aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/libparse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/techmap/libparse.cc')
-rw-r--r--passes/techmap/libparse.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/passes/techmap/libparse.cc b/passes/techmap/libparse.cc
index d3b1ff02f..3927a657b 100644
--- a/passes/techmap/libparse.cc
+++ b/passes/techmap/libparse.cc
@@ -90,11 +90,11 @@ int LibertyParser::lexer(std::string &str)
c = f.get();
} while (c == ' ' || c == '\t' || c == '\r');
- if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_' || c == '-' || c == '+' || c == '.') {
+ if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_' || c == '-' || c == '+' || c == '.' || c == '[' || c == ']') {
str = c;
while (1) {
c = f.get();
- if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_' || c == '-' || c == '+' || c == '.')
+ if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_' || c == '-' || c == '+' || c == '.' || c == '[' || c == ']')
str += c;
else
break;
@@ -159,7 +159,7 @@ int LibertyParser::lexer(std::string &str)
if (c == '\n') {
line++;
- return ';';
+ return 'n';
}
// if (c >= 32 && c < 255)
@@ -175,7 +175,7 @@ LibertyAst *LibertyParser::parse()
int tok = lexer(str);
- while (tok == ';')
+ while (tok == 'n')
tok = lexer(str);
if (tok == '}' || tok < 0)
@@ -194,6 +194,9 @@ LibertyAst *LibertyParser::parse()
if (tok == ';')
break;
+ if (tok == 'n')
+ continue;
+
if (tok == ':' && ast->value.empty()) {
tok = lexer(ast->value);
if (tok != 'v')
@@ -249,14 +252,14 @@ LibertyAst *LibertyParser::parse()
void LibertyParser::error()
{
- log_error("Syntax error in line %d.\n", line);
+ log_error("Syntax error in liberty file on line %d.\n", line);
}
#else
void LibertyParser::error()
{
- fprintf(stderr, "Syntax error in line %d.\n", line);
+ fprintf(stderr, "Syntax error in liberty file on line %d.\n", line);
exit(1);
}