diff --git a/src/main/php/lang/ast/syntax/PHP.class.php b/src/main/php/lang/ast/syntax/PHP.class.php index 4eff29c..aacc31d 100755 --- a/src/main/php/lang/ast/syntax/PHP.class.php +++ b/src/main/php/lang/ast/syntax/PHP.class.php @@ -71,6 +71,7 @@ IsLiteral, IsMap, IsNullable, + IsUnchecked, IsUnion, IsValue }; @@ -1115,6 +1116,11 @@ public function list($parse, $end, $kind) { } public function type($parse, $optional= true) { + if ('@' === $parse->token->value) { + $parse->forward(); + return new IsUnchecked($this->type($parse, false)); + } + $t= $this->type0($parse, $optional); // Check for union and intersection types (which cannot be mixed diff --git a/src/main/php/lang/ast/types/IsUnchecked.class.php b/src/main/php/lang/ast/types/IsUnchecked.class.php new file mode 100755 index 0000000..eb253db --- /dev/null +++ b/src/main/php/lang/ast/types/IsUnchecked.class.php @@ -0,0 +1,32 @@ +element= $element; + } + + /** @return string */ + public function literal() { return $this->element->literal(); } + + /** @return string */ + public function name() { return $this->element->name(); } + + /** + * Compare + * + * @param var $value + * @return int + */ + public function compareTo($value) { + return $value instanceof self ? $this->element->compareTo($value->element) : 1; + } +} \ No newline at end of file