-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'resources/webidl2/' changes from dd57b9f0db..68a37d21e8
68a37d21e8 chore(package): bump version number to 12.1.0 621d0b6c17 fix: prevent keywords from being identifiers (#157) 9ad8932034 chore(package): bump version number to 12.0.0 a154b63cea BREAKING CHANGE: remove allowNestedTypedefs (#155) 5a495f76a5 refactor: remove all_ws() and gather trivia implicitly (#154) e717aa67fa tests: Remove test/widlproc (#153) 131e74cc57 chore(package): bump version number to 11.0.0 09f8a1daae Prevent incorrect enums (#151) fa060611a9 BREAKING CHANGE: remove opt.ws (#150) 2bb4e1cbb2 chore(package): bump version number to 10.3.3 (#149) 80936fa3c9 oefactor simple_extended_attr() (#148) c060079cca docs: remove description about typePair (#147) 4169268630 docs: simple WebIDL checker. (#146) a28c7b55f7 chore(package): bump version number to 10.3.2 e311680dc0 fix: correctly handle whitespaces of implements and includes. (#145) 50c828344d refactor: remove eas.length check (#144) 968ca63fd4 refactor: one-to-one match for token matcher (#143) 8531535861 chore(package): bump version number to 10.3.1 96deeb3480 const-type as full IDL Type (#142) a13dfa8cf5 chore(package): bump version number to 10.3.0 c0ab164af2 always add extAttrs for .idlType (#141) 932dcfb96d docs(README): add missing typedef-type 56777f49dc docs(README): add missing types-of-types c14d7c1767 docs(README): add types of types (#140) 730a3b99db chore(CHANGELOG): regenerate git-subtree-dir: resources/webidl2 git-subtree-split: 68a37d21e81740563a5e98198e0e979232d363c0
- Loading branch information
Showing
75 changed files
with
1,351 additions
and
942 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>WebIDL 2 Checker</title> | ||
|
||
<script src='../lib/webidl2.js'></script> | ||
<script> | ||
let parserResult = undefined; | ||
|
||
function formatParserOutput() { | ||
const outputEl = document.getElementById('webidl-checker-output'); | ||
if (parserResult) { | ||
const prettyPrintEl = document.getElementById('pretty-print'); | ||
outputEl.innerText = JSON.stringify(parserResult, null, prettyPrintEl.checked ? 2 : null); | ||
} else { | ||
outputEl.innerText = ''; | ||
} | ||
} | ||
|
||
function checkWebIDL(textToCheck) { | ||
const validation = document.getElementById('webidl-checker-validation'); | ||
parserResult = null; | ||
try { | ||
parserResult = WebIDL2.parse(textToCheck); | ||
validation.innerText = 'WebIDL parsed successfully!'; | ||
} catch (e) { | ||
validation.innerText = 'Exception while parsing WebIDL. See JavaScript console for more details.\n\n' + e.toString(); | ||
// Pass it along to the JavaScript console. | ||
throw e; | ||
} finally { | ||
formatParserOutput(); | ||
} | ||
} | ||
</script> | ||
<style> | ||
textarea { | ||
font-family: monospace; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h2>WebIDL Checker</h2> | ||
<p>This is an online checker for WebIDL built on the <a href="https://github.com/w3c/webidl2.js">webidl2.js</a> project.</p> | ||
<p>Enter your WebIDL to check below:</p> | ||
<textarea id='webidl-to-check' rows='20' cols='80'></textarea> | ||
<br> | ||
<input type='button' value='Check WebIDL' onclick='checkWebIDL(document.getElementById("webidl-to-check").value)'> | ||
<p>Validation results:</p> | ||
<textarea id='webidl-checker-validation' rows='20' cols='80'></textarea> | ||
<p>Parser output:</p> | ||
<textarea id='webidl-checker-output' rows='20' cols='80'></textarea> | ||
<br> | ||
<input type='checkbox' id='pretty-print' checked='true' onchange='formatParserOutput()'>Pretty Print | ||
</body> | ||
</html> |
Oops, something went wrong.