mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rb_enc_symname_type: indent
This commit is contained in:
parent
0a43f0de27
commit
7715d428f1
1 changed files with 21 additions and 21 deletions
42
symbol.c
42
symbol.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue