-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
while loop support, and native functions (including ffi!)
- Loading branch information
Showing
34 changed files
with
465 additions
and
113 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// GENERATED CODE FROM PORK AST CODEGEN | ||
package gay.pizza.pork.ast | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("break") | ||
class Break : Expression() { | ||
override val type: NodeType = NodeType.Break | ||
|
||
override fun <T> visit(visitor: NodeVisitor<T>): T = | ||
visitor.visitBreak(this) | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (other !is Break) return false | ||
return true | ||
} | ||
|
||
override fun hashCode(): Int = | ||
31 * type.hashCode() | ||
} |
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,22 @@ | ||
// GENERATED CODE FROM PORK AST CODEGEN | ||
package gay.pizza.pork.ast | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("continue") | ||
class Continue : Expression() { | ||
override val type: NodeType = NodeType.Continue | ||
|
||
override fun <T> visit(visitor: NodeVisitor<T>): T = | ||
visitor.visitContinue(this) | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (other !is Continue) return false | ||
return true | ||
} | ||
|
||
override fun hashCode(): Int = | ||
31 * type.hashCode() | ||
} |
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,29 @@ | ||
// GENERATED CODE FROM PORK AST CODEGEN | ||
package gay.pizza.pork.ast | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("native") | ||
class Native(val form: Symbol, val definition: StringLiteral) : Node() { | ||
override val type: NodeType = NodeType.Native | ||
|
||
override fun <T> visitChildren(visitor: NodeVisitor<T>): List<T> = | ||
visitor.visitNodes(form, definition) | ||
|
||
override fun <T> visit(visitor: NodeVisitor<T>): T = | ||
visitor.visitNative(this) | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (other !is Native) return false | ||
return other.form == form && other.definition == definition | ||
} | ||
|
||
override fun hashCode(): Int { | ||
var result = form.hashCode() | ||
result = 31 * result + definition.hashCode() | ||
result = 31 * result + type.hashCode() | ||
return result | ||
} | ||
} |
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,29 @@ | ||
// GENERATED CODE FROM PORK AST CODEGEN | ||
package gay.pizza.pork.ast | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("while") | ||
class While(val condition: Expression, val block: Block) : Expression() { | ||
override val type: NodeType = NodeType.While | ||
|
||
override fun <T> visitChildren(visitor: NodeVisitor<T>): List<T> = | ||
visitor.visitNodes(condition, block) | ||
|
||
override fun <T> visit(visitor: NodeVisitor<T>): T = | ||
visitor.visitWhile(this) | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (other !is While) return false | ||
return other.condition == condition && other.block == block | ||
} | ||
|
||
override fun hashCode(): Int { | ||
var result = condition.hashCode() | ||
result = 31 * result + block.hashCode() | ||
result = 31 * result + type.hashCode() | ||
return result | ||
} | ||
} |
Oops, something went wrong.