hhyyrylainen / Leviathan

Leviathan Game Engine
Other
17 stars 8 forks source link

Make the file generator properly indent lines #34

Open hhyyrylainen opened 5 years ago

hhyyrylainen commented 5 years ago

Besides splitting it into more files it would be good for readability to make an output writer class that would have methods like:

f.puts "if(stuff){"
f.indent
f.puts "return true;"
f.deindent

to make the code output code cleaner and easier to read. And also the resulting code

NillyTheKid commented 5 years ago

So instead of the current ofstream that writes we'd need a class that's used to write (with indentation and write functionality)?

hhyyrylainen commented 5 years ago

This is about FileGen.rb, the massive ruby file for generating tons of stuff. And, yes, I'm talking about alternative to directly writing to the file in ruby, instead it would have an object in between that inserts indentation.

hhyyrylainen commented 5 years ago

This is flagged "good first issue" but isn't very high priority for anything. This is just a good intro to the file generation system.