diff --git a/build.sbt b/build.sbt index 95efa63be..56a21b422 100644 --- a/build.sbt +++ b/build.sbt @@ -122,6 +122,7 @@ lazy val prettify = Module("prettify", "riddl-prettify") ) .dependsOn(utils, language, comptest(passes), command, testKitDep) + val Hugo = config("hugo") lazy val hugo = Module("hugo", "riddl-hugo") .configure(With.typical) diff --git a/codify/src/main/resources/META-INF/services/com.ossuminc.riddl.commands.CommandPlugin b/codify/src/main/resources/META-INF/services/com.ossuminc.riddl.commands.CommandPlugin new file mode 100644 index 000000000..a6411e662 --- /dev/null +++ b/codify/src/main/resources/META-INF/services/com.ossuminc.riddl.commands.CommandPlugin @@ -0,0 +1 @@ +com.ossuminc.riddl.stats.CodifyCommand diff --git a/codify/src/main/scala/com/ossuminc/riddl/codify/CodifyCommand.scala b/codify/src/main/scala/com/ossuminc/riddl/codify/CodifyCommand.scala new file mode 100644 index 000000000..32f496101 --- /dev/null +++ b/codify/src/main/scala/com/ossuminc/riddl/codify/CodifyCommand.scala @@ -0,0 +1,96 @@ +/* + * Copyright 2019 Ossum, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.ossuminc.riddl.codify + +import com.ossuminc.riddl.commands.{CommandOptions, PassCommand, PassCommandOptions} +import com.ossuminc.riddl.language.Messages.Messages +import com.ossuminc.riddl.language.CommonOptions +import com.ossuminc.riddl.passes.Pass.standardPasses +import com.ossuminc.riddl.passes.{Pass, PassesCreator} +import com.ossuminc.riddl.utils.Logger +import scopt.OParser +import pureconfig.{ConfigCursor, ConfigReader} + +import java.io.File +import java.nio.file.Path +import java.net.URI + +object CodifyCommand { + val cmdName: String = "codify" + case class Options( + inputFile: Option[Path] = None, + endPoint: Option[URI] = None, + apiKey: Option[String] = None, + orgId: Option[String] = None + ) extends PassCommandOptions + with CommandOptions { + def command: String = cmdName + def outputDir: Option[Path] = None + } +} + +/** Codify Command */ +class CodifyCommand extends PassCommand[CodifyCommand.Options](CodifyCommand.cmdName) { + import CodifyCommand.Options + + // Members declared in com.ossuminc.riddl.commands.CommandPlugin + def getConfigReader: ConfigReader[Options] = { (cur: ConfigCursor) => + for + topCur <- cur.asObjectCursor + topRes <- topCur.atKey(pluginName) + objCur <- topRes.asObjectCursor + inFileRes <- objCur.atKey("input-file").map(_.asString) + inFile <- inFileRes + endPointRes <- objCur.atKey("end-point").map(_.asString) + endPoint <- endPointRes + apiKeyRes <- objCur.atKey("api-key").map(_.asString) + apiKey <- apiKeyRes + orgIdRes <- objCur.atKey("org-id").map(_.asString) + orgId <- orgIdRes + yield { + Options(Some(Path.of(inFile)), Some(URI.create(endPoint)), Some(apiKey), Some(orgId)) + } + } + + def getOptions: (OParser[Unit, Options], CodifyCommand.Options) = { + import builder.* + cmd(CodifyCommand.cmdName) + .children( + arg[File]("input-file") + .action { (file, opt) => + opt.copy(inputFile = Some(file.toPath)) + } + .text("The main input file on which to generate statistics.") + ) + .text("Loads a configuration file and executes the command in it") -> + CodifyCommand.Options() + } + + // Members declared in com.ossuminc.riddl.commands.PassCommand + def overrideOptions(options: Options, newOutputDir: Path): Options = { + options // we don't support overriding the output dir + } + + override def replaceInputFile( + opts: Options, + inputFile: Path + ): Options = { opts.copy(inputFile = Some(inputFile)) } + + override def loadOptionsFrom( + configFile: Path, + commonOptions: CommonOptions + ): Either[Messages, Options] = { + super.loadOptionsFrom(configFile, commonOptions).map { options => + resolveInputFileToConfigFile(options, commonOptions, configFile) + } + } + + override def getPasses(log: Logger, commonOptions: CommonOptions, options: Options): PassesCreator = { + standardPasses :+ CodifyPass.creator + } + +} diff --git a/codify/src/main/scala/com/ossuminc/riddl/codify/CodifyPass.scala b/codify/src/main/scala/com/ossuminc/riddl/codify/CodifyPass.scala new file mode 100644 index 000000000..89b2c3eab --- /dev/null +++ b/codify/src/main/scala/com/ossuminc/riddl/codify/CodifyPass.scala @@ -0,0 +1,84 @@ +/* + * Copyright 2023 Ossum, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package com.ossuminc.riddl.codify + +import com.ossuminc.riddl.language.{AST, Messages} +import com.ossuminc.riddl.language.AST.* +import com.ossuminc.riddl.language.Messages.{Messages, error} +import com.ossuminc.riddl.passes.{ + PassCreator, + PassInfo, + PassInput, + PassesOutput, + TranslatingPass, + TranslatingPassOutput +} +import com.ossuminc.riddl.passes.resolve.ResolutionPass +import com.ossuminc.riddl.passes.symbols.SymbolsPass +import com.ossuminc.riddl.passes.symbols.Symbols.ParentStack +import com.ossuminc.riddl.passes.validate.ValidationPass + +import scala.collection.mutable + +object CodifyPass extends PassInfo { + val name: String = "codify" + val creator: PassCreator = { (in: PassInput, out: PassesOutput) => CodifyPass(in, out) } +} + +/** The output from running the CodifyPass */ +case class CodifyOutput( + messages: Messages = Messages.empty, + newASTRoot: Root +) extends TranslatingPassOutput(messages, newASTRoot) + +/** A pass that translates RIDDL definitions into RIDDL code statements */ +case class CodifyPass(input: PassInput, outputs: PassesOutput) extends TranslatingPass(input, outputs) { + + def name: String = CodifyPass.name + + requires(SymbolsPass) + requires(ResolutionPass) + requires(ValidationPass) + + val handlers: mutable.HashMap[Processor[?, ?], Handler] = mutable.HashMap.empty[Processor[?, ?], Handler] + + protected def process( + definition: RiddlValue, + parents: ParentStack + ): Unit = { + definition match { + case s: State => + val proc = parents.find(_.isProcessor).get.asInstanceOf[Processor[?, ?]] + handlers.addAll(s.handlers.map(proc -> _)) + case h: Handler => + val proc = parents.find(_.isProcessor).get.asInstanceOf[Processor[?, ?]] + handlers.addOne(proc -> h) + case _ => () + } + } + + private var newRootAST: Root = ??? + + def getStatements(h: Handler, p: Processor[?,?]): Seq[Statement] = { + + } + def postProcess(root: Root): Unit = { + // TODO: Postprocess root to transform it into newRootAST + newRootAST = root + } + + /** Generate the output of this Pass. This will only be called after all the calls to process have completed. + * + * @return + * an instance of the output type + */ + override def result: CodifyOutput = { + CodifyOutput( + Messages.empty, + newRootAST + ) + } +} diff --git a/codify/src/test/input/VendingMachine.riddl b/codify/src/test/input/VendingMachine.riddl new file mode 100644 index 000000000..3a6af11a6 --- /dev/null +++ b/codify/src/test/input/VendingMachine.riddl @@ -0,0 +1,55 @@ +domain VendingMachine { + context Transactions { + entity Machine { + record Money(amount: Real) + record Item(which: Integer) + command InsertCoin(amount: Money) + command SelectItem(item: Item) + command DispenseItem(item: Item) + command DIspenseChange(change: Money) + + record IdleState is { ??? } + record AwaitingSelectionState is { ??? } + record DispensingItemState is { ??? } + record DispensingChangeState is { ??? } + + state Idle of IdleState { + handler CustomerInteraction { + on command InsertCoin { + "Validate coin" + "Update machine balance" + morph entity Machine to state AwaitingSelection with record AwaitingSelectionState + } + } + } + + state AwaitingSelection of AwaitingSelectionState { + handler CustomerInteraction { + on command SelectItem { + "Check if item is available" + "Check if inserted money is sufficient" + morph entity Machine to state DispensingItem with record DispensingItemState + } + } + } + + state DispensingItem of DispensingItemState { + handler CustomerInteraction { + on command DispenseItem { + // Activate mechanism to dispense the selected item + morph entity Machine to state DispensingChange with record DispensingChangeState + } + } + } + + state DispensingChange of DispensingChangeState { + handler CustomerInteraction { + on command DispenseChange { + // Calculate and return change + morph entity Machine to state Idle with record IdleState + } + } + } + } + } +} diff --git a/codify/src/test/scala/com/ossuminc/riddl/codify/CodifyPassTest.scala b/codify/src/test/scala/com/ossuminc/riddl/codify/CodifyPassTest.scala new file mode 100644 index 000000000..25878a45c --- /dev/null +++ b/codify/src/test/scala/com/ossuminc/riddl/codify/CodifyPassTest.scala @@ -0,0 +1,40 @@ +package com.ossuminc.riddl.codify + +import com.ossuminc.riddl.language.CommonOptions +import com.ossuminc.riddl.language.parsing.RiddlParserInput +import com.ossuminc.riddl.language.Messages.* +import com.ossuminc.riddl.testkit.ValidatingTest + +import java.nio.file.Path + +class CodifyPassTest extends ValidatingTest { + + def input(path: String): RiddlParserInput = { + RiddlParserInput(Path.of("codify/src/test/input/", path)) + } + + "CodifyPass" must { + + val commonOptions = CommonOptions() + + "run" in { + val rpi = input("VendingMachine.riddl") + parseTopLevelDomains(rpi) match { + case Left(messages) => + val errors = messages.justErrors + if errors.nonEmpty then fail(errors.format) + info(messages.justWarnings.format) + succeed + case Right(root) => + runStandardPasses(root, commonOptions) match + case Left(messages) => + val errors = messages.justErrors + if errors.nonEmpty then fail(errors.format) + info(messages.justWarnings.format) + succeed + case Right(passesResult) => + } + } + } + +} diff --git a/language/src/main/scala/com/ossuminc/riddl/language/AST.scala b/language/src/main/scala/com/ossuminc/riddl/language/AST.scala index 5a4deff1f..5f64be1c8 100644 --- a/language/src/main/scala/com/ossuminc/riddl/language/AST.scala +++ b/language/src/main/scala/com/ossuminc/riddl/language/AST.scala @@ -785,7 +785,7 @@ object AST { def format: String = s"user ${id.format} is ${is_a.format}" } - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// USER + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// TERM /** A term definition for the glossary */ case class Term( diff --git a/passes/src/main/scala/com/ossuminc/riddl/passes/CollectingPass.scala b/passes/src/main/scala/com/ossuminc/riddl/passes/CollectingPass.scala new file mode 100644 index 000000000..ba5a4307b --- /dev/null +++ b/passes/src/main/scala/com/ossuminc/riddl/passes/CollectingPass.scala @@ -0,0 +1,66 @@ +package com.ossuminc.riddl.passes + +import com.ossuminc.riddl.language.AST.RiddlValue +import com.ossuminc.riddl.language.Messages +import com.ossuminc.riddl.language.Messages.Messages +import com.ossuminc.riddl.passes.symbols.Symbols.ParentStack + +import scala.collection.mutable + +/** An abstract PassOutput for use with passes that derive from CollectingPass. This just provides a standard field name + * for the data that is collected, being `collected`. + * + * @param messages + * The required messages field from the PassOutput trait + * @param collected + * The data that was collected from the CollectingPass's run + * @tparam T + * The element type of the collected data + */ +abstract class CollectingPassOutput[T]( + messages: Messages = Messages.empty, + collected: Seq[T] = Seq.empty[T] +) extends PassOutput + +/** A Pass subclass that processes the AST exactly the same as the depth first search that the Pass class uses. The only + * difference is that + * + * @param input + * The PassInput to process + * @param outputs + * The outputs from previous pass runs in case they are needed as input to this CollectingPass + * @tparam F + * The element type of the collected values + */ +abstract class CollectingPass[F](input: PassInput, outputs: PassesOutput) extends Pass(input, outputs) { + + /** The method usually called for each definition that is to be processed but our implementation of traverse instead + * calls collect so a value can be returned. This implementation is final because it is meant to be ignored. + * + * @param definition + * The definition to be processed + * @param parents + * The stack of definitions that are the parents of [[com.ossuminc.riddl.language.AST.Definition]]. This stack goes + * from immediate parent towards the root. The root is deepest in the stack. + */ + override final def process(definition: RiddlValue, parents: ParentStack): Unit = { + val collected: Seq[F] = collect(definition, parents) + collectedValues ++= collected + } + + protected val collectedValues: mutable.ArrayBuffer[F] = mutable.ArrayBuffer.empty[F] + + /** The processing method called at each node, similar to [[com.ossuminc.riddl.passes.Pass.process]] but modified to + * return an sequence of the collectable, [[F]]. + * + * @param definition + * The definition from which an [[F]] value is collected. + * @param parents + * The parents of the definition + * @return + * One of the collected values, an [[F]] + */ + protected def collect(definition: RiddlValue, parents: ParentStack): Seq[F] + + override def result: CollectingPassOutput[F] +} \ No newline at end of file diff --git a/passes/src/main/scala/com/ossuminc/riddl/passes/HierarchyPass.scala b/passes/src/main/scala/com/ossuminc/riddl/passes/HierarchyPass.scala new file mode 100644 index 000000000..f7a9b4c37 --- /dev/null +++ b/passes/src/main/scala/com/ossuminc/riddl/passes/HierarchyPass.scala @@ -0,0 +1,91 @@ +package com.ossuminc.riddl.passes + +import com.ossuminc.riddl.language.AST.{Definition, Include, LeafDefinition, RiddlValue} +import com.ossuminc.riddl.passes.symbols.Symbols.{ParentStack, Parents} + +/** A Pass base class that allows the processing to be done based on containers, and calling these methods: + * - openContainer at the start of container's processing + * - processLeaf for any leaf nodes within the container + * - closeContainer after all the container's contents have been processed + * + * This kind of Pass allows the processing to follow the AST hierarchy so that container nodes can run before all their + * content (openContainer) and also after all its content (closeContainer). This is necessary for passes that must + * maintain the hierarchical structure of the AST model in their processing. + * + * @param input + * The PassInput to process + */ +abstract class HierarchyPass(input: PassInput, outputs: PassesOutput) extends Pass(input, outputs) { + + /** not required in this kind of pass, final override it as a result + * + * @param definition + * The definition to be processed + * @param parents + * The stack of definitions that are the parents of [[com.ossuminc.riddl.language.AST.Definition]]. This stack goes + * from immediate parent towards the root. The root is deepest in the stack. + */ + override final def process(definition: RiddlValue, parents: ParentStack): Unit = () + + /** Called by traverse when a new container is started Subclasses must implement this method. + * @param definition + * The definition that was opened + * @param parents + * The parents of the definition opened + */ + protected def openContainer(definition: Definition, parents: Parents): Unit + + /** Called by traverse when a leaf node is encountered Subclasses must implement this method + * @param definition + * The leaf definition that was found + * @param parents + * THe parents of the leaf node + */ + protected def processLeaf(definition: LeafDefinition, parents: Parents): Unit + + /** Process a non-definition, non-include, value + * + * @param value + * The value to be processed + * @param parents + * The parent definitions of value + */ + protected def processValue(value: RiddlValue, parents: Parents): Unit = () + + /** Called by traverse after all leaf nodes of an opened node have been processed and the opened node is now being + * closed. Subclasses must implement this method. + * @param definition + * The opened node that now needs to be closed + * @param parents + * THe parents of the node to be closed; should be the same as when it was opened + */ + protected def closeContainer(definition: Definition, parents: Parents): Unit + + /** Redefine traverse to make the three calls + * + * @param definition + * The RiddlValue being considered + * @param parents + * The definition parents of the value + */ + override protected def traverse(definition: RiddlValue, parents: ParentStack): Unit = { + definition match { + case leaf: LeafDefinition => + processLeaf(leaf, parents.toSeq) + case container: Definition => + openContainer(container, parents.toSeq) + parents.push(container) + container.contents.foreach { + case leaf: LeafDefinition => processLeaf(leaf, parents.toSeq) + case definition: Definition => traverse(definition, parents) + case include: Include[?] => traverse(include, parents) + case value: RiddlValue => processValue(value, parents.toSeq) + } + parents.pop() + closeContainer(container, parents.toSeq) + case include: Include[?] => + include.contents.foreach { item => traverse(item, parents) } + case value: RiddlValue => processValue(value, parents.toSeq) + } + } +} diff --git a/passes/src/main/scala/com/ossuminc/riddl/passes/Pass.scala b/passes/src/main/scala/com/ossuminc/riddl/passes/Pass.scala index 7a2fcb810..468e0ebbd 100644 --- a/passes/src/main/scala/com/ossuminc/riddl/passes/Pass.scala +++ b/passes/src/main/scala/com/ossuminc/riddl/passes/Pass.scala @@ -232,150 +232,8 @@ abstract class Pass(@unused val in: PassInput, val out: PassesOutput) { protected val messages: Messages.Accumulator = Messages.Accumulator(in.commonOptions) } -/** A Pass base class that allows the processing to be done based on containers, and calling these methods: - * - openContainer at the start of container's processing - * - processLeaf for any leaf nodes within the container - * - closeContainer after all the container's contents have been processed - * - * This kind of Pass allows the processing to follow the AST hierarchy so that container nodes can run before all their - * content (openContainer) and also after all its content (closeContainer). This is necessary for passes that must - * maintain the hierarchical structure of the AST model in their processing. - * - * @param input - * The PassInput to process - */ -abstract class HierarchyPass(input: PassInput, outputs: PassesOutput) extends Pass(input, outputs) { - - /** not required in this kind of pass, final override it as a result - * - * @param definition - * The definition to be processed - * @param parents - * The stack of definitions that are the parents of [[com.ossuminc.riddl.language.AST.Definition]]. This stack goes - * from immediate parent towards the root. The root is deepest in the stack. - */ - override final def process(definition: RiddlValue, parents: ParentStack): Unit = () - - /** Called by traverse when a new container is started Subclasses must implement this method. - * @param definition - * The definition that was opened - * @param parents - * The parents of the definition opened - */ - protected def openContainer(definition: Definition, parents: Parents): Unit - - /** Called by traverse when a leaf node is encountered Subclasses must implement this method - * @param definition - * The leaf definition that was found - * @param parents - * THe parents of the leaf node - */ - protected def processLeaf(definition: LeafDefinition, parents: Parents): Unit - /** Process a non-definition, non-include, value - * - * @param value - * The value to be processed - * @param parents - * The parent definitions of value - */ - protected def processValue(value: RiddlValue, parents: Parents): Unit = () - /** Called by traverse after all leaf nodes of an opened node have been processed and the opened node is now being - * closed. Subclasses must implement this method. - * @param definition - * The opened node that now needs to be closed - * @param parents - * THe parents of the node to be closed; should be the same as when it was opened - */ - protected def closeContainer(definition: Definition, parents: Parents): Unit - - /** Redefine traverse to make the three calls - * - * @param definition - * The RiddlValue being considered - * @param parents - * The definition parents of the value - */ - override protected def traverse(definition: RiddlValue, parents: ParentStack): Unit = { - definition match { - case leaf: LeafDefinition => - processLeaf(leaf, parents.toSeq) - case container: Definition => - openContainer(container, parents.toSeq) - parents.push(container) - container.contents.foreach { - case leaf: LeafDefinition => processLeaf(leaf, parents.toSeq) - case definition: Definition => traverse(definition, parents) - case include: Include[?] => traverse(include, parents) - case value: RiddlValue => processValue(value, parents.toSeq) - } - parents.pop() - closeContainer(container, parents.toSeq) - case include: Include[?] => - include.contents.foreach { item => traverse(item, parents) } - case value: RiddlValue => processValue(value, parents.toSeq) - } - } -} - -/** An abstract PassOutput for use with passes that derive from CollectingPass. This just provides a standard field name - * for the data that is collected, being `collected`. - * - * @param messages - * The required messages field from the PassOutput trait - * @param collected - * The data that was collected from the CollectingPass's run - * @tparam T - * The element type of the collected data - */ -abstract class CollectingPassOutput[T]( - messages: Messages = Messages.empty, - collected: Seq[T] = Seq.empty[T] -) extends PassOutput - -/** A Pass subclass that processes the AST exactly the same as the depth first search that the Pass class uses. The only - * difference is that - * - * @param input - * The PassInput to process - * @param outputs - * The outputs from previous pass runs in case they are needed as input to this CollectingPass - * @tparam F - * The element type of the collected values - */ -abstract class CollectingPass[F](input: PassInput, outputs: PassesOutput) extends Pass(input, outputs) { - - /** The method usually called for each definition that is to be processed but our implementation of traverse instead - * calls collect so a value can be returned. This implementation is final because it is meant to be ignored. - * - * @param definition - * The definition to be processed - * @param parents - * The stack of definitions that are the parents of [[com.ossuminc.riddl.language.AST.Definition]]. This stack goes - * from immediate parent towards the root. The root is deepest in the stack. - */ - override final def process(definition: RiddlValue, parents: ParentStack): Unit = { - val collected: Seq[F] = collect(definition, parents) - collectedValues ++= collected - } - - protected val collectedValues: mutable.ArrayBuffer[F] = mutable.ArrayBuffer.empty[F] - - /** The processing method called at each node, similar to [[com.ossuminc.riddl.passes.Pass.process]] but modified to - * return an sequence of the collectable, [[F]]. - * - * @param definition - * The definition from which an [[F]] value is collected. - * @param parents - * The parents of the definition - * @return - * One of the collected values, an [[F]] - */ - protected def collect(definition: RiddlValue, parents: ParentStack): Seq[F] - - override def result: CollectingPassOutput[F] -} object Pass { diff --git a/passes/src/main/scala/com/ossuminc/riddl/passes/TranslatingPass.scala b/passes/src/main/scala/com/ossuminc/riddl/passes/TranslatingPass.scala new file mode 100644 index 000000000..4a653d7fd --- /dev/null +++ b/passes/src/main/scala/com/ossuminc/riddl/passes/TranslatingPass.scala @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Ossum, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.ossuminc.riddl.passes + +import com.ossuminc.riddl.language.AST.Root +import com.ossuminc.riddl.language.{CommonOptions, Messages} +import com.ossuminc.riddl.language.Messages.Messages +import com.ossuminc.riddl.language.parsing.RiddlParserInput +import com.ossuminc.riddl.passes.{Pass, PassCreator, PassInput, PassesCreator, PassesOutput, PassesResult, Riddl} +import com.ossuminc.riddl.utils.Logger + +import java.nio.file.Path + +/** An abstract PassOutput for use with passes that derive from TranslatingPass. This just provides a standard + * field name for the data that is collected. + * + * @param messages + * The required messages field from the PassOutput trait + * @param newASTRoot + * The new AST Root after the AST was translated + * @tparam T + * The element type of the collected data + */ +abstract class TranslatingPassOutput( + messages: Messages = Messages.empty, + newASTRoot: Root +) extends PassOutput + +/** Base class of all Translators + */ +abstract class TranslatingPass(input: PassInput, outputs: PassesOutput) extends Pass(input, outputs) { + + def passes: PassesCreator = Seq.empty[PassCreator] + + final def parseValidateTranslate( + input: RiddlParserInput, + log: Logger, + commonOptions: CommonOptions + ): Either[Messages, PassesResult] = { + val allPasses = Pass.standardPasses ++ passes + Riddl.parseAndValidate(input, commonOptions, shouldFailOnError = true, allPasses, log) + } +} diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 2c990560c..a40d3fe62 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -10,6 +10,7 @@ object V { val fastparse = "3.0.2" val jgit = "6.5.0" val lang3 = "3.14.0" + val openAISC = "1.0.0.RC.1" val pureconfig = "0.17.6" val scalacheck = "1.17.0" val scalatest = "3.2.18" @@ -23,6 +24,7 @@ object Dep { val fastparse = "com.lihaoyi" %% "fastparse" % V.fastparse val jgit = "org.eclipse.jgit" % "org.eclipse.jgit" % V.jgit val lang3 = "org.apache.commons" % "commons-lang3" % V.lang3 + val openAISC = "io.cequence" %% "openai-scala-client" % V.openAISC val pureconfig = "com.github.pureconfig" %% "pureconfig-core" % V.pureconfig val scalactic = "org.scalactic" %% "scalactic" % V.scalatest val scalatest = "org.scalatest" %% "scalatest" % V.scalatest diff --git a/testkit/src/test/input/dokn.riddl b/testkit/src/test/input/dokn.riddl index bb3110f44..922aaad7d 100644 --- a/testkit/src/test/input/dokn.riddl +++ b/testkit/src/test/input/dokn.riddl @@ -1,5 +1,5 @@ domain dokn is { - type Address = { + type Address is { line1: String, line2: String, line3: String, @@ -15,9 +15,9 @@ domain dokn is { "^[a-zA-Z0-9_+&*-] + (?:\\.[a-zA-Z0-9_+&*-] + )*@(?:[a-zA-Z0-9-]+\\.) + [a-zA-Z]{2,7}" ) type LoadingMethod = any of { dock, tailgate, forklift, none } - type CompanyId = Id(dokn.Company.Company) - type DriverId = MobileNumber - type NoteId = Id(dokn.Note.Note) + type CompanyId is Id(dokn.Company.Company) + type DriverId is MobileNumber + type NoteId is Id(dokn.Note.Note) type MediaId is Id(dokn.Media.Media) type LocationId is Id(dokn.Location.Location) type NoteList is reference to dokn.Note.Note*