We should probably try to just come up with a basic algorithm first, then I can code the Java end of it, and someone else could code the JS end of it.
I'll try to come up with some basic cases that we'd have to look for. Stuff like:
end of line - should it get a semi-colon, or is it continued on the next line.
end of function - does it need a semi-colon?
If the code is going to be compressed anyway, it might be easier to make it one big line, then try to find the missing semi-colons, that way you don't have to worry about end of line's that shouldn't have semi-colons like this:
var test = "test" +
"test";
or
var test = "test"
+ test;
Hmm...now you've got me thinking. This is bad....I have work to get done for my "real" job, but I want to make this work!
Jesse
Doug Melvin wrote:
I have a firend with a Comp Sci/Comp Math education. He will help me with this. says "It's easy"Something to do with stacks and queues.. I called it "counting braces and crlf's" and he said that that is basically it. So.. If I harras him enough, we can have the semi colon checking (and brace matching, ect) in a few weeks.. I would rely on him to do the codeing.. only to show me what he thinks I should be doing with these stacks and queues.. (If someone just sat up and yelled "uerica!".. feel free to write this code yerself.. :-) ) ----- Original Message ----- From: "Leif W" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 30, 2003 8:29 AM Subject: Re: [Dynapi-Dev] Any word on the Java CompressorThat's a good point. Maybe for those who don't have access to java, or don't want to install it or use it? It's always nice to have some flexibility and options. Either way, if it's a Java or _javascript_, it'll be nice to have a GUI version someday, but probably Jesse is right in focussing attention to fixing the missing smi-colon issue. IIRC, in some cases where the compressor would like a semi-colon, theremaysimply be one missing, or there may intentionally be one missing, because sometimes the _javascript_ breaks with those semi-colons in place. In each case the compressor has to do it's thing but figure out which case iswhichbefore adding semi-colons. Leif ----- Original Message ----- From: Doug Melvin To: [EMAIL PROTECTED] Sent: Monday, September 29, 2003 5:10 PM Subject: Re: [Dynapi-Dev] Any word on the Java Compressor ---opinion start--- The JScript version should not be "done away with" Even if it lags behind the Java version (assuming one does come out) itcanstill be a usefull tool for online editing of html documents.. ---opinion end--- ----- Original Message ----- From: Jesse Vitrone To: [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 10:00 AM Subject: Re: [Dynapi-Dev] Any word on the Java Compressor If you have long term plans of doing away with the _javascript_ version,thenwhy implement the missing semi-colon logic in _javascript_? If you haveideasand just give me some pseudo, I can whip something up in Java and add itin.Jesse Raymond Irving wrote: Ok I'll try to implement such a featrure into to JScript version (beacause I'm not that verse at Java) and then you can implement it into the Java version. Once we have a gui interface I think we can then do away with the JScript version. __ Raymond Irving Jesse Vitrone <[EMAIL PROTECTED]> wrote: Raymond, Unfortunately, no. I've been using it all the time, but just from the command line. I'd love to be able to put more time in it, but I've been busy with other stuff :( If there was time to work on it, I think it might be better spent trying to add logic to determine where missing semi-colons are and where it's safe to add them in. Jesse Raymond Irving wrote:Hi Jesse, Any word on the Visual side of the Java Compressor for DynAPI? -- Raymond Irving __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.522 / Virus Database: 320 - Release Date: 9/29/03 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.522 / Virus Database: 320 - Release Date: 9/29/03 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/