#pragma once #include #include #include "syntax/token.h" struct scanner_cursor_t { std::string source; std::string::size_type current; std::string::size_type guard; int length; int line; // 扫描器当前所在的行 int column; // 扫描器当前所在的列 }; struct module_t { std::string source; scanner_cursor_t s_cursor; std::vector token_list; module_t(std::string source) : source(source) { s_cursor.source = source; s_cursor.line = 1; s_cursor.column = 1; s_cursor.length = 0; s_cursor.current = 0; s_cursor.guard = 0; } };