1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 04:10:29 +03:00

Add Program syntax wrapper to python too

This commit is contained in:
Timothy Clem 2017-07-21 10:31:57 -07:00
parent dad86d0dd8
commit 34e3dc9965

View File

@ -74,6 +74,7 @@ type Syntax =
, Syntax.Empty
, Syntax.Error
, Syntax.Identifier
, Syntax.Program
, 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 :: Assignment
assignment = makeTerm <$> symbol Module <*> children (many declaration) <|> parseError
assignment =
makeTerm <$> symbol Module <*> children (Syntax.Program <$> many declaration)
<|> parseError
declaration :: Assignment
declaration = classDefinition