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

Construct variable declarations.

This commit is contained in:
Rob Rix 2016-08-25 18:13:35 -04:00
parent 48fdd44d7c
commit 65b5eaa081

View File

@ -146,6 +146,7 @@ javascriptTermConstructor source sourceSpan name range children = withDefaultInf
("ternary", (condition:cases)) -> S.Ternary condition cases
("arguments", _) -> S.Args children
("var_assignment", [ x, y ]) -> S.VarAssignment x y
("var_declaration", _) -> S.Indexed $ toVarDecl <$> children
(_, []) -> S.Leaf . toText $ slice range source
_ -> S.Indexed children
where withDefaultInfo = pure . cofree . ((range .: categoryForJavaScriptProductionName name .: RNil) :<)