-
Notifications
You must be signed in to change notification settings - Fork 18
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
Adding custom symbols doesn't work (internal symbol container issue) #10
Comments
…s fixed in upstream repo
Hello,
yep, the
I get the same exception when I run your code example.
If this is true then your solution is only a workaround, right? The acutal issue still exist. I will try to figure out why there are two instances of a class that is meant to be soem kind of singleton (at least that's what i remeber right now). |
@chriskonnertz Sounds about true — if there's a singleton mechanism involved, it doesn't seem to work. ;) |
@chriskonnertz Besides: nice and useful piece of code — I'm "misusing" it for parsing CSS |
I will merge your solution. It makes sense to use the
Thank you!
I do not think you are "misusing" it ;) |
Fix symbol container bug / custom symbol addition (closes #10)
First of all thanks for this nice and thoughtful piece of software! I'm about trying to use it for a new library I'm working on and it looks like it could serve me well for a particular use case. However, it looks like I discovered an issue with adding custom symbols (tl;dr: it doesn't work at the moment ...). Consider this test scenario (namespaces & comments omitted for the sake of brevity):
I would expect this to yield just
1
. However, I get this exception (because the parser cannot find thetest()
function):Changing this line to the following fixes the problem:
It looks like
$this->container->get('stringcalc_symbolcontainer')
is different from$this->symbolContainer
despite this assignment.I can avoid this bug temporarily by modifying the source as shown but it would be great to have the issue fixed upstream asap as automatic build tests are failing as well. (By the way you could also add to the documentation the fact that you need to pass a
StringHelper
instance to the function object constructor — just missing this in the docs).The text was updated successfully, but these errors were encountered: