-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBuiltins.h
More file actions
33 lines (32 loc) · 1.11 KB
/
Builtins.h
File metadata and controls
33 lines (32 loc) · 1.11 KB
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
#pragma once
// Get builtin function declarations (for typechecking purposes).
inline const char* GetBuiltins()
{
return
// Arithmetic
"int operator+ ( int x, int y ); "
"int operator- ( int x, int y ); "
"int operator* ( int x, int y ); "
"int operator/ ( int x, int y ); "
"int operator% ( int x, int y ); "
// Equality
"bool operator== ( int x, int y ); "
"bool operator!= ( int x, int y ); "
"bool operator== ( bool x, bool y ); "
"bool operator!= ( bool x, bool y ); "
// Comparisons
"bool operator< ( int x, int y ); "
"bool operator<= ( int x, int y ); "
"bool operator> ( int x, int y ); "
"bool operator>= ( int x, int y ); "
// Unary operations.
"bool operator! ( bool x ); "
"int operator- ( int x ); "
// Logical operations
"bool operator&& ( bool x, bool y ); "
"bool operator|| ( bool x, bool y ); "
// Type conversions
"bool operator bool ( int x ); "
"int operator int ( bool x ); "
;
}