Class Comments
Comments, and the rule that decides where one starts.
Inherited Members
Namespace: Link.Foundation.Links.Notation
Assembly: Link.Foundation.Links.Notation.dll
Syntax
public static class Comments
Remarks
# starts a comment when it opens a token: at the start of the document or
after a space, a tab or a line break. A # written inside a token
(issue#1047) or inside a delimited reference ("# not a comment") is
an ordinary character.
Fields
| Edit this page View SourceComment
The character that starts a comment.
Declaration
public const char Comment = '#'
Field Value
| Type | Description |
|---|---|
| char |
Methods
| Edit this page View SourceStripComments(string)
Blanks every comment of a document.
Declaration
public static string StripComments(string document)
Parameters
| Type | Name | Description |
|---|---|---|
| string | document | The document to read. |
Returns
| Type | Description |
|---|---|
| string | The same document with the characters of every comment replaced by spaces. |
Remarks
Every character of a comment is replaced rather than removed, so every later
character keeps the position it had in the document the caller wrote, and
anything the parser reports about a position still points at what the reader
can see. The document is read token by token, the way the grammar reads it, so
a # inside a delimited reference that starts right after a group,
another reference or a literal is content, as it is in one that starts after a
space (issue #377).