@akemona-org/strapi-plugin-content-manager 3.7.0 → 3.7.2
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/admin/src/InjectedComponents/ContentTypeBuilder/ConfigureViewButton/index.js +2 -5
- package/admin/src/components/AddDropdown/index.js +5 -12
- package/admin/src/components/Block/index.js +2 -4
- package/admin/src/components/ComponentInitializer/index.js +1 -1
- package/admin/src/components/CustomTable/ActionCollapse/index.js +2 -2
- package/admin/src/components/CustomTable/Row/Cell.js +1 -1
- package/admin/src/components/CustomTable/Row/index.js +6 -6
- package/admin/src/components/CustomTable/index.js +5 -5
- package/admin/src/components/CustomTable/styledComponents.js +2 -2
- package/admin/src/components/DragLayer/index.js +1 -1
- package/admin/src/components/DraggedField/Wrapper.js +2 -7
- package/admin/src/components/DraggedField/index.js +3 -3
- package/admin/src/components/DraggedField/utils/getHeight.js +1 -1
- package/admin/src/components/DraggedFieldWithPreview/DynamicComponent.js +2 -2
- package/admin/src/components/DraggedFieldWithPreview/Wrapper.js +1 -2
- package/admin/src/components/DraggedFieldWithPreview/index.js +4 -4
- package/admin/src/components/DynamicComponentCard/index.js +2 -8
- package/admin/src/components/DynamicZone/Picker/index.js +3 -3
- package/admin/src/components/DynamicZone/index.js +4 -4
- package/admin/src/components/DynamicZone/utils/select.js +1 -1
- package/admin/src/components/FieldComponent/index.js +1 -1
- package/admin/src/components/FieldComponent/utils/select.js +6 -6
- package/admin/src/components/FieldsReorder/Item.js +6 -9
- package/admin/src/components/FieldsReorder/index.js +6 -17
- package/admin/src/components/FilterOptionsCTA/index.js +1 -1
- package/admin/src/components/FilterPicker/components.js +2 -2
- package/admin/src/components/FilterPicker/index.js +7 -7
- package/admin/src/components/FilterPicker/reducer.js +2 -2
- package/admin/src/components/FilterPickerOption/Input.js +1 -1
- package/admin/src/components/FilterPickerOption/Option.js +1 -3
- package/admin/src/components/FilterPickerOption/components.js +2 -2
- package/admin/src/components/FilterPickerOption/index.js +4 -4
- package/admin/src/components/FormTitle/index.js +1 -5
- package/admin/src/components/InputJSON/index.js +3 -3
- package/admin/src/components/InputJSON/jsonlint.js +639 -383
- package/admin/src/components/InputJSONWithErrors/index.js +2 -2
- package/admin/src/components/InputUID/Options/index.js +2 -2
- package/admin/src/components/InputUID/Options/wrapper.js +1 -1
- package/admin/src/components/InputUID/index.js +2 -2
- package/admin/src/components/Inputs/index.js +4 -4
- package/admin/src/components/Inputs/utils/generateOptions.js +2 -2
- package/admin/src/components/Inputs/utils/getStep.js +1 -1
- package/admin/src/components/MediaPreviewList/index.js +5 -5
- package/admin/src/components/NonRepeatableComponent/index.js +4 -4
- package/admin/src/components/PreviewWysiwyg/Wrapper.js +1 -1
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.js +1 -1
- package/admin/src/components/RelationPreviewList/RelationPreviewTooltip.js +3 -3
- package/admin/src/components/RelationPreviewList/index.js +1 -1
- package/admin/src/components/RepeatableComponent/Banner.js +2 -2
- package/admin/src/components/RepeatableComponent/BannerWrapper.js +1 -2
- package/admin/src/components/RepeatableComponent/DraggedItem/index.js +3 -9
- package/admin/src/components/RepeatableComponent/index.js +8 -8
- package/admin/src/components/RepeatableComponent/reducer.js +9 -9
- package/admin/src/components/Search/index.js +2 -2
- package/admin/src/components/SectionTitle/index.js +1 -3
- package/admin/src/components/SelectMany/ListItem.js +2 -2
- package/admin/src/components/SelectMany/index.js +3 -3
- package/admin/src/components/SelectOne/SingleValue.js +1 -1
- package/admin/src/components/SelectWrapper/ClearIndicator.js +1 -1
- package/admin/src/components/SelectWrapper/Option.js +1 -1
- package/admin/src/components/SelectWrapper/index.js +17 -27
- package/admin/src/components/SelectWrapper/utils/styles.js +6 -6
- package/admin/src/components/SettingsViewWrapper/index.js +9 -9
- package/admin/src/components/SortableList/Item.js +5 -11
- package/admin/src/components/Wysiwyg/MediaLib.js +1 -1
- package/admin/src/components/Wysiwyg/index.js +17 -25
- package/admin/src/components/Wysiwyg/toggleMode.js +3 -7
- package/admin/src/components/Wysiwyg/utils.js +2 -10
- package/admin/src/components/WysiwygDropUpload/index.js +1 -1
- package/admin/src/components/WysiwygInlineControls/Button.js +1 -1
- package/admin/src/components/WysiwygInlineControls/index.js +1 -1
- package/admin/src/components/WysiwygWithErrors/index.js +1 -1
- package/admin/src/containers/CollectionTypeFormWrapper/index.js +7 -12
- package/admin/src/containers/CollectionTypeFormWrapper/utils/getRequestUrl.js +1 -1
- package/admin/src/containers/CollectionTypeRecursivePath/index.js +1 -1
- package/admin/src/containers/ComponentSetttingsView/index.js +2 -2
- package/admin/src/containers/EditSettingsView/index.js +17 -17
- package/admin/src/containers/EditSettingsView/reducer.js +10 -10
- package/admin/src/containers/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +2 -2
- package/admin/src/containers/EditSettingsView/utils/getInputProps.js +1 -1
- package/admin/src/containers/EditSettingsView/utils/layout.js +9 -9
- package/admin/src/containers/EditView/DeleteLink/index.js +1 -1
- package/admin/src/containers/EditView/Header/index.js +10 -9
- package/admin/src/containers/EditView/Header/utils/getDraftRelations.js +3 -3
- package/admin/src/containers/EditView/index.js +7 -10
- package/admin/src/containers/EditView/utils/createAttributesLayout.js +4 -9
- package/admin/src/containers/EditView/utils/getFieldsActionMatchingPermissions.js +1 -1
- package/admin/src/containers/EditViewDataManagerProvider/index.js +7 -12
- package/admin/src/containers/EditViewDataManagerProvider/reducer.js +14 -14
- package/admin/src/containers/EditViewDataManagerProvider/utils/cleanData.js +4 -4
- package/admin/src/containers/EditViewDataManagerProvider/utils/getYupInnerErrors.js +2 -8
- package/admin/src/containers/EditViewDataManagerProvider/utils/schema.js +12 -12
- package/admin/src/containers/EditViewLayoutManager/Permissions.js +1 -1
- package/admin/src/containers/EditViewLayoutManager/reducer.js +1 -1
- package/admin/src/containers/EditViewLayoutManager/selectors.js +1 -1
- package/admin/src/containers/ListSettingsView/Label.js +2 -11
- package/admin/src/containers/ListSettingsView/index.js +9 -9
- package/admin/src/containers/ListSettingsView/reducer.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/Fields/Wrapper.js +1 -1
- package/admin/src/containers/ListView/FieldPicker/Fields/index.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/index.js +2 -2
- package/admin/src/containers/ListView/Filter.js +1 -4
- package/admin/src/containers/ListView/actions.js +2 -2
- package/admin/src/containers/ListView/index.js +8 -7
- package/admin/src/containers/ListView/reducer.js +5 -5
- package/admin/src/containers/ListView/selectors.js +2 -2
- package/admin/src/containers/ListView/utils/createPluginsFilter.js +1 -1
- package/admin/src/containers/ListView/utils/getAllAllowedHeaders.js +1 -1
- package/admin/src/containers/ListView/utils/getFirstSortableHeader.js +2 -2
- package/admin/src/containers/ListViewLayoutManager/Permissions.js +1 -1
- package/admin/src/containers/ListViewProvider/index.js +1 -3
- package/admin/src/containers/Main/index.js +2 -2
- package/admin/src/containers/Main/reducer.js +1 -1
- package/admin/src/containers/Main/selectors.js +2 -2
- package/admin/src/containers/RBACManager/reducer.js +1 -1
- package/admin/src/containers/SingleTypeFormWrapper/index.js +6 -11
- package/admin/src/containers/SingleTypeFormWrapper/utils/getRequestUrl.js +1 -1
- package/admin/src/containers/WysiwygProvider/index.js +1 -3
- package/admin/src/hooks/useContentTypeLayout/index.js +1 -1
- package/admin/src/hooks/useFetchContentTypeLayout/index.js +3 -3
- package/admin/src/hooks/useFetchContentTypeLayout/reducer.js +1 -1
- package/admin/src/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +8 -8
- package/admin/src/hooks/useFindRedirectionLink/index.js +1 -1
- package/admin/src/hooks/useFindRedirectionLink/selectors.js +1 -1
- package/admin/src/icons/Cross/index.js +1 -6
- package/admin/src/icons/Na/index.js +3 -22
- package/admin/src/index.js +1 -1
- package/admin/src/pluginId.js +1 -1
- package/admin/src/selectors.js +2 -2
- package/admin/src/sharedReducers/crudReducer/actions.js +3 -3
- package/admin/src/sharedReducers/crudReducer/reducer.js +1 -1
- package/admin/src/sharedReducers/crudReducer/selectors.js +1 -1
- package/admin/src/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/utils/formatFiltersFromQuery.js +2 -2
- package/admin/src/utils/formatLayoutToApi.js +2 -2
- package/admin/src/utils/generatePermissionsObject.js +3 -2
- package/admin/src/utils/getComponents.js +3 -5
- package/admin/src/utils/getFieldName.js +2 -2
- package/admin/src/utils/getMaxTempKey.js +2 -2
- package/admin/src/utils/getRequestUrl.js +1 -1
- package/admin/src/utils/getTrad.js +1 -1
- package/admin/src/utils/mergeMetasWithSchema.js +2 -2
- package/admin/src/utils/removeKeyInObject.js +1 -1
- package/admin/src/utils/removePasswordFieldsFromData.js +2 -2
- package/controllers/content-types.js +4 -4
- package/package.json +4 -4
- package/services/components.js +1 -1
- package/services/configuration.js +9 -9
- package/services/permission-checker.js +6 -6
- package/services/uid.js +1 -1
- package/services/utils/configuration/layouts.js +14 -35
- package/services/utils/configuration/metadatas.js +1 -1
- package/services/utils/store.js +9 -9
- package/utils/index.js +1 -1
- package/utils/wrap-bad-request.js +14 -12
|
@@ -1,424 +1,680 @@
|
|
|
1
1
|
/* Jison generated parser */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
var jsonlint = (function(){
|
|
4
|
-
var parser = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
3
|
+
var jsonlint = (function () {
|
|
4
|
+
var parser = {
|
|
5
|
+
trace: function trace() {},
|
|
6
|
+
yy: {},
|
|
7
|
+
symbols_: {
|
|
8
|
+
error: 2,
|
|
9
|
+
JSONString: 3,
|
|
10
|
+
STRING: 4,
|
|
11
|
+
JSONNumber: 5,
|
|
12
|
+
NUMBER: 6,
|
|
13
|
+
JSONNullLiteral: 7,
|
|
14
|
+
NULL: 8,
|
|
15
|
+
JSONBooleanLiteral: 9,
|
|
16
|
+
TRUE: 10,
|
|
17
|
+
FALSE: 11,
|
|
18
|
+
JSONText: 12,
|
|
19
|
+
JSONValue: 13,
|
|
20
|
+
EOF: 14,
|
|
21
|
+
JSONObject: 15,
|
|
22
|
+
JSONArray: 16,
|
|
23
|
+
'{': 17,
|
|
24
|
+
'}': 18,
|
|
25
|
+
JSONMemberList: 19,
|
|
26
|
+
JSONMember: 20,
|
|
27
|
+
':': 21,
|
|
28
|
+
',': 22,
|
|
29
|
+
'[': 23,
|
|
30
|
+
']': 24,
|
|
31
|
+
JSONElementList: 25,
|
|
32
|
+
$accept: 0,
|
|
33
|
+
$end: 1,
|
|
34
|
+
},
|
|
35
|
+
terminals_: {
|
|
36
|
+
2: 'error',
|
|
37
|
+
4: 'STRING',
|
|
38
|
+
6: 'NUMBER',
|
|
39
|
+
8: 'NULL',
|
|
40
|
+
10: 'TRUE',
|
|
41
|
+
11: 'FALSE',
|
|
42
|
+
14: 'EOF',
|
|
43
|
+
17: '{',
|
|
44
|
+
18: '}',
|
|
45
|
+
21: ':',
|
|
46
|
+
22: ',',
|
|
47
|
+
23: '[',
|
|
48
|
+
24: ']',
|
|
49
|
+
},
|
|
50
|
+
productions_: [
|
|
51
|
+
0,
|
|
52
|
+
[3, 1],
|
|
53
|
+
[5, 1],
|
|
54
|
+
[7, 1],
|
|
55
|
+
[9, 1],
|
|
56
|
+
[9, 1],
|
|
57
|
+
[12, 2],
|
|
58
|
+
[13, 1],
|
|
59
|
+
[13, 1],
|
|
60
|
+
[13, 1],
|
|
61
|
+
[13, 1],
|
|
62
|
+
[13, 1],
|
|
63
|
+
[13, 1],
|
|
64
|
+
[15, 2],
|
|
65
|
+
[15, 3],
|
|
66
|
+
[20, 3],
|
|
67
|
+
[19, 1],
|
|
68
|
+
[19, 3],
|
|
69
|
+
[16, 2],
|
|
70
|
+
[16, 3],
|
|
71
|
+
[25, 1],
|
|
72
|
+
[25, 3],
|
|
73
|
+
],
|
|
74
|
+
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
|
|
75
|
+
var $0 = $$.length - 1;
|
|
76
|
+
switch (yystate) {
|
|
77
|
+
case 1: // replace escaped characters with actual character
|
|
78
|
+
this.$ = yytext
|
|
79
|
+
.replace(/\\(\\|")/g, '$' + '1')
|
|
80
|
+
.replace(/\\n/g, '\n')
|
|
81
|
+
.replace(/\\r/g, '\r')
|
|
82
|
+
.replace(/\\t/g, '\t')
|
|
83
|
+
.replace(/\\v/g, '\v')
|
|
84
|
+
.replace(/\\f/g, '\f')
|
|
85
|
+
.replace(/\\b/g, '\b');
|
|
86
|
+
|
|
87
|
+
break;
|
|
88
|
+
case 2:
|
|
89
|
+
this.$ = Number(yytext);
|
|
90
|
+
break;
|
|
91
|
+
case 3:
|
|
92
|
+
this.$ = null;
|
|
93
|
+
break;
|
|
94
|
+
case 4:
|
|
95
|
+
this.$ = true;
|
|
96
|
+
break;
|
|
97
|
+
case 5:
|
|
98
|
+
this.$ = false;
|
|
99
|
+
break;
|
|
100
|
+
case 6:
|
|
101
|
+
return (this.$ = $$[$0 - 1]);
|
|
102
|
+
break;
|
|
103
|
+
case 13:
|
|
104
|
+
this.$ = {};
|
|
105
|
+
break;
|
|
106
|
+
case 14:
|
|
107
|
+
this.$ = $$[$0 - 1];
|
|
108
|
+
break;
|
|
109
|
+
case 15:
|
|
110
|
+
this.$ = [$$[$0 - 2], $$[$0]];
|
|
111
|
+
break;
|
|
112
|
+
case 16:
|
|
113
|
+
this.$ = {};
|
|
114
|
+
this.$[$$[$0][0]] = $$[$0][1];
|
|
115
|
+
break;
|
|
116
|
+
case 17:
|
|
117
|
+
this.$ = $$[$0 - 2];
|
|
118
|
+
$$[$0 - 2][$$[$0][0]] = $$[$0][1];
|
|
119
|
+
break;
|
|
120
|
+
case 18:
|
|
121
|
+
this.$ = [];
|
|
122
|
+
break;
|
|
123
|
+
case 19:
|
|
124
|
+
this.$ = $$[$0 - 1];
|
|
125
|
+
break;
|
|
126
|
+
case 20:
|
|
127
|
+
this.$ = [$$[$0]];
|
|
128
|
+
break;
|
|
129
|
+
case 21:
|
|
130
|
+
this.$ = $$[$0 - 2];
|
|
131
|
+
$$[$0 - 2].push($$[$0]);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
table: [
|
|
136
|
+
{
|
|
137
|
+
3: 5,
|
|
138
|
+
4: [1, 12],
|
|
139
|
+
5: 6,
|
|
140
|
+
6: [1, 13],
|
|
141
|
+
7: 3,
|
|
142
|
+
8: [1, 9],
|
|
143
|
+
9: 4,
|
|
144
|
+
10: [1, 10],
|
|
145
|
+
11: [1, 11],
|
|
146
|
+
12: 1,
|
|
147
|
+
13: 2,
|
|
148
|
+
15: 7,
|
|
149
|
+
16: 8,
|
|
150
|
+
17: [1, 14],
|
|
151
|
+
23: [1, 15],
|
|
152
|
+
},
|
|
153
|
+
{ 1: [3] },
|
|
154
|
+
{ 14: [1, 16] },
|
|
155
|
+
{ 14: [2, 7], 18: [2, 7], 22: [2, 7], 24: [2, 7] },
|
|
156
|
+
{ 14: [2, 8], 18: [2, 8], 22: [2, 8], 24: [2, 8] },
|
|
157
|
+
{ 14: [2, 9], 18: [2, 9], 22: [2, 9], 24: [2, 9] },
|
|
158
|
+
{ 14: [2, 10], 18: [2, 10], 22: [2, 10], 24: [2, 10] },
|
|
159
|
+
{ 14: [2, 11], 18: [2, 11], 22: [2, 11], 24: [2, 11] },
|
|
160
|
+
{ 14: [2, 12], 18: [2, 12], 22: [2, 12], 24: [2, 12] },
|
|
161
|
+
{ 14: [2, 3], 18: [2, 3], 22: [2, 3], 24: [2, 3] },
|
|
162
|
+
{ 14: [2, 4], 18: [2, 4], 22: [2, 4], 24: [2, 4] },
|
|
163
|
+
{ 14: [2, 5], 18: [2, 5], 22: [2, 5], 24: [2, 5] },
|
|
164
|
+
{ 14: [2, 1], 18: [2, 1], 21: [2, 1], 22: [2, 1], 24: [2, 1] },
|
|
165
|
+
{ 14: [2, 2], 18: [2, 2], 22: [2, 2], 24: [2, 2] },
|
|
166
|
+
{ 3: 20, 4: [1, 12], 18: [1, 17], 19: 18, 20: 19 },
|
|
167
|
+
{
|
|
168
|
+
3: 5,
|
|
169
|
+
4: [1, 12],
|
|
170
|
+
5: 6,
|
|
171
|
+
6: [1, 13],
|
|
172
|
+
7: 3,
|
|
173
|
+
8: [1, 9],
|
|
174
|
+
9: 4,
|
|
175
|
+
10: [1, 10],
|
|
176
|
+
11: [1, 11],
|
|
177
|
+
13: 23,
|
|
178
|
+
15: 7,
|
|
179
|
+
16: 8,
|
|
180
|
+
17: [1, 14],
|
|
181
|
+
23: [1, 15],
|
|
182
|
+
24: [1, 21],
|
|
183
|
+
25: 22,
|
|
184
|
+
},
|
|
185
|
+
{ 1: [2, 6] },
|
|
186
|
+
{ 14: [2, 13], 18: [2, 13], 22: [2, 13], 24: [2, 13] },
|
|
187
|
+
{ 18: [1, 24], 22: [1, 25] },
|
|
188
|
+
{ 18: [2, 16], 22: [2, 16] },
|
|
189
|
+
{ 21: [1, 26] },
|
|
190
|
+
{ 14: [2, 18], 18: [2, 18], 22: [2, 18], 24: [2, 18] },
|
|
191
|
+
{ 22: [1, 28], 24: [1, 27] },
|
|
192
|
+
{ 22: [2, 20], 24: [2, 20] },
|
|
193
|
+
{ 14: [2, 14], 18: [2, 14], 22: [2, 14], 24: [2, 14] },
|
|
194
|
+
{ 3: 20, 4: [1, 12], 20: 29 },
|
|
195
|
+
{
|
|
196
|
+
3: 5,
|
|
197
|
+
4: [1, 12],
|
|
198
|
+
5: 6,
|
|
199
|
+
6: [1, 13],
|
|
200
|
+
7: 3,
|
|
201
|
+
8: [1, 9],
|
|
202
|
+
9: 4,
|
|
203
|
+
10: [1, 10],
|
|
204
|
+
11: [1, 11],
|
|
205
|
+
13: 30,
|
|
206
|
+
15: 7,
|
|
207
|
+
16: 8,
|
|
208
|
+
17: [1, 14],
|
|
209
|
+
23: [1, 15],
|
|
210
|
+
},
|
|
211
|
+
{ 14: [2, 19], 18: [2, 19], 22: [2, 19], 24: [2, 19] },
|
|
212
|
+
{
|
|
213
|
+
3: 5,
|
|
214
|
+
4: [1, 12],
|
|
215
|
+
5: 6,
|
|
216
|
+
6: [1, 13],
|
|
217
|
+
7: 3,
|
|
218
|
+
8: [1, 9],
|
|
219
|
+
9: 4,
|
|
220
|
+
10: [1, 10],
|
|
221
|
+
11: [1, 11],
|
|
222
|
+
13: 31,
|
|
223
|
+
15: 7,
|
|
224
|
+
16: 8,
|
|
225
|
+
17: [1, 14],
|
|
226
|
+
23: [1, 15],
|
|
227
|
+
},
|
|
228
|
+
{ 18: [2, 17], 22: [2, 17] },
|
|
229
|
+
{ 18: [2, 15], 22: [2, 15] },
|
|
230
|
+
{ 22: [2, 21], 24: [2, 21] },
|
|
231
|
+
],
|
|
232
|
+
defaultActions: { 16: [2, 6] },
|
|
233
|
+
parseError: function parseError(str, hash) {
|
|
56
234
|
throw new Error(str);
|
|
57
|
-
|
|
58
|
-
|
|
235
|
+
},
|
|
236
|
+
parse: function parse(input) {
|
|
59
237
|
var self = this,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
238
|
+
stack = [0],
|
|
239
|
+
vstack = [null], // semantic value stack
|
|
240
|
+
lstack = [], // location stack
|
|
241
|
+
table = this.table,
|
|
242
|
+
yytext = '',
|
|
243
|
+
yylineno = 0,
|
|
244
|
+
yyleng = 0,
|
|
245
|
+
recovering = 0,
|
|
246
|
+
TERROR = 2,
|
|
247
|
+
EOF = 1;
|
|
248
|
+
|
|
71
249
|
//this.reductionCount = this.shiftCount = 0;
|
|
72
|
-
|
|
250
|
+
|
|
73
251
|
this.lexer.setInput(input);
|
|
74
252
|
this.lexer.yy = this.yy;
|
|
75
253
|
this.yy.lexer = this.lexer;
|
|
76
|
-
if (typeof this.lexer.yylloc == 'undefined')
|
|
77
|
-
this.lexer.yylloc = {};
|
|
254
|
+
if (typeof this.lexer.yylloc == 'undefined') this.lexer.yylloc = {};
|
|
78
255
|
var yyloc = this.lexer.yylloc;
|
|
79
256
|
lstack.push(yyloc);
|
|
80
|
-
|
|
81
|
-
if (typeof this.yy.parseError === 'function')
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
lstack.length = lstack.length - n;
|
|
257
|
+
|
|
258
|
+
if (typeof this.yy.parseError === 'function') this.parseError = this.yy.parseError;
|
|
259
|
+
|
|
260
|
+
function popStack(n) {
|
|
261
|
+
stack.length = stack.length - 2 * n;
|
|
262
|
+
vstack.length = vstack.length - n;
|
|
263
|
+
lstack.length = lstack.length - n;
|
|
88
264
|
}
|
|
89
|
-
|
|
265
|
+
|
|
90
266
|
function lex() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
267
|
+
var token;
|
|
268
|
+
token = self.lexer.lex() || 1; // $end = 1
|
|
269
|
+
// if token isn't its numeric value, convert
|
|
270
|
+
if (typeof token !== 'number') {
|
|
271
|
+
token = self.symbols_[token] || token;
|
|
272
|
+
}
|
|
273
|
+
return token;
|
|
98
274
|
}
|
|
99
|
-
|
|
100
|
-
var symbol,
|
|
275
|
+
|
|
276
|
+
var symbol,
|
|
277
|
+
preErrorSymbol,
|
|
278
|
+
state,
|
|
279
|
+
action,
|
|
280
|
+
a,
|
|
281
|
+
r,
|
|
282
|
+
yyval = {},
|
|
283
|
+
p,
|
|
284
|
+
len,
|
|
285
|
+
newState,
|
|
286
|
+
expected;
|
|
101
287
|
while (true) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
for (p in table[state]) if (this.terminals_[p] && p > 2) {
|
|
123
|
-
expected.push("'"+this.terminals_[p]+"'");
|
|
124
|
-
}
|
|
125
|
-
var errStr = '';
|
|
126
|
-
if (this.lexer.showPosition) {
|
|
127
|
-
errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
|
|
128
|
-
} else {
|
|
129
|
-
errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
|
|
130
|
-
(symbol == 1 /*EOF*/ ? "end of input" :
|
|
131
|
-
("'"+(this.terminals_[symbol] || symbol)+"'"));
|
|
132
|
-
}
|
|
133
|
-
this.parseError(errStr,
|
|
134
|
-
{text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
|
|
288
|
+
// retreive state number from top of stack
|
|
289
|
+
state = stack[stack.length - 1];
|
|
290
|
+
|
|
291
|
+
// use default actions if available
|
|
292
|
+
if (this.defaultActions[state]) {
|
|
293
|
+
action = this.defaultActions[state];
|
|
294
|
+
} else {
|
|
295
|
+
if (symbol == null) symbol = lex();
|
|
296
|
+
// read action for current state and first input
|
|
297
|
+
action = table[state] && table[state][symbol];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// handle parse error
|
|
301
|
+
_handle_error: if (typeof action === 'undefined' || !action.length || !action[0]) {
|
|
302
|
+
if (!recovering) {
|
|
303
|
+
// Report error
|
|
304
|
+
expected = [];
|
|
305
|
+
for (p in table[state])
|
|
306
|
+
if (this.terminals_[p] && p > 2) {
|
|
307
|
+
expected.push("'" + this.terminals_[p] + "'");
|
|
135
308
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
preErrorSymbol = symbol; // save the lookahead token
|
|
165
|
-
symbol = TERROR; // insert generic error symbol as new lookahead
|
|
166
|
-
state = stack[stack.length-1];
|
|
167
|
-
action = table[state] && table[state][TERROR];
|
|
168
|
-
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
|
|
309
|
+
var errStr = '';
|
|
310
|
+
if (this.lexer.showPosition) {
|
|
311
|
+
errStr =
|
|
312
|
+
'Parse error on line ' +
|
|
313
|
+
(yylineno + 1) +
|
|
314
|
+
':\n' +
|
|
315
|
+
this.lexer.showPosition() +
|
|
316
|
+
'\nExpecting ' +
|
|
317
|
+
expected.join(', ') +
|
|
318
|
+
", got '" +
|
|
319
|
+
this.terminals_[symbol] +
|
|
320
|
+
"'";
|
|
321
|
+
} else {
|
|
322
|
+
errStr =
|
|
323
|
+
'Parse error on line ' +
|
|
324
|
+
(yylineno + 1) +
|
|
325
|
+
': Unexpected ' +
|
|
326
|
+
(symbol == 1 /*EOF*/
|
|
327
|
+
? 'end of input'
|
|
328
|
+
: "'" + (this.terminals_[symbol] || symbol) + "'");
|
|
329
|
+
}
|
|
330
|
+
this.parseError(errStr, {
|
|
331
|
+
text: this.lexer.match,
|
|
332
|
+
token: this.terminals_[symbol] || symbol,
|
|
333
|
+
line: this.lexer.yylineno,
|
|
334
|
+
loc: yyloc,
|
|
335
|
+
expected: expected,
|
|
336
|
+
});
|
|
169
337
|
}
|
|
170
|
-
|
|
171
|
-
//
|
|
172
|
-
if (
|
|
173
|
-
|
|
338
|
+
|
|
339
|
+
// just recovered from another error
|
|
340
|
+
if (recovering == 3) {
|
|
341
|
+
if (symbol == EOF) {
|
|
342
|
+
throw new Error(errStr || 'Parsing halted.');
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// discard current lookahead and grab another
|
|
346
|
+
yyleng = this.lexer.yyleng;
|
|
347
|
+
yytext = this.lexer.yytext;
|
|
348
|
+
yylineno = this.lexer.yylineno;
|
|
349
|
+
yyloc = this.lexer.yylloc;
|
|
350
|
+
symbol = lex();
|
|
174
351
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
yyleng = this.lexer.yyleng;
|
|
188
|
-
yytext = this.lexer.yytext;
|
|
189
|
-
yylineno = this.lexer.yylineno;
|
|
190
|
-
yyloc = this.lexer.yylloc;
|
|
191
|
-
if (recovering > 0)
|
|
192
|
-
recovering--;
|
|
193
|
-
} else { // error just occurred, resume old lookahead f/ before error
|
|
194
|
-
symbol = preErrorSymbol;
|
|
195
|
-
preErrorSymbol = null;
|
|
196
|
-
}
|
|
197
|
-
break;
|
|
198
|
-
|
|
199
|
-
case 2: // reduce
|
|
200
|
-
//this.reductionCount++;
|
|
201
|
-
|
|
202
|
-
len = this.productions_[action[1]][1];
|
|
203
|
-
|
|
204
|
-
// perform semantic action
|
|
205
|
-
yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
|
|
206
|
-
// default location, uses first token for firsts, last for lasts
|
|
207
|
-
yyval._$ = {
|
|
208
|
-
first_line: lstack[lstack.length-(len||1)].first_line,
|
|
209
|
-
last_line: lstack[lstack.length-1].last_line,
|
|
210
|
-
first_column: lstack[lstack.length-(len||1)].first_column,
|
|
211
|
-
last_column: lstack[lstack.length-1].last_column
|
|
212
|
-
};
|
|
213
|
-
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
|
|
214
|
-
|
|
215
|
-
if (typeof r !== 'undefined') {
|
|
216
|
-
return r;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// pop off stack
|
|
220
|
-
if (len) {
|
|
221
|
-
stack = stack.slice(0,-1*len*2);
|
|
222
|
-
vstack = vstack.slice(0, -1*len);
|
|
223
|
-
lstack = lstack.slice(0, -1*len);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
|
|
227
|
-
vstack.push(yyval.$);
|
|
228
|
-
lstack.push(yyval._$);
|
|
229
|
-
// goto new state = table[STATE][NONTERMINAL]
|
|
230
|
-
newState = table[stack[stack.length-2]][stack[stack.length-1]];
|
|
231
|
-
stack.push(newState);
|
|
232
|
-
break;
|
|
233
|
-
|
|
234
|
-
case 3: // accept
|
|
235
|
-
return true;
|
|
352
|
+
|
|
353
|
+
// try to recover from error
|
|
354
|
+
while (1) {
|
|
355
|
+
// check for error recovery rule in this state
|
|
356
|
+
if (TERROR.toString() in table[state]) {
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
if (state == 0) {
|
|
360
|
+
throw new Error(errStr || 'Parsing halted.');
|
|
361
|
+
}
|
|
362
|
+
popStack(1);
|
|
363
|
+
state = stack[stack.length - 1];
|
|
236
364
|
}
|
|
237
|
-
|
|
365
|
+
|
|
366
|
+
preErrorSymbol = symbol; // save the lookahead token
|
|
367
|
+
symbol = TERROR; // insert generic error symbol as new lookahead
|
|
368
|
+
state = stack[stack.length - 1];
|
|
369
|
+
action = table[state] && table[state][TERROR];
|
|
370
|
+
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// this shouldn't happen, unless resolve defaults are off
|
|
374
|
+
if (action[0] instanceof Array && action.length > 1) {
|
|
375
|
+
throw new Error(
|
|
376
|
+
'Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
switch (action[0]) {
|
|
381
|
+
case 1: // shift
|
|
382
|
+
//this.shiftCount++;
|
|
383
|
+
|
|
384
|
+
stack.push(symbol);
|
|
385
|
+
vstack.push(this.lexer.yytext);
|
|
386
|
+
lstack.push(this.lexer.yylloc);
|
|
387
|
+
stack.push(action[1]); // push state
|
|
388
|
+
symbol = null;
|
|
389
|
+
if (!preErrorSymbol) {
|
|
390
|
+
// normal execution/no error
|
|
391
|
+
yyleng = this.lexer.yyleng;
|
|
392
|
+
yytext = this.lexer.yytext;
|
|
393
|
+
yylineno = this.lexer.yylineno;
|
|
394
|
+
yyloc = this.lexer.yylloc;
|
|
395
|
+
if (recovering > 0) recovering--;
|
|
396
|
+
} else {
|
|
397
|
+
// error just occurred, resume old lookahead f/ before error
|
|
398
|
+
symbol = preErrorSymbol;
|
|
399
|
+
preErrorSymbol = null;
|
|
400
|
+
}
|
|
401
|
+
break;
|
|
402
|
+
|
|
403
|
+
case 2: // reduce
|
|
404
|
+
//this.reductionCount++;
|
|
405
|
+
|
|
406
|
+
len = this.productions_[action[1]][1];
|
|
407
|
+
|
|
408
|
+
// perform semantic action
|
|
409
|
+
yyval.$ = vstack[vstack.length - len]; // default to $$ = $1
|
|
410
|
+
// default location, uses first token for firsts, last for lasts
|
|
411
|
+
yyval._$ = {
|
|
412
|
+
first_line: lstack[lstack.length - (len || 1)].first_line,
|
|
413
|
+
last_line: lstack[lstack.length - 1].last_line,
|
|
414
|
+
first_column: lstack[lstack.length - (len || 1)].first_column,
|
|
415
|
+
last_column: lstack[lstack.length - 1].last_column,
|
|
416
|
+
};
|
|
417
|
+
r = this.performAction.call(
|
|
418
|
+
yyval,
|
|
419
|
+
yytext,
|
|
420
|
+
yyleng,
|
|
421
|
+
yylineno,
|
|
422
|
+
this.yy,
|
|
423
|
+
action[1],
|
|
424
|
+
vstack,
|
|
425
|
+
lstack
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
if (typeof r !== 'undefined') {
|
|
429
|
+
return r;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// pop off stack
|
|
433
|
+
if (len) {
|
|
434
|
+
stack = stack.slice(0, -1 * len * 2);
|
|
435
|
+
vstack = vstack.slice(0, -1 * len);
|
|
436
|
+
lstack = lstack.slice(0, -1 * len);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
|
|
440
|
+
vstack.push(yyval.$);
|
|
441
|
+
lstack.push(yyval._$);
|
|
442
|
+
// goto new state = table[STATE][NONTERMINAL]
|
|
443
|
+
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
|
444
|
+
stack.push(newState);
|
|
445
|
+
break;
|
|
446
|
+
|
|
447
|
+
case 3: // accept
|
|
448
|
+
return true;
|
|
449
|
+
}
|
|
238
450
|
}
|
|
239
|
-
|
|
451
|
+
|
|
240
452
|
return true;
|
|
241
|
-
|
|
453
|
+
},
|
|
454
|
+
};
|
|
242
455
|
/* Jison generated lexer */
|
|
243
|
-
var lexer = (function(){
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
456
|
+
var lexer = (function () {
|
|
457
|
+
var lexer = {
|
|
458
|
+
EOF: 1,
|
|
459
|
+
parseError: function parseError(str, hash) {
|
|
460
|
+
if (this.yy.parseError) {
|
|
461
|
+
this.yy.parseError(str, hash);
|
|
462
|
+
} else {
|
|
463
|
+
throw new Error(str);
|
|
464
|
+
}
|
|
251
465
|
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
466
|
+
setInput: function (input) {
|
|
467
|
+
this._input = input;
|
|
468
|
+
this._more = this._less = this.done = false;
|
|
469
|
+
this.yylineno = this.yyleng = 0;
|
|
470
|
+
this.yytext = this.matched = this.match = '';
|
|
471
|
+
this.conditionStack = ['INITIAL'];
|
|
472
|
+
this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
|
|
473
|
+
return this;
|
|
260
474
|
},
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
475
|
+
input: function () {
|
|
476
|
+
var ch = this._input[0];
|
|
477
|
+
this.yytext += ch;
|
|
478
|
+
this.yyleng++;
|
|
479
|
+
this.match += ch;
|
|
480
|
+
this.matched += ch;
|
|
481
|
+
var lines = ch.match(/\n/);
|
|
482
|
+
if (lines) this.yylineno++;
|
|
483
|
+
this._input = this._input.slice(1);
|
|
484
|
+
return ch;
|
|
271
485
|
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
486
|
+
unput: function (ch) {
|
|
487
|
+
this._input = ch + this._input;
|
|
488
|
+
return this;
|
|
275
489
|
},
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
490
|
+
more: function () {
|
|
491
|
+
this._more = true;
|
|
492
|
+
return this;
|
|
279
493
|
},
|
|
280
|
-
|
|
281
|
-
|
|
494
|
+
less: function (n) {
|
|
495
|
+
this._input = this.match.slice(n) + this._input;
|
|
282
496
|
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
497
|
+
pastInput: function () {
|
|
498
|
+
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
|
499
|
+
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '');
|
|
286
500
|
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
501
|
+
upcomingInput: function () {
|
|
502
|
+
var next = this.match;
|
|
503
|
+
if (next.length < 20) {
|
|
504
|
+
next += this._input.substr(0, 20 - next.length);
|
|
505
|
+
}
|
|
506
|
+
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '');
|
|
293
507
|
},
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
508
|
+
showPosition: function () {
|
|
509
|
+
var pre = this.pastInput();
|
|
510
|
+
var c = new Array(pre.length + 1).join('-');
|
|
511
|
+
return pre + this.upcomingInput() + '\n' + c + '^';
|
|
298
512
|
},
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
tempMatch = this._input.match(this.rules[rules[i]]);
|
|
318
|
-
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
|
319
|
-
match = tempMatch;
|
|
320
|
-
index = i;
|
|
321
|
-
if (!this.options.flex) break;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
if (match) {
|
|
325
|
-
lines = match[0].match(/\n.*/g);
|
|
326
|
-
if (lines) this.yylineno += lines.length;
|
|
327
|
-
this.yylloc = {first_line: this.yylloc.last_line,
|
|
328
|
-
last_line: this.yylineno+1,
|
|
329
|
-
first_column: this.yylloc.last_column,
|
|
330
|
-
last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
|
|
331
|
-
this.yytext += match[0];
|
|
332
|
-
this.match += match[0];
|
|
333
|
-
this.yyleng = this.yytext.length;
|
|
334
|
-
this._more = false;
|
|
335
|
-
this._input = this._input.slice(match[0].length);
|
|
336
|
-
this.matched += match[0];
|
|
337
|
-
token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
|
|
338
|
-
if (this.done && this._input) this.done = false;
|
|
339
|
-
if (token) return token;
|
|
340
|
-
else return;
|
|
341
|
-
}
|
|
342
|
-
if (this._input === "") {
|
|
343
|
-
return this.EOF;
|
|
344
|
-
} else {
|
|
345
|
-
this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
|
|
346
|
-
{text: "", token: null, line: this.yylineno});
|
|
513
|
+
next: function () {
|
|
514
|
+
if (this.done) {
|
|
515
|
+
return this.EOF;
|
|
516
|
+
}
|
|
517
|
+
if (!this._input) this.done = true;
|
|
518
|
+
|
|
519
|
+
var token, match, tempMatch, index, col, lines;
|
|
520
|
+
if (!this._more) {
|
|
521
|
+
this.yytext = '';
|
|
522
|
+
this.match = '';
|
|
523
|
+
}
|
|
524
|
+
var rules = this._currentRules();
|
|
525
|
+
for (var i = 0; i < rules.length; i++) {
|
|
526
|
+
tempMatch = this._input.match(this.rules[rules[i]]);
|
|
527
|
+
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
|
528
|
+
match = tempMatch;
|
|
529
|
+
index = i;
|
|
530
|
+
if (!this.options.flex) break;
|
|
347
531
|
}
|
|
532
|
+
}
|
|
533
|
+
if (match) {
|
|
534
|
+
lines = match[0].match(/\n.*/g);
|
|
535
|
+
if (lines) this.yylineno += lines.length;
|
|
536
|
+
this.yylloc = {
|
|
537
|
+
first_line: this.yylloc.last_line,
|
|
538
|
+
last_line: this.yylineno + 1,
|
|
539
|
+
first_column: this.yylloc.last_column,
|
|
540
|
+
last_column: lines
|
|
541
|
+
? lines[lines.length - 1].length - 1
|
|
542
|
+
: this.yylloc.last_column + match[0].length,
|
|
543
|
+
};
|
|
544
|
+
this.yytext += match[0];
|
|
545
|
+
this.match += match[0];
|
|
546
|
+
this.yyleng = this.yytext.length;
|
|
547
|
+
this._more = false;
|
|
548
|
+
this._input = this._input.slice(match[0].length);
|
|
549
|
+
this.matched += match[0];
|
|
550
|
+
token = this.performAction.call(
|
|
551
|
+
this,
|
|
552
|
+
this.yy,
|
|
553
|
+
this,
|
|
554
|
+
rules[index],
|
|
555
|
+
this.conditionStack[this.conditionStack.length - 1]
|
|
556
|
+
);
|
|
557
|
+
if (this.done && this._input) this.done = false;
|
|
558
|
+
if (token) return token;
|
|
559
|
+
else return;
|
|
560
|
+
}
|
|
561
|
+
if (this._input === '') {
|
|
562
|
+
return this.EOF;
|
|
563
|
+
} else {
|
|
564
|
+
this.parseError(
|
|
565
|
+
'Lexical error on line ' +
|
|
566
|
+
(this.yylineno + 1) +
|
|
567
|
+
'. Unrecognized text.\n' +
|
|
568
|
+
this.showPosition(),
|
|
569
|
+
{ text: '', token: null, line: this.yylineno }
|
|
570
|
+
);
|
|
571
|
+
}
|
|
348
572
|
},
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
573
|
+
lex: function lex() {
|
|
574
|
+
var r = this.next();
|
|
575
|
+
if (typeof r !== 'undefined') {
|
|
576
|
+
return r;
|
|
577
|
+
} else {
|
|
578
|
+
return this.lex();
|
|
579
|
+
}
|
|
356
580
|
},
|
|
357
|
-
|
|
358
|
-
|
|
581
|
+
begin: function begin(condition) {
|
|
582
|
+
this.conditionStack.push(condition);
|
|
359
583
|
},
|
|
360
|
-
|
|
361
|
-
|
|
584
|
+
popState: function popState() {
|
|
585
|
+
return this.conditionStack.pop();
|
|
362
586
|
},
|
|
363
|
-
|
|
364
|
-
|
|
587
|
+
_currentRules: function _currentRules() {
|
|
588
|
+
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
|
365
589
|
},
|
|
366
|
-
|
|
367
|
-
|
|
590
|
+
topState: function () {
|
|
591
|
+
return this.conditionStack[this.conditionStack.length - 2];
|
|
368
592
|
},
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
593
|
+
pushState: function begin(condition) {
|
|
594
|
+
this.begin(condition);
|
|
595
|
+
},
|
|
596
|
+
};
|
|
597
|
+
lexer.options = {};
|
|
598
|
+
lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
|
599
|
+
var YYSTATE = YY_START;
|
|
600
|
+
switch ($avoiding_name_collisions) {
|
|
601
|
+
case 0 /* skip whitespace */:
|
|
602
|
+
break;
|
|
603
|
+
case 1:
|
|
604
|
+
return 6;
|
|
605
|
+
break;
|
|
606
|
+
case 2:
|
|
607
|
+
yy_.yytext = yy_.yytext.substr(1, yy_.yyleng - 2);
|
|
608
|
+
return 4;
|
|
609
|
+
break;
|
|
610
|
+
case 3:
|
|
611
|
+
return 17;
|
|
612
|
+
break;
|
|
613
|
+
case 4:
|
|
614
|
+
return 18;
|
|
615
|
+
break;
|
|
616
|
+
case 5:
|
|
617
|
+
return 23;
|
|
618
|
+
break;
|
|
619
|
+
case 6:
|
|
620
|
+
return 24;
|
|
621
|
+
break;
|
|
622
|
+
case 7:
|
|
623
|
+
return 22;
|
|
624
|
+
break;
|
|
625
|
+
case 8:
|
|
626
|
+
return 21;
|
|
627
|
+
break;
|
|
628
|
+
case 9:
|
|
629
|
+
return 10;
|
|
630
|
+
break;
|
|
631
|
+
case 10:
|
|
632
|
+
return 11;
|
|
633
|
+
break;
|
|
634
|
+
case 11:
|
|
635
|
+
return 8;
|
|
636
|
+
break;
|
|
637
|
+
case 12:
|
|
638
|
+
return 14;
|
|
639
|
+
break;
|
|
640
|
+
case 13:
|
|
641
|
+
return 'INVALID';
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
lexer.rules = [
|
|
646
|
+
/^(?:\s+)/,
|
|
647
|
+
/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,
|
|
648
|
+
/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,
|
|
649
|
+
/^(?:\{)/,
|
|
650
|
+
/^(?:\})/,
|
|
651
|
+
/^(?:\[)/,
|
|
652
|
+
/^(?:\])/,
|
|
653
|
+
/^(?:,)/,
|
|
654
|
+
/^(?::)/,
|
|
655
|
+
/^(?:true\b)/,
|
|
656
|
+
/^(?:false\b)/,
|
|
657
|
+
/^(?:null\b)/,
|
|
658
|
+
/^(?:$)/,
|
|
659
|
+
/^(?:.)/,
|
|
660
|
+
];
|
|
661
|
+
lexer.conditions = {
|
|
662
|
+
INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], inclusive: true },
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
return lexer;
|
|
666
|
+
})();
|
|
413
667
|
parser.lexer = lexer;
|
|
414
668
|
return parser;
|
|
415
|
-
|
|
416
|
-
|
|
669
|
+
})();
|
|
670
|
+
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
|
|
417
671
|
exports.parser = jsonlint;
|
|
418
|
-
exports.parse = function () {
|
|
672
|
+
exports.parse = function () {
|
|
673
|
+
return jsonlint.parse.apply(jsonlint, arguments);
|
|
674
|
+
};
|
|
419
675
|
exports.main = function commonjsMain(args) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
}
|
|
676
|
+
if (!args[1]) {
|
|
677
|
+
throw new Error('Usage: ' + args[0] + ' FILE');
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
}
|