feat: add noncomputable section parser
This commit is contained in:
parent
0ade9ee39b
commit
55db56f80d
2 changed files with 3 additions and 0 deletions
|
|
@ -26,6 +26,8 @@ structure Scope where
|
|||
varDecls : Array Syntax := #[]
|
||||
/-- Globally unique internal identifiers for the `varDecls` -/
|
||||
varUIds : Array Name := #[]
|
||||
/-- noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
|
||||
isNoncomputable : Bool := false
|
||||
deriving Inhabited
|
||||
|
||||
structure State where
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ def «structure» := leading_parser
|
|||
@[builtinCommandParser] def declaration := leading_parser
|
||||
declModifiers false >> («abbrev» <|> «def» <|> «theorem» <|> «constant» <|> «instance» <|> «axiom» <|> «example» <|> «inductive» <|> classInductive <|> «structure»)
|
||||
@[builtinCommandParser] def «deriving» := leading_parser "deriving " >> "instance " >> derivingClasses >> " for " >> sepBy1 ident ", "
|
||||
@[builtinCommandParser] def noncomputableSection := leading_parser "noncomputable " >> "section " >> optional ident
|
||||
@[builtinCommandParser] def «section» := leading_parser "section " >> optional ident
|
||||
@[builtinCommandParser] def «namespace» := leading_parser "namespace " >> ident
|
||||
@[builtinCommandParser] def «end» := leading_parser "end " >> optional ident
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue