Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
POTTIER Francois
menhir
Commits
c2584813
Commit
c2584813
authored
Oct 23, 2018
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove [Positions.two].
It is replaced with [Positions.import] in a singleton list.
parent
6636a4a7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
12 deletions
+5
-12
src/fancy-parser.mly
src/fancy-parser.mly
+1
-1
src/grammarFunctor.ml
src/grammarFunctor.ml
+1
-1
src/lexer.mll
src/lexer.mll
+1
-1
src/positions.ml
src/positions.ml
+0
-3
src/positions.mli
src/positions.mli
+0
-2
src/sentenceLexer.mll
src/sentenceLexer.mll
+1
-2
src/sentenceParser.mly
src/sentenceParser.mly
+1
-2
No files found.
src/fancy-parser.mly
View file @
c2584813
...
...
@@ -129,7 +129,7 @@ declaration:
|
rule_specific_token
{
Error
.
error
(
Positions
.
two
$
startpos
$
endpos
)
Error
.
error
[
Positions
.
import
$
loc
]
"syntax error inside a declaration.
\n
\
Did you perhaps forget the %%%% that separates declarations and rules?"
}
...
...
src/grammarFunctor.ml
View file @
c2584813
...
...
@@ -75,7 +75,7 @@ module TokPrecedence = struct
|
UndefinedPrecedence
->
()
|
PrecedenceLevel
(
_
,
_
,
pos1
,
pos2
)
->
Error
.
grammar_warning
(
Positions
.
two
pos1
pos2
)
Error
.
grammar_warning
[
Positions
.
import
(
pos1
,
pos2
)
]
"the precedence level assigned to %s is never useful."
id
)
grammar
.
tokens
...
...
src/lexer.mll
View file @
c2584813
...
...
@@ -26,7 +26,7 @@ let error1 pos =
Error
.
error
(
Positions
.
one
pos
)
let
error2
lexbuf
=
Error
.
error
(
Positions
.
two
lexbuf
.
lex_start_p
lexbuf
.
lex_curr_p
)
Error
.
error
(
Positions
.
lexbuf
lexbuf
)
(* ------------------------------------------------------------------------ *)
...
...
src/positions.ml
View file @
c2584813
...
...
@@ -140,9 +140,6 @@ type positions =
let
one
(
pos
:
position
)
:
positions
=
[
import
(
pos
,
pos
)
]
let
two
(
pos1
:
position
)
(
pos2
:
position
)
:
positions
=
[
import
(
pos1
,
pos2
)
]
let
lexbuf
(
lexbuf
:
lexbuf
)
:
positions
=
[
import
(
lexbuf
.
lex_start_p
,
lexbuf
.
lex_curr_p
)
]
...
...
src/positions.mli
View file @
c2584813
...
...
@@ -123,8 +123,6 @@ type positions =
val
one
:
Lexing
.
position
->
positions
val
two
:
Lexing
.
position
->
Lexing
.
position
->
positions
val
lexbuf
:
Lexing
.
lexbuf
->
positions
(* Low-level printing function, for debugging. *)
...
...
src/sentenceLexer.mll
View file @
c2584813
...
...
@@ -23,7 +23,7 @@
(* A short-hand. *)
let
error2
lexbuf
=
Error
.
error
(
Positions
.
two
lexbuf
.
lex_start_p
lexbuf
.
lex_curr_p
)
Error
.
error
(
Positions
.
lexbuf
lexbuf
)
}
...
...
@@ -84,4 +84,3 @@ rule lex = parse
{
COLON
}
|
_
{
error2
lexbuf
"unexpected character."
}
src/sentenceParser.mly
View file @
c2584813
...
...
@@ -66,7 +66,7 @@
|
None
,
[]
->
Lexing
.
dummy_pos
(* cannot happen *)
in
Positions
.
two
opening
closing
,
[
Positions
.
import
(
opening
,
closing
)]
,
strip_sentence
(
nto
,
terminals
)
%
}
...
...
@@ -118,4 +118,3 @@ terminals:
{
[]
}
|
TERMINAL
terminals
{
$
1
::
$
2
}
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