diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/language-reference/05-expressions.md | 14 | ||||
| -rw-r--r-- | docs/language-reference/06-statements.md | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/docs/language-reference/05-expressions.md b/docs/language-reference/05-expressions.md index 861def5c0..4879d5a5f 100644 --- a/docs/language-reference/05-expressions.md +++ b/docs/language-reference/05-expressions.md @@ -92,7 +92,7 @@ If the base expression of a member reference is a _pointer-like type_ such as `C ### Vector Swizzles -When the base expression of a member expression is of a vetor type `vector<T,N>` then a member expression is a _vector swizzle expression_. +When the base expression of a member expression is of a vector type `vector<T,N>` then a member expression is a _vector swizzle expression_. The member name must conform to these constraints: * The member name must comprise between one and four ASCII characters @@ -268,7 +268,7 @@ The following prefix operators are supported: A prefix operator expression like `+val` is equivalent to a call expression to a function of the matching name `operator+(val)`, except that lookup for the function only considers functions marked with the `__prefix` keyword. -The built-in prefix `++` and `--` operators require that their operand is an l-value, and work as folows: +The built-in prefix `++` and `--` operators require that their operand is an l-value, and work as follows: * Evaluate the operand to produce an l-value * Read from the l-value to yield an _old value_ @@ -287,7 +287,7 @@ The following postfix operators are supported: A postfix operator expression like `val++` is equivalent to a call expression to a function of the matching name `operator++(val)`, except that lookup for the function only considers functions marked with the `__postfix` keyword. -The built-in prefix `++` and `--` operators require that their operand is an l-value, and work as folows: +The built-in prefix `++` and `--` operators require that their operand is an l-value, and work as follows: * Evaluate the operand to produce an l-value * Read from the l-value to yield an _old value_ @@ -316,9 +316,9 @@ The follow infix binary operators are supported: | `!=` | Equality | not equal to | | `&` | BitAnd | bitwise and | | `^` | BitXor | bitwise exclusive or | -| `|` | BitOr | bitwise or | +| `\|` | BitOr | bitwise or | | `&&` | And | logical and | -| `||` | Or | logical or | +| `\|\|` | Or | logical or | | `+=` | Assignment | compound add/assign | | `-=` | Assignment | compound subtract/assign | | `*=` | Assignment | compound multiply/assign | @@ -327,7 +327,7 @@ The follow infix binary operators are supported: | `<<=` | Assignment | compound left shift/assign | | `>>=` | Assignment | compound right shift/assign | | `&=` | Assignment | compound bitwise and/assign | -| `|=` | Assignment | compound bitwise or/assign | +| `\|=` | Assignment | compound bitwise or/assign | | `^=` | Assignment | compound bitwise xor/assign | | `=` | Assignment | assignment | | `,` | Sequencing | sequence | @@ -342,7 +342,7 @@ The conditonal operator, `?:`, is used to select between two expressions based o useNegative ? -1.0f : 1.0f ``` -The condition may be either a single value of type `bool`, or a vetor of `bool`. +The condition may be either a single value of type `bool`, or a vector of `bool`. When a vector of `bool` is used, the two values being selected between must be vectors, and selection is performed component-wise. > Note: Unlike C, C++, GLSL, and most other C-family languages, Slang currently follows the precedent of HLSL where `?:` does not short-cirucuit. diff --git a/docs/language-reference/06-statements.md b/docs/language-reference/06-statements.md index f861ba299..daed30a67 100644 --- a/docs/language-reference/06-statements.md +++ b/docs/language-reference/06-statements.md @@ -93,10 +93,10 @@ case 1: doBasicThing(); break; -// this is another swithc case clause +// this is another switch case clause default: - doAnotherThing(); - break; + doAnotherThing(); + break; ``` A _case label_ consists of the keyword `case` followed by an expresison and a colon (`:`). @@ -105,7 +105,7 @@ The expression must evaluate to a compile-time constant integer. A _default label_ consists of the keyword `default` followed by a colon (`:`). It is an error for a case label or default label to appear anywhere other than the body of a `switch` statement. -It is an error for a statement to appear inside the body of a `switch` statemetn that is no part of a switch case clause. +It is an error for a statement to appear inside the body of a `switch` statement that is no part of a switch case clause. Each switch case clause must exit the `switch` statement via a `break` or other control transfer statement. "Fall-through" from one switch case clause to another is not allowed. @@ -172,7 +172,7 @@ A `break` statement transfers control to after the end of the closest lexically break; ``` -### Continute Statement +### Continue Statement A `continue` statement transfers control to the start of the next iteration of a loop statement. In a for statement with a side effect expression, the side effect expression is evaluated when `continue` is used: |
