lines 5 and 12 conflicting between themselves
https://play.crystal-lang.org/#/r/6ae2
module M1
macro included
def self.amberDestroyMethod : String
<<-AMBER_DESTROY
redirect_to action: :index, flash: {\"success\" => \"Deleted successfully.\"}
AMBER_DESTROY
end
def self.testMethod : String
required = [] of String
[{"1", "2", "3", "4"}].each do |name, t|
required << "output = #{t}::None"
end
required.join "\n "
end
end
end
module M2
include M1
end
Reduced:
macro foo
<<-X
a \"
X
end
But I don't understand what you are trying to do. Why do you use \" instead of "?
It doesn't really matter why one would write \" instead of ", it shouldn't really matter, because in the context of a heredoc neither of them should have any specific meaning, thus both should be equivalent. This seems to be a parser bug.
reducing incorrect, because removing line 12 or remove #{t} from 12th line - changes error message - two lines together reproducing original bug.
in real program, i moved self.amberDestroyMethod upper in code and bug dissapear.
and, yes - removing backslash also solves problem
why i do that - probably some kind of insanity.
Even this fails:
macro foo # syntax error: unterminated macro
<<-X
"
X
end
Most helpful comment
reducing incorrect, because removing line 12 or remove #{t} from 12th line - changes error message - two lines together reproducing original bug.
in real program, i moved self.amberDestroyMethod upper in code and bug dissapear.
and, yes - removing backslash also solves problem
why i do that - probably some kind of insanity.