Anyone know of anything that already does that? 

I have a regex that does an ok job of finding parts of a line that have 
already been "completed", figuring out what's "partially" done.. and then 
some code that looks to see what could match the "partial" part, but 
obviously a one-line regex isn't going to do a very good job of parsing 
javascript :)


What I have is: 

static std::regex 
completion_regex("^(.*?[\\[\\]\\(\\)]*?)[.]?([^.\\[\\]\\(\\)]*)$");

My goal is to handle simple one-liners, not more complex language features 
like creating functions or loops.. 

so if you had:

var a={alpha: 1, bravo: [{charlie: 3, delta: 4}]};

and you type a.b[0].c<tab> 

it sees the only option starting with a 'c' is "charlie" and adds that to 
your string so now you have:

a.b[0].charlie<cursor here>

and then you can press enter and it prints 3.

live:
http://regexr.com/3dbun

Anyone have anything better?

Thanks.

--Zac

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to