Skip to content

Commit 0bbea0a

Browse files
Bump @nomicfoundation/slang from 1.2.1 to 1.3.0 (#1288)
1 parent 4149062 commit 0bbea0a

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"webpack-cli": "^6.0.1"
113113
},
114114
"dependencies": {
115-
"@nomicfoundation/slang": "1.2.1",
115+
"@nomicfoundation/slang": "1.3.0",
116116
"@solidity-parser/parser": "^0.20.2",
117117
"semver": "^7.7.3"
118118
},

src/slang-nodes/AbicoderPragma.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NonterminalKind } from '@nomicfoundation/slang/cst';
22
import { SlangNode } from './SlangNode.js';
3-
import { TerminalNode } from './TerminalNode.js';
3+
import { AbicoderVersion } from './AbicoderVersion.js';
44

55
import type * as ast from '@nomicfoundation/slang/ast';
66
import type { AstPath, Doc } from 'prettier';
@@ -9,12 +9,12 @@ import type { PrintFunction } from '../types.d.ts';
99
export class AbicoderPragma extends SlangNode {
1010
readonly kind = NonterminalKind.AbicoderPragma;
1111

12-
version: TerminalNode;
12+
version: AbicoderVersion;
1313

1414
constructor(ast: ast.AbicoderPragma) {
1515
super(ast);
1616

17-
this.version = new TerminalNode(ast.version);
17+
this.version = new AbicoderVersion(ast.version);
1818
}
1919

2020
print(path: AstPath<AbicoderPragma>, print: PrintFunction): Doc {

src/slang-nodes/AbicoderVersion.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NonterminalKind } from '@nomicfoundation/slang/cst';
2+
import { SlangNode } from './SlangNode.js';
3+
4+
import type * as ast from '@nomicfoundation/slang/ast';
5+
import type { Doc } from 'prettier';
6+
7+
export class AbicoderVersion extends SlangNode {
8+
readonly kind = NonterminalKind.AbicoderVersion;
9+
10+
variant: string;
11+
12+
constructor(ast: ast.AbicoderVersion) {
13+
super(ast);
14+
15+
this.variant = ast.variant.unparse();
16+
}
17+
18+
print(): Doc {
19+
return this.variant;
20+
}
21+
}

src/slang-nodes/types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { AbicoderPragma } from './AbicoderPragma.ts';
2+
import type { AbicoderVersion } from './AbicoderVersion.ts';
23
import type { AdditiveExpression } from './AdditiveExpression.ts';
34
import type { AddressType } from './AddressType.ts';
45
import type { AndExpression } from './AndExpression.ts';
@@ -242,6 +243,7 @@ export type StrictAstNode =
242243
| SourceUnit
243244
| PragmaDirective
244245
| AbicoderPragma
246+
| AbicoderVersion
245247
| ExperimentalPragma
246248
| VersionPragma
247249
| VersionRange

0 commit comments

Comments
 (0)