Class: Codebox

Fish. Codebox

new Codebox(code)

Turns the code into a codebox. All newline characters will be removed and turned into actual new lines. To get actual newline characters into the codebox, manipulate it using Fish.Codebox#setCodeAt
Parameters:
Name Type Description
code String Code to parse
Source:

Members

height

Height of the code box
Source:

width

Width of the code box
Source:

Methods

getAllCodePoints() → {Array}

Function to get ALL code points in the code box
Source:
Returns:
An array with objects on the form {char: number, line: numer}
Type
Array

getCodeAt(ip) → {Number}

Function to get code at a point in the code box
Parameters:
Name Type Description
ip Object Instruction pointer location
Properties
Name Type Description
char Number Character index
line Number Line index
Source:
Returns:
Charcode of the code at the given position
Type
Number

setCodeAt(ip, code)

Function to set code at a point in the code box
Parameters:
Name Type Description
ip Object Instruction pointer location
Properties
Name Type Description
char Number Character index
line Number Line index
code Number Charcode of the code to insert
Source: