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/red | |
| parent | f0445be718da83541ea3401aad882f3937147263 (diff) | |
| download | pygments-git-examplefiles.tar.gz | |
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/red')
| -rw-r--r-- | tests/lexers/red/example.txt | 1670 | ||||
| -rw-r--r-- | tests/lexers/red/example2.txt | 1008 |
2 files changed, 2678 insertions, 0 deletions
diff --git a/tests/lexers/red/example.txt b/tests/lexers/red/example.txt new file mode 100644 index 00000000..1f727073 --- /dev/null +++ b/tests/lexers/red/example.txt @@ -0,0 +1,1670 @@ +---input--- +Red [ + Title: "Red console" + Author: ["Nenad Rakocevic" "Kaj de Vos"] + File: %console.red + Tabs: 4 + Rights: "Copyright (C) 2012-2013 Nenad Rakocevic. All rights reserved." + License: { + Distributed under the Boost Software License, Version 1.0. + See https://github.com/dockimbel/Red/blob/master/BSL-License.txt + } + Purpose: "Just some code for testing Pygments colorizer" + Language: http://www.red-lang.org/ +] + +#system-global [ + #either OS = 'Windows [ + #import [ + "kernel32.dll" stdcall [ + AttachConsole: "AttachConsole" [ + processID [integer!] + return: [integer!] + ] + SetConsoleTitle: "SetConsoleTitleA" [ + title [c-string!] + return: [integer!] + ] + ReadConsole: "ReadConsoleA" [ + consoleInput [integer!] + buffer [byte-ptr!] + charsToRead [integer!] + numberOfChars [int-ptr!] + inputControl [int-ptr!] + return: [integer!] + ] + ] + ] + line-buffer-size: 16 * 1024 + line-buffer: allocate line-buffer-size + ][ + #switch OS [ + MacOSX [ + #define ReadLine-library "libreadline.dylib" + ] + #default [ + #define ReadLine-library "libreadline.so.6" + #define History-library "libhistory.so.6" + ] + ] + #import [ + ReadLine-library cdecl [ + read-line: "readline" [ ; Read a line from the console. + prompt [c-string!] + return: [c-string!] + ] + rl-bind-key: "rl_bind_key" [ + key [integer!] + command [integer!] + return: [integer!] + ] + rl-insert: "rl_insert" [ + count [integer!] + key [integer!] + return: [integer!] + ] + ] + #if OS <> 'MacOSX [ + History-library cdecl [ + add-history: "add_history" [ ; Add line to the history. + line [c-string!] + ] + ] + ] + ] + + rl-insert-wrapper: func [ + [cdecl] + count [integer!] + key [integer!] + return: [integer!] + ][ + rl-insert count key + ] + + ] +] + +Windows?: system/platform = 'Windows + +read-argument: routine [ + /local + args [str-array!] + str [red-string!] +][ + if system/args-count <> 2 [ + SET_RETURN(none-value) + exit + ] + args: system/args-list + 1 ;-- skip binary filename + str: simple-io/read-txt args/item + SET_RETURN(str) +] + +init-console: routine [ + str [string!] + /local + ret +][ + #either OS = 'Windows [ + ;ret: AttachConsole -1 + ;if zero? ret [print-line "ReadConsole failed!" halt] + + ret: SetConsoleTitle as c-string! string/rs-head str + if zero? ret [print-line "SetConsoleTitle failed!" halt] + ][ + rl-bind-key as-integer tab as-integer :rl-insert-wrapper + ] +] + +input: routine [ + prompt [string!] + /local + len ret str buffer line +][ + #either OS = 'Windows [ + len: 0 + print as c-string! string/rs-head prompt + ret: ReadConsole stdin line-buffer line-buffer-size :len null + if zero? ret [print-line "ReadConsole failed!" halt] + len: len + 1 + line-buffer/len: null-byte + str: string/load as c-string! line-buffer len + ][ + line: read-line as c-string! string/rs-head prompt + if line = null [halt] ; EOF + + #if OS <> 'MacOSX [add-history line] + + str: string/load line 1 + length? line +; free as byte-ptr! line + ] + SET_RETURN(str) +] + +count-delimiters: function [ + buffer [string!] + return: [block!] +][ + list: copy [0 0] + c: none + + foreach c buffer [ + case [ + escaped? [ + escaped?: no + ] + in-comment? [ + switch c [ + #"^/" [in-comment?: no] + ] + ] + 'else [ + switch c [ + #"^^" [escaped?: yes] + #";" [if zero? list/2 [in-comment?: yes]] + #"[" [list/1: list/1 + 1] + #"]" [list/1: list/1 - 1] + #"{" [list/2: list/2 + 1] + #"}" [list/2: list/2 - 1] + ] + ] + ] + ] + list +] + +do-console: function [][ + buffer: make string! 10000 + prompt: red-prompt: "red>> " + mode: 'mono + + switch-mode: [ + mode: case [ + cnt/1 > 0 ['block] + cnt/2 > 0 ['string] + 'else [ + prompt: red-prompt + do eval + 'mono + ] + ] + prompt: switch mode [ + block ["[^-"] + string ["{^-"] + mono [red-prompt] + ] + ] + + eval: [ + code: load/all buffer + + unless tail? code [ + set/any 'result do code + + unless unset? :result [ + if 67 = length? result: mold/part :result 67 [ ;-- optimized for width = 72 + clear back tail result + append result "..." + ] + print ["==" result] + ] + ] + clear buffer + ] + + while [true][ + unless tail? line: input prompt [ + append buffer line + cnt: count-delimiters buffer + + either Windows? [ + remove skip tail buffer -2 ;-- clear extra CR (Windows) + ][ + append buffer lf ;-- Unix + ] + + switch mode [ + block [if cnt/1 <= 0 [do switch-mode]] + string [if cnt/2 <= 0 [do switch-mode]] + mono [do either any [cnt/1 > 0 cnt/2 > 0][switch-mode][eval]] + ] + ] + ] +] + +q: :quit + +if script: read-argument [ + script: load script + either any [ + script/1 <> 'Red + not block? script/2 + ][ + print "*** Error: not a Red program!" + ][ + do skip script 2 + ] + quit +] + +init-console "Red Console" + +print { +-=== Red Console alpha version ===- +(only ASCII input supported) +} + +do-console + +---tokens--- +'Red [' Generic.Strong +'\n ' Text +'Title:' Generic.Subheading +' ' Text +'"' Literal.String +'Red console' Literal.String +'"' Literal.String +'\n ' Text +'Author:' Generic.Subheading +' ' Text +'[' Generic.Strong +'"' Literal.String +'Nenad Rakocevic' Literal.String +'"' Literal.String +' ' Text +'"' Literal.String +'Kaj de Vos' Literal.String +'"' Literal.String +']' Generic.Strong +'\n ' Text +'File:' Generic.Subheading +' ' Text +'%console.red' Name.Decorator +'\n ' Text +'Tabs:' Generic.Subheading +' ' Text +'4' Literal.Number +'\n ' Text +'Rights:' Generic.Subheading +' ' Text +'"' Literal.String +'Copyright ' Literal.String +'(' Literal.String +'C' Literal.String +')' Literal.String +' 2012-2013 Nenad Rakocevic. All rights reserved.' Literal.String +'"' Literal.String +'\n ' Text +'License:' Generic.Subheading +' ' Text +'{' Literal.String +'\n Distributed under the Boost Software License, Version 1.0.\n See https://github.com/dockimbel/Red/blob/master/BSL-License.txt\n ' Literal.String +'}' Literal.String +'\n ' Text +'Purpose:' Generic.Subheading +' ' Text +'"' Literal.String +'Just some code for testing Pygments colorizer' Literal.String +'"' Literal.String +'\n ' Text +'Language:' Generic.Subheading +' ' Text +'http://www.red-lang.org/' Name.Decorator +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'#system-global' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n ' Text +'#either' Keyword.Namespace +' ' Text +'OS' Name.Variable +' ' Text +'=' Operator +' ' Text +"'Windows" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +'#import' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n ' Text +'"' Literal.String +'kernel32.dll' Literal.String +'"' Literal.String +' ' Text +'stdcall' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n ' Text +'AttachConsole:' Generic.Subheading +' ' Text +'"' Literal.String +'AttachConsole' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +'\n ' Text +'processID' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'SetConsoleTitle:' Generic.Subheading +' ' Text +'"' Literal.String +'SetConsoleTitleA' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +'\n ' Text +'title' Name.Variable +' ' Text +'[' Generic.Strong +'c-string!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'ReadConsole:' Generic.Subheading +' ' Text +'"' Literal.String +'ReadConsoleA' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +'\n ' Text +'consoleInput' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'buffer' Name.Variable +' ' Text +'[' Generic.Strong +'byte-ptr!' Keyword.Type +']' Generic.Strong +'\n ' Text +'charsToRead' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'numberOfChars' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +'\n ' Text +'inputControl' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'line-buffer-size:' Generic.Subheading +' ' Text +'16' Literal.Number +' ' Text +'*' Operator +' ' Text +'1024' Literal.Number +'\n ' Text +'line-buffer:' Generic.Subheading +' ' Text +'allocate' Name.Variable +' ' Text +'line-buffer-size' Name.Variable +'\n ' Text +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'#switch' Keyword.Namespace +' ' Text +'OS' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'MacOSX' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'#define' Keyword.Namespace +' ' Text +'ReadLine-library' Name.Variable +' ' Text +'"' Literal.String +'libreadline.dylib' Literal.String +'"' Literal.String +'\n ' Text +']' Generic.Strong +'\n ' Text +'#default' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n ' Text +'#define' Keyword.Namespace +' ' Text +'ReadLine-library' Name.Variable +' ' Text +'"' Literal.String +'libreadline.so.6' Literal.String +'"' Literal.String +'\n ' Text +'#define' Keyword.Namespace +' ' Text +'History-library' Name.Variable +' ' Text +'"' Literal.String +'libhistory.so.6' Literal.String +'"' Literal.String +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'#import' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n ' Text +'ReadLine-library' Name.Variable +' ' Text +'cdecl' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n ' Text +'read-line:' Generic.Subheading +' ' Text +'"' Literal.String +'readline' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +' ' Text +'; Read a line from the console.\n' Comment + +' ' Text +'prompt' Name.Variable +' ' Text +'[' Generic.Strong +'c-string!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'c-string!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'rl-bind-key:' Generic.Subheading +' ' Text +'"' Literal.String +'rl_bind_key' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +'\n ' Text +'key' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'command' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'rl-insert:' Generic.Subheading +' ' Text +'"' Literal.String +'rl_insert' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +'\n ' Text +'count' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'key' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'#if' Keyword.Namespace +' ' Text +'OS' Name.Variable +' ' Text +'<>' Operator +' ' Text +"'MacOSX" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +'History-library' Name.Variable +' ' Text +'cdecl' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n ' Text +'add-history:' Generic.Subheading +' ' Text +'"' Literal.String +'add_history' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +' ' Text +'; Add line to the history.\n' Comment + +' ' Text +'line' Name.Variable +' ' Text +'[' Generic.Strong +'c-string!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n\n ' Text +'rl-insert-wrapper:' Generic.Subheading +' ' Text +'func' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'[' Generic.Strong +'cdecl' Keyword.Namespace +']' Generic.Strong +'\n ' Text +'count' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'key' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'rl-insert' Name.Variable +' ' Text +'count' Name.Variable +' ' Text +'key' Name.Variable +'\n ' Text +']' Generic.Strong +'\n \n ' Text +']' Generic.Strong +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'Windows?:' Generic.Subheading +' ' Text +'system' Name.Exception +'/platform' Name.Attribute +' ' Text +'=' Operator +' ' Text +"'Windows" Name.Variable.Instance +'\n\n' Text + +'read-argument:' Generic.Subheading +' ' Text +'routine' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'/local' Name.Attribute +'\n ' Text +'args' Name.Variable +' ' Text +'[' Generic.Strong +'str-array!' Keyword.Type +']' Generic.Strong +'\n ' Text +'str' Name.Variable +' ' Text +'[' Generic.Strong +'red-string!' Keyword.Type +']' Generic.Strong +'\n' Text + +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'if' Name.Builtin +' ' Text +'system' Name.Exception +'/args-count' Name.Attribute +' ' Text +'<>' Operator +' ' Text +'2' Literal.Number +' ' Text +'[' Generic.Strong +'\n ' Text +'SET_RETURN' Name.Variable +'(' Generic.Strong +'none-value' Text +')' Generic.Strong +'\n ' Text +'exit' Name.Exception +'\n ' Text +']' Generic.Strong +'\n ' Text +'args:' Generic.Subheading +' ' Text +'system' Name.Exception +'/args-list' Name.Attribute +' ' Text +'+' Operator +' ' Text +'1' Literal.Number +' ' Text +';-- skip binary filename\n' Comment + +' ' Text +'str:' Generic.Subheading +' ' Text +'simple-io' Name.Variable +'/read-txt' Name.Attribute +' ' Text +'args' Name.Variable +'/item' Name.Attribute +'\n ' Text +'SET_RETURN' Name.Variable +'(' Generic.Strong +'str' Text +')' Generic.Strong +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'init-console:' Generic.Subheading +' ' Text +'routine' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'str' Name.Variable +' ' Text +'[' Generic.Strong +'string!' Keyword.Type +']' Generic.Strong +'\n ' Text +'/local' Name.Attribute +'\n ' Text +'ret' Name.Variable +'\n' Text + +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'#either' Keyword.Namespace +' ' Text +'OS' Name.Variable +' ' Text +'=' Operator +' ' Text +"'Windows" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +';ret: AttachConsole -1\n' Comment + +' ' Text +';if zero? ret [print-line "ReadConsole failed!" halt]\n' Comment + +' \n ' Text +'ret:' Generic.Subheading +' ' Text +'SetConsoleTitle' Name.Variable +' ' Text +'as' Name.Variable +' ' Text +'c-string!' Keyword.Type +' ' Text +'string' Name.Variable +'/rs-head' Name.Attribute +' ' Text +'str' Name.Variable +'\n ' Text +'if' Name.Builtin +' ' Text +'zero?' Keyword +' ' Text +'ret' Name.Variable +' ' Text +'[' Generic.Strong +'print-line' Name.Variable +' ' Text +'"' Literal.String +'SetConsoleTitle failed!' Literal.String +'"' Literal.String +' ' Text +'halt' Name.Exception +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'rl-bind-key' Name.Variable +' ' Text +'as-integer' Name.Variable +' ' Text +'tab' Name.Builtin.Pseudo +' ' Text +'as-integer' Name.Variable +' ' Text +':rl-insert-wrapper' Generic.Subheading +'\n ' Text +']' Generic.Strong +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'input:' Generic.Subheading +' ' Text +'routine' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'prompt' Name.Variable +' ' Text +'[' Generic.Strong +'string!' Keyword.Type +']' Generic.Strong +'\n ' Text +'/local' Name.Attribute +'\n ' Text +'len' Name.Variable +' ' Text +'ret' Name.Variable +' ' Text +'str' Name.Variable +' ' Text +'buffer' Name.Variable +' ' Text +'line' Name.Variable +'\n' Text + +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'#either' Keyword.Namespace +' ' Text +'OS' Name.Variable +' ' Text +'=' Operator +' ' Text +"'Windows" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +'len:' Generic.Subheading +' ' Text +'0' Literal.Number +'\n ' Text +'print' Name.Builtin +' ' Text +'as' Name.Variable +' ' Text +'c-string!' Keyword.Type +' ' Text +'string' Name.Variable +'/rs-head' Name.Attribute +' ' Text +'prompt' Name.Variable +'\n ' Text +'ret:' Generic.Subheading +' ' Text +'ReadConsole' Name.Variable +' ' Text +'stdin' Name.Variable +' ' Text +'line-buffer' Name.Variable +' ' Text +'line-buffer-size' Name.Variable +' ' Text +':len' Generic.Subheading +' ' Text +'null' Name.Builtin.Pseudo +'\n ' Text +'if' Name.Builtin +' ' Text +'zero?' Keyword +' ' Text +'ret' Name.Variable +' ' Text +'[' Generic.Strong +'print-line' Name.Variable +' ' Text +'"' Literal.String +'ReadConsole failed!' Literal.String +'"' Literal.String +' ' Text +'halt' Name.Exception +']' Generic.Strong +'\n ' Text +'len:' Generic.Subheading +' ' Text +'len' Name.Variable +' ' Text +'+' Operator +' ' Text +'1' Literal.Number +'\n ' Text +'line-buffer' Name.Variable +'/len:' Name.Attribute +' ' Text +'null-byte' Name.Builtin.Pseudo +'\n ' Text +'str:' Generic.Subheading +' ' Text +'string' Name.Variable +'/load' Name.Attribute +' ' Text +'as' Name.Variable +' ' Text +'c-string!' Keyword.Type +' ' Text +'line-buffer' Name.Variable +' ' Text +'len' Name.Variable +'\n ' Text +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'line:' Generic.Subheading +' ' Text +'read-line' Name.Variable +' ' Text +'as' Name.Variable +' ' Text +'c-string!' Keyword.Type +' ' Text +'string' Name.Variable +'/rs-head' Name.Attribute +' ' Text +'prompt' Name.Variable +'\n ' Text +'if' Name.Builtin +' ' Text +'line' Name.Variable +' ' Text +'=' Operator +' ' Text +'null' Name.Builtin.Pseudo +' ' Text +'[' Generic.Strong +'halt' Name.Exception +']' Generic.Strong +' ' Text +'; EOF\n' Comment + +'\n ' Text +'#if' Keyword.Namespace +' ' Text +'OS' Name.Variable +' ' Text +'<>' Operator +' ' Text +"'MacOSX" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'add-history' Name.Variable +' ' Text +'line' Name.Variable +']' Generic.Strong +'\n\n ' Text +'str:' Generic.Subheading +' ' Text +'string' Name.Variable +'/load' Name.Attribute +' ' Text +'line' Name.Variable +' ' Text +'1' Literal.Number +' ' Text +'+' Operator +' ' Text +'length?' Name.Function +' ' Text +'line' Name.Variable +'\n' Text + +'; free as byte-ptr! line\n' Comment + +' ' Text +']' Generic.Strong +'\n ' Text +'SET_RETURN' Name.Variable +'(' Generic.Strong +'str' Text +')' Generic.Strong +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'count-delimiters:' Generic.Subheading +' ' Text +'function' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'buffer' Name.Variable +' ' Text +'[' Generic.Strong +'string!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'block!' Keyword.Type +']' Generic.Strong +'\n' Text + +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'list:' Generic.Subheading +' ' Text +'copy' Name.Function +' ' Text +'[' Generic.Strong +'0' Literal.Number +' ' Text +'0' Literal.Number +']' Generic.Strong +'\n ' Text +'c:' Generic.Subheading +' ' Text +'none' Name.Builtin.Pseudo +'\n \n ' Text +'foreach' Name.Builtin +' ' Text +'c' Name.Variable +' ' Text +'buffer' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'case' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'escaped?' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'escaped?:' Generic.Subheading +' ' Text +'no' Name.Builtin.Pseudo +'\n ' Text +']' Generic.Strong +'\n ' Text +'in-comment?' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'switch' Name.Builtin +' ' Text +'c' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'#"' Literal.String.Char +'^/"' Literal.String.Char +' ' Text +'[' Generic.Strong +'in-comment?:' Generic.Subheading +' ' Text +'no' Name.Builtin.Pseudo +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +"'else" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +'switch' Name.Builtin +' ' Text +'c' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'#"' Literal.String.Char +'^^"' Literal.String.Char +' ' Text +'[' Generic.Strong +'escaped?:' Generic.Subheading +' ' Text +'yes' Name.Builtin.Pseudo +']' Generic.Strong +'\n ' Text +'#"' Literal.String.Char +';"' Literal.String.Char +' ' Text +'[' Generic.Strong +'if' Name.Builtin +' ' Text +'zero?' Keyword +' ' Text +'list' Name.Variable +'/2' Name.Attribute +' ' Text +'[' Generic.Strong +'in-comment?:' Generic.Subheading +' ' Text +'yes' Name.Builtin.Pseudo +']' Generic.Strong +']' Generic.Strong +'\n ' Text +'#"' Literal.String.Char +'["' Literal.String.Char +' ' Text +'[' Generic.Strong +'list' Name.Variable +'/1:' Name.Attribute +' ' Text +'list' Name.Variable +'/1' Name.Attribute +' ' Text +'+' Operator +' ' Text +'1' Literal.Number +']' Generic.Strong +'\n ' Text +'#"' Literal.String.Char +']"' Literal.String.Char +' ' Text +'[' Generic.Strong +'list' Name.Variable +'/1:' Name.Attribute +' ' Text +'list' Name.Variable +'/1' Name.Attribute +' ' Text +'-' Operator +' ' Text +'1' Literal.Number +']' Generic.Strong +'\n ' Text +'#"' Literal.String.Char +'{"' Literal.String.Char +' ' Text +'[' Generic.Strong +'list' Name.Variable +'/2:' Name.Attribute +' ' Text +'list' Name.Variable +'/2' Name.Attribute +' ' Text +'+' Operator +' ' Text +'1' Literal.Number +']' Generic.Strong +'\n ' Text +'#"' Literal.String.Char +'}"' Literal.String.Char +' ' Text +'[' Generic.Strong +'list' Name.Variable +'/2:' Name.Attribute +' ' Text +'list' Name.Variable +'/2' Name.Attribute +' ' Text +'-' Operator +' ' Text +'1' Literal.Number +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'list' Name.Variable +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'do-console:' Generic.Subheading +' ' Text +'function' Name.Builtin +' ' Text +'[' Generic.Strong +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'buffer:' Generic.Subheading +' ' Text +'make' Name.Function +' ' Text +'string!' Keyword.Type +' ' Text +'10000' Literal.Number +'\n ' Text +'prompt:' Generic.Subheading +' ' Text +'red-prompt:' Generic.Subheading +' ' Text +'"' Literal.String +'red>> ' Literal.String +'"' Literal.String +'\n ' Text +'mode:' Generic.Subheading +' ' Text +"'mono" Name.Variable.Instance +'\n \n ' Text +'switch-mode:' Generic.Subheading +' ' Text +'[' Generic.Strong +'\n ' Text +'mode:' Generic.Subheading +' ' Text +'case' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'cnt' Name.Variable +'/1' Name.Attribute +' ' Text +'>' Name.Variable +' ' Text +'0' Literal.Number +' ' Text +'[' Generic.Strong +"'block" Name.Variable.Instance +']' Generic.Strong +'\n ' Text +'cnt' Name.Variable +'/2' Name.Attribute +' ' Text +'>' Name.Variable +' ' Text +'0' Literal.Number +' ' Text +'[' Generic.Strong +"'string" Name.Variable.Instance +']' Generic.Strong +'\n ' Text +"'else" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +'prompt:' Generic.Subheading +' ' Text +'red-prompt' Name.Variable +'\n ' Text +'do' Name.Exception +' ' Text +'eval' Name.Variable +'\n ' Text +"'mono" Name.Variable.Instance +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'prompt:' Generic.Subheading +' ' Text +'switch' Name.Builtin +' ' Text +'mode' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'block' Name.Variable +' ' Text +'[' Generic.Strong +'"' Literal.String +'[' Literal.String +'^-' Literal.String.Escape +'"' Literal.String +']' Generic.Strong +'\n ' Text +'string' Name.Variable +' ' Text +'[' Generic.Strong +'"' Literal.String +'{' Literal.String +'^-' Literal.String.Escape +'"' Literal.String +']' Generic.Strong +'\n ' Text +'mono' Name.Variable +' ' Text +'[' Generic.Strong +'red-prompt' Name.Variable +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n \n ' Text +'eval:' Generic.Subheading +' ' Text +'[' Generic.Strong +'\n ' Text +'code:' Generic.Subheading +' ' Text +'load' Name.Exception +'/all' Name.Attribute +' ' Text +'buffer' Name.Variable +'\n \n ' Text +'unless' Name.Builtin +' ' Text +'tail?' Name.Function +' ' Text +'code' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'set' Name.Builtin +'/any' Name.Attribute +' ' Text +"'result" Name.Variable.Instance +' ' Text +'do' Name.Exception +' ' Text +'code' Name.Variable +'\n \n ' Text +'unless' Name.Builtin +' ' Text +'unset?' Keyword +' ' Text +':result' Generic.Subheading +' ' Text +'[' Generic.Strong +'\n ' Text +'if' Name.Builtin +' ' Text +'67' Literal.Number +' ' Text +'=' Operator +' ' Text +'length?' Name.Function +' ' Text +'result:' Generic.Subheading +' ' Text +'mold' Name.Function +'/part' Name.Attribute +' ' Text +':result' Generic.Subheading +' ' Text +'67' Literal.Number +' ' Text +'[' Generic.Strong +' ' Text +';-- optimized for width = 72\n' Comment + +' ' Text +'clear' Name.Function +' ' Text +'back' Name.Function +' ' Text +'tail' Name.Function +' ' Text +'result' Name.Variable +'\n ' Text +'append' Name.Function +' ' Text +'result' Name.Variable +' ' Text +'"' Literal.String +'...' Literal.String +'"' Literal.String +'\n ' Text +']' Generic.Strong +'\n ' Text +'print' Name.Builtin +' ' Text +'[' Generic.Strong +'"' Literal.String +'==' Literal.String +'"' Literal.String +' ' Text +'result' Name.Variable +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'clear' Name.Function +' ' Text +'buffer' Name.Variable +'\n ' Text +']' Generic.Strong +'\n\n ' Text +'while' Name.Builtin +' ' Text +'[' Generic.Strong +'true' Name.Builtin.Pseudo +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'unless' Name.Builtin +' ' Text +'tail?' Name.Function +' ' Text +'line:' Generic.Subheading +' ' Text +'input' Name.Variable +' ' Text +'prompt' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'append' Name.Function +' ' Text +'buffer' Name.Variable +' ' Text +'line' Name.Variable +'\n ' Text +'cnt:' Generic.Subheading +' ' Text +'count-delimiters' Name.Variable +' ' Text +'buffer' Name.Variable +'\n\n ' Text +'either' Name.Builtin +' ' Text +'Windows?' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'remove' Name.Function +' ' Text +'skip' Name.Function +' ' Text +'tail' Name.Function +' ' Text +'buffer' Name.Variable +' ' Text +'-2' Literal.Number +' ' Text +';-- clear extra CR (Windows)\n' Comment + +' ' Text +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'append' Name.Function +' ' Text +'buffer' Name.Variable +' ' Text +'lf' Name.Builtin.Pseudo +' ' Text +';-- Unix\n' Comment + +' ' Text +']' Generic.Strong +'\n \n ' Text +'switch' Name.Builtin +' ' Text +'mode' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'block' Name.Variable +' ' Text +'[' Generic.Strong +'if' Name.Builtin +' ' Text +'cnt' Name.Variable +'/1' Name.Attribute +' ' Text +'<=' Operator +' ' Text +'0' Literal.Number +' ' Text +'[' Generic.Strong +'do' Name.Exception +' ' Text +'switch-mode' Name.Variable +']' Generic.Strong +']' Generic.Strong +'\n ' Text +'string' Name.Variable +' ' Text +'[' Generic.Strong +'if' Name.Builtin +' ' Text +'cnt' Name.Variable +'/2' Name.Attribute +' ' Text +'<=' Operator +' ' Text +'0' Literal.Number +' ' Text +'[' Generic.Strong +'do' Name.Exception +' ' Text +'switch-mode' Name.Variable +']' Generic.Strong +']' Generic.Strong +'\n ' Text +'mono' Name.Variable +' ' Text +'[' Generic.Strong +'do' Name.Exception +' ' Text +'either' Name.Builtin +' ' Text +'any' Name.Builtin +' ' Text +'[' Generic.Strong +'cnt' Name.Variable +'/1' Name.Attribute +' ' Text +'>' Name.Variable +' ' Text +'0' Literal.Number +' ' Text +'cnt' Name.Variable +'/2' Name.Attribute +' ' Text +'>' Name.Variable +' ' Text +'0' Literal.Number +']' Generic.Strong +'[' Generic.Strong +'switch-mode' Name.Variable +']' Generic.Strong +'[' Generic.Strong +'eval' Name.Variable +']' Generic.Strong +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'q:' Generic.Subheading +' ' Text +':quit' Generic.Subheading +'\n\n' Text + +'if' Name.Builtin +' ' Text +'script:' Generic.Subheading +' ' Text +'read-argument' Name.Variable +' ' Text +'[' Generic.Strong +'\n ' Text +'script:' Generic.Subheading +' ' Text +'load' Name.Exception +' ' Text +'script' Name.Variable +'\n ' Text +'either' Name.Builtin +' ' Text +'any' Name.Builtin +' ' Text +'[' Generic.Strong +'\n ' Text +'script' Name.Variable +'/1' Name.Attribute +' ' Text +'<>' Operator +' ' Text +"'Red" Name.Variable.Instance +'\n ' Text +'not' Name.Builtin +' ' Text +'block?' Keyword +' ' Text +'script' Name.Variable +'/2' Name.Attribute +' \n ' Text +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'print' Name.Builtin +' ' Text +'"' Literal.String +'*** Error: not a Red program!' Literal.String +'"' Literal.String +'\n ' Text +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'do' Name.Exception +' ' Text +'skip' Name.Function +' ' Text +'script' Name.Variable +' ' Text +'2' Literal.Number +'\n ' Text +']' Generic.Strong +'\n ' Text +'quit' Name.Exception +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'init-console' Name.Variable +' ' Text +'"' Literal.String +'Red Console' Literal.String +'"' Literal.String +'\n\n' Text + +'print' Name.Builtin +' ' Text +'{' Literal.String +'\n-=== Red Console alpha version ===-\n' Literal.String + +'(' Literal.String +'only ASCII input supported' Literal.String +')' Literal.String +'\n' Literal.String + +'}' Literal.String +'\n\n' Text + +'do-console' Name.Variable +'\n' Text diff --git a/tests/lexers/red/example2.txt b/tests/lexers/red/example2.txt new file mode 100644 index 00000000..ff1ec142 --- /dev/null +++ b/tests/lexers/red/example2.txt @@ -0,0 +1,1008 @@ +---input--- +Red/System [ + Title: "Red/System example file" + Purpose: "Just some code for testing Pygments colorizer" + Language: http://www.red-lang.org/ +] + +#include %../common/FPU-configuration.reds + +; C types + +#define time! long! +#define clock! long! + +date!: alias struct! [ + second [integer!] ; 0-61 (60?) + minute [integer!] ; 0-59 + hour [integer!] ; 0-23 + + day [integer!] ; 1-31 + month [integer!] ; 0-11 + year [integer!] ; Since 1900 + + weekday [integer!] ; 0-6 since Sunday + yearday [integer!] ; 0-365 + daylight-saving-time? [integer!] ; Negative: unknown +] + +#either OS = 'Windows [ + #define clocks-per-second 1000 +][ + ; CLOCKS_PER_SEC value for Syllable, Linux (XSI-conformant systems) + ; TODO: check for other systems + #define clocks-per-second 1000'000 +] + +#import [LIBC-file cdecl [ + + ; Error handling + + form-error: "strerror" [ ; Return error description. + code [integer!] + return: [c-string!] + ] + print-error: "perror" [ ; Print error to standard error output. + string [c-string!] + ] + + + ; Memory management + + make: "calloc" [ ; Allocate zero-filled memory. + chunks [size!] + size [size!] + return: [binary!] + ] + resize: "realloc" [ ; Resize memory allocation. + memory [binary!] + size [size!] + return: [binary!] + ] + ] + + JVM!: alias struct! [ + reserved0 [int-ptr!] + reserved1 [int-ptr!] + reserved2 [int-ptr!] + + DestroyJavaVM [function! [[JNICALL] vm [JVM-ptr!] return: [jint!]]] + AttachCurrentThread [function! [[JNICALL] vm [JVM-ptr!] penv [struct! [p [int-ptr!]]] args [byte-ptr!] return: [jint!]]] + DetachCurrentThread [function! [[JNICALL] vm [JVM-ptr!] return: [jint!]]] + GetEnv [function! [[JNICALL] vm [JVM-ptr!] penv [struct! [p [int-ptr!]]] version [integer!] return: [jint!]]] + AttachCurrentThreadAsDaemon [function! [[JNICALL] vm [JVM-ptr!] penv [struct! [p [int-ptr!]]] args [byte-ptr!] return: [jint!]]] +] + + ;just some datatypes for testing: + + #some-hash + 10-1-2013 + quit + + ;binary: + #{00FF0000} + #{00FF0000 FF000000} + #{00FF0000 FF000000} ;with tab instead of space + 2#{00001111} + 64#{/wAAAA==} + 64#{/wAAA A==} ;with space inside + 64#{/wAAA A==} ;with tab inside + + + ;string with char + {bla ^(ff) foo} + {bla ^(( foo} + ;some numbers: + 12 + 1'000 + 1.2 + FF00FF00h + + ;some tests of hexa number notation with not common ending + [ff00h ff00h] ff00h{} FFh"foo" 00h(1 + 2) (AEh) + +;normal words: +foo char + +;get-word +:foo + +;lit-word: +'foo 'foo + +;multiple comment tests... +1 + 1 +comment "aa" +2 + 2 +comment {aa} +3 + 3 +comment {a^{} +4 + 4 +comment {{}} +5 + 5 +comment { + foo: 6 +} +6 + 6 +comment [foo: 6] +7 + 7 +comment [foo: "[" ] +8 + 8 +comment [foo: {^{} ] +9 + 9 +comment [foo: {boo} ] +10 + 10 +comment 5-May-2014/11:17:34+2:00 +11 + 11 + + +to-integer foo +foo/(a + 1)/b + +call/output reform ['which interpreter] path: copy "" + + version-1.1: 00010001h + + #if type = 'exe [ + push system/stack/frame ;-- save previous frame pointer + system/stack/frame: system/stack/top ;-- @@ reposition frame pointer just after the catch flag +] +push CATCH_ALL ;-- exceptions root barrier +push 0 ;-- keep stack aligned on 64-bit + +---tokens--- +'Red/System [' Generic.Strong +'\n ' Text +'Title:' Generic.Subheading +' ' Text +'"' Literal.String +'Red/System example file' Literal.String +'"' Literal.String +'\n ' Text +'Purpose:' Generic.Subheading +' ' Text +'"' Literal.String +'Just some code for testing Pygments colorizer' Literal.String +'"' Literal.String +'\n ' Text +'Language:' Generic.Subheading +' ' Text +'http://www.red-lang.org/' Name.Decorator +'\n' Text + +']' Generic.Strong +'\n\n' Text + +'#include' Keyword.Namespace +' ' Text +'%../common/FPU-configuration.reds' Name.Decorator +'\n\n' Text + +'; C types\n' Comment + +'\n' Text + +'#define' Keyword.Namespace +' ' Text +'time!' Keyword.Type +' ' Text +'long!' Keyword.Type +'\n' Text + +'#define' Keyword.Namespace +' ' Text +'clock!' Keyword.Type +' ' Text +'long!' Keyword.Type +'\n\n' Text + +'date!:' Generic.Subheading +' ' Text +'alias' Name.Exception +' ' Text +'struct!' Keyword.Type +' ' Text +'[' Generic.Strong +'\n ' Text +'second' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; 0-61 (60?)\n' Comment + +' ' Text +'minute' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; 0-59\n' Comment + +' ' Text +'hour' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; 0-23\n' Comment + +'\n ' Text +'day' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; 1-31\n' Comment + +' ' Text +'month' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; 0-11\n' Comment + +' ' Text +'year' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; Since 1900\n' Comment + +'\n ' Text +'weekday' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; 0-6 since Sunday\n' Comment + +' ' Text +'yearday' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; 0-365\n' Comment + +' ' Text +'daylight-saving-time?' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'; Negative: unknown\n' Comment + +']' Generic.Strong +'\n\n' Text + +'#either' Keyword.Namespace +' ' Text +'OS' Name.Variable +' ' Text +'=' Operator +' ' Text +"'Windows" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +'#define' Keyword.Namespace +' ' Text +'clocks-per-second' Name.Variable +' ' Text +'1000' Literal.Number +'\n' Text + +']' Generic.Strong +'[' Generic.Strong +'\n ' Text +'; CLOCKS_PER_SEC value for Syllable, Linux (XSI-conformant systems)\n' Comment + +' ' Text +'; TODO: check for other systems\n' Comment + +' ' Text +'#define' Keyword.Namespace +' ' Text +'clocks-per-second' Name.Variable +' ' Text +"1000'000" Literal.Number +'\n' Text + +']' Generic.Strong +' \n\n' Text + +'#import' Keyword.Namespace +' ' Text +'[' Generic.Strong +'LIBC-file' Name.Variable +' ' Text +'cdecl' Keyword.Namespace +' ' Text +'[' Generic.Strong +'\n\n ' Text +'; Error handling\n' Comment + +'\n ' Text +'form-error:' Generic.Subheading +' ' Text +'"' Literal.String +'strerror' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +' ' Text +'; Return error description.\n' Comment + +' ' Text +'code' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'c-string!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'print-error:' Generic.Subheading +' ' Text +'"' Literal.String +'perror' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +' ' Text +'; Print error to standard error output.\n' Comment + +' ' Text +'string' Name.Variable +' ' Text +'[' Generic.Strong +'c-string!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n\n\n ' Text +'; Memory management\n' Comment + +'\n ' Text +'make:' Generic.Subheading +' ' Text +'"' Literal.String +'calloc' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +' ' Text +'; Allocate zero-filled memory.\n' Comment + +' ' Text +'chunks' Name.Variable +' ' Text +'[' Generic.Strong +'size!' Keyword.Type +']' Generic.Strong +'\n ' Text +'size' Name.Variable +' ' Text +'[' Generic.Strong +'size!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'binary!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +'resize:' Generic.Subheading +' ' Text +'"' Literal.String +'realloc' Literal.String +'"' Literal.String +' ' Text +'[' Generic.Strong +' ' Text +'; Resize memory allocation.\n' Comment + +' ' Text +'memory' Name.Variable +' ' Text +'[' Generic.Strong +'binary!' Keyword.Type +']' Generic.Strong +'\n ' Text +'size' Name.Variable +' ' Text +'[' Generic.Strong +'size!' Keyword.Type +']' Generic.Strong +'\n ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'binary!' Keyword.Type +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n ' Text +']' Generic.Strong +'\n \n ' Text +'JVM!:' Generic.Subheading +' ' Text +'alias' Name.Exception +' ' Text +'struct!' Keyword.Type +' ' Text +'[' Generic.Strong +'\n ' Text +'reserved0' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +'\n ' Text +'reserved1' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +'\n ' Text +'reserved2' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +'\n \n ' Text +'DestroyJavaVM' Name.Variable +' ' Text +'[' Generic.Strong +'function!' Keyword.Type +' ' Text +'[' Generic.Strong +'[' Generic.Strong +'JNICALL' Keyword.Namespace +']' Generic.Strong +' ' Text +'vm' Name.Variable +' ' Text +'[' Generic.Strong +'JVM-ptr!' Keyword.Type +']' Generic.Strong +' ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'jint!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +'\n ' Text +'AttachCurrentThread' Name.Variable +' ' Text +'[' Generic.Strong +'function!' Keyword.Type +' ' Text +'[' Generic.Strong +'[' Generic.Strong +'JNICALL' Keyword.Namespace +']' Generic.Strong +' ' Text +'vm' Name.Variable +' ' Text +'[' Generic.Strong +'JVM-ptr!' Keyword.Type +']' Generic.Strong +' ' Text +'penv' Name.Variable +' ' Text +'[' Generic.Strong +'struct!' Keyword.Type +' ' Text +'[' Generic.Strong +'p' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +' ' Text +'args' Name.Variable +' ' Text +'[' Generic.Strong +'byte-ptr!' Keyword.Type +']' Generic.Strong +' ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'jint!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +'\n ' Text +'DetachCurrentThread' Name.Variable +' ' Text +'[' Generic.Strong +'function!' Keyword.Type +' ' Text +'[' Generic.Strong +'[' Generic.Strong +'JNICALL' Keyword.Namespace +']' Generic.Strong +' ' Text +'vm' Name.Variable +' ' Text +'[' Generic.Strong +'JVM-ptr!' Keyword.Type +']' Generic.Strong +' ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'jint!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +'\n ' Text +'GetEnv' Name.Variable +' ' Text +'[' Generic.Strong +'function!' Keyword.Type +' ' Text +'[' Generic.Strong +'[' Generic.Strong +'JNICALL' Keyword.Namespace +']' Generic.Strong +' ' Text +'vm' Name.Variable +' ' Text +'[' Generic.Strong +'JVM-ptr!' Keyword.Type +']' Generic.Strong +' ' Text +'penv' Name.Variable +' ' Text +'[' Generic.Strong +'struct!' Keyword.Type +' ' Text +'[' Generic.Strong +'p' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +' ' Text +'version' Name.Variable +' ' Text +'[' Generic.Strong +'integer!' Keyword.Type +']' Generic.Strong +' ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'jint!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +'\n ' Text +'AttachCurrentThreadAsDaemon' Name.Variable +' ' Text +'[' Generic.Strong +'function!' Keyword.Type +' ' Text +'[' Generic.Strong +'[' Generic.Strong +'JNICALL' Keyword.Namespace +']' Generic.Strong +' ' Text +'vm' Name.Variable +' ' Text +'[' Generic.Strong +'JVM-ptr!' Keyword.Type +']' Generic.Strong +' ' Text +'penv' Name.Variable +' ' Text +'[' Generic.Strong +'struct!' Keyword.Type +' ' Text +'[' Generic.Strong +'p' Name.Variable +' ' Text +'[' Generic.Strong +'int-ptr!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +' ' Text +'args' Name.Variable +' ' Text +'[' Generic.Strong +'byte-ptr!' Keyword.Type +']' Generic.Strong +' ' Text +'return:' Generic.Subheading +' ' Text +'[' Generic.Strong +'jint!' Keyword.Type +']' Generic.Strong +']' Generic.Strong +']' Generic.Strong +'\n' Text + +']' Generic.Strong +'\n\n ' Text +';just some datatypes for testing:\n' Comment + +' \n ' Text +'#some-hash' Name.Label +'\n ' Text +'10-1-2013' Literal.String.Other +'\n ' Text +'quit' Name.Exception +'\n \n ' Text +';binary:\n' Comment + +' ' Text +'#{00FF0000}' Literal.Number.Hex +'\n ' Text +'#{00FF0000 FF000000}' Literal.Number.Hex +'\n ' Text +'#{00FF0000\tFF000000}' Literal.Number.Hex +' ' Text +';with tab instead of space\n' Comment + +' ' Text +'2#{' Literal.Number.Hex +'00001111' Literal.Number.Hex +'}' Literal.Number.Hex +'\n ' Text +'64#{/wAAAA==}' Literal.Number.Hex +'\n ' Text +'64#{/wAAA A==}' Literal.Number.Hex +' ' Text +';with space\t inside\n' Comment + +' ' Text +'64#{/wAAA\tA==}' Literal.Number.Hex +' ' Text +';with tab inside\n' Comment + +' \n \n ' Text +';string with char\n' Comment + +' ' Text +'{' Literal.String +'bla ' Literal.String +'^(ff)' Literal.String.Escape +' foo' Literal.String +'}' Literal.String +'\n ' Text +'{' Literal.String +'bla ' Literal.String +'^(' Literal.String.Escape +'(' Literal.String +' foo' Literal.String +'}' Literal.String +'\n ' Text +';some numbers:\n' Comment + +' ' Text +'12' Literal.Number +'\n ' Text +"1'000" Literal.Number +'\n ' Text +'1.2' Literal.Number.Float +'\n ' Text +'FF00FF00' Literal.Number.Hex +'h' Name.Variable +'\n' Text.Whitespace + +' \n ' Text +';some tests of hexa number notation with not common ending\n' Comment + +' ' Text +'[' Generic.Strong +'ff00' Literal.Number.Hex +'h' Name.Variable +' ' Text.Whitespace +'ff00' Literal.Number.Hex +'h' Name.Variable +']' Generic.Strong +' ' Text +'ff00' Literal.Number.Hex +'h' Name.Variable +'{' Literal.String +'}' Literal.String +' ' Text +'FF' Literal.Number.Hex +'h' Name.Variable +'"' Literal.String +'foo' Literal.String +'"' Literal.String +' ' Text +'00' Literal.Number.Hex +'h' Name.Variable +'(' Generic.Strong +'1' Literal.Number +' ' Text +'+' Operator +' ' Text +'2' Literal.Number +')' Generic.Strong +' ' Text +'(' Generic.Strong +'AE' Literal.Number.Hex +'h' Name.Variable +')' Generic.Strong +'\n\n' Text + +';normal words:\n' Comment + +'foo' Name.Variable +' ' Text +'char' Name.Variable +'\n\n' Text + +';get-word\n' Comment + +':foo' Generic.Subheading +'\n \n' Text + +';lit-word:\n' Comment + +"'foo" Name.Variable.Instance +' ' Text +"'foo" Name.Variable.Instance +'\n\n' Text + +';multiple comment tests...\n' Comment + +'1' Literal.Number +' ' Text +'+' Operator +' ' Text +'1' Literal.Number +'\n' Text + +'comment "' Comment +'aa' Comment +'"' Comment +'\t\t\t\t\t\t\t\t\n' Text + +'2' Literal.Number +' ' Text +'+' Operator +' ' Text +'2' Literal.Number +'\n' Text + +'comment {' Comment +'aa' Comment +'}' Comment +'\n' Text + +'3' Literal.Number +' ' Text +'+' Operator +' ' Text +'3' Literal.Number +'\n' Text + +'comment {' Comment +'a' Comment +'^{' Comment +'}' Comment +'\n' Text + +'4' Literal.Number +' ' Text +'+' Operator +' ' Text +'4' Literal.Number +'\n' Text + +'comment {' Comment +'{' Comment +'}' Comment +'}' Comment +'\n' Text + +'5' Literal.Number +' ' Text +'+' Operator +' ' Text +'5' Literal.Number +'\n' Text + +'comment {' Comment +'\n\tfoo: 6\n' Comment + +'}' Comment +'\n' Text + +'6' Literal.Number +' ' Text +'+' Operator +' ' Text +'6' Literal.Number +'\n' Text + +'comment [' Comment +'foo: 6' Comment +']' Comment +'\n' Text + +'7' Literal.Number +' ' Text +'+' Operator +' ' Text +'7' Literal.Number +'\n' Text + +'comment [' Comment +'foo: ' Comment +'"' Comment +'[' Comment +'"' Comment +' ' Comment +']' Comment +'\n' Text + +'8' Literal.Number +' ' Text +'+' Operator +' ' Text +'8' Literal.Number +'\n' Text + +'comment [' Comment +'foo: ' Comment +'{' Comment +'^{' Comment +'}' Comment +' ' Comment +']' Comment +'\n' Text + +'9' Literal.Number +' ' Text +'+' Operator +' ' Text +'9' Literal.Number +'\n' Text + +'comment [' Comment +'foo: ' Comment +'{' Comment +'boo' Comment +'}' Comment +' ' Comment +']' Comment +'\n' Text + +'10' Literal.Number +' ' Text +'+' Operator +' ' Text +'10' Literal.Number +'\n' Text + +'comment 5-May-2014/11:17:34+2:00' Comment +'\n' Text + +'11' Literal.Number +' ' Text +'+' Operator +' ' Text +'11' Literal.Number +'\n\n\n' Text + +'to-integer' Keyword +' ' Text +'foo' Name.Variable +'\n' Text + +'foo' Name.Variable +'/' Name.Attribute +'(' Generic.Strong +'a' Name.Variable +' ' Text +'+' Operator +' ' Text +'1' Literal.Number +')' Generic.Strong +'/b' Name.Attribute +'\n\n' Text + +'call' Name.Exception +'/output' Name.Attribute +' ' Text +'reform' Name.Variable +' ' Text +'[' Generic.Strong +"'which" Name.Variable.Instance +' ' Text +'interpreter' Name.Variable +']' Generic.Strong +' ' Text +'path:' Generic.Subheading +' ' Text +'copy' Name.Function +' ' Text +'"' Literal.String +'"' Literal.String +'\n\n ' Text +'version-1.1:' Generic.Subheading +' ' Text +'00010001' Literal.Number.Hex +'h' Name.Variable +'\n' Text.Whitespace + +' \n ' Text +'#if' Keyword.Namespace +' ' Text +'type' Name.Variable +' ' Text +'=' Operator +' ' Text +"'exe" Name.Variable.Instance +' ' Text +'[' Generic.Strong +'\n ' Text +'push' Name.Exception +' ' Text +'system' Name.Exception +'/stack' Name.Attribute +'/frame' Name.Attribute +' ' Text +';-- save previous frame pointer\n' Comment + +' ' Text +'system' Name.Exception +'/stack' Name.Attribute +'/frame:' Name.Attribute +' ' Text +'system' Name.Exception +'/stack' Name.Attribute +'/top' Name.Attribute +' ' Text +';-- @@ reposition frame pointer just after the catch flag\n' Comment + +']' Generic.Strong +'\n' Text + +'push' Name.Exception +' ' Text +'CATCH_ALL' Name.Variable +' ' Text +';-- exceptions root barrier\n' Comment + +'push' Name.Exception +' ' Text +'0' Literal.Number +' ' Text +';-- keep stack aligned on 64-bit\n' Comment |
