use prism-tomorrow.css

This commit is contained in:
CyC2018
2018-12-19 14:09:39 +08:00
parent 0f00bcacaf
commit e9e604e6a7
1747 changed files with 100462 additions and 0 deletions

View File

@ -0,0 +1,21 @@
(true)
(false)
----------------------------------------------------
[
["expression", [
["punctuation", "("],
["boolean", "true"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["boolean", "false"],
["punctuation", ")"]
]]
]
----------------------------------------------------
Checks for booleans inside expressions.

View File

@ -0,0 +1,68 @@
^$
^^
^;
^@
^(
^)
^[
^]
^{
^}
^"
^'
^:
^#
^#20
^#af
^#AF
^^date::now
^$foobar
<div class="foo^^bar">
----------------------------------------------------
[
["escape", "^$"],
["escape", "^^"],
["escape", "^;"],
["escape", "^@"],
["escape", "^("],
["escape", "^)"],
["escape", "^["],
["escape", "^]"],
["escape", "^{"],
["escape", "^}"],
["escape", "^\""],
["escape", "^'"],
["escape", "^:"],
["escape", "^#"],
["escape", "^#20"],
["escape", "^#af"],
["escape", "^#AF"],
["escape", "^^"], "date::now\r\n",
["escape", "^$"], "foobar\r\n\r\n",
["tag", [
["tag", [
["punctuation", "<"],
"div"
]],
["attr-name", ["class"]],
["attr-value", [
["punctuation", "="],
["punctuation", "\""],
"foo",
["escape", "^^"],
"bar",
["punctuation", "\""]
]],
["punctuation", ">"]
]]
]
----------------------------------------------------
Checks for escapes.

View File

@ -0,0 +1,58 @@
((3-(9-2))*4)
^eval(4+2)
<div class="foo-^eval(4+2)">
----------------------------------------------------
[
["expression", [
["punctuation", "("],
["punctuation", "("],
["number", "3"],
["operator", "-"],
["punctuation", "("],
["number", "9"],
["operator", "-"],
["number", "2"],
["punctuation", ")"],
["punctuation", ")"],
["operator", "*"],
["number", "4"],
["punctuation", ")"]
]],
["keyword", "^eval"],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "+"],
["number", "2"],
["punctuation", ")"]
]],
["tag", [
["tag", [
["punctuation", "<"],
"div"
]],
["attr-name", ["class"]],
["attr-value", [
["punctuation", "="],
["punctuation", "\""],
"foo-",
["keyword", "^eval"],
["expression", [
["punctuation", "("],
["number", "4"], ["operator", "+"], ["number", "2"],
["punctuation", ")"]
]],
["punctuation", "\""]
]],
["punctuation", ">"]
]]
]
----------------------------------------------------
Checks for expressions, up to 3 levels of depth.

View File

@ -0,0 +1,48 @@
@foo[]
@GET_foo[]
@SET_foo[]
^foo[]
^Foo::create[]
^date::now[]
^foo_bar.menu{}
(^foo[])
<div class="^foo[]">
----------------------------------------------------
[
["function", ["@foo"]], ["punctuation", "["], ["punctuation", "]"],
["function", ["@", ["keyword", "GET_"], "foo"]], ["punctuation", "["], ["punctuation", "]"],
["function", ["@", ["keyword", "SET_"], "foo"]], ["punctuation", "["], ["punctuation", "]"],
["function", ["^foo"]], ["punctuation", "["], ["punctuation", "]"],
["function", ["^Foo", ["punctuation", "::"], "create"]], ["punctuation", "["], ["punctuation", "]"],
["function", ["^date", ["punctuation", "::"], "now"]], ["punctuation", "["], ["punctuation", "]"],
["function", ["^foo_bar", ["punctuation", "."], "menu"]], ["punctuation", "{"], ["punctuation", "}"],
["expression", [
["punctuation", "("],
["function", ["^foo"]], ["punctuation", "["], ["punctuation", "]"],
["punctuation", ")"]
]],
["tag", [
["tag", [
["punctuation", "<"],
"div"
]],
["attr-name", ["class"]],
["attr-value", [
["punctuation", "="],
["punctuation", "\""],
["function", ["^foo"]], ["parser-punctuation", "["], ["parser-punctuation", "]"],
["punctuation", "\""]
]],
["punctuation", ">"]
]]
]
----------------------------------------------------
Checks for functions and methods.

View File

@ -0,0 +1,70 @@
^case
^eval
^for
^if
^switch
^throw
@BASE
@CLASS
@GET
@GET_DEFAULT
@OPTIONS
@SET_DEFAULT
@USE
(^eval(2+2))
<div class="^if($foo){bar}{baz}">
----------------------------------------------------
[
["keyword", "^case"],
["keyword", "^eval"],
["keyword", "^for"],
["keyword", "^if"],
["keyword", "^switch"],
["keyword", "^throw"],
["keyword", "@BASE"],
["keyword", "@CLASS"],
["keyword", "@GET"],
["keyword", "@GET_DEFAULT"],
["keyword", "@OPTIONS"],
["keyword", "@SET_DEFAULT"],
["keyword", "@USE"],
["expression", [
["punctuation", "("],
["keyword", "^eval"],
["punctuation", "("],
["number", "2"], ["operator", "+"], ["number", "2"],
["punctuation", ")"],
["punctuation", ")"]
]],
["tag", [
["tag", [
["punctuation", "<"],
"div"
]],
["attr-name", ["class"]],
["attr-value", [
["punctuation", "="],
["punctuation", "\""],
["keyword", "^if"],
["expression", [
["punctuation", "("], ["variable", ["$foo"]], ["punctuation", ")"]
]],
["parser-punctuation", "{"], "bar", ["parser-punctuation", "}"],
["parser-punctuation", "{"], "baz", ["parser-punctuation", "}"],
["punctuation", "\""]
]],
["punctuation", ">"]
]]
]
----------------------------------------------------
Checks for keywords.

View File

@ -0,0 +1,51 @@
(42)
(3.14159)
(3e5)
(0.8E-12)
(3.9e+2)
(0xbadface)
(0XBADFACE)
----------------------------------------------------
[
["expression", [
["punctuation", "("],
["number", "42"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "3.14159"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "3e5"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "0.8E-12"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "3.9e+2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "0xbadface"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "0XBADFACE"],
["punctuation", ")"]
]]
]
----------------------------------------------------
Checks for numbers inside expressions.

View File

@ -0,0 +1,257 @@
(~42)
(+42)
(-42)
(4/2)
(9\2)
(9%2)
(!true)
(4!|2)
(true!||false)
(4!=2)
(4&2)
(true&&false)
(4|2)
(true||false)
(4==2)
(4<2)
(4<=2)
(4<<2)
(4>2)
(4>=2)
(4>>2)
(-f "foo")
(-d "foo")
(def $foo)
(4 eq 2)
(4 ge 2)
(4 gt 2)
(in "foo")
($foo is string)
(4 le 2)
(4 lt 2)
(4 ne 2)
----------------------------------------------------
[
["expression", [
["punctuation", "("],
["operator", "~"],
["number", "42"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["operator", "+"],
["number", "42"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["operator", "-"],
["number", "42"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "/"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "9"],
["operator", "\\"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "9"],
["operator", "%"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["operator", "!"],
["boolean", "true"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "!|"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["boolean", "true"],
["operator", "!||"],
["boolean", "false"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "!="],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "&"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["boolean", "true"],
["operator", "&&"],
["boolean", "false"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "|"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["boolean", "true"],
["operator", "||"],
["boolean", "false"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "=="],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "<"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "<="],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "<<"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", ">"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", ">="],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", ">>"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["operator", "-f"],
["string", "\"foo\""],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["operator", "-d"],
["string", "\"foo\""],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["operator", "def"],
["variable", ["$foo"]],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "eq"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "ge"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "gt"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["operator", "in"],
["string", "\"foo\""],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["variable", ["$foo"]],
["operator", "is"],
" string",
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "le"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "lt"],
["number", "2"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["number", "4"],
["operator", "ne"],
["number", "2"],
["punctuation", ")"]
]]
]
----------------------------------------------------
Checks for operators inside expressions.

View File

@ -0,0 +1,17 @@
Foo
#
# Foobar
----------------------------------------------------
[
"Foo\r\n",
["parser-comment", "#"],
["parser-comment", "# Foobar"]
]
----------------------------------------------------
Checks for comments.
The first line of this test is needed, since we require a whitespace before the hash
and tests are trimmed.

View File

@ -0,0 +1,47 @@
("")
("foo^"bar")
("foo
bar")
('')
('foo^'bar')
('foo
bar')
----------------------------------------------------
[
["expression", [
["punctuation", "("],
["string", "\"\""],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["string", "\"foo^\"bar\""],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["string", "\"foo\r\nbar\""],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["string", "''"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["string", "'foo^'bar'"],
["punctuation", ")"]
]],
["expression", [
["punctuation", "("],
["string", "'foo\r\nbar'"],
["punctuation", ")"]
]]
]
----------------------------------------------------
Checks for strings inside expressions.

View File

@ -0,0 +1,55 @@
$foo
$foo[bar]
$foo_bar[
$.baz[foo]
$.1[bar]
]
$foo.$bar
$foo.[$bar.baz]
$math:PI
($foo)
<div class="$foo">
----------------------------------------------------
[
["variable", ["$foo"]],
["variable", ["$foo"]], ["punctuation", "["], "bar", ["punctuation", "]"],
["variable", ["$foo_bar"]], ["punctuation", "["],
["variable", ["$", ["punctuation", "."], "baz"]],
["punctuation", "["], "foo", ["punctuation", "]"],
["variable", ["$", ["punctuation", "."], "1"]],
["punctuation", "["], "bar", ["punctuation", "]"],
["punctuation", "]"],
["variable", ["$foo", ["punctuation", "."]]], ["variable", ["$bar"]],
["variable", ["$foo", ["punctuation", "."]]], ["punctuation", "["],
["variable", ["$bar", ["punctuation", "."], "baz"]], ["punctuation", "]"],
["variable", ["$math", ["punctuation", ":"], "PI"]],
["expression", [
["punctuation", "("],
["variable", ["$foo"]],
["punctuation", ")"]
]],
["tag", [
["tag", [
["punctuation", "<"],
"div"
]],
["attr-name", ["class"]],
["attr-value", [
["punctuation", "="],
["punctuation", "\""],
["variable", ["$foo"]],
["punctuation", "\""]
]],
["punctuation", ">"]
]]
]
----------------------------------------------------
Checks for variables.