@nomicfoundation/slang
Advanced tools
Comparing version 0.11.0 to 0.12.0
# changelog | ||
## 0.12.0 | ||
### Minor Changes | ||
- [#699](https://github.com/NomicFoundation/slang/pull/699) [`ddfebfe9`](https://github.com/NomicFoundation/slang/commit/ddfebfe988345136007431f8ea2efac19fd7e887) Thanks [@Xanewok](https://github.com/Xanewok)! - Remove `ProductionKind` in favor of `RuleKind` | ||
- [#699](https://github.com/NomicFoundation/slang/pull/699) [`ddfebfe9`](https://github.com/NomicFoundation/slang/commit/ddfebfe988345136007431f8ea2efac19fd7e887) Thanks [@Xanewok](https://github.com/Xanewok)! - Allow parsing individual precedence expressions, like `ShiftExpression` | ||
- [#665](https://github.com/NomicFoundation/slang/pull/665) [`4b5f8b46`](https://github.com/NomicFoundation/slang/commit/4b5f8b467d4cbab72cf27a539bb5ca8c71090dd6) Thanks [@Xanewok](https://github.com/Xanewok)! - Remove the CST Visitor API in favor of the Cursor API | ||
- [#666](https://github.com/NomicFoundation/slang/pull/666) [`0434b68c`](https://github.com/NomicFoundation/slang/commit/0434b68c9ef9cd1d1dcc07d7ed50e6d63645319b) Thanks [@Xanewok](https://github.com/Xanewok)! - Add `Node::unparse()` that allows to reconstruct the source code from the CST node | ||
- [#675](https://github.com/NomicFoundation/slang/pull/675) [`daea4b7f`](https://github.com/NomicFoundation/slang/commit/daea4b7f954ff1e918b9191aff40ee95c10a4db2) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `Cursor`'s `pathRuleNodes()` to `ancestors()` in the NodeJS API. | ||
- [#676](https://github.com/NomicFoundation/slang/pull/676) [`b496d361`](https://github.com/NomicFoundation/slang/commit/b496d36120700347bcbcc25b948eb46814fd5412) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Fix NAPI `cursor` types and expose `cursor.depth`. | ||
### Patch Changes | ||
- [#685](https://github.com/NomicFoundation/slang/pull/685) [`b5fca94a`](https://github.com/NomicFoundation/slang/commit/b5fca94af917a2f0418c224b3101885c02e5cb9c) Thanks [@Xanewok](https://github.com/Xanewok)! - `bytes` is now properly recognized as a reserved word | ||
- [#660](https://github.com/NomicFoundation/slang/pull/660) [`97028991`](https://github.com/NomicFoundation/slang/commit/9702899164f0540a49f2e0f7f19d82fbd04b1d1b) Thanks [@Xanewok](https://github.com/Xanewok)! - Drop List suffix from collection grammar rule names | ||
## 0.11.0 | ||
@@ -4,0 +26,0 @@ |
import * as generated from "../generated"; | ||
export type Node = generated.cst.Node; | ||
export declare const NodeType: typeof generated.cst.NodeType; | ||
@@ -3,0 +4,0 @@ export type NodeType = generated.cst.NodeType; |
@@ -6,4 +6,2 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
// @ts-nocheck | ||
/* tslint:disable */ | ||
@@ -15,154 +13,19 @@ /* eslint-disable */ | ||
export namespace kinds { | ||
export enum ProductionKind { | ||
ABICoderPragma = "ABICoderPragma", | ||
AddressType = "AddressType", | ||
ArgumentsDeclaration = "ArgumentsDeclaration", | ||
ArrayExpression = "ArrayExpression", | ||
ArrayValuesList = "ArrayValuesList", | ||
AsciiStringLiteralsList = "AsciiStringLiteralsList", | ||
AssemblyFlagsList = "AssemblyFlagsList", | ||
AssemblyStatement = "AssemblyStatement", | ||
Block = "Block", | ||
BreakStatement = "BreakStatement", | ||
CatchClause = "CatchClause", | ||
CatchClauseError = "CatchClauseError", | ||
CatchClausesList = "CatchClausesList", | ||
ConstantDefinition = "ConstantDefinition", | ||
ConstructorAttributesList = "ConstructorAttributesList", | ||
ConstructorDefinition = "ConstructorDefinition", | ||
ContinueStatement = "ContinueStatement", | ||
ContractDefinition = "ContractDefinition", | ||
ContractMembersList = "ContractMembersList", | ||
DeconstructionImport = "DeconstructionImport", | ||
DeconstructionImportSymbol = "DeconstructionImportSymbol", | ||
DeconstructionImportSymbolsList = "DeconstructionImportSymbolsList", | ||
DeleteStatement = "DeleteStatement", | ||
DoWhileStatement = "DoWhileStatement", | ||
EmitStatement = "EmitStatement", | ||
EndOfFileTrivia = "EndOfFileTrivia", | ||
EnumDefinition = "EnumDefinition", | ||
ErrorDefinition = "ErrorDefinition", | ||
ErrorParameter = "ErrorParameter", | ||
ErrorParametersList = "ErrorParametersList", | ||
EventDefinition = "EventDefinition", | ||
EventParameter = "EventParameter", | ||
EventParametersList = "EventParametersList", | ||
ExperimentalPragma = "ExperimentalPragma", | ||
Expression = "Expression", | ||
ExpressionStatement = "ExpressionStatement", | ||
FallbackFunctionAttributesList = "FallbackFunctionAttributesList", | ||
FallbackFunctionDefinition = "FallbackFunctionDefinition", | ||
ForStatement = "ForStatement", | ||
FunctionAttributesList = "FunctionAttributesList", | ||
FunctionCallOptions = "FunctionCallOptions", | ||
FunctionDefinition = "FunctionDefinition", | ||
FunctionType = "FunctionType", | ||
FunctionTypeAttributesList = "FunctionTypeAttributesList", | ||
HexStringLiteralsList = "HexStringLiteralsList", | ||
IdentifierPath = "IdentifierPath", | ||
IdentifierPathsList = "IdentifierPathsList", | ||
IdentifiersList = "IdentifiersList", | ||
IfStatement = "IfStatement", | ||
ImportDirective = "ImportDirective", | ||
InheritanceSpecifier = "InheritanceSpecifier", | ||
InheritanceType = "InheritanceType", | ||
InheritanceTypesList = "InheritanceTypesList", | ||
InterfaceDefinition = "InterfaceDefinition", | ||
InterfaceMembersList = "InterfaceMembersList", | ||
LeadingTrivia = "LeadingTrivia", | ||
LibraryDefinition = "LibraryDefinition", | ||
LibraryMembersList = "LibraryMembersList", | ||
MappingKeyType = "MappingKeyType", | ||
MappingType = "MappingType", | ||
MappingValueType = "MappingValueType", | ||
ModifierAttributesList = "ModifierAttributesList", | ||
ModifierDefinition = "ModifierDefinition", | ||
ModifierInvocation = "ModifierInvocation", | ||
NamedArgument = "NamedArgument", | ||
NamedArgumentsDeclaration = "NamedArgumentsDeclaration", | ||
NamedArgumentsList = "NamedArgumentsList", | ||
NamedImport = "NamedImport", | ||
NewExpression = "NewExpression", | ||
NumericExpression = "NumericExpression", | ||
OverrideSpecifier = "OverrideSpecifier", | ||
Parameter = "Parameter", | ||
ParametersDeclaration = "ParametersDeclaration", | ||
ParametersList = "ParametersList", | ||
PathImport = "PathImport", | ||
PositionalArgumentsList = "PositionalArgumentsList", | ||
PragmaDirective = "PragmaDirective", | ||
ReceiveFunctionAttributesList = "ReceiveFunctionAttributesList", | ||
ReceiveFunctionDefinition = "ReceiveFunctionDefinition", | ||
ReturnStatement = "ReturnStatement", | ||
ReturnsDeclaration = "ReturnsDeclaration", | ||
RevertStatement = "RevertStatement", | ||
SourceUnit = "SourceUnit", | ||
SourceUnitMembersList = "SourceUnitMembersList", | ||
StateVariableAttributesList = "StateVariableAttributesList", | ||
StateVariableDefinition = "StateVariableDefinition", | ||
Statement = "Statement", | ||
StatementsList = "StatementsList", | ||
StructDefinition = "StructDefinition", | ||
StructMember = "StructMember", | ||
StructMembersList = "StructMembersList", | ||
ThrowStatement = "ThrowStatement", | ||
TrailingTrivia = "TrailingTrivia", | ||
TryStatement = "TryStatement", | ||
TupleDeconstructionStatement = "TupleDeconstructionStatement", | ||
TupleExpression = "TupleExpression", | ||
TupleMember = "TupleMember", | ||
TupleMembersList = "TupleMembersList", | ||
TupleValuesList = "TupleValuesList", | ||
TypeExpression = "TypeExpression", | ||
TypeName = "TypeName", | ||
UncheckedBlock = "UncheckedBlock", | ||
UnicodeStringLiteralsList = "UnicodeStringLiteralsList", | ||
UnnamedFunctionAttributesList = "UnnamedFunctionAttributesList", | ||
UnnamedFunctionDefinition = "UnnamedFunctionDefinition", | ||
UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", | ||
UsingDirective = "UsingDirective", | ||
UsingDirectiveDeconstruction = "UsingDirectiveDeconstruction", | ||
UsingDirectivePath = "UsingDirectivePath", | ||
UsingDirectiveSymbol = "UsingDirectiveSymbol", | ||
UsingDirectiveSymbolsList = "UsingDirectiveSymbolsList", | ||
VariableDeclaration = "VariableDeclaration", | ||
VariableDeclarationStatement = "VariableDeclarationStatement", | ||
VersionPragma = "VersionPragma", | ||
VersionPragmaExpression = "VersionPragmaExpression", | ||
VersionPragmaExpressionsList = "VersionPragmaExpressionsList", | ||
VersionPragmaSpecifier = "VersionPragmaSpecifier", | ||
WhileStatement = "WhileStatement", | ||
YulAssignmentStatement = "YulAssignmentStatement", | ||
YulBlock = "YulBlock", | ||
YulBreakStatement = "YulBreakStatement", | ||
YulContinueStatement = "YulContinueStatement", | ||
YulDeclarationStatement = "YulDeclarationStatement", | ||
YulExpression = "YulExpression", | ||
YulExpressionsList = "YulExpressionsList", | ||
YulForStatement = "YulForStatement", | ||
YulFunctionDefinition = "YulFunctionDefinition", | ||
YulIdentifierPath = "YulIdentifierPath", | ||
YulIdentifierPathsList = "YulIdentifierPathsList", | ||
YulIdentifiersList = "YulIdentifiersList", | ||
YulIfStatement = "YulIfStatement", | ||
YulLeaveStatement = "YulLeaveStatement", | ||
YulParametersDeclaration = "YulParametersDeclaration", | ||
YulReturnsDeclaration = "YulReturnsDeclaration", | ||
YulStatement = "YulStatement", | ||
YulStatementsList = "YulStatementsList", | ||
YulSwitchCase = "YulSwitchCase", | ||
YulSwitchCasesList = "YulSwitchCasesList", | ||
YulSwitchStatement = "YulSwitchStatement", | ||
} | ||
export enum RuleKind { | ||
ABICoderPragma = "ABICoderPragma", | ||
AdditiveExpression = "AdditiveExpression", | ||
AddressType = "AddressType", | ||
AndExpression = "AndExpression", | ||
ArgumentsDeclaration = "ArgumentsDeclaration", | ||
ArrayExpression = "ArrayExpression", | ||
ArrayTypeName = "ArrayTypeName", | ||
ArrayValuesList = "ArrayValuesList", | ||
AsciiStringLiteralsList = "AsciiStringLiteralsList", | ||
AssemblyFlagsList = "AssemblyFlagsList", | ||
ArrayValues = "ArrayValues", | ||
AsciiStringLiterals = "AsciiStringLiterals", | ||
AssemblyFlags = "AssemblyFlags", | ||
AssemblyFlagsDeclaration = "AssemblyFlagsDeclaration", | ||
AssemblyStatement = "AssemblyStatement", | ||
BinaryExpression = "BinaryExpression", | ||
AssignmentExpression = "AssignmentExpression", | ||
BitwiseAndExpression = "BitwiseAndExpression", | ||
BitwiseOrExpression = "BitwiseOrExpression", | ||
BitwiseXorExpression = "BitwiseXorExpression", | ||
Block = "Block", | ||
@@ -172,72 +35,107 @@ BreakStatement = "BreakStatement", | ||
CatchClauseError = "CatchClauseError", | ||
CatchClausesList = "CatchClausesList", | ||
CatchClauses = "CatchClauses", | ||
ComparisonExpression = "ComparisonExpression", | ||
ConditionalExpression = "ConditionalExpression", | ||
ConstantDefinition = "ConstantDefinition", | ||
ConstructorAttributesList = "ConstructorAttributesList", | ||
ConstructorAttribute = "ConstructorAttribute", | ||
ConstructorAttributes = "ConstructorAttributes", | ||
ConstructorDefinition = "ConstructorDefinition", | ||
ContinueStatement = "ContinueStatement", | ||
ContractDefinition = "ContractDefinition", | ||
ContractMembersList = "ContractMembersList", | ||
DeconstructionImport = "DeconstructionImport", | ||
DeconstructionImportSymbol = "DeconstructionImportSymbol", | ||
DeconstructionImportSymbolsList = "DeconstructionImportSymbolsList", | ||
ContractMember = "ContractMember", | ||
ContractMembers = "ContractMembers", | ||
DecimalNumberExpression = "DecimalNumberExpression", | ||
DeleteStatement = "DeleteStatement", | ||
DoWhileStatement = "DoWhileStatement", | ||
ElementaryType = "ElementaryType", | ||
ElseBranch = "ElseBranch", | ||
EmitStatement = "EmitStatement", | ||
EndOfFileTrivia = "EndOfFileTrivia", | ||
EnumDefinition = "EnumDefinition", | ||
EnumMembers = "EnumMembers", | ||
EqualityExpression = "EqualityExpression", | ||
ErrorDefinition = "ErrorDefinition", | ||
ErrorParameter = "ErrorParameter", | ||
ErrorParametersList = "ErrorParametersList", | ||
ErrorParameters = "ErrorParameters", | ||
ErrorParametersDeclaration = "ErrorParametersDeclaration", | ||
EventDefinition = "EventDefinition", | ||
EventParameter = "EventParameter", | ||
EventParametersList = "EventParametersList", | ||
EventParameters = "EventParameters", | ||
EventParametersDeclaration = "EventParametersDeclaration", | ||
ExperimentalFeature = "ExperimentalFeature", | ||
ExperimentalPragma = "ExperimentalPragma", | ||
ExponentiationExpression = "ExponentiationExpression", | ||
Expression = "Expression", | ||
ExpressionStatement = "ExpressionStatement", | ||
FallbackFunctionAttributesList = "FallbackFunctionAttributesList", | ||
FallbackFunctionAttribute = "FallbackFunctionAttribute", | ||
FallbackFunctionAttributes = "FallbackFunctionAttributes", | ||
FallbackFunctionDefinition = "FallbackFunctionDefinition", | ||
ForStatement = "ForStatement", | ||
FunctionAttributesList = "FunctionAttributesList", | ||
ForStatementCondition = "ForStatementCondition", | ||
ForStatementInitialization = "ForStatementInitialization", | ||
FunctionAttribute = "FunctionAttribute", | ||
FunctionAttributes = "FunctionAttributes", | ||
FunctionBody = "FunctionBody", | ||
FunctionCallExpression = "FunctionCallExpression", | ||
FunctionCallOptions = "FunctionCallOptions", | ||
FunctionDefinition = "FunctionDefinition", | ||
FunctionName = "FunctionName", | ||
FunctionType = "FunctionType", | ||
FunctionTypeAttributesList = "FunctionTypeAttributesList", | ||
HexStringLiteralsList = "HexStringLiteralsList", | ||
FunctionTypeAttribute = "FunctionTypeAttribute", | ||
FunctionTypeAttributes = "FunctionTypeAttributes", | ||
HexNumberExpression = "HexNumberExpression", | ||
HexStringLiterals = "HexStringLiterals", | ||
IdentifierPath = "IdentifierPath", | ||
IdentifierPathsList = "IdentifierPathsList", | ||
IdentifiersList = "IdentifiersList", | ||
IfStatement = "IfStatement", | ||
ImportAlias = "ImportAlias", | ||
ImportClause = "ImportClause", | ||
ImportDeconstruction = "ImportDeconstruction", | ||
ImportDeconstructionSymbol = "ImportDeconstructionSymbol", | ||
ImportDeconstructionSymbols = "ImportDeconstructionSymbols", | ||
ImportDirective = "ImportDirective", | ||
IndexAccessEnd = "IndexAccessEnd", | ||
IndexAccessExpression = "IndexAccessExpression", | ||
InheritanceSpecifier = "InheritanceSpecifier", | ||
InheritanceType = "InheritanceType", | ||
InheritanceTypesList = "InheritanceTypesList", | ||
InheritanceTypes = "InheritanceTypes", | ||
InterfaceDefinition = "InterfaceDefinition", | ||
InterfaceMembersList = "InterfaceMembersList", | ||
InterfaceMembers = "InterfaceMembers", | ||
LeadingTrivia = "LeadingTrivia", | ||
LibraryDefinition = "LibraryDefinition", | ||
LibraryMembersList = "LibraryMembersList", | ||
LibraryMembers = "LibraryMembers", | ||
MappingKey = "MappingKey", | ||
MappingKeyType = "MappingKeyType", | ||
MappingType = "MappingType", | ||
MappingValueType = "MappingValueType", | ||
MappingValue = "MappingValue", | ||
MemberAccess = "MemberAccess", | ||
MemberAccessExpression = "MemberAccessExpression", | ||
ModifierAttributesList = "ModifierAttributesList", | ||
ModifierAttribute = "ModifierAttribute", | ||
ModifierAttributes = "ModifierAttributes", | ||
ModifierDefinition = "ModifierDefinition", | ||
ModifierInvocation = "ModifierInvocation", | ||
MultiplicativeExpression = "MultiplicativeExpression", | ||
NamedArgument = "NamedArgument", | ||
NamedArgumentGroup = "NamedArgumentGroup", | ||
NamedArgumentGroups = "NamedArgumentGroups", | ||
NamedArguments = "NamedArguments", | ||
NamedArgumentsDeclaration = "NamedArgumentsDeclaration", | ||
NamedArgumentsList = "NamedArgumentsList", | ||
NamedImport = "NamedImport", | ||
NewExpression = "NewExpression", | ||
NumericExpression = "NumericExpression", | ||
NumberUnit = "NumberUnit", | ||
OrExpression = "OrExpression", | ||
OverridePaths = "OverridePaths", | ||
OverridePathsDeclaration = "OverridePathsDeclaration", | ||
OverrideSpecifier = "OverrideSpecifier", | ||
Parameter = "Parameter", | ||
Parameters = "Parameters", | ||
ParametersDeclaration = "ParametersDeclaration", | ||
ParametersList = "ParametersList", | ||
PathImport = "PathImport", | ||
PositionalArgumentsList = "PositionalArgumentsList", | ||
PositionalArguments = "PositionalArguments", | ||
PositionalArgumentsDeclaration = "PositionalArgumentsDeclaration", | ||
PostfixExpression = "PostfixExpression", | ||
Pragma = "Pragma", | ||
PragmaDirective = "PragmaDirective", | ||
ReceiveFunctionAttributesList = "ReceiveFunctionAttributesList", | ||
PrefixExpression = "PrefixExpression", | ||
ReceiveFunctionAttribute = "ReceiveFunctionAttribute", | ||
ReceiveFunctionAttributes = "ReceiveFunctionAttributes", | ||
ReceiveFunctionDefinition = "ReceiveFunctionDefinition", | ||
@@ -247,42 +145,57 @@ ReturnStatement = "ReturnStatement", | ||
RevertStatement = "RevertStatement", | ||
ShiftExpression = "ShiftExpression", | ||
SourceUnit = "SourceUnit", | ||
SourceUnitMembersList = "SourceUnitMembersList", | ||
StateVariableAttributesList = "StateVariableAttributesList", | ||
SourceUnitMember = "SourceUnitMember", | ||
SourceUnitMembers = "SourceUnitMembers", | ||
StateVariableAttribute = "StateVariableAttribute", | ||
StateVariableAttributes = "StateVariableAttributes", | ||
StateVariableDefinition = "StateVariableDefinition", | ||
StateVariableDefinitionValue = "StateVariableDefinitionValue", | ||
Statement = "Statement", | ||
StatementsList = "StatementsList", | ||
Statements = "Statements", | ||
StorageLocation = "StorageLocation", | ||
StringExpression = "StringExpression", | ||
StructDefinition = "StructDefinition", | ||
StructMember = "StructMember", | ||
StructMembersList = "StructMembersList", | ||
StructMembers = "StructMembers", | ||
ThrowStatement = "ThrowStatement", | ||
TrailingTrivia = "TrailingTrivia", | ||
TryStatement = "TryStatement", | ||
TupleDeconstructionElement = "TupleDeconstructionElement", | ||
TupleDeconstructionElements = "TupleDeconstructionElements", | ||
TupleDeconstructionStatement = "TupleDeconstructionStatement", | ||
TupleExpression = "TupleExpression", | ||
TupleMember = "TupleMember", | ||
TupleMembersList = "TupleMembersList", | ||
TupleValuesList = "TupleValuesList", | ||
TupleValue = "TupleValue", | ||
TupleValues = "TupleValues", | ||
TypeExpression = "TypeExpression", | ||
TypeName = "TypeName", | ||
UnaryPostfixExpression = "UnaryPostfixExpression", | ||
UnaryPrefixExpression = "UnaryPrefixExpression", | ||
TypedTupleMember = "TypedTupleMember", | ||
UncheckedBlock = "UncheckedBlock", | ||
UnicodeStringLiteralsList = "UnicodeStringLiteralsList", | ||
UnnamedFunctionAttributesList = "UnnamedFunctionAttributesList", | ||
UnicodeStringLiterals = "UnicodeStringLiterals", | ||
UnnamedFunctionAttribute = "UnnamedFunctionAttribute", | ||
UnnamedFunctionAttributes = "UnnamedFunctionAttributes", | ||
UnnamedFunctionDefinition = "UnnamedFunctionDefinition", | ||
UntypedTupleMember = "UntypedTupleMember", | ||
UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", | ||
UsingAlias = "UsingAlias", | ||
UsingClause = "UsingClause", | ||
UsingDeconstruction = "UsingDeconstruction", | ||
UsingDeconstructionSymbol = "UsingDeconstructionSymbol", | ||
UsingDeconstructionSymbols = "UsingDeconstructionSymbols", | ||
UsingDirective = "UsingDirective", | ||
UsingDirectiveDeconstruction = "UsingDirectiveDeconstruction", | ||
UsingDirectivePath = "UsingDirectivePath", | ||
UsingDirectiveSymbol = "UsingDirectiveSymbol", | ||
UsingDirectiveSymbolsList = "UsingDirectiveSymbolsList", | ||
VariableDeclaration = "VariableDeclaration", | ||
UsingOperator = "UsingOperator", | ||
UsingTarget = "UsingTarget", | ||
VariableDeclarationStatement = "VariableDeclarationStatement", | ||
VariableDeclarationType = "VariableDeclarationType", | ||
VariableDeclarationValue = "VariableDeclarationValue", | ||
VersionPragma = "VersionPragma", | ||
VersionPragmaBinaryExpression = "VersionPragmaBinaryExpression", | ||
VersionPragmaExpression = "VersionPragmaExpression", | ||
VersionPragmaExpressionsList = "VersionPragmaExpressionsList", | ||
VersionPragmaExpressions = "VersionPragmaExpressions", | ||
VersionPragmaOrExpression = "VersionPragmaOrExpression", | ||
VersionPragmaPrefixExpression = "VersionPragmaPrefixExpression", | ||
VersionPragmaRangeExpression = "VersionPragmaRangeExpression", | ||
VersionPragmaSpecifier = "VersionPragmaSpecifier", | ||
VersionPragmaUnaryExpression = "VersionPragmaUnaryExpression", | ||
WhileStatement = "WhileStatement", | ||
YulArguments = "YulArguments", | ||
YulAssignmentStatement = "YulAssignmentStatement", | ||
@@ -292,5 +205,4 @@ YulBlock = "YulBlock", | ||
YulContinueStatement = "YulContinueStatement", | ||
YulDeclarationStatement = "YulDeclarationStatement", | ||
YulDefaultCase = "YulDefaultCase", | ||
YulExpression = "YulExpression", | ||
YulExpressionsList = "YulExpressionsList", | ||
YulForStatement = "YulForStatement", | ||
@@ -300,17 +212,22 @@ YulFunctionCallExpression = "YulFunctionCallExpression", | ||
YulIdentifierPath = "YulIdentifierPath", | ||
YulIdentifierPathsList = "YulIdentifierPathsList", | ||
YulIdentifiersList = "YulIdentifiersList", | ||
YulIdentifierPaths = "YulIdentifierPaths", | ||
YulIfStatement = "YulIfStatement", | ||
YulLeaveStatement = "YulLeaveStatement", | ||
YulLiteral = "YulLiteral", | ||
YulParameters = "YulParameters", | ||
YulParametersDeclaration = "YulParametersDeclaration", | ||
YulReturnVariables = "YulReturnVariables", | ||
YulReturnsDeclaration = "YulReturnsDeclaration", | ||
YulStatement = "YulStatement", | ||
YulStatementsList = "YulStatementsList", | ||
YulStatements = "YulStatements", | ||
YulSwitchCase = "YulSwitchCase", | ||
YulSwitchCasesList = "YulSwitchCasesList", | ||
YulSwitchCases = "YulSwitchCases", | ||
YulSwitchStatement = "YulSwitchStatement", | ||
YulValueCase = "YulValueCase", | ||
YulVariableDeclarationStatement = "YulVariableDeclarationStatement", | ||
YulVariableDeclarationValue = "YulVariableDeclarationValue", | ||
} | ||
export enum TokenKind { | ||
SKIPPED = "SKIPPED", | ||
ABICoderKeyword = "ABICoderKeyword", | ||
AbicoderKeyword = "AbicoderKeyword", | ||
AbstractKeyword = "AbstractKeyword", | ||
@@ -340,3 +257,4 @@ AddressKeyword = "AddressKeyword", | ||
ByteKeyword = "ByteKeyword", | ||
CalldataKeyword = "CalldataKeyword", | ||
BytesKeyword = "BytesKeyword", | ||
CallDataKeyword = "CallDataKeyword", | ||
Caret = "Caret", | ||
@@ -356,3 +274,3 @@ CaretEqual = "CaretEqual", | ||
ContractKeyword = "ContractKeyword", | ||
CopyofKeyword = "CopyofKeyword", | ||
CopyOfKeyword = "CopyOfKeyword", | ||
DaysKeyword = "DaysKeyword", | ||
@@ -380,3 +298,3 @@ DecimalLiteral = "DecimalLiteral", | ||
FinneyKeyword = "FinneyKeyword", | ||
FixedBytesType = "FixedBytesType", | ||
FixedKeyword = "FixedKeyword", | ||
ForKeyword = "ForKeyword", | ||
@@ -405,6 +323,6 @@ FromKeyword = "FromKeyword", | ||
InlineKeyword = "InlineKeyword", | ||
IntKeyword = "IntKeyword", | ||
InterfaceKeyword = "InterfaceKeyword", | ||
InternalKeyword = "InternalKeyword", | ||
IsKeyword = "IsKeyword", | ||
LeaveKeyword = "LeaveKeyword", | ||
LessThan = "LessThan", | ||
@@ -458,6 +376,4 @@ LessThanEqual = "LessThanEqual", | ||
Semicolon = "Semicolon", | ||
SignedFixedType = "SignedFixedType", | ||
SignedIntegerType = "SignedIntegerType", | ||
SingleLineComment = "SingleLineComment", | ||
SizeofKeyword = "SizeofKeyword", | ||
SizeOfKeyword = "SizeOfKeyword", | ||
Slash = "Slash", | ||
@@ -477,9 +393,9 @@ SlashEqual = "SlashEqual", | ||
TryKeyword = "TryKeyword", | ||
TypeDefKeyword = "TypeDefKeyword", | ||
TypeKeyword = "TypeKeyword", | ||
TypedefKeyword = "TypedefKeyword", | ||
TypeofKeyword = "TypeofKeyword", | ||
TypeOfKeyword = "TypeOfKeyword", | ||
UfixedKeyword = "UfixedKeyword", | ||
UintKeyword = "UintKeyword", | ||
UncheckedKeyword = "UncheckedKeyword", | ||
UnicodeStringLiteral = "UnicodeStringLiteral", | ||
UnsignedFixedType = "UnsignedFixedType", | ||
UnsignedIntegerType = "UnsignedIntegerType", | ||
UsingKeyword = "UsingKeyword", | ||
@@ -495,5 +411,112 @@ VarKeyword = "VarKeyword", | ||
YearsKeyword = "YearsKeyword", | ||
YulAbstractKeyword = "YulAbstractKeyword", | ||
YulAddressKeyword = "YulAddressKeyword", | ||
YulAfterKeyword = "YulAfterKeyword", | ||
YulAliasKeyword = "YulAliasKeyword", | ||
YulAnonymousKeyword = "YulAnonymousKeyword", | ||
YulApplyKeyword = "YulApplyKeyword", | ||
YulAsKeyword = "YulAsKeyword", | ||
YulAssemblyKeyword = "YulAssemblyKeyword", | ||
YulAutoKeyword = "YulAutoKeyword", | ||
YulBoolKeyword = "YulBoolKeyword", | ||
YulBreakKeyword = "YulBreakKeyword", | ||
YulByteKeyword = "YulByteKeyword", | ||
YulBytesKeyword = "YulBytesKeyword", | ||
YulCallDataKeyword = "YulCallDataKeyword", | ||
YulCaseKeyword = "YulCaseKeyword", | ||
YulCatchKeyword = "YulCatchKeyword", | ||
YulConstantKeyword = "YulConstantKeyword", | ||
YulConstructorKeyword = "YulConstructorKeyword", | ||
YulContinueKeyword = "YulContinueKeyword", | ||
YulContractKeyword = "YulContractKeyword", | ||
YulCopyOfKeyword = "YulCopyOfKeyword", | ||
YulDaysKeyword = "YulDaysKeyword", | ||
YulDecimalLiteral = "YulDecimalLiteral", | ||
YulDefaultKeyword = "YulDefaultKeyword", | ||
YulDefineKeyword = "YulDefineKeyword", | ||
YulDeleteKeyword = "YulDeleteKeyword", | ||
YulDoKeyword = "YulDoKeyword", | ||
YulElseKeyword = "YulElseKeyword", | ||
YulEmitKeyword = "YulEmitKeyword", | ||
YulEnumKeyword = "YulEnumKeyword", | ||
YulEtherKeyword = "YulEtherKeyword", | ||
YulEventKeyword = "YulEventKeyword", | ||
YulExternalKeyword = "YulExternalKeyword", | ||
YulFallbackKeyword = "YulFallbackKeyword", | ||
YulFalseKeyword = "YulFalseKeyword", | ||
YulFinalKeyword = "YulFinalKeyword", | ||
YulFinneyKeyword = "YulFinneyKeyword", | ||
YulFixedKeyword = "YulFixedKeyword", | ||
YulForKeyword = "YulForKeyword", | ||
YulFunctionKeyword = "YulFunctionKeyword", | ||
YulGweiKeyword = "YulGweiKeyword", | ||
YulHexKeyword = "YulHexKeyword", | ||
YulHexLiteral = "YulHexLiteral", | ||
YulHoursKeyword = "YulHoursKeyword", | ||
YulIdentifier = "YulIdentifier", | ||
YulIfKeyword = "YulIfKeyword", | ||
YulImmutableKeyword = "YulImmutableKeyword", | ||
YulImplementsKeyword = "YulImplementsKeyword", | ||
YulImportKeyword = "YulImportKeyword", | ||
YulInKeyword = "YulInKeyword", | ||
YulIndexedKeyword = "YulIndexedKeyword", | ||
YulInlineKeyword = "YulInlineKeyword", | ||
YulIntKeyword = "YulIntKeyword", | ||
YulInterfaceKeyword = "YulInterfaceKeyword", | ||
YulInternalKeyword = "YulInternalKeyword", | ||
YulIsKeyword = "YulIsKeyword", | ||
YulLeaveKeyword = "YulLeaveKeyword", | ||
YulLetKeyword = "YulLetKeyword", | ||
YulLibraryKeyword = "YulLibraryKeyword", | ||
YulMacroKeyword = "YulMacroKeyword", | ||
YulMappingKeyword = "YulMappingKeyword", | ||
YulMatchKeyword = "YulMatchKeyword", | ||
YulMemoryKeyword = "YulMemoryKeyword", | ||
YulMinutesKeyword = "YulMinutesKeyword", | ||
YulModifierKeyword = "YulModifierKeyword", | ||
YulMutableKeyword = "YulMutableKeyword", | ||
YulNewKeyword = "YulNewKeyword", | ||
YulNullKeyword = "YulNullKeyword", | ||
YulOfKeyword = "YulOfKeyword", | ||
YulOverrideKeyword = "YulOverrideKeyword", | ||
YulPartialKeyword = "YulPartialKeyword", | ||
YulPayableKeyword = "YulPayableKeyword", | ||
YulPragmaKeyword = "YulPragmaKeyword", | ||
YulPrivateKeyword = "YulPrivateKeyword", | ||
YulPromiseKeyword = "YulPromiseKeyword", | ||
YulPublicKeyword = "YulPublicKeyword", | ||
YulPureKeyword = "YulPureKeyword", | ||
YulReceiveKeyword = "YulReceiveKeyword", | ||
YulReferenceKeyword = "YulReferenceKeyword", | ||
YulRelocatableKeyword = "YulRelocatableKeyword", | ||
YulReturnKeyword = "YulReturnKeyword", | ||
YulReturnsKeyword = "YulReturnsKeyword", | ||
YulRevertKeyword = "YulRevertKeyword", | ||
YulSealedKeyword = "YulSealedKeyword", | ||
YulSecondsKeyword = "YulSecondsKeyword", | ||
YulSizeOfKeyword = "YulSizeOfKeyword", | ||
YulStaticKeyword = "YulStaticKeyword", | ||
YulStorageKeyword = "YulStorageKeyword", | ||
YulStringKeyword = "YulStringKeyword", | ||
YulStructKeyword = "YulStructKeyword", | ||
YulSupportsKeyword = "YulSupportsKeyword", | ||
YulSwitchKeyword = "YulSwitchKeyword", | ||
YulSzaboKeyword = "YulSzaboKeyword", | ||
YulThrowKeyword = "YulThrowKeyword", | ||
YulTrueKeyword = "YulTrueKeyword", | ||
YulTryKeyword = "YulTryKeyword", | ||
YulTypeDefKeyword = "YulTypeDefKeyword", | ||
YulTypeKeyword = "YulTypeKeyword", | ||
YulTypeOfKeyword = "YulTypeOfKeyword", | ||
YulUfixedKeyword = "YulUfixedKeyword", | ||
YulUintKeyword = "YulUintKeyword", | ||
YulUncheckedKeyword = "YulUncheckedKeyword", | ||
YulUsingKeyword = "YulUsingKeyword", | ||
YulVarKeyword = "YulVarKeyword", | ||
YulViewKeyword = "YulViewKeyword", | ||
YulVirtualKeyword = "YulVirtualKeyword", | ||
YulWeeksKeyword = "YulWeeksKeyword", | ||
YulWeiKeyword = "YulWeiKeyword", | ||
YulWhileKeyword = "YulWhileKeyword", | ||
YulYearsKeyword = "YulYearsKeyword", | ||
} | ||
@@ -505,4 +528,4 @@ } | ||
Default = "Default", | ||
VersionPragma = "VersionPragma", | ||
YulBlock = "YulBlock", | ||
Pragma = "Pragma", | ||
Yul = "Yul", | ||
} | ||
@@ -514,3 +537,3 @@ export class Language { | ||
scan(lexicalContext: LexicalContext, input: string): kinds.TokenKind | null; | ||
parse(productionKind: kinds.ProductionKind, input: string): parse_output.ParseOutput; | ||
parse(kind: kinds.RuleKind, input: string): parse_output.ParseOutput; | ||
} | ||
@@ -527,4 +550,4 @@ } | ||
get textLength(): text_index.TextIndex; | ||
children(): Array<cst.RuleNode | cst.TokenNode>; | ||
createCursor(textOffset: TextIndex): cursor.Cursor; | ||
children(): Array<cst.Node>; | ||
createCursor(textOffset: text_index.TextIndex): cursor.Cursor; | ||
} | ||
@@ -536,3 +559,3 @@ export class TokenNode { | ||
get text(): string; | ||
createCursor(textOffset: TextIndex): cursor.Cursor; | ||
createCursor(textOffset: text_index.TextIndex): cursor.Cursor; | ||
} | ||
@@ -547,6 +570,7 @@ } | ||
get isCompleted(): boolean; | ||
node(): cst.RuleNode | cst.TokenNode; | ||
node(): cst.Node; | ||
get textOffset(): text_index.TextIndex; | ||
get textRange(): text_index.TextRange; | ||
pathRuleNodes(): Array<cst.RuleNode>; | ||
get depth(): number; | ||
ancestors(): Array<cst.RuleNode>; | ||
goToNext(): boolean; | ||
@@ -561,4 +585,6 @@ goToNextNonDescendent(): boolean; | ||
goToPreviousSibling(): boolean; | ||
findTokenWithKind(kinds: Array<kinds.TokenKind>): cst.TokenNode | null; | ||
findRuleWithKind(kinds: Array<kinds.RuleKind>): cst.RuleNode | null; | ||
goToNextToken(): boolean; | ||
goToNextTokenWithKinds(kinds: Array<kinds.TokenKind>): boolean; | ||
goToNextRule(): boolean; | ||
goToNextRuleWithKinds(kinds: Array<kinds.RuleKind>): boolean; | ||
} | ||
@@ -574,3 +600,3 @@ } | ||
export class ParseOutput { | ||
tree(): cst.RuleNode | cst.TokenNode; | ||
tree(): cst.Node; | ||
errors(): Array<parse_error.ParseError>; | ||
@@ -593,1 +619,5 @@ get isValid(): boolean; | ||
} | ||
export namespace cst { | ||
export type Node = RuleNode | TokenNode; | ||
} |
import * as generated from "../generated"; | ||
export declare const ProductionKind: typeof generated.kinds.ProductionKind; | ||
export type ProductionKind = generated.kinds.ProductionKind; | ||
export declare const RuleKind: typeof generated.kinds.RuleKind; | ||
@@ -5,0 +3,0 @@ export type RuleKind = generated.kinds.RuleKind; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TokenKind = exports.RuleKind = exports.ProductionKind = void 0; | ||
exports.TokenKind = exports.RuleKind = void 0; | ||
const generated = require("../generated"); | ||
exports.ProductionKind = generated.kinds.ProductionKind; | ||
exports.RuleKind = generated.kinds.RuleKind; | ||
exports.TokenKind = generated.kinds.TokenKind; |
{ | ||
"name": "@nomicfoundation/slang", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "A modular set of compiler APIs empowering the next generation of Solidity code analysis and developer tooling. Written in Rust and distributed in multiple languages.", | ||
@@ -31,11 +31,11 @@ "homepage": "https://nomicfoundation.github.io/slang/", | ||
"optionalDependencies": { | ||
"@nomicfoundation/slang-darwin-arm64": "0.11.0", | ||
"@nomicfoundation/slang-win32-arm64-msvc": "0.11.0", | ||
"@nomicfoundation/slang-linux-arm64-gnu": "0.11.0", | ||
"@nomicfoundation/slang-linux-arm64-musl": "0.11.0", | ||
"@nomicfoundation/slang-win32-ia32-msvc": "0.11.0", | ||
"@nomicfoundation/slang-darwin-x64": "0.11.0", | ||
"@nomicfoundation/slang-win32-x64-msvc": "0.11.0", | ||
"@nomicfoundation/slang-linux-x64-gnu": "0.11.0", | ||
"@nomicfoundation/slang-linux-x64-musl": "0.11.0" | ||
"@nomicfoundation/slang-darwin-arm64": "0.12.0", | ||
"@nomicfoundation/slang-win32-arm64-msvc": "0.12.0", | ||
"@nomicfoundation/slang-linux-arm64-gnu": "0.12.0", | ||
"@nomicfoundation/slang-linux-arm64-musl": "0.12.0", | ||
"@nomicfoundation/slang-win32-ia32-msvc": "0.12.0", | ||
"@nomicfoundation/slang-darwin-x64": "0.12.0", | ||
"@nomicfoundation/slang-win32-x64-msvc": "0.12.0", | ||
"@nomicfoundation/slang-linux-x64-gnu": "0.12.0", | ||
"@nomicfoundation/slang-linux-x64-musl": "0.12.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "napi": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58945
920