[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l
Chris Lattner
lattner at cs.uiuc.edu
Thu Dec 9 21:27:42 PST 2004
Changes in directory llvm/lib/AsmParser:
Lexer.l updated: 1.55 -> 1.56
---
Log message:
Implement test/Feature/escaped_label.ll
---
Diffs of the changes: (+7 -0)
Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.55 llvm/lib/AsmParser/Lexer.l:1.56
--- llvm/lib/AsmParser/Lexer.l:1.55 Sat Oct 16 13:17:13 2004
+++ llvm/lib/AsmParser/Lexer.l Thu Dec 9 23:27:29 2004
@@ -139,6 +139,7 @@
/* Label identifiers end with a colon */
Label [-a-zA-Z$._0-9]+:
+QuoteLabel \"[^\"]*\":
/* Quoted names can contain any character except " and \ */
StringConstant \"[^\"]*\"
@@ -269,6 +270,12 @@
llvmAsmlval.StrVal = strdup(yytext);
return LABELSTR;
}
+{QuoteLabel} {
+ yytext[strlen(yytext)-2] = 0; // nuke colon, end quote
+ UnEscapeLexed(yytext+1);
+ llvmAsmlval.StrVal = strdup(yytext+1);
+ return LABELSTR;
+ }
{StringConstant} { // Note that we cannot unescape a string constant here! The
// string constant might contain a \00 which would not be
More information about the llvm-commits
mailing list