Module: SyntaxTree::DSL
- Included in:
- YARV::Decompiler, YARV::Decompiler::BlockLabel
- Defined in:
- lib/syntax_tree/dsl.rb
Overview
This module provides shortcuts for creating AST nodes.
Instance Method Summary collapse
-
#AliasNode(left, right) ⇒ Object
Create a new AliasNode node.
-
#ARef(collection, index) ⇒ Object
Create a new ARef node.
-
#ARefField(collection, index) ⇒ Object
Create a new ARefField node.
-
#ArgBlock(value) ⇒ Object
Create a new ArgBlock node.
-
#ArgParen(arguments) ⇒ Object
Create a new ArgParen node.
-
#Args(parts) ⇒ Object
Create a new Args node.
-
#ArgsForward ⇒ Object
Create a new ArgsForward node.
-
#ArgStar(value) ⇒ Object
Create a new ArgStar node.
-
#ArrayLiteral(lbracket, contents) ⇒ Object
Create a new ArrayLiteral node.
-
#AryPtn(constant, requireds, rest, posts) ⇒ Object
Create a new AryPtn node.
-
#Assign(target, value) ⇒ Object
Create a new Assign node.
-
#Assoc(key, value) ⇒ Object
Create a new Assoc node.
-
#AssocSplat(value) ⇒ Object
Create a new AssocSplat node.
-
#Backref(value) ⇒ Object
Create a new Backref node.
-
#Backtick(value) ⇒ Object
Create a new Backtick node.
-
#BareAssocHash(assocs) ⇒ Object
Create a new BareAssocHash node.
-
#Begin(bodystmt) ⇒ Object
Create a new Begin node.
-
#BEGINBlock(lbrace, statements) ⇒ Object
Create a new BEGINBlock node.
-
#Binary(left, operator, right) ⇒ Object
Create a new Binary node.
-
#BlockArg(name) ⇒ Object
Create a new BlockArg node.
-
#BlockNode(opening, block_var, bodystmt) ⇒ Object
Create a new BlockNode node.
-
#BlockVar(params, locals) ⇒ Object
Create a new BlockVar node.
-
#BodyStmt(statements, rescue_clause, else_keyword, else_clause, ensure_clause) ⇒ Object
Create a new BodyStmt node.
-
#Break(arguments) ⇒ Object
Create a new Break node.
-
#CallNode(receiver, operator, message, arguments) ⇒ Object
Create a new CallNode node.
-
#Case(keyword, value, consequent) ⇒ Object
Create a new Case node.
-
#CHAR(value) ⇒ Object
Create a new CHAR node.
-
#ClassDeclaration(constant, superclass, bodystmt) ⇒ Object
Create a new ClassDeclaration node.
-
#Comma(value) ⇒ Object
Create a new Comma node.
-
#Command(message, arguments, block) ⇒ Object
Create a new Command node.
-
#CommandCall(receiver, operator, message, arguments, block) ⇒ Object
Create a new CommandCall node.
-
#Comment(value, inline) ⇒ Object
Create a new Comment node.
-
#Const(value) ⇒ Object
Create a new Const node.
-
#ConstPathField(parent, constant) ⇒ Object
Create a new ConstPathField node.
-
#ConstPathRef(parent, constant) ⇒ Object
Create a new ConstPathRef node.
-
#ConstRef(constant) ⇒ Object
Create a new ConstRef node.
-
#CVar(value) ⇒ Object
Create a new CVar node.
-
#Defined(value) ⇒ Object
Create a new Defined node.
-
#DefNode(target, operator, name, params, bodystmt) ⇒ Object
Create a new DefNode node.
-
#DynaSymbol(parts, quote) ⇒ Object
Create a new DynaSymbol node.
-
#Else(keyword, statements) ⇒ Object
Create a new Else node.
-
#Elsif(predicate, statements, consequent) ⇒ Object
Create a new Elsif node.
-
#EmbDoc(value) ⇒ Object
Create a new EmbDoc node.
-
#EmbExprBeg(value) ⇒ Object
Create a new EmbExprBeg node.
-
#EmbExprEnd(value) ⇒ Object
Create a new EmbExprEnd node.
-
#EmbVar(value) ⇒ Object
Create a new EmbVar node.
-
#ENDBlock(lbrace, statements) ⇒ Object
Create a new ENDBlock node.
-
#EndContent(value) ⇒ Object
Create a new EndContent node.
-
#Ensure(keyword, statements) ⇒ Object
Create a new Ensure node.
-
#ExcessedComma(value) ⇒ Object
Create a new ExcessedComma node.
-
#Field(parent, operator, name) ⇒ Object
Create a new Field node.
-
#FloatLiteral(value) ⇒ Object
Create a new FloatLiteral node.
-
#FndPtn(constant, left, values, right) ⇒ Object
Create a new FndPtn node.
-
#For(index, collection, statements) ⇒ Object
Create a new For node.
-
#GVar(value) ⇒ Object
Create a new GVar node.
-
#HashLiteral(lbrace, assocs) ⇒ Object
Create a new HashLiteral node.
-
#Heredoc(beginning, ending, dedent, parts) ⇒ Object
Create a new Heredoc node.
-
#HeredocBeg(value) ⇒ Object
Create a new HeredocBeg node.
-
#HeredocEnd(value) ⇒ Object
Create a new HeredocEnd node.
-
#HshPtn(constant, keywords, keyword_rest) ⇒ Object
Create a new HshPtn node.
-
#Ident(value) ⇒ Object
Create a new Ident node.
-
#IfNode(predicate, statements, consequent) ⇒ Object
Create a new IfNode node.
-
#IfOp(predicate, truthy, falsy) ⇒ Object
Create a new IfOp node.
-
#Imaginary(value) ⇒ Object
Create a new Imaginary node.
-
#In(pattern, statements, consequent) ⇒ Object
Create a new In node.
-
#Int(value) ⇒ Object
Create a new Int node.
-
#IVar(value) ⇒ Object
Create a new IVar node.
-
#Kw(value) ⇒ Object
Create a new Kw node.
-
#KwRestParam(name) ⇒ Object
Create a new KwRestParam node.
-
#Label(value) ⇒ Object
Create a new Label node.
-
#LabelEnd(value) ⇒ Object
Create a new LabelEnd node.
-
#Lambda(params, statements) ⇒ Object
Create a new Lambda node.
-
#LambdaVar(params, locals) ⇒ Object
Create a new LambdaVar node.
-
#LBrace(value) ⇒ Object
Create a new LBrace node.
-
#LBracket(value) ⇒ Object
Create a new LBracket node.
-
#LParen(value) ⇒ Object
Create a new LParen node.
-
#MAssign(target, value) ⇒ Object
Create a new MAssign node.
-
#MethodAddBlock(call, block) ⇒ Object
Create a new MethodAddBlock node.
-
#MLHS(parts, comma) ⇒ Object
Create a new MLHS node.
-
#MLHSParen(contents, comma) ⇒ Object
Create a new MLHSParen node.
-
#ModuleDeclaration(constant, bodystmt) ⇒ Object
Create a new ModuleDeclaration node.
-
#MRHS(parts) ⇒ Object
Create a new MRHS node.
-
#Next(arguments) ⇒ Object
Create a new Next node.
-
#Not(statement, parentheses) ⇒ Object
Create a new Not node.
-
#Op(value) ⇒ Object
Create a new Op node.
-
#OpAssign(target, operator, value) ⇒ Object
Create a new OpAssign node.
-
#Params(requireds, optionals, rest, posts, keywords, keyword_rest, block) ⇒ Object
Create a new Params node.
-
#Paren(lparen, contents) ⇒ Object
Create a new Paren node.
-
#Period(value) ⇒ Object
Create a new Period node.
-
#PinnedBegin(statement) ⇒ Object
Create a new PinnedBegin node.
-
#PinnedVarRef(value) ⇒ Object
Create a new PinnedVarRef node.
-
#Program(statements) ⇒ Object
Create a new Program node.
-
#QSymbols(beginning, elements) ⇒ Object
Create a new QSymbols node.
-
#QSymbolsBeg(value) ⇒ Object
Create a new QSymbolsBeg node.
-
#QWords(beginning, elements) ⇒ Object
Create a new QWords node.
-
#QWordsBeg(value) ⇒ Object
Create a new QWordsBeg node.
-
#RangeNode(left, operator, right) ⇒ Object
Create a new RangeNode node.
-
#RAssign(value, operator, pattern) ⇒ Object
Create a new RAssign node.
-
#RationalLiteral(value) ⇒ Object
Create a new RationalLiteral node.
-
#RBrace(value) ⇒ Object
Create a new RBrace node.
-
#RBracket(value) ⇒ Object
Create a new RBracket node.
-
#Redo ⇒ Object
Create a new Redo node.
-
#RegexpBeg(value) ⇒ Object
Create a new RegexpBeg node.
-
#RegexpContent(beginning, parts) ⇒ Object
Create a new RegexpContent node.
-
#RegexpEnd(value) ⇒ Object
Create a new RegexpEnd node.
-
#RegexpLiteral(beginning, ending, parts) ⇒ Object
Create a new RegexpLiteral node.
-
#Rescue(keyword, exception, statements, consequent) ⇒ Object
Create a new Rescue node.
-
#RescueEx(exceptions, variable) ⇒ Object
Create a new RescueEx node.
-
#RescueMod(statement, value) ⇒ Object
Create a new RescueMod node.
-
#RestParam(name) ⇒ Object
Create a new RestParam node.
-
#Retry ⇒ Object
Create a new Retry node.
-
#ReturnNode(arguments) ⇒ Object
Create a new ReturnNode node.
-
#RParen(value) ⇒ Object
Create a new RParen node.
-
#SClass(target, bodystmt) ⇒ Object
Create a new SClass node.
-
#Statements(body) ⇒ Object
Create a new Statements node.
-
#StringConcat(left, right) ⇒ Object
Create a new StringConcat node.
-
#StringContent(parts) ⇒ Object
Create a new StringContent node.
-
#StringDVar(variable) ⇒ Object
Create a new StringDVar node.
-
#StringEmbExpr(statements) ⇒ Object
Create a new StringEmbExpr node.
-
#StringLiteral(parts, quote) ⇒ Object
Create a new StringLiteral node.
-
#Super(arguments) ⇒ Object
Create a new Super node.
-
#SymBeg(value) ⇒ Object
Create a new SymBeg node.
-
#SymbolContent(value) ⇒ Object
Create a new SymbolContent node.
-
#SymbolLiteral(value) ⇒ Object
Create a new SymbolLiteral node.
-
#Symbols(beginning, elements) ⇒ Object
Create a new Symbols node.
-
#SymbolsBeg(value) ⇒ Object
Create a new SymbolsBeg node.
-
#TLambda(value) ⇒ Object
Create a new TLambda node.
-
#TLamBeg(value) ⇒ Object
Create a new TLamBeg node.
-
#TopConstField(constant) ⇒ Object
Create a new TopConstField node.
-
#TopConstRef(constant) ⇒ Object
Create a new TopConstRef node.
-
#TStringBeg(value) ⇒ Object
Create a new TStringBeg node.
-
#TStringContent(value) ⇒ Object
Create a new TStringContent node.
-
#TStringEnd(value) ⇒ Object
Create a new TStringEnd node.
-
#Unary(operator, statement) ⇒ Object
Create a new Unary node.
-
#Undef(symbols) ⇒ Object
Create a new Undef node.
-
#UnlessNode(predicate, statements, consequent) ⇒ Object
Create a new UnlessNode node.
-
#UntilNode(predicate, statements) ⇒ Object
Create a new UntilNode node.
-
#VarField(value) ⇒ Object
Create a new VarField node.
-
#VarRef(value) ⇒ Object
Create a new VarRef node.
-
#VCall(value) ⇒ Object
Create a new VCall node.
-
#VoidStmt ⇒ Object
Create a new VoidStmt node.
-
#When(arguments, statements, consequent) ⇒ Object
Create a new When node.
-
#WhileNode(predicate, statements) ⇒ Object
Create a new WhileNode node.
-
#Word(parts) ⇒ Object
Create a new Word node.
-
#Words(beginning, elements) ⇒ Object
Create a new Words node.
-
#WordsBeg(value) ⇒ Object
Create a new WordsBeg node.
-
#XString(parts) ⇒ Object
Create a new XString node.
-
#XStringLiteral(parts) ⇒ Object
Create a new XStringLiteral node.
-
#YieldNode(arguments) ⇒ Object
Create a new YieldNode node.
-
#ZSuper ⇒ Object
Create a new ZSuper node.
Instance Method Details
#AliasNode(left, right) ⇒ Object
Create a new AliasNode node.
35 36 37 |
# File 'lib/syntax_tree/dsl.rb', line 35 def AliasNode(left, right) AliasNode.new(left: left, right: right, location: Location.default) end |
#ARef(collection, index) ⇒ Object
Create a new ARef node.
40 41 42 |
# File 'lib/syntax_tree/dsl.rb', line 40 def ARef(collection, index) ARef.new(collection: collection, index: index, location: Location.default) end |
#ARefField(collection, index) ⇒ Object
Create a new ARefField node.
45 46 47 48 49 50 51 |
# File 'lib/syntax_tree/dsl.rb', line 45 def ARefField(collection, index) ARefField.new( collection: collection, index: index, location: Location.default ) end |
#ArgBlock(value) ⇒ Object
Create a new ArgBlock node.
64 65 66 |
# File 'lib/syntax_tree/dsl.rb', line 64 def ArgBlock(value) ArgBlock.new(value: value, location: Location.default) end |
#ArgParen(arguments) ⇒ Object
Create a new ArgParen node.
54 55 56 |
# File 'lib/syntax_tree/dsl.rb', line 54 def ArgParen(arguments) ArgParen.new(arguments: arguments, location: Location.default) end |
#Args(parts) ⇒ Object
Create a new Args node.
59 60 61 |
# File 'lib/syntax_tree/dsl.rb', line 59 def Args(parts) Args.new(parts: parts, location: Location.default) end |
#ArgsForward ⇒ Object
Create a new ArgsForward node.
74 75 76 |
# File 'lib/syntax_tree/dsl.rb', line 74 def ArgsForward ArgsForward.new(location: Location.default) end |
#ArgStar(value) ⇒ Object
Create a new ArgStar node.
69 70 71 |
# File 'lib/syntax_tree/dsl.rb', line 69 def ArgStar(value) ArgStar.new(value: value, location: Location.default) end |
#ArrayLiteral(lbracket, contents) ⇒ Object
Create a new ArrayLiteral node.
79 80 81 82 83 84 85 |
# File 'lib/syntax_tree/dsl.rb', line 79 def ArrayLiteral(lbracket, contents) ArrayLiteral.new( lbracket: lbracket, contents: contents, location: Location.default ) end |
#AryPtn(constant, requireds, rest, posts) ⇒ Object
Create a new AryPtn node.
88 89 90 91 92 93 94 95 96 |
# File 'lib/syntax_tree/dsl.rb', line 88 def AryPtn(constant, requireds, rest, posts) AryPtn.new( constant: constant, requireds: requireds, rest: rest, posts: posts, location: Location.default ) end |
#Assign(target, value) ⇒ Object
Create a new Assign node.
99 100 101 |
# File 'lib/syntax_tree/dsl.rb', line 99 def Assign(target, value) Assign.new(target: target, value: value, location: Location.default) end |
#Assoc(key, value) ⇒ Object
Create a new Assoc node.
104 105 106 |
# File 'lib/syntax_tree/dsl.rb', line 104 def Assoc(key, value) Assoc.new(key: key, value: value, location: Location.default) end |
#AssocSplat(value) ⇒ Object
Create a new AssocSplat node.
109 110 111 |
# File 'lib/syntax_tree/dsl.rb', line 109 def AssocSplat(value) AssocSplat.new(value: value, location: Location.default) end |
#Backref(value) ⇒ Object
Create a new Backref node.
114 115 116 |
# File 'lib/syntax_tree/dsl.rb', line 114 def Backref(value) Backref.new(value: value, location: Location.default) end |
#Backtick(value) ⇒ Object
Create a new Backtick node.
119 120 121 |
# File 'lib/syntax_tree/dsl.rb', line 119 def Backtick(value) Backtick.new(value: value, location: Location.default) end |
#BareAssocHash(assocs) ⇒ Object
Create a new BareAssocHash node.
124 125 126 |
# File 'lib/syntax_tree/dsl.rb', line 124 def BareAssocHash(assocs) BareAssocHash.new(assocs: assocs, location: Location.default) end |
#Begin(bodystmt) ⇒ Object
Create a new Begin node.
129 130 131 |
# File 'lib/syntax_tree/dsl.rb', line 129 def Begin(bodystmt) Begin.new(bodystmt: bodystmt, location: Location.default) end |
#BEGINBlock(lbrace, statements) ⇒ Object
Create a new BEGINBlock node.
7 8 9 10 11 12 13 |
# File 'lib/syntax_tree/dsl.rb', line 7 def BEGINBlock(lbrace, statements) BEGINBlock.new( lbrace: lbrace, statements: statements, location: Location.default ) end |
#Binary(left, operator, right) ⇒ Object
Create a new Binary node.
139 140 141 142 143 144 145 146 |
# File 'lib/syntax_tree/dsl.rb', line 139 def Binary(left, operator, right) Binary.new( left: left, operator: operator, right: right, location: Location.default ) end |
#BlockArg(name) ⇒ Object
Create a new BlockArg node.
154 155 156 |
# File 'lib/syntax_tree/dsl.rb', line 154 def BlockArg(name) BlockArg.new(name: name, location: Location.default) end |
#BlockNode(opening, block_var, bodystmt) ⇒ Object
Create a new BlockNode node.
305 306 307 308 309 310 311 312 |
# File 'lib/syntax_tree/dsl.rb', line 305 def BlockNode(opening, block_var, bodystmt) BlockNode.new( opening: opening, block_var: block_var, bodystmt: bodystmt, location: Location.default ) end |
#BlockVar(params, locals) ⇒ Object
Create a new BlockVar node.
149 150 151 |
# File 'lib/syntax_tree/dsl.rb', line 149 def BlockVar(params, locals) BlockVar.new(params: params, locals: locals, location: Location.default) end |
#BodyStmt(statements, rescue_clause, else_keyword, else_clause, ensure_clause) ⇒ Object
Create a new BodyStmt node.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/syntax_tree/dsl.rb', line 159 def BodyStmt( statements, rescue_clause, else_keyword, else_clause, ensure_clause ) BodyStmt.new( statements: statements, rescue_clause: rescue_clause, else_keyword: else_keyword, else_clause: else_clause, ensure_clause: ensure_clause, location: Location.default ) end |
#Break(arguments) ⇒ Object
Create a new Break node.
177 178 179 |
# File 'lib/syntax_tree/dsl.rb', line 177 def Break(arguments) Break.new(arguments: arguments, location: Location.default) end |
#CallNode(receiver, operator, message, arguments) ⇒ Object
Create a new CallNode node.
182 183 184 185 186 187 188 189 190 |
# File 'lib/syntax_tree/dsl.rb', line 182 def CallNode(receiver, operator, , arguments) CallNode.new( receiver: receiver, operator: operator, message: , arguments: arguments, location: Location.default ) end |
#Case(keyword, value, consequent) ⇒ Object
Create a new Case node.
193 194 195 196 197 198 199 200 |
# File 'lib/syntax_tree/dsl.rb', line 193 def Case(keyword, value, consequent) Case.new( keyword: keyword, value: value, consequent: consequent, location: Location.default ) end |
#CHAR(value) ⇒ Object
Create a new CHAR node.
16 17 18 |
# File 'lib/syntax_tree/dsl.rb', line 16 def CHAR(value) CHAR.new(value: value, location: Location.default) end |
#ClassDeclaration(constant, superclass, bodystmt) ⇒ Object
Create a new ClassDeclaration node.
213 214 215 216 217 218 219 220 |
# File 'lib/syntax_tree/dsl.rb', line 213 def ClassDeclaration(constant, superclass, bodystmt) ClassDeclaration.new( constant: constant, superclass: superclass, bodystmt: bodystmt, location: Location.default ) end |
#Comma(value) ⇒ Object
Create a new Comma node.
223 224 225 |
# File 'lib/syntax_tree/dsl.rb', line 223 def Comma(value) Comma.new(value: value, location: Location.default) end |
#Command(message, arguments, block) ⇒ Object
Create a new Command node.
228 229 230 231 232 233 234 235 |
# File 'lib/syntax_tree/dsl.rb', line 228 def Command(, arguments, block) Command.new( message: , arguments: arguments, block: block, location: Location.default ) end |
#CommandCall(receiver, operator, message, arguments, block) ⇒ Object
Create a new CommandCall node.
238 239 240 241 242 243 244 245 246 247 |
# File 'lib/syntax_tree/dsl.rb', line 238 def CommandCall(receiver, operator, , arguments, block) CommandCall.new( receiver: receiver, operator: operator, message: , arguments: arguments, block: block, location: Location.default ) end |
#Comment(value, inline) ⇒ Object
Create a new Comment node.
250 251 252 |
# File 'lib/syntax_tree/dsl.rb', line 250 def Comment(value, inline) Comment.new(value: value, inline: inline, location: Location.default) end |
#Const(value) ⇒ Object
Create a new Const node.
255 256 257 |
# File 'lib/syntax_tree/dsl.rb', line 255 def Const(value) Const.new(value: value, location: Location.default) end |
#ConstPathField(parent, constant) ⇒ Object
Create a new ConstPathField node.
260 261 262 263 264 265 266 |
# File 'lib/syntax_tree/dsl.rb', line 260 def ConstPathField(parent, constant) ConstPathField.new( parent: parent, constant: constant, location: Location.default ) end |
#ConstPathRef(parent, constant) ⇒ Object
Create a new ConstPathRef node.
269 270 271 272 273 274 275 |
# File 'lib/syntax_tree/dsl.rb', line 269 def ConstPathRef(parent, constant) ConstPathRef.new( parent: parent, constant: constant, location: Location.default ) end |
#ConstRef(constant) ⇒ Object
Create a new ConstRef node.
278 279 280 |
# File 'lib/syntax_tree/dsl.rb', line 278 def ConstRef(constant) ConstRef.new(constant: constant, location: Location.default) end |
#CVar(value) ⇒ Object
Create a new CVar node.
283 284 285 |
# File 'lib/syntax_tree/dsl.rb', line 283 def CVar(value) CVar.new(value: value, location: Location.default) end |
#Defined(value) ⇒ Object
Create a new Defined node.
300 301 302 |
# File 'lib/syntax_tree/dsl.rb', line 300 def Defined(value) Defined.new(value: value, location: Location.default) end |
#DefNode(target, operator, name, params, bodystmt) ⇒ Object
Create a new DefNode node.
288 289 290 291 292 293 294 295 296 297 |
# File 'lib/syntax_tree/dsl.rb', line 288 def DefNode(target, operator, name, params, bodystmt) DefNode.new( target: target, operator: operator, name: name, params: params, bodystmt: bodystmt, location: Location.default ) end |
#DynaSymbol(parts, quote) ⇒ Object
Create a new DynaSymbol node.
325 326 327 |
# File 'lib/syntax_tree/dsl.rb', line 325 def DynaSymbol(parts, quote) DynaSymbol.new(parts: parts, quote: quote, location: Location.default) end |
#Else(keyword, statements) ⇒ Object
Create a new Else node.
330 331 332 333 334 335 336 |
# File 'lib/syntax_tree/dsl.rb', line 330 def Else(keyword, statements) Else.new( keyword: keyword, statements: statements, location: Location.default ) end |
#Elsif(predicate, statements, consequent) ⇒ Object
Create a new Elsif node.
339 340 341 342 343 344 345 346 |
# File 'lib/syntax_tree/dsl.rb', line 339 def Elsif(predicate, statements, consequent) Elsif.new( predicate: predicate, statements: statements, consequent: consequent, location: Location.default ) end |
#EmbDoc(value) ⇒ Object
Create a new EmbDoc node.
349 350 351 |
# File 'lib/syntax_tree/dsl.rb', line 349 def EmbDoc(value) EmbDoc.new(value: value, location: Location.default) end |
#EmbExprBeg(value) ⇒ Object
Create a new EmbExprBeg node.
354 355 356 |
# File 'lib/syntax_tree/dsl.rb', line 354 def EmbExprBeg(value) EmbExprBeg.new(value: value, location: Location.default) end |
#EmbExprEnd(value) ⇒ Object
Create a new EmbExprEnd node.
359 360 361 |
# File 'lib/syntax_tree/dsl.rb', line 359 def EmbExprEnd(value) EmbExprEnd.new(value: value, location: Location.default) end |
#EmbVar(value) ⇒ Object
Create a new EmbVar node.
364 365 366 |
# File 'lib/syntax_tree/dsl.rb', line 364 def EmbVar(value) EmbVar.new(value: value, location: Location.default) end |
#ENDBlock(lbrace, statements) ⇒ Object
Create a new ENDBlock node.
21 22 23 24 25 26 27 |
# File 'lib/syntax_tree/dsl.rb', line 21 def ENDBlock(lbrace, statements) ENDBlock.new( lbrace: lbrace, statements: statements, location: Location.default ) end |
#EndContent(value) ⇒ Object
Create a new EndContent node.
30 31 32 |
# File 'lib/syntax_tree/dsl.rb', line 30 def EndContent(value) EndContent.new(value: value, location: Location.default) end |
#Ensure(keyword, statements) ⇒ Object
Create a new Ensure node.
369 370 371 372 373 374 375 |
# File 'lib/syntax_tree/dsl.rb', line 369 def Ensure(keyword, statements) Ensure.new( keyword: keyword, statements: statements, location: Location.default ) end |
#ExcessedComma(value) ⇒ Object
Create a new ExcessedComma node.
378 379 380 |
# File 'lib/syntax_tree/dsl.rb', line 378 def ExcessedComma(value) ExcessedComma.new(value: value, location: Location.default) end |
#Field(parent, operator, name) ⇒ Object
Create a new Field node.
383 384 385 386 387 388 389 390 |
# File 'lib/syntax_tree/dsl.rb', line 383 def Field(parent, operator, name) Field.new( parent: parent, operator: operator, name: name, location: Location.default ) end |
#FloatLiteral(value) ⇒ Object
Create a new FloatLiteral node.
393 394 395 |
# File 'lib/syntax_tree/dsl.rb', line 393 def FloatLiteral(value) FloatLiteral.new(value: value, location: Location.default) end |
#FndPtn(constant, left, values, right) ⇒ Object
Create a new FndPtn node.
398 399 400 401 402 403 404 405 406 |
# File 'lib/syntax_tree/dsl.rb', line 398 def FndPtn(constant, left, values, right) FndPtn.new( constant: constant, left: left, values: values, right: right, location: Location.default ) end |
#For(index, collection, statements) ⇒ Object
Create a new For node.
409 410 411 412 413 414 415 416 |
# File 'lib/syntax_tree/dsl.rb', line 409 def For(index, collection, statements) For.new( index: index, collection: collection, statements: statements, location: Location.default ) end |
#GVar(value) ⇒ Object
Create a new GVar node.
419 420 421 |
# File 'lib/syntax_tree/dsl.rb', line 419 def GVar(value) GVar.new(value: value, location: Location.default) end |
#HashLiteral(lbrace, assocs) ⇒ Object
Create a new HashLiteral node.
424 425 426 427 428 429 430 |
# File 'lib/syntax_tree/dsl.rb', line 424 def HashLiteral(lbrace, assocs) HashLiteral.new( lbrace: lbrace, assocs: assocs, location: Location.default ) end |
#Heredoc(beginning, ending, dedent, parts) ⇒ Object
Create a new Heredoc node.
433 434 435 436 437 438 439 440 441 |
# File 'lib/syntax_tree/dsl.rb', line 433 def Heredoc(beginning, ending, dedent, parts) Heredoc.new( beginning: beginning, ending: ending, dedent: dedent, parts: parts, location: Location.default ) end |
#HeredocBeg(value) ⇒ Object
Create a new HeredocBeg node.
444 445 446 |
# File 'lib/syntax_tree/dsl.rb', line 444 def HeredocBeg(value) HeredocBeg.new(value: value, location: Location.default) end |
#HeredocEnd(value) ⇒ Object
Create a new HeredocEnd node.
449 450 451 |
# File 'lib/syntax_tree/dsl.rb', line 449 def HeredocEnd(value) HeredocEnd.new(value: value, location: Location.default) end |
#HshPtn(constant, keywords, keyword_rest) ⇒ Object
Create a new HshPtn node.
454 455 456 457 458 459 460 461 |
# File 'lib/syntax_tree/dsl.rb', line 454 def HshPtn(constant, keywords, keyword_rest) HshPtn.new( constant: constant, keywords: keywords, keyword_rest: keyword_rest, location: Location.default ) end |
#Ident(value) ⇒ Object
Create a new Ident node.
464 465 466 |
# File 'lib/syntax_tree/dsl.rb', line 464 def Ident(value) Ident.new(value: value, location: Location.default) end |
#IfNode(predicate, statements, consequent) ⇒ Object
Create a new IfNode node.
469 470 471 472 473 474 475 476 |
# File 'lib/syntax_tree/dsl.rb', line 469 def IfNode(predicate, statements, consequent) IfNode.new( predicate: predicate, statements: statements, consequent: consequent, location: Location.default ) end |
#IfOp(predicate, truthy, falsy) ⇒ Object
Create a new IfOp node.
479 480 481 482 483 484 485 486 |
# File 'lib/syntax_tree/dsl.rb', line 479 def IfOp(predicate, truthy, falsy) IfOp.new( predicate: predicate, truthy: truthy, falsy: falsy, location: Location.default ) end |
#Imaginary(value) ⇒ Object
Create a new Imaginary node.
489 490 491 |
# File 'lib/syntax_tree/dsl.rb', line 489 def Imaginary(value) Imaginary.new(value: value, location: Location.default) end |
#In(pattern, statements, consequent) ⇒ Object
Create a new In node.
494 495 496 497 498 499 500 501 |
# File 'lib/syntax_tree/dsl.rb', line 494 def In(pattern, statements, consequent) In.new( pattern: pattern, statements: statements, consequent: consequent, location: Location.default ) end |
#Int(value) ⇒ Object
Create a new Int node.
504 505 506 |
# File 'lib/syntax_tree/dsl.rb', line 504 def Int(value) Int.new(value: value, location: Location.default) end |
#IVar(value) ⇒ Object
Create a new IVar node.
509 510 511 |
# File 'lib/syntax_tree/dsl.rb', line 509 def IVar(value) IVar.new(value: value, location: Location.default) end |
#Kw(value) ⇒ Object
Create a new Kw node.
514 515 516 |
# File 'lib/syntax_tree/dsl.rb', line 514 def Kw(value) Kw.new(value: value, location: Location.default) end |
#KwRestParam(name) ⇒ Object
Create a new KwRestParam node.
519 520 521 |
# File 'lib/syntax_tree/dsl.rb', line 519 def KwRestParam(name) KwRestParam.new(name: name, location: Location.default) end |
#Label(value) ⇒ Object
Create a new Label node.
524 525 526 |
# File 'lib/syntax_tree/dsl.rb', line 524 def Label(value) Label.new(value: value, location: Location.default) end |
#LabelEnd(value) ⇒ Object
Create a new LabelEnd node.
529 530 531 |
# File 'lib/syntax_tree/dsl.rb', line 529 def LabelEnd(value) LabelEnd.new(value: value, location: Location.default) end |
#Lambda(params, statements) ⇒ Object
Create a new Lambda node.
534 535 536 537 538 539 540 |
# File 'lib/syntax_tree/dsl.rb', line 534 def Lambda(params, statements) Lambda.new( params: params, statements: statements, location: Location.default ) end |
#LambdaVar(params, locals) ⇒ Object
Create a new LambdaVar node.
543 544 545 |
# File 'lib/syntax_tree/dsl.rb', line 543 def LambdaVar(params, locals) LambdaVar.new(params: params, locals: locals, location: Location.default) end |
#LBrace(value) ⇒ Object
Create a new LBrace node.
548 549 550 |
# File 'lib/syntax_tree/dsl.rb', line 548 def LBrace(value) LBrace.new(value: value, location: Location.default) end |
#LBracket(value) ⇒ Object
Create a new LBracket node.
553 554 555 |
# File 'lib/syntax_tree/dsl.rb', line 553 def LBracket(value) LBracket.new(value: value, location: Location.default) end |
#LParen(value) ⇒ Object
Create a new LParen node.
558 559 560 |
# File 'lib/syntax_tree/dsl.rb', line 558 def LParen(value) LParen.new(value: value, location: Location.default) end |
#MAssign(target, value) ⇒ Object
Create a new MAssign node.
563 564 565 |
# File 'lib/syntax_tree/dsl.rb', line 563 def MAssign(target, value) MAssign.new(target: target, value: value, location: Location.default) end |
#MethodAddBlock(call, block) ⇒ Object
Create a new MethodAddBlock node.
568 569 570 |
# File 'lib/syntax_tree/dsl.rb', line 568 def MethodAddBlock(call, block) MethodAddBlock.new(call: call, block: block, location: Location.default) end |
#MLHS(parts, comma) ⇒ Object
Create a new MLHS node.
573 574 575 |
# File 'lib/syntax_tree/dsl.rb', line 573 def MLHS(parts, comma) MLHS.new(parts: parts, comma: comma, location: Location.default) end |
#MLHSParen(contents, comma) ⇒ Object
Create a new MLHSParen node.
578 579 580 581 582 583 584 |
# File 'lib/syntax_tree/dsl.rb', line 578 def MLHSParen(contents, comma) MLHSParen.new( contents: contents, comma: comma, location: Location.default ) end |
#ModuleDeclaration(constant, bodystmt) ⇒ Object
Create a new ModuleDeclaration node.
587 588 589 590 591 592 593 |
# File 'lib/syntax_tree/dsl.rb', line 587 def ModuleDeclaration(constant, bodystmt) ModuleDeclaration.new( constant: constant, bodystmt: bodystmt, location: Location.default ) end |
#MRHS(parts) ⇒ Object
Create a new MRHS node.
596 597 598 |
# File 'lib/syntax_tree/dsl.rb', line 596 def MRHS(parts) MRHS.new(parts: parts, location: Location.default) end |
#Next(arguments) ⇒ Object
Create a new Next node.
601 602 603 |
# File 'lib/syntax_tree/dsl.rb', line 601 def Next(arguments) Next.new(arguments: arguments, location: Location.default) end |
#Not(statement, parentheses) ⇒ Object
Create a new Not node.
880 881 882 883 884 885 886 |
# File 'lib/syntax_tree/dsl.rb', line 880 def Not(statement, parentheses) Not.new( statement: statement, parentheses: parentheses, location: Location.default ) end |
#Op(value) ⇒ Object
Create a new Op node.
606 607 608 |
# File 'lib/syntax_tree/dsl.rb', line 606 def Op(value) Op.new(value: value, location: Location.default) end |
#OpAssign(target, operator, value) ⇒ Object
Create a new OpAssign node.
611 612 613 614 615 616 617 618 |
# File 'lib/syntax_tree/dsl.rb', line 611 def OpAssign(target, operator, value) OpAssign.new( target: target, operator: operator, value: value, location: Location.default ) end |
#Params(requireds, optionals, rest, posts, keywords, keyword_rest, block) ⇒ Object
Create a new Params node.
621 622 623 624 625 626 627 628 629 630 631 632 |
# File 'lib/syntax_tree/dsl.rb', line 621 def Params(requireds, optionals, rest, posts, keywords, keyword_rest, block) Params.new( requireds: requireds, optionals: optionals, rest: rest, posts: posts, keywords: keywords, keyword_rest: keyword_rest, block: block, location: Location.default ) end |
#Paren(lparen, contents) ⇒ Object
Create a new Paren node.
635 636 637 |
# File 'lib/syntax_tree/dsl.rb', line 635 def Paren(lparen, contents) Paren.new(lparen: lparen, contents: contents, location: Location.default) end |
#Period(value) ⇒ Object
Create a new Period node.
640 641 642 |
# File 'lib/syntax_tree/dsl.rb', line 640 def Period(value) Period.new(value: value, location: Location.default) end |
#PinnedBegin(statement) ⇒ Object
Create a new PinnedBegin node.
134 135 136 |
# File 'lib/syntax_tree/dsl.rb', line 134 def PinnedBegin(statement) PinnedBegin.new(statement: statement, location: Location.default) end |
#PinnedVarRef(value) ⇒ Object
Create a new PinnedVarRef node.
932 933 934 |
# File 'lib/syntax_tree/dsl.rb', line 932 def PinnedVarRef(value) PinnedVarRef.new(value: value, location: Location.default) end |
#Program(statements) ⇒ Object
Create a new Program node.
645 646 647 |
# File 'lib/syntax_tree/dsl.rb', line 645 def Program(statements) Program.new(statements: statements, location: Location.default) end |
#QSymbols(beginning, elements) ⇒ Object
Create a new QSymbols node.
650 651 652 653 654 655 656 |
# File 'lib/syntax_tree/dsl.rb', line 650 def QSymbols(beginning, elements) QSymbols.new( beginning: beginning, elements: elements, location: Location.default ) end |
#QSymbolsBeg(value) ⇒ Object
Create a new QSymbolsBeg node.
659 660 661 |
# File 'lib/syntax_tree/dsl.rb', line 659 def QSymbolsBeg(value) QSymbolsBeg.new(value: value, location: Location.default) end |
#QWords(beginning, elements) ⇒ Object
Create a new QWords node.
664 665 666 667 668 669 670 |
# File 'lib/syntax_tree/dsl.rb', line 664 def QWords(beginning, elements) QWords.new( beginning: beginning, elements: elements, location: Location.default ) end |
#QWordsBeg(value) ⇒ Object
Create a new QWordsBeg node.
673 674 675 |
# File 'lib/syntax_tree/dsl.rb', line 673 def QWordsBeg(value) QWordsBeg.new(value: value, location: Location.default) end |
#RangeNode(left, operator, right) ⇒ Object
Create a new RangeNode node.
315 316 317 318 319 320 321 322 |
# File 'lib/syntax_tree/dsl.rb', line 315 def RangeNode(left, operator, right) RangeNode.new( left: left, operator: operator, right: right, location: Location.default ) end |
#RAssign(value, operator, pattern) ⇒ Object
Create a new RAssign node.
203 204 205 206 207 208 209 210 |
# File 'lib/syntax_tree/dsl.rb', line 203 def RAssign(value, operator, pattern) RAssign.new( value: value, operator: operator, pattern: pattern, location: Location.default ) end |
#RationalLiteral(value) ⇒ Object
Create a new RationalLiteral node.
678 679 680 |
# File 'lib/syntax_tree/dsl.rb', line 678 def RationalLiteral(value) RationalLiteral.new(value: value, location: Location.default) end |
#RBrace(value) ⇒ Object
Create a new RBrace node.
683 684 685 |
# File 'lib/syntax_tree/dsl.rb', line 683 def RBrace(value) RBrace.new(value: value, location: Location.default) end |
#RBracket(value) ⇒ Object
Create a new RBracket node.
688 689 690 |
# File 'lib/syntax_tree/dsl.rb', line 688 def RBracket(value) RBracket.new(value: value, location: Location.default) end |
#Redo ⇒ Object
Create a new Redo node.
693 694 695 |
# File 'lib/syntax_tree/dsl.rb', line 693 def Redo Redo.new(location: Location.default) end |
#RegexpBeg(value) ⇒ Object
Create a new RegexpBeg node.
707 708 709 |
# File 'lib/syntax_tree/dsl.rb', line 707 def RegexpBeg(value) RegexpBeg.new(value: value, location: Location.default) end |
#RegexpContent(beginning, parts) ⇒ Object
Create a new RegexpContent node.
698 699 700 701 702 703 704 |
# File 'lib/syntax_tree/dsl.rb', line 698 def RegexpContent(beginning, parts) RegexpContent.new( beginning: beginning, parts: parts, location: Location.default ) end |
#RegexpEnd(value) ⇒ Object
Create a new RegexpEnd node.
712 713 714 |
# File 'lib/syntax_tree/dsl.rb', line 712 def RegexpEnd(value) RegexpEnd.new(value: value, location: Location.default) end |
#RegexpLiteral(beginning, ending, parts) ⇒ Object
Create a new RegexpLiteral node.
717 718 719 720 721 722 723 724 |
# File 'lib/syntax_tree/dsl.rb', line 717 def RegexpLiteral(beginning, ending, parts) RegexpLiteral.new( beginning: beginning, ending: ending, parts: parts, location: Location.default ) end |
#Rescue(keyword, exception, statements, consequent) ⇒ Object
Create a new Rescue node.
736 737 738 739 740 741 742 743 744 |
# File 'lib/syntax_tree/dsl.rb', line 736 def Rescue(keyword, exception, statements, consequent) Rescue.new( keyword: keyword, exception: exception, statements: statements, consequent: consequent, location: Location.default ) end |
#RescueEx(exceptions, variable) ⇒ Object
Create a new RescueEx node.
727 728 729 730 731 732 733 |
# File 'lib/syntax_tree/dsl.rb', line 727 def RescueEx(exceptions, variable) RescueEx.new( exceptions: exceptions, variable: variable, location: Location.default ) end |
#RescueMod(statement, value) ⇒ Object
Create a new RescueMod node.
747 748 749 750 751 752 753 |
# File 'lib/syntax_tree/dsl.rb', line 747 def RescueMod(statement, value) RescueMod.new( statement: statement, value: value, location: Location.default ) end |
#RestParam(name) ⇒ Object
Create a new RestParam node.
756 757 758 |
# File 'lib/syntax_tree/dsl.rb', line 756 def RestParam(name) RestParam.new(name: name, location: Location.default) end |
#Retry ⇒ Object
Create a new Retry node.
761 762 763 |
# File 'lib/syntax_tree/dsl.rb', line 761 def Retry Retry.new(location: Location.default) end |
#ReturnNode(arguments) ⇒ Object
Create a new ReturnNode node.
766 767 768 |
# File 'lib/syntax_tree/dsl.rb', line 766 def ReturnNode(arguments) ReturnNode.new(arguments: arguments, location: Location.default) end |
#RParen(value) ⇒ Object
Create a new RParen node.
771 772 773 |
# File 'lib/syntax_tree/dsl.rb', line 771 def RParen(value) RParen.new(value: value, location: Location.default) end |
#SClass(target, bodystmt) ⇒ Object
Create a new SClass node.
776 777 778 |
# File 'lib/syntax_tree/dsl.rb', line 776 def SClass(target, bodystmt) SClass.new(target: target, bodystmt: bodystmt, location: Location.default) end |
#Statements(body) ⇒ Object
Create a new Statements node.
781 782 783 |
# File 'lib/syntax_tree/dsl.rb', line 781 def Statements(body) Statements.new(nil, body: body, location: Location.default) end |
#StringConcat(left, right) ⇒ Object
Create a new StringConcat node.
791 792 793 |
# File 'lib/syntax_tree/dsl.rb', line 791 def StringConcat(left, right) StringConcat.new(left: left, right: right, location: Location.default) end |
#StringContent(parts) ⇒ Object
Create a new StringContent node.
786 787 788 |
# File 'lib/syntax_tree/dsl.rb', line 786 def StringContent(parts) StringContent.new(parts: parts, location: Location.default) end |
#StringDVar(variable) ⇒ Object
Create a new StringDVar node.
796 797 798 |
# File 'lib/syntax_tree/dsl.rb', line 796 def StringDVar(variable) StringDVar.new(variable: variable, location: Location.default) end |
#StringEmbExpr(statements) ⇒ Object
Create a new StringEmbExpr node.
801 802 803 |
# File 'lib/syntax_tree/dsl.rb', line 801 def StringEmbExpr(statements) StringEmbExpr.new(statements: statements, location: Location.default) end |
#StringLiteral(parts, quote) ⇒ Object
Create a new StringLiteral node.
806 807 808 |
# File 'lib/syntax_tree/dsl.rb', line 806 def StringLiteral(parts, quote) StringLiteral.new(parts: parts, quote: quote, location: Location.default) end |
#Super(arguments) ⇒ Object
Create a new Super node.
811 812 813 |
# File 'lib/syntax_tree/dsl.rb', line 811 def Super(arguments) Super.new(arguments: arguments, location: Location.default) end |
#SymBeg(value) ⇒ Object
Create a new SymBeg node.
816 817 818 |
# File 'lib/syntax_tree/dsl.rb', line 816 def SymBeg(value) SymBeg.new(value: value, location: Location.default) end |
#SymbolContent(value) ⇒ Object
Create a new SymbolContent node.
821 822 823 |
# File 'lib/syntax_tree/dsl.rb', line 821 def SymbolContent(value) SymbolContent.new(value: value, location: Location.default) end |
#SymbolLiteral(value) ⇒ Object
Create a new SymbolLiteral node.
826 827 828 |
# File 'lib/syntax_tree/dsl.rb', line 826 def SymbolLiteral(value) SymbolLiteral.new(value: value, location: Location.default) end |
#Symbols(beginning, elements) ⇒ Object
Create a new Symbols node.
831 832 833 834 835 836 837 |
# File 'lib/syntax_tree/dsl.rb', line 831 def Symbols(beginning, elements) Symbols.new( beginning: beginning, elements: elements, location: Location.default ) end |
#SymbolsBeg(value) ⇒ Object
Create a new SymbolsBeg node.
840 841 842 |
# File 'lib/syntax_tree/dsl.rb', line 840 def SymbolsBeg(value) SymbolsBeg.new(value: value, location: Location.default) end |
#TLambda(value) ⇒ Object
Create a new TLambda node.
845 846 847 |
# File 'lib/syntax_tree/dsl.rb', line 845 def TLambda(value) TLambda.new(value: value, location: Location.default) end |
#TLamBeg(value) ⇒ Object
Create a new TLamBeg node.
850 851 852 |
# File 'lib/syntax_tree/dsl.rb', line 850 def TLamBeg(value) TLamBeg.new(value: value, location: Location.default) end |
#TopConstField(constant) ⇒ Object
Create a new TopConstField node.
855 856 857 |
# File 'lib/syntax_tree/dsl.rb', line 855 def TopConstField(constant) TopConstField.new(constant: constant, location: Location.default) end |
#TopConstRef(constant) ⇒ Object
Create a new TopConstRef node.
860 861 862 |
# File 'lib/syntax_tree/dsl.rb', line 860 def TopConstRef(constant) TopConstRef.new(constant: constant, location: Location.default) end |
#TStringBeg(value) ⇒ Object
Create a new TStringBeg node.
865 866 867 |
# File 'lib/syntax_tree/dsl.rb', line 865 def TStringBeg(value) TStringBeg.new(value: value, location: Location.default) end |
#TStringContent(value) ⇒ Object
Create a new TStringContent node.
870 871 872 |
# File 'lib/syntax_tree/dsl.rb', line 870 def TStringContent(value) TStringContent.new(value: value, location: Location.default) end |
#TStringEnd(value) ⇒ Object
Create a new TStringEnd node.
875 876 877 |
# File 'lib/syntax_tree/dsl.rb', line 875 def TStringEnd(value) TStringEnd.new(value: value, location: Location.default) end |
#Unary(operator, statement) ⇒ Object
Create a new Unary node.
889 890 891 892 893 894 895 |
# File 'lib/syntax_tree/dsl.rb', line 889 def Unary(operator, statement) Unary.new( operator: operator, statement: statement, location: Location.default ) end |
#Undef(symbols) ⇒ Object
Create a new Undef node.
898 899 900 |
# File 'lib/syntax_tree/dsl.rb', line 898 def Undef(symbols) Undef.new(symbols: symbols, location: Location.default) end |
#UnlessNode(predicate, statements, consequent) ⇒ Object
Create a new UnlessNode node.
903 904 905 906 907 908 909 910 |
# File 'lib/syntax_tree/dsl.rb', line 903 def UnlessNode(predicate, statements, consequent) UnlessNode.new( predicate: predicate, statements: statements, consequent: consequent, location: Location.default ) end |
#UntilNode(predicate, statements) ⇒ Object
Create a new UntilNode node.
913 914 915 916 917 918 919 |
# File 'lib/syntax_tree/dsl.rb', line 913 def UntilNode(predicate, statements) UntilNode.new( predicate: predicate, statements: statements, location: Location.default ) end |
#VarField(value) ⇒ Object
Create a new VarField node.
922 923 924 |
# File 'lib/syntax_tree/dsl.rb', line 922 def VarField(value) VarField.new(value: value, location: Location.default) end |
#VarRef(value) ⇒ Object
Create a new VarRef node.
927 928 929 |
# File 'lib/syntax_tree/dsl.rb', line 927 def VarRef(value) VarRef.new(value: value, location: Location.default) end |
#VCall(value) ⇒ Object
Create a new VCall node.
937 938 939 |
# File 'lib/syntax_tree/dsl.rb', line 937 def VCall(value) VCall.new(value: value, location: Location.default) end |
#VoidStmt ⇒ Object
Create a new VoidStmt node.
942 943 944 |
# File 'lib/syntax_tree/dsl.rb', line 942 def VoidStmt VoidStmt.new(location: Location.default) end |
#When(arguments, statements, consequent) ⇒ Object
Create a new When node.
947 948 949 950 951 952 953 954 |
# File 'lib/syntax_tree/dsl.rb', line 947 def When(arguments, statements, consequent) When.new( arguments: arguments, statements: statements, consequent: consequent, location: Location.default ) end |
#WhileNode(predicate, statements) ⇒ Object
Create a new WhileNode node.
957 958 959 960 961 962 963 |
# File 'lib/syntax_tree/dsl.rb', line 957 def WhileNode(predicate, statements) WhileNode.new( predicate: predicate, statements: statements, location: Location.default ) end |
#Word(parts) ⇒ Object
Create a new Word node.
966 967 968 |
# File 'lib/syntax_tree/dsl.rb', line 966 def Word(parts) Word.new(parts: parts, location: Location.default) end |
#Words(beginning, elements) ⇒ Object
Create a new Words node.
971 972 973 974 975 976 977 |
# File 'lib/syntax_tree/dsl.rb', line 971 def Words(beginning, elements) Words.new( beginning: beginning, elements: elements, location: Location.default ) end |
#WordsBeg(value) ⇒ Object
Create a new WordsBeg node.
980 981 982 |
# File 'lib/syntax_tree/dsl.rb', line 980 def WordsBeg(value) WordsBeg.new(value: value, location: Location.default) end |
#XString(parts) ⇒ Object
Create a new XString node.
985 986 987 |
# File 'lib/syntax_tree/dsl.rb', line 985 def XString(parts) XString.new(parts: parts, location: Location.default) end |
#XStringLiteral(parts) ⇒ Object
Create a new XStringLiteral node.
990 991 992 |
# File 'lib/syntax_tree/dsl.rb', line 990 def XStringLiteral(parts) XStringLiteral.new(parts: parts, location: Location.default) end |
#YieldNode(arguments) ⇒ Object
Create a new YieldNode node.
995 996 997 |
# File 'lib/syntax_tree/dsl.rb', line 995 def YieldNode(arguments) YieldNode.new(arguments: arguments, location: Location.default) end |
#ZSuper ⇒ Object
Create a new ZSuper node.
1000 1001 1002 |
# File 'lib/syntax_tree/dsl.rb', line 1000 def ZSuper ZSuper.new(location: Location.default) end |