Skip to content

[SpaceTode] Tabs and Spaces

Luke Wilson edited this page Aug 23, 2020 · 3 revisions

SpaceTode has some strict syntax rules about tabs and spaces. If you don't follow them, it will throw an error.

Consistent Indent Size

Every indent must be the same size.

Bad, because indents are different sizes:

element MyFirstElement {
   default true
  category "MyCoolElements"
     colour "blue"
}

Good, because indents are the same size:

element MyFirstElement {
   default true
   category "MyCoolElements"
   colour "blue"
}

Good, because indents are the same size:

element MyFirstElement {
        default true
        category "MyCoolElements"
        colour "blue"
}

Consistent Indent Character

You are not allowed to mix up spaces and tabs in different indents.

Bad, because some indents use tabs, and some use spaces:

element MyFirstElement {
        default true
	category "MyCoolElements"
        colour "blue"
}

Good, because all indents use tabs:

element MyFirstElement {
	default true
	category "MyCoolElements"
	colour "blue"
}

Good, because all indents use spaces:

element MyFirstElement {
        default true
        category "MyCoolElements"
        colour "blue"
}

Only Spaces in Diagrams

You must use spaces in between different parts of a diagram.

Bad, because it uses tabs inside a diagram:

element MyFirstElement {
	@  =>   _
	_	@
}

Good, because it only uses spaces inside a diagram:

element MyFirstElement {
	@  =>   _
	_       @
}