8000 Fix `NullToken` definition · ruby/rbs@ccdef8b · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit ccdef8b

Browse files
committed
Fix NullToken definition
1 parent eb440db commit ccdef8b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/rbs/lexer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ typedef struct {
140140
const rbs_encoding_t *encoding;
141141
} rbs_lexer_t;
142142

143-
extern rbs_token_t NullToken;
144-
extern rbs_position_t NullPosition;
145-
extern rbs_range_t NULL_RANGE;
143+
extern const rbs_token_t NullToken;
144+
extern const rbs_position_t NullPosition;
145+
extern const rbs_range_t NULL_RANGE;
146146

147147
char *rbs_peek_token(rbs_lexer_t *lexer, rbs_token_t tok);
148148
int rbs_token_chars(rbs_token_t tok);

src/lexstate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ static const char *RBS_TOKENTYPE_NAMES[] = {
9292
"tANNOTATION", /* Annotation */
9393
};
9494

95-
rbs_token_t NullToken = { .type = NullType, .range = {0} };
96-
rbs_position_t NullPosition = { -1, -1, -1, -1 };
97-
rbs_range_t NULL_RANGE = { { -1, -1, -1, -1 }, { -1, -1, -1, -1 } };
95+
const rbs_position_t NullPosition = { -1, -1, -1, -1 };
96+
const rbs_range_t NULL_RANGE = { { -1, -1, -1, -1 }, { -1, -1, -1, -1 } };
97+
const rbs_token_t NullToken = { .type = NullType, .range = { {0}, {0} } };
9898

9999
const char *rbs_token_type_str(enum RBSTokenType type) {
100100
return RBS_TOKENTYPE_NAMES[type];

0 commit comments

Comments
 (0)
0