diff --git a/Syntaxes/JavaScript.plist b/Syntaxes/JavaScript.plist index b4a0ea9..2eab6c7 100644 --- a/Syntaxes/JavaScript.plist +++ b/Syntaxes/JavaScript.plist @@ -3,9 +3,19 @@ foldingStartMarker - ^.*(\bfunction\s*(\w+\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$)|(={\s*$)|(\({$) + (?x)^ + # Yes *+ Open ( Blank |Comments | (No Paren | String) | String | (Nested Parens ) )*+ + (?> \g<yesS>*+ \[ (?<yesS> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noS>[^\[\]'"/]) | (?<str> '(\\'|[^'])*+' | "(\\"|[^"])*+" | /(\\/|[^/])*+/) | (?<squar> \[ \g<yesS>*+ \] ) )*+ + | \g<yesR>*+ \( (?<yesR> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noR>[^\(\)'"/]) | \g<str> | (?<round> \( \g<yesR>*+ \) ) )*+ + | \g<yesC>*+ \{ (?<yesC> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noC>[^\{\}'"/]) | \g<str> | (?<curly> \{ \g<yesC>*+ \} ) )*+ + )$ foldingStopMarker - (^\s*\})|(^}\)); + (?x)^ + # ( Blank |Comments | (No Paren | String) | String | (Nested Parens ) )*+ Close Yes *+ + (?> (?<yesS> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noS>[^\[\]'"/]) | (?<str> '(\\'|[^'])*+' | "(\\"|[^"])*+" | /(\\/|[^/])*+/) | (?<squar> \[ \g<yesS>*+ \] ) )*+ \] \g<yesS>*+ + | (?<yesR> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noR>[^\(\)'"/]) | \g<str> | (?<round> \( \g<yesR>*+ \) ) )*+ \) \g<yesR>*+ + | (?<yesC> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noC>[^\{\}'"/]) | \g<str> | (?<curly> \{ \g<yesC>*+ \} ) )*+ \} \g<yesC>*+ + )$ keyEquivalent ^~J name