Skip to content
Permalink
Browse files
Java: Added char token (#3217)
  • Loading branch information
RunDevelopment committed Dec 5, 2021
1 parent fa55492 commit 0a9f909ca5fdf59a92b3bf636f6c366f2a60e1bc
@@ -21,6 +21,11 @@
};

Prism.languages.java = Prism.languages.extend('clike', {
'string': {
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
lookbehind: true,
greedy: true
},
'class-name': [
className,
{
@@ -52,6 +57,10 @@
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
greedy: true,
alias: 'string'
},
'char': {
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
greedy: true
}
});

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,11 @@
'A'
'\n'
'\u0041'

----------------------------------------------------

[
["char", "'A'"],
["char", "'\\n'"],
["char", "'\\u0041'"]
]
@@ -83,7 +83,7 @@ if (a<6&&b>6){}
["punctuation", "("],
["number", "12.2585"],
["punctuation", ","],
["string", "'C'"],
["char", "'C'"],
["punctuation", ")"],
["punctuation", ";"],

@@ -1,3 +1,4 @@
""
"foo"
"\"foo\""

@@ -20,6 +21,7 @@ String empty = """
----------------------------------------------------

[
["string", "\"\""],
["string", "\"foo\""],
["string", "\"\\\"foo\\\"\""],

@@ -0,0 +1,13 @@
'a'
'\u0041'
'\n'
'\t'

----------------------------------------------------

[
["char", "'a'"],
["char", "'\\u0041'"],
["char", "'\\n'"],
["char", "'\\t'"]
]
@@ -1,8 +1,3 @@
'a'
'\u0041'
'\n'
'\t'

""
"fo\"obar"

@@ -17,12 +12,9 @@ bar"""
----------------------------------------------------

[
["string", "'a'"],
["string", "'\\u0041'"],
["string", "'\\n'"],
["string", "'\\t'"],
["string", "\"\""],
["string", "\"fo\\\"obar\""],

["triple-quoted-string", "\"\"\"fo\"o\r\nbar\"\"\""],
["triple-quoted-string", "\"\"\"fo\"o\r\n// comment\r\nbar\"\"\""],
["string", "\"foo /* comment */ bar\""],

0 comments on commit 0a9f909

Please sign in to comment.