diff options
author | JJ | 2024-05-17 03:27:10 +0000 |
---|---|---|
committer | JJ | 2024-05-17 08:08:23 +0000 |
commit | 08439ee27125539e66cac4a6f2ddf6488878a601 (patch) | |
tree | bb8ccc8fa0b1b178bfb2041d64c88053dc818d11 /docs/SYNTAX.md | |
parent | 7334c4b65d6722911c20af34f830ddc6c69b57e5 (diff) |
docs: update highlighting
Diffstat (limited to 'docs/SYNTAX.md')
-rw-r--r-- | docs/SYNTAX.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/SYNTAX.md b/docs/SYNTAX.md index c6e96f6..249d6e3 100644 --- a/docs/SYNTAX.md +++ b/docs/SYNTAX.md @@ -4,7 +4,7 @@ There is little difference between a function, macro, and operator call. There are only a few forms such calls can take, too, though notably more than most other languages (due to, among other things, uniform function call syntax): hence this section. -``` +```puck # The standard, unambiguous call. routine(1, 2, 3, 4) # The method call syntax equivalent. @@ -22,7 +22,7 @@ routine 1, 2, 3, 4 Binary operators have some special rules. -``` +```puck # Valid call syntaxes for binary operators. What can constitute a binary # operator is constrained for parsing's sake. Whitespace is optional. 1 + 2 @@ -33,7 +33,7 @@ Binary operators have some special rules. As do unary operators. -``` +```puck # The standard call for unary operators. Postfix. 1? ?(1) @@ -41,7 +41,7 @@ As do unary operators. Method call syntax has a number of advantages: notably that it can be *chained*: acting as a natural pipe operator. Redundant parenthesis can also be omitted. -``` +```puck # The following statements are equivalent: foo.bar.baz foo().bar().baz() @@ -110,7 +110,7 @@ of that then ... A line beginning with a scope token is treated as attached to the previous expression. -``` +```puck # Technically allowed. Please don't do this. let foo = ... @@ -132,7 +132,7 @@ of that then ... This *can* lead to some ugly possibilities for formatting that are best avoided. -``` +```puck # Much preferred. let foo = @@ -166,7 +166,7 @@ There are some syntactic constructs unambiguously recognizable as statements: al Expressions can go almost anywhere. Our indentation rules above allow for it. -``` +```puck # Some different formulations of valid expressions. if cond then @@ -190,7 +190,7 @@ let foo = that ``` -``` +```puck # Some different formulations of *invalid* expressions. # These primarily break the rule that everything following a scope token # (ex. `=`, `do`, `then`) not at the end of the line must be self-contained. |