Files
mdtex-compiler/include/lexer/Cursor.h
T
2026-06-24 23:04:58 +03:00

23 lines
431 B
C++

#pragma once
#include <string>
namespace lexer {
// controlled character stream access
class Cursor {
private:
const std::string &source;
int position; // current index in string
int line; // current index of line
int column; //
public:
char current(); // returns current symbol
char peek(int offset); //
void advance();
bool eol() const;
bool eof() const;
};
}