Skip to content

Commit

Permalink
rb_enc_symname_type: indent
Browse files Browse the repository at this point in the history
  • Loading branch information
shyouhei committed Mar 5, 2021
1 parent 0a43f0d commit 7715d42
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions symbol.c
Expand Up @@ -375,28 +375,28 @@ rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int a
case stophere: break;
case needmore:

if (m >= e || (*m != '_' && !ISALPHA(*m) && ISASCII(*m))) {
if (len > 1 && *(e-1) == '=') {
type = rb_enc_symname_type(name, len-1, enc, allowed_attrset);
if (type != ID_ATTRSET) return ID_ATTRSET;
if (m >= e || (*m != '_' && !ISALPHA(*m) && ISASCII(*m))) {
if (len > 1 && *(e-1) == '=') {
type = rb_enc_symname_type(name, len-1, enc, allowed_attrset);
if (type != ID_ATTRSET) return ID_ATTRSET;
}
return -1;
}
while (m < e && is_identchar(m, e, enc)) m += rb_enc_mbclen(m, e, enc);
if (m >= e) break;
switch (*m) {
case '!': case '?':
if (type == ID_GLOBAL || type == ID_CLASS || type == ID_INSTANCE) return -1;
type = ID_JUNK;
++m;
if (m + 1 < e || *m != '=') break;
/* fall through */
case '=':
if (!(allowed_attrset & (1U << type))) return -1;
type = ID_ATTRSET;
++m;
break;
}
return -1;
}
while (m < e && is_identchar(m, e, enc)) m += rb_enc_mbclen(m, e, enc);
if (m >= e) break;
switch (*m) {
case '!': case '?':
if (type == ID_GLOBAL || type == ID_CLASS || type == ID_INSTANCE) return -1;
type = ID_JUNK;
++m;
if (m + 1 < e || *m != '=') break;
/* fall through */
case '=':
if (!(allowed_attrset & (1U << type))) return -1;
type = ID_ATTRSET;
++m;
break;
}
}

return m == e ? type : -1;
Expand Down

0 comments on commit 7715d42

Please sign in to comment.