Specctra import: accept layer names like numbers (i.e. +12).

This commit is contained in:
jean-pierre charras 2017-03-20 19:50:07 +01:00
parent 230980fc9d
commit c2227abb36
2 changed files with 6 additions and 8 deletions

View File

@ -347,10 +347,7 @@ bool DSNLEXER::IsSymbol( int aTok )
// This is static and not inline to reduce code space.
// if aTok is >= 0, then it is a coincidental match to a keyword.
return aTok==DSN_SYMBOL
|| aTok==DSN_STRING
|| aTok>=0
;
return aTok==DSN_SYMBOL || aTok==DSN_STRING || aTok>=0;
}

View File

@ -1009,9 +1009,9 @@ void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR, boost::bad_poi
void SPECCTRA_DB::doPATH( PATH* growth ) throw( IO_ERROR )
{
T tok = NextTok();
T tok = NextTok();
if( !IsSymbol( tok ) )
if( !IsSymbol( tok ) && (int)tok != DSN_NUMBER ) // a layer name can be like a number like +12
Expecting( "layer_id" );
growth->layer_id = CurText();
@ -1084,7 +1084,7 @@ void SPECCTRA_DB::doCIRCLE( CIRCLE* growth ) throw( IO_ERROR )
{
T tok;
NeedSYMBOL();
NeedSYMBOLorNUMBER();
growth->layer_id = CurText();
if( NextTok() != T_NUMBER )
@ -2062,6 +2062,7 @@ L_done_that:
if( growth->shape )
Unexpected( tok );
break;
default:
// the example in the spec uses "circ" instead of "circle". Bad!
if( !strcmp( "circ", CurText() ) )
@ -2811,7 +2812,7 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IO_ERROR, boost::bad_pointer )
break;
case T_net:
NeedSYMBOL();
NeedSYMBOLorNUMBER();
growth->net_id = CurText();
NeedRIGHT();
break;