Tests: Automatically normalize line ends (#2934)

This commit is contained in:
Michael Schmidt 2021-06-13 22:00:43 +02:00 committed by GitHub
parent 8e93c5daa8
commit 99f3ddcdc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
91 changed files with 1158 additions and 830 deletions

3
.gitattributes vendored
View File

@ -1,4 +1 @@
* text=auto
# Test files should not have their line endings modified by git
/tests/languages/**/*.test binary

View File

@ -13,7 +13,7 @@
greedy: true
},
'character-code': {
pattern: /'[\s\S]/,
pattern: /'(?:[^\r]|\r\n?)/,
alias: 'number'
},
'assembler-code': {

View File

@ -1 +1 @@
Prism.languages.false={comment:{pattern:/\{[^}]*\}/},string:{pattern:/"[^"]*"/,greedy:!0},"character-code":{pattern:/'[\s\S]/,alias:"number"},"assembler-code":{pattern:/\d+`/,alias:"important"},number:/\d+/,operator:/[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/,punctuation:/\[|\]/,variable:/[a-z]/,"non-standard":{pattern:/[()<BDO®]/,alias:"bold"}};
Prism.languages.false={comment:{pattern:/\{[^}]*\}/},string:{pattern:/"[^"]*"/,greedy:!0},"character-code":{pattern:/'(?:[^\r]|\r\n?)/,alias:"number"},"assembler-code":{pattern:/\d+`/,alias:"important"},number:/\d+/,operator:/[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/,punctuation:/\[|\]/,variable:/[a-z]/,"non-standard":{pattern:/[()<BDO®]/,alias:"bold"}};

View File

@ -66,7 +66,6 @@ module.exports = {
function updateFile() {
// change the file
const lineEnd = (/\r\n/.test(testCase.code) || !/\n/.test(testCase.code)) ? '\r\n' : '\n';
const separator = '\n\n----------------------------------------------------\n\n';
const pretty = TokenStreamTransformer.prettyprint(tokenStream, '\t');
@ -75,7 +74,9 @@ module.exports = {
content += separator + testCase.comment.trim();
}
content += '\n';
content = content.replace(/\r?\n/g, lineEnd);
// convert line ends to the line ends of the file
content = content.replace(/\r\n?|\n/g, testCase.lineEndOnDisk);
fs.writeFileSync(filePath, content, 'utf-8');
}
@ -202,6 +203,7 @@ module.exports = {
* @returns {ParsedTestCase}
*
* @typedef ParsedTestCase
* @property {string} lineEndOnDisk The EOL format used by the parsed file.
* @property {string} code
* @property {string} expectedJson
* @property {number} expectedLineOffset
@ -209,7 +211,11 @@ module.exports = {
* @property {string} comment
*/
parseTestCaseFile(filePath) {
const testCaseSource = fs.readFileSync(filePath, 'utf8');
let testCaseSource = fs.readFileSync(filePath, 'utf8');
const lineEndOnDisk = (/\r\n?|\n/.exec(testCaseSource) || ['\n'])[0];
// normalize line ends to \r\n
testCaseSource = testCaseSource.replace(/\r\n?|\n/g, '\r\n');
const testCaseParts = testCaseSource.split(/^-{10,}[ \t]*$/m);
if (testCaseParts.length > 3) {
@ -221,9 +227,10 @@ module.exports = {
const comment = (testCaseParts[2] || '').trimStart();
const testCase = {
lineEndOnDisk,
code,
expectedJson: expected,
expectedLineOffset: code.split(/\r\n?|\n/g).length,
expectedLineOffset: code.split(/\r\n/g).length,
expectedTokenStream: expected ? JSON.parse(expected) : null,
comment
};

View File

@ -7,7 +7,7 @@
----------------------------------------------------
[
["comment", "{-\n\tThis is a\n\tmultiline comment\n-}"],
["comment", "{-\r\n\tThis is a\r\n\tmultiline comment\r\n-}"],
["comment", "-- This is a singleline comment"]
]

View File

@ -29,11 +29,11 @@ merge xs@(x ∷ xs₁) ys@(y ∷ ys₁) =
["operator", "→"],
" List A ",
["operator", "→"],
" List A\nmerge xs [] ",
" List A\r\nmerge xs [] ",
["operator", "="],
" xs\nmerge [] ys ",
" xs\r\nmerge [] ys ",
["operator", "="],
" ys\nmerge xs",
" ys\r\nmerge xs",
["punctuation", "@"],
["punctuation", "("],
"x ∷ xs₁",
@ -44,7 +44,8 @@ merge xs@(x ∷ xs₁) ys@(y ∷ ys₁) =
"y ∷ ys₁",
["punctuation", ")"],
["operator", "="],
"\n\tif x < y then x ∷ merge xs₁ ys\n\t\t\t\t\t else y ∷ merge xs ys₁"
"\r\n\tif x < y then x ∷ merge xs₁ ys\r\n\t\t\t\t\t else y ∷ merge xs ys₁"
]
----------------------------------------------------

View File

@ -11,12 +11,14 @@ open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎) renaming (begin_ to star
["punctuation", "."],
"test ",
["keyword", "where"],
["keyword", "import"],
" Relation",
["punctuation", "."],
"Binary",
["punctuation", "."],
"PropositionalEquality as Eq\n",
"PropositionalEquality as Eq\r\n",
["keyword", "open"],
" Eq ",
["keyword", "hiding"],
@ -25,6 +27,7 @@ open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎) renaming (begin_ to star
["punctuation", ";"],
" refl",
["punctuation", ")"],
["keyword", "open"],
" Eq",
["punctuation", "."],

View File

@ -18,15 +18,20 @@ open Fin
["operator", ":"],
["keyword", "Set"],
["keyword", "where"],
["keyword", "constructor"],
" _[_]\n\t",
" _[_]\r\n\t",
["keyword", "field"],
["function", "⟦_⟧ "],
["operator", ":"],
" Nat\n\t\t",
" Nat\r\n\t\t",
["function", "proof "],
["operator", ":"],
" suc ⟦_⟧ ≤ n\n",
" suc ⟦_⟧ ≤ n\r\n",
["keyword", "open"],
" Fin"
]

View File

@ -9,7 +9,7 @@
[
["comment", "// comment"],
["comment", "/**/"],
["comment", "/*\n comment\n*/"]
["comment", "/*\r\n comment\r\n*/"]
]
----------------------------------------------------

View File

@ -21,12 +21,14 @@ from LexerAdaptor import LexerAdaptor
["content", " superClass = LexerAdaptor; "],
["punctuation", "}"]
]],
["annotation", "@lexer::header"],
["action", [
["punctuation", "{"],
["content", "\n import { Token } from 'antlr4ts/Token';\n import { CommonToken } from 'antlr4ts/CommonToken';\n import { Python3Parser } from './Python3Parser';\n"],
["content", "\r\n import { Token } from 'antlr4ts/Token';\r\n import { CommonToken } from 'antlr4ts/CommonToken';\r\n import { Python3Parser } from './Python3Parser';\r\n"],
["punctuation", "}"]
]],
["definition", "END"],
["punctuation", ":"],
["string", "'end'"],
@ -36,10 +38,11 @@ from LexerAdaptor import LexerAdaptor
["punctuation", "}"]
]],
["punctuation", ";"],
["annotation", "@header"],
["action", [
["punctuation", "{"],
["content", "\nfrom LexerAdaptor import LexerAdaptor\n"],
["content", "\r\nfrom LexerAdaptor import LexerAdaptor\r\n"],
["punctuation", "}"]
]]
]

View File

@ -7,7 +7,7 @@
[
["comment", "// comment"],
["comment", "/*\n comment\n*/"]
["comment", "/*\r\n comment\r\n*/"]
]
----------------------------------------------------

View File

@ -29,6 +29,7 @@
]],
["punctuation", "]"]
]],
["tag", [
["tag", [
["punctuation", "["],
@ -36,7 +37,8 @@
]],
["punctuation", "]"]
]],
"Entry A\n ",
"Entry A\r\n ",
["tag", [
["tag", [
["punctuation", "["],
@ -44,7 +46,8 @@
]],
["punctuation", "]"]
]],
"Entry B\n",
"Entry B\r\n",
["tag", [
["tag", [
["punctuation", "[/"],
@ -64,6 +67,7 @@
]],
["punctuation", "]"]
]],
["tag", [
["tag", [
["punctuation", "["],
@ -71,7 +75,8 @@
]],
["punctuation", "]"]
]],
"Entry 1\n ",
"Entry 1\r\n ",
["tag", [
["tag", [
["punctuation", "["],
@ -79,7 +84,8 @@
]],
["punctuation", "]"]
]],
"Entry 2\n",
"Entry 2\r\n",
["tag", [
["tag", [
["punctuation", "[/"],
@ -110,7 +116,8 @@
]],
["punctuation", "]"]
]],
" or\n",
" or\r\n",
["tag", [
["tag", [
["punctuation", "["],
@ -131,7 +138,8 @@
]],
["punctuation", "]"]
]],
" or\n",
" or\r\n",
["tag", [
["tag", [
["punctuation", "["],
@ -151,6 +159,7 @@
]],
["punctuation", "]"]
]],
["tag", [
["tag", [
["punctuation", "["],
@ -166,6 +175,7 @@
]],
["punctuation", "]"]
]],
["tag", [
["tag", [
["punctuation", "["],
@ -211,6 +221,7 @@
]],
["punctuation", "]"]
]],
["tag", [
["tag", [
["punctuation", "["],

View File

@ -9,15 +9,11 @@ a = { foo: 5, bar: 6, "foo bar": 7 }
[
["punctuation", "{"],
["property", "foo"],
["operator", ":"],
["number", "4"],
["property", "\"bar\""],
["operator", ":"],
["number", "5"],
["property", "foo"], ["operator", ":"], ["number", "4"],
["property", "\"bar\""], ["operator", ":"], ["number", "5"],
["punctuation", "}"],
"\n\na ",
"\r\n\r\na ",
["operator", "="],
["punctuation", "{"],
["property", "foo"],

View File

@ -8,7 +8,7 @@ string"
[
["string", "\"\""],
["string", "\"Fo\\\"obar\""],
["string", "\"multi-line\nstring\""]
["string", "\"multi-line\r\nstring\""]
]
----------------------------------------------------

View File

@ -10,29 +10,39 @@ string"
[
["string", ["\"This is a string\""]],
["string", ["\"This is \nmulti\nline\nstring\""]],
["string", ["\"This is \r\nmulti\r\nline\r\nstring\""]],
["string", [
"\"",
["interpolation", [
["punctuation", "${"], ["variable", "VAR"], ["punctuation", "}"]]
],
["punctuation", "${"],
["variable", "VAR"],
["punctuation", "}"]
]],
"with",
["interpolation", [
["punctuation", "${"], ["variable", "BAR"], ["punctuation", "}"]]
], "\""]
],
["punctuation", "${"],
["variable", "BAR"],
["punctuation", "}"]
]],
"\""
]],
["string", [
"\"",
["interpolation", [
["punctuation", "${"], ["variable", "FOO"], ["punctuation", "}"]]
],
["punctuation", "${"],
["variable", "FOO"],
["punctuation", "}"]
]],
" with ",
["interpolation", [
["punctuation", "${"], ["variable", "BAR"], ["punctuation", "}"]]
], "\""]
]
["punctuation", "${"],
["variable", "BAR"],
["punctuation", "}"]
]],
"\""
]]
]
----------------------------------------------------
Checks for strings.
Checks for strings.

View File

@ -69,7 +69,7 @@ greeting pic x(12) value is "Hello World".
]],
["punctuation", "."],
"\n\ngreeting ",
"\r\n\r\ngreeting ",
["keyword", "pic"],
["class-name", [
"x",
@ -81,4 +81,4 @@ greeting pic x(12) value is "Hello World".
["keyword", "is"],
["string", "\"Hello World\""],
["punctuation", "."]
]
]

View File

@ -23,7 +23,7 @@ void MainWindow::changeWindowTitle()
["punctuation", "{"],
"\n Q_OBJECT\n\n ",
"\r\n Q_OBJECT\r\n\r\n ",
["keyword", "private"],
" slots",
@ -67,4 +67,4 @@ void MainWindow::changeWindowTitle()
["punctuation", ";"],
["punctuation", "}"]
]
]

View File

@ -29,16 +29,13 @@ var c = new (int, int)[Count];
[
["punctuation", "["],
["attribute", [
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["class-name", [
"Foo"
]],
["class-name", ["Foo"]],
["attribute-arguments", [
["punctuation", "("],
["number", "1"],
@ -48,11 +45,10 @@ var c = new (int, int)[Count];
]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["class-name", [
"Foo"
]],
["class-name", ["Foo"]],
["attribute-arguments", [
["punctuation", "("],
["number", "1"],
@ -66,58 +62,48 @@ var c = new (int, int)[Count];
]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["class-name", [
"Foo"
]],
["class-name", ["Foo"]],
["punctuation", ","],
["class-name", [
"Bar"
]]
["class-name", ["Bar"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["class-name", [
"Foo"
]],
["class-name", ["Foo"]],
["attribute-arguments", [
["punctuation", "("],
["string", "\"()\""],
["punctuation", ")"]
]],
["punctuation", ","],
["class-name", [
"Bar"
]],
["class-name", ["Bar"]],
["attribute-arguments", [
["punctuation", "("],
["string", "\"[]\""],
["punctuation", ")"]
]],
["punctuation", ","],
["class-name", [
"Baz"
]]
["class-name", ["Baz"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "return"],
["punctuation", ":"],
["class-name", [
"MaybeNull"
]]
["class-name", ["MaybeNull"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "assembly"],
["punctuation", ":"],
["class-name", [
"InternalsVisibleTo"
]],
["class-name", ["InternalsVisibleTo"]],
["attribute-arguments", [
["punctuation", "("],
["string", "\"Tests\""],
@ -125,98 +111,93 @@ var c = new (int, int)[Count];
]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "assembly"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "module"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "field"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "event"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "method"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "param"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "property"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "return"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["punctuation", "["],
["attribute", [
["target", "type"],
["punctuation", ":"],
["class-name", [
"Foo"
]]
["class-name", ["Foo"]]
]],
["punctuation", "]"],
["comment", "// not attributes"],
["class-name", [
["keyword", "var"]
]],
" a ",
["operator", "="],
" d\n",
" d\r\n",
["punctuation", "["],
"Foo",
["punctuation", "]"],
["punctuation", ";"],
["class-name", [
["keyword", "var"]
]],
@ -234,6 +215,7 @@ var c = new (int, int)[Count];
"Count",
["punctuation", "]"],
["punctuation", ";"],
["class-name", [
["keyword", "var"]
]],

View File

@ -51,28 +51,25 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
["keyword", "public"],
["keyword", "static"],
["return-type", [
"RGBColor"
]],
["return-type", ["RGBColor"]],
["function", "FromRainbow"],
["punctuation", "("],
["class-name", [
"Rainbow"
]],
["class-name", ["Rainbow"]],
" colorBand",
["punctuation", ")"],
["operator", "=>"],
"\n\tcolorBand ",
"\r\n\tcolorBand ",
["keyword", "switch"],
["punctuation", "{"],
"\n\t\tRainbow",
"\r\n\t\tRainbow",
["punctuation", "."],
"Red ",
["operator", "=>"],
["keyword", "new"],
["constructor-invocation", [
"RGBColor"
]],
["constructor-invocation", ["RGBColor"]],
["punctuation", "("],
["number", "0xFF"],
["punctuation", ","],
@ -81,13 +78,12 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
["number", "0x00"],
["punctuation", ")"],
["punctuation", ","],
"\n\t\t_ ",
"\r\n\t\t_ ",
["operator", "=>"],
["keyword", "throw"],
["keyword", "new"],
["constructor-invocation", [
"ArgumentException"
]],
["constructor-invocation", ["ArgumentException"]],
["punctuation", "("],
["named-parameter", "message"],
["punctuation", ":"],
@ -101,6 +97,7 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
["punctuation", ")"],
["punctuation", ")"],
["punctuation", ","],
["punctuation", "}"],
["punctuation", ";"]
]

View File

@ -18,9 +18,7 @@ $@"{
["string", "$\"Hello, {{ "],
["interpolation", [
["punctuation", "{"],
["expression", [
"name"
]],
["expression", ["name"]],
["punctuation", "}"]
]],
["string", " }}! Today is "],
@ -36,9 +34,7 @@ $@"{
["string", ", it's "],
["interpolation", [
["punctuation", "{"],
["expression", [
"date"
]],
["expression", ["date"]],
["format-string", [
["punctuation", ":"],
"HH:mm"
@ -113,12 +109,14 @@ $@"{
]],
["string", "\""]
]],
["interpolation-string", [
["string", "@$\"\n\""]
["string", "@$\"\r\n\""]
]],
["interpolation-string", [
["string", "$@\"\n\""]
["string", "$@\"\r\n\""]
]],
["interpolation-string", [
["string", "$@\""],
["interpolation", [

View File

@ -15,7 +15,7 @@ list[..];
["punctuation", "]"],
["punctuation", ";"],
"\nlist",
"\r\nlist",
["punctuation", "["],
["range", ".."],
["operator", "^"],
@ -23,14 +23,14 @@ list[..];
["punctuation", "]"],
["punctuation", ";"],
"\nlist",
"\r\nlist",
["punctuation", "["],
["number", "2"],
["range", ".."],
["punctuation", "]"],
["punctuation", ";"],
"\nlist",
"\r\nlist",
["punctuation", "["],
["range", ".."],
["punctuation", "]"],

View File

@ -113,12 +113,13 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
" vehicle",
["punctuation", ")"],
["operator", "=>"],
"\n\tvehicle ",
"\r\n\tvehicle ",
["keyword", "switch"],
["punctuation", "{"],
["class-name", [
"DeliveryTruck"
]],
["class-name", ["DeliveryTruck"]],
" t ",
["keyword", "when"],
" t",
@ -131,9 +132,8 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "+"],
["number", "5.00m"],
["punctuation", ","],
["class-name", [
"DeliveryTruck"
]],
["class-name", ["DeliveryTruck"]],
" t ",
["keyword", "when"],
" t",
@ -146,20 +146,18 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "-"],
["number", "2.00m"],
["punctuation", ","],
["return-type", [
"DeliveryTruck"
]],
["return-type", ["DeliveryTruck"]],
" _ ",
["operator", "=>"],
["number", "10.00m"],
["punctuation", ","],
"\n\t\t_ ",
"\r\n\t\t_ ",
["operator", "=>"],
["keyword", "throw"],
["keyword", "new"],
["constructor-invocation", [
"ArgumentException"
]],
["constructor-invocation", ["ArgumentException"]],
["punctuation", "("],
["string", "\"Not a known vehicle type\""],
["punctuation", ","],
@ -168,18 +166,20 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
"vehicle",
["punctuation", ")"],
["punctuation", ")"],
["punctuation", "}"],
["punctuation", ";"],
["class-name", [
"DeliveryTruck"
]],
["class-name", ["DeliveryTruck"]],
" t ",
["keyword", "when"],
" t",
["punctuation", "."],
"GrossWeightClass ",
["keyword", "switch"],
["punctuation", "{"],
["operator", ">"],
["number", "5000"],
["operator", "=>"],
@ -187,6 +187,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "+"],
["number", "5.00m"],
["punctuation", ","],
["operator", "<"],
["number", "3000"],
["operator", "=>"],
@ -194,22 +195,25 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "-"],
["number", "2.00m"],
["punctuation", ","],
"\n\t_ ",
"\r\n\t_ ",
["operator", "=>"],
["number", "10.00m"],
["punctuation", ","],
["punctuation", "}"],
["punctuation", ","],
["class-name", [
"DeliveryTruck"
]],
["class-name", ["DeliveryTruck"]],
" t ",
["keyword", "when"],
" t",
["punctuation", "."],
"GrossWeightClass ",
["keyword", "switch"],
["punctuation", "{"],
["operator", "<"],
["number", "3000"],
["operator", "=>"],
@ -217,6 +221,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "-"],
["number", "2.00m"],
["punctuation", ","],
["operator", ">="],
["number", "3000"],
["keyword", "and"],
@ -225,6 +230,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "=>"],
["number", "10.00m"],
["punctuation", ","],
["operator", ">"],
["number", "5000"],
["operator", "=>"],
@ -232,8 +238,10 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "+"],
["number", "5.00m"],
["punctuation", ","],
["punctuation", "}"],
["punctuation", ","],
["keyword", "switch"],
["punctuation", "("],
"DateTime",
@ -242,150 +250,187 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["punctuation", "."],
"DayOfWeek",
["punctuation", ")"],
["punctuation", "{"],
["keyword", "case"],
" DayOfWeek",
["punctuation", "."],
"Sunday",
["punctuation", ":"],
["keyword", "case"],
" DayOfWeek",
["punctuation", "."],
"Saturday",
["punctuation", ":"],
"\n\t\tConsole",
"\r\n\t\tConsole",
["punctuation", "."],
["function", "WriteLine"],
["punctuation", "("],
["string", "\"The weekend\""],
["punctuation", ")"],
["punctuation", ";"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
" DayOfWeek",
["punctuation", "."],
"Monday",
["punctuation", ":"],
"\n\t\tConsole",
"\r\n\t\tConsole",
["punctuation", "."],
["function", "WriteLine"],
["punctuation", "("],
["string", "\"The first day of the work week.\""],
["punctuation", ")"],
["punctuation", ";"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
" DayOfWeek",
["punctuation", "."],
"Friday",
["punctuation", ":"],
"\n\t\tConsole",
"\r\n\t\tConsole",
["punctuation", "."],
["function", "WriteLine"],
["punctuation", "("],
["string", "\"The last day of the work week.\""],
["punctuation", ")"],
["punctuation", ";"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "default"],
["punctuation", ":"],
"\n\t\tConsole",
"\r\n\t\tConsole",
["punctuation", "."],
["function", "WriteLine"],
["punctuation", "("],
["string", "\"The middle of the work week.\""],
["punctuation", ")"],
["punctuation", ";"],
["keyword", "break"],
["punctuation", ";"],
["punctuation", "}"],
["keyword", "switch"],
["punctuation", "("],
"str",
["punctuation", ")"],
["punctuation", "{"],
["keyword", "case"],
["string", "\"1\""],
["punctuation", ":"],
["keyword", "case"],
["string", "\"small\""],
["punctuation", ":"],
"\n\t\tcost ",
"\r\n\t\tcost ",
["operator", "+="],
["number", "25"],
["punctuation", ";"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
["string", "\"2\""],
["punctuation", ":"],
["keyword", "case"],
["string", "\"medium\""],
["punctuation", ":"],
"\n\t\tcost ",
"\r\n\t\tcost ",
["operator", "+="],
["number", "25"],
["punctuation", ";"],
["keyword", "goto"],
["keyword", "case"],
["string", "\"1\""],
["punctuation", ";"],
["keyword", "case"],
["string", "\"3\""],
["punctuation", ":"],
["keyword", "case"],
["string", "\"large\""],
["punctuation", ":"],
"\n\t\tcost ",
"\r\n\t\tcost ",
["operator", "+="],
["number", "50"],
["punctuation", ";"],
["keyword", "goto"],
["keyword", "case"],
["string", "\"1\""],
["punctuation", ";"],
["keyword", "default"],
["punctuation", ":"],
"\n\t\tConsole",
"\r\n\t\tConsole",
["punctuation", "."],
["function", "WriteLine"],
["punctuation", "("],
["string", "\"Invalid selection. Please select 1, 2, or 3.\""],
["punctuation", ")"],
["punctuation", ";"],
["keyword", "break"],
["punctuation", ";"],
["punctuation", "}"],
["keyword", "switch"],
["punctuation", "("],
"sh",
["punctuation", ")"],
["punctuation", "{"],
["comment", "// Note that this code never evaluates to true."],
["keyword", "case"],
["class-name", [
"Shape"
]],
["class-name", ["Shape"]],
" shape ",
["keyword", "when"],
" shape ",
["operator", "=="],
["keyword", "null"],
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
["keyword", "null"],
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
["class-name", [
"Rectangle"
]],
["class-name", ["Rectangle"]],
" r ",
["keyword", "when"],
" r",
@ -402,26 +447,33 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", ">"],
["number", "0"],
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "default"],
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["punctuation", "}"],
["keyword", "switch"],
["punctuation", "("],
"coll",
["punctuation", ")"],
["punctuation", "{"],
["keyword", "case"],
["class-name", [
"Array"
]],
["class-name", ["Array"]],
" arr",
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
["class-name", [
"IEnumerable",
@ -431,21 +483,28 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
]],
" ieInt",
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
["class-name", [
["keyword", "object"]
]],
" o",
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "default"],
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["punctuation", "}"],
["return-type", [
["keyword", "bool"]
]],
@ -459,6 +518,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "=>"],
" x ",
["keyword", "is"],
["operator", ">="],
["number", "0"],
["keyword", "and"],
@ -466,6 +526,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["number", "100"],
["keyword", "or"],
["comment", "// integer tests"],
["operator", ">="],
["number", "0F"],
["keyword", "and"],
@ -473,6 +534,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["number", "100F"],
["keyword", "or"],
["comment", "// float tests"],
["operator", ">="],
["number", "0D"],
["keyword", "and"],
@ -480,6 +542,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["number", "100D"],
["punctuation", ";"],
["comment", "// double tests"],
["return-type", [
["keyword", "bool"]
]],
@ -500,6 +563,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["operator", "<"],
["number", "100"],
["punctuation", ";"],
["keyword", "case"],
["punctuation", "("],
["number", "0"],
@ -510,6 +574,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
" x",
["punctuation", ")"],
["punctuation", ":"],
["keyword", "case"],
["punctuation", "("],
["class-name", [
@ -520,19 +585,22 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["number", "0"],
["punctuation", ")"],
["punctuation", ":"],
"\n\tConsole",
"\r\n\tConsole",
["punctuation", "."],
["function", "WriteLine"],
["punctuation", "("],
"x",
["punctuation", ")"],
["punctuation", ";"],
["keyword", "case"],
["operator", "<"],
["number", "2"],
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["keyword", "case"],
["number", "0"],
["keyword", "or"],
@ -548,6 +616,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
["punctuation", ":"],
["keyword", "break"],
["punctuation", ";"],
["class-name", [
["keyword", "int"]
]],

View File

@ -5,9 +5,7 @@ a.$name
[
["variable", "$name"],
"\na",
["punctuation", "."],
["variable", "$name"]
"\r\na", ["punctuation", "."], ["variable", "$name"]
]
----------------------------------------------------

View File

@ -13,7 +13,7 @@ payload.myFunction(1,2,3)
["number", "123"],
["punctuation", ")"],
"\npayload",
"\r\npayload",
["punctuation", "."],
["function", "myFunction"],
["punctuation", "("],
@ -24,5 +24,7 @@ payload.myFunction(1,2,3)
["number", "3"],
["punctuation", ")"]
]
----------------------------------------------------
Check for functions
Check for functions

View File

@ -42,7 +42,7 @@ payload match {
["keyword", "type"],
" T ",
["operator", "="],
" String\n",
" String\r\n",
["keyword", "fun"],
["function", "test"],
@ -73,7 +73,7 @@ payload match {
["operator", "->"],
" x ",
["keyword", "as"],
" String\n",
" String\r\n",
["punctuation", "}"],
@ -105,7 +105,7 @@ payload match {
["keyword", "else"],
" \npayload ",
" \r\npayload ",
["keyword", "match"],
["punctuation", "{"],
@ -116,9 +116,11 @@ payload match {
["operator", "->"],
" x ",
["keyword", "as"],
" String\n",
" String\r\n",
["punctuation", "}"]
]
----------------------------------------------------
Check for keywords
Check for keywords

View File

@ -19,37 +19,37 @@ payload.name?
[
"a ",
["operator", ">"],
" b\nc ",
" b\r\nc ",
["operator", "<"],
" d\na ",
" d\r\na ",
["operator", "="],
["number", "1"],
"\na ",
"\r\na ",
["operator", "<<"],
["number", "1"],
"\nb ",
"\r\nb ",
["operator", ">>"],
["number", "2"],
"\nd ",
"\r\nd ",
["operator", "<="],
["number", "2"],
"\ne ",
"\r\ne ",
["operator", ">="],
["number", "3"],
"\nf ",
"\r\nf ",
["operator", "!="],
["number", "4"],
"\ng ",
"\r\ng ",
["operator", "~="],
["number", "4"],
"\nh ",
"\r\nh ",
["operator", "=="],
["number", "1"],
@ -59,19 +59,21 @@ payload.name?
["operator", "->"],
["number", "1"],
"\na ",
"\r\na ",
["operator", "++"],
" b\nc ",
" b\r\nc ",
["operator", "--"],
" d\npayload",
" d\r\npayload",
["punctuation", "."],
"name",
["operator", "!"],
"\npayload",
"\r\npayload",
["punctuation", "."],
"name",
["operator", "?"]
]
----------------------------------------------------
Check for operators
Check for operators

View File

@ -12,7 +12,7 @@
[
["comment", "-- comment"],
["comment", "{-\n\tcomment\n\t{-\n\t\tnested comment\n\t-}\n-}"]
["comment", "{-\r\n\tcomment\r\n\t{-\r\n\t\tnested comment\r\n\t-}\r\n-}"]
]
----------------------------------------------------

View File

@ -14,45 +14,32 @@ foo/${bar}
----------------------------------------------------
[
["string", [
"\"\""
]],
["string", [
"\"foo\""
]],
["string", [
"\"\\\"\""
]],
["string", ["\"\""]],
["string", ["\"foo\""]],
["string", ["\"\\\"\""]],
["string", [
"\"foo/",
["interpolation", [
["punctuation", "${"],
["expression", [
"bar"
]],
["expression", ["bar"]],
["punctuation", "}"]
]],
"\""
]],
["string", [
"''foo''"
]],
["string", [
"''bar'''baz''"
]],
["string", ["''foo''"]],
["string", ["''bar'''baz''"]],
["string", [
"''\nfoo/",
"''\r\nfoo/",
["interpolation", [
["punctuation", "${"],
["expression", [
"bar"
]],
["expression", ["bar"]],
["punctuation", "}"]
]],
"\n''"
"\r\n''"
]]
]

View File

@ -6,7 +6,7 @@ bar%>
[
["ejs", [
["delimiter", "<%"],
["comment", "#foo\nbar"],
["comment", "#foo\r\nbar"],
["delimiter", "%>"]
]]
]

View File

@ -27,30 +27,79 @@ multiline
----------------------------------------------------
[
[ "doc", [ [ "attribute", "@doc" ], [ "string", "\"single\"" ] ] ],
[ "doc", [ [ "attribute", "@doc" ], [ "string", "'single'" ] ] ],
[ "doc", [ [ "attribute", "@doc" ], [ "string", "\"\"\"triple\"\"\"" ] ] ],
[ "doc", [ [ "attribute", "@doc" ], [ "string", "'''triple'''" ] ] ],
[ "doc", [ [ "attribute", "@doc" ], [ "string", "'''\nmultiline\n'''" ] ] ],
[ "doc", [ [ "attribute", "@doc" ], [ "string", "\"\"\"\nmultiline\n\"\"\"" ] ] ],
[ "attribute", "@doc" ],
[ "attr-name", "since:" ],
[ "string", [ "\"1.3.0\"" ] ],
[ "attribute", "@doc" ],
[ "attr-name", "deprecated:" ],
[ "string", [ "\"phased out\"" ] ],
[ "doc", [ [ "attribute", "@moduledoc" ], [ "string", "\"single\"" ] ] ],
[ "doc", [ [ "attribute", "@moduledoc" ], [ "string", "'single'" ] ] ],
[ "doc", [ [ "attribute", "@moduledoc" ], [ "string", "\"\"\"triple\"\"\"" ] ] ],
[ "doc", [ [ "attribute", "@moduledoc" ], [ "string", "'''triple'''" ] ] ],
[ "doc", [ [ "attribute", "@moduledoc" ], [ "string", "'''\nmultiline\n'''" ] ] ],
[ "doc", [ [ "attribute", "@moduledoc" ], [ "string", "\"\"\"\nmultiline\n\"\"\"" ] ] ],
[ "attribute", "@moduledoc" ],
[ "attr-name", "since:" ],
[ "string", [ "\"1.3.0\"" ] ],
[ "attribute", "@moduledoc" ],
[ "attr-name", "deprecated:" ],
[ "string", [ "\"phased out\"" ] ]
]
["doc", [
["attribute", "@doc"],
["string", "\"single\""]
]],
----------------------------------------------------
["doc", [
["attribute", "@doc"],
["string", "'single'"]
]],
["doc", [
["attribute", "@doc"],
["string", "\"\"\"triple\"\"\""]
]],
["doc", [
["attribute", "@doc"],
["string", "'''triple'''"]
]],
["doc", [
["attribute", "@doc"],
["string", "'''\r\nmultiline\r\n'''"]
]],
["doc", [
["attribute", "@doc"],
["string", "\"\"\"\r\nmultiline\r\n\"\"\""]
]],
["attribute", "@doc"],
["attr-name", "since:"],
["string", ["\"1.3.0\""]],
["attribute", "@doc"],
["attr-name", "deprecated:"],
["string", ["\"phased out\""]],
["doc", [
["attribute", "@moduledoc"],
["string", "\"single\""]
]],
["doc", [
["attribute", "@moduledoc"],
["string", "'single'"]
]],
["doc", [
["attribute", "@moduledoc"],
["string", "\"\"\"triple\"\"\""]
]],
["doc", [
["attribute", "@moduledoc"],
["string", "'''triple'''"]
]],
["doc", [
["attribute", "@moduledoc"],
["string", "'''\r\nmultiline\r\n'''"]
]],
["doc", [
["attribute", "@moduledoc"],
["string", "\"\"\"\r\nmultiline\r\n\"\"\""]
]],
["attribute", "@moduledoc"],
["attr-name", "since:"],
["string", ["\"1.3.0\""]],
["attribute", "@moduledoc"],
["attr-name", "deprecated:"],
["string", ["\"phased out\""]]
]

View File

@ -7,21 +7,26 @@ end
----------------------------------------------------
[
["keyword", "defmodule"], ["module", "Math"], ["keyword", "do"],
["keyword", "defmodule"],
["module", "Math"],
["keyword", "do"],
["keyword", "def"],
["function", "sum"],
["punctuation", "("],
"a",
["punctuation", ","],
" b",
["punctuation", ")"],
["keyword", "do"],
["keyword", "def"],
["function", "sum"],
["punctuation", "("],
"a",
["punctuation", ","],
" b",
["punctuation", ")"],
["keyword", "do"],
"\n a ", ["operator", "+"], " b\n ",
"\r\n a ",
["operator", "+"],
" b\r\n ",
["keyword", "end"],
["keyword", "end"]
["keyword", "end"],
["keyword", "end"]
]
----------------------------------------------------

View File

@ -21,10 +21,9 @@
["comment", "# this is a block comment "],
["delimiter", "%>"]
]],
["erb", [
["delimiter", "<%"],
["comment", "=begin %>\n\tblock comment\n\t(both lines of both the begin and end tags must be at the start of their lines)\n<%\n=end"],
["comment", "=begin %>\r\n\tblock comment\r\n\t(both lines of both the begin and end tags must be at the start of their lines)\r\n<%\r\n=end"],
["delimiter", "%>"]
]],
@ -33,21 +32,14 @@
["comment", "# this is not "],
["delimiter", "%>"]
]],
["erb", [
["delimiter", "<%"],
["operator", "="],
["keyword", "begin"],
["delimiter", "%>"]
["operator", "="], ["keyword", "begin"], ["delimiter", "%>"]
]],
"\n\tnot a comment\n\t",
"\r\n\tnot a comment\r\n\t",
["erb", [
["delimiter", "<%"],
["operator", "="],
["keyword", "end"],
["delimiter", "%>"]
["operator", "="], ["keyword", "end"], ["delimiter", "%>"]
]]
]

View File

@ -6,7 +6,7 @@
----------------------------------------------------
[
["character-code", "'\n"], ["character-code", "'\t"],
["character-code", "'\r\n"], ["character-code", "'\t"],
["character-code", "' "],
["character-code", "''"]
]

View File

@ -11,7 +11,7 @@
----------------------------------------------------
[
["comment", "{\n}"],
["comment", "{\r\n}"],
["comment", "{!#$%&'*+,-./:;=>?@[\\]^_`|~ßø}"],
["comment", "{\"\"}"],
["comment", "{foo}"],

View File

@ -9,7 +9,7 @@
----------------------------------------------------
[
["string", "\"\n\""],
["string", "\"\r\n\""],
["string", "\"!#$%&'*+,-./:;=>?@[\\]^_`|~ßø\""],
["string", "\"\""],
["string", "\"\""], ["string", "\"\""],

View File

@ -34,51 +34,172 @@ exception Error2 of string * int
----------------------------------------------------
[
["keyword", "let"], " func ",
["punctuation", ":"], ["class-name", ["HttpFunc"]],
["operator", "="], " handler ", ["punctuation", "("],
"Some ", ["operator", ">>"], " Task", ["punctuation", "."], "FromResult",
["keyword", "let"],
" func ",
["punctuation", ":"],
["class-name", ["HttpFunc"]],
["operator", "="],
" handler ",
["punctuation", "("],
"Some ",
["operator", ">>"],
" Task",
["punctuation", "."],
"FromResult",
["punctuation", ")"],
["keyword", "type"], ["class-name", ["Base1"]], ["punctuation", "("], ["punctuation", ")"], ["operator", "="],
["keyword", "abstract"], ["keyword", "member"], " F ", ["punctuation", ":"],
["keyword", "type"],
["class-name", ["Base1"]],
["punctuation", "("],
["punctuation", ")"],
["operator", "="],
["keyword", "abstract"],
["keyword", "member"],
" F ",
["punctuation", ":"],
["class-name", [
"unit ", ["operator", "->"], " unit"]
],
["keyword", "default"], " u", ["punctuation", "."], ["function", "F"], ["punctuation", "("], ["punctuation", ")"],
["operator", "="], "\n printfn ", ["string", "\"F Base1\""],
"unit ",
["operator", "->"],
" unit"
]],
["keyword", "type"], ["class-name", ["Derived1"]], ["punctuation", "("], ["punctuation", ")"], ["operator", "="],
["keyword", "inherit"], ["class-name", ["Base1"]], ["punctuation", "("], ["punctuation", ")"],
["keyword", "override"], " u", ["punctuation", "."], ["function", "F"], ["punctuation", "("], ["punctuation", ")"], ["operator", "="],
"\n printfn ", ["string", "\"F Derived1\""],
["keyword", "default"],
" u",
["punctuation", "."],
["function", "F"],
["punctuation", "("],
["punctuation", ")"],
["operator", "="],
["keyword", "let"], " d1 ", ["punctuation", ":"], ["class-name", ["Derived1"]], ["operator", "="],
["function", "Derived1"], ["punctuation", "("], ["punctuation", ")"],
"\r\n printfn ",
["string", "\"F Base1\""],
["keyword", "let"], " base1 ", ["operator", "="], " d1 ", ["operator", ":>"], ["class-name", ["Base1"]],
["keyword", "type"],
["class-name", ["Derived1"]],
["punctuation", "("],
["punctuation", ")"],
["operator", "="],
["keyword", "let"], " derived1 ", ["operator", "="], " base1 ", ["operator", ":?>"], ["class-name", ["Derived1"]],
["keyword", "inherit"],
["class-name", ["Base1"]],
["punctuation", "("],
["punctuation", ")"],
["keyword", "type"], ["class-name", ["PersonName"]], ["operator", "="],
["operator", "|"], " FirstOnly ", ["keyword", "of"], ["class-name", ["string"]],
["operator", "|"], " LastOnly ", ["keyword", "of"], ["class-name", ["string"]],
["operator", "|"], " FirstLast ", ["keyword", "of"], ["class-name", ["string ", ["operator", "*"], " string"]],
["keyword", "override"],
" u",
["punctuation", "."],
["function", "F"],
["punctuation", "("],
["punctuation", ")"],
["operator", "="],
["keyword", "type"], ["class-name", ["Shape"]], ["operator", "="],
["operator", "|"], " Rectangle ", ["keyword", "of"],
" height ", ["punctuation", ":"], ["class-name", ["float"]], ["operator", "*"],
" width ", ["punctuation", ":"], ["class-name", ["float"]],
["operator", "|"], " Circle ", ["keyword", "of"], " radius ", ["punctuation", ":"], ["class-name", ["float"]],
"\r\n printfn ",
["string", "\"F Derived1\""],
["keyword", "type"], ["class-name", ["MyInterface"]], ["operator", "="],
["keyword", "abstract"], ["keyword", "member"], " Add", ["punctuation", ":"],
["class-name", ["int ", ["operator", "->"], " int ", ["operator", "->"], " int"]],
["keyword", "abstract"], ["keyword", "member"], " Pi ", ["punctuation", ":"], ["class-name", ["float"]],
["keyword", "let"],
" d1 ",
["punctuation", ":"],
["class-name", ["Derived1"]],
["operator", "="],
["function", "Derived1"],
["punctuation", "("],
["punctuation", ")"],
["keyword", "exception"], ["class-name", ["Error1"]], ["keyword", "of"], ["class-name", ["string"]],
["keyword", "let"],
" base1 ",
["operator", "="],
" d1 ",
["operator", ":>"],
["class-name", ["Base1"]],
["keyword", "exception"], ["class-name", ["Error2"]], ["keyword", "of"], ["class-name", ["string ", ["operator", "*"], " int"]]
["keyword", "let"],
" derived1 ",
["operator", "="],
" base1 ",
["operator", ":?>"],
["class-name", ["Derived1"]],
["keyword", "type"],
["class-name", ["PersonName"]],
["operator", "="],
["operator", "|"],
" FirstOnly ",
["keyword", "of"],
["class-name", ["string"]],
["operator", "|"],
" LastOnly ",
["keyword", "of"],
["class-name", ["string"]],
["operator", "|"],
" FirstLast ",
["keyword", "of"],
["class-name", [
"string ",
["operator", "*"],
" string"
]],
["keyword", "type"],
["class-name", ["Shape"]],
["operator", "="],
["operator", "|"],
" Rectangle ",
["keyword", "of"],
" height ",
["punctuation", ":"],
["class-name", ["float"]],
["operator", "*"],
" width ",
["punctuation", ":"],
["class-name", ["float"]],
["operator", "|"],
" Circle ",
["keyword", "of"],
" radius ",
["punctuation", ":"],
["class-name", ["float"]],
["keyword", "type"],
["class-name", ["MyInterface"]],
["operator", "="],
["keyword", "abstract"],
["keyword", "member"],
" Add",
["punctuation", ":"],
["class-name", [
"int ",
["operator", "->"],
" int ",
["operator", "->"],
" int"
]],
["keyword", "abstract"],
["keyword", "member"],
" Pi ",
["punctuation", ":"],
["class-name", ["float"]],
["keyword", "exception"],
["class-name", ["Error1"]],
["keyword", "of"],
["class-name", ["string"]],
["keyword", "exception"],
["class-name", ["Error2"]],
["keyword", "of"],
["class-name", [
"string ",
["operator", "*"],
" int"
]]
]
----------------------------------------------------

View File

@ -6,9 +6,9 @@ E420:420
----------------------------------------------------
[
["property", "X"], "123\n",
["property", "Y"], "0.2\n",
["property", "Z"], "-3.1415\n",
["property", "X"], "123\r\n",
["property", "Y"], "0.2\r\n",
["property", "Z"], "-3.1415\r\n",
["property", "E"], "420", ["punctuation", ":"], "420"
]

View File

@ -16,21 +16,18 @@ func add(reference: Item, amount: int) -> Item:
----------------------------------------------------
[
["keyword", "class_name"],
["class-name", "Foo"],
["keyword", "extends"],
["class-name", "Bar"],
["keyword", "class_name"], ["class-name", "Foo"],
["keyword", "extends"], ["class-name", "Bar"],
["keyword", "class"],
["class-name", "InnerClass"],
["punctuation", ":"],
["keyword", "class"], ["class-name", "InnerClass"], ["punctuation", ":"],
["keyword", "export"],
["punctuation", "("],
["class-name", "int"],
["punctuation", ")"],
["keyword", "var"],
" baz\n",
" baz\r\n",
["keyword", "export"],
["punctuation", "("],
["class-name", "int"],
@ -38,12 +35,9 @@ func add(reference: Item, amount: int) -> Item:
["number", "0"],
["punctuation", ")"],
["keyword", "var"],
" i\n\n",
" i\r\n\r\n",
["keyword", "return"],
" foo ",
["keyword", "as"],
["class-name", "Node"],
["keyword", "return"], " foo ", ["keyword", "as"], ["class-name", "Node"],
["keyword", "const"],
["constant", "FOO"],
@ -51,6 +45,7 @@ func add(reference: Item, amount: int) -> Item:
["class-name", "int"],
["operator", "="],
["number", "9"],
["keyword", "var"],
" bar",
["punctuation", ":"],

View File

@ -18,7 +18,9 @@
["string", "'bar'"],
["string", "\"\\\"'foo'\\\"\""],
["string", "'\"\\'bar\\'\"'"],
["string", "\"\"\"\n\"baz\"\n\"\"\""],
["string", "\"\"\"\r\n\"baz\"\r\n\"\"\""],
["string", "@\"foo\""],
["string", "@'bar'"],
["string", "@\"\"\"baz\"\"\""]

View File

@ -13,27 +13,29 @@ enum Color {
----------------------------------------------------
[
["keyword", "enum"],
["class-name", "Color"],
["punctuation", "{"],
["keyword", "enum"], ["class-name", "Color"], ["punctuation", "{"],
["constant", "RED"],
["constant", "GREEN"],
["constant", "BLUE"],
["punctuation", "}"],
["punctuation", "{"],
"\n\tfoo",
"\r\n\tfoo",
["punctuation", "("],
["attr-name", "bar"],
["punctuation", ":"],
["constant", "RED"],
["punctuation", ")"],
["punctuation", "{"],
"\n\t\tbaz\n\t",
"\r\n\t\tbaz\r\n\t",
["punctuation", "}"],
["punctuation", "}"]
]
----------------------------------------------------
Checks for constants.
Checks for constants.

View File

@ -6,7 +6,8 @@ END_VAR
[
["class-name", "VAR"],
"\n varname ",
"\r\n varname ",
["keyword", "AT"],
["symbol", "%QX1.0.0"],
["operator", ":"],
@ -14,6 +15,7 @@ END_VAR
["operator", ":="],
["boolean", "TRUE"],
["punctuation", ";"],
["class-name", "END_VAR"]
]

View File

@ -1,4 +1,4 @@
#
#
;
#
;
@ -42,7 +42,7 @@ foobar;
["comment", ";[foo]"],
["comment", ";foo=bar"],
["comment", ";foobar"],
"\nfoo#bar\nfoobar#\nfoo;bar\nfoobar;"
"\r\nfoo#bar\r\nfoobar#\r\nfoo;bar\r\nfoobar;"
]
----------------------------------------------------

View File

@ -1,4 +1,4 @@
bar1 =
bar1 =
"bar2" =
'bar3' =
bar4 =
@ -32,36 +32,127 @@ bar30=baz30=qux30
----------------------------------------------------
[
["key", "bar1"], ["punctuation", "="],
["key", "\"bar2\""], ["punctuation", "="],
["key", "'bar3'"], ["punctuation", "="],
["key", "bar4"], ["punctuation", "="],
["key", "\" bar5 \""], ["punctuation", "="],
["key", "\"bar6\""], ["punctuation", "="],
["key", "' bar7 '"], ["punctuation", "="],
["key", "'bar8'"], ["punctuation", "="],
["punctuation", "="], ["value", ["baz9"]],
["punctuation", "="], ["value", ["\"", ["inner-value", "baz10"], "\""]],
["punctuation", "="], ["value", ["'", ["inner-value", "baz11"], "'"]],
["punctuation", "="], ["value", ["baz12"]],
["punctuation", "="], ["value", ["\"", ["inner-value", " baz13 "], "\""]],
["punctuation", "="], ["value", ["\"", ["inner-value", "b14\"a14\"z14"], "\""]],
["punctuation", "="], ["value", ["\"", ["inner-value", "baz15"], "\""]],
["punctuation", "="], ["value", ["\"baz16"]],
["punctuation", "="], ["value", ["'", ["inner-value", " baz17 "], "'"]],
["punctuation", "="], ["value", ["'", ["inner-value", "baz18"], "'"]],
["punctuation", "="], ["value", ["b19\"a19\"z19"]],
["punctuation", "="], ["value", ["b20\"az20"]],
["punctuation", "="], ["value", ["ba21\"z21"]],
["punctuation", "="], ["value", ["baz22"]],
["punctuation", "="], ["value", ["baz23\""]],
"\nbar24\n",
["key", "bar25 baz25"], ["punctuation", "="], ["value", ["qux25"]],
["key", "bar26"], ["punctuation", "="],
["key", "bar27"], ["punctuation", "="], ["value", ["=baz27"]],
["key", "bar28"], ["punctuation", "="], ["value", ["baz28"]],
["key", "bar29"], ["punctuation", "="], ["value", ["baz29 qux29"]],
["key", "bar30"], ["punctuation", "="], ["value", ["baz30=qux30"]]
["key", "bar1"],
["punctuation", "="],
["key", "\"bar2\""],
["punctuation", "="],
["key", "'bar3'"],
["punctuation", "="],
["key", "bar4"],
["punctuation", "="],
["key", "\" bar5 \""],
["punctuation", "="],
["key", "\"bar6\""],
["punctuation", "="],
["key", "' bar7 '"],
["punctuation", "="],
["key", "'bar8'"],
["punctuation", "="],
["punctuation", "="],
["value", ["baz9"]],
["punctuation", "="],
["value", [
"\"",
["inner-value", "baz10"],
"\""
]],
["punctuation", "="],
["value", [
"'",
["inner-value", "baz11"],
"'"
]],
["punctuation", "="],
["value", ["baz12"]],
["punctuation", "="],
["value", [
"\"",
["inner-value", " baz13 "],
"\""
]],
["punctuation", "="],
["value", [
"\"",
["inner-value", "b14\"a14\"z14"],
"\""
]],
["punctuation", "="],
["value", [
"\"",
["inner-value", "baz15"],
"\""
]],
["punctuation", "="],
["value", ["\"baz16"]],
["punctuation", "="],
["value", [
"'",
["inner-value", " baz17 "],
"'"
]],
["punctuation", "="],
["value", [
"'",
["inner-value", "baz18"],
"'"
]],
["punctuation", "="],
["value", ["b19\"a19\"z19"]],
["punctuation", "="],
["value", ["b20\"az20"]],
["punctuation", "="],
["value", ["ba21\"z21"]],
["punctuation", "="],
["value", ["baz22"]],
["punctuation", "="],
["value", ["baz23\""]],
"\r\nbar24\r\n",
["key", "bar25 baz25"],
["punctuation", "="],
["value", ["qux25"]],
["key", "bar26"],
["punctuation", "="],
["key", "bar27"],
["punctuation", "="],
["value", ["=baz27"]],
["key", "bar28"],
["punctuation", "="],
["value", ["baz28"]],
["key", "bar29"],
["punctuation", "="],
["value", ["baz29 qux29"]],
["key", "bar30"],
["punctuation", "="],
["value", ["baz30=qux30"]]
]
----------------------------------------------------

View File

@ -11,7 +11,7 @@ comment
["comment", "//"],
["comment", "// Foobar"],
["comment", "#!/usr/bin/env io"],
["comment", "/* multiline\ncomment\n*/"]
["comment", "/* multiline\r\ncomment\r\n*/"]
]
----------------------------------------------------

View File

@ -4,15 +4,15 @@
"""this is a "test".
This is only a test."""
-------------------------------------------------------------------------
----------------------------------------------------
[
["string", "\"\""],
["triple-quoted-string", "\"\"\"\"\"\""],
["string", "\"this is a \\\"test\\\".\\nThis is only a test.\""],
["triple-quoted-string", "\"\"\"this is a \"test\".\nThis is only a test.\"\"\""]
["triple-quoted-string", "\"\"\"this is a \"test\".\r\nThis is only a test.\"\"\""]
]
-------------------------------------------------------------------------
----------------------------------------------------
Check strings.

View File

@ -23,29 +23,27 @@ String empty = """
["string", "\"foo\""],
["string", "\"\\\"foo\\\"\""],
["triple-quoted-string", "\"\"\"\nfoo\n\"\"\""],
["triple-quoted-string", "\"\"\"\r\nfoo\r\n\"\"\""],
["keyword", "var"],
" a ",
["operator", "="],
["triple-quoted-string", "\"\"\"\n\\\"\"\"\nfoo\"\"\""],
["triple-quoted-string", "\"\"\"\r\n\\\"\"\"\r\nfoo\"\"\""],
["punctuation", ";"],
["triple-quoted-string", "\"\"\"\nThe quick brown fox\"\"\""],
["triple-quoted-string", "\"\"\"\r\nThe quick brown fox\"\"\""],
["operator", "+"],
["string", "\" \\n\""],
["operator", "+"],
["triple-quoted-string", "\"\"\"\njumps over the lazy dog\n\"\"\""],
["triple-quoted-string", "\"\"\"\r\njumps over the lazy dog\r\n\"\"\""],
["class-name", [
"String"
]],
["class-name", ["String"]],
" empty ",
["operator", "="],
["triple-quoted-string", "\"\"\"\n\"\"\""],
["triple-quoted-string", "\"\"\"\r\n\"\"\""],
["punctuation", ";"]
]
----------------------------------------------------
Checks for strings.
Checks for strings.

View File

@ -25,9 +25,7 @@ foo.Bar = function() {};
["maybe-class-name", "Baz"],
["punctuation", "."],
["method", [
"foo"
]],
["method", ["foo"]],
["punctuation", "("],
["punctuation", ")"],
["punctuation", ";"],
@ -44,7 +42,7 @@ foo.Bar = function() {};
["punctuation", "}"],
["punctuation", ";"],
"\nfoo",
"\r\nfoo",
["punctuation", "."],
["method-variable", [
["maybe-class-name", "Bar"]

View File

@ -7,9 +7,7 @@ this.bar = () => {};
[
"foo",
["punctuation", "."],
["method-variable", [
"bar"
]],
["method-variable", ["bar"]],
["operator", "="],
["keyword", "function"],
["punctuation", "("],
@ -18,11 +16,9 @@ this.bar = () => {};
["punctuation", "}"],
["punctuation", ";"],
"\nfoo",
"\r\nfoo",
["punctuation", "."],
["method-variable", [
"bar"
]],
["method-variable", ["bar"]],
["operator", "="],
["keyword", "async"],
["punctuation", "("],
@ -34,9 +30,7 @@ this.bar = () => {};
["keyword", "this"],
["punctuation", "."],
["method-variable", [
"bar"
]],
["method-variable", ["bar"]],
["operator", "="],
["punctuation", "("],
["punctuation", ")"],

View File

@ -7,31 +7,23 @@ this.#bar();
[
"foo",
["punctuation", "."],
["method", [
"bar"
]],
["method", ["bar"]],
["punctuation", "("],
["punctuation", ")"],
["punctuation", ";"],
"\nfoo",
"\r\nfoo",
["punctuation", "."],
["method", [
"bar"
]],
["method", ["bar"]],
["punctuation", "."],
["method", [
"call"
]],
["method", ["call"]],
["punctuation", "("],
["punctuation", ")"],
["punctuation", ";"],
["keyword", "this"],
["punctuation", "."],
["method", [
"#bar"
]],
["method", ["#bar"]],
["punctuation", "("],
["punctuation", ")"],
["punctuation", ";"]

View File

@ -6,10 +6,22 @@ gl.FLOAT_MAT2x4;
----------------------------------------------------
[
["keyword", "var"], ["constant", "FOO"], ["punctuation", ";"],
["keyword", "const"], ["constant", "FOO_BAR"], ["punctuation", ";"],
["keyword", "const"], ["constant", "BAZ42"], ["punctuation", ";"],
"\ngl", ["punctuation", "."], ["constant", "FLOAT_MAT2x4"], ["punctuation", ";"]
["keyword", "var"],
["constant", "FOO"],
["punctuation", ";"],
["keyword", "const"],
["constant", "FOO_BAR"],
["punctuation", ";"],
["keyword", "const"],
["constant", "BAZ42"],
["punctuation", ";"],
"\r\ngl",
["punctuation", "."],
["constant", "FLOAT_MAT2x4"],
["punctuation", ";"]
]
----------------------------------------------------

View File

@ -10,7 +10,8 @@ foo.var.new;
["punctuation", "("],
["punctuation", ")"],
["punctuation", ";"],
"\nfoo",
"\r\nfoo",
["punctuation", "."],
"var",
["punctuation", "."],

View File

@ -17,7 +17,7 @@ fooBar.prototype.bar;
"constructor",
["punctuation", ";"],
"\nfooBar",
"\r\nfooBar",
["punctuation", "."],
"prototype",
["punctuation", "."],

View File

@ -42,7 +42,7 @@ at at.foo.bar.Main$FooBar.main(Native Method)
]],
["punctuation", ")"]
]],
" Same but with some additional notes\n",
" Same but with some additional notes\r\n",
["stack-frame", [
["keyword", "at"],
@ -233,7 +233,7 @@ at at.foo.bar.Main$FooBar.main(Native Method)
["punctuation", ")"]
]],
"\n\n// not to forget our swiss friends\n",
"\r\n\r\n// not to forget our swiss friends\r\n",
["stack-frame", [
["keyword", "at"],
["namespace", [

View File

@ -18,6 +18,7 @@ println @ Console( "none" )()
" Third"
]]
]],
["keyword", "Redirects"],
["operator", ":"],
["redirects", [
@ -29,19 +30,22 @@ println @ Console( "none" )()
["symbol", "=>"],
["function", "Fourth"]
]],
["keyword", "Jolie"],
["operator", ":"],
["string", "\"logger.ol\""],
["keyword", "in"],
["function", "LoggerService"],
"\nlog",
"\r\nlog",
["symbol", "@"],
["function", "LoggerService"],
"( ",
["keyword", "new"],
" )()",
["symbol", ";"],
"\nprintln ",
"\r\nprintln ",
["symbol", "@"],
["function", "Console"],
"( ",

View File

@ -28,14 +28,15 @@
----------------------------------------------------
[
"/**\n * ",
"/**\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
"number",
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -44,7 +45,8 @@
" string",
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -63,7 +65,8 @@
["punctuation", ">"],
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -87,7 +90,8 @@
["punctuation", "}"],
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -110,7 +114,8 @@
["punctuation", "]"],
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -121,7 +126,8 @@
["number", "2"],
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -130,7 +136,8 @@
" string",
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -139,7 +146,8 @@
" Type2",
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -152,7 +160,8 @@
"Bar",
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -162,14 +171,16 @@
["punctuation", "]"],
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
["operator", "*"],
["punctuation", "}"]
]],
"\n * ",
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -179,73 +190,63 @@
["keyword", "void"],
["punctuation", "}"]
]],
"\n *\n * ",
"\r\n *\r\n * ",
["keyword", "@typedef"],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@typedef"],
["class-name", [
["punctuation", "{"],
"Bar",
["punctuation", "}"]
]],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@template"],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@template"],
["class-name", [
["punctuation", "{"],
"Bar",
["punctuation", "}"]
]],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@augments"],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@extends"],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@class"],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@interface"],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@memberof"],
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@memberof"],
"! ",
["class-name", [
"Foo"
]],
"\n * ",
["class-name", ["Foo"]],
"\r\n * ",
["keyword", "@this"],
["class-name", [
"Foo"
]],
"\n */"
["class-name", ["Foo"]],
"\r\n */"
]
----------------------------------------------------

View File

@ -7,14 +7,16 @@
----------------------------------------------------
[
"/**\n * ",
"/**\r\n * ",
["keyword", "@example"],
["example", [
"* ",
["code", [
["comment", "// returns 3"]
]],
"\n * ",
"\r\n * ",
["code", [
"globalNS",
["punctuation", "."],
@ -27,7 +29,8 @@
["punctuation", ";"]
]]
]],
"\n */"
"\r\n */"
]
----------------------------------------------------

View File

@ -89,92 +89,92 @@
----------------------------------------------------
[
"/**\n * ", ["keyword", "@abstract"],
"\n * ", ["keyword", "@virtual"],
"\n * ", ["keyword", "@access"],
"\n * ", ["keyword", "@alias"],
"\n * ", ["keyword", "@async"],
"\n * ", ["keyword", "@augments"],
"\n * ", ["keyword", "@extends"],
"\n * ", ["keyword", "@author"],
"\n * ", ["keyword", "@borrows"],
"\n * ", ["keyword", "@callback"],
"\n * ", ["keyword", "@class"],
"\n * ", ["keyword", "@constructor"],
"\n * ", ["keyword", "@hideconstructor"],
"\n * ", ["keyword", "@classdesc"],
"\n * ", ["keyword", "@constant"],
"\n * ", ["keyword", "@const"],
"\n * ", ["keyword", "@constructs"],
"\n * ", ["keyword", "@copyright"],
"\n * ", ["keyword", "@default"],
"\n * ", ["keyword", "@defaultValue"],
"\n * ", ["keyword", "@deprecated"],
"\n * ", ["keyword", "@description"],
"\n * ", ["keyword", "@desc"],
"\n * ", ["keyword", "@enum"],
"\n * ", ["keyword", "@event"],
"\n * ", ["keyword", "@exports"],
"\n * ", ["keyword", "@external"],
"\n * ", ["keyword", "@host"],
"\n * ", ["keyword", "@file"],
"\n * ", ["keyword", "@overview"],
"\n * ", ["keyword", "@fileoverview"],
"\n * ", ["keyword", "@fires"],
"\n * ", ["keyword", "@emits"],
"\n * ", ["keyword", "@function"],
"\n * ", ["keyword", "@func"],
"\n * ", ["keyword", "@method"],
"\n * ", ["keyword", "@generator"],
"\n * ", ["keyword", "@global"],
"\n * ", ["keyword", "@ignore"],
"\n * ", ["keyword", "@implements"],
"\n * ", ["keyword", "@inheritdoc"],
"\n * ", ["keyword", "@inner"],
"\n * ", ["keyword", "@instance"],
"\n * ", ["keyword", "@interface"],
"\n * ", ["keyword", "@kind"],
"\n * ", ["keyword", "@lends"],
"\n * ", ["keyword", "@license"],
"\n * ", ["keyword", "@listens"],
"\n * ", ["keyword", "@member"],
"\n * ", ["keyword", "@var"],
"\n * ", ["keyword", "@memberof"],
"\n * ", ["keyword", "@mixes"],
"\n * ", ["keyword", "@mixin"],
"\n * ", ["keyword", "@module"],
"\n * ", ["keyword", "@name"],
"\n * ", ["keyword", "@namespace"],
"\n * ", ["keyword", "@override"],
"\n * ", ["keyword", "@package"],
"\n * ", ["keyword", "@param"],
"\n * ", ["keyword", "@arg"],
"\n * ", ["keyword", "@argument"],
"\n * ", ["keyword", "@private"],
"\n * ", ["keyword", "@property"],
"\n * ", ["keyword", "@prop"],
"\n * ", ["keyword", "@protected"],
"\n * ", ["keyword", "@public"],
"\n * ", ["keyword", "@readonly"],
"\n * ", ["keyword", "@requires"],
"\n * ", ["keyword", "@return"],
"\n * ", ["keyword", "@returns"],
"\n * ", ["keyword", "@see"],
"\n * ", ["keyword", "@since"],
"\n * ", ["keyword", "@static"],
"\n * ", ["keyword", "@summary"],
"\n * ", ["keyword", "@this"],
"\n * ", ["keyword", "@throws"],
"\n * ", ["keyword", "@exception"],
"\n * ", ["keyword", "@todo"],
"\n * ", ["keyword", "@tutorial"],
"\n * ", ["keyword", "@type"],
"\n * ", ["keyword", "@typedef"],
"\n * ", ["keyword", "@variation"],
"\n * ", ["keyword", "@version"],
"\n * ", ["keyword", "@yield"],
"\n * ", ["keyword", "@yields"],
"\n */"
"/**\r\n * ", ["keyword", "@abstract"],
"\r\n * ", ["keyword", "@virtual"],
"\r\n * ", ["keyword", "@access"],
"\r\n * ", ["keyword", "@alias"],
"\r\n * ", ["keyword", "@async"],
"\r\n * ", ["keyword", "@augments"],
"\r\n * ", ["keyword", "@extends"],
"\r\n * ", ["keyword", "@author"],
"\r\n * ", ["keyword", "@borrows"],
"\r\n * ", ["keyword", "@callback"],
"\r\n * ", ["keyword", "@class"],
"\r\n * ", ["keyword", "@constructor"],
"\r\n * ", ["keyword", "@hideconstructor"],
"\r\n * ", ["keyword", "@classdesc"],
"\r\n * ", ["keyword", "@constant"],
"\r\n * ", ["keyword", "@const"],
"\r\n * ", ["keyword", "@constructs"],
"\r\n * ", ["keyword", "@copyright"],
"\r\n * ", ["keyword", "@default"],
"\r\n * ", ["keyword", "@defaultValue"],
"\r\n * ", ["keyword", "@deprecated"],
"\r\n * ", ["keyword", "@description"],
"\r\n * ", ["keyword", "@desc"],
"\r\n * ", ["keyword", "@enum"],
"\r\n * ", ["keyword", "@event"],
"\r\n * ", ["keyword", "@exports"],
"\r\n * ", ["keyword", "@external"],
"\r\n * ", ["keyword", "@host"],
"\r\n * ", ["keyword", "@file"],
"\r\n * ", ["keyword", "@overview"],
"\r\n * ", ["keyword", "@fileoverview"],
"\r\n * ", ["keyword", "@fires"],
"\r\n * ", ["keyword", "@emits"],
"\r\n * ", ["keyword", "@function"],
"\r\n * ", ["keyword", "@func"],
"\r\n * ", ["keyword", "@method"],
"\r\n * ", ["keyword", "@generator"],
"\r\n * ", ["keyword", "@global"],
"\r\n * ", ["keyword", "@ignore"],
"\r\n * ", ["keyword", "@implements"],
"\r\n * ", ["keyword", "@inheritdoc"],
"\r\n * ", ["keyword", "@inner"],
"\r\n * ", ["keyword", "@instance"],
"\r\n * ", ["keyword", "@interface"],
"\r\n * ", ["keyword", "@kind"],
"\r\n * ", ["keyword", "@lends"],
"\r\n * ", ["keyword", "@license"],
"\r\n * ", ["keyword", "@listens"],
"\r\n * ", ["keyword", "@member"],
"\r\n * ", ["keyword", "@var"],
"\r\n * ", ["keyword", "@memberof"],
"\r\n * ", ["keyword", "@mixes"],
"\r\n * ", ["keyword", "@mixin"],
"\r\n * ", ["keyword", "@module"],
"\r\n * ", ["keyword", "@name"],
"\r\n * ", ["keyword", "@namespace"],
"\r\n * ", ["keyword", "@override"],
"\r\n * ", ["keyword", "@package"],
"\r\n * ", ["keyword", "@param"],
"\r\n * ", ["keyword", "@arg"],
"\r\n * ", ["keyword", "@argument"],
"\r\n * ", ["keyword", "@private"],
"\r\n * ", ["keyword", "@property"],
"\r\n * ", ["keyword", "@prop"],
"\r\n * ", ["keyword", "@protected"],
"\r\n * ", ["keyword", "@public"],
"\r\n * ", ["keyword", "@readonly"],
"\r\n * ", ["keyword", "@requires"],
"\r\n * ", ["keyword", "@return"],
"\r\n * ", ["keyword", "@returns"],
"\r\n * ", ["keyword", "@see"],
"\r\n * ", ["keyword", "@since"],
"\r\n * ", ["keyword", "@static"],
"\r\n * ", ["keyword", "@summary"],
"\r\n * ", ["keyword", "@this"],
"\r\n * ", ["keyword", "@throws"],
"\r\n * ", ["keyword", "@exception"],
"\r\n * ", ["keyword", "@todo"],
"\r\n * ", ["keyword", "@tutorial"],
"\r\n * ", ["keyword", "@type"],
"\r\n * ", ["keyword", "@typedef"],
"\r\n * ", ["keyword", "@variation"],
"\r\n * ", ["keyword", "@version"],
"\r\n * ", ["keyword", "@yield"],
"\r\n * ", ["keyword", "@yields"],
"\r\n */"
]
----------------------------------------------------

View File

@ -10,27 +10,21 @@
----------------------------------------------------
[
"/**\n * ",
"/**\r\n * ",
["keyword", "@param"],
["parameter", [
"n"
]],
" - A number.\n * ",
["parameter", ["n"]],
" - A number.\r\n * ",
["keyword", "@param"],
["optional-parameter", [
["punctuation", "["],
["parameter", [
"n"
]],
["parameter", ["n"]],
["punctuation", "]"]
]],
" - A number.\n * ",
" - A number.\r\n * ",
["keyword", "@param"],
["optional-parameter", [
["punctuation", "["],
["parameter", [
"n"
]],
["parameter", ["n"]],
["punctuation", "="],
["code", [
["number", "1"],
@ -39,17 +33,15 @@
]],
["punctuation", "]"]
]],
" - A number.\n * ",
" - A number.\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
"number",
["punctuation", "}"]
]],
["parameter", [
"n"
]],
" - A number.\n * ",
["parameter", ["n"]],
" - A number.\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -73,10 +65,9 @@
["punctuation", "}"],
["punctuation", "}"]
]],
["parameter", [
"map"
]],
"\n * ",
["parameter", ["map"]],
"\r\n * ",
["keyword", "@param"],
["class-name", [
["punctuation", "{"],
@ -88,7 +79,8 @@
["punctuation", "."],
"bar"
]],
"\n */"
"\r\n */"
]
----------------------------------------------------

View File

@ -12,8 +12,11 @@ newline"
[
["string", "\"\""],
["string", "\"foo\""],
["string", "\"foo\\\"bar\\\"baz\""],
["string", "\"\\u2642\\\\ \""],
["punctuation", "{"],
@ -27,8 +30,10 @@ newline"
["punctuation", "}"],
["string", "'foo\"bar\"baz'"],
["string", "'\\u0001'"],
["string", "\"\\\nnewline\""]
["string", "\"\\\r\nnewline\""]
]
----------------------------------------------------

View File

@ -15,10 +15,10 @@ $1badb002
----------------------------------------------------
[
"$\n",
"$\r\n",
["number", "$1BADB002"],
["number", "$1badb002"],
"\n.\n",
"\r\n.\r\n",
["number", ".456"],
["number", "123"],
["number", "123."],

View File

@ -8,7 +8,8 @@ multiple lines
[
["comment", "% single line"],
["comment", "%{\nmultiple lines\n%}"]
["comment", "%{\r\nmultiple lines\r\n%}"]
]
----------------------------------------------------

View File

@ -14,16 +14,19 @@ h\fermata
["punctuation", "\\"],
"set"
]],
["keyword", [
["punctuation", "\\"],
"center-column"
]],
["number", "5"],
["keyword", [
["punctuation", "\\"],
"mm"
]],
"\nh",
"\r\nh",
["keyword", [
["punctuation", "\\"],
"fermata"

View File

@ -6,7 +6,7 @@ bar\""
[
["string", "\"foo\""],
["string", "\"foo\nbar\\\"\""]
["string", "\"foo\r\nbar\\\"\""]
]
----------------------------------------------------

View File

@ -62,9 +62,7 @@ UnclosedExpression{ab{cndum dui dolor tincidu{nt [s[fa]sdf [
["command", [
["command-name", "@commandAndGenericTextOnNewLine"]
]],
["generic-text", [
"Massa ut elementum."
]],
["generic-text", ["Massa ut elementum."]],
["command", [
["command-name", "@commandWithParameterAndGenericTextOnNewLine"],
@ -72,9 +70,7 @@ UnclosedExpression{ab{cndum dui dolor tincidu{nt [s[fa]sdf [
["command-param-value", "WideParam"]
]]
]],
["generic-text", [
"Integer"
]],
["generic-text", ["Integer"]],
["generic-text", [
"Escaped braces inside generic text",
@ -89,7 +85,7 @@ UnclosedExpression{ab{cndum dui dolor tincidu{nt [s[fa]sdf [
["bad-line", "UnclosedExpression{ab{cndum dui dolor tincidu{nt [s[fa]sdf ["],
["bad-line", "\"Integer: a = {a} malesuada a + b = {a + b}\", Random(a, b) = {Random(a, b)}, Random(\"foo\", \"bar\", \"foobar\") = {Random(\"foo\", \"bar\", \"foobar\")},}"],
"\n#\n>\n@"
"\r\n#\r\n>\r\n@"
]
----------------------------------------------------

View File

@ -23,12 +23,16 @@ comment
----------------------------------------------------
[
["comment", "/*\ncomment\n*/"],
["comment", "/*\r\ncomment\r\n*/"],
["comment", "REM comment;"],
["comment", "REM comment\nstatement;"],
["comment", "<*\ncomment\n*>"],
["comment", "<*\n<*\ncomment\n*>\n*>"],
["comment", "/+\ncomment\n+/"]
["comment", "REM comment\r\nstatement;"],
["comment", "<*\r\ncomment\r\n*>"],
["comment", "<*\r\n<*\r\ncomment\r\n*>\r\n*>"],
["comment", "/+\r\ncomment\r\n+/"]
]
----------------------------------------------------

View File

@ -117,7 +117,7 @@
----------------------------------------------------
[
["prolog", "<?\n\t// Session starten und confog.php includen\n\tsession_start();\n\tinclude (\"config.php\");\n\n\t// CaptchaCodes abfragen\n\t$CAPTCHA_RandomText = \"\";\n\tif (isset($_POST['txtCode'])){\n\t$CAPTCHA_EnteredText = str_replace(\"<\",\"\",str_replace(\">\",\"\",str_replace(\"'\",\"\",str_replace(\"[\",\"\",str_replace(\"]\",\"\",$_POST['txtCode'])))));\n\t}\n\tif (isset($_SESSION['CAPTCHA_RndText'])) {\n\t$CAPTCHA_RandomText = $_SESSION['CAPTCHA_RndText'];\n\t}\n\n\t// Eingabefelder abfragen\n\t$_SESSION['company'] = $_POST['company'];\n\t$_SESSION['name'] = $_POST['name'];\n\t$_SESSION['address'] = $_POST['address'];\n\t$_SESSION['zip_code'] = $_POST['zip_code'];\n\t$_SESSION['city'] = $_POST['city'];\n\t$_SESSION['county'] = $_POST['county'];\n\t$_SESSION['country'] = $_POST['country'];\n\t$_SESSION['phone'] = $_POST['phone'];\n\t$_SESSION['fax'] = $_POST['fax'];\n\t$_SESSION['email'] = $_POST['email'];\n\t$_SESSION['nachricht'] = $_POST['nachricht'];\n\n\t$email_i = $_SESSION['email'];\n\n\t// Email Funktion\n\tfunction pruefe_mail($email_i) {\n\t\t if(strstr($email_i, \"@\")) {\n\t\t\t$email_i = explode (\"@\", $email_i);\n\t\t\tif(strstr($email_i[1], \".\")) $ok = TRUE;\n\t\t }\n\t\t return $ok;\n\t\t}\n\n\t// Eingaben prüfen\n\t$fehler = \"\";\n\tif(!pruefe_mail($email_i) && !empty($email_i)) {\n\t\t\t$fehler .= \"<li>email</li>\";\n\t\t\t}\n\t\t\tif ($_SESSION['name'] == \"\"){\n\t\t\t$fehler .= \"<li>name</li>\";\n\t\t\t}\n\t\t\tif ($_SESSION['city'] == \"\"){\n\t\t\t$fehler .= \"<li>city</li>\";\n\t\t\t}\n\t\t\tif ($_SESSION['country'] == \"\"){\n\t\t\t$fehler .= \"<li>country</li>\";\n\t\t\t}\n\t\t\tif ($_SESSION['phone'] == \"\"){\n\t\t\t$fehler .= \"<li>phone</li>\";\n\t\t\t}\n\t\t\tif ($_SESSION['email'] == \"\"){\n\t\t\t$fehler .= \"<li>email</li>\";\n\t\t\t}\n\t\t\tif ($_SESSION['message'] == \"\"){\n\t\t\t$fehler .= \"<li>message</li>\";\n\t\t\t}\n\t\t\tif ($CAPTCHA_EnteredText == $CAPTCHA_RandomText and isset($_POST['txtCode']) == true and isset($_SESSION['CAPTCHA_RndText'])){\n\t\t\t$captcha = true;\n\t\t\t} else {\n\t\t\t$fehler .= \"<li>code</li>\";\n\t\t\t}\n\techo '<div>';\n\tif ($fehler == \"\"){\n\t// Email zumsammensetzen\n\t$email = \"From: \" . $_SESSION['email'];\n\n\n\t$nachrichtfertig =\n\t\"Company: \" . $_SESSION['company'] \"n\\\"\n\t\"Name: \" $_SESSION['name'] \"n\\\"\n\t\"Address: \" $_SESSION['address'] \"n\\\"\n\t\"ZIP Code: \" $_SESSION['zip_code'] \"n\\\"\n\t\"City: \" $_SESSION['city'] \"n\\\"\n\t\"County: \" $_SESSION['county'] \"n\\\"\n\t\"Country: \" $_SESSION['country'] \"n\\\"\n\t\"Phone: \" $_SESSION['phone'] \"n\\\"\n\t\"Fax: \" $_SESSION['fax'] \"n\\\"\n\t\"eMail: \" $_SESSION['email'] \"n\\n\\\"\n\t\"Message: \" $_SESSION['message'];\n\n\n\t$versand = mail($empfaenger, $betreff, $nachrichtfertig, $email);\n\t\t\tif ($versand) {\n\t\t\techo '<p class=titles>Thank you very much!</p>\n\t\t\t\t <p>The message were send successfully</p>';\n\n\t\t\t// Sessionvariablen löschen\n\t\t\tunset($_SESSION['company']);\n\t\t\tunset($_SESSION['name']);\n\t\t\tunset($_SESSION['address']);\n\t\t\tunset($_SESSION['zip_code']);\n\t\t\tunset($_SESSION['city']);\n\t\t\tunset($_SESSION['county']);\n\t\t\tunset($_SESSION['country']);\n\t\t\tunset($_SESSION['phone']);\n\t\t\tunset($_SESSION['fax']);\n\t\t\tunset($_SESSION['email']);\n\t\t\tunset($_SESSION['nachricht']);\n\t\t\t}\n\n\t} else {\n\techo '<p class=titles>Error</p>';\n\techo '<p>Please fill in all the $fehler field. <a href=\"contact.php\">back</a></p>';\n\t}\n\techo '</div>';\n\n\t// Session unset\n\tunset($_SESSION['CAPTCHA_RndText']);\n\n?>"]
["prolog", "<?\r\n\t// Session starten und confog.php includen\r\n\tsession_start();\r\n\tinclude (\"config.php\");\r\n\r\n\t// CaptchaCodes abfragen\r\n\t$CAPTCHA_RandomText = \"\";\r\n\tif (isset($_POST['txtCode'])){\r\n\t$CAPTCHA_EnteredText = str_replace(\"<\",\"\",str_replace(\">\",\"\",str_replace(\"'\",\"\",str_replace(\"[\",\"\",str_replace(\"]\",\"\",$_POST['txtCode'])))));\r\n\t}\r\n\tif (isset($_SESSION['CAPTCHA_RndText'])) {\r\n\t$CAPTCHA_RandomText = $_SESSION['CAPTCHA_RndText'];\r\n\t}\r\n\r\n\t// Eingabefelder abfragen\r\n\t$_SESSION['company'] = $_POST['company'];\r\n\t$_SESSION['name'] = $_POST['name'];\r\n\t$_SESSION['address'] = $_POST['address'];\r\n\t$_SESSION['zip_code'] = $_POST['zip_code'];\r\n\t$_SESSION['city'] = $_POST['city'];\r\n\t$_SESSION['county'] = $_POST['county'];\r\n\t$_SESSION['country'] = $_POST['country'];\r\n\t$_SESSION['phone'] = $_POST['phone'];\r\n\t$_SESSION['fax'] = $_POST['fax'];\r\n\t$_SESSION['email'] = $_POST['email'];\r\n\t$_SESSION['nachricht'] = $_POST['nachricht'];\r\n\r\n\t$email_i = $_SESSION['email'];\r\n\r\n\t// Email Funktion\r\n\tfunction pruefe_mail($email_i) {\r\n\t\t if(strstr($email_i, \"@\")) {\r\n\t\t\t$email_i = explode (\"@\", $email_i);\r\n\t\t\tif(strstr($email_i[1], \".\")) $ok = TRUE;\r\n\t\t }\r\n\t\t return $ok;\r\n\t\t}\r\n\r\n\t// Eingaben prüfen\r\n\t$fehler = \"\";\r\n\tif(!pruefe_mail($email_i) && !empty($email_i)) {\r\n\t\t\t$fehler .= \"<li>email</li>\";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['name'] == \"\"){\r\n\t\t\t$fehler .= \"<li>name</li>\";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['city'] == \"\"){\r\n\t\t\t$fehler .= \"<li>city</li>\";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['country'] == \"\"){\r\n\t\t\t$fehler .= \"<li>country</li>\";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['phone'] == \"\"){\r\n\t\t\t$fehler .= \"<li>phone</li>\";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['email'] == \"\"){\r\n\t\t\t$fehler .= \"<li>email</li>\";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['message'] == \"\"){\r\n\t\t\t$fehler .= \"<li>message</li>\";\r\n\t\t\t}\r\n\t\t\tif ($CAPTCHA_EnteredText == $CAPTCHA_RandomText and isset($_POST['txtCode']) == true and isset($_SESSION['CAPTCHA_RndText'])){\r\n\t\t\t$captcha = true;\r\n\t\t\t} else {\r\n\t\t\t$fehler .= \"<li>code</li>\";\r\n\t\t\t}\r\n\techo '<div>';\r\n\tif ($fehler == \"\"){\r\n\t// Email zumsammensetzen\r\n\t$email = \"From: \" . $_SESSION['email'];\r\n\r\n\r\n\t$nachrichtfertig =\r\n\t\"Company: \" . $_SESSION['company'] \"n\\\"\r\n\t\"Name: \" $_SESSION['name'] \"n\\\"\r\n\t\"Address: \" $_SESSION['address'] \"n\\\"\r\n\t\"ZIP Code: \" $_SESSION['zip_code'] \"n\\\"\r\n\t\"City: \" $_SESSION['city'] \"n\\\"\r\n\t\"County: \" $_SESSION['county'] \"n\\\"\r\n\t\"Country: \" $_SESSION['country'] \"n\\\"\r\n\t\"Phone: \" $_SESSION['phone'] \"n\\\"\r\n\t\"Fax: \" $_SESSION['fax'] \"n\\\"\r\n\t\"eMail: \" $_SESSION['email'] \"n\\n\\\"\r\n\t\"Message: \" $_SESSION['message'];\r\n\r\n\r\n\t$versand = mail($empfaenger, $betreff, $nachrichtfertig, $email);\r\n\t\t\tif ($versand) {\r\n\t\t\techo '<p class=titles>Thank you very much!</p>\r\n\t\t\t\t <p>The message were send successfully</p>';\r\n\r\n\t\t\t// Sessionvariablen löschen\r\n\t\t\tunset($_SESSION['company']);\r\n\t\t\tunset($_SESSION['name']);\r\n\t\t\tunset($_SESSION['address']);\r\n\t\t\tunset($_SESSION['zip_code']);\r\n\t\t\tunset($_SESSION['city']);\r\n\t\t\tunset($_SESSION['county']);\r\n\t\t\tunset($_SESSION['country']);\r\n\t\t\tunset($_SESSION['phone']);\r\n\t\t\tunset($_SESSION['fax']);\r\n\t\t\tunset($_SESSION['email']);\r\n\t\t\tunset($_SESSION['nachricht']);\r\n\t\t\t}\r\n\r\n\t} else {\r\n\techo '<p class=titles>Error</p>';\r\n\techo '<p>Please fill in all the $fehler field. <a href=\"contact.php\">back</a></p>';\r\n\t}\r\n\techo '</div>';\r\n\r\n\t// Session unset\r\n\tunset($_SESSION['CAPTCHA_RndText']);\r\n\r\n?>"]
]
----------------------------------------------------

View File

@ -8,7 +8,7 @@
----------------------------------------------------
[
"/**\n * ",
"/**\r\n * ",
["keyword", "@param"],
["class-name", [
["keyword", "string"],
@ -16,12 +16,13 @@
["keyword", "null"]
]],
["parameter", "$parameter"],
" a parameter\n * ",
" a parameter\r\n * ",
["keyword", "@return"],
["class-name", [
["keyword", "self"]
]],
"\n * ",
"\r\n * ",
["keyword", "@var"],
["class-name", [
"MyClass",
@ -29,7 +30,8 @@
["keyword", "int"],
["punctuation", "]"]
]],
"\n * ",
"\r\n * ",
["keyword", "@throws"],
["class-name", [
["punctuation", "\\"],
@ -37,7 +39,7 @@
["punctuation", "\\"],
"MyException"
]],
" if something bad happens\n */"
" if something bad happens\r\n */"
]
----------------------------------------------------

View File

@ -33,65 +33,36 @@
----------------------------------------------------
[
"/**\n * ",
["keyword", "@api"],
"\n * ",
["keyword", "@author"],
"\n * ",
["keyword", "@category"],
"\n * ",
["keyword", "@copyright"],
"\n * ",
["keyword", "@deprecated"],
"\n * ",
["keyword", "@example"],
"\n * ",
["keyword", "@filesource"],
"\n * ",
["keyword", "@global"],
"\n * ",
["keyword", "@ignore"],
"\n * ",
["keyword", "@internal"],
"\n * ",
["keyword", "@license"],
"\n * ",
["keyword", "@link"],
"\n * ",
["keyword", "@method"],
"\n * ",
["keyword", "@package"],
"\n * ",
["keyword", "@param"],
"\n * ",
["keyword", "@property"],
"\n * ",
["keyword", "@property-read"],
"\n * ",
["keyword", "@property-write"],
"\n * ",
["keyword", "@return"],
"\n * ",
["keyword", "@see"],
"\n * ",
["keyword", "@since"],
"\n * ",
["keyword", "@source"],
"\n * ",
["keyword", "@subpackage"],
"\n * ",
["keyword", "@throws"],
"\n * ",
["keyword", "@todo"],
"\n * ",
["keyword", "@uses"],
"\n * ",
["keyword", "@used-by"],
"\n * ",
["keyword", "@var"],
"\n * ",
["keyword", "@version"],
"\n */"
"/**\r\n * ", ["keyword", "@api"],
"\r\n * ", ["keyword", "@author"],
"\r\n * ", ["keyword", "@category"],
"\r\n * ", ["keyword", "@copyright"],
"\r\n * ", ["keyword", "@deprecated"],
"\r\n * ", ["keyword", "@example"],
"\r\n * ", ["keyword", "@filesource"],
"\r\n * ", ["keyword", "@global"],
"\r\n * ", ["keyword", "@ignore"],
"\r\n * ", ["keyword", "@internal"],
"\r\n * ", ["keyword", "@license"],
"\r\n * ", ["keyword", "@link"],
"\r\n * ", ["keyword", "@method"],
"\r\n * ", ["keyword", "@package"],
"\r\n * ", ["keyword", "@param"],
"\r\n * ", ["keyword", "@property"],
"\r\n * ", ["keyword", "@property-read"],
"\r\n * ", ["keyword", "@property-write"],
"\r\n * ", ["keyword", "@return"],
"\r\n * ", ["keyword", "@see"],
"\r\n * ", ["keyword", "@since"],
"\r\n * ", ["keyword", "@source"],
"\r\n * ", ["keyword", "@subpackage"],
"\r\n * ", ["keyword", "@throws"],
"\r\n * ", ["keyword", "@todo"],
"\r\n * ", ["keyword", "@uses"],
"\r\n * ", ["keyword", "@used-by"],
"\r\n * ", ["keyword", "@var"],
"\r\n * ", ["keyword", "@version"],
"\r\n */"
]
----------------------------------------------------

View File

@ -6,16 +6,16 @@
----------------------------------------------------
[
"/**\n * ",
"/**\r\n * ",
["keyword", "@param"],
["class-name", [
["keyword", "string"]
]],
["parameter", "$parameter"],
" a parameter\n * ",
" a parameter\r\n * ",
["keyword", "@param"],
["parameter", "$arg2"],
" a second parameter\n */"
" a second parameter\r\n */"
]
----------------------------------------------------

View File

@ -7,13 +7,13 @@ import "componentCreation.js" as MyScript
[
["keyword", "import"],
" QtQuick 2.9\n",
" QtQuick 2.9\r\n",
["keyword", "import"],
" QtQml.Models 2.2\n",
" QtQml.Models 2.2\r\n",
["keyword", "import"],
" Person 1.0\n",
" Person 1.0\r\n",
["keyword", "import"],
["string", "\"componentCreation.js\""],

View File

@ -20,61 +20,75 @@ end
----------------------------------------------------
[
["keyword", "class"],
["class-name", ["Circle"]],
["keyword", "def"],
["method-definition", [
["keyword", "self"],
["punctuation", "."],
["function", "of_diameter"]
]],
["punctuation", "("],
"diameter",
["punctuation", ")"],
["keyword", "new"],
" 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"]
["keyword", "class"],
["class-name", ["Circle"]],
["keyword", "def"],
["method-definition", [
["keyword", "self"],
["punctuation", "."],
["function", "of_diameter"]
]],
["punctuation", "("],
"diameter",
["punctuation", ")"],
["keyword", "new"],
" diameter ",
["operator", "/"],
["number", "2"],
["keyword", "end"],
["keyword", "def"],
["method-definition", [
["function", "initialize"]
]],
["punctuation", "("],
"radius",
["punctuation", ")"],
["variable", "@radius"],
["operator", "="],
" radius\r\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\r\n ",
["keyword", "end"],
["keyword", "end"]
]
----------------------------------------------------

View File

@ -29,6 +29,7 @@ enum Foo {
["punctuation", ":"],
["class-name", "CStr"],
["punctuation", ";"],
["keyword", "let"],
" foo",
["punctuation", ":"],
@ -36,6 +37,7 @@ enum Foo {
["lifetime-annotation", "'a"],
["class-name", "CStr"],
["punctuation", ";"],
["keyword", "let"],
" foo",
["punctuation", ":"],
@ -47,6 +49,7 @@ enum Foo {
["class-name", "Bar"],
["operator", ">"],
["punctuation", ";"],
["class-name", "Option"],
["punctuation", "::"],
["class-name", "Some"],
@ -54,18 +57,23 @@ enum Foo {
"foo",
["punctuation", ")"],
["punctuation", ";"],
["class-name", "Option"],
["punctuation", "::"],
["class-name", "None"],
["punctuation", ";"],
["comment", "// we can differentiate between enum variants and class names"],
["comment", "// so let's make the bug a feature!"],
["keyword", "enum"],
["type-definition", "Foo"],
["punctuation", "{"],
["class-name", "Const"],
["punctuation", ","],
["class-name", "Tuple"],
["punctuation", "("],
["keyword", "i8"],
@ -73,12 +81,16 @@ enum Foo {
["keyword", "i8"],
["punctuation", ")"],
["punctuation", ","],
["class-name", "Struct"],
["punctuation", "{"],
"\n\t\tfoo",
"\r\n\t\tfoo",
["punctuation", ":"],
["keyword", "u8"],
["punctuation", "}"],
["punctuation", "}"]
]

View File

@ -23,12 +23,8 @@ Write down the passphrase. Store both at safe place(s).
["shell-symbol", "$"],
["bash", [
["builtin", "export"],
["assign-left", [
"BORG_PASSCOMMAND"
]],
["operator", [
"="
]],
["assign-left", ["BORG_PASSCOMMAND"]],
["operator", ["="]],
["string", [
"\"security find-generic-password -a ",
["environment", "$USER"],
@ -40,30 +36,20 @@ Write down the passphrase. Store both at safe place(s).
["shell-symbol", "$"],
["bash", [
["builtin", "export"],
["assign-left", [
"BORG_RSH"
]],
["operator", [
"="
]],
["string", [
"\"ssh -i ~/.ssh/borg\""
]]
["assign-left", ["BORG_RSH"]],
["operator", ["="]],
["string", ["\"ssh -i ~/.ssh/borg\""]]
]]
]],
["command", [
["shell-symbol", "$"],
["bash", [
"borg init --encryption",
["operator", [
"="
]],
["operator", ["="]],
"keyfile-blake2 ",
["string", [
"\"borg@1.2.3.4:backup\""
]]
["string", ["\"borg@1.2.3.4:backup\""]]
]]
]],
["output", "By default repositories initialized with this version will produce security\nerrors if written to with an older version (up to and including Borg 1.0.8).\n\nIf you want to use these older versions, you can disable the check by running:\nborg upgrade --disable-tam ssh://borg@1.2.3.4/./backup\n\nSee https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.\n\nIMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!\nUse \"borg key export\" to export the key, optionally in printable format.\nWrite down the passphrase. Store both at safe place(s).\n\n---"]
]
["output", "By default repositories initialized with this version will produce security\r\nerrors if written to with an older version (up to and including Borg 1.0.8).\r\n\r\nIf you want to use these older versions, you can disable the check by running:\r\nborg upgrade --disable-tam ssh://borg@1.2.3.4/./backup\r\n\r\nSee https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.\r\n\r\nIMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!\r\nUse \"borg key export\" to export the key, optionally in printable format.\r\nWrite down the passphrase. Store both at safe place(s).\r\n\r\n---"]
]

View File

@ -43,6 +43,7 @@ val systemStanzas: string -> string list list
["punctuation", ")"],
" token"
]],
["keyword", "val"],
" FOO",
["punctuation", ":"],
@ -62,6 +63,7 @@ val systemStanzas: string -> string list list
["punctuation", ")"],
" token"
]],
["keyword", "val"],
" FOO",
["punctuation", ":"],
@ -81,6 +83,7 @@ val systemStanzas: string -> string list list
["punctuation", ")"],
" token"
]],
["keyword", "val"],
" FOO",
["punctuation", ":"],
@ -100,6 +103,7 @@ val systemStanzas: string -> string list list
["punctuation", ")"],
" token"
]],
["keyword", "val"],
" FOO",
["punctuation", ":"],
@ -124,59 +128,54 @@ val systemStanzas: string -> string list list
["punctuation", "{"],
"head ",
["punctuation", ":"],
["class-name", [
"string list"
]],
["class-name", ["string list"]],
["punctuation", ","],
"\n decls ",
"\r\n decls ",
["punctuation", ":"],
["class-name", [
"decl_ast list"
]],
["class-name", ["decl_ast list"]],
["punctuation", ","],
"\n rules ",
"\r\n rules ",
["punctuation", ":"],
["class-name", [
"rule_ast list"
]],
["class-name", ["rule_ast list"]],
["punctuation", ","],
"\n tail ",
"\r\n tail ",
["punctuation", ":"],
["class-name", [
"string list"
]],
["class-name", ["string list"]],
["punctuation", "}"],
["keyword", "type"],
["class-name", "out_state"],
["operator", "="],
["punctuation", "{"],
"\ntout ",
"\r\ntout ",
["punctuation", ":"],
["class-name", [
"real"
]],
["class-name", ["real"]],
["punctuation", ","],
"\ndtout ",
"\r\ndtout ",
["punctuation", ":"],
["class-name", [
"real"
]],
["class-name", ["real"]],
["punctuation", ","],
"\ndtime ",
"\r\ndtime ",
["punctuation", ":"],
["class-name", [
"real"
]],
["class-name", ["real"]],
["punctuation", ","],
"\nstrm ",
"\r\nstrm ",
["punctuation", ":"],
["class-name", [
"TextIO",
["punctuation", "."],
"outstream"
]],
["punctuation", "}"],
["keyword", "val"],
" outState ",
["operator", "="],
@ -184,9 +183,7 @@ val systemStanzas: string -> string list list
["punctuation", "("],
"NONE ",
["punctuation", ":"],
["class-name", [
"out_state option"
]],
["class-name", ["out_state option"]],
["punctuation", ")"],
["keyword", "val"],
@ -197,6 +194,7 @@ val systemStanzas: string -> string list list
["operator", "->"],
" string list"
]],
["keyword", "val"],
" systemCleanLines",
["punctuation", ":"],
@ -205,6 +203,7 @@ val systemStanzas: string -> string list list
["operator", "->"],
" string list"
]],
["keyword", "val"],
" systemStanzas",
["punctuation", ":"],
@ -213,4 +212,4 @@ val systemStanzas: string -> string list list
["operator", "->"],
" string list list"
]]
]
]

View File

@ -7,5 +7,5 @@
[
["comment", "(* comment *)"],
["comment", "(*\n (* nested comment *)\n*)"]
]
["comment", "(*\r\n (* nested comment *)\r\n*)"]
]

View File

@ -7,7 +7,7 @@ bar
[
["comment", "// foo"],
["comment", "/*\nbar\n*/"]
["comment", "/*\r\nbar\r\n*/"]
]
----------------------------------------------------

View File

@ -9,7 +9,8 @@ def"
[
["string", "\"foo\\\"\\'\""],
["string", "'bar\\'\\\"'"],
["string", "\"\\n\\\"\\'\\\\abc\\\ndef\""]
["string", "\"\\n\\\"\\'\\\\abc\\\r\ndef\""]
]
----------------------------------------------------

View File

@ -9,7 +9,7 @@ comment
[
["comment", "# comment"],
["comment", "// comment"],
["comment", "/*\ncomment\n*/"]
["comment", "/*\r\ncomment\r\n*/"]
]
----------------------------------------------------

View File

@ -6,7 +6,7 @@ public class Bar {}
----------------------------------------------------
[
"Foo\n",
"Foo\r\n",
["block", [
["class-feature", [
["delimiter", "<#+"],

View File

@ -18,12 +18,12 @@ var b = new int[] { <#=
["delimiter", "#>"]
]]
]],
";\nvar b = new int[] { ",
";\r\nvar b = new int[] { ",
["block", [
["expression", [
["delimiter", "<#="],
["content", [
"\n\tString",
"\r\n\tString",
["punctuation", "."],
["function", "Join"],
["punctuation", "("],

View File

@ -33,7 +33,9 @@ The number <#= i #> is even.
" i",
["operator", "++"],
["punctuation", ")"],
["punctuation", "{"],
["keyword", "if"],
["punctuation", "("],
"i ",
@ -42,23 +44,22 @@ The number <#= i #> is even.
["operator", "=="],
["number", "0"],
["punctuation", ")"],
["punctuation", "{"]
]],
["delimiter", "#>"]
]]
]],
"\nThe number ",
"\r\nThe number ",
["block", [
["expression", [
["delimiter", "<#="],
["content", [
" i "
]],
["content", [" i "]],
["delimiter", "#>"]
]]
]],
" is even.\n",
" is even.\r\n",
["block", [
["standard", [

View File

@ -53,11 +53,8 @@ The number <#= i #> is even.
["class-feature", [
["delimiter", "<#+"],
["content", [
["keyword", "Public"],
["keyword", "Class"],
" Bar\n",
["keyword", "End"],
["keyword", "Class"]
["keyword", "Public"], ["keyword", "Class"], " Bar\r\n",
["keyword", "End"], ["keyword", "Class"]
]],
["delimiter", "#>"]
]]
@ -75,6 +72,7 @@ The number <#= i #> is even.
["number", "0"],
["keyword", "To"],
["number", "9"],
["keyword", "If"],
" i ",
["keyword", "Mod"],
@ -87,26 +85,22 @@ The number <#= i #> is even.
]]
]],
"\nThe number ",
"\r\nThe number ",
["block", [
["expression", [
["delimiter", "<#="],
["content", [
" i "
]],
["content", [" i "]],
["delimiter", "#>"]
]]
]],
" is even.\n",
" is even.\r\n",
["block", [
["standard", [
["delimiter", "<#"],
["content", [
["keyword", "End"],
["keyword", "If"],
["keyword", "Next"],
" i\n"
["keyword", "End"], ["keyword", "If"],
["keyword", "Next"], " i\r\n"
]],
["delimiter", "#>"]
]]

View File

@ -15,32 +15,43 @@ ok
[
["pass", "ok"],
["yamlish", [
["punctuation", "---"],
["key", "message"],
["punctuation", ":"],
["string", "\"Failed with error 'hostname peebles.example.com not found'\""],
["key", "severity"],
["punctuation", ":"],
" fail\n ",
" fail\r\n ",
["key", "data"],
["punctuation", ":"],
["key", "got"],
["punctuation", ":"],
["key", "hostname"],
["punctuation", ":"],
["string", "'peebles.example.com'"],
["key", "address"],
["punctuation", ":"],
["null", "~"],
["key", "expected"],
["punctuation", ":"],
["key", "hostname"],
["punctuation", ":"],
["string", "'peebles.example.com'"],
["key", "address"],
["punctuation", ":"],
["string", "'85.193.201.85'"],
["punctuation", "..."]
]]
]

View File

@ -20,8 +20,8 @@
["string", "''"],
["string", "'#'"],
["string", "'\"abc\"'"],
["string", "\"\"\"\n\tabc\n\t\"\"\""],
["string", "'''\n\tabc\n\t'''"]
["string", "\"\"\"\r\n\tabc\r\n\t\"\"\""],
["string", "'''\r\n\tabc\r\n\t'''"]
]
----------------------------------------------------

View File

@ -13,7 +13,7 @@ bob = new SqlCommand("Select * from test Where Code=Code");
["punctuation", ")"],
["punctuation", ";"],
"\nbob ",
"\r\nbob ",
["operator", "="],
["keyword", "new"],
" SqlCommand",
@ -21,4 +21,4 @@ bob = new SqlCommand("Select * from test Where Code=Code");
["string", "\"Select * from test Where Code=Code\""],
["punctuation", ")"],
["punctuation", ";"]
]
]

View File

@ -6,12 +6,15 @@ Console.WriteLine("Message: {0}", message)
----------------------------------------------------
[
["keyword", "Dim"], " x ", ["operator", "="], ["string", "\"hello\nworld\""],
["keyword", "Dim"],
" x ",
["operator", "="],
["string", "\"hello\r\nworld\""],
"\n\nConsole.WriteLine",
"\r\n\r\nConsole.WriteLine",
["punctuation", "("],
["string", "\"Message: {0}\""],
["punctuation", ","],
" message",
["punctuation", ")"]
]
]

View File

@ -11,7 +11,7 @@ title: Blogging Like a Hacker
["front-matter-block", [
["punctuation", "---"],
["font-matter", [
["key", "layout"], ["punctuation", ":"], " post\n",
["key", "layout"], ["punctuation", ":"], " post\r\n",
["key", "title"], ["punctuation", ":"], " Blogging Like a Hacker"
]],
["punctuation", "---"]
@ -21,4 +21,4 @@ title: Blogging Like a Hacker
["punctuation", "#"],
" Title"
]]
]
]

View File

@ -71,7 +71,7 @@ tagb: !!tagb *tag-b
["punctuation", ":"],
["important", "&sca-lar"],
["punctuation", "|"],
["scalar", "\n\tfoo\n\tbar"],
["scalar", "\r\n\tfoo\r\n\tbar"],
["key", "x-utf8"],
["punctuation", ":"],
@ -113,7 +113,7 @@ tagb: !!tagb *tag-b
["important", "&tag-scalar"],
["tag", "!!tag-scalar"],
["punctuation", "|"],
["scalar", "\n\tfoo\n\tbar"],
["scalar", "\r\n\tfoo\r\n\tbar"],
["key", "x-tag-string"],
["punctuation", ":"],
@ -150,7 +150,7 @@ tagb: !!tagb *tag-b
["tag", "!!tag-scalar"],
["important", "&tag-scalar"],
["punctuation", "|"],
["scalar", "\n\tfoo\n\tbar"],
["scalar", "\r\n\tfoo\r\n\tbar"],
["key", "foobar"],
["punctuation", ":"],
@ -182,7 +182,7 @@ tagb: !!tagb *tag-b
["punctuation", ":"],
["tag", "!!str"],
" bar\n",
" bar\r\n",
["important", "&a2"],
["key", "baz"],

View File

@ -7,7 +7,7 @@
[
["comment", "// comment"],
["comment", "/*\n comment\n*/"]
["comment", "/*\r\n comment\r\n*/"]
]
----------------------------------------------------

View File

@ -7,7 +7,8 @@ type _foo.-bar:type
["keyword", "type"],
["namespace", "foo"],
["punctuation", ":"],
"type\n",
"type\r\n",
["keyword", "type"],
["namespace", "_foo.-bar"],
["punctuation", ":"],

View File

@ -10,8 +10,8 @@ o'
----------------------------------------------------
[
["string", "\"\n\n\\\"'foo'\\\"\n\n\""],
["string", "'fo\n\"\"\no'"]
["string", "\"\r\n\r\n\\\"'foo'\\\"\r\n\r\n\""],
["string", "'fo\r\n\"\"\r\no'"]
]
----------------------------------------------------