diff --git a/src/lexer.l b/src/lexer.l index f1557ab9..b8a491e3 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -203,8 +203,7 @@ use[ \t\r\n>]*"<" { BEGIN(cond_use); } [\n\r\t ] -\/\/ { return COMMENT;} -"//"[^0-9"["] { yyless(2); BEGIN(cond_lcomment); stringcontents.clear(); return DCOMMENT;} +\/\/ { BEGIN(cond_lcomment); stringcontents.clear(); return COMMENT;} { \n { BEGIN(INITIAL); parserlval.text = strdup(stringcontents.c_str()); diff --git a/src/parser.y b/src/parser.y index 532dfb81..c9579287 100644 --- a/src/parser.y +++ b/src/parser.y @@ -178,6 +178,7 @@ annotations: $$->push_back(*$2); delete $2; } + ; annotation: TOK_ANNOTATION TOK_ID '(' arguments_call ')' @@ -185,6 +186,7 @@ annotation: $$ = Annotation::create($2, *$4); free($2); } + ; descriptions: description @@ -193,12 +195,13 @@ descriptions: $$->push_back(*$1); delete $1; } - + ; description: - DCOMMENT arguments_call + COMMENT arguments_call { $$ = Annotation::create("Description", *$2); } + ; parameters: parameter @@ -207,19 +210,14 @@ parameters: $$->push_back(*$1); delete $1; } - | - parameters parameter - { - $$ = $1; - $$->push_back(*$2); - delete $2; - } + ; parameter: COMMENT arguments_call { $$ = Annotation::create("Parameter", *$2); } + ; statement: ';' @@ -246,7 +244,7 @@ statement: $2->add_annotations($1); $2->add_annotations($3); } - + |descriptions | TOK_MODULE TOK_ID '(' arguments_decl optional_commas ')' { Module *newmodule = new Module();