diff --git a/src/parser.mly b/src/parser.mly index 69ef0dc8828e160ffd196338cdfa3b73edc9b9a1..6ee807dcde22a7be9b266a505cfa2a655a240c1a 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -817,12 +817,12 @@ sxNodeDecl: ; sxLocalNode: - TK_NODE sxIdent sxStaticParams sxParams TK_RETURNS sxParams sxOptSemicol - sxPragma sxLocals sxBody sxOptEndNode - { treat_node_decl true $2 $3 $4 $6 $9 $8 (fst $10) (snd $10) } - | TK_FUNCTION sxIdent sxStaticParams sxParams TK_RETURNS sxParams sxOptSemicol - sxPragma sxLocals sxBody sxOptEndNode - { treat_node_decl false $2 $3 $4 $6 $9 $8 (fst $10) (snd $10) } + TK_NODE sxIdent sxStaticParams sxParams TK_RETURNS sxParams sxPragma sxOptSemicol + sxLocals sxBody sxOptEndNode + { treat_node_decl true $2 $3 $4 $6 $9 $7 (fst $10) (snd $10) } + | TK_FUNCTION sxIdent sxStaticParams sxParams TK_RETURNS sxParams sxPragma sxOptSemicol + sxLocals sxBody sxOptEndNode + { treat_node_decl false $2 $3 $4 $6 $9 $7 (fst $10) (snd $10) } | TK_NODE sxIdent sxStaticParams sxNodeProfileOpt TK_EQ sxEffectiveNode sxOptSemicol { treat_node_alias true $2 $3 $4 $6 } diff --git a/src/test/should_work/packEnvTest/contractForElementSelectionInArray/main.lus b/src/test/should_work/packEnvTest/contractForElementSelectionInArray/main.lus index 4be4a0f03867eff35c6421b42f5befd0e99896a1..19c96fc4b371c69c10a8b9f8ba9e2e67223cd5e6 100644 --- a/src/test/should_work/packEnvTest/contractForElementSelectionInArray/main.lus +++ b/src/test/should_work/packEnvTest/contractForElementSelectionInArray/main.lus @@ -1,10 +1,18 @@ +package util + provides node igt(i, j: int) returns (res: bool); + body +node igt(i, j: int) returns (res: bool); +let + res = i > j; +tel +end --package intArray is packageTableau(int, 10, equals, gt); --package intArray is packageTableau(int, 10, Lustre::eq, Lustre::igt); --package intArray is packageTableau(int, 10, =, Lustre::igt); -package intArray is packageTableau(int, 10, =, >); +package intArray is packageTableau(int, 10, =, util::igt); package main uses intArray;--, intArray2, intArray3; diff --git a/src/test/test.res.exp b/src/test/test.res.exp index 53a5c09c56dc00d0252ccf506e7c2859e946a026..dc6e2fe025f391c4b03b3e0da2b7a970e4146882 100644 --- a/src/test/test.res.exp +++ b/src/test/test.res.exp @@ -6448,7 +6448,7 @@ tel ---------------------------------------------------------------------- ====> ../lus2lic -vl 3 --compile-all-items should_work/demo/Gyroscope2.lus Opening file should_work/demo/Gyroscope2.lus -*** Error in file "should_work/demo/Gyroscope2.lus", line 107, col 27 to 27, token ';': syntax error +*** Error in file "should_work/demo/Gyroscope2.lus", line 129, col 14 to 14, token '{': syntax error ---------------------------------------------------------------------- @@ -9930,7 +9930,7 @@ tel ---------------------------------------------------------------------- ====> ../lus2lic -vl 3 --compile-all-items should_work/lionel/Gyroscope.lus Opening file should_work/lionel/Gyroscope.lus -*** Error in file "should_work/lionel/Gyroscope.lus", line 49, col 25 to 25, token ';': syntax error +*** Error in file "should_work/lionel/Gyroscope.lus", line 128, col 17 to 17, token '{': syntax error ---------------------------------------------------------------------- @@ -12242,8 +12242,10 @@ Opening file should_work/packEnvTest/contractForElementSelectionInArray/main.lus *** SyntaxTab.create pass 2 init pack main export node main + init pack util + export node igt init pack intArray -*** Error in file "should_work/packEnvTest/contractForElementSelectionInArray/main.lus", line 7, col 9 to 16, token 'intArray': bad pack instance: model packageTableau undeclared +*** Error in file "should_work/packEnvTest/contractForElementSelectionInArray/main.lus", line 15, col 9 to 16, token 'intArray': bad pack instance: model packageTableau undeclared ----------------------------------------------------------------------