From 17df76a965e08423c29ded0d62487f9092c8eed5 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Wed, 1 Jun 2011 14:50:18 +0200
Subject: [PATCH] Change the priority of TK_impk to parse expressions like "ok
 = x=1 => true;".

---
 release-lv6/Makefile                          |  2 +-
 src/Makefile                                  |  2 +-
 src/parser.mly                                |  3 ++-
 src/test/should_work/NONREG/impl_priority.lus |  4 ++++
 src/test/test.res.exp                         | 13 +++++++++++++
 src/test/test_ec.res.exp                      |  4 ++++
 src/test/test_lv4.res.exp                     |  5 +++++
 7 files changed, 30 insertions(+), 3 deletions(-)
 create mode 100644 src/test/should_work/NONREG/impl_priority.lus

diff --git a/release-lv6/Makefile b/release-lv6/Makefile
index 1f416178..8e45edb7 100644
--- a/release-lv6/Makefile
+++ b/release-lv6/Makefile
@@ -3,7 +3,7 @@
 LIC2CDIR=~/lic2loc
 LUS2LICDIR=~/lus2lic
 LUS2LIC=$(LUS2LICDIR)/src/lus2lic
-WWW_DIR=/usr/local/www/DIST-TOOLS/SYNCHRONE/lustre-v6
+WWW_DIR=/import/www/DIST-TOOLS/SYNCHRONE/lustre-v6
 
 ifeq ($(HOSTTYPE),cygwin)
 WWW_DIR=//ARPONT/www-verimag/DIST-TOOLS/SYNCHRONE/lustre-v6
diff --git a/src/Makefile b/src/Makefile
index dc6ec7d5..3619d0f8 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,6 +1,6 @@
 
 OCAMLMAKEFILE = ./OCamlMakefile
-RESULT=lus2lic
+RESULT=lus2lic$(EXE)
 
 LIBS = str unix
 
diff --git a/src/parser.mly b/src/parser.mly
index db6b4ac1..edb887d5 100644
--- a/src/parser.mly
+++ b/src/parser.mly
@@ -110,9 +110,10 @@ open ParserUtils
 %left TK_ARROW
 %nonassoc TK_STEP
 %nonassoc TK_CDOTS
+%right TK_IMPL
 %left TK_OR TK_XOR
 %left TK_AND
-%nonassoc TK_LT TK_LTE TK_EQ TK_GTE TK_GT TK_NEQ TK_IMPL 
+%nonassoc TK_LT TK_LTE TK_EQ TK_GTE TK_GT TK_NEQ  
 %nonassoc TK_NOT
 %left TK_PLUS TK_MINUS
 %left TK_STAR TK_SLASH TK_PCENT TK_MOD TK_DIV
diff --git a/src/test/should_work/NONREG/impl_priority.lus b/src/test/should_work/NONREG/impl_priority.lus
new file mode 100644
index 00000000..fffbc748
--- /dev/null
+++ b/src/test/should_work/NONREG/impl_priority.lus
@@ -0,0 +1,4 @@
+node test_impl_prio(x: int) returns (ok: bool)
+let
+  ok = x=1 => true;
+tel
diff --git a/src/test/test.res.exp b/src/test/test.res.exp
index 1d19efce..abb250c8 100644
--- a/src/test/test.res.exp
+++ b/src/test/test.res.exp
@@ -3317,6 +3317,19 @@ type A_A_A_int_4_4_4 = A_A_int_4_4^4;
 type A_A_int_4_4 = A_int_4^4;
 type A_int_4 = int^4;
 
+----------------------------------------------------------------------
+====> ../lus2lic -vl 2 --nonreg-test should_work/NONREG/impl_priority.lus
+--	 ../lus2lic -vl 2 --nonreg-test should_work/NONREG/impl_priority.lus
+
+node impl_priority::test_impl_prio(x:int) returns (ok:bool);
+var
+   _v_1:bool;
+let
+   ok = _v_1 => true;
+   _v_1 = x = 1;
+tel
+-- end of node impl_priority::test_impl_prio
+
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --nonreg-test should_work/NONREG/import1.lus
 --	 ../lus2lic -vl 2 --nonreg-test should_work/NONREG/import1.lus
diff --git a/src/test/test_ec.res.exp b/src/test/test_ec.res.exp
index a466933c..6223e86a 100644
--- a/src/test/test_ec.res.exp
+++ b/src/test/test_ec.res.exp
@@ -233,6 +233,10 @@ ec2c /tmp/xx.ec
 ====> ../lus2lic   --nonreg-test -ec should_work/NONREG/hanane.lus -o /tmp/xx.ec
 ec2c /tmp/xx.ec
 
+----------------------------------------------------------------------
+====> ../lus2lic   --nonreg-test -ec should_work/NONREG/impl_priority.lus -o /tmp/xx.ec
+ec2c /tmp/xx.ec
+
 ----------------------------------------------------------------------
 ====> ../lus2lic   --nonreg-test -ec should_work/NONREG/import1.lus -o /tmp/xx.ec
 ec2c /tmp/xx.ec
diff --git a/src/test/test_lv4.res.exp b/src/test/test_lv4.res.exp
index 9ce4862f..1e5f5f92 100644
--- a/src/test/test_lv4.res.exp
+++ b/src/test/test_lv4.res.exp
@@ -334,6 +334,11 @@ lus2ec /tmp/xx.lus fresh_name__fn
 lus2ec /tmp/xx.lus hanane__hanane
 --Pollux Version 2.3a
 
+----------------------------------------------------------------------
+====> ../lus2lic   --nonreg-test  -lv4 should_work/NONREG/impl_priority.lus -o /tmp/xx.lus
+lus2ec /tmp/xx.lus impl_priority__test_impl_prio
+--Pollux Version 2.3a
+
 ----------------------------------------------------------------------
 ====> ../lus2lic   --nonreg-test  -lv4 should_work/NONREG/import1.lus -o /tmp/xx.lus
 lus2ec /tmp/xx.lus import1__import1
-- 
GitLab