-
Notifications
You must be signed in to change notification settings - Fork 19
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
Passing a string with commas as a macro argument confuses the parser #23
Comments
Yes, we've had this problem in the past in our projects. I confirm this issue. |
Hmmm...works for me without problems... |
It seems to work okay for me at the moment, but I believe you that this is sometimes an issue. At the beginning of the compiling process all strings in the script stored and each string is replaced with a number so that they can be put back in further down the process. I'm not sure on the exact circumstances, but I think these string placeholders are sometimes not made. This could be why the comma in strings work correct only sometimes. I will have look about fixing this. |
I don't know if it helps, but for us it always happened because we used a macro that did a control declaration and help text in one go. Whenever we put commas in the string for the help text argument, it would break:
Granted we've now adopted the better control methods in the updated SublimeKSP (the "control -> par := value" functionality is AWESOME!), so we don't deal with it anymore. |
Oh, awesome indeed! I didn't even know about this. I looked again at the documentation and couldn't find it mentioned anywhere. There's one snippet of code in the section about multidimensional UI arrays that quietly uses this syntax and I missed it. Maybe I'm blind. :) |
It is great! This is from Nils' features, but I don't believe it is documented anywhere. I'll quickly add it to the wiki. |
You find it documented in http://nilsliberg.se/ksp/history.txt Search for "Added new control parameter access feature (see example 3)" |
Fixed in the latest feature merge |
If you have a macro that accepts an argument that's used as a string and then pass a string containing a comma, the parser confuses the commas as separate arguments and complains about incorrect number of arguments.
Test case:
Functions don't have this problem, and in fact can mask the macro issue through indirection:
The text was updated successfully, but these errors were encountered: