diff --git a/src/lic2soc.ml b/src/lic2soc.ml index 6ce04a9349b3413f8da878133665378db4961e7d..e29497d353bd856bc6018dfbf96c35f48fe82edf 100644 --- a/src/lic2soc.ml +++ b/src/lic2soc.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 10/01/2017 (at 17:27) by Erwan Jahier> *) +(** Time-stamp: <modified the 20/02/2017 (at 11:38) by Erwan Jahier> *) (* XXX ce module est mal écrit. A reprendre. (R1) *) @@ -418,9 +418,12 @@ let rec (is_a_sub_clock : Lic.clock -> Lic.clock -> bool) = *) let (clock_of_expr : Lic.val_exp -> Lic.clock) = function + | { ve_core = CallByPosLic({it=CALL _}, []) } -> + BaseLic (* the clock of a node with no arg is the base clock *) | { ve_core = CallByPosLic({it=CALL _}, args) } -> let clks = List.map (fun arg -> arg.ve_clk) args in let clks = List.flatten clks in + assert(clks<>[]); List.fold_left (fun ck1 ck2 -> if is_a_sub_clock ck1 ck2 then ck2 else diff --git a/src/lv6parser.mly b/src/lv6parser.mly index 4a36b71c3cbcba7c5ed11cfd293eaa7812dfc6bb..f740196f74f93e9797b0031dcefd8445aea01eae 100644 --- a/src/lv6parser.mly +++ b/src/lv6parser.mly @@ -1180,7 +1180,10 @@ CallByNameParam: ; /* WARNING ! : les listes sont créées à l'envers */ -ExpressionList: Expression +ExpressionList: + /* empty */ + { [] } + | Expression { [$1] } | ExpressionList TK_COMA Expression { $3::$1 } diff --git a/src/lv6version.ml b/src/lv6version.ml index 7f74b50f19a32105d874d0b250346894b6950817..e514b9975961bacd2adecd9a34816c67176f4664 100644 --- a/src/lv6version.ml +++ b/src/lv6version.ml @@ -1,7 +1,7 @@ (** Automatically generated from Makefile *) let tool = "lus2lic" let branch = "master" -let commit = "681" -let sha_1 = "2b8578b2a47f71b209731302d7216c1f25b600e7" +let commit = "682" +let sha_1 = "91120cfbec86724f356d936c3c991c01922002e7" let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")") let maintainer = "jahier@imag.fr" diff --git a/test/should_work/noinput.lus b/test/should_work/noinput.lus new file mode 100644 index 0000000000000000000000000000000000000000..2e1ec9b94b4bbf0449867637b06250a6fc1d6c62 --- /dev/null +++ b/test/should_work/noinput.lus @@ -0,0 +1,25 @@ +-- Time-stamp: <modified the 20/02/2017 (at 11:19) by Erwan Jahier> + + + +function foo() returns (x: bool); +let + x = true; +tel + +node bar(a: bool) returns (b: bool); +let + b = foo() -> pre a; +tel + + -- FIXME: + -- XXX: + +node noinput(x1,x2:int) returns (y:int); +let + y = x1+ if bar(x2<0) then 1 else 0; +tel + -- end of myplus + + -- comment + \ No newline at end of file diff --git a/test/should_work/sqrt.lus b/test/should_work/sqrt.lus new file mode 100644 index 0000000000000000000000000000000000000000..580f57a5fa3f95ecd76bb155bd65d71cc79cfa26 --- /dev/null +++ b/test/should_work/sqrt.lus @@ -0,0 +1,6 @@ +extern function sqrt(x:real) returns (y:real); + +node test_sqrt(x:real) returns (y:real); +let + y = sqrt(x); +tel \ No newline at end of file