aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-13 02:32:45 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-13 02:32:45 +0900
commit81399a5c464c8eafdb68fddb5e26a519390cd069 (patch)
tree2d39d0b523764f88b36e48171c2d1c17adbb8e31 /parse.y
parent17b0643392749f45b7aacb64fc1c1bd704d42b4c (diff)
downloadruby-81399a5c464c8eafdb68fddb5e26a519390cd069.tar.gz
Use `lex_eol` macros
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index d5c6ca36be..4daefb4a9c 100644
--- a/parse.y
+++ b/parse.y
@@ -7912,7 +7912,7 @@ tokadd_utf8(struct parser_params *p, rb_encoding **encp,
* does its own validation and will catch any issues.
*/
tokadd(p, open_brace);
- while (++p->lex.pcur < p->lex.pend) {
+ while (!lex_eol_ptr_p(p, ++p->lex.pcur)) {
int c = peekc(p);
if (c == close_brace) {
tokadd(p, c);
@@ -7922,7 +7922,7 @@ tokadd_utf8(struct parser_params *p, rb_encoding **encp,
else if (c == term) {
break;
}
- if (c == '\\' && p->lex.pcur + 1 < p->lex.pend) {
+ if (c == '\\' && !lex_eol_n_p(p, 1)) {
tokadd(p, c);
c = *++p->lex.pcur;
}