Skip to content

Commit 0a7facb

Browse files
committedNov 30, 2014
[FEATURE] Add comment functionality to QgsExpression
1 parent e48a6f6 commit 0a7facb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎src/core/qgsexpressionlexer.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ static QLocale cLocale("C");
9595

9696
%}
9797

98+
%s IN_COMMENT
99+
98100
white [ \t\r\n]+
99101

100102
non_ascii [\x80-\xFF]
@@ -117,6 +119,16 @@ string "'"{str_char}*"'"
117119
118120
%%
119121
122+
<INITIAL>{
123+
"/*" BEGIN(IN_COMMENT);
124+
}
125+
<IN_COMMENT>{
126+
"*/" BEGIN(INITIAL);
127+
[^*\n]+ // eat comment in chunks
128+
"*" // eat the lone star
129+
\n yylineno++;
130+
}
131+
120132
"NOT" { U_OP(uoNot); return NOT; }
121133
"AND" { B_OP(boAnd); return AND; }
122134
"OR" { B_OP(boOr); return OR; }
@@ -185,4 +197,5 @@ string "'"{str_char}*"'"
185197
186198
. { return Unknown_CHARACTER; }
187199
200+
188201
%%

0 commit comments

Comments
 (0)
Please sign in to comment.