mirror of
https://github.com/github/semantic.git
synced 2025-01-01 19:55:34 +03:00
Add Yield term constructor support for JavaScript
This commit is contained in:
parent
859820cfb2
commit
a0fb4e75a7
@ -103,6 +103,8 @@ termConstructor source sourceSpan name range children
|
||||
_ -> S.Export (Just statements) []
|
||||
("export_statement", _ ) -> S.Error children
|
||||
("break_statement", [ expr ] ) -> S.Break expr
|
||||
("yield_statement", [ expr ] ) -> S.Yield (Just expr)
|
||||
("yield_statement", [ ] ) -> S.Yield Nothing
|
||||
_ | name `elem` forStatements -> case unsnoc children of
|
||||
Just (exprs, body) -> S.For exprs [body]
|
||||
_ -> S.Error children
|
||||
@ -196,4 +198,5 @@ categoryForJavaScriptProductionName name = case name of
|
||||
"export_statement" -> Export
|
||||
"break_statement" -> Break
|
||||
"continue_statement" -> Continue
|
||||
"yield_statement" -> Yield
|
||||
_ -> Other name
|
||||
|
Loading…
Reference in New Issue
Block a user