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

Compiling a script does not display errors #3

Closed
prgrmRyC opened this issue Jun 10, 2013 · 4 comments
Closed

Compiling a script does not display errors #3

prgrmRyC opened this issue Jun 10, 2013 · 4 comments
Assignees

Comments

@prgrmRyC
Copy link

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

@ghost ghost assigned jingwood Jun 11, 2013
@jingwood
Copy link
Member

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.
And I planned to release next version within one week.
Jing Lu

@prgrmRyC
Copy link
Author

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
-=Ryan

From: Jing Lu
Sent: Monday, June 10, 2013 9:56 PM
To: unvell/ReoScript
Cc: prgrmRyC
Subject: Re: [ReoScript] Compiling a script does not display errors (#3)

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.
And I planned to release next version within one week.
Jing Lu


Reply to this email directly or view it on GitHub.

jingwood added a commit that referenced this issue Jun 17, 2013
- 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
@jingwood
Copy link
Member

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:
https://github.com/unvell/ReoScript/wiki/Error-Handling

And reflection is here:
https://github.com/unvell/ReoScript/wiki/Reflection

If you have other problems, please let me know.
Thanks for a good suggestion again!

@prgrmRyC
Copy link
Author

Cool than Jing! I will send you an icon to post when I am ready.

-=Ryan
www.rynamix.com

From: Jing Lu
Sent: Monday, June 17, 2013 12:25 PM
To: unvell/ReoScript
Cc: prgrmRyC
Subject: Re: [ReoScript] Compiling a script does not display errors (#3)

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:
https://github.com/unvell/ReoScript/wiki/Error-Handling

And reflection is here:
https://github.com/unvell/ReoScript/wiki/Reflection

If you have other problems, please let me know.
Thanks for a good suggestion again!


Reply to this email directly or view it on GitHub.

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

2 participants