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
C
cduce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
cduce
cduce
Commits
94822f79
Commit
94822f79
authored
May 13, 2011
by
Jérôme Maloberti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added const and end suffix to services.
parent
41e26c72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
types/types.ml
types/types.ml
+21
-6
No files found.
types/types.ml
View file @
94822f79
...
...
@@ -1824,7 +1824,11 @@ end
module
Service
=
struct
type
service_attributs
=
{
mutable
suffix
:
bool
}
type
service_attributs
=
{
mutable
suffix
:
bool
;
mutable
const
:
bool
;
mutable
end_suffix
:
bool
}
let
prepare
t
=
let
t
=
Print
.
uniq
t
in
let
t
=
Print
.
prepare
t
in
...
...
@@ -1874,13 +1878,20 @@ struct
|
Print
.
Char
c
->
assert
false
|
Print
.
Regexp
r
->
convert_regexp
name
r
|
Print
.
Xml
(
tag
,
attr
,
t
)
->
let
flags
=
{
suffix
=
false
}
in
let
flags
=
{
suffix
=
false
;
const
=
false
;
end_suffix
=
false
}
in
(
convert_attrs
flags
attr
;
let
res
=
convert
t
(
convert_tag
tag
)
in
if
flags
.
suffix
then
TSuffix
(
true
,
res
)
let
tagname
=
convert_tag
tag
in
let
res
=
convert
t
tagname
in
if
flags
.
const
then
TConst
tagname
else
res
if
flags
.
end_suffix
then
TESuffix
tagname
else
if
flags
.
suffix
then
TSuffix
(
true
,
res
)
else
res
)
|
_
->
assert
false
and
convert_regexp
name
=
function
...
...
@@ -1920,6 +1931,8 @@ struct
trace
(
"convert_record:"
^
attr_label
);
match
attr_label
with
|
"suffix"
->
flags
.
suffix
<-
true
|
"const"
->
flags
.
const
<-
true
|
"end_suffix"
->
flags
.
end_suffix
<-
true
|
_
->
output_string
stderr
(
"Bad attribute name:"
^
attr_label
^
"
\n
"
)
(* Label.print_attr l opt (do_print_slot 0) t *)
...
...
@@ -1948,12 +1961,14 @@ struct
|
TFloat
n
->
"TFloat("
^
n
^
")"
|
TBool
n
->
"TBool("
^
n
^
")"
|
TString
n
->
"TString("
^
n
^
")"
|
TConst
n
->
"TConst("
^
n
^
")"
|
TProd
(
e1
,
e2
)
->
"TProd("
^
(
aux
e1
)
^
","
^
(
aux
e2
)
^
")"
|
TOption
e
->
"TOption("
^
(
aux
e
)
^
")"
|
TSet
e
->
"TSet("
^
(
aux
e
)
^
")"
|
TUnit
->
"TUnit()"
|
TSum
(
e1
,
e2
)
->
"TSum("
^
(
aux
e1
)
^
","
^
(
aux
e2
)
^
")"
|
TSuffix
(
b
,
e
)
->
"TSuffix("
^
(
bool_to_string
b
)
^
","
^
(
aux
e
)
^
")"
|
TESuffix
n
->
"TESuffix("
^
n
^
")"
|
_
->
" unknown "
in
aux
t
;;
end
...
...
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