Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
29b4b59e
Commit
29b4b59e
authored
28 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
now uses readline
Rev: bin/hilfe.lpc:1.6
parent
f0e31fe5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/hilfe.lpc
+36
-32
36 additions, 32 deletions
bin/hilfe.lpc
with
36 additions
and
32 deletions
bin/hilfe.lpc
+
36
−
32
View file @
29b4b59e
...
@@ -169,6 +169,13 @@ void cut_buffer(int where)
...
@@ -169,6 +169,13 @@ void cut_buffer(int where)
#endif
#endif
}
}
void print_version()
{
write(version()+
" Running Hilfe v1.4 (Hubbe's Incremental LPC FrontEnd)\n");
}
int do_parse()
int do_parse()
{
{
string tmp;
string tmp;
...
@@ -201,7 +208,7 @@ int do_parse()
...
@@ -201,7 +208,7 @@ int do_parse()
case ".":
case ".":
clean_buffer();
clean_buffer();
write("Input buffer flushed.\n");
write("Input buffer flushed.\n");
break
;
continue
;
case "new":
case "new":
this_object()->__INIT();
this_object()->__INIT();
...
@@ -216,6 +223,22 @@ int do_parse()
...
@@ -216,6 +223,22 @@ int do_parse()
m_values(variables));
m_values(variables));
cut_buffer(4);
cut_buffer(4);
continue;
continue;
case "help":
print_version();
write("Hilfe is a tool to evaluate uLPC interactively and incrementally.\n"
"Any uLPC function, expression or variable declaration can be intered\n"
"at the command line. There are also a few extra commands:\n"
" help - show this text\n"
" quit - exit this program\n"
" . - abort current input batch\n"
" dump - dump variables\n"
" new - clear all function and variables\n"
"See the uLPC reference manual for more information.\n"
);
cut_buffer(4);
continue;
}
}
}
}
}
}
...
@@ -465,7 +488,7 @@ void stdin(string s)
...
@@ -465,7 +488,7 @@ void stdin(string s)
object foo;
object foo;
#ifdef DEBUG
#ifdef DEBUG
write("input: "+code_value(s,1)+"\n");
write("input:
'
"+code_value(s,1)+"
'
\n");
#endif
#endif
s=skipwhite(s);
s=skipwhite(s);
...
@@ -476,8 +499,7 @@ void stdin(string s)
...
@@ -476,8 +499,7 @@ void stdin(string s)
s=s[2..strlen(s)-1];
s=s[2..strlen(s)-1];
}
}
add_buffer(s);
add_buffer(s);
if(!strlen(input))
// if(!strlen(input)) write("> ");
write("> ");
}
}
void my_write(mixed x)
void my_write(mixed x)
...
@@ -485,27 +507,6 @@ void my_write(mixed x)
...
@@ -485,27 +507,6 @@ void my_write(mixed x)
write(sprintf("%O",x));
write(sprintf("%O",x));
}
}
void read_input()
{
string a,b;
object stdin_object;
stdin_object=clone((program)"/precompiled/file","stdin");
stdin_object->set_blocking();
while(stdin_object)
{
a=stdin_object->read(1);
if(!stringp(a)) continue;
stdin_object->set_nonblocking(0,0,0);
b=stdin_object->read(100000);
if(stringp(b)) a+=b;
stdin_object->set_blocking();
stdin(a);
}
write("Terminal closed.\n");
}
void signal_trap(int s)
void signal_trap(int s)
{
{
clean_buffer();
clean_buffer();
...
@@ -514,14 +515,17 @@ void signal_trap(int s)
...
@@ -514,14 +515,17 @@ void signal_trap(int s)
void main(int argc,string *argv)
void main(int argc,string *argv)
{
{
string s;
add_efun("write",my_write);
add_efun("write",my_write);
signal(signum("SIGINT"),signal_trap);
write(version()+
print_version();
" Running Hilfe v1.3 (Hubbe's Incremental LPC FrontEnd)\n");
while(s=readline(strlen(input) ? ">> " : "> "))
write("> ");
{
signal(signum("SIGINT"),signal_trap);
read_input();
stdin(s+"\n");
signal(signum("SIGINT"));
}
write("Terminal closed.\n");
return 0;
return 0;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment