@markuplint/pug-parser 2.0.0 → 2.0.1-dev.20220307.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/pug-parser/index.d.ts +97 -114
- package/package.json +5 -5
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { parse } from './parse';
|
|
2
|
-
export declare const endTag =
|
|
2
|
+
export declare const endTag = "never";
|
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
export declare function pugParse(pug: string): ASTBlock;
|
|
2
2
|
export declare type ASTBlock = PugAST<ASTNode>;
|
|
3
|
-
export declare type ASTNode =
|
|
4
|
-
|
|
5
|
-
| ASTTextNode
|
|
6
|
-
| ASTCodeNode
|
|
7
|
-
| ASTComment
|
|
8
|
-
| ASTDoctype
|
|
9
|
-
| ASTIncludeNode
|
|
10
|
-
| ASTMixinNode
|
|
11
|
-
| ASTMixinSlotNode
|
|
12
|
-
| ASTFilterNode
|
|
13
|
-
| ASTEachNode
|
|
14
|
-
| ASTConditionalNode
|
|
15
|
-
| ASTCaseNode
|
|
16
|
-
| ASTCaseWhenNode;
|
|
17
|
-
export declare type ASTTagNode = Omit<
|
|
18
|
-
PugASTTagNode<ASTAttr, ASTBlock>,
|
|
19
|
-
'attributeBlocks' | 'selfClosing' | 'isInline'
|
|
20
|
-
> &
|
|
21
|
-
AddtionalASTData;
|
|
3
|
+
export declare type ASTNode = ASTTagNode | ASTTextNode | ASTCodeNode | ASTComment | ASTDoctype | ASTIncludeNode | ASTMixinNode | ASTMixinSlotNode | ASTFilterNode | ASTEachNode | ASTConditionalNode | ASTCaseNode | ASTCaseWhenNode;
|
|
4
|
+
export declare type ASTTagNode = Omit<PugASTTagNode<ASTAttr, ASTBlock>, 'attributeBlocks' | 'selfClosing' | 'isInline'> & AddtionalASTData;
|
|
22
5
|
export declare type ASTTextNode = Omit<PugASTTextNode, 'val'> & AddtionalASTData;
|
|
23
6
|
export declare type ASTCodeNode = PugASTCodeNode & AddtionalASTData;
|
|
24
7
|
export declare type ASTComment = PugASTCommentNode & AddtionalASTData;
|
|
@@ -29,135 +12,135 @@ export declare type ASTMixinSlotNode = PugASTMixinSlotNode & AddtionalASTData;
|
|
|
29
12
|
export declare type ASTFilterNode = PugASTFilterNode<ASTAttr, ASTBlock> & AddtionalASTData;
|
|
30
13
|
export declare type ASTEachNode = PugASTEachNode<ASTBlock> & AddtionalASTData;
|
|
31
14
|
export declare type ASTConditionalNode = Omit<PugASTConditionalNode<ASTBlock>, 'consequent' | 'alternate'> & {
|
|
32
|
-
|
|
15
|
+
block: ASTBlock;
|
|
33
16
|
} & AddtionalASTData;
|
|
34
17
|
export declare type ASTCaseNode = PugASTCaseNode<ASTBlock> & AddtionalASTData;
|
|
35
18
|
export declare type ASTCaseWhenNode = PugASTCaseWhenNode<ASTBlock> & AddtionalASTData;
|
|
36
19
|
export declare type ASTAttr = PugASTAttr & AddtionalASTData;
|
|
37
20
|
declare type AddtionalASTData = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
21
|
+
raw: string;
|
|
22
|
+
offset: number;
|
|
23
|
+
endOffset: number;
|
|
24
|
+
endLine: number;
|
|
25
|
+
endColumn: number;
|
|
43
26
|
};
|
|
44
27
|
interface PugAST<N> {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
type: 'Block';
|
|
29
|
+
nodes: N[];
|
|
30
|
+
line: number;
|
|
48
31
|
}
|
|
49
32
|
declare type PugASTTagNode<A, B> = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
type: 'Tag';
|
|
34
|
+
name: string;
|
|
35
|
+
selfClosing: boolean;
|
|
36
|
+
attrs: A[];
|
|
37
|
+
attributeBlocks: never[];
|
|
38
|
+
isInline: boolean;
|
|
39
|
+
line: number;
|
|
40
|
+
column: number;
|
|
41
|
+
block: B;
|
|
59
42
|
};
|
|
60
43
|
declare type PugASTTextNode = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
44
|
+
type: 'Text';
|
|
45
|
+
val: string;
|
|
46
|
+
isHtml?: true;
|
|
47
|
+
line: number;
|
|
48
|
+
column: number;
|
|
66
49
|
};
|
|
67
50
|
declare type PugASTCodeNode = {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
51
|
+
type: 'Code';
|
|
52
|
+
val: string;
|
|
53
|
+
buffer: boolean;
|
|
54
|
+
mustEscape: boolean;
|
|
55
|
+
isInline: boolean;
|
|
56
|
+
line: number;
|
|
57
|
+
column: number;
|
|
75
58
|
};
|
|
76
59
|
declare type PugASTCommentNode = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
60
|
+
type: 'Comment';
|
|
61
|
+
val: string;
|
|
62
|
+
buffer: boolean;
|
|
63
|
+
line: number;
|
|
64
|
+
column: number;
|
|
82
65
|
};
|
|
83
66
|
declare type PugASTDoctypeNode = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
67
|
+
type: 'Doctype';
|
|
68
|
+
val: string;
|
|
69
|
+
line: number;
|
|
70
|
+
column: number;
|
|
88
71
|
};
|
|
89
72
|
declare type PugASTIncludeNode<B> = {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
73
|
+
type: 'Include';
|
|
74
|
+
file: {
|
|
75
|
+
type: 'FileReference';
|
|
76
|
+
path: string;
|
|
77
|
+
line: number;
|
|
78
|
+
column: number;
|
|
79
|
+
};
|
|
80
|
+
block: B;
|
|
81
|
+
line: number;
|
|
82
|
+
column: number;
|
|
100
83
|
};
|
|
101
84
|
declare type PugASTEachNode<B> = {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
85
|
+
type: 'Each';
|
|
86
|
+
obj: string;
|
|
87
|
+
val: string;
|
|
88
|
+
key: string | null;
|
|
89
|
+
block: B;
|
|
90
|
+
line: number;
|
|
91
|
+
column: number;
|
|
109
92
|
};
|
|
110
93
|
declare type PugASTMixinNode<A, B> = {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
94
|
+
type: 'Mixin';
|
|
95
|
+
name: string;
|
|
96
|
+
args: string;
|
|
97
|
+
call: boolean;
|
|
98
|
+
block: B | null;
|
|
99
|
+
attrs?: A[];
|
|
100
|
+
attributeBlocks: never[];
|
|
101
|
+
line: number;
|
|
102
|
+
column: number;
|
|
120
103
|
};
|
|
121
104
|
declare type PugASTMixinSlotNode = {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
105
|
+
type: 'MixinBlock';
|
|
106
|
+
line: number;
|
|
107
|
+
column: number;
|
|
125
108
|
};
|
|
126
109
|
declare type PugASTFilterNode<A, B> = {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
110
|
+
type: 'Filter';
|
|
111
|
+
name: string;
|
|
112
|
+
block: B;
|
|
113
|
+
attrs: A[];
|
|
114
|
+
line: number;
|
|
115
|
+
column: number;
|
|
133
116
|
};
|
|
134
117
|
declare type PugASTConditionalNode<B> = {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
118
|
+
type: 'Conditional';
|
|
119
|
+
test: string;
|
|
120
|
+
consequent: B;
|
|
121
|
+
alternate?: B | PugASTConditionalNode<B>;
|
|
122
|
+
line: number;
|
|
123
|
+
column: number;
|
|
141
124
|
};
|
|
142
125
|
declare type PugASTCaseNode<B> = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
126
|
+
type: 'Case';
|
|
127
|
+
expr: string;
|
|
128
|
+
block: B;
|
|
129
|
+
line: number;
|
|
130
|
+
column: number;
|
|
148
131
|
};
|
|
149
132
|
declare type PugASTCaseWhenNode<B> = {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
133
|
+
type: 'When';
|
|
134
|
+
expr: string;
|
|
135
|
+
block: B;
|
|
136
|
+
line: number;
|
|
137
|
+
column: number;
|
|
155
138
|
};
|
|
156
139
|
declare type PugASTAttr = {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
140
|
+
name: string;
|
|
141
|
+
val: string | true;
|
|
142
|
+
mustEscape: boolean;
|
|
143
|
+
line: number;
|
|
144
|
+
column: number;
|
|
162
145
|
};
|
|
163
146
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/pug-parser",
|
|
3
|
-
"version": "2.0.0",
|
|
3
|
+
"version": "2.0.1-dev.20220307.0",
|
|
4
4
|
"description": "Pug parser for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"clean": "tsc --build --clean"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@markuplint/html-parser": "2.0.0",
|
|
20
|
-
"@markuplint/ml-ast": "2.0.0",
|
|
21
|
-
"@markuplint/parser-utils": "2.0.0",
|
|
19
|
+
"@markuplint/html-parser": "2.0.1-dev.20220307.0",
|
|
20
|
+
"@markuplint/ml-ast": "2.0.1-dev.20220307.0",
|
|
21
|
+
"@markuplint/parser-utils": "2.0.1-dev.20220307.0",
|
|
22
22
|
"pug-lexer": "^5.0.1",
|
|
23
23
|
"pug-parser": "^6.0.0",
|
|
24
24
|
"tslib": "^2.3.1"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "c0a9d36c32ae278bd2fdb9ec9434fd4af46918c3"
|
|
27
27
|
}
|