syntactic_ast: fix issue in set! parsing, add set! to the test case.
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
2026-01-07 18:18:38 +03:00
parent e25b6b0b10
commit be81061895
2 changed files with 2 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ and dbg_print_start = function
let def = Parser.parse_str "(define (f) let def = Parser.parse_str "(define (f)
(let ((x 5)) (let ((x 5))
(if t (+ x 1)))) (if t (set! x (+ x 1)))))
(define (f) (define (f)
(define (g y) (* y 2)) (define (g y) (* y 2))
(or (g 5) (g 6))) (or (g 5) (g 6)))

View File

@@ -204,6 +204,7 @@ and builtin_if cons =
exp (If (test, then_branch, else_branch)) exp (If (test, then_branch, else_branch))
and builtin_set cons = and builtin_set cons =
let* cons = sexpr_cdr cons in
let* sym = sexpr_car cons in let* sym = sexpr_car cons in
let* sym = (match sym with let* sym = (match sym with
| LSymbol s -> Ok s | LSymbol s -> Ok s