Stax
Programming language
Loading...
Searching...
No Matches
tokens.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <boost/describe.hpp>
4#include <string_view>
5
6namespace stax::token {
7
8BOOST_DEFINE_ENUM(Type, kIllegal, kEOF, kIdent, kLet, kFn, kInt, kAssign,
9 kPlus, kComma, kSemicolon, kLParen, kRParen, kLBrace, kRBrace)
10
11struct Token {
12 Type type;
13 std::string_view view;
14
15 auto operator==(const Token&) const -> bool = default;
16};
17
18BOOST_DESCRIBE_STRUCT(Token, (), (type, view));
19
20} // namespace stax
Definition tokens.hpp:6
BOOST_DEFINE_ENUM(Type, kIllegal, kEOF, kIdent, kLet, kFn, kInt, kAssign, kPlus, kComma, kSemicolon, kLParen, kRParen, kLBrace, kRBrace) struct Token
Definition tokens.hpp:8
BOOST_DESCRIBE_STRUCT(Token,(),(type, view))