From 6e338215192c26dfb16236398ca8e3762a8d4d0e Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 20 Mar 2025 13:51:28 -0400 Subject: Add logic to open file, lex single character symbols, tests --- src/lex.lisp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/lex.lisp (limited to 'src/lex.lisp') diff --git a/src/lex.lisp b/src/lex.lisp new file mode 100644 index 0000000..ad386ba --- /dev/null +++ b/src/lex.lisp @@ -0,0 +1,52 @@ +(in-package #:lex) + +(defun file->tokens (file) + "Opens FILE and parses returns a list of tokens, or +NIL if the file could not be opened." + + (defun read-tokens (tokens-so-far) + "Collects tokens in FILE into TOKENS-SO-FAR." + (let ((token (read-token))) + (if token + (read-tokens (cons token tokens-so-far)) + (reverse tokens-so-far)))) + + (and (probe-file file) + (with-open-file (*standard-input* file :direction :input) + (read-tokens '())))) + +(defun read-token () + "Reads *STANDARD-INPUT* and returns a token, or nil if the end +of file has been reached. +Whitespace, commas, colons, and parentheses are token delimiters. +Comments start with a semi-colon ';' and all tokens after are ignored." + (let ((chr (read-char *standard-input* nil))) + (cond + ((null chr) chr) + ((whitespace-char-p chr) + (read-token)) + + ((char= chr #\;) + (progn (read-line *standard-input* nil) + (read-token))) + + ((char= chr #\() 'left-paren) + ((char= chr #\)) 'right-paren) + + ((digit-char-p chr) + (read-immediate chr)) + + ((alpha-char-p chr) + (read-identifier chr)) + + (t (error (format nil "~a is not a valid lexical symbol.~%" chr)))))) + +(defun read-immediate (chr) + 'immediate) + +(defun read-identifier (chr) + 'id) + +(defun whitespace-char-p (x) + (or (char= #\space x) + (not (graphic-char-p x)))) -- cgit v1.2.3 From 4d8ffb6a29285f12d9ebd788727d633550510d7f Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 3 Apr 2025 01:07:13 -0400 Subject: Add lexing for immediates, keywords, and associated tests --- src/lex.lisp | 57 +++++++++++++++++++++++++++++++++++++++++++++----------- src/main.lisp | 9 +++++---- src/package.lisp | 3 ++- t/lex.lisp | 46 ++++++++++++++++++++++++++++++++++++--------- 4 files changed, 90 insertions(+), 25 deletions(-) (limited to 'src/lex.lisp') diff --git a/src/lex.lisp b/src/lex.lisp index ad386ba..c6e9cf7 100644 --- a/src/lex.lisp +++ b/src/lex.lisp @@ -1,19 +1,34 @@ (in-package #:lex) +(define-condition invalid-immediate-or-keyword (error) + ((chr :initarg :chr + :initform nil + :reader chr) + (instance :initarg :instance + :initform nil + :reader instance)) + (:report (lambda (condition stream) + (format stream + "Lex failed--encountered ~a while reading ~a." + (chr condition) (instance condition)))) + (:documentation "Dedicated error for immediates/keywords which contain +invalid characters.")) + (defun file->tokens (file) "Opens FILE and parses returns a list of tokens, or NIL if the file could not be opened." - (defun read-tokens (tokens-so-far) - "Collects tokens in FILE into TOKENS-SO-FAR." + (defun read-instr (lst tokens-so-far) + "Collects tokens in FILE into TOKENS-SO-FAR, splitting on a newline." (let ((token (read-token))) - (if token - (read-tokens (cons token tokens-so-far)) - (reverse tokens-so-far)))) + (cond ((null token) (reverse tokens-so-far)) + ((eq token 'nl) + (cons (reverse tokens-so-far) (read-instr nil nil))) + (t (read-instr lst (cons token tokens-so-far)))))) (and (probe-file file) (with-open-file (*standard-input* file :direction :input) - (read-tokens '())))) + (remove nil (read-instr '() '()))))) (defun read-token () "Reads *STANDARD-INPUT* and returns a token, or nil if the end @@ -23,29 +38,49 @@ Comments start with a semi-colon ';' and all tokens after are ignored." (let ((chr (read-char *standard-input* nil))) (cond ((null chr) chr) + + ((char= chr #\linefeed) 'nl) + ((whitespace-char-p chr) (read-token)) ((char= chr #\;) (progn (read-line *standard-input* nil) - (read-token))) + 'nl)) ((char= chr #\() 'left-paren) ((char= chr #\)) 'right-paren) + ((char= chr #\:) 'colon) + ((char= chr #\$) 'dollar) + ((digit-char-p chr) (read-immediate chr)) ((alpha-char-p chr) - (read-identifier chr)) + (read-keyword chr)) (t (error (format nil "~a is not a valid lexical symbol.~%" chr)))))) (defun read-immediate (chr) - 'immediate) + (defun read-immediate-helper (chrs-so-far) + (let ((chr (peek-char nil *standard-input* nil))) + (cond ((and (not (null chr)) (digit-char-p chr)) + (read-immediate-helper (cons (read-char *standard-input* nil) chrs-so-far))) + ((and (not (null chr)) (alpha-char-p chr)) + (error 'invalid-immediate-or-keyword :chr chr :instance "immediate")) + (t (reverse chrs-so-far))))) + (parse-integer (coerce (read-immediate-helper (list chr)) 'string))) -(defun read-identifier (chr) - 'id) +(defun read-keyword (chr) + (defun read-keyword-helper (chrs-so-far) + (let ((chr (peek-char nil *standard-input* nil))) + (cond ((and (not (null chr)) (alpha-char-p chr)) + (read-keyword-helper (cons (read-char *standard-input* nil) chrs-so-far))) + ((and (not (null chr)) (digit-char-p chr)) + (error 'invalid-immediate-or-keyword :chr chr :instance "keyword")) + (t (reverse chrs-so-far))))) + (coerce (read-keyword-helper (list chr)) 'string)) (defun whitespace-char-p (x) (or (char= #\space x) diff --git a/src/main.lisp b/src/main.lisp index 98176ec..f6e5754 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -41,13 +41,14 @@ _/_/ _/_/ " (emit? (not (clingon:getopt cmd :parse)))) (cond ;; complain about num arguments - ((/= (length args) 1) (error "Wrong number of arguments.")) + ((/= (length args) 1) (error "Wrong number of arguments.~%")) ((not (util:asm-extension? file)) - (error "The file is not an asm source code file.")) + (error "The file is not an asm source code file.~%")) (t (let ((tokens (lex:file->tokens file))) (if tokens - (format t "~a" tokens) - (error "The file does not exist, or it could not be opened.")) + (progn (pprint tokens) + (terpri)) + (error "The file does not exist, or it could not be opened.~%")) (format t "Nitimur in Vetitum~%")))))) diff --git a/src/package.lisp b/src/package.lisp index 44399cb..670ed02 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -10,4 +10,5 @@ (:use #:cl) (:export #:file->tokens ;; exported for testing only - #:read-token)) + #:read-token + #:invalid-immediate-or-keyword)) diff --git a/t/lex.lisp b/t/lex.lisp index e210ecb..40698f9 100644 --- a/t/lex.lisp +++ b/t/lex.lisp @@ -14,6 +14,11 @@ (read-this "" (is (not (lex:read-token))))) +(test read-token-reads-nl + (read-this " +" + (is (eq (lex:read-token) 'lex::nl)))) + (test read-token-reads-left-paren (read-this "(" (is (eq (lex:read-token) 'lex::left-paren)))) @@ -22,6 +27,10 @@ (read-this ")" (is (eq (lex:read-token) 'lex::right-paren)))) +(test read-token-reads-left-paren + (read-this "$" + (is (eq (lex:read-token) 'lex::dollar)))) + (test read-token-ignores-space (read-this " (" (is (eq (lex:read-token) 'lex::left-paren)))) @@ -30,16 +39,35 @@ (read-this " (" (is (eq (lex:read-token) 'lex::left-paren)))) -(test read-token-ignores-newline - (read-this " -(" - (is (eq (lex:read-token) 'lex::left-paren)))) - (test read-token-ignores-comment (read-this "; this is a comment (" - (is (eq (lex:read-token) 'lex::left-paren)))) + (is (eq (lex:read-token) 'lex::nl)))) -(test read-token-ignores-comment-eof - (read-this ";" - (is (not (lex:read-token))))) +(test read-token-immediate-zero + (read-this "0" + (is (= (lex:read-token) 0)))) + +(test read-token-immediate-all-digits + (read-this "123456789" + (is (= (lex:read-token) 123456789)))) + +(test read-token-immediate-invalid-immediate + (handler-case + (progn (read-this "0v0" (lex:read-token)) + (fail)) + (lex:invalid-immediate-or-keyword ()))) + +(test read-token-keyword-single + (read-this "a" + (is (string= (lex:read-token) "a")))) + +(test read-token-keyword-add + (read-this "addi" + (is (string= (lex:read-token) "addi")))) + +(test read-token-immediate-invalid-keyword + (handler-case + (progn (read-this "sub0" (lex:read-token)) + (fail)) + (lex:invalid-immediate-or-keyword ()))) -- cgit v1.2.3 From 14d6dd6f18ef8a94da7def84b4c8eb39a37e309c Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 3 Apr 2025 03:17:45 -0400 Subject: Allow lexing of immediates in different bases --- src/lex.lisp | 22 ++++++++++++++++++++-- t/lex.lisp | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) (limited to 'src/lex.lisp') diff --git a/src/lex.lisp b/src/lex.lisp index c6e9cf7..e86d1e9 100644 --- a/src/lex.lisp +++ b/src/lex.lisp @@ -9,7 +9,7 @@ :reader instance)) (:report (lambda (condition stream) (format stream - "Lex failed--encountered ~a while reading ~a." + "LEX failed--encountered ~a while reading ~a." (chr condition) (instance condition)))) (:documentation "Dedicated error for immediates/keywords which contain invalid characters.")) @@ -63,6 +63,9 @@ Comments start with a semi-colon ';' and all tokens after are ignored." (t (error (format nil "~a is not a valid lexical symbol.~%" chr)))))) (defun read-immediate (chr) + "Reads a sequence of digits, in base 2, 8, 10, or 16.. Throws +`invalid-immediate-or-keyword' error if an alphabetic character is encountered." + ;; may be combined with read-keyword-helper (defun read-immediate-helper (chrs-so-far) (let ((chr (peek-char nil *standard-input* nil))) (cond ((and (not (null chr)) (digit-char-p chr)) @@ -70,9 +73,24 @@ Comments start with a semi-colon ';' and all tokens after are ignored." ((and (not (null chr)) (alpha-char-p chr)) (error 'invalid-immediate-or-keyword :chr chr :instance "immediate")) (t (reverse chrs-so-far))))) - (parse-integer (coerce (read-immediate-helper (list chr)) 'string))) + + (let* ((next (peek-char nil *standard-input* nil)) + (radix (cond ((null next) 10) + ((char= next #\b) 2) + ((char= next #\o) 8) + ((char= next #\x) 16) + ((digit-char-p next) 10) + (t nil))) + (arg (list chr))) + (when (and (char= chr #\0) radix (not (= radix 10))) + (read-char *standard-input* nil) + (setq arg '())) + (parse-integer (coerce (read-immediate-helper arg) 'string) :radix radix))) (defun read-keyword (chr) + "Reads a sequence of alphabetic characters. Throws `invalid-immediate-or-keyword' +error if a digit is encountered." + ;; may be combined with read-immediate-helper (defun read-keyword-helper (chrs-so-far) (let ((chr (peek-char nil *standard-input* nil))) (cond ((and (not (null chr)) (alpha-char-p chr)) diff --git a/t/lex.lisp b/t/lex.lisp index 40698f9..ab0ed99 100644 --- a/t/lex.lisp +++ b/t/lex.lisp @@ -52,12 +52,31 @@ (read-this "123456789" (is (= (lex:read-token) 123456789)))) +(test read-token-immediate-binary + (read-this "0b00101010" + (is (= (lex:read-token) 42)))) + +(test read-token-immediate-octal + (read-this "0o052" + (is (= (lex:read-token) 42)))) + +(test read-token-immediate-hexadecimal + (read-this "0x200" + (is (= (lex:read-token) 512)))) + (test read-token-immediate-invalid-immediate (handler-case (progn (read-this "0v0" (lex:read-token)) (fail)) (lex:invalid-immediate-or-keyword ()))) +;; do we want a custom error for this too? +(test read-token-immediate-radix + (handler-case + (progn (read-this "0x" (lex:read-token)) + (fail)) + (sb-int:simple-parse-error ()))) + (test read-token-keyword-single (read-this "a" (is (string= (lex:read-token) "a")))) -- cgit v1.2.3 From 458f25364589979cd9099a9ad5fb89932511e78b Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 3 Apr 2025 03:20:12 -0400 Subject: Fix minor bug --- src/lex.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lex.lisp') diff --git a/src/lex.lisp b/src/lex.lisp index e86d1e9..eea0709 100644 --- a/src/lex.lisp +++ b/src/lex.lisp @@ -79,8 +79,8 @@ Comments start with a semi-colon ';' and all tokens after are ignored." ((char= next #\b) 2) ((char= next #\o) 8) ((char= next #\x) 16) - ((digit-char-p next) 10) - (t nil))) + ((alpha-char-p next) nil) + (t 10))) (arg (list chr))) (when (and (char= chr #\0) radix (not (= radix 10))) (read-char *standard-input* nil) -- cgit v1.2.3 From 4c76966b49e8559f710013463dac04143c1f4e09 Mon Sep 17 00:00:00 2001 From: bd Date: Tue, 8 Apr 2025 00:41:00 -0400 Subject: Add plus and minus symbols to lexer --- input/add-loop.asm | 4 ++-- src/lex.lisp | 3 +++ t/lex.lisp | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/lex.lisp') diff --git a/input/add-loop.asm b/input/add-loop.asm index e24a7e6..6379831 100644 --- a/input/add-loop.asm +++ b/input/add-loop.asm @@ -12,8 +12,8 @@ jrl CHECK LOOP: add $9 $fp $5 - load $7 0($9) - load $8 1($9) + load $7 -0($9) + load $8 +1($9) add $7 $7 $8 store $7 0($9) addi $5 $5 0x1 diff --git a/src/lex.lisp b/src/lex.lisp index eea0709..d5c77a1 100644 --- a/src/lex.lisp +++ b/src/lex.lisp @@ -54,6 +54,9 @@ Comments start with a semi-colon ';' and all tokens after are ignored." ((char= chr #\:) 'colon) ((char= chr #\$) 'dollar) + ((char= chr #\+) 'plus) + ((char= chr #\-) 'minus) + ((digit-char-p chr) (read-immediate chr)) diff --git a/t/lex.lisp b/t/lex.lisp index ab0ed99..dfa632a 100644 --- a/t/lex.lisp +++ b/t/lex.lisp @@ -31,6 +31,14 @@ (read-this "$" (is (eq (lex:read-token) 'lex::dollar)))) +(test read-token-reads-plus + (read-this "+" + (is (eq (lex:read-token) 'lex::plus)))) + +(test read-token-reads-minus + (read-this "-" + (is (eq (lex:read-token) 'lex::minus)))) + (test read-token-ignores-space (read-this " (" (is (eq (lex:read-token) 'lex::left-paren)))) -- cgit v1.2.3 From b85c10ba1c53f1b442fea6bde4c2a2f73cfe5d6b Mon Sep 17 00:00:00 2001 From: bd Date: Tue, 8 Apr 2025 01:56:18 -0400 Subject: Simplify lexer-error handling, skeletion parsing functions for types --- src/lex.lisp | 30 +++++++++++++++--------------- src/package.lisp | 17 ++++++++++------- src/parse.lisp | 42 ++++++++++++++++++++++++++++++++++++++---- src/util.lisp | 32 +++++++++++--------------------- t/lex.lisp | 4 ++-- t/parse.lisp | 14 ++++++++++---- 6 files changed, 86 insertions(+), 53 deletions(-) (limited to 'src/lex.lisp') diff --git a/src/lex.lisp b/src/lex.lisp index d5c77a1..5b1457d 100644 --- a/src/lex.lisp +++ b/src/lex.lisp @@ -1,18 +1,12 @@ (in-package #:lex) -(define-condition invalid-immediate-or-keyword (error) - ((chr :initarg :chr - :initform nil - :reader chr) - (instance :initarg :instance - :initform nil - :reader instance)) +(define-condition lexer-error (error) + ((message :initarg :message + :initform nil + :reader message)) (:report (lambda (condition stream) - (format stream - "LEX failed--encountered ~a while reading ~a." - (chr condition) (instance condition)))) - (:documentation "Dedicated error for immediates/keywords which contain -invalid characters.")) + (format stream "~A" (message condition)))) + (:documentation "Dedicated error for an invalid lex.")) (defun file->tokens (file) "Opens FILE and parses returns a list of tokens, or @@ -63,7 +57,9 @@ Comments start with a semi-colon ';' and all tokens after are ignored." ((alpha-char-p chr) (read-keyword chr)) - (t (error (format nil "~a is not a valid lexical symbol.~%" chr)))))) + (t (error 'lexer-error + :message + (format nil "LEX failled--~a is not a valid lexical symbol.~%" chr)))))) (defun read-immediate (chr) "Reads a sequence of digits, in base 2, 8, 10, or 16.. Throws @@ -74,7 +70,9 @@ Comments start with a semi-colon ';' and all tokens after are ignored." (cond ((and (not (null chr)) (digit-char-p chr)) (read-immediate-helper (cons (read-char *standard-input* nil) chrs-so-far))) ((and (not (null chr)) (alpha-char-p chr)) - (error 'invalid-immediate-or-keyword :chr chr :instance "immediate")) + (error 'lexer-error + :message + (format nil "LEX failed--encountered ~a while reading immediate.~%" chr))) (t (reverse chrs-so-far))))) (let* ((next (peek-char nil *standard-input* nil)) @@ -99,7 +97,9 @@ error if a digit is encountered." (cond ((and (not (null chr)) (alpha-char-p chr)) (read-keyword-helper (cons (read-char *standard-input* nil) chrs-so-far))) ((and (not (null chr)) (digit-char-p chr)) - (error 'invalid-immediate-or-keyword :chr chr :instance "keyword")) + (error 'lexer-error + :message + (format nil "LEX failed--encountered ~a while reading keyword.~%" chr))) (t (reverse chrs-so-far))))) (coerce (read-keyword-helper (list chr)) 'string)) diff --git a/src/package.lisp b/src/package.lisp index d999783..3364856 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1,4 +1,4 @@ -(defpackage #:rva +helper(defpackage #:rva (:use #:cl) (:export #:main)) @@ -6,18 +6,21 @@ (:use #:cl) (:export #:asm-extension? #:format-as-binary - #:label-loc - #:mnemonic-loc)) + #:type-r + #:type-i + #:type-j + #:label-loc)) (defpackage #:lex (:use #:cl) - (:export #:file->tokens + (:export #:lexer-error + #:file->tokens ;; exported for testing only - #:read-token - #:invalid-immediate-or-keyword)) + #:read-token)) (defpackage #:parse (:use #:cl) - (:export #:tokens->ast + (:export #:parser-error + #:tokens->ast ;; exported for testing only #:extract-label)) diff --git a/src/parse.lisp b/src/parse.lisp index 8bd8c50..3052583 100644 --- a/src/parse.lisp +++ b/src/parse.lisp @@ -1,9 +1,20 @@ -(in-package #:parse) +helper(in-package #:parse) + +(define-condition parser-error (error) + ((message :initarg :message + :initform nil + :reader message)) + (:report (lambda (condition stream) + (format stream "~A" (message condition)))) + (:documentation "Dedicated error for an invalid parse.")) (defun tokens->ast (program) - (let ((program (remove nil (mapcar #'extract-label program)))) - ;; TODO - program)) + "Given PROGRAM, which is a list of lists of symbols, +filters out the labels and parses." + ;; TODO add directives + (let ((program (remove nil (mapcar #'extract-label program))) + (i 0)) + (mapcar (lambda (l) (extract-instruction l i)) program))) (let ((i 0)) (defun extract-label (line) @@ -19,3 +30,26 @@ processing." (satisfies (lambda (x) (equal x 'lex::colon)))) (progn (push (cons (read-from-string id) i) util:label-loc) nil)) (_ (progn (incf i) line))))) + +(defun extract-instruction (line i) + "Given instruction LINE, determines the expected type format and passes +LINE and the index I to the the respective function." + ;; TODO add pseudo-ops (i.e., nop, mov, ...) + (let* ((type-map '((r-type . extract-r-type) + (i-type . extract-i-type) + (j-type . extract-j-type))) + (keyword (car line)) + (type-fn (cdr (assoc keyword type-map)))) + (if type-fn + (funcall type-fn line i) + (error 'parser-error + (format nil "PARSE failed--~a is not a known keyword.~%" (keyword)))))) + +(defun extract-r-type (line i) + 'r) + +(defun extract-i-type (line i) + 'i) + +(defun extract-j-type (line i) + 'j) diff --git a/src/util.lisp b/src/util.lisp index 1ea6dfc..5edee4a 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -11,27 +11,17 @@ (declare (type (integer 0 *) len)) (format nil "~V,'0b" len num)) -(defmacro generate-type-map (type opsize ops) - "Generates an alist where the key corresponds to an element in -OPS, while the value is the index of that key (padded to OPSIZE) -concatenated with TYPE." - `(let ((i 0)) - (mapcar (lambda (x) - (incf i) - (cons x (concatenate 'string ,type - (format-as-binary i ,opsize)))) - ,ops))) +(defparameter type-r + '(ADD SUB MUL QUOT REM SFTR SFTL AND OR NOT XOR ADDV SUBV MULV DIVV CMP CEV) + "R-type instructions.") + +(defparameter type-i + '(LOAD LOADV ADDI SUBI SFTRI SFTLI ANDI ORI XORI STORE STOREV) + "I-type instructions.") + +(defparameter type-j + '(JMP JRL JAL BEQ BGT BUF BOF PUSH POP) + "J-type instructions.") (defparameter label-loc '() "A symbol table mapping label names to line indices.") - -(defparameter mnemonic-loc - `(,@(generate-type-map "00" 5 - '(ADD SUB MUL QUOT REM SFTR SFTL AND OR NOT - XOR ADDV SUBV MULV DIVV CMP CEV)) - ,@(generate-type-map "01" 4 - '(LOAD LOADV ADDI SUBI SFTRI SFTLI ANDI ORI - XORI STORE STOREV)) - ,@(generate-type-map "10" 4 - '(JMP JRL JAL BEQ BGT BUF BOF PUSH POP))) - "An alist mapping known mnemonics to their binary representation.") diff --git a/t/lex.lisp b/t/lex.lisp index dfa632a..7a20608 100644 --- a/t/lex.lisp +++ b/t/lex.lisp @@ -76,7 +76,7 @@ (handler-case (progn (read-this "0v0" (lex:read-token)) (fail)) - (lex:invalid-immediate-or-keyword ()))) + (lex:lexer-error ()))) ;; do we want a custom error for this too? (test read-token-immediate-radix @@ -97,4 +97,4 @@ (handler-case (progn (read-this "sub0" (lex:read-token)) (fail)) - (lex:invalid-immediate-or-keyword ()))) + (lex:lexer-error ()))) diff --git a/t/parse.lisp b/t/parse.lisp index 2ab3e76..bd1310f 100644 --- a/t/parse.lisp +++ b/t/parse.lisp @@ -11,10 +11,16 @@ (test extract-label-not-a-label-one (let ((lst '("NICE" "TRY"))) - (is (equal lst - (parse:extract-label lst))))) + (is (equal lst + (parse:extract-label lst))))) (test extract-label-not-a-label-two (let ((lst '("LOOP" lex::colon lex::colon))) - (is (equal lst - (parse:extract-label lst))))) + (is (equal lst + (parse:extract-label lst))))) + +(test extract-line-invalid-type + (handler-case + (progn (parse:tokens->ast '(("foo" LEX::DOLLAR))) + (fail)) + (lex:parser-error ()))) -- cgit v1.2.3