From a0fb4e75a7060a8fa8ef12c64424b0f176c6d1a1 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Wed, 30 Nov 2016 15:56:57 -0600 Subject: [PATCH] Add Yield term constructor support for JavaScript --- src/Language/JavaScript.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Language/JavaScript.hs b/src/Language/JavaScript.hs index cc9943f30..00ffc0a5e 100644 --- a/src/Language/JavaScript.hs +++ b/src/Language/JavaScript.hs @@ -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