summaryrefslogtreecommitdiff
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-10 05:27:29 +0000
committerChris Lattner <sabre@nondot.org>2004-12-10 05:27:29 +0000
commitc6c9772823e1eed0ebb2c825fb652f2de8345160 (patch)
tree1b58023fbfb56ff82272336ffed8d0ef210e8890 /lib/AsmParser
parenta44f445d2ce16e54773c90dde6b1156a30cb7605 (diff)
Implement test/Feature/escaped_label.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/Lexer.l7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AsmParser/Lexer.l b/lib/AsmParser/Lexer.l
index 072bc159d83..da875be34bd 100644
--- a/lib/AsmParser/Lexer.l
+++ b/lib/AsmParser/Lexer.l
@@ -139,6 +139,7 @@ VarID %[-a-zA-Z$._][-a-zA-Z$._0-9]*
/* 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 @@ getelementptr { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); }
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