Releases: BNFC/bnfc
v2.9.6.1
Change for 2.9.6.1
- Haskell: restore
LANGUAGE DeriveDataTypeable
in generatedAbs.hs
;
fixes regression in 2.9.6 [#507]
Builds with GHC versions:
- with
cabal
, GHC 8.0 - 9.12 - with
stack
, GHC 8.4 - 9.12
What's Changed
- Restore DeriveDataTypeable in Abs.hs (Haskell backend) by @fizruk in #508
- Version 2.9.6.1 and CHANGELOG by @andreasabel in #509
New Contributors
Full Changelog: v2.9.6...v2.9.6.1
v2.9.6
Changelog for BNFC 2.9.6
- C: preserve case in constructors (union): e.g. label
EInt
now is union membereInt_
rather thaneint_
[#479] - Haskell: lex ASCII 222 as upper rather than lower case letter
[#497] - Haskell: no longer derive
Typeable
(obsolete since GHC 7.10)
[#503] - Haskell: drop support for GHC 7, generated code needs at least GHC 8.0
Builds with GHC versions:
- with
cabal
, GHC 8.0 - 9.12 - with
stack
, GHC 8.4 - 9.12
What's Changed (auto-generated)
- Bump Haskell CI to GHCs 9.8.0 and 9.4.7 by @andreasabel in #459
- Bump actions/checkout from 3 to 4 by @dependabot[bot] in #457
- Bump stack CI to GHC 9.8.1 by @andreasabel in #464
- stack two digit.yaml by @andreasabel in #470
- lts 22 by @andreasabel in #472
- Bump actions/cache from 3 to 4 by @dependabot[bot] in #473
- Fix #479: C backend: preserve case in union member names by @andreasabel in #480
- Don't add
Lex/Par.hs
to sdist tarball by @andreasabel in #466 - Bump CI to GHC 9.10.1 by @andreasabel in #482
- Add nix packaging support using haskell.nix by @chaserhkj in #483
- Bump Haskell CI to 9.12.0 and Stack CI to 9.10.1 by @andreasabel in #488
- Add
parseRawCF
to use bnfc as library and parse LBNF from another application by @chaserhkj in #484 - Bump CI to GHC 9.12.1 by @andreasabel in #496
- Bump nix flake locked version and use newer ghc versions by @chaserhkj in #502
- Fix #503: Haskell: no longer derive Typeable (obsolete since GHC 7.10) by @andreasabel in #504
- Release 2.9.6 by @andreasabel in #505
New Contributors
- @dependabot[bot] made their first contribution in #457
- @chaserhkj made their first contribution in #483
Full Changelog: v2.9.5...v2.9.6
v2.9.5
Fixes
- C/C++/Java: escape newline etc. when printing
String
andChar
literals [#449] - Java/ANTLR: unescape
String
andChar
literals in parser (needs Java ≥ 15) [#451] - Java/ANTLR: fix case problem with language names like
C
[#455] - Java with line numbers: compatibility with
jflex
≥ 1.8 [#453] - Haskell/GADT: generated
ComposOp.hs
no longer needsmtl
library [#438] - Ocaml: fixed a crash in printer with unbalanced
}
[#439] - Ocaml: lex escape sequences in
Char
[#452] - Ocaml: removed superfluous
let rec
in the printers for token categories
Tested GHC versions:
- with
cabal
, GHC 7.10 - 9.6 - with
stack
, GHC 8.2 - 9.6
What's Changed (autogenerated from PRs)
- Haskell/GADT: produce mtl-2.3 compatible code by @andreasabel in #438
- Fix #439: Ocaml/printer: catch negative indentation by @andreasabel in #440
- Fix: #437: enable doctest for GHC 9.6.1 in Haskell-CI by @andreasabel in #441
- Simplify definition of internal function
columns
by @ivanperez-keera in #442 - Fix for Dockerfile smell DL3059 by @grosa1 in #444
- Haskell/Printer: showString t [] is just t by @andreasabel in #446
- various: fix typos by @p-linnane in #448
New Contributors
- @ivanperez-keera made their first contribution in #442
- @grosa1 made their first contribution in #444
- @p-linnane made their first contribution in #448
Full Changelog: v2.9.4.1...v2.9.5
BNFC 2.9.4.1
BNFC 2.9.4
Bug fixes and improvements
- LBNF: empty tokens types are now forbidden [#388]
- Agda: support position information via
--functor
[#405] - C/C++: use
size_t
and-Wsign-conversion
[#391] - C++: repair broken
--line-numbers
[#390], regression in 2.9.2 by [#349] - Haskell: fix a problem with layout stop words and top-level layout [#399,#413]
- Haskell: generated test parser can parse several files now [#400]
- Java: use L
.valueOf()
instead of deprecatednew
L()
for literal classes L [#402] - Ocaml: non-terminals in generated parser are now type-annotated [#407]
- Ocaml: sanitize bound variables in
define
- Ocaml/Menhir: update parse error mechanism to Menhir 2021/12/30 [#414]
Contributors:
BNFC 2.9.3
Bug fixes and small improvements
- BNFC now uniformly signs generated files with its version number [#373]
- C/C++: include
stdio.h
in parser header files [#381] - C++: fixed parser regression in 2.9.2: missing
#include <algorithm>
[#377] - Ocaml: lex CR as whitespace [see also #376]
- Ocaml: correct position in parse errors [#380]
- Ocaml/Haskell: make printer for lists categories total [#383]
64bit binaries for Linux, macOS, and Windows below.
BNFC 2.9.2
Major improvements
- Haskell: layout keywords can now be stacked on the same line [#354],
see https://bnfc.readthedocs.io/en/latest/lbnf.html#stacking-layout-keywords - C: new methods
free_*
andclone_*
to deallocate and clone syntax trees [#348] - C/C++ backends now create reentrant parsers [#349]
Bug fixes and small improvements
- Haskell-GADT: generated code is warning free [#346]
- Haskell: fixes in layout preprocessor [#343,#344,#345,#352,#353]
- Haskell: print
[Char]
correctly, removed methodprtList
[#359] - Haskell: added missing import [#368], regression introduced in 2.9.1 by [#331]
- C: fixed a space leak when parsing from a string in memory [#347]
- C: removed errorneous
define
d constructors fromSkeleton.c
- C++:
define
d constructors now reside inAbsyn
[#287] - Java:
define
d constructor now reside inAbsynDef.java
[#287] - Ocaml: fixed translation of nested
define
d constructors - C/C++/Java: Pre/post/mixfix lists are now printed correctly [#358]
- all:
define
d constructors involving list expressions work now [#363] - all: printers render braces on their own line [#366]
Cosmetical changes
- C/C++: instead of
_SYMB_nnn
, more readable token names in lexer & parser
v2.9.1
Main new feature
- Haskell: the
--functor
option now produces position-annotated ASTs [#176,#327]. Thanks @Commelina!
Bug fixes and small improvements
- Haskell: fix generated
Makefile
and test parser for--glr
mode [#340] - Haskell(/GADT): generated modules import
Prelude
explicitly, compatible with{-# LANGUAGE NoImplicitPrelude #-}
- Haskell: generated code is warning free [#331]
- Haskell: generated printer more robust wrt. identifier clashes [#337]
- Haskell/C: handle token constructors in
define
expressions [#338] - Java/ANTLR: removed more superfluous quotation in lexer character sets [#329]
- Ocaml: fix syntax error in generated printer [#330]
- LBNF: more sanity checks [#339]
- Tested with GHC 9.0
v2.9.0
Major changes
- New license: BSD 3-clause [#308]
- LBNF: removed
delimiters
pragma [#308] - Haskell: removed options
--alex1
,--alex2
,--sharestrings
,--profile
, and--cnf
[#265] - C#: backend removed [#265]
Bug fixes
- LBNF: allow list categories in
entrypoints
pragma [#306] - LBNF: report clashes between token and ordinary categories [#323]
- C:
strdup
is not part of C89 standard,_POSIX_C_SOURCE
required [#318] - C/C++: fixed buffer overrun in
String
literal lexer [#316] - C++: fixed regressions (one of them #310) introduced by #288
- C/C++/OCaml: allow unicode characters in token definitions [#324]
- C/OCaml: sanitize grammar file names [#325]
- Java/ANTLR: removed superfluous quotation in lexer character sets [#319]
v2.8.4
This release adds the OCaml/Menhir backend, a variant of the OCaml backend that uses parser generator menhir
instead of ocamlyacc
. Beyond that, the focus of this release has been increased robustness and predictability of the BNFC tool:
- New option
--check
that only performs sanity checks on the given LBNF grammar file, without calling any backend (#286). - New sanity checks (#186, #213, #214) and deprecation warnings.
- Error messages of BNFC concerning rule or category names are now equipped with the error location.
- Generated code systematically tries to avoid clashes with language keywords or standard library names (#278, #289).
- Pragma
define
now supported by all maintained backends (Agda, Haskell, Haskell/GADT, C, C++, Java). - Pragma
position token
now supported by all maintained backends with the exception of C++/NoSTL. - List separators consisting just of whitespace are now accepted. They are used in the generated printers but treated like "" in the generated parsers (#70).
The Haskell backend has seen the following improvements:
- New option
--text-token
to useData.Text
instead ofString
in the generated lexer (#167). - Deriving
IsString
instances forIdent
-like token types (#192). - The
Err
monad is now defined asEither String
. ModuleErrM
is only generated for backwards compatibility. Imports ofErrM
with an explicit import list may have to modified slightly, see a migration guide at the Haskell backend documentation. - Block comments delimiters are no longer restricted to 2 characters.
The C-family backends have been improved as follows:
- C, C++, Java: Now multiple block comment forms per grammar are allowed (#202).
- C++/STL: The parser now throws an exception when parsing fails (#288).
- Java/JFlex: Special characters are properly escaped (#299).
- Java/ANTLR: Start rules are generated to work around ANTLR issue #2689 (#272).
Further bug fixes: #163, #169, #196, #212, #235, #256, #264, #269, #274, #276, #277, #279, #282, #283, #290.
Building of BNFC 2.8.4 requires GHC ≥ 7.10 and has been tested up to GHC 8.10.2. BNFC can be build using cabal
or stack
(using one of the enclosed stack-x.y.z.yaml
files).