1. Beta test indent.ex?
- Posted by Jeremy Cowgar <jeremy at cow?ar.com> May 20, 2008
- 774 views
I am wondering if a few people would beta test indent.ex for me? It's a pretty hard program to test because I always code with the same style. I am thinking of adding a few more features, cleaning the code up, adding some command line switches and releasing it as a tool with Euphoria. What it does is indents Euphoria source. Right now it uses tabs as indent characters. One of the options will be tab/space if space how many. Anyway, it should take totally malformed euphoria code (malformed as in not indented correctly) and indent it. Right now it saves the source as input_file.new ... so if you pass it hello.e you will have a new file hello.e.new but be careful please. Usage: exu/exwc indent.ex filea.e fileb.ex filec.exw ....
if 10 then puts(1, "John\n") puts(1, "Jane\n") end if
should turn out:
if 10 then puts(1, "John\n") puts(1, "Jane\n") end if
I've tested it on my code, the includes in euphoria/include as well as a few in euphoria/source The URL is: http://jeremy.cowgar.com/files/indent.ex Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com
2. Re: Beta test indent.ex?
- Posted by Jeremy Cowgar <jeremy at ?owg?r.com> May 20, 2008
- 729 views
- Last edited May 21, 2008
Sorry guys/gals, I forgot to mention that this requires 4.0. I probably should have posted to the dev list. Once a few more issues are ironed out, we will make a binary distribution of 4.0 alpha. -- Jeremy Cowgar http://jeremy.cowgar.com
3. Re: Beta test indent.ex?
- Posted by Kenneth Rhodes <ken_rhodes30436 at yahoo?com> May 20, 2008
- 710 views
- Last edited May 21, 2008
Jeremy Cowgar wrote: > > Sorry guys/gals, I forgot to mention that this requires 4.0. I probably should > have posted to the dev list. > > Once a few more issues are ironed out, we will make a binary distribution of > 4.0 alpha. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think you may be reinventing the wheel. Jiri Babor's neat little utility program "tidy.ex" is in the archives: http://www.rapideuphoria.com/tidy.zip Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good,
4. Re: Beta test indent.ex?
- Posted by Kenneth Rhodes <ken_rhodes30436 at yah?o?com> May 20, 2008
- 726 views
- Last edited May 21, 2008
Kenneth Rhodes wrote: > > Jeremy Cowgar wrote: > > > > Sorry guys/gals, I forgot to mention that this requires 4.0. I probably > > should > > have posted to the dev list. > > > > Once a few more issues are ironed out, we will make a binary distribution of > > 4.0 alpha. > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > I think you may be reinventing the wheel. Jiri Babor's neat little > utility program "tidy.ex" is in the archives: > > <a > href="http://www.rapideuphoria.com/tidy.zip">http://www.rapideuphoria.com/tidy.zip</a> > > Well, now tidy.ex crashes on my system. I used it for several years prior to Euphoria 3.0 with no problem. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good,
5. Re: Beta test indent.ex?
- Posted by Jeremy Cowgar <jeremy at c?wgar.co?> May 20, 2008
- 744 views
- Last edited May 21, 2008
Kenneth Rhodes wrote: > > > I think you may be reinventing the wheel. Jiri Babor's neat little > > utility program "tidy.ex" is in the archives: > > > > <a > > href="http://www.rapideuphoria.com/tidy.zip">http://www.rapideuphoria.com/tidy.zip</a> > > > > > Well, now tidy.ex crashes on my system. I used it for several years prior > to Euphoria 3.0 with no problem. Ken, Probably a whole lot easier to resurrect tidy.ex though. I did a search, I'm not sure how I missed that. Thanks for the pointer, I'll look into it. -- Jeremy Cowgar http://jeremy.cowgar.com
6. Re: Beta test indent.ex?
- Posted by Jeremy Cowgar <jeremy at cow?ar.c?m> May 20, 2008
- 771 views
- Last edited May 21, 2008
Kenneth Rhodes wrote: > > > Well, now tidy.ex crashes on my system. I used it for several years prior > to Euphoria 3.0 with no problem. > I added "type" to it's definition of what should be indented and that seems to have fixed the problem. I did some comparisons:
constant name = 10, age = 30 global type abc(object o) ? 0 end type if 10 and 20 and 40 then puts(1, "John\n") elsifhello = 20 def=30 end if function long_name_with_parameters(sequence abc, sequence def) return 0 end function while 10 and 20 and 30 and 40 do puts(1, "Go") end while if 10 and 20 and 30 and 40 then ? 0 end if
turns into with tidy.ex:
constant name = 10, age = 30 global type abc(object o) ? 0 end type if 10 and 20 and 40 then puts(1, "John\n") elsifhello = 20 def=30 end if function long_name_with_parameters(sequence abc, sequence def) return 0 end function while 10 and 20 and 30 and 40 do puts(1, "Go") end while if 10 and 20 and 30 and 40 then ? 0 end if
with indent it turns into:
constant name = 10, age = 30 global type abc(object o) ? 0 end type if 10 and 20 and 40 then puts(1, "John\n") elsifhello = 20 def=30 end if function long_name_with_parameters(sequence abc, sequence def) return 0 end function while 10 and 20 and 30 and 40 do puts(1, "Go") end while if 10 and 20 and 30 and 40 then ? 0 end if
Line counts: lines nb-lines nb-nc-lines chars 253 253 235 6510 tidy.ex 142 131 127 3820 indent.ex However, that's not totally valid as I saw in tidy.ex such functions as rtrim, ltrim which I use from the standard library and did not have to implement in my own code. -- Jeremy Cowgar http://jeremy.cowgar.com