Browse Source

Make sure sexpr gets stacked when followed by non-token.

For instance, with "(min 1.27mm)", we need to stack the
"min" token after hitting the space.
newinvert
Jeff Young 2 years ago
parent
commit
911a54ac82
  1. 26
      pcbnew/dialogs/panel_setup_rules.cpp

26
pcbnew/dialogs/panel_setup_rules.cpp

@ -312,16 +312,28 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
}
else if( c == ' ' )
{
if( context == SEXPR_OPEN && ( partial == wxT( "constraint" )
|| partial == wxT( "disallow" )
|| partial == wxT( "layer" )
|| partial == wxT( "severity" ) ) )
if( context == SEXPR_OPEN && !partial.IsEmpty() )
{
m_textEditor->AutoCompCancel();
sexprs.push( partial );
if( partial == wxT( "constraint" )
|| partial == wxT( "layer" )
|| partial == wxT( "severity" ) )
{
context = SEXPR_TOKEN;
}
else if( partial == wxT( "rule" )
|| partial == wxT( "condition" ) )
{
context = SEXPR_STRING;
}
else
{
context = NONE;
}
partial = wxEmptyString;
context = SEXPR_TOKEN;
continue;
}
else if( partial == wxT( "disallow" )
@ -336,9 +348,7 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
context = SEXPR_TOKEN;
continue;
}
else if( partial == wxT( "rule" )
|| partial == wxT( "assertion" )
|| partial == wxT( "condition" ) )
else if( partial == wxT( "assertion" ) )
{
m_textEditor->AutoCompCancel();
sexprs.push( partial );

Loading…
Cancel
Save