don't overlap type and variant names

This commit is contained in:
Branden J Brown 2024-01-14 20:50:19 -06:00
parent 2e67fe38ce
commit ac15bde327
1 changed files with 18 additions and 19 deletions

View File

@ -2,46 +2,45 @@ module VijiN.Syntax
type Variable = Variable of string type Variable = Variable of string
type Term = Text of string | Variable of Variable type Term = TextTerm of string | VarTerm of Variable
type Character = Character of Term type Character = Character of Term
// TODO: Character should probably have more, like selecting portrait outfit/style // TODO: Character should probably have more, like selecting portrait outfit/style
type DirectivePrefix = Prefix of string type DirectivePrefix = string
type DirectiveInfix = Infix of string type DirectiveInfix = string
type DirectiveSuffix = Suffix of string type DirectiveOperator = DirectivePrefix * DirectiveInfix
type DirectiveOperator = DirectivePrefix * DirectiveInfix option * DirectiveSuffix option
type DirectiveArg = Arg of Term type DirectiveArg = Arg of Term list
type Directive = DirectiveOperator * DirectiveArg list list // TODO: non-empty list type Directive = DirectiveOperator * DirectiveArg list list // TODO: non-empty list
type Directives = Directive list // TODO: non-empty list type Directives = Directive list // TODO: non-empty list
type ChoiceText = Text of Term type ChoiceText = ChoiceText of Term list
type ChoiceValue = Value of Term type ChoiceValue = ChoiceValue of Term list
type ChoiceOption = ChoiceText * ChoiceValue option type ChoiceOption = ChoiceText * ChoiceValue option
type Choice = Variable * ChoiceOption list // TODO: non-empty list type Choice = Variable * ChoiceOption list // TODO: non-empty list
type InlineDirective = Directive type InlineDirective = Directive
type SpokenText = type SpokenText =
| Plain of Term | Plain of Term list
| Emphasis of Term | Emphasis of Term list
| Yell of Term | Yell of Term list
| Whisper of Term | Whisper of Term list
type Spoken = Character option * InlineDirective list * SpokenText list // TODO: non-empty list type Spoken = Character option * InlineDirective list * SpokenText list // TODO: non-empty list
type Comment = Comment of string type Comment = Comment of string
type Line = type Line =
| Spoken of Spoken | SpokenLine of Spoken
| Directive of Directives | DirectiveLine of Directives
| Comment of Comment | CommentLine of Comment
| Choice of Choice | ChoiceLine of Choice
type LineNumber = Line of int // TODO: >= 1 type LineNumber = LineNo of int // TODO: >= 1
type PageNumber = Page of int // TODO: >= 1 type PageNumber = PageNo of int // TODO: >= 1
type ScriptLine = LineNumber * PageNumber * Line type ScriptLine = LineNumber * PageNumber * Line
// TODO: other diffing metadata // TODO: other diffing metadata
type SceneName = Name of string type SceneName = SceneName of string
type Scene = SceneName * Character list * ScriptLine list type Scene = SceneName * Character list * ScriptLine list