php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58841 Expose parser stream
Submitted: 2009-08-30 10:59 UTC Modified: 2009-10-05 11:40 UTC
From: drslump at pollinimini dot net Assigned:
Status: Wont fix Package: spidermonkey (PECL)
PHP Version: 5.3.0RC4 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
10 + 7 = ?
Subscribe to this entry?

 
 [2009-08-30 10:59 UTC] drslump at pollinimini dot net
Description:
------------
I was wondering if it'll be possible to expose Spidermonkey's parser token stream to PHP. It'd allow to create some nice tools to process javascript code be it for minification (ala YUI Compressor) or more advanced behaviors like removing log calls or injecting custom code based on a solid parser instead of regular expressions.

Unfortunately my knowledge of C is very limited and glancing over the extension source code scared the hell out of me with all the PHP related macros :(


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-05 11:40 UTC] c dot robin at smartphp dot org
Unfortunately spidermonkey doesn't provide such a thing as a "parser token stream", most tools use Rhino as it is the only one allowing to manually parse a tokenised javascript code. So until spidermonkey provide this kind of functionnality I will not be able to do this feature ( Even though I need it too ).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 08:01:30 2024 UTC