GnaspGames / Smelt

A CLI tool for Minecraft map makers
http://smelt.gnasp.com
MIT License
19 stars 4 forks source link

Work on #33 (multi-line improvements) and #36 (variables) #42

Closed JBartelsson closed 8 years ago

JBartelsson commented 8 years ago

multiple Lines are now in.

"--" is the trigger Command for a comment!

GnaspGames commented 8 years ago

Note: This is for #33

GnaspGames commented 8 years ago

Copying from conversation for future reference:

Regarding this:

if (line[0]+line[1]!="--"){
            for (var Vars in this.CustomVariables){
            line = line.replace(new RegExp("\\"+Vars,'g'), this.CustomVariables[Vars]);
        }
            this.FinalCommand += " " + line;
        }

Is it is, that is really messy at the moment.

Put this into it's own function:

            for (var Vars in this.CustomVariables){
            line = line.replace(new RegExp("\\"+Vars,'g'), this.CustomVariables[Vars]);
        }

Then call it at the beginning of processRowLine, processJsonLine,processCommandBlockLine and processBangLine.

Then inside processVariableLine only use it to parse varValue

GnaspGames commented 8 years ago

Note: This will also be going towards #36 - variables