ast

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

README

Wraparound 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 added in v0.1.5

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 added in v0.3.0

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 added in v0.3.0

func (beginact BeginAct) Equals(other Element) bool

Equals checks if an Element is the same BeginAct

type Cell added in v0.1.5

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

Cell contains richtext

func (Cell) Empty added in v0.1.5

func (cell Cell) Empty() bool

Empty checks if the cell has no contents

func (Cell) Equals added in v0.3.0

func (cell Cell) Equals(other Cell) bool

Equals checks if both cells are identical

func (Cell) Lenght added in v0.1.5

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

func (endact EndAct) Equals(other Element) bool

Equals checks if an Element is the same EndAct

type Line added in v0.1.5

type Line []Cell

Line a line of richtext cells

func (Line) Empty added in v0.1.5

func (line Line) Empty() bool

Empty checks if the line is empty

func (Line) Equals added in v0.3.0

func (line Line) Equals(other Line) bool

Equals checks if both cells are identical

func (Line) Lenght added in v0.1.5

func (line Line) Lenght() int

Lenght is the amount of runes in the line

func (Line) String added in v0.1.5

func (line Line) String() string

String returns a plaintext version of the line

func (Line) StringBuffer added in v0.1.5

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

func (speech Speech) Equals(other Element) bool

Equals checks if an Element is the same Speech

type Synopsis added in v0.3.0

type Synopsis []Line

Synopsis type.

func (Synopsis) Equals added in v0.3.0

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 added in v0.3.0

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