You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a matrix could be defined as any of the following:
matrix {
581 984
321 35
}
matrix {
581 984;
321 35;
}
matrix {
581 984; 321 35
}
So should matrix { 581 984; 321 35 } also be valid? It's not too clear from the mirrored docs. I'm trying to iron out issues with the Java implementation sdlang-dev/SDL#5
The text was updated successfully, but these errors were encountered:
Despite the curly braces and semicolons, SDLang is NOT a free-form semicolon-terminated language like the C-family. SDLang is a newline-based language, like INI files or shell scripts.
This is the basic grammar of a the simple matrix example:
That right there IS the syntax for adding children to a tag, period.
Second key point: It just so happens that SDLang allows a semicolon to be used as a substitute for a newline. This is to allow combining things onto one line.
That means, your second example:
matrix {
581 984;
321 35;
}
REALLY means this:
matrix {
581 984
321 35
}
Note the two blank lines (which just happen to be inconsequential, because blank lines are ignored in SDLang).
Therefore, if you want to put the entire matrix on one line, you don't do it the C-style way. Instead, you replace the newlines with semicolons:
matrix {; 581 984; 321 35 }
And of course, technically, you can add more semicolons if you want:
// Ugly and pointless, but valid and still means
// the same thing (just with extra blank lines)
;;;;; matrix {;;;; 581 984;;; 321 35;;;;; };;;
And you're right: This should be more clear in the docs.
a matrix could be defined as any of the following:
So should
matrix { 581 984; 321 35 }
also be valid? It's not too clear from the mirrored docs. I'm trying to iron out issues with the Java implementation sdlang-dev/SDL#5The text was updated successfully, but these errors were encountered: