From: nishi Date: Tue, 4 Jun 2024 03:21:27 +0000 (+0000) Subject: will fix soon X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=81eaf5e789cf3637c3e785d060ec690a5bd0a7a4;p=dataworks.git will fix soon git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@142 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/Grammar/dw.l b/Grammar/dw.l index fb8cebd..c8f22c2 100644 --- a/Grammar/dw.l +++ b/Grammar/dw.l @@ -38,15 +38,18 @@ extern YYSTYPE yylval; ["][^"]*["] { yylval.node.string = strdup(yytext + 1); yylval.node.string[strlen(yylval.node.string) - 1] = 0; + yylval.node.nodes = NULL; return (STRING); } ['][^']*['] { yylval.node.string = strdup(yytext + 1); yylval.node.string[strlen(yylval.node.string) - 1] = 0; + yylval.node.nodes = NULL; return (STRING); } [a-zA-Z0-9_\-]+ { yylval.node.ident = strdup(yytext); + yylval.node.nodes = NULL; return (IDENTIFIER); } [\(\),] { diff --git a/Grammar/dw.y b/Grammar/dw.y index 7f48ad5..16785fe 100644 --- a/Grammar/dw.y +++ b/Grammar/dw.y @@ -38,6 +38,7 @@ struct Node { char* string; char* ident; + struct Node* nodes; } node; } @@ -50,10 +51,18 @@ argument ; single_argument - : SPACE argument SPACE - | SPACE argument - | argument SPACE - | argument + : SPACE argument SPACE { + $$ = $2; + } + | SPACE argument { + $$ = $2; + } + | argument SPACE { + $$ = $1; + } + | argument { + $$ = $1; + } ; arguments