From 1ca4ac2b7918e156c05b5d49241fa37d5d4a4c9c Mon Sep 17 00:00:00 2001 From: Emin Arslan Date: Sun, 17 May 2026 20:04:20 +0300 Subject: [PATCH] parser: fix bug where strings were always uppercased instead of symbols. --- lib/parser/parse.mly | 4 ++-- lib/vm/vm.ml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/parser/parse.mly b/lib/parser/parse.mly index 91969bc..297b098 100644 --- a/lib/parser/parse.mly +++ b/lib/parser/parse.mly @@ -23,8 +23,8 @@ prog: expr: | i = INT { LInt i } | d = DOUBLE { LDouble d} - | s = SYM { LSymbol s } - | s = STR { LString (String.uppercase_ascii s) } + | s = SYM { LSymbol (String.uppercase_ascii s) } + | s = STR { LString s} | LPAREN; l = lisp_list_rest { l } | QUOTE; e = expr { LCons (LSymbol "quote", LCons (e, LNil)) } ; diff --git a/lib/vm/vm.ml b/lib/vm/vm.ml index 3c4ae90..6690121 100644 --- a/lib/vm/vm.ml +++ b/lib/vm/vm.ml @@ -52,7 +52,7 @@ let rec do_apply state arg_count = | _ -> failwith "Cannot apply non-closure object" and interpret state = - trace state; + (*trace state; (* For debug use *)*) let i = state.i in state.i <- i + 1; (match state.instrs.(i) with