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,56 @@
%{
#include <stdio.h>
%}
%code {
if(foo) {
}
}
%%
exp:
NUM {
$$ = f($3, $4);
@$.first_column = @1.first_column;
$result = $left + $<itype>1;
}
%%
----------------------------------------------------
[
["bison", [
["c", [
["delimiter", "%{"],
["macro", ["#", ["directive", "include"], ["string", "<stdio.h>"]]],
["delimiter", "%}"]
]],
["keyword", "%code"],
["c", [
["delimiter", "{"],
["keyword", "if"], ["punctuation", "("], "foo", ["punctuation", ")"],
["punctuation", "{"], ["punctuation", "}"],
["delimiter", "}"]
]],
["punctuation", "%%"],
["property", "exp"], ["punctuation", ":"],
"\r\n\tNUM ",
["c", [
["delimiter", "{"],
["bison-variable", ["$$"]], ["operator", "="],
["function", "f"], ["punctuation", "("],
["bison-variable", ["$3"]], ["punctuation", ","],
["bison-variable", ["$4"]], ["punctuation", ")"], ["punctuation", ";"],
["bison-variable", ["@$"]], ["punctuation", "."], "first_column ", ["operator", "="],
["bison-variable", ["@1"]], ["punctuation", "."], "first_column", ["punctuation", ";"],
["bison-variable", ["$result"]], ["operator", "="],
["bison-variable", ["$left"]], ["operator", "+"],
["bison-variable", ["$", ["punctuation", "<"], "itype", ["punctuation", ">"], "1"]], ["punctuation", ";"],
["delimiter", "}"]
]],
["punctuation", "%%"]
]]
]
----------------------------------------------------
Checks for C inside Bison, along with special Bison variables.

View File

@ -0,0 +1,25 @@
// Foobar
/* Foo
bar */
%%
// Foobar
/* Foo
bar */
%%
----------------------------------------------------
[
["bison", [
["comment", "// Foobar"],
["comment", "/* Foo\r\nbar */"],
["punctuation", "%%"],
["comment", "// Foobar"],
["comment", "/* Foo\r\nbar */"],
["punctuation", "%%"]
]]
]
----------------------------------------------------
Checks for comments.

View File

@ -0,0 +1,22 @@
%union
%token
%%
exp: %empty
%%
----------------------------------------------------
[
["bison", [
["keyword", "%union"],
["keyword", "%token"],
["punctuation", "%%"],
["property", "exp"], ["punctuation", ":"],
["keyword", "%empty"],
["punctuation", "%%"]
]]
]
----------------------------------------------------
Checks for keywords.

View File

@ -0,0 +1,15 @@
42
0
0xBadFace
----------------------------------------------------
[
["number", "42"],
["number", "0"],
["number", "0xBadFace"]
]
----------------------------------------------------
Checks for numbers.

View File

@ -0,0 +1,21 @@
%%
foo:
bar_42:
$@1:
%%
----------------------------------------------------
[
["bison", [
["punctuation", "%%"],
["property", "foo"], ["punctuation", ":"],
["property", "bar_42"], ["punctuation", ":"],
["property", "$@1"], ["punctuation", ":"],
["punctuation", "%%"]
]]
]
----------------------------------------------------
Checks for properties.

View File

@ -0,0 +1,21 @@
%%
foo: 'foo' "foo";
bar: '\'' "\"";
%%
----------------------------------------------------
[
["bison", [
["punctuation", "%%"],
["property", "foo"], ["punctuation", ":"],
["string", "'foo'"], ["string", "\"foo\""], ["punctuation", ";"],
["property", "bar"], ["punctuation", ":"],
["string", "'\\''"], ["string", "\"\\\"\""], ["punctuation", ";"],
["punctuation", "%%"]
]]
]
----------------------------------------------------
Checks for strings.