;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. #@52 Skip across any whitespace characters or comments. (defalias 'zenscript--skip-ws-and-comments #[0 "\300\301!\210d`\302\\Y\205-\212\303``\302\\\304\211\211\305&)\3068\205+\303`d\304\211\307&\210\310 \262\207" [skip-syntax-forward " >" 2 parse-partial-sexp nil t 4 syntax-table zenscript--skip-ws-and-comments] 8 (#$ . 87)]) #@178 Make a hashmap. KWARGS are additional arguments to `make-hash-table'. Each odd element of KVS is a key corresponding to the value immediately after it. (fn KWARGS &rest KVS) (defalias 'zenscript--map* #[385 "\300\301\302G\303\245$\203\304@A@#\210AA\262\202 \207" [apply make-hash-table :size 2 puthash] 7 (#$ . 424)]) (byte-code "\300\301\302\303#\210\300\304\305\306#\207" [define-hash-table-test zenscript--string-test-single #[514 "\300\207" [t] 3 "\n\n(fn A B)"] #[257 "\211\300\267\202\n\301\207\302\207\303\207" [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (92 6 39 8)) 0 1 2] 3 "\n\n(fn K)"] zenscript--string-test-double #[514 "\300\207" [t] 3 "\n\n(fn A B)"] #[257 "\211\300\267\202\n\301\207\302\207\303\207" [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (92 6 34 8)) 0 1 2] 3 "\n\n(fn K)"]] 4) #@100 A vector of states for the DFA. Each state is a hash-table of characters to the next state index. (defconst zenscript--token-dfa-states (byte-code "\300\301\302\303\304\305\304\306\304\307\304\310\304\311\304\312\304\313\304\314\304\315\304\316\304\317\304\320\304\321\304\322\304\323\304\324\304\325\304\326\304\327\304\330\304\331\304\332\304\333\304\334\304\335\304\336\304\337\304\340\304\341\304\342\304\343\304\344\304\345\304\346\304\347\304\350\304\351\304\352\304\353\304\354\304\355\304\356\304\357\304\360\304\361\304\362\304\363\304\364\304\365\304\366\304\367\304\370\304\371\372\373\374\375\376\377\201@\201A\201B\201C\201D\201E\201F\201G\201H\201I\201J\201K\201L\201M\201N\201O\201P\201Q\201R\201S\201T\201U\201V\201W\201X\201Y\201Z\201[\201\\\201]\201^\201_\201`\201a\201b\201c\201d\201e\201Q\201`\201Y\201d\201I\201f\201E\201b\201g\201h\201i\201g\201W\201j\201W\201k\201W\201l\201W\201m\201W\201n\201W\201o\201W\201i\201W\201p\201W&\265\301\302\303\304\305\304\306\304\307\304\310\304\311\304\312\304\313\304\314\304\315\304\316\304\317\304\320\304\321\304\322\304\323\304\324\304\325\304\326\304\327\304\330\304\331\304\332\304\333\304\334\304\335\304\336\304\337\304\340\304\341\304\342\304\343\304\344\304\345\304\346\304\347\304\350\304\351\304\352\304\353\304\354\304\355\304\356\304\357\304\360\304\361\304\362\304\363\304\364\304\365\304\366\304\367\304\370\304\201h\304\201g\304\201j\304\201k\304\201l\304\201m\304\201n\304\201o\304\201i\304\201p\304&\301\302!\301\302!\301\302!\301\302!\301\302\201A\201q#\301\302!\301\302!\301\302\201e\201r#\301\302!\301\302\201e\201s\201h\201i\201g\201W\201j\201W\201k\201W\201l\201W\201m\201W\201n\201W\201o\201W\201i\201W\201p\201W&\301\302!\301\302\201e\201t#\301\302!\301\302\201e\201u#\301\302!\301\302\201e\201v#\301\302!\301\302\201e\201w\201O\201x%\301\302!\301\302!\301\302\201e\201y\201Q\201z%\301\302!\301\302!\301\302\201e\201{#\301\302!\301\302!\301\302!\301\302!\301\302!\301\302\201e\201|#\301\302!\301\302!\301\302\201e\201}#\301\302!\301\302\201e\201M#\301\302!\301\302\201e\201f#\301\302!\301\302\201e\201[#\301\302!\301\302!\301\201~\201\201C\201f\201o\201A\201E&\301\302\330\201G\201f\201E\201b\201E\201\201E\201K\201E\305\201E\311\201E\321\201E\325\201E\327\201E&\301\302\201h\201A\201g\201A\201j\201A\201k\201A\201l\201A\201m\201A\201n\201A\201o\201A\201i\201A\201p\201A\303\201A\305\201A\306\201A\307\201A\310\201A\311\201A\336\201A\337\201A\340\201A\341\201A\342\201A\343\201A&-\301\302\201h\201K\201g\201K\201j\201K\201k\201K\201l\201K\201m\201K\201n\201K\201o\201K\201i\201K\201p\201K\303\201K\305\201K\306\201K\307\201K\310\201K\311\201K\336\201K\337\201K\340\201K\341\201K\342\201K\343\201K&-\301\302\201h\211\201g\201h\201j\201h\201k\201h\201l\201h\201m\201h\201n\201h\201o\201h\201i\201h\201p\201h\303\201h\305\201h\306\201h\307\201h\310\201h\311\201h\336\201h\337\201h\340\201h\341\201h\342\201h\343\201h&-\301\302\201h\201E\201g\201E\201j\201E\201k\201E\201l\201E\201m\201E\201n\201E\201o\201E\201i\201E\201p\201E\303\201E\305\201E\306\201E\307\201E\310\201E\311\201E\336\201E\337\201E\340\201E\341\201E\342\201E\343\201E&-\301\201\200\201\201j\201b\201o\201A\201g&\301\302\330\201k\201f\201g\201b\201g\201\201g\201K\201g\305\201g\311\201g\321\201g\325\201g\327\201g&\301\302\201h\201l\201g\201l\201j\201l\201k\201l\211\211\201m\201l\201n\201l\201o\201l\201i\201l\201p\201l\303\201l\305\201l\306\201l\307\201l\310\201l\311\201l\336\201l\337\201l\340\201l\341\201l\342\201l\343\201l&-\301\302\201h\201m\201g\201m\201j\201m\201k\201m\201l\201m\211\211\201n\201m\201o\201m\201i\201m\201p\201m\303\201m\305\201m\306\201m\307\201m\310\201m\311\201m\336\201m\337\201m\340\201m\341\201m\342\201m\343\201m&-\301\302\201h\201n\201g\201n\201j\201n\201k\201n\201l\201n\201m\201n\211\211\201o\201n\201i\201n\201p\201n\303\201n\305\201n\306\201n\307\201n\310\201n\311\201n\336\201n\337\201n\340\201n\341\201n\342\201n\343\201n&-\301\302\201h\201g\211\211\201j\201g\201k\201g\201l\201g\201m\201g\201n\201g\201o\201g\201i\201g\201p\201g\303\201g\305\201g\306\201g\307\201g\310\201g\311\201g\336\201g\337\201g\340\201g\341\201g\342\201g\343\201g&-\301\302!\301\302\333\201p\201A\201_%\301\302\201h\201p\201g\201p\201j\201p\201k\201p\201l\201p\201m\201p\201n\201p\201o\201p\201i\201p\211\211\303\201p\305\201p\306\201p\307\201p\310\201p\311\201p\336\201p\337\201p\340\201p\341\201p\342\201p\343\201p&-\301\302\201h\201W\201g\201W\201j\201W\201k\201W\201l\201W\201m\201W\201n\201W\201o\201W\201i\201W\201p\201W\201A\201_&\301\302\201h\201_\201g\201_\201j\201_\201k\201_\201l\201_\201m\201_\201n\201_\201o\201_\201i\201_\201p\201_\310\201a\342\201a\311\201U\343\201U\307\201U\341\201U&!\301\302\201h\201_\201g\201_\201j\201_\201k\201_\201l\201_\201m\201_\201n\201_\201o\201_\201i\201_\201p\201_\310\201a\342\201a\311\201U\343\201U\307\201U\341\201U&!\301\302\201h\201c\201g\201c\201j\201c\201k\201c\201l\201c\201m\201c\201n\201c\201o\201c\201i\201c\201p\201c\201E\201e\201G\201e&\301\302\201h\201c\201g\201c\201j\201c\201k\201c\201l\201c\201m\201c\201n\201c\201o\201c\201i\201c\201p\201c\311\201U\343\201U\307\201U\341\201U&\301\302\201h\201c\201g\201c\201j\201c\201k\201c\201l\201c\201m\201c\201n\201c\201o\201c\201i\201c\201p\201c\311\201U\343\201U\307\201U\341\201U&\301\302!&A\207" [vector zenscript--map* nil 97 1 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 95 123 2 125 3 91 4 93 5 46 6 44 8 43 9 45 11 42 13 47 15 37 17 124 19 38 22 94 25 63 27 58 28 40 29 41 30 126 31 59 33 60 34 62 36 61 39 49 48 56 50 51 52 53 54 55 57 7 10 12 14 16 18 20 21 23 24 26 32 35 (:test zenscript--string-test-single) 92 (:test zenscript--string-test-double)] 183) (#$ . 1333)) #@92 A hashmap of final states indeces. Each final state is mapped to the token it represents. (defconst zenscript--token-dfa-finals (byte-code "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\201@\201A\201B\201C\201D\201E\201F\201G\201H\201I\201J\201K\201L\201M\201N\201O\201P\201Q\201R\201S\201T\201U\201V\201W\201X\201Y\201Z\201Y\201[\201Y\201\\\201]\201^\201]\201_\201]&c\207" [zenscript--map* nil 1 T_ID 2 T_AOPEN 3 T_ACLOSE 4 T_SQBROPEN 5 T_SQBRCLOSE 6 T_DOT 7 T_DOT2 8 T_COMMA 9 T_PLUS 10 T_PLUSASSIGN 11 T_MINUS 12 T_MINUSASSIGN 13 T_MUL 14 T_MULASSIGN 15 T_DIV 16 T_DIVASSIGN 17 T_MOD 18 T_MODASSIGN 19 T_OR 20 T_ORASSIGN 21 T_OR2 22 T_AND 23 T_ANDASSIGN 24 T_AND2 25 T_XOR 26 T_XORASSIGN 27 T_QUEST 28 T_COLON 29 T_BROPEN 30 T_BRCLOSE 31 T_TILDE 32 T_TILDEASSIGN 33 T_SEMICOLON 34 T_LT 35 T_LTEQ 36 T_GT 37 T_GTEQ 38 T_ASSIGN 39 T_EQ 40 T_NOT 41 T_NOTEQ 42 T_DOLLAR 55 T_STRINGVALUE 56 T_INTVALUE 57 58 59 T_FLOATVALUE 62 63] 100) (#$ . 7725)) #@525 Read the buffer into a list of tokens. FROM is the start position, and defaults to `point-min'. TO is the end position, and defaults to `point-max'. If a token is unrecognised, and NO-ERROR is nil, 'zenscript-unrecognised-token is thrown with point. If NO-ERROR is non-nil, then parsing stops instead, returning the partially accumulated list of tokens, and leaving point where it is. If parsing concludes, then point is left at TO. Note: this uses the syntax table to handle comments. (fn &optional FROM TO NO-ERROR) (defalias 'zenscript--tokenize-buffer #[768 "\206eb\210\206\fd\300\301\302 \210\203\\\301f\203\\`\303 `Y\204'\211\204*\301\262\211\203N`V\203;b\266\202\211B\262`W\203I\302 \210\266\202\204W\304\305`\"\210\266\202\306!\207" [t nil zenscript--skip-ws-and-comments zenscript--next-token throw zenscript-unrecognized-token reverse] 11 (#$ . 8927)]) #@37 A hash-table of keywords to tokens. (defconst zenscript--keyword-map (byte-code "\300\301\302\303\304\303\305\306\307\306\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\355\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\201@\201A\201B&E\207" [zenscript--map* (:test equal) "frigginConstructor" T_ZEN_CONSTRUCTOR "zenConstructor" "frigginClass" T_ZEN_CLASS "zenClass" "instanceof" T_INSTANCEOF "static" T_STATIC "global" T_GLOBAL "import" T_IMPORT "false" T_FALSE "true" T_TRUE "null" T_NULL "break" T_BREAK "while" T_WHILE "val" T_VAL "var" T_VAR "return" T_RETURN "for" T_FOR "else" T_ELSE "if" T_IF "version" T_VERSION "as" T_AS "void" T_VOID "has" T_IN "in" "function" T_FUNCTION "string" T_STRING "double" T_DOUBLE "float" T_FLOAT "long" T_LONG "int" T_INT "short" T_SHORT "byte" T_BYTE "bool" T_BOOL "any" T_ANY] 70) (#$ . 9834)) #@562 Parse the next ZenScript token after point. If SKIP-WHITESPACE is non-nil, whitespace and comments are skipped according to `syntax-table'. Return a list of the form (type val pos) or nil if no token was recognised. type: The type of the token, as seen here https://docs.blamejared.com/1.12/en/Dev_Area/ZenTokens/ val: The string value of the token. pos: The position at which the token occured. file: The file name of the buffer from which the token was read. point is put after token, if one was found. (fn &optional SKIP-WHITESPACE) (defalias 'zenscript--next-token #[256 "`\203\303 \210`\304\305f\203)\306\305fH\"\211\203\211\262\211\262\203)\305u\210\202\n\306 \"\307`\"\310=\203A\306\n\"\206?\310\262\203JE\207b\266\305\207" [zenscript--token-dfa-states zenscript--token-dfa-finals zenscript--keyword-map zenscript--skip-ws-and-comments 0 nil gethash buffer-substring-no-properties T_ID] 9 (#$ . 10809)]) #@41 Set LIST to the cdr of LIST. (fn LIST) (defalias 'zenscript--cdr! '(macro . #[257 "\300\301DE\207" [setq cdr] 5 (#$ . 11777)])) #@55 Do (cons CAR LIST) and set LIST to it. (fn CAR LIST) (defalias 'zenscript--cons! '(macro . #[514 "\300\301EE\207" [setq cons] 7 (#$ . 11914)])) #@133 A list of hooks run when an error occurs while parsing. Each hook is called with the error message and the token where it occured. (defvar zenscript-parse-error-hook nil (#$ . 12069)) #@109 Run `zenscript-parse-error-hook' and throw 'zenscript-parse-error with (MESSAGE TOKEN). (fn MESSAGE TOKEN) (defalias 'zenscript--throw-parse-error #[514 "\300\301#\210\302\303D\"\207" [run-hook-with-args zenscript-parse-error-hook throw zenscript-parse-error] 6 (#$ . 12261)]) #@117 Make a tokenstream from a list of tokens, TOKEN-LIST, as returned by `zenscript--tokenize-buffer'. (fn TOKEN-LIST) (defalias 'zenscript--make-tokenstream #[257 "\211C\300\301\"\207" [make-closure #[385 "\301\267\202E\300\242@\207\300\242@\300\211\242A\240\210\207\211@\300\242@@=\205F\300\242@\300\211\242A\240\210\207\211@\300\242@@=\203<\300\242@\300\211\242A\240\210\207\302A@\300\242@\"\207\303\207" [V0 #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (PEEK 6 NEXT 10 OPTIONAL 20 REQUIRE 40)) zenscript--throw-parse-error nil] 5 "\n\n(fn OP &rest ARGS)"]] 5 (#$ . 12550)]) #@242 Require a token of type TYPE from TOKENS. Return the first token if it is of the correct type, otherwise zenscript--throw-parse-error with MESSAGE. TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TYPE TOKENS MESSAGE) (defalias 'zenscript--require-token #[771 "\300#\207" [REQUIRE] 7 (#$ . 13178)]) #@147 Look at the next token in the stream TOKENS, without consuming it. TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--peek-token #[257 "\211\300!\207" [PEEK] 3 (#$ . 13510)]) #@135 Get the next token in the stream TOKENS, consuming it. TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--get-token #[257 "\211\300!\207" [NEXT] 3 (#$ . 13742)]) #@127 Get the next token if it is of type TYPE. TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TYPE TOKENS) (defalias 'zenscript--optional-token #[514 "\211\300\"\207" [OPTIONAL] 5 (#$ . 13961)]) #@130 Return t if TOKENS has any more tokens remaining. TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--has-next-token #[257 "\300!\205\301\207" [zenscript--peek-token t] 3 (#$ . 14183)]) #@721 Parse a list of ZenScript tokens. TOKENLIST is a list of tokens as returned by `zenscript--tokenize-buffer'. Returns a list of the form (imports functions zenclasses statements globals) Which are lists of elements of the formats: imports: (fqname pos rename) fqname: A list of strings representing the fully qualified name. pos: The position at which the import appears. rename: The name by which fqname should be referenced, or nil if the last name in fqname should be used. functions: See `zenscript--parse-function'. zenclasses: See `zenscript--parse-zenclass'. statements: See `zenscript--parse-statement'. globals: See `zenscript--parse-global'. (fn TOKENLIST) (defalias 'zenscript--parse-tokens #[257 "\300!\301\211\211\211\211\3022q\303!\205p\304!@\305=\205p\301\306\307!8\301\310\311\n\312#A@C\262\313\314\n\"\203G\310\311\n\312#A@B\262\2020\313\315\n\"\203Y\310\311\n\312#A@\262\310\316\n\317#\210\320!EB\262\266\202\f0\210\303!\203\274\3022\270\304!@\211\321\267\202\254\322!B\211\262\202\265\323!B\211\262\202\265\324!B\211\262\202\265\325!B\211\262\2620\210\202r\320!\320!\320!\320!\320!\257\207" [zenscript--make-tokenstream nil zenscript-parse-error zenscript--has-next-token zenscript--peek-token T_IMPORT 2 zenscript--get-token zenscript--require-token T_ID "identifier expected" zenscript--optional-token T_DOT T_AS T_SEMICOLON "; expected" reverse #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_STATIC 136 T_GLOBAL 136 T_FUNCTION 148 T_ZEN_CLASS 160)) zenscript--parse-global zenscript--parse-function zenscript--parse-zenclass zenscript--parse-statement] 14 (#$ . 14428)]) #@605 Parse the next static function definition from TOKENS. Return a list of the form: (name arguments type statements start end) name: The token that is the name of the function. arguments: A list of arguments as returned by `zenscript--parse-function-arguments'. type: The ZenType that the function returns. statements: A list of statements, which are as returned by `zenscript--parse-statement'. start: The position after the opening { end: The position before the closing } function name(argname [as type], argname [as type], ...) [as type] { ...statements... } (fn TOKENS) (defalias 'zenscript--parse-function #[257 "\300\301\302#\210\300\303\304#\305!\306\307\"\203\310!\202\311\312\300\313\314#8T\315\211\316!\203M\306\317\"\211\205=\3128\211\262\262\204M\320!B\262\202'\321!\257\207" [zenscript--require-token T_FUNCTION "function expected" T_ID "identifier expected" zenscript--parse-function-arguments zenscript--optional-token T_AS zenscript--parse-zentype (C_RAW "any") 2 T_AOPEN "{ expected" nil zenscript--has-next-token T_ACLOSE zenscript--parse-statement reverse] 13 (#$ . 16187)]) #@209 Parse a list of function arguments from TOKENS. A list of arguments of the form: (name type) name: The token that is the identifier of this binding. type: The ZenType of this binding. (fn TOKENS) (defalias 'zenscript--parse-function-arguments #[257 "\300\301\302\303#\210\304\305\"\204?\300\211\204>\301\306\307#\304\310\"\203%\311!\202&\312DB\262\304\313\"\204\301\305\314#\210\315\262\202\210\316!\207" [nil zenscript--require-token T_BROPEN "( expected" zenscript--optional-token T_BRCLOSE T_ID "identifier expected" T_AS zenscript--parse-zentype (C_RAW "any") T_COMMA ") or , expected" t reverse] 7 (#$ . 17352)]) #@563 Parse the next class definition from TOKENS. A list of the form: (name fields constructors methods start end) name: The token that is the name of this class. fields: A list of fields, which are as returned by `zenscript--parse-zenclass-field'. constructors: A list of constructors, which are as returned by `zenscript--parse-zenclass-constructor'. methods: A list of methods, which are as returned by `zenscript--parse-zenclass-method'. start: The position after the opening { end: The position before the closing } (fn TOKENS) (defalias 'zenscript--parse-zenclass #[257 "\300\301\302#\210\300\303\304#\305\300\306\307#8T\310\211\211\211\311\312\"\206<\311\313\"\206<\311\314\"\206<\311\315\"\206<\311\316\"\211\262\203w@\211\317\267\210\202\320@\314=\"B\262\210\202\321!B\262\210\202\322!B\266\202\202\210\202\323!\323!\323!\305\300\324\325#8\257\207" [zenscript--require-token T_ZEN_CLASS "zenClass expected" T_ID "identifier expected" 2 T_AOPEN "{ expected" nil zenscript--optional-token T_VAL T_VAR T_STATIC T_ZEN_CONSTRUCTOR T_FUNCTION #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_STATIC 75 T_VAR 75 T_VAL 75 T_ZEN_CONSTRUCTOR 92 T_FUNCTION 104)) zenscript--parse-zenclass-field zenscript--parse-zenclass-constructor zenscript--parse-zenclass-method reverse T_ACLOSE "} expected"] 17 (#$ . 18008)]) #@375 Parse a field definition of a ZenClass from TOKENS. A list of the form: (name type init static) name: The token that is the name of this field. type: The ZenType of the field. init: The expression by which this field is initialized. static: t if the field is static, nil otherwise. STATIC should be true if the class field is static. (fn TOKENS STATIC) (defalias 'zenscript--parse-zenclass-field #[514 "\300\301\302#\303\304\"\203\305!\202\306\303\307\"\205\310!\300\311\312#\210F\207" [zenscript--require-token T_ID "identifier expected" zenscript--optional-token T_AS zenscript--parse-zentype (C_RAW "any") T_ASSIGN zenscript--parse-expression T_SEMICOLON "; expected"] 9 (#$ . 19448)]) #@400 Parse a constructor definition of a ZenClass from TOKENS. A list of the form: (arguments statements start end) arguments: The list of arguments, as returned by `zenscript--parse-function-arguments'. statements: A list of statements, which are as returned by `zenscript--parse-statement'. start: The position after the opening { end: The position before the closing } (fn TOKENS) (defalias 'zenscript--parse-zenclass-constructor #[257 "\300!\301\302\303\304#8T\305\211\306!\2031\307\310\"\211\205\"\3018\211\262\262\2041\311!B\262\202 \312!F\207" [zenscript--parse-function-arguments 2 zenscript--require-token T_AOPEN "{ expected" nil zenscript--has-next-token zenscript--optional-token T_ACLOSE zenscript--parse-statement reverse] 9 (#$ . 20183)]) #@505 Parse a method definition of a ZenClass from TOKENS. A list of the form: (name arguments type statements start end) name: The token that is the name of this method. arguments: The list of arguments, as returned by `zenscript--parse-function-arguments'. type: The ZenType that the method returns. statements: A list of statements, which are as returned by `zenscript--parse-statement'. start: The position after the opening { end: The position before the closing } (fn TOKENS) (defalias 'zenscript--parse-zenclass-method #[257 "\300\301\302#\303!\304\305\"\203\306!\202\307\310\300\311\312#8T\313\211\314!\203G\304\315\"\211\2057\3108\211\262\262\204G\316!B\262\202!\317!\257\207" [zenscript--require-token T_ID "identifier expected" zenscript--parse-function-arguments zenscript--optional-token T_AS zenscript--parse-zentype (C_RAW "any") 2 T_AOPEN "{ expected" nil zenscript--has-next-token T_ACLOSE zenscript--parse-statement reverse] 13 (#$ . 20978)]) #@2106 Parse the next statement from TOKENS. A list of the form: (type start after . value) type: The type of the statement, see below for possible values. start: The position at which this statement started. after: The position of the next token after this statement, or `point-max'. value: The value of the statement, which varies by type. See below. The following types are possible: S_BLOCK: value: (statements end) statements: A list of statements, which are as returned by `zenscript--parse-statement'. end: The position after the closing } S_RETURN: value: (expression) expression: An expression that is the value of this return statement. See `zenscript--parse-expression'. S_VAR: value: (name type initializer final) name: The token that is the name of this variable. type: The explicit ZenType of this variable. initializer: The expression that initializes this variable. final: t if this variable is final, nil otherwise. S_IF: value: (predicate then else) predicate: The expression that is evaluated to determine whether to evaluate THEN or ELSE. then: The statement to evaluate if predicate is true. else: The statement to evaluate if predicate is false. S_FOR: value: (names expression statement) names: A list of tokens that are bound variables. expression: The expression of what is being iterated over. statement: The expression to run in this for loop. S_WHILE: value: (predicate statement) predicate: The expression to test if the loop should be run. statement: The statement that is run each iteration. S_BREAK: value: () S_CONTINUE: value: () S_EXPRESSION: value: (expression) expression: The expression to evaluate as a statement. See `zenscript--parse-statement'. S_INVALID: value: (message) An invalid expression, something went wrong while parsing. (fn TOKENS) (defalias 'zenscript--parse-statement #[257 "\300!\3012<\211@\211\302\267\202-\303!\210\304\211\305!\2039\306\307\"\211\205*\3108\211\262\262\2049\311!B\262\202\312\313!E\266\202\2029\303!\210\314\300!@\315=?\205V\316!\317\315\320#\210D\2029\303!\210\317\321\322#\304\211\306\323\"\203z\324!\262\306\325\"\203\210\316!\262\317\315\320#\210\326@\327=\257\266\203\2029\303!\210\330\316!\311!\306\331\"\205\266\311!F\2029\303!\210\332\304\211\317\321\322#C\262\204\351\306\333\"\203\343\317\321\322#B\262\202\312\334\262\202\312\313!\266\202\317\335\336#\210\316!\311!F\2029\303!\210\337\316!\311!E\2029\303!\210\317\315\320#\210\340C\2029\303!\210\317\315\320#\210\341C\2029\342\316!\317\315\320#\210D\2620\211;\203G\343D\202H\211\211@\3108\310\300!8\206WdABBB\207" [zenscript--peek-token zenscript-parse-error #s(hash-table size 9 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_AOPEN 15 T_RETURN 68 T_VAL 97 T_VAR 97 T_IF 159 T_FOR 186 T_WHILE 256 T_BREAK 271 T_CONTINUE 286)) zenscript--get-token nil zenscript--has-next-token zenscript--optional-token T_ACLOSE 2 zenscript--parse-statement S_BLOCK reverse S_RETURN T_SEMICOLON zenscript--parse-expression zenscript--require-token "; expected" T_ID "identifier expected" T_AS zenscript--parse-zentype T_ASSIGN S_VAR T_VAL S_IF T_ELSE S_FOR T_COMMA t T_IN "in expected" S_WHILE S_BREAK S_CONTINUE S_EXPRESSION S_INVALID] 12 (#$ . 22002)]) #@1550 Parse the next ZenType from TOKENS. A ZenType is represented as a list of the following format: (category . value) value: The value of the ZenType. What VALUE is depends on the type, described below. category: A symbol, the category of the ZenType. This may be any of those below. The format of VALUE is also written for each entry: C_RAW: (name) A raw type is the simplest possible type. It has one value, its name, a string denoting its fully qualified name, as it may be imported or referenced without import. name: The name of the ZenType. C_FUNCTION: (argument-types return-type) A function type. This is the type of a function object that can be called. argument-types: A list of ZenTypes that are the types of the function arguments. return-type: The ZenType returned by calling this function. C_LIST: (elem-type) A list type. This would be equivalent to java.util.List in Java. elem-type: The ZenType of elements in the list. C_ARRAY: (elem-type) A Java array type. This would be equivalent to elem-type[] in Java. elem-type: The ZenType of elements in the array. C_ASSOCIATIVE: (key-type val-type) A map type. This would be equivalent to java.util.Map in Java. key-type: The ZenType of keys in this map. val-type: The ZenType of values in this map. TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-zentype #[257 "\300!\301@\211\302\267\202\271\266\303\202\304\266\304\202\304\266\305\202\304\266\306\202\304\266\307\202\304\266\310\202\304\266\311\202\304\266\312\202\304\266\313\202\304\266\314\202\304A@\315\316\"\203c\211\317\320\321\322#A@Q\262\202K\323D\266\203\202\304\301\320\324\325#\210\315\326\"\204\232\327!C\262\315\330\"\203\223\327!B\262\202\201\320\326\331#\210\332\333!\327!E\266\203\202\304\334\327!D\262\320\335\336#\266\202\304\337\340\341A@\"\"\266\315\342\"\203\353\315\335\"\203\332\343D\262\202\304\344\327!E\262\320\335\336#\210\202\304\207" [zenscript--get-token nil #s(hash-table size 13 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_ANY 12 T_VOID 18 T_BOOL 24 T_BYTE 30 T_SHORT 36 T_INT 42 T_LONG 48 T_FLOAT 54 T_DOUBLE 60 T_STRING 66 T_ID 72 T_FUNCTION 107 T_SQBROPEN 168)) (C_RAW "any") (C_RAW "void") (C_RAW "bool") (C_RAW "byte") (C_RAW "short") (C_RAW "int") (C_RAW "long") (C_RAW "float") (C_RAW "double") (C_RAW "string") zenscript--optional-token T_DOT "." zenscript--require-token T_ID "identifier expected" C_RAW T_BROPEN "( expected" T_BRCLOSE zenscript--parse-zentype T_COMMA ") expected" C_FUNCTION reverse C_LIST T_SQBRCLOSE "] expected" zenscript--throw-parse-error format "Unknown type: %s" T_SQBROPEN C_ARRAY C_ASSOCIATIVE] 11 (#$ . 25628)]) #@2580 Parse the next expression from TOKENS. An expression is a list of the form: (type . value) type: The type of expression. See below for possible expressions. value: The value of the expression, varies by type. Each layer of `zenscript--parse-` except the last delegates to a layer below. See each layer for details on the possible expression types at each layer. This layer delegates to `zenscript--parse-conditional'. This layer reads the following expressions: (delegated) represents a function call to the next layer (recursive) represents a recursive call T_... represents a token of the type T_... E_ASSIGN: (delegated) | T_ASSIGN | (recursive) v | _ | v ----------------------------------- left | _ | right value: (left right) E_OPASSIGN: (delegated) | T_PLUSASSIGN | (recursive) v | O_PLUS | v ----------------------------------------- (delegated) | T_MINUSASSIGN | (recursive) v | O_MINUS | v ----------------------------------------- (delegated) | T_TILDEASSIGN | (recursive) v | O_TILDE | v ----------------------------------------- (delegated) | T_MULASSIGN | (recursive) v | O_MUL | v ----------------------------------------- (delegated) | T_DIVASSIGN | (recursive) v | O_DIV | v ----------------------------------------- (delegated) | T_MODASSIGN | (recursive) v | O_MOD | v ----------------------------------------- (delegated) | T_ORASSIGN | (recursive) v | O_OR | v ----------------------------------------- (delegated) | T_ANDASSIGN | (recursive) v | O_AND | v ----------------------------------------- (delegated) | T_XORASSIGN | (recursive) v | O_XOR | v ----------------------------------------- (delegated) | T_PLUSASSIGN | (recursive) v | O_PLUS | v ----------------------------------------- left | op | right value: (left right op) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-expression #[257 "\300!\301\204 \302\303\301\"\210\304!\262\300!\204\302\303\301\"\210\300!@\211\305\267\202\274\306!\210\307\310!E\202\275\306!\210\311\312\310!F\202\275\306!\210\311\313\310!F\202\275\306!\210\311\314\310!F\202\275\306!\210\311\315\310!F\202\275\306!\210\311\316\310!F\202\275\306!\210\311\317\310!F\202\275\306!\210\311\320\310!F\202\275\306!\210\311\321\310!F\202\275\306!\210\311\322\310!F\202\275\301\262\206\303\211\207" [zenscript--peek-token nil zenscript--throw-parse-error "Unexpected end of file" zenscript--parse-conditional #s(hash-table size 10 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_ASSIGN 39 T_PLUSASSIGN 53 T_MINUSASSIGN 68 T_TILDEASSIGN 83 T_MULASSIGN 98 T_DIVASSIGN 113 T_MODASSIGN 128 T_ORASSIGN 143 T_ANDASSIGN 158 T_XORASSIGN 173)) zenscript--get-token E_ASSIGN zenscript--parse-expression E_OPASSIGN ADD SUB CAT MUL DIV MOD OR AND XOR] 9 (#$ . 28595)]) #@722 Possibly read a conditional expression from TOKENS. This layer delegates to `zenscript--parse-or-or'. This layer reads the following expressions: (delegated) represents a function call to the next layer (recursive) represents a recursive call T_... represents a token of the type T_... E_CONDITIONAL: (delegated) | T_QUEST | (delegated) | T_COLON | (recursive) v | _ | v | v | v ----------------------------------------------------------- predicate | _ | then | _ | else value: (predicate then else) ?: (delegated) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-conditional #[257 "\300!\301\302\"\211\203\303\300!\304\305\306#\210\307!F\207\207" [zenscript--parse-or-or zenscript--optional-token T_QUEST E_CONDITIONAL zenscript--require-token T_COLON ": expected" zenscript--parse-conditional] 10 (#$ . 32192)]) #@313 Convenience function for the binary expressions below. TOKEN-TYPE is the token representing this operation. EXPRESSION-TYPE is the type of the expression that may be parsed. TOKENS is the tokenstream to read from. PARSE-NEXT is the function to delegate to. (fn TOKEN-TYPE EXPRESSION-TYPE TOKENS PARSE-NEXT) (defalias 'zenscript--parse-binary #[1028 "\211!\300\"\203!E\262\202\207" [zenscript--optional-token] 9 (#$ . 33209)]) #@362 Possibly read an expression using ||s from TOKENS. Delegates to `zenscript--parse-and-and' Reads: E_OR2: (recursive) | T_OR2 | (delegated) v | | v --------------------------------- left | _ | right value: (left right) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-or-or #[257 "\300\301\302\303$\207" [zenscript--parse-binary T_OR2 E_OR2 zenscript--parse-and-and] 6 (#$ . 33659)]) #@364 Possibly read an expression using &&s from TOKENS. Delegates to `zenscript--parse-or' Reads: E_AND2: (recursive) | T_AND2 | (delegated) v | | v --------------------------------- left | _ | right value: (left right) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-and-and #[257 "\300\301\302\303$\207" [zenscript--parse-binary T_AND2 E_AND2 zenscript--parse-or] 6 (#$ . 34172)]) #@346 Possibly read an expression using |s from TOKENS. Delegates to `zenscript--parse-xor' Reads: E_OR (recursive) | T_OR | (delegated) v | | v --------------------------------- left | _ | right value: (left right) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-or #[257 "\300\301\302\303$\207" [zenscript--parse-binary T_OR E_OR zenscript--parse-xor] 6 (#$ . 34686)]) #@353 Possibly read an expression using ^s from TOKENS. Delegates to `zenscript--parse-and' Reads: E_XOR (recursive) | T_XOR | (delegated) v | | v --------------------------------- left | _ | right value: (left right) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-xor #[257 "\300\301\302\303$\207" [zenscript--parse-binary T_XOR E_XOR zenscript--parse-and] 6 (#$ . 35174)]) #@360 Possibly read an expression using &s from TOKENS. Delegates to `zenscript--parse-comparison' Reads: E_AND (recursive) | T_AND | (delegated) v | | v --------------------------------- left | _ | right value: (left right) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-and #[257 "\300\301\302\303$\207" [zenscript--parse-binary T_AND E_AND zenscript--parse-comparison] 6 (#$ . 35672)]) #@1287 Possibly read a comparison expression from TOKENS. Delegates to `zenscript--parse-add' Reads: E_COMPARE: (delegated) | T_NOTEQ | (delegated) v | C_EQ | v ----------------------------------- (delegated) | T_LT | (delegated) v | C_NE | v ----------------------------------- (delegated) | T_LTEQ | (delegated) v | C_LT | v ----------------------------------- (delegated) | T_GT | (delegated) v | C_LE | v ----------------------------------- (delegated) | T_GTEQ | (delegated) v | C_GT | v ----------------------------------- (delegated) | T_EQ | (delegated) v | C_GE | v ----------------------------------- left | op | right value: (left right op) E_BINARY: (delegated) | T_IN | (delegated) v | O_CONTAINS | v -------------------------------------- left | op | right value: (left right op) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-comparison #[257 "\300!\301!@\211\302\267\2026\303\2027\304\2027\305\2027\306\2027\307\2027\310\2027\311\312!\210\300!\313F\262\314\2027\314\262\211\203I\315\312!\210\300!F\207\207" [zenscript--parse-add zenscript--peek-token #s(hash-table size 7 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_EQ 13 T_NOTEQ 17 T_LT 21 T_LTEQ 25 T_GT 29 T_GTEQ 33 T_IN 37)) C_EQ C_NE C_LT C_LE C_GT C_GE E_BINARY zenscript--get-token O_CONTAINS nil E_COMPARE] 7 (#$ . 36185)]) #@657 Possibly read an addition-priority expression from TOKENS. Delegates to `zenscript--parse-mul' Reads: E_BINARY: (delegated) | T_MINUS | (delegated) v | O_ADD | v ----------------------------------- (delegated) | T_TILDE | (delegated) v | O_SUB | v ----------------------------------- (delegated) | T_PLUS | (delegated) v | O_CAT | v ----------------------------------- left | op | right value: (left right op) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-add #[257 "\300!\301\302\"\203\303\300!\304F\211\262\202@\301\305\"\203+\303\300!\306F\211\262\202@\301\307\"\203?\303\300!\310F\211\262\202@\311\204\207" [zenscript--parse-mul zenscript--optional-token T_PLUS E_BINARY O_ADD T_MINUS O_SUB T_TILDE O_CAT nil] 6 (#$ . 38007)]) #@645 Possibly read an multiplication-priority expression from TOKENS. Delegates to `zenscript--parse-unary' Reads: E_BINARY: (delegated) | T_MUL | (delegated) v | O_MUL | v --------------------------------- (delegated) | T_DIV | (delegated) v | O_DIV | v --------------------------------- (delegated) | T_MOD | (delegated) v | O_MOD | v --------------------------------- left | op | right value: (left right op) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-mul #[257 "\300!\301\302\"\203\303\300!\304F\211\262\202@\301\305\"\203+\303\300!\306F\211\262\202@\301\307\"\203?\303\300!\310F\211\262\202@\311\204\207" [zenscript--parse-unary zenscript--optional-token T_MUL E_BINARY O_MUL T_DIV O_DIV T_MOD O_MOD nil] 6 (#$ . 38995)]) #@402 Possibly read a unary expression from TOKENS. Delegates to `zenscript--parse-postfix' Reads: E_UNARY: T_NOT | (recursive) O_NOT | v --------------------- T_MINUS | (recursive) O_MINUS | v --------------------- op | expr value: (expr op) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-unary #[257 "\300!@\211\301\267\202 \302\303!\210\304!\305E\207\302\303!\210\304!\306E\207\307!\207" [zenscript--peek-token #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_NOT 10 T_MINUS 21)) E_UNARY zenscript--get-token zenscript--parse-unary O_NOT O_MINUS zenscript--parse-postfix] 5 (#$ . 39968)]) #@26 Increment VAL. (fn VAL) (defalias 'zenscript--++ '(macro . #[257 "\300\301DE\207" [setq 1+] 5 (#$ . 40751)])) #@35 Increment VAL by BY. (fn VAL BY) (defalias 'zenscript--+= '(macro . #[514 "\300\301EE\207" [setq +] 7 (#$ . 40870)])) #@1842 Unescape the string token TOKEN, i.e. get the value it represents. unescape_perl_string()

Tom Christiansen Sun Nov 28 12:55:24 MST 2010

It's completely ridiculous that there's no standard unescape_java_string function. Since I have to do the damn thing myself, I might as well make it halfway useful by supporting things Java was too stupid to consider in strings:

=> "?" items are additions to Java string escapes but normal in Java regexes

=> "!" items are also additions to Java regex escapes

Standard singletons: ?\a ?\e \f \n \r \t

NB: \b is unsupported as backspace so it can pass-through to the regex translator untouched; I refuse to make anyone doublebackslash it as doublebackslashing is a Java idiocy I desperately wish would die out. There are plenty of other ways to write it:

\cH, \12, \012, \x08 \x{8}, \u0008, \U00000008

Octal escapes: \0 \0N \0NN \N \NN \NNN Can range up to !\777 not \377

TODO: add !\o{NNNNN} last Unicode is 4177777 maxint is 37777777777

Control chars: ?\cX Means: ord(X) ^ ord('@')

Old hex escapes: \xXX unbraced must be 2 xdigits

Perl hex escapes: !\x{XXX} braced may be 1-8 xdigits NB: proper Unicode never needs more than 6, as highest valid codepoint is 0x10FFFF, not maxint 0xFFFFFFFF

Lame Java escape: \[IDIOT JAVA PREPROCESSOR]uXXXX must be exactly 4 xdigits;

I can't write XXXX in this comment where it belongs because the damned Java Preprocessor can't mind its own business. Idiots!

Lame Python escape: !\UXXXXXXXX must be exactly 8 xdigits

TODO: Perl translation escapes: \Q \U \L \E \[IDIOT JAVA PREPROCESSOR]u \l These are not so important to cover if you're passing the result to Pattern.compile(), since it handles them for you further downstream. Hm, what about \[IDIOT JAVA PREPROCESSOR]u? (fn TOKEN) (defalias 'zenscript--unescape-string-token #[257 "\3001\337\211A@\301\302O\303\211\304\211GW\203\314H\2043\211\305=\203(\306\262\210\202\305\307!B\262\210\202\305\211\310\267\202\265\311B\262\202\301\312B\262\202\301\313B\262\202\301\314B\262\202\301\315B\262\202\301\316B\262\202\301\317B\262\202\301\320B\262\202\301\307!B\262\202\301T\262\307\321H\322\"!B\262\202\301\211\323=\204\241S\262TG=\203\261\324B\262\202\301T\262\304\211\211\325W\203\361\\G=\203\315\325\262\202\352\\H\211\323W\204\337\211\326V\203\345\266\325\202\352T\262\210\211T\262\202\267\327\211\\O\330\"\307!B\262S\\\262\266\202\301T\262\303\304H\331=\203$T\262\306\262\211\330W\203U\204:\211\332=\203:\330\262\202N\\H\203M\211\333=\203M\330\262\210\211T\262\202$\327\211\\O\334\"\307!B\262\210\203p\211T\262S\\\262\266\202\301T\262\327\211\335\\O\334\"\307!B\262\210\335\\\262\202\301T\262\327\211\330\\O\334\"\307!B\262\210\330\\\262\202\301\311B\262\307!B\262\303\262\210\211T\262\202 \203\325\311B\262\336\337\340!\"\266\2040\207\341\342\"\207" [(args-out-of-range) 1 -1 nil 0 92 t char-to-string #s(hash-table size 24 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (92 57 114 65 110 73 102 81 98 89 116 97 97 105 101 113 34 121 39 121 99 131 57 151 56 151 55 151 54 151 53 151 52 151 51 151 50 151 49 151 48 151 120 270 117 379 85 408)) "\\" " " "\n" "\f" "\\b" " " "" "" logxor 64 48 "" 3 55 string-to-number 8 123 2 125 16 4 apply concat reverse zenscript--throw-parse-error "Error parsing string"] 13 (#$ . 41000)]) #@2503 Possibly read a postfix expression from TOKENS. Delegates to `zenscript--parse-primary' (expression) represents a call to `zenscript--parse-expression' (zentype) represents a call to `zenscript--parse-zentype' Reads: E_MEMBER: (recursive) | T_DOT | T_ID v | _ | (cadr v) ---------------------------------------------------------- (recursive) | T_DOT | T_VERSION v | _ | (cadr v) ---------------------------------------------------------- (recursive) | T_DOT | T_STRING v | _ | (zenscript--unescape-string-token v) ---------------------------------------------------------- base | _ | member value: (base member) E_BINARY: (recursive) | T_DOT2 | (expression) v | _ | v ----------------------------------- (recursive) | T_ID* | (expression) v | _ | v *only if (string= (cadr v) "to") ----------------------------------- from | _ | to value: (from to 'O_RANGE) E_INDEX: (recursive) | T_SQBROPEN | (expression) | T_SQBRCLOSE v | _ | v | _ ----------------------------------------------------- base | _ | index | _ value: (base index) E_INDEX_SET: E_INDEX | T_ASSIGN | (expression) _ | _ | v --------------------------------- _ | _ | val A T_ASSIGN following an E_INDEX becomes an E_INDEX_SET. value: (base index val) E_CALL: (recursive) | T_BROPEN | [(expression) | ... T_COMMA] | T_BRCLOSE v | _ | v | _ ----------------------------------------------------------------- base | _ | args | _ value: (base args) E_CAST: (recursive) | T_AS | (zentype) v | _ | v ------------------------------ base | _ | type value: (base type) E_INSTANCEOF: (recursive) | T_INSTANCEOF | (zentype) v | _ | v -------------------------------------- base | _ | type value: (base type) TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-postfix #[257 "\300!\301!\203\363\302\303\"\2038\302\304\"\206\302\305\"\306\203'A@\202/\307\310\311\312#!E\211\262\262\202\360\302\313\"\204Y\301!\211@\304=\205T\211A@\314\230\205T\315!\262\203a\316\317!\320F\207\302\321\"\203\217\317!\310\322\323#\210\302\324\"\203\203\325\317!F\202\207\326E\211\262\262\202\360\302\327\"\203\311\330\302\331\"\204\273\317!C\262\302\332\"\203\265\317!B\262\202\244\310\331\333#\210\334\335!E\211\262\262\202\360\302\336\"\203\334\337\340!E\211\262\202\360\302\341\"\203\357\342\340!E\211\262\202\360\330\204\207" [zenscript--parse-primary zenscript--peek-token zenscript--optional-token T_DOT T_ID T_VERSION E_MEMBER zenscript--unescape-string-token zenscript--require-token T_STRINGVALUE "identifier or string expected" T_DOT2 "to" zenscript--get-token E_BINARY zenscript--parse-expression O_RANGE T_SQBROPEN T_SQBRCLOSE "] expected" T_ASSIGN E_INDEX_SET E_INDEX T_BROPEN nil T_BRCLOSE T_COMMA ") expected" E_CALL reverse T_AS E_CAST zenscript--parse-zentype T_INSTANCEOF E_INSTANCEOF] 10 (#$ . 44535)]) #@73 Convert STRING to a number as java.lang.Long#decode would. (fn STRING) (defalias 'zenscript--decode-long #[257 "\211\300\230\203\301\207\302\301\303\301H\304=\203\305\262\306\262\202(\301H\307=\203(T\262\310\211\311\\\312\301\311\305&\305=\203D\313\262\311\\\262\202s\310\211T\314\301\306&\305=\203]\313\262T\262\202s\310\211T\315\301\306&\305=\203s\316\262T\262\317\303O\"\203\201\211[\207\207" ["" 0 10 nil 45 t 1 43 compare-strings 2 "0x" 16 "#" "0" 8 string-to-number] 12 (#$ . 48189)]) #@2767 Read a primary expression from TOKENS. This is the last layer and does not delegate. Reads: E_VALUE: _ | T_INTVALUE E_INT | (zenscript--decode-long (cadr v)) ---------|------------------------------------- _ | T_FLOATVALUE E_FLOAT | (string-to-number (cadr v)) ---------|------------------------------------- _ | T_STRINGVALUE E_STRING | (zenscript--unescape-string-token v) ---------|------------------------------------- type | val value: (type val double-length?) double-length: If type is E_STRING, this is not present. If type is E_INT or E_FLOAT, this it t if a double-length Java primitive is represented here (long, double), and nil otherwise. E_VARIABLE: T_ID (cadr v) -------- name value: (name) E_FUNCTION: T_FUNCTION | T_BROPEN | [T_ID | [T_AS (zentype)]? | ... T_COMMA] | T_BRCLOSE | [T_AS (zentype)]? | T_AOPEN | ... | T_ACLOSE An anonymous function. value: (arguments return-type statements start end) arguments: A list of arguments, as returned by `zenscript--parse-function-arguments'. name: The name of the argument, a string. type: The ZenType of the argument. pos: The pointer position the identifier token appeared at. start: The position after the opening { end: The position before the closing } return-type: The ZenType that this function returns. statements: A list of statements that are the function body. E_BRACKET: T_LT | ... | T_GT value: (tokens) tokens: A list of tokens that make up the bracket. E_LIST: T_SQBROPEN | [(expression) | ... T_COMMA] | T_SQBRCLOSE value: (elements) elements: A list of expressions that make up this list literal. E_MAP: T_AOPEN | [(expression) | T_COLON | (expression) | ... T_COMMA] | T_ACLOSE value: (keys values) keys: A list of expressions that are the keys of the map. values: A list of expressions that are the values of the map. The length of these two lists are the same, with each index of KEYS corresponding to the entry at the same index in VALUES. E_BOOL: T_TRUE t ------- T_FALSE () ------- val value: (val) val: t if the boolean is TRUE, nil otherwise. E_NULL: T_NULL _ ------ _ value: () TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-primary #[257 "\300!@\211\301\267\202z\302\303!A@!\304\305\211\306\307\310\"SV\206%\306\307\310\"[WED\207\303!A@\311!\211GSH\304\312\313=\206A\314=?ED\207\304\315\316\303!!DD\207\317\303!A@D\207\303!\210\320!\321\322\"\203k\323!\202l\324\307\325\326\327#8T\330\211\331!\203\235\321\332\"\211\205\215\3078\211\262\262\204\235\333!B\262\202w\334\335!\257\207\303!\210\330\211\331!\203\315\321\336\"\204\315\303!\211\262\203\315\211B\262\202\257\337\335!D\207\303!\210\330\321\340\"\204\330\211\204\321\340\"\204\341!B\262\321\342\"\204\340\325\340\343#\210\344\262\202\340\210\345\335!D\207\303!\210\330\321\332\"\204L\330\211\204K\321\332\"\204K\341!B\262\325\346\347#\210\341!B\262\321\342\"\204\325\332\350#\210\344\262\202\210\351\335!\335\330!E\207\303!\210\352\344D\207\303!\210\352\330D\207\303!\210\353C\207\303!\210\341!\325\354\355#\210\207\356\357\303!\"\207" [zenscript--peek-token #s(hash-table size 12 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (T_INTVALUE 10 T_FLOATVALUE 40 T_STRINGVALUE 69 T_ID 79 T_FUNCTION 87 T_LT 169 T_SQBROPEN 211 T_AOPEN 268 T_TRUE 341 T_FALSE 349 T_NULL 357 T_BROPEN 364)) zenscript--decode-long zenscript--get-token E_VALUE E_INT expt 2 31 string-to-number E_FLOAT 12 70 E_STRING zenscript--unescape-string-token E_VARIABLE zenscript--parse-function-arguments zenscript--optional-token T_AS zenscript--parse-zentype (C_RAW "any") zenscript--require-token T_AOPEN "{ expected" nil zenscript--has-next-token T_ACLOSE zenscript--parse-statement E_FUNCTION reverse T_GT E_BRACKET T_SQBRCLOSE zenscript--parse-expression T_COMMA "] or , expected" t E_LIST T_COLON ": expected" "} or , expected" E_MAP E_BOOL E_NULL T_BRCLOSE ") expected" zenscript--throw-parse-error "Invalid expression"] 13 (#$ . 48729)]) #@334 Parse the next global definition from TOKENS. Return a list of the form: (name type value) name: The token that is the name of this binding. type: The ZenType of this binding. value: The expression that is the initializer of this binding. TOKENS must be a tokenstream from `zenscript--make-tokenstream'. (fn TOKENS) (defalias 'zenscript--parse-global #[257 "\300!\210\301\302\303#\304\305\"\203\306!\202\307\301\310\311#\210\312!\301\313\314#\210E\207" [zenscript--get-token zenscript--require-token T_ID "Global value requires a name!" zenscript--optional-token T_AS zenscript--parse-zentype (C_RAW "any") T_ASSIGN "Global values have to be initialized!" zenscript--parse-expression T_SEMICOLON "; expected"] 8 (#$ . 53396)]) (provide 'zenscript-parser)