From 7efb8e4db4ef64ba81592c6b8dec6ee30452bee6 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Wed, 2 Aug 2017 09:48:46 -0700 Subject: [PATCH] ++tree-sitter-ruby and +parenthesized_expressions --- languages/ruby/vendor/tree-sitter-ruby | 2 +- src/Language/Ruby/Grammar.hs | 2 +- src/Language/Ruby/Syntax.hs | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/languages/ruby/vendor/tree-sitter-ruby b/languages/ruby/vendor/tree-sitter-ruby index a58ec93c6..fc17fcfa9 160000 --- a/languages/ruby/vendor/tree-sitter-ruby +++ b/languages/ruby/vendor/tree-sitter-ruby @@ -1 +1 @@ -Subproject commit a58ec93c65805dc836269b3e0277aa51c82f7d64 +Subproject commit fc17fcfa9387d1e8cc387c269067be90f9462028 diff --git a/src/Language/Ruby/Grammar.hs b/src/Language/Ruby/Grammar.hs index e23710858..81da956c0 100644 --- a/src/Language/Ruby/Grammar.hs +++ b/src/Language/Ruby/Grammar.hs @@ -5,6 +5,6 @@ import Language.Haskell.TH import Text.Parser.TreeSitter.Language import Text.Parser.TreeSitter.Ruby --- v3 - Bump to get file to change to force template haskell to regenerate. +-- v4 - Bump to get file to change to force template haskell to regenerate. -- | Statically-known rules corresponding to symbols in the grammar. mkSymbolDatatype (mkName "Grammar") tree_sitter_ruby diff --git a/src/Language/Ruby/Syntax.hs b/src/Language/Ruby/Syntax.hs index fe0842382..7eac2d20c 100644 --- a/src/Language/Ruby/Syntax.hs +++ b/src/Language/Ruby/Syntax.hs @@ -114,6 +114,7 @@ expression = <|> mk Yield Statement.Yield <|> module' <|> pair + <|> parenthesized_expressions <|> rescue <|> scopeResolution <|> singletonClass @@ -130,6 +131,9 @@ expression = expressions :: Assignment expressions = makeTerm <$> location <*> many expression +parenthesized_expressions :: Assignment +parenthesized_expressions = makeTerm <$> symbol ParenthesizedStatements <*> children (many expression) + identifier :: Assignment identifier = mk Identifier