parser: fix bug where strings were always uppercased instead of symbols.
This commit is contained in:
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user