#pragma once

//the types of tokens produced by the lexer
typedef enum Toy_TokenType {
	//with apologies to Tony Hoare
	TOY_TOKEN_NULL,

	//variable names
	TOY_TOKEN_NAME,

	//types
	TOY_TOKEN_TYPE_BOOLEAN,
	TOY_TOKEN_TYPE_INTEGER,
	TOY_TOKEN_TYPE_FLOAT,
	TOY_TOKEN_TYPE_STRING,
	TOY_TOKEN_TYPE_ARRAY,
	TOY_TOKEN_TYPE_TABLE,
	TOY_TOKEN_TYPE_FUNCTION,
	TOY_TOKEN_TYPE_OPAQUE,
	TOY_TOKEN_TYPE_ANY,

	//keywords and reserved words
	TOY_TOKEN_KEYWORD_AS, //unused
	TOY_TOKEN_KEYWORD_ASSERT,
	TOY_TOKEN_KEYWORD_BREAK,
	TOY_TOKEN_KEYWORD_CLASS, //unused
	TOY_TOKEN_KEYWORD_CONST,
	TOY_TOKEN_KEYWORD_CONTINUE,
	TOY_TOKEN_KEYWORD_DO, //unused
	TOY_TOKEN_KEYWORD_ELSE,
	TOY_TOKEN_KEYWORD_EXPORT, //unused
	TOY_TOKEN_KEYWORD_FOR,
	TOY_TOKEN_KEYWORD_FOREACH, //unused
	TOY_TOKEN_KEYWORD_FUNCTION, //remapped 'fn'
	TOY_TOKEN_KEYWORD_IF,
	TOY_TOKEN_KEYWORD_IMPORT, //unused
	TOY_TOKEN_KEYWORD_IN, //unused
	TOY_TOKEN_KEYWORD_OF, //unused
	TOY_TOKEN_KEYWORD_PASS,
	TOY_TOKEN_KEYWORD_PRINT,
	TOY_TOKEN_KEYWORD_RETURN,
	TOY_TOKEN_KEYWORD_VAR,
	TOY_TOKEN_KEYWORD_WHILE,
	TOY_TOKEN_KEYWORD_YIELD, //unused

	//literal values
	TOY_TOKEN_LITERAL_TRUE,
	TOY_TOKEN_LITERAL_FALSE,
	TOY_TOKEN_LITERAL_INTEGER,
	TOY_TOKEN_LITERAL_FLOAT,
	TOY_TOKEN_LITERAL_STRING,

	//math operators
	TOY_TOKEN_OPERATOR_ADD,                    //  +
	TOY_TOKEN_OPERATOR_SUBTRACT,               //  -
	TOY_TOKEN_OPERATOR_MULTIPLY,               //  *
	TOY_TOKEN_OPERATOR_DIVIDE,                 //  /
	TOY_TOKEN_OPERATOR_MODULO,                 //  %
	TOY_TOKEN_OPERATOR_ADD_ASSIGN,             //  +=
	TOY_TOKEN_OPERATOR_SUBTRACT_ASSIGN,        //  -=
	TOY_TOKEN_OPERATOR_MULTIPLY_ASSIGN,        //  *=
	TOY_TOKEN_OPERATOR_DIVIDE_ASSIGN,          //  /=
	TOY_TOKEN_OPERATOR_MODULO_ASSIGN,          //  %=
	TOY_TOKEN_OPERATOR_INCREMENT,              //  ++
	TOY_TOKEN_OPERATOR_DECREMENT,              //  --
	TOY_TOKEN_OPERATOR_ASSIGN,                 //  =

	//comparator operators
	TOY_TOKEN_OPERATOR_COMPARE_EQUAL,          //  ==
	TOY_TOKEN_OPERATOR_COMPARE_NOT,            //  !=
	TOY_TOKEN_OPERATOR_COMPARE_LESS,           //  <
	TOY_TOKEN_OPERATOR_COMPARE_LESS_EQUAL,     //  <=
	TOY_TOKEN_OPERATOR_COMPARE_GREATER,        //  >
	TOY_TOKEN_OPERATOR_COMPARE_GREATER_EQUAL,  //  >=

	//structural operators
	TOY_TOKEN_OPERATOR_PAREN_LEFT,             //  (
	TOY_TOKEN_OPERATOR_PAREN_RIGHT,            //  )
	TOY_TOKEN_OPERATOR_BRACKET_LEFT,           //  [
	TOY_TOKEN_OPERATOR_BRACKET_RIGHT,          //  ]
	TOY_TOKEN_OPERATOR_BRACE_LEFT,             //  {
	TOY_TOKEN_OPERATOR_BRACE_RIGHT,            //  }

	//other operators
	TOY_TOKEN_OPERATOR_AND,       //  &&
	TOY_TOKEN_OPERATOR_OR,        //  ||
	TOY_TOKEN_OPERATOR_NEGATE,    //  ! (prefix)
	TOY_TOKEN_OPERATOR_QUESTION,  //  ?
	TOY_TOKEN_OPERATOR_COLON,     //  :

	TOY_TOKEN_OPERATOR_SEMICOLON, //  ;
	TOY_TOKEN_OPERATOR_COMMA,     //  ,

	TOY_TOKEN_OPERATOR_DOT,       //  .
	TOY_TOKEN_OPERATOR_CONCAT,    //  ..
	TOY_TOKEN_OPERATOR_REST,      //  ...

	//unused operators
	TOY_TOKEN_OPERATOR_AMPERSAND, //  &
	TOY_TOKEN_OPERATOR_PIPE,      //  |

	//meta tokens
	TOY_TOKEN_ERROR, //meta
	TOY_TOKEN_EOF, //meta
} Toy_TokenType;

