Fossil SCM

Fixed some grammar and spelling in the th1.md doc.

wyoung 2018-09-04 11:59 trunk
Commit 40787f50119aced6d5be4678edbc30cd9d4d1b0652cd488ae3c5e99c7bd7b48b
1 file changed +11 -11
+11 -11
--- www/th1.md
+++ www/th1.md
@@ -33,14 +33,14 @@
3333
seem inefficient, but it is faster than people imagine, and numeric
3434
computations do not come up very often for the kinds of work that TH1 does,
3535
so it has never been a factor.)
3636
3737
A TH1 script consist of a sequence of commands.
38
-Each command is terminated by the first (unescaped) newline or ";" character.
38
+Each command is terminated by the first *unescaped* newline or ";" character.
3939
The text of the command (excluding the newline or semicolon terminator)
4040
is broken into space-separated tokens. The first token is the command
41
-name and subsequent tokens are the arguments. In this since, TH1 syntax
41
+name and subsequent tokens are the arguments. In this sense, TH1 syntax
4242
is similar to the familiar command-line shell syntax.
4343
4444
A token is any sequence of characters other than whitespace and semicolons.
4545
Or, all text without double-quotes is a single token even if it includes
4646
whitespace and semicolons. Or, all text without nested {...} pairs is a
@@ -48,32 +48,32 @@
4848
4949
The nested {...} form of tokens is important because it allows TH1 commands
5050
to have an appearance similar to C/C++. It is important to remember, though,
5151
that a TH1 script is really just a list of text commands, not a context-free
5252
language with a grammar like C/C++. This can be confusing to long-time
53
-C/C++ programmers because TH1 does look a lot like C/C++. But the semantics
53
+C/C++ programmers because TH1 does look a lot like C/C++, but the semantics
5454
of TH1 are closer to FORTH or Lisp than they are to C.
5555
56
-Consider the "if" command in TH1.
56
+Consider the `if` command in TH1.
5757
5858
if {$current eq "dev"} {
5959
puts "hello"
6060
} else {
6161
puts "world"
6262
}
6363
6464
The example above is a single command. The first token, and the name
65
-of the command, is "if".
66
-The second token is '$current eq "dev"' - an expression. (The outer {...}
65
+of the command, is `if`.
66
+The second token is `$current eq "dev"` - an expression. (The outer {...}
6767
are removed from each token by the command parser.) The third token
68
-is the 'puts "hello"', with its whitespace and newlines. The fourth token
69
-is "else". And the fifth and last token is 'puts "world"'.
68
+is the `puts "hello"`, with its whitespace and newlines. The fourth token
69
+is `else"` And the fifth and last token is `puts "world"`.
7070
71
-The "if" command word by evaluating its first argument (the second token)
72
-as an expression, and if that expression is true, evaluating its
71
+The `if` command evaluates its first argument (the second token)
72
+as an expression, and if that expression is true, evaluates its
7373
second argument (the third token) as a TH1 script.
74
-If the expression is false and the third argument is "else" then
74
+If the expression is false and the third argument is `else`, then
7575
the fourth argument is evaluated as a TH1 expression.
7676
7777
So, you see, even though the example above spans five lines, it is really
7878
just a single command.
7979
8080
--- www/th1.md
+++ www/th1.md
@@ -33,14 +33,14 @@
33 seem inefficient, but it is faster than people imagine, and numeric
34 computations do not come up very often for the kinds of work that TH1 does,
35 so it has never been a factor.)
36
37 A TH1 script consist of a sequence of commands.
38 Each command is terminated by the first (unescaped) newline or ";" character.
39 The text of the command (excluding the newline or semicolon terminator)
40 is broken into space-separated tokens. The first token is the command
41 name and subsequent tokens are the arguments. In this since, TH1 syntax
42 is similar to the familiar command-line shell syntax.
43
44 A token is any sequence of characters other than whitespace and semicolons.
45 Or, all text without double-quotes is a single token even if it includes
46 whitespace and semicolons. Or, all text without nested {...} pairs is a
@@ -48,32 +48,32 @@
48
49 The nested {...} form of tokens is important because it allows TH1 commands
50 to have an appearance similar to C/C++. It is important to remember, though,
51 that a TH1 script is really just a list of text commands, not a context-free
52 language with a grammar like C/C++. This can be confusing to long-time
53 C/C++ programmers because TH1 does look a lot like C/C++. But the semantics
54 of TH1 are closer to FORTH or Lisp than they are to C.
55
56 Consider the "if" command in TH1.
57
58 if {$current eq "dev"} {
59 puts "hello"
60 } else {
61 puts "world"
62 }
63
64 The example above is a single command. The first token, and the name
65 of the command, is "if".
66 The second token is '$current eq "dev"' - an expression. (The outer {...}
67 are removed from each token by the command parser.) The third token
68 is the 'puts "hello"', with its whitespace and newlines. The fourth token
69 is "else". And the fifth and last token is 'puts "world"'.
70
71 The "if" command word by evaluating its first argument (the second token)
72 as an expression, and if that expression is true, evaluating its
73 second argument (the third token) as a TH1 script.
74 If the expression is false and the third argument is "else" then
75 the fourth argument is evaluated as a TH1 expression.
76
77 So, you see, even though the example above spans five lines, it is really
78 just a single command.
79
80
--- www/th1.md
+++ www/th1.md
@@ -33,14 +33,14 @@
33 seem inefficient, but it is faster than people imagine, and numeric
34 computations do not come up very often for the kinds of work that TH1 does,
35 so it has never been a factor.)
36
37 A TH1 script consist of a sequence of commands.
38 Each command is terminated by the first *unescaped* newline or ";" character.
39 The text of the command (excluding the newline or semicolon terminator)
40 is broken into space-separated tokens. The first token is the command
41 name and subsequent tokens are the arguments. In this sense, TH1 syntax
42 is similar to the familiar command-line shell syntax.
43
44 A token is any sequence of characters other than whitespace and semicolons.
45 Or, all text without double-quotes is a single token even if it includes
46 whitespace and semicolons. Or, all text without nested {...} pairs is a
@@ -48,32 +48,32 @@
48
49 The nested {...} form of tokens is important because it allows TH1 commands
50 to have an appearance similar to C/C++. It is important to remember, though,
51 that a TH1 script is really just a list of text commands, not a context-free
52 language with a grammar like C/C++. This can be confusing to long-time
53 C/C++ programmers because TH1 does look a lot like C/C++, but the semantics
54 of TH1 are closer to FORTH or Lisp than they are to C.
55
56 Consider the `if` command in TH1.
57
58 if {$current eq "dev"} {
59 puts "hello"
60 } else {
61 puts "world"
62 }
63
64 The example above is a single command. The first token, and the name
65 of the command, is `if`.
66 The second token is `$current eq "dev"` - an expression. (The outer {...}
67 are removed from each token by the command parser.) The third token
68 is the `puts "hello"`, with its whitespace and newlines. The fourth token
69 is `else"` And the fifth and last token is `puts "world"`.
70
71 The `if` command evaluates its first argument (the second token)
72 as an expression, and if that expression is true, evaluates its
73 second argument (the third token) as a TH1 script.
74 If the expression is false and the third argument is `else`, then
75 the fourth argument is evaluated as a TH1 expression.
76
77 So, you see, even though the example above spans five lines, it is really
78 just a single command.
79
80

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button