Skip to content

v2.0.0

Compare
Choose a tag to compare
@mvdan mvdan released this 30 Aug 16:03
· 1303 commits to master since this release

Highlights:

  • The package import paths were moved to mvdan.cc/sh/...
  • syntax
    • Parser and Printer structs introduced with functional options
    • Node positions are now independent - Position merged into Pos
    • All comments are now attached to nodes
    • Support mksh - MirBSD's Korn Shell, used in Android
    • Various changes to the AST:
      • EvalClause removed; eval is no longer parsed as a keyword
      • Add support for Bash's time and select
      • Merge UntilClause into WhileClause
      • Moved Stmt.Assigns to CallExpr.Assigns
      • Remove Elif - chain IfClause nodes instead
    • Support for indexed assignments like a[i]=b
    • Allow expansions in arithmetic expressions again
    • Unclosed heredocs now produce an error
    • Binary ops are kept in the same line - see BinaryNextLine
    • Switch cases are not indented by default - see SwitchCaseIndent
  • cmd/shfmt
    • Add -s, which simplifies programs via syntax.Simplify
    • Add -ln <lang>, like -ln mksh
    • Add -bn to put binary ops in the next line, like in v1
    • Add -ci to indent switch cases, like in v1
  • interp
    • Some progress made, though still experimental
    • Most of POSIX done - some builtins remain to be done

Binaries built on go version go1.8.3 linux/amd64.