Skip to content

Releases: NomicFoundation/slang

v1.3.2

22 Dec 13:19
71d628c

Choose a tag to compare

Patch Changes

v1.3.1

11 Dec 18:05
c5540f1

Choose a tag to compare

Patch Changes

v1.3.0

20 Oct 18:52
19d618a

Choose a tag to compare

Minor Changes

  • #1396 d568dec Thanks @beta-ziliani! - Add a rewriter API, allowing the transformation of CSTs by extending the BaseRewriter type, overriding the appropriate methods (User Guide).

  • #1440 4438fc8 Thanks @OmarTawfik! - add TextIndexExtensions.zero() utility to create an index at offset zero, which is useful for creating cursors from child nodes where parent offset is not needed.

  • #1390 6a0f598 Thanks @OmarTawfik! - Add new TypeScript APIs for creating nodes and edges:

    • NonterminalNode.create(kind: NonterminalKind, children: Edge[]): NonterminalNode
    • TerminalNode.create(kind: TerminalKind, text: string): TerminalNode
    • createEdge(label: EdgeLabel, node: Node): Edge
    • Edge.createWithNonterminal(label: EdgeLabel, node: NonterminalNode): Edge
    • Edge.createWithTerminal(label: EdgeLabel, node: TerminalNode): Edge

Patch Changes

  • #1424 d54a35c Thanks @ggiraldez! - Resolve identifiers in assembly blocks to locally imported symbols

  • #1388 4607e6a Thanks @beta-ziliani! - Fixed the pragma grammar and CST nodes:

    • pragma abicoder <version>:

      • Only enabled starting Solidity 0.7.5.
      • <version> is restricted to new keywords (v1 and v2).
    • pragma experimental <flag>:

      • Only enabled starting Solidity 0.4.16.
      • <flag> is restricted to be a string, or new keywords representing ABIEncoderV2 and SMTChecker.
  • #1431 a62c857 Thanks @OmarTawfik! - fix CST query matches to return an empty array for unmatched named captures, instead of undefined.

v1.2.1

23 Jul 22:31
53b08ab

Choose a tag to compare

Patch Changes

  • #1377 f3b51be Thanks @ggiraldez! - Bind untyped tuple deconstruction elements as references, not declarations

  • #1335 6c3ad5d Thanks @ggiraldez! - Top-level ConstantDefinitions now bind to their type and resolve extension functions called on them

  • #1338 18be0bc Thanks @ggiraldez! - Make try/catch parameters and vars in for loop initialization available in Yul

  • #1339 f16e4b5 Thanks @ggiraldez! - Fixes to the binding rules in Solidity:

    • Make the .length member available in all static-size byte arrays
    • Allow assembly blocks (and nested Yul functions) to access inherited state variables
    • Allow assembly blocks access to constructor/modifier/fallback parameters
    • msg.sender is of address type (not payable) until 0.5.0
    • Top-level constants need to be visible from assembly blocks in files that import them
    • Resolve named arguments when calling an extension function
    • Imported symbols using deconstruction syntax can be bound in assembly blocks
  • #1353 8e718dd Thanks @ggiraldez! - Fixes to the binding rules in Solidity:

    • Values of the deprecated byte type have a length member until 0.8.0
    • Bind a qualified identifier in the same contract, ie. Foo.x in a method body of Foo
    • Correctly bind external constants and built-ins in nested functions in assembly blocks
    • Literal boolean values should bind to the bool type to chain extension functions
    • Public state variables the generate getters should have members of external functions (such as .selector)
    • Event types have a selector member
  • #1326 045179b Thanks @ggiraldez! - Fixes to binding rules:

    • Update TupleDeconstructionStatement so that their definiens is the TypedTupleMember/UntypedTupleMember for each variable declared.
    • Update YulVariableDeclarationStatement so that their definiens is the YulIdentifier for each variable declared.
  • #1350 0594fe8 Thanks @ggiraldez! - Fixes to bindings rules in Solidity:

    • Allow binding of using directives inside interfaces in Solidity < 0.7.1
    • Bind literal fixed arrays types
    • Fix generating binding graph for built-ins: remove the memory location specifier from types so they bind properly
    • Fix return type of value() and gas() legacy call options to allow chaining them
    • Bind legacy call options in the result of new expressions
    • Bind output type of public getters when the state variable is a nested mapping or array
    • A using directive with the global modifier should impact the source unit's lexical scope
    • Relax the Solidity version where the transfer() method works for non-payable addresses; this is a workaround for a Solidity quirk that makes it possible to do address(uint160(to)).transfer(amount) even after 0.5.0
    • Fix bound return types of wrap() and unwrap() methods of a user value defined type
    • Resolve the type of min() and max() of type() expressions for integer types to the integer type given in the expression operand
    • Fix binding of fully qualified modifier invocations
    • Fix #1321: min() and max() for type() expressions on enum types should bind only after Solidity 0.8.8
    • Bound type for literal number expressions is uint256 by default; this allows correctly binding extension methods operating on literal values
    • The type bytes is an array type and should bind the push() and pop() methods
    • Contract or interface reference values implicitly inherit from the address type on Solidity < 0.5.0
    • Modifiers are allowed inside interfaces until Solidity 0.8.8 and thus should properly bind and be accessible from inheriting contracts
    • Libraries before Solidity 0.5.0 allowed this in function methods and work as an address type

v1.2.0

22 May 21:53
a9ecfc3

Choose a tag to compare

Minor Changes

Patch Changes

v1.1.0

10 Apr 18:48
38e8a4a

Choose a tag to compare

Minor Changes

  • #1288 2090ab8 Thanks @OmarTawfik! - support Solidity 0.8.29 and Custom Storage Layouts:

    • ContractDefinition nodes will no longer have an optional InheritanceSpecifier child directly, but will hold a list of ContractSpecifier children
    • ContractSpecifier nodes have either InheritanceSpecifier or StorageLayoutSpecifier children
  • #1265 2312260 Thanks @mjoerussell! - Add LanguageUtils::infer_language_versions(source_code) -> Version[] API, which will analyze version pragmas inside a source file, and return a list of supported language versions that they allow. This can be used to select a valid language version to use with the rest of Slang APIs. Please see the Choosing a Solidity Version guide for more information.

Patch Changes

  • #1291 da1f863 Thanks @ggiraldez! - Resolve arguments to inheritance specifiers and expressions in storage layout specifiers using the contract's parent scope.

v1.0.0

17 Mar 16:06
e42f7f4

Choose a tag to compare

Major Changes

v0.20.1

11 Mar 19:23
4386836

Choose a tag to compare

Patch Changes

v0.20.0

10 Mar 11:23
a173a6c

Choose a tag to compare

Minor Changes

Patch Changes

v0.19.0

24 Jan 14:07
be199cc

Choose a tag to compare

Minor Changes

  • #1156 3a82f06 Thanks @OmarTawfik! - add node.descendants() and cursor.descendants() APIs to allow iterating over all descendants of the current node in pre-order traversal.

  • #1156 3a82f06 Thanks @OmarTawfik! - fix node.children() and parseOutput.errors() return types

  • #1194 7a25d63 Thanks @OmarTawfik! - split parser/Parser.supportedVersions() into a new utils/LanguageFacts API, with allVersions(), earliestVersion(), and latestVersion() methods.

  • #1194 7a25d63 Thanks @OmarTawfik! - expose the BingingGraph API to allow querying definitions/references between source files.

  • #1156 3a82f06 Thanks @OmarTawfik! - add cursor.ancestors() API to allow iterating over all ancestors of the current node, starting with the immediate parent, and moving upwards, ending with the root node.

  • #1156 3a82f06 Thanks @OmarTawfik! - add cursor.remainingNodes() API to allow iterating over all the remaining nodes in the current tree, moving in pre-order traversal, until the tree is completed.

  • #1223 3e85a14 Thanks @OmarTawfik! - split Parser.parse() API into parse_file_contents() and parse_nonterminal().

  • #1194 7a25d63 Thanks @OmarTawfik! - add a CompilationBuilder API to incrementally load and resolve source files and their imports.

  • #1223 3e85a14 Thanks @OmarTawfik! - rename Query.parse() to Query.create(), and provide exact TextRange for any errors it returns.

  • #1172 6102886 Thanks @beta-ziliani! - Improved error recovery, where leading trivia are always parsed and included before an erroneous terminal.

  • #1223 3e85a14 Thanks @OmarTawfik! - add TerminalKindExtensions.is_identifier() API to distinguish terminals like Solidity's Identifier and Yul's YulIdentifier.

  • #1187 6389361 Thanks @beta-ziliani! - Change ParseOutput and File.tree to return a NonTerminal instead of a Node.

Patch Changes