Fossil SCM
Fixed some grammar and spelling in the th1.md doc.
Commit
40787f50119aced6d5be4678edbc30cd9d4d1b0652cd488ae3c5e99c7bd7b48b
Parent
af39da6d5583f80…
1 file changed
+11
-11
+11
-11
| --- www/th1.md | ||
| +++ www/th1.md | ||
| @@ -33,14 +33,14 @@ | ||
| 33 | 33 | seem inefficient, but it is faster than people imagine, and numeric |
| 34 | 34 | computations do not come up very often for the kinds of work that TH1 does, |
| 35 | 35 | so it has never been a factor.) |
| 36 | 36 | |
| 37 | 37 | 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. | |
| 39 | 39 | The text of the command (excluding the newline or semicolon terminator) |
| 40 | 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 | |
| 41 | +name and subsequent tokens are the arguments. In this sense, TH1 syntax | |
| 42 | 42 | is similar to the familiar command-line shell syntax. |
| 43 | 43 | |
| 44 | 44 | A token is any sequence of characters other than whitespace and semicolons. |
| 45 | 45 | Or, all text without double-quotes is a single token even if it includes |
| 46 | 46 | whitespace and semicolons. Or, all text without nested {...} pairs is a |
| @@ -48,32 +48,32 @@ | ||
| 48 | 48 | |
| 49 | 49 | The nested {...} form of tokens is important because it allows TH1 commands |
| 50 | 50 | to have an appearance similar to C/C++. It is important to remember, though, |
| 51 | 51 | that a TH1 script is really just a list of text commands, not a context-free |
| 52 | 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 | |
| 53 | +C/C++ programmers because TH1 does look a lot like C/C++, but the semantics | |
| 54 | 54 | of TH1 are closer to FORTH or Lisp than they are to C. |
| 55 | 55 | |
| 56 | -Consider the "if" command in TH1. | |
| 56 | +Consider the `if` command in TH1. | |
| 57 | 57 | |
| 58 | 58 | if {$current eq "dev"} { |
| 59 | 59 | puts "hello" |
| 60 | 60 | } else { |
| 61 | 61 | puts "world" |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 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 {...} | |
| 65 | +of the command, is `if`. | |
| 66 | +The second token is `$current eq "dev"` - an expression. (The outer {...} | |
| 67 | 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"'. | |
| 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 | 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 | |
| 71 | +The `if` command evaluates its first argument (the second token) | |
| 72 | +as an expression, and if that expression is true, evaluates its | |
| 73 | 73 | 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 | |
| 75 | 75 | the fourth argument is evaluated as a TH1 expression. |
| 76 | 76 | |
| 77 | 77 | So, you see, even though the example above spans five lines, it is really |
| 78 | 78 | just a single command. |
| 79 | 79 | |
| 80 | 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 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 |