public void should_recognize_as(string input, AstBuilder<LanguageConstruct> expected) { var subject = new RecognizeLines(); var result = subject.ParseWholeFile(input); result.Should() .BeRecognizedAs(expected); }
public static LanguageConstruct Interpret(int indentationDepth, string content, RecognizeLines recognizeLines) { recognizeLines.RememberThatHaveFoundCommentSection(); var match = CommentDefinitionBlockPreludePattern.Match(content); if (!match.Success) { return _ExtractCommentDefinitionBlockPrelude(indentationDepth, "", ""); } var commentId = match.Groups["commentId"].Value; var extra = match.Groups["extra"].Value; return _ExtractCommentDefinitionBlockPrelude(indentationDepth, commentId, extra); }
public static LanguageConstruct Interpret(string content, RecognizeLines recognizeLines) { recognizeLines.RememberThatHaveFoundCommentSection(); var match = CommentDefinitionPattern.Match(content); if (!match.Success) { return _ExtractSingleLineCommentDefinition( "", content.Substring(1) .TrimStart(), ""); } var commentId = match.Groups["commentId"].Value; var commentSeparator = match.Groups["commentSeparator"].Value; var firstLineContent = match.Groups["firstLineContent"].Value; return _ExtractSingleLineCommentDefinition(commentId, firstLineContent, commentSeparator); }