Skip to content

Commit 573e708

Browse files
committed
Expose input parameters as public properties in Tokenizer and Parser
1 parent d0ac02b commit 573e708

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Acornima/Parser.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public Parser(ParserOptions options)
2626
_isReservedWord = _isReservedWordBind = null!;
2727
}
2828

29+
public ParserOptions Options => _options;
30+
2931
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3032
public Script ParseScript(string input, string? sourceFile = null, bool strict = false)
3133
{

src/Acornima/Tokenizer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public Tokenizer(string input, int start, int length, SourceType sourceType, str
4242
Reset(input, start, length, sourceType, sourceFile);
4343
}
4444

45+
public string Input => _input;
46+
public Range Range => new Range(_startPosition, _endPosition);
47+
public SourceType SourceType => _sourceType;
48+
public string? SourceFile => _sourceFile;
49+
50+
public TokenizerOptions Options => _options;
51+
4552
public Token Current
4653
{
4754
[MethodImpl(MethodImplOptions.AggressiveInlining)]

0 commit comments

Comments
 (0)