diff options
| author | Georg Brandl <georg@python.org> | 2021-01-18 21:24:00 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2021-01-18 22:08:36 +0100 |
| commit | 2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch) | |
| tree | 809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/dylan | |
| parent | f0445be718da83541ea3401aad882f3937147263 (diff) | |
| download | pygments-git-examplefiles.tar.gz | |
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/dylan')
| -rw-r--r-- | tests/lexers/dylan/example.txt | 767 | ||||
| -rw-r--r-- | tests/lexers/dylan/example2.txt | 1074 |
2 files changed, 1841 insertions, 0 deletions
diff --git a/tests/lexers/dylan/example.txt b/tests/lexers/dylan/example.txt new file mode 100644 index 00000000..8522f6a3 --- /dev/null +++ b/tests/lexers/dylan/example.txt @@ -0,0 +1,767 @@ +---input--- +module: nanomsg +synopsis: generated bindings for the nanomsg library +author: Bruce Mitchener, Jr. +copyright: See LICENSE file in this distribution. + +define simple-C-mapped-subtype <C-buffer-offset> (<C-char*>) + export-map <machine-word>, export-function: identity; +end; + +define interface + #include { + "sp/sp.h", + "sp/fanin.h", + "sp/inproc.h", + "sp/pair.h", + "sp/reqrep.h", + "sp/survey.h", + "sp/fanout.h", + "sp/ipc.h", + "sp/pubsub.h", + "sp/tcp.h" + }, + + exclude: { + "SP_HAUSNUMERO", + "SP_PAIR_ID", + "SP_PUBSUB_ID", + "SP_REQREP_ID", + "SP_FANIN_ID", + "SP_FANOUT_ID", + "SP_SURVEY_ID" + }, + + equate: {"char *" => <c-string>}, + + rename: { + "sp_recv" => %sp-recv, + "sp_send" => %sp-send, + "sp_setsockopt" => %sp-setsockopt + }; + + function "sp_version", + output-argument: 1, + output-argument: 2, + output-argument: 3; + + function "sp_send", + map-argument: { 2 => <C-buffer-offset> }; + + function "sp_recv", + map-argument: { 2 => <C-buffer-offset> }; + +end interface; + +// Function for adding the base address of the repeated slots of a <buffer> +// to an offset and returning the result as a <machine-word>. This is +// necessary for passing <buffer> contents across the FFI. + +define function buffer-offset + (the-buffer :: <buffer>, data-offset :: <integer>) + => (result-offset :: <machine-word>) + u%+(data-offset, + primitive-wrap-machine-word + (primitive-repeated-slot-as-raw + (the-buffer, primitive-repeated-slot-offset(the-buffer)))) +end function; + +define inline function sp-send (socket :: <integer>, data :: <buffer>, flags :: <integer>) => (res :: <integer>) + %sp-send(socket, buffer-offset(data, 0), data.size, flags) +end; + +define inline function sp-recv (socket :: <integer>, data :: <buffer>, flags :: <integer>) => (res :: <integer>) + %sp-recv(socket, buffer-offset(data, 0), data.size, flags); +end; + +define inline method sp-setsockopt (socket :: <integer>, level :: <integer>, option :: <integer>, value :: <integer>) + with-stack-structure (int :: <C-int*>) + pointer-value(int) := value; + let setsockopt-result = + %sp-setsockopt(socket, level, option, int, size-of(<C-int*>)); + if (setsockopt-result < 0) + // Check error! + end; + setsockopt-result + end; +end; + +define inline method sp-setsockopt (socket :: <integer>, level :: <integer>, option :: <integer>, data :: <byte-string>) + let setsockopt-result = + %sp-setsockopt(socket, level, option, as(<c-string>, data), data.size); + if (setsockopt-result < 0) + // Check error! + end; + setsockopt-result +end; + +---tokens--- +'module' Name.Attribute +':' Operator +' ' Text +'nanomsg' Literal.String +'\n' Text + +'synopsis' Name.Attribute +':' Operator +' ' Text +'generated bindings for the nanomsg library' Literal.String +'\n' Text + +'author' Name.Attribute +':' Operator +' ' Text +'Bruce Mitchener, Jr.' Literal.String +'\n' Text + +'copyright' Name.Attribute +':' Operator +' ' Text +'See LICENSE file in this distribution.' Literal.String +'\n\n' Text + +'define' Keyword +' ' Text +'simple-C-mapped-subtype' Name +' ' Text +'<C-buffer-offset>' Name.Class +' ' Text +'(' Punctuation +'<C-char*>' Name.Class +')' Punctuation +'\n ' Text +'export-map' Name +' ' Text +'<machine-word>' Name.Class +',' Punctuation +' ' Text +'export-function:' Keyword +' ' Text +'identity' Name.Builtin +';' Punctuation +'\n' Text + +'end' Keyword +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'interface' Name.Builtin +'\n ' Text +'#include' Keyword +' ' Text +'{' Punctuation +'\n ' Text +'"' Literal.String +'sp/sp.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/fanin.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/inproc.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/pair.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/reqrep.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/survey.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/fanout.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/ipc.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/pubsub.h' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'sp/tcp.h' Literal.String +'"' Literal.String +'\n ' Text +'}' Punctuation +',' Punctuation +'\n\n ' Text +'exclude:' Keyword +' ' Text +'{' Punctuation +'\n ' Text +'"' Literal.String +'SP_HAUSNUMERO' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'SP_PAIR_ID' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'SP_PUBSUB_ID' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'SP_REQREP_ID' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'SP_FANIN_ID' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'SP_FANOUT_ID' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'"' Literal.String +'SP_SURVEY_ID' Literal.String +'"' Literal.String +'\n ' Text +'}' Punctuation +',' Punctuation +'\n\n ' Text +'equate:' Keyword +' ' Text +'{' Punctuation +'"' Literal.String +'char *' Literal.String +'"' Literal.String +' ' Text +'=>' Punctuation +' ' Text +'<c-string>' Name.Class +'}' Punctuation +',' Punctuation +'\n\n ' Text +'rename:' Keyword +' ' Text +'{' Punctuation +'\n ' Text +'"' Literal.String +'sp_recv' Literal.String +'"' Literal.String +' ' Text +'=>' Punctuation +' ' Text +'%sp-recv' Name +',' Punctuation +'\n ' Text +'"' Literal.String +'sp_send' Literal.String +'"' Literal.String +' ' Text +'=>' Punctuation +' ' Text +'%sp-send' Name +',' Punctuation +'\n ' Text +'"' Literal.String +'sp_setsockopt' Literal.String +'"' Literal.String +' ' Text +'=>' Punctuation +' ' Text +'%sp-setsockopt' Name +'\n ' Text +'}' Punctuation +';' Punctuation +'\n\n ' Text +'function' Name.Builtin +' ' Text +'"' Literal.String +'sp_version' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'output-argument:' Keyword +' ' Text +'1' Literal.Number.Integer +',' Punctuation +'\n ' Text +'output-argument:' Keyword +' ' Text +'2' Literal.Number.Integer +',' Punctuation +'\n ' Text +'output-argument:' Keyword +' ' Text +'3' Literal.Number.Integer +';' Punctuation +'\n\n ' Text +'function' Name.Builtin +' ' Text +'"' Literal.String +'sp_send' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'map-argument:' Keyword +' ' Text +'{' Punctuation +' ' Text +'2' Literal.Number.Integer +' ' Text +'=>' Punctuation +' ' Text +'<C-buffer-offset>' Name.Class +' ' Text +'}' Punctuation +';' Punctuation +'\n\n ' Text +'function' Name.Builtin +' ' Text +'"' Literal.String +'sp_recv' Literal.String +'"' Literal.String +',' Punctuation +'\n ' Text +'map-argument:' Keyword +' ' Text +'{' Punctuation +' ' Text +'2' Literal.Number.Integer +' ' Text +'=>' Punctuation +' ' Text +'<C-buffer-offset>' Name.Class +' ' Text +'}' Punctuation +';' Punctuation +'\n\n' Text + +'end' Keyword +' ' Text +'interface' Name.Builtin +';' Punctuation +'\n\n' Text + +'// Function for adding the base address of the repeated slots of a <buffer>\n' Comment.Single + +'// to an offset and returning the result as a <machine-word>. This is\n' Comment.Single + +'// necessary for passing <buffer> contents across the FFI.\n' Comment.Single + +'\n' Text + +'define' Keyword +' ' Text +'function' Name.Builtin +' ' Text +'buffer-offset' Name +'\n ' Text +'(' Punctuation +'the-buffer' Name +' ' Text +'::' Punctuation +' ' Text +'<buffer>' Name.Class +',' Punctuation +' ' Text +'data-offset' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +')' Punctuation +'\n ' Text +'=>' Punctuation +' ' Text +'(' Punctuation +'result-offset' Name +' ' Text +'::' Punctuation +' ' Text +'<machine-word>' Name.Class +')' Punctuation +'\n ' Text +'u%+' Name +'(' Punctuation +'data-offset' Name +',' Punctuation +'\n ' Text +'primitive-wrap-machine-word' Name +'\n ' Text +'(' Punctuation +'primitive-repeated-slot-as-raw' Name +'\n ' Text +'(' Punctuation +'the-buffer' Name +',' Punctuation +' ' Text +'primitive-repeated-slot-offset' Name +'(' Punctuation +'the-buffer' Name +')' Punctuation +')' Punctuation +')' Punctuation +')' Punctuation +'\n' Text + +'end' Keyword +' ' Text +'function' Name.Builtin +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'inline' Name.Builtin +' ' Text +'function' Name.Builtin +' ' Text +'sp-send' Name +' ' Text +'(' Punctuation +'socket' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'data' Name +' ' Text +'::' Punctuation +' ' Text +'<buffer>' Name.Class +',' Punctuation +' ' Text +'flags' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +')' Punctuation +' ' Text +'=>' Punctuation +' ' Text +'(' Punctuation +'res' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +')' Punctuation +'\n ' Text +'%sp-send' Name +'(' Punctuation +'socket' Name +',' Punctuation +' ' Text +'buffer-offset' Name +'(' Punctuation +'data' Name +',' Punctuation +' ' Text +'0' Literal.Number.Integer +')' Punctuation +',' Punctuation +' ' Text +'data' Name +'.' Punctuation +'size' Name.Builtin +',' Punctuation +' ' Text +'flags' Name +')' Punctuation +'\n' Text + +'end' Keyword +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'inline' Name.Builtin +' ' Text +'function' Name.Builtin +' ' Text +'sp-recv' Name +' ' Text +'(' Punctuation +'socket' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'data' Name +' ' Text +'::' Punctuation +' ' Text +'<buffer>' Name.Class +',' Punctuation +' ' Text +'flags' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +')' Punctuation +' ' Text +'=>' Punctuation +' ' Text +'(' Punctuation +'res' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +')' Punctuation +'\n ' Text +'%sp-recv' Name +'(' Punctuation +'socket' Name +',' Punctuation +' ' Text +'buffer-offset' Name +'(' Punctuation +'data' Name +',' Punctuation +' ' Text +'0' Literal.Number.Integer +')' Punctuation +',' Punctuation +' ' Text +'data' Name +'.' Punctuation +'size' Name.Builtin +',' Punctuation +' ' Text +'flags' Name +')' Punctuation +';' Punctuation +'\n' Text + +'end' Keyword +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'inline' Name.Builtin +' ' Text +'method' Name.Builtin +' ' Text +'sp-setsockopt' Name +' ' Text +'(' Punctuation +'socket' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'level' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'option' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'value' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +')' Punctuation +'\n ' Text +'with-stack-structure' Name +' ' Text +'(' Punctuation +'int' Name +' ' Text +'::' Punctuation +' ' Text +'<C-int*>' Name.Class +')' Punctuation +'\n ' Text +'pointer-value' Name +'(' Punctuation +'int' Name +')' Punctuation +' ' Text +':=' Operator +' ' Text +'value' Name +';' Punctuation +'\n ' Text +'let' Keyword +' ' Text +'setsockopt-result' Name +' ' Text +'=' Operator +'\n ' Text +'%sp-setsockopt' Name +'(' Punctuation +'socket' Name +',' Punctuation +' ' Text +'level' Name +',' Punctuation +' ' Text +'option' Name +',' Punctuation +' ' Text +'int' Name +',' Punctuation +' ' Text +'size-of' Name +'(' Punctuation +'<C-int*>' Name.Class +')' Punctuation +')' Punctuation +';' Punctuation +'\n ' Text +'if' Keyword +' ' Text +'(' Punctuation +'setsockopt-result' Name +' ' Text +'<' Operator +' ' Text +'0' Literal.Number.Integer +')' Punctuation +'\n ' Text +'// Check error!\n' Comment.Single + +' ' Text +'end' Keyword +';' Punctuation +'\n ' Text +'setsockopt-result' Name +'\n ' Text +'end' Keyword +';' Punctuation +'\n' Text + +'end' Keyword +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'inline' Name.Builtin +' ' Text +'method' Name.Builtin +' ' Text +'sp-setsockopt' Name +' ' Text +'(' Punctuation +'socket' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'level' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'option' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +',' Punctuation +' ' Text +'data' Name +' ' Text +'::' Punctuation +' ' Text +'<byte-string>' Name.Class +')' Punctuation +'\n ' Text +'let' Keyword +' ' Text +'setsockopt-result' Name +' ' Text +'=' Operator +'\n ' Text +'%sp-setsockopt' Name +'(' Punctuation +'socket' Name +',' Punctuation +' ' Text +'level' Name +',' Punctuation +' ' Text +'option' Name +',' Punctuation +' ' Text +'as' Name.Builtin +'(' Punctuation +'<c-string>' Name.Class +',' Punctuation +' ' Text +'data' Name +')' Punctuation +',' Punctuation +' ' Text +'data' Name +'.' Punctuation +'size' Name.Builtin +')' Punctuation +';' Punctuation +'\n ' Text +'if' Keyword +' ' Text +'(' Punctuation +'setsockopt-result' Name +' ' Text +'<' Operator +' ' Text +'0' Literal.Number.Integer +')' Punctuation +'\n ' Text +'// Check error!\n' Comment.Single + +' ' Text +'end' Keyword +';' Punctuation +'\n ' Text +'setsockopt-result' Name +'\n' Text + +'end' Keyword +';' Punctuation +'\n' Text diff --git a/tests/lexers/dylan/example2.txt b/tests/lexers/dylan/example2.txt new file mode 100644 index 00000000..00b6655a --- /dev/null +++ b/tests/lexers/dylan/example2.txt @@ -0,0 +1,1074 @@ +---input--- +module: sample +comment: for make sure that does not highlight per word. + and it continues on to the next line. + +define class <car> (<object>) + slot serial-number :: <integer> = unique-serial-number(); + constant slot model-name :: <string>, + required-init-keyword: model:; + each-subclass slot has-sunroof? :: <boolean>, + init-keyword: sunroof?:, + init-value: #f; + keyword foo:; + required keyword bar:; +end class <car>; + +define class <flying-car> (<car>) +end class <flying-car>; + +let flying-car = make(<flying-car>); +let car? :: <car?> = #f; +let prefixed-car :: <vehicles/car> = #f; +let model :: <car-911> = #f; + +define constant $empty-string = ""; +define constant $escaped-backslash = '\\'; +define constant $escaped-single-quote = '\''; + +define variable *unique-serial-number* = 0; + +define function unique-serial-number() => (usn :: <integer>) + let serial = *unique-serial-number*; + *unique-serial-number* := *unique-serial-number* + 1; + serial; +end function; + +define constant $blue-car = make(<car>, model: "Viper"); +define constant $black-car = make(<car>, model: "Town Car", sunroof?: #t); +define constant $red-car = make(<car>, model: "F40", sunroof?: #f); + +define method foo() => _ :: <boolean> + #t +end method; + +define method foo() => _ :: <boolean>; + #t +end method; + +define method \+ + (offset1 :: <time-offset>, offset2 :: <time-offset>) + => (sum :: <time-offset>) + let sum = offset1.total-seconds + offset2.total-seconds; + make(<time-offset>, total-seconds: sum); +end method \+; + +define method bar () + 1 | 2 & 3 +end + +if (bar) + 1 +elseif (foo) + 2 +else + 3 +end if; + +select (foo by instance?) + <integer> => 1 + otherwise => 3 +end select; + +/* multi + line + comment +*/ + +/* multi line comments + /* can be */ + nested */ + +define constant $symbol = #"hello"; +define variable *vector* = #[3.5, 5] +define constant $list = #(1, 2); +define constant $pair = #(1 . "foo") + +let octal-number = #o238; +let hex-number = #x3890ADEF; +let binary-number = #b1010; +let float-exponent = 3.5e10; + +block (return) + with-lock (lock) + return(); + end; +exception (e :: <error>) + format-out("Oh no"); +cleanup + return(); +afterwards + format-out("Hello"); +end; + +define macro repeat + { repeat ?:body end } + => { block (?=stop!) + local method again() ?body; again() end; + again(); + end } +end macro repeat; + +define macro with-decoded-seconds + { + with-decoded-seconds + (?max:variable, ?min:variable, ?sec:variable = ?time:expression) + ?:body + end + } + => { + let (?max, ?min, ?sec) = decode-total-seconds(?time); + ?body + } +end macro; + +let x = "This size call should be seen as a builtin despite the odd case.".siZe; + + +---tokens--- +'module' Name.Attribute +':' Operator +' ' Text +'sample' Literal.String +'\n' Text + +'comment' Name.Attribute +':' Operator +' ' Text +'for make sure that does not highlight per word.\n and it continues on to the next line.' Literal.String +'\n\n' Text + +'define' Keyword +' ' Text +'class' Name.Builtin +' ' Text +'<car>' Name.Class +' ' Text +'(' Punctuation +'<object>' Name.Class +')' Punctuation +'\n ' Text +'slot' Name.Builtin +' ' Text +'serial-number' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +' ' Text +'=' Operator +' ' Text +'unique-serial-number' Name +'(' Punctuation +')' Punctuation +';' Punctuation +'\n ' Text +'constant' Name.Builtin +' ' Text +'slot' Name.Builtin +' ' Text +'model-name' Name +' ' Text +'::' Punctuation +' ' Text +'<string>' Name.Class +',' Punctuation +'\n ' Text +'required-init-keyword:' Keyword +' ' Text +'model:' Keyword +';' Punctuation +'\n ' Text +'each-subclass' Name.Builtin +' ' Text +'slot' Name.Builtin +' ' Text +'has-sunroof?' Name +' ' Text +'::' Punctuation +' ' Text +'<boolean>' Name.Class +',' Punctuation +'\n ' Text +'init-keyword:' Keyword +' ' Text +'sunroof?:' Keyword +',' Punctuation +'\n ' Text +'init-value:' Keyword +' ' Text +'#f' Literal +';' Punctuation +'\n ' Text +'keyword' Name.Builtin +' ' Text +'foo:' Keyword +';' Punctuation +'\n ' Text +'required' Name.Builtin +' ' Text +'keyword' Name.Builtin +' ' Text +'bar:' Keyword +';' Punctuation +'\n' Text + +'end' Keyword +' ' Text +'class' Name.Builtin +' ' Text +'<car>' Name.Class +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'class' Name.Builtin +' ' Text +'<flying-car>' Name.Class +' ' Text +'(' Punctuation +'<car>' Name.Class +')' Punctuation +'\n' Text + +'end' Keyword +' ' Text +'class' Name.Builtin +' ' Text +'<flying-car>' Name.Class +';' Punctuation +'\n\n' Text + +'let' Keyword +' ' Text +'flying-car' Name +' ' Text +'=' Operator +' ' Text +'make' Name.Builtin +'(' Punctuation +'<flying-car>' Name.Class +')' Punctuation +';' Punctuation +'\n' Text + +'let' Keyword +' ' Text +'car?' Name +' ' Text +'::' Punctuation +' ' Text +'<car?>' Name.Class +' ' Text +'=' Operator +' ' Text +'#f' Literal +';' Punctuation +'\n' Text + +'let' Keyword +' ' Text +'prefixed-car' Name +' ' Text +'::' Punctuation +' ' Text +'<vehicles/car>' Name.Class +' ' Text +'=' Operator +' ' Text +'#f' Literal +';' Punctuation +'\n' Text + +'let' Keyword +' ' Text +'model' Name +' ' Text +'::' Punctuation +' ' Text +'<car-911>' Name.Class +' ' Text +'=' Operator +' ' Text +'#f' Literal +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$empty-string' Name.Constant +' ' Text +'=' Operator +' ' Text +'"' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$escaped-backslash' Name.Constant +' ' Text +'=' Operator +' ' Text +"'\\\\'" Literal.String.Char +';' Punctuation +'\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$escaped-single-quote' Name.Constant +' ' Text +'=' Operator +' ' Text +"'\\''" Literal.String.Char +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'variable' Name.Builtin +' ' Text +'*unique-serial-number*' Name.Variable.Global +' ' Text +'=' Operator +' ' Text +'0' Literal.Number.Integer +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'function' Name.Builtin +' ' Text +'unique-serial-number' Name +'(' Punctuation +')' Punctuation +' ' Text +'=>' Punctuation +' ' Text +'(' Punctuation +'usn' Name +' ' Text +'::' Punctuation +' ' Text +'<integer>' Name.Class +')' Punctuation +'\n ' Text +'let' Keyword +' ' Text +'serial' Name +' ' Text +'=' Operator +' ' Text +'*unique-serial-number*' Name.Variable.Global +';' Punctuation +'\n ' Text +'*unique-serial-number*' Name.Variable.Global +' ' Text +':=' Operator +' ' Text +'*unique-serial-number*' Name.Variable.Global +' ' Text +'+' Operator +' ' Text +'1' Literal.Number.Integer +';' Punctuation +'\n ' Text +'serial' Name +';' Punctuation +'\n' Text + +'end' Keyword +' ' Text +'function' Name.Builtin +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$blue-car' Name.Constant +' ' Text +'=' Operator +' ' Text +'make' Name.Builtin +'(' Punctuation +'<car>' Name.Class +',' Punctuation +' ' Text +'model:' Keyword +' ' Text +'"' Literal.String +'Viper' Literal.String +'"' Literal.String +')' Punctuation +';' Punctuation +'\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$black-car' Name.Constant +' ' Text +'=' Operator +' ' Text +'make' Name.Builtin +'(' Punctuation +'<car>' Name.Class +',' Punctuation +' ' Text +'model:' Keyword +' ' Text +'"' Literal.String +'Town Car' Literal.String +'"' Literal.String +',' Punctuation +' ' Text +'sunroof?:' Keyword +' ' Text +'#t' Literal +')' Punctuation +';' Punctuation +'\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$red-car' Name.Constant +' ' Text +'=' Operator +' ' Text +'make' Name.Builtin +'(' Punctuation +'<car>' Name.Class +',' Punctuation +' ' Text +'model:' Keyword +' ' Text +'"' Literal.String +'F40' Literal.String +'"' Literal.String +',' Punctuation +' ' Text +'sunroof?:' Keyword +' ' Text +'#f' Literal +')' Punctuation +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'method' Name.Builtin +' ' Text +'foo' Name +'(' Punctuation +')' Punctuation +' ' Text +'=>' Punctuation +' ' Text +'_' Name +' ' Text +'::' Punctuation +' ' Text +'<boolean>' Name.Class +'\n ' Text +'#t' Literal +'\n' Text + +'end' Keyword +' ' Text +'method' Name.Builtin +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'method' Name.Builtin +' ' Text +'foo' Name +'(' Punctuation +')' Punctuation +' ' Text +'=>' Punctuation +' ' Text +'_' Name +' ' Text +'::' Punctuation +' ' Text +'<boolean>' Name.Class +';' Punctuation +'\n ' Text +'#t' Literal +'\n' Text + +'end' Keyword +' ' Text +'method' Name.Builtin +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'method' Name.Builtin +' ' Text +'\\+' Name +'\n ' Text +'(' Punctuation +'offset1' Name +' ' Text +'::' Punctuation +' ' Text +'<time-offset>' Name.Class +',' Punctuation +' ' Text +'offset2' Name +' ' Text +'::' Punctuation +' ' Text +'<time-offset>' Name.Class +')' Punctuation +'\n ' Text +'=>' Punctuation +' ' Text +'(' Punctuation +'sum' Name +' ' Text +'::' Punctuation +' ' Text +'<time-offset>' Name.Class +')' Punctuation +'\n ' Text +'let' Keyword +' ' Text +'sum' Name +' ' Text +'=' Operator +' ' Text +'offset1' Name +'.' Punctuation +'total-seconds' Name +' ' Text +'+' Operator +' ' Text +'offset2' Name +'.' Punctuation +'total-seconds' Name +';' Punctuation +'\n ' Text +'make' Name.Builtin +'(' Punctuation +'<time-offset>' Name.Class +',' Punctuation +' ' Text +'total-seconds:' Keyword +' ' Text +'sum' Name +')' Punctuation +';' Punctuation +'\n' Text + +'end' Keyword +' ' Text +'method' Name.Builtin +' ' Text +'\\+' Name +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'method' Name.Builtin +' ' Text +'bar' Name +' ' Text +'(' Punctuation +')' Punctuation +'\n ' Text +'1' Literal.Number.Integer +' ' Text +'|' Operator +' ' Text +'2' Literal.Number.Integer +' ' Text +'&' Operator +' ' Text +'3' Literal.Number.Integer +'\n' Text + +'end' Keyword +'\n\n' Text + +'if' Keyword +' ' Text +'(' Punctuation +'bar' Name +')' Punctuation +'\n ' Text +'1' Literal.Number.Integer +'\n' Text + +'elseif' Keyword +' ' Text +'(' Punctuation +'foo' Name +')' Punctuation +'\n ' Text +'2' Literal.Number.Integer +'\n' Text + +'else' Keyword +'\n ' Text +'3' Literal.Number.Integer +'\n' Text + +'end' Keyword +' ' Text +'if' Keyword +';' Punctuation +'\n\n' Text + +'select' Keyword +' ' Text +'(' Punctuation +'foo' Name +' ' Text +'by' Keyword +' ' Text +'instance?' Name.Builtin +')' Punctuation +'\n ' Text +'<integer>' Name.Class +' ' Text +'=>' Punctuation +' ' Text +'1' Literal.Number.Integer +'\n ' Text +'otherwise' Keyword +' ' Text +'=>' Punctuation +' ' Text +'3' Literal.Number.Integer +'\n' Text + +'end' Keyword +' ' Text +'select' Keyword +';' Punctuation +'\n\n' Text + +'/*' Comment.Multiline +' ' Comment.Multiline +'m' Comment.Multiline +'u' Comment.Multiline +'l' Comment.Multiline +'t' Comment.Multiline +'i' Comment.Multiline +'\n' Comment.Multiline + +' ' Comment.Multiline +' ' Comment.Multiline +' ' Comment.Multiline +'l' Comment.Multiline +'i' Comment.Multiline +'n' Comment.Multiline +'e' Comment.Multiline +'\n' Comment.Multiline + +' ' Comment.Multiline +' ' Comment.Multiline +' ' Comment.Multiline +'c' Comment.Multiline +'o' Comment.Multiline +'m' Comment.Multiline +'m' Comment.Multiline +'e' Comment.Multiline +'n' Comment.Multiline +'t' Comment.Multiline +'\n' Comment.Multiline + +'*/' Comment.Multiline +'\n\n' Text + +'/*' Comment.Multiline +' ' Comment.Multiline +'m' Comment.Multiline +'u' Comment.Multiline +'l' Comment.Multiline +'t' Comment.Multiline +'i' Comment.Multiline +' ' Comment.Multiline +'l' Comment.Multiline +'i' Comment.Multiline +'n' Comment.Multiline +'e' Comment.Multiline +' ' Comment.Multiline +'c' Comment.Multiline +'o' Comment.Multiline +'m' Comment.Multiline +'m' Comment.Multiline +'e' Comment.Multiline +'n' Comment.Multiline +'t' Comment.Multiline +'s' Comment.Multiline +'\n' Comment.Multiline + +' ' Comment.Multiline +' ' Comment.Multiline +'/*' Comment.Multiline +' ' Comment.Multiline +'c' Comment.Multiline +'a' Comment.Multiline +'n' Comment.Multiline +' ' Comment.Multiline +'b' Comment.Multiline +'e' Comment.Multiline +' ' Comment.Multiline +'*/' Comment.Multiline +'\n' Comment.Multiline + +' ' Comment.Multiline +' ' Comment.Multiline +'n' Comment.Multiline +'e' Comment.Multiline +'s' Comment.Multiline +'t' Comment.Multiline +'e' Comment.Multiline +'d' Comment.Multiline +' ' Comment.Multiline +'*/' Comment.Multiline +'\n\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$symbol' Name.Constant +' ' Text +'=' Operator +' ' Text +'#"' Literal.String.Symbol +'hello' Literal.String.Symbol +'"' Literal.String.Symbol +';' Punctuation +'\n' Text + +'define' Keyword +' ' Text +'variable' Name.Builtin +' ' Text +'*vector*' Name.Variable.Global +' ' Text +'=' Operator +' ' Text +'#[' Punctuation +'3.5' Literal.Number.Float +',' Punctuation +' ' Text +'5' Literal.Number.Integer +']' Punctuation +'\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$list' Name.Constant +' ' Text +'=' Operator +' ' Text +'#(' Punctuation +'1' Literal.Number.Integer +',' Punctuation +' ' Text +'2' Literal.Number.Integer +')' Punctuation +';' Punctuation +'\n' Text + +'define' Keyword +' ' Text +'constant' Name.Builtin +' ' Text +'$pair' Name.Constant +' ' Text +'=' Operator +' ' Text +'#(' Punctuation +'1' Literal.Number.Integer +' ' Text +'.' Punctuation +' ' Text +'"' Literal.String +'foo' Literal.String +'"' Literal.String +')' Punctuation +'\n\n' Text + +'let' Keyword +' ' Text +'octal-number' Name +' ' Text +'=' Operator +' ' Text +'#o23' Literal.Number.Oct +'8' Literal.Number.Integer +';' Punctuation +'\n' Text + +'let' Keyword +' ' Text +'hex-number' Name +' ' Text +'=' Operator +' ' Text +'#x3890ADEF' Literal.Number.Hex +';' Punctuation +'\n' Text + +'let' Keyword +' ' Text +'binary-number' Name +' ' Text +'=' Operator +' ' Text +'#b1010' Literal.Number.Bin +';' Punctuation +'\n' Text + +'let' Keyword +' ' Text +'float-exponent' Name +' ' Text +'=' Operator +' ' Text +'3.5e10' Literal.Number.Float +';' Punctuation +'\n\n' Text + +'block' Name.Builtin +' ' Text +'(' Punctuation +'return' Name +')' Punctuation +'\n ' Text +'with-lock' Name +' ' Text +'(' Punctuation +'lock' Name +')' Punctuation +'\n ' Text +'return' Name +'(' Punctuation +')' Punctuation +';' Punctuation +'\n ' Text +'end' Keyword +';' Punctuation +'\n' Text + +'exception' Name.Builtin +' ' Text +'(' Punctuation +'e' Name +' ' Text +'::' Punctuation +' ' Text +'<error>' Name.Class +')' Punctuation +'\n ' Text +'format-out' Name +'(' Punctuation +'"' Literal.String +'Oh no' Literal.String +'"' Literal.String +')' Punctuation +';' Punctuation +'\n' Text + +'cleanup' Keyword +'\n ' Text +'return' Name +'(' Punctuation +')' Punctuation +';' Punctuation +'\n' Text + +'afterwards' Keyword +'\n ' Text +'format-out' Name +'(' Punctuation +'"' Literal.String +'Hello' Literal.String +'"' Literal.String +')' Punctuation +';' Punctuation +'\n' Text + +'end' Keyword +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'macro' Name.Builtin +' ' Text +'repeat' Name +'\n ' Text +'{' Punctuation +' ' Text +'repeat' Name +' ' Text +'?' Name.Tag +':' Operator +'body' Name.Builtin +' ' Text +'end' Keyword +' ' Text +'}' Punctuation +'\n ' Text +'=>' Punctuation +' ' Text +'{' Punctuation +' ' Text +'block' Name.Builtin +' ' Text +'(' Punctuation +'?=stop!' Name.Tag +')' Punctuation +'\n ' Text +'local' Keyword +' ' Text +'method' Name.Builtin +' ' Text +'again' Name +'(' Punctuation +')' Punctuation +' ' Text +'?body' Name.Tag +';' Punctuation +' ' Text +'again' Name +'(' Punctuation +')' Punctuation +' ' Text +'end' Keyword +';' Punctuation +'\n ' Text +'again' Name +'(' Punctuation +')' Punctuation +';' Punctuation +'\n ' Text +'end' Keyword +' ' Text +'}' Punctuation +'\n' Text + +'end' Keyword +' ' Text +'macro' Name.Builtin +' ' Text +'repeat' Name +';' Punctuation +'\n\n' Text + +'define' Keyword +' ' Text +'macro' Name.Builtin +' ' Text +'with-decoded-seconds' Name +'\n ' Text +'{' Punctuation +'\n ' Text +'with-decoded-seconds' Name +'\n ' Text +'(' Punctuation +'?max' Name.Tag +':' Operator +'variable' Name.Builtin +',' Punctuation +' ' Text +'?min' Name.Tag +':' Operator +'variable' Name.Builtin +',' Punctuation +' ' Text +'?sec' Name.Tag +':' Operator +'variable' Name.Builtin +' ' Text +'=' Operator +' ' Text +'?time' Name.Tag +':' Operator +'expression' Name.Builtin +')' Punctuation +'\n ' Text +'?' Name.Tag +':' Operator +'body' Name.Builtin +'\n ' Text +'end' Keyword +'\n ' Text +'}' Punctuation +'\n ' Text +'=>' Punctuation +' ' Text +'{' Punctuation +'\n ' Text +'let' Keyword +' ' Text +'(' Punctuation +'?max' Name.Tag +',' Punctuation +' ' Text +'?min' Name.Tag +',' Punctuation +' ' Text +'?sec' Name.Tag +')' Punctuation +' ' Text +'=' Operator +' ' Text +'decode-total-seconds' Name +'(' Punctuation +'?time' Name.Tag +')' Punctuation +';' Punctuation +'\n ' Text +'?body' Name.Tag +'\n ' Text +'}' Punctuation +'\n' Text + +'end' Keyword +' ' Text +'macro' Name.Builtin +';' Punctuation +'\n\n' Text + +'let' Keyword +' ' Text +'x' Name +' ' Text +'=' Operator +' ' Text +'"' Literal.String +'This size call should be seen as a builtin despite the odd case.' Literal.String +'"' Literal.String +'.' Punctuation +'siZe' Name.Builtin +';' Punctuation +'\n' Text |
