File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -244,13 +244,12 @@ static string generateTransitionCondition(RegexNode node)
244244 RegexChar rc => $ """ c == '{ EscapeChar ( rc . Value ) } ' /* { rc } */""" ,
245245 RegexAnyChar => "true /* RegexAnyChar */" ,
246246 NegatedCharClassGroup rcc when rcc . ToString ( ) == $@ "[^[\n]]" => $@ "c is not '\n' and not '\0' /* { rcc } */",
247- NegatedCharClassGroup x when x . Classes . Any ( x => x is RangesCharClass ) => $@ "!({ string . Join ( " && " , x . Classes . Select ( generateTransitionCondition ) ) } ) && c != '\0'",
248247 RangesCharClass rcc => GenerateRangeCondition ( rcc ) ,
249248 WordCharClass wcc => $ """ { ( wcc . Negated ? "!" : "" ) } (char.IsLetterOrDigit(c) || c == '_')""" ,
250249 DigitCharClass dcc => $ """ { ( dcc . Negated ? "!" : "" ) } char.IsDigit(c)""" ,
251250 WhitespaceCharClass scc => $ """ { ( scc . Negated ? "!" : "" ) } char.IsWhiteSpace(c)""" ,
252251 LetterCharClass lcc => $ """ { ( lcc . Negated ? "!" : "" ) } char.IsLetter(c)""" ,
253- NegatedCharClassGroup x => $@ "false /* { x } ( { x . GetType ( ) . Name } ) { string . Join ( " && " , x . Classes . Select ( x => $ " { x } ( { x . GetType ( ) . Name } )" ) ) } */ ",
252+ NegatedCharClassGroup x => $@ "!( { string . Join ( " || " , x . Classes . Select ( generateTransitionCondition ) ) } ) && c != '\0' ",
254253 _ => $ "false /* { node } ({ node . GetType ( ) . Name } ) */"
255254 } ;
256255 }
You can’t perform that action at this time.
0 commit comments