-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation.html #506
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,9 @@ Unreleased | |
|
||
### Bug fixes | ||
|
||
### Documentation | ||
- Added END OF INPUT (`!.`). | ||
|
||
4.0.2 | ||
----- | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -833,6 +833,41 @@ <h3 id="grammar-syntax-and-semantics-parsing-expression-types">Parsing Expressio | |
</div> | ||
</dd> | ||
|
||
<dt><code>!.</code> (END OF INPUT)</dt> | ||
|
||
<dd> | ||
<p>Match END OF INPUT. This <em>Bang Dot</em> sequence will match a completely empty input, | ||
or patterns up to the end of input. This is a composite rule; | ||
It should NOT be placed inside a character set or quote. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line seems obvious to me (we don't say this about any of the other primitives), and as such, it was confusing. Maybe remove? |
||
For example <code>"f" !.</code> | ||
will test for end of input after the character "f".</p> | ||
<div class="example"> | ||
<div> | ||
<div><em>Example:</em> <code>no_input = !.</code></div> | ||
<div><em>Matches:</em> <code>""</code></div> | ||
<div><em>Does not match:</em> <code>"f"</code></div> | ||
</div> | ||
<div class="try"> | ||
<em>Try it:</em> | ||
<input type="text" value="" class="exampleInput" name="no_input"> | ||
<div class="result"></div> | ||
</div> | ||
</div> | ||
|
||
<div class="example"> | ||
<div> | ||
<div><em>Example:</em> <code>end_of_input = "f" !.</code></div> | ||
<div><em>Matches:</em> <code>"f[EOI]"</code></div> | ||
<div><em>Does not match:</em> <code>"f [EOI]"</code>, <code>""</code></div> | ||
</div> | ||
<div class="try"> | ||
<em>Try it:</em> | ||
<input type="text" value="f" class="exampleInput" name="end_of_input"> | ||
<div class="result"></div> | ||
</div> | ||
</div> | ||
</dd> | ||
|
||
<dt><code>[<em>characters</em>]</code></dt> | ||
|
||
<dd> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,7 @@ action = match:(" "+ "a" { return location(); }) rest:rest { return {match, rest | |
alt = match:("a" / "b" / "c") rest:rest { return {match, rest}; } | ||
|
||
rest "The rest of the input" = $.* | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, this is a nitpick, but can you move your new rule above |
||
no_input = match:!. rest:rest { return {match, rest}; } | ||
|
||
end_of_input = match:("f" !.) rest:rest { return {match, rest}; } |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"patterns up to the end of the rule" isn't clear. I think you mean that it's useful when used as a predicate, but we probably need some more words.