summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-23 23:35:16 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-23 23:35:16 +0000
commit90654fd9248b543ab254d7e8e6280b39ea80e3ce (patch)
tree7a6d5c8884df6fe7c40b74f44234f47518cd707f /tools
parentb98c67232854ccbb0bec50f266d3a23d4c18fe86 (diff)
downloadllvm-90654fd9248b543ab254d7e8e6280b39ea80e3ce.tar.gz
llvm-90654fd9248b543ab254d7e8e6280b39ea80e3ce.tar.bz2
llvm-90654fd9248b543ab254d7e8e6280b39ea80e3ce.tar.xz
Handle space, separators, bad substitutions, and library search path better
than before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvmc/ConfigLexer.l13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/llvmc/ConfigLexer.l b/tools/llvmc/ConfigLexer.l
index 6633156eb3..4589d4821a 100644
--- a/tools/llvmc/ConfigLexer.l
+++ b/tools/llvmc/ConfigLexer.l
@@ -79,6 +79,7 @@ inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token)
ASSEMBLER assembler|Assembler|ASSEMBLER
COMMAND command|Command|COMMAND
LANG lang|Lang|LANG
+LIBS libs|Libs|LIBS
LINKER linker|Linker|LINKER
NAME name|Name|NAME
OPT1 opt1|Opt1|OPT1
@@ -100,7 +101,7 @@ False false|False|FALSE|off|Off|OFF|no|No|NO
Bytecode bc|BC|bytecode|Bytecode|BYTECODE
Assembly asm|ASM|assembly|Assembly|ASSEMBLY
-BadSubst \%[^iots][a-zA-Z]\%
+BadSubst \%[a-zA-Z]*\%
Comment \#[^\r\n]*\r?\n
NewLine \r?\n
Eq \=
@@ -113,7 +114,7 @@ White [ \t]*
%%
-{White} { /* Ignore whitespace */ }
+{White} { if (ConfigLexerState.in_value) return SPACE; }
{Comment} { /* Ignore comments */
ConfigLexerState.in_value = false;
@@ -134,9 +135,12 @@ White [ \t]*
return EQUALS;
}
+{Sep} { return SEPARATOR; }
+
{VERSION} { return handleNameContext(VERSION_TOK); }
{LANG} { return handleNameContext(LANG); }
+{LIBS} { return handleNameContext(LIBS); }
{NAME} { return handleNameContext(NAME); }
{OPT1} { return handleNameContext(OPT1); }
{OPT2} { return handleNameContext(OPT2); }
@@ -173,7 +177,6 @@ White [ \t]*
%fOpts% { return handleSubstitution(FOPTS_SUBST); }
%MOpts% { return handleSubstitution(MOPTS_SUBST); }
%WOpts% { return handleSubstitution(WOPTS_SUBST); }
-{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); }
{Assembly} { return handleValueContext(ASSEMBLY); }
{Bytecode} { return handleValueContext(BYTECODE); }
@@ -186,8 +189,6 @@ White [ \t]*
--ConfigLexerState.StringVal.end());
return STRING;
}
-{Sep} { if (ConfigLexerState.in_value) { ConfigLexerState.StringVal = yytext;
- return OPTION; } }
-
+{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); }
%%