ast

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 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.

type BeginAct

type BeginAct []Line

BeginAct type

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) 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.

type Dialogue

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

Dialogue type.

type DualDialogue

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

	RCharacter []Line
	RLines     []Element
}

DualDialogue type.

type Element

type Element interface{}

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
	TSynopse
	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

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) 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.

type Note

type Note []Line

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

type PageBreak

type PageBreak struct{}

PageBreak type.

type Parenthetical

type Parenthetical []Line

Parenthetical type

type Scene

type Scene struct {
	Slugline    []Line
	SceneNumber string
}

Scene header type.

type Script

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

Script contains the entire script.

type Section

type Section struct {
	Level uint8
	Line  []Line
}

Section type.

type Speech

type Speech []Line

Speech type

type Synopse

type Synopse []Line

Synopse type.

type Transition

type Transition []Line

Transition type.

Jump to

Keyboard shortcuts

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