nlipiarski / MCC

Marshal Command Code Syntax Highlighter
GNU General Public License v3.0
14 stars 2 forks source link

Adopting new Smelt behavior #3

Closed Moesh-zz closed 8 years ago

Moesh-zz commented 8 years ago

Smelt has a new addition for defining Command Block types, as well as variable handlers.

The right angle bracket > trigger is for JSON properties. A valid JSON string (in curly {} brackets) is then used to set properties for the commands.

>{ "type":"repeating","auto":true, "conditional":true, "executeAs":"@a[name=whatever]", "markerTag";"NameName" }

While this uses JSON, the behavior controls the type of command blocks being placed.

I think we should highlight the >{} to as either a command or a support type.

I'm leaning towards support type, since it affects every command to follow until a new line of command blocks is determined, but I'm not sure.

More info here: http://smelt.gnasp.com/syntax.html

nlipiarski commented 8 years ago

I think it would be a good idea to include the >{} notation because it would allow the smelt commands to be isolated from the regular json in the code and we would be able to provide more specific syntax highlighting for smelt.

Moesh-zz commented 8 years ago

That sounds great. I tried taking a swing at this, but got confused quickly. Would you be able to walk me through it?

nlipiarski commented 8 years ago

Yeah, I'm away this week but I should be free next week.

GnaspGames commented 8 years ago

Also, there is a new variables feature: http://smelt.gnasp.com/syntax.html#variables

Would it be possible to add highlighting to how they are declared and used?

Example:

    $name=Gnasp
    $nameAndTitle=Mr ${name}

    /say Good day ${nameAndTitle}!

Output: [@] Good day Mr Gnasp!

nlipiarski commented 8 years ago

That should be pretty easy to implement

GnaspGames commented 8 years ago

Sorry to add more; but "repeating-chain" and "impulse-chain" are now valid on the JSON properties

Example:

# CHECK TIMER
>{"type":"repeating-chain", "auto":true}
    /worldborder get
    /stats block ~-1 ~ ~ set QueryResult @e[type=ArmorStand,name=SYSTEM] timer 
    /scoreboard players remove @e[type=ArmorStand,name=SYSTEM] timer 1000000 
nlipiarski commented 8 years ago

We will definitely include that when we update the syntax.

nlipiarski commented 8 years ago

The newest version now includes smelt's json and variables.