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,29 @@
Array Bignum Binding
Class;
Continuation Dir Exception
FalseClass File Stat File
Fixnum Float Hash Integer
IO MatchData Method Module
NilClass Numeric Object
Proc Range Regexp String
Struct TMS Symbol ThreadGroup
Thread Time TrueClass
----------------------------------------------------
[
["builtin", "Array"], ["builtin", "Bignum"], ["builtin", "Binding"],
["builtin", "Class"], ["punctuation", ";"],
["builtin", "Continuation"], ["builtin", "Dir"], ["builtin", "Exception"],
["builtin", "FalseClass"], ["builtin", "File"], ["builtin", "Stat"], ["builtin", "File"],
["builtin", "Fixnum"], ["builtin", "Float"], ["builtin", "Hash"], ["builtin", "Integer"],
["builtin", "IO"], ["builtin", "MatchData"], ["builtin", "Method"], ["builtin", "Module"],
["builtin", "NilClass"], ["builtin", "Numeric"], ["builtin", "Object"],
["builtin", "Proc"], ["builtin", "Range"], ["builtin", "Regexp"], ["builtin", "String"],
["builtin", "Struct"], ["builtin", "TMS"], ["builtin", "Symbol"], ["builtin", "ThreadGroup"],
["builtin", "Thread"], ["builtin", "Time"], ["builtin", "TrueClass"]
]
----------------------------------------------------
Checks for all builtins.

View File

@ -0,0 +1,22 @@
#
# foobar
=begin
foo bar baz
=end
=begin
=end
#{comment}
----------------------------------------------------
[
["comment", "#"],
["comment", "# foobar"],
["comment", "=begin\r\nfoo bar baz\r\n=end"],
["comment", "=begin\r\n=end"],
["comment", "#{comment}"]
]
----------------------------------------------------
Checks for comments.

View File

@ -0,0 +1,21 @@
Foobar
FOO_BAR_42
F
FOO
BAR?
BAZ!
----------------------------------------------------
[
["constant", "Foobar"],
["constant", "FOO_BAR_42"],
["constant", "F"],
["constant", "FOO"],
["constant", "BAR?"],
["constant", "BAZ!"]
]
----------------------------------------------------
Checks for constants.

View File

@ -0,0 +1,15 @@
:Foo
Foo::Bar
----------------------------------------------------
[
["symbol", ":Foo"],
["constant", "Foo"],
["punctuation", ":"], ["punctuation", ":"],
["constant", "Bar"]
]
----------------------------------------------------
Ensures module syntax is not confused with symbols. See #1336

View File

@ -0,0 +1,103 @@
alias
and
BEGIN
begin
break
case
class;
def;
define_method
defined
do
each
else
elsif
END
end
ensure
false
for
if
in
module
new;
next
nil
not
or
protected
private
public
raise
redo
require
rescue
retry
return
self
super
then
throw
true
undef
unless
until
when
while
yield
----------------------------------------------------
[
["keyword", "alias"],
["keyword", "and"],
["keyword", "BEGIN"],
["keyword", "begin"],
["keyword", "break"],
["keyword", "case"],
["keyword", "class"], ["punctuation", ";"],
["keyword", "def"], ["punctuation", ";"],
["keyword", "define_method"],
["keyword", "defined"],
["keyword", "do"],
["keyword", "each"],
["keyword", "else"],
["keyword", "elsif"],
["keyword", "END"],
["keyword", "end"],
["keyword", "ensure"],
["keyword", "false"],
["keyword", "for"],
["keyword", "if"],
["keyword", "in"],
["keyword", "module"],
["keyword", "new"], ["punctuation", ";"],
["keyword", "next"],
["keyword", "nil"],
["keyword", "not"],
["keyword", "or"],
["keyword", "protected"],
["keyword", "private"],
["keyword", "public"],
["keyword", "raise"],
["keyword", "redo"],
["keyword", "require"],
["keyword", "rescue"],
["keyword", "retry"],
["keyword", "return"],
["keyword", "self"],
["keyword", "super"],
["keyword", "then"],
["keyword", "throw"],
["keyword", "true"],
["keyword", "undef"],
["keyword", "unless"],
["keyword", "until"],
["keyword", "when"],
["keyword", "while"],
["keyword", "yield"]
]
----------------------------------------------------
Checks for all keywords.

View File

@ -0,0 +1,82 @@
class Circle
def self.of_diameter(diameter)
new diameter / 2
end
def initialize(radius)
@radius = radius
end
def circumference
Math::PI * radius ** 2
end
# Seattle style
def grow_by factor:
@radius = @radius * factor
end
end
----------------------------------------------------
[
["keyword", "class"],
["class-name", ["Circle"]],
["keyword", "def"],
["method-definition", [
["keyword", "self"],
["punctuation", "."],
["function", "of_diameter"]
]],
["punctuation", "("],
"diameter",
["punctuation", ")"],
["keyword", "new"],
["class-name", ["diameter"]],
["operator", "/"],
["number", "2"],
["keyword", "end"],
["keyword", "def"],
["method-definition", [
["function", "initialize"]
]],
["punctuation", "("],
"radius",
["punctuation", ")"],
["variable", "@radius"],
["operator", "="],
" radius\n ",
["keyword", "end"],
["keyword", "def"],
["method-definition", [
["function", "circumference"]
]],
["constant", "Math"],
["punctuation", ":"],
["punctuation", ":"],
["constant", "PI"],
["operator", "*"],
" radius ",
["operator", "*"],
["operator", "*"],
["number", "2"],
["keyword", "end"],
["comment", "# Seattle style"],
["keyword", "def"],
["method-definition", [
["function", "grow_by"]
]],
" factor",
["punctuation", ":"],
["variable", "@radius"],
["operator", "="],
["variable", "@radius"],
["operator", "*"],
" factor\n ",
["keyword", "end"],
["keyword", "end"]
]
----------------------------------------------------
Checks that method definitions are highlighted correctly

View File

@ -0,0 +1,45 @@
/[foo]\/bar/gim
/[bar]/,
/./i;
%r!foo?bar#{39+3}!
%r(foo?bar#{39+3})
%r{foo?bar#{39+3}}
%r[foo?bar#{39+3}]
%r<foo?bar#{39+3}>
----------------------------------------------------
[
["regex", "/[foo]\\/bar/gim"],
["regex", "/[bar]/"], ["punctuation", ","],
["regex", "/./i"], ["punctuation", ";"],
["regex", ["%r!foo?bar", ["interpolation", [
["delimiter", "#{"],
["number", "39"], ["operator", "+"], ["number", "3"],
["delimiter", "}"]
]], "!"]],
["regex", ["%r(foo?bar", ["interpolation", [
["delimiter", "#{"],
["number", "39"], ["operator", "+"], ["number", "3"],
["delimiter", "}"]
]], ")"]],
["regex", ["%r{foo?bar", ["interpolation", [
["delimiter", "#{"],
["number", "39"], ["operator", "+"], ["number", "3"],
["delimiter", "}"]
]], "}"]],
["regex", ["%r[foo?bar", ["interpolation", [
["delimiter", "#{"],
["number", "39"], ["operator", "+"], ["number", "3"],
["delimiter", "}"]
]], "]"]],
["regex", ["%r<foo?bar", ["interpolation", [
["delimiter", "#{"],
["number", "39"], ["operator", "+"], ["number", "3"],
["delimiter", "}"]
]], ">"]]
]
----------------------------------------------------
Checks for regex.

View File

@ -0,0 +1,287 @@
''
""
'foo'
"foo"
'foo\
bar'
"foo\
bar"
"foo #bar"
"foo #{ 42 } bar"
%!foo #{ 42 }!
%(foo #{ 42 })
%{foo #{ 42 }}
%[foo #{ 42 }]
%<foo #{ 42 }>
%Q!foo #{ 42 }!
%Q(foo #{ 42 })
%Q{foo #{ 42 }}
%Q[foo #{ 42 }]
%Q<foo #{ 42 }>
%I!foo #{ 42 }!
%I(foo #{ 42 })
%I{foo #{ 42 }}
%I[foo #{ 42 }]
%I<foo #{ 42 }>
%W!foo #{ 42 }!
%W(foo #{ 42 })
%W{foo #{ 42 }}
%W[foo #{ 42 }]
%W<foo #{ 42 }>
%x!foo #{ 42 }!
%x(foo #{ 42 })
%x{foo #{ 42 }}
%x[foo #{ 42 }]
%x<foo #{ 42 }>
----------------------------------------------------
[
["string", ["''"]],
["string", ["\"\""]],
["string", ["'foo'"]],
["string", ["\"foo\""]],
["string", ["'foo\\\r\nbar'"]],
["string", ["\"foo\\\r\nbar\""]],
["string", ["\"foo #bar\""]],
["string", [
"\"foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
" bar\""
]],
["string", [
"%!foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"!"
]],
["string", [
"%(foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
")"
]],
["string", [
"%{foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"}"
]],
["string", [
"%[foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"]"
]],
["string", [
"%<foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
">"
]],
["string", [
"%Q!foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"!"
]],
["string", [
"%Q(foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
")"
]],
["string", [
"%Q{foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"}"
]],
["string", [
"%Q[foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"]"
]],
["string", [
"%Q<foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
">"
]],
["string", [
"%I!foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"!"
]],
["string", [
"%I(foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
")"
]],
["string", [
"%I{foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"}"
]],
["string", [
"%I[foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"]"
]],
["string", [
"%I<foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
">"
]],
["string", [
"%W!foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"!"
]],
["string", [
"%W(foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
")"
]],
["string", [
"%W{foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"}"
]],
["string", [
"%W[foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"]"
]],
["string", [
"%W<foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
">"
]],
["string", [
"%x!foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"!"
]],
["string", [
"%x(foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
")"
]],
["string", [
"%x{foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"}"
]],
["string", [
"%x[foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
"]"
]],
["string", [
"%x<foo ",
["interpolation", [
["delimiter", "#{"],
["number", "42"],
["delimiter", "}"]
]],
">"
]]
]
----------------------------------------------------
Checks for strings and string interpolation.

View File

@ -0,0 +1,17 @@
:_
:foo
:BAR?
:Baz_42!
----------------------------------------------------
[
["symbol", ":_"],
["symbol", ":foo"],
["symbol", ":BAR?"],
["symbol", ":Baz_42!"]
]
----------------------------------------------------
Checks for symbols.

View File

@ -0,0 +1,27 @@
$_
$foo
$BAR?
$Baz_42!
@_
@foo
@BAR?
@Baz_42!
----------------------------------------------------
[
["variable", "$_"],
["variable", "$foo"],
["variable", "$BAR?"],
["variable", "$Baz_42!"],
["variable", "@_"],
["variable", "@foo"],
["variable", "@BAR?"],
["variable", "@Baz_42!"]
]
----------------------------------------------------
Checks for variables.