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
bec30984
Commit
bec30984
authored
Jun 04, 2014
by
Julien Lopez
Browse files
[TESTS][LAMBDA][MINOR] Fix GRAMMAR
parent
8f63f467
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/lambda/GRAMMAR
View file @
bec30984
expr = id
|
integer
|
INTEGER
| "`true"
| "`false"
| STRING
| CHAR
| abstr
| "let" LIDENT ":" type_id "=" expr "in" expr ":" type_id
| "if" expr "then" expr
...
...
@@ -42,8 +43,11 @@ abstr = "fun" id id ":" type_id params ":" type_id "->" expr
;;
match_value = id ":" type_id
| integer
| INTEGER
| "`true"
| "`false"
| STRING
| CHAR
| match_value "," match_value
| match_value "::" match_value
| "(" match_value ")"
...
...
@@ -80,6 +84,4 @@ complex_type_id = UIDENT (* [A-Z][A-Za-z0-9_]* *)
| complex_type_id "->" complex_type_id
| "[" complex_type_id "]"
| "(" complex_type_id ")"
;;
integer = INTEGER (* [0-9]+ *)
tests/lambda/tests/src/compute.ml
View file @
bec30984
...
...
@@ -70,6 +70,7 @@ let rec g_token n = function
|
"UIDENT"
->
g_uident
3
""
|
"STRING"
->
"
\"
"
^
g_ident
3
""
^
"
\"
"
|
"INTEGER"
->
string_of_int
(
Random
.
int
1000
)
|
"CHAR"
->
"'"
^
Char
.
escaped
(
Char
.
chr
(
Random
.
int
128
))
^
"'"
|
_
->
let
l
=
Loc
.
start_line
loc
in
let
cbegin
=
Loc
.
start_off
loc
-
Loc
.
start_bol
loc
in
...
...
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