summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2019-11-11 17:37:21 +0900
committerNARUSE, Yui <naruse@airemix.jp>2019-11-11 17:37:21 +0900
commitfd69f82675bf93a848e5aa58d117bf8bbf604188 (patch)
tree715969bdeda865555857a5d2336bfce42a5e9898 /parse.y
parentba5b51ca5968314f5ca92fee0afaea44a78eb0b1 (diff)
Revert "Warn EOF char in comment"
This reverts commit 69ec3f70fab0c1c537c68fb135cc315181b1d750.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y29
1 files changed, 4 insertions, 25 deletions
diff --git a/parse.y b/parse.y
index 039abc48d7..e84468d2a5 100644
--- a/parse.y
+++ b/parse.y
@@ -6191,30 +6191,7 @@ parser_str_new(const char *ptr, long len, rb_encoding *enc, int func, rb_encodin
return str;
}
-static const char *
-eof_char(int c)
-{
- switch (c) {
- case '\0': return "\\0";
- case '\004': return "^D";
- case '\032': return "^Z";
- }
- return 0;
-}
-
-static void
-lex_goto_eol(struct parser_params *p)
-{
- const char *pcur = p->lex.pcur, *pend = p->lex.pend;
- for (; pcur < pend; pcur++) {
- const char *eof = eof_char(*pcur);
- if (eof) {
- rb_warning1("encountered %s in comment, just ignored in this version", WARN_S(eof));
- break;
- }
- }
- p->lex.pcur = pend; /* pcur */
-}
+#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
#define lex_eol_p(p) ((p)->lex.pcur >= (p)->lex.pend)
#define lex_eol_n_p(p,n) ((p)->lex.pcur+(n) >= (p)->lex.pend)
#define peek(p,c) peek_n(p, (c), 0)
@@ -7421,7 +7398,9 @@ word_match_p(struct parser_params *p, const char *word, long len)
if (p->lex.pcur + len == p->lex.pend) return 1;
int c = (unsigned char)p->lex.pcur[len];
if (ISSPACE(c)) return 1;
- if (eof_char(c)) return 1;
+ switch (c) {
+ case '\0': case '\004': case '\032': return 1;
+ }
return 0;
}