dsp-asm/error.hpp
Zack Buhman 082ebc20e5 lexer: add header
This also calls the lexer from main.
2023-08-14 11:38:52 -07:00

25 lines
471 B
C++

#pragma once
#include <iostream>
namespace dsp {
extern bool had_error;
static inline void report(const int line, const int col, const std::string where, const std::string message)
{
std::cerr << "[line " << line
<< " col " << col
<< "] error" << where << ": " << message
<< std::endl;
had_error = true;
}
static inline void error(const int line, const int col, std::string message)
{
report(line, col, "", message);
}
}