ast

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

README

Wrap AST

This repository defines the datastructures used internally by both the parser and the export modules to represent the screen- or stageplay.

For more information see the wiki or if there is a bug you would like to report or an idea to suggest you can do that here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LinesToString

func LinesToString(lines []Line) string

LinesToString gets a string representation of a list of strings

Types

type Action

type Action []Line

Action type.

func (Action) Equals

func (action Action) Equals(other Element) bool

Equals checks if an Element is the same Action

type BeginAct

type BeginAct []Line

BeginAct type

func (BeginAct) Equals

func (beginact BeginAct) Equals(other Element) bool

Equals checks if an Element is the same BeginAct

type Cell

type Cell struct {
	Content   string
	Boldface  bool
	Italics   bool
	Underline bool
	Comment   bool
}

Cell contains richtext

func (Cell) Empty

func (cell Cell) Empty() bool

Empty checks if the cell has no contents

func (Cell) Equals

func (cell Cell) Equals(other Cell) bool

Equals checks if both cells are identical

func (Cell) Lenght

func (cell Cell) Lenght() int

Lenght of a Cell is the amount of runes in it 0 if the cell is a comment

type CenteredText

type CenteredText []Line

CenteredText type.

func (CenteredText) Equals

func (centeredtext CenteredText) Equals(other Element) bool

Equals checks if an Element is the same CenteredText

type Dialogue

type Dialogue struct {
	Character []Line
	Lines     []Element
}

Dialogue type.

func (Dialogue) Equals

func (dialogue Dialogue) Equals(other Element) bool

Equals checks if an Element is the same Dialogue

type DualDialogue

type DualDialogue struct {
	LCharacter []Line
	LLines     []Element

	RCharacter []Line
	RLines     []Element
}

DualDialogue type.

func (DualDialogue) Equals

func (dualdialogue DualDialogue) Equals(other Element) bool

Equals checks if an Element is the same DualDialogue

type Element

type Element interface {
	Equals(Element) bool
}

Element represents a part of the script.

type ElementType

type ElementType byte

ElementType is another representation of an elements type

const (
	TScene ElementType = iota
	TBeginAct
	TEndAct
	TAction
	TDialogue
	TDualDialogue
	TLyrics
	TTransition
	TCenteredText
	TPageBreak
	TSection
	TSynopsis
	TNote
	TNone
)

Defines the different ElementTypes

func GetElementType

func GetElementType(elem Element) ElementType

GetElementType returns the type of element as a lowercase string and "TNone" if unknown.

type EndAct

type EndAct []Line

EndAct type

func (EndAct) Equals

func (endact EndAct) Equals(other Element) bool

Equals checks if an Element is the same EndAct

type Line

type Line []Cell

Line a line of richtext cells

func (Line) Empty

func (line Line) Empty() bool

Empty checks if the line is empty

func (Line) Equals

func (line Line) Equals(other Line) bool

Equals checks if both cells are identical

func (Line) Lenght

func (line Line) Lenght() int

Lenght is the amount of runes in the line

func (Line) String

func (line Line) String() string

String returns a plaintext version of the line

func (Line) StringBuffer

func (line Line) StringBuffer() *bytes.Buffer

StringBuffer returns a buffer containing the contents of the line

type Lyrics

type Lyrics []Line

Lyrics type.

func (Lyrics) Equals

func (lyrics Lyrics) Equals(other Element) bool

Equals checks if an Element is the same Lyrics

type Note

type Note []Line

Note represents a note which isn't part of another element.

func (Note) Equals

func (note Note) Equals(other Element) bool

Equals checks if an Element is the same Note

type PageBreak

type PageBreak struct{}

PageBreak type.

func (PageBreak) Equals

func (pagebreak PageBreak) Equals(other Element) bool

Equals checks if an Element is also a PageBreak

type Parenthetical

type Parenthetical []Line

Parenthetical type

func (Parenthetical) Equals

func (parenthetical Parenthetical) Equals(other Element) bool

Equals checks if an Element is the same Parenthetical

type Scene

type Scene struct {
	Slugline    []Line
	SceneNumber string
}

Scene header type.

func (Scene) Equals

func (scene Scene) Equals(other Element) bool

Equals checks if an Element is the same Scene

type Script

type Script struct {
	Language  languages.Language
	TitlePage map[string][]Line
	Elements  []Element
}

Script contains the entire script.

func (*Script) Equals

func (script *Script) Equals(other *Script) bool

Equals checks if two Scripts are identical

type Section

type Section struct {
	Level uint8
	Line  []Line
}

Section type.

func (Section) Equals

func (section Section) Equals(other Element) bool

Equals checks if an Element is the same Section

type Speech

type Speech []Line

Speech type

func (Speech) Equals

func (speech Speech) Equals(other Element) bool

Equals checks if an Element is the same Speech

type Synopsis

type Synopsis []Line

Synopsis type.

func (Synopsis) Equals

func (synopsis Synopsis) Equals(other Element) bool

Equals checks if an Element is the same Synopsis

type Transition

type Transition []Line

Transition type.

func (Transition) Equals

func (transition Transition) Equals(other Element) bool

Equals checks if an Element is the same Transition

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL