I am trying to parse lisp comments from s-expression using FParsec. It helped me a little to parse the single-line comments in this previous thread - How to convert the FParsec parser to parse spaces
While this was allowed, I still need to parse multi-line comments. Here the current code is
/// Read whitespace character as a string. let spaceAsStr = anyOf whitespaceChars |>> fun chr -> string chr /// Read a line comment. let lineComment = pchar lineCommentChar >>. restOfLine true /// Read a multiline comment. /// TODO: make multiline comments nest. let multilineComment = between (pstring openMultilineCommentStr) (pstring closeMultilineCommentStr) (charsTillString closeMultilineCommentStr true System.Int32.MaxValue) /// Read whitespace text. let whitespace = lineComment <|> multilineComment <|> spaceAsStr /// Skip any white space characters. let skipWhitespace = skipMany whitespace /// Skip at least one white space character. let skipWhitespace1 = skipMany1 whitespace
Unfortunately, multi-user analysis never succeeds. Since this is a combinator, I cannot set breakpoints or analyze why it will not work.
Any ideas why this won't work?
source share