@vituum/vite-plugin-latte 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (26) hide show
  1. package/index.js +21 -16
  2. package/package.json +1 -1
  3. package/vendor/composer/autoload_classmap.php +5 -4
  4. package/vendor/composer/autoload_static.php +5 -4
  5. package/vendor/composer/installed.json +7 -7
  6. package/vendor/composer/installed.php +9 -9
  7. package/vendor/latte/latte/src/Latte/Compiler/Escaper.php +2 -2
  8. package/vendor/latte/latte/src/Latte/Compiler/ExpressionBuilder.php +2 -2
  9. package/vendor/latte/latte/src/Latte/Compiler/Node.php +2 -5
  10. package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/{Expression/ArrayItemNode.php → ArrayItemNode.php} +13 -3
  11. package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/{Expression/ClosureUseNode.php → ClosureUseNode.php} +2 -1
  12. package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ArrayNode.php +1 -0
  13. package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ClosureNode.php +1 -0
  14. package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/{Scalar/EncapsedStringPartNode.php → InterpolatedStringPartNode.php} +10 -4
  15. package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/NameNode.php +10 -10
  16. package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/{EncapsedStringNode.php → InterpolatedStringNode.php} +6 -5
  17. package/vendor/latte/latte/src/Latte/Compiler/TagLexer.php +1 -1
  18. package/vendor/latte/latte/src/Latte/Compiler/TagParser.php +4 -4
  19. package/vendor/latte/latte/src/Latte/Compiler/TagParserData.php +127 -127
  20. package/vendor/latte/latte/src/Latte/Compiler/TemplateParser.php +0 -15
  21. package/vendor/latte/latte/src/Latte/Compiler/TemplateParserHtml.php +3 -3
  22. package/vendor/latte/latte/src/Latte/Engine.php +5 -5
  23. package/vendor/latte/latte/src/Latte/Essential/CachingIterator.php +1 -1
  24. package/vendor/latte/latte/src/Latte/Essential/Nodes/ParametersNode.php +1 -1
  25. package/vendor/latte/latte/src/Latte/Essential/Nodes/VarNode.php +1 -1
  26. package/vendor/latte/latte/src/Latte/Runtime/Filters.php +2 -2
package/index.js CHANGED
@@ -19,7 +19,9 @@ const defaultOptions = {
19
19
  filters: {},
20
20
  functions: {},
21
21
  tags: {},
22
- globals: {},
22
+ globals: {
23
+ format: 'latte'
24
+ },
23
25
  data: ['src/data/**/*.json'],
24
26
  formats: ['latte', 'json.latte', 'json'],
25
27
  bin: 'php',
@@ -40,31 +42,31 @@ const execSync = (cmd) => {
40
42
  }
41
43
  }
42
44
 
43
- const renderTemplate = ({ server, path, filename, cwd, packageRoot }, params, content) => {
44
- const renderTransformedHtml = params.renderTransformedHtml(server ? filename.replace('.html', '') : filename)
45
+ const renderTemplate = ({ server, path, filename, cwd, packageRoot }, options, content) => {
46
+ const renderTransformedHtml = options.renderTransformedHtml(server ? filename.replace('.html', '') : filename)
45
47
 
46
- if (params.data) {
47
- const normalizePaths = Array.isArray(params.data) ? params.data.map(path => path.replace(/\\/g, '/')) : params.data.replace(/\\/g, '/')
48
+ if (options.data) {
49
+ const normalizePaths = Array.isArray(options.data) ? options.data.map(path => path.replace(/\\/g, '/')) : options.data.replace(/\\/g, '/')
48
50
 
49
- params.data = FastGlob.sync(normalizePaths).map(entry => resolve(process.cwd(), entry))
51
+ options.data = FastGlob.sync(normalizePaths).map(entry => resolve(process.cwd(), entry))
50
52
  }
51
53
 
52
- Object.keys(params.filters).forEach(key => {
53
- if (typeof params.filters[key] === 'function') {
54
- params.filters[key] = params.filters[key].toString().match(/\(\s*([^)]+?)\s*\)/)[1].replace(/\s/g, '').split(',')
54
+ Object.keys(options.filters).forEach(key => {
55
+ if (typeof options.filters[key] === 'function') {
56
+ options.filters[key] = options.filters[key].toString().match(/\(\s*([^)]+?)\s*\)/)[1].replace(/\s/g, '').split(',')
55
57
  }
56
58
  })
57
59
 
58
- Object.keys(params.functions).forEach(key => {
59
- if (typeof params.functions[key] === 'function') {
60
- params.functions[key] = params.functions[key].toString().match(/\(\s*([^)]+?)\s*\)/)[1].replace(/\s/g, '').split(',')
60
+ Object.keys(options.functions).forEach(key => {
61
+ if (typeof options.functions[key] === 'function') {
62
+ options.functions[key] = options.functions[key].toString().match(/\(\s*([^)]+?)\s*\)/)[1].replace(/\s/g, '').split(',')
61
63
  }
62
64
  })
63
65
 
64
66
  if (renderTransformedHtml) {
65
67
  const timestamp = Math.floor(Date.now() * Math.random())
66
68
 
67
- params.contentTimestamp = timestamp
69
+ options.contentTimestamp = timestamp
68
70
 
69
71
  if (!fs.existsSync(resolve(packageRoot, 'temp'))) {
70
72
  fs.mkdirSync(resolve(packageRoot, 'temp'))
@@ -73,9 +75,9 @@ const renderTemplate = ({ server, path, filename, cwd, packageRoot }, params, co
73
75
  fs.writeFileSync(resolve(packageRoot, `temp/${timestamp}.html`), content)
74
76
  }
75
77
 
76
- const data = Object.assign({ packageRoot, cwd, isRenderTransformedHtml: renderTransformedHtml }, params)
78
+ const data = Object.assign({ packageRoot, cwd, isRenderTransformedHtml: renderTransformedHtml }, options)
77
79
 
78
- return execSync(`${params.bin} ${packageRoot}/index.php ${join(params.root, server ? path.replace('.html', '') : path)} ${JSON.stringify(JSON.stringify(data))}`)
80
+ return execSync(`${options.bin} ${packageRoot}/index.php ${join(options.root, server ? path.replace('.html', '') : path)} ${JSON.stringify(JSON.stringify(data))}`)
79
81
  }
80
82
 
81
83
  /**
@@ -133,7 +135,10 @@ const plugin = (options = {}) => {
133
135
  return content
134
136
  }
135
137
 
136
- if (!options.formats.find(format => path.endsWith(`${format}.html`))) {
138
+ if (
139
+ !options.formats.find(format => filename.replace('.html', '').endsWith(format)) ||
140
+ (filename.replace('.html', '').endsWith('.json') && !content.startsWith('{'))
141
+ ) {
137
142
  return content
138
143
  }
139
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vituum/vite-plugin-latte",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.8",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,10 +29,12 @@ return array(
29
29
  'Latte\\Compiler\\Nodes\\Html\\QuotedValue' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Html/QuotedValue.php',
30
30
  'Latte\\Compiler\\Nodes\\NopNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/NopNode.php',
31
31
  'Latte\\Compiler\\Nodes\\Php\\ArgumentNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ArgumentNode.php',
32
+ 'Latte\\Compiler\\Nodes\\Php\\ArrayItemNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ArrayItemNode.php',
33
+ 'Latte\\Compiler\\Nodes\\Php\\ClosureUseNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ClosureUseNode.php',
32
34
  'Latte\\Compiler\\Nodes\\Php\\ComplexTypeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ComplexTypeNode.php',
33
35
  'Latte\\Compiler\\Nodes\\Php\\ExpressionNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ExpressionNode.php',
34
36
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayAccessNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ArrayAccessNode.php',
35
- 'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayItemNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ArrayItemNode.php',
37
+ 'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayItemNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ArrayItemNode.php',
36
38
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ArrayNode.php',
37
39
  'Latte\\Compiler\\Nodes\\Php\\Expression\\AssignNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/AssignNode.php',
38
40
  'Latte\\Compiler\\Nodes\\Php\\Expression\\AssignOpNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/AssignOpNode.php',
@@ -41,7 +43,6 @@ return array(
41
43
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ClassConstantFetchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ClassConstantFetchNode.php',
42
44
  'Latte\\Compiler\\Nodes\\Php\\Expression\\CloneNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/CloneNode.php',
43
45
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ClosureNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ClosureNode.php',
44
- 'Latte\\Compiler\\Nodes\\Php\\Expression\\ClosureUseNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ClosureUseNode.php',
45
46
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ConstantFetchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ConstantFetchNode.php',
46
47
  'Latte\\Compiler\\Nodes\\Php\\Expression\\EmptyNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/EmptyNode.php',
47
48
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ErrorSuppressNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ErrorSuppressNode.php',
@@ -67,6 +68,7 @@ return array(
67
68
  'Latte\\Compiler\\Nodes\\Php\\Expression\\VariableNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/VariableNode.php',
68
69
  'Latte\\Compiler\\Nodes\\Php\\FilterNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/FilterNode.php',
69
70
  'Latte\\Compiler\\Nodes\\Php\\IdentifierNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/IdentifierNode.php',
71
+ 'Latte\\Compiler\\Nodes\\Php\\InterpolatedStringPartNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/InterpolatedStringPartNode.php',
70
72
  'Latte\\Compiler\\Nodes\\Php\\IntersectionTypeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/IntersectionTypeNode.php',
71
73
  'Latte\\Compiler\\Nodes\\Php\\MatchArmNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/MatchArmNode.php',
72
74
  'Latte\\Compiler\\Nodes\\Php\\ModifierNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ModifierNode.php',
@@ -75,10 +77,9 @@ return array(
75
77
  'Latte\\Compiler\\Nodes\\Php\\ParameterNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ParameterNode.php',
76
78
  'Latte\\Compiler\\Nodes\\Php\\ScalarNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/ScalarNode.php',
77
79
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\BooleanNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/BooleanNode.php',
78
- 'Latte\\Compiler\\Nodes\\Php\\Scalar\\EncapsedStringNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/EncapsedStringNode.php',
79
- 'Latte\\Compiler\\Nodes\\Php\\Scalar\\EncapsedStringPartNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/EncapsedStringPartNode.php',
80
80
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\FloatNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/FloatNode.php',
81
81
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\IntegerNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/IntegerNode.php',
82
+ 'Latte\\Compiler\\Nodes\\Php\\Scalar\\InterpolatedStringNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/InterpolatedStringNode.php',
82
83
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\NullNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/NullNode.php',
83
84
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\StringNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/StringNode.php',
84
85
  'Latte\\Compiler\\Nodes\\Php\\SuperiorTypeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/SuperiorTypeNode.php',
@@ -30,10 +30,12 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
30
30
  'Latte\\Compiler\\Nodes\\Html\\QuotedValue' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Html/QuotedValue.php',
31
31
  'Latte\\Compiler\\Nodes\\NopNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/NopNode.php',
32
32
  'Latte\\Compiler\\Nodes\\Php\\ArgumentNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ArgumentNode.php',
33
+ 'Latte\\Compiler\\Nodes\\Php\\ArrayItemNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ArrayItemNode.php',
34
+ 'Latte\\Compiler\\Nodes\\Php\\ClosureUseNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ClosureUseNode.php',
33
35
  'Latte\\Compiler\\Nodes\\Php\\ComplexTypeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ComplexTypeNode.php',
34
36
  'Latte\\Compiler\\Nodes\\Php\\ExpressionNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ExpressionNode.php',
35
37
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayAccessNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ArrayAccessNode.php',
36
- 'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayItemNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ArrayItemNode.php',
38
+ 'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayItemNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ArrayItemNode.php',
37
39
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ArrayNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ArrayNode.php',
38
40
  'Latte\\Compiler\\Nodes\\Php\\Expression\\AssignNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/AssignNode.php',
39
41
  'Latte\\Compiler\\Nodes\\Php\\Expression\\AssignOpNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/AssignOpNode.php',
@@ -42,7 +44,6 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
42
44
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ClassConstantFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ClassConstantFetchNode.php',
43
45
  'Latte\\Compiler\\Nodes\\Php\\Expression\\CloneNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/CloneNode.php',
44
46
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ClosureNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ClosureNode.php',
45
- 'Latte\\Compiler\\Nodes\\Php\\Expression\\ClosureUseNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ClosureUseNode.php',
46
47
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ConstantFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ConstantFetchNode.php',
47
48
  'Latte\\Compiler\\Nodes\\Php\\Expression\\EmptyNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/EmptyNode.php',
48
49
  'Latte\\Compiler\\Nodes\\Php\\Expression\\ErrorSuppressNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ErrorSuppressNode.php',
@@ -68,6 +69,7 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
68
69
  'Latte\\Compiler\\Nodes\\Php\\Expression\\VariableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/VariableNode.php',
69
70
  'Latte\\Compiler\\Nodes\\Php\\FilterNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/FilterNode.php',
70
71
  'Latte\\Compiler\\Nodes\\Php\\IdentifierNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/IdentifierNode.php',
72
+ 'Latte\\Compiler\\Nodes\\Php\\InterpolatedStringPartNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/InterpolatedStringPartNode.php',
71
73
  'Latte\\Compiler\\Nodes\\Php\\IntersectionTypeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/IntersectionTypeNode.php',
72
74
  'Latte\\Compiler\\Nodes\\Php\\MatchArmNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/MatchArmNode.php',
73
75
  'Latte\\Compiler\\Nodes\\Php\\ModifierNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ModifierNode.php',
@@ -76,10 +78,9 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
76
78
  'Latte\\Compiler\\Nodes\\Php\\ParameterNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ParameterNode.php',
77
79
  'Latte\\Compiler\\Nodes\\Php\\ScalarNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/ScalarNode.php',
78
80
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\BooleanNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/BooleanNode.php',
79
- 'Latte\\Compiler\\Nodes\\Php\\Scalar\\EncapsedStringNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/EncapsedStringNode.php',
80
- 'Latte\\Compiler\\Nodes\\Php\\Scalar\\EncapsedStringPartNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/EncapsedStringPartNode.php',
81
81
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\FloatNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/FloatNode.php',
82
82
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\IntegerNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/IntegerNode.php',
83
+ 'Latte\\Compiler\\Nodes\\Php\\Scalar\\InterpolatedStringNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/InterpolatedStringNode.php',
83
84
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\NullNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/NullNode.php',
84
85
  'Latte\\Compiler\\Nodes\\Php\\Scalar\\StringNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/StringNode.php',
85
86
  'Latte\\Compiler\\Nodes\\Php\\SuperiorTypeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/SuperiorTypeNode.php',
@@ -2,17 +2,17 @@
2
2
  "packages": [
3
3
  {
4
4
  "name": "latte/latte",
5
- "version": "v3.0.5",
6
- "version_normalized": "3.0.5.0",
5
+ "version": "v3.0.6",
6
+ "version_normalized": "3.0.6.0",
7
7
  "source": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/nette/latte.git",
10
- "reference": "1ccb0add4ddc5e8b5db3b82a145fa9ff2d9d6f8f"
10
+ "reference": "6f66dcfea7ad76f60b8234139161421e9e1e309f"
11
11
  },
12
12
  "dist": {
13
13
  "type": "zip",
14
- "url": "https://api.github.com/repos/nette/latte/zipball/1ccb0add4ddc5e8b5db3b82a145fa9ff2d9d6f8f",
15
- "reference": "1ccb0add4ddc5e8b5db3b82a145fa9ff2d9d6f8f",
14
+ "url": "https://api.github.com/repos/nette/latte/zipball/6f66dcfea7ad76f60b8234139161421e9e1e309f",
15
+ "reference": "6f66dcfea7ad76f60b8234139161421e9e1e309f",
16
16
  "shasum": ""
17
17
  },
18
18
  "require": {
@@ -38,7 +38,7 @@
38
38
  "nette/php-generator": "to use tag {templatePrint}",
39
39
  "nette/utils": "to use filter |webalize"
40
40
  },
41
- "time": "2023-01-16T23:22:36+00:00",
41
+ "time": "2023-03-09T01:34:56+00:00",
42
42
  "bin": [
43
43
  "bin/latte-lint"
44
44
  ],
@@ -84,7 +84,7 @@
84
84
  ],
85
85
  "support": {
86
86
  "issues": "https://github.com/nette/latte/issues",
87
- "source": "https://github.com/nette/latte/tree/v3.0.5"
87
+ "source": "https://github.com/nette/latte/tree/v3.0.6"
88
88
  },
89
89
  "install-path": "../latte/latte"
90
90
  }
@@ -1,31 +1,31 @@
1
1
  <?php return array(
2
2
  'root' => array(
3
- 'pretty_version' => 'dev-main',
4
- 'version' => 'dev-main',
3
+ 'pretty_version' => 'dev-next',
4
+ 'version' => 'dev-next',
5
5
  'type' => 'library',
6
6
  'install_path' => __DIR__ . '/../../',
7
7
  'aliases' => array(),
8
- 'reference' => '4a326211ec39d4137aa4b39a5221b1ac622a4771',
8
+ 'reference' => '713a4283dc3286aa6309d6e931e49e7eeec110da',
9
9
  'name' => '__root__',
10
10
  'dev' => true,
11
11
  ),
12
12
  'versions' => array(
13
13
  '__root__' => array(
14
- 'pretty_version' => 'dev-main',
15
- 'version' => 'dev-main',
14
+ 'pretty_version' => 'dev-next',
15
+ 'version' => 'dev-next',
16
16
  'type' => 'library',
17
17
  'install_path' => __DIR__ . '/../../',
18
18
  'aliases' => array(),
19
- 'reference' => '4a326211ec39d4137aa4b39a5221b1ac622a4771',
19
+ 'reference' => '713a4283dc3286aa6309d6e931e49e7eeec110da',
20
20
  'dev_requirement' => false,
21
21
  ),
22
22
  'latte/latte' => array(
23
- 'pretty_version' => 'v3.0.5',
24
- 'version' => '3.0.5.0',
23
+ 'pretty_version' => 'v3.0.6',
24
+ 'version' => '3.0.6.0',
25
25
  'type' => 'library',
26
26
  'install_path' => __DIR__ . '/../latte/latte',
27
27
  'aliases' => array(),
28
- 'reference' => '1ccb0add4ddc5e8b5db3b82a145fa9ff2d9d6f8f',
28
+ 'reference' => '6f66dcfea7ad76f60b8234139161421e9e1e309f',
29
29
  'dev_requirement' => false,
30
30
  ),
31
31
  ),
@@ -202,14 +202,14 @@ final class Escaper
202
202
  'html' => 'escapeHtmlText',
203
203
  'html/attr' => 'escapeHtmlAttr',
204
204
  'html/attr/js' => 'escapeHtmlAttr',
205
- 'html/js' => 'escapeHtmlRawText',
205
+ 'html/js' => 'convertJSToHtmlRawText',
206
206
  'html/comment' => 'escapeHtmlComment',
207
207
  ],
208
208
  self::Css => [
209
209
  'html' => 'escapeHtmlText',
210
210
  'html/attr' => 'escapeHtmlAttr',
211
211
  'html/attr/css' => 'escapeHtmlAttr',
212
- 'html/css' => 'escapeHtmlRawText',
212
+ 'html/css' => 'convertJSToHtmlRawText',
213
213
  'html/comment' => 'escapeHtmlComment',
214
214
  ],
215
215
  'html' => [
@@ -99,10 +99,10 @@ final class ExpressionBuilder
99
99
  $lastKey = -1;
100
100
  foreach ($arr as $key => $val) {
101
101
  if ($lastKey !== null && ++$lastKey === $key) {
102
- $node->items[] = new Expression\ArrayItemNode(self::valueToNode($val));
102
+ $node->items[] = new Nodes\Php\ArrayItemNode(self::valueToNode($val));
103
103
  } else {
104
104
  $lastKey = null;
105
- $node->items[] = new Expression\ArrayItemNode(self::valueToNode($val), self::valueToNode($key));
105
+ $node->items[] = new Nodes\Php\ArrayItemNode(self::valueToNode($val), self::valueToNode($key));
106
106
  }
107
107
  }
108
108
 
@@ -20,9 +20,6 @@ abstract class Node implements \IteratorAggregate
20
20
  abstract public function print(PrintContext $context): string;
21
21
 
22
22
 
23
- public function &getIterator(): \Generator
24
- {
25
- return;
26
- yield;
27
- }
23
+ /** @return \Generator<self> */
24
+ abstract public function &getIterator(): \Generator;
28
25
  }
@@ -7,11 +7,9 @@
7
7
 
8
8
  declare(strict_types=1);
9
9
 
10
- namespace Latte\Compiler\Nodes\Php\Expression;
10
+ namespace Latte\Compiler\Nodes\Php;
11
11
 
12
12
  use Latte\Compiler\Node;
13
- use Latte\Compiler\Nodes\Php\ExpressionNode;
14
- use Latte\Compiler\Nodes\Php\IdentifierNode;
15
13
  use Latte\Compiler\Position;
16
14
  use Latte\Compiler\PrintContext;
17
15
 
@@ -50,3 +48,15 @@ class ArrayItemNode extends Node
50
48
  yield $this->value;
51
49
  }
52
50
  }
51
+
52
+
53
+ class_alias(ArrayItemNode::class, Expression\ArrayItemNode::class);
54
+
55
+ namespace Latte\Compiler\Nodes\Php\Expression;
56
+
57
+ if (false) {
58
+ /** @deprecated use Latte\Compiler\Nodes\Php\ArrayItemNode */
59
+ class ArrayItemNode
60
+ {
61
+ }
62
+ }
@@ -7,9 +7,10 @@
7
7
 
8
8
  declare(strict_types=1);
9
9
 
10
- namespace Latte\Compiler\Nodes\Php\Expression;
10
+ namespace Latte\Compiler\Nodes\Php;
11
11
 
12
12
  use Latte\Compiler\Node;
13
+ use Latte\Compiler\Nodes\Php\Expression\VariableNode;
13
14
  use Latte\Compiler\Position;
14
15
  use Latte\Compiler\PrintContext;
15
16
 
@@ -10,6 +10,7 @@ declare(strict_types=1);
10
10
  namespace Latte\Compiler\Nodes\Php\Expression;
11
11
 
12
12
  use Latte\Compiler\Nodes\Php\ArgumentNode;
13
+ use Latte\Compiler\Nodes\Php\ArrayItemNode;
13
14
  use Latte\Compiler\Nodes\Php\ExpressionNode;
14
15
  use Latte\Compiler\Nodes\Php\IdentifierNode;
15
16
  use Latte\Compiler\Nodes\Php\Scalar;
@@ -10,6 +10,7 @@ declare(strict_types=1);
10
10
  namespace Latte\Compiler\Nodes\Php\Expression;
11
11
 
12
12
  use Latte\Compiler\Nodes\Php;
13
+ use Latte\Compiler\Nodes\Php\ClosureUseNode;
13
14
  use Latte\Compiler\Nodes\Php\ExpressionNode;
14
15
  use Latte\Compiler\Position;
15
16
  use Latte\Compiler\PrintContext;
@@ -7,14 +7,14 @@
7
7
 
8
8
  declare(strict_types=1);
9
9
 
10
- namespace Latte\Compiler\Nodes\Php\Scalar;
10
+ namespace Latte\Compiler\Nodes\Php;
11
11
 
12
- use Latte\Compiler\Nodes\Php\ScalarNode;
12
+ use Latte\Compiler\Node;
13
13
  use Latte\Compiler\Position;
14
14
  use Latte\Compiler\PrintContext;
15
15
 
16
16
 
17
- class EncapsedStringPartNode extends ScalarNode
17
+ class InterpolatedStringPartNode extends Node
18
18
  {
19
19
  public function __construct(
20
20
  public string $value,
@@ -25,6 +25,12 @@ class EncapsedStringPartNode extends ScalarNode
25
25
 
26
26
  public function print(PrintContext $context): string
27
27
  {
28
- throw new \LogicException('Cannot directly print EncapsedStringPart');
28
+ throw new \LogicException('Cannot directly print InterpolatedStringPart');
29
+ }
30
+
31
+
32
+ public function &getIterator(): \Generator
33
+ {
34
+ false && yield;
29
35
  }
30
36
  }
@@ -52,17 +52,17 @@ class NameNode extends Node
52
52
  public function isKeyword(): bool
53
53
  {
54
54
  static $keywords;
55
- $keywords ??= array_flip([
56
- 'include', 'include_once', 'eval', 'require', 'require_once', 'or', 'xor', 'and',
57
- 'instanceof', 'new', 'clone', 'exit', 'if', 'elseif', 'else', 'endif', 'echo', 'do', 'while',
58
- 'endwhile', 'for', 'endfor', 'foreach', 'endforeach', 'declare', 'enddeclare', 'as', 'try', 'catch',
59
- 'finally', 'throw', 'use', 'insteadof', 'global', 'var', 'unset', 'isset', 'empty', 'continue', 'goto',
60
- 'function', 'const', 'return', 'print', 'yield', 'list', 'switch', 'endswitch', 'case', 'default',
61
- 'break', 'array', 'callable', 'extends', 'implements', 'namespace', 'trait', 'interface', 'class',
62
- 'static', 'abstract', 'final', 'private', 'protected', 'public', 'fn', 'match', 'self', 'parent',
55
+ $keywords ??= array_flip([ // https://www.php.net/manual/en/reserved.keywords.php
56
+ '__halt_compiler', '__class__', '__dir__', '__file__', '__function__', '__line__', '__method__', '__namespace__', '__trait__',
57
+ 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare',
58
+ 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch',
59
+ 'endwhile', 'eval', 'exit', 'extends', 'final', 'finally', 'fn', 'for', 'foreach', 'function', 'global', 'goto', 'if',
60
+ 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'match', 'namespace',
61
+ 'new', 'or', 'print', 'private', 'protected', 'public', 'readonly', 'require', 'require_once', 'return', 'static',
62
+ 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor', 'yield',
63
+ 'parent', 'self', 'mixed', 'void', 'enum', // extra
63
64
  ]);
64
- return count($this->parts) === 1
65
- && (isset($keywords[strtolower($this->parts[0])]) || str_starts_with($this->parts[0], '__'));
65
+ return count($this->parts) === 1 && isset($keywords[strtolower($this->parts[0])]);
66
66
  }
67
67
 
68
68
 
@@ -11,27 +11,28 @@ namespace Latte\Compiler\Nodes\Php\Scalar;
11
11
 
12
12
  use Latte\Compiler\Nodes\Php\Expression;
13
13
  use Latte\Compiler\Nodes\Php\ExpressionNode;
14
+ use Latte\Compiler\Nodes\Php\InterpolatedStringPartNode;
14
15
  use Latte\Compiler\Nodes\Php\ScalarNode;
15
16
  use Latte\Compiler\PhpHelpers;
16
17
  use Latte\Compiler\Position;
17
18
  use Latte\Compiler\PrintContext;
18
19
 
19
20
 
20
- class EncapsedStringNode extends ScalarNode
21
+ class InterpolatedStringNode extends ScalarNode
21
22
  {
22
23
  public function __construct(
23
- /** @var ExpressionNode[] */
24
+ /** @var array<ExpressionNode|InterpolatedStringPartNode> */
24
25
  public array $parts,
25
26
  public ?Position $position = null,
26
27
  ) {
27
28
  }
28
29
 
29
30
 
30
- /** @param ExpressionNode[] $parts */
31
+ /** @param array<ExpressionNode|InterpolatedStringPartNode> $parts */
31
32
  public static function parse(array $parts, Position $position): static
32
33
  {
33
34
  foreach ($parts as $part) {
34
- if ($part instanceof EncapsedStringPartNode) {
35
+ if ($part instanceof InterpolatedStringPartNode) {
35
36
  $part->value = PhpHelpers::decodeEscapeSequences($part->value, '"');
36
37
  }
37
38
  }
@@ -45,7 +46,7 @@ class EncapsedStringNode extends ScalarNode
45
46
  $s = '';
46
47
  $expr = false;
47
48
  foreach ($this->parts as $part) {
48
- if ($part instanceof EncapsedStringPartNode) {
49
+ if ($part instanceof InterpolatedStringPartNode) {
49
50
  $s .= substr($context->encodeString($part->value, '"'), 1, -1);
50
51
  continue;
51
52
  }
@@ -124,7 +124,7 @@ final class TagLexer
124
124
  (?<Php_NameFullyQualified> \\ (?&label) ( \\ (?&label) )* )|
125
125
  (?<Php_NameQualified> (?&label) ( \\ (?&label) )+ )|
126
126
  (?<Php_IdentifierFollowed> (?&label) (?= [ \t\r\n]* [(&=] ) )|
127
- (?<Php_Identifier> (?&label)(--?[a-zA-Z0-9_\x80-\xff]+)* )|
127
+ (?<Php_Identifier> (?&label)((--?|\.)[a-zA-Z0-9_\x80-\xff]+)* )|
128
128
  (
129
129
  (
130
130
  (?<Php_ObjectOperator> -> )|
@@ -325,7 +325,7 @@ final class TagParser extends TagParserData
325
325
  string $endToken,
326
326
  Position $startPos,
327
327
  Position $endPos,
328
- ): Scalar\StringNode|Scalar\EncapsedStringNode
328
+ ): Scalar\StringNode|Scalar\InterpolatedStringNode
329
329
  {
330
330
  $hereDoc = !str_contains($startToken, "'");
331
331
  preg_match('/\A[ \t]*/', $endToken, $matches);
@@ -336,14 +336,14 @@ final class TagParser extends TagParserData
336
336
  } elseif (!$parts) {
337
337
  return new Scalar\StringNode('', $startPos);
338
338
 
339
- } elseif (!$parts[0] instanceof Scalar\EncapsedStringPartNode) {
339
+ } elseif (!$parts[0] instanceof Node\InterpolatedStringPartNode) {
340
340
  // If there is no leading encapsed string part, pretend there is an empty one
341
341
  $this->stripIndentation('', $indentation, true, false, $parts[0]->position);
342
342
  }
343
343
 
344
344
  $newParts = [];
345
345
  foreach ($parts as $i => $part) {
346
- if ($part instanceof Scalar\EncapsedStringPartNode) {
346
+ if ($part instanceof Node\InterpolatedStringPartNode) {
347
347
  $isLast = $i === \count($parts) - 1;
348
348
  $part->value = $this->stripIndentation(
349
349
  $part->value,
@@ -368,7 +368,7 @@ final class TagParser extends TagParserData
368
368
  $newParts[] = $part;
369
369
  }
370
370
 
371
- return new Scalar\EncapsedStringNode($newParts, $startPos);
371
+ return new Scalar\InterpolatedStringNode($newParts, $startPos);
372
372
  }
373
373
 
374
374
 
@@ -35,7 +35,7 @@ abstract class TagParserData
35
35
  protected const TokenToSymbol = [
36
36
  0, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
37
37
  112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 48, 107, 112, 108, 47, 112, 112,
38
- 101, 102, 45, 42, 2, 43, 44, 46, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 22, 105,
38
+ 101, 102, 45, 43, 2, 44, 39, 46, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 22, 105,
39
39
  35, 7, 37, 21, 59, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
40
40
  112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 61, 112, 106, 27, 112, 112, 100, 112, 112,
41
41
  112, 98, 112, 112, 112, 112, 112, 112, 112, 99, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
@@ -47,7 +47,7 @@ abstract class TagParserData
47
47
  112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
48
48
  112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 1, 3, 4, 5,
49
49
  6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 28, 29, 30,
50
- 31, 32, 33, 34, 36, 38, 39, 40, 41, 49, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62,
50
+ 31, 32, 33, 34, 36, 38, 40, 41, 42, 49, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62,
51
51
  63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
52
52
  83, 84, 85, 86, 87, 88, 89, 90, 109, 91, 92, 93, 94, 110, 111, 95, 96, 97,
53
53
  ];
@@ -56,104 +56,104 @@ abstract class TagParserData
56
56
  * state/symbol pair is self::Action[self::ActionBase[$state] + $symbol]. If self::ActionBase[$state] is 0, the
57
57
  * action is defaulted, i.e. self::ActionDefault[$state] should be used instead. */
58
58
  protected const ActionBase = [
59
- 97, 305, 305, 305, 305, 100, 141, 305, 264, 182, 223, 305, 385, 385, 385, 385, 385, 155, 155, 155,
60
- 232, 232, 214, 225, 353, 354, 355, 375, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
61
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
62
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
63
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
64
- -42, -42, -42, -42, -42, -42, -42, -42, -42, 38, 224, 378, 381, 380, 382, 422, 429, 430, 433, 441,
65
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 140, 64, 557, 107, 107, 107,
66
- 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 274, 274, 274, 371, 504,
67
- 492, 391, -67, 412, 412, 127, 127, 127, 127, 127, 426, 426, 426, 426, 79, 79, 79, 79, 250, 250,
68
- 250, 250, 250, 250, 250, 250, 87, 87, 103, 208, -39, -39, -39, 451, 451, 451, 41, 41, 41, 41,
69
- 41, 111, 152, 193, 449, 203, 446, 446, 446, 446, 446, 446, 230, 444, -21, -11, -11, 388, 303, 303,
70
- 303, -11, 397, 94, 321, -36, 461, 474, 318, 419, 263, 222, 377, 216, 217, 236, 26, 26, 26, 26,
71
- 155, 445, 445, 155, 155, 155, 132, 132, 132, -83, 221, 52, 23, 389, 221, 221, 221, 47, 37, 60,
72
- 285, 220, 271, 276, 33, 104, 61, 292, 311, 285, 285, 145, 61, 61, 234, 240, 244, 169, 99, 244,
73
- 235, 235, 165, 29, 322, 317, 324, 269, 261, 387, 181, 192, 233, 231, 260, 245, 215, 322, 317, 324,
74
- 218, 181, 228, 228, 228, 258, 228, 228, 228, 228, 228, 228, 228, 432, 30, 239, 326, 327, 342, 344,
75
- 211, 226, 394, 228, 227, 255, 252, 434, 181, 259, 435, 384, 320, 254, 213, 336, 212, 439, 348, 407,
76
- 200, 331, 202, 414, 219, 390, 229, 352, 418, 420, 0, -42, -42, -42, -42, -42, -42, -42, -42, -42,
77
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, 0, 0,
59
+ 261, 304, 304, 304, 304, 99, 140, 304, 263, 181, 222, 304, 384, 384, 384, 384, 384, 159, 159, 159,
60
+ 247, 247, 212, 226, 354, 372, 374, 376, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
61
+ -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
62
+ -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
63
+ -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
64
+ -43, -43, -43, -43, -43, -43, -43, -43, -43, 21, 216, 380, 398, 382, 399, 412, 432, 435, 440, 457,
65
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 167, 177, 538, 234, 234, 234,
66
+ 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 543, 543, 543, 370, 499,
67
+ 494, 390, 5, 411, 411, 462, 462, 462, 462, 462, 58, 58, 58, 58, 156, 156, 156, 156, 45, 45,
68
+ 45, 45, 45, 45, 45, 45, 236, 3, 3, 7, 208, 250, 250, 250, 139, 139, 139, 139, 139, 267,
69
+ 111, 111, 111, 192, 233, 387, 257, -64, -64, -64, -64, -64, -64, 268, 405, -12, 444, 444, 447, 168,
70
+ 168, 444, 469, 76, 286, -15, 68, 471, 443, 453, 429, 318, 379, 219, 223, 232, 38, 38, 38, 38,
71
+ 159, 442, 442, 159, 159, 159, 98, 98, 98, -84, 231, -63, 8, 404, 231, 231, 231, 90, 57, -32,
72
+ 316, 237, 291, 310, 33, 117, 46, 317, 320, 316, 316, 120, 46, 46, 244, 278, 240, 197, 113, 240,
73
+ 217, 217, 123, 31, 322, 321, 324, 289, 285, 407, 176, 221, 272, 214, 284, 239, 218, 322, 321, 324,
74
+ 224, 176, 227, 227, 227, 270, 227, 227, 227, 227, 227, 227, 227, 445, 1, 273, 326, 327, 335, 342,
75
+ 213, 220, 315, 227, 230, 209, 205, 450, 176, 275, 455, 406, 225, 243, 242, 262, 241, 456, 347, 403,
76
+ 194, 329, 198, 409, 215, 408, 228, 352, 428, 410, 0, -43, -43, -43, -43, -43, -43, -43, -43, -43,
77
+ -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, 0, 0,
78
78
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
79
79
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
80
80
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
81
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53,
82
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
83
- 0, 0, 0, 0, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
84
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 0, 426, 53, 53, 53, 53, 53, 53, 53,
85
- 0, 0, 0, 0, 303, 303, 303, 303, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
86
- 303, 303, 303, 41, 41, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 397, 235, 235, 235, 235,
87
- 235, 235, 397, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 397, 235, 0, 0, 0, 0, 0,
88
- 0, 0, 155, 155, 155, 397, 0, 0, 0, 0, 0, 235, 235, 0, 0, 0, 0, 0, 0, 0,
89
- 228, 0, 0, 30, 228, 228, 228,
81
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52,
82
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
83
+ 0, 0, 0, 0, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
84
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 0, 58, 52, 52, 52, 52, 52, 52, 52,
85
+ 0, 0, 0, 0, 111, 111, 111, 111, 139, 139, 139, 139, 139, 139, 139, 139, 111, 139, 139, 139,
86
+ 139, 139, 139, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 469, 217, 217, 217,
87
+ 217, 217, 217, 469, 469, 0, 0, 0, 0, 111, 111, 0, 0, 469, 217, 0, 0, 0, 0, 0,
88
+ 0, 0, 159, 159, 159, 469, 0, 0, 0, 0, 0, 217, 217, 0, 0, 0, 0, 0, 0, 0,
89
+ 227, 0, 0, 1, 227, 227, 227,
90
90
  ];
91
91
 
92
92
  /** Table of actions. Indexed according to self::ActionBase comment. */
93
93
  protected const Action = [
94
- 34, 35, 376, 75, 76, 77, 36, -176, 37, 178, 179, 38, 39, 40, 41, 42, 43, 44, -176, 1,
95
- 193, 45, 544, 545, 202, -213, 527, 376, 12, 0, 542, 284, 7, 243, 244, 11, 98, 285, 286, 16,
96
- -211, 289, 287, 288, 205, -213, -213, -213, 13, 173, -208, 529, 528, 550, 548, 549, 54, 55, 56, 29,
97
- -211, -211, -211, 15, 172, 222, 289, -8190, -8190, -211, -208, -208, -208, 197, 23, 198, 57, 58, 59, -208,
98
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
99
- 80, 21, 195, 357, 358, 356, 101, 525, 196, 527, -8190, -8190, -8190, 81, -8191, -8191, -8191, -8191, 72, 73,
100
- 74, 75, 76, 77, 196, 493, 405, 14, 355, 354, -8190, -8190, -8190, -21, 529, 528, 407, 32, 406, 434,
101
- 204, 367, -175, -8190, 357, 358, 356, 188, -8190, 361, -8190, -8190, -8190, -175, -8190, -8190, -8190, -8191, -8191, -8191,
102
- -8191, -8191, 194, 46, 510, -8190, 201, 232, 296, 355, 354, 378, -214, 297, 363, 233, 234, 362, 368, 298,
103
- 299, 553, 367, 355, 354, 357, 358, 356, 95, -45, 361, 24, -214, -214, -214, 33, 261, 3, 374, 96,
104
- 375, -175, 416, 194, 46, -28, 105, 201, 106, 296, 355, 354, -175, -214, 297, 363, 233, 234, 362, 368,
105
- 298, 299, -260, 367, -260, 107, 357, 358, 356, 196, 18, 361, 25, -214, -214, -214, 108, -22, -16, -15,
106
- 19, 200, -175, 416, 194, 46, 170, 97, 201, 104, 296, 355, 354, -175, -210, 297, 363, 233, 234, 362,
107
- 368, 298, 299, -257, 367, -257, 189, 357, 358, 356, 195, 171, 361, 26, -210, -210, -210, -8190, -8190, -8190,
108
- 199, 320, 630, -210, 416, 194, 46, 102, 81, 201, 554, 296, 355, 354, -217, -8190, 297, 363, 233, 234,
109
- 362, 368, 298, 299, 376, 367, 277, -8190, 357, 358, 356, 1, 341, 361, 27, 625, 251, 555, -254, 376,
110
- -254, -184, 542, 162, -260, 416, 194, 46, -260, 241, 201, 386, 296, 355, 354, 288, 0, 297, 363, 233,
111
- 234, 362, 368, 298, 299, -8190, 367, -8190, 78, 79, 80, 49, 195, -243, 361, 100, -241, 222, 289, -217,
112
- -216, -215, 2, 81, 336, -257, 416, 194, 46, -257, 4, 201, 5, 296, -8190, -8190, -8190, 6, 297, 363,
113
- 233, 234, 362, 368, 298, 299, 8, 628, 357, 358, 356, 629, -8190, 9, -8190, -8190, 47, 48, 17, 82,
114
- 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 10, 355, 354, -8190, -8190, -8190, 28, -71,
115
- -254, -71, 274, 51, -254, 52, 367, 186, 187, 357, 358, 356, 240, -8190, 361, -8190, -8190, -8190, 276, -8190,
116
- -8190, -8190, 456, 458, 498, -71, 540, 194, 46, 31, 417, 201, -208, 296, 513, 519, 521, 523, 297, 363,
117
- 233, 234, 362, 368, 298, 299, 376, 367, 617, 209, 210, 211, -208, -208, -208, 361, 100, 572, 242, -28,
118
- 329, -208, 331, 532, 499, 22, 181, 20, 360, 359, 53, 597, 371, 259, 372, -8190, -8190, -8190, 627, 364,
119
- 363, 366, 365, 362, 368, 369, 370, -8190, -8190, -8190, -209, 387, 374, -8190, 375, -8190, -8190, -8190, 626, -8190,
120
- 376, -71, 30, 349, 509, -8190, 624, -8190, -8190, -8190, -209, -209, -209, 581, 592, 224, -8190, 595, 539, -209,
121
- 569, 585, 206, 207, 208, 620, -8190, 343, -8190, 99, -216, 543, 50, 289, 289, 246, 247, 248, 0, 289,
122
- -8190, -8190, -8190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103,
94
+ 34, 35, 374, 7, 375, 36, -176, 37, 178, 179, 38, 39, 40, 41, 42, 43, 44, -176, 1, 191,
95
+ 45, 544, 545, 203, 194, 527, 376, -175, 194, 542, 284, 0, 243, 244, 173, 11, 285, 286, -175, 99,
96
+ 12, 287, 288, 206, 289, 32, -213, 172, 15, -211, 529, 528, 550, 548, 549, 54, 55, 56, 29, 16,
97
+ 13, 357, 358, 356, 222, 289, -213, -213, -213, -211, -211, -211, 510, 23, 376, 57, 58, 59, -211, 60,
98
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
99
+ 367, 193, 357, 358, 356, -45, 1, 361, 98, -28, 493, 251, 81, 289, 376, 21, 195, 542, 196, 101,
100
+ 360, 359, 189, 205, 371, 232, 372, 355, 354, 30, 288, 364, 363, 366, 365, 362, 368, 369, 370, 14,
101
+ -8190, 367, -8190, 357, 358, 356, 49, -8190, 361, 207, 208, 209, 222, 289, 76, 77, 78, 79, 80, 434,
102
+ 193, 192, 46, 553, 374, 199, 375, 296, 355, 354, -8190, 81, 297, 363, 233, 234, 362, 368, 298, 299,
103
+ -8190, -8190, 367, 95, 357, 358, 356, 355, 354, 361, 24, -8191, -8191, -8191, -8191, 72, 73, 74, 75, 378,
104
+ 105, 416, 192, 46, 106, 525, 199, 527, 296, 355, 354, -8190, -8190, 297, 363, 233, 234, 362, 368, 298,
105
+ 299, 107, 18, 367, 405, 357, 358, 356, 96, 194, 361, 25, 529, 528, 407, 108, 406, -8190, -8190, -8190,
106
+ -22, -16, 416, 192, 46, -15, 19, 199, 97, 296, 355, 354, 104, -214, 297, 363, 233, 234, 362, 368,
107
+ 298, 299, 190, 170, 367, 171, 357, 358, 356, 197, 198, 361, 26, -214, -214, -214, 73, 74, 75, 320,
108
+ 193, 102, -175, 416, 192, 46, 376, 81, 199, -21, 296, 355, 354, -175, -210, 297, 363, 233, 234, 362,
109
+ 368, 298, 299, -8190, -184, 367, -243, 357, 358, 356, -241, 630, 361, 27, -210, -210, -210, 625, -260, 376,
110
+ -260, 277, 341, -210, 416, 192, 46, 274, -214, 199, 336, 296, 355, 354, -217, -8190, 297, 363, 233, 234,
111
+ 362, 368, 298, 299, 554, -8190, 367, -8190, -214, -214, -214, 50, 628, 361, 100, 555, 629, -175, 289, 33,
112
+ 261, 3, 162, 241, 276, 416, 192, 46, -175, 386, 199, -217, 296, -8190, -8190, -8190, -216, 297, 363, 233,
113
+ 234, 362, 368, 298, 299, -215, 2, 357, 358, 356, 4, -8190, 5, -8190, -8190, 47, 48, 17, 82, 83,
114
+ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 6, 355, 354, -8190, -8190, -8190, 8, 9, 627,
115
+ -260, 10, 28, 51, -260, 52, 367, 187, 188, -257, 240, -257, -8190, 361, -8190, -8190, -8190, 498, -8190, -8190,
116
+ -8190, 456, 458, -254, 540, -254, 192, 46, -209, 417, 199, -208, 296, -71, 513, -71, 519, 297, 363, 233,
117
+ 234, 362, 368, 298, 299, -8190, -8190, -8190, -209, -209, -209, -208, -208, -208, 521, 100, 523, -209, 572, -71,
118
+ -208, -28, 329, -8190, 331, -8190, -8190, -8190, -216, -8190, -8190, -8190, -8191, -8191, -8191, -8191, -8191, -8190, -8190, -8190,
119
+ 532, 499, -8190, -8190, -8190, -208, 597, 387, 31, 20, 53, 259, 543, 626, 509, -8190, 624, -8190, -8190, -8190,
120
+ -8190, -8190, -8190, -8190, -8190, -208, -208, -208, 210, 211, 212, -257, 224, 349, -208, -257, 581, 242, 376, 592,
121
+ 617, -8190, -8190, -8190, 595, -254, -8190, -8190, -8190, -254, 289, 539, 246, 247, 248, -71, 569, 22, 181, 0,
122
+ 103, 585, 620, 343, -8190,
123
123
  ];
124
124
 
125
125
  /** Table indexed analogously to self::Action. If self::ActionCheck[self::ActionBase[$state] + $symbol] != $symbol
126
126
  * then the action is defaulted, i.e. self::ActionDefault[$state] should be used instead. */
127
127
  protected const ActionCheck = [
128
- 42, 43, 69, 42, 43, 44, 48, 90, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 101, 61,
129
- 62, 63, 64, 65, 66, 61, 68, 69, 2, 0, 72, 73, 2, 75, 76, 2, 103, 79, 80, 2,
130
- 61, 108, 84, 85, 86, 81, 82, 83, 22, 26, 61, 93, 94, 95, 96, 97, 3, 4, 5, 101,
131
- 81, 82, 83, 2, 26, 107, 108, 3, 4, 90, 81, 82, 83, 26, 21, 28, 23, 24, 25, 90,
132
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
133
- 47, 2, 49, 3, 4, 5, 2, 66, 21, 68, 3, 4, 5, 60, 35, 36, 37, 38, 39, 40,
134
- 41, 42, 43, 44, 21, 102, 85, 101, 28, 29, 3, 4, 5, 22, 93, 94, 95, 77, 97, 102,
135
- 102, 41, 90, 3, 3, 4, 5, 2, 21, 49, 23, 24, 25, 101, 27, 28, 29, 30, 31, 32,
136
- 33, 34, 62, 63, 104, 71, 66, 2, 68, 28, 29, 2, 61, 73, 74, 75, 76, 77, 78, 79,
137
- 80, 87, 41, 28, 29, 3, 4, 5, 7, 102, 49, 91, 81, 82, 83, 98, 99, 100, 66, 7,
138
- 68, 90, 102, 62, 63, 102, 6, 66, 6, 68, 28, 29, 101, 61, 73, 74, 75, 76, 77, 78,
139
- 79, 80, 0, 41, 2, 6, 3, 4, 5, 21, 6, 49, 91, 81, 82, 83, 7, 22, 22, 22,
140
- 22, 28, 90, 102, 62, 63, 26, 22, 66, 22, 68, 28, 29, 101, 61, 73, 74, 75, 76, 77,
141
- 78, 79, 80, 0, 41, 2, 22, 3, 4, 5, 49, 26, 49, 91, 81, 82, 83, 3, 4, 5,
142
- 26, 67, 70, 90, 102, 62, 63, 61, 60, 66, 87, 68, 28, 29, 101, 21, 73, 74, 75, 76,
143
- 77, 78, 79, 80, 69, 41, 74, 71, 3, 4, 5, 61, 78, 49, 91, 104, 66, 87, 0, 69,
144
- 2, 90, 72, 90, 102, 102, 62, 63, 106, 90, 66, 91, 68, 28, 29, 85, -1, 73, 74, 75,
145
- 76, 77, 78, 79, 80, 95, 41, 97, 45, 46, 47, 101, 49, 101, 49, 91, 101, 107, 108, 101,
146
- 101, 101, 101, 60, 43, 102, 102, 62, 63, 106, 101, 66, 101, 68, 3, 4, 5, 101, 73, 74,
147
- 75, 76, 77, 78, 79, 80, 101, 66, 3, 4, 5, 70, 21, 101, 23, 24, 91, 92, 7, 8,
148
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 101, 28, 29, 3, 4, 5, 101, 0,
149
- 102, 2, 102, 101, 106, 101, 41, 101, 101, 3, 4, 5, 101, 21, 49, 23, 24, 25, 102, 27,
150
- 28, 29, 51, 52, 102, 26, 102, 62, 63, 61, 102, 66, 61, 68, 102, 102, 102, 102, 73, 74,
151
- 75, 76, 77, 78, 79, 80, 69, 41, 71, 81, 82, 83, 81, 82, 83, 49, 91, 102, 90, 102,
152
- 102, 90, 102, 102, 102, 88, 89, 103, 62, 63, 103, 102, 66, 103, 68, 3, 4, 5, 104, 73,
153
- 74, 75, 76, 77, 78, 79, 80, 3, 4, 5, 61, 104, 66, 21, 68, 23, 24, 25, 104, 27,
154
- 69, 102, 61, 105, 104, 21, 104, 23, 24, 25, 81, 82, 83, 104, 104, 61, 85, 104, 106, 90,
155
- 106, 106, 81, 82, 83, 106, 95, 106, 97, 103, 101, 107, 101, 108, 108, 81, 82, 83, -1, 108,
156
- 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22,
128
+ 43, 44, 66, 2, 68, 48, 90, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 101, 61, 62,
129
+ 63, 64, 65, 66, 21, 68, 69, 90, 21, 72, 73, 0, 75, 76, 26, 2, 79, 80, 101, 103,
130
+ 2, 84, 85, 86, 108, 77, 61, 26, 2, 61, 93, 94, 95, 96, 97, 3, 4, 5, 101, 2,
131
+ 22, 3, 4, 5, 107, 108, 81, 82, 83, 81, 82, 83, 104, 21, 69, 23, 24, 25, 90, 27,
132
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
133
+ 42, 49, 3, 4, 5, 102, 61, 49, 103, 102, 102, 66, 60, 108, 69, 2, 26, 72, 28, 2,
134
+ 62, 63, 2, 102, 66, 2, 68, 28, 29, 61, 85, 73, 74, 75, 76, 77, 78, 79, 80, 101,
135
+ 95, 42, 97, 3, 4, 5, 101, 71, 49, 81, 82, 83, 107, 108, 43, 44, 45, 46, 47, 102,
136
+ 49, 62, 63, 87, 66, 66, 68, 68, 28, 29, 3, 60, 73, 74, 75, 76, 77, 78, 79, 80,
137
+ 3, 4, 42, 7, 3, 4, 5, 28, 29, 49, 91, 35, 36, 37, 38, 39, 40, 41, 42, 2,
138
+ 6, 102, 62, 63, 6, 66, 66, 68, 68, 28, 29, 43, 44, 73, 74, 75, 76, 77, 78, 79,
139
+ 80, 6, 6, 42, 85, 3, 4, 5, 7, 21, 49, 91, 93, 94, 95, 7, 97, 3, 4, 5,
140
+ 22, 22, 102, 62, 63, 22, 22, 66, 22, 68, 28, 29, 22, 61, 73, 74, 75, 76, 77, 78,
141
+ 79, 80, 22, 26, 42, 26, 3, 4, 5, 26, 28, 49, 91, 81, 82, 83, 40, 41, 42, 67,
142
+ 49, 61, 90, 102, 62, 63, 69, 60, 66, 22, 68, 28, 29, 101, 61, 73, 74, 75, 76, 77,
143
+ 78, 79, 80, 71, 90, 42, 101, 3, 4, 5, 101, 70, 49, 91, 81, 82, 83, 104, 0, 69,
144
+ 2, 74, 78, 90, 102, 62, 63, 102, 61, 66, 44, 68, 28, 29, 101, 85, 73, 74, 75, 76,
145
+ 77, 78, 79, 80, 87, 95, 42, 97, 81, 82, 83, 101, 66, 49, 91, 87, 70, 90, 108, 98,
146
+ 99, 100, 90, 90, 102, 102, 62, 63, 101, 91, 66, 101, 68, 3, 4, 5, 101, 73, 74, 75,
147
+ 76, 77, 78, 79, 80, 101, 101, 3, 4, 5, 101, 21, 101, 23, 24, 91, 92, 7, 8, 9,
148
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 101, 28, 29, 3, 4, 5, 101, 101, 104,
149
+ 102, 101, 101, 101, 106, 101, 42, 101, 101, 0, 101, 2, 21, 49, 23, 24, 25, 102, 27, 28,
150
+ 29, 51, 52, 0, 102, 2, 62, 63, 61, 102, 66, 61, 68, 0, 102, 2, 102, 73, 74, 75,
151
+ 76, 77, 78, 79, 80, 3, 4, 5, 81, 82, 83, 81, 82, 83, 102, 91, 102, 90, 102, 26,
152
+ 90, 102, 102, 21, 102, 23, 24, 25, 101, 27, 28, 29, 30, 31, 32, 33, 34, 3, 4, 5,
153
+ 102, 102, 3, 4, 5, 61, 102, 104, 61, 103, 103, 103, 107, 104, 104, 21, 104, 23, 24, 25,
154
+ 21, 27, 23, 24, 25, 81, 82, 83, 81, 82, 83, 102, 61, 105, 90, 106, 104, 90, 69, 104,
155
+ 71, 3, 4, 5, 104, 102, 3, 4, 5, 106, 108, 106, 81, 82, 83, 102, 106, 88, 89, -1,
156
+ 22, 106, 106, 106, 21,
157
157
  ];
158
158
 
159
159
  /** Map of states to their default action */
@@ -167,9 +167,9 @@ abstract class TagParserData
167
167
  1, 261, 262, 76, 70, 207, 256, 259, 72, 75, 73, 42, 43, 49, 112, 114, 146, 113, 88, 93,
168
168
  94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 86, 87, 158, 147, 145, 144, 110, 111,
169
169
  117, 85, 8191, 115, 116, 134, 135, 132, 133, 136, 8191, 8191, 8191, 8191, 137, 138, 139, 140, 8191, 8191,
170
- 8191, 8191, 8191, 8191, 8191, 8191, 62, 62, 62, 8191, 124, 125, 127, 8191, 10, 8191, 8191, 8191, 8191, 8191,
171
- 8191, 197, 197, 196, 142, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 202, 107, 109, 181, 119, 120,
172
- 118, 89, 8191, 8191, 8191, 201, 8191, 269, 208, 208, 208, 208, 33, 33, 33, 8191, 81, 81, 81, 81,
170
+ 8191, 8191, 8191, 8191, 8191, 8191, 118, 62, 62, 62, 8191, 8191, 10, 8191, 8191, 8191, 8191, 8191, 8191, 197,
171
+ 124, 125, 127, 197, 196, 142, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 202, 107, 109, 181, 119,
172
+ 120, 89, 8191, 8191, 8191, 201, 8191, 269, 208, 208, 208, 208, 33, 33, 33, 8191, 81, 81, 81, 81,
173
173
  33, 8191, 8191, 33, 33, 33, 8191, 8191, 8191, 187, 130, 214, 8191, 8191, 121, 122, 123, 50, 8191, 8191,
174
174
  185, 8191, 174, 8191, 27, 27, 27, 8191, 227, 228, 229, 27, 27, 27, 162, 35, 64, 27, 27, 64,
175
175
  8191, 8191, 27, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 191, 8191, 212, 225, 2, 177, 14, 19, 20,
@@ -181,10 +181,10 @@ abstract class TagParserData
181
181
  /** Map of non-terminals to a displacement into the self::Goto table. The corresponding goto state for this
182
182
  * non-terminal/state pair is self::Goto[self::GotoBase[$nonTerminal] + $state] (unless defaulted) */
183
183
  protected const GotoBase = [
184
- 0, 0, -1, 0, 0, 107, 0, 161, -2, -39, -96, 0, 260, -55, 0, 0, 0, 0, 114, 110,
185
- -16, 0, -8, 0, 64, 52, 0, 0, -66, -9, -255, 103, -11, 19, 0, 0, -44, 236, 27, 0,
186
- 73, 0, 0, 233, 0, 0, 0, 29, 0, 0, 0, 0, 67, -47, 0, 0, 35, 43, 7, 51,
187
- -35, -86, 0, 0, -50, 48, 0, 25, 109, 4, -68, 0, 0,
184
+ 0, 0, -1, 0, 0, 107, 0, 162, 15, -39, -84, 0, 261, 14, 0, 0, 0, 0, 118, 140,
185
+ -2, 0, 1, 0, 5, -75, 0, 0, -60, -8, -255, 103, -11, 21, 0, 0, 13, 242, 29, 0,
186
+ 47, 0, 0, 234, 0, 0, 0, 27, 0, 0, 0, 0, -21, -43, 0, 0, 37, 45, 7, 53,
187
+ -25, -66, 0, 0, -50, -32, 0, 28, 109, 4, 33, 0, 0,
188
188
  ];
189
189
 
190
190
  /** Table of states to goto after reduction. Indexed according to self::GotoBase comment. */
@@ -192,20 +192,20 @@ abstract class TagParserData
192
192
  110, 110, 110, 110, 419, 419, 110, 518, 520, 319, 110, 599, 522, 571, 573, 574, 138, 126, 127, 123,
193
193
  123, 115, 136, 128, 128, 128, 128, 123, 109, 125, 125, 125, 120, 302, 303, 250, 304, 306, 307, 308,
194
194
  309, 310, 311, 312, 442, 442, 121, 122, 111, 112, 113, 114, 116, 134, 135, 137, 155, 158, 159, 160,
195
- 163, 164, 165, 166, 167, 168, 169, 174, 175, 176, 177, 190, 191, 192, 218, 219, 220, 254, 255, 256,
195
+ 163, 164, 165, 166, 167, 168, 169, 174, 175, 176, 177, 186, 200, 201, 202, 219, 220, 254, 255, 256,
196
196
  323, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 156, 117, 118, 128,
197
- 129, 119, 157, 130, 131, 154, 132, 133, 180, 180, 180, 180, 326, 253, 180, 272, 273, 258, 180, 223,
198
- 404, 404, 404, 404, 183, 184, 185, 524, 524, 524, 404, 404, 404, 404, 404, 391, 235, 615, 318, 526,
199
- 526, 526, 526, 584, 584, 584, 526, 526, 526, 526, 526, 526, 526, 526, 615, 616, 596, 596, 596, 596,
200
- 596, 596, 300, 300, 300, 300, 227, 616, 300, 424, 338, 335, 300, 227, 227, 394, 433, 432, 316, 317,
201
- 397, 344, 389, 227, 227, 631, 514, 213, 316, 317, 275, 582, 582, 430, 427, 428, 227, 215, 216, 228,
202
- 322, 229, 221, 230, 231, 541, 541, 541, 541, 541, 541, 541, 541, 563, 563, 563, 563, 563, 563, 563,
203
- 563, 561, 561, 561, 561, 561, 561, 561, 561, 305, 305, 305, 305, 305, 305, 305, 305, 301, 301, 301,
204
- 301, 346, 517, 301, 621, 622, 623, 301, 401, 408, 410, 409, 411, 415, 328, 269, 270, 586, 587, 588,
205
- 315, 315, 315, 381, 330, 348, 589, 590, 491, 515, 345, 382, 0, 0, 0, 0, 0, 0, 0, 0,
197
+ 129, 119, 157, 130, 131, 154, 132, 133, 180, 180, 180, 180, 326, 253, 180, 272, 273, 258, 180, 401,
198
+ 408, 410, 409, 411, 183, 184, 185, 404, 404, 404, 404, 524, 524, 524, 404, 404, 404, 404, 404, 391,
199
+ 223, 584, 584, 584, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 235, 596, 596, 596,
200
+ 596, 596, 596, 300, 300, 300, 300, 227, 318, 300, 315, 315, 315, 300, 227, 227, 269, 270, 586, 587,
201
+ 588, 424, 338, 227, 227, 631, 335, 394, 433, 432, 397, 582, 582, 344, 389, 415, 227, 214, 514, 216,
202
+ 217, 228, 322, 229, 221, 230, 231, 541, 541, 541, 541, 541, 541, 541, 541, 563, 563, 563, 563, 563,
203
+ 563, 563, 563, 561, 561, 561, 561, 561, 561, 561, 561, 305, 305, 305, 305, 305, 305, 305, 305, 615,
204
+ 491, 346, 517, 301, 301, 301, 301, 316, 317, 301, 430, 427, 428, 301, 0, 615, 616, 316, 317, 275,
205
+ 328, 621, 622, 623, 381, 330, 348, 515, 616, 589, 590, 345, 382, 0, 0, 0, 0, 0, 0, 0,
206
206
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
207
207
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
208
- 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 0, 0, 0, 0, 384,
208
+ 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 0, 0, 0, 384,
209
209
  384, 384, 0, 0, 0, 0, 0, 384, 0, 0, 384, 384, 384,
210
210
  ];
211
211
 
@@ -217,18 +217,18 @@ abstract class TagParserData
217
217
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
218
218
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
219
219
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
220
- 2, 2, 2, 2, 2, 2, 2, 2, 5, 5, 5, 5, 64, 68, 5, 31, 31, 31, 5, 61,
221
- 28, 28, 28, 28, 5, 5, 5, 28, 28, 28, 28, 28, 28, 28, 28, 18, 61, 70, 19, 53,
222
- 53, 53, 53, 64, 64, 64, 53, 53, 53, 53, 53, 53, 53, 53, 70, 70, 64, 64, 64, 64,
223
- 64, 64, 7, 7, 7, 7, 9, 70, 7, 10, 10, 20, 7, 9, 9, 10, 10, 10, 13, 13,
224
- 22, 10, 10, 9, 9, 9, 10, 60, 13, 13, 13, 64, 64, 36, 36, 36, 9, 33, 33, 33,
225
- 33, 33, 33, 33, 33, 38, 38, 38, 38, 38, 38, 38, 38, 56, 56, 56, 56, 56, 56, 56,
226
- 56, 57, 57, 57, 57, 57, 57, 57, 57, 59, 59, 59, 59, 59, 59, 59, 59, 37, 37, 37,
227
- 37, 9, 9, 37, 8, 8, 8, 37, 25, 25, 25, 25, 25, 24, 37, 65, 65, 65, 65, 65,
228
- 52, 52, 52, 12, 43, 43, 67, 67, 40, 47, 29, 12, -1, -1, -1, -1, -1, -1, -1, -1,
220
+ 2, 2, 2, 2, 2, 2, 2, 2, 5, 5, 5, 5, 64, 68, 5, 31, 31, 31, 5, 25,
221
+ 25, 25, 25, 25, 5, 5, 5, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 18,
222
+ 61, 64, 64, 64, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 61, 64, 64, 64,
223
+ 64, 64, 64, 7, 7, 7, 7, 9, 19, 7, 52, 52, 52, 7, 9, 9, 65, 65, 65, 65,
224
+ 65, 10, 10, 9, 9, 9, 20, 10, 10, 10, 22, 64, 64, 10, 10, 24, 9, 60, 10, 33,
225
+ 33, 33, 33, 33, 33, 33, 33, 38, 38, 38, 38, 38, 38, 38, 38, 56, 56, 56, 56, 56,
226
+ 56, 56, 56, 57, 57, 57, 57, 57, 57, 57, 57, 59, 59, 59, 59, 59, 59, 59, 59, 70,
227
+ 40, 9, 9, 37, 37, 37, 37, 13, 13, 37, 36, 36, 36, 37, -1, 70, 70, 13, 13, 13,
228
+ 37, 8, 8, 8, 12, 43, 43, 47, 70, 67, 67, 29, 12, -1, -1, -1, -1, -1, -1, -1,
229
229
  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
230
230
  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
231
- -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, 7, 7, 7, 7, -1, -1, -1, -1, 5,
231
+ -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, 7, 7, 7, 7, -1, -1, -1, 5,
232
232
  5, 5, -1, -1, -1, -1, -1, 5, -1, -1, 5, 5, 5,
233
233
  ];
234
234
 
@@ -236,8 +236,8 @@ abstract class TagParserData
236
236
  protected const GotoDefault = [
237
237
  -8192, 283, 124, 295, 353, 182, 373, 324, 594, 580, 379, 264, 601, 281, 280, 441, 339, 278, 390, 340,
238
238
  332, 271, 396, 245, 413, 257, 333, 334, 262, 342, 536, 266, 418, 161, 265, 252, 429, 290, 291, 440,
239
- 260, 507, 279, 327, 511, 347, 282, 516, 570, 263, 292, 267, 533, 249, 217, 293, 225, 214, 313, 203,
240
- 212, 614, 226, 294, 568, 268, 576, 583, 314, 600, 613, 321, 337,
239
+ 260, 507, 279, 327, 511, 347, 282, 516, 570, 263, 292, 267, 533, 249, 218, 293, 225, 215, 313, 204,
240
+ 213, 614, 226, 294, 568, 268, 576, 583, 314, 600, 613, 321, 337,
241
241
  ];
242
242
 
243
243
  /** Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for
@@ -321,12 +321,12 @@ abstract class TagParserData
321
321
  "'<='",
322
322
  "'>'",
323
323
  "'>='",
324
+ "'.'",
324
325
  "'<<'",
325
326
  "'>>'",
326
327
  "'in'",
327
328
  "'+'",
328
329
  "'-'",
329
- "'.'",
330
330
  "'*'",
331
331
  "'/'",
332
332
  "'%'",
@@ -513,7 +513,7 @@ abstract class TagParserData
513
513
  159 => fn() => $this->semValue = new Expression\ClosureNode((bool) $this->semStack[$pos - 10], $this->semStack[$pos - 8], $this->semStack[$pos - 6], $this->semStack[$pos - 5], $this->semStack[$pos - 2], $this->startTokenStack[$pos - 11]->position),
514
514
  160 => fn() => $this->semValue = new Expression\ClosureNode((bool) $this->semStack[$pos - 7], $this->semStack[$pos - 5], $this->semStack[$pos - 3], $this->semStack[$pos - 2], null, $this->startTokenStack[$pos - 8]->position),
515
515
  161 => fn() => $this->semValue = new Expression\NewNode($this->semStack[$pos - 1], $this->semStack[$pos], $this->startTokenStack[$pos - 2]->position),
516
- 167 => fn() => $this->semValue = new Expression\ClosureUseNode($this->semStack[$pos], $this->semStack[$pos - 1], $this->startTokenStack[$pos - 1]->position),
516
+ 167 => fn() => $this->semValue = new Node\ClosureUseNode($this->semStack[$pos], $this->semStack[$pos - 1], $this->startTokenStack[$pos - 1]->position),
517
517
  168, 170 => fn() => $this->semValue = $this->checkFunctionName(new Expression\FunctionCallNode($this->semStack[$pos - 1], $this->semStack[$pos], $this->startTokenStack[$pos - 1]->position)),
518
518
  169, 171 => fn() => $this->semValue = $this->checkFunctionName(new Expression\FunctionCallableNode($this->semStack[$pos - 3], $this->startTokenStack[$pos - 3]->position)),
519
519
  172 => fn() => $this->semValue = new Expression\StaticCallNode($this->semStack[$pos - 3], $this->semStack[$pos - 1], $this->semStack[$pos], $this->startTokenStack[$pos - 3]->position),
@@ -525,7 +525,7 @@ abstract class TagParserData
525
525
  189 => fn() => $this->semValue = new Expression\ArrayNode($this->semStack[$pos - 1], $this->startTokenStack[$pos - 2]->position),
526
526
  190, 247 => fn() => $this->semValue = new Expression\ArrayNode($this->semStack[$pos - 1], $this->startTokenStack[$pos - 3]->position),
527
527
  192 => fn() => $this->semValue = Scalar\StringNode::parse($this->semStack[$pos], $this->startTokenStack[$pos]->position),
528
- 193 => fn() => $this->semValue = Scalar\EncapsedStringNode::parse($this->semStack[$pos - 1], $this->startTokenStack[$pos - 2]->position),
528
+ 193 => fn() => $this->semValue = Scalar\InterpolatedStringNode::parse($this->semStack[$pos - 1], $this->startTokenStack[$pos - 2]->position),
529
529
  194 => fn() => $this->semValue = Scalar\IntegerNode::parse($this->semStack[$pos], $this->startTokenStack[$pos]->position),
530
530
  195 => fn() => $this->semValue = Scalar\FloatNode::parse($this->semStack[$pos], $this->startTokenStack[$pos]->position),
531
531
  197, 278 => fn() => $this->semValue = new Scalar\StringNode($this->semStack[$pos], $this->startTokenStack[$pos]->position),
@@ -559,17 +559,17 @@ abstract class TagParserData
559
559
  array_pop($this->semValue);
560
560
  }
561
561
  },
562
- 253, 255 => fn() => $this->semValue = new Expression\ArrayItemNode($this->semStack[$pos], null, false, false, $this->startTokenStack[$pos]->position),
563
- 254 => fn() => $this->semValue = new Expression\ArrayItemNode($this->semStack[$pos], null, true, false, $this->startTokenStack[$pos - 1]->position),
564
- 256, 258, 259 => fn() => $this->semValue = new Expression\ArrayItemNode($this->semStack[$pos], $this->semStack[$pos - 2], false, false, $this->startTokenStack[$pos - 2]->position),
565
- 257, 260 => fn() => $this->semValue = new Expression\ArrayItemNode($this->semStack[$pos], $this->semStack[$pos - 3], true, false, $this->startTokenStack[$pos - 3]->position),
566
- 261, 262 => fn() => $this->semValue = new Expression\ArrayItemNode($this->semStack[$pos], null, false, true, $this->startTokenStack[$pos - 1]->position),
562
+ 253, 255 => fn() => $this->semValue = new Node\ArrayItemNode($this->semStack[$pos], null, false, false, $this->startTokenStack[$pos]->position),
563
+ 254 => fn() => $this->semValue = new Node\ArrayItemNode($this->semStack[$pos], null, true, false, $this->startTokenStack[$pos - 1]->position),
564
+ 256, 258, 259 => fn() => $this->semValue = new Node\ArrayItemNode($this->semStack[$pos], $this->semStack[$pos - 2], false, false, $this->startTokenStack[$pos - 2]->position),
565
+ 257, 260 => fn() => $this->semValue = new Node\ArrayItemNode($this->semStack[$pos], $this->semStack[$pos - 3], true, false, $this->startTokenStack[$pos - 3]->position),
566
+ 261, 262 => fn() => $this->semValue = new Node\ArrayItemNode($this->semStack[$pos], null, false, true, $this->startTokenStack[$pos - 1]->position),
567
567
  263, 264 => function () use ($pos) {
568
568
  $this->semStack[$pos - 1][] = $this->semStack[$pos];
569
569
  $this->semValue = $this->semStack[$pos - 1];
570
570
  },
571
571
  266 => fn() => $this->semValue = [$this->semStack[$pos - 1], $this->semStack[$pos]],
572
- 267 => fn() => $this->semValue = new Scalar\EncapsedStringPartNode($this->semStack[$pos], $this->startTokenStack[$pos]->position),
572
+ 267 => fn() => $this->semValue = new Node\InterpolatedStringPartNode($this->semStack[$pos], $this->startTokenStack[$pos]->position),
573
573
  268 => fn() => $this->semValue = new Expression\VariableNode($this->semStack[$pos], $this->startTokenStack[$pos]->position),
574
574
  274, 275 => fn() => $this->semValue = new Expression\VariableNode($this->semStack[$pos - 1], $this->startTokenStack[$pos - 2]->position),
575
575
  276 => fn() => $this->semValue = new Expression\ArrayAccessNode($this->semStack[$pos - 4], $this->semStack[$pos - 2], $this->startTokenStack[$pos - 5]->position),
@@ -238,8 +238,6 @@ final class TemplateParser
238
238
  throw new \LogicException("Incorrect behavior of {{$startTag->name}} parser, unexpected returned value (on line {$startTag->position->line})");
239
239
  }
240
240
 
241
- $this->checkNodeCompatibility($node);
242
-
243
241
  if ($this->location === self::LocationHead && $startTag->outputMode !== $startTag::OutputNone) {
244
242
  $this->location = self::LocationText;
245
243
  }
@@ -447,17 +445,4 @@ final class TemplateParser
447
445
  {
448
446
  return !$this->policy || $this->policy->isTagAllowed($name);
449
447
  }
450
-
451
-
452
- public function checkNodeCompatibility(Node $node): void
453
- {
454
- static $prev = ['Nette\Bridges\ApplicationLatte\Nodes\NNonceNode' => true];
455
- if (
456
- !isset($prev[$node::class])
457
- && (new \ReflectionMethod($node, 'getIterator'))->getDeclaringClass()->getName() === Node::class
458
- ) {
459
- trigger_error('Class ' . $node::class . ' should contain method getIterator(), see https://bit.ly/latte-666');
460
- }
461
- $prev[$node::class] = true;
462
- }
463
448
  }
@@ -256,7 +256,9 @@ final class TemplateParserHtml
256
256
  default => null,
257
257
  });
258
258
  } catch (CompileException $e) {
259
- if ($followsLatte) {
259
+ if ($followsLatte // attribute name together with the value inside the tag
260
+ && $stream->peek() // it is not lexer exception
261
+ ) {
260
262
  $stream->seek($save);
261
263
  return $this->parser->parseLatteStatement();
262
264
  }
@@ -454,7 +456,6 @@ final class TemplateParserHtml
454
456
 
455
457
  } elseif ($res instanceof Node) {
456
458
  $this->parser->ensureIsConsumed($tag);
457
- $this->parser->checkNodeCompatibility($res);
458
459
  $res->position = $tag->position;
459
460
  $tag->replaceNAttribute($res);
460
461
  $this->parser->popTag();
@@ -478,7 +479,6 @@ final class TemplateParserHtml
478
479
  while ([$gen, $tag] = array_pop($toClose)) {
479
480
  $gen->send([$node, null]);
480
481
  $node = $gen->getReturn();
481
- $this->parser->checkNodeCompatibility($node);
482
482
  $node->position = $tag->position;
483
483
  $this->parser->popTag();
484
484
  $this->parser->ensureIsConsumed($tag);
@@ -19,8 +19,8 @@ class Engine
19
19
  {
20
20
  use Strict;
21
21
 
22
- public const VERSION = '3.0.5';
23
- public const VERSION_ID = 30005;
22
+ public const VERSION = '3.0.6';
23
+ public const VERSION_ID = 30006;
24
24
 
25
25
  /** @deprecated use ContentType::* */
26
26
  public const
@@ -248,6 +248,8 @@ class Engine
248
248
  if ((include $file) === false) {
249
249
  throw new RuntimeException("Unable to load '$file'.");
250
250
  }
251
+
252
+ flock($lock, LOCK_UN);
251
253
  }
252
254
 
253
255
 
@@ -314,7 +316,7 @@ class Engine
314
316
  ];
315
317
  foreach ($this->extensions as $extension) {
316
318
  $key[] = [
317
- preg_replace('~\$.*~', '', $extension::class), // remove id from anonymous class
319
+ get_debug_type($extension),
318
320
  $extension->getCacheKey($this),
319
321
  ];
320
322
  }
@@ -550,8 +552,6 @@ class Engine
550
552
  {
551
553
  if (is_array($params)) {
552
554
  return $params;
553
- } elseif (!is_object($params)) {
554
- throw new \InvalidArgumentException(sprintf('Engine::render() expects array|object, %s given.', gettype($params)));
555
555
  }
556
556
 
557
557
  $methods = (new \ReflectionClass($params))->getMethods(\ReflectionMethod::IS_PUBLIC);
@@ -49,7 +49,7 @@ class CachingIterator extends \CachingIterator implements \Countable
49
49
  $iterator = new \IteratorIterator($iterator);
50
50
  }
51
51
  } else {
52
- throw new \InvalidArgumentException(sprintf('Invalid argument passed to foreach; array or Traversable expected, %s given.', is_object($iterator) ? $iterator::class : gettype($iterator)));
52
+ throw new \InvalidArgumentException(sprintf('Invalid argument passed to foreach; array or Traversable expected, %s given.', get_debug_type($iterator)));
53
53
  }
54
54
 
55
55
  parent::__construct($iterator, 0);
@@ -62,7 +62,7 @@ class ParametersNode extends StatementNode
62
62
  $stream->seek($save);
63
63
  $stream->throwUnexpectedException(addendum: ' in ' . $tag->getNotation());
64
64
  }
65
- } while ($stream->tryConsume(','));
65
+ } while ($stream->tryConsume(',') && !$stream->peek()->isEnd());
66
66
 
67
67
  return $params;
68
68
  }
@@ -58,7 +58,7 @@ class VarNode extends StatementNode
58
58
  $stream->seek($save);
59
59
  $stream->throwUnexpectedException(addendum: ' in ' . $tag->getNotation());
60
60
  }
61
- } while ($stream->tryConsume(','));
61
+ } while ($stream->tryConsume(',') && !$stream->peek()->isEnd());
62
62
 
63
63
  return $res;
64
64
  }
@@ -170,9 +170,9 @@ class Filters
170
170
 
171
171
 
172
172
  /**
173
- * Escapes CSS/JS for usage in <script> and <style>..
173
+ * Converts JS and CSS for usage in <script> or <style>
174
174
  */
175
- public static function escapeHtmlRawText($s): string
175
+ public static function convertJSToHtmlRawText($s): string
176
176
  {
177
177
  return preg_replace('#</(script|style)#i', '<\/$1', (string) $s);
178
178
  }