1
1
mirror of https://github.com/github/semantic.git synced 2025-01-07 07:58:12 +03:00

allow comments in and around parameters

This commit is contained in:
Charlie Somerville 2018-04-16 17:16:14 +10:00
parent 584aa364b5
commit 699e2642ff

View File

@ -229,7 +229,9 @@ scopeResolution :: Assignment
scopeResolution = makeTerm <$> symbol ScopeResolution <*> children (Expression.ScopeResolution <$> many expression) scopeResolution = makeTerm <$> symbol ScopeResolution <*> children (Expression.ScopeResolution <$> many expression)
parameter :: Assignment parameter :: Assignment
parameter = parameter = postContextualize comment (term uncontextualizedParameter)
where
uncontextualizedParameter =
lhsIdent lhsIdent
<|> splatParameter <|> splatParameter
<|> hashSplatParameter <|> hashSplatParameter
@ -237,7 +239,6 @@ parameter =
<|> keywordParameter <|> keywordParameter
<|> optionalParameter <|> optionalParameter
<|> makeTerm <$> symbol DestructuredParameter <*> children (many parameter) <|> makeTerm <$> symbol DestructuredParameter <*> children (many parameter)
where
-- splat and hash splat arguments can be unnamed. we don't currently -- splat and hash splat arguments can be unnamed. we don't currently
-- support unnamed arguments in the term syntax, so the use of emptyTerm -- support unnamed arguments in the term syntax, so the use of emptyTerm
-- here is a huge hack. what we should be able to do is return a Nothing -- here is a huge hack. what we should be able to do is return a Nothing