void () { testParsing( """ public class X { // @start void main() { System.out.println("Hello"); // @replace substring="Hello" substring2='GoodBye' // @highlight type=underline System.out.println("Hello"); // @link type=pfff doubleReplace // @replace substring="Hello" regex="Hello" replacement="Hello" malformed // @replace regex="???" replacement="xyz" // @replace region="test region" startRegion // @end } // @end test } """, """ PlainText[range=(0,17), content=public class X { ] ErrorMarkup[range=(22,28), message=@start: missing 'region' attribute] PlainText[range=(29,29), content=] PlainText[range=(29,45), content= void main() { ] ErrorMarkup[range=(108,128), message=@replace: unsupported attribute: 'substring2'] ErrorMarkup[range=(81,128), message=@replace: missing 'replacement' attribute] PlainText[range=(45,78), content= System.out.println("Hello");\s ] ErrorMarkup[range=(147,161), message=@highlight: unknown type 'underline'; only 'bold', 'italic', and 'highlighted' are supported] Highlight[range=(136,161), selector=WholeLine[], region=null, type=HIGHLIGHTED] PlainText[range=(162,162), content=] ErrorMarkup[range=(198,213), message=@link: missing 'target' attribute] ErrorMarkup[range=(204,213), message=@link: unknown type 'pfff'; only 'link' and 'linkplain' are supported] PlainText[range=(162,195), content= System.out.println("Hello");\s ] ErrorMarkup[range=(262,275), message=@replace: either regex or substring should be specified but not both] PlainText[range=(214,232), content= doubleReplace\s ] ErrorMarkup[range=(322,333), message=@replace: malformed regular expression: Dangling meta character '?' near index 0 ??? ^] PlainText[range=(296,310), content= malformed\s ] ErrorMarkup[range=(359,388), message=@replace: missing 'replacement' attribute] StartRegion[range=(359,388), region=test region] PlainText[range=(389,389), content=] PlainText[range=(389,405), content= startRegion ] EndRegion[range=(412,416), region=null] PlainText[range=(417,417), content=] PlainText[range=(417,421), content= } ] ErrorMarkup[range=(431,435), message=@end: unsupported attribute: 'test'] EndRegion[range=(426,435), region=null] PlainText[range=(436,436), content=] PlainText[range=(436,438), content=} ] PlainText[range=(438,438), content=]"""); }