# README
Chasm
Chasm is the Chaincode Assembler.
It isn't very sophisticated yet.
Need more docs on the assembler syntax, but look at examples to see how it's done.
Also needs work to define constants for the various contexts and create a proper symbol table.
# Functions
AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes.
Debug creates an Option to set the debug flag to b.
Entrypoint creates an Option to set the rule name to use as entrypoint.
GlobalStore creates an Option to set a key to a certain value in the globalStore.
InitState creates an Option to set a key to a certain value in the global "state" store.
MaxExpressions creates an Option to stop parsing after the provided number of expressions have been parsed, if the value is 0 then the parser will parse for as many steps as needed (possibly an infinite number).
Memoize creates an Option to set the memoize flag to b.
Parse parses the data from b using filename as information in the error messages.
ParseFile parses the file identified by filename.
ParseReader parses the data from r using filename as information in the error messages.
Recover creates an Option to set the recover flag to b.
Statistics adds a user provided Stats struct to the parser to allow the user to process the results after the parsing has finished.
# Structs
BinaryOpcode is for opcodes that take one single-byte argument.
CallOpcode is for opcodes that call a function and take a function name.
DecoOpcode is for Deco, which calls a function and takes a function name as well as a field index.
ErrorPosition defines the raw error position data.
FunctionDef is a node that expresses the information in a function definition.
HandlerDef is a node that expresses the information in a handler definition.
PushB is an array of bytes.
PushOpcode constructs push operations with the appropriate number of bytes to express the specified value.
PushTimestamp is a 64-bit representation of the time since the start of the epoch in microseconds.
Script is the highest level node in the system.
Stats stores some statistics, gathered during parsing.
UnitaryOpcode is for opcodes that cannot take arguments.
# Interfaces
Cloner is implemented by any value that has a Clone method, which returns a copy of the value.
ErrorPositioner is an interface that can be used to tell if an error provides position data in the source file.
Fixupper is an interface that is implemented by all nodes that need fixups and all nodes that contain other nodes as children.
Node is the fundamental unit that the parser manipulates (it builds a structure of nodes).Each node can emit itself as an array of bytes, or nil.
# Type aliases
Option is a function that can set an option on the parser.