bruns added inline comments.

INLINE COMMENTS

> michaelh wrote in advancedqueryparser.cpp:69
> 1. I misunderstood your description as ':=' should become '='.
> 
> > The lexer should not handle ">" and ">=" differently, both are (valid) 
> > tokens, and should be returned as such.
> 
> That is what I meant. I was confused by `parse()` lexing again when 
> encountering a '>'.
> 
> > Adding e.g. ">=" to the switch statement is not possible, as it works on 
> > QChar's.
> 
> I don't understand. token is QString. Why not instead of `switch 
> (token.at(0).toLatin1())`
> 
>   switch (token) {
>   case '>'`: comparator = Term::Greater; break;
>   case '>='`: comparator = Term::GreaterEqual; break;
> 
> What am I missing?

> I don't understand. token is QString. Why not instead of switch 
> (token.at(0).toLatin1())
> 
>   switch (token) {
>   case '>'`: comparator = Term::Greater; break;
>   case '>='`: comparator = Term::GreaterEqual; break;
> 
> 
> What am I missing?

You can only `switch` on integral statements (ints, chars, ...). With C++11, 
you can do some `constexpr` hacks, but your code won't work as is.

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D11888

To: bruns, #baloo, michaelh
Cc: #frameworks, ashaposhnikov, michaelh, astippich, spoorun, ngraham, alexeymin

Reply via email to