Skip to content

Commit 7788f61

Browse files
committed
Rearranging the placement of the definition of the AstNode type
1 parent e16a8c7 commit 7788f61

188 files changed

Lines changed: 878 additions & 720 deletions

File tree

Some content is hidden

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

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import type {
1616
RequiredOptions,
1717
SupportLanguage
1818
} from 'prettier';
19-
import type { AstNode, Comment } from './types';
19+
import type { AstNode } from './slang-nodes';
20+
import type { Comment } from './types';
2021

2122
const parserName = 'slang';
2223
const astFormat = 'slang-ast';

src/slang-comments/handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import handlers from './handlers/index.js';
22

33
import type { ParserOptions } from 'prettier';
4-
import type { AstNode, Comment } from '../types';
4+
import type { AstNode } from '../slang-nodes';
5+
import type { Comment } from '../types';
56

67
function ownLine(
78
comment: Comment,

src/slang-comments/handlers/add-hub-node-first-comment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { util } from 'prettier';
22

3-
import type { Comment, HubNode } from '../../types';
3+
import type { HubNode } from '../../slang-nodes';
4+
import type { Comment } from '../../types';
45

56
const { addDanglingComment, addLeadingComment } = util;
67

src/slang-comments/handlers/add-hub-node-last-comment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { util } from 'prettier';
22

3-
import type { Comment, HubNode } from '../../types';
3+
import type { HubNode } from '../../slang-nodes';
4+
import type { Comment } from '../../types';
45

56
const { addDanglingComment, addTrailingComment } = util;
67

src/slang-comments/handlers/types.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { Comment, StrictAstNode } from '../../types';
1+
import type { StrictAstNode } from '../../slang-nodes';
2+
import type { Comment } from '../../types';
23

34
interface HandlerParams {
45
text: string;

src/slang-comments/printer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { doc } from 'prettier';
22
import { isBlockComment, isLineComment } from '../slang-utils/is-comment.js';
33

44
import type { AstPath, Doc } from 'prettier';
5-
import type { AstNode, Comment } from '../types';
5+
import type { AstNode } from '../slang-nodes';
6+
import type { Comment } from '../types';
67

78
const { hardline, join, literalline } = doc.builders;
89

src/slang-nodes/AdditiveExpression.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { Expression } from './Expression.js';
66

77
import type * as ast from '@nomicfoundation/slang/ast';
88
import type { AstPath, Doc, ParserOptions } from 'prettier';
9-
import type { AstNode, PrintFunction, SlangNode } from '../types';
9+
import type { AstNode } from '../slang-nodes';
10+
import type { PrintFunction, SlangNode } from '../types';
1011

1112
const tryToHug = createHugFunction(['%']);
1213

src/slang-nodes/AndExpression.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Expression } from './Expression.js';
55

66
import type * as ast from '@nomicfoundation/slang/ast';
77
import type { AstPath, Doc, ParserOptions } from 'prettier';
8-
import type { AstNode, PrintFunction, SlangNode } from '../types';
8+
import type { AstNode } from '../slang-nodes';
9+
import type { PrintFunction, SlangNode } from '../types';
910

1011
export class AndExpression implements SlangNode {
1112
readonly kind = NonterminalKind.AndExpression;

src/slang-nodes/ArgumentsDeclaration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { NamedArgumentsDeclaration } from './NamedArgumentsDeclaration.js';
55

66
import type * as ast from '@nomicfoundation/slang/ast';
77
import type { AstPath, Doc, ParserOptions } from 'prettier';
8-
import type { AstNode, PrintFunction, SlangNode } from '../types';
8+
import type { AstNode } from '../slang-nodes';
9+
import type { PrintFunction, SlangNode } from '../types';
910

1011
export class ArgumentsDeclaration implements SlangNode {
1112
readonly kind = NonterminalKind.ArgumentsDeclaration;

src/slang-nodes/ArrayExpression.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { ArrayValues } from './ArrayValues.js';
55

66
import type * as ast from '@nomicfoundation/slang/ast';
77
import type { AstPath, Doc, ParserOptions } from 'prettier';
8-
import type { AstNode, PrintFunction, SlangNode } from '../types';
8+
import type { AstNode } from '../slang-nodes';
9+
import type { PrintFunction, SlangNode } from '../types';
910

1011
const { group } = doc.builders;
1112

0 commit comments

Comments
 (0)