From 92f6f1058acaffc5f56130e36dbf4e26b9177155 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sun, 6 Feb 2011 20:53:36 -0800 Subject: [PATCH] Identifiers are case-insensitive in VHDL So translate them to lower case so that internally I don't have to constantly worry about it. Note that even keywords are case insensitive, so do the translation BEFORE the keyword check. --- vhdlpp/lexor.lex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vhdlpp/lexor.lex b/vhdlpp/lexor.lex index f00addcb9..5a22fc8a8 100644 --- a/vhdlpp/lexor.lex +++ b/vhdlpp/lexor.lex @@ -104,7 +104,7 @@ based_integer [0-9a-fA-F](_?[0-9a-fA-F])* return CHARACTER_LITERAL; } -(\"([^"]|(\"\"))*?\")|(\"[^\"]*\") { +(\"([^\"]|(\"\"))*?\")|(\"[^\"]*\") { /* first pattern: string literals with doubled quotation mark */ /* second pattern: string literals without doubled quotation */ yylval.text = escape_quot_and_dup(yytext); @@ -112,7 +112,9 @@ based_integer [0-9a-fA-F](_?[0-9a-fA-F])* return STRING_LITERAL; } -[a-zA-Z][a-zA-Z0-9_]* { +[a-zA-Z_][a-zA-Z0-9_]* { + for (char*cp = yytext ; *cp ; cp += 1) + *cp = tolower(*cp); int rc = lexor_keyword_code(yytext, yyleng); switch (rc) { case IDENTIFIER: