Class CommentParser
Contains functions to build parsers which skip over comments
Namespace: Pidgin.Comment
Assembly: Pidgin.dll
Syntax
public static class CommentParser : object
Methods
| Improve this Doc View SourceSkipBlockComment<T, U>(Parser<Char, T>, Parser<Char, U>)
Creates a parser which runs blockCommentStart,
then skips everything until blockCommentEnd.
Declaration
public static Parser<char, Unit> SkipBlockComment<T, U>(Parser<char, T> blockCommentStart, Parser<char, U> blockCommentEnd)
Parameters
| Type | Name | Description |
|---|---|---|
| Parser<Char, T> | blockCommentStart | A parser to recognise a lexeme which starts a multi-line block comment |
| Parser<Char, U> | blockCommentEnd | A parser to recognise a lexeme which ends a multi-line block comment |
Returns
| Type | Description |
|---|---|
| Parser<Char, Unit> | A parser which runs |
Type Parameters
| Name | Description |
|---|---|
| T | |
| U |
SkipLineComment<T>(Parser<Char, T>)
Creates a parser which runs lineCommentStart, then skips the rest of the line.
Declaration
public static Parser<char, Unit> SkipLineComment<T>(Parser<char, T> lineCommentStart)
Parameters
| Type | Name | Description |
|---|---|---|
| Parser<Char, T> | lineCommentStart | A parser to recognise a lexeme which starts a line comment |
Returns
| Type | Description |
|---|---|
| Parser<Char, Unit> | A parser which runs |
Type Parameters
| Name | Description |
|---|---|
| T |
SkipNestedBlockComment<T, U>(Parser<Char, T>, Parser<Char, U>)
Creates a parser which runs blockCommentStart,
then skips everything until blockCommentEnd, accounting for nested comments.
Declaration
public static Parser<char, Unit> SkipNestedBlockComment<T, U>(Parser<char, T> blockCommentStart, Parser<char, U> blockCommentEnd)
Parameters
| Type | Name | Description |
|---|---|---|
| Parser<Char, T> | blockCommentStart | A parser to recognise a lexeme which starts a multi-line block comment |
| Parser<Char, U> | blockCommentEnd | A parser to recognise a lexeme which ends a multi-line block comment |
Returns
| Type | Description |
|---|---|
| Parser<Char, Unit> | A parser which runs |
Type Parameters
| Name | Description |
|---|---|
| T | |
| U |