-
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: CASC Weekly Release | ||
name: CASC Weekly Release | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * 1" | ||
- cron: "0 0 * * 1" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
@@ -18,45 +18,45 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Jar built files with Gradle | ||
run: ./gradlew jar | ||
- name: Create release | ||
uses: actions/create-release@v1 | ||
id: create_release | ||
with: | ||
draft: false | ||
prerelease: false | ||
release_name: ${{ steps.version.outputs.version }} | ||
tag_name: ${{ steps.date.outputs.date }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Upload Jar file to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./build/libs/CASC-0.0.1.jar | ||
asset_name: CASC-Weekly-${{ steps.date.outputs.date }}.jar | ||
asset_content_type: application/zip | ||
- name: Publish Jar file | ||
uses: actions/[email protected] | ||
with: | ||
# Artifact name | ||
name: CASC-Weekly-${{ steps.date.outputs.date }}.jar | ||
# A file, directory or wildcard pattern that describes what to upload | ||
path: ./build/libs/CASC-0.0.1.jar | ||
# The desired behavior if no files are found using the provided path. | ||
- uses: actions/checkout@v2 | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Jar built files with Gradle | ||
run: ./gradlew jar | ||
- name: Create release | ||
uses: actions/create-release@v1 | ||
id: create_release | ||
with: | ||
draft: false | ||
prerelease: false | ||
release_name: ${{ steps.version.outputs.version }} | ||
tag_name: ${{ steps.date.outputs.date }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Upload Jar file to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./build/libs/CASC-0.0.1.jar | ||
asset_name: CASC-Weekly-${{ steps.date.outputs.date }}.jar | ||
asset_content_type: application/zip | ||
- name: Publish Jar file | ||
uses: actions/[email protected] | ||
with: | ||
# Artifact name | ||
name: CASC-Weekly-${{ steps.date.outputs.date }}.jar | ||
# A file, directory or wildcard pattern that describes what to upload | ||
path: ./build/libs/CASC-0.0.1.jar | ||
# The desired behavior if no files are found using the provided path. |
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.