@@ -63,9 +63,9 @@ public Parser(SmartSettings? smartSettings = null)
6363 {
6464 Settings = smartSettings ?? new SmartSettings ( ) ;
6565 _parserSettings = Settings . Parser ;
66- _operatorChars = _parserSettings . OperatorChars ( ) ;
67- _customOperatorChars = _parserSettings . CustomOperatorChars ( ) ;
68- _formatOptionsTerminatorChars = _parserSettings . FormatOptionsTerminatorChars ( ) ;
66+ _operatorChars = ParserSettings . OperatorChars ;
67+ _customOperatorChars = _parserSettings . CustomOperatorChars ;
68+ _formatOptionsTerminatorChars = ParserSettings . FormatOptionsTerminatorChars ;
6969
7070 _disallowedSelectorChars = _parserSettings . DisallowedSelectorChars ( ) ;
7171 }
@@ -239,19 +239,19 @@ private void ProcessLiteralText(char inputChar, ParserState state, ParsingErrors
239239 return ;
240240 }
241241
242- if ( inputChar == _parserSettings . PlaceholderBeginChar )
242+ if ( inputChar == ParserSettings . PlaceholderBeginChar )
243243 {
244244 AddLiteralCharsParsedBefore ( state ) ;
245- if ( EscapeLikeStringFormat ( _parserSettings . PlaceholderBeginChar , state ) ) return ;
245+ if ( EscapeLikeStringFormat ( ParserSettings . PlaceholderBeginChar , state ) ) return ;
246246
247247 // Context transition
248248 CreateNewPlaceholder ( ref nestedDepth , state , out currentPlaceholder ) ;
249249 currentContext = ParseContext . SelectorHeader ;
250250 }
251- else if ( inputChar == _parserSettings . PlaceholderEndChar )
251+ else if ( inputChar == ParserSettings . PlaceholderEndChar )
252252 {
253253 AddLiteralCharsParsedBefore ( state ) ;
254- if ( EscapeLikeStringFormat ( _parserSettings . PlaceholderEndChar , state ) ) return ;
254+ if ( EscapeLikeStringFormat ( ParserSettings . PlaceholderEndChar , state ) ) return ;
255255 if ( HasProcessedTooManyClosingBraces ( parsingErrors , state ) ) return ;
256256
257257 // End of a nested placeholder's Format.
@@ -292,7 +292,7 @@ private void ProcessSelector(char inputChar, ParserState state, ParsingErrors pa
292292 }
293293 state . Index . LastEnd = state . Index . SafeAdd ( state . Index . Current , 1 ) ;
294294 }
295- else if ( inputChar == _parserSettings . FormatterNameSeparator )
295+ else if ( inputChar == ParserSettings . FormatterNameSeparator )
296296 {
297297 AddLastSelector ( ref currentPlaceholder , state , parsingErrors ) ;
298298
@@ -308,7 +308,7 @@ private void ProcessSelector(char inputChar, ParserState state, ParsingErrors pa
308308 // We are now parsing the literal text *inside* the placeholder's format.
309309 currentContext = ParseContext . LiteralText ;
310310 }
311- else if ( inputChar == _parserSettings . PlaceholderEndChar )
311+ else if ( inputChar == ParserSettings . PlaceholderEndChar )
312312 {
313313 AddLastSelector ( ref currentPlaceholder , state , parsingErrors ) ;
314314
@@ -465,8 +465,8 @@ private void ParseAlternativeEscaping(ParserState state)
465465 throw new ArgumentException ( $ "Unrecognized escape sequence at the end of the literal") ;
466466
467467 // **** Alternative brace escaping with { or } following the escape character ****
468- if ( state . InputFormat [ indexNextChar ] == _parserSettings . PlaceholderBeginChar ||
469- state . InputFormat [ indexNextChar ] == _parserSettings . PlaceholderEndChar )
468+ if ( state . InputFormat [ indexNextChar ] == ParserSettings . PlaceholderBeginChar ||
469+ state . InputFormat [ indexNextChar ] == ParserSettings . PlaceholderEndChar )
470470 {
471471 // Finish the last text item:
472472 if ( state . Index . Current != state . Index . LastEnd )
@@ -509,7 +509,7 @@ private void ParseAlternativeEscaping(ParserState state)
509509 private bool ParseNamedFormatter ( ParserState state )
510510 {
511511 var inputChar = state . InputFormat [ state . Index . Current ] ;
512- if ( inputChar == _parserSettings . FormatterOptionsBeginChar )
512+ if ( inputChar == ParserSettings . FormatterOptionsBeginChar )
513513 {
514514 var emptyName = state . Index . NamedFormatterStart == state . Index . Current ;
515515 if ( emptyName )
@@ -521,16 +521,16 @@ private bool ParseNamedFormatter(ParserState state)
521521 // Note: This short-circuits the Parser.ParseFormat main loop
522522 ParseFormatOptions ( state ) ;
523523 }
524- else if ( inputChar == _parserSettings . FormatterOptionsEndChar || inputChar == _parserSettings . FormatterNameSeparator )
524+ else if ( inputChar == ParserSettings . FormatterOptionsEndChar || inputChar == ParserSettings . FormatterNameSeparator )
525525 {
526- if ( inputChar == _parserSettings . FormatterOptionsEndChar )
526+ if ( inputChar == ParserSettings . FormatterOptionsEndChar )
527527 {
528528 var hasOpeningParenthesis = state . Index . NamedFormatterOptionsStart != PositionUndefined ;
529529
530530 // ensure no trailing chars past ')'
531531 var nextCharIndex = state . Index . SafeAdd ( state . Index . Current , 1 ) ;
532532 var nextCharIsValid = nextCharIndex < state . InputFormat . Length &&
533- ( state . InputFormat [ nextCharIndex ] == _parserSettings . FormatterNameSeparator || state . InputFormat [ nextCharIndex ] == _parserSettings . PlaceholderEndChar ) ;
533+ ( state . InputFormat [ nextCharIndex ] == ParserSettings . FormatterNameSeparator || state . InputFormat [ nextCharIndex ] == ParserSettings . PlaceholderEndChar ) ;
534534
535535 if ( ! hasOpeningParenthesis || ! nextCharIsValid )
536536 {
@@ -540,7 +540,7 @@ private bool ParseNamedFormatter(ParserState state)
540540
541541 state . Index . NamedFormatterOptionsEnd = state . Index . Current ;
542542
543- if ( state . InputFormat [ nextCharIndex ] == _parserSettings . FormatterNameSeparator ) state . Index . Current ++ ;
543+ if ( state . InputFormat [ nextCharIndex ] == ParserSettings . FormatterNameSeparator ) state . Index . Current ++ ;
544544 }
545545
546546 var nameIsEmpty = state . Index . NamedFormatterStart == state . Index . Current ;
@@ -601,8 +601,8 @@ private void AddLastSelector(ref Placeholder currentPlaceholder, ParserState sta
601601 if ( state . Index . Current != state . Index . LastEnd ||
602602 currentPlaceholder . Selectors . Count > 0 && currentPlaceholder . Selectors [ currentPlaceholder . Selectors . Count - 1 ] . Length > 0 &&
603603 state . Index . Current - state . Index . Operator == 1 &&
604- ( state . InputFormat [ state . Index . Operator ] == _parserSettings . ListIndexEndChar ||
605- state . InputFormat [ state . Index . Operator ] == _parserSettings . NullableOperator ) )
604+ ( state . InputFormat [ state . Index . Operator ] == ParserSettings . ListIndexEndChar ||
605+ state . InputFormat [ state . Index . Operator ] == ParserSettings . NullableOperator ) )
606606 currentPlaceholder . AddSelector ( SelectorPool . Instance . Get ( ) . Initialize ( Settings , currentPlaceholder , state . InputFormat , state . Index . LastEnd , state . Index . Current , state . Index . Operator , state . Index . Selector ) ) ;
607607 else if ( state . Index . Operator != state . Index . Current )
608608 parsingErrors . AddIssue ( state . ResultFormat ,
0 commit comments