-
Notifications
You must be signed in to change notification settings - Fork 35
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
Compiling a script does not display errors #3
Comments
Thank you Ryan. srm.compile parses the script of text and try to construct a syntax-tree in memory, actually the syntax errors has been detected and stored in the syntax-tree (finished by ANTLR). Currently there is no API available to retrieve these errors. I will fix this ASAP. A runtime error like 'aa.bb.cc = 5' where 'bb' is null, the exception can only be thrown at runtime. (maybe in future we can detect that an object may always be null at compile-time) For the variables collecting, I will add an API to iterate all the variables (and functions) used in script. Just like Reflection in .NET. Hope useful for your email processor. |
Jing, Thanks for the quick reply. You’ve done a great job on ReoScript. I have tried many different addon script LIBs and although I like a few of them like csScript, I think ReoScript is cleaner and easier to understand, plus I think my users will know Javascript before C#, Lua, Pearl, etc. By the way, since you so graciously include the source code, I added a simple function to SRM that returns an array of variables from WorldObject, minus the built in ones. I look forward to your updates. Once I get this app released, I will gladly add a ReoScript icon and link to your site from mine. Thanks From: Jing Lu Thank you Ryan. srm.compile parses the script of text and try to construct a syntax-tree in memory, actually the syntax errors has been detected and stored in the syntax-tree (finished by ANTLR). Currently there is no API available to retrieve these errors. I will fix this ASAP. A runtime error like 'aa.bb.cc = 5' where 'bb' is null, the exception can only be thrown at runtime. (maybe in future we can detect that an object may always be null at compile-time) For the variables collecting, I will add an API to iterate all the variables (and functions) used in script. Just like Reflection in .NET. Hope useful for your email processor. — |
- New: Performance improving - New: New error handling method (#3) - New: Handle or throw syntax errors at pre-interpret-time - New: Handle const values at pre-interpret-time - New: Inner function can cache its outer call-scope (#1) - New: Inner function can be pre-interpreted (call before define is available) (#2) - New: Max call-stack detection added - New: Minus operator can be used to calculate elapsed milliseconds with two date objects - New: IDirectory interface is available to property access and enumeration (#4) - New: Information about functions and variables is available after compiling - Fixed: Function scope and call-scope has been fixed - Fixed: Exception caused when array resizing has been fixed - Changed: .NET IList interface can be accessed directly (DirectAccess mode is unnecessary) - Changed: Reform library namespaces
Ryan you're welcome! I am also gladly add your link back:) I just released the version 1.3 that contains the compile-time error handling and API to get all the functions and variables defined in script. Sorry for a method to SRM that returns an array of variables from WorldObject is not added at this time, please keep using your own method for several days, I will add it in next version. About error handling please refer to this document: And reflection is here: If you have other problems, please let me know. |
Cool than Jing! I will send you an icon to post when I am ready. -=Ryan From: Jing Lu Ryan you're welcome! I am also gladly add your link back:) I just released the version 1.3 that contains the compile-time error handling and API to get all the functions and variables defined in script. Sorry for a method to SRM that returns an array of variables from WorldObject is not added at this time, please keep using your own method for several days, I will add it in next version. About error handling please refer to this document: And reflection is here: If you have other problems, please let me know. — |
I just found ReoScript and have been playing around with it in VS 2010 (C#) and trying to decide if I want to use it in an email processor I am writing.
One thing I am noticing is that ReoScript does not seam to parse the script until it actual it runs, meaning the srm.compile does not throw any errors if they are errors in the script. It also does not collect all the variables used in the script until it is ran.
What is the point of compiling? I want to be able to to tell my users that there script has error before actually running the script.
Thanks for a nice LIB!
-=Ryan
The text was updated successfully, but these errors were encountered: