You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently all events, functions, etc require a trigger: section to execute the code.
Even if the trigger: section is the only member, it's still required.
Describe the solution you'd like
Make trigger: implicit if there are no other members.
Example:
on load:
trigger:
print "hello"
Would become:
on load:
print "hello"
Describe alternatives you've considered
I've thought about making a preprocessor to automatically generate trigger: sections when needed.
The text was updated successfully, but these errors were encountered:
Make trigger: implicit if there are no other members.
I'm not entirely sure what you mean by this: if you mean for something that has no other possible entries (I think events don't yet) then I don't really want to do this because I intend everything to have a lot more available entries for metadata (e.g. annotation-replacers) and micro-controlling tasks, plus any extra bits that third-party libraries or DSL versions would like to add
If, on the other hand, you mean if the user has only put a trigger entry (even though there are others available, e.g. in a simple function) -
I considered this at the start but decided against it on the grounds that it makes parsing very muddy.
E.g. if the parser defaults to looking for CODE_BODY elements if the line is not a MEMBER_BODY element it could start incorrectly compiling code that was in fact a mistake or an indentation error.
I've generally been in favour of keeping things quite rigid so that it's easier to know what goes where and what something is doing, however I'll leave this open in case it gets more support from other people and I'll consider it. :)
Is your feature request related to a problem? Please describe.
Currently all events, functions, etc require a
trigger:
section to execute the code.Even if the
trigger:
section is the only member, it's still required.Describe the solution you'd like
Make
trigger:
implicit if there are no other members.Example:
Would become:
Describe alternatives you've considered
I've thought about making a preprocessor to automatically generate
trigger:
sections when needed.The text was updated successfully, but these errors were encountered: