Skip to content

Commit

Permalink
Fixed bug in calculation of FileInfo during parsing.
Browse files Browse the repository at this point in the history
Bump version.
  • Loading branch information
CuppoJava committed Oct 13, 2022
1 parent 57798ff commit a322a74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/params.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public defn compiler-flags () :
to-tuple(COMPILE-FLAGS)

;========= Stanza Configuration ========
public val STANZA-VERSION = [0 17 27]
public val STANZA-VERSION = [0 17 28]
public var STANZA-INSTALL-DIR:String = ""
public var OUTPUT-PLATFORM:Symbol = `platform
public var STANZA-PKG-DIRS:List<String> = List()
Expand Down
11 changes: 7 additions & 4 deletions core/parser/engine.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,16 @@ defn interpret (input-form:List,

;Main loop of interpreter
;------------------------


;- info: The most recent file information of the tokens, including
; the upcoming form.
;- form: The next list to parse.
;- upform: The list to resume parsing when we encounter a
; right paren.
;- pc: The next instruction to execute.

defn* loop (info:FileInfo|False, form:List, upform:List<List>, pc:Int) :
; println("%_) %_ (%_) (overlay = %_)" % [pc, opcodes[pc], next-token, overlay?]) where :
defn* loop (info:FileInfo|False, form:List, upform:List<List>, pc:Int) :
; println("%_) %_ (%_) (%_) (overlay = %_)" % [pc, opcodes[pc], next-token, info, overlay?]) where :
; val next-token =
; if empty?(form) : "DONE"
; else if unwrap-token(head(form)) is List : "LPAREN"
Expand Down Expand Up @@ -467,7 +469,8 @@ defn interpret (input-form:List,
if empty?(form) :
pop-frame<ListFrame>()
val form = head(upform)
loop(info, form, tail(upform), pc + 1)
val new-info = new-info(info, form)
loop(new-info, form, tail(upform), pc + 1)
else :
popframe-failure(info, form, upform)

Expand Down

0 comments on commit a322a74

Please sign in to comment.