mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 22:50:18 +00:00
101 last line comment (#179)
This commit is contained in:
parent
985309d4eb
commit
3236f91db2
@ -22,7 +22,7 @@ or simply download the latest JAR file from the [releases](https://github.com/fl
|
||||
It requires `java` to run Aqua compiler from the command line:
|
||||
|
||||
```commandline
|
||||
java -jar aqua-hll.jar path/to/input/dir path/to/output/dir
|
||||
java -jar aqua-cli-%version_number%.jar -i path/to/input/dir -o path/to/output/dir
|
||||
```
|
||||
|
||||
Input directory should contain files with `aqua` scripts.
|
||||
|
@ -1,5 +1,20 @@
|
||||
import "print.aqua"
|
||||
service OpH("op"):
|
||||
puk(s: string) -> string
|
||||
pek(s: string, -- trgtr
|
||||
c: string) -> string
|
||||
|
||||
func iterateAndPrint(strings: []string):
|
||||
for s <- strings:
|
||||
print(s)
|
||||
func a( -- ferkjn
|
||||
b: string, -- fr
|
||||
c: string, -- asdf
|
||||
g: string
|
||||
) -> string: -- rgtr
|
||||
|
||||
try:
|
||||
f = "world"
|
||||
OpH "planet"
|
||||
OpH.pek("TRY THIS", -- gtrg
|
||||
c)
|
||||
catch err:
|
||||
OpH.puk(err.msg)
|
||||
<- f
|
||||
-- hello
|
@ -100,7 +100,7 @@ object AppOps {
|
||||
.options[String]("const", "Constant that will be used in an aqua code", "c")
|
||||
.mapValidated { strs =>
|
||||
val parsed = strs.map(s => ConstantExpr.onlyLiteral.parseAll(s))
|
||||
println(parsed)
|
||||
|
||||
val errors = parsed.collect { case Left(er) =>
|
||||
er
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package aqua
|
||||
|
||||
import aqua.backend.air.FuncAirGen
|
||||
import aqua.backend.ts.TypescriptFile
|
||||
import aqua.backend.js.JavaScriptFile
|
||||
import aqua.backend.ts.TypescriptFile
|
||||
import aqua.io.{AquaFileError, AquaFiles, FileModuleId, Unresolvable}
|
||||
import aqua.linker.Linker
|
||||
import aqua.model.{AquaContext, VarModel}
|
||||
import aqua.model.AquaContext
|
||||
import aqua.model.transform.BodyConfig
|
||||
import aqua.parser.lift.FileSpan
|
||||
import aqua.semantics.{RulesViolated, SemanticError, Semantics}
|
||||
@ -129,7 +129,7 @@ object AquaCompiler extends LogSupport {
|
||||
prepareFiles(srcPath, imports, targetPath)
|
||||
.map(_.map(_.filter { p =>
|
||||
val hasOutput = p.hasOutput(compileTo)
|
||||
if (!hasOutput) info(s"Source ${p.srcPath}: compilation OK (nothing to emit)")
|
||||
if (!hasOutput) info(s"Source ${p.modFile}: compilation OK (nothing to emit)")
|
||||
hasOutput
|
||||
}))
|
||||
.flatMap[ValidatedNec[String, Chain[String]]] {
|
||||
|
@ -60,6 +60,9 @@ object AquaFile {
|
||||
Files[F]
|
||||
.readAll(file, 4096)
|
||||
.fold(Vector.empty[Byte])((acc, b) => acc :+ b)
|
||||
// TODO fix for comment on last line in air
|
||||
// TODO should be fixed by parser
|
||||
.map(_.appendedAll("\n\r".getBytes))
|
||||
.flatMap(fs2.Stream.emits)
|
||||
.through(text.utf8Decode)
|
||||
.attempt
|
||||
|
@ -55,6 +55,7 @@ object Token {
|
||||
|
||||
val ` \n` : P[Unit] =
|
||||
(` `.?.void *> (`--` *> P.charsWhile(_ != '\n')).?.void).with1 *> `\n`
|
||||
|
||||
val ` \n+` : P[Unit] = P.repAs[Unit, Unit](` \n`.backtrack, 1)(Accumulator0.unitAccumulator0)
|
||||
val ` : \n+` : P[Unit] = ` `.?.with1 *> `:` *> ` \n+`
|
||||
val `,` : P[Unit] = P.char(',') <* ` `.?
|
||||
|
Loading…
Reference in New Issue
Block a user