Releases: NomicFoundation/slang
v1.3.2
v1.3.1
v1.3.0
Minor Changes
-
#1396
d568decThanks @beta-ziliani! - Add a rewriter API, allowing the transformation of CSTs by extending theBaseRewritertype, overriding the appropriate methods (User Guide). -
#1440
4438fc8Thanks @OmarTawfik! - addTextIndexExtensions.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
6a0f598Thanks @OmarTawfik! - Add new TypeScript APIs for creating nodes and edges:NonterminalNode.create(kind: NonterminalKind, children: Edge[]): NonterminalNodeTerminalNode.create(kind: TerminalKind, text: string): TerminalNodecreateEdge(label: EdgeLabel, node: Node): EdgeEdge.createWithNonterminal(label: EdgeLabel, node: NonterminalNode): EdgeEdge.createWithTerminal(label: EdgeLabel, node: TerminalNode): Edge
Patch Changes
-
#1424
d54a35cThanks @ggiraldez! - Resolve identifiers in assembly blocks to locally imported symbols -
#1388
4607e6aThanks @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 (v1andv2).
- Only enabled starting Solidity
-
pragma experimental <flag>:- Only enabled starting Solidity
0.4.16. <flag>is restricted to be a string, or new keywords representingABIEncoderV2andSMTChecker.
- Only enabled starting Solidity
-
-
#1431
a62c857Thanks @OmarTawfik! - fix CST query matches to return an empty array for unmatched named captures, instead ofundefined.
v1.2.1
Patch Changes
-
#1377
f3b51beThanks @ggiraldez! - Bind untyped tuple deconstruction elements as references, not declarations -
#1335
6c3ad5dThanks @ggiraldez! - Top-levelConstantDefinitions now bind to their type and resolve extension functions called on them -
#1338
18be0bcThanks @ggiraldez! - Make try/catch parameters and vars in for loop initialization available in Yul -
#1339
f16e4b5Thanks @ggiraldez! - Fixes to the binding rules in Solidity:- Make the
.lengthmember 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.senderis ofaddresstype (notpayable) 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
- Make the
-
#1353
8e718ddThanks @ggiraldez! - Fixes to the binding rules in Solidity:- Values of the deprecated
bytetype have alengthmember until 0.8.0 - Bind a qualified identifier in the same contract, ie.
Foo.xin a method body ofFoo - Correctly bind external constants and built-ins in nested functions in assembly blocks
- Literal boolean values should bind to the
booltype to chain extension functions - Public state variables the generate getters should have members of external functions (such as
.selector) - Event types have a
selectormember
- Values of the deprecated
-
#1326
045179bThanks @ggiraldez! - Fixes to binding rules:- Update
TupleDeconstructionStatementso that their definiens is theTypedTupleMember/UntypedTupleMemberfor each variable declared. - Update
YulVariableDeclarationStatementso that their definiens is theYulIdentifierfor each variable declared.
- Update
-
#1350
0594fe8Thanks @ggiraldez! - Fixes to bindings rules in Solidity:- Allow binding of
usingdirectives inside interfaces in Solidity < 0.7.1 - Bind literal fixed arrays types
- Fix generating binding graph for built-ins: remove the
memorylocation specifier from types so they bind properly - Fix return type of
value()andgas()legacy call options to allow chaining them - Bind legacy call options in the result of
newexpressions - Bind output type of public getters when the state variable is a nested mapping or array
- A
usingdirective with theglobalmodifier 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 doaddress(uint160(to)).transfer(amount)even after 0.5.0 - Fix bound return types of
wrap()andunwrap()methods of a user value defined type - Resolve the type of
min()andmax()oftype()expressions for integer types to the integer type given in the expression operand - Fix binding of fully qualified modifier invocations
- Fix #1321:
min()andmax()fortype()expressions onenumtypes should bind only after Solidity 0.8.8 - Bound type for literal number expressions is
uint256by default; this allows correctly binding extension methods operating on literal values - The type
bytesis an array type and should bind thepush()andpop()methods - Contract or interface reference values implicitly inherit from the
addresstype 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
thisin function methods and work as anaddresstype
- Allow binding of
v1.2.0
Minor Changes
- #1330
56393d5Thanks @OmarTawfik! - add support for Solidity0.8.30
Patch Changes
-
#1314
743d6b0Thanks @mjoerussell! - Adding missing YUL built in functions:codesize()codecopy(f, t, s)
v1.1.0
Minor Changes
-
#1288
2090ab8Thanks @OmarTawfik! - support Solidity0.8.29and Custom Storage Layouts:ContractDefinitionnodes will no longer have an optionalInheritanceSpecifierchild directly, but will hold a list ofContractSpecifierchildrenContractSpecifiernodes have eitherInheritanceSpecifierorStorageLayoutSpecifierchildren
-
#1265
2312260Thanks @mjoerussell! - AddLanguageUtils::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
da1f863Thanks @ggiraldez! - Resolve arguments to inheritance specifiers and expressions in storage layout specifiers using the contract's parent scope.
v1.0.0
Major Changes
- #1279
6de3e41Thanks @OmarTawfik! - release Slang v1 🚀🚀🚀
v0.20.1
Patch Changes
- #1275
ed2cae9Thanks @OmarTawfik! - renameComparisonExpressiontoInequalityExpression
v0.20.0
Minor Changes
-
#1203
a5c3b1aThanks @ggiraldez! - add separate contexts (ie. binding scopes) for Solidity and Yul built-ins -
#1257
9f5d8f0Thanks @OmarTawfik! - exportassertUserFileLocation()andassertBuiltInLocation()utilities from thebindingsmodule -
#1243
99d182fThanks @ggiraldez! - adddefinition.references()API to find all references that resolve to a definition. -
#1205
103b331Thanks @mjoerussell! - MakeEdge::labela required field instead of being optional. -
#1257
9f5d8f0Thanks @OmarTawfik! - update user guides with new binding graph and compilation APIs -
#1257
9f5d8f0Thanks @OmarTawfik! - exportassertNonterminalNode()andassertTerminalNode()utilities from thecstmodule
Patch Changes
-
#1246
aea2dd0Thanks @OmarTawfik! - unreservejumpandjumpiyul keywords between0.6.0and0.8.0 -
#1203
a5c3b1aThanks @ggiraldez! - enableaddress payablefrom 0.5.0 and removetransferbuilt-in from non-payableaddresses -
#1246
aea2dd0Thanks @OmarTawfik! - make sure assembly flags are only enabled starting from0.8.13 -
#1246
aea2dd0Thanks @OmarTawfik! - enable yul'strueandfalsekeywords starting from0.6.2 -
#1246
aea2dd0Thanks @OmarTawfik! - make suresuperandthiskeywords are unreserved before0.8.0.
v0.19.0
Minor Changes
-
#1156
3a82f06Thanks @OmarTawfik! - addnode.descendants()andcursor.descendants()APIs to allow iterating over all descendants of the current node in pre-order traversal. -
#1156
3a82f06Thanks @OmarTawfik! - fixnode.children()andparseOutput.errors()return types -
#1194
7a25d63Thanks @OmarTawfik! - splitparser/Parser.supportedVersions()into a newutils/LanguageFactsAPI, withallVersions(),earliestVersion(), andlatestVersion()methods. -
#1194
7a25d63Thanks @OmarTawfik! - expose theBingingGraphAPI to allow querying definitions/references between source files. -
#1156
3a82f06Thanks @OmarTawfik! - addcursor.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
3a82f06Thanks @OmarTawfik! - addcursor.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
3e85a14Thanks @OmarTawfik! - splitParser.parse()API intoparse_file_contents()andparse_nonterminal(). -
#1194
7a25d63Thanks @OmarTawfik! - add aCompilationBuilderAPI to incrementally load and resolve source files and their imports. -
#1223
3e85a14Thanks @OmarTawfik! - renameQuery.parse()toQuery.create(), and provide exactTextRangefor any errors it returns. -
#1172
6102886Thanks @beta-ziliani! - Improved error recovery, where leading trivia are always parsed and included before an erroneous terminal. -
#1223
3e85a14Thanks @OmarTawfik! - addTerminalKindExtensions.is_identifier()API to distinguish terminals like Solidity'sIdentifierand Yul'sYulIdentifier. -
#1187
6389361Thanks @beta-ziliani! - ChangeParseOutputandFile.treeto return aNonTerminalinstead of aNode.
Patch Changes
-
#1134
cfc62f2Thanks @OmarTawfik! - removeYulPathComponentand just useYulIdentifierinstead. -
#1138
44a706fThanks @OmarTawfik! - addThisKeywordandSuperKeywordto the grammar, instead of parsing them as identifiers. -
#1134
cfc62f2Thanks @OmarTawfik! - unreserveAddressKeyword, and let it be used forMemberAccessExpression,StructMember, etc... -
#1154
7b9b478Thanks @beta-ziliani! - Adding support for deprecated keywordsjumpandjumpi