Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: add utility functions to scan/execute a script file #140

Open
GoogleCodeExporter opened this issue Oct 14, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. A predefined function to scan a script file would be handy. 

  void scanFile(char *pScriptFilename);

It is easy to create on our own:

void CscanFile(struct ParseState *Parser, struct Value *ReturnValue, struct 
Value **Param, int NumArgs)
{
    char *pScriptFileName = ( char *)Param[0]->Val->Pointer;
    PicocPlatformScanFile( pScriptFileName);
}

but it could maybe be a part of the standard package?


2. A predefined function to execute a script in its own context would be handy 
(see also issue 137):

    void executeFile(char *pScriptFileName);

Interprets the file content in its own picoc context.


What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 9 Oct 2011 at 12:52

@GoogleCodeExporter
Copy link
Author

I guess that the prototype for executeFile should read

  int executeFile(char *pScriptFileName);

and that the function could return the value returned by 'main' in the script 
executed? 

Using executeFile all scripts could have their own main and could be executed 
stand alone and also by other scripts (nested to (almost) any depth).

Original comment by [email protected] on 10 Oct 2011 at 8:07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant