chore: make Syntax.getArg(s) panic

This commit is contained in:
Sebastian Ullrich 2020-08-19 14:59:18 +02:00 committed by Leonardo de Moura
parent eb5a171764
commit 4768ac2fbc

View file

@ -223,12 +223,12 @@ def isOfKind : Syntax → SyntaxNodeKind → Bool
def getArg (stx : Syntax) (i : Nat) : Syntax :=
match stx with
| Syntax.node _ args => args.get! i
| _ => arbitrary _
| _ => panic! "Syntax.getArg: not a node"
def getArgs (stx : Syntax) : Array Syntax :=
match stx with
| Syntax.node _ args => args
| _ => #[]
| _ => panic! "Syntax.getArgs: not a node"
/-- Retrieve the left-most leaf's info in the Syntax tree. -/
partial def getHeadInfo : Syntax → Option SourceInfo