-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
248 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Prism.languages.neon = { | ||
'comment': { | ||
pattern: /#.*/, | ||
greedy: true | ||
}, | ||
'datetime': { | ||
pattern: /(^|[[{(=,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/, | ||
lookbehind: true, | ||
alias: 'number' | ||
}, | ||
'key': { | ||
pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/, | ||
lookbehind: true, | ||
alias: 'atrule' | ||
}, | ||
'number': { | ||
pattern: /(^|[[{(=,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+\.?\d*|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),\s])/, | ||
lookbehind: true | ||
}, | ||
'boolean': { | ||
pattern: /(^|[[{(=,\s])(?:true|false|yes|no)(?=$|[\]}),\s])/i, | ||
lookbehind: true | ||
}, | ||
'null': { | ||
pattern: /(^|[[{(=,\s])(?:null)(?=$|[\]}),\s])/i, | ||
lookbehind: true | ||
}, | ||
'string': { | ||
pattern: /(^|[[{(=,\s])(?:'''\r?\n(?:(?:[^\r\n]|\r?\n(?![\t\ ]*'''))*\r?\n)?[\t\ ]*'''|"""\r?\n(?:(?:[^\r\n]|\r?\n(?![\t\ ]*"""))*\r?\n)?[\t\ ]*"""|'[^'\n]*'|"(?:\\.|[^"\n])*")(?=$|[\]}),\s])/m, | ||
lookbehind: true, | ||
greedy: true | ||
}, | ||
'literal': { | ||
pattern: /(?:[^#"\',:=[\]{}()\x00-\x20`-]|[:-][^"\',\]})\s])(?:[^,:=\]})(\x00-\x20]+|:(?![\s,\]})]|$)|[\ \t]+[^#,:=\]})(\x00-\x20])*/, | ||
alias: 'string', | ||
}, | ||
'punctuation': /[,:=[\]{}()-]/, | ||
}; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
foo: true | ||
bar: false | ||
alt: [yes, no, YES, NO, TRUE, FALSE] | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "foo"], ["punctuation", ":"], | ||
["boolean", "true"], | ||
["key", "bar"], ["punctuation", ":"], | ||
["boolean", "false"], | ||
["key", "alt"], ["punctuation", ":"], ["punctuation", "["], | ||
["boolean", "yes"], ["punctuation", ","], ["boolean", "no"], ["punctuation", ","], ["boolean", "YES"], ["punctuation", ","], ["boolean", "NO"], ["punctuation", ","], ["boolean", "TRUE"], ["punctuation", ","], ["boolean", "FALSE"], | ||
["punctuation", "]"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for booleans. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# foobar | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "#"], | ||
["comment", "# foobar"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
phones: {home: 555-6528,work: 555-7334 } | ||
|
||
children: # this is a comment | ||
- -50.5 | ||
|
||
entity: Column(type=int, nulls=yes) | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "phones"], ["punctuation", ":"], ["punctuation", "{"], | ||
["key", "home"], ["punctuation", ":"], | ||
["literal", "555-6528"], ["punctuation", ","], | ||
["key", "work"], ["punctuation", ":"], | ||
["literal", "555-7334"], ["punctuation", "}"], | ||
["key", "children"], ["punctuation", ":"], | ||
["comment", "# this is a comment"], | ||
["punctuation", "-"], ["number", "-50.5"], | ||
["key", "entity"], ["punctuation", ":"], | ||
["literal", "Column"], ["punctuation", "("], ["key", "type"], ["punctuation", "="], ["literal", "int"], ["punctuation", ","], ["key", "nulls"], ["punctuation", "="], ["boolean", "yes"], ["punctuation", ")"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Overall test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
canonical: 2001-12-15T02:59:43.1Z | ||
iso8601: 2001-12-14t21:59:43.10-05:00 | ||
spaced: 2001-12-14 21:59:43.10 -5 | ||
date: 2002-12-14 | ||
short: 2002-1-1 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "canonical"], ["punctuation", ":"], | ||
["datetime", "2001-12-15T02:59:43.1Z"], | ||
["key", "iso8601"], ["punctuation", ":"], | ||
["datetime", "2001-12-14t21:59:43.10-05:00"], | ||
["key", "spaced"], ["punctuation", ":"], | ||
["datetime", "2001-12-14 21:59:43.10 -5"], | ||
["key", "date"], ["punctuation", ":"], | ||
["datetime", "2002-12-14"], | ||
["key", "short"], ["punctuation", ":"], | ||
["datetime", "2002-1-1"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for dates and datetimes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
foo: 4 | ||
FooBar : 5 | ||
alt=6 | ||
alt2 = 7 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "foo"], ["punctuation", ":"], ["number", "4"], | ||
["key", "FooBar"], ["punctuation", ":"], ["number", "5"], | ||
["key", "alt"], ["punctuation", "="], ["number", "6"], | ||
["key", "alt2"], ["punctuation", "="], ["number", "7"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
foo: hello:abc | ||
bar: @test\x\b | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "foo"], ["punctuation", ":"], | ||
["literal","hello:abc"], | ||
["key", "bar"], ["punctuation", ":"], | ||
["literal","@test\\x\\b"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for literals. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
foo: null | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "foo"], ["punctuation", ":"], | ||
["null", "null"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for null. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
foo: 0xBadFace | ||
bar: 0o754 | ||
baz: 42 | ||
foo: 3.14159 | ||
bar: 4e8 | ||
baz: 3.1E-7 | ||
foo: 0.4e+2 | ||
bar: -0xFF | ||
baz: +0o123 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "foo"], ["punctuation", ":"], | ||
["number", "0xBadFace"], | ||
["key", "bar"], ["punctuation", ":"], | ||
["number", "0o754"], | ||
["key", "baz"], ["punctuation", ":"], | ||
["number", "42"], | ||
["key", "foo"], ["punctuation", ":"], | ||
["number", "3.14159"], | ||
["key", "bar"], ["punctuation", ":"], | ||
["number", "4e8"], | ||
["key", "baz"], ["punctuation", ":"], | ||
["number", "3.1E-7"], | ||
["key", "foo"], ["punctuation", ":"], | ||
["number", "0.4e+2"], | ||
["key", "bar"], ["punctuation", ":"], | ||
["number", "-0xFF"], | ||
["key", "baz"], ["punctuation", ":"], | ||
["number", "+0o123"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for numbers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
foo: "" | ||
bar: "fo\"obar" | ||
foo: '' | ||
foo: "foo" # bar | ||
bar: 'bar' # foo | ||
multi: ''' | ||
one line | ||
second line | ||
third line | ||
''' | ||
multi: """ | ||
one line | ||
second line | ||
third line | ||
""" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["key", "foo"], ["punctuation", ":"], | ||
["string", "\"\""], | ||
["key", "bar"], ["punctuation", ":"], | ||
["string", "\"fo\\\"obar\""], | ||
["key", "foo"], ["punctuation", ":"], | ||
["string", "''"], | ||
["key", "foo"], ["punctuation", ":"], | ||
["string", "\"foo\""], ["comment", "# bar"], | ||
["key", "bar"], ["punctuation", ":"], | ||
["string", "'bar'"], ["comment", "# foo"], | ||
["key", "multi"], ["punctuation", ":"], | ||
["string", "'''\r\n\tone line\r\n\tsecond line\r\n\tthird line\r\n'''"], | ||
["key", "multi"], ["punctuation", ":"], | ||
["string", "\"\"\"\r\n\tone line\r\n\tsecond line\r\n\tthird line\r\n\"\"\""] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for strings. |