Skip to content

Commit

Permalink
[FEATURE] Add comment functionality to QgsExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 30, 2014
1 parent e48a6f6 commit 0a7facb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/qgsexpressionlexer.ll
Expand Up @@ -95,6 +95,8 @@ static QLocale cLocale("C");

%}

%s IN_COMMENT

white [ \t\r\n]+

non_ascii [\x80-\xFF]
Expand All @@ -117,6 +119,16 @@ string "'"{str_char}*"'"
%%
<INITIAL>{
"/*" BEGIN(IN_COMMENT);
}
<IN_COMMENT>{
"*/" BEGIN(INITIAL);
[^*\n]+ // eat comment in chunks
"*" // eat the lone star
\n yylineno++;
}
"NOT" { U_OP(uoNot); return NOT; }
"AND" { B_OP(boAnd); return AND; }
"OR" { B_OP(boOr); return OR; }
Expand Down Expand Up @@ -185,4 +197,5 @@ string "'"{str_char}*"'"
. { return Unknown_CHARACTER; }
%%

0 comments on commit 0a7facb

Please sign in to comment.