1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 14:11:33 +03:00

Construct object literals.

This commit is contained in:
Rob Rix 2016-08-25 18:13:50 -04:00
parent e0b8c126ce
commit 75c120fad7

View File

@ -149,6 +149,7 @@ javascriptTermConstructor source sourceSpan name range children = withDefaultInf
("var_declaration", _) -> S.Indexed $ toVarDecl <$> children
("switch_statement", (expr:rest)) -> S.Switch expr rest
("case", [ expr, body ]) -> S.Case expr body
("object", _) -> S.Object $ foldMap toTuple children
(_, []) -> S.Leaf . toText $ slice range source
_ -> S.Indexed children
where withDefaultInfo = pure . cofree . ((range .: categoryForJavaScriptProductionName name .: RNil) :<)