-
Notifications
You must be signed in to change notification settings - Fork 30
Add 'only-explicit-rules' option to display explicit grammar rules #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I think |
|
Thank you. I certainly agree with outputting as much information as possible in trace. I would be happy to see only the grammar rules and exclude actions, when I research structure of grammar rule. What do you think about adding an option to trace, for example, like |
|
I agree to add new option to [Added] |
This PR, midrule actions should not be included when tracing rules. Before: ``` ❯ exe/lrama --trace=rules ./spec/fixtures/common/basic.y Grammar rules: $accept -> program EOI program -> class program -> '+' strings_1 program -> '-' strings_2 class -> keyword_class tSTRING keyword_end $@1 -> ε $@2 -> ε class -> keyword_class $@1 tSTRING '!' keyword_end $@2 $@3 -> ε $@4 -> ε class -> keyword_class $@3 tSTRING '?' keyword_end $@4 strings_1 -> string_1 strings_2 -> string_1 strings_2 -> string_2 string_1 -> string string_2 -> string '+' string -> tSTRING unused -> tNUMBER ``` After: ``` ❯ exe/lrama --trace=rules ./spec/fixtures/common/basic.y Grammar rules: $accept -> program EOI program -> class program -> '+' strings_1 program -> '-' strings_2 class -> keyword_class tSTRING keyword_end class -> keyword_class tSTRING '!' keyword_end class -> keyword_class tSTRING '?' keyword_end strings_1 -> string_1 strings_2 -> string_1 strings_2 -> string_2 string_1 -> string string_2 -> string '+' string -> tSTRING unused -> tNUMBER ```
e05bcf8 to
5a4901b
Compare
|
@yui-knk Thank you for your suggestion! The |
This PR, add 'only-explicit-rules' option to display explicit grammar rules.
--trace=rules:
--trace=only-explicit-rules: