1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Add empty context to Ruby method and singletonMethod

This commit is contained in:
joshvera 2017-08-16 12:22:28 -04:00
parent 3b6fe74bfa
commit ce66af3cf6

View File

@ -207,11 +207,11 @@ parameter =
where mk s = makeTerm <$> symbol s <*> (Syntax.Identifier <$> source) where mk s = makeTerm <$> symbol s <*> (Syntax.Identifier <$> source)
method :: Assignment method :: Assignment
method = makeTerm <$> symbol Method <*> children (Declaration.Method <$> emptyTerm <*> expression <*> params <*> expressions) method = makeTerm <$> symbol Method <*> children (Declaration.Method <$> [] <*> emptyTerm <*> expression <*> params <*> expressions)
where params = symbol MethodParameters *> children (many parameter) <|> pure [] where params = symbol MethodParameters *> children (many parameter) <|> pure []
singletonMethod :: Assignment singletonMethod :: Assignment
singletonMethod = makeTerm <$> symbol SingletonMethod <*> children (Declaration.Method <$> expression <*> expression <*> params <*> expressions) singletonMethod = makeTerm <$> symbol SingletonMethod <*> children (Declaration.Method <$> [] <*> expression <*> expression <*> params <*> expressions)
where params = symbol MethodParameters *> children (many parameter) <|> pure [] where params = symbol MethodParameters *> children (many parameter) <|> pure []
lambda :: Assignment lambda :: Assignment