mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more special keyword characters (IDEA-82441)
This commit is contained in:
+1
-1
@@ -66,7 +66,7 @@ public class KeywordParser extends TokenParser {
|
||||
word = word.replace("\\", "\\\\");
|
||||
for (int i = 0; i < word.length(); i++) {
|
||||
char ch = word.charAt(i);
|
||||
if ("-*+?$%^.()".indexOf(ch) >= 0) esc.append('\\');
|
||||
if ("-*+?$%^.(){}[]|".indexOf(ch) >= 0) esc.append('\\');
|
||||
esc.append(ch);
|
||||
}
|
||||
word = esc.toString();
|
||||
|
||||
+6
-1
@@ -306,7 +306,8 @@ CHARACTER (')')
|
||||
table.addKeyword1("b-c")
|
||||
table.addKeyword2("d#")
|
||||
table.addKeyword2("e")
|
||||
doTest table, 'a* b-c d# e-', '''\
|
||||
table.addKeyword2("foo{}")
|
||||
doTest table, 'a* b-c d# e- e foo{}', '''\
|
||||
KEYWORD_1 ('a*')
|
||||
WHITESPACE (' ')
|
||||
KEYWORD_1 ('b-c')
|
||||
@@ -314,6 +315,10 @@ WHITESPACE (' ')
|
||||
KEYWORD_2 ('d#')
|
||||
WHITESPACE (' ')
|
||||
IDENTIFIER ('e-')
|
||||
WHITESPACE (' ')
|
||||
KEYWORD_2 ('e')
|
||||
WHITESPACE (' ')
|
||||
KEYWORD_2 ('foo{}')
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user