-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
server/utils: fix Bison directives #72
Conversation
This didn't get tested properly in Travis because buildconf suppresses regeneration of the parser sources by default. I fixed this in 2dd0046 so if you rebase to current trunk you'll get one CI job testing it properly. |
Non terminal cannot have string aliases (only tokens appear in error messages). %token is used to define tokens, and %nterm non terminals. The hidden %type (which was only recently documented) is meant for both tokens and non terminals. Yet %type <foo> expr "expression" is actually more or less equivalent to %nterm <foo> expr %token <foo> "expression" which is clearly not the intention of the author here. * server/util_expr_parse.y: Remove useless string-literal only tokens. Prefer %nterm to %type to avoid this error.
Hi @notroj |
messages). %token is used to define tokens, and %nterm non terminals. The hidden %type (which was only recently documented) is meant for both tokens and non terminals. Yet %type <foo> expr "expression" is actually more or less equivalent to %nterm <foo> expr %token <foo> "expression" which is clearly not the intention of the author here. * server/util_expr_parse.y: Remove useless string-literal only tokens. Prefer %nterm to %type to avoid this error. PR: #72 Submitted by: Akim Demaille <akim.demaille gmail.com> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1869724 13f79535-47bb-0310-9956-ffa450edef68
Thanks for the contribution @akimd! I've merged this to trunk, but I'll have to ask you to close the PR since I can't do it myself. |
Thanks! |
As an extension to POSIX Yacc, Bison's %type accepts tokens. Unfortunately with string literals as implicit tokens, this is misleading, and led some users to write %type <exVal> cond "condition" believing that "condition" would be associated to the 'cond' nonterminal (see apache/httpd#72). * doc/bison.texi: Promote %nterm rather than %type to declare the type of nonterminals.
As an extension to POSIX Yacc, Bison's %type accepts tokens. Unfortunately with string literals as implicit tokens, this is misleading, and led some users to write %type <exVal> cond "condition" believing that "condition" would be associated to the 'cond' nonterminal (see apache/httpd#72). * doc/bison.texi: Promote %nterm rather than %type to declare the type of nonterminals.
As an extension to POSIX Yacc, Bison's %type accepts tokens. Unfortunately with string literals as implicit tokens, this is misleading, and led some users to write %type <exVal> cond "condition" believing that "condition" would be associated to the 'cond' nonterminal (see apache/httpd#72). * doc/bison.texi: Promote %nterm rather than %type to declare the type of nonterminals.
Non terminal cannot have string aliases (only tokens appear in error
messages). %token is used to define tokens, and %nterm non terminals.
The hidden %type (which was only recently documented) is meant for
both tokens and non terminals. Yet
is actually more or less equivalent to
which is clearly not the intention of the author here.
Prefer %nterm to %type to avoid this error.