Merge branch 'master' into ast
This commit is contained in:
commit
1643628c60
@ -1,2 +1,4 @@
|
|||||||
version = 3.8.6
|
version = 3.8.6
|
||||||
runner.dialect = scala3
|
runner.dialect = scala3
|
||||||
|
|
||||||
|
maxColumn = 100
|
||||||
|
@ -24,9 +24,7 @@ object ast {
|
|||||||
case object PairLiter extends Expr6 with ParserBridge0[PairLiter.type]
|
case object PairLiter extends Expr6 with ParserBridge0[PairLiter.type]
|
||||||
case class Ident(v: String) extends Expr6 with LValue
|
case class Ident(v: String) extends Expr6 with LValue
|
||||||
object Ident extends ParserBridge1[String, Ident]
|
object Ident extends ParserBridge1[String, Ident]
|
||||||
case class ArrayElem(name: Ident, indices: List[Expr])
|
case class ArrayElem(name: Ident, indices: List[Expr]) extends Expr6 with LValue
|
||||||
extends Expr6
|
|
||||||
with LValue
|
|
||||||
object ArrayElem extends ParserBridge2[Ident, List[Expr], ArrayElem]
|
object ArrayElem extends ParserBridge2[Ident, List[Expr], ArrayElem]
|
||||||
case class Parens(expr: Expr) extends Expr6
|
case class Parens(expr: Expr) extends Expr6
|
||||||
object Parens extends ParserBridge1[Expr, Parens]
|
object Parens extends ParserBridge1[Expr, Parens]
|
||||||
@ -78,17 +76,13 @@ object ast {
|
|||||||
case object BoolType extends BaseType with ParserBridge0[BoolType.type]
|
case object BoolType extends BaseType with ParserBridge0[BoolType.type]
|
||||||
case object CharType extends BaseType with ParserBridge0[CharType.type]
|
case object CharType extends BaseType with ParserBridge0[CharType.type]
|
||||||
case object StringType extends BaseType with ParserBridge0[StringType.type]
|
case object StringType extends BaseType with ParserBridge0[StringType.type]
|
||||||
case class ArrayType(elemType: Type, dimensions: Int)
|
case class ArrayType(elemType: Type, dimensions: Int) extends Type with PairElemType
|
||||||
extends Type
|
|
||||||
with PairElemType
|
|
||||||
object ArrayType extends ParserBridge2[Type, Int, ArrayType]
|
object ArrayType extends ParserBridge2[Type, Int, ArrayType]
|
||||||
case class PairType(fst: PairElemType, snd: PairElemType) extends Type
|
case class PairType(fst: PairElemType, snd: PairElemType) extends Type
|
||||||
object PairType extends ParserBridge2[PairElemType, PairElemType, PairType]
|
object PairType extends ParserBridge2[PairElemType, PairElemType, PairType]
|
||||||
|
|
||||||
sealed trait PairElemType
|
sealed trait PairElemType
|
||||||
case object UntypedPairType
|
case object UntypedPairType extends PairElemType with ParserBridge0[UntypedPairType.type]
|
||||||
extends PairElemType
|
|
||||||
with ParserBridge0[UntypedPairType.type]
|
|
||||||
|
|
||||||
// waccadoodledo
|
// waccadoodledo
|
||||||
case class Program(funcs: List[FuncDecl], main: List[Stmt])
|
case class Program(funcs: List[FuncDecl], main: List[Stmt])
|
||||||
@ -101,8 +95,7 @@ object ast {
|
|||||||
params: List[Param],
|
params: List[Param],
|
||||||
body: List[Stmt]
|
body: List[Stmt]
|
||||||
)
|
)
|
||||||
object FuncDecl
|
object FuncDecl extends ParserBridge4[Type, Ident, List[Param], List[Stmt], FuncDecl]
|
||||||
extends ParserBridge4[Type, Ident, List[Param], List[Stmt], FuncDecl]
|
|
||||||
|
|
||||||
case class Param(paramType: Type, name: Ident)
|
case class Param(paramType: Type, name: Ident)
|
||||||
object Param extends ParserBridge2[Type, Ident, Param]
|
object Param extends ParserBridge2[Type, Ident, Param]
|
||||||
@ -124,8 +117,7 @@ object ast {
|
|||||||
object Exit extends ParserBridge1[Expr, Exit]
|
object Exit extends ParserBridge1[Expr, Exit]
|
||||||
case class Print(expr: Expr, newline: Boolean) extends Stmt
|
case class Print(expr: Expr, newline: Boolean) extends Stmt
|
||||||
object Print extends ParserBridge2[Expr, Boolean, Print]
|
object Print extends ParserBridge2[Expr, Boolean, Print]
|
||||||
case class If(cond: Expr, thenStmt: List[Stmt], elseStmt: List[Stmt])
|
case class If(cond: Expr, thenStmt: List[Stmt], elseStmt: List[Stmt]) extends Stmt
|
||||||
extends Stmt
|
|
||||||
object If extends ParserBridge3[Expr, List[Stmt], List[Stmt], If]
|
object If extends ParserBridge3[Expr, List[Stmt], List[Stmt], If]
|
||||||
case class While(cond: Expr, body: List[Stmt]) extends Stmt
|
case class While(cond: Expr, body: List[Stmt]) extends Stmt
|
||||||
object While extends ParserBridge2[Expr, List[Stmt], While]
|
object While extends ParserBridge2[Expr, List[Stmt], While]
|
||||||
|
@ -5,10 +5,7 @@ import org.scalatest.flatspec.AnyFlatSpec
|
|||||||
import org.scalatest.Inspectors.forEvery
|
import org.scalatest.Inspectors.forEvery
|
||||||
import parsley.{Success, Failure}
|
import parsley.{Success, Failure}
|
||||||
|
|
||||||
class ParallelExamplesSpec
|
class ParallelExamplesSpec extends AnyFlatSpec with BeforeAndAfterAll with ParallelTestExecution {
|
||||||
extends AnyFlatSpec
|
|
||||||
with BeforeAndAfterAll
|
|
||||||
with ParallelTestExecution {
|
|
||||||
val files =
|
val files =
|
||||||
allWaccFiles("wacc-examples/valid").map { p =>
|
allWaccFiles("wacc-examples/valid").map { p =>
|
||||||
(p.toString, List(0))
|
(p.toString, List(0))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user