void () { doTest("\"\\{}\"", "STRING_TEMPLATE_BEGIN ('\"\\{')\nSTRING_TEMPLATE_END ('}\"')"); doTest("\"\"\"\n\\{}\"\"\"", "TEXT_BLOCK_TEMPLATE_BEGIN ('\"\"\"\\n\\{')\nTEXT_BLOCK_TEMPLATE_END ('}\"\"\"')"); doTest("\"\\{123}\"", "STRING_TEMPLATE_BEGIN ('\"\\{')\nINTEGER_LITERAL ('123')\nSTRING_TEMPLATE_END ('}\"')"); doTest("\"\"\"\n\\{123}\"\"\"", "TEXT_BLOCK_TEMPLATE_BEGIN ('\"\"\"\\n\\{')\nINTEGER_LITERAL ('123')\nTEXT_BLOCK_TEMPLATE_END ('}\"\"\"')"); doTest("\"\\{new int[][] {{}}}\"", """ STRING_TEMPLATE_BEGIN ('"\\{') NEW_KEYWORD ('new') WHITE_SPACE (' ') INT_KEYWORD ('int') LBRACKET ('[') RBRACKET (']') LBRACKET ('[') RBRACKET (']') WHITE_SPACE (' ') LBRACE ('{') LBRACE ('{') RBRACE ('}') RBRACE ('}') STRING_TEMPLATE_END ('}"')"""); doTest("\"\"\"\n\\{new int[][] {{}}}\"\"\"", """ TEXT_BLOCK_TEMPLATE_BEGIN ('""\"\\n\\{') NEW_KEYWORD ('new') WHITE_SPACE (' ') INT_KEYWORD ('int') LBRACKET ('[') RBRACKET (']') LBRACKET ('[') RBRACKET (']') WHITE_SPACE (' ') LBRACE ('{') LBRACE ('{') RBRACE ('}') RBRACE ('}') TEXT_BLOCK_TEMPLATE_END ('}""\"')"""); doTest("\"\\{x} + \\{y} = \\{x + y}\"", """ STRING_TEMPLATE_BEGIN ('"\\{') IDENTIFIER ('x') STRING_TEMPLATE_MID ('} + \\{') IDENTIFIER ('y') STRING_TEMPLATE_MID ('} = \\{') IDENTIFIER ('x') WHITE_SPACE (' ') PLUS ('+') WHITE_SPACE (' ') IDENTIFIER ('y') STRING_TEMPLATE_END ('}"')"""); doTest("\"\"\"\n\\{x} +\n \\{y} = \\{x + y}\"\"\"", """ TEXT_BLOCK_TEMPLATE_BEGIN ('""\"\\n\\{') IDENTIFIER ('x') TEXT_BLOCK_TEMPLATE_MID ('} +\\n \\{') IDENTIFIER ('y') TEXT_BLOCK_TEMPLATE_MID ('} = \\{') IDENTIFIER ('x') WHITE_SPACE (' ') PLUS ('+') WHITE_SPACE (' ') IDENTIFIER ('y') TEXT_BLOCK_TEMPLATE_END ('}""\"')"""); doTest("\"\\{}\" }