borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
558 stars 18 forks source link

Comment is not allowed before default value in function definition #166

Closed StreetStrider closed 6 years ago

StreetStrider commented 6 years ago

Found a minor thing. Looks like comment is not allowed inside round brackets in function definition it is before default value.

function f (x /**/ = 1) { var y = 2 }

Where var is destyled. I tried to feed that to Node and it works OK, so I presume the syntax is correct, thus highlighting must follow.

borela commented 6 years ago

Fixed in https://github.com/borela/naomi/releases/tag/v4.1.3;

For now, the logic around parameters is a bit complex because I am enveloping the parameter and default value with the scope meta.function.parameter.optional but I am not sure this meta scope is necessary.

StreetStrider commented 6 years ago

:+1: