Let the new expression end if its a function expression start

This commit is contained in:
Sheetal Nandi 2017-04-24 16:03:35 -07:00
Родитель 999acab7ac
Коммит 9f6676aa2d
5 изменённых файлов: 180 добавлений и 3 удалений

Просмотреть файл

@ -1512,7 +1512,7 @@ repository:
begin: (?<!\.|\$)\b(new)\b(?!\$|\.)
beginCaptures:
'1': { name: keyword.operator.new.ts }
end: (?<=\))|(?=[;),}]|$|((?<!\.|\$)\bnew\b(?!\$|\.)))
end: (?<=\))|(?=[;),}]|$|((?<!\.|\$)\bnew\b(?!\$|\.))|((?<!\.|\$)\bfunction((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))
patterns:
- include: '#paren-expression'
- include: '#class-or-interface-declaration'

Просмотреть файл

@ -4133,7 +4133,7 @@
</dict>
</dict>
<key>end</key>
<string>(?&lt;=\))|(?=[;),}]|$|((?&lt;!\.|\$)\bnew\b(?!\$|\.)))</string>
<string>(?&lt;=\))|(?=[;),}]|$|((?&lt;!\.|\$)\bnew\b(?!\$|\.))|((?&lt;!\.|\$)\bfunction((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))</string>
<key>patterns</key>
<array>
<dict>

Просмотреть файл

@ -4079,7 +4079,7 @@
</dict>
</dict>
<key>end</key>
<string>(?&lt;=\))|(?=[;),}]|$|((?&lt;!\.|\$)\bnew\b(?!\$|\.)))</string>
<string>(?&lt;=\))|(?=[;),}]|$|((?&lt;!\.|\$)\bnew\b(?!\$|\.))|((?&lt;!\.|\$)\bfunction((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))</string>
<key>patterns</key>
<array>
<dict>

Просмотреть файл

@ -0,0 +1,168 @@
original file
-----------------------------------
let storeSomeObj = new function () {
this.hasNoColorization = function () {
let butThisDoes = "yay";
}
let noColorHereEither = "I'm not colorized";
}
let butOutSide = "all color is back to normal!";
-----------------------------------
Grammar: TypeScript.tmLanguage
-----------------------------------
>let storeSomeObj = new function () {
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^^^^^^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts
^^^
source.ts meta.var.expr.ts new.expr.ts keyword.operator.new.ts
^
source.ts meta.var.expr.ts new.expr.ts
^^^^^^^^
source.ts meta.var.expr.ts meta.function.expression.ts storage.type.function.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
> this.hasNoColorization = function () {
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
^^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts variable.language.this.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts punctuation.accessor.ts
^^^^^^^^^^^^^^^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts entity.name.function.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
^^^^^^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts storage.type.function.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts
> let butThisDoes = "yay";
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts
^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts
^^^^^^^^^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts string.quoted.double.ts punctuation.definition.string.begin.ts
^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts string.quoted.double.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts meta.var.expr.ts string.quoted.double.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts punctuation.terminator.statement.ts
^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts
> }
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
>
^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
> let noColorHereEither = "I'm not colorized";
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts
^^^^^^^^^^^^^^^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts string.quoted.double.ts punctuation.definition.string.begin.ts
^^^^^^^^^^^^^^^^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts string.quoted.double.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts string.quoted.double.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts punctuation.terminator.statement.ts
^^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
> }
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts
^
source.ts meta.var.expr.ts meta.function.expression.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.var.expr.ts
>
^^
source.ts
> let butOutSide = "all color is back to normal!";
^
source.ts
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^^^^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts string.quoted.double.ts punctuation.definition.string.begin.ts
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
source.ts meta.var.expr.ts string.quoted.double.ts
^
source.ts meta.var.expr.ts string.quoted.double.ts punctuation.definition.string.end.ts
^
source.ts punctuation.terminator.statement.ts

Просмотреть файл

@ -0,0 +1,9 @@
let storeSomeObj = new function () {
this.hasNoColorization = function () {
let butThisDoes = "yay";
}
let noColorHereEither = "I'm not colorized";
}
let butOutSide = "all color is back to normal!";