1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Map "block" onto ExpressionStatements.

This commit is contained in:
Rob Rix 2017-01-23 15:33:31 -05:00
parent 338522ab5c
commit 99590a52d3

View File

@ -74,7 +74,7 @@ termAssignment source (range :. category :. sourceSpan :. Nil) children = case (
(Method, [params, name, outParams, ty, fun]) -> withDefaultInfo (S.Method name (Just ty) (toList (unwrap params) <> toList (unwrap outParams)) (toList (unwrap fun)))
_ -> Nothing
where
toIfStatement children = case Prologue.break ((Other "block" ==) . Info.category . extract) children of
toIfStatement children = case Prologue.break ((ExpressionStatements ==) . Info.category . extract) children of
(clauses, blocks) ->
let clauses' = withRanges range ExpressionStatements (S.Indexed clauses)
blocks' = foldMap (toList . unwrap) blocks
@ -148,4 +148,5 @@ categoryForGoName = \case
"rune_literal" -> RuneLiteral
"method_declaration" -> Method
"import_spec" -> Import
"block" -> ExpressionStatements
s -> Other (toS s)