diff --git a/clibrary.c b/clibrary.c index c653675..fd573a1 100644 --- a/clibrary.c +++ b/clibrary.c @@ -87,7 +87,7 @@ void PrintFP(double Num, CharWriter *PutCh) #endif /* intrinsic functions made available to the language */ -void LibPrintf(struct Value *ReturnValue, struct Value **Param, int NumArgs) +void LibPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { struct Value *CharArray = Param[0]->Val->Pointer.Segment; char *Format; diff --git a/parse.c b/parse.c index f142e1c..02f80f8 100644 --- a/parse.c +++ b/parse.c @@ -87,7 +87,7 @@ void ParseFunctionCall(struct ParseState *Parser, struct Value **Result, const c VariableStackFramePop(Parser); } else - FuncValue->Val->FuncDef.Intrinsic(*Result, ParamArray, ArgCount); + FuncValue->Val->FuncDef.Intrinsic(Parser, *Result, ParamArray, ArgCount); HeapPopStackFrame(); } diff --git a/picoc.h b/picoc.h index e444621..3738845 100644 --- a/picoc.h +++ b/picoc.h @@ -210,7 +210,7 @@ struct LexState /* library function definition */ struct LibraryFunction { - void (*Func)(struct Value *, struct Value **, int); + void (*Func)(struct ParseState *Parser, struct Value *, struct Value **, int); const char *Prototype; }; diff --git a/platform_library.c b/platform_library.c index d95b78f..378fdb7 100644 --- a/platform_library.c +++ b/platform_library.c @@ -1,17 +1,17 @@ #include "picoc.h" -void SayHello(struct Value *ReturnValue, struct Value **Param, int NumArgs) +void SayHello(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { PlatformPrintf("Hello\n"); } -void PrintInteger(struct Value *ReturnValue, struct Value **Param, int NumArgs) +void PrintInteger(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { PlatformPrintf("%d\n", Param[0]->Val->Integer); } #ifdef UNIX_HOST -void Random(struct Value *ReturnValue, struct Value **Param, int NumArgs) +void Random(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { ReturnValue->Val->Integer = random(); }