mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dollars can't be escaped in slashy strings
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -134,7 +134,7 @@ mIDENT_NOBUCKS = {mLETTER} ({mLETTER} | {mDIGIT})*
|
||||
|
||||
mSTRING_NL = {mONE_NL}
|
||||
mSTRING_ESC = \\ [^] | \\ ({WHITE_SPACE})+ (\n|\r)
|
||||
mREGEX_ESC = \\ "$"
|
||||
mREGEX_ESC = \\ "/"
|
||||
| "\\""u"{mHEX_DIGIT}{4}
|
||||
| "\\" [0..3] ([0..7] ([0..7])?)?
|
||||
| "\\" [4..7] ([0..7])?
|
||||
@@ -142,8 +142,7 @@ mREGEX_ESC = \\ "$"
|
||||
|
||||
/// Regexes ////////////////////////////////////////////////////////////////
|
||||
|
||||
ESCAPED_REGEX_SEP = \\ "/"
|
||||
mREGEX_CONTENT = ({mREGEX_ESC} | {ESCAPED_REGEX_SEP} | [^"/""$"])+
|
||||
mREGEX_CONTENT = ({mREGEX_ESC} | [^"/""$"])+
|
||||
|
||||
mDOLLAR_SLASH_REGEX_CONTENT = ([^\/\$] | \/[^\/\$] )+
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'bugaga' ==~ /abc \${do "def ${a+b}} fgh$st ${frg./sdf/(5)} /
|
||||
'bugaga' ==~ /abc \${do "def ${a+b}"} fgh$st ${frg./sdf/(5)} /
|
||||
-----
|
||||
Groovy script
|
||||
Logical expression
|
||||
@@ -9,21 +9,36 @@ Groovy script
|
||||
PsiWhiteSpace(' ')
|
||||
Compound regular expression
|
||||
PsiElement(regex begin)('/')
|
||||
PsiElement(regex content)('abc \${do "def ')
|
||||
PsiElement(regex content)('abc \')
|
||||
GString injection
|
||||
PsiElement($)('$')
|
||||
Closable block
|
||||
PsiElement({)('{')
|
||||
Parameter list
|
||||
<empty list>
|
||||
Additive expression
|
||||
Reference expression
|
||||
PsiElement(identifier)('a')
|
||||
PsiElement(+)('+')
|
||||
Reference expression
|
||||
PsiElement(identifier)('b')
|
||||
PsiErrorElement:Wrong statement
|
||||
<empty list>
|
||||
PsiElement(do)('do')
|
||||
PsiWhiteSpace(' ')
|
||||
Compound Gstring
|
||||
PsiElement(Gstring begin)('"')
|
||||
PsiElement(Gstring content)('def ')
|
||||
GString injection
|
||||
PsiElement($)('$')
|
||||
Closable block
|
||||
PsiElement({)('{')
|
||||
Parameter list
|
||||
<empty list>
|
||||
Additive expression
|
||||
Reference expression
|
||||
PsiElement(identifier)('a')
|
||||
PsiElement(+)('+')
|
||||
Reference expression
|
||||
PsiElement(identifier)('b')
|
||||
PsiElement(})('}')
|
||||
PsiElement(Gstring end)('"')
|
||||
PsiElement(})('}')
|
||||
PsiElement(regex content)('} fgh')
|
||||
PsiElement(regex content)(' fgh')
|
||||
GString injection
|
||||
PsiElement($)('$')
|
||||
Reference expression
|
||||
|
||||
@@ -7,9 +7,17 @@ Groovy script
|
||||
PsiWhiteSpace(' ')
|
||||
Arguments
|
||||
PsiElement(()('(')
|
||||
Literal
|
||||
GroovyASTPsiElementImpl(regex literal)
|
||||
PsiElement(regex begin)('/')
|
||||
PsiElement(regex content)('a\${2}')
|
||||
PsiElement(regex end)('/')
|
||||
Compound regular expression
|
||||
PsiElement(regex begin)('/')
|
||||
PsiElement(regex content)('a\')
|
||||
GString injection
|
||||
PsiElement($)('$')
|
||||
Closable block
|
||||
PsiElement({)('{')
|
||||
Parameter list
|
||||
<empty list>
|
||||
Literal
|
||||
PsiElement(Integer)('2')
|
||||
PsiElement(})('}')
|
||||
PsiElement(regex end)('/')
|
||||
PsiElement())(')')
|
||||
Reference in New Issue
Block a user