Skip to content

Releases: rail5/bashpp

v0.8.10

13 May 09:40
d8f4d8a

Choose a tag to compare

  • Performance: Significant compiler speed-ups from multiple optimizations:
    • Entity inheritance now pre-reserves map space and uses std::copy()
      instead of repeated dynamic allocations, yielding a combined speedup
      of over 200% on large source files.
    • The old bpp_entity::get_objects() interface, which merged and copied
      local and foreign object maps, has been removed. Replaced by separate
      get_local_objects() and get_foreign_objects() returning const
      references, avoiding unnecessary allocations and copies (roughly 2x
      speedup on large data).
    • bpp_entity::get_classes(), get_datamember() and get_method() now return
      const references instead of copies.
    • bpp-lsp now obtains class names directly from map keys, eliminating an
      indirection through bpp_class::get_name().
    • AST node type handling refactored from a virtual function to a
      non-virtual base-class member, reducing indirection.
    • Replaced unnecessary dynamic casts with static casts when the pointer
      type is already known at compile time.
  • Compiler & language semantics:
    • Dynamic includes that fail at runtime now print an error to stderr and
      terminate with a non-zero exit code, in line with the language spec.
    • Lexer/parser bug fix: whitespace and comments are now allowed after
      include/include_once directives.
    • stdlib: corrected a copy-paste error in SharedObject's start-up checks
      (was referencing "SharedArray" instead of "SharedObject").
  • Debian packaging:
    • Added Homepage field pointing to bpp.sh.
    • Standards-Version updated to 4.7.0.
    • Removed explicit "Priority: optional" (now the default in dpkg).
  • Build system:
    • Compiler and flags are now overridable (?=) to ease cross-compilation
      and use of non-GNU toolchains. Thanks to @Nizarjh for the patches.
    • Cleaner fallback logic for obtaining version information when
      dpkg-parsechangelog is unavailable.
  • Test suite:
    • The runner now explicitly checks for Perl-compatible regex support
      in system grep before any tests are executed, failing with a clear
      message when support is missing (related to #15).
    • Test suite switched to angle-bracket includes and -Istdlib/ to test
      the local standard library, leveraging the new include-path ordering,
      rather than relying on quoted includes with a long ../../ series,
      as we did before.
  • Code hygiene & modernization:
    • Replaced manual linear searches with std::erase_if and
      std::ranges::contains.
    • Replaced legacy const char* arrays with constexpr
      std::arraystd::string_view for type safety.
    • Converted bpp.h enums to enum class; omitted unused parameter names in
      listener handlers.
    • Introduced a bpp_assert macro that compiles away with NDEBUG; replaced
      explicit dynamic_pointer_cast + InternalError patterns with a template
      helper that becomes a zero-cost static cast in release builds (note:
      NDEBUG builds will not be shipped before v1.0.0).
    • Renamed the entity "objects" map to "foreign_objects" to better convey
      ownership intent.
    • Copyright headers standardized with SPDX-License-Identifier and cleaned
      up formatting; removed extraneous asterisks that leaked into Doxygen
      documentation.
    • Pass const reference in ErrorOrWarning::set_from_listener to avoid a
      full copy; prevent overflow in BashVersion parsing; declare NullBuffer
      constructors/destructor noexcept.
    • Minor style improvements: std::ranges::reverse_view, emplace_back for
      temporaries, removed unused includes.

v0.8.9

17 Apr 17:55
44e1794

Choose a tag to compare

  • Subshell code generation: Fixed critical bug where normal command
    substitution subshells ($(...)) and cat‑replacement subshells
    ($(< file)) incorrectly shared buffer placement logic.
    • Cat‑replacement subshells now enforce perfect forwarding: pre‑code
      and post‑code are placed strictly outside the substitution, and
      local object destruction is deferred until after buffers are flushed.
    • Normal subshells now correctly scope pre‑code, post‑code, and
      destructor calls inside the substitution, ensuring proper lifetime
      management and output capture.
    • Added test cases for cat‑replacement and corrected expectations in
      the local‑scope test.
  • AST pretty‑printing: SubshellSubstitution nodes now display whether
    they represent a cat‑replacement subshell, aiding debugging.
  • Parser error recovery: The parser now attempts to recover from syntax
    errors and continue building the AST, allowing multiple parser errors to
    be reported in a single compilation pass rather than aborting on the
    first failure.
  • bpp‑lsp improvements:
    • Removed unused --port and --socket options; the language server
      now communicates exclusively over stdio.
    • Eliminated unnecessary signal handlers; the server simply exits on
      signals as no extra cleanup is required.
    • Added a note to the help text describing LSP usage.
  • Code hygiene and refactoring:
    • Replaced system() with fork() + execvp() for runs-on-exit
    • Changed in_supershell boolean flag to a stack<std::monostate>
      to correctly track nested supershell contexts.
    • Unified multiple NullOStream implementations into a single common
      definition.
    • Migrated from realpath() to std::filesystem::canonical().
    • Refined argument parsing: Bash version string parsing moved into a
      constexpr constructor of BashVersion.

v0.8.8

09 Apr 12:12
43791d9

Choose a tag to compare

  • Spec: Automatic object lifetime management is now explicitly
    defined by the spec. Destructors will automatically be called for
    scope-local objects at the end of all scoped constructs, including:
    Plain bash functions, class methods, curly-braced blocks, subshells,
    process substitutions, and all control-flow constructs (if/else, while
    until, for, case, select).
    Some of these cases were not properly handled before, having the spec
    state explicitly what the behavior should be helps us to verify that
    the compiler is behaving properly.
  • Spec: Define explicitly that objects instantiated within a supershell
    are owned (and therefore have their lifetimes managed) by the
    code entity containing that supershell, not by the supershell itself.
    Having this defined also illuminated another bug: namely, that the
    compiler didn't do this. This is therefore also a bug fix. To this end,
    an internal adopt() function was added to bpp::bpp_code_entity,
    used by parent scopes to adopt the objects instantiated by supershells
    that they contain.
  • Include path handling: The standard library directory is now always the
    last include path, allowing user-supplied -I directories to override
    standard library files. This behavior is now consistent between both the
    compiler and the language server.
  • Lexer bug fix: Correctly exit the class-header lexer mode after a class
    declaration that does not inherit from a parent class. This resolves
    a parser failure where ':' no-op commands would appear later in the
    source.
  • Redirections and pipes with compound constructs: Fixed a bug where 'if'
    and 'case' statements would incorrectly append delimiters after their
    terminal tokens (that is, after 'fi', 'esac').
    Added relevant test case for redirections and pipes into and out of
    all compound shell constructs (if, while, until, for, select, and case)
  • bpp-lsp: The 'UTF16' flag is now correctly propagated to included files.
  • Code hygiene (internal): Replaced legacy .rfind()/.find() string checks
    with modern .starts_with()/.contains()
    Removed unused include directives and commented out unused function
    parameters.
    Updated vendored XGetOpt version to 1.0.1
  • Documentation: Added comprehensive spec pages on scope and object
    lifetime management.
    Clarified the definition of 'system methods'
    Updated compiler and language manuals to reflect new include path
    behavior.

v0.8.7

23 Mar 01:03
7d88b66

Choose a tag to compare

  • Lexer bug fix: Only register elif/else/fi as keywords if they're
    lvalues
  • Build system: Simplified and generalized build system with
    auto-discovered sources
    Refactored the build system to remove per- directory object rules
    and replace them with a single generic pattern that mirrors the
    source tree into bin/obj.
  • Code style improvements:
    Replaced global bpp_exit_code with data member of the Listener class
    Replaced pointer arithmetic in parse_arguments() with std::span usage
    Added default case to xgetopt switch
    No need to explicitly default virtual destructors for LSP message
    base types
    Explicit member initialization everywhere
    Use emplace_back() for temporaries
    Explicitly handle ownership semantics in BashppParser
    Use BashppParser.setInputFromFilePath instead of from FilePtr where
    ownership may be ambiguous
    bpp-lsp: Moved URI validation to freestanding function
    Option parsing: Allow non-regular files (such as /dev/null) for output,
    just check whether we have write permission
  • Test suite: Added '-c' option to benchmark compile times without actually
    running the compiled tests
  • Parser: error out of datamember declarations when given an lvalue object
    reference instead of a proper object instantiation

v0.8.6

16 Feb 05:09
2f602c2

Choose a tag to compare

  • Supershells: Preserve stderr as subshells do
    Supershells in Bash++ now handle stderr identically to subshell
    substitution, matching Bash 5.3's native supershells.
    Previously, supershells in 5.2-compatibility mode discarded stderr; now it
    is preserved.
    Added regression test for supershell stderr handling.
  • Dynamic cast codegen: Don't force-quote reference code
    Fixed edge-case bug where generated code for dynamic casts would
    incorrectly add quotes around the reference code. Now preserves original
    quoting as written in source.
    Added regression test for dynamic cast quoting.
  • Parser: Never override lexer's positive lvalue judgment
    Fixed bug where parser could incorrectly override the lexer's
    determination that a token could be an lvalue.
    Ensures correct handling of lvalue/rvalue distinctions, especially around
    redirections and pipes.
    Added regression test for this behavior.
  • Test suite: Run tests for Bash 5.2 and 5.3
    Tests are now run twice if Bash >=5.3 is installed:
    once for 5.2 compatibility, once for 5.3.

v0.8.5

15 Feb 02:51
9b944c1

Choose a tag to compare

  • Bug fix: bpp-lsp: Don't re-throw exceptions
    When the input stream is unexpectedly halted, make sure we go through our
    necessary clean-up procedure. Re-throwing the received exception in this
    case would suddenly halt the program sans clean-up.
  • Bug fix: bpp: Concatenated lvalues in the parser
    Updated the parser grammar to allow operative command words to be
    composed of multiple adjacent tokens, matching Bash's behavior for
    command names.
    Added accompanying regression test
  • Replaced homegrown CLI option parsing with XGetOpt
    Vendored XGetOpt header in src/include

v0.8.4

04 Feb 07:52
5cb608a

Choose a tag to compare

  • Lexer/Parser/AST:
    Full and proper support for array indexing in object references and lvalue
    assignments; parser and listener logic updated accordingly.
    Bug fix: Properly lex isolated digits in heredoc content and escaped dollar
    signs in string interpolations.
    Improved error handling: Parser errors are now propagated to listeners and
    main program logic, enabling better diagnostics and LSP support.
    Added new test cases for parser errors and self-reference outside of class
    context.
    Bug fix: Verify we're inside a class if processing a self-reference.
    Improved output line comparison in the test suite.
  • Standard Library:
    All container empty methods now return status code
    (0 if empty, 1 otherwise) instead of echoing "true"/"false", for
    shell-friendly checks.
    Documentation and test cases updated to reflect new empty method behavior
    Consistent return conventions across Array, Stack, Queue, SharedArray,
    SharedStack, SharedQueue, SharedVar, TypedArray, TypedStack, and TypedQueue
  • Documentation:
    Added and clarified language specification pages, including a new page on
    the "entity" concept.
    Improved CONTRIBUTING.md with style guidelines and examples.
    Added PR template and clarified how to add test cases.
  • Language Server:
    Bug fix: If the input stream is halted, clean up and exit rather than
    hanging.
    Improved debounce logic for didChange notifications.
    Bug fix: Provide completions after 'this'/'super' keywords.
    Improved error propagation and diagnostics for parser errors.

v0.8.3

29 Jan 11:37
85a492d

Choose a tag to compare

  • Internal system methods refactored:
    Treat all internal system methods (such as __new, __delete, __copy) as
    ordinary methods.
  • Removed special-casing for system methods; they are now generated,
    overridden, and dispatched using the same mechanisms as user-defined
    methods.
  • Improved method override and inheritance logic for system methods, ensuring
    correct virtual/override semantics.
  • Refactored code generation for object creation, deletion, and copying to
    use generated methods (__new, __delete, __copy) instead of templates or
    global functions.
  • Enhanced constructor and destructor handling for better inheritance and
    chaining.
  • Added comprehensive regression tests for copy, delete, and constructor
    chaining behaviors.
  • Code cleanup and improved error propagation in method prologues.

v0.8.2

28 Jan 12:00
6cb5929

Choose a tag to compare

  • bpp: Code entities: When adding objects, don't force quotes around the
    assignment value
  • bpp: Throw a detailed syntax error if a data member's name is not unique

v0.8.1

28 Jan 04:48
bed7da8

Choose a tag to compare

  • bpp: Enhanced method override tracking and reference propagation:
    Added weak pointer tracking for overridden methods in bpp_entity and
    bpp_method.
    Improved reference propagation for "find all references" and "rename
    symbol".
  • bpp: Refactored method inheritance and constructor codegen for
    virtual/override correctness:
    Improved vTable and constructor call code generation.
    Centralized constructor call logic.
    Optimized method inheritance and override tracking.
  • bpp: Bug fix: for/select statements: Ensure code buffers are flushed.
  • bpp: More efficient CRTP: Removed std::invoke and map, use switch with
    if constexpr.
  • bpp: FlatIntervalTree: Replaced IntervalTree for better cache locality and
    performance.
  • bpp: Error handling improvements:
    Preserve node children for diagnostics.
    Unified InternalError and SyntaxError handling.
    Improved error reporting and tree traversal.
    Display 1-indexed line/column numbers in error messages.
  • bpp-lsp: Bug fix: Properly identify entities as lvalues in assignments in
    the language server.
  • bpp-lsp: Adaptive debounce timing for didChange notifications in the
    language server
    Debounce interval now adapts to reparse durations.
    Simplified unsaved changes tracking.
    Improved logging and thread safety.
  • bpp-lsp: Bug fix: Provide completions after 'this'/'super' keywords in the
    language server.
  • bpp-lsp: Changed global BashppServer instance to pointer for better server
    lifetime control.
  • libstd-bpp: STL: Use supershells, remove head/tail dependencies, use sed.
  • Test suite: Use supershells for faster execution.