moonscript icon indicating copy to clipboard operation
moonscript copied to clipboard

assignment in line decorators

Open ghost opened this issue 7 years ago • 0 comments

Would it be possible to add conditional assignment to line decorators? For example, I can do option 1: fcolor=message\match "<%w*>" message=message\gsub "<%->", fcolor if fcolor

Or option 2: message=message\gsub "<%->", fcolor if (->fcolor=message\match "<%w*>" )!

But option 2 creates an anonymous function. The following would be better:

message=message\gsub "<%->", fcolor if fcolor=message\match "<%w*>" compiled to the same output as if fcolor=message\match "<%w*>" then message=message\gsub "<%->", fcolor

ghost avatar Nov 17 '18 22:11 ghost