Skip to content

Commit

Permalink
[parser] fix a bug on shadowing de Bruijn indexed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
cannorin committed Jan 28, 2019
1 parent dfa0f9b commit 227314b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/parsedAst.fs
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ module ParserUtils =
| x' -> TmDefer (TimeN 1u, NotTemporalTerm x')
| PTmDeferInf x -> TmDefer (TimeInf, tot stack x |> NotTemporalTerm)
| PTmLet (x, r, b) ->
TmLet (x, r |> tot stack, b |> tot stack)
TmLet (x, r |> tot stack, b |> tot (stack |> List.filter ((<>) x)))
| PTmLetDefer (time, x, r, b) ->
TmDefer (time,
TmLetRun (x, time, r |> tot stack, b |> tot stack) |> sameInfoOf ptm
TmLetRun (x, time, r |> tot stack, b |> tot (stack |> List.filter ((<>) x)))
|> sameInfoOf ptm
)
| PTmOp2 (l, op, r) when ctx |> Context.findConstructor [op] (Some [l; r]) |> Option.isSome ->
TmConstruct ([op], [l; r] |> List.map (tot stack))
Expand Down

0 comments on commit 227314b

Please sign in to comment.