Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
lustre-v6
Commits
e74551e8
Commit
e74551e8
authored
7 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
Better error messages.
parent
6e914d04
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
_oasis
+1
-1
1 addition, 1 deletion
_oasis
src/evalType.ml
+11
-8
11 additions, 8 deletions
src/evalType.ml
src/licEvalType.ml
+7
-8
7 additions, 8 deletions
src/licEvalType.ml
src/lv6version.ml
+2
-2
2 additions, 2 deletions
src/lv6version.ml
test/lus2lic.sum
+12
-12
12 additions, 12 deletions
test/lus2lic.sum
with
33 additions
and
31 deletions
_oasis
+
1
−
1
View file @
e74551e8
OASISFormat: 0.4
Name: lustre-v6
Version: 1.69
7
Version: 1.69
8
Synopsis: The Lustre V6 Verimag compiler
Description: This package contains:
(1) lus2lic: the (current) name of the compiler (and interpreter via -exec).
...
...
This diff is collapsed.
Click to expand it.
src/evalType.ml
+
11
−
8
View file @
e74551e8
(** Time-stamp: <modified the 2
4/11
/201
6
(at
16:25
) by Erwan Jahier> *)
(** Time-stamp: <modified the 2
2/06
/201
7
(at
08:43
) by Erwan Jahier> *)
open
AstPredef
...
...
@@ -89,7 +89,7 @@ and eval_by_pos_type
let
t_args
=
List
.
flatten
t_argsl
in
let
llti
=
List
.
length
lti
and
lt_args
=
List
.
length
t_args
in
let
_
=
if
llti
<>
lt_args
then
raise_arity_error
""
lt_args
llti
raise_arity_error
(
fst
(
fst
node_key
))
lt_args
llti
in
(* lti = expecteds, t_args = given *)
let
tmatches
=
try
UnifyType
.
is_matched
lti
t_args
...
...
@@ -138,8 +138,11 @@ and eval_by_pos_type
else
raise_type_error
(
List
.
flatten
targs
)
[]
"two arrays of the same type was expected"
|
[
t1
;
t2
]
->
raise_type_error
(
List
.
flatten
targs
)
[]
" whereas 2 arrays were expected"
|
_
->
raise_arity_error
""
(
List
.
length
args
)
2
raise_arity_error
"
concat
"
(
List
.
length
args
)
2
in
None
,
args
,
tve
|
Lic
.
STRUCT_ACCESS
(
fid
)
->
...
...
@@ -157,7 +160,7 @@ and eval_by_pos_type
(
Lic
.
string_of_type
(
List
.
hd
targ
))))
)
|
[
x
]
->
raise_type_error
[
x
]
[]
"some struct type was expected"
|
x
->
raise_arity_error
""
(
List
.
length
x
)
1
|
x
->
raise_arity_error
"
struct access
"
(
List
.
length
x
)
1
in
None
,
[
arg
]
,
[
teff_field
]
|
Lic
.
ARRAY_ACCES
(
i
)
->
...
...
@@ -244,7 +247,7 @@ and eval_by_pos_type
in
match
targs
with
|
[
teff
]
->
None
,
args
,
teff
|
_
->
raise_arity_error
""
(
List
.
length
targs
)
1
|
_
->
raise_arity_error
"
when
"
(
List
.
length
targs
)
1
)
|
Lic
.
ARROW
|
Lic
.
FBY
->
(
...
...
@@ -252,20 +255,20 @@ and eval_by_pos_type
match
targs
with
|
[
init
;
teff
]
->
if
init
=
teff
then
None
,
args
,
teff
else
raise
(
EvalType_error
(
"type mismatch. "
))
|
_
->
raise_arity_error
""
(
List
.
length
targs
)
2
|
_
->
raise_arity_error
"
fby
"
(
List
.
length
targs
)
2
)
|
Lic
.
CURRENT
(
Some
_
)
->
(
let
args
,
targs
=
List
.
split
(
List
.
map
(
f
id_solver
)
args
)
in
match
targs
with
|
[
_
;
teff
]
->
None
,
args
,
teff
|
_
->
raise_arity_error
""
(
List
.
length
targs
)
2
|
_
->
raise_arity_error
"
current
"
(
List
.
length
targs
)
2
)
|
Lic
.
CURRENT
None
|
Lic
.
PRE
->
(
let
args
,
targs
=
List
.
split
(
List
.
map
(
f
id_solver
)
args
)
in
match
targs
with
|
[
teff
]
->
None
,
args
,
teff
|
_
->
raise_arity_error
""
(
List
.
length
targs
)
1
|
_
->
raise_arity_error
"
pre
"
(
List
.
length
targs
)
1
)
...
...
This diff is collapsed.
Click to expand it.
src/licEvalType.ml
+
7
−
8
View file @
e74551e8
(* Time-stamp: <modified the
30/11
/201
6
(at
16
:40) by Erwan Jahier> *)
(* Time-stamp: <modified the
22/06
/201
7
(at
08
:40) by Erwan Jahier> *)
open
AstPredef
open
Lxm
...
...
@@ -32,9 +32,8 @@ let raise_type_error
let
pr
=
Lic
.
string_of_type_list
prov
in
let
ex
=
Lic
.
string_of_type_list
expec
in
(
"
\n
*** type '"
^
pr
^
"' was provided"
^
(
if
ex
=
""
then
""
else
(
" whereas
\n
*** type '"
^
ex
^
"' was expected"
)
"'"
^
pr
^
"' was provided"
^
(
if
ex
=
""
then
""
else
(
" whereas
\n
*** type '"
^
ex
^
"' was expected"
)
)
^
(
if
msg
=
""
then
""
else
(
"
\n
*** "
^
msg
)
)
...
...
@@ -44,7 +43,7 @@ let raise_type_error
let
raise_arity_error
(
msg
:
string
)
(
get
:
int
)
(
expect
:
int
)
=
raise
(
EvalType_error
(
Printf
.
sprintf
"
\n
***
arity
error
%s: %d argument%s, whereas %d were expected"
Printf
.
sprintf
"
bad
arity
(
%s
)
: %d argument%s, whereas %d were expected"
msg
get
(
if
get
>
1
then
"s"
else
""
)
expect
))
(*********************************************************************************)
...
...
@@ -150,7 +149,7 @@ let condact_profile
Lv6Verbose
.
exe
~
flag
:
dbg
~
level
:
3
(
fun
()
->
Lv6Verbose
.
printf
" condact_profile: dflt=%s
\n
"
(
string_of_const_eff
dflt
));
let
_
=
if
(
dl
<>
ol
)
then
raise_arity_error
"
in condact default arg"
dl
ol
in
raise_arity_error
"in condact default arg"
dl
ol
in
let
out_types
=
List
.
map
(
fun
x
->
x
.
var_type_eff
)
outlist
in
let
_
=
if
dflt_types
<>
out_types
then
...
...
@@ -390,7 +389,7 @@ let f (id_solver: IdSolver.t) (op: op) (lxm: Lxm.t) : typer = fun ll ->
|
[[
Bool_type_eff
];
t
;
e
]
->
if
t
=
e
then
t
else
(
type_error
(
List
.
flatten
[[
Bool_type_eff
];
t
;
e
])
"bool*any*any"
)
|
x
->
(
raise_arity_error
""
(
List
.
length
x
)
3
)
|
x
->
(
raise_arity_error
"
if/then/else
"
(
List
.
length
x
)
3
)
)
|
(
NOR_n
|
DIESE_n
)
->
(* VERRUE 2 : cannot check the arity for them. *)
...
...
@@ -409,7 +408,7 @@ let f (id_solver: IdSolver.t) (op: op) (lxm: Lxm.t) : typer = fun ll ->
and
lto
=
List
.
map
(
fun
v
->
v
.
var_type_eff
)
node_eff
.
outlist_eff
in
let
l
=
List
.
flatten
ll
in
if
(
List
.
length
l
<>
List
.
length
lti
)
then
raise_arity_error
""
(
List
.
length
l
)
(
List
.
length
lti
)
raise_arity_error
(
op2string
op
)
(
List
.
length
l
)
(
List
.
length
lti
)
else
if
(
l
=
[]
)
then
(* useless to call UnifyType.f ! *)
lto
...
...
This diff is collapsed.
Click to expand it.
src/lv6version.ml
+
2
−
2
View file @
e74551e8
(** Automatically generated from Makefile *)
let
tool
=
"lus2lic"
let
branch
=
"master"
let
commit
=
"69
7
"
let
sha_1
=
"
2650f12bcd544dc9b308b2ffb31f2a4a7267bbcb
"
let
commit
=
"69
8
"
let
sha_1
=
"
6e914d041797511cf84b2a956827d355630bd3fc
"
let
str
=
(
branch
^
"."
^
commit
^
" ("
^
sha_1
^
")"
)
let
maintainer
=
"jahier@imag.fr"
This diff is collapsed.
Click to expand it.
test/lus2lic.sum
+
12
−
12
View file @
e74551e8
==> lus2lic0.sum <==
Test Run By jahier on
Wed
Jun 2
1 17:15:56
Test Run By jahier on
Thu
Jun 2
2 08:46:40
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic0 tests ===
...
...
@@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
==> lus2lic1.sum <==
Test Run By jahier on
Wed
Jun 2
1 17:15:57
Test Run By jahier on
Thu
Jun 2
2 08:46:41
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic1 tests ===
...
...
@@ -398,7 +398,7 @@ PASS: sh multipar.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
==> lus2lic2.sum <==
Test Run By jahier on
Wed
Jun 2
1 17:16:53
Test Run By jahier on
Thu
Jun 2
2 08:47:32
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic2 tests ===
...
...
@@ -738,7 +738,7 @@ PASS: sh zzz2.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {}
==> lus2lic3.sum <==
Test Run By jahier on
Wed
Jun 2
1 17:17:49
Test Run By jahier on
Thu
Jun 2
2 08:48:28
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic3 tests ===
...
...
@@ -1243,7 +1243,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test Run By jahier on
Wed
Jun 2
1 17:19:06
Test Run By jahier on
Thu
Jun 2
2 08:49:40
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic4 tests ===
...
...
@@ -1760,14 +1760,14 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
# of unexpected failures 6
===============================
# Total number of failures: 22
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in
1
seconds
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in
0
seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 51 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 5
6
seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 5
5
seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 72 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 4
8
seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 4
9
seconds
* Ref time:
0.0
6
user 0.00system 3:
58.30
elapsed 0%CPU (0avgtext+0avgdata 56
8
8maxresident)k
9
6inputs+0outputs (0major+61
57
minor)pagefaults 0swaps
0.0
7
user 0.00system 3:
49.41
elapsed 0%CPU (0avgtext+0avgdata 56
2
8maxresident)k
6
4
inputs+0outputs (0major+61
84
minor)pagefaults 0swaps
* Quick time (-j 4):
0.0
4
user 0.0
4
system 2:
19
.8
4
elapsed 0%CPU (0avgtext+0avgdata 568
4
maxresident)k
32
inputs+0outputs (0major+61
76
minor)pagefaults 0swaps
0.0
6
user 0.0
1
system 2:
20
.8
8
elapsed 0%CPU (0avgtext+0avgdata 56
2
8maxresident)k
64
inputs+0outputs (0major+61
81
minor)pagefaults 0swaps
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment