aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-12-01 21:57:28 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-12-02 02:41:39 +0900
commit6e2b10d45653ed96529aafe981eae7e920110461 (patch)
treed97dca0fecb0ec220c40f12fdad216bdde931ac2 /parse.y
parent9d209093429658664b476b7d0630463ec8748d2c (diff)
downloadruby-6e2b10d45653ed96529aafe981eae7e920110461.tar.gz
Prefer proper enum over bare int
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index f767108181..668e6091ac 100644
--- a/parse.y
+++ b/parse.y
@@ -8607,7 +8607,7 @@ parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
}
newtok(p);
if ((func & STR_FUNC_EXPAND) && c == '#') {
- int t = parser_peek_variable_name(p);
+ enum yytokentype t = parser_peek_variable_name(p);
if (t) return t;
tokadd(p, '#');
c = nextc(p);
@@ -9081,7 +9081,7 @@ here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
/* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
newtok(p);
if (c == '#') {
- int t = parser_peek_variable_name(p);
+ enum yytokentype t = parser_peek_variable_name(p);
if (p->heredoc_line_indent != -1) {
if (p->heredoc_indent > p->heredoc_line_indent) {
p->heredoc_indent = p->heredoc_line_indent;
@@ -10663,7 +10663,7 @@ parser_yylex(struct parser_params *p)
!IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
!IS_END() &&
(!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
- int token = heredoc_identifier(p);
+ enum yytokentype token = heredoc_identifier(p);
if (token) return token < 0 ? 0 : token;
}
if (IS_AFTER_OPERATOR()) {