コード例 #1
0
        private static Pattern CodePart()
        {
            QuantifiedPattern whileNot = WhileNotChar('\'', '"', '@', '/', '}', '$');

            return(whileNot
                   + MaybeMany(
                       Any(
                           NamedGroup("text", Snippets.CSharpEscapedTextLiteral()),
                           NamedGroup("text", Snippets.CSharpVerbatimTextLiteral()),
                           NamedGroup("char", Snippets.CSharpCharacterLiteral()),
                           NamedGroup("comment", Snippets.CSharpMultilineComment())
                           )
                       + whileNot
                       ));
        }
コード例 #2
0
        private static Pattern TextPart()
        {
            QuantifiedPattern whileNot = WhileNotChar('\\', '{', '"');

            return(NamedGroup("text",
                              whileNot
                              + MaybeMany(
                                  Any(
                                      '\\' + NotNewLineChar(),
                                      "{{"
                                      )
                                  + whileNot
                                  )
                              ));
        }