;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'json) (defconst zenscript-mode-syntax-table (byte-code "\300 \301\302\303#\210\301\304\305#\210\301\306\305#\210\301\307\305#\210\301\310\305#\210\301\311\312#\210\301\313\312#\210\301\314\312#\210\301\315\312#\210\301\316\317#\210\301\320\321#\210\301\322\323#\210\301\324\325#\210\301\326\327#\210\301\330\331#\210\301\332\333#\210\301\334\335#\210\301\336\337#\210\301\340\341#\210\301\342\343#\210\301\344\343#\210\301\345\343#\210\301\346\343#\210\301\347\343#\210\301\350\343#\210\301\351\343#\210\301\352\343#\210\301\353\343#\210\301\354\343#\210\301\355\343#\210\301\356\343#\210\301\357\343#\210\301\360\343#\210\301\361\362#\210\301\363\362#\210\207" [make-syntax-table modify-syntax-entry (0 . 127) "_" (48 . 57) "w" (97 . 122) (65 . 90) 95 32 " " 160 9 12 40 "()" 41 ")(" 91 "(]" 93 ")[" 123 "(}" 125 "){" 35 "< b" 47 ". 124b" 10 "> b" 42 ". 23" 61 "." 43 45 37 124 38 94 63 58 126 60 62 33 36 34 "\"" 39] 5)) (defconst zenscript-storage-keywords '("any" "bool" "byte" "short" "int" "long" "float" "double" "string" "void")) (defconst zenscript-constants '("true" "false" "null")) (defconst zenscript-math-operators '(".." "+=" "+" "-=" "-" "*=" "*" "/=" "/" "%=" "%" "|=" "|" "||" "&=" "&&" "&" "^=" "^" "?" ":" "~=" "~" "<=" "<" ">=" ">" "==" "=" "!=" "!" "$")) (defconst zenscript-punctuation (append zenscript-math-operators '(";" ","))) (defconst zenscript-operator-keywords '("in" "has" "as" "instanceof")) (defconst zenscript-var-keywords '("var" "val" "static" "global")) (defconst zenscript-class-keywords '("zenClass" "frigginClass")) (defconst zenscript-function-keywords '("zenConstructor" "frigginConstructor" "function")) (defconst zenscript-preprocessors '("debug" "ignoreBracketErrors" "norun" "loader" "priority" "ikwid" "profile" "zslint" "modloaded")) (defconst zenscript-all-keywords (append zenscript-var-keywords zenscript-function-keywords zenscript-class-keywords zenscript-operator-keywords '("if" "else" "version" "for" "return" "while" "break" "import"))) #@77 The cached data read from /ct dumpzs, or null if it should be recalculated. (defvar zenscript-dumpzs-cache nil (#$ . 2128)) #@57 Parse the contents of /zs dumpzs json at LOC. (fn LOC) (defalias 'zenscript--parse-dumpzs-json #[257 "\300!\207" [json-read-file] 3 (#$ . 2258)]) #@78 Return a predicate which will return non-nil if EL is of type TAG. (fn TAG) (defalias 'zenscript--tag-p #[257 "\300\301\"\207" [make-closure #[257 "\211<\205 \300@=\207" [V0] 3 "\n\n(fn EL)"]] 4 (#$ . 2412)]) #@54 Convert a tag HTML to a list recursively. (fn HTML) (defalias 'zenscript--rewrite-html #[257 "\211<\203\300\301\302\303\304!\"\"\207\207" [mapcar #[257 "\300\301\302!\"\211\203\3038\304\300\301\305!\"!B\207\304\3038!\207" [seq-find zenscript--tag-p label 2 zenscript--rewrite-html ul] 7 "\n\n(fn LI)"] seq-filter zenscript--tag-p li] 6 (#$ . 2631)]) #@235 Thread the expr through the forms. Insert X as the last item in FORM, making a list of it if it is not a list already. If there are MORE, insert the first form as the last item in second form, etc. (fn X &optional FORM &rest MORE) (defalias 'zenscript--->> '(macro . #[641 "\204C\207\211\204<\203\300C\"\207D\207\301\211EBB\207" [append zenscript--->>] 7 (#$ . 2998)])) #@57 Parse the contents of /zs dumpzs html at LOC. (fn LOC) (defalias 'zenscript--parse-dumpzs-html #[257 "\300\301!\2032\302\303\304\"r\211q\210\305\306\"\216\307!\210\301ed\"*\262\310\311\312\313!\311\312\314!\311\312\315!\"\"\"!\207\316\317!\210\320\207" [fboundp libxml-parse-html-region generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents zenscript--rewrite-html seq-find zenscript--tag-p ul div body message "libxml not available, didn't parse /zs dumpzs html" nil] 10 (#$ . 3393)]) #@214 Load the data from /zs dumpzs. LOCATION should be a pair of the form (json-loc . html-loc) json-loc: The location of zs_export.json, or nil. html-loc: The location of tree3.html, or nil. (fn LOCATION) (defalias 'zenscript-calculate-dumpzs-cache #[257 "\211@A\204\f\211\205\205\301!\205\302!B\211\207" [zenscript-dumpzs-cache zenscript--parse-dumpzs-json zenscript--parse-dumpzs-html] 6 (#$ . 3972)]) #@301 Retrieve the data dumped by /ct dumpzs. Returns a pair in the format: (json . html) json: The data parsed from /ct dumpzs json html: The data parsed from /ct dumpzs html If PROMPT is non-nil, the cache may be recalculated, most likely prompting the user for input. (fn &optional PROMPT) (defalias 'zenscript-get-dumpzs #[256 "\206\211\203\301\302 !\206\303\207" [zenscript-dumpzs-cache zenscript-calculate-dumpzs-cache zenscript-get-dumpzs-location (nil)] 3 (#$ . 4405)]) #@132 Resolve /ct dumpzs outpus. If they cannot be found relative to a parent dir containing crafttweaker.log, prompt the user instead. (defalias 'zenscript-get-dumpzs-location #[0 "\300\211\211\301 \211\203!\302\303\"\262\205\304P\262\205\305P\262\203+\306!\204;\30716\310\311!0\2029\300\262\262\203E\306!\204U\3121P\310\313!0\202S\300\262\262\210\205a\306!\205a\205l\306!\205lB\207" [nil buffer-file-name locate-dominating-file "crafttweaker.log" "zs_export.json" "crafttweaker_dump/tree3.html" file-readable-p (quit) read-file-name "Location of /ct dumpzs json: " (quit) "Location of /ct dumpzs html: "] 7 (#$ . 4904)]) #@331 Set the location of /ct dumpzs, used for code completion. LOCATION should be a pair of the form (json-loc . html-loc) json-loc: The location of zs_export.json, or nil. html-loc: The location of tree3.html, or nil. When this is called, the file is loaded to compute the cache, and LOCATION isn't stored. (fn LOCATION) (defalias 'zenscript-set-dumpzs-location #[257 "\300!\207" [zenscript-calculate-dumpzs-cache] 3 (#$ . 5568)]) #@62 Like `(regexp-opt WORDS)`, but wrapping with \b. (fn WORDS) (defalias 'zenscript--word-from #[257 "\300\301!\300Q\207" ["\\b" regexp-opt] 4 (#$ . 6015)]) #@61 Initialize hooks and locals required by `zenscript-common`. (defalias 'zenscript--init-common #[0 "\305\300!\210\306\305\301!\210\307\305\302!\210\310\311 !\210\305\304!\210\312\310!\211\207" [comment-start comment-start-skip comment-multi-line zenscript-mode-syntax-table zenscript-dumpzs-cache make-local-variable "//" "\\(\\(//+\\|#+\\)\\|/\\*+\\)\\s *" t set-syntax-table zenscript-get-dumpzs] 2 (#$ . 6177)]) (provide 'zenscript-common)