@@ -5,11 +5,11 @@ namespace Esprima;
55/// <summary>
66/// Parser options.
77/// </summary>
8- public record class ParserOptions : IScannerOptions
8+ public record class ParserOptions
99{
1010 public static readonly ParserOptions Default = new ( ) ;
1111
12- internal readonly ScannerOptions _scannerOptions = new ( ) ;
12+ public ScannerOptions ScannerOptions { get ; } = new ( ) ;
1313
1414 /// <summary>
1515 /// Gets or sets whether the tokens are included in the parsed tree, defaults to <see langword="false"/>.
@@ -19,27 +19,27 @@ public record class ParserOptions : IScannerOptions
1919 /// <summary>
2020 /// Gets or sets whether the comments are included in the parsed tree, defaults to <see langword="false"/>.
2121 /// </summary>
22- public bool Comments { get ; init ; }
22+ public bool Comments { get => ScannerOptions . _comments ; init => ScannerOptions . _comments = value ; }
2323
2424 /// <summary>
2525 /// Gets or sets whether the parser is tolerant to errors, defaults to <see langword="true"/>.
2626 /// </summary>
27- public bool Tolerant { get ; init ; } = true ;
27+ public bool Tolerant { get => ScannerOptions . _tolerant ; init => ScannerOptions . _tolerant = value ; }
2828
2929 /// <summary>
3030 /// Gets or sets the <see cref="ErrorHandler"/> to use, defaults to <see cref="ErrorHandler.Default"/>.
3131 /// </summary>
32- public ErrorHandler ErrorHandler { get ; init ; } = ErrorHandler . Default ;
32+ public ErrorHandler ErrorHandler { get => ScannerOptions . _errorHandler ; init => ScannerOptions . _errorHandler = value ; }
3333
3434 /// <summary>
3535 /// Gets or sets whether the Regular Expression syntax should be converted to a .NET compatible one, defaults to <see langword="true"/>.
3636 /// </summary>
37- public bool AdaptRegexp { get ; init ; } = true ;
37+ public bool AdaptRegexp { get => ScannerOptions . _adaptRegexp ; init => ScannerOptions . _adaptRegexp = value ; }
3838
3939 /// <summary>
4040 /// Default timeout for created regexes, defaults to 10 seconds.
4141 /// </summary>
42- public TimeSpan RegexTimeout { get ; init ; } = TimeSpan . FromSeconds ( 10 ) ;
42+ public TimeSpan RegexTimeout { get => ScannerOptions . _regexTimeout ; init => ScannerOptions . _regexTimeout = value ; }
4343
4444 /// <summary>
4545 /// The maximum depth of assignments allowed, defaults to 200.
@@ -57,7 +57,7 @@ public record class ParserOptions : IScannerOptions
5757 /// {
5858 /// foreach (var child in node.ChildNodes)
5959 /// {
60- /// child.AdditionalData["Parent"] = node;
60+ /// child.AdditionalData = node;
6161 /// }
6262 /// };
6363 /// </code>
0 commit comments