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
a5696df6
Commit
a5696df6
authored
28 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
now handles class
Rev: bin/hilfe:1.7
parent
79042c50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/hilfe
+24
-25
24 additions, 25 deletions
bin/hilfe
with
24 additions
and
25 deletions
bin/hilfe
+
24
−
25
View file @
a5696df6
...
...
@@ -21,12 +21,19 @@
/* #define DEBUG */
mapping variables=([]);
string *functions=({});
string *function_names=({});
mapping query_variables() { return variables; }
/* do nothing */
void my_write(mixed x)
{
write(sprintf("%O",x));
}
object eval(string f)
{
string prog,file;
...
...
@@ -176,14 +183,14 @@ void cut_buffer(int where)
pos-=old-new; if(pos<0) pos=0;
eq_pos-=old-new; if(eq_pos<0) eq_pos=-1;
#ifdef DEBUG
write("CUT input = "+
code_valu
e(input
,1
)+" pos="+pos+"\n");
write("CUT input = "+
my_writ
e(input)+" pos="+pos+"\n");
#endif
}
void print_version()
{
write(version()+
" Running Hilfe v1.
4
(Incremental Pike Frontend)\n");
" Running Hilfe v1.
5
(Incremental Pike Frontend)\n");
}
...
...
@@ -214,8 +221,8 @@ int do_parse()
{
first_word=input[0..pos-1];
#ifdef DEBUG
write("First = "+
code_valu
e(first_word)+" pos="+pos+"\n");
write("input = "+
code_valu
e(input)+"\n");
write("First = "+
my_writ
e(first_word)+" pos="+pos+"\n");
write("input = "+
my_writ
e(input)+"\n");
#endif
switch(first_word)
{
...
...
@@ -370,6 +377,7 @@ mixed parse_function(string fun)
case "mixed":
case "program":
case "function":
case "class":
/* parse function */
if(eq_pos!=-1) break; /* it's a variable */
sscanf(fun,first_word+"%s",name);
...
...
@@ -378,25 +386,20 @@ mixed parse_function(string fun)
name=c[0];
c=c[1];
if(c[0]=='(')
int i;
if((i=member_array(name,function_names))!=-1)
{
int i;
if((i=member_array(name,function_names))!=-1)
b=functions[i];
functions[i]=fun;
if(!eval("")) functions[i]=b;
}else{
if(eval(fun))
{
b=functions[i];
functions[i]=fun;
if(!eval("")) functions[i]=b;
}else{
if(eval(fun))
{
functions+=({fun});
function_names+=({name});
}
functions+=({fun});
function_names+=({name});
}
return 1;
}else{
write("Syntax error.\n");
}
return 1;
}
}
...
...
@@ -482,6 +485,7 @@ mixed parse_statement(string ex)
return 1;
default:
if(ex==";") return 1;
/* parse expressions */
a="mixed ___Foo4711() { return (mixed)("+ex[0..strlen(ex)-2]+"); }\n";
if(foo=eval(a))
...
...
@@ -505,7 +509,7 @@ void stdin(string s)
object foo;
#ifdef DEBUG
write("input: '"+
code_valu
e(s
,1
)+"'\n");
write("input: '"+
my_writ
e(s)+"'\n");
#endif
s=skipwhite(s);
...
...
@@ -519,11 +523,6 @@ void stdin(string s)
// if(!strlen(input)) write("> ");
}
void my_write(mixed x)
{
write(sprintf("%O",x));
}
void signal_trap(int s)
{
clean_buffer();
...
...
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