Skip to content
GitLab
Menu
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
59a15ab3
Commit
59a15ab3
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2003-10-06 07:52:41 by cvscast] added #help directive to the toplevel
Original author: cvscast Date: 2003-10-06 07:52:42+00:00
parent
85f4e437
Changes
3
Hide whitespace changes
Inline
Side-by-side
driver/cduce.ml
View file @
59a15ab3
...
...
@@ -57,6 +57,15 @@ let dump_env ppf =
Typer
.
iter_values
!
typing_env
(
fun
x
t
->
dump_value
ppf
x
t
(
get_global_value
x
))
let
directive_help
ppf
=
Format
.
fprintf
ppf
"Toplevel directives:
#quit;; quit the interpreter
#env;; dump current environment
#reinit_ns;; reinitialize namespace processing
#help;; shows this help message
"
let
rec
print_exn
ppf
=
function
|
Location
(
loc
,
w
,
exn
)
->
Format
.
fprintf
ppf
"Error %a:@."
Location
.
print_loc
(
loc
,
w
);
...
...
@@ -251,6 +260,9 @@ let rec phrases ppf phs = match phs with
|
{
descr
=
Ast
.
Directive
`Reinit_ns
}
::
rest
->
Typer
.
set_ns_table_for_printer
!
typing_env
;
phrases
ppf
rest
|
{
descr
=
Ast
.
Directive
`Help
}
::
rest
->
directive_help
ppf
;
phrases
ppf
rest
|
[]
->
()
let
catch_exn
ppf_err
=
function
...
...
parser/ast.ml
View file @
59a15ab3
...
...
@@ -29,6 +29,7 @@ and toplevel_directive =
[
`Quit
|
`Env
|
`Reinit_ns
|
`Help
]
...
...
parser/parser.ml
View file @
59a15ab3
...
...
@@ -116,6 +116,7 @@ EXTEND
|
DIRECTIVE
"#quit"
->
[
mk
loc
(
Directive
`Quit
)
]
|
DIRECTIVE
"#env"
->
[
mk
loc
(
Directive
`Env
)
]
|
DIRECTIVE
"#reinit_ns"
->
[
mk
loc
(
Directive
`Reinit_ns
)
]
|
DIRECTIVE
"#help"
->
[
mk
loc
(
Directive
`Help
)
]
|
"include"
;
s
=
STRING2
->
let
s
=
if
Filename
.
is_relative
s
...
...
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