[Qgis-developer] QgsExpression: Comment support and unary minus
Radim Blazek
radim.blazek at gmail.com
Thu Nov 27 00:30:31 PST 2014
On Thu, Nov 27, 2014 at 9:14 AM, Matthias Kuhn <matthias.kuhn at gmx.ch> wrote:
> Hi all,
>
> I am working on introducing comment support for QgsExpressions (See
> below for examples). Line comments should be started with `--` (double
> minus) like in SQL. Running the test suite on this complains, because
> there is a test for unary minus that tests if `--1` evaluates properly.
> And that would be considered a comment after this change, currently it
> evaluates to 1 (Legitimate, but is that useful?).
> Question:
>
> * Is that a typo and it should actually be `-1`?
> * Is there a reason, that `--` as initial delimiter for line comments
> is not good?
Why not double slash '//' to keep block and line comments consistent.
Radim
> ------------------------
> Examples:
>
> Block comments:
>
> /*
> * Comment
> */
>
> And line comments:
>
> CASE
> WHEN name = 'QGIS' THEN 'Yay' -- Using the good stuff
> ELSE 'Nay' -- You can get it on http://qgis.org
> END
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
More information about the Qgis-developer
mailing list