LibParseState

Git Source

Functions

newActiveSourcePointer

function newActiveSourcePointer(uint256 oldActiveSourcePointer) internal pure returns (uint256);

resetSource

function resetSource(ParseState memory state) internal pure;

newState

function newState(bytes memory data, bytes memory meta, bytes memory operandHandlers, bytes memory literalParsers)
    internal
    pure
    returns (ParseState memory);

snapshotSourceHeadToLineTracker

function snapshotSourceHeadToLineTracker(ParseState memory state) internal pure;

endLine

function endLine(ParseState memory state, uint256 cursor) internal pure;

highwater

We potentially just closed out some group of arbitrarily nested parens OR a lone literal value at the top level. IF we are at the top level we move the immutable stack highwater mark forward 1 item, which moves the RHS offset forward 1 byte to start a new word counter.

function highwater(ParseState memory state) internal pure;

pushConstantValue

Includes a constant value in the constants linked list so that it will appear in the final constants array.

function pushConstantValue(ParseState memory state, uint256 fingerprint, uint256 value) internal pure;

pushLiteral

function pushLiteral(ParseState memory state, uint256 cursor, uint256 end) internal pure returns (uint256);

pushOpToSource

function pushOpToSource(ParseState memory state, uint256 opcode, Operand operand) internal pure;

endSource

function endSource(ParseState memory state) internal pure;

buildBytecode

function buildBytecode(ParseState memory state) internal pure returns (bytes memory bytecode);

buildConstants

function buildConstants(ParseState memory state) internal pure returns (uint256[] memory constants);