|
Post by louisatome on Sept 11, 2017 16:01:46 GMT
Hi,
Is it possible to do Ruby code parsing from a native rhodes extension ? I need to parse some Ruby code my user typed in the application and check some rules. I saw there is some classes in rhodes gem that looks promising (https://github.com/rhomobile/rhodes/blob/master/platform/shared/xruby/src/com/xruby/compiler/parser/RubyParser.java) but I don't know if I can use it during runtime and how to do it.
Thanks,
Louis
|
|
|
Post by Alex Epifanov on Sept 11, 2017 17:58:53 GMT
|
|
|
Post by jontara on Sept 11, 2017 19:00:30 GMT
Is your app some tool for Ruby programmers? Will the code be uploaded somewhere for use elsewhere?
If you intend to actually execute the Ruby in the app, it will be disallowed in Apple App Store, if that matters to you.
They might allow it, e.g. if it is some tool that implements a REPL where the user types in some Ruby, and the app shows the result. (It would have to have no side-effects that might actually run some arbitrary code in your app, though.)
Ripper looks promising for just creating a parse tree. Since it is pure Ruby code, it would be easy to implement as an extension.
|
|
|
Post by louisatome on Sept 12, 2017 8:50:23 GMT
Thanks for the reply, I'm gonna try to include Ripper in my app. jontara Yes my app execute Ruby code but Apple has made the rules more flexible for apps used to teach code.
|
|