parser: fix bug where strings were always uppercased instead of symbols.

This commit is contained in:
2026-05-17 20:04:20 +03:00
parent 68b8916d63
commit 1ca4ac2b79
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ prog:
expr: expr:
| i = INT { LInt i } | i = INT { LInt i }
| d = DOUBLE { LDouble d} | d = DOUBLE { LDouble d}
| s = SYM { LSymbol s } | s = SYM { LSymbol (String.uppercase_ascii s) }
| s = STR { LString (String.uppercase_ascii s) } | s = STR { LString s}
| LPAREN; l = lisp_list_rest { l } | LPAREN; l = lisp_list_rest { l }
| QUOTE; e = expr { LCons (LSymbol "quote", LCons (e, LNil)) } | QUOTE; e = expr { LCons (LSymbol "quote", LCons (e, LNil)) }
; ;
+1 -1
View File
@@ -52,7 +52,7 @@ let rec do_apply state arg_count =
| _ -> failwith "Cannot apply non-closure object" | _ -> failwith "Cannot apply non-closure object"
and interpret state = and interpret state =
trace state; (*trace state; (* For debug use *)*)
let i = state.i in let i = state.i in
state.i <- i + 1; state.i <- i + 1;
(match state.instrs.(i) with (match state.instrs.(i) with