chore: make Syntax.getArg(s) panic
This commit is contained in:
parent
eb5a171764
commit
4768ac2fbc
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue