1
1
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:
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.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