Skip to content

Feature: Implement the UTF-8 lexer - #74

Merged
mf366-dev merged 11 commits into
devfrom
feat/lexer-impl
Aug 12, 2026
Merged

Feature: Implement the UTF-8 lexer#74
mf366-dev merged 11 commits into
devfrom
feat/lexer-impl

Conversation

@mf366-dev

Copy link
Copy Markdown
Member

Before you continue

Before submitting your pull request, please check all the boxes that apply:

  • I have read the project's contributing guidelines.
  • My code follows the project's coding style and conventions (if applicable).
  • I have added tests that prove my fix is effective or that my feature works (if applicable).
  • I have ensured that my code passes all existing tests.
  • I have updated the documentation accordingly (if applicable).
  • I have checked that my changes do not introduce new warnings or errors.
  • I have kept my pull request focused on a single feature or fix.
  • I have provided a clear and descriptive title and description for my pull request.

Summary

This adds the UTF-8 lexer that is gon' get RSML development actually started. It also removes the buffer but oh well.

Related Issues

Closes #49.

Testing

No tests were added (marked for later).

Changes Made

  • Implemented IUtf8Lexer and Utf8Lexer
  • Removed the custom buffer and scanner types

Thank you for your contribution!

Essentially, splitting the previously huge `Directory.Build.props`.
…ct and split it by diagnostics and panics (soon by sources as well)
They were heavy to maintain and didn't add much, as the lexer barely used the APIs they exposed. On top of that, .NET has many better ways to handle things like that.

Currently code is fundamentally broken, so CI will fail.
…II extensions instead of UTF-16 string methods) [1/?]

Code is fundamentally broken, so CI will fail. Lots of TODOs in code. Essentially, this is very bad code LMFAO (for now).

Signed-off-by: Matthew
Refs: #49
…II extensions instead of UTF-16 string methods) [2/3]

Code is fundamentally broken, so CI will fail. Lots of TODOs in code. Essentially, this is very bad code LMFAO (for now).

Signed-off-by: Matthew
Refs: #49
Context: Refactor the lexer for performance (using UTF-8 and ASCII extensions instead of UTF-16 string methods)

Code is no longer broken.

Signed-off-by: Matthew
Refs: #49
@mf366-dev

Copy link
Copy Markdown
Member Author

Sending this back to clear build errors and logic errors.

Build errors found:

  • SequenceReader cannot be preserved across yield, because it's a by-ref value type. Recommended alternative to yield: ArrayBufferWriter<Token>.

Logic errors found:

  • Updates to position.Line are very rare and are not working as they should.

View CI status and reviews for more info.

@mf366-dev mf366-dev left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are needed.

Comment thread src/RSML.Language.Lexing/Utf8/Utf8Lexer.cs
: Result.Success(new Token(kind, startLoc, reader.Consumed - startLoc));
}

private void SkipWhitespaceAndComments(ref SequenceReader<byte> reader)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates to position.Line are very rare and are not working as they should.

@mf366-dev

Copy link
Copy Markdown
Member Author

There aren't any tests yet, but this is getting merged.

@mf366-dev
mf366-dev merged commit 9c329a3 into dev Aug 12, 2026
0 of 2 checks passed
@github-project-automation github-project-automation Bot moved this from On Track to Done in 💪 Red Sea Project Aug 12, 2026
@mf366-dev
mf366-dev deleted the feat/lexer-impl branch August 12, 2026 20:34
@mf366-dev mf366-dev mentioned this pull request Aug 12, 2026
3 tasks
@mf366-dev mf366-dev linked an issue Aug 15, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Feature: Implement a lexer that uses UTF-8

1 participant