On Aug 18, 11:09 am, europe72 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Does anyone know if there exists somewhere in the Rhino src regex to
> correctly parse and split (into String[] or Object[]) parameters from
> a String representation of a function call? The regex would of course
> need to take into account the fact that params are seperated by ",",
> but also that a "," can seperate array values, can exist in strings
> and can also seperate obj values etc..
>
> If this regex exists somewhere that is great...otherwise I will post
> it when I write it. But I would really prefer not to reinvent the
> wheel on this one.
>
> e.g.: test('mYstring\'\'\'s', 1e12 , ['A', 'B',
> 'C'],'hello','blah \n aaa', {foo: [1], bar: 12345}) into String[] args
> or Object[] args.
No, there's no regexp for this in Rhino. We tokenize and parse with a
recursive descent parser.
--Norris
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino