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 |
Members
height
Height of the code box
width
Width of the code box
Methods
getAllCodePoints() → {Array}
Function to get ALL code points in the code box
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
|
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
|
|||||||||
code |
Number | Charcode of the code to insert |