Check Your Work
Verify your document parses, and tidy it with the formatter
If you do have the technique program installed, we can use it to check our work.
Check syntax is correct
Put the greeting : procedure from the previous page into a file called
Hello.tq so we can run the compiler on it.
First you can run the check command to make sure it parses correctly:
$ technique check Hello.tq
ok
$
Code formatting
The Technique parser is remarkably whitespace agnostic. We ignore leading and trailing whitespace as much as possible. But there IS a code formatter, which will tidy your document to the canonical layout that will best represents the nesting of the code and your intent as the author.
$ technique format Hello.tq
greeting :
1. Attempt to say hello to everyone in the room and totally fail to get
on with any of them.
2. Offer to make tea.
$
This will format the document and syntax highlight the output in your terminal console.
You may not have noticed, but it re-wrapped the content of step 1 to the width of a standard terminal and with the correct hanging indent. There's an option to specify a different wrap width if you require.
If you redirect to a file then it'll be plain unhighlighted text:
$ technique format Hello.tq > out
$ cat out
greeting :
1. Attempt to say hello to everyone in the room and totally fail to get
on with any of them.
2. Offer to make tea.
$
In editors with support for the Technique language you can code format the document in-place with "Format Buffer" or similar.