diff options
| author | Thomas Duboucher <serianox@users.noreply.github.com> | 2021-02-14 08:54:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-14 08:54:54 +0100 |
| commit | 1e2efc02e4187ac7a5dbed2854a3e633f600e1e6 (patch) | |
| tree | a2afedab35f330a808734e092179e71891e12bb5 | |
| parent | efd9aa5a955fd512fcf9d1980f206f795cea9075 (diff) | |
| download | pygments-git-1e2efc02e4187ac7a5dbed2854a3e633f600e1e6.tar.gz | |
Add CDDL lexer (Fix #1239) (#1379)
* Add CDDL lexer (thanks to Fabian Neumann)
* Add CDDL to mappings
* Fix inline flag in CDDL regex
* Update AUTHORS
* Fix explosive backtracking
* Comment invalid CDDL syntax for automated tests
* Update following Georg Brandl's review
* Update tests for CDDL to new framework
* Pylint pass
* Update links to CDDL RFC
* Update copyright header
* Solve regexlint issues in CDDL parser
* Add link to CDDL in documentation
| -rw-r--r-- | AUTHORS | 2 | ||||
| -rw-r--r-- | doc/languages.rst | 1 | ||||
| -rw-r--r-- | pygments/lexers/_mapping.py | 1 | ||||
| -rw-r--r-- | pygments/lexers/cddl.py | 191 | ||||
| -rw-r--r-- | tests/examplefiles/cddl/example.cddl | 377 | ||||
| -rw-r--r-- | tests/examplefiles/cddl/example.cddl.output | 2665 |
6 files changed, 3237 insertions, 0 deletions
@@ -237,5 +237,7 @@ Other contributors, listed alphabetically, are: * Hubert Gruniaux -- C and C++ lexer improvements * Thomas Symalla -- AMDGPU Lexer * 15b3 -- Image Formatter improvements +* Fabian Neumann -- CDDL lexer +* Thomas Duboucher -- CDDL lexer Many thanks for all contributions! diff --git a/doc/languages.rst b/doc/languages.rst index 3ccb3b8f..f9adb907 100644 --- a/doc/languages.rst +++ b/doc/languages.rst @@ -220,6 +220,7 @@ Other markup * BBCode * CapDL * `Cap'n Proto <https://capnproto.com>`_ +* `CDDL <https://datatracker.ietf.org/doc/rfc8610/>`_ * CMake * `Csound <https://csound.com>`_ scores * CSS diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index 298e64c8..3c5b6fd0 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -78,6 +78,7 @@ LEXERS = { 'CapDLLexer': ('pygments.lexers.esoteric', 'CapDL', ('capdl',), ('*.cdl',), ()), 'CapnProtoLexer': ('pygments.lexers.capnproto', "Cap'n Proto", ('capnp',), ('*.capnp',), ()), 'CbmBasicV2Lexer': ('pygments.lexers.basic', 'CBM BASIC V2', ('cbmbas',), ('*.bas',), ()), + 'CddlLexer': ('pygments.lexers.cddl', 'CDDL', ('cddl',), ('*.cddl',), ('text/x-cddl',)), 'CeylonLexer': ('pygments.lexers.jvm', 'Ceylon', ('ceylon',), ('*.ceylon',), ('text/x-ceylon',)), 'Cfengine3Lexer': ('pygments.lexers.configs', 'CFEngine3', ('cfengine3', 'cf3'), ('*.cf',), ()), 'ChaiscriptLexer': ('pygments.lexers.scripting', 'ChaiScript', ('chai', 'chaiscript'), ('*.chai',), ('text/x-chaiscript', 'application/x-chaiscript')), diff --git a/pygments/lexers/cddl.py b/pygments/lexers/cddl.py new file mode 100644 index 00000000..6b6b8085 --- /dev/null +++ b/pygments/lexers/cddl.py @@ -0,0 +1,191 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.cddl + ~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Concise data definition language (CDDL), a notational + convention to express CBOR and JSON data structures. + + More information: + https://datatracker.ietf.org/doc/rfc8610/ + + :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +__all__ = ['CddlLexer'] + +from pygments.lexer import RegexLexer, bygroups, include, words +from pygments.token import ( + Comment, + Error, + Keyword, + Name, + Number, + Operator, + Punctuation, + String, + Text, +) + + +class CddlLexer(RegexLexer): + """ + Lexer for CDDL definitions. + + .. versionadded:: 2.8 + """ + name = "CDDL" + aliases = ["cddl"] + filenames = ["*.cddl"] + mimetypes = ["text/x-cddl"] + + _prelude_types = [ + "any", + "b64legacy", + "b64url", + "bigfloat", + "bigint", + "bignint", + "biguint", + "bool", + "bstr", + "bytes", + "cbor-any", + "decfrac", + "eb16", + "eb64legacy", + "eb64url", + "encoded-cbor", + "false", + "float", + "float16", + "float16-32", + "float32", + "float32-64", + "float64", + "int", + "integer", + "mime-message", + "nil", + "nint", + "null", + "number", + "regexp", + "tdate", + "text", + "time", + "true", + "tstr", + "uint", + "undefined", + "unsigned", + "uri", + ] + + _controls = [ + ".and", + ".bits", + ".cbor", + ".cborseq", + ".default", + ".eq", + ".ge", + ".gt", + ".le", + ".lt", + ".ne", + ".regexp", + ".size", + ".within", + ] + + _re_id = ( + r"[$@A-Z_a-z]" + r"(?:[\-\.]*[$@0-9A-Z_a-z]|[$@0-9A-Z_a-z])*" + ) + + # While the spec reads more like "an int must not start with 0" we use a + # lookahead here that says "after a 0 there must be no digit". This makes the + # '0' the invalid character in '01', which looks nicer when highlighted. + _re_uint = r"(?:0b[01]+|0x[0-9a-fA-F]+|[1-9]\d*|0(?!\d))" + _re_int = r"-?" + _re_uint + + flags = re.UNICODE | re.MULTILINE + + tokens = { + "commentsandwhitespace": [(r"\s+", Text), (r";.+$", Comment.Single)], + "root": [ + include("commentsandwhitespace"), + # tag types + (r"#(\d\.{uint})?".format(uint=_re_uint), Keyword.Type), # type or any + # occurence + ( + r"({uint})?(\*)({uint})?".format(uint=_re_uint), + bygroups(Number, Operator, Number), + ), + (r"\?|\+", Operator), # occurrence + (r"\^", Operator), # cuts + (r"(\.\.\.|\.\.)", Operator), # rangeop + (words(_controls, suffix=r"\b"), Operator.Word), # ctlops + # into choice op + (r"&(?=\s*({groupname}|\())".format(groupname=_re_id), Operator), + (r"~(?=\s*{})".format(_re_id), Operator), # unwrap op + (r"//|/(?!/)", Operator), # double und single slash + (r"=>|/==|/=|=", Operator), + (r"[\[\]{}\(\),<>:]", Punctuation), + # Bytestrings + (r"(b64)(')", bygroups(String.Affix, String.Single), "bstrb64url"), + (r"(h)(')", bygroups(String.Affix, String.Single), "bstrh"), + (r"'", String.Single, "bstr"), + # Barewords as member keys (must be matched before values, types, typenames, + # groupnames). + # Token type is String as barewords are always interpreted as such. + ( + r"({bareword})(\s*)(:)".format(bareword=_re_id), + bygroups(String, Text, Punctuation), + ), + # predefined types + ( + words(_prelude_types, prefix=r"(?![\-_$@])\b", suffix=r"\b(?![\-_$@])"), + Name.Builtin, + ), + # user-defined groupnames, typenames + (_re_id, Name.Class), + # values + (r"0b[01]+", Number.Bin), + (r"0o[0-7]+", Number.Oct), + (r"0x[0-9a-fA-F]+(\.[0-9a-fA-F]+)?p[+-]?\d+", Number.Hex), # hexfloat + (r"0x[0-9a-fA-F]+", Number.Hex), # hex + # Float + ( + r"{int}(?=(\.\d|e[+-]?\d))(?:\.\d+)?(?:e[+-]?\d+)?".format(int=_re_int), + Number.Float, + ), + # Int + (_re_int, Number.Int), + (r'"(\\\\|\\"|[^"])*"', String.Double), + ], + "bstrb64url": [ + (r"'", String.Single, "#pop"), + include("commentsandwhitespace"), + (r"\\.", String.Escape), + (r"[0-9a-zA-Z\-_=]+", String.Single), + (r".", Error), + # (r";.+$", Token.Other), + ], + "bstrh": [ + (r"'", String.Single, "#pop"), + include("commentsandwhitespace"), + (r"\\.", String.Escape), + (r"[0-9a-fA-F]+", String.Single), + (r".", Error), + ], + "bstr": [ + (r"'", String.Single, "#pop"), + (r"\\.", String.Escape), + (r"[^']", String.Single), + ], + } diff --git a/tests/examplefiles/cddl/example.cddl b/tests/examplefiles/cddl/example.cddl new file mode 100644 index 00000000..e9d97129 --- /dev/null +++ b/tests/examplefiles/cddl/example.cddl @@ -0,0 +1,377 @@ +; Note: This CDDL does not make sense *semantically*. +; These are various examples from the CDDL spec that +; should cover most syntax cases, however. + +pii = ( + age: int, + name: tstr, + employer: tstr, +) + +person = { + pii +} + +person = {( + age: int, + name: tstr, + employer: tstr, +)} + +person = { + identity, + employer: tstr, +} + +dog = { + identity, + leash-length: float, +} + +identity = ( + age: int, + name: tstr, +) + +address = { delivery } + +delivery = ( +street: tstr, ? number: uint, city // +po-box: uint, city // +per-pickup: true ) + +city = ( +name: tstr, zip-code: uint +) + +attire /= "swimwear" + +delivery //= ( +lat: float, long: float, drone-type: tstr +) + +device-address = bytefloat +max-byte = 0b01001001 +max-oct = 0o014 +max-int = -123 +max-float = 23.5 +int-range = 0..10 ; only integers match +float-range = 0.0..10.0 ; only floats match +byte = 0..max-byte ; inclusive range +first-non-byte = 256 +byte1 = 0...first-non-byte ; byte1 is equivalent to byte + +BAD-range1 = 0..10.0 ; NOT DEFINED +BAD-range2 = 0.0..10 ; NOT DEFINED +numeric-range = int-range / float-range + +terminal-color = &basecolors +basecolors = ( + black: 0, red: 1, green: 2, yellow: 3, + blue: 4, magenta: 5, cyan: 6, white: 7, +) +extended-color = &( + basecolors, + orange: 8, pink: 9, purple: 10, brown: 11, +) + +foo = # + +my_breakfast = #6.55799(breakfast) ; cbor-any is too general! +breakfast = cereal / porridge +cereal = #6.998(tstr) +porridge = #6.999([liquid, solid]) +liquid = milk / water +milk = 0 +water = 1 +solid = tstr + +; This is a comment +person = { g } + +g = ( + "name": tstr, + age: int, ; "age" is a bareword +) + +apartment = { + kitchen: size, + * bedroom: size, +} +size = float ; in m2 + +unlimited-people = [* person] +one-or-two-people = [1*2 person] +at-least-two-people = [2* person] +person = ( + name: tstr, + age: uint, +) + +Geography = [ + city : tstr, + gpsCoordinates : GpsCoordinates, +] + +GpsCoordinates = { + longitude : uint, ; multiplied by 10^7 + latitude : uint, ; multiplied by 10^7 +} +located-samples = { + sample-point: int, + samples: [+ float], +} + +proper-ints = 1 / 0 +;invalid-int = 01 + +flt = 1.23 +flt = -1.23 +flt = 1.23e+10 +flt = 1.23e-10 +flt = 1.23e10 +val = 123 + +located-samples = { + sample-point: int, + samples: [+ float], + * equipment-type => equipment-tolerances, +} +equipment-type = [name: tstr, manufacturer: tstr] +equipment-tolerances = [+ [float, float]] + +PersonalData = { + ? displayName: tstr, + NameComponents, + ? age: uint, + * tstr => any +} + +NameComponents = ( + ? firstName: tstr, + ? familyName: tstr, +) + +square-roots = {* x => y} +x = int +y = float + +extensible-map-example = { + ? "optional-key" ^ => int, + * tstr => any +} + +extensible-map-example = { + ? "optional-key": int, + * tstr => any +} + +extensible-map-example = { + ? optional-key: int, + * tstr => any +} + +biguint = #6.2(bstr) +buuid = #6.37(bstr) +my_uri = #6.32(tstr) / tstr + +basic-header = [ + field1: int, + field2: text, +] + +advanced-header = [ + ~basic-header, + field3: bytes, + field4: ~time, +] + +hexfloat = 0xcafe.badp-9sdf +hexfloat = 0xcafe.badp-9 + +full-address = [[+ label], ip4, ip6] +ip4 = bstr .size 4 +ip6 = bstr .size 16 +label = bstr .size (1..63) + +member-keys = { + bare-word: true, + "string": false, + 4711: number, + 0xdecafe: false, +} + +audio_sample = uint .size 3 ; 24-bit, equivalent to 0...16777216 + +tcpflagbytes = bstr .bits flags +flags = &( + fin: 8, + syn: 9, + rst: 10, + psh: 11, + ack: 12, + urg: 13, + ece: 14, + cwr: 15, + ns: 0, +) / (4..7) ; data offset bits + +rwxbits = uint .bits rwx +rwx = &(r: 2, w: 1, x: 0) + +nai = tstr .regexp "[A-Za-z0-9]+@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)+" + +message = $message .within message-structure +message-structure = [message_type, *message_option] +message_type = 0..255 +message_option = any + +$message /= [3, dough: text, topping: [* text]] +$message /= [4, noodles: text, sauce: text, parmesan: bool] + +speed = number .ge 0 ; unit: m/s + +timer = { + time: uint, + ? displayed-step: (number .gt 0) .default 1 +} + +tcp-header = {seq: uint, ack: uint, * $$tcp-option} + +; later, in a different file + +$$tcp-option //= ( +sack: [+(left: uint, right: uint)] +) + +; and, maybe in another file + +$$tcp-option //= ( +sack-permitted: true +) + +PersonalData = { + ? displayName: tstr, + NameComponents, + ? age: uint, + * $$personaldata-extensions +} + +NameComponents = ( + ? firstName: tstr, + ? familyName: tstr, +) + +; The above already works as is. +; But then, we can add later: + +$$personaldata-extensions //= ( + favorite-salsa: tstr, +) + +; and again, somewhere else: + +$$personaldata-extensions //= ( + shoesize: uint, +) + +messages = message<"reboot", "now"> / message<"sleep", 1..100> +message<t, v> = {type: t, value: v} + +t = [group1] +group1 = (a / b // c / d) +a = 1 b = 2 c = 3 d = 4 + +t = {group2} +group2 = (? ab: a / b // cd: c / d) +a = 1 b = 2 c = 3 d = 4 + +t = [group3] +group3 = (+ a / b / c) +a = 1 b = 2 c = 3 + +t = [group4] +group4 = (+ a // b / c) +a = 1 b = 2 c = 3 + +t = [group4a] +group4a = ((+ a) // (b / c)) +a = 1 b = 2 c = 3 + +byte-strings = 'hello world' / h'68656c6c6f20776f726c64' / b64'Zm-9v_YmE=' +;byte-strings-w-errors = h'68656gc6c6f2077oops6f726c64' / b64'Zm+9vY/mE=' +oneline-bstr = '<?php print(\'hello world\'); // no comment … ?>' +multiline-bstr = ' + <?php + print(\'hello world\'); // no comment + … ?> +' +multiline-hex = h' + 83 ; \'83\' means Array of length 3 + 01 ; 1 + 82 ; Array of length 2 + 02 ; 2 + 03 ; 3 + 82 ; Array of length 2 + 04 ; 4 + 05 ; 5 +' +;multiline-hex-err = h' +; 83 \'83\' means Array of length 3 (oops, missed the \';\') +; 01 ; 1 +;' + +; THE STANDARD "POSTLUDE" +any = # + +uint = #0 +nint = #1 +int = uint / nint + +bstr = #2 +bytes = bstr +tstr = #3 +text = tstr + +tdate = #6.0(tstr) +time = #6.1(number) +number = int / float +biguint = #6.0x02(bstr) +biguint = #6.2(bstr) +bignint = #6.3(bstr) +bigint = biguint / bignint +integer = int / bigint +unsigned = uint / biguint +decfrac = #6.4([e10: int, m: integer]) +bigfloat = #6.5([e2: int, m: integer]) +eb64url = #6.21(any) +eb64legacy = #6.22(any) +eb16 = #6.23(any) +encoded-cbor = #6.24(bstr) +uri = #6.32(tstr) +b64url = #6.33(tstr) +b64legacy = #6.34(tstr) +regexp = #6.35(tstr) +mime-message = #6.36(tstr) +cbor-any = #6.55799(any) + +float16 = #7.25 +float32 = #7.26 +float64 = #7.27 +float16-32 = float16 / float32 +float32-64 = float32 / float64 +float = float16-32 / float64 + +false = #7.20 +true = #7.21 +bool = false / true +nil = #7.22 +null = nil +undefined = #7.23 + + +; INVALID CDDL + +;invalid_identifier- = -another_invalid +;untermindated-string = "sometimes I cannot finish my… +;next-thought = { valid: true } diff --git a/tests/examplefiles/cddl/example.cddl.output b/tests/examplefiles/cddl/example.cddl.output new file mode 100644 index 00000000..f98cc411 --- /dev/null +++ b/tests/examplefiles/cddl/example.cddl.output @@ -0,0 +1,2665 @@ +'; Note: This CDDL does not make sense *semantically*.' Comment.Single +'\n' Text + +'; These are various examples from the CDDL spec that' Comment.Single +'\n' Text + +'; should cover most syntax cases, however.' Comment.Single +'\n\n' Text + +'pii' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'age' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'name' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'employer' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'person' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'pii' Name.Class +'\n' Text + +'}' Punctuation +'\n\n' Text + +'person' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'(' Punctuation +'\n ' Text +'age' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'name' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'employer' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'}' Punctuation +'\n\n' Text + +'person' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'identity' Name.Class +',' Punctuation +'\n ' Text +'employer' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n' Text + +'}' Punctuation +'\n\n' Text + +'dog' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'identity' Name.Class +',' Punctuation +'\n ' Text +'leash-length' Literal.String +':' Punctuation +' ' Text +'float' Name.Builtin +',' Punctuation +'\n' Text + +'}' Punctuation +'\n\n' Text + +'identity' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'age' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'name' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'address' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +' ' Text +'delivery' Name.Class +' ' Text +'}' Punctuation +'\n\n' Text + +'delivery' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n' Text + +'street' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +' ' Text +'?' Operator +' ' Text +'number' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +' ' Text +'city' Name.Class +' ' Text +'//' Operator +'\n' Text + +'po-box' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +' ' Text +'city' Name.Class +' ' Text +'//' Operator +'\n' Text + +'per-pickup' Literal.String +':' Punctuation +' ' Text +'true' Name.Builtin +' ' Text +')' Punctuation +'\n\n' Text + +'city' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n' Text + +'name' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +' ' Text +'zip-code' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +'\n' Text + +')' Punctuation +'\n\n' Text + +'attire' Name.Class +' ' Text +'/' Operator +'=' Operator +' ' Text +'"swimwear"' Literal.String.Double +'\n\n' Text + +'delivery' Name.Class +' ' Text +'//' Operator +'=' Operator +' ' Text +'(' Punctuation +'\n' Text + +'lat' Literal.String +':' Punctuation +' ' Text +'float' Name.Builtin +',' Punctuation +' ' Text +'long' Literal.String +':' Punctuation +' ' Text +'float' Name.Builtin +',' Punctuation +' ' Text +'drone-type' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +'\n' Text + +')' Punctuation +'\n\n' Text + +'device-address' Name.Class +' ' Text +'=' Operator +' ' Text +'bytefloat' Name.Class +'\n' Text + +'max-byte' Name.Class +' ' Text +'=' Operator +' ' Text +'0b01001001' Literal.Number.Bin +'\n' Text + +'max-oct' Name.Class +' ' Text +'=' Operator +' ' Text +'0o014' Literal.Number.Oct +'\n' Text + +'max-int' Name.Class +' ' Text +'=' Operator +' ' Text +'-123' Literal.Number.Int +'\n' Text + +'max-float' Name.Class +' ' Text +'=' Operator +' ' Text +'23.5' Literal.Number.Float +'\n' Text + +'int-range' Name.Class +' ' Text +'=' Operator +' ' Text +'0' Literal.Number.Int +'..' Operator +'10' Literal.Number.Int +' ' Text +'; only integers match' Comment.Single +'\n' Text + +'float-range' Name.Class +' ' Text +'=' Operator +' ' Text +'0.0' Literal.Number.Float +'..' Operator +'10.0' Literal.Number.Float +' ' Text +'; only floats match' Comment.Single +'\n' Text + +'byte' Name.Class +' ' Text +'=' Operator +' ' Text +'0' Literal.Number.Int +'..' Operator +'max-byte' Name.Class +' ' Text +'; inclusive range' Comment.Single +'\n' Text + +'first-non-byte' Name.Class +' ' Text +'=' Operator +' ' Text +'256' Literal.Number.Int +'\n' Text + +'byte1' Name.Class +' ' Text +'=' Operator +' ' Text +'0' Literal.Number.Int +'...' Operator +'first-non-byte' Name.Class +' ' Text +'; byte1 is equivalent to byte' Comment.Single +'\n\n' Text + +'BAD-range1' Name.Class +' ' Text +'=' Operator +' ' Text +'0' Literal.Number.Int +'..' Operator +'10.0' Literal.Number.Float +' ' Text +'; NOT DEFINED' Comment.Single +'\n' Text + +'BAD-range2' Name.Class +' ' Text +'=' Operator +' ' Text +'0.0' Literal.Number.Float +'..' Operator +'10' Literal.Number.Int +' ' Text +'; NOT DEFINED' Comment.Single +'\n' Text + +'numeric-range' Name.Class +' ' Text +'=' Operator +' ' Text +'int-range' Name.Class +' ' Text +'/' Operator +' ' Text +'float-range' Name.Class +'\n\n' Text + +'terminal-color' Name.Class +' ' Text +'=' Operator +' ' Text +'&' Operator +'basecolors' Name.Class +'\n' Text + +'basecolors' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'black' Literal.String +':' Punctuation +' ' Text +'0' Literal.Number.Int +',' Punctuation +' ' Text +'red' Literal.String +':' Punctuation +' ' Text +'1' Literal.Number.Int +',' Punctuation +' ' Text +'green' Literal.String +':' Punctuation +' ' Text +'2' Literal.Number.Int +',' Punctuation +' ' Text +'yellow' Literal.String +':' Punctuation +' ' Text +'3' Literal.Number.Int +',' Punctuation +'\n ' Text +'blue' Literal.String +':' Punctuation +' ' Text +'4' Literal.Number.Int +',' Punctuation +' ' Text +'magenta' Literal.String +':' Punctuation +' ' Text +'5' Literal.Number.Int +',' Punctuation +' ' Text +'cyan' Literal.String +':' Punctuation +' ' Text +'6' Literal.Number.Int +',' Punctuation +' ' Text +'white' Literal.String +':' Punctuation +' ' Text +'7' Literal.Number.Int +',' Punctuation +'\n' Text + +')' Punctuation +'\n' Text + +'extended-color' Name.Class +' ' Text +'=' Operator +' ' Text +'&' Operator +'(' Punctuation +'\n ' Text +'basecolors' Name.Class +',' Punctuation +'\n ' Text +'orange' Literal.String +':' Punctuation +' ' Text +'8' Literal.Number.Int +',' Punctuation +' ' Text +'pink' Literal.String +':' Punctuation +' ' Text +'9' Literal.Number.Int +',' Punctuation +' ' Text +'purple' Literal.String +':' Punctuation +' ' Text +'10' Literal.Number.Int +',' Punctuation +' ' Text +'brown' Literal.String +':' Punctuation +' ' Text +'11' Literal.Number.Int +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'foo' Name.Class +' ' Text +'=' Operator +' ' Text +'#' Keyword.Type +'\n\n' Text + +'my_breakfast' Name.Class +' ' Text +'=' Operator +' ' Text +'#6.55799' Keyword.Type +'(' Punctuation +'breakfast' Name.Class +')' Punctuation +' ' Text +'; cbor-any is too general!' Comment.Single +'\n' Text + +'breakfast' Name.Class +' ' Text +'=' Operator +' ' Text +'cereal' Name.Class +' ' Text +'/' Operator +' ' Text +'porridge' Name.Class +'\n' Text + +'cereal' Name.Class +' ' Text +'=' Operator +' ' Text +'#6.998' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +'\n' Text + +'porridge' Name.Class +' ' Text +'=' Operator +' ' Text +'#6.999' Keyword.Type +'(' Punctuation +'[' Punctuation +'liquid' Name.Class +',' Punctuation +' ' Text +'solid' Name.Class +']' Punctuation +')' Punctuation +'\n' Text + +'liquid' Name.Class +' ' Text +'=' Operator +' ' Text +'milk' Name.Class +' ' Text +'/' Operator +' ' Text +'water' Name.Class +'\n' Text + +'milk' Name.Class +' ' Text +'=' Operator +' ' Text +'0' Literal.Number.Int +'\n' Text + +'water' Name.Class +' ' Text +'=' Operator +' ' Text +'1' Literal.Number.Int +'\n' Text + +'solid' Name.Class +' ' Text +'=' Operator +' ' Text +'tstr' Name.Builtin +'\n\n' Text + +'; This is a comment' Comment.Single +'\n' Text + +'person' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +' ' Text +'g' Name.Class +' ' Text +'}' Punctuation +'\n\n' Text + +'g' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'"name"' Literal.String.Double +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'age' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +' ' Text +'; "age" is a bareword' Comment.Single +'\n' Text + +')' Punctuation +'\n\n' Text + +'apartment' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'kitchen' Literal.String +':' Punctuation +' ' Text +'size' Name.Class +',' Punctuation +'\n ' Text +'*' Operator +' ' Text +'bedroom' Literal.String +':' Punctuation +' ' Text +'size' Name.Class +',' Punctuation +'\n' Text + +'}' Punctuation +'\n' Text + +'size' Name.Class +' ' Text +'=' Operator +' ' Text +'float' Name.Builtin +' ' Text +'; in m2' Comment.Single +'\n\n' Text + +'unlimited-people' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'*' Operator +' ' Text +'person' Name.Class +']' Punctuation +'\n' Text + +'one-or-two-people' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'1' Literal.Number +'*' Operator +'2' Literal.Number +' ' Text +'person' Name.Class +']' Punctuation +'\n' Text + +'at-least-two-people' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'2' Literal.Number +'*' Operator +' ' Text +'person' Name.Class +']' Punctuation +'\n' Text + +'person' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'name' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'age' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'Geography' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'\n ' Text +'city' Literal.String +' ' Text +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'gpsCoordinates' Literal.String +' ' Text +':' Punctuation +' ' Text +'GpsCoordinates' Name.Class +',' Punctuation +'\n' Text + +']' Punctuation +'\n\n' Text + +'GpsCoordinates' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'longitude' Literal.String +' ' Text +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +' ' Text +'; multiplied by 10^7' Comment.Single +'\n ' Text +'latitude' Literal.String +' ' Text +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +' ' Text +'; multiplied by 10^7' Comment.Single +'\n' Text + +'}' Punctuation +'\n' Text + +'located-samples' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'sample-point' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'samples' Literal.String +':' Punctuation +' ' Text +'[' Punctuation +'+' Operator +' ' Text +'float' Name.Builtin +']' Punctuation +',' Punctuation +'\n' Text + +'}' Punctuation +'\n\n' Text + +'proper-ints' Name.Class +' ' Text +'=' Operator +' ' Text +'1' Literal.Number.Int +' ' Text +'/' Operator +' ' Text +'0' Literal.Number.Int +'\n' Text + +';invalid-int = 01' Comment.Single +'\n\n' Text + +'flt' Name.Class +' ' Text +'=' Operator +' ' Text +'1.23' Literal.Number.Float +'\n' Text + +'flt' Name.Class +' ' Text +'=' Operator +' ' Text +'-1.23' Literal.Number.Float +'\n' Text + +'flt' Name.Class +' ' Text +'=' Operator +' ' Text +'1.23e+10' Literal.Number.Float +'\n' Text + +'flt' Name.Class +' ' Text +'=' Operator +' ' Text +'1.23e-10' Literal.Number.Float +'\n' Text + +'flt' Name.Class +' ' Text +'=' Operator +' ' Text +'1.23e10' Literal.Number.Float +'\n' Text + +'val' Name.Class +' ' Text +'=' Operator +' ' Text +'123' Literal.Number.Int +'\n\n' Text + +'located-samples' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'sample-point' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'samples' Literal.String +':' Punctuation +' ' Text +'[' Punctuation +'+' Operator +' ' Text +'float' Name.Builtin +']' Punctuation +',' Punctuation +'\n ' Text +'*' Operator +' ' Text +'equipment-type' Name.Class +' ' Text +'=>' Operator +' ' Text +'equipment-tolerances' Name.Class +',' Punctuation +'\n' Text + +'}' Punctuation +'\n' Text + +'equipment-type' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'name' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +' ' Text +'manufacturer' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +']' Punctuation +'\n' Text + +'equipment-tolerances' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'+' Operator +' ' Text +'[' Punctuation +'float' Name.Builtin +',' Punctuation +' ' Text +'float' Name.Builtin +']' Punctuation +']' Punctuation +'\n\n' Text + +'PersonalData' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'?' Operator +' ' Text +'displayName' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'NameComponents' Name.Class +',' Punctuation +'\n ' Text +'?' Operator +' ' Text +'age' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +'\n ' Text +'*' Operator +' ' Text +'tstr' Name.Builtin +' ' Text +'=>' Operator +' ' Text +'any' Name.Builtin +'\n' Text + +'}' Punctuation +'\n\n' Text + +'NameComponents' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'?' Operator +' ' Text +'firstName' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'?' Operator +' ' Text +'familyName' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'square-roots' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'*' Operator +' ' Text +'x' Name.Class +' ' Text +'=>' Operator +' ' Text +'y' Name.Class +'}' Punctuation +'\n' Text + +'x' Name.Class +' ' Text +'=' Operator +' ' Text +'int' Name.Builtin +'\n' Text + +'y' Name.Class +' ' Text +'=' Operator +' ' Text +'float' Name.Builtin +'\n\n' Text + +'extensible-map-example' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'?' Operator +' ' Text +'"optional-key"' Literal.String.Double +' ' Text +'^' Operator +' ' Text +'=>' Operator +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'*' Operator +' ' Text +'tstr' Name.Builtin +' ' Text +'=>' Operator +' ' Text +'any' Name.Builtin +'\n' Text + +'}' Punctuation +'\n\n' Text + +'extensible-map-example' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'?' Operator +' ' Text +'"optional-key"' Literal.String.Double +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'*' Operator +' ' Text +'tstr' Name.Builtin +' ' Text +'=>' Operator +' ' Text +'any' Name.Builtin +'\n' Text + +'}' Punctuation +'\n\n' Text + +'extensible-map-example' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'?' Operator +' ' Text +'optional-key' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'*' Operator +' ' Text +'tstr' Name.Builtin +' ' Text +'=>' Operator +' ' Text +'any' Name.Builtin +'\n' Text + +'}' Punctuation +'\n\n' Text + +'biguint' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.2' Keyword.Type +'(' Punctuation +'bstr' Name.Builtin +')' Punctuation +'\n' Text + +'buuid' Name.Class +' ' Text +'=' Operator +' ' Text +'#6.37' Keyword.Type +'(' Punctuation +'bstr' Name.Builtin +')' Punctuation +'\n' Text + +'my_uri' Name.Class +' ' Text +'=' Operator +' ' Text +'#6.32' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +' ' Text +'/' Operator +' ' Text +'tstr' Name.Builtin +'\n\n' Text + +'basic-header' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'\n ' Text +'field1' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +'\n ' Text +'field2' Literal.String +':' Punctuation +' ' Text +'text' Name.Builtin +',' Punctuation +'\n' Text + +']' Punctuation +'\n\n' Text + +'advanced-header' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'\n ' Text +'~' Operator +'basic-header' Name.Class +',' Punctuation +'\n ' Text +'field3' Literal.String +':' Punctuation +' ' Text +'bytes' Name.Builtin +',' Punctuation +'\n ' Text +'field4' Literal.String +':' Punctuation +' ' Text +'~' Operator +'time' Name.Builtin +',' Punctuation +'\n' Text + +']' Punctuation +'\n\n' Text + +'hexfloat' Name.Class +' ' Text +'=' Operator +' ' Text +'0xcafe.badp-9' Literal.Number.Hex +'sdf' Name.Class +'\n' Text + +'hexfloat' Name.Class +' ' Text +'=' Operator +' ' Text +'0xcafe.badp-9' Literal.Number.Hex +'\n\n' Text + +'full-address' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'[' Punctuation +'+' Operator +' ' Text +'label' Name.Class +']' Punctuation +',' Punctuation +' ' Text +'ip4' Name.Class +',' Punctuation +' ' Text +'ip6' Name.Class +']' Punctuation +'\n' Text + +'ip4' Name.Class +' ' Text +'=' Operator +' ' Text +'bstr' Name.Builtin +' ' Text +'.size' Operator.Word +' ' Text +'4' Literal.Number.Int +'\n' Text + +'ip6' Name.Class +' ' Text +'=' Operator +' ' Text +'bstr' Name.Builtin +' ' Text +'.size' Operator.Word +' ' Text +'16' Literal.Number.Int +'\n' Text + +'label' Name.Class +' ' Text +'=' Operator +' ' Text +'bstr' Name.Builtin +' ' Text +'.size' Operator.Word +' ' Text +'(' Punctuation +'1' Literal.Number.Int +'..' Operator +'63' Literal.Number.Int +')' Punctuation +'\n\n' Text + +'member-keys' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'bare-word' Literal.String +':' Punctuation +' ' Text +'true' Name.Builtin +',' Punctuation +'\n ' Text +'"string"' Literal.String.Double +':' Punctuation +' ' Text +'false' Name.Builtin +',' Punctuation +'\n ' Text +'4711' Literal.Number.Int +':' Punctuation +' ' Text +'number' Name.Builtin +',' Punctuation +'\n ' Text +'0xdecafe' Literal.Number.Hex +':' Punctuation +' ' Text +'false' Name.Builtin +',' Punctuation +'\n' Text + +'}' Punctuation +'\n\n' Text + +'audio_sample' Name.Class +' ' Text +'=' Operator +' ' Text +'uint' Name.Builtin +' ' Text +'.size' Operator.Word +' ' Text +'3' Literal.Number.Int +' ' Text +'; 24-bit, equivalent to 0...16777216' Comment.Single +'\n\n' Text + +'tcpflagbytes' Name.Class +' ' Text +'=' Operator +' ' Text +'bstr' Name.Builtin +' ' Text +'.bits' Operator.Word +' ' Text +'flags' Name.Class +'\n' Text + +'flags' Name.Class +' ' Text +'=' Operator +' ' Text +'&' Operator +'(' Punctuation +'\n ' Text +'fin' Literal.String +':' Punctuation +' ' Text +'8' Literal.Number.Int +',' Punctuation +'\n ' Text +'syn' Literal.String +':' Punctuation +' ' Text +'9' Literal.Number.Int +',' Punctuation +'\n ' Text +'rst' Literal.String +':' Punctuation +' ' Text +'10' Literal.Number.Int +',' Punctuation +'\n ' Text +'psh' Literal.String +':' Punctuation +' ' Text +'11' Literal.Number.Int +',' Punctuation +'\n ' Text +'ack' Literal.String +':' Punctuation +' ' Text +'12' Literal.Number.Int +',' Punctuation +'\n ' Text +'urg' Literal.String +':' Punctuation +' ' Text +'13' Literal.Number.Int +',' Punctuation +'\n ' Text +'ece' Literal.String +':' Punctuation +' ' Text +'14' Literal.Number.Int +',' Punctuation +'\n ' Text +'cwr' Literal.String +':' Punctuation +' ' Text +'15' Literal.Number.Int +',' Punctuation +'\n ' Text +'ns' Literal.String +':' Punctuation +' ' Text +'0' Literal.Number.Int +',' Punctuation +'\n' Text + +')' Punctuation +' ' Text +'/' Operator +' ' Text +'(' Punctuation +'4' Literal.Number.Int +'..' Operator +'7' Literal.Number.Int +')' Punctuation +' ' Text +'; data offset bits' Comment.Single +'\n\n' Text + +'rwxbits' Name.Class +' ' Text +'=' Operator +' ' Text +'uint' Name.Builtin +' ' Text +'.bits' Operator.Word +' ' Text +'rwx' Name.Class +'\n' Text + +'rwx' Name.Class +' ' Text +'=' Operator +' ' Text +'&' Operator +'(' Punctuation +'r' Literal.String +':' Punctuation +' ' Text +'2' Literal.Number.Int +',' Punctuation +' ' Text +'w' Literal.String +':' Punctuation +' ' Text +'1' Literal.Number.Int +',' Punctuation +' ' Text +'x' Literal.String +':' Punctuation +' ' Text +'0' Literal.Number.Int +')' Punctuation +'\n\n' Text + +'nai' Name.Class +' ' Text +'=' Operator +' ' Text +'tstr' Name.Builtin +' ' Text +'.regexp' Operator.Word +' ' Text +'"[A-Za-z0-9]+@[A-Za-z0-9]+(\\\\.[A-Za-z0-9]+)+"' Literal.String.Double +'\n\n' Text + +'message' Name.Class +' ' Text +'=' Operator +' ' Text +'$message' Name.Class +' ' Text +'.within' Operator.Word +' ' Text +'message-structure' Name.Class +'\n' Text + +'message-structure' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'message_type' Name.Class +',' Punctuation +' ' Text +'*' Operator +'message_option' Name.Class +']' Punctuation +'\n' Text + +'message_type' Name.Class +' ' Text +'=' Operator +' ' Text +'0' Literal.Number.Int +'..' Operator +'255' Literal.Number.Int +'\n' Text + +'message_option' Name.Class +' ' Text +'=' Operator +' ' Text +'any' Name.Builtin +'\n\n' Text + +'$message' Name.Class +' ' Text +'/' Operator +'=' Operator +' ' Text +'[' Punctuation +'3' Literal.Number.Int +',' Punctuation +' ' Text +'dough' Literal.String +':' Punctuation +' ' Text +'text' Name.Builtin +',' Punctuation +' ' Text +'topping' Literal.String +':' Punctuation +' ' Text +'[' Punctuation +'*' Operator +' ' Text +'text' Name.Builtin +']' Punctuation +']' Punctuation +'\n' Text + +'$message' Name.Class +' ' Text +'/' Operator +'=' Operator +' ' Text +'[' Punctuation +'4' Literal.Number.Int +',' Punctuation +' ' Text +'noodles' Literal.String +':' Punctuation +' ' Text +'text' Name.Builtin +',' Punctuation +' ' Text +'sauce' Literal.String +':' Punctuation +' ' Text +'text' Name.Builtin +',' Punctuation +' ' Text +'parmesan' Literal.String +':' Punctuation +' ' Text +'bool' Name.Builtin +']' Punctuation +'\n\n' Text + +'speed' Name.Class +' ' Text +'=' Operator +' ' Text +'number' Name.Builtin +' ' Text +'.ge' Operator.Word +' ' Text +'0' Literal.Number.Int +' ' Text +'; unit: m/s' Comment.Single +'\n\n' Text + +'timer' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'time' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +'\n ' Text +'?' Operator +' ' Text +'displayed-step' Literal.String +':' Punctuation +' ' Text +'(' Punctuation +'number' Name.Builtin +' ' Text +'.gt' Operator.Word +' ' Text +'0' Literal.Number.Int +')' Punctuation +' ' Text +'.default' Operator.Word +' ' Text +'1' Literal.Number.Int +'\n' Text + +'}' Punctuation +'\n\n' Text + +'tcp-header' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'seq' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +' ' Text +'ack' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +' ' Text +'*' Operator +' ' Text +'$$tcp-option' Name.Class +'}' Punctuation +'\n\n' Text + +'; later, in a different file' Comment.Single +'\n\n' Text + +'$$tcp-option' Name.Class +' ' Text +'//' Operator +'=' Operator +' ' Text +'(' Punctuation +'\n' Text + +'sack' Literal.String +':' Punctuation +' ' Text +'[' Punctuation +'+' Operator +'(' Punctuation +'left' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +' ' Text +'right' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +')' Punctuation +']' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'; and, maybe in another file' Comment.Single +'\n\n' Text + +'$$tcp-option' Name.Class +' ' Text +'//' Operator +'=' Operator +' ' Text +'(' Punctuation +'\n' Text + +'sack-permitted' Literal.String +':' Punctuation +' ' Text +'true' Name.Builtin +'\n' Text + +')' Punctuation +'\n\n' Text + +'PersonalData' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'\n ' Text +'?' Operator +' ' Text +'displayName' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'NameComponents' Name.Class +',' Punctuation +'\n ' Text +'?' Operator +' ' Text +'age' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +'\n ' Text +'*' Operator +' ' Text +'$$personaldata-extensions' Name.Class +'\n' Text + +'}' Punctuation +'\n\n' Text + +'NameComponents' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'?' Operator +' ' Text +'firstName' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n ' Text +'?' Operator +' ' Text +'familyName' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'; The above already works as is.' Comment.Single +'\n' Text + +'; But then, we can add later:' Comment.Single +'\n\n' Text + +'$$personaldata-extensions' Name.Class +' ' Text +'//' Operator +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'favorite-salsa' Literal.String +':' Punctuation +' ' Text +'tstr' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'; and again, somewhere else:' Comment.Single +'\n\n' Text + +'$$personaldata-extensions' Name.Class +' ' Text +'//' Operator +'=' Operator +' ' Text +'(' Punctuation +'\n ' Text +'shoesize' Literal.String +':' Punctuation +' ' Text +'uint' Name.Builtin +',' Punctuation +'\n' Text + +')' Punctuation +'\n\n' Text + +'messages' Name.Class +' ' Text +'=' Operator +' ' Text +'message' Name.Class +'<' Punctuation +'"reboot"' Literal.String.Double +',' Punctuation +' ' Text +'"now"' Literal.String.Double +'>' Punctuation +' ' Text +'/' Operator +' ' Text +'message' Name.Class +'<' Punctuation +'"sleep"' Literal.String.Double +',' Punctuation +' ' Text +'1' Literal.Number.Int +'..' Operator +'100' Literal.Number.Int +'>' Punctuation +'\n' Text + +'message' Name.Class +'<' Punctuation +'t' Name.Class +',' Punctuation +' ' Text +'v' Name.Class +'>' Punctuation +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'type' Literal.String +':' Punctuation +' ' Text +'t' Name.Class +',' Punctuation +' ' Text +'value' Literal.String +':' Punctuation +' ' Text +'v' Name.Class +'}' Punctuation +'\n\n' Text + +'t' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'group1' Name.Class +']' Punctuation +'\n' Text + +'group1' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'a' Name.Class +' ' Text +'/' Operator +' ' Text +'b' Name.Class +' ' Text +'//' Operator +' ' Text +'c' Name.Class +' ' Text +'/' Operator +' ' Text +'d' Name.Class +')' Punctuation +'\n' Text + +'a' Name.Class +' ' Text +'=' Operator +' ' Text +'1' Literal.Number.Int +' ' Text +'b' Name.Class +' ' Text +'=' Operator +' ' Text +'2' Literal.Number.Int +' ' Text +'c' Name.Class +' ' Text +'=' Operator +' ' Text +'3' Literal.Number.Int +' ' Text +'d' Name.Class +' ' Text +'=' Operator +' ' Text +'4' Literal.Number.Int +'\n\n' Text + +'t' Name.Class +' ' Text +'=' Operator +' ' Text +'{' Punctuation +'group2' Name.Class +'}' Punctuation +'\n' Text + +'group2' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'?' Operator +' ' Text +'ab' Literal.String +':' Punctuation +' ' Text +'a' Name.Class +' ' Text +'/' Operator +' ' Text +'b' Name.Class +' ' Text +'//' Operator +' ' Text +'cd' Literal.String +':' Punctuation +' ' Text +'c' Name.Class +' ' Text +'/' Operator +' ' Text +'d' Name.Class +')' Punctuation +'\n' Text + +'a' Name.Class +' ' Text +'=' Operator +' ' Text +'1' Literal.Number.Int +' ' Text +'b' Name.Class +' ' Text +'=' Operator +' ' Text +'2' Literal.Number.Int +' ' Text +'c' Name.Class +' ' Text +'=' Operator +' ' Text +'3' Literal.Number.Int +' ' Text +'d' Name.Class +' ' Text +'=' Operator +' ' Text +'4' Literal.Number.Int +'\n\n' Text + +'t' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'group3' Name.Class +']' Punctuation +'\n' Text + +'group3' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'+' Operator +' ' Text +'a' Name.Class +' ' Text +'/' Operator +' ' Text +'b' Name.Class +' ' Text +'/' Operator +' ' Text +'c' Name.Class +')' Punctuation +'\n' Text + +'a' Name.Class +' ' Text +'=' Operator +' ' Text +'1' Literal.Number.Int +' ' Text +'b' Name.Class +' ' Text +'=' Operator +' ' Text +'2' Literal.Number.Int +' ' Text +'c' Name.Class +' ' Text +'=' Operator +' ' Text +'3' Literal.Number.Int +'\n\n' Text + +'t' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'group4' Name.Class +']' Punctuation +'\n' Text + +'group4' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'+' Operator +' ' Text +'a' Name.Class +' ' Text +'//' Operator +' ' Text +'b' Name.Class +' ' Text +'/' Operator +' ' Text +'c' Name.Class +')' Punctuation +'\n' Text + +'a' Name.Class +' ' Text +'=' Operator +' ' Text +'1' Literal.Number.Int +' ' Text +'b' Name.Class +' ' Text +'=' Operator +' ' Text +'2' Literal.Number.Int +' ' Text +'c' Name.Class +' ' Text +'=' Operator +' ' Text +'3' Literal.Number.Int +'\n\n' Text + +'t' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'group4a' Name.Class +']' Punctuation +'\n' Text + +'group4a' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'(' Punctuation +'+' Operator +' ' Text +'a' Name.Class +')' Punctuation +' ' Text +'//' Operator +' ' Text +'(' Punctuation +'b' Name.Class +' ' Text +'/' Operator +' ' Text +'c' Name.Class +')' Punctuation +')' Punctuation +'\n' Text + +'a' Name.Class +' ' Text +'=' Operator +' ' Text +'1' Literal.Number.Int +' ' Text +'b' Name.Class +' ' Text +'=' Operator +' ' Text +'2' Literal.Number.Int +' ' Text +'c' Name.Class +' ' Text +'=' Operator +' ' Text +'3' Literal.Number.Int +'\n\n' Text + +'byte-strings' Name.Class +' ' Text +'=' Operator +' ' Text +"'" Literal.String.Single +'h' Literal.String.Single +'e' Literal.String.Single +'l' Literal.String.Single +'l' Literal.String.Single +'o' Literal.String.Single +' ' Literal.String.Single +'w' Literal.String.Single +'o' Literal.String.Single +'r' Literal.String.Single +'l' Literal.String.Single +'d' Literal.String.Single +"'" Literal.String.Single +' ' Text +'/' Operator +' ' Text +'h' Literal.String.Affix +"'" Literal.String.Single +'68656c6c6f20776f726c64' Literal.String.Single +"'" Literal.String.Single +' ' Text +'/' Operator +' ' Text +'b64' Literal.String.Affix +"'" Literal.String.Single +'Zm-9v_YmE=' Literal.String.Single +"'" Literal.String.Single +'\n' Text + +";byte-strings-w-errors = h'68656gc6c6f2077oops6f726c64' / b64'Zm+9vY/mE='" Comment.Single +'\n' Text + +'oneline-bstr' Name.Class +' ' Text +'=' Operator +' ' Text +"'" Literal.String.Single +'<' Literal.String.Single +'?' Literal.String.Single +'p' Literal.String.Single +'h' Literal.String.Single +'p' Literal.String.Single +' ' Literal.String.Single +'p' Literal.String.Single +'r' Literal.String.Single +'i' Literal.String.Single +'n' Literal.String.Single +'t' Literal.String.Single +'(' Literal.String.Single +"\\'" Literal.String.Escape +'h' Literal.String.Single +'e' Literal.String.Single +'l' Literal.String.Single +'l' Literal.String.Single +'o' Literal.String.Single +' ' Literal.String.Single +'w' Literal.String.Single +'o' Literal.String.Single +'r' Literal.String.Single +'l' Literal.String.Single +'d' Literal.String.Single +"\\'" Literal.String.Escape +')' Literal.String.Single +';' Literal.String.Single +' ' Literal.String.Single +' ' Literal.String.Single +'/' Literal.String.Single +'/' Literal.String.Single +' ' Literal.String.Single +'n' Literal.String.Single +'o' Literal.String.Single +' ' Literal.String.Single +'c' Literal.String.Single +'o' Literal.String.Single +'m' Literal.String.Single +'m' Literal.String.Single +'e' Literal.String.Single +'n' Literal.String.Single +'t' Literal.String.Single +' ' Literal.String.Single +'…' Literal.String.Single +' ' Literal.String.Single +'?' Literal.String.Single +'>' Literal.String.Single +"'" Literal.String.Single +'\n' Text + +'multiline-bstr' Name.Class +' ' Text +'=' Operator +' ' Text +"'" Literal.String.Single +'\n' Literal.String.Single + +' ' Literal.String.Single +' ' Literal.String.Single +'<' Literal.String.Single +'?' Literal.String.Single +'p' Literal.String.Single +'h' Literal.String.Single +'p' Literal.String.Single +'\n' Literal.String.Single + +' ' Literal.String.Single +' ' Literal.String.Single +' ' Literal.String.Single +' ' Literal.String.Single +'p' Literal.String.Single +'r' Literal.String.Single +'i' Literal.String.Single +'n' Literal.String.Single +'t' Literal.String.Single +'(' Literal.String.Single +"\\'" Literal.String.Escape +'h' Literal.String.Single +'e' Literal.String.Single +'l' Literal.String.Single +'l' Literal.String.Single +'o' Literal.String.Single +' ' Literal.String.Single +'w' Literal.String.Single +'o' Literal.String.Single +'r' Literal.String.Single +'l' Literal.String.Single +'d' Literal.String.Single +"\\'" Literal.String.Escape +')' Literal.String.Single +';' Literal.String.Single +' ' Literal.String.Single +' ' Literal.String.Single +'/' Literal.String.Single +'/' Literal.String.Single +' ' Literal.String.Single +'n' Literal.String.Single +'o' Literal.String.Single +' ' Literal.String.Single +'c' Literal.String.Single +'o' Literal.String.Single +'m' Literal.String.Single +'m' Literal.String.Single +'e' Literal.String.Single +'n' Literal.String.Single +'t' Literal.String.Single +'\n' Literal.String.Single + +' ' Literal.String.Single +' ' Literal.String.Single +' ' Literal.String.Single +' ' Literal.String.Single +'…' Literal.String.Single +' ' Literal.String.Single +'?' Literal.String.Single +'>' Literal.String.Single +'\n' Literal.String.Single + +"'" Literal.String.Single +'\n' Text + +'multiline-hex' Name.Class +' ' Text +'=' Operator +' ' Text +'h' Literal.String.Affix +"'" Literal.String.Single +'\n ' Text +'83' Literal.String.Single +' ' Text +"; \\'83\\' means Array of length 3" Comment.Single +'\n ' Text +'01' Literal.String.Single +' ' Text +'; 1' Comment.Single +'\n ' Text +'82' Literal.String.Single +' ' Text +'; Array of length 2' Comment.Single +'\n ' Text +'02' Literal.String.Single +' ' Text +'; 2' Comment.Single +'\n ' Text +'03' Literal.String.Single +' ' Text +'; 3' Comment.Single +'\n ' Text +'82' Literal.String.Single +' ' Text +'; Array of length 2' Comment.Single +'\n ' Text +'04' Literal.String.Single +' ' Text +'; 4' Comment.Single +'\n ' Text +'05' Literal.String.Single +' ' Text +'; 5' Comment.Single +'\n' Text + +"'" Literal.String.Single +'\n' Text + +";multiline-hex-err = h'" Comment.Single +'\n' Text + +"; 83 \\'83\\' means Array of length 3 (oops, missed the \\';\\')" Comment.Single +'\n' Text + +'; 01 ; 1' Comment.Single +'\n' Text + +";'" Comment.Single +'\n\n' Text + +'; THE STANDARD "POSTLUDE"' Comment.Single +'\n' Text + +'any' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#' Keyword.Type +'\n\n' Text + +'uint' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#' Keyword.Type +'0' Literal.Number.Int +'\n' Text + +'nint' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#' Keyword.Type +'1' Literal.Number.Int +'\n' Text + +'int' Name.Builtin +' ' Text +'=' Operator +' ' Text +'uint' Name.Builtin +' ' Text +'/' Operator +' ' Text +'nint' Name.Builtin +'\n\n' Text + +'bstr' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#' Keyword.Type +'2' Literal.Number.Int +'\n' Text + +'bytes' Name.Builtin +' ' Text +'=' Operator +' ' Text +'bstr' Name.Builtin +'\n' Text + +'tstr' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#' Keyword.Type +'3' Literal.Number.Int +'\n' Text + +'text' Name.Builtin +' ' Text +'=' Operator +' ' Text +'tstr' Name.Builtin +'\n\n' Text + +'tdate' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.0' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +'\n' Text + +'time' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.1' Keyword.Type +'(' Punctuation +'number' Name.Builtin +')' Punctuation +'\n' Text + +'number' Name.Builtin +' ' Text +'=' Operator +' ' Text +'int' Name.Builtin +' ' Text +'/' Operator +' ' Text +'float' Name.Builtin +'\n' Text + +'biguint' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.0x02' Keyword.Type +'(' Punctuation +'bstr' Name.Builtin +')' Punctuation +'\n' Text + +'biguint' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.2' Keyword.Type +'(' Punctuation +'bstr' Name.Builtin +')' Punctuation +'\n' Text + +'bignint' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.3' Keyword.Type +'(' Punctuation +'bstr' Name.Builtin +')' Punctuation +'\n' Text + +'bigint' Name.Builtin +' ' Text +'=' Operator +' ' Text +'biguint' Name.Builtin +' ' Text +'/' Operator +' ' Text +'bignint' Name.Builtin +'\n' Text + +'integer' Name.Builtin +' ' Text +'=' Operator +' ' Text +'int' Name.Builtin +' ' Text +'/' Operator +' ' Text +'bigint' Name.Builtin +'\n' Text + +'unsigned' Name.Builtin +' ' Text +'=' Operator +' ' Text +'uint' Name.Builtin +' ' Text +'/' Operator +' ' Text +'biguint' Name.Builtin +'\n' Text + +'decfrac' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.4' Keyword.Type +'(' Punctuation +'[' Punctuation +'e10' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +' ' Text +'m' Literal.String +':' Punctuation +' ' Text +'integer' Name.Builtin +']' Punctuation +')' Punctuation +'\n' Text + +'bigfloat' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.5' Keyword.Type +'(' Punctuation +'[' Punctuation +'e2' Literal.String +':' Punctuation +' ' Text +'int' Name.Builtin +',' Punctuation +' ' Text +'m' Literal.String +':' Punctuation +' ' Text +'integer' Name.Builtin +']' Punctuation +')' Punctuation +'\n' Text + +'eb64url' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.21' Keyword.Type +'(' Punctuation +'any' Name.Builtin +')' Punctuation +'\n' Text + +'eb64legacy' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.22' Keyword.Type +'(' Punctuation +'any' Name.Builtin +')' Punctuation +'\n' Text + +'eb16' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.23' Keyword.Type +'(' Punctuation +'any' Name.Builtin +')' Punctuation +'\n' Text + +'encoded-cbor' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.24' Keyword.Type +'(' Punctuation +'bstr' Name.Builtin +')' Punctuation +'\n' Text + +'uri' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.32' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +'\n' Text + +'b64url' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.33' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +'\n' Text + +'b64legacy' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.34' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +'\n' Text + +'regexp' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.35' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +'\n' Text + +'mime-message' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.36' Keyword.Type +'(' Punctuation +'tstr' Name.Builtin +')' Punctuation +'\n' Text + +'cbor-any' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#6.55799' Keyword.Type +'(' Punctuation +'any' Name.Builtin +')' Punctuation +'\n\n' Text + +'float16' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#7.25' Keyword.Type +'\n' Text + +'float32' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#7.26' Keyword.Type +'\n' Text + +'float64' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#7.27' Keyword.Type +'\n' Text + +'float16-32' Name.Builtin +' ' Text +'=' Operator +' ' Text +'float16' Name.Builtin +' ' Text +'/' Operator +' ' Text +'float32' Name.Builtin +'\n' Text + +'float32-64' Name.Builtin +' ' Text +'=' Operator +' ' Text +'float32' Name.Builtin +' ' Text +'/' Operator +' ' Text +'float64' Name.Builtin +'\n' Text + +'float' Name.Builtin +' ' Text +'=' Operator +' ' Text +'float16-32' Name.Builtin +' ' Text +'/' Operator +' ' Text +'float64' Name.Builtin +'\n\n' Text + +'false' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#7.20' Keyword.Type +'\n' Text + +'true' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#7.21' Keyword.Type +'\n' Text + +'bool' Name.Builtin +' ' Text +'=' Operator +' ' Text +'false' Name.Builtin +' ' Text +'/' Operator +' ' Text +'true' Name.Builtin +'\n' Text + +'nil' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#7.22' Keyword.Type +'\n' Text + +'null' Name.Builtin +' ' Text +'=' Operator +' ' Text +'nil' Name.Builtin +'\n' Text + +'undefined' Name.Builtin +' ' Text +'=' Operator +' ' Text +'#7.23' Keyword.Type +'\n\n\n' Text + +'; INVALID CDDL' Comment.Single +'\n\n' Text + +';invalid_identifier- = -another_invalid' Comment.Single +'\n' Text + +';untermindated-string = "sometimes I cannot finish my…' Comment.Single +'\n' Text + +';next-thought = { valid: true }' Comment.Single +'\n' Text |
