Convert overbar syntax in bus aliases.

Fixes https://gitlab.com/kicad/code/kicad/issues/8647
This commit is contained in:
Jeff Young 2021-06-21 20:03:32 +01:00
parent a31b667e2a
commit 6d223931fb
2 changed files with 20 additions and 4 deletions

View File

@ -63,4 +63,5 @@
//#define SEXPR_SCHEMATIC_FILE_VERSION 20210126 // Fix bug with writing pin uuids.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20210406 // Add schematic level uuids.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20210606 // Change overbar syntax from `~...~` to `~{...}`.
#define SEXPR_SCHEMATIC_FILE_VERSION 20210615 // Update overbar syntax in net names.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20210615 // Update overbar syntax in net names.
#define SEXPR_SCHEMATIC_FILE_VERSION 20210621 // Update overbar syntax in bus aliases.

View File

@ -3013,10 +3013,19 @@ void SCH_SEXPR_PARSER::parseBusAlias( SCH_SCREEN* aScreen )
wxCHECK( aScreen, /* void */ );
T token;
auto busAlias = std::make_shared<BUS_ALIAS>( aScreen );
std::shared_ptr<BUS_ALIAS> busAlias = std::make_shared<BUS_ALIAS>( aScreen );
wxString alias;
wxString member;
NeedSYMBOL();
busAlias->SetName( FromUTF8() );
alias = FromUTF8();
if( m_requiredVersion < 20210621 )
alias = ConvertToNewOverbarNotation( alias );
busAlias->SetName( alias );
NeedLEFT();
token = NextTok();
@ -3030,7 +3039,13 @@ void SCH_SEXPR_PARSER::parseBusAlias( SCH_SCREEN* aScreen )
if( !IsSymbol( token ) )
Expecting( "quoted string" );
busAlias->AddMember( FromUTF8() );
member = FromUTF8();
if( m_requiredVersion < 20210621 )
member = ConvertToNewOverbarNotation( member );
busAlias->AddMember( member );
token = NextTok();
}