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
M
menhir
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POTTIER Francois
menhir
Commits
6636a4a7
Commit
6636a4a7
authored
Oct 23, 2018
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename [Positions.lex_join] to [Positions.import]. Change its API. Use [$loc].
parent
f7876493
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
src/fancy-parser.mly
src/fancy-parser.mly
+1
-1
src/lexer.mll
src/lexer.mll
+1
-1
src/positions.ml
src/positions.ml
+5
-5
src/positions.mli
src/positions.mli
+1
-1
src/yacc-parser.mly
src/yacc-parser.mly
+3
-3
No files found.
src/fancy-parser.mly
View file @
6636a4a7
...
@@ -271,7 +271,7 @@ production:
...
@@ -271,7 +271,7 @@ production:
{
producers
,
{
producers
,
oprec
,
oprec
,
ParserAux
.
new_production_level
()
,
ParserAux
.
new_production_level
()
,
Positions
.
lex_join
$
startpos
$
endpos
Positions
.
import
$
loc
}
}
/*
-------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------------------
*/
...
...
src/lexer.mll
View file @
6636a4a7
...
@@ -461,7 +461,7 @@ rule main = parse
...
@@ -461,7 +461,7 @@ rule main = parse
{
let
openingpos
=
lexeme_start_p
lexbuf
in
{
let
openingpos
=
lexeme_start_p
lexbuf
in
let
stretchpos
=
lexeme_end_p
lexbuf
in
let
stretchpos
=
lexeme_end_p
lexbuf
in
let
closingpos
=
attribute
openingpos
lexbuf
in
let
closingpos
=
attribute
openingpos
lexbuf
in
let
pos
=
Positions
.
lex_join
openingpos
(
lexeme_end_p
lexbuf
)
in
let
pos
=
Positions
.
import
(
openingpos
,
lexeme_end_p
lexbuf
)
in
let
attr
=
mk_stretch
stretchpos
closingpos
false
[]
in
let
attr
=
mk_stretch
stretchpos
closingpos
false
[]
in
if
percent
=
""
then
if
percent
=
""
then
(* No [%] sign: this is a normal attribute. *)
(* No [%] sign: this is a normal attribute. *)
...
...
src/positions.ml
View file @
6636a4a7
...
@@ -86,8 +86,8 @@ let join x1 x2 =
...
@@ -86,8 +86,8 @@ let join x1 x2 =
end_of_position
(
if
x2
=
dummy
then
x1
else
x2
)
end_of_position
(
if
x2
=
dummy
then
x1
else
x2
)
)
)
let
lex_join
x1
x2
=
let
import
x
=
(
x1
,
x2
)
x
let
join_located
l1
l2
f
=
let
join_located
l1
l2
f
=
{
{
...
@@ -138,13 +138,13 @@ type positions =
...
@@ -138,13 +138,13 @@ type positions =
t
list
t
list
let
one
(
pos
:
position
)
:
positions
=
let
one
(
pos
:
position
)
:
positions
=
[
(
pos
,
pos
)
]
(* or: lex_join pos pos *)
[
import
(
pos
,
pos
)
]
let
two
(
pos1
:
position
)
(
pos2
:
position
)
:
positions
=
let
two
(
pos1
:
position
)
(
pos2
:
position
)
:
positions
=
[
lex_join
pos1
pos2
]
[
import
(
pos1
,
pos2
)
]
let
lexbuf
(
lexbuf
:
lexbuf
)
:
positions
=
let
lexbuf
(
lexbuf
:
lexbuf
)
:
positions
=
[
lex_join
lexbuf
.
lex_start_p
lexbuf
.
lex_curr_p
]
[
import
(
lexbuf
.
lex_start_p
,
lexbuf
.
lex_curr_p
)
]
let
print
(
pos
:
position
)
=
let
print
(
pos
:
position
)
=
Printf
.
printf
Printf
.
printf
...
...
src/positions.mli
View file @
6636a4a7
...
@@ -82,7 +82,7 @@ val filename_of_position: t -> string
...
@@ -82,7 +82,7 @@ val filename_of_position: t -> string
starts and stops where [p2] stops. *)
starts and stops where [p2] stops. *)
val
join
:
t
->
t
->
t
val
join
:
t
->
t
->
t
val
lex_join
:
Lexing
.
position
->
Lexing
.
position
->
t
val
import
:
Lexing
.
position
*
Lexing
.
position
->
t
val
ljoinf
:
(
'
a
->
t
)
->
'
a
list
->
t
val
ljoinf
:
(
'
a
->
t
)
->
'
a
list
->
t
...
...
src/yacc-parser.mly
View file @
6636a4a7
...
@@ -346,7 +346,7 @@ production:
...
@@ -346,7 +346,7 @@ production:
{
List
.
rev
$
1
,
{
List
.
rev
$
1
,
$
2
,
$
2
,
ParserAux
.
new_production_level
()
,
ParserAux
.
new_production_level
()
,
Positions
.
lex_join
(
symbol_start_pos
()
)
(
symbol_end_pos
()
)
Positions
.
import
(
symbol_start_pos
()
,
symbol_end_pos
()
)
}
}
producers
:
producers
:
...
@@ -361,8 +361,8 @@ producers:
...
@@ -361,8 +361,8 @@ producers:
producer
:
producer
:
|
actual
attributes
|
actual
attributes
{
Positions
.
lex_join
(
symbol_start_pos
()
)
(
symbol_end_pos
()
)
,
None
,
$
1
,
$
2
}
{
Positions
.
import
(
symbol_start_pos
()
,
symbol_end_pos
()
)
,
None
,
$
1
,
$
2
}
|
LID
EQUAL
actual
attributes
|
LID
EQUAL
actual
attributes
{
Positions
.
lex_join
(
symbol_start_pos
()
)
(
symbol_end_pos
()
)
,
Some
$
1
,
$
3
,
$
4
}
{
Positions
.
import
(
symbol_start_pos
()
,
symbol_end_pos
()
)
,
Some
$
1
,
$
3
,
$
4
}
%%
%%
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