My ATG file defines a code block as
Codeblock = "<#" {anychar} "#>"
When the Coco generated parser comes across a block like this:
<#
a=5;
print "Hello world!";
#>
The token picks up
a=5;
print "Hello
This is exactly what I want.
However, when it comes across code like this:
<#
a=5;
print "Hello World";
#>
<#
b=5;
print "Foo Bar";
#>
The token, greedily picks up
a=5;
print "Hello World";
#>
<#
b=5;
print "Foo Bar";
How can I let Coco/R know not to do this?
try this:
by making anychar ended with ";" then cocor cannot mistakenly parse anychar with this pattern "#> <#"