xslt-processor 3.0.1 → 3.1.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.
Files changed (226) hide show
  1. package/constants.d.ts +12 -12
  2. package/constants.js +16 -16
  3. package/dom/functions.d.ts +14 -14
  4. package/dom/functions.js +56 -57
  5. package/dom/functions.js.map +1 -1
  6. package/dom/index.d.ts +6 -6
  7. package/dom/index.js +22 -22
  8. package/dom/util.d.ts +7 -7
  9. package/dom/util.js +42 -43
  10. package/dom/util.js.map +1 -1
  11. package/dom/xdocument.d.ts +16 -16
  12. package/dom/xdocument.js +73 -74
  13. package/dom/xdocument.js.map +1 -1
  14. package/dom/xml-functions.d.ts +58 -58
  15. package/dom/xml-functions.js +369 -370
  16. package/dom/xml-functions.js.map +1 -1
  17. package/dom/xml-output-options.d.ts +6 -6
  18. package/dom/xml-output-options.js +2 -2
  19. package/dom/xml-parser.d.ts +47 -47
  20. package/dom/xml-parser.js +307 -307
  21. package/dom/xml-parser.js.map +1 -1
  22. package/dom/xmltoken.d.ts +12 -12
  23. package/dom/xmltoken.js +101 -101
  24. package/dom/xnode.d.ts +73 -73
  25. package/dom/xnode.js +450 -450
  26. package/dom/xnode.js.map +1 -1
  27. package/index.d.ts +4 -4
  28. package/index.js +12 -12
  29. package/package.json +7 -7
  30. package/test-without-jest.d.ts +1 -0
  31. package/test-without-jest.js +63 -0
  32. package/test-without-jest.js.map +1 -0
  33. package/umd/constants.d.ts +12 -12
  34. package/umd/dom/functions.d.ts +14 -14
  35. package/umd/dom/index.d.ts +6 -6
  36. package/umd/dom/util.d.ts +7 -7
  37. package/umd/dom/xdocument.d.ts +16 -16
  38. package/umd/dom/xml-functions.d.ts +58 -58
  39. package/umd/dom/xml-output-options.d.ts +6 -6
  40. package/umd/dom/xml-parser.d.ts +47 -47
  41. package/umd/dom/xmltoken.d.ts +12 -12
  42. package/umd/dom/xnode.d.ts +73 -73
  43. package/umd/index.d.ts +4 -4
  44. package/umd/test-without-jest.d.ts +1 -0
  45. package/umd/xpath/common-function.d.ts +8 -8
  46. package/umd/xpath/expr-context.d.ts +116 -111
  47. package/umd/xpath/expressions/binary-expr.d.ts +11 -11
  48. package/umd/xpath/expressions/expression.d.ts +4 -4
  49. package/umd/xpath/expressions/filter-expr.d.ts +9 -9
  50. package/umd/xpath/expressions/function-call-expr.d.ts +12 -12
  51. package/umd/xpath/expressions/index.d.ts +13 -13
  52. package/umd/xpath/expressions/literal-expr.d.ts +7 -7
  53. package/umd/xpath/expressions/location-expr.d.ts +15 -15
  54. package/umd/xpath/expressions/number-expr.d.ts +7 -7
  55. package/umd/xpath/expressions/path-expr.d.ts +9 -9
  56. package/umd/xpath/expressions/predicate-expr.d.ts +8 -8
  57. package/umd/xpath/expressions/step-expr.d.ts +25 -25
  58. package/umd/xpath/expressions/token-expr.d.ts +7 -7
  59. package/umd/xpath/expressions/unary-minus-expr.d.ts +8 -8
  60. package/umd/xpath/expressions/union-expr.d.ts +9 -9
  61. package/umd/xpath/expressions/variable-expr.d.ts +7 -7
  62. package/umd/xpath/functions/index.d.ts +4 -2
  63. package/umd/xpath/functions/internal-functions.d.ts +2 -2
  64. package/umd/xpath/functions/non-standard.d.ts +12 -12
  65. package/umd/xpath/functions/standard-20.d.ts +5 -5
  66. package/umd/xpath/functions/standard.d.ts +40 -40
  67. package/umd/xpath/functions/xslt-specific.d.ts +3 -0
  68. package/umd/xpath/grammar-rule-candidate.d.ts +8 -8
  69. package/umd/xpath/index.d.ts +3 -3
  70. package/umd/xpath/match-resolver.d.ts +55 -55
  71. package/umd/xpath/node-tests/index.d.ts +8 -8
  72. package/umd/xpath/node-tests/node-test-any.d.ts +6 -6
  73. package/umd/xpath/node-tests/node-test-comment.d.ts +6 -6
  74. package/umd/xpath/node-tests/node-test-element-or-attribute.d.ts +6 -6
  75. package/umd/xpath/node-tests/node-test-name.d.ts +10 -10
  76. package/umd/xpath/node-tests/node-test-nc.d.ts +9 -9
  77. package/umd/xpath/node-tests/node-test-pi.d.ts +8 -8
  78. package/umd/xpath/node-tests/node-test-text.d.ts +6 -6
  79. package/umd/xpath/node-tests/node-test.d.ts +5 -5
  80. package/umd/xpath/tokens.d.ts +62 -62
  81. package/umd/xpath/values/boolean-value.d.ts +11 -11
  82. package/umd/xpath/values/index.d.ts +5 -5
  83. package/umd/xpath/values/node-set-value.d.ts +11 -11
  84. package/umd/xpath/values/node-value.d.ts +7 -7
  85. package/umd/xpath/values/number-value.d.ts +11 -11
  86. package/umd/xpath/values/string-value.d.ts +11 -11
  87. package/umd/xpath/xpath-grammar-rules.d.ts +68 -68
  88. package/umd/xpath/xpath-token-rule.d.ts +7 -7
  89. package/umd/xpath/xpath.d.ts +174 -174
  90. package/umd/xpathdebug.d.ts +2 -2
  91. package/umd/xslt/index.d.ts +3 -3
  92. package/umd/xslt/xslt-decimal-format-settings.d.ts +28 -28
  93. package/umd/xslt/xslt-options.d.ts +7 -7
  94. package/umd/xslt/xslt-parameter.d.ts +5 -5
  95. package/umd/xslt/xslt.d.ts +260 -207
  96. package/umd/xslt-processor.js +1 -15
  97. package/umd/xslt-processor.js.map +1 -1
  98. package/xpath/common-function.d.ts +8 -8
  99. package/xpath/common-function.js +31 -32
  100. package/xpath/common-function.js.map +1 -1
  101. package/xpath/expr-context.d.ts +116 -111
  102. package/xpath/expr-context.js +190 -189
  103. package/xpath/expr-context.js.map +1 -1
  104. package/xpath/expressions/binary-expr.d.ts +11 -11
  105. package/xpath/expressions/binary-expr.js +165 -165
  106. package/xpath/expressions/binary-expr.js.map +1 -1
  107. package/xpath/expressions/expression.d.ts +4 -4
  108. package/xpath/expressions/expression.js +9 -9
  109. package/xpath/expressions/filter-expr.d.ts +9 -9
  110. package/xpath/expressions/filter-expr.js +52 -52
  111. package/xpath/expressions/filter-expr.js.map +1 -1
  112. package/xpath/expressions/function-call-expr.d.ts +12 -12
  113. package/xpath/expressions/function-call-expr.js +96 -95
  114. package/xpath/expressions/function-call-expr.js.map +1 -1
  115. package/xpath/expressions/index.d.ts +13 -13
  116. package/xpath/expressions/index.js +29 -29
  117. package/xpath/expressions/literal-expr.d.ts +7 -7
  118. package/xpath/expressions/literal-expr.js +33 -33
  119. package/xpath/expressions/literal-expr.js.map +1 -1
  120. package/xpath/expressions/location-expr.d.ts +15 -15
  121. package/xpath/expressions/location-expr.js +98 -98
  122. package/xpath/expressions/location-expr.js.map +1 -1
  123. package/xpath/expressions/number-expr.d.ts +7 -7
  124. package/xpath/expressions/number-expr.js +33 -33
  125. package/xpath/expressions/number-expr.js.map +1 -1
  126. package/xpath/expressions/path-expr.d.ts +9 -9
  127. package/xpath/expressions/path-expr.js +51 -51
  128. package/xpath/expressions/path-expr.js.map +1 -1
  129. package/xpath/expressions/predicate-expr.d.ts +8 -8
  130. package/xpath/expressions/predicate-expr.js +40 -40
  131. package/xpath/expressions/predicate-expr.js.map +1 -1
  132. package/xpath/expressions/step-expr.d.ts +25 -25
  133. package/xpath/expressions/step-expr.js +280 -280
  134. package/xpath/expressions/step-expr.js.map +1 -1
  135. package/xpath/expressions/token-expr.d.ts +7 -7
  136. package/xpath/expressions/token-expr.js +33 -33
  137. package/xpath/expressions/token-expr.js.map +1 -1
  138. package/xpath/expressions/unary-minus-expr.d.ts +8 -8
  139. package/xpath/expressions/unary-minus-expr.js +33 -33
  140. package/xpath/expressions/unary-minus-expr.js.map +1 -1
  141. package/xpath/expressions/union-expr.d.ts +9 -9
  142. package/xpath/expressions/union-expr.js +50 -50
  143. package/xpath/expressions/union-expr.js.map +1 -1
  144. package/xpath/expressions/variable-expr.d.ts +7 -7
  145. package/xpath/expressions/variable-expr.js +32 -32
  146. package/xpath/expressions/variable-expr.js.map +1 -1
  147. package/xpath/functions/index.d.ts +4 -2
  148. package/xpath/functions/index.js +20 -18
  149. package/xpath/functions/index.js.map +1 -1
  150. package/xpath/functions/internal-functions.d.ts +2 -2
  151. package/xpath/functions/internal-functions.js +21 -22
  152. package/xpath/functions/internal-functions.js.map +1 -1
  153. package/xpath/functions/non-standard.d.ts +12 -12
  154. package/xpath/functions/non-standard.js +44 -45
  155. package/xpath/functions/non-standard.js.map +1 -1
  156. package/xpath/functions/standard-20.d.ts +5 -5
  157. package/xpath/functions/standard-20.js +25 -26
  158. package/xpath/functions/standard-20.js.map +1 -1
  159. package/xpath/functions/standard.d.ts +40 -40
  160. package/xpath/functions/standard.js +441 -442
  161. package/xpath/functions/standard.js.map +1 -1
  162. package/xpath/functions/xslt-specific.d.ts +3 -0
  163. package/xpath/functions/xslt-specific.js +14 -0
  164. package/xpath/functions/xslt-specific.js.map +1 -0
  165. package/xpath/grammar-rule-candidate.d.ts +8 -8
  166. package/xpath/grammar-rule-candidate.js +2 -2
  167. package/xpath/index.d.ts +3 -3
  168. package/xpath/index.js +19 -19
  169. package/xpath/match-resolver.d.ts +55 -55
  170. package/xpath/match-resolver.js +136 -136
  171. package/xpath/match-resolver.js.map +1 -1
  172. package/xpath/node-tests/index.d.ts +8 -8
  173. package/xpath/node-tests/index.js +17 -17
  174. package/xpath/node-tests/node-test-any.d.ts +6 -6
  175. package/xpath/node-tests/node-test-any.js +14 -14
  176. package/xpath/node-tests/node-test-comment.d.ts +6 -6
  177. package/xpath/node-tests/node-test-comment.js +14 -14
  178. package/xpath/node-tests/node-test-element-or-attribute.d.ts +6 -6
  179. package/xpath/node-tests/node-test-element-or-attribute.js +15 -15
  180. package/xpath/node-tests/node-test-name.d.ts +10 -10
  181. package/xpath/node-tests/node-test-name.js +38 -38
  182. package/xpath/node-tests/node-test-name.js.map +1 -1
  183. package/xpath/node-tests/node-test-nc.d.ts +9 -9
  184. package/xpath/node-tests/node-test-nc.js +16 -16
  185. package/xpath/node-tests/node-test-pi.d.ts +8 -8
  186. package/xpath/node-tests/node-test-pi.js +16 -16
  187. package/xpath/node-tests/node-test-text.d.ts +6 -6
  188. package/xpath/node-tests/node-test-text.js +14 -14
  189. package/xpath/node-tests/node-test.d.ts +5 -5
  190. package/xpath/node-tests/node-test.js +2 -2
  191. package/xpath/tokens.d.ts +62 -62
  192. package/xpath/tokens.js +300 -300
  193. package/xpath/values/boolean-value.d.ts +11 -11
  194. package/xpath/values/boolean-value.js +23 -23
  195. package/xpath/values/index.d.ts +5 -5
  196. package/xpath/values/index.js +46 -46
  197. package/xpath/values/node-set-value.d.ts +11 -11
  198. package/xpath/values/node-set-value.js +27 -27
  199. package/xpath/values/node-set-value.js.map +1 -1
  200. package/xpath/values/node-value.d.ts +7 -7
  201. package/xpath/values/node-value.js +2 -2
  202. package/xpath/values/number-value.d.ts +11 -11
  203. package/xpath/values/number-value.js +23 -23
  204. package/xpath/values/string-value.d.ts +11 -11
  205. package/xpath/values/string-value.js +23 -23
  206. package/xpath/xpath-grammar-rules.d.ts +68 -68
  207. package/xpath/xpath-grammar-rules.js +74 -74
  208. package/xpath/xpath-token-rule.d.ts +7 -7
  209. package/xpath/xpath-token-rule.js +2 -2
  210. package/xpath/xpath.d.ts +174 -174
  211. package/xpath/xpath.js +911 -911
  212. package/xpath/xpath.js.map +1 -1
  213. package/xpathdebug.d.ts +2 -2
  214. package/xpathdebug.js +187 -187
  215. package/xpathdebug.js.map +1 -1
  216. package/xslt/index.d.ts +3 -3
  217. package/xslt/index.js +19 -19
  218. package/xslt/xslt-decimal-format-settings.d.ts +28 -28
  219. package/xslt/xslt-decimal-format-settings.js +2 -2
  220. package/xslt/xslt-options.d.ts +7 -7
  221. package/xslt/xslt-options.js +2 -2
  222. package/xslt/xslt-parameter.d.ts +5 -5
  223. package/xslt/xslt-parameter.js +2 -2
  224. package/xslt/xslt.d.ts +260 -207
  225. package/xslt/xslt.js +1290 -1126
  226. package/xslt/xslt.js.map +1 -1
package/xpath/tokens.js CHANGED
@@ -1,301 +1,301 @@
1
- "use strict";
2
- // The tokens of the language. The label property is just used for
3
- // generating debug output. The prec property is the precedence used
4
- // for shift/reduce resolution. Default precedence is 0 as a lookahead
5
- // token and 2 on the stack. TODO(mesch): this is certainly not
6
- // necessary and too complicated. Simplify this!
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ASSOC_LEFT = exports.Q_ONE_OR_MULTIPLE = exports.Q_ZERO_OR_MULTIPLE = exports.Q_ZERO_OR_ONE = exports.xPathTokenRules = exports.TOK_NODEO = exports.TOK_QNAME = exports.TOK_NUMBER = exports.TOK_LITERALQQ = exports.TOK_LITERALQ = exports.TOK_ASTERISK = exports.TOK_NCNAME = exports.TOK_DOLLAR = exports.TOK_BRACKC = exports.TOK_BRACKO = exports.TOK_MOD = exports.TOK_DIV = exports.TOK_MINUS = exports.TOK_PLUS = exports.TOK_LT = exports.TOK_LE = exports.TOK_GT = exports.TOK_GE = exports.TOK_NEQ = exports.TOK_EQ = exports.TOK_AND = exports.TOK_OR = exports.TOK_COMMA = exports.TOK_AT = exports.TOK_DOT = exports.TOK_DDOT = exports.TOK_PARENC = exports.TOK_PARENO = exports.TOK_AXISNAME = exports.TOK_COLON = exports.TOK_AXIS = exports.TOK_SLASH = exports.TOK_DSLASH = exports.TOK_PIPE = exports.xPathAxis = void 0;
9
- var xmltoken_1 = require("../dom/xmltoken");
10
- // NOTE: tabular formatting is the big exception, but here it should
11
- // be OK.
12
- // The axes of XPath expressions.
13
- exports.xPathAxis = {
14
- ANCESTOR_OR_SELF: 'ancestor-or-self',
15
- ANCESTOR: 'ancestor',
16
- ATTRIBUTE: 'attribute',
17
- CHILD: 'child',
18
- DESCENDANT_OR_SELF: 'descendant-or-self',
19
- DESCENDANT: 'descendant',
20
- FOLLOWING_SIBLING: 'following-sibling',
21
- FOLLOWING: 'following',
22
- NAMESPACE: 'namespace',
23
- PARENT: 'parent',
24
- PRECEDING_SIBLING: 'preceding-sibling',
25
- PRECEDING: 'preceding',
26
- SELF: 'self',
27
- SELF_AND_SIBLINGS: 'self-and-siblings' // Doesn't exist officially.
28
- // It is here for a special case of `<xsl:apply-templates>`.
29
- };
30
- var xpathAxesRe = [
31
- exports.xPathAxis.ANCESTOR_OR_SELF,
32
- exports.xPathAxis.ANCESTOR,
33
- exports.xPathAxis.ATTRIBUTE,
34
- exports.xPathAxis.CHILD,
35
- exports.xPathAxis.DESCENDANT_OR_SELF,
36
- exports.xPathAxis.DESCENDANT,
37
- exports.xPathAxis.FOLLOWING_SIBLING,
38
- exports.xPathAxis.FOLLOWING,
39
- exports.xPathAxis.NAMESPACE,
40
- exports.xPathAxis.PARENT,
41
- exports.xPathAxis.PRECEDING_SIBLING,
42
- exports.xPathAxis.PRECEDING,
43
- exports.xPathAxis.SELF
44
- ].join('(?=::)|') + '(?=::)'; //(viat) bodgy fix because namespace-uri() was getting detected as the namespace axis. maybe less bodgy fix later.
45
- exports.TOK_PIPE = {
46
- label: '|',
47
- prec: 17,
48
- re: new RegExp('^\\|'),
49
- key: undefined
50
- };
51
- exports.TOK_DSLASH = {
52
- label: '//',
53
- prec: 19,
54
- re: new RegExp('^//'),
55
- key: undefined
56
- };
57
- exports.TOK_SLASH = {
58
- label: '/',
59
- prec: 30,
60
- re: new RegExp('^/'),
61
- key: undefined
62
- };
63
- exports.TOK_AXIS = {
64
- label: '::',
65
- prec: 20,
66
- re: new RegExp('^::'),
67
- key: undefined
68
- };
69
- exports.TOK_COLON = {
70
- label: ':',
71
- prec: 1000,
72
- re: new RegExp('^:'),
73
- key: undefined
74
- };
75
- exports.TOK_AXISNAME = {
76
- label: '[axis]',
77
- re: new RegExp("^(".concat(xpathAxesRe, ")")),
78
- key: undefined
79
- };
80
- exports.TOK_PARENO = {
81
- label: '(',
82
- prec: 34,
83
- re: new RegExp('^\\('),
84
- key: undefined
85
- };
86
- exports.TOK_PARENC = {
87
- label: ')',
88
- re: new RegExp('^\\)'),
89
- key: undefined
90
- };
91
- exports.TOK_DDOT = {
92
- label: '..',
93
- prec: 34,
94
- re: new RegExp('^\\.\\.'),
95
- key: undefined
96
- };
97
- exports.TOK_DOT = {
98
- label: '.',
99
- prec: 34,
100
- re: new RegExp('^\\.'),
101
- key: undefined
102
- };
103
- exports.TOK_AT = {
104
- label: '@',
105
- prec: 34,
106
- re: new RegExp('^@'),
107
- key: undefined
108
- };
109
- exports.TOK_COMMA = {
110
- label: ',',
111
- re: new RegExp('^,'),
112
- key: undefined
113
- };
114
- exports.TOK_OR = {
115
- label: 'or',
116
- prec: 10,
117
- re: new RegExp('^or\\b'),
118
- key: undefined
119
- };
120
- exports.TOK_AND = {
121
- label: 'and',
122
- prec: 11,
123
- re: new RegExp('^and\\b'),
124
- key: undefined
125
- };
126
- exports.TOK_EQ = {
127
- label: '=',
128
- prec: 12,
129
- re: new RegExp('^='),
130
- key: undefined
131
- };
132
- exports.TOK_NEQ = {
133
- label: '!=',
134
- prec: 12,
135
- re: new RegExp('^!='),
136
- key: undefined
137
- };
138
- exports.TOK_GE = {
139
- label: '>=',
140
- prec: 13,
141
- re: new RegExp('^>='),
142
- key: undefined
143
- };
144
- exports.TOK_GT = {
145
- label: '>',
146
- prec: 13,
147
- re: new RegExp('^>'),
148
- key: undefined
149
- };
150
- exports.TOK_LE = {
151
- label: '<=',
152
- prec: 13,
153
- re: new RegExp('^<='),
154
- key: undefined
155
- };
156
- exports.TOK_LT = {
157
- label: '<',
158
- prec: 13,
159
- re: new RegExp('^<'),
160
- key: undefined
161
- };
162
- exports.TOK_PLUS = {
163
- label: '+',
164
- prec: 14,
165
- re: new RegExp('^\\+'),
166
- left: true,
167
- key: undefined
168
- };
169
- exports.TOK_MINUS = {
170
- label: '-',
171
- prec: 14,
172
- re: new RegExp('^\\-'),
173
- left: true,
174
- key: undefined
175
- };
176
- exports.TOK_DIV = {
177
- label: 'div',
178
- prec: 15,
179
- re: new RegExp('^div\\b'),
180
- left: true,
181
- key: undefined
182
- };
183
- exports.TOK_MOD = {
184
- label: 'mod',
185
- prec: 15,
186
- re: new RegExp('^mod\\b'),
187
- left: true,
188
- key: undefined
189
- };
190
- exports.TOK_BRACKO = {
191
- label: '[',
192
- prec: 32,
193
- re: new RegExp('^\\['),
194
- key: undefined
195
- };
196
- exports.TOK_BRACKC = {
197
- label: ']',
198
- re: new RegExp('^\\]'),
199
- key: undefined
200
- };
201
- exports.TOK_DOLLAR = {
202
- label: '$',
203
- re: new RegExp('^\\$'),
204
- key: undefined
205
- };
206
- exports.TOK_NCNAME = {
207
- label: '[ncname]',
208
- re: new RegExp("^".concat(xmltoken_1.XML_NC_NAME)),
209
- key: undefined
210
- };
211
- exports.TOK_ASTERISK = {
212
- label: '*',
213
- prec: 15,
214
- re: new RegExp('^\\*'),
215
- left: true,
216
- key: undefined
217
- };
218
- exports.TOK_LITERALQ = {
219
- label: '[litq]',
220
- prec: 20,
221
- re: new RegExp("^'[^\\']*'"),
222
- key: undefined
223
- };
224
- exports.TOK_LITERALQQ = {
225
- label: '[litqq]',
226
- prec: 20,
227
- re: new RegExp('^"[^\\"]*"'),
228
- key: undefined
229
- };
230
- exports.TOK_NUMBER = {
231
- label: '[number]',
232
- prec: 35,
233
- re: new RegExp('^\\d+(\\.\\d*)?'),
234
- key: undefined
235
- };
236
- exports.TOK_QNAME = {
237
- label: '[qname]',
238
- re: new RegExp("^(".concat(xmltoken_1.XML_NC_NAME, ":)?").concat(xmltoken_1.XML_NC_NAME)),
239
- key: undefined
240
- };
241
- exports.TOK_NODEO = {
242
- label: '[nodeTest-start]',
243
- re: new RegExp('^(processing-instruction|comment|text|node)\\('),
244
- key: undefined
245
- };
246
- // The table of the tokens of our grammar, used by the lexer: first
247
- // column the tag, second column a regexp to recognize it in the
248
- // input, third column the precedence of the token, fourth column a
249
- // factory function for the semantic value of the token.
250
- //
251
- // NOTE: order of this list is important, because the first match
252
- // counts. Cf. DDOT and DOT, and AXIS and COLON.
253
- exports.xPathTokenRules = [
254
- exports.TOK_DSLASH,
255
- exports.TOK_SLASH,
256
- exports.TOK_DDOT,
257
- exports.TOK_DOT,
258
- exports.TOK_AXIS,
259
- exports.TOK_COLON,
260
- exports.TOK_AXISNAME,
261
- exports.TOK_NODEO,
262
- exports.TOK_PARENO,
263
- exports.TOK_PARENC,
264
- exports.TOK_BRACKO,
265
- exports.TOK_BRACKC,
266
- exports.TOK_AT,
267
- exports.TOK_COMMA,
268
- exports.TOK_OR,
269
- exports.TOK_AND,
270
- exports.TOK_NEQ,
271
- exports.TOK_EQ,
272
- exports.TOK_GE,
273
- exports.TOK_GT,
274
- exports.TOK_LE,
275
- exports.TOK_LT,
276
- exports.TOK_PLUS,
277
- exports.TOK_MINUS,
278
- exports.TOK_ASTERISK,
279
- exports.TOK_PIPE,
280
- exports.TOK_MOD,
281
- exports.TOK_DIV,
282
- exports.TOK_LITERALQ,
283
- exports.TOK_LITERALQQ,
284
- exports.TOK_NUMBER,
285
- exports.TOK_QNAME,
286
- exports.TOK_NCNAME,
287
- exports.TOK_DOLLAR
288
- ];
289
- // Quantifiers that are used in the productions of the grammar.
290
- exports.Q_ZERO_OR_ONE = {
291
- label: '?'
292
- };
293
- exports.Q_ZERO_OR_MULTIPLE = {
294
- label: '*'
295
- };
296
- exports.Q_ONE_OR_MULTIPLE = {
297
- label: '+'
298
- };
299
- // Tag for left associativity (right assoc is implied by undefined).
300
- exports.ASSOC_LEFT = true;
1
+ "use strict";
2
+ // The tokens of the language. The label property is just used for
3
+ // generating debug output. The prec property is the precedence used
4
+ // for shift/reduce resolution. Default precedence is 0 as a lookahead
5
+ // token and 2 on the stack. TODO(mesch): this is certainly not
6
+ // necessary and too complicated. Simplify this!
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ASSOC_LEFT = exports.Q_ONE_OR_MULTIPLE = exports.Q_ZERO_OR_MULTIPLE = exports.Q_ZERO_OR_ONE = exports.xPathTokenRules = exports.TOK_NODEO = exports.TOK_QNAME = exports.TOK_NUMBER = exports.TOK_LITERALQQ = exports.TOK_LITERALQ = exports.TOK_ASTERISK = exports.TOK_NCNAME = exports.TOK_DOLLAR = exports.TOK_BRACKC = exports.TOK_BRACKO = exports.TOK_MOD = exports.TOK_DIV = exports.TOK_MINUS = exports.TOK_PLUS = exports.TOK_LT = exports.TOK_LE = exports.TOK_GT = exports.TOK_GE = exports.TOK_NEQ = exports.TOK_EQ = exports.TOK_AND = exports.TOK_OR = exports.TOK_COMMA = exports.TOK_AT = exports.TOK_DOT = exports.TOK_DDOT = exports.TOK_PARENC = exports.TOK_PARENO = exports.TOK_AXISNAME = exports.TOK_COLON = exports.TOK_AXIS = exports.TOK_SLASH = exports.TOK_DSLASH = exports.TOK_PIPE = exports.xPathAxis = void 0;
9
+ var xmltoken_1 = require("../dom/xmltoken");
10
+ // NOTE: tabular formatting is the big exception, but here it should
11
+ // be OK.
12
+ // The axes of XPath expressions.
13
+ exports.xPathAxis = {
14
+ ANCESTOR_OR_SELF: 'ancestor-or-self',
15
+ ANCESTOR: 'ancestor',
16
+ ATTRIBUTE: 'attribute',
17
+ CHILD: 'child',
18
+ DESCENDANT_OR_SELF: 'descendant-or-self',
19
+ DESCENDANT: 'descendant',
20
+ FOLLOWING_SIBLING: 'following-sibling',
21
+ FOLLOWING: 'following',
22
+ NAMESPACE: 'namespace',
23
+ PARENT: 'parent',
24
+ PRECEDING_SIBLING: 'preceding-sibling',
25
+ PRECEDING: 'preceding',
26
+ SELF: 'self',
27
+ SELF_AND_SIBLINGS: 'self-and-siblings' // Doesn't exist officially.
28
+ // It is here for a special case of `<xsl:apply-templates>`.
29
+ };
30
+ var xpathAxesRe = [
31
+ exports.xPathAxis.ANCESTOR_OR_SELF,
32
+ exports.xPathAxis.ANCESTOR,
33
+ exports.xPathAxis.ATTRIBUTE,
34
+ exports.xPathAxis.CHILD,
35
+ exports.xPathAxis.DESCENDANT_OR_SELF,
36
+ exports.xPathAxis.DESCENDANT,
37
+ exports.xPathAxis.FOLLOWING_SIBLING,
38
+ exports.xPathAxis.FOLLOWING,
39
+ exports.xPathAxis.NAMESPACE,
40
+ exports.xPathAxis.PARENT,
41
+ exports.xPathAxis.PRECEDING_SIBLING,
42
+ exports.xPathAxis.PRECEDING,
43
+ exports.xPathAxis.SELF
44
+ ].join('(?=::)|') + '(?=::)'; //(viat) bodgy fix because namespace-uri() was getting detected as the namespace axis. maybe less bodgy fix later.
45
+ exports.TOK_PIPE = {
46
+ label: '|',
47
+ prec: 17,
48
+ re: new RegExp('^\\|'),
49
+ key: undefined
50
+ };
51
+ exports.TOK_DSLASH = {
52
+ label: '//',
53
+ prec: 19,
54
+ re: new RegExp('^//'),
55
+ key: undefined
56
+ };
57
+ exports.TOK_SLASH = {
58
+ label: '/',
59
+ prec: 30,
60
+ re: new RegExp('^/'),
61
+ key: undefined
62
+ };
63
+ exports.TOK_AXIS = {
64
+ label: '::',
65
+ prec: 20,
66
+ re: new RegExp('^::'),
67
+ key: undefined
68
+ };
69
+ exports.TOK_COLON = {
70
+ label: ':',
71
+ prec: 1000,
72
+ re: new RegExp('^:'),
73
+ key: undefined
74
+ };
75
+ exports.TOK_AXISNAME = {
76
+ label: '[axis]',
77
+ re: new RegExp("^(".concat(xpathAxesRe, ")")),
78
+ key: undefined
79
+ };
80
+ exports.TOK_PARENO = {
81
+ label: '(',
82
+ prec: 34,
83
+ re: new RegExp('^\\('),
84
+ key: undefined
85
+ };
86
+ exports.TOK_PARENC = {
87
+ label: ')',
88
+ re: new RegExp('^\\)'),
89
+ key: undefined
90
+ };
91
+ exports.TOK_DDOT = {
92
+ label: '..',
93
+ prec: 34,
94
+ re: new RegExp('^\\.\\.'),
95
+ key: undefined
96
+ };
97
+ exports.TOK_DOT = {
98
+ label: '.',
99
+ prec: 34,
100
+ re: new RegExp('^\\.'),
101
+ key: undefined
102
+ };
103
+ exports.TOK_AT = {
104
+ label: '@',
105
+ prec: 34,
106
+ re: new RegExp('^@'),
107
+ key: undefined
108
+ };
109
+ exports.TOK_COMMA = {
110
+ label: ',',
111
+ re: new RegExp('^,'),
112
+ key: undefined
113
+ };
114
+ exports.TOK_OR = {
115
+ label: 'or',
116
+ prec: 10,
117
+ re: new RegExp('^or\\b'),
118
+ key: undefined
119
+ };
120
+ exports.TOK_AND = {
121
+ label: 'and',
122
+ prec: 11,
123
+ re: new RegExp('^and\\b'),
124
+ key: undefined
125
+ };
126
+ exports.TOK_EQ = {
127
+ label: '=',
128
+ prec: 12,
129
+ re: new RegExp('^='),
130
+ key: undefined
131
+ };
132
+ exports.TOK_NEQ = {
133
+ label: '!=',
134
+ prec: 12,
135
+ re: new RegExp('^!='),
136
+ key: undefined
137
+ };
138
+ exports.TOK_GE = {
139
+ label: '>=',
140
+ prec: 13,
141
+ re: new RegExp('^>='),
142
+ key: undefined
143
+ };
144
+ exports.TOK_GT = {
145
+ label: '>',
146
+ prec: 13,
147
+ re: new RegExp('^>'),
148
+ key: undefined
149
+ };
150
+ exports.TOK_LE = {
151
+ label: '<=',
152
+ prec: 13,
153
+ re: new RegExp('^<='),
154
+ key: undefined
155
+ };
156
+ exports.TOK_LT = {
157
+ label: '<',
158
+ prec: 13,
159
+ re: new RegExp('^<'),
160
+ key: undefined
161
+ };
162
+ exports.TOK_PLUS = {
163
+ label: '+',
164
+ prec: 14,
165
+ re: new RegExp('^\\+'),
166
+ left: true,
167
+ key: undefined
168
+ };
169
+ exports.TOK_MINUS = {
170
+ label: '-',
171
+ prec: 14,
172
+ re: new RegExp('^\\-'),
173
+ left: true,
174
+ key: undefined
175
+ };
176
+ exports.TOK_DIV = {
177
+ label: 'div',
178
+ prec: 15,
179
+ re: new RegExp('^div\\b'),
180
+ left: true,
181
+ key: undefined
182
+ };
183
+ exports.TOK_MOD = {
184
+ label: 'mod',
185
+ prec: 15,
186
+ re: new RegExp('^mod\\b'),
187
+ left: true,
188
+ key: undefined
189
+ };
190
+ exports.TOK_BRACKO = {
191
+ label: '[',
192
+ prec: 32,
193
+ re: new RegExp('^\\['),
194
+ key: undefined
195
+ };
196
+ exports.TOK_BRACKC = {
197
+ label: ']',
198
+ re: new RegExp('^\\]'),
199
+ key: undefined
200
+ };
201
+ exports.TOK_DOLLAR = {
202
+ label: '$',
203
+ re: new RegExp('^\\$'),
204
+ key: undefined
205
+ };
206
+ exports.TOK_NCNAME = {
207
+ label: '[ncname]',
208
+ re: new RegExp("^".concat(xmltoken_1.XML_NC_NAME)),
209
+ key: undefined
210
+ };
211
+ exports.TOK_ASTERISK = {
212
+ label: '*',
213
+ prec: 15,
214
+ re: new RegExp('^\\*'),
215
+ left: true,
216
+ key: undefined
217
+ };
218
+ exports.TOK_LITERALQ = {
219
+ label: '[litq]',
220
+ prec: 20,
221
+ re: new RegExp("^'[^\\']*'"),
222
+ key: undefined
223
+ };
224
+ exports.TOK_LITERALQQ = {
225
+ label: '[litqq]',
226
+ prec: 20,
227
+ re: new RegExp('^"[^\\"]*"'),
228
+ key: undefined
229
+ };
230
+ exports.TOK_NUMBER = {
231
+ label: '[number]',
232
+ prec: 35,
233
+ re: new RegExp('^\\d+(\\.\\d*)?'),
234
+ key: undefined
235
+ };
236
+ exports.TOK_QNAME = {
237
+ label: '[qname]',
238
+ re: new RegExp("^(".concat(xmltoken_1.XML_NC_NAME, ":)?").concat(xmltoken_1.XML_NC_NAME)),
239
+ key: undefined
240
+ };
241
+ exports.TOK_NODEO = {
242
+ label: '[nodeTest-start]',
243
+ re: new RegExp('^(processing-instruction|comment|text|node)\\('),
244
+ key: undefined
245
+ };
246
+ // The table of the tokens of our grammar, used by the lexer: first
247
+ // column the tag, second column a regexp to recognize it in the
248
+ // input, third column the precedence of the token, fourth column a
249
+ // factory function for the semantic value of the token.
250
+ //
251
+ // NOTE: order of this list is important, because the first match
252
+ // counts. Cf. DDOT and DOT, and AXIS and COLON.
253
+ exports.xPathTokenRules = [
254
+ exports.TOK_DSLASH,
255
+ exports.TOK_SLASH,
256
+ exports.TOK_DDOT,
257
+ exports.TOK_DOT,
258
+ exports.TOK_AXIS,
259
+ exports.TOK_COLON,
260
+ exports.TOK_AXISNAME,
261
+ exports.TOK_NODEO,
262
+ exports.TOK_PARENO,
263
+ exports.TOK_PARENC,
264
+ exports.TOK_BRACKO,
265
+ exports.TOK_BRACKC,
266
+ exports.TOK_AT,
267
+ exports.TOK_COMMA,
268
+ exports.TOK_OR,
269
+ exports.TOK_AND,
270
+ exports.TOK_NEQ,
271
+ exports.TOK_EQ,
272
+ exports.TOK_GE,
273
+ exports.TOK_GT,
274
+ exports.TOK_LE,
275
+ exports.TOK_LT,
276
+ exports.TOK_PLUS,
277
+ exports.TOK_MINUS,
278
+ exports.TOK_ASTERISK,
279
+ exports.TOK_PIPE,
280
+ exports.TOK_MOD,
281
+ exports.TOK_DIV,
282
+ exports.TOK_LITERALQ,
283
+ exports.TOK_LITERALQQ,
284
+ exports.TOK_NUMBER,
285
+ exports.TOK_QNAME,
286
+ exports.TOK_NCNAME,
287
+ exports.TOK_DOLLAR
288
+ ];
289
+ // Quantifiers that are used in the productions of the grammar.
290
+ exports.Q_ZERO_OR_ONE = {
291
+ label: '?'
292
+ };
293
+ exports.Q_ZERO_OR_MULTIPLE = {
294
+ label: '*'
295
+ };
296
+ exports.Q_ONE_OR_MULTIPLE = {
297
+ label: '+'
298
+ };
299
+ // Tag for left associativity (right assoc is implied by undefined).
300
+ exports.ASSOC_LEFT = true;
301
301
  //# sourceMappingURL=tokens.js.map
@@ -1,11 +1,11 @@
1
- import { XNode } from "../../dom";
2
- import { NodeValue } from "./node-value";
3
- export declare class BooleanValue implements NodeValue {
4
- value: any;
5
- type: string;
6
- constructor(value: any);
7
- stringValue(): string;
8
- booleanValue(): any;
9
- numberValue(): 1 | 0;
10
- nodeSetValue(): XNode[];
11
- }
1
+ import { XNode } from "../../dom";
2
+ import { NodeValue } from "./node-value";
3
+ export declare class BooleanValue implements NodeValue {
4
+ value: any;
5
+ type: string;
6
+ constructor(value: any);
7
+ stringValue(): string;
8
+ booleanValue(): any;
9
+ numberValue(): 1 | 0;
10
+ nodeSetValue(): XNode[];
11
+ }
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BooleanValue = void 0;
4
- var BooleanValue = /** @class */ (function () {
5
- function BooleanValue(value) {
6
- this.value = value;
7
- this.type = 'boolean';
8
- }
9
- BooleanValue.prototype.stringValue = function () {
10
- return "".concat(this.value);
11
- };
12
- BooleanValue.prototype.booleanValue = function () {
13
- return this.value;
14
- };
15
- BooleanValue.prototype.numberValue = function () {
16
- return this.value ? 1 : 0;
17
- };
18
- BooleanValue.prototype.nodeSetValue = function () {
19
- throw this;
20
- };
21
- return BooleanValue;
22
- }());
23
- exports.BooleanValue = BooleanValue;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BooleanValue = void 0;
4
+ var BooleanValue = /** @class */ (function () {
5
+ function BooleanValue(value) {
6
+ this.value = value;
7
+ this.type = 'boolean';
8
+ }
9
+ BooleanValue.prototype.stringValue = function () {
10
+ return "".concat(this.value);
11
+ };
12
+ BooleanValue.prototype.booleanValue = function () {
13
+ return this.value;
14
+ };
15
+ BooleanValue.prototype.numberValue = function () {
16
+ return this.value ? 1 : 0;
17
+ };
18
+ BooleanValue.prototype.nodeSetValue = function () {
19
+ throw this;
20
+ };
21
+ return BooleanValue;
22
+ }());
23
+ exports.BooleanValue = BooleanValue;
24
24
  //# sourceMappingURL=boolean-value.js.map