mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
fixed method output in test and in parser
This commit is contained in:
parent
d39aef086c
commit
bae324db5f
3 changed files with 14 additions and 6 deletions
11
src/parser.c
11
src/parser.c
|
@ -224,7 +224,11 @@ inline int PSYC_parseElement(
|
||||||
return -5; // report error
|
return -5; // report error
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
*name = data+*cursor;
|
||||||
|
*nlength=1;
|
||||||
method=1;
|
method=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -247,12 +251,7 @@ inline int PSYC_parseElement(
|
||||||
&& data[*cursor] != '_') // AND not '_'. must be invalid then
|
&& data[*cursor] != '_') // AND not '_'. must be invalid then
|
||||||
return -1; // return parser error.
|
return -1; // return parser error.
|
||||||
|
|
||||||
if(1 == method) // for the method..
|
*nlength+=1;
|
||||||
{
|
|
||||||
*name=data+*cursor; // the name starts here.
|
|
||||||
*nlength=1; // the initial length is 1.
|
|
||||||
}else
|
|
||||||
*nlength+=1;
|
|
||||||
|
|
||||||
/* now checking how long the name of the variable is. */
|
/* now checking how long the name of the variable is. */
|
||||||
unsigned int i=0;
|
unsigned int i=0;
|
||||||
|
|
|
@ -2,5 +2,6 @@
|
||||||
:_source psyc://heise.de/~user
|
:_source psyc://heise.de/~user
|
||||||
|
|
||||||
_request_some_things
|
_request_some_things
|
||||||
|
content!
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,14 @@ int main(int argc, char** argv)
|
||||||
write(0,"\n",1);
|
write(0,"\n",1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ret == 3 || ret == 2)
|
||||||
|
{
|
||||||
|
write(0,varname,nl);
|
||||||
|
write(0," = ",3);
|
||||||
|
write(0,varvalue,vl);
|
||||||
|
write(0,"\n",1);
|
||||||
|
}
|
||||||
|
|
||||||
if(tmp != cursor)
|
if(tmp != cursor)
|
||||||
tmp=cursor;
|
tmp=cursor;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue