Declare message/assertion types, so latest babel doesn't complain about missing exports
This commit is contained in:
parent
7447a4d3dc
commit
31b3ef250d
|
@ -1,5 +1,6 @@
|
||||||
// Horrible, horrible, horrible, horrible hack to get hold of the Parser
|
// Horrible, horrible, horrible, horrible hack to get hold of (a) the
|
||||||
// from babel-parser/src/parser/index.js.
|
// Parser and (b) various flags and non-exported values from
|
||||||
|
// babel-parser/src/parser/index.js.
|
||||||
|
|
||||||
exports._original_Parser = Parser;
|
exports._original_Parser = Parser;
|
||||||
exports.__getParser = function () {
|
exports.__getParser = function () {
|
||||||
|
@ -8,3 +9,5 @@ exports.__getParser = function () {
|
||||||
exports.__setParser = function (newParser) {
|
exports.__setParser = function (newParser) {
|
||||||
Parser = newParser;
|
Parser = newParser;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.BIND_LEXICAL = BIND_LEXICAL;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
import { _original_Parser, tokTypes as tt } from "@babel/parser";
|
import { _original_Parser, BIND_LEXICAL, tokTypes as tt } from "@babel/parser";
|
||||||
|
|
||||||
export default class SyndicateParser extends _original_Parser {
|
export default class SyndicateParser extends _original_Parser {
|
||||||
// Overrides ExpressionParser.parseMaybeAssign
|
// Overrides ExpressionParser.parseMaybeAssign
|
||||||
|
@ -141,6 +141,7 @@ export default class SyndicateParser extends _original_Parser {
|
||||||
this.eatContextual("type");
|
this.eatContextual("type");
|
||||||
if (!this.match(tt.name)) { this.unexpected(null, tt.name); }
|
if (!this.match(tt.name)) { this.unexpected(null, tt.name); }
|
||||||
node.id = this.parseIdentifier();
|
node.id = this.parseIdentifier();
|
||||||
|
this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
|
||||||
this.parseFunctionParams(node); // eww
|
this.parseFunctionParams(node); // eww
|
||||||
node.formals = node.params;
|
node.formals = node.params;
|
||||||
delete node.params; // eww
|
delete node.params; // eww
|
||||||
|
|
Loading…
Reference in New Issue