Skip to content

Commit

Permalink
feat(library/init/lean/parser/syntax): Syntax.hasMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Apr 1, 2019
1 parent fc20c1f commit 89a607d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/init/lean/parser/syntax.lean
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ def getPos (stx : Syntax) : Option Parsec.Position :=
do i ← stx.getHeadInfo,
pure i.pos

partial def hasMissing : Syntax → Bool
| missing := true
| (rawNode n) := n.args.foldl (λ s r, hasMissing s || r) false
| _ := false

def reprintAtom : SyntaxAtom → String
| ⟨some info, s⟩ := info.leading.toString ++ s ++ info.trailing.toString
| ⟨none, s⟩ := s
Expand Down

0 comments on commit 89a607d

Please sign in to comment.