Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 58 lines (47 sloc) 1.574 kb
7d7d3e8 @ferrous26 Change ownership to The MacRuby Team and update copyrights
ferrous26 authored
1 /*
19f18d3 a new Symbol class, unicode-aware + refactored/cleaned symbol generation
Laurent Sansonetti authored
2 * MacRuby Symbols.
3 *
4 * This file is covered by the Ruby license. See COPYING for more details.
7d7d3e8 @ferrous26 Change ownership to The MacRuby Team and update copyrights
ferrous26 authored
5 *
6 * Copyright (C) 2012, The MacRuby Team. All rights reserved.
9595725 update copyrights to 2011
Laurent Sansonetti authored
7 * Copyright (C) 2010-2011, Apple Inc. All rights reserved.
19f18d3 a new Symbol class, unicode-aware + refactored/cleaned symbol generation
Laurent Sansonetti authored
8 */
9
10 #ifndef __SYMBOL_H_
11 #define __SYMBOL_H_
12
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16
17 // For the parser.
18 #define ID_SCOPE_SHIFT 3
19 #define ID_SCOPE_MASK 0x07
20 #define ID_LOCAL 0x00
21 #define ID_INSTANCE 0x01
22 #define ID_GLOBAL 0x03
23 #define ID_ATTRSET 0x04
24 #define ID_CONST 0x05
25 #define ID_CLASS 0x06
26 #define ID_JUNK 0x07
27 #define ID_INTERNAL ID_JUNK
28
29 #define is_notop_id(id) (true)
30 #define is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)
31 #define is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL)
32 #define is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE)
33 #define is_attrset_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET)
34 #define is_const_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST)
35 #define is_class_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS)
36 #define is_junk_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK)
37
38 #define is_asgn_or_id(id) ((is_notop_id(id)) && \
39 (((id)&ID_SCOPE_MASK) == ID_GLOBAL || \
40 ((id)&ID_SCOPE_MASK) == ID_INSTANCE || \
41 ((id)&ID_SCOPE_MASK) == ID_CLASS))
42
43 struct rb_op_tbl_entry {
44 ID token;
45 const char *name;
46 };
47
48 // Defined in parse.y.
49 extern struct rb_op_tbl_entry rb_op_tbl[];
50
f738483 honor the original string encoding when generating substrings out of a r...
Laurent Sansonetti authored
51 VALUE rb_sym_str(VALUE sym);
52
19f18d3 a new Symbol class, unicode-aware + refactored/cleaned symbol generation
Laurent Sansonetti authored
53 #if defined(__cplusplus)
54 } // extern "C"
55 #endif
56
57 #endif // __SYMBOL_H_
Something went wrong with that request. Please try again.