-
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 #51 from CASC-Lang/trait-impl
Trait impl implementation phase II: Implement Trait declaration
- Loading branch information
Showing
18 changed files
with
511 additions
and
143 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.casc.lang.ast | ||
|
||
import org.casc.lang.table.HasFlag | ||
import org.casc.lang.table.Reference | ||
import org.objectweb.asm.Opcodes | ||
|
||
data class TraitInstance( | ||
override val packageReference: Reference?, | ||
val accessorToken: Token?, | ||
val traitKeyword: Token?, | ||
override val typeReference: Reference, | ||
override val fields: List<Field>, | ||
override val accessor: Accessor = Accessor.fromString(accessorToken?.literal) | ||
) : TypeInstance(), HasFlag { | ||
override val flag: Int by lazy { | ||
accessor.access + Opcodes.ACC_ABSTRACT + Opcodes.ACC_INTERFACE | ||
} | ||
} |
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.