@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 CHANGED
@@ -1,2 +1,2 @@
1
1
  export { parse } from './parse';
2
- export declare const endTag = 'never';
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
- | ASTTagNode
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
- block: ASTBlock;
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
- raw: string;
39
- offset: number;
40
- endOffset: number;
41
- endLine: number;
42
- endColumn: number;
21
+ raw: string;
22
+ offset: number;
23
+ endOffset: number;
24
+ endLine: number;
25
+ endColumn: number;
43
26
  };
44
27
  interface PugAST<N> {
45
- type: 'Block';
46
- nodes: N[];
47
- line: number;
28
+ type: 'Block';
29
+ nodes: N[];
30
+ line: number;
48
31
  }
49
32
  declare type PugASTTagNode<A, B> = {
50
- type: 'Tag';
51
- name: string;
52
- selfClosing: boolean;
53
- attrs: A[];
54
- attributeBlocks: never[];
55
- isInline: boolean;
56
- line: number;
57
- column: number;
58
- block: B;
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
- type: 'Text';
62
- val: string;
63
- isHtml?: true;
64
- line: number;
65
- column: number;
44
+ type: 'Text';
45
+ val: string;
46
+ isHtml?: true;
47
+ line: number;
48
+ column: number;
66
49
  };
67
50
  declare type PugASTCodeNode = {
68
- type: 'Code';
69
- val: string;
70
- buffer: boolean;
71
- mustEscape: boolean;
72
- isInline: boolean;
73
- line: number;
74
- column: number;
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
- type: 'Comment';
78
- val: string;
79
- buffer: boolean;
80
- line: number;
81
- column: number;
60
+ type: 'Comment';
61
+ val: string;
62
+ buffer: boolean;
63
+ line: number;
64
+ column: number;
82
65
  };
83
66
  declare type PugASTDoctypeNode = {
84
- type: 'Doctype';
85
- val: string;
86
- line: number;
87
- column: number;
67
+ type: 'Doctype';
68
+ val: string;
69
+ line: number;
70
+ column: number;
88
71
  };
89
72
  declare type PugASTIncludeNode<B> = {
90
- type: 'Include';
91
- file: {
92
- type: 'FileReference';
93
- path: string;
94
- line: number;
95
- column: number;
96
- };
97
- block: B;
98
- line: number;
99
- column: number;
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
- type: 'Each';
103
- obj: string;
104
- val: string;
105
- key: string | null;
106
- block: B;
107
- line: number;
108
- column: number;
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
- type: 'Mixin';
112
- name: string;
113
- args: string;
114
- call: boolean;
115
- block: B | null;
116
- attrs?: A[];
117
- attributeBlocks: never[];
118
- line: number;
119
- column: number;
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
- type: 'MixinBlock';
123
- line: number;
124
- column: number;
105
+ type: 'MixinBlock';
106
+ line: number;
107
+ column: number;
125
108
  };
126
109
  declare type PugASTFilterNode<A, B> = {
127
- type: 'Filter';
128
- name: string;
129
- block: B;
130
- attrs: A[];
131
- line: number;
132
- column: number;
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
- type: 'Conditional';
136
- test: string;
137
- consequent: B;
138
- alternate?: B | PugASTConditionalNode<B>;
139
- line: number;
140
- column: number;
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
- type: 'Case';
144
- expr: string;
145
- block: B;
146
- line: number;
147
- column: number;
126
+ type: 'Case';
127
+ expr: string;
128
+ block: B;
129
+ line: number;
130
+ column: number;
148
131
  };
149
132
  declare type PugASTCaseWhenNode<B> = {
150
- type: 'When';
151
- expr: string;
152
- block: B;
153
- line: number;
154
- column: number;
133
+ type: 'When';
134
+ expr: string;
135
+ block: B;
136
+ line: number;
137
+ column: number;
155
138
  };
156
139
  declare type PugASTAttr = {
157
- name: string;
158
- val: string | true;
159
- mustEscape: boolean;
160
- line: number;
161
- column: number;
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": "de81fc514acdf472f87184e3499e9364258f9b66"
26
+ "gitHead": "c0a9d36c32ae278bd2fdb9ec9434fd4af46918c3"
27
27
  }