Created
November 15, 2022 02:25
-
-
Save palkan/e0eb0a4c29b148a992e4e9b0a5f39a7d to your computer and use it in GitHub Desktop.
Syntax Tree doubles query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# gem install syntax_tree | |
# stree double_query.txt spec/**/*.rb | |
# | |
CallNode[ | |
receiver: NilClass, | |
message: Ident[value: "double" | "instance_double"], | |
arguments: ArgParen[ | |
arguments: Args[ | |
parts: [StringLiteral | VarRef[value: Const], BareAssocHash] | |
] | |
] | |
] | | |
Command[ | |
message: Ident[value: "double" | "instance_double"], | |
arguments: Args[ | |
parts: [StringLiteral | VarRef[value: Const], BareAssocHash] | |
] | |
] | | |
CommandCall[ | |
receiver: CallNode[ | |
receiver: NilClass, | |
message: Ident[value: "allow" | "expect"], | |
arguments: ArgParen | |
], | |
operator: Period, | |
message: Ident[value: "to"], | |
arguments: Args[ | |
parts: [ | |
CallNode[ | |
receiver: NilClass, | |
message: Ident[value: "receive"], | |
arguments: ArgParen[ | |
arguments: Args[ | |
parts: [ | |
SymbolLiteral | |
] | |
] | |
] | |
] | | |
CallNode[ | |
receiver: CallNode[ | |
receiver: NilClass, | |
message: Ident[value: "receive"], | |
arguments: ArgParen[ | |
arguments: Args[ | |
parts: [ | |
SymbolLiteral | |
] | |
] | |
] | |
], | |
operator: Period, | |
message: SyntaxTree::Ident[value: "with" | "and_return"] | |
] | | |
CallNode[ | |
receiver: CallNode[ | |
receiver: CallNode[ | |
receiver: NilClass, | |
message: Ident[value: "receive"], | |
arguments: ArgParen[ | |
arguments: Args[ | |
parts: [ | |
SymbolLiteral | |
] | |
] | |
] | |
], | |
operator: Period, | |
message: SyntaxTree::Ident[value: "with" | "and_return"] | |
], | |
operator: Period, | |
message: SyntaxTree::Ident[value: "with" | "and_return"] | |
] | | |
MethodAddBlock[ | |
call: CallNode[ | |
receiver: NilClass, | |
message: Ident[value: "receive"], | |
arguments: ArgParen[ | |
arguments: Args[ | |
parts: [ | |
SymbolLiteral | |
] | |
] | |
] | |
], | |
block: BlockNode | |
] | |
] | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment