Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
95ce24fa
Commit
95ce24fa
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2003-05-26 22:36:48 by cvscast] Cosmetique
Original author: cvscast Date: 2003-05-26 22:36:48+00:00
parent
52640d75
Changes
1
Hide whitespace changes
Inline
Side-by-side
misc/q_symbol.ml
View file @
95ce24fa
let
symbols
=
ref
[]
let
define
s
=
try
let
i
=
String
.
index
s
'
=
'
in
symbols
:=
(
String
.
sub
s
0
i
,
String
.
sub
s
(
i
+
1
)
(
String
.
length
s
-
i
-
1
))
::
!
symbols
with
Not_found
->
failwith
(
"Invalid symbol definition :"
^
s
)
let
i
=
try
String
.
index
s
'
=
'
with
Not_found
->
failwith
(
"Invalid symbol definition :"
^
s
)
in
symbols
:=
(
String
.
sub
s
0
i
,
String
.
sub
s
(
i
+
1
)
(
String
.
length
s
-
i
-
1
))
::
!
symbols
let
expr
_
s
=
try
List
.
assoc
s
!
symbols
with
Not_found
->
failwith
(
"No definition for symbol "
^
s
)
with
Not_found
->
failwith
(
"No definition for symbol "
^
s
)
let
_
=
Quotation
.
add
"symbol"
(
Quotation
.
ExStr
expr
);
Pcaml
.
add_option
"-symbol"
(
Arg
.
String
define
)
Pcaml
.
add_option
"-symbol"
(
Arg
.
String
define
)
"<symbol=value> Define a symbol"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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