2024-01-12 23:27:48 -06:00
|
|
|
module VijiN.Syntax
|
|
|
|
|
|
|
|
type Variable = Variable of string
|
|
|
|
|
2024-01-14 20:50:19 -06:00
|
|
|
type Term = TextTerm of string | VarTerm of Variable
|
2024-01-12 23:27:48 -06:00
|
|
|
|
|
|
|
type Character = Character of Term
|
|
|
|
// TODO: Character should probably have more, like selecting portrait outfit/style
|
|
|
|
|
2024-01-14 20:50:19 -06:00
|
|
|
type DirectivePrefix = string
|
|
|
|
type DirectiveInfix = string
|
|
|
|
type DirectiveOperator = DirectivePrefix * DirectiveInfix
|
2024-01-12 23:27:48 -06:00
|
|
|
|
2024-01-14 20:50:19 -06:00
|
|
|
type DirectiveArg = Arg of Term list
|
2024-01-12 23:27:48 -06:00
|
|
|
type Directive = DirectiveOperator * DirectiveArg list list // TODO: non-empty list
|
|
|
|
type Directives = Directive list // TODO: non-empty list
|
|
|
|
|
2024-01-14 20:50:19 -06:00
|
|
|
type ChoiceText = ChoiceText of Term list
|
|
|
|
type ChoiceValue = ChoiceValue of Term list
|
2024-01-12 23:27:48 -06:00
|
|
|
type ChoiceOption = ChoiceText * ChoiceValue option
|
|
|
|
type Choice = Variable * ChoiceOption list // TODO: non-empty list
|
|
|
|
|
|
|
|
type InlineDirective = Directive
|
|
|
|
type SpokenText =
|
2024-01-14 20:50:19 -06:00
|
|
|
| Plain of Term list
|
|
|
|
| Emphasis of Term list
|
|
|
|
| Yell of Term list
|
|
|
|
| Whisper of Term list
|
2024-01-12 23:27:48 -06:00
|
|
|
type Spoken = Character option * InlineDirective list * SpokenText list // TODO: non-empty list
|
|
|
|
|
|
|
|
type Comment = Comment of string
|
|
|
|
|
|
|
|
type Line =
|
2024-01-14 20:50:19 -06:00
|
|
|
| SpokenLine of Spoken
|
|
|
|
| DirectiveLine of Directives
|
|
|
|
| CommentLine of Comment
|
|
|
|
| ChoiceLine of Choice
|
2024-01-12 23:27:48 -06:00
|
|
|
|
2024-01-14 20:50:19 -06:00
|
|
|
type LineNumber = LineNo of int // TODO: >= 1
|
|
|
|
type PageNumber = PageNo of int // TODO: >= 1
|
2024-01-12 23:27:48 -06:00
|
|
|
type ScriptLine = LineNumber * PageNumber * Line
|
|
|
|
// TODO: other diffing metadata
|
|
|
|
|
2024-01-14 20:50:19 -06:00
|
|
|
type SceneName = SceneName of string
|
2024-01-12 23:27:48 -06:00
|
|
|
|
|
|
|
type Scene = SceneName * Character list * ScriptLine list
|