mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-12-01 11:30:04 +00:00
added clang-format
This commit is contained in:
19
src/clex.h
19
src/clex.h
@@ -3,7 +3,8 @@
|
||||
|
||||
#include "cosmo.h"
|
||||
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
// single character tokens
|
||||
TOKEN_LEFT_PAREN,
|
||||
TOKEN_RIGHT_PAREN,
|
||||
@@ -72,26 +73,30 @@ typedef enum {
|
||||
TOKEN_EOF
|
||||
} CTokenType;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
CTokenType type;
|
||||
const char *word;
|
||||
int len;
|
||||
} CReservedWord;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
CTokenType type;
|
||||
char *start;
|
||||
int length;
|
||||
int line;
|
||||
} CToken;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
char *currentChar;
|
||||
char *startChar;
|
||||
char *buffer; // if non-NULL & bufCount > 0, token->start & token->length will be set to buffer & bufCount respectively
|
||||
char *buffer; // if non-NULL & bufCount > 0, token->start & token->length will be set to buffer
|
||||
// & bufCount respectively
|
||||
size_t bufCount;
|
||||
size_t bufCap;
|
||||
int line; // current line
|
||||
size_t bufCap;
|
||||
int line; // current line
|
||||
int lastLine; // line of the previous consumed token
|
||||
bool isEnd;
|
||||
CTokenType lastType;
|
||||
|
||||
Reference in New Issue
Block a user