Skip to content

Commit 76560a6

Browse files
committed
Now successfully parses all valid IDL and errors on most invalid IDL
1 parent 804f57b commit 76560a6

File tree

6 files changed

+2963
-1715
lines changed

6 files changed

+2963
-1715
lines changed

.phan/stubs/Assert.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,26 @@ abstract class Assert {
1010
*/
1111
public static function assertEquals( $expected, $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false ): void {
1212
}
13+
14+
/**
15+
* Asserts that a condition is true.
16+
*
17+
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
18+
* @throws ExpectationFailedException
19+
*
20+
* @psalm-assert true $condition
21+
*/
22+
public static function assertTrue( $condition, string $message = '' ): void {
23+
}
24+
25+
/**
26+
* Mark the test as skipped.
27+
*
28+
* @throws SkippedTestError
29+
* @throws SyntheticSkippedError
30+
*
31+
* @psalm-return never-return
32+
*/
33+
public static function markTestSkipped( string $message = '' ): void {
34+
}
1335
}

.phan/stubs/SyntaxError.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
namespace WikiPEG;
4+
5+
class SyntaxError extends \Exception implements \JsonSerializable {
6+
}

bin/parse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
require_once __DIR__ . "/../vendor/autoload.php";
33

44
global $argv;
5-
var_dump(\Wikimedia\WebIDL\WebIDL::parse(file_get_contents($argv[1])));
5+
var_dump( \Wikimedia\WebIDL\WebIDL::parse( file_get_contents( $argv[1] ) ) );

0 commit comments

Comments
 (0)