Commit 5d97b2063952752024fe957efde492a7389c2b6b
1 parent
41f4765a
some bug fixes, there are still more to do.
Showing
3 changed files
with
12 additions
and
8 deletions
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | #include <expValue.h> | 5 | #include <expValue.h> |
6 | #include <block.h> | 6 | #include <block.h> |
7 | 7 | ||
8 | -s_ident * getVariable (s_block *, char *); | 8 | +s_ident * getVariable (s_identList *, char *); |
9 | s_ident * getArray (s_ident *, s_expVal *); | 9 | s_ident * getArray (s_ident *, s_expVal *); |
10 | 10 | ||
11 | #endif /* _VARIABLE_H_ */ | 11 | #endif /* _VARIABLE_H_ */ |
@@ -58,9 +58,13 @@ inline | @@ -58,9 +58,13 @@ inline | ||
58 | enqGlobId (s_stmtQueue * sQueue, char * id) | 58 | enqGlobId (s_stmtQueue * sQueue, char * id) |
59 | { | 59 | { |
60 | s_stmtQueue * ret = (sQueue == NULL) ? stmtQueueNew () : sQueue; | 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 | return ret; | 69 | return ret; |
66 | } | 70 | } |
@@ -363,7 +367,7 @@ genCastStringStmt (s_stmt * stmt) | @@ -363,7 +367,7 @@ genCastStringStmt (s_stmt * stmt) | ||
363 | %} | 367 | %} |
364 | 368 | ||
365 | %token STMT_END ';' REPEAT COUNT FOREACH AS IF ELSE BLOCK_END UNSET | 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 | %token <cPtr> IDENT | 371 | %token <cPtr> IDENT |
368 | %token <cPtr> HTML | 372 | %token <cPtr> HTML |
369 | %token <iVal> INT | 373 | %token <iVal> INT |
@@ -399,7 +403,6 @@ genCastStringStmt (s_stmt * stmt) | @@ -399,7 +403,6 @@ genCastStringStmt (s_stmt * stmt) | ||
399 | %type <stmt> expr; | 403 | %type <stmt> expr; |
400 | %type <stmt> html; | 404 | %type <stmt> html; |
401 | %type <stmt> block_stmt; | 405 | %type <stmt> block_stmt; |
402 | -%type <stmt> gdecl_block; | ||
403 | %type <stmt> simple_stmt; | 406 | %type <stmt> simple_stmt; |
404 | %type <stmt> if_stmt; | 407 | %type <stmt> if_stmt; |
405 | %type <stmt> rep_stmt; | 408 | %type <stmt> rep_stmt; |
@@ -408,6 +411,7 @@ genCastStringStmt (s_stmt * stmt) | @@ -408,6 +411,7 @@ genCastStringStmt (s_stmt * stmt) | ||
408 | %type <sQue> stmt_queue; | 411 | %type <sQue> stmt_queue; |
409 | %type <sQue> block_queue; | 412 | %type <sQue> block_queue; |
410 | %type <sQue> glob_decl; | 413 | %type <sQue> glob_decl; |
414 | +%type <sQue> gdecl_block; | ||
411 | 415 | ||
412 | %expect 1 | 416 | %expect 1 |
413 | 417 | ||
@@ -459,7 +463,7 @@ block_queue : stmt_queue { $$ = genBlockQue (NULL, $1); } | @@ -459,7 +463,7 @@ block_queue : stmt_queue { $$ = genBlockQue (NULL, $1); } | ||
459 | * ------ | 463 | * ------ |
460 | */ | 464 | */ |
461 | gdecl_block : GLOBAL ':' glob_decl BLOCK_END | 465 | gdecl_block : GLOBAL ':' glob_decl BLOCK_END |
462 | - { $$ = $3); } | 466 | + { $$ = $3; } |
463 | ; | 467 | ; |
464 | 468 | ||
465 | glob_decl : IDENT { $$ = enqGlobId (NULL, $1); } | 469 | glob_decl : IDENT { $$ = enqGlobId (NULL, $1); } |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | 8 | ||
9 | 9 | ||
10 | s_ident * | 10 | s_ident * |
11 | -getVariable (identList * iList, char * id) | 11 | +getVariable (s_identList * iList, char * id) |
12 | { | 12 | { |
13 | return identListSeekKey (iList, id); | 13 | return identListSeekKey (iList, id); |
14 | } | 14 | } |
@@ -20,7 +20,7 @@ getArray (s_ident * var, s_expVal * eVal) | @@ -20,7 +20,7 @@ getArray (s_ident * var, s_expVal * eVal) | ||
20 | 20 | ||
21 | /* generate new idl if ident isn't, discard prev val */ | 21 | /* generate new idl if ident isn't, discard prev val */ |
22 | if (identGetType (var) != ID_TYP_IDL) | 22 | if (identGetType (var) != ID_TYP_IDL) |
23 | - identSetIdl (var, identListNew (NULL)); | 23 | + identSetIdl (var, identListNew ()); |
24 | 24 | ||
25 | /* now seek or generate the actual ident */ | 25 | /* now seek or generate the actual ident */ |
26 | switch (expValueGetType (eVal)) | 26 | switch (expValueGetType (eVal)) |
Please
register
or
login
to post a comment