-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Cannot access properties from object references using <current()> #761
Comments
This may be a bug in the Lexer. Frankly unlikely to be fixed unless someone is willing to check it. #733 would be another way to really fix those kind of problems as well. Could you however check the resutl in 2.x? |
|
So I have added this regex to Stack trace:
|
To deal with nested functions, I'm using a FunctionTokenizer to "flatten" a function. Otherwise it's a nightmare to detect nested functions. In your case however, it seems like there's a bug. I'll try to apply that regex and see what we can do about it but I'm not sure when I can do that. Alternatively, you need to debug that step by step with breakpoints (use xdebug for it) |
Hmmm dang. The only issue is that it is including the reference in the function string which it shouldn't be. It should probably be splitting at the opening arrow as well maybe? |
I'm not really sure what the issue is, the tokenized function is ok, it's probably a bug in FunctionTreeTokenizer which maybe thinks something wrong due to the |
any progress ? |
I am taking a look at this again. This is the test fixture I am using.
I don't know exactly what the cause it. Doesn't seem like it is the FunctionTreeTokenzier. I notice though in hits the PropertyReferenceTokenParser in which it has the value When it attempts to parse this value it goes through all the lexers and gets to the FunctionLexer which checks if it's tokenized which returns false because the If I make it pass the |
Yeah, I'm not really sure on how to fix it tbh. To me it looks like we are hitting the limits of the in-house lexer a good way to tackle the issue would be to replace it by a real lexer like HoaCompiler (cf. #712). But lexer limitations are a known issue, it was already the case in 2.x (although not exactly the same ones) to be fair so it has been an issue for a long time already. I can suggest:
|
Using |
I think we can make the case with |
That would be much better than not having that functionality at all. Just a matter of how do we do so now. |
Allow to use `$current` variable outside of the identity context and more peticuliarly allow to use expressions such as `@user$current`. Closes nelmio#761
Allow to use `$current` variable outside of the identity context and more peticuliarly allow to use expressions such as `@user$current`. Closes #761
Thank you for implementing this fix. Helped me out today. |
Doing this:
Throws exception:
Could not lex the value ">type".
But this works:
Was working in 2.x.
The text was updated successfully, but these errors were encountered: