Permalink
Browse files

Simplify the condition syntax highlighting - proper list parsing will

have to wait
  • Loading branch information...
aelliott committed Apr 26, 2013
1 parent 51a97a4 commit 717fdd5aa2570bab14d82f93f3d18a843725f19c
Showing with 12 additions and 30 deletions.
  1. +12 −30 src/developer/conditioneditor.cpp
@@ -222,26 +222,14 @@ void ConditionEditor::handleLexeme(ConditionLexemes lexeme, int matchLength)
_tokens.push_back(token);
return;
case ListSeparator:
if(_wantsValue)
{
// Reject
token->lexeme = ConditionLexeme_Error;
token->description = tr("Unexpected list separator");
_tokens.push_back(token);
}
else
{
// Accept it
_tokens.push_back(token);
_wantsValue = true;
}
return;
case Comma:
// Reject it, we handle these in areas which accept them
token->lexeme = ConditionLexeme_Error;
token->description = tr("Unexpected comma");
_tokens.push_back(token);
return;
// Accept it
_tokens.push_back(token);
return;
case QuotedString:
// Accept it
_tokens.push_back(token);
@@ -285,27 +273,21 @@ void ConditionEditor::handleLexeme(ConditionLexemes lexeme, int matchLength)
case Minus:
case Divide:
case Times:
// Reject it, we handle these in areas which accept them
token->lexeme = ConditionLexeme_Error;
token->description = tr("Unexpected arithmetic operator");
_tokens.push_back(token);
return;
// Accept it
_tokens.push_back(token);
return;
case LessThan:
case LessThanEqualTo:
case GreaterThan:
case GreaterThanEqualTo:
// Reject it, we handle these in areas which accept them
token->lexeme = ConditionLexeme_Error;
token->description = tr("Unexpected comparison operator");
_tokens.push_back(token);
return;
// Accept it
_tokens.push_back(token);
return;
case Equals:
case NotEquals:
// Reject it, we handle these in areas which accept them
token->lexeme = ConditionLexeme_Error;
token->description = tr("Unexpected equality operator");
_tokens.push_back(token);
return;
// Accept it
_tokens.push_back(token);
return;
case EdgeTest:
// Accept it
_tokens.push_back(token);

0 comments on commit 717fdd5

Please sign in to comment.