forked from emojicode/emojicode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmojicodeShared.h
56 lines (44 loc) 路 1.47 KB
/
EmojicodeShared.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// EmojicodeSharedTypes.h
// Emojicode
//
// Created by Theo Weidmann on 19/07/15.
// Copyright (c) 2015 Theo Weidmann. All rights reserved.
//
#ifndef EmojicodeShared_h
#define EmojicodeShared_h
#include <cstdint>
/// A byte-code instruction
using EmojicodeInstruction = uint32_t;
#ifndef defaultPackagesDirectory
#define defaultPackagesDirectory "/usr/local/EmojicodePackages"
#endif
#define T_NOTHINGNESS static_cast<EmojicodeInteger>(0)
#define T_OBJECT 1
#define T_OPTIONAL_VALUE static_cast<EmojicodeInteger>(1)
#define T_ERROR static_cast<EmojicodeInteger>(2)
#define T_BOOLEAN 3
#define T_INTEGER 4
#define T_DOUBLE 5
#define T_SYMBOL 6
#define REMOTE_MASK (1 << 31)
/// @returns True if @c c is a whitespace character. See http://www.unicode.org/Public/6.3.0/ucd/PropList.txt
inline bool isWhitespace(char32_t c) {
return (0x9 <= c && c <= 0xD) || c == 0x20 || c == 0x85 || c == 0xA0 || c == 0x1680 || (0x2000 <= c && c <= 0x200A)
|| c == 0x2028 || c== 0x2029 || c == 0x2029 || c == 0x202F || c == 0x205F || c == 0x3000 || c == 0xFE0F;
}
#define PORTABLE_INTLEAST64_MAX ((int_least64_t)9223372036854775807)
enum class ObjectVariableType {
/// There is an object pointer a the given index
Simple = 0,
/// There is an object pointer a the given index if the value at @c condition is truthy
Condition = 1,
Box = 2,
ConditionalSkip = 3
};
enum class ContextType {
None = 0,
Object = 1,
ValueReference = 2,
};
#endif /* EmojicodeShared_h */