Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
POTTIER Francois
menhir
Commits
45d9e27b
Commit
45d9e27b
authored
Oct 06, 2015
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup. Renamed [tk_priority] to [tk_precedence].
parent
f58d6adb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
src/grammar.ml
src/grammar.ml
+3
-3
src/partialGrammar.ml
src/partialGrammar.ml
+3
-3
src/syntax.mli
src/syntax.mli
+1
-1
src/unparameterizedPrinter.ml
src/unparameterizedPrinter.ml
+1
-1
No files found.
src/grammar.ml
View file @
45d9e27b
...
...
@@ -26,7 +26,7 @@ module TokPrecedence = struct
level was useful. *)
let
levelip
id
properties
=
lazy
(
use
id
)
,
properties
.
tk_pr
iority
lazy
(
use
id
)
,
properties
.
tk_pr
ecedence
let
leveli
id
=
let
properties
=
...
...
@@ -43,7 +43,7 @@ module TokPrecedence = struct
let
diagnostics
()
=
StringMap
.
iter
(
fun
id
properties
->
if
not
(
StringSet
.
mem
id
!
ever_useful
)
then
match
properties
.
tk_pr
iority
with
match
properties
.
tk_pr
ecedence
with
|
UndefinedPrecedence
->
()
|
PrecedenceLevel
(
_
,
_
,
pos1
,
pos2
)
->
...
...
@@ -202,7 +202,7 @@ module Terminal = struct
let
not_so_dummy_properties
=
(* applicable to [error] and [#] *)
{
tk_filename
=
"__primitives__"
;
tk_pr
iority
=
UndefinedPrecedence
;
tk_pr
ecedence
=
UndefinedPrecedence
;
tk_associativity
=
UndefinedAssoc
;
tk_ocamltype
=
None
;
tk_is_declared
=
true
;
...
...
src/partialGrammar.ml
View file @
45d9e27b
...
...
@@ -64,7 +64,7 @@ let join_declaration filename (grammar : grammar) decl =
tk_filename
=
filename
;
tk_ocamltype
=
ocamltype
;
tk_associativity
=
UndefinedAssoc
;
tk_pr
iority
=
UndefinedPrecedence
;
tk_pr
ecedence
=
UndefinedPrecedence
;
tk_position
=
decl
.
position
;
tk_is_declared
=
true
}
...
...
@@ -101,7 +101,7 @@ let join_declaration filename (grammar : grammar) decl =
tk_filename
=
filename
;
tk_ocamltype
=
None
;
tk_associativity
=
UndefinedAssoc
;
tk_pr
iority
=
prec
;
tk_pr
ecedence
=
prec
;
tk_is_declared
=
false
;
(* Will be updated later. *)
tk_position
=
decl
.
position
;
...
...
@@ -119,7 +119,7 @@ let join_declaration filename (grammar : grammar) decl =
(* Record the new declaration. *)
token_properties
.
tk_pr
iority
<-
prec
;
token_properties
.
tk_pr
ecedence
<-
prec
;
token_properties
.
tk_associativity
<-
assoc
;
grammar
...
...
src/syntax.mli
View file @
45d9e27b
...
...
@@ -48,7 +48,7 @@ type token_properties =
tk_ocamltype
:
Stretch
.
ocamltype
option
;
tk_position
:
Positions
.
t
;
mutable
tk_associativity
:
token_associativity
;
mutable
tk_pr
iority
:
precedence_level
;
(* TEMPORARY terminologie toujours pas coherente *)
mutable
tk_pr
ecedence
:
precedence_level
;
mutable
tk_is_declared
:
bool
;
}
...
...
src/unparameterizedPrinter.ml
View file @
45d9e27b
...
...
@@ -54,7 +54,7 @@ let print_tokens mode b g =
(* Sort tokens wrt precedence. *)
let
undefined
,
partition_tokens
=
StringMap
.
fold
(
fun
token
prop
acu
->
insert
acu
(
token
,
prop
.
tk_pr
iority
)
insert
acu
(
token
,
prop
.
tk_pr
ecedence
)
)
g
.
tokens
([]
,
[]
)
in
let
ordered_tokens
=
...
...
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