A small enhancement for CIF / less ignorant reader

The change is to allow lower-case cell and layer names when they
are separated from the command with a blank. So

"Layername XZY;": "L" is the command, "ayername" is ignored

BUT:

"L xyz;": "xyz" is not part of the command, but the layername.

Same for "DS".

This is a deviation from the "standard", but a useful one. Otherwise
case sensitivity cannot be maintained anymore in a CIF/Magic loop.
This commit is contained in:
Matthias Koefferlein 2019-11-29 01:15:06 +01:00
parent 0796b20c2d
commit 9fb73a3928
1 changed files with 7 additions and 2 deletions

View File

@ -106,10 +106,17 @@ CIFReader::warn (const std::string &msg)
void
CIFReader::skip_blanks()
{
bool had_space = false;
while (! m_stream.at_end ()) {
char c = m_stream.peek_char ();
if (isupper (c) || isdigit (c) || c == '-' || c == '(' || c == ')' || c == ';') {
return;
} else if (isspace (c)) {
had_space = true;
} else if (had_space) {
// an extension to allow lower-case cell and layer names and some more flexibility
// in general: after space (blank, tab ...) any character will end the sequence.
return;
}
m_stream.get_char ();
}
@ -536,8 +543,6 @@ CIFReader::read_cell (db::Layout &layout, db::Cell &cell, double sf, int level)
} else if (c == 'L') {
skip_blanks ();
++layer_specs;
std::string name = read_name ();