mirror of
https://github.com/fluencelabs/aqua.git
synced 2025-04-25 15:02:14 +00:00
Reformat
This commit is contained in:
parent
9f80069615
commit
d2676c8b14
16
README.md
16
README.md
@ -1,9 +1,13 @@
|
|||||||
## sbt project compiled with Dotty
|
## Aquamarine HLL
|
||||||
|
|
||||||
### Usage
|
The high level language that compiles to AIR and some wrappers in the host language (e.g. TypeScript).
|
||||||
|
|
||||||
This is a normal sbt project, you can compile code with `sbt compile` and run it
|
### TODO
|
||||||
with `sbt run`, `sbt console` will start a Dotty REPL.
|
|
||||||
|
|
||||||
For more information on the sbt-dotty plugin, see the
|
- Lambda
|
||||||
[dotty-example-project](https://github.com/lampepfl/dotty-example-project/blob/master/README.md).
|
- Build data types: extend
|
||||||
|
- Platform-specific Predef with Return ability
|
||||||
|
- Implementation for abilities
|
||||||
|
- Abilities passing
|
||||||
|
- Print syntax errors better way
|
||||||
|
- For the offset, find a token
|
||||||
|
@ -6,7 +6,7 @@ records[type]
|
|||||||
arrays[type]
|
arrays[type]
|
||||||
```
|
```
|
||||||
|
|
||||||
From lambda, we want to have a non-destructive transitions.
|
From lambda, we want to have non-destructive transitions.
|
||||||
|
|
||||||
Assume we have variables a...z in scope.
|
Assume we have variables a...z in scope.
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package aqua
|
package aqua
|
||||||
|
|
||||||
import aqua.parse.{ArrowType, Block, DataType, Type}
|
import aqua.parser.{ArrowType, Block, DataType, Type}
|
||||||
import cats.data.NonEmptyMap
|
import cats.data.NonEmptyMap
|
||||||
import cats.parse.{Parser ⇒ P, Parser0 ⇒ P0}
|
import cats.parse.{Parser ⇒ P, Parser0 ⇒ P0}
|
||||||
import aqua.parse.lift.Span
|
import aqua.parser.lift.Span
|
||||||
|
|
||||||
case class Aqua(
|
case class Aqua(
|
||||||
inputs: Map[String, DataType],
|
inputs: Map[String, DataType],
|
||||||
@ -13,7 +13,7 @@ case class Aqua(
|
|||||||
)
|
)
|
||||||
|
|
||||||
object Aqua {
|
object Aqua {
|
||||||
import aqua.parse.lexer.Token._
|
import aqua.parser.lexer.Token._
|
||||||
|
|
||||||
val `parser`: P0[List[Block[Span]]] = P.repSep0(Block.`block`[Span], ` \n*`)
|
val `parser`: P0[List[Block[Span]]] = P.repSep0(Block.`block`[Span], ` \n*`)
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package aqua.parse
|
package aqua.parser
|
||||||
|
|
||||||
import aqua.parse.DataType.{`customtypedef`, `datatypedef`}
|
import aqua.parser.DataType.{`customtypedef`, `datatypedef`}
|
||||||
import aqua.parse.lexer.Token._
|
import aqua.parser.lexer.Token._
|
||||||
import aqua.parse.Type.{`arrowdef`, `typedef`}
|
import aqua.parser.Type.{`arrowdef`, `typedef`}
|
||||||
import aqua.parse.lift.LiftParser
|
import aqua.parser.lift.LiftParser
|
||||||
import aqua.parse.lift.LiftParser._
|
import aqua.parser.lift.LiftParser._
|
||||||
import cats.Functor
|
import cats.Functor
|
||||||
import cats.data.{NonEmptyList, NonEmptyMap}
|
import cats.data.{NonEmptyList, NonEmptyMap}
|
||||||
import cats.parse.{Parser => P}
|
import cats.parse.{Parser => P}
|
||||||
@ -56,6 +56,7 @@ object DefService {
|
|||||||
|
|
||||||
def `servicename`[F[_]: LiftParser]: P[F[String]] = `service` *> ` ` *> Name.lift <* ` `.? <* `:` <* ` \n*`
|
def `servicename`[F[_]: LiftParser]: P[F[String]] = `service` *> ` ` *> Name.lift <* ` `.? <* `:` <* ` \n*`
|
||||||
|
|
||||||
|
// TODO switch to funchead?
|
||||||
def `defservice`[F[_]: LiftParser]: P[DefService[F]] =
|
def `defservice`[F[_]: LiftParser]: P[DefService[F]] =
|
||||||
(`servicename` ~ indented(`funcdef`).map(_.toNem)).map {
|
(`servicename` ~ indented(`funcdef`).map(_.toNem)).map {
|
||||||
case (n, f) ⇒ DefService(n, f)
|
case (n, f) ⇒ DefService(n, f)
|
||||||
@ -74,6 +75,10 @@ object Block {
|
|||||||
|
|
||||||
def block[F[_]: LiftParser: Functor]: P[Block[F]] =
|
def block[F[_]: LiftParser: Functor]: P[Block[F]] =
|
||||||
` \n*`.rep0.with1 *> P.oneOf(
|
` \n*`.rep0.with1 *> P.oneOf(
|
||||||
DefType.`deftype` :: DefService.`defservice` :: DefFunc.`deffunc` :: DefAlias.`defalias` :: Nil
|
DefType.`deftype` ::
|
||||||
|
DefService.`defservice` ::
|
||||||
|
DefFunc.`deffunc` ::
|
||||||
|
DefAlias.`defalias` ::
|
||||||
|
Nil
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -1,12 +1,12 @@
|
|||||||
package aqua.parse
|
package aqua.parser
|
||||||
|
|
||||||
import aqua.parse.lexer.Token._
|
import aqua.parser.lexer.Token._
|
||||||
import aqua.parse.lexer.Value
|
import aqua.parser.lexer.Value
|
||||||
import cats.data.NonEmptyList
|
import cats.data.NonEmptyList
|
||||||
import cats.parse.{Parser ⇒ P}
|
import cats.parse.{Parser ⇒ P}
|
||||||
import aqua.parse.lexer.Value.`value`
|
import aqua.parser.lexer.Value.`value`
|
||||||
import aqua.parse.lift.LiftParser
|
import aqua.parser.lift.LiftParser
|
||||||
import aqua.parse.lift.LiftParser._
|
import aqua.parser.lift.LiftParser._
|
||||||
import cats.Functor
|
import cats.Functor
|
||||||
import cats.syntax.functor._
|
import cats.syntax.functor._
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
package aqua.parse
|
package aqua.parser
|
||||||
|
|
||||||
import aqua.parse.lexer.Token._
|
import aqua.parser.lexer.Token._
|
||||||
import cats.parse.{Parser ⇒ P}
|
import cats.parse.{Parser ⇒ P}
|
||||||
|
|
||||||
sealed trait Type
|
sealed trait Type
|
@ -1,4 +1,4 @@
|
|||||||
package aqua.parse.lexer
|
package aqua.parser.lexer
|
||||||
|
|
||||||
import cats.data.NonEmptyList
|
import cats.data.NonEmptyList
|
||||||
import cats.parse.{Accumulator0, Parser ⇒ P, Parser0 ⇒ P0}
|
import cats.parse.{Accumulator0, Parser ⇒ P, Parser0 ⇒ P0}
|
@ -1,7 +1,7 @@
|
|||||||
package aqua.parse.lexer
|
package aqua.parser.lexer
|
||||||
|
|
||||||
import aqua.parse.BasicType
|
import aqua.parser.BasicType
|
||||||
import aqua.parse.lexer.Token._
|
import aqua.parser.lexer.Token._
|
||||||
import cats.parse.{Numbers, Parser ⇒ P}
|
import cats.parse.{Numbers, Parser ⇒ P}
|
||||||
|
|
||||||
sealed trait Value
|
sealed trait Value
|
@ -1,4 +1,4 @@
|
|||||||
package aqua.parse.lift
|
package aqua.parser.lift
|
||||||
|
|
||||||
import cats.Id
|
import cats.Id
|
||||||
import cats.parse.Parser
|
import cats.parse.Parser
|
@ -1,4 +1,4 @@
|
|||||||
package aqua.parse.lift
|
package aqua.parser.lift
|
||||||
|
|
||||||
import cats.Comonad
|
import cats.Comonad
|
||||||
import cats.parse.{Parser ⇒ P}
|
import cats.parse.{Parser ⇒ P}
|
@ -1,11 +1,11 @@
|
|||||||
package aqua.parse
|
package aqua.parser
|
||||||
|
|
||||||
import aqua.parse.lexer.{Literal, VarLambda}
|
import aqua.parser.lexer.{Literal, VarLambda}
|
||||||
import cats.data.NonEmptyList
|
import cats.data.NonEmptyList
|
||||||
import org.scalatest.EitherValues
|
import org.scalatest.EitherValues
|
||||||
import org.scalatest.flatspec.AnyFlatSpec
|
import org.scalatest.flatspec.AnyFlatSpec
|
||||||
import org.scalatest.matchers.should.Matchers
|
import org.scalatest.matchers.should.Matchers
|
||||||
import aqua.parse.lift.LiftParser.Implicits.idLiftParser
|
import aqua.parser.lift.LiftParser.Implicits.idLiftParser
|
||||||
import cats.Id
|
import cats.Id
|
||||||
|
|
||||||
class FuncOpSpec extends AnyFlatSpec with Matchers with EitherValues {
|
class FuncOpSpec extends AnyFlatSpec with Matchers with EitherValues {
|
@ -1,11 +1,11 @@
|
|||||||
package aqua.parse
|
package aqua.parser
|
||||||
|
|
||||||
import aqua.parse.lexer.{Literal, VarLambda}
|
import aqua.parser.lexer.{Literal, VarLambda}
|
||||||
import cats.data.NonEmptyList
|
import cats.data.NonEmptyList
|
||||||
import org.scalatest.EitherValues
|
import org.scalatest.EitherValues
|
||||||
import org.scalatest.flatspec.AnyFlatSpec
|
import org.scalatest.flatspec.AnyFlatSpec
|
||||||
import org.scalatest.matchers.should.Matchers
|
import org.scalatest.matchers.should.Matchers
|
||||||
import aqua.parse.lift.LiftParser.Implicits.idLiftParser
|
import aqua.parser.lift.LiftParser.Implicits.idLiftParser
|
||||||
import cats.Id
|
import cats.Id
|
||||||
|
|
||||||
class FuncSpec extends AnyFlatSpec with Matchers with EitherValues {
|
class FuncSpec extends AnyFlatSpec with Matchers with EitherValues {
|
@ -1,4 +1,4 @@
|
|||||||
package aqua.parse
|
package aqua.parser
|
||||||
|
|
||||||
import org.scalatest.EitherValues
|
import org.scalatest.EitherValues
|
||||||
import org.scalatest.flatspec.AnyFlatSpec
|
import org.scalatest.flatspec.AnyFlatSpec
|
@ -1,6 +1,6 @@
|
|||||||
package aqua.parse.lexer
|
package aqua.parser.lexer
|
||||||
|
|
||||||
import aqua.parse.lexer.Token._
|
import aqua.parser.lexer.Token._
|
||||||
import org.scalatest.EitherValues
|
import org.scalatest.EitherValues
|
||||||
import org.scalatest.flatspec.AnyFlatSpec
|
import org.scalatest.flatspec.AnyFlatSpec
|
||||||
import org.scalatest.matchers.should.Matchers
|
import org.scalatest.matchers.should.Matchers
|
@ -1,6 +1,6 @@
|
|||||||
package aqua.parse.lexer
|
package aqua.parser.lexer
|
||||||
|
|
||||||
import aqua.parse.BasicType
|
import aqua.parser.BasicType
|
||||||
import org.scalatest.EitherValues
|
import org.scalatest.EitherValues
|
||||||
import org.scalatest.flatspec.AnyFlatSpec
|
import org.scalatest.flatspec.AnyFlatSpec
|
||||||
import org.scalatest.matchers.should.Matchers
|
import org.scalatest.matchers.should.Matchers
|
Loading…
x
Reference in New Issue
Block a user