Skip to content

Commit

Permalink
feat: 优化 SourceReader 性能。
Browse files Browse the repository at this point in the history
  • Loading branch information
CYJB committed Mar 26, 2024
1 parent 938c1e8 commit d006bfb
Show file tree
Hide file tree
Showing 9 changed files with 648 additions and 571 deletions.
2 changes: 1 addition & 1 deletion Runtime/Lexers/LexerRunner`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal LexerRunner(LexerData<T> lexerData, LexerController<T> controller)
public void Parse(string source)
{
ArgumentNullException.ThrowIfNull(source);
Parse(new SourceReader(new StringReader(source)));
Parse(SourceReader.Create(source));
}

/// <summary>
Expand Down
11 changes: 1 addition & 10 deletions Runtime/Lexers/LexerTokenizer`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,7 @@ internal LexerTokenizer(LexerData<T> data, LexerController<T> controller)
public void Load(string source)
{
ArgumentNullException.ThrowIfNull(source);
Load(new SourceReader(source));
}

/// <summary>
/// 加载指定的源码。
/// </summary>
/// <param name="source">要加载的源码。</param>
public void Load(StringView source)
{
Load(new SourceReader(source));
Load(SourceReader.Create(source));
}

/// <summary>
Expand Down
66 changes: 0 additions & 66 deletions Runtime/Text/ISourceBuffer.cs

This file was deleted.

209 changes: 0 additions & 209 deletions Runtime/Text/SourceCompleteBuffer.cs

This file was deleted.

Loading

0 comments on commit d006bfb

Please sign in to comment.