diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ebb088..d51a83c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added support for PHP8.2 - Added a new way to extend Smarty functionality using `Smarty::addExtension()` +- Full support for ternary `{$test ? $a : $b}` and `{$var ?: $alternative}` [#881](https://github.com/smarty-php/smarty/issues/881) ### Changed - All Smarty code is now in the \Smarty namespace. For simple use-cases, you only need to add diff --git a/docs/designers/language-basic-syntax/index.md b/docs/designers/language-basic-syntax/index.md index c0a12a9b..05c0ba69 100644 --- a/docs/designers/language-basic-syntax/index.md +++ b/docs/designers/language-basic-syntax/index.md @@ -26,8 +26,8 @@ The basis components of the Smarty syntax are: - [Comments](language-syntax-comments.md) - [Variables](language-syntax-variables.md) +- [Operators](language-syntax-operators.md) - [Functions](language-syntax-functions.md) - [Attributes](language-syntax-attributes.md) - [Quotes](language-syntax-quotes.md) -- [Math](language-math.md) - [Escaping](language-escaping.md) diff --git a/docs/designers/language-basic-syntax/language-math.md b/docs/designers/language-basic-syntax/language-math.md deleted file mode 100644 index a9a43efd..00000000 --- a/docs/designers/language-basic-syntax/language-math.md +++ /dev/null @@ -1,28 +0,0 @@ -# Math - -Math can be applied directly to variable values. - -## Examples -```smarty -{$foo+1} - -{$foo*$bar} - -{* some more complicated examples *} - -{$foo->bar-$bar[1]*$baz->foo->bar()-3*7} - -{if ($foo+$bar.test%$baz*134232+10+$b+10)} - -{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"} - -{assign var="foo" value="`$foo+$bar`"} -``` - -> **Note** -> -> Although Smarty can handle some very complex expressions and syntax, -> it is a good rule of thumb to keep the template syntax minimal and -> focused on presentation. If you find your template syntax getting too -> complex, it may be a good idea to move the bits that do not deal -> explicitly with presentation to PHP by way of plugins or modifiers. diff --git a/docs/designers/language-basic-syntax/language-syntax-operators.md b/docs/designers/language-basic-syntax/language-syntax-operators.md new file mode 100644 index 00000000..a3cc66b7 --- /dev/null +++ b/docs/designers/language-basic-syntax/language-syntax-operators.md @@ -0,0 +1,50 @@ +# Operators + +## Basic + +Various basic operators can be applied directly to variable values. + +## Examples +```smarty +{$foo + 1} + +{$foo * $bar} + +{$foo->bar - $bar[1] * $baz->foo->bar() -3 * 7} + +{if ($foo + $bar.test % $baz * 134232 + 10 + $b + 10)} + ... +{/if} + +{$foo = $foo + $bar} +``` + +> **Note** +> +> Although Smarty can handle some very complex expressions and syntax, +> it is a good rule of thumb to keep the template syntax minimal and +> focused on presentation. If you find your template syntax getting too +> complex, it may be a good idea to move the bits that do not deal +> explicitly with presentation to PHP by way of plugins or modifiers. + +## Ternary +You can use the `?:` (or ternary) operator to test one expression and present the value +of the second or third expression, based on the result of te test. + +In other words: +```smarty +{$test ? "OK" : "FAIL"} +``` +will result in OK if `$test` is set to true, and in FAIL otherwise. + +There is also a shorthand `?:` operator: +```smarty +{$myVar ?: "empty"} +``` +will result in 'empty' if `$myVar` is not set or set to something that evaluates to false, such as an empty string. +If `$myVar` is set to something that evaluates to true, the value of `$myVar` is returned. So, the following will +return 'hello': +```smarty +{$myVar="hello"} +{$myVar ?: "empty"} +``` \ No newline at end of file diff --git a/src/Parser/TemplateParser.php b/src/Parser/TemplateParser.php index 7ae1bb3d..6e8e352d 100644 --- a/src/Parser/TemplateParser.php +++ b/src/Parser/TemplateParser.php @@ -263,322 +263,322 @@ class TemplateParser const TP_ARRAYOPEN = 57; const TP_QUOTE = 58; const TP_BACKTICK = 59; - const YY_NO_ACTION = 516; - const YY_ACCEPT_ACTION = 515; - const YY_ERROR_ACTION = 514; + const YY_NO_ACTION = 520; + const YY_ACCEPT_ACTION = 519; + const YY_ERROR_ACTION = 518; - const YY_SZ_ACTTAB = 1963; + const YY_SZ_ACTTAB = 2040; public static $yy_action = array( - 238, 239, 240, 1, 302, 127, 206, 185, 99, 6, - 53, 237, 212, 206, 30, 105, 220, 387, 151, 207, - 252, 208, 274, 200, 387, 22, 387, 309, 41, 387, - 122, 42, 43, 268, 216, 387, 226, 387, 195, 387, - 52, 4, 315, 290, 55, 304, 95, 215, 5, 50, - 238, 239, 240, 1, 290, 93, 381, 51, 227, 6, - 53, 260, 212, 171, 293, 105, 515, 92, 381, 207, - 252, 208, 132, 214, 381, 22, 254, 428, 41, 12, - 192, 42, 43, 268, 216, 169, 272, 217, 195, 428, - 52, 4, 131, 290, 222, 44, 21, 275, 5, 50, - 238, 239, 240, 1, 160, 129, 135, 194, 209, 6, - 53, 3, 212, 95, 247, 105, 44, 21, 275, 207, - 252, 208, 302, 214, 206, 22, 90, 52, 41, 13, - 290, 42, 43, 268, 216, 14, 272, 95, 195, 27, - 52, 4, 108, 290, 290, 145, 428, 248, 5, 50, - 238, 239, 240, 1, 137, 129, 192, 186, 428, 6, - 53, 484, 212, 298, 247, 105, 44, 21, 275, 207, - 252, 208, 210, 214, 150, 22, 248, 279, 41, 147, - 192, 42, 43, 268, 216, 122, 272, 228, 195, 247, - 52, 4, 144, 290, 230, 191, 136, 100, 5, 50, - 238, 239, 240, 1, 161, 128, 247, 194, 175, 6, - 53, 34, 212, 95, 247, 105, 44, 21, 275, 207, - 252, 208, 173, 214, 236, 11, 170, 293, 41, 95, - 280, 42, 43, 268, 216, 146, 272, 133, 195, 87, - 52, 4, 108, 290, 121, 247, 192, 257, 5, 50, - 238, 239, 240, 1, 94, 129, 141, 181, 108, 6, - 53, 248, 212, 256, 176, 105, 247, 288, 292, 207, - 252, 208, 26, 203, 246, 22, 235, 236, 41, 15, - 248, 42, 43, 268, 216, 148, 272, 192, 195, 88, - 52, 4, 89, 290, 33, 247, 170, 293, 5, 50, - 238, 239, 240, 1, 19, 130, 184, 194, 262, 6, - 53, 13, 212, 104, 176, 105, 149, 14, 428, 207, - 252, 208, 441, 214, 263, 22, 247, 224, 41, 441, - 428, 42, 43, 268, 216, 312, 272, 143, 195, 175, - 52, 4, 163, 290, 290, 175, 294, 247, 5, 50, - 238, 239, 240, 1, 255, 129, 132, 179, 348, 6, - 53, 248, 212, 12, 348, 105, 138, 176, 251, 207, - 252, 208, 25, 214, 291, 22, 100, 49, 41, 192, - 37, 42, 43, 268, 216, 228, 272, 228, 195, 29, - 52, 4, 325, 290, 229, 100, 348, 100, 5, 50, - 238, 239, 240, 1, 255, 129, 441, 194, 348, 6, - 53, 7, 212, 441, 348, 105, 255, 244, 134, 207, - 252, 208, 168, 180, 17, 22, 260, 49, 41, 83, - 14, 42, 43, 268, 216, 9, 272, 305, 195, 49, - 52, 4, 144, 290, 39, 40, 38, 176, 5, 50, - 238, 239, 240, 1, 300, 131, 290, 194, 139, 6, - 53, 283, 284, 285, 286, 105, 159, 299, 247, 207, - 252, 208, 84, 214, 255, 20, 247, 162, 45, 172, - 293, 42, 43, 268, 216, 37, 272, 247, 195, 251, - 52, 4, 165, 290, 39, 40, 38, 49, 5, 50, - 238, 239, 240, 1, 310, 131, 428, 194, 322, 6, - 53, 283, 284, 285, 286, 105, 16, 176, 428, 207, - 252, 208, 324, 214, 152, 20, 204, 189, 41, 156, - 429, 42, 43, 268, 216, 289, 272, 166, 195, 158, - 52, 4, 429, 290, 121, 10, 290, 223, 5, 50, - 277, 205, 206, 243, 94, 86, 102, 109, 183, 96, - 82, 9, 176, 215, 25, 94, 316, 288, 264, 32, - 319, 311, 8, 271, 196, 273, 85, 278, 288, 308, - 91, 277, 205, 206, 243, 250, 86, 102, 18, 182, - 96, 62, 249, 39, 40, 38, 94, 215, 25, 264, - 317, 13, 164, 142, 271, 196, 273, 14, 278, 288, - 283, 284, 285, 286, 277, 190, 206, 245, 167, 107, - 102, 153, 183, 96, 82, 277, 154, 206, 234, 94, - 107, 241, 264, 193, 111, 74, 242, 271, 196, 273, - 94, 278, 288, 264, 192, 174, 255, 106, 271, 196, - 273, 250, 278, 288, 18, 253, 349, 277, 249, 206, - 113, 261, 107, 199, 307, 193, 111, 74, 349, 49, - 265, 267, 94, 215, 349, 264, 250, 23, 269, 18, - 271, 196, 273, 249, 278, 288, 270, 7, 287, 277, - 219, 206, 54, 225, 101, 198, 307, 193, 114, 47, - 277, 112, 206, 313, 94, 107, 155, 264, 193, 114, - 69, 157, 271, 196, 273, 94, 278, 288, 264, 250, - 314, 323, 18, 271, 196, 273, 249, 278, 288, 277, - 34, 206, 326, 250, 107, 202, 18, 193, 114, 69, - 249, 35, 296, 457, 94, 296, 457, 264, 296, 13, - 457, 296, 271, 196, 273, 14, 278, 288, 211, 36, - 277, 13, 206, 296, 197, 107, 296, 14, 193, 111, - 74, 296, 39, 40, 38, 94, 296, 131, 264, 258, - 296, 296, 457, 271, 196, 273, 296, 278, 288, 283, - 284, 285, 286, 277, 296, 206, 296, 457, 107, 306, - 457, 193, 114, 69, 457, 296, 296, 296, 94, 296, - 259, 264, 52, 296, 192, 290, 271, 196, 273, 296, - 278, 288, 277, 296, 206, 296, 383, 101, 201, 296, - 193, 114, 61, 296, 229, 296, 296, 94, 383, 296, - 264, 296, 296, 296, 383, 271, 196, 273, 296, 278, - 288, 303, 296, 296, 213, 296, 296, 238, 239, 240, - 2, 457, 301, 192, 457, 296, 6, 53, 457, 441, - 296, 296, 105, 266, 296, 352, 207, 252, 208, 221, - 296, 296, 296, 296, 296, 296, 296, 13, 296, 296, - 296, 296, 296, 14, 296, 441, 428, 296, 441, 296, - 457, 296, 441, 281, 296, 296, 296, 28, 428, 296, - 303, 296, 296, 213, 296, 296, 238, 239, 240, 2, - 457, 301, 192, 457, 296, 6, 53, 457, 441, 296, - 296, 105, 266, 296, 380, 207, 252, 208, 296, 296, - 296, 296, 296, 296, 296, 296, 380, 296, 296, 296, - 296, 296, 380, 296, 441, 296, 296, 441, 296, 457, - 296, 441, 296, 296, 296, 297, 28, 296, 296, 231, - 232, 233, 125, 296, 296, 238, 239, 240, 1, 296, - 13, 296, 296, 296, 6, 53, 14, 296, 296, 296, - 105, 39, 40, 38, 207, 252, 208, 277, 296, 206, - 296, 296, 107, 296, 296, 188, 110, 60, 283, 284, - 285, 286, 94, 296, 296, 264, 296, 296, 296, 296, - 271, 196, 273, 296, 278, 288, 296, 296, 296, 296, - 296, 296, 277, 296, 206, 296, 296, 107, 296, 296, - 193, 97, 81, 277, 296, 206, 296, 94, 107, 296, - 264, 193, 98, 80, 296, 271, 196, 273, 94, 278, - 288, 264, 296, 296, 296, 296, 271, 196, 273, 296, - 278, 288, 277, 296, 206, 296, 296, 107, 296, 296, - 193, 114, 56, 296, 296, 296, 296, 94, 296, 296, - 264, 296, 296, 296, 296, 271, 196, 273, 296, 278, - 288, 296, 296, 277, 296, 206, 296, 296, 107, 296, - 296, 193, 114, 68, 277, 296, 206, 296, 94, 107, - 296, 264, 193, 97, 57, 296, 271, 196, 273, 94, - 278, 288, 264, 296, 296, 296, 296, 271, 196, 273, - 296, 278, 288, 277, 296, 206, 296, 296, 107, 296, - 296, 193, 114, 67, 296, 296, 296, 296, 94, 296, - 296, 264, 296, 296, 296, 296, 271, 196, 273, 296, - 278, 288, 296, 296, 277, 296, 206, 296, 296, 107, - 296, 296, 193, 114, 58, 277, 296, 206, 296, 94, - 107, 296, 264, 193, 114, 59, 296, 271, 196, 273, - 94, 278, 288, 264, 296, 296, 296, 296, 271, 196, - 273, 296, 278, 288, 277, 296, 206, 296, 296, 107, - 296, 296, 193, 114, 70, 296, 296, 296, 296, 94, - 296, 296, 264, 296, 296, 296, 296, 271, 196, 273, - 296, 278, 288, 296, 296, 277, 296, 206, 296, 296, - 107, 296, 296, 193, 114, 61, 277, 296, 206, 296, - 94, 107, 296, 264, 193, 114, 66, 296, 271, 196, - 273, 94, 278, 288, 264, 296, 296, 296, 296, 271, - 196, 273, 296, 278, 288, 277, 296, 206, 296, 296, - 107, 296, 296, 193, 114, 71, 296, 296, 296, 296, - 94, 296, 296, 264, 296, 296, 296, 296, 271, 196, - 273, 296, 278, 288, 296, 296, 277, 296, 206, 296, - 296, 107, 296, 296, 193, 114, 72, 277, 296, 206, - 296, 94, 107, 296, 264, 193, 114, 73, 296, 271, - 196, 273, 94, 278, 288, 264, 296, 296, 296, 296, - 271, 196, 273, 296, 278, 288, 277, 296, 206, 296, - 296, 107, 296, 296, 193, 114, 75, 296, 296, 296, - 296, 94, 296, 296, 264, 296, 296, 296, 296, 271, - 196, 273, 296, 278, 288, 296, 296, 277, 296, 206, - 296, 296, 107, 296, 296, 187, 114, 63, 277, 296, - 206, 296, 94, 107, 296, 264, 193, 114, 64, 296, - 271, 196, 273, 94, 278, 288, 264, 296, 296, 296, - 296, 271, 196, 273, 296, 278, 288, 277, 296, 206, - 296, 296, 107, 296, 296, 193, 114, 65, 296, 296, - 296, 296, 94, 296, 296, 264, 296, 296, 296, 296, - 271, 196, 273, 296, 278, 288, 296, 296, 277, 296, - 206, 296, 296, 107, 296, 296, 193, 114, 76, 277, - 296, 206, 296, 94, 107, 296, 264, 193, 114, 77, - 296, 271, 196, 273, 94, 278, 288, 264, 296, 296, - 296, 296, 271, 196, 273, 296, 278, 288, 277, 296, - 206, 296, 296, 107, 296, 296, 193, 114, 78, 296, - 296, 296, 296, 94, 296, 296, 264, 296, 296, 296, - 296, 271, 196, 273, 296, 278, 288, 296, 296, 277, - 296, 206, 296, 296, 107, 296, 296, 193, 114, 79, - 277, 296, 206, 296, 94, 107, 296, 264, 193, 114, - 46, 296, 271, 196, 273, 94, 278, 288, 264, 296, - 296, 296, 296, 271, 196, 273, 24, 278, 288, 277, - 296, 206, 296, 457, 107, 296, 457, 193, 114, 48, - 457, 441, 296, 296, 94, 266, 296, 264, 296, 296, - 296, 296, 271, 196, 273, 296, 278, 288, 296, 296, - 277, 296, 206, 296, 296, 107, 296, 441, 193, 126, - 441, 277, 457, 206, 441, 94, 107, 296, 296, 193, - 120, 296, 320, 271, 196, 273, 94, 278, 288, 296, - 296, 296, 296, 276, 271, 196, 273, 213, 278, 288, - 277, 296, 206, 296, 457, 107, 296, 457, 193, 124, - 3, 457, 441, 296, 296, 94, 266, 296, 296, 296, - 296, 296, 296, 271, 196, 273, 296, 278, 288, 296, - 296, 277, 296, 206, 296, 296, 107, 296, 441, 193, - 115, 441, 277, 457, 206, 441, 94, 107, 296, 296, - 193, 116, 296, 296, 271, 196, 273, 94, 278, 288, - 296, 296, 296, 296, 296, 271, 196, 273, 213, 278, - 288, 277, 296, 206, 296, 457, 107, 296, 457, 193, - 117, 33, 457, 441, 296, 296, 94, 266, 296, 296, - 296, 296, 296, 296, 271, 196, 273, 296, 278, 288, - 296, 296, 277, 296, 206, 296, 296, 107, 296, 441, - 193, 118, 441, 277, 457, 206, 441, 94, 107, 296, - 395, 193, 119, 296, 296, 271, 196, 273, 94, 278, - 288, 296, 296, 296, 296, 296, 271, 196, 273, 296, - 278, 288, 277, 103, 206, 296, 296, 107, 296, 296, - 193, 123, 428, 296, 395, 395, 395, 94, 296, 39, - 40, 38, 296, 296, 428, 271, 196, 273, 296, 278, - 288, 395, 395, 395, 395, 296, 283, 284, 285, 286, - 296, 140, 296, 318, 39, 40, 38, 296, 296, 296, - 296, 39, 40, 38, 296, 296, 296, 39, 40, 38, - 296, 283, 284, 285, 286, 295, 296, 296, 283, 284, - 285, 286, 282, 296, 283, 284, 285, 286, 177, 218, - 39, 40, 38, 296, 296, 296, 178, 296, 39, 40, - 38, 321, 296, 296, 296, 296, 296, 283, 284, 285, - 286, 39, 40, 38, 31, 283, 284, 285, 286, 39, - 40, 38, 296, 296, 39, 40, 38, 296, 283, 284, - 285, 286, 296, 296, 296, 296, 283, 284, 285, 286, - 296, 283, 284, 285, 286, 296, 296, 296, 39, 40, - 38, 457, 296, 296, 457, 296, 296, 296, 457, 441, - 296, 296, 296, 296, 296, 283, 284, 285, 286, 296, - 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, - 296, 296, 296, 296, 296, 441, 296, 296, 441, 296, - 457, 296, 441, + 240, 241, 242, 1, 135, 130, 230, 188, 101, 6, + 54, 12, 215, 232, 194, 107, 102, 389, 33, 210, + 254, 211, 97, 203, 389, 21, 389, 310, 42, 389, + 138, 43, 44, 270, 219, 389, 228, 389, 198, 389, + 53, 4, 317, 291, 32, 34, 218, 218, 5, 51, + 92, 240, 241, 242, 1, 136, 133, 383, 197, 229, + 6, 54, 262, 215, 174, 294, 107, 150, 291, 383, + 210, 254, 211, 445, 217, 383, 21, 249, 432, 42, + 445, 97, 43, 44, 270, 219, 303, 274, 209, 198, + 432, 53, 4, 134, 291, 224, 178, 519, 94, 5, + 51, 240, 241, 242, 1, 163, 95, 135, 52, 195, + 6, 54, 195, 215, 12, 249, 107, 45, 22, 277, + 210, 254, 211, 246, 217, 213, 21, 299, 53, 42, + 152, 291, 43, 44, 270, 219, 239, 274, 209, 198, + 249, 53, 4, 147, 291, 45, 22, 277, 147, 5, + 51, 240, 241, 242, 1, 140, 132, 97, 197, 178, + 6, 54, 3, 215, 97, 249, 107, 45, 22, 277, + 210, 254, 211, 276, 217, 148, 21, 250, 35, 42, + 97, 125, 43, 44, 270, 219, 110, 274, 144, 198, + 488, 53, 4, 110, 291, 195, 38, 139, 249, 5, + 51, 240, 241, 242, 1, 164, 132, 249, 189, 110, + 6, 54, 250, 215, 250, 249, 107, 45, 22, 277, + 210, 254, 211, 153, 217, 250, 21, 173, 294, 42, + 281, 432, 43, 44, 270, 219, 149, 274, 125, 198, + 89, 53, 4, 432, 291, 124, 249, 433, 259, 5, + 51, 240, 241, 242, 1, 96, 131, 146, 197, 433, + 6, 54, 9, 215, 258, 179, 107, 249, 289, 293, + 210, 254, 211, 172, 217, 220, 11, 195, 23, 42, + 309, 250, 43, 44, 270, 219, 151, 274, 195, 198, + 90, 53, 4, 24, 291, 292, 249, 173, 294, 5, + 51, 240, 241, 242, 1, 20, 132, 187, 184, 264, + 6, 54, 14, 215, 195, 179, 107, 142, 15, 432, + 210, 254, 211, 171, 206, 265, 21, 249, 226, 42, + 162, 432, 43, 44, 270, 219, 314, 274, 218, 198, + 249, 53, 4, 166, 291, 291, 313, 295, 179, 5, + 51, 240, 241, 242, 1, 257, 132, 257, 182, 350, + 6, 54, 195, 215, 282, 350, 107, 141, 179, 253, + 210, 254, 211, 248, 217, 14, 21, 102, 50, 42, + 50, 15, 43, 44, 270, 219, 230, 274, 25, 198, + 106, 53, 4, 327, 291, 301, 102, 350, 168, 5, + 51, 240, 241, 242, 1, 257, 132, 230, 197, 350, + 6, 54, 26, 215, 231, 350, 107, 102, 28, 432, + 210, 254, 211, 179, 183, 176, 21, 238, 50, 42, + 18, 432, 43, 44, 270, 219, 15, 274, 85, 198, + 7, 53, 4, 137, 291, 40, 41, 39, 13, 5, + 51, 240, 241, 242, 1, 169, 134, 86, 197, 165, + 6, 54, 284, 285, 286, 287, 107, 17, 300, 249, + 210, 254, 211, 326, 217, 155, 21, 175, 294, 46, + 179, 291, 43, 44, 270, 219, 257, 274, 262, 198, + 159, 53, 4, 324, 291, 40, 41, 39, 13, 5, + 51, 240, 241, 242, 1, 303, 134, 209, 197, 50, + 6, 54, 284, 285, 286, 287, 107, 257, 207, 192, + 210, 254, 211, 29, 217, 222, 21, 154, 9, 42, + 306, 291, 43, 44, 270, 219, 445, 274, 256, 198, + 50, 53, 4, 445, 291, 56, 305, 312, 161, 5, + 51, 279, 208, 209, 245, 252, 88, 104, 19, 186, + 98, 84, 251, 291, 252, 461, 96, 19, 461, 266, + 212, 251, 461, 178, 273, 199, 275, 38, 280, 289, + 237, 238, 279, 208, 209, 245, 252, 88, 104, 19, + 185, 98, 62, 251, 134, 87, 260, 96, 8, 16, + 266, 10, 14, 221, 145, 273, 199, 275, 15, 280, + 289, 253, 91, 111, 24, 279, 318, 209, 247, 290, + 109, 104, 193, 186, 98, 84, 279, 261, 209, 53, + 96, 109, 291, 266, 196, 114, 74, 156, 273, 199, + 275, 96, 280, 289, 266, 195, 24, 195, 319, 273, + 199, 275, 93, 280, 289, 167, 157, 351, 279, 385, + 209, 236, 243, 109, 202, 308, 196, 114, 74, 351, + 170, 385, 244, 96, 177, 351, 266, 385, 108, 255, + 116, 273, 199, 275, 263, 280, 289, 267, 269, 271, + 279, 218, 209, 272, 7, 103, 201, 308, 196, 117, + 48, 279, 115, 209, 288, 96, 109, 55, 266, 196, + 117, 69, 35, 273, 199, 275, 96, 280, 289, 266, + 252, 227, 315, 19, 273, 199, 275, 251, 280, 289, + 279, 158, 209, 160, 252, 109, 205, 19, 196, 117, + 69, 251, 325, 316, 461, 96, 36, 461, 266, 328, + 14, 461, 298, 273, 199, 275, 15, 280, 289, 214, + 298, 279, 298, 209, 298, 200, 109, 298, 195, 196, + 114, 74, 124, 298, 298, 225, 96, 298, 298, 266, + 382, 195, 96, 461, 273, 199, 275, 298, 280, 289, + 298, 298, 382, 354, 279, 289, 209, 223, 382, 109, + 307, 298, 196, 117, 69, 14, 298, 298, 298, 96, + 298, 15, 266, 298, 432, 298, 298, 273, 199, 275, + 298, 280, 289, 279, 298, 209, 432, 298, 103, 204, + 298, 196, 117, 60, 298, 231, 298, 298, 96, 298, + 298, 266, 298, 298, 298, 298, 273, 199, 275, 298, + 280, 289, 304, 105, 298, 298, 298, 298, 240, 241, + 242, 2, 298, 302, 298, 298, 298, 6, 54, 40, + 41, 39, 13, 107, 298, 298, 298, 210, 254, 211, + 298, 298, 37, 298, 14, 298, 284, 285, 286, 287, + 15, 298, 298, 298, 298, 40, 41, 39, 13, 298, + 298, 298, 298, 298, 298, 298, 298, 297, 27, 298, + 298, 304, 284, 285, 286, 287, 298, 240, 241, 242, + 2, 298, 302, 298, 298, 298, 6, 54, 298, 298, + 298, 298, 107, 298, 14, 298, 210, 254, 211, 298, + 15, 298, 298, 298, 298, 40, 41, 39, 13, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 284, 285, 286, 287, 298, 27, 298, 298, + 233, 234, 235, 128, 298, 298, 240, 241, 242, 1, + 298, 298, 298, 298, 298, 6, 54, 298, 298, 298, + 298, 107, 298, 298, 298, 210, 254, 211, 279, 298, + 209, 298, 298, 109, 298, 298, 191, 112, 61, 298, + 298, 298, 298, 96, 298, 298, 266, 298, 298, 298, + 298, 273, 199, 275, 298, 280, 289, 298, 298, 298, + 298, 298, 298, 279, 298, 209, 298, 298, 109, 298, + 298, 196, 113, 66, 279, 298, 209, 298, 96, 109, + 298, 266, 196, 99, 83, 298, 273, 199, 275, 96, + 280, 289, 266, 298, 298, 298, 298, 273, 199, 275, + 298, 280, 289, 279, 298, 209, 298, 298, 109, 298, + 298, 196, 100, 82, 298, 298, 298, 298, 96, 298, + 298, 266, 298, 298, 298, 298, 273, 199, 275, 298, + 280, 289, 298, 298, 279, 298, 209, 298, 298, 109, + 298, 298, 196, 117, 57, 279, 298, 209, 298, 96, + 109, 298, 266, 196, 117, 68, 298, 273, 199, 275, + 96, 280, 289, 266, 298, 298, 298, 298, 273, 199, + 275, 298, 280, 289, 279, 298, 209, 298, 298, 109, + 298, 298, 196, 99, 58, 298, 298, 298, 298, 96, + 298, 298, 266, 298, 298, 298, 298, 273, 199, 275, + 298, 280, 289, 298, 298, 279, 298, 209, 298, 298, + 109, 298, 298, 196, 117, 67, 279, 298, 209, 298, + 96, 109, 298, 266, 196, 117, 59, 298, 273, 199, + 275, 96, 280, 289, 266, 298, 298, 298, 298, 273, + 199, 275, 298, 280, 289, 279, 298, 209, 298, 298, + 109, 298, 298, 196, 117, 60, 298, 298, 298, 298, + 96, 298, 298, 266, 298, 298, 298, 298, 273, 199, + 275, 298, 280, 289, 298, 298, 279, 298, 209, 298, + 298, 109, 298, 298, 196, 117, 70, 279, 298, 209, + 298, 96, 109, 298, 266, 196, 117, 71, 298, 273, + 199, 275, 96, 280, 289, 266, 298, 298, 298, 298, + 273, 199, 275, 298, 280, 289, 279, 298, 209, 298, + 298, 109, 298, 298, 196, 117, 72, 298, 298, 298, + 298, 96, 298, 298, 266, 298, 298, 298, 298, 273, + 199, 275, 298, 280, 289, 298, 298, 279, 298, 209, + 298, 298, 109, 298, 298, 196, 117, 73, 279, 298, + 209, 298, 96, 109, 298, 266, 196, 117, 75, 298, + 273, 199, 275, 96, 280, 289, 266, 298, 298, 298, + 298, 273, 199, 275, 298, 280, 289, 279, 298, 209, + 298, 298, 109, 298, 298, 190, 117, 63, 298, 298, + 298, 298, 96, 298, 298, 266, 298, 298, 298, 298, + 273, 199, 275, 298, 280, 289, 298, 298, 279, 298, + 209, 298, 298, 109, 298, 298, 196, 117, 64, 279, + 298, 209, 298, 96, 109, 298, 266, 196, 117, 65, + 298, 273, 199, 275, 96, 280, 289, 266, 298, 298, + 298, 298, 273, 199, 275, 298, 280, 289, 279, 298, + 209, 298, 298, 109, 298, 298, 196, 117, 76, 298, + 298, 298, 298, 96, 298, 298, 266, 298, 298, 298, + 298, 273, 199, 275, 298, 280, 289, 298, 298, 279, + 298, 209, 298, 298, 109, 298, 298, 196, 117, 77, + 279, 298, 209, 298, 96, 109, 298, 266, 196, 117, + 78, 298, 273, 199, 275, 96, 280, 289, 266, 298, + 298, 298, 298, 273, 199, 275, 298, 280, 289, 279, + 298, 209, 298, 298, 109, 298, 298, 196, 117, 79, + 298, 298, 298, 298, 96, 298, 298, 266, 298, 298, + 298, 298, 273, 199, 275, 298, 280, 289, 298, 298, + 279, 298, 209, 298, 298, 109, 298, 298, 196, 117, + 80, 279, 298, 209, 298, 96, 109, 298, 266, 196, + 117, 81, 298, 273, 199, 275, 96, 280, 289, 266, + 298, 298, 298, 298, 273, 199, 275, 298, 280, 289, + 279, 298, 209, 298, 298, 109, 298, 298, 196, 117, + 47, 298, 298, 298, 298, 96, 298, 298, 266, 298, + 298, 298, 298, 273, 199, 275, 298, 280, 289, 298, + 298, 279, 298, 209, 298, 298, 109, 298, 298, 196, + 117, 49, 279, 298, 209, 298, 96, 109, 298, 266, + 196, 129, 298, 298, 273, 199, 275, 96, 280, 289, + 298, 298, 298, 298, 322, 273, 199, 275, 216, 280, + 289, 279, 298, 209, 298, 461, 109, 298, 461, 196, + 123, 3, 461, 445, 298, 298, 96, 268, 298, 298, + 298, 298, 298, 278, 273, 199, 275, 298, 280, 289, + 298, 298, 279, 298, 209, 298, 298, 109, 298, 445, + 196, 127, 445, 279, 461, 209, 445, 96, 109, 298, + 298, 196, 118, 298, 298, 273, 199, 275, 96, 280, + 289, 298, 298, 298, 298, 298, 273, 199, 275, 216, + 280, 289, 279, 298, 209, 298, 461, 109, 298, 461, + 196, 119, 34, 461, 445, 298, 298, 96, 268, 298, + 298, 298, 298, 298, 298, 273, 199, 275, 298, 280, + 289, 298, 298, 279, 298, 209, 298, 298, 109, 298, + 445, 196, 120, 445, 279, 461, 209, 445, 96, 109, + 298, 298, 196, 121, 298, 298, 273, 199, 275, 96, + 280, 289, 298, 298, 298, 298, 298, 273, 199, 275, + 216, 280, 289, 279, 298, 209, 216, 461, 109, 298, + 461, 196, 122, 461, 461, 445, 461, 298, 96, 268, + 461, 445, 298, 298, 298, 268, 273, 199, 275, 298, + 280, 289, 298, 397, 279, 298, 209, 298, 298, 109, + 298, 445, 196, 126, 445, 298, 461, 445, 445, 96, + 445, 298, 461, 298, 445, 283, 298, 273, 199, 275, + 298, 280, 289, 298, 30, 432, 298, 397, 397, 397, + 397, 461, 298, 298, 461, 298, 298, 432, 461, 445, + 298, 298, 298, 268, 397, 397, 397, 397, 298, 143, + 298, 298, 298, 298, 298, 298, 298, 321, 298, 40, + 41, 39, 13, 298, 298, 445, 298, 298, 445, 298, + 461, 298, 445, 298, 298, 298, 284, 285, 286, 287, + 40, 41, 39, 13, 298, 320, 40, 41, 39, 13, + 296, 298, 298, 298, 180, 298, 298, 284, 285, 286, + 287, 298, 298, 284, 285, 286, 287, 40, 41, 39, + 13, 298, 298, 40, 41, 39, 13, 40, 41, 39, + 13, 181, 311, 31, 284, 285, 286, 287, 323, 298, + 284, 285, 286, 287, 284, 285, 286, 287, 298, 298, + 298, 298, 298, 298, 40, 41, 39, 13, 298, 298, + 298, 40, 41, 39, 13, 298, 298, 40, 41, 39, + 13, 284, 285, 286, 287, 298, 298, 298, 284, 285, + 286, 287, 298, 298, 284, 285, 286, 287, 461, 298, + 298, 461, 298, 298, 298, 461, 445, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 445, 298, 298, 445, 298, 461, 298, 445, ); public static $yy_lookahead = array( - 9, 10, 11, 12, 65, 14, 67, 16, 80, 18, - 19, 65, 21, 67, 12, 24, 14, 13, 16, 28, - 29, 30, 91, 32, 20, 34, 22, 99, 37, 25, - 99, 40, 41, 42, 43, 31, 45, 33, 47, 35, - 49, 50, 51, 52, 105, 106, 17, 43, 57, 58, - 9, 10, 11, 12, 52, 14, 13, 16, 15, 18, - 19, 95, 21, 97, 98, 24, 61, 62, 25, 28, - 29, 30, 43, 32, 31, 34, 16, 34, 37, 50, - 1, 40, 41, 42, 43, 14, 45, 16, 47, 46, - 49, 50, 14, 52, 16, 84, 85, 86, 57, 58, - 9, 10, 11, 12, 72, 14, 14, 16, 48, 18, - 19, 15, 21, 17, 82, 24, 84, 85, 86, 28, - 29, 30, 65, 32, 67, 34, 34, 49, 37, 25, - 52, 40, 41, 42, 43, 31, 45, 17, 47, 27, - 49, 50, 46, 52, 52, 94, 34, 96, 57, 58, - 9, 10, 11, 12, 72, 14, 1, 16, 46, 18, - 19, 1, 21, 106, 82, 24, 84, 85, 86, 28, - 29, 30, 17, 32, 94, 34, 96, 91, 37, 72, - 1, 40, 41, 42, 43, 99, 45, 70, 47, 82, - 49, 50, 94, 52, 77, 78, 72, 80, 57, 58, - 9, 10, 11, 12, 72, 14, 82, 16, 101, 18, - 19, 15, 21, 17, 82, 24, 84, 85, 86, 28, - 29, 30, 6, 32, 8, 34, 97, 98, 37, 17, - 51, 40, 41, 42, 43, 72, 45, 80, 47, 76, - 49, 50, 46, 52, 70, 82, 1, 73, 57, 58, - 9, 10, 11, 12, 80, 14, 72, 16, 46, 18, - 19, 96, 21, 89, 101, 24, 82, 93, 69, 28, - 29, 30, 27, 32, 82, 34, 7, 8, 37, 20, - 96, 40, 41, 42, 43, 72, 45, 1, 47, 76, - 49, 50, 33, 52, 15, 82, 97, 98, 57, 58, - 9, 10, 11, 12, 12, 14, 14, 16, 16, 18, - 19, 25, 21, 79, 101, 24, 72, 31, 34, 28, - 29, 30, 43, 32, 32, 34, 82, 43, 37, 50, - 46, 40, 41, 42, 43, 51, 45, 72, 47, 101, - 49, 50, 76, 52, 52, 101, 13, 82, 57, 58, - 9, 10, 11, 12, 21, 14, 43, 16, 25, 18, - 19, 96, 21, 50, 31, 24, 70, 101, 102, 28, - 29, 30, 33, 32, 35, 34, 80, 44, 37, 1, - 2, 40, 41, 42, 43, 70, 45, 70, 47, 12, - 49, 50, 77, 52, 77, 80, 13, 80, 57, 58, - 9, 10, 11, 12, 21, 14, 43, 16, 25, 18, - 19, 34, 21, 50, 31, 24, 21, 69, 14, 28, - 29, 30, 76, 32, 25, 34, 95, 44, 37, 80, - 31, 40, 41, 42, 43, 33, 45, 35, 47, 44, - 49, 50, 94, 52, 36, 37, 38, 101, 57, 58, - 9, 10, 11, 12, 59, 14, 52, 16, 72, 18, - 19, 53, 54, 55, 56, 24, 72, 59, 82, 28, - 29, 30, 80, 32, 21, 34, 82, 72, 37, 97, - 98, 40, 41, 42, 43, 2, 45, 82, 47, 102, - 49, 50, 76, 52, 36, 37, 38, 44, 57, 58, - 9, 10, 11, 12, 51, 14, 34, 16, 14, 18, - 19, 53, 54, 55, 56, 24, 15, 101, 46, 28, - 29, 30, 21, 32, 94, 34, 63, 64, 37, 94, - 34, 40, 41, 42, 43, 98, 45, 76, 47, 94, - 49, 50, 46, 52, 70, 34, 52, 73, 57, 58, - 65, 66, 67, 68, 80, 70, 71, 46, 73, 74, - 75, 33, 101, 43, 33, 80, 35, 93, 83, 15, - 13, 51, 34, 88, 89, 90, 94, 92, 93, 51, - 81, 65, 66, 67, 68, 9, 70, 71, 12, 73, - 74, 75, 16, 36, 37, 38, 80, 43, 33, 83, - 35, 25, 81, 27, 88, 89, 90, 31, 92, 93, - 53, 54, 55, 56, 65, 64, 67, 68, 81, 70, - 71, 94, 73, 74, 75, 65, 94, 67, 7, 80, - 70, 13, 83, 73, 74, 75, 13, 88, 89, 90, - 80, 92, 93, 83, 1, 16, 21, 16, 88, 89, - 90, 9, 92, 93, 12, 16, 13, 65, 16, 67, - 16, 16, 70, 103, 104, 73, 74, 75, 25, 44, - 14, 16, 80, 43, 31, 83, 9, 39, 32, 12, - 88, 89, 90, 16, 92, 93, 32, 34, 16, 65, - 48, 67, 16, 16, 70, 103, 104, 73, 74, 75, - 65, 77, 67, 51, 80, 70, 49, 83, 73, 74, - 75, 49, 88, 89, 90, 80, 92, 93, 83, 9, - 51, 16, 12, 88, 89, 90, 16, 92, 93, 65, - 15, 67, 35, 9, 70, 100, 12, 73, 74, 75, - 16, 22, 107, 9, 80, 107, 12, 83, 107, 25, - 16, 107, 88, 89, 90, 31, 92, 93, 48, 23, - 65, 25, 67, 107, 100, 70, 107, 31, 73, 74, - 75, 107, 36, 37, 38, 80, 107, 14, 83, 16, - 107, 107, 48, 88, 89, 90, 107, 92, 93, 53, - 54, 55, 56, 65, 107, 67, 107, 9, 70, 104, - 12, 73, 74, 75, 16, 107, 107, 107, 80, 107, - 47, 83, 49, 107, 1, 52, 88, 89, 90, 107, - 92, 93, 65, 107, 67, 107, 13, 70, 100, 107, - 73, 74, 75, 107, 77, 107, 107, 80, 25, 107, - 83, 107, 107, 107, 31, 88, 89, 90, 107, 92, - 93, 3, 107, 107, 2, 107, 107, 9, 10, 11, - 12, 9, 14, 1, 12, 107, 18, 19, 16, 17, - 107, 107, 24, 21, 107, 13, 28, 29, 30, 17, - 107, 107, 107, 107, 107, 107, 107, 25, 107, 107, - 107, 107, 107, 31, 107, 43, 34, 107, 46, 107, - 48, 107, 50, 51, 107, 107, 58, 59, 46, 107, - 3, 107, 107, 2, 107, 107, 9, 10, 11, 12, - 9, 14, 1, 12, 107, 18, 19, 16, 17, 107, - 107, 24, 21, 107, 13, 28, 29, 30, 107, 107, - 107, 107, 107, 107, 107, 107, 25, 107, 107, 107, - 107, 107, 31, 107, 43, 107, 107, 46, 107, 48, - 107, 50, 107, 107, 107, 58, 59, 107, 107, 3, - 4, 5, 6, 107, 107, 9, 10, 11, 12, 107, - 25, 107, 107, 107, 18, 19, 31, 107, 107, 107, - 24, 36, 37, 38, 28, 29, 30, 65, 107, 67, - 107, 107, 70, 107, 107, 73, 74, 75, 53, 54, - 55, 56, 80, 107, 107, 83, 107, 107, 107, 107, - 88, 89, 90, 107, 92, 93, 107, 107, 107, 107, - 107, 107, 65, 107, 67, 107, 107, 70, 107, 107, - 73, 74, 75, 65, 107, 67, 107, 80, 70, 107, - 83, 73, 74, 75, 107, 88, 89, 90, 80, 92, - 93, 83, 107, 107, 107, 107, 88, 89, 90, 107, - 92, 93, 65, 107, 67, 107, 107, 70, 107, 107, - 73, 74, 75, 107, 107, 107, 107, 80, 107, 107, - 83, 107, 107, 107, 107, 88, 89, 90, 107, 92, - 93, 107, 107, 65, 107, 67, 107, 107, 70, 107, + 9, 10, 11, 12, 43, 14, 70, 16, 80, 18, + 19, 50, 21, 77, 78, 24, 80, 13, 15, 28, + 29, 30, 17, 32, 20, 34, 22, 99, 37, 25, + 14, 40, 41, 42, 43, 31, 45, 33, 47, 35, + 49, 50, 51, 52, 2, 15, 43, 43, 57, 58, + 34, 9, 10, 11, 12, 80, 14, 13, 16, 15, + 18, 19, 95, 21, 97, 98, 24, 72, 52, 25, + 28, 29, 30, 43, 32, 31, 34, 82, 34, 37, + 50, 17, 40, 41, 42, 43, 65, 45, 67, 47, + 46, 49, 50, 14, 52, 16, 101, 61, 62, 57, + 58, 9, 10, 11, 12, 72, 14, 43, 16, 1, + 18, 19, 1, 21, 50, 82, 24, 84, 85, 86, + 28, 29, 30, 69, 32, 17, 34, 106, 49, 37, + 72, 52, 40, 41, 42, 43, 65, 45, 67, 47, + 82, 49, 50, 94, 52, 84, 85, 86, 94, 57, + 58, 9, 10, 11, 12, 72, 14, 17, 16, 101, + 18, 19, 15, 21, 17, 82, 24, 84, 85, 86, + 28, 29, 30, 91, 32, 94, 34, 96, 15, 37, + 17, 99, 40, 41, 42, 43, 46, 45, 72, 47, + 1, 49, 50, 46, 52, 1, 2, 72, 82, 57, + 58, 9, 10, 11, 12, 72, 14, 82, 16, 46, + 18, 19, 96, 21, 96, 82, 24, 84, 85, 86, + 28, 29, 30, 94, 32, 96, 34, 97, 98, 37, + 91, 34, 40, 41, 42, 43, 72, 45, 99, 47, + 76, 49, 50, 46, 52, 70, 82, 34, 73, 57, + 58, 9, 10, 11, 12, 80, 14, 72, 16, 46, + 18, 19, 33, 21, 89, 101, 24, 82, 93, 69, + 28, 29, 30, 14, 32, 16, 34, 1, 2, 37, + 51, 96, 40, 41, 42, 43, 72, 45, 1, 47, + 76, 49, 50, 33, 52, 35, 82, 97, 98, 57, + 58, 9, 10, 11, 12, 12, 14, 14, 16, 16, + 18, 19, 25, 21, 1, 101, 24, 72, 31, 34, + 28, 29, 30, 76, 32, 32, 34, 82, 43, 37, + 72, 46, 40, 41, 42, 43, 51, 45, 43, 47, + 82, 49, 50, 76, 52, 52, 51, 13, 101, 57, + 58, 9, 10, 11, 12, 21, 14, 21, 16, 25, + 18, 19, 1, 21, 51, 31, 24, 70, 101, 102, + 28, 29, 30, 82, 32, 25, 34, 80, 44, 37, + 44, 31, 40, 41, 42, 43, 70, 45, 27, 47, + 79, 49, 50, 77, 52, 59, 80, 13, 76, 57, + 58, 9, 10, 11, 12, 21, 14, 70, 16, 25, + 18, 19, 27, 21, 77, 31, 24, 80, 12, 34, + 28, 29, 30, 101, 32, 6, 34, 8, 44, 37, + 25, 46, 40, 41, 42, 43, 31, 45, 80, 47, + 34, 49, 50, 14, 52, 36, 37, 38, 39, 57, + 58, 9, 10, 11, 12, 76, 14, 80, 16, 72, + 18, 19, 53, 54, 55, 56, 24, 15, 59, 82, + 28, 29, 30, 21, 32, 94, 34, 97, 98, 37, + 101, 52, 40, 41, 42, 43, 21, 45, 95, 47, + 94, 49, 50, 14, 52, 36, 37, 38, 39, 57, + 58, 9, 10, 11, 12, 65, 14, 67, 16, 44, + 18, 19, 53, 54, 55, 56, 24, 21, 63, 64, + 28, 29, 30, 12, 32, 14, 34, 16, 33, 37, + 35, 52, 40, 41, 42, 43, 43, 45, 16, 47, + 44, 49, 50, 50, 52, 105, 106, 51, 94, 57, + 58, 65, 66, 67, 68, 9, 70, 71, 12, 73, + 74, 75, 16, 52, 9, 9, 80, 12, 12, 83, + 48, 16, 16, 101, 88, 89, 90, 2, 92, 93, + 7, 8, 65, 66, 67, 68, 9, 70, 71, 12, + 73, 74, 75, 16, 14, 94, 16, 80, 34, 20, + 83, 34, 25, 48, 27, 88, 89, 90, 31, 92, + 93, 102, 33, 46, 33, 65, 35, 67, 68, 98, + 70, 71, 64, 73, 74, 75, 65, 47, 67, 49, + 80, 70, 52, 83, 73, 74, 75, 94, 88, 89, + 90, 80, 92, 93, 83, 1, 33, 1, 35, 88, + 89, 90, 81, 92, 93, 81, 94, 13, 65, 13, + 67, 7, 13, 70, 103, 104, 73, 74, 75, 25, + 81, 25, 13, 80, 16, 31, 83, 31, 16, 16, + 16, 88, 89, 90, 16, 92, 93, 14, 16, 32, + 65, 43, 67, 32, 34, 70, 103, 104, 73, 74, + 75, 65, 77, 67, 16, 80, 70, 16, 83, 73, + 74, 75, 15, 88, 89, 90, 80, 92, 93, 83, + 9, 16, 51, 12, 88, 89, 90, 16, 92, 93, + 65, 49, 67, 49, 9, 70, 100, 12, 73, 74, + 75, 16, 16, 51, 9, 80, 22, 12, 83, 35, + 25, 16, 107, 88, 89, 90, 31, 92, 93, 48, + 107, 65, 107, 67, 107, 100, 70, 107, 1, 73, + 74, 75, 70, 107, 107, 73, 80, 107, 107, 83, + 13, 1, 80, 48, 88, 89, 90, 107, 92, 93, + 107, 107, 25, 13, 65, 93, 67, 17, 31, 70, + 104, 107, 73, 74, 75, 25, 107, 107, 107, 80, + 107, 31, 83, 107, 34, 107, 107, 88, 89, 90, + 107, 92, 93, 65, 107, 67, 46, 107, 70, 100, + 107, 73, 74, 75, 107, 77, 107, 107, 80, 107, + 107, 83, 107, 107, 107, 107, 88, 89, 90, 107, + 92, 93, 3, 20, 107, 107, 107, 107, 9, 10, + 11, 12, 107, 14, 107, 107, 107, 18, 19, 36, + 37, 38, 39, 24, 107, 107, 107, 28, 29, 30, + 107, 107, 23, 107, 25, 107, 53, 54, 55, 56, + 31, 107, 107, 107, 107, 36, 37, 38, 39, 107, + 107, 107, 107, 107, 107, 107, 107, 58, 59, 107, + 107, 3, 53, 54, 55, 56, 107, 9, 10, 11, + 12, 107, 14, 107, 107, 107, 18, 19, 107, 107, + 107, 107, 24, 107, 25, 107, 28, 29, 30, 107, + 31, 107, 107, 107, 107, 36, 37, 38, 39, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 53, 54, 55, 56, 58, 59, 107, 107, + 3, 4, 5, 6, 107, 107, 9, 10, 11, 12, + 107, 107, 107, 107, 107, 18, 19, 107, 107, 107, + 107, 24, 107, 107, 107, 28, 29, 30, 65, 107, + 67, 107, 107, 70, 107, 107, 73, 74, 75, 107, + 107, 107, 107, 80, 107, 107, 83, 107, 107, 107, + 107, 88, 89, 90, 107, 92, 93, 107, 107, 107, + 107, 107, 107, 65, 107, 67, 107, 107, 70, 107, 107, 73, 74, 75, 65, 107, 67, 107, 80, 70, 107, 83, 73, 74, 75, 107, 88, 89, 90, 80, 92, 93, 83, 107, 107, 107, 107, 88, 89, 90, @@ -624,97 +624,112 @@ public static $yy_action = array( 107, 67, 107, 107, 70, 107, 107, 73, 74, 75, 65, 107, 67, 107, 80, 70, 107, 83, 73, 74, 75, 107, 88, 89, 90, 80, 92, 93, 83, 107, - 107, 107, 107, 88, 89, 90, 2, 92, 93, 65, - 107, 67, 107, 9, 70, 107, 12, 73, 74, 75, - 16, 17, 107, 107, 80, 21, 107, 83, 107, 107, + 107, 107, 107, 88, 89, 90, 107, 92, 93, 65, + 107, 67, 107, 107, 70, 107, 107, 73, 74, 75, + 107, 107, 107, 107, 80, 107, 107, 83, 107, 107, 107, 107, 88, 89, 90, 107, 92, 93, 107, 107, - 65, 107, 67, 107, 107, 70, 107, 43, 73, 74, - 46, 65, 48, 67, 50, 80, 70, 107, 107, 73, - 74, 107, 87, 88, 89, 90, 80, 92, 93, 107, - 107, 107, 107, 87, 88, 89, 90, 2, 92, 93, - 65, 107, 67, 107, 9, 70, 107, 12, 73, 74, - 15, 16, 17, 107, 107, 80, 21, 107, 107, 107, + 65, 107, 67, 107, 107, 70, 107, 107, 73, 74, + 75, 65, 107, 67, 107, 80, 70, 107, 83, 73, + 74, 75, 107, 88, 89, 90, 80, 92, 93, 83, + 107, 107, 107, 107, 88, 89, 90, 107, 92, 93, + 65, 107, 67, 107, 107, 70, 107, 107, 73, 74, + 75, 107, 107, 107, 107, 80, 107, 107, 83, 107, 107, 107, 107, 88, 89, 90, 107, 92, 93, 107, - 107, 65, 107, 67, 107, 107, 70, 107, 43, 73, - 74, 46, 65, 48, 67, 50, 80, 70, 107, 107, + 107, 65, 107, 67, 107, 107, 70, 107, 107, 73, + 74, 75, 65, 107, 67, 107, 80, 70, 107, 83, 73, 74, 107, 107, 88, 89, 90, 80, 92, 93, - 107, 107, 107, 107, 107, 88, 89, 90, 2, 92, + 107, 107, 107, 107, 87, 88, 89, 90, 2, 92, 93, 65, 107, 67, 107, 9, 70, 107, 12, 73, 74, 15, 16, 17, 107, 107, 80, 21, 107, 107, - 107, 107, 107, 107, 88, 89, 90, 107, 92, 93, + 107, 107, 107, 87, 88, 89, 90, 107, 92, 93, 107, 107, 65, 107, 67, 107, 107, 70, 107, 43, 73, 74, 46, 65, 48, 67, 50, 80, 70, 107, - 2, 73, 74, 107, 107, 88, 89, 90, 80, 92, - 93, 107, 107, 107, 107, 107, 88, 89, 90, 107, - 92, 93, 65, 20, 67, 107, 107, 70, 107, 107, - 73, 74, 34, 107, 36, 37, 38, 80, 107, 36, - 37, 38, 107, 107, 46, 88, 89, 90, 107, 92, - 93, 53, 54, 55, 56, 107, 53, 54, 55, 56, - 107, 26, 107, 35, 36, 37, 38, 107, 107, 107, - 107, 36, 37, 38, 107, 107, 107, 36, 37, 38, - 107, 53, 54, 55, 56, 13, 107, 107, 53, 54, - 55, 56, 51, 107, 53, 54, 55, 56, 13, 35, - 36, 37, 38, 107, 107, 107, 13, 107, 36, 37, - 38, 13, 107, 107, 107, 107, 107, 53, 54, 55, - 56, 36, 37, 38, 2, 53, 54, 55, 56, 36, - 37, 38, 107, 107, 36, 37, 38, 107, 53, 54, - 55, 56, 107, 107, 107, 107, 53, 54, 55, 56, - 107, 53, 54, 55, 56, 107, 107, 107, 36, 37, - 38, 9, 107, 107, 12, 107, 107, 107, 16, 17, - 107, 107, 107, 107, 107, 53, 54, 55, 56, 107, + 107, 73, 74, 107, 107, 88, 89, 90, 80, 92, + 93, 107, 107, 107, 107, 107, 88, 89, 90, 2, + 92, 93, 65, 107, 67, 107, 9, 70, 107, 12, + 73, 74, 15, 16, 17, 107, 107, 80, 21, 107, + 107, 107, 107, 107, 107, 88, 89, 90, 107, 92, + 93, 107, 107, 65, 107, 67, 107, 107, 70, 107, + 43, 73, 74, 46, 65, 48, 67, 50, 80, 70, + 107, 107, 73, 74, 107, 107, 88, 89, 90, 80, + 92, 93, 107, 107, 107, 107, 107, 88, 89, 90, + 2, 92, 93, 65, 107, 67, 2, 9, 70, 107, + 12, 73, 74, 9, 16, 17, 12, 107, 80, 21, + 16, 17, 107, 107, 107, 21, 88, 89, 90, 107, + 92, 93, 107, 2, 65, 107, 67, 107, 107, 70, + 107, 43, 73, 74, 46, 107, 48, 43, 50, 80, + 46, 107, 48, 107, 50, 51, 107, 88, 89, 90, + 107, 92, 93, 107, 2, 34, 107, 36, 37, 38, + 39, 9, 107, 107, 12, 107, 107, 46, 16, 17, + 107, 107, 107, 21, 53, 54, 55, 56, 107, 26, + 107, 107, 107, 107, 107, 107, 107, 13, 107, 36, + 37, 38, 39, 107, 107, 43, 107, 107, 46, 107, + 48, 107, 50, 107, 107, 107, 53, 54, 55, 56, + 36, 37, 38, 39, 107, 35, 36, 37, 38, 39, + 13, 107, 107, 107, 13, 107, 107, 53, 54, 55, + 56, 107, 107, 53, 54, 55, 56, 36, 37, 38, + 39, 107, 107, 36, 37, 38, 39, 36, 37, 38, + 39, 13, 51, 2, 53, 54, 55, 56, 13, 107, + 53, 54, 55, 56, 53, 54, 55, 56, 107, 107, + 107, 107, 107, 107, 36, 37, 38, 39, 107, 107, + 107, 36, 37, 38, 39, 107, 107, 36, 37, 38, + 39, 53, 54, 55, 56, 107, 107, 107, 53, 54, + 55, 56, 107, 107, 53, 54, 55, 56, 9, 107, + 107, 12, 107, 107, 107, 16, 17, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 43, 107, 107, 46, 107, - 48, 107, 50, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 43, 107, 107, 46, 107, 48, 107, 50, ); - const YY_SHIFT_USE_DFLT = -10; - const YY_SHIFT_MAX = 230; + const YY_SHIFT_USE_DFLT = -40; + const YY_SHIFT_MAX = 232; public static $yy_shift_ofst = array( - -10, 41, 41, 91, 141, 141, 191, 91, 91, 141, - 91, 191, -9, 241, 91, 91, 91, 241, 91, 91, - 91, 91, 91, 291, 341, 91, 91, 91, 91, 91, - 91, 91, 91, 391, 91, 91, 91, 441, 491, 491, - 491, 491, 491, 491, 491, 491, 736, 955, 955, 763, - 848, 862, 78, 92, 286, 907, 1763, 1795, 557, 1788, - 1801, 1824, 1832, 408, 1845, 1853, 1882, 1858, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 576, 724, 29, 96, 286, 286, 92, - 92, 378, 966, 1635, 642, 2, 643, 813, 921, 667, - 667, 196, 104, 404, 104, 399, 155, 212, 71, 71, - 179, 245, 104, 79, 79, 79, 79, 79, 79, 79, - 79, 120, 120, 160, 79, -10, -10, 852, 1706, 911, - 1564, 1912, 292, 710, 788, 279, 104, 104, 501, 104, - 494, 104, 494, 104, 313, 313, 104, 104, 104, 104, - 313, 377, 313, 313, 313, 363, 313, 363, 313, 104, - 104, 104, 104, 79, 483, 79, 79, 483, 79, 538, - 120, 120, 120, -10, -10, -10, -10, -10, -10, 1758, - 4, 43, 333, 383, 734, 284, 112, 395, 453, 216, - 269, 259, 60, 625, 472, 496, 511, 339, 402, 528, - 520, 531, 565, 554, 621, 618, 623, 629, 631, 639, - 644, 645, 656, 655, 630, 646, 654, 653, 638, 672, - 538, 676, 657, 662, 677, 652, 669, 705, 715, 697, - 719, + -40, 92, 92, 142, 192, 192, 242, 142, 142, 192, + 142, 242, -9, 42, 292, 142, 142, 142, 292, 142, + 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, + 342, 142, 142, 142, 392, 142, 142, 142, 442, 492, + 492, 492, 492, 492, 492, 492, 492, 859, 909, 909, + 580, 849, 780, 79, 16, 287, 908, 833, 1843, 1864, + 1870, 1891, 1897, 409, 1901, 1928, 1941, 1935, 459, 459, + 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, + 459, 459, 459, 459, 459, 577, 725, 64, 147, 287, + 287, 16, 16, 194, 967, 1636, 555, 511, 644, 646, + 767, 546, 546, 163, 350, 429, 350, 405, 108, 140, + 259, 259, 313, 276, 361, 350, 111, 111, 111, 111, + 111, 111, 111, 111, 5, 5, 189, 111, -40, -40, + 1784, 1707, 1778, 1842, 1989, 293, 711, 556, 30, 350, + 350, 452, 350, 479, 350, 479, 350, -39, -39, 350, + 350, 350, 350, -39, 406, -39, -39, -39, 493, -39, + 493, -39, 350, 350, 350, 350, 111, 575, 111, 111, + 575, 111, 564, 5, 5, 5, -40, -40, -40, -40, + -40, -40, 1811, 4, 44, 334, 384, 735, 285, 385, + 336, 496, 419, 573, 579, 522, 465, 197, 213, 567, + 260, 495, 229, 295, 581, 613, 3, 654, 649, 659, + 658, 662, 663, 664, 668, 673, 672, 648, 657, 661, + 660, 688, 564, 691, 682, 684, 705, 671, 692, 726, + 697, 714, 724, ); const YY_REDUCE_USE_DFLT = -73; - const YY_REDUCE_MAX = 178; + const YY_REDUCE_MAX = 181; public static $yy_reduce_ofst = array( - 5, 485, 516, 549, 560, 592, 624, 635, 664, 695, - 728, 757, 932, 967, 978, 1007, 1038, 1049, 1078, 1109, - 1120, 1149, 1180, 1191, 1220, 1251, 1262, 1291, 1322, 1333, - 1362, 1393, 1404, 1433, 1464, 1475, 1504, 1535, 1546, 1575, - 1606, 1617, 1646, 1677, 1688, 1717, 32, 82, 132, 174, - -61, 163, 474, 117, 213, 57, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 184, 265, -34, 199, 107, 244, 315, - 317, 266, -54, 348, 51, -72, 346, 346, 346, 80, - 51, 129, 124, 296, 386, 394, 416, 129, -69, 86, - 346, 346, 405, 461, 346, 346, 346, 346, 346, 346, - 346, 129, 382, 346, 346, 463, 346, 98, 98, 98, - 98, 98, 157, 165, 98, 98, 192, 192, 234, 192, - 349, 192, 392, 192, 331, 331, 192, 192, 192, 192, - 331, 430, 331, 331, 331, 435, 331, 445, 331, 192, - 192, 192, 192, 238, 387, 238, 238, 387, 238, 482, - 437, 437, 437, 551, 499, 521, 537, 527, 532, + 36, 486, 517, 550, 561, 593, 625, 636, 665, 696, + 729, 758, 933, 968, 979, 1008, 1039, 1050, 1079, 1110, + 1121, 1150, 1181, 1192, 1221, 1252, 1263, 1292, 1323, 1334, + 1363, 1394, 1405, 1434, 1465, 1476, 1505, 1536, 1547, 1576, + 1607, 1618, 1647, 1678, 1689, 1718, 1749, 33, 83, 133, + 175, 440, 164, 702, -64, 214, 21, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 116, 185, -33, 200, -5, + 58, 316, 337, 267, 71, 54, 81, -72, 247, 247, + 247, 129, 81, 130, 125, 297, 245, 258, 322, 130, + 82, 139, 247, 247, 247, 387, 379, 247, 247, 247, + 247, 247, 247, 247, 130, 380, 247, 247, 455, 247, + 49, 49, 49, 49, 49, -25, 118, 49, 49, 291, + 291, 311, 291, 358, 291, 377, 291, 393, 393, 291, + 291, 291, 291, 393, 381, 393, 393, 393, 396, 393, + 454, 393, 291, 291, 291, 291, 472, 509, 472, 472, + 509, 472, 501, 521, 521, 521, 558, 571, 574, 589, + 543, 562, ); public static $yyExpectedTokens = array( array(), @@ -730,6 +745,7 @@ public static $yy_action = array( array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 51, 52, 57, 58, ), + array(2, 9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), @@ -763,9 +779,9 @@ public static $yy_action = array( array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), - array(23, 25, 31, 36, 37, 38, 53, 54, 55, 56, ), - array(25, 31, 36, 37, 38, 53, 54, 55, 56, ), - array(25, 31, 36, 37, 38, 53, 54, 55, 56, ), + array(23, 25, 31, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(25, 31, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(25, 31, 36, 37, 38, 39, 53, 54, 55, 56, ), array(14, 16, 47, 49, 52, ), array(3, 9, 10, 11, 12, 14, 18, 19, 24, 28, 29, 30, 58, 59, ), array(1, 13, 17, 25, 31, 34, 46, ), @@ -773,33 +789,34 @@ public static $yy_action = array( array(14, 34, 52, ), array(1, 25, 31, ), array(3, 9, 10, 11, 12, 14, 18, 19, 24, 28, 29, 30, 58, 59, ), - array(20, 36, 37, 38, 53, 54, 55, 56, ), - array(26, 36, 37, 38, 53, 54, 55, 56, ), - array(13, 36, 37, 38, 53, 54, 55, 56, ), - array(35, 36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 51, 53, 54, 55, 56, ), - array(35, 36, 37, 38, 53, 54, 55, 56, ), - array(13, 36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, 59, ), - array(13, 36, 37, 38, 53, 54, 55, 56, ), - array(13, 36, 37, 38, 53, 54, 55, 56, ), - array(2, 36, 37, 38, 53, 54, 55, 56, ), - array(13, 36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), - array(36, 37, 38, 53, 54, 55, 56, ), + array(20, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(26, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(35, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 51, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, 59, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(2, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), array(9, 12, 16, 25, 27, 31, ), array(9, 12, 16, 25, 31, ), array(17, 43, 50, ), @@ -828,6 +845,7 @@ public static $yy_action = array( array(14, 16, ), array(14, 16, ), array(1, 51, ), + array(1, 2, ), array(1, 27, ), array(25, 31, ), array(1, ), @@ -896,7 +914,7 @@ public static $yy_action = array( array(), array(), array(), - array(2, 34, 36, 37, 38, 46, 53, 54, 55, 56, ), + array(2, 34, 36, 37, 38, 39, 46, 53, 54, 55, 56, ), array(13, 20, 22, 25, 31, 33, 35, 43, ), array(13, 15, 25, 31, 34, 46, ), array(13, 21, 25, 31, 44, ), @@ -935,7 +953,6 @@ public static $yy_action = array( array(32, ), array(32, ), array(34, ), - array(39, ), array(16, ), array(34, ), array(16, ), @@ -1046,44 +1063,44 @@ public static $yy_action = array( array(), ); public static $yy_default = array( - 337, 514, 514, 514, 499, 499, 514, 476, 476, 514, - 476, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 377, 356, 377, 514, - 514, 415, 514, 514, 377, 514, 514, 382, 514, 514, - 514, 514, 350, 514, 514, 514, 514, 514, 361, 475, - 399, 403, 474, 500, 502, 501, 404, 384, 388, 389, - 379, 382, 350, 377, 377, 489, 431, 377, 377, 514, - 514, 368, 327, 430, 441, 514, 391, 391, 391, 441, - 441, 431, 377, 514, 377, 377, 371, 431, 514, 514, - 391, 391, 358, 373, 391, 397, 406, 407, 408, 398, - 402, 431, 486, 406, 396, 335, 483, 430, 430, 430, - 430, 430, 514, 443, 441, 457, 347, 357, 514, 360, - 514, 365, 514, 366, 438, 439, 351, 353, 354, 355, - 467, 441, 466, 469, 468, 434, 435, 436, 437, 367, - 363, 364, 359, 369, 477, 372, 374, 478, 424, 441, - 463, 490, 487, 335, 482, 482, 482, 441, 441, 415, - 411, 415, 405, 405, 442, 415, 415, 405, 405, 333, - 514, 514, 514, 405, 415, 425, 514, 514, 514, 514, - 411, 514, 514, 411, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 411, 413, 514, 488, 417, 514, - 457, 514, 514, 514, 514, 514, 420, 514, 514, 514, - 385, 328, 329, 330, 331, 332, 334, 336, 338, 339, - 340, 341, 342, 343, 344, 346, 375, 376, 459, 460, - 461, 481, 370, 479, 480, 409, 418, 419, 428, 429, - 440, 444, 445, 446, 392, 393, 394, 395, 410, 412, - 414, 416, 420, 421, 422, 400, 401, 423, 426, 427, - 454, 452, 455, 491, 492, 493, 494, 432, 433, 465, - 458, 473, 345, 464, 510, 511, 503, 504, 505, 508, - 507, 509, 512, 513, 506, 496, 498, 497, 495, 470, - 453, 451, 448, 449, 450, 456, 471, 472, 417, 447, - 485, 462, 457, 378, 362, 386, 390, + 339, 518, 518, 518, 503, 503, 518, 480, 480, 518, + 480, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 379, 358, 379, + 518, 518, 419, 518, 518, 379, 518, 518, 384, 518, + 518, 518, 352, 518, 518, 518, 518, 518, 363, 479, + 401, 406, 478, 504, 506, 505, 405, 407, 408, 386, + 390, 391, 381, 384, 352, 379, 379, 493, 435, 379, + 379, 518, 518, 370, 329, 434, 445, 518, 393, 393, + 393, 445, 445, 435, 379, 518, 379, 379, 373, 435, + 518, 518, 393, 393, 393, 360, 375, 393, 399, 410, + 411, 412, 400, 404, 435, 490, 410, 398, 337, 487, + 434, 434, 434, 434, 434, 518, 447, 445, 461, 349, + 359, 518, 362, 518, 367, 518, 368, 442, 443, 353, + 355, 356, 357, 471, 445, 470, 473, 472, 438, 439, + 440, 441, 369, 365, 366, 361, 371, 481, 374, 376, + 482, 428, 445, 467, 494, 491, 337, 486, 486, 486, + 445, 445, 419, 415, 419, 409, 409, 446, 419, 419, + 409, 409, 335, 518, 518, 518, 409, 419, 429, 518, + 518, 518, 518, 415, 518, 518, 415, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 415, 417, 518, + 492, 518, 461, 518, 518, 518, 518, 518, 424, 518, + 518, 518, 387, 330, 331, 332, 333, 334, 336, 338, + 340, 341, 342, 343, 344, 345, 346, 348, 377, 378, + 463, 464, 465, 485, 372, 483, 484, 413, 422, 423, + 432, 433, 444, 448, 449, 450, 394, 395, 396, 397, + 414, 416, 418, 420, 424, 425, 426, 402, 403, 427, + 430, 431, 458, 456, 495, 496, 497, 498, 436, 437, + 469, 462, 477, 347, 468, 514, 515, 507, 508, 509, + 512, 511, 513, 516, 517, 510, 500, 502, 501, 499, + 474, 459, 457, 455, 452, 453, 454, 460, 475, 476, + 421, 451, 489, 466, 461, 380, 364, 388, 392, ); const YYNOCODE = 108; const YYSTACKDEPTH = 500; - const YYNSTATE = 327; - const YYNRULE = 187; + const YYNSTATE = 329; + const YYNRULE = 189; const YYERRORSYMBOL = 60; const YYERRSYMDT = 'yy0'; const YYFALLBACK = 0; @@ -1219,8 +1236,10 @@ public static $yy_action = array( 'expr ::= expr scond', 'expr ::= expr ISIN array', 'expr ::= expr ISIN value', - 'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr', - 'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr', + 'ternary ::= expr QMARK DOLLARID COLON expr', + 'ternary ::= expr QMARK value COLON expr', + 'ternary ::= expr QMARK expr COLON expr', + 'ternary ::= expr QMARK COLON expr', 'value ::= variable', 'value ::= UNIMATH value', 'value ::= NOT value', @@ -1721,8 +1740,10 @@ public static $yy_action = array( array( 0 => 75, 1 => 2 ), array( 0 => 75, 1 => 3 ), array( 0 => 75, 1 => 3 ), - array( 0 => 83, 1 => 7 ), - array( 0 => 83, 1 => 7 ), + array( 0 => 83, 1 => 5 ), + array( 0 => 83, 1 => 5 ), + array( 0 => 83, 1 => 5 ), + array( 0 => 83, 1 => 4 ), array( 0 => 74, 1 => 1 ), array( 0 => 74, 1 => 2 ), array( 0 => 74, 1 => 2 ), @@ -1850,18 +1871,18 @@ public static $yy_action = array( 56 => 6, 64 => 6, 65 => 6, - 78 => 6, - 83 => 6, - 84 => 6, - 89 => 6, - 93 => 6, - 94 => 6, - 98 => 6, - 99 => 6, + 80 => 6, + 85 => 6, + 86 => 6, + 91 => 6, + 95 => 6, + 96 => 6, + 100 => 6, 101 => 6, - 106 => 6, - 170 => 6, - 175 => 6, + 103 => 6, + 108 => 6, + 172 => 6, + 177 => 6, 7 => 7, 8 => 8, 9 => 9, @@ -1901,18 +1922,18 @@ public static $yy_action = array( 48 => 48, 49 => 49, 58 => 49, - 148 => 49, - 152 => 49, - 156 => 49, + 150 => 49, + 154 => 49, 158 => 49, + 160 => 49, 50 => 50, - 149 => 50, - 155 => 50, + 151 => 50, + 157 => 50, 51 => 51, 52 => 52, 53 => 52, 54 => 54, - 133 => 54, + 135 => 54, 57 => 57, 59 => 59, 60 => 60, @@ -1931,55 +1952,55 @@ public static $yy_action = array( 75 => 75, 76 => 76, 77 => 77, + 78 => 77, 79 => 79, - 81 => 79, - 82 => 79, - 113 => 79, - 80 => 80, - 85 => 85, - 86 => 86, + 81 => 81, + 83 => 81, + 84 => 81, + 115 => 81, + 82 => 82, 87 => 87, 88 => 88, + 89 => 89, 90 => 90, - 91 => 91, - 92 => 91, - 95 => 95, - 96 => 96, + 92 => 92, + 93 => 93, + 94 => 93, 97 => 97, - 100 => 100, + 98 => 98, + 99 => 99, 102 => 102, - 103 => 103, 104 => 104, 105 => 105, + 106 => 106, 107 => 107, - 108 => 108, 109 => 109, 110 => 110, 111 => 111, 112 => 112, + 113 => 113, 114 => 114, - 172 => 114, - 115 => 115, 116 => 116, + 174 => 116, 117 => 117, 118 => 118, 119 => 119, 120 => 120, - 128 => 120, 121 => 121, 122 => 122, + 130 => 122, 123 => 123, - 124 => 123, - 126 => 123, - 127 => 123, + 124 => 124, 125 => 125, - 129 => 129, - 130 => 130, + 126 => 125, + 128 => 125, + 129 => 125, + 127 => 127, 131 => 131, - 176 => 131, 132 => 132, + 133 => 133, + 178 => 133, 134 => 134, - 135 => 135, 136 => 136, 137 => 137, 138 => 138, @@ -1992,13 +2013,13 @@ public static $yy_action = array( 145 => 145, 146 => 146, 147 => 147, - 150 => 150, - 151 => 151, + 148 => 148, + 149 => 149, + 152 => 152, 153 => 153, - 154 => 154, - 157 => 157, + 155 => 155, + 156 => 156, 159 => 159, - 160 => 160, 161 => 161, 162 => 162, 163 => 163, @@ -2007,20 +2028,22 @@ public static $yy_action = array( 166 => 166, 167 => 167, 168 => 168, - 169 => 168, - 171 => 171, + 169 => 169, + 170 => 170, + 171 => 170, 173 => 173, - 174 => 174, - 177 => 177, - 178 => 178, + 175 => 175, + 176 => 176, 179 => 179, 180 => 180, - 183 => 180, 181 => 181, - 184 => 181, 182 => 182, - 185 => 185, - 186 => 186, + 185 => 182, + 183 => 183, + 186 => 183, + 184 => 184, + 187 => 187, + 188 => 188, ); // line 245 "src/Parser/TemplateParser.y" public function yy_r0(){ @@ -2354,34 +2377,38 @@ public static $yy_action = array( } // line 675 "src/Parser/TemplateParser.y" public function yy_r76(){ - $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '. $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'') . ' : '.$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '. $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'') . ' : '.$this->yystack[$this->yyidx + 0]->minor; } // line 679 "src/Parser/TemplateParser.y" public function yy_r77(){ - $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; } -// line 689 "src/Parser/TemplateParser.y" +// line 688 "src/Parser/TemplateParser.y" public function yy_r79(){ + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?: '.$this->yystack[$this->yyidx + 0]->minor; + } +// line 698 "src/Parser/TemplateParser.y" + public function yy_r81(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 694 "src/Parser/TemplateParser.y" - public function yy_r80(){ +// line 703 "src/Parser/TemplateParser.y" + public function yy_r82(){ $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; } -// line 715 "src/Parser/TemplateParser.y" - public function yy_r85(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; - } -// line 719 "src/Parser/TemplateParser.y" - public function yy_r86(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; - } -// line 723 "src/Parser/TemplateParser.y" +// line 724 "src/Parser/TemplateParser.y" public function yy_r87(){ - $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } // line 728 "src/Parser/TemplateParser.y" public function yy_r88(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; + } +// line 732 "src/Parser/TemplateParser.y" + public function yy_r89(){ + $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 737 "src/Parser/TemplateParser.y" + public function yy_r90(){ if (defined($this->yystack[$this->yyidx + 0]->minor)) { if ($this->security) { $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); @@ -2391,16 +2418,16 @@ public static $yy_action = array( $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } } -// line 745 "src/Parser/TemplateParser.y" - public function yy_r90(){ +// line 754 "src/Parser/TemplateParser.y" + public function yy_r92(){ $this->_retvalue = '('. $this->yystack[$this->yyidx + -1]->minor .')'; } -// line 749 "src/Parser/TemplateParser.y" - public function yy_r91(){ +// line 758 "src/Parser/TemplateParser.y" + public function yy_r93(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 767 "src/Parser/TemplateParser.y" - public function yy_r95(){ +// line 776 "src/Parser/TemplateParser.y" + public function yy_r97(){ if ($this->security && $this->security->static_classes !== array()) { $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); } @@ -2412,19 +2439,19 @@ public static $yy_action = array( } $this->_retvalue = $prefixVar .'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; } -// line 781 "src/Parser/TemplateParser.y" - public function yy_r96(){ +// line 790 "src/Parser/TemplateParser.y" + public function yy_r98(){ $prefixVar = $this->compiler->getNewPrefixVariable(); $tmp = $this->compiler->appendCode('', $this->yystack[$this->yyidx + 0]->minor); $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, "")); $this->_retvalue = $prefixVar; } -// line 788 "src/Parser/TemplateParser.y" - public function yy_r97(){ +// line 797 "src/Parser/TemplateParser.y" + public function yy_r99(){ $this->_retvalue = $this->compiler->compileModifier($this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor); } -// line 801 "src/Parser/TemplateParser.y" - public function yy_r100(){ +// line 810 "src/Parser/TemplateParser.y" + public function yy_r102(){ if (!in_array(strtolower($this->yystack[$this->yyidx + -2]->minor), array('self', 'parent')) && (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->compiler))) { if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; @@ -2435,16 +2462,16 @@ public static $yy_action = array( $this->compiler->trigger_template_error ('static class \''.$this->yystack[$this->yyidx + -2]->minor.'\' is undefined or not allowed by security setting'); } } -// line 820 "src/Parser/TemplateParser.y" - public function yy_r102(){ +// line 829 "src/Parser/TemplateParser.y" + public function yy_r104(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -// line 831 "src/Parser/TemplateParser.y" - public function yy_r103(){ +// line 840 "src/Parser/TemplateParser.y" + public function yy_r105(){ $this->_retvalue = $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''); } -// line 834 "src/Parser/TemplateParser.y" - public function yy_r104(){ +// line 843 "src/Parser/TemplateParser.y" + public function yy_r106(){ if ($this->yystack[$this->yyidx + 0]->minor['var'] === '\'smarty\'') { $smarty_var = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); $this->_retvalue = $smarty_var; @@ -2455,164 +2482,164 @@ public static $yy_action = array( $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; } } -// line 847 "src/Parser/TemplateParser.y" - public function yy_r105(){ +// line 856 "src/Parser/TemplateParser.y" + public function yy_r107(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; } -// line 857 "src/Parser/TemplateParser.y" - public function yy_r107(){ +// line 866 "src/Parser/TemplateParser.y" + public function yy_r109(){ $this->_retvalue = $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -1]->minor . '\''); } -// line 861 "src/Parser/TemplateParser.y" - public function yy_r108(){ +// line 870 "src/Parser/TemplateParser.y" + public function yy_r110(){ $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -2]->minor . '\'') . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; } -// line 865 "src/Parser/TemplateParser.y" - public function yy_r109(){ +// line 874 "src/Parser/TemplateParser.y" + public function yy_r111(){ $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -1]->minor); } -// line 869 "src/Parser/TemplateParser.y" - public function yy_r110(){ +// line 878 "src/Parser/TemplateParser.y" + public function yy_r112(){ $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -2]->minor) . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; } -// line 873 "src/Parser/TemplateParser.y" - public function yy_r111(){ +// line 882 "src/Parser/TemplateParser.y" + public function yy_r113(){ $this->_retvalue = array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'', 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } -// line 876 "src/Parser/TemplateParser.y" - public function yy_r112(){ - $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); - } -// line 889 "src/Parser/TemplateParser.y" +// line 885 "src/Parser/TemplateParser.y" public function yy_r114(){ - return; - } -// line 895 "src/Parser/TemplateParser.y" - public function yy_r115(){ - $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\'').']'; + $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } // line 898 "src/Parser/TemplateParser.y" public function yy_r116(){ + return; + } +// line 904 "src/Parser/TemplateParser.y" + public function yy_r117(){ + $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\'').']'; + } +// line 907 "src/Parser/TemplateParser.y" + public function yy_r118(){ $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor).']'; } -// line 902 "src/Parser/TemplateParser.y" - public function yy_r117(){ - $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; - } -// line 906 "src/Parser/TemplateParser.y" - public function yy_r118(){ - $this->_retvalue = '[\''. $this->yystack[$this->yyidx + 0]->minor .'\']'; - } -// line 910 "src/Parser/TemplateParser.y" +// line 911 "src/Parser/TemplateParser.y" public function yy_r119(){ - $this->_retvalue = '['. $this->yystack[$this->yyidx + 0]->minor .']'; + $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; } // line 915 "src/Parser/TemplateParser.y" public function yy_r120(){ - $this->_retvalue = '['. $this->yystack[$this->yyidx + -1]->minor .']'; + $this->_retvalue = '[\''. $this->yystack[$this->yyidx + 0]->minor .'\']'; } -// line 920 "src/Parser/TemplateParser.y" +// line 919 "src/Parser/TemplateParser.y" public function yy_r121(){ - $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; + $this->_retvalue = '['. $this->yystack[$this->yyidx + 0]->minor .']'; } // line 924 "src/Parser/TemplateParser.y" public function yy_r122(){ - $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; + $this->_retvalue = '['. $this->yystack[$this->yyidx + -1]->minor .']'; } -// line 927 "src/Parser/TemplateParser.y" +// line 929 "src/Parser/TemplateParser.y" public function yy_r123(){ - $this->_retvalue = '['.$this->yystack[$this->yyidx + -1]->minor.']'; + $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; } // line 933 "src/Parser/TemplateParser.y" + public function yy_r124(){ + $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; + } +// line 936 "src/Parser/TemplateParser.y" public function yy_r125(){ + $this->_retvalue = '['.$this->yystack[$this->yyidx + -1]->minor.']'; + } +// line 942 "src/Parser/TemplateParser.y" + public function yy_r127(){ $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'').']'; } -// line 949 "src/Parser/TemplateParser.y" - public function yy_r129(){ - $this->_retvalue = '[]'; - } -// line 959 "src/Parser/TemplateParser.y" - public function yy_r130(){ - $this->_retvalue = '\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''; - } -// line 963 "src/Parser/TemplateParser.y" +// line 958 "src/Parser/TemplateParser.y" public function yy_r131(){ - $this->_retvalue = '\'\''; + $this->_retvalue = '[]'; } // line 968 "src/Parser/TemplateParser.y" public function yy_r132(){ + $this->_retvalue = '\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''; + } +// line 972 "src/Parser/TemplateParser.y" + public function yy_r133(){ + $this->_retvalue = '\'\''; + } +// line 977 "src/Parser/TemplateParser.y" + public function yy_r134(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } -// line 976 "src/Parser/TemplateParser.y" - public function yy_r134(){ +// line 985 "src/Parser/TemplateParser.y" + public function yy_r136(){ $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); $this->_retvalue = $this->compiler->compileVariable('\''.$var.'\''); } -// line 982 "src/Parser/TemplateParser.y" - public function yy_r135(){ +// line 991 "src/Parser/TemplateParser.y" + public function yy_r137(){ $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; } -// line 989 "src/Parser/TemplateParser.y" - public function yy_r136(){ +// line 998 "src/Parser/TemplateParser.y" + public function yy_r138(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] === '\'smarty\'') { $this->_retvalue = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; } else { $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; } } -// line 998 "src/Parser/TemplateParser.y" - public function yy_r137(){ +// line 1007 "src/Parser/TemplateParser.y" + public function yy_r139(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -// line 1003 "src/Parser/TemplateParser.y" - public function yy_r138(){ +// line 1012 "src/Parser/TemplateParser.y" + public function yy_r140(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 1008 "src/Parser/TemplateParser.y" - public function yy_r139(){ +// line 1017 "src/Parser/TemplateParser.y" + public function yy_r141(){ if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) === '_') { $this->compiler->trigger_template_error (self::ERR1); } $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 1015 "src/Parser/TemplateParser.y" - public function yy_r140(){ +// line 1024 "src/Parser/TemplateParser.y" + public function yy_r142(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{'.$this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1022 "src/Parser/TemplateParser.y" - public function yy_r141(){ +// line 1031 "src/Parser/TemplateParser.y" + public function yy_r143(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1029 "src/Parser/TemplateParser.y" - public function yy_r142(){ +// line 1038 "src/Parser/TemplateParser.y" + public function yy_r144(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1037 "src/Parser/TemplateParser.y" - public function yy_r143(){ +// line 1046 "src/Parser/TemplateParser.y" + public function yy_r145(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1045 "src/Parser/TemplateParser.y" - public function yy_r144(){ +// line 1054 "src/Parser/TemplateParser.y" + public function yy_r146(){ $this->_retvalue = $this->compiler->compileFunctionCall($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor); } -// line 1053 "src/Parser/TemplateParser.y" - public function yy_r145(){ +// line 1062 "src/Parser/TemplateParser.y" + public function yy_r147(){ if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) === '_') { $this->compiler->trigger_template_error (self::ERR1); } $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . '('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; } -// line 1060 "src/Parser/TemplateParser.y" - public function yy_r146(){ +// line 1069 "src/Parser/TemplateParser.y" + public function yy_r148(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } @@ -2620,56 +2647,56 @@ public static $yy_action = array( $this->compiler->appendPrefixCode("compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -3]->minor,1).'\'').';?>'); $this->_retvalue = $prefixVar .'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; } -// line 1071 "src/Parser/TemplateParser.y" - public function yy_r147(){ +// line 1080 "src/Parser/TemplateParser.y" + public function yy_r149(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); } -// line 1088 "src/Parser/TemplateParser.y" - public function yy_r150(){ +// line 1097 "src/Parser/TemplateParser.y" + public function yy_r152(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); } -// line 1092 "src/Parser/TemplateParser.y" - public function yy_r151(){ +// line 1101 "src/Parser/TemplateParser.y" + public function yy_r153(){ $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); } -// line 1100 "src/Parser/TemplateParser.y" - public function yy_r153(){ +// line 1109 "src/Parser/TemplateParser.y" + public function yy_r155(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } -// line 1108 "src/Parser/TemplateParser.y" - public function yy_r154(){ +// line 1117 "src/Parser/TemplateParser.y" + public function yy_r156(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); } -// line 1121 "src/Parser/TemplateParser.y" - public function yy_r157(){ - $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor); - } // line 1130 "src/Parser/TemplateParser.y" public function yy_r159(){ + $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor); + } +// line 1139 "src/Parser/TemplateParser.y" + public function yy_r161(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '', 'method'); } -// line 1135 "src/Parser/TemplateParser.y" - public function yy_r160(){ +// line 1144 "src/Parser/TemplateParser.y" + public function yy_r162(){ $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'method'); } -// line 1140 "src/Parser/TemplateParser.y" - public function yy_r161(){ +// line 1149 "src/Parser/TemplateParser.y" + public function yy_r163(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, ''); } -// line 1145 "src/Parser/TemplateParser.y" - public function yy_r162(){ +// line 1154 "src/Parser/TemplateParser.y" + public function yy_r164(){ $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'property'); } -// line 1150 "src/Parser/TemplateParser.y" - public function yy_r163(){ +// line 1159 "src/Parser/TemplateParser.y" + public function yy_r165(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor, 'property'); } -// line 1156 "src/Parser/TemplateParser.y" - public function yy_r164(){ +// line 1165 "src/Parser/TemplateParser.y" + public function yy_r166(){ $this->_retvalue = ' '. trim($this->yystack[$this->yyidx + 0]->minor) . ' '; } -// line 1160 "src/Parser/TemplateParser.y" - public function yy_r165(){ +// line 1169 "src/Parser/TemplateParser.y" + public function yy_r167(){ static $lops = array( 'eq' => ' == ', 'ne' => ' != ', @@ -2688,8 +2715,8 @@ public static $yy_action = array( $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $lops[$op]; } -// line 1179 "src/Parser/TemplateParser.y" - public function yy_r166(){ +// line 1188 "src/Parser/TemplateParser.y" + public function yy_r168(){ static $tlops = array( 'isdivby' => array('op' => ' % ', 'pre' => '!('), 'isnotdivby' => array('op' => ' % ', 'pre' => '('), @@ -2701,8 +2728,8 @@ public static $yy_action = array( $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $tlops[$op]; } -// line 1192 "src/Parser/TemplateParser.y" - public function yy_r167(){ +// line 1201 "src/Parser/TemplateParser.y" + public function yy_r169(){ static $scond = array ( 'iseven' => '!(1 & ', 'isnoteven' => '(1 & ', @@ -2712,54 +2739,54 @@ public static $yy_action = array( $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $scond[$op]; } -// line 1206 "src/Parser/TemplateParser.y" - public function yy_r168(){ +// line 1215 "src/Parser/TemplateParser.y" + public function yy_r170(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; } -// line 1217 "src/Parser/TemplateParser.y" - public function yy_r171(){ +// line 1226 "src/Parser/TemplateParser.y" + public function yy_r173(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; } -// line 1225 "src/Parser/TemplateParser.y" - public function yy_r173(){ +// line 1234 "src/Parser/TemplateParser.y" + public function yy_r175(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1229 "src/Parser/TemplateParser.y" - public function yy_r174(){ +// line 1238 "src/Parser/TemplateParser.y" + public function yy_r176(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1245 "src/Parser/TemplateParser.y" - public function yy_r177(){ +// line 1254 "src/Parser/TemplateParser.y" + public function yy_r179(){ $this->compiler->leaveDoubleQuote(); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php($this); } -// line 1251 "src/Parser/TemplateParser.y" - public function yy_r178(){ +// line 1260 "src/Parser/TemplateParser.y" + public function yy_r180(){ $this->yystack[$this->yyidx + -1]->minor->append_subtree($this, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -// line 1256 "src/Parser/TemplateParser.y" - public function yy_r179(){ +// line 1265 "src/Parser/TemplateParser.y" + public function yy_r181(){ $this->_retvalue = new Dq($this, $this->yystack[$this->yyidx + 0]->minor); } -// line 1260 "src/Parser/TemplateParser.y" - public function yy_r180(){ +// line 1269 "src/Parser/TemplateParser.y" + public function yy_r182(){ $this->_retvalue = new Code('(string)'.$this->yystack[$this->yyidx + -1]->minor); } -// line 1264 "src/Parser/TemplateParser.y" - public function yy_r181(){ +// line 1273 "src/Parser/TemplateParser.y" + public function yy_r183(){ $this->_retvalue = new Code('(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); } -// line 1268 "src/Parser/TemplateParser.y" - public function yy_r182(){ +// line 1277 "src/Parser/TemplateParser.y" + public function yy_r184(){ $this->_retvalue = new Code('(string)$_smarty_tpl->getValue(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')'); } -// line 1280 "src/Parser/TemplateParser.y" - public function yy_r185(){ +// line 1289 "src/Parser/TemplateParser.y" + public function yy_r187(){ $this->_retvalue = new Tag($this, $this->yystack[$this->yyidx + 0]->minor); } -// line 1284 "src/Parser/TemplateParser.y" - public function yy_r186(){ +// line 1293 "src/Parser/TemplateParser.y" + public function yy_r188(){ $this->_retvalue = new DqContent($this->yystack[$this->yyidx + 0]->minor); } diff --git a/src/Parser/TemplateParser.y b/src/Parser/TemplateParser.y index 1c604e3c..e69f6367 100644 --- a/src/Parser/TemplateParser.y +++ b/src/Parser/TemplateParser.y @@ -672,14 +672,23 @@ expr(res) ::= expr(e1) ISIN value(v). { // // ternary // -ternary(res) ::= OPENP expr(v) CLOSEP QMARK DOLLARID(e1) COLON expr(e2). { +ternary(res) ::= expr(v) QMARK DOLLARID(e1) COLON expr(e2). { res = v.' ? '. $this->compiler->compileVariable('\''.substr(e1,1).'\'') . ' : '.e2; } -ternary(res) ::= OPENP expr(v) CLOSEP QMARK expr(e1) COLON expr(e2). { +ternary(res) ::= expr(v) QMARK value(e1) COLON expr(e2). { res = v.' ? '.e1.' : '.e2; } +ternary(res) ::= expr(v) QMARK expr(e1) COLON expr(e2). { + res = v.' ? '.e1.' : '.e2; +} + +// shorthand ternary +ternary(res) ::= expr(v) QMARK COLON expr(e2). { + res = v.' ?: '.e2; +} + // value value(res) ::= variable(v). { res = v; diff --git a/tests/PHPUnit_Smarty.php b/tests/PHPUnit_Smarty.php index 98042db5..18b4112f 100644 --- a/tests/PHPUnit_Smarty.php +++ b/tests/PHPUnit_Smarty.php @@ -100,7 +100,7 @@ class PHPUnit_Smarty extends PHPUnit\Framework\TestCase * * @param null $dir working directory */ - public function setUpSmarty($dir = null) + public function setUpSmarty($dir) { static $s_dir; // set up current working directory diff --git a/tests/UnitTests/TemplateSource/TernaryTest.php b/tests/UnitTests/TemplateSource/TernaryTest.php new file mode 100644 index 00000000..95ce4b34 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TernaryTest.php @@ -0,0 +1,41 @@ +setUpSmarty('/tmp'); + $this->cleanDirs(); + } + + public function testTernaryTrue() { + $tpl = $this->smarty->createTemplate('string:{$a ? $b : $c}'); + $tpl->assign('a', true); + $tpl->assign('b', 'B'); + $tpl->assign('c', 'C'); + $this->assertEquals('B', $this->smarty->fetch($tpl)); + } + + public function testTernaryFalse() { + $tpl = $this->smarty->createTemplate('string:{$a ? $b : $c}'); + $tpl->assign('a', false); + $tpl->assign('b', 'B'); + $tpl->assign('c', 'C'); + $this->assertEquals('C', $this->smarty->fetch($tpl)); + } + + public function testShorthandTernaryTrue() { + $tpl = $this->smarty->createTemplate('string:{$a ?: $c}'); + $tpl->assign('a', true); + $tpl->assign('c', 'C'); + $this->assertEquals(true, $this->smarty->fetch($tpl)); + } + + public function testShorthandTernaryFalse() { + $tpl = $this->smarty->createTemplate('string:{$a ? $b : $c}'); + $tpl->assign('a', false); + $tpl->assign('c', 'C'); + $this->assertEquals('C', $this->smarty->fetch($tpl)); + } + +}