-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Allow query parameters starting with an underscore #717
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-2544 We use Jira to track the state of pull requests and the versions they got |
@hackedd please add tests that would fail without this patch |
The test should be in the unit tests of the lexer, not in the functional tests |
Allow query parameters starting with an underscore
@guilhermeblanco do we actually want this as valid parameter name? I am not sure |
I was asking myself the same question. Unless someone has good arguments my On Sat, Aug 10, 2013 at 6:13 PM, Benjamin Eberlei
|
@guilhermeblanco why "should"? This parameters don't match to php variable names anywhere, i don't see the relation. This only adds another way for something that already works when using sane identifier naming rules |
@beberlei some people (me included) like to use the parameter name as the same as the variable name. It's sane (and also seems to be supported by HQL) to support same identifiers as variables. |
Using a query parameter of which the name starts with an underscore results in a QueryException. For example:
Results in:
This happens because of a bug in the Lexer, which recognizes
:_name
as two tokens (the:
as the start of a input parameter,_name
as an identifier). The attached patch changes the regular expression for input parameters to allow identifiers starting with a letter or underscore.