Skip to content

Commit

Permalink
chore: use function instead of explicit loop
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Feb 20, 2024
1 parent cc3583d commit 760d9b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Lean/Parser/Module.lean
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ private partial def mkErrorMessage (c : InputContext) (pos : String.Pos) (stk :
where
-- Error recovery might lead to there being some "junk" on the stack
lastTrailing (s : SyntaxStack) : Option Substring :=
if s.size < 1 then none
else if let .original (trailing := trailing) .. := s.back.getTailInfo then some trailing
else lastTrailing s.pop
s.toSubarray.findSomeRevM? (m := Id) fun stx =>
if let .original (trailing := trailing) .. := stx.getTailInfo then pure (some trailing)
else none

def parseHeader (inputCtx : InputContext) : IO (Syntax × ModuleParserState × MessageLog) := do
let dummyEnv ← mkEmptyEnvironment
Expand Down

0 comments on commit 760d9b0

Please sign in to comment.