[OpenSCAD] Missing operators

Steven Dick kg4ydw at gmail.com
Mon Sep 13 13:22:01 CEST 2010


On Mon, Sep 13, 2010 at 4:54 AM, Giles Bathgate <giles.bathgate at gmail.com>wrote:

> Actually that fix wasn't ideal here is a better fix.
>
> diff --git a/src/lexer.l b/src/lexer.l
> index 48729c8..3550fe5 100644
> --- a/src/lexer.l
> +++ b/src/lexer.l
> @@ -138 +138 @@ use[ \t\r\n>]*"<"[^ \t\r\n>]+">" {
> -[0-9][0-9.]* { parserlval.number = QString(yytext).toDouble(); return
> TOK_NUMBER; }
> +"."?[0-9][0-9.]*
>
> That fix was not better than the first.

Actually, a bigger complaint is 0.4.4  is a number when it should not be.

I think a better fix is something like

[0-9]+|[0-9]+.[0-9]*|[0-9]*.[0-9]+

I'd be tempted to pull the correct one out of the C BNF or C lex file.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20100913/577b1751/attachment.html


More information about the OpenSCAD mailing list