diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-10-19 18:27:47 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-10-19 18:27:47 (GMT) |
commit | 05b2eb1b90620025ba9242477b0df688745dd0db (patch) | |
tree | cfa890ef8e4bb5182ba988cf817c482e2fc639e1 /parser.y | |
parent | 7c998717209c4ea3cd8edf329baa3e5040d15266 (diff) |
Clifford Wolf:
Fixed scalar subtraction
Fixed handling of -/+ scalar prefix
Fixed vector handling [0 1 2] doesn't work anymore now
git-svn-id: http://svn.clifford.at/openscad/trunk@109 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 24 |
1 files changed, 6 insertions, 18 deletions
@@ -22,6 +22,8 @@ #include "openscad.h" +int parser_error_pos = -1; + int parserlex(void); void yyerror(char const *s); @@ -79,7 +81,6 @@ public: %right '?' ':' %type <expr> expr -%type <value> vector_const %type <expr> vector_expr %type <inst> module_instantciation @@ -275,11 +276,6 @@ expr: $$->const_value = new Value(); $$->const_value->type = Value::VECTOR; } | - '[' vector_const ']' { - $$ = new Expression(); - $$->type = "C"; - $$->const_value = $2; - } | '[' vector_expr ']' { $$ = $2; } | @@ -400,18 +396,6 @@ expr: delete $3; } ; -vector_const: - TOK_NUMBER TOK_NUMBER { - $$ = new Value(); - $$->type = Value::VECTOR; - $$->vec.append(new Value($1)); - $$->vec.append(new Value($2)); - } | - vector_const TOK_NUMBER { - $$ = $1; - $$->vec.append(new Value($2)); - } ; - vector_expr: expr { $$ = new Expression(); @@ -504,6 +488,7 @@ const char *parser_input_buffer; AbstractModule *parse(const char *text, int debug) { lexerin = NULL; + parser_error_pos = -1; parser_input_buffer = text; module_stack.clear(); @@ -514,6 +499,9 @@ AbstractModule *parse(const char *text, int debug) lexerlex_destroy(); + if (module) + parser_error_pos = -1; + return module; } |