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:
parent
e0b8c126ce
commit
75c120fad7
@ -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) :<)
|
||||
|
Loading…
Reference in New Issue
Block a user