BasicLexer

- Documented `isForward()` and `isBackward()`
- Made `isBackward()` private
This commit is contained in:
Tristan B. Velloza Kildaire 2023-12-27 08:15:31 +02:00
parent 98784847c7
commit 4286b11250
1 changed files with 19 additions and 1 deletions

View File

@ -148,12 +148,30 @@ public final class BasicLexer : LexerInterface
this.sourceCode = sourceCode;
}
/**
* Checks whether or not we could shift our
* source text pointer forward if it would
* be within the boundries of the source text
* or not
*
* Returns: `true` if within the boundries,
* `false` otherwise
*/
private bool isForward()
{
return position + 1 < sourceCode.length;
}
public bool isBackward()
/**
* Checks whether or not we could shift our
* source text pointer backwards and it it
* would be within the boundries of the source
* text or not
*
* Returns: `true` if within the boundries,
* `false` otherwise
*/
private bool isBackward()
{
return position - 1 < sourceCode.length;
}