moonscript icon indicating copy to clipboard operation
moonscript copied to clipboard

Syntax caveats when using List Comprehensions

Open strait opened this issue 6 years ago • 0 comments

A simple example has me transforming a list of lists: [[trans x for x in sub] for sub in list]

Preliminary testing does show this parsing as a comprehension instead of a longstring. However, most syntax highlighters are likely not going to be sophisticated enough to determine this. Adding a space at the front between the outer and inner comprehension will resolve the syntax ([ [trans x...), but will require additional usage direction for list comprehensions.

strait avatar Oct 22 '19 23:10 strait