/fparsec/main/changes.txt

http://github.com/sandersn/fing · Plain Text · 271 lines · 238 code · 33 blank · 0 comment · 0 complexity · b3e823a3fad870e5abcc3db93cedb25d MD5 · raw file

  1. Version 0.8
  2. -----------
  3. Todo before release:
  4. - updating the documentation
  5. New features/ improvements:
  6. - case-insensitive matching with `pstringCI`, `charsTillStringCI`, etc.
  7. (using the Unicode 1-to-1 case folding mappings for chars in the BMP)
  8. - various new parsers and combinators, including `restOfLine`,
  9. `skipToString`, `manySatisfyMinMax`, `manyStrings`, `withSkippedString`
  10. - new functions `runParserOnSubstring` and `runParserOnSubstream`
  11. - various performance improvements
  12. - F# 1.9.6.16 compatibility
  13. Design changes:
  14. - standardized on a single input stream type (`FParsec.CharStream`)
  15. and a single concrete parser state type (`FParsec.State`)
  16. - refactored the `Reply<_,_>`, `ErrorMessage` and `ParserError` types:
  17. * error replies now also contain a complete `State`
  18. * whether a parser has changed the state is now determined by
  19. checking the input and the output state for equality, instead of testing
  20. the `Consumed` flag
  21. * replaced the `Reply<_,_>.Flags` with a `Status` field
  22. * replaced the various helper functions for constructing a `Reply` with
  23. three overloaded `Reply<_,_>` constructors (with different arities)
  24. - all char parsers are now "newline aware", i.e. they normalize
  25. any of the three standard newline representations ("\n", "\r\n", "\r")
  26. to "\n" and they properly increment the line count whenever they parse
  27. a newline; this means that the BEHAVIOUR OF ALMOST ALL CHAR PARSERS HAS
  28. CHANGED WITH REGARD TO HOW NEWLINE CHARS ARE HANDLED
  29. Bug fixes:
  30. - The `CharStream` class now uses the serialization API to persist the decoder
  31. state for backtracking purposes. Previously it relied on the decoder loosing
  32. its state at block boundaries after a certain sequence of method calls. The
  33. previous approach works in practice for the .NET decoders of the standard
  34. unicode encodings and for simple stateless encodings like ASCII and ANSI,
  35. but it relies on undocumented behaviour and it does not work reliably for
  36. encodings like GB18030, ISO-2022 or ISCII.
  37. - In previous FParsec versions the `CharStream` file path/System.IO.Stream
  38. constructors failed with an `IndexOutOfRange` exception when the file/stream
  39. was empty and encoding detection was not turned off
  40. (reported by Vesa Karvonen - thanks Vesa!).
  41. - In previous FParsec versions the `NumberLiteral.String` returned by the
  42. `numberLiteral` parser included parsed suffix chars despite the
  43. documentation claiming the opposite. (The testing code was buggy too.)
  44. Applications that rely on this behaviour can now use the new
  45. `NumberLiteralOptions.IncludeSuffixCharsInString` to force the
  46. `numberLiteral` parser to include any suffix chars in the returned string.
  47. Other breaking changes:
  48. - renamed the module `CharParser` to `CharParsers`
  49. - moved `CharParser.OperatorPrecedenceParser` into separate module
  50. - FParsec.Primitives:
  51. * (SUBTLE CHANGE) renamed `message` to `fail` and `fail` to `failFatally`
  52. * renamed `pair`, `triple` and `quad` to `tuple2`, `tuple3` and `tuple4`
  53. * renamed `manyFoldLeft` to `manyFold` and changed the
  54. argument order of the accumulator and function argument
  55. * removed `manyFoldRight`
  56. * renamed `count` to `parray` and changed the return type,
  57. renamed `skipCount` to `skipArray`
  58. * renamed `followedBy` and `notFollowedBy` to `followedByL` and
  59. `notFollowedByL` and introduced `followedBy` and `notFollowedBy` functions
  60. that take no second argument
  61. * moved `ParserResult<_>` to `CharParsers` and changed constructor arguments
  62. * removed applyParser
  63. * removed `|>>=`, now `>>=` automatically uses an optimized branch for
  64. uncurried functions
  65. * removed `endBy` and `endBy1` (`endBy p sep` can be replaced with
  66. `many (p .>> sep)` and `endBy1 p sep` with `many1 (p .>> sep)`)
  67. - FParsec.CharParsers:
  68. * renamed `manyTillString` to `charsTillString`
  69. * removed `applyParser` from the public interface
  70. * removed `getIndex`, `skip`, `registerNL`, `extract`, `regexp`
  71. (these low-level operations should be done directly through the
  72. `State<_>`/`CharStream.Iterator` interface)
  73. * removed `anyCharOrNL` (no longer needed, see design changes above)
  74. * removed `nSatisfy` (can be replaced with `manySatisfyMinMax`)
  75. * removed `unicodeDigit` and `unicodeNumber` (can be replaced with
  76. `satisfy System.Char.IsDigit` and `satisfy System.Char.IsNumber`)
  77. * moved the helper functions `expectedError`, `unexpectedError` etc. into
  78. the `Error` module
  79. - FParsec.CharStream:
  80. * string constructor takes more arguments
  81. * `Iterator.Peek(i)` now returns the `EndOfStreamChar` char instead
  82. of throwing an exception if the char peeked at lies before the beginning
  83. of the stream
  84. Version 0.7.3.1, 2009-02-26
  85. ---------------------------
  86. - Fixed a bug in `CharParser.normalizeNewlines`/`CharStream.NormalizeNewlines`.
  87. This bug also affected the `skipped` and `manyTillString` parsers, which
  88. internaly call `normalizeNewlines` to normalize the returned string.
  89. The bug was reported by Greg Chapman - thanks Greg!
  90. When given a multi-line string in which the lines are delimited by "\r\n" but
  91. the last line does not end in a newline, the buggy `normalizeNewlines`
  92. replaced the chars on the last line with '\n` chars.
  93. - Changed the signature of `Helper.SkipOverWhitespace`.
  94. Known issue:
  95. - Visual Studio rebuilds the whole solution every time one
  96. tries to run the "Test" executable under the debugger.
  97. This behaviour is caused by a known bug in the F# Visual
  98. Studio plugin. I'm not aware of any workaround.
  99. Version 0.7.3, 2008-12-08
  100. -------------------------
  101. Breaking changes (all of which should have little or no impact
  102. on existing code bases):
  103. - `CharStream.Iterator` instances now compare equal if and only if they belong
  104. to the same `CharStream` and point to the same index (previously they
  105. compared only equal if their internal representations were identical)
  106. - the constructor argument of `Error.otherError` is now expected to be
  107. comparable with F#'s structural comparison function `compare`,
  108. see http://research.microsoft.com/fsharp/manual/spec2.aspx#_Toc207785725
  109. - the signature of the second `ParserError.ToString` overload has changed
  110. - `CharParser.errorToString` and `printErrorLine` have been deprecated
  111. New features:
  112. - reimplemented the error formatting code in `FParsec.Error`
  113. - added new `State<_>.AdvanceTo` and `CharStream.Iterator.Advance` overloads
  114. - slightly modified the error reporting in `Primitives.sepEndBy`
  115. - some documentation fixes
  116. Version 0.7.2, 2008-11-17
  117. -------------------------
  118. - added `CharParser.OperatorPrecedenceParser`
  119. - changed the overflow checking in `pint32` such that it will
  120. not be affected by an expected future change in F#'s
  121. int32 -> uint64 conversion behaviour
  122. - added `CharParser.pint16`, `puint16`, `pint8`, `puint8`
  123. - changed the signatures in CharParser.fsi to use the `Parser<_,_>` type
  124. abbreviation
  125. - fixed outdated documentation of `CharParser.expectedError`
  126. - some minor optimizations
  127. Version 0.7.1, 2008-09-29
  128. -------------------------
  129. Breaking changes:
  130. - renamed `Primitives.Reply._tag` member to `Flags` and gave
  131. it a proper enumeration type
  132. - `CharParser.State` is now a reference type
  133. - Removed `CharParser.State.Flags` member
  134. - deprecated `Primitives.reconstructError`
  135. Version 0.7.0.1, 2008-09-23
  136. ---------------------------
  137. Breaking change:
  138. - changed the case of the `FParsec.Error.Pos` members
  139. (This wasn't already done in 0.7 because of an oversight.)
  140. Version 0.7, 2008-09-13
  141. -------------------------
  142. Bugfixes:
  143. - made `FParsec.Error.Pos` IComparable to prevent `ParserError.ToString`
  144. from throwing an exception under rare circumstances
  145. - corrected the argument checking for some `CharStream.Iterator` methods
  146. for very large arguments
  147. New features:
  148. - compatibility with the F# CTP release
  149. - a configurable parser for number literals: `CharParser.numberLiteral`
  150. - `CharParser.pfloat` now also parses `NaN`, `Infinity` and
  151. hexadecimal floating point literals as supported by IEEE754r, C99 and
  152. Java (but different from the hex representation supported by F#)
  153. - new helper functions `CharParser.floatToHexString`, `floatOfHexString`,
  154. `float32ToHexString` and `float32OfHexString`
  155. - integer parsers: `Charparser.pint32`, `puint64`, `puint32`, `puint64`
  156. - new sample: a JSON parser
  157. - various optimizations and some code cleanup
  158. - new `CharStream.Iterator` members `ReadUntil`, `Increment` and `Decrement`
  159. - new `State` member `AdvanceTo`
  160. - new function `Primitives.createParserForwardedToRef`
  161. - new combinator `|>>=` in `Primitives`
  162. Breaking changes:
  163. - renamed the parsers `char` and `string` to `pchar` and `pstring`
  164. (This is in deference to the built-in F# functions `char`
  165. and `string`, which weren't yet around when the first version
  166. of FParsec was released.)
  167. - changed the case of the properties of the `Reply` and `State` types
  168. (This reflects the emerging consensus in the F# community that all
  169. public members of types should be named in PascalCase.)
  170. - deprecated State.AdvanceNL (use the 3 parameter Advance overload instead)
  171. - deprecated the `Primitives` helper functions `isOk`, `isEmpty`, ...
  172. (the `Reply` properties `IsOk`, `IsEmpty`,... should be used instead)
  173. - deprecated the `CharParser` helper functions `matchChar`, `readChar`, ...
  174. (the `State.Iter` methods `Match`, `Read`, ... should be used instead)
  175. - deprecated `Primitives.option`, `<|>$` should be used instead
  176. - made `CharParser.CharList` internal (If you need this helper class for
  177. your code, just copy the implementation to your source.)
  178. - State.Flags() now has more bits (and less bits are reset on a position change)
  179. Version 0.6, 2008-05-20
  180. -------------------------
  181. - fixed a bug in `manyTillString` (the code keeping track of newlines was
  182. buggy)
  183. - fixed a bug in CharParser.<?> (the error reporting was inconsistent with
  184. Primitives.<?> in the rare case where `<?>` is applied inside an
  185. `attempt (...) <?> label` clause to a parser that returns an EmptyOk reply)
  186. - various changes for F# 1.9.4.15
  187. - added `skipped` parser to `CharParser`
  188. - added `nextCharSatifiesNot`, `prevCharSatifiesNot`,
  189. `currCharSatisfies`, `currCharSatisfiesNot` to `CharParser` module;
  190. the behaviours of the existing `nextCharSatisfies` and `prevCharSatisfies`
  191. were slightly changed (see fparsec.html for more details)
  192. - added `TryWith` and `TryFinally` members to `Primitivs.ParserCombinator`
  193. - added `triple` and `quad` parsers to `Primitives` module
  194. - set CompilationRepresentationFlags.PermitNull for `Error.ParserError`
  195. - various optimizations
  196. - some documentation fixes, including corrections for the docs of
  197. the `CharParser` error generation helper functions (`expectedError` etc.)
  198. Version 0.5.1, 2008-01-20
  199. -------------------------
  200. - added `pipe2`, `pipe3` and `pipe4` primitives
  201. - replaced `count` and `skipCount` primitives with optimized versions
  202. - minor optimizations in `spaces` and `spaces1`
  203. - added `pfloat` char parser
  204. - minor documentation fixes
  205. Version 0.5, 2008-01-15
  206. -------------------------
  207. - Major design change: all lazy computations were removed and the types
  208. Output and Reply unified. The new implementation is considerably simpler
  209. and also compiles with F# 1.9.3.7.
  210. - Fixed a bug in build.bat (reported by Santosh Zachariah - thanks Santosh!)
  211. Version 0.4.4, 2008-01-13
  212. -------------------------
  213. - fixed a minor issue in CharParser.attempt
  214. - added `.>>!` and `>>.!` primitives
  215. - added `skipManySatisfy` and `skipMany1Satisfy` char parsers
  216. Version 0.4.3, 2008-01-12
  217. -------------------------
  218. - fixed bugs in the CharParser versions of `<?>` and `attempt`.
  219. - added `>>?` primitive
  220. - added `skipSatisfy` and `skipSatisfyL` char parsers
  221. - minor documentation fixes
  222. Version 0.4.2, 2008-01-04
  223. -------------------------
  224. - performance improvements in `CharStream.Iterator`
  225. - minor documentation fixes
  226. Version 0.4.1, 2008-01-02
  227. -------------------------
  228. - documentation fixes
  229. - new sample application: a parser for Parsing Expression Grammars
  230. - `newline` and `unicodeNewline` now return '\n', instead of 1 or 2
  231. - added `whitespace` parser and changed `unicodeWhitespace`
  232. - added `spaces` parser (equivalent to `skipManyChars whitespace`)
  233. - removed newlineRepl parameter from `manyTillString`
  234. - added `skipManyTill` and `skipManyCharsTill`
  235. - generalized types of skipManyChars and skipManyChars1
  236. Version 0.4, 2007-12-30
  237. -----------------------
  238. - initial public release