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,36 @@
- if(foo)
p= 'This code is' + ' <escaped>!'
span
!= 'Not escaped'
----------------------------------------------------
[
["punctuation", "-"],
["code", [
["keyword", "if"],
["punctuation", "("],
"foo",
["punctuation", ")"]
]],
["tag", ["p"]],
["punctuation", "="],
["code", [
["string", "'This code is'"],
["operator", "+"],
["string", "' <escaped>!'"]
]],
["tag", ["span"]],
["punctuation", "!="],
["code", [
["string", "'Not escaped'"]
]]
]
----------------------------------------------------
Checks for inline code.

View File

@ -0,0 +1,22 @@
// foo
bar
// foo
bar baz
// foo
// bar
----------------------------------------------------
[
["comment", "// foo\r\n bar"],
["comment", "// foo\r\n\t\tbar baz"],
["comment", "// foo"],
["comment", "// bar"]
]
----------------------------------------------------
Checks for single-line comments.

View File

@ -0,0 +1,15 @@
doctype html
doctype 1.1
doctype html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
----------------------------------------------------
[
["doctype", "doctype html"],
["doctype", "doctype 1.1"],
["doctype", "doctype html PUBLIC \"-//W3C//DTD XHTML Basic 1.1//EN\""]
]
----------------------------------------------------
Checks for doctypes.

View File

@ -0,0 +1,75 @@
each val, index in [1,2,3]
if foo
else if bar
else
unless foo
while n < 4
case foo
when "bar"
default
----------------------------------------------------
[
["flow-control", [
["each", [
["keyword", "each"],
" val",
["punctuation", ","],
" index ",
["keyword", "in"]
]],
["punctuation", "["],
["number", "1"],
["punctuation", ","],
["number", "2"],
["punctuation", ","],
["number", "3"],
["punctuation", "]"]
]],
["flow-control", [
["branch", "if"],
" foo"
]],
["flow-control", [
["branch", "else"],
["keyword", "if"],
" bar"
]],
["flow-control", [
["branch", "else"]
]],
["flow-control", [
["branch", "unless"],
" foo"
]],
["flow-control", [
["branch", "while"],
" n ",
["operator", "<"],
["number", "4"]
]],
["flow-control", [
["branch", "case"],
" foo"
]],
["flow-control", [
["branch", "when"],
["string", "\"bar\""]
]],
["flow-control", [
["branch", "default"]
]]
]
----------------------------------------------------
Checks for all flow-control structures.

View File

@ -0,0 +1,27 @@
block title
extends ./foo.pug
include ./bar.pug
block append foo
append bar
block prepend foo
prepend bar
----------------------------------------------------
[
["keyword", "block title"],
["keyword", "extends ./foo.pug"],
["keyword", "include ./bar.pug"],
["keyword", "block append foo"],
["keyword", "append bar"],
["keyword", "block prepend foo"],
["keyword", "prepend bar"]
]
----------------------------------------------------
Checks for all keywords.

View File

@ -0,0 +1,35 @@
mixin foo
mixin pet(name)
+foo
+pet('cat')
----------------------------------------------------
[
["mixin", [
["keyword", "mixin"],
["function", "foo"]
]],
["mixin", [
["keyword", "mixin"],
["function", "pet"],
["punctuation", "("],
"name",
["punctuation", ")"]
]],
["mixin", [
["name", "+foo"]
]],
["mixin", [
["name", "+pet"],
["punctuation", "("],
["string", "'cat'"],
["punctuation", ")"]
]]
]
----------------------------------------------------
Checks for mixins declaration and usage.

View File

@ -0,0 +1,30 @@
div.
foobar
baz
.
div.
foobar
baz
----------------------------------------------------
[
["tag", [
"div"
]],
["punctuation", "."],
["multiline-plain-text", "\r\n foobar\r\n\r\n baz"],
["punctuation", "."],
["tag", [
"div"
]],
["punctuation", "."],
["multiline-plain-text", "\r\n\t\tfoobar\r\n\t\tbaz"]
]
----------------------------------------------------
Checks for multi-line plain text.

View File

@ -0,0 +1,58 @@
script.
alert(42);
.
script(type='text/javascript').
if(foo) {
bar(1 + 5);
}
----------------------------------------------------
[
["tag", [
"script"
]],
["punctuation", "."],
["multiline-script", [
["function", "alert"],
["punctuation", "("],
["number", "42"],
["punctuation", ")"],
["punctuation", ";"]
]],
["punctuation", "."],
["tag", [
"script",
["attributes", [
["punctuation", "("],
["attr-name", "type"],
["punctuation", "="],
["attr-value", [["string", "'text/javascript'"]]],
["punctuation", ")"]
]]
]],
["punctuation", "."],
["multiline-script", [
["keyword", "if"],
["punctuation", "("],
"foo",
["punctuation", ")"],
["punctuation", "{"],
["function", "bar"],
["punctuation", "("],
["number", "1"],
["operator", "+"],
["number", "5"],
["punctuation", ")"],
["punctuation", ";"],
["punctuation", "}"]
]]
]
----------------------------------------------------
Checks for multi-line scripts. The alone dot serves as a separator.

View File

@ -0,0 +1,19 @@
div foo
span foo bar
----------------------------------------------------
[
["tag", [
"div"
]],
["plain-text", "foo"],
["tag", [
"span"
]],
["plain-text", "foo bar"]
]
----------------------------------------------------
Checks for single-line plain text.

View File

@ -0,0 +1,38 @@
script alert(42);
script(type='text/javascript') alert(42);
----------------------------------------------------
[
["tag", [
"script"
]],
["script", [
["function", "alert"],
["punctuation", "("],
["number", "42"],
["punctuation", ")"],
["punctuation", ";"]
]],
["tag", [
"script",
["attributes", [
["punctuation", "("],
["attr-name", "type"],
["punctuation", "="],
["attr-value", [["string", "'text/javascript'"]]],
["punctuation", ")"]
]]
]],
["script", [
["function", "alert"],
["punctuation", "("],
["number", "42"],
["punctuation", ")"],
["punctuation", ";"]
]]
]
----------------------------------------------------
Checks for single-line scripts.

View File

@ -0,0 +1,97 @@
div
span&attributes({'data-foo': 'bar'})
input(data-bar="foo", type='checkbox', checked)
a(style={color: 'red', background: 'green'})
div(unescaped!="<code>")
a.button
.content
a#main-link
#content
a: span
----------------------------------------------------
[
["tag", ["div"]],
["tag", [
"span",
["attributes", [
["operator", "&"],
["function", "attributes"],
["punctuation", "("],
["punctuation", "{"],
["string", "'data-foo'"],
["punctuation", ":"],
["string", "'bar'"],
["punctuation", "}"],
["punctuation", ")"]
]]
]],
["tag", [
"input",
["attributes", [
["punctuation", "("],
["attr-name", "data-bar"],
["punctuation", "="],
["attr-value", [["string", "\"foo\""]]],
["punctuation", ","],
["attr-name", "type"],
["punctuation", "="],
["attr-value", [["string", "'checkbox'"]]],
["punctuation", ","],
["attr-name", "checked"],
["punctuation", ")"]
]]
]],
["tag", [
"a",
["attributes", [
["punctuation", "("],
["attr-name", "style"],
["punctuation", "="],
["attr-value", [
["punctuation", "{"],
"color",
["punctuation", ":"],
["string", "'red'"],
["punctuation", ","],
" background",
["punctuation", ":"],
["string", "'green'"],
["punctuation", "}"]
]],
["punctuation", ")"]
]]
]],
["tag", [
"div",
["attributes", [
["punctuation", "("],
["attr-name", "unescaped"],
["punctuation", "!="],
["attr-value", [["string", "\"<code>\""]]],
["punctuation", ")"]
]]
]],
["tag", ["a.button"]],
["tag", [".content"]],
["tag", ["a#main-link"]],
["tag", ["#content"]],
["tag", ["a", ["punctuation", ":"]]],
["tag", ["span"]]
]
----------------------------------------------------
Checks for tags and attributes.