use prism-tomorrow.css
This commit is contained in:
@ -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.
|
@ -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.
|
@ -0,0 +1,22 @@
|
||||
%union
|
||||
%token
|
||||
%%
|
||||
exp: %empty
|
||||
%%
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["bison", [
|
||||
["keyword", "%union"],
|
||||
["keyword", "%token"],
|
||||
["punctuation", "%%"],
|
||||
["property", "exp"], ["punctuation", ":"],
|
||||
["keyword", "%empty"],
|
||||
["punctuation", "%%"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for keywords.
|
@ -0,0 +1,15 @@
|
||||
42
|
||||
0
|
||||
0xBadFace
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["number", "42"],
|
||||
["number", "0"],
|
||||
["number", "0xBadFace"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for numbers.
|
@ -0,0 +1,21 @@
|
||||
%%
|
||||
foo:
|
||||
bar_42:
|
||||
$@1:
|
||||
%%
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["bison", [
|
||||
["punctuation", "%%"],
|
||||
["property", "foo"], ["punctuation", ":"],
|
||||
["property", "bar_42"], ["punctuation", ":"],
|
||||
["property", "$@1"], ["punctuation", ":"],
|
||||
["punctuation", "%%"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for properties.
|
@ -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.
|
Reference in New Issue
Block a user