-
Notifications
You must be signed in to change notification settings - Fork 43
Add support for abstract classes #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Only a few nitpicks.
@@ -297,7 +297,8 @@ class TSDefParser extends StdTokenParsers with ImplicitConversions { | |||
| "public" ^^^ Modifier.Public | |||
| "readonly" ^^^ Modifier.ReadOnly | |||
| "protected" ^^^ Modifier.Protected | |||
) | |||
| lexical.Identifier("abstract") ^^^ Modifier.Abstract | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting for the )
was broken here (there should be only 2 spaces before it).
@@ -139,7 +139,8 @@ class Printer(private val output: PrintWriter, outputPackage: String) { | |||
if (sym.modifiers(Modifier.Const)) "val" | |||
else if (sym.modifiers(Modifier.ReadOnly)) "def" | |||
else "var" | |||
pln" $access$decl $name: ${sym.tpe} = js.native" | |||
p" $access$decl $name: ${sym.tpe}" | |||
pln"${if (sym.modifiers(Modifier.Abstract)) "" else " = js.native"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the following would be more readable:
if (!sym.modifiers(Modifier.Abstract))
p" = js.native"
pln""
@@ -158,7 +159,8 @@ class Printer(private val output: PrintWriter, outputPackage: String) { | |||
p" ${modifiers}def $name" | |||
if (!sym.tparams.isEmpty) | |||
p"[${sym.tparams}]" | |||
pln"($params): ${sym.resultType} = js.native" | |||
p"($params): ${sym.resultType}" | |||
pln"${if (sym.modifiers(Modifier.Abstract)) "" else " = js.native"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same readability comment here.
This should now be rebased on master, and the |
086f99f
to
e3b265b
Compare
Rebased and nitpicks should have been addressed, too :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
Including abstract fields and methods.