cwal

Check-in [d40e79250d]
Login

Check-in [d40e79250d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Documented s2's non-processing of backslash escapes in comments. See [https://fossil-scm.org/forum/forumpost/85978ec9d2] for why.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d40e79250d1df9968962d94cf771650a9270cd37
User & Date: stephan 2020-05-07 20:22:06
Context
2020-05-14
07:51
s/parameter/argument/, removed a not-quite-correct snippet. check-in: b5118520c5 user: stephan tags: trunk
2020-05-07
20:22
Documented s2's non-processing of backslash escapes in comments. See [https://fossil-scm.org/forum/forumpost/85978ec9d2] for why. check-in: d40e79250d user: stephan tags: trunk
2020-05-02
22:06
Removed line which was not supposed to have been in the last edit :/. This is why /fileedit needs Preview and Diff features. check-in: ed727d8cdd user: stephan tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to s2/manual/grammar.md.
127
128
129
130
131
132
133





134
135
136
137
138
139
140
s2 supports both C- and C++-style comments, which may appear essentially
anywhere in code:

```s2
// comment until end of line
/* comment until … */
```






When evaluating, comments are ignored as if they were spaces. Newlines
are *almost* always treated as whitespace, with the exception that *some*
block-level constructs allow (for convenience and convention) a
newline to act as an end-of-expression. Here is an example of the effect
of semicolons and newlines around an expression:








>
>
>
>
>







127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
s2 supports both C- and C++-style comments, which may appear essentially
anywhere in code:

```s2
// comment until end of line
/* comment until … */
```

> Sidebar: inside of comments, backslash escapes are not processed.
That means that a `//`-style comment which ends in a backslash
followed by a newline does *not*, contrary to the C standard, combine
the next line with the comment.

When evaluating, comments are ignored as if they were spaces. Newlines
are *almost* always treated as whitespace, with the exception that *some*
block-level constructs allow (for convenience and convention) a
newline to act as an end-of-expression. Here is an example of the effect
of semicolons and newlines around an expression: