Created
September 19, 2019 15:02
-
-
Save DarkDimius/bd9293f6150897f23fdc7fd85dcc973a to your computer and use it in GitHub Desktop.
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
class <emptyTree><<C <root>>> < () | |
a = "part 1 of heredoc ".concat("not a heredoc".+("eom part\n").to_s()).concat("\n").concat("eom part\n").concat("EOM\n").concat("part 2 of heredoc\n").to_s() | |
b = "oweqijfoiwjefqwoefij\n" | |
def foo<<C <todo sym>>>(&<blk>) | |
begin | |
c = "oqweijfoqwiejf\n" | |
<self>.puts(c) | |
end | |
end | |
<self>.puts(a) | |
<self>.puts(b) | |
<self>.foo() | |
end |
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
{ | |
"type" : "Begin", | |
"stmts" : [ | |
{ | |
"type" : "Assign", | |
"lhs" : { | |
"type" : "LVarLhs", | |
"name" : "a" | |
}, | |
"rhs" : { | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "String", | |
"val" : "part 1 of heredoc " | |
}, | |
{ | |
"type" : "Begin", | |
"stmts" : [ | |
{ | |
"type" : "Send", | |
"receiver" : { | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "String", | |
"val" : "not a heredoc" | |
} | |
] | |
}, | |
"method" : "+", | |
"args" : [ | |
{ | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "String", | |
"val" : "eom part\n" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"type" : "String", | |
"val" : "\n" | |
}, | |
{ | |
"type" : "String", | |
"val" : "eom part\n" | |
}, | |
{ | |
"type" : "String", | |
"val" : "EOM\n" | |
}, | |
{ | |
"type" : "String", | |
"val" : "part 2 of heredoc\n" | |
} | |
] | |
} | |
] | |
} | |
}, | |
{ | |
"type" : "Assign", | |
"lhs" : { | |
"type" : "LVarLhs", | |
"name" : "b" | |
}, | |
"rhs" : { | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "String", | |
"val" : "oweqijfoiwjefqwoefij\n" | |
} | |
] | |
} | |
] | |
} | |
}, | |
{ | |
"type" : "DefMethod", | |
"name" : "foo", | |
"args" : null, | |
"body" : { | |
"type" : "Begin", | |
"stmts" : [ | |
{ | |
"type" : "Assign", | |
"lhs" : { | |
"type" : "LVarLhs", | |
"name" : "c" | |
}, | |
"rhs" : { | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "DString", | |
"nodes" : [ | |
{ | |
"type" : "String", | |
"val" : "oqweijfoqwiejf\n" | |
} | |
] | |
} | |
] | |
} | |
}, | |
{ | |
"type" : "Send", | |
"receiver" : null, | |
"method" : "puts", | |
"args" : [ | |
{ | |
"type" : "LVar", | |
"name" : "c" | |
} | |
] | |
} | |
] | |
} | |
}, | |
{ | |
"type" : "Send", | |
"receiver" : null, | |
"method" : "puts", | |
"args" : [ | |
{ | |
"type" : "LVar", | |
"name" : "a" | |
} | |
] | |
}, | |
{ | |
"type" : "Send", | |
"receiver" : null, | |
"method" : "puts", | |
"args" : [ | |
{ | |
"type" : "LVar", | |
"name" : "b" | |
} | |
] | |
}, | |
{ | |
"type" : "Send", | |
"receiver" : null, | |
"method" : "foo", | |
"args" : [ | |
] | |
} | |
] | |
} |
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
a = <<EOD | |
part 1 of heredoc #{ "not a heredoc" + <<EOM } | |
eom part | |
EOM | |
part 2 of heredoc | |
EOD | |
b = <<-EOD | |
oweqijfoiwjefqwoefij | |
EOD | |
def foo | |
c = <<~EOD | |
oqweijfoqwiejf | |
EOD | |
puts c | |
end | |
puts a | |
puts b | |
foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment