-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from CASC-Lang/trait-impl
Trait impl implementation phase III: Trait Impl
- Loading branch information
Showing
65 changed files
with
877 additions
and
453 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,29 +1,23 @@ | ||
package org.casc.lang.ast | ||
|
||
import org.casc.lang.table.HasFlag | ||
import org.casc.lang.table.Reference | ||
import org.casc.lang.utils.getOrElse | ||
import org.objectweb.asm.Opcodes | ||
|
||
data class ClassInstance( | ||
override val packageReference: Reference?, | ||
val accessorToken: Token?, | ||
val abstrToken: Token?, // Unused | ||
val abstrToken: Token?, | ||
val mutKeyword: Token?, | ||
val classKeyword: Token?, | ||
val classKeyword: Token, | ||
override val typeReference: Reference, | ||
override val fields: List<Field>, | ||
override val accessor: Accessor = Accessor.fromString(accessorToken?.literal) | ||
) : TypeInstance(), HasFlag { | ||
) : TypeInstance() { | ||
override val flag: Int by lazy { | ||
var flag = Opcodes.ACC_SUPER | ||
flag += accessor.access | ||
flag += abstrToken.getOrElse(Opcodes.ACC_ABSTRACT) | ||
flag += mutKeyword.getOrElse(0, Opcodes.ACC_FINAL) | ||
flag += abstrToken.getOrElse(Opcodes.ACC_ABSTRACT, mutKeyword.getOrElse(0, Opcodes.ACC_FINAL)) | ||
flag | ||
} | ||
|
||
val parentClassReference: Reference by lazy { | ||
impl?.parentClassReference ?: Reference.OBJECT_TYPE_REFERENCE | ||
} | ||
} |
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,3 @@ | ||
package org.casc.lang.ast | ||
|
||
data class CompanionBlock(val compKeyword: Token, val statements: List<Statement>) |
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
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
package org.casc.lang.ast | ||
|
||
data class TraitImpl(val implKeyword: Token, val functions: List<Function>) | ||
import org.casc.lang.table.Reference | ||
|
||
data class TraitImpl(val implKeyword: Token, val implementedTraitReference: Reference, val functions: List<Function>) |
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
Oops, something went wrong.