Skip to content

Commit cfe9bf7

Browse files
authored
Merge pull request #1126 from prettier-solidity/rename-parsers
Rename parsers
2 parents 91cbfc5 + 81ef86e commit cfe9bf7

File tree

123 files changed

+188
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+188
-188
lines changed

README.md

Lines changed: 5 additions & 5 deletions

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import type {
1818
} from 'prettier';
1919
import type { AstNode } from './slang-nodes/types.d.ts';
2020

21-
const slangParserId = 'slang-solidity';
22-
const antlrParserId = 'solidity-parse';
21+
const slangParserId = 'slang';
22+
const antlrParserId = 'antlr';
2323
const slangAstId = 'slang-ast';
24-
const antlrAstId = 'solidity-ast';
24+
const antlrAstId = 'antlr-ast';
2525

2626
// https://prettier.io/docs/en/plugins.html#languages
2727
// https://github.com/github-linguist/linguist/blob/master/lib/linguist/languages.yml

src/printer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function once(factory) {
1818

1919
const warnDeprecation = once(() => {
2020
printWarning(
21-
`'solidity-parse' has been deprecated, please use 'slang-solidity'.`
21+
`The 'antlr' parser has been deprecated, please use 'slang' instead.`
2222
);
2323
return true;
2424
});

tests/config/run-format-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ async function runTest({
322322
}
323323

324324
if (
325-
formatOptions.parser === "slang-solidity" &&
325+
formatOptions.parser === "slang" &&
326326
!isAntlrMismatch(filename, formatOptions)
327327
) {
328328
// Compare with ANTLR's format
@@ -335,7 +335,7 @@ async function runTest({
335335
compiler:
336336
formatOptions.compiler ||
337337
createParser(code, formatOptions)[0].languageVersion,
338-
parser: "solidity-parse",
338+
parser: "antlr",
339339
plugins: await getPlugins(),
340340
});
341341
expect(antlrOutput).toEqual(formatResult.output);

tests/format/AddressPayable/__snapshots__/format.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`AddressPayable.sol format 1`] = `
44
====================================options=====================================
5-
parsers: ["slang-solidity"]
5+
parsers: ["slang"]
66
printWidth: 80
77
| printWidth
88
=====================================input======================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
runFormatTest(import.meta, ['slang-solidity']);
1+
runFormatTest(import.meta, ['slang']);

tests/format/AllSolidityFeatures/__snapshots__/format.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`AllSolidityFeatures.sol format 1`] = `
44
====================================options=====================================
5-
parsers: ["slang-solidity"]
5+
parsers: ["slang"]
66
printWidth: 80
77
| printWidth
88
=====================================input======================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
runFormatTest(import.meta, ['slang-solidity']);
1+
runFormatTest(import.meta, ['slang']);

tests/format/AllSolidityFeaturesV0.4.26/__snapshots__/format.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`AllSolidityFeatures.sol format 1`] = `
44
====================================options=====================================
5-
parsers: ["slang-solidity"]
5+
parsers: ["slang"]
66
printWidth: 80
77
| printWidth
88
=====================================input======================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
runFormatTest(import.meta, ['slang-solidity']);
1+
runFormatTest(import.meta, ['slang']);

0 commit comments

Comments
 (0)