Skip to content

Commit

Permalink
- quick hack to pass the tests for the new flow types: DeclareOpaqueT…
Browse files Browse the repository at this point in the history
…ype and OpaqueType.

- bumped build revision and moving towards public 'scoped package' releases as per https://docs.npmjs.com/misc/scope; this is also related to GerHobbelt/jison#11
  • Loading branch information
GerHobbelt committed Aug 27, 2017
1 parent 3a98341 commit 890dfc3
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 245 deletions.
16 changes: 16 additions & 0 deletions lib/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,11 @@ function genericPrintNoParens(path, options, print) {

case "DeclareTypeAlias":
parts.push("declare ");
return concat(parts);

case "DeclareOpaqueType":
parts.push("declare ");
return concat(parts);

case "TypeAlias":
return concat([
Expand All @@ -1551,6 +1556,17 @@ function genericPrintNoParens(path, options, print) {
";"
]);

case "OpaqueType":
return concat([
"type ",
path.call(print, "id"),
path.call(print, "typeParameters"),
" = ",
path.call(print, "implType"),
path.call(print, "superType"),
";"
]);

case "TypeCastExpression":
return concat([
"(",
Expand Down
2 changes: 1 addition & 1 deletion lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// custom types to the AST type system (in particular, the File type), but
// those types are now incorporated into ast-types, so this module doesn't
// have much to do anymore. Still, it might prove useful in the future.
module.exports = require("ast-types");
module.exports = require("@gerhobbelt/ast-types");
Loading

0 comments on commit 890dfc3

Please sign in to comment.