diff options
| author | Arun Isaac | 2025-12-17 21:37:57 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-12-17 22:26:38 +0000 |
| commit | cf91c081404cc2fc06677840a02b1bb84cffacbe (patch) | |
| tree | 73bd0639dd5cc692dbcce864a5ec7be2b958a70e | |
| parent | 72d0fa2f7e5e1fe77e506533ccfd880fd0f23b6f (diff) | |
| download | ravanan-cf91c081404cc2fc06677840a02b1bb84cffacbe.tar.gz ravanan-cf91c081404cc2fc06677840a02b1bb84cffacbe.tar.lz ravanan-cf91c081404cc2fc06677840a02b1bb84cffacbe.zip | |
javascript: Do not treat null as a special case.
Restrict parameter reference symbol at the parser level. Do not treat null as a special case. Let it drop to node as a javascript expression.
| -rw-r--r-- | ravanan/javascript.scm | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/ravanan/javascript.scm b/ravanan/javascript.scm index eebf082..5061085 100644 --- a/ravanan/javascript.scm +++ b/ravanan/javascript.scm @@ -70,7 +70,9 @@ (and (or (and (ignore ".") symbol) singleq doubleq index))) (define-peg-pattern parameter-reference all - (and (ignore "$(") symbol (* segment) (ignore ")"))) + (and (ignore "$(") + (or "inputs" "self" "runtime") + (* segment) (ignore ")"))) (define-peg-pattern javascript-subexpression body (and "(" @@ -118,17 +120,6 @@ keys @code{\"inputs\"}, @code{\"self\"} and @code{\"runtime\"}. ;; String literal ((? string? str) str) - ;; Special case for null - (('parameter-reference "null") - (if context - 'null - #~'null)) - ;; Disallow referencing anything other than inputs, self or runtime. - (('parameter-reference (and (not (or "inputs" "self" "runtime")) - symbol) - _ ...) - (user-error "Invalid parameter reference; `~a' unknown" - symbol)) ;; Parse parameter reference. The strange and complex matching pattern for ;; segments accounts for how (ice-9 peg) adds an additional layer of ;; parentheses to the tree when there are 2 or more segments. |
