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
Why3
why3
Commits
70ca1d7d
Commit
70ca1d7d
authored
Mar 08, 2010
by
Andrei Paskevich
Browse files
restrict the use of parenthesed idents
parent
b29d4d0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/parser/parser.mly
View file @
70ca1d7d
...
...
@@ -184,25 +184,30 @@ list0_decl:
;
ident
:
|
lident_string
{
{
id
=
$
1
;
id_loc
=
loc
()
}
}
|
UIDENT
{
{
id
=
$
1
;
id_loc
=
loc
()
}
}
|
uident
{
$
1
}
|
lident
{
$
1
}
;
ident_rich
:
|
uident
{
$
1
}
|
lident_rich
{
$
1
}
;
lident
:
|
lident_string
|
LIDENT
{
{
id
=
$
1
;
id_loc
=
loc
()
}
}
;
lident_
string
:
|
LIDENT
lident_
rich
:
|
lident
{
$
1
}
|
LEFTPAR
UNDERSCORE
lident_op
UNDERSCORE
RIGHTPAR
{
infix
$
3
}
{
{
id
=
infix
$
3
;
id_loc
=
loc
()
}
}
|
LEFTPAR
lident_op
UNDERSCORE
RIGHTPAR
{
prefix
$
2
}
{
{
id
=
prefix
$
2
;
id_loc
=
loc
()
}
}
/*
|
LEFTPAR
UNDERSCORE
lident_op
RIGHTPAR
{
postfix
$
3
}
{
{
id
=
postfix
$
3
;
id_loc
=
loc
()
}
}
*/
;
...
...
@@ -238,9 +243,13 @@ any_qualid:
|
any_qualid
DOT
ident
{
Qdot
(
$
1
,
$
3
)
}
;
tqualid
:
|
uident
{
Qident
$
1
}
|
any_qualid
DOT
uident
{
Qdot
(
$
1
,
$
3
)
}
qualid
:
|
ident
{
Qident
$
1
}
|
uqualid
DOT
ident
{
Qdot
(
$
1
,
$
3
)
}
|
ident
_rich
{
Qident
$
1
}
|
uqualid
DOT
ident
_rich
{
Qdot
(
$
1
,
$
3
)
}
params
:
|
/*
epsilon
*/
{
[]
}
...
...
@@ -272,7 +281,7 @@ logic_def_option:
;
logic_decl
:
|
LOGIC
lident
params
logic_type_option
logic_def_option
|
LOGIC
lident
_rich
params
logic_type_option
logic_def_option
{
{
ld_loc
=
loc
()
;
ld_ident
=
$
2
;
ld_params
=
$
3
;
ld_type
=
$
4
;
ld_def
=
$
5
;
}
}
;
...
...
@@ -293,7 +302,7 @@ list1_type_decl:
;
inductive_decl
:
|
INDUCTIVE
lident
primitive_types
inddefn
|
INDUCTIVE
lident
_rich
primitive_types
inddefn
{
{
in_loc
=
loc
()
;
in_ident
=
$
2
;
in_params
=
$
3
;
in_def
=
$
4
}
}
list1_inductive_decl
:
...
...
@@ -512,9 +521,9 @@ list1_lident_sep_comma:
;
use
:
|
imp_exp
any_
qualid
|
imp_exp
t
qualid
{
{
use_theory
=
$
2
;
use_as
=
None
;
use_imp_exp
=
$
1
}
}
|
imp_exp
any_
qualid
AS
uident
|
imp_exp
t
qualid
AS
uident
{
{
use_theory
=
$
2
;
use_as
=
Some
$
4
;
use_imp_exp
=
$
1
}
}
;
...
...
Write
Preview
Supports
Markdown
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