Added support for Apache Avro IDL (#3051)
This commit is contained in:
parent
247fd9a38f
commit
87e5a37644
File diff suppressed because one or more lines are too long
|
@ -160,6 +160,11 @@
|
|||
"title": "AutoIt",
|
||||
"owner": "Golmote"
|
||||
},
|
||||
"avro-idl": {
|
||||
"title":"Avro IDL",
|
||||
"alias": "avdl",
|
||||
"owner": "RunDevelopment"
|
||||
},
|
||||
"bash": {
|
||||
"title": "Bash",
|
||||
"alias": "shell",
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
// GitHub: https://github.com/apache/avro
|
||||
// Docs: https://avro.apache.org/docs/current/idl.html
|
||||
|
||||
Prism.languages['avro-idl'] = {
|
||||
'comment': {
|
||||
pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
|
||||
greedy: true
|
||||
},
|
||||
'string': [
|
||||
{
|
||||
pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^\\])'(?:[^\r\n'\\]|\\(?:[\s\S]|\d{1,3}))'/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
|
||||
'annotation': {
|
||||
pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/,
|
||||
greedy: true,
|
||||
alias: 'function'
|
||||
},
|
||||
'function-identifier': {
|
||||
pattern: /`[^\r\n`]+`(?=\s*\()/,
|
||||
greedy: true,
|
||||
alias: 'function'
|
||||
},
|
||||
'identifier': {
|
||||
pattern: /`[^\r\n`]+`/,
|
||||
greedy: true
|
||||
},
|
||||
|
||||
'class-name': {
|
||||
pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
'keyword': /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,
|
||||
'function': /\b[a-z_]\w*(?=\s*\()/i,
|
||||
|
||||
'number': [
|
||||
{
|
||||
pattern: /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,
|
||||
lookbehind: true
|
||||
},
|
||||
/-?\b(?:NaN|Infinity)\b/
|
||||
],
|
||||
|
||||
'operator': /=/,
|
||||
'punctuation': /[()\[\]{}<>.:,;-]/
|
||||
};
|
||||
|
||||
Prism.languages.avdl = Prism.languages['avro-idl'];
|
|
@ -0,0 +1 @@
|
|||
Prism.languages["avro-idl"]={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:[{pattern:/(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])'(?:[^\r\n'\\]|\\(?:[\s\S]|\d{1,3}))'/,lookbehind:!0,greedy:!0}],annotation:{pattern:/@(?:[$\w.-]|`[^\r\n`]+`)+/,greedy:!0,alias:"function"},"function-identifier":{pattern:/`[^\r\n`]+`(?=\s*\()/,greedy:!0,alias:"function"},identifier:{pattern:/`[^\r\n`]+`/,greedy:!0},"class-name":{pattern:/(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,lookbehind:!0,greedy:!0},keyword:/\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:[{pattern:/(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,lookbehind:!0},/-?\b(?:NaN|Infinity)\b/],operator:/=/,punctuation:/[()\[\]{}<>.:,;-]/},Prism.languages.avdl=Prism.languages["avro-idl"];
|
|
@ -0,0 +1,44 @@
|
|||
<h2>Full example</h2>
|
||||
<pre><code>// Source: https://avro.apache.org/docs/current/idl.html#example
|
||||
|
||||
/**
|
||||
* An example protocol in Avro IDL
|
||||
*/
|
||||
@namespace("org.apache.avro.test")
|
||||
protocol Simple {
|
||||
|
||||
@aliases(["org.foo.KindOf"])
|
||||
enum Kind {
|
||||
FOO,
|
||||
BAR, // the bar enum value
|
||||
BAZ
|
||||
}
|
||||
|
||||
fixed MD5(16);
|
||||
|
||||
record TestRecord {
|
||||
@order("ignore")
|
||||
string name;
|
||||
|
||||
@order("descending")
|
||||
Kind kind;
|
||||
|
||||
MD5 hash;
|
||||
|
||||
union { MD5, null} @aliases(["hash"]) nullableHash;
|
||||
|
||||
array<long> arrayOfLongs;
|
||||
}
|
||||
|
||||
error TestError {
|
||||
string message;
|
||||
}
|
||||
|
||||
string hello(string greeting);
|
||||
TestRecord echo(TestRecord `record`);
|
||||
int add(int arg1, int arg2);
|
||||
bytes echoBytes(bytes data);
|
||||
void `error`() throws TestError;
|
||||
void ping() oneway;
|
||||
}
|
||||
</code></pre>
|
|
@ -172,6 +172,7 @@
|
|||
"js": "javascript",
|
||||
"g4": "antlr4",
|
||||
"adoc": "asciidoc",
|
||||
"avdl": "avro-idl",
|
||||
"shell": "bash",
|
||||
"shortcode": "bbcode",
|
||||
"rbnf": "bnf",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -43,6 +43,8 @@
|
|||
"asm6502": "6502 Assembly",
|
||||
"autohotkey": "AutoHotkey",
|
||||
"autoit": "AutoIt",
|
||||
"avro-idl": "Avro IDL",
|
||||
"avdl": "Avro IDL",
|
||||
"basic": "BASIC",
|
||||
"bbcode": "BBcode",
|
||||
"bnf": "BNF",
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document)if(Prism.plugins.toolbar){var i={none:"Plain text",plain:"Plain text",plaintext:"Plain text",text:"Plain text",txt:"Plain text",html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cfscript:"CFScript",cfc:"CFScript",cil:"CIL",cmake:"CMake",cobol:"COBOL",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",csv:"CSV",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gn:"GN",gni:"GN",graphql:"GraphQL",hbs:"Handlebars",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam","icu-message-format":"ICU Message Format",idr:"Idris",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",kts:"Kotlin Script",kt:"Kotlin",kumir:"KuMir (КуМир)",kum:"KuMir (КуМир)",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",log:"Log file",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",openqasm:"OpenQasm",qasm:"OpenQasm",parigp:"PARI/GP",objectpascal:"Object Pascal",psl:"PATROL Scripting Language",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",qsharp:"Q#",qs:"Q#",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",iecst:"Structured Text (IEC 61131-3)","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",wolfram:"Wolfram language",nb:"Mathematica Notebook",wl:"Wolfram language",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,s=a.getAttribute("data-language")||i[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(s){var o=document.createElement("span");return o.textContent=s,o}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}();
|
||||
!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document)if(Prism.plugins.toolbar){var i={none:"Plain text",plain:"Plain text",plaintext:"Plain text",text:"Plain text",txt:"Plain text",html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt","avro-idl":"Avro IDL",avdl:"Avro IDL",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cfscript:"CFScript",cfc:"CFScript",cil:"CIL",cmake:"CMake",cobol:"COBOL",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",csv:"CSV",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gn:"GN",gni:"GN",graphql:"GraphQL",hbs:"Handlebars",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam","icu-message-format":"ICU Message Format",idr:"Idris",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",kts:"Kotlin Script",kt:"Kotlin",kumir:"KuMir (КуМир)",kum:"KuMir (КуМир)",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",log:"Log file",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",openqasm:"OpenQasm",qasm:"OpenQasm",parigp:"PARI/GP",objectpascal:"Object Pascal",psl:"PATROL Scripting Language",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",qsharp:"Q#",qs:"Q#",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",iecst:"Structured Text (IEC 61131-3)","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",wolfram:"Wolfram language",nb:"Mathematica Notebook",wl:"Wolfram language",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,s=a.getAttribute("data-language")||i[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(s){var o=document.createElement("span");return o.textContent=s,o}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}();
|
|
@ -0,0 +1,76 @@
|
|||
record MyRecord {
|
||||
string @order("ascending") myAscendingSortField;
|
||||
string @order("descending") myDescendingField;
|
||||
string @order("ignore") myIgnoredField;
|
||||
}
|
||||
|
||||
@java-class("java.util.ArrayList") array<string> myStrings;
|
||||
|
||||
@namespace("org.apache.avro.firstNamespace")
|
||||
|
||||
union { MD5, null} @aliases(["hash"]) nullableHash;
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "record"],
|
||||
["class-name", "MyRecord"],
|
||||
["punctuation", "{"],
|
||||
|
||||
["keyword", "string"],
|
||||
["annotation", "@order"],
|
||||
["punctuation", "("],
|
||||
["string", "\"ascending\""],
|
||||
["punctuation", ")"],
|
||||
" myAscendingSortField",
|
||||
["punctuation", ";"],
|
||||
|
||||
["keyword", "string"],
|
||||
["annotation", "@order"],
|
||||
["punctuation", "("],
|
||||
["string", "\"descending\""],
|
||||
["punctuation", ")"],
|
||||
" myDescendingField",
|
||||
["punctuation", ";"],
|
||||
|
||||
["keyword", "string"],
|
||||
["annotation", "@order"],
|
||||
["punctuation", "("],
|
||||
["string", "\"ignore\""],
|
||||
["punctuation", ")"],
|
||||
" myIgnoredField",
|
||||
["punctuation", ";"],
|
||||
|
||||
["punctuation", "}"],
|
||||
|
||||
["annotation", "@java-class"],
|
||||
["punctuation", "("],
|
||||
["string", "\"java.util.ArrayList\""],
|
||||
["punctuation", ")"],
|
||||
["keyword", "array"],
|
||||
["punctuation", "<"],
|
||||
["keyword", "string"],
|
||||
["punctuation", ">"],
|
||||
" myStrings",
|
||||
["punctuation", ";"],
|
||||
|
||||
["annotation", "@namespace"],
|
||||
["punctuation", "("],
|
||||
["string", "\"org.apache.avro.firstNamespace\""],
|
||||
["punctuation", ")"],
|
||||
|
||||
["keyword", "union"],
|
||||
["punctuation", "{"],
|
||||
" MD5",
|
||||
["punctuation", ","],
|
||||
["keyword", "null"],
|
||||
["punctuation", "}"],
|
||||
["annotation", "@aliases"],
|
||||
["punctuation", "("],
|
||||
["punctuation", "["],
|
||||
["string", "\"hash\""],
|
||||
["punctuation", "]"],
|
||||
["punctuation", ")"],
|
||||
" nullableHash",
|
||||
["punctuation", ";"]
|
||||
]
|
|
@ -0,0 +1,52 @@
|
|||
protocol MyProto {
|
||||
@namespace("org.apache.avro.someOtherNamespace")
|
||||
record Foo {}
|
||||
|
||||
record Bar {}
|
||||
|
||||
enum Kind {
|
||||
FOO,
|
||||
BAR, // the bar enum value
|
||||
BAZ
|
||||
}
|
||||
|
||||
error TestError {
|
||||
string message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "protocol"],
|
||||
["class-name", "MyProto"],
|
||||
["punctuation", "{"],
|
||||
|
||||
["annotation", "@namespace"],
|
||||
["punctuation", "("],
|
||||
["string", "\"org.apache.avro.someOtherNamespace\""],
|
||||
["punctuation", ")"],
|
||||
|
||||
["keyword", "record"],
|
||||
["class-name", "Foo"],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "}"],
|
||||
|
||||
["keyword", "record"],
|
||||
["class-name", "Bar"],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "}"],
|
||||
|
||||
["keyword", "enum"], ["class-name", "Kind"], ["punctuation", "{"],
|
||||
"\r\n FOO", ["punctuation", ","],
|
||||
"\r\n BAR", ["punctuation", ","], ["comment", "// the bar enum value"],
|
||||
"\r\n BAZ\r\n ",
|
||||
["punctuation", "}"],
|
||||
|
||||
["keyword", "error"], ["class-name", "TestError"], ["punctuation", "{"],
|
||||
["keyword", "string"], " message", ["punctuation", ";"],
|
||||
["punctuation", "}"],
|
||||
|
||||
["punctuation", "}"]
|
||||
]
|
|
@ -0,0 +1,15 @@
|
|||
/* comment */
|
||||
/*
|
||||
comment
|
||||
*/
|
||||
|
||||
// comment
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["comment", "/* comment */"],
|
||||
["comment", "/*\r\n comment\r\n */"],
|
||||
|
||||
["comment", "// comment"]
|
||||
]
|
|
@ -0,0 +1,57 @@
|
|||
int add(int foo, int bar = 0);
|
||||
|
||||
void logMessage(string message);
|
||||
|
||||
void goKaboom() throws Kaboom;
|
||||
|
||||
void fireAndForget(string message) oneway;
|
||||
|
||||
void `error`();
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "int"],
|
||||
["function", "add"],
|
||||
["punctuation", "("],
|
||||
["keyword", "int"],
|
||||
" foo",
|
||||
["punctuation", ","],
|
||||
["keyword", "int"],
|
||||
" bar ",
|
||||
["operator", "="],
|
||||
["number", "0"],
|
||||
["punctuation", ")"],
|
||||
["punctuation", ";"],
|
||||
|
||||
["keyword", "void"],
|
||||
["function", "logMessage"],
|
||||
["punctuation", "("],
|
||||
["keyword", "string"],
|
||||
" message",
|
||||
["punctuation", ")"],
|
||||
["punctuation", ";"],
|
||||
|
||||
["keyword", "void"],
|
||||
["function", "goKaboom"],
|
||||
["punctuation", "("],
|
||||
["punctuation", ")"],
|
||||
["keyword", "throws"],
|
||||
["class-name", "Kaboom"],
|
||||
["punctuation", ";"],
|
||||
|
||||
["keyword", "void"],
|
||||
["function", "fireAndForget"],
|
||||
["punctuation", "("],
|
||||
["keyword", "string"],
|
||||
" message",
|
||||
["punctuation", ")"],
|
||||
["keyword", "oneway"],
|
||||
["punctuation", ";"],
|
||||
|
||||
["keyword", "void"],
|
||||
["function-identifier", "`error`"],
|
||||
["punctuation", "("],
|
||||
["punctuation", ")"],
|
||||
["punctuation", ";"]
|
||||
]
|
|
@ -0,0 +1,65 @@
|
|||
array;
|
||||
boolean;
|
||||
bytes;
|
||||
date;
|
||||
decimal;
|
||||
double;
|
||||
enum;
|
||||
error;
|
||||
false;
|
||||
fixed;
|
||||
float;
|
||||
idl;
|
||||
import;
|
||||
int;
|
||||
local_timestamp_ms;
|
||||
long;
|
||||
map;
|
||||
null;
|
||||
oneway;
|
||||
protocol;
|
||||
record;
|
||||
schema;
|
||||
string;
|
||||
throws;
|
||||
time_ms;
|
||||
timestamp_ms;
|
||||
true;
|
||||
union;
|
||||
uuid;
|
||||
void;
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "array"], ["punctuation", ";"],
|
||||
["keyword", "boolean"], ["punctuation", ";"],
|
||||
["keyword", "bytes"], ["punctuation", ";"],
|
||||
["keyword", "date"], ["punctuation", ";"],
|
||||
["keyword", "decimal"], ["punctuation", ";"],
|
||||
["keyword", "double"], ["punctuation", ";"],
|
||||
["keyword", "enum"], ["punctuation", ";"],
|
||||
["keyword", "error"], ["punctuation", ";"],
|
||||
["keyword", "false"], ["punctuation", ";"],
|
||||
["keyword", "fixed"], ["punctuation", ";"],
|
||||
["keyword", "float"], ["punctuation", ";"],
|
||||
["keyword", "idl"], ["punctuation", ";"],
|
||||
["keyword", "import"], ["punctuation", ";"],
|
||||
["keyword", "int"], ["punctuation", ";"],
|
||||
["keyword", "local_timestamp_ms"], ["punctuation", ";"],
|
||||
["keyword", "long"], ["punctuation", ";"],
|
||||
["keyword", "map"], ["punctuation", ";"],
|
||||
["keyword", "null"], ["punctuation", ";"],
|
||||
["keyword", "oneway"], ["punctuation", ";"],
|
||||
["keyword", "protocol"], ["punctuation", ";"],
|
||||
["keyword", "record"], ["punctuation", ";"],
|
||||
["keyword", "schema"], ["punctuation", ";"],
|
||||
["keyword", "string"], ["punctuation", ";"],
|
||||
["keyword", "throws"], ["punctuation", ";"],
|
||||
["keyword", "time_ms"], ["punctuation", ";"],
|
||||
["keyword", "timestamp_ms"], ["punctuation", ";"],
|
||||
["keyword", "true"], ["punctuation", ";"],
|
||||
["keyword", "union"], ["punctuation", ";"],
|
||||
["keyword", "uuid"], ["punctuation", ";"],
|
||||
["keyword", "void"], ["punctuation", ";"]
|
||||
]
|
|
@ -0,0 +1,43 @@
|
|||
0
|
||||
123
|
||||
0xFFF
|
||||
-0
|
||||
-123
|
||||
-0xFF
|
||||
12343324234L
|
||||
0xFFFFFFFFFl
|
||||
|
||||
0.342e4
|
||||
0.342e-4f
|
||||
0.342e-4d
|
||||
.324
|
||||
123.
|
||||
0x.2Fp+323f
|
||||
0x234.p+323d
|
||||
|
||||
NaN
|
||||
Infinity
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["number", "0"],
|
||||
["number", "123"],
|
||||
["number", "0xFFF"],
|
||||
["number", "-0"],
|
||||
["number", "-123"],
|
||||
["number", "-0xFF"],
|
||||
["number", "12343324234L"],
|
||||
["number", "0xFFFFFFFFFl"],
|
||||
|
||||
["number", "0.342e4"],
|
||||
["number", "0.342e-4f"],
|
||||
["number", "0.342e-4d"],
|
||||
["number", ".324"],
|
||||
["number", "123."],
|
||||
["number", "0x.2Fp+323f"],
|
||||
["number", "0x234.p+323d"],
|
||||
|
||||
["number", "NaN"],
|
||||
["number", "Infinity"]
|
||||
]
|
|
@ -0,0 +1,7 @@
|
|||
=
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["operator", "="]
|
||||
]
|
|
@ -0,0 +1,20 @@
|
|||
( ) [ ] { } < >
|
||||
. : , ;
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["punctuation", "("],
|
||||
["punctuation", ")"],
|
||||
["punctuation", "["],
|
||||
["punctuation", "]"],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "}"],
|
||||
["punctuation", "<"],
|
||||
["punctuation", ">"],
|
||||
|
||||
["punctuation", "."],
|
||||
["punctuation", ":"],
|
||||
["punctuation", ","],
|
||||
["punctuation", ";"]
|
||||
]
|
|
@ -0,0 +1,21 @@
|
|||
""
|
||||
"foo"
|
||||
"\""
|
||||
"\n\n"
|
||||
|
||||
'f'
|
||||
'\n'
|
||||
'\34'
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["string", "\"\""],
|
||||
["string", "\"foo\""],
|
||||
["string", "\"\\\"\""],
|
||||
["string", "\"\\n\\n\""],
|
||||
|
||||
["string", "'f'"],
|
||||
["string", "'\\n'"],
|
||||
["string", "'\\34'"]
|
||||
]
|
Loading…
Reference in New Issue