mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Merge remote-tracking branch 'origin/master' into graph-cli
This commit is contained in:
commit
b02b7c74c9
@ -74,7 +74,6 @@ type Syntax = '[
|
||||
, Syntax.Identifier
|
||||
, Syntax.Paren
|
||||
, Syntax.Program
|
||||
, Ruby.Syntax.Send
|
||||
, Ruby.Syntax.Class
|
||||
, Ruby.Syntax.Load
|
||||
, Ruby.Syntax.LowPrecedenceBoolean
|
||||
@ -84,8 +83,7 @@ type Syntax = '[
|
||||
]
|
||||
|
||||
type Term = Term.Term (Union Syntax) (Record Location)
|
||||
type Assignment' a = HasCallStack => Assignment.Assignment [] Grammar a
|
||||
type Assignment = Assignment' Term
|
||||
type Assignment = HasCallStack => Assignment.Assignment [] Grammar Term
|
||||
|
||||
-- | Assignment from AST in Ruby’s grammar onto a program in Ruby’s syntax.
|
||||
assignment :: Assignment
|
||||
@ -293,12 +291,9 @@ pair :: Assignment
|
||||
pair = makeTerm <$> symbol Pair <*> children (Literal.KeyValue <$> expression <*> (expression <|> emptyTerm))
|
||||
|
||||
methodCall :: Assignment
|
||||
methodCall = makeTerm' <$> symbol MethodCall <*> children (require <|> load <|> funcCall <|> regularCall)
|
||||
methodCall = makeTerm' <$> symbol MethodCall <*> children (require <|> load <|> regularCall)
|
||||
where
|
||||
funcCall = inj <$> (Ruby.Syntax.Send Nothing <$> methodSelector <*> args <*> optional block)
|
||||
|
||||
regularCall = inj <$> (symbol Call *> children (Ruby.Syntax.Send <$> (Just <$> expression) <*> methodSelector) <*> args <*> optional block)
|
||||
|
||||
regularCall = inj <$> (Expression.Call <$> pure [] <*> expression <*> args <*> (block <|> emptyTerm))
|
||||
require = inj <$> (symbol Identifier *> do
|
||||
s <- source
|
||||
guard (s `elem` ["require", "require_relative"])
|
||||
@ -307,17 +302,14 @@ methodCall = makeTerm' <$> symbol MethodCall <*> children (require <|> load <|>
|
||||
s <- source
|
||||
guard (s == "load")
|
||||
Ruby.Syntax.Load <$> loadArgs)
|
||||
args = (symbol ArgumentList <|> symbol ArgumentListWithParens) *> children (many expression) <|> many expression
|
||||
args = (symbol ArgumentList <|> symbol ArgumentListWithParens) *> children (many expression) <|> pure []
|
||||
loadArgs = (symbol ArgumentList <|> symbol ArgumentListWithParens) *> children (some expression)
|
||||
nameExpression = (symbol ArgumentList <|> symbol ArgumentListWithParens) *> children expression
|
||||
|
||||
methodSelector :: Assignment
|
||||
methodSelector = mk Identifier <|> mk Identifier'
|
||||
where
|
||||
mk s = makeTerm <$> symbol s <*> (Syntax.Identifier <$> (name <$> source))
|
||||
|
||||
call :: Assignment
|
||||
call = makeTerm <$> symbol Call <*> children (Ruby.Syntax.Send <$> (Just <$> expression) <*> methodSelector <*> pure [] <*> optional block)
|
||||
call = makeTerm <$> symbol Call <*> children (Expression.MemberAccess <$> expression <*> (args <|> expressions))
|
||||
where
|
||||
args = (symbol ArgumentList <|> symbol ArgumentListWithParens) *> children expressions
|
||||
|
||||
rescue :: Assignment
|
||||
rescue = rescue'
|
||||
|
@ -36,22 +36,6 @@ maybeFailNotFound name = maybeFail notFound
|
||||
cleanNameOrPath :: ByteString -> String
|
||||
cleanNameOrPath = BC.unpack . dropRelativePrefix . stripQuotes
|
||||
|
||||
data Send a = Send { sendReceiver :: Maybe a, sendSelector :: a, sendArgs :: [a], sendBlock :: Maybe a }
|
||||
deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1)
|
||||
|
||||
instance Eq1 Send where liftEq = genericLiftEq
|
||||
instance Ord1 Send where liftCompare = genericLiftCompare
|
||||
instance Show1 Send where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable Send where
|
||||
eval Send{..} = do
|
||||
func <- case sendReceiver of
|
||||
Just recv -> do
|
||||
recvEnv <- subtermValue recv >>= scopedEnvironment
|
||||
localEnv (mappend recvEnv) (subtermValue sendSelector)
|
||||
Nothing -> subtermValue sendSelector -- TODO Does this require `localize` so we don't leak terms when resolving `sendSelector`?
|
||||
call func (map subtermValue sendArgs) -- TODO pass through sendBlock
|
||||
|
||||
data Require a = Require { requireRelative :: Bool, requirePath :: !a }
|
||||
deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1)
|
||||
|
||||
|
@ -57,6 +57,7 @@ arguments = info (version <*> helper <*> ((,) <$> optionsParser <*> argumentsPar
|
||||
<*> pure False -- PrintSource
|
||||
<*> pure Log.logfmtFormatter -- Formatter
|
||||
<*> pure 0 -- ProcessID
|
||||
<*> switch (long "fail-on-warning" <> help "Fail on assignment warnings.")
|
||||
argumentsParser = (. Task.writeToOutput) . (>>=)
|
||||
<$> hsubparser (diffCommand <> parseCommand <> graphCommand)
|
||||
<*> ( Right <$> strOption (long "output" <> short 'o' <> help "Output path, defaults to stdout")
|
||||
|
@ -83,13 +83,14 @@ terminalFormatter Options{..} (Message level message pairs time) =
|
||||
|
||||
-- | Options controlling logging, error handling, &c.
|
||||
data Options = Options
|
||||
{ optionsEnableColour :: Bool -- ^ Whether to enable colour formatting for logging (Only works when logging to a terminal that supports ANSI colors).
|
||||
, optionsLevel :: Maybe Level -- ^ What level of messages to log. 'Nothing' disabled logging.
|
||||
, optionsRequestID :: Maybe String -- ^ Optional request id for tracing across systems.
|
||||
, optionsIsTerminal :: Bool -- ^ Whether a terminal is attached (set automaticaly at runtime).
|
||||
, optionsPrintSource :: Bool -- ^ Whether to print the source reference when logging errors (set automatically at runtime).
|
||||
, optionsFormatter :: Options -> Message -> String -- ^ Log formatter to use (set automaticaly at runtime).
|
||||
, optionsProcessID :: CPid -- ^ ProcessID (set automaticaly at runtime).
|
||||
{ optionsEnableColour :: Bool -- ^ Whether to enable colour formatting for logging (Only works when logging to a terminal that supports ANSI colors).
|
||||
, optionsLevel :: Maybe Level -- ^ What level of messages to log. 'Nothing' disabled logging.
|
||||
, optionsRequestID :: Maybe String -- ^ Optional request id for tracing across systems.
|
||||
, optionsIsTerminal :: Bool -- ^ Whether a terminal is attached (set automaticaly at runtime).
|
||||
, optionsPrintSource :: Bool -- ^ Whether to print the source reference when logging errors (set automatically at runtime).
|
||||
, optionsFormatter :: Options -> Message -> String -- ^ Log formatter to use (set automaticaly at runtime).
|
||||
, optionsProcessID :: CPid -- ^ ProcessID (set automaticaly at runtime).
|
||||
, optionsFailOnWarning :: Bool
|
||||
}
|
||||
|
||||
defaultOptions :: Options
|
||||
@ -101,6 +102,7 @@ defaultOptions = Options
|
||||
, optionsPrintSource = False
|
||||
, optionsFormatter = logfmtFormatter
|
||||
, optionsProcessID = 0
|
||||
, optionsFailOnWarning = False
|
||||
}
|
||||
|
||||
configureOptionsForHandle :: MonadIO io => Handle -> Options -> io Options
|
||||
|
@ -53,6 +53,7 @@ import Analysis.Decorator (decoratorWithAlgebra)
|
||||
import qualified Assigning.Assignment as Assignment
|
||||
import qualified Control.Abstract.Analysis as Analysis
|
||||
import qualified Control.Exception as Exc
|
||||
import Control.Monad
|
||||
import Control.Monad.Effect.Exception
|
||||
import Control.Monad.Effect.Internal as Eff hiding (run)
|
||||
import Control.Monad.Effect.Reader
|
||||
@ -228,6 +229,7 @@ runParser blob@Blob{..} parser = case parser of
|
||||
_ -> do
|
||||
writeStat (Stat.increment "parse.assign_warnings" languageTag)
|
||||
logError options Warning blob err (("task", "assign") : blobFields)
|
||||
when (optionsFailOnWarning options) $ throwError (toException err)
|
||||
writeStat (Stat.count "parse.nodes" (length term) languageTag)
|
||||
pure term
|
||||
MarkdownParser ->
|
||||
|
5
test/fixtures/ruby/begin.diffA-B.txt
vendored
5
test/fixtures/ruby/begin.diffA-B.txt
vendored
@ -5,6 +5,7 @@
|
||||
(
|
||||
(Try
|
||||
{ ([])
|
||||
->(Send
|
||||
->(Call
|
||||
{+(Identifier)+}
|
||||
{+(TextElement)+}) }))))
|
||||
{+(TextElement)+}
|
||||
{+(Empty)+}) }))))
|
||||
|
5
test/fixtures/ruby/begin.diffB-A.txt
vendored
5
test/fixtures/ruby/begin.diffB-A.txt
vendored
@ -4,7 +4,8 @@
|
||||
(Identifier)
|
||||
(
|
||||
(Try
|
||||
{ (Send
|
||||
{ (Call
|
||||
{-(Identifier)-}
|
||||
{-(TextElement)-})
|
||||
{-(TextElement)-}
|
||||
{-(Empty)-})
|
||||
->([]) }))))
|
||||
|
5
test/fixtures/ruby/begin.parseB.txt
vendored
5
test/fixtures/ruby/begin.parseB.txt
vendored
@ -4,6 +4,7 @@
|
||||
(Identifier)
|
||||
(
|
||||
(Try
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(TextElement))))))
|
||||
(TextElement)
|
||||
(Empty))))))
|
||||
|
10
test/fixtures/ruby/else.diffA-B.txt
vendored
10
test/fixtures/ruby/else.diffA-B.txt
vendored
@ -1,10 +1,12 @@
|
||||
(Program
|
||||
(Try
|
||||
(
|
||||
(Send
|
||||
(Identifier))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty))
|
||||
(Else
|
||||
(Empty)
|
||||
{ ([])
|
||||
->(Send
|
||||
{+(Identifier)+}) }))))
|
||||
->(Call
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+}) }))))
|
||||
|
10
test/fixtures/ruby/else.diffB-A.txt
vendored
10
test/fixtures/ruby/else.diffB-A.txt
vendored
@ -1,10 +1,12 @@
|
||||
(Program
|
||||
(Try
|
||||
(
|
||||
(Send
|
||||
(Identifier))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty))
|
||||
(Else
|
||||
(Empty)
|
||||
{ (Send
|
||||
{-(Identifier)-})
|
||||
{ (Call
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})
|
||||
->([]) }))))
|
||||
|
5
test/fixtures/ruby/else.parseA.txt
vendored
5
test/fixtures/ruby/else.parseA.txt
vendored
@ -1,8 +1,9 @@
|
||||
(Program
|
||||
(Try
|
||||
(
|
||||
(Send
|
||||
(Identifier))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty))
|
||||
(Else
|
||||
(Empty)
|
||||
([])))))
|
||||
|
10
test/fixtures/ruby/else.parseB.txt
vendored
10
test/fixtures/ruby/else.parseB.txt
vendored
@ -1,9 +1,11 @@
|
||||
(Program
|
||||
(Try
|
||||
(
|
||||
(Send
|
||||
(Identifier))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty))
|
||||
(Else
|
||||
(Empty)
|
||||
(Send
|
||||
(Identifier))))))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty))))))
|
||||
|
10
test/fixtures/ruby/elsif.diffA-B.txt
vendored
10
test/fixtures/ruby/elsif.diffA-B.txt
vendored
@ -2,11 +2,13 @@
|
||||
(If
|
||||
(Identifier)
|
||||
(
|
||||
(Send
|
||||
(Identifier)))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
(If
|
||||
(Identifier)
|
||||
(
|
||||
{+(Send
|
||||
{+(Identifier)+})+})
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+})
|
||||
(Empty))))
|
||||
|
10
test/fixtures/ruby/elsif.diffB-A.txt
vendored
10
test/fixtures/ruby/elsif.diffB-A.txt
vendored
@ -2,11 +2,13 @@
|
||||
(If
|
||||
(Identifier)
|
||||
(
|
||||
(Send
|
||||
(Identifier)))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
(If
|
||||
(Identifier)
|
||||
([]
|
||||
{-(Send
|
||||
{-(Identifier)-})-})
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-})
|
||||
(Empty))))
|
||||
|
5
test/fixtures/ruby/elsif.parseA.txt
vendored
5
test/fixtures/ruby/elsif.parseA.txt
vendored
@ -2,8 +2,9 @@
|
||||
(If
|
||||
(Identifier)
|
||||
(
|
||||
(Send
|
||||
(Identifier)))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
(If
|
||||
(Identifier)
|
||||
([])
|
||||
|
10
test/fixtures/ruby/elsif.parseB.txt
vendored
10
test/fixtures/ruby/elsif.parseB.txt
vendored
@ -2,11 +2,13 @@
|
||||
(If
|
||||
(Identifier)
|
||||
(
|
||||
(Send
|
||||
(Identifier)))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
(If
|
||||
(Identifier)
|
||||
(
|
||||
(Send
|
||||
(Identifier)))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
(Empty))))
|
||||
|
5
test/fixtures/ruby/for.diffA-B.txt
vendored
5
test/fixtures/ruby/for.diffA-B.txt
vendored
@ -6,9 +6,10 @@
|
||||
{+(Integer)+}
|
||||
{+(Integer)+}
|
||||
{+(Integer)+})+}
|
||||
{+(Send
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+})+}
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+})+}
|
||||
{-(ForEach
|
||||
{-(
|
||||
{-(Identifier)-})-}
|
||||
|
5
test/fixtures/ruby/for.diffB-A.txt
vendored
5
test/fixtures/ruby/for.diffB-A.txt
vendored
@ -22,9 +22,10 @@
|
||||
{+(Integer)+}
|
||||
{+(Integer)+}
|
||||
{+(Empty)+}) }
|
||||
{ (Send
|
||||
{ (Call
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})
|
||||
->(Boolean) })
|
||||
{+(ForEach
|
||||
{+(
|
||||
|
5
test/fixtures/ruby/for.parseB.txt
vendored
5
test/fixtures/ruby/for.parseB.txt
vendored
@ -6,6 +6,7 @@
|
||||
(Integer)
|
||||
(Integer)
|
||||
(Integer))
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(Identifier))))
|
||||
(Identifier)
|
||||
(Empty))))
|
||||
|
15
test/fixtures/ruby/heredoc.diffA-B.txt
vendored
15
test/fixtures/ruby/heredoc.diffA-B.txt
vendored
@ -1,9 +1,12 @@
|
||||
(Program
|
||||
{+(Send
|
||||
{+(Send
|
||||
{+(Identifier)+}
|
||||
{+(TextElement)+}
|
||||
{+(TextElement)+})+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Call
|
||||
{+(MemberAccess
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(TextElement)+}
|
||||
{+(TextElement)+}
|
||||
{+(Empty)+})+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Empty)+})+}
|
||||
{-(TextElement)-}
|
||||
{-(TextElement)-})
|
||||
|
15
test/fixtures/ruby/heredoc.diffB-A.txt
vendored
15
test/fixtures/ruby/heredoc.diffB-A.txt
vendored
@ -1,9 +1,12 @@
|
||||
(Program
|
||||
{+(TextElement)+}
|
||||
{+(TextElement)+}
|
||||
{-(Send
|
||||
{-(Send
|
||||
{-(Identifier)-}
|
||||
{-(TextElement)-}
|
||||
{-(TextElement)-})-}
|
||||
{-(Identifier)-})-})
|
||||
{-(Call
|
||||
{-(MemberAccess
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(TextElement)-}
|
||||
{-(TextElement)-}
|
||||
{-(Empty)-})-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Empty)-})-})
|
||||
|
15
test/fixtures/ruby/heredoc.parseB.txt
vendored
15
test/fixtures/ruby/heredoc.parseB.txt
vendored
@ -1,7 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Send
|
||||
(Identifier)
|
||||
(TextElement)
|
||||
(TextElement))
|
||||
(Identifier)))
|
||||
(Call
|
||||
(MemberAccess
|
||||
(Call
|
||||
(Identifier)
|
||||
(TextElement)
|
||||
(TextElement)
|
||||
(Empty))
|
||||
(Identifier))
|
||||
(Empty)))
|
||||
|
9
test/fixtures/ruby/lambda.diffA-B.txt
vendored
9
test/fixtures/ruby/lambda.diffA-B.txt
vendored
@ -1,8 +1,9 @@
|
||||
(Program
|
||||
{-(Send
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Hash)-})-}
|
||||
(Send
|
||||
{-(Hash)-}
|
||||
{-(Empty)-})-}
|
||||
(Call
|
||||
(Identifier)
|
||||
(Function
|
||||
(Empty)
|
||||
@ -11,7 +12,7 @@
|
||||
->(Plus
|
||||
{+(Identifier)+}
|
||||
{+(Integer)+}) }))
|
||||
{-(Send
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Function
|
||||
{-(Empty)-}
|
||||
|
9
test/fixtures/ruby/lambda.diffB-A.txt
vendored
9
test/fixtures/ruby/lambda.diffB-A.txt
vendored
@ -1,8 +1,9 @@
|
||||
(Program
|
||||
{+(Send
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Hash)+})+}
|
||||
(Send
|
||||
{+(Hash)+}
|
||||
{+(Empty)+})+}
|
||||
(Call
|
||||
(Identifier)
|
||||
(Function
|
||||
(Empty)
|
||||
@ -11,7 +12,7 @@
|
||||
{-(Identifier)-}
|
||||
{-(Integer)-})
|
||||
->(Identifier) }))
|
||||
{+(Send
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Function
|
||||
{+(Empty)+}
|
||||
|
9
test/fixtures/ruby/lambda.parseA.txt
vendored
9
test/fixtures/ruby/lambda.parseA.txt
vendored
@ -1,13 +1,14 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(Hash))
|
||||
(Send
|
||||
(Hash)
|
||||
(Empty))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Function
|
||||
(Empty)
|
||||
(Identifier)))
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(Function
|
||||
(Empty)
|
||||
|
2
test/fixtures/ruby/lambda.parseB.txt
vendored
2
test/fixtures/ruby/lambda.parseB.txt
vendored
@ -1,5 +1,5 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(Function
|
||||
(Empty)
|
||||
|
@ -1,9 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Symbol)
|
||||
(Boolean))
|
||||
{+(KeyValue
|
||||
{+(Symbol)+}
|
||||
{+(Integer)+})+}))
|
||||
{+(Integer)+})+}
|
||||
(Empty)))
|
||||
|
@ -1,9 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Symbol)
|
||||
(Boolean))
|
||||
{-(KeyValue
|
||||
{-(Symbol)-}
|
||||
{-(Integer)-})-}))
|
||||
{-(Integer)-})-}
|
||||
(Empty)))
|
||||
|
@ -1,6 +1,7 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Symbol)
|
||||
(Boolean))))
|
||||
(Boolean))
|
||||
(Empty)))
|
||||
|
@ -1,9 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Symbol)
|
||||
(Boolean))
|
||||
(KeyValue
|
||||
(Symbol)
|
||||
(Integer))))
|
||||
(Integer))
|
||||
(Empty)))
|
||||
|
@ -1,9 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Identifier)
|
||||
(Boolean))
|
||||
{+(KeyValue
|
||||
{+(Identifier)+}
|
||||
{+(Integer)+})+}))
|
||||
{+(Integer)+})+}
|
||||
(Empty)))
|
||||
|
@ -1,9 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Identifier)
|
||||
(Boolean))
|
||||
{-(KeyValue
|
||||
{-(Identifier)-}
|
||||
{-(Integer)-})-}))
|
||||
{-(Integer)-})-}
|
||||
(Empty)))
|
||||
|
@ -1,6 +1,7 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Identifier)
|
||||
(Boolean))))
|
||||
(Boolean))
|
||||
(Empty)))
|
||||
|
@ -1,9 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Identifier)
|
||||
(Boolean))
|
||||
(KeyValue
|
||||
(Identifier)
|
||||
(Integer))))
|
||||
(Integer))
|
||||
(Empty)))
|
||||
|
28
test/fixtures/ruby/method-calls.diffA-B.txt
vendored
28
test/fixtures/ruby/method-calls.diffA-B.txt
vendored
@ -1,9 +1,11 @@
|
||||
(Program
|
||||
(Send
|
||||
{-(Identifier)-}
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
{-(Send
|
||||
(Call
|
||||
{ (MemberAccess
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})
|
||||
->(Identifier) }
|
||||
(Empty))
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-}
|
||||
@ -12,13 +14,16 @@
|
||||
{-(Integer)-})-}
|
||||
{-(KeyValue
|
||||
{-(Identifier)-}
|
||||
{-(Integer)-})-})-}
|
||||
{-(Send
|
||||
{-(Integer)-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Send
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-})-}
|
||||
{-(Send
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(KeyValue
|
||||
{-(Array)-}
|
||||
@ -30,4 +35,5 @@
|
||||
{-(Identifier)-}
|
||||
{-(Function
|
||||
{-(Empty)-}
|
||||
{-(Integer)-})-})-})-})
|
||||
{-(Integer)-})-})-}
|
||||
{-(Empty)-})-})
|
||||
|
26
test/fixtures/ruby/method-calls.diffB-A.txt
vendored
26
test/fixtures/ruby/method-calls.diffB-A.txt
vendored
@ -1,9 +1,11 @@
|
||||
(Program
|
||||
(Send
|
||||
{+(Identifier)+}
|
||||
(Call
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
{+(Send
|
||||
->(MemberAccess
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+}) }
|
||||
(Empty))
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+}
|
||||
@ -12,13 +14,16 @@
|
||||
{+(Integer)+})+}
|
||||
{+(KeyValue
|
||||
{+(Identifier)+}
|
||||
{+(Integer)+})+})+}
|
||||
{+(Send
|
||||
{+(Integer)+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Send
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+})+}
|
||||
{+(Send
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(KeyValue
|
||||
{+(Array)+}
|
||||
@ -30,4 +35,5 @@
|
||||
{+(Identifier)+}
|
||||
{+(Function
|
||||
{+(Empty)+}
|
||||
{+(Integer)+})+})+})+})
|
||||
{+(Integer)+})+})+}
|
||||
{+(Empty)+})+})
|
||||
|
26
test/fixtures/ruby/method-calls.parseA.txt
vendored
26
test/fixtures/ruby/method-calls.parseA.txt
vendored
@ -1,8 +1,10 @@
|
||||
(Program
|
||||
(Send
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Send
|
||||
(Call
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Empty))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
@ -11,13 +13,16 @@
|
||||
(Integer))
|
||||
(KeyValue
|
||||
(Identifier)
|
||||
(Integer)))
|
||||
(Send
|
||||
(Integer))
|
||||
(Empty))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Send
|
||||
(Identifier)
|
||||
(Empty))
|
||||
(Empty))
|
||||
(Call
|
||||
(Identifier)
|
||||
(KeyValue
|
||||
(Array)
|
||||
@ -29,4 +34,5 @@
|
||||
(Identifier)
|
||||
(Function
|
||||
(Empty)
|
||||
(Integer)))))
|
||||
(Integer)))
|
||||
(Empty)))
|
||||
|
5
test/fixtures/ruby/method-calls.parseB.txt
vendored
5
test/fixtures/ruby/method-calls.parseB.txt
vendored
@ -1,3 +1,4 @@
|
||||
(Program
|
||||
(Send
|
||||
(Identifier)))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
|
34
test/fixtures/ruby/method-invocation.diffA-B.txt
vendored
34
test/fixtures/ruby/method-invocation.diffA-B.txt
vendored
@ -1,17 +1,25 @@
|
||||
(Program
|
||||
{+(Send
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(TextElement)+})+}
|
||||
{+(TextElement)+}
|
||||
{+(Empty)+})+}
|
||||
{+(Call
|
||||
{+(MemberAccess
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Integer)+}
|
||||
{+(Integer)+}
|
||||
{+(Empty)+})+}
|
||||
{+(Call
|
||||
{+(Identifier)+}
|
||||
{+(Integer)+}
|
||||
{+(Integer)+}
|
||||
{+(Empty)+})+}
|
||||
{-(Identifier)-}
|
||||
(Send
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
{+(Send
|
||||
{+(Identifier)+}
|
||||
{+(Integer)+}
|
||||
{+(Integer)+})+}
|
||||
{+(Send
|
||||
{+(Identifier)+}
|
||||
{+(Integer)+}
|
||||
{+(Integer)+})+}
|
||||
{-(MemberAccess
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Identifier)-})
|
||||
|
28
test/fixtures/ruby/method-invocation.diffB-A.txt
vendored
28
test/fixtures/ruby/method-invocation.diffB-A.txt
vendored
@ -1,17 +1,25 @@
|
||||
(Program
|
||||
{+(Identifier)+}
|
||||
{-(Send
|
||||
{-(Identifier)-}
|
||||
{-(TextElement)-})-}
|
||||
(Send
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
{+(MemberAccess
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Identifier)+}
|
||||
{-(Send
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(TextElement)-}
|
||||
{-(Empty)-})-}
|
||||
{-(Call
|
||||
{-(MemberAccess
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Integer)-}
|
||||
{-(Integer)-})-}
|
||||
{-(Send
|
||||
{-(Integer)-}
|
||||
{-(Empty)-})-}
|
||||
{-(Call
|
||||
{-(Identifier)-}
|
||||
{-(Integer)-}
|
||||
{-(Integer)-})-})
|
||||
{-(Integer)-}
|
||||
{-(Empty)-})-})
|
||||
|
@ -1,6 +1,6 @@
|
||||
(Program
|
||||
(Identifier)
|
||||
(Send
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier))
|
||||
|
23
test/fixtures/ruby/method-invocation.parseB.txt
vendored
23
test/fixtures/ruby/method-invocation.parseB.txt
vendored
@ -1,15 +1,20 @@
|
||||
(Program
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(TextElement))
|
||||
(Send
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Send
|
||||
(TextElement)
|
||||
(Empty))
|
||||
(Call
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Empty))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Integer)
|
||||
(Integer))
|
||||
(Send
|
||||
(Integer)
|
||||
(Empty))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Integer)
|
||||
(Integer)))
|
||||
(Integer)
|
||||
(Empty)))
|
||||
|
@ -37,17 +37,17 @@
|
||||
{-(Identifier)-})-}
|
||||
{-(Assignment
|
||||
{-(
|
||||
{-(Send
|
||||
{-(MemberAccess
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Send
|
||||
{-(MemberAccess
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-})-}
|
||||
{-(
|
||||
{-(Send
|
||||
{-(MemberAccess
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Send
|
||||
{-(MemberAccess
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-})-})-}
|
||||
{-(Assignment
|
||||
|
@ -37,17 +37,17 @@
|
||||
{+(Identifier)+})+}
|
||||
{+(Assignment
|
||||
{+(
|
||||
{+(Send
|
||||
{+(MemberAccess
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Send
|
||||
{+(MemberAccess
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+})+}
|
||||
{+(
|
||||
{+(Send
|
||||
{+(MemberAccess
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Send
|
||||
{+(MemberAccess
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+})+})+}
|
||||
{+(Assignment
|
||||
|
@ -36,17 +36,17 @@
|
||||
(Identifier))
|
||||
(Assignment
|
||||
(
|
||||
(Send
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Send
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(
|
||||
(Send
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Send
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))))
|
||||
(Assignment
|
||||
|
@ -1,5 +1,5 @@
|
||||
(Program
|
||||
{ (Equal
|
||||
{(Equal
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})
|
||||
->(Comparison
|
||||
@ -10,12 +10,11 @@
|
||||
{+(Identifier)+})+}
|
||||
{+(Assignment
|
||||
{+(Identifier)+}
|
||||
{+(Not
|
||||
{+(Identifier)+})+})+}
|
||||
{+(Not{+(Identifier)+})+})+}
|
||||
{-(Not
|
||||
{-(Equal
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-})-}
|
||||
{-(Equal
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-})
|
||||
{-(Identifier)-})- })
|
||||
|
@ -1,5 +1,5 @@
|
||||
(Program
|
||||
{ (Comparison
|
||||
{(Comparison
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})
|
||||
->(Equal
|
||||
@ -17,5 +17,4 @@
|
||||
{-(Identifier)-})-}
|
||||
{-(Assignment
|
||||
{-(Identifier)-}
|
||||
{-(Not
|
||||
{-(Identifier)-})-})-})
|
||||
{-(Not{-(Identifier)-})-})- })
|
||||
|
5
test/fixtures/ruby/require.diffA-B.txt
vendored
5
test/fixtures/ruby/require.diffA-B.txt
vendored
@ -2,9 +2,10 @@
|
||||
(Require
|
||||
{ (TextElement)
|
||||
->(TextElement) })
|
||||
(Send
|
||||
(Call
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{+(Symbol)+}
|
||||
{+(TextElement)+}
|
||||
{-(Identifier)-}))
|
||||
{-(Identifier)-}
|
||||
(Empty)))
|
||||
|
5
test/fixtures/ruby/require.diffB-A.txt
vendored
5
test/fixtures/ruby/require.diffB-A.txt
vendored
@ -2,9 +2,10 @@
|
||||
(Require
|
||||
{ (TextElement)
|
||||
->(TextElement) })
|
||||
(Send
|
||||
(Call
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{+(Identifier)+}
|
||||
{-(Symbol)-}
|
||||
{-(TextElement)-}))
|
||||
{-(TextElement)-}
|
||||
(Empty)))
|
||||
|
5
test/fixtures/ruby/require.parseA.txt
vendored
5
test/fixtures/ruby/require.parseA.txt
vendored
@ -1,6 +1,7 @@
|
||||
(Program
|
||||
(Require
|
||||
(TextElement))
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
|
5
test/fixtures/ruby/require.parseB.txt
vendored
5
test/fixtures/ruby/require.parseB.txt
vendored
@ -1,7 +1,8 @@
|
||||
(Program
|
||||
(Require
|
||||
(TextElement))
|
||||
(Send
|
||||
(Call
|
||||
(Identifier)
|
||||
(Symbol)
|
||||
(TextElement)))
|
||||
(TextElement)
|
||||
(Empty)))
|
||||
|
Loading…
Reference in New Issue
Block a user