summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-19 10:47:46 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commit08fc718e8c3a949c17d2b894a441ef183c28d8ac (patch)
tree8a9f33c286d3f29b2585ec63d9ee5fdd99082402 /symbol.c
parentad6512f359fe38d587715c618380e245af586be1 (diff)
indent [ci skip]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/symbol.c b/symbol.c
index b40af8883f..e9f0942324 100644
--- a/symbol.c
+++ b/symbol.c
@@ -321,28 +321,28 @@ rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int a
goto stophere;
id:
- 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) goto stophere;
- 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;
- }
+ 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) goto stophere;
+ 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;
+ }
stophere:
return m == e ? type : -1;