-
Notifications
You must be signed in to change notification settings - Fork 52
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
Enable property macros on grammar.flag #941
Comments
Can you show the if/else macro that you are currently using? I am a bit confused on what you are trying to achieve. |
@alexanderpann For example, imagine you want to generate something like a Lisp Unquote that has a boolean splice property. To display whether or not it is a splice unquote, a grammar flag with the text
Since this is not possible, on can use an
and define the condition in the inspector for the IF/ELSE macro. This has disadvantages:
|
I still don't understand why go can't just set the boolean value, so I can just give some hints. If you want to automatically set the value, you could have a listener that changes the value automatically. I could also change the code so that not the raw property value is used but also the getter of the property is evaluated. Then you can derive the value by a condition. If you want to prevent users from typing the flag in certain situations, you can set the substitute and side transformation condition in the flag cell. |
I'm not sure if you understood what I meant, because you are writing about a listener to change a value and side transformations and I guess these things ar about when you want to change a value based on an event, in this case, when a user uses the editor. But I'm talking about the programmatic setting of the value during generation, where the language using the |
When writing a generator that targets a language that uses
grammar.flag
, it woud be really nice to be able to set the status of the flag using a property macro, just like you would when using the boolean value in the editor itself. Because as it is now, you have to create anIF/ELSE
macro with two versions of the node which introduces duplication and clutter.The text was updated successfully, but these errors were encountered: