Skip to content

Commit

Permalink
Expose input parameters as public properties in Tokenizer and Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed Apr 2, 2024
1 parent d0ac02b commit 573e708
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Acornima/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public Parser(ParserOptions options)
_isReservedWord = _isReservedWordBind = null!;
}

public ParserOptions Options => _options;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Script ParseScript(string input, string? sourceFile = null, bool strict = false)
{
Expand Down
7 changes: 7 additions & 0 deletions src/Acornima/Tokenizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public Tokenizer(string input, int start, int length, SourceType sourceType, str
Reset(input, start, length, sourceType, sourceFile);
}

public string Input => _input;
public Range Range => new Range(_startPosition, _endPosition);
public SourceType SourceType => _sourceType;
public string? SourceFile => _sourceFile;

public TokenizerOptions Options => _options;

public Token Current
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit 573e708

Please sign in to comment.