Dont treat start of new line as regex since it could be continuing expression
Fixes #198
This commit is contained in:
Родитель
aa5eecd502
Коммит
9e2430a063
|
@ -1074,7 +1074,7 @@ repository:
|
|||
|
||||
regex:
|
||||
name: string.regex.ts
|
||||
begin: (?<=[=(:,\[?+!]|^|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)
|
||||
begin: (?<=[=(:,\[?+!]|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)
|
||||
beginCaptures:
|
||||
'1': {name: punctuation.definition.string.begin.ts}
|
||||
end: (/)([gimuy]*)
|
||||
|
|
|
@ -2819,7 +2819,7 @@
|
|||
<key>regex</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<=[=(:,\[?+!]|^|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)</string>
|
||||
<string>(?<=[=(:,\[?+!]|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
|
|
@ -1063,7 +1063,7 @@ repository:
|
|||
|
||||
regex:
|
||||
name: string.regex.tsx
|
||||
begin: (?<=[=(:,\[?+!]|^|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)
|
||||
begin: (?<=[=(:,\[?+!]|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)
|
||||
beginCaptures:
|
||||
'1': {name: punctuation.definition.string.begin.tsx}
|
||||
end: (/)([gimuy]*)
|
||||
|
|
|
@ -3205,7 +3205,7 @@
|
|||
<key>regex</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<=[=(:,\[?+!]|^|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)</string>
|
||||
<string>(?<=[=(:,\[?+!]|return|case|=>|&&|\|\||\*\/)\s*(/)(?![/*+{}?])(?=.*/)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
let a = 0, b = 0, c = 0;
|
||||
let value = a / b
|
||||
/ c;
|
||||
let value2 = a / b
|
||||
/ c * a + b / a / b / c;
|
||||
let value2 = a / b / c * a + b / a / b / c;
|
||||
-----------------------------------
|
||||
|
||||
>let a = 0, b = 0, c = 0;
|
||||
^^^
|
||||
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 variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts constant.numeric.decimal.ts
|
||||
^^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts constant.numeric.decimal.ts
|
||||
^^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts constant.numeric.decimal.ts
|
||||
^^^
|
||||
source.ts
|
||||
>let value = a / b
|
||||
^^^
|
||||
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 variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
> / c;
|
||||
^^^^
|
||||
source.ts
|
||||
^
|
||||
source.ts keyword.operator.arithmetic.ts
|
||||
^^^^^
|
||||
source.ts
|
||||
>let value2 = a / b
|
||||
^^^
|
||||
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 variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
> / c * a + b / a / b / c;
|
||||
^^^^
|
||||
source.ts
|
||||
^
|
||||
source.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts
|
||||
^
|
||||
source.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts
|
||||
^
|
||||
source.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts
|
||||
^
|
||||
source.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts
|
||||
^
|
||||
source.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts
|
||||
^
|
||||
source.ts keyword.operator.arithmetic.ts
|
||||
^^^^^
|
||||
source.ts
|
||||
>let value2 = a / b / c * a + b / a / b / c;
|
||||
^^^
|
||||
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 variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.arithmetic.ts
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^^
|
||||
source.ts
|
|
@ -0,0 +1,6 @@
|
|||
let a = 0, b = 0, c = 0;
|
||||
let value = a / b
|
||||
/ c;
|
||||
let value2 = a / b
|
||||
/ c * a + b / a / b / c;
|
||||
let value2 = a / b / c * a + b / a / b / c;
|
Загрузка…
Ссылка в новой задаче