import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; export const configGeas: monaco.languages.LanguageConfiguration = { comments: { lineComment: ';;', }, }; export const defGeas: monaco.languages.IMonarchLanguage = { builtins: [ 'abs', 'selector', 'keccak256', 'address', 'include', 'assemble', 'pragma', 'define', 'push', ...Array.from({ length: 32 }, (_, i) => `push${ i }`), ], keywords: [ // geasEnvOpcode 'address', 'balance', 'origin', 'caller', 'callvalue', 'calldataload', 'calldatasize', 'calldatacopy', 'codesize', 'codecopy', 'gasprice', 'returndatasize', 'returndatacopy', 'blockhash', 'coinbase', 'timestamp', 'number', 'difficulty', 'gaslimit', 'chainid', 'selfbalance', 'basefee', // geasTrieOpcode 'extcodesize', 'extcodecopy', 'extcodehash', 'sload', 'sstore', 'selfdestruct', // geasCallOpcode 'create', 'call', 'callcode', 'delegatecall', 'create2', 'staticcall', ], operators: [ // geasRegularOpcode 'stop', 'add', 'mul', 'sub', 'div', 'sdiv', 'mod', 'smod', 'addmod', 'mulmod', 'exp', 'signextend', 'lt', 'gt', 'slt', 'sgt', 'eq', 'iszero', 'and', 'or', 'xor', 'not', 'byte', 'shl', 'shr', 'sar', 'keccak256', 'pop', 'mload', 'mstore', 'mstore8', 'jump', 'jumpi', 'pc', 'msize', 'gas', 'jumpdest', 'revert', 'invalid', 'return', // geasRegularOpcode (dynamic) 'dup', ...Array.from({ length: 16 }, (_, i) => `dup${ i }`), 'swap', ...Array.from({ length: 16 }, (_, i) => `swap${ i }`), 'log', ...Array.from({ length: 4 }, (_, i) => `log${ i }`), ], calls: /@\.\w+/, macros: /#?(include|assemble|push|abs|selector|keccak256|address|pragma|define)/, // we include these common regular expressions symbols: /[=>