Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15374485
D14627.id35390.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14627.id35390.diff
View Options
diff --git a/src/parser/xhpast/__tests__/data/yyinitdepth.php.test b/src/parser/xhpast/__tests__/data/yyinitdepth.php.test
new file mode 100644
--- /dev/null
+++ b/src/parser/xhpast/__tests__/data/yyinitdepth.php.test
@@ -0,0 +1,65 @@
+<?php
+
+if ($node instanceof Node\Expr\BinaryOp\BitwiseXor) {
+ return $left ^ $right;
+} else if ($node instanceof Node\Expr\BinaryOp\BitwiseAnd) {
+ return $left & $right;
+} else if ($node instanceof Node\Expr\BinaryOp\BitwiseOr) {
+ return $left | $right;
+} else if ($node instanceof Node\Expr\BinaryOp\BooleanAnd) {
+ return $left && $right;
+} else if ($node instanceof Node\Expr\BinaryOp\BooleanOr) {
+ return $left || $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Coalesce ) {
+ return $left ?: $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Concat) {
+ return $left.$right;
+} else if ($node instanceof Node\Expr\BinaryOp\Div) {
+ return $left / $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Equal) {
+ return $left == $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Greater) {
+ return $left > $right;
+} else if ($node instanceof Node\Expr\BinaryOp\GreaterOrEqual) {
+ return $left >= $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Identical) {
+ return $left === $right;
+} else if ($node instanceof Node\Expr\BinaryOp\LogicalAnd) {
+ return $left && $right;
+} else if ($node instanceof Node\Expr\BinaryOp\LogicalOr) {
+ return $left || $right;
+} else if ($node instanceof Node\Expr\BinaryOp\LogicalXor) {
+ return $left xor $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Minus) {
+ return $left - $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Mod) {
+ return $left % $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Mul) {
+ return $left * $right;
+} else if ($node instanceof Node\Expr\BinaryOp\NotEqual) {
+ return $left != $right;
+} else if ($node instanceof Node\Expr\BinaryOp\NotIdentical) {
+ return $left !== $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Plus) {
+ return $left + $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Pow) {
+ return pow($left, $right);
+} else if ($node instanceof Node\Expr\BinaryOp\ShiftLeft) {
+ return $left << $right;
+} else if ($node instanceof Node\Expr\BinaryOp\ShiftRight) {
+ return $left >> $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Smaller) {
+ return $left < $right;
+} else if ($node instanceof Node\Expr\BinaryOp\SmallerOrEqual) {
+ return $left <= $right;
+} else if ($node instanceof Node\Expr\BinaryOp\Spaceship) {
+ if ($left < $right) {
+ return -1;
+ } else if ($left == $right) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+~~~~~~~~~~
+pass
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 13, 7:13 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7629721
Default Alt Text
D14627.id35390.diff (2 KB)
Attached To
Mode
D14627: Add a test case for `YYINITDEPTH`
Attached
Detach File
Event Timeline
Log In to Comment