Skip to content

Commit

Permalink
feat: support bigints
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Nov 18, 2020
1 parent 8dd443f commit 9d756ed
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/productions/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function primitive_type(tokeniser) {
const { source } = tokeniser;
const num_type = integer_type(tokeniser) || decimal_type(tokeniser);
if (num_type) return num_type;
const base = tokeniser.consume("boolean", "byte", "octet", "undefined");
const base = tokeniser.consume("bigint", "boolean", "byte", "octet", "undefined");
if (base) {
return new Type({ source, tokens: { base } });
}
Expand Down
1 change: 1 addition & 0 deletions lib/tokeniser.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const nonRegexTerminals = [
"NaN",
"ObservableArray",
"Promise",
"bigint",
"boolean",
"byte",
"double",
Expand Down
3 changes: 3 additions & 0 deletions test/invalid/idl/bigint-keyword.webidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dictionary Dictionary {
long long bigint;
};
13 changes: 13 additions & 0 deletions test/syntax/idl/bigint.webidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Exposed=Window]
interface Interface {
attribute bigint _bigint;
bigint getBig();
void setBig(bigint big);
};

dictionary Dictionary {
bigint big;
required bigint another;
};

typedef (bigint or short) allowed;

0 comments on commit 9d756ed

Please sign in to comment.