Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
ff766d4d
Commit
ff766d4d
authored
Mar 25, 2014
by
Julien Lopez
Browse files
[TESTS][EVAL] Add a rather complete test for the parser; TODO added;
GRAMMAR updated
parent
6a9bf556
Changes
6
Hide whitespace changes
Inline
Side-by-side
tests/eval/GRAMMAR
View file @
ff766d4d
(* TODO: Update this grammar if needed.
Formaly add comments. *)
expr = id
| integer
| expr expr
| abstr
| "(" expr "," expr ")"
| expr "." expr
| expr "," expr
| "(" expr ")"
| "match" expr "with" "|" expr ["&" type_id] "->" expr branches
abstr = "fun" id params "=" expr
...
...
tests/eval/TODO
0 → 100644
View file @
ff766d4d
Syntax:
- "_" as a keyword (?)
Externals:
- Compile the externals to the parser
Tests:
- Update tests to check the evaluation of CDuce (depends on externals)
tests/eval/tests/parser/refs/overview.ref
0 → 100644
View file @
ff766d4d
Original: fun firsts x y -> match x,y with
| (a,_),(b,_) -> a,b (* This (* is (* a nested *) *) comment *)
| _ -> x.3 (* That doesn't make any sense *)
Expr: Abstract(firsts x y, Match(Pair(Var(x), Var(y)), (Pair(Pair(Var(a), Var(_)), Pair(Var(b), Var(_))), Pair(Var(a), Var(b)))(Var(_), Apply(Var(x), Int(3)))))
Result: fun firsts x y -> match (x, y) with
| ((a, _), (b, _)) -> (a, b)
| _ -> x . 3
tests/eval/tests/parser/refs/overview.res
0 → 100644
View file @
ff766d4d
0
\ No newline at end of file
tests/eval/tests/parser/tests/overview.test
0 → 100644
View file @
ff766d4d
fun
firsts
x
y
->
match
x
,
y
with
|
(
a
,
_
),(
b
,
_
)
->
a
,
b
(
*
This
(
*
is
(
*
a
nested
*
)
*
)
comment
*
)
|
_
->
x
.3
(
*
That
doesn
'
t
make
any
sense
*
)
tests/eval/tests/test.sh
View file @
ff766d4d
...
...
@@ -2,7 +2,7 @@
ROOT
=
"."
BIN
=
$ROOT
/
`
grep
OUT
$ROOT
/Makefile |
head
-1
|
cut
-d
'='
-f
2 |
tr
-d
' '
`
MODULES
=
"
$ROOT
/tests/lexer"
MODULES
=
"
$ROOT
/tests/lexer
$ROOT
/tests/parser
"
OUT
=
__out__
DIFF
=
__diff__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment