Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
ae1037fb
Commit
ae1037fb
authored
Sep 22, 2010
by
Andrei Paskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
labels w/ location: "label" ` lnum ` bol ` cnum1 ` cnum2 ` "filename"
parent
7d4be12e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
src/parser/lexer.mll
src/parser/lexer.mll
+2
-0
src/parser/parser.mly
src/parser/parser.mly
+22
-3
No files found.
src/parser/lexer.mll
View file @
ae1037fb
...
...
@@ -171,6 +171,8 @@ rule token = parse
{
comment_start_loc
:=
loc
lexbuf
;
comment
lexbuf
;
token
lexbuf
}
|
"'"
{
QUOTE
}
|
"`"
{
BACKQUOTE
}
|
","
{
COMMA
}
|
"("
...
...
src/parser/parser.mly
View file @
ae1037fb
...
...
@@ -72,6 +72,15 @@
let
infix
s
=
"infix "
^
s
let
prefix
s
=
"prefix "
^
s
let
user_loc
fname
lnum
bol
cnum1
cnum2
=
let
pos
=
{
Lexing
.
pos_fname
=
fname
;
Lexing
.
pos_lnum
=
lnum
;
Lexing
.
pos_bol
=
bol
;
Lexing
.
pos_cnum
=
cnum1
}
in
pos
,
{
pos
with
Lexing
.
pos_cnum
=
cnum2
}
let
()
=
Exn_printer
.
register
(
fun
fmt
exn
->
match
exn
with
|
Parsing
.
Parse_error
->
Format
.
fprintf
fmt
"syntax error"
...
...
@@ -98,7 +107,7 @@
/*
symbols
*/
%
token
ARROW
ASYM_AND
ASYM_OR
%
token
BAR
%
token
BA
CKQUOTE
BA
R
%
token
COLON
COMMA
%
token
DOT
EQUAL
LTGT
%
token
LEFTPAR
LEFTPAR_STAR_RIGHTPAR
LEFTSQ
...
...
@@ -441,8 +450,8 @@ lexpr:
{
mk_pp
(
PPif
(
$
2
,
$
4
,
$
6
))
}
|
quant
list1_param_var_sep_comma
triggers
DOT
lexpr
{
mk_pp
(
PPquant
(
$
1
,
$
2
,
$
3
,
$
5
))
}
|
STRING
lexpr
%
prec
prec_named
{
mk_pp
(
PPnamed
(
Ident
.
label
~
loc
:
(
loc
()
)
$
1
,
$
2
))
}
|
label
lexpr
%
prec
prec_named
{
mk_pp
(
PPnamed
(
$
1
,
$
2
))
}
|
LET
pattern
EQUAL
lexpr
IN
lexpr
{
match
$
2
.
pat_desc
with
|
PPpvar
id
->
mk_pp
(
PPlet
(
id
,
$
4
,
$
6
))
...
...
@@ -694,6 +703,16 @@ qualid:
/*
Misc
*/
label
:
|
STRING
{
Ident
.
label
$
1
}
|
STRING
BACKQUOTE
INTEGER
BACKQUOTE
INTEGER
BACKQUOTE
INTEGER
BACKQUOTE
INTEGER
BACKQUOTE
STRING
{
let
loc
=
user_loc
$
11
(
int_of_string
$
3
)
(
int_of_string
$
5
)
(
int_of_string
$
7
)
(
int_of_string
$
9
)
in
Ident
.
label
~
loc
$
1
}
;
bar_
:
|
/*
epsilon
*/
{
()
}
|
BAR
{
()
}
...
...
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