GLuaFixer - Parses, fixes and pretty prints your terrible code!

This program does three things!

  • Attempts to fix syntax errors!
  • Pretty prints code!
  • (Extra feature!) Converts old DarkRP shipment/job/entity/etc. syntax to the new one!

The last one is useful for the DarkRP community, but won’t affect you if you run it on normal GLua files. It does, however, show what the program is capable of:

Left is before, right is after.

When to use this program

  • When terrible shit coders don’t know how to fucking indent their god damn code.
  • Fucking around, trying to see what kind of syntax errors it can fix and how it fixes them
  • Converting old DarkRP crap to the newer syntax in batch.

Currently not that much. Maybe I’ll expand the features to make it lint GLua or something.

How to use this program

USING THE GUI:

  1. Double click the gluafixer executable (gluafixer.exe on Windows, gluafixer-linux on Linux)
  2. Select the file you want to read
  3. Save the fixed file.
  4. Observe “LuaErrors.txt”, which contains all the errors the program tried to fix and how it tried to fix it.

USING THE TERMINAL:



// Windows:
gluafixer-console file.lua stdout

// Linux:
gluafixer-linux file.lua stdout


FAQ

  • The syntax corrections made by this program are shite
    > The corrections are made by the glorious uu-parsinglib and are therefore not to be criticised. Seriously, though, I cannot really influence the way it corrects things, sadly.

  • What the FUCK is UUAGC/uu-parsinglib?
    > UUAGC is short for Utrecht University Attribute Grammar Compiler. Hard to explain what it does (something with catamorphisms), but it does it in a fucking amazing way. It’s glorious.
    > uu-parsinglib is a parser library for haskell that fixes syntax errors. It’s also glorious, though a bit slow and I can’t really hook into the error repairing mechanism.

Source of the program
Hahaha you’re not going to understand shit because it’s written in Haskell and UUAGC. You’ll never find any malicous code I put in there hahahahaha!

[http://www.yellosoft.us/public/images/haskell.png

http://foswiki.cs.uu.nl/foswiki/pub/HUT/WebLeftBar/uuagsmall.png](https://github.com/FPtje/GLuaFixer)
Click either glorious image to go to the source.

Where to download this program

More images!

you probably thought the whole Haskell part of your post was gonna make you sound really smart and cool, but now you just like a prick.

[editline]25th July 2015[/editline]

otherwise looks good!

[editline]25th July 2015[/editline]

today’s newbies are tomorrow’s experts.
I think you should tone down your whole post.

Looks amaazing! Can’ wait to try this badboy out

I’m mocking myself because I use niche technology. While Haskell might not be as niche as I make it out to be, I personally know/have known the maintainers of uu-parsinglib and UUAGC. They’re technologies with very few users, but with amazing capabilities.

Scripters who read this thread are being mocked because it’s good banter. Don’t take it too seriously. :v:

that’s great, but did you reread your post before hitting submit?
it sounded really silly all around and just perpetuated the elitist haskeller stereotype.

Wait, there’s an elitist Haskell programmer stereotype? Haha, that’s fucking great!

it seems like you’re trying to advocate for the usage of Haskell, but it’s totally backfiring.

[editline]25th July 2015[/editline]

anyways, this thread is for your tool, and not my ranting.
sorry bout that folks.

Im sure after a week or 2 of this program being out there it will get detected from malwarebytes. IF you did put malicous code…

It was a joke. I’m sure anyone with decent programming knowledge would recognise exploit code, even in a functional language.

@StrappedC4
PLease note that FPtje is not like all programmers, he will never put malicious code anywhere because a SuperCoder like him do always the good.

@FPtje
Thanx for this awsome app.
It will be interestning to made some Sublime Text or NotePad ++ plugin to automate the process.

Best Regards,

Shit man, this would have been my dream a year ago :C

cat cock.lua

what is wrong with you :v:

It’s FPtje, what did you expect? xD

haven’t you read the rest of the code?

[lua]customCheck = function()
/some comment here/
for k,v in pairs(dicks.And.tits(player.GetAll())) do
return v:Tits() < kn […]
end
end
[/lua]

Yes, there is.

I use Ada so I’m more niche than all of you.

Anyway, nice job with GLuaFixer - it might be worth putting something in there called “braindead mode” which detects correct Lua code such as “not”, “and/or” and “~=” and replaces them with Garry’s totally unnecessary C-style operators for when he eventually yanks the plug on normal Lua syntax and addon maintainers have more work to do (although we could just do a s/<thing>/<otherthing>/g. Might not work in all cases though, so if you have an AST representation of the Lua grammar there in Haskell, why not use that…

I remember writing fold algebras to convert GLua tokens to pure Lua and the other way around. The only thing it couldn’t deal with was ‘continue’. I can’t find them at the moment, though.