Commit 5d97b2063952752024fe957efde492a7389c2b6b

Authored by Georg Hopp
1 parent 41f4765a

some bug fixes, there are still more to do.

... ... @@ -5,7 +5,7 @@
5 5 #include <expValue.h>
6 6 #include <block.h>
7 7
8   -s_ident * getVariable (s_block *, char *);
  8 +s_ident * getVariable (s_identList *, char *);
9 9 s_ident * getArray (s_ident *, s_expVal *);
10 10
11 11 #endif /* _VARIABLE_H_ */
... ...
... ... @@ -58,9 +58,13 @@ inline
58 58 enqGlobId (s_stmtQueue * sQueue, char * id)
59 59 {
60 60 s_stmtQueue * ret = (sQueue == NULL) ? stmtQueueNew () : sQueue;
61   - s_stmt * val = stmtNew (STMT_CONST, NULL, STYP_EVAL, (u_stmtType) id);
  61 + s_stmt * val = stmtNew (
  62 + STMT_CONST,
  63 + NULL,
  64 + STYP_EVAL,
  65 + (u_stmtType) expValueStringNew (id));
62 66
63   - stmtQueueEnqueue (ret, id);
  67 + stmtQueueEnqueue (ret, val);
64 68
65 69 return ret;
66 70 }
... ... @@ -363,7 +367,7 @@ genCastStringStmt (s_stmt * stmt)
363 367 %}
364 368
365 369 %token STMT_END ';' REPEAT COUNT FOREACH AS IF ELSE BLOCK_END UNSET
366   -%token ICAST FCAST SCAST GLOBAL /* for explicit casts */
  370 +%token ICAST FCAST SCAST GLOBAL PARENT /* for explicit casts */
367 371 %token <cPtr> IDENT
368 372 %token <cPtr> HTML
369 373 %token <iVal> INT
... ... @@ -399,7 +403,6 @@ genCastStringStmt (s_stmt * stmt)
399 403 %type <stmt> expr;
400 404 %type <stmt> html;
401 405 %type <stmt> block_stmt;
402   -%type <stmt> gdecl_block;
403 406 %type <stmt> simple_stmt;
404 407 %type <stmt> if_stmt;
405 408 %type <stmt> rep_stmt;
... ... @@ -408,6 +411,7 @@ genCastStringStmt (s_stmt * stmt)
408 411 %type <sQue> stmt_queue;
409 412 %type <sQue> block_queue;
410 413 %type <sQue> glob_decl;
  414 +%type <sQue> gdecl_block;
411 415
412 416 %expect 1
413 417
... ... @@ -459,7 +463,7 @@ block_queue : stmt_queue { $$ = genBlockQue (NULL, $1); }
459 463 * ------
460 464 */
461 465 gdecl_block : GLOBAL ':' glob_decl BLOCK_END
462   - { $$ = $3); }
  466 + { $$ = $3; }
463 467 ;
464 468
465 469 glob_decl : IDENT { $$ = enqGlobId (NULL, $1); }
... ...
... ... @@ -8,7 +8,7 @@
8 8
9 9
10 10 s_ident *
11   -getVariable (identList * iList, char * id)
  11 +getVariable (s_identList * iList, char * id)
12 12 {
13 13 return identListSeekKey (iList, id);
14 14 }
... ... @@ -20,7 +20,7 @@ getArray (s_ident * var, s_expVal * eVal)
20 20
21 21 /* generate new idl if ident isn't, discard prev val */
22 22 if (identGetType (var) != ID_TYP_IDL)
23   - identSetIdl (var, identListNew (NULL));
  23 + identSetIdl (var, identListNew ());
24 24
25 25 /* now seek or generate the actual ident */
26 26 switch (expValueGetType (eVal))
... ...
Please register or login to post a comment