From 066c828f4711288a12af4d0ed707a945ac232caf Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Fri, 12 Jan 2024 23:27:48 -0600 Subject: [PATCH] initial commit --- .gitignore | 3 +++ Program.fs | 2 ++ Syntax.fs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ vijin.fsproj | 10 ++++++++++ 4 files changed, 62 insertions(+) create mode 100644 .gitignore create mode 100644 Program.fs create mode 100644 Syntax.fs create mode 100644 vijin.fsproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc3ff32 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/ +obj/ +.ionide/ diff --git a/Program.fs b/Program.fs new file mode 100644 index 0000000..d6818ab --- /dev/null +++ b/Program.fs @@ -0,0 +1,2 @@ +// For more information see https://aka.ms/fsharp-console-apps +printfn "Hello from F#" diff --git a/Syntax.fs b/Syntax.fs new file mode 100644 index 0000000..183f0a9 --- /dev/null +++ b/Syntax.fs @@ -0,0 +1,47 @@ +module VijiN.Syntax + +type Variable = Variable of string + +type Term = Text of string | Variable of Variable + +type Character = Character of Term +// TODO: Character should probably have more, like selecting portrait outfit/style + +type DirectivePrefix = Prefix of string +type DirectiveInfix = Infix of string +type DirectiveSuffix = Suffix of string +type DirectiveOperator = DirectivePrefix * DirectiveInfix option * DirectiveSuffix option + +type DirectiveArg = Arg of Term +type Directive = DirectiveOperator * DirectiveArg list list // TODO: non-empty list +type Directives = Directive list // TODO: non-empty list + +type ChoiceText = Text of Term +type ChoiceValue = Value of Term +type ChoiceOption = ChoiceText * ChoiceValue option +type Choice = Variable * ChoiceOption list // TODO: non-empty list + +type InlineDirective = Directive +type SpokenText = + | Plain of Term + | Emphasis of Term + | Yell of Term + | Whisper of Term +type Spoken = Character option * InlineDirective list * SpokenText list // TODO: non-empty list + +type Comment = Comment of string + +type Line = + | Spoken of Spoken + | Directive of Directives + | Comment of Comment + | Choice of Choice + +type LineNumber = Line of int // TODO: >= 1 +type PageNumber = Page of int // TODO: >= 1 +type ScriptLine = LineNumber * PageNumber * Line +// TODO: other diffing metadata + +type SceneName = Name of string + +type Scene = SceneName * Character list * ScriptLine list diff --git a/vijin.fsproj b/vijin.fsproj new file mode 100644 index 0000000..4fc971b --- /dev/null +++ b/vijin.fsproj @@ -0,0 +1,10 @@ + + + Exe + net7.0 + + + + + + \ No newline at end of file