mirror of
https://github.com/github/semantic.git
synced 2025-01-04 13:34:31 +03:00
Add Program syntax wrapper to python too
This commit is contained in:
parent
dad86d0dd8
commit
34e3dc9965
@ -74,6 +74,7 @@ type Syntax =
|
|||||||
, Syntax.Empty
|
, Syntax.Empty
|
||||||
, Syntax.Error
|
, Syntax.Error
|
||||||
, Syntax.Identifier
|
, Syntax.Identifier
|
||||||
|
, Syntax.Program
|
||||||
, Type.Annotation
|
, Type.Annotation
|
||||||
, []
|
, []
|
||||||
]
|
]
|
||||||
@ -97,7 +98,9 @@ instance Show1 Redirect where liftShowsPrec = genericLiftShowsPrec
|
|||||||
|
|
||||||
-- | Assignment from AST in Python's grammar onto a program in Python's syntax.
|
-- | Assignment from AST in Python's grammar onto a program in Python's syntax.
|
||||||
assignment :: Assignment
|
assignment :: Assignment
|
||||||
assignment = makeTerm <$> symbol Module <*> children (many declaration) <|> parseError
|
assignment =
|
||||||
|
makeTerm <$> symbol Module <*> children (Syntax.Program <$> many declaration)
|
||||||
|
<|> parseError
|
||||||
|
|
||||||
declaration :: Assignment
|
declaration :: Assignment
|
||||||
declaration = classDefinition
|
declaration = classDefinition
|
||||||
|
Loading…
Reference in New Issue
Block a user