code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
module foo.bar;
import core.vararg;
import std.stdio;
pragma (lib, "test");
pragma (msg, "Hello World");
static assert(true, "message");
typedef double mydbl = 10;
int main();
struct S
{
int m;
int n;
}
template Foo(T, int V)
{
void foo(...)
{
static if (is(Object _ : X!TL, alias X, TL...))
{
}
auto x = __traits(hasMember, Object, "noMember");
auto y = is(Object : X!TL, alias X, TL...);
assert(!x && !y, "message");
S s = {1, 2};
auto a = [1, 2, 3];
auto aa = [1:1, 2:2, 3:3];
int n, m;
}
int bar(double d, int x)
{
if (d)
{
d++;
}
else
d--;
asm { naked; }
asm { mov EAX,3; }
for (;;)
{
{
d = d + 1;
}
}
for (int i = 0;
i < 10; i++)
{
{
d = i ? d + 1 : 5;
}
}
char[] s;
foreach (char c; s)
{
d *= 2;
if (d)
break;
else
continue;
}
switch (V)
{
case 1:
{
}
case 2:
{
break;
}
case 3:
{
goto case 1;
}
case 4:
{
goto default;
}
default:
{
d /= 8;
break;
}
}
enum Label
{
A,
B,
C,
}
;
void fswitch(Label l);
loop:
while (x)
{
x--;
if (x)
break loop;
else
continue loop;
}
do
{
x++;
}
while (x < 10);
try
{
try
{
bar(1, 2);
}
catch(Object o)
{
x++;
}
}
finally
{
x--;
}
Object o;
synchronized(o) {
x = ~x;
}
synchronized {
x = x < 3;
}
with (o)
{
toString();
}
}
}
static this();
interface iFoo
{
}
class xFoo : iFoo
{
}
interface iFoo2
{
}
class xFoo2 : iFoo, iFoo2
{
}
class Foo3
{
this(int a, ...);
this(int* a);
}
alias int myint;
static notquit = 1;
class Test
{
void a();
void b();
void c();
void d();
void e();
void f();
void g();
void h();
void i();
void j();
void k();
void l();
void m();
void n();
void o();
void p();
void q();
void r();
void s();
void t();
void u();
void v();
void w();
void x();
void y();
void z();
void aa();
void bb();
void cc();
void dd();
void ee();
template A(T)
{
}
alias A!uint getHUint;
alias A!int getHInt;
alias A!float getHFloat;
alias A!ulong getHUlong;
alias A!long getHLong;
alias A!double getHDouble;
alias A!byte getHByte;
alias A!ubyte getHUbyte;
alias A!short getHShort;
alias A!ushort getHUShort;
alias A!real getHReal;
}
template templ(T)
{
void templ(T val)
{
pragma (msg, "Invalid destination type.");
}
}
static char[] charArray = ['"', '\''];
class Point
{
auto x = 10;
uint y = 20;
}
template Foo2(bool bar)
{
void test()
{
static if (bar)
{
int i;
}
else
{
}
static if (!bar)
{
}
else
{
}
}
}
template Foo4()
{
void bar()
{
}
}
template Foo4x(T...)
{
}
class Baz4
{
mixin Foo4!() foo;
mixin Foo4x!(int, "str") foox;
alias foo.bar baz;
}
template test(T)
{
int test(T t)
{
if (auto o = cast(Object)t)
return 1;
return 0;
}
}
enum x6 = 1;
bool foo6(int a, int b, int c, int d);
auto foo7(int x)
{
return 5;
}
class D8
{
}
void func8();
template func9(T)
{
T func9()
{
T i;
scope(exit) i = 1;
scope(success) i = 2;
scope(failure) i = 3;
return i;
}
}
template V10(T)
{
void func()
{
for (int i, j = 4; i < 3; i++)
{
{
}
}
}
}
int foo11(int function() fn);
template bar11(T)
{
int bar11()
{
return foo11(function int()
{
return 0;
}
);
}
}
struct S6360
{
@property const pure nothrow long weeks1();
const nothrow pure @property long weeks2();
}
struct S12
{
nothrow this(int n);
nothrow this(string s);
}
struct T12
{
template __ctor()
{
immutable this(int args)
{
}
}
immutable template __ctor(A...)
{
this(A args)
{
}
}
}
import std.stdio : writeln, F = File;
template foo6591()
{
void foo6591()
{
import std.stdio : writeln, F = File;
}
}
version (unittest)
{
nothrow pure {}
nothrow pure {}
public {}
extern (C) {}
align{}
}
template Foo10334(T) if (Bar10334!())
{
}
template Foo10334(T) if (Bar10334!100)
{
}
template Foo10334(T) if (Bar10334!3.14)
{
}
template Foo10334(T) if (Bar10334!"str")
{
}
template Foo10334(T) if (Bar10334!1.4i)
{
}
template Foo10334(T) if (Bar10334!null)
{
}
template Foo10334(T) if (Bar10334!true)
{
}
template Foo10334(T) if (Bar10334!false)
{
}
template Foo10334(T) if (Bar10334!'A')
{
}
template Foo10334(T) if (Bar10334!int)
{
}
template Foo10334(T) if (Bar10334!string)
{
}
template Foo10334(T) if (Bar10334!this)
{
}
template Foo10334(T) if (Bar10334!([1, 2, 3]))
{
}
template Foo10334(T) if (Bar10334!(Baz10334!()))
{
}
template Foo10334(T) if (Bar10334!(Baz10334!T))
{
}
template Foo10334(T) if (Bar10334!(Baz10334!100))
{
}
template Foo10334(T) if (Bar10334!(.foo))
{
}
template Test10334(T...)
{
}
mixin Test10334!int a;
mixin Test10334!(int, long) b;
mixin Test10334!"str" c;
|
D
|
/***********************************************************************\
* ntsecapi.d *
* *
* Windows API header module *
* *
* Translated from MinGW Windows headers *
* by Stewart Gordon *
* *
* Placed into public domain *
\***********************************************************************/
module win32.ntsecapi;
private import
win32.basetyps, win32.ntdef, win32.windef, win32.winnt, win32.w32api;
// FIXME: check types and grouping of constants
// FIXME: check Windows version support
const KERB_WRAP_NO_ENCRYPT = 0x80000001;
const LOGON_GUEST = 0x00000001;
const LOGON_NOENCRYPTION = 0x00000002;
const LOGON_CACHED_ACCOUNT = 0x00000004;
const LOGON_USED_LM_PASSWORD = 0x00000008;
const LOGON_EXTRA_SIDS = 0x00000020;
const LOGON_SUBAUTH_SESSION_KEY = 0x00000040;
const LOGON_SERVER_TRUST_ACCOUNT = 0x00000080;
const LOGON_NTLMV2_ENABLED = 0x00000100;
const LOGON_RESOURCE_GROUPS = 0x00000200;
const LOGON_PROFILE_PATH_RETURNED = 0x00000400;
const LOGON_GRACE_LOGON = 0x01000000;
enum {
LSA_MODE_PASSWORD_PROTECTED = 1,
LSA_MODE_INDIVIDUAL_ACCOUNTS,
LSA_MODE_MANDATORY_ACCESS,
LSA_MODE_LOG_FULL
}
bool LSA_SUCCESS(int x) { return x >= 0; }
/* TOTHINKABOUT: These constants don't have ANSI/Unicode versioned
* aliases. Should we merge them anyway?
*/
const char[] MICROSOFT_KERBEROS_NAME_A = "Kerberos";
const wchar[] MICROSOFT_KERBEROS_NAME_W = "Kerberos";
const char[] MSV1_0_PACKAGE_NAME = "MICROSOFT_AUTHENTICATION_PACKAGE_V1_0";
const wchar[] MSV1_0_PACKAGE_NAMEW = "MICROSOFT_AUTHENTICATION_PACKAGE_V1_0";
const MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = 32;
const MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = 2048;
const MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = 2;
const MSV1_0_CRED_LM_PRESENT = 1;
const MSV1_0_CRED_NT_PRESENT = 2;
const MSV1_0_CRED_VERSION = 0;
const MSV1_0_DONT_TRY_GUEST_ACCOUNT = 16;
const MSV1_0_MAX_NTLM3_LIFE = 1800;
const MSV1_0_MAX_AVL_SIZE = 64000;
const MSV1_0_MNS_LOGON = 16777216;
const size_t
MSV1_0_CHALLENGE_LENGTH = 8,
MSV1_0_LANMAN_SESSION_KEY_LENGTH = 8,
MSV1_0_NTLM3_RESPONSE_LENGTH = 16,
MSV1_0_NTLM3_OWF_LENGTH = 16,
MSV1_0_NTLM3_INPUT_LENGTH = MSV1_0_NTLM3_RESPONSE.sizeof
- MSV1_0_NTLM3_RESPONSE_LENGTH,
MSV1_0_OWF_PASSWORD_LENGTH = 16,
MSV1_0_PACKAGE_NAMEW_LENGTH = MSV1_0_PACKAGE_NAMEW.sizeof
- WCHAR.sizeof;
const MSV1_0_RETURN_USER_PARAMETERS = 8;
const MSV1_0_RETURN_PASSWORD_EXPIRY = 64;
const MSV1_0_RETURN_PROFILE_PATH = 512;
const MSV1_0_SUBAUTHENTICATION_DLL_EX = 1048576;
const MSV1_0_SUBAUTHENTICATION_DLL = 0xff000000;
const MSV1_0_SUBAUTHENTICATION_DLL_SHIFT = 24;
const MSV1_0_SUBAUTHENTICATION_DLL_RAS = 2;
const MSV1_0_SUBAUTHENTICATION_DLL_IIS = 132;
const MSV1_0_SUBAUTHENTICATION_FLAGS = 0xff000000;
const MSV1_0_TRY_GUEST_ACCOUNT_ONLY = 256;
const MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY = 1024;
const MSV1_0_UPDATE_LOGON_STATISTICS = 4;
const MSV1_0_USE_CLIENT_CHALLENGE = 128;
const MSV1_0_USER_SESSION_KEY_LENGTH = 16;
const char[]
MSV1_0_SUBAUTHENTICATION_KEY
= `System\CurrentControlSet\Control\Lsa\MSV1_0`,
MSV1_0_SUBAUTHENTICATION_VALUE = "Auth";
const ACCESS_MASK
POLICY_VIEW_LOCAL_INFORMATION = 0x0001,
POLICY_VIEW_AUDIT_INFORMATION = 0x0002,
POLICY_GET_PRIVATE_INFORMATION = 0x0004,
POLICY_TRUST_ADMIN = 0x0008,
POLICY_CREATE_ACCOUNT = 0x0010,
POLICY_CREATE_SECRET = 0x0020,
POLICY_CREATE_PRIVILEGE = 0x0040,
POLICY_SET_DEFAULT_QUOTA_LIMITS = 0x0080,
POLICY_SET_AUDIT_REQUIREMENTS = 0x0100,
POLICY_AUDIT_LOG_ADMIN = 0x0200,
POLICY_SERVER_ADMIN = 0x0400,
POLICY_LOOKUP_NAMES = 0x0800,
POLICY_READ = STANDARD_RIGHTS_READ | 0x0006,
POLICY_WRITE = STANDARD_RIGHTS_WRITE | 0x07F8,
POLICY_EXECUTE = STANDARD_RIGHTS_EXECUTE | 0x0801,
POLICY_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | 0x0FFF;
const POLICY_AUDIT_EVENT_UNCHANGED = 0;
const POLICY_AUDIT_EVENT_SUCCESS = 1;
const POLICY_AUDIT_EVENT_FAILURE = 2;
const POLICY_AUDIT_EVENT_NONE = 4;
const POLICY_AUDIT_EVENT_MASK = 7;
enum {
POLICY_LOCATION_LOCAL = 1,
POLICY_LOCATION_DS
}
enum : uint {
POLICY_MACHINE_POLICY_LOCAL = 0,
POLICY_MACHINE_POLICY_DEFAULTED,
POLICY_MACHINE_POLICY_EXPLICIT,
POLICY_MACHINE_POLICY_UNKNOWN = 0xFFFFFFFF
}
const POLICY_QOS_SCHANEL_REQUIRED = 0x0001;
const POLICY_QOS_OUTBOUND_INTEGRITY = 0x0002;
const POLICY_QOS_OUTBOUND_CONFIDENTIALITY = 0x0004;
const POLICY_QOS_INBOUND_INTEGREITY = 0x0008;
const POLICY_QOS_INBOUND_CONFIDENTIALITY = 0x0010;
const POLICY_QOS_ALLOW_LOCAL_ROOT_CERT_STORE = 0x0020;
const POLICY_QOS_RAS_SERVER_ALLOWED = 0x0040;
const POLICY_QOS_DHCP_SERVER_ALLOWD = 0x0080;
const POLICY_KERBEROS_FORWARDABLE = 1;
const POLICY_KERBEROS_PROXYABLE = 2;
const POLICY_KERBEROS_RENEWABLE = 4;
const POLICY_KERBEROS_POSTDATEABLE = 8;
const char[]
SAM_PASSWORD_CHANGE_NOTIFY_ROUTINE = "PasswordChangeNotify",
SAM_INIT_NOTIFICATION_ROUTINE = "InitializeChangeNotify",
SAM_PASSWORD_FILTER_ROUTINE = "PasswordFilter";
const TCHAR[]
SE_INTERACTIVE_LOGON_NAME = "SeInteractiveLogonRight",
SE_NETWORK_LOGON_NAME = "SeNetworkLogonRight",
SE_BATCH_LOGON_NAME = "SeBatchLogonRight",
SE_SERVICE_LOGON_NAME = "SeServiceLogonRight";
enum {
TRUST_ATTRIBUTE_NON_TRANSITIVE = 1,
TRUST_ATTRIBUTE_UPLEVEL_ONLY = 2,
TRUST_ATTRIBUTE_TREE_PARENT = 4194304,
TRUST_ATTRIBUTES_VALID = -16580609
}
enum {
TRUST_AUTH_TYPE_NONE,
TRUST_AUTH_TYPE_NT4OWF,
TRUST_AUTH_TYPE_CLEAR
}
enum {
TRUST_DIRECTION_DISABLED,
TRUST_DIRECTION_INBOUND,
TRUST_DIRECTION_OUTBOUND,
TRUST_DIRECTION_BIDIRECTIONAL
}
enum {
TRUST_TYPE_DOWNLEVEL = 1,
TRUST_TYPE_UPLEVEL,
TRUST_TYPE_MIT,
TRUST_TYPE_DCE
}
alias UNICODE_STRING LSA_UNICODE_STRING;
alias UNICODE_STRING* PLSA_UNICODE_STRING;
alias STRING LSA_STRING;
alias STRING* PLSA_STRING;
enum MSV1_0_LOGON_SUBMIT_TYPE {
MsV1_0InteractiveLogon = 2,
MsV1_0Lm20Logon,
MsV1_0NetworkLogon,
MsV1_0SubAuthLogon,
MsV1_0WorkstationUnlockLogon = 7
}
alias MSV1_0_LOGON_SUBMIT_TYPE* PMSV1_0_LOGON_SUBMIT_TYPE;
enum MSV1_0_PROFILE_BUFFER_TYPE {
MsV1_0InteractiveProfile = 2,
MsV1_0Lm20LogonProfile,
MsV1_0SmartCardProfile
}
alias MSV1_0_PROFILE_BUFFER_TYPE* PMSV1_0_PROFILE_BUFFER_TYPE;
enum MSV1_0_AVID {
MsvAvEOL,
MsvAvNbComputerName,
MsvAvNbDomainName,
MsvAvDnsComputerName,
MsvAvDnsDomainName
}
enum MSV1_0_PROTOCOL_MESSAGE_TYPE {
MsV1_0Lm20ChallengeRequest = 0,
MsV1_0Lm20GetChallengeResponse,
MsV1_0EnumerateUsers,
MsV1_0GetUserInfo,
MsV1_0ReLogonUsers,
MsV1_0ChangePassword,
MsV1_0ChangeCachedPassword,
MsV1_0GenericPassthrough,
MsV1_0CacheLogon,
MsV1_0SubAuth,
MsV1_0DeriveCredential,
MsV1_0CacheLookup
}
alias MSV1_0_PROTOCOL_MESSAGE_TYPE* PMSV1_0_PROTOCOL_MESSAGE_TYPE;
enum POLICY_LSA_SERVER_ROLE {
PolicyServerRoleBackup = 2,
PolicyServerRolePrimary
}
alias POLICY_LSA_SERVER_ROLE* PPOLICY_LSA_SERVER_ROLE;
enum POLICY_SERVER_ENABLE_STATE {
PolicyServerEnabled = 2,
PolicyServerDisabled
}
alias POLICY_SERVER_ENABLE_STATE* PPOLICY_SERVER_ENABLE_STATE;
enum POLICY_INFORMATION_CLASS {
PolicyAuditLogInformation = 1,
PolicyAuditEventsInformation,
PolicyPrimaryDomainInformation,
PolicyPdAccountInformation,
PolicyAccountDomainInformation,
PolicyLsaServerRoleInformation,
PolicyReplicaSourceInformation,
PolicyDefaultQuotaInformation,
PolicyModificationInformation,
PolicyAuditFullSetInformation,
PolicyAuditFullQueryInformation,
PolicyDnsDomainInformation,
PolicyEfsInformation
}
alias POLICY_INFORMATION_CLASS* PPOLICY_INFORMATION_CLASS;
enum POLICY_AUDIT_EVENT_TYPE {
AuditCategorySystem,
AuditCategoryLogon,
AuditCategoryObjectAccess,
AuditCategoryPrivilegeUse,
AuditCategoryDetailedTracking,
AuditCategoryPolicyChange,
AuditCategoryAccountManagement,
AuditCategoryDirectoryServiceAccess,
AuditCategoryAccountLogon
}
alias POLICY_AUDIT_EVENT_TYPE* PPOLICY_AUDIT_EVENT_TYPE;
enum POLICY_LOCAL_INFORMATION_CLASS {
PolicyLocalAuditEventsInformation = 1,
PolicyLocalPdAccountInformation,
PolicyLocalAccountDomainInformation,
PolicyLocalLsaServerRoleInformation,
PolicyLocalReplicaSourceInformation,
PolicyLocalModificationInformation,
PolicyLocalAuditFullSetInformation,
PolicyLocalAuditFullQueryInformation,
PolicyLocalDnsDomainInformation,
PolicyLocalIPSecReferenceInformation,
PolicyLocalMachinePasswordInformation,
PolicyLocalQualityOfServiceInformation,
PolicyLocalPolicyLocationInformation
}
alias POLICY_LOCAL_INFORMATION_CLASS* PPOLICY_LOCAL_INFORMATION_CLASS;
enum POLICY_DOMAIN_INFORMATION_CLASS {
PolicyDomainIPSecReferenceInformation = 1,
PolicyDomainQualityOfServiceInformation,
PolicyDomainEfsInformation,
PolicyDomainPublicKeyInformation,
PolicyDomainPasswordPolicyInformation,
PolicyDomainLockoutInformation,
PolicyDomainKerberosTicketInformation
}
alias POLICY_DOMAIN_INFORMATION_CLASS* PPOLICY_DOMAIN_INFORMATION_CLASS;
enum SECURITY_LOGON_TYPE {
Interactive = 2,
Network,
Batch,
Service,
Proxy,
Unlock
}
alias SECURITY_LOGON_TYPE* PSECURITY_LOGON_TYPE;
enum TRUSTED_INFORMATION_CLASS {
TrustedDomainNameInformation = 1,
TrustedControllersInformation,
TrustedPosixOffsetInformation,
TrustedPasswordInformation,
TrustedDomainInformationBasic,
TrustedDomainInformationEx,
TrustedDomainAuthInformation,
TrustedDomainFullInformation
}
alias TRUSTED_INFORMATION_CLASS* PTRUSTED_INFORMATION_CLASS;
struct DOMAIN_PASSWORD_INFORMATION {
USHORT MinPasswordLength;
USHORT PasswordHistoryLength;
ULONG PasswordProperties;
LARGE_INTEGER MaxPasswordAge;
LARGE_INTEGER MinPasswordAge;
}
alias DOMAIN_PASSWORD_INFORMATION* PDOMAIN_PASSWORD_INFORMATION;
struct LSA_ENUMERATION_INFORMATION {
PSID Sid;
}
alias LSA_ENUMERATION_INFORMATION* PLSA_ENUMERATION_INFORMATION;
alias OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES;
alias OBJECT_ATTRIBUTES* PLSA_OBJECT_ATTRIBUTES;
struct LSA_TRUST_INFORMATION {
LSA_UNICODE_STRING Name;
PSID Sid;
}
alias LSA_TRUST_INFORMATION TRUSTED_DOMAIN_INFORMATION_BASIC;
alias LSA_TRUST_INFORMATION* PLSA_TRUST_INFORMATION;
/* in MinGW (further down the code):
* typedef PLSA_TRUST_INFORMATION *PTRUSTED_DOMAIN_INFORMATION_BASIC;
* but it doesn't look right....
*/
alias LSA_TRUST_INFORMATION** PTRUSTED_DOMAIN_INFORMATION_BASIC;
struct LSA_REFERENCED_DOMAIN_LIST {
ULONG Entries;
PLSA_TRUST_INFORMATION Domains;
}
alias LSA_REFERENCED_DOMAIN_LIST* PLSA_REFERENCED_DOMAIN_LIST;
struct LSA_TRANSLATED_SID {
SID_NAME_USE Use;
ULONG RelativeId;
LONG DomainIndex;
}
alias LSA_TRANSLATED_SID* PLSA_TRANSLATED_SID;
struct LSA_TRANSLATED_NAME {
SID_NAME_USE Use;
LSA_UNICODE_STRING Name;
LONG DomainIndex;
}
alias LSA_TRANSLATED_NAME* PLSA_TRANSLATED_NAME;
struct MSV1_0_INTERACTIVE_LOGON {
MSV1_0_LOGON_SUBMIT_TYPE MessageType;
UNICODE_STRING LogonDomainName;
UNICODE_STRING UserName;
UNICODE_STRING Password;
}
alias MSV1_0_INTERACTIVE_LOGON* PMSV1_0_INTERACTIVE_LOGON;
struct MSV1_0_INTERACTIVE_PROFILE {
MSV1_0_PROFILE_BUFFER_TYPE MessageType;
USHORT LogonCount;
USHORT BadPasswordCount;
LARGE_INTEGER LogonTime;
LARGE_INTEGER LogoffTime;
LARGE_INTEGER KickOffTime;
LARGE_INTEGER PasswordLastSet;
LARGE_INTEGER PasswordCanChange;
LARGE_INTEGER PasswordMustChange;
UNICODE_STRING LogonScript;
UNICODE_STRING HomeDirectory;
UNICODE_STRING FullName;
UNICODE_STRING ProfilePath;
UNICODE_STRING HomeDirectoryDrive;
UNICODE_STRING LogonServer;
ULONG UserFlags;
}
alias MSV1_0_INTERACTIVE_PROFILE* PMSV1_0_INTERACTIVE_PROFILE;
struct MSV1_0_LM20_LOGON {
MSV1_0_LOGON_SUBMIT_TYPE MessageType;
UNICODE_STRING LogonDomainName;
UNICODE_STRING UserName;
UNICODE_STRING Workstation;
UCHAR[MSV1_0_CHALLENGE_LENGTH] ChallengeToClient;
STRING CaseSensitiveChallengeResponse;
STRING CaseInsensitiveChallengeResponse;
ULONG ParameterControl;
}
alias MSV1_0_LM20_LOGON* PMSV1_0_LM20_LOGON;
static if (_WIN32_WINNT_ONLY && _WIN32_WINNT >= 0x500) {
struct MSV1_0_SUBAUTH_LOGON {
MSV1_0_LOGON_SUBMIT_TYPE MessageType;
UNICODE_STRING LogonDomainName;
UNICODE_STRING UserName;
UNICODE_STRING Workstation;
UCHAR[MSV1_0_CHALLENGE_LENGTH] ChallengeToClient;
STRING AuthenticationInfo1;
STRING AuthenticationInfo2;
ULONG ParameterControl;
ULONG SubAuthPackageId;
}
alias MSV1_0_SUBAUTH_LOGON* PMSV1_0_SUBAUTH_LOGON;
}
struct MSV1_0_LM20_LOGON_PROFILE {
MSV1_0_PROFILE_BUFFER_TYPE MessageType;
LARGE_INTEGER KickOffTime;
LARGE_INTEGER LogoffTime;
ULONG UserFlags;
UCHAR[MSV1_0_USER_SESSION_KEY_LENGTH] UserSessionKey;
UNICODE_STRING LogonDomainName;
UCHAR[MSV1_0_LANMAN_SESSION_KEY_LENGTH] LanmanSessionKey;
UNICODE_STRING LogonServer;
UNICODE_STRING UserParameters;
}
alias MSV1_0_LM20_LOGON_PROFILE* PMSV1_0_LM20_LOGON_PROFILE;
struct MSV1_0_SUPPLEMENTAL_CREDENTIAL {
ULONG Version;
ULONG Flags;
UCHAR[MSV1_0_OWF_PASSWORD_LENGTH] LmPassword;
UCHAR[MSV1_0_OWF_PASSWORD_LENGTH] NtPassword;
}
alias MSV1_0_SUPPLEMENTAL_CREDENTIAL* PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
struct MSV1_0_NTLM3_RESPONSE {
UCHAR[MSV1_0_NTLM3_RESPONSE_LENGTH] Response;
UCHAR RespType;
UCHAR HiRespType;
USHORT Flags;
ULONG MsgWord;
ULONGLONG TimeStamp;
UCHAR[MSV1_0_CHALLENGE_LENGTH] ChallengeFromClient;
ULONG AvPairsOff;
UCHAR _Buffer;
UCHAR* Buffer() { return &_Buffer; }
}
alias MSV1_0_NTLM3_RESPONSE* PMSV1_0_NTLM3_RESPONSE;
struct MSV1_0_AV_PAIR {
USHORT AvId;
USHORT AvLen;
}
alias MSV1_0_AV_PAIR* PMSV1_0_AV_PAIR;
struct MSV1_0_CHANGEPASSWORD_REQUEST {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
UNICODE_STRING DomainName;
UNICODE_STRING AccountName;
UNICODE_STRING OldPassword;
UNICODE_STRING NewPassword;
BOOLEAN Impersonating;
}
alias MSV1_0_CHANGEPASSWORD_REQUEST* PMSV1_0_CHANGEPASSWORD_REQUEST;
struct MSV1_0_CHANGEPASSWORD_RESPONSE {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
BOOLEAN PasswordInfoValid;
DOMAIN_PASSWORD_INFORMATION DomainPasswordInfo;
}
alias MSV1_0_CHANGEPASSWORD_RESPONSE* PMSV1_0_CHANGEPASSWORD_RESPONSE;
struct MSV1_0_SUBAUTH_REQUEST {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG SubAuthPackageId;
ULONG SubAuthInfoLength;
PUCHAR SubAuthSubmitBuffer;
}
alias MSV1_0_SUBAUTH_REQUEST* PMSV1_0_SUBAUTH_REQUEST;
struct MSV1_0_SUBAUTH_RESPONSE {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG SubAuthInfoLength;
PUCHAR SubAuthReturnBuffer;
}
alias MSV1_0_SUBAUTH_RESPONSE* PMSV1_0_SUBAUTH_RESPONSE;
const MSV1_0_DERIVECRED_TYPE_SHA1 = 0;
struct MSV1_0_DERIVECRED_REQUEST {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
LUID LogonId;
ULONG DeriveCredType;
ULONG DeriveCredInfoLength;
UCHAR _DeriveCredSubmitBuffer;
UCHAR* DeriveCredSubmitBuffer() { return &_DeriveCredSubmitBuffer; }
}
alias MSV1_0_DERIVECRED_REQUEST* PMSV1_0_DERIVECRED_REQUEST;
struct MSV1_0_DERIVECRED_RESPONSE {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG DeriveCredInfoLength;
UCHAR _DeriveCredReturnBuffer;
UCHAR* DeriveCredReturnBuffer() { return &_DeriveCredReturnBuffer; }
}
alias MSV1_0_DERIVECRED_RESPONSE* PMSV1_0_DERIVECRED_RESPONSE;
alias uint LSA_ENUMERATION_HANDLE, LSA_OPERATIONAL_MODE,
POLICY_AUDIT_EVENT_OPTIONS;
alias uint* PLSA_ENUMERATION_HANDLE, PLSA_OPERATIONAL_MODE,
PPOLICY_AUDIT_EVENT_OPTIONS;
struct POLICY_PRIVILEGE_DEFINITION {
LSA_UNICODE_STRING Name;
LUID LocalValue;
}
alias POLICY_PRIVILEGE_DEFINITION* PPOLICY_PRIVILEGE_DEFINITION;
struct POLICY_AUDIT_LOG_INFO {
ULONG AuditLogPercentFull;
ULONG MaximumLogSize;
LARGE_INTEGER AuditRetentionPeriod;
BOOLEAN AuditLogFullShutdownInProgress;
LARGE_INTEGER TimeToShutdown;
ULONG NextAuditRecordId;
}
alias POLICY_AUDIT_LOG_INFO* PPOLICY_AUDIT_LOG_INFO;
struct POLICY_AUDIT_EVENTS_INFO {
BOOLEAN AuditingMode;
PPOLICY_AUDIT_EVENT_OPTIONS EventAuditingOptions;
ULONG MaximumAuditEventCount;
}
alias POLICY_AUDIT_EVENTS_INFO* PPOLICY_AUDIT_EVENTS_INFO;
struct POLICY_ACCOUNT_DOMAIN_INFO {
LSA_UNICODE_STRING DomainName;
PSID DomainSid;
}
alias POLICY_ACCOUNT_DOMAIN_INFO* PPOLICY_ACCOUNT_DOMAIN_INFO;
struct POLICY_PRIMARY_DOMAIN_INFO {
LSA_UNICODE_STRING Name;
PSID Sid;
}
alias POLICY_PRIMARY_DOMAIN_INFO* PPOLICY_PRIMARY_DOMAIN_INFO;
struct POLICY_DNS_DOMAIN_INFO {
LSA_UNICODE_STRING Name;
LSA_UNICODE_STRING DnsDomainName;
LSA_UNICODE_STRING DnsTreeName;
GUID DomainGuid;
PSID Sid;
}
alias POLICY_DNS_DOMAIN_INFO* PPOLICY_DNS_DOMAIN_INFO;
struct POLICY_PD_ACCOUNT_INFO {
LSA_UNICODE_STRING Name;
}
alias POLICY_PD_ACCOUNT_INFO* PPOLICY_PD_ACCOUNT_INFO;
struct POLICY_LSA_SERVER_ROLE_INFO {
POLICY_LSA_SERVER_ROLE LsaServerRole;
}
alias POLICY_LSA_SERVER_ROLE_INFO* PPOLICY_LSA_SERVER_ROLE_INFO;
struct POLICY_REPLICA_SOURCE_INFO {
LSA_UNICODE_STRING ReplicaSource;
LSA_UNICODE_STRING ReplicaAccountName;
}
alias POLICY_REPLICA_SOURCE_INFO* PPOLICY_REPLICA_SOURCE_INFO;
struct POLICY_DEFAULT_QUOTA_INFO {
QUOTA_LIMITS QuotaLimits;
}
alias POLICY_DEFAULT_QUOTA_INFO* PPOLICY_DEFAULT_QUOTA_INFO;
struct POLICY_MODIFICATION_INFO {
LARGE_INTEGER ModifiedId;
LARGE_INTEGER DatabaseCreationTime;
}
alias POLICY_MODIFICATION_INFO* PPOLICY_MODIFICATION_INFO;
struct POLICY_AUDIT_FULL_SET_INFO {
BOOLEAN ShutDownOnFull;
}
alias POLICY_AUDIT_FULL_SET_INFO* PPOLICY_AUDIT_FULL_SET_INFO;
struct POLICY_AUDIT_FULL_QUERY_INFO {
BOOLEAN ShutDownOnFull;
BOOLEAN LogIsFull;
}
alias POLICY_AUDIT_FULL_QUERY_INFO* PPOLICY_AUDIT_FULL_QUERY_INFO;
struct POLICY_EFS_INFO {
ULONG InfoLength;
PUCHAR EfsBlob;
}
alias POLICY_EFS_INFO* PPOLICY_EFS_INFO;
struct POLICY_LOCAL_IPSEC_REFERENCE_INFO {
LSA_UNICODE_STRING ObjectPath;
}
alias POLICY_LOCAL_IPSEC_REFERENCE_INFO* PPOLICY_LOCAL_IPSEC_REFERENCE_INFO;
struct POLICY_LOCAL_MACHINE_PASSWORD_INFO {
LARGE_INTEGER PasswordChangeInterval;
}
alias POLICY_LOCAL_MACHINE_PASSWORD_INFO* PPOLICY_LOCAL_MACHINE_PASSWORD_INFO;
struct POLICY_LOCAL_POLICY_LOCATION_INFO {
ULONG PolicyLocation;
}
alias POLICY_LOCAL_POLICY_LOCATION_INFO* PPOLICY_LOCAL_POLICY_LOCATION_INFO;
struct POLICY_LOCAL_QUALITY_OF_SERVICE_INFO{
ULONG QualityOfService;
}
alias POLICY_LOCAL_QUALITY_OF_SERVICE_INFO
POLICY_DOMAIN_QUALITY_OF_SERVICE_INFO;
alias POLICY_LOCAL_QUALITY_OF_SERVICE_INFO*
PPOLICY_LOCAL_QUALITY_OF_SERVICE_INFO,
PPOLICY_DOMAIN_QUALITY_OF_SERVICE_INFO;
struct POLICY_DOMAIN_PUBLIC_KEY_INFO {
ULONG InfoLength;
PUCHAR PublicKeyInfo;
}
alias POLICY_DOMAIN_PUBLIC_KEY_INFO* PPOLICY_DOMAIN_PUBLIC_KEY_INFO;
struct POLICY_DOMAIN_LOCKOUT_INFO {
LARGE_INTEGER LockoutDuration;
LARGE_INTEGER LockoutObservationWindow;
USHORT LockoutThreshold;
}
alias POLICY_DOMAIN_LOCKOUT_INFO* PPOLICY_DOMAIN_LOCKOUT_INFO;
struct POLICY_DOMAIN_PASSWORD_INFO {
USHORT MinPasswordLength;
USHORT PasswordHistoryLength;
ULONG PasswordProperties;
LARGE_INTEGER MaxPasswordAge;
LARGE_INTEGER MinPasswordAge;
}
alias POLICY_DOMAIN_PASSWORD_INFO* PPOLICY_DOMAIN_PASSWORD_INFO;
struct POLICY_DOMAIN_KERBEROS_TICKET_INFO {
ULONG AuthenticationOptions;
LARGE_INTEGER MinTicketAge;
LARGE_INTEGER MaxTicketAge;
LARGE_INTEGER MaxRenewAge;
LARGE_INTEGER ProxyLifetime;
LARGE_INTEGER ForceLogoff;
}
alias POLICY_DOMAIN_KERBEROS_TICKET_INFO* PPOLICY_DOMAIN_KERBEROS_TICKET_INFO;
alias HANDLE LSA_HANDLE;
alias HANDLE* PLSA_HANDLE;
struct TRUSTED_DOMAIN_NAME_INFO {
LSA_UNICODE_STRING Name;
}
alias TRUSTED_DOMAIN_NAME_INFO* PTRUSTED_DOMAIN_NAME_INFO;
struct TRUSTED_CONTROLLERS_INFO {
ULONG Entries;
PLSA_UNICODE_STRING Names;
}
alias TRUSTED_CONTROLLERS_INFO* PTRUSTED_CONTROLLERS_INFO;
struct TRUSTED_POSIX_OFFSET_INFO {
ULONG Offset;
}
alias TRUSTED_POSIX_OFFSET_INFO* PTRUSTED_POSIX_OFFSET_INFO;
struct TRUSTED_PASSWORD_INFO {
LSA_UNICODE_STRING Password;
LSA_UNICODE_STRING OldPassword;
}
alias TRUSTED_PASSWORD_INFO* PTRUSTED_PASSWORD_INFO;
struct TRUSTED_DOMAIN_INFORMATION_EX {
LSA_UNICODE_STRING Name;
LSA_UNICODE_STRING FlatName;
PSID Sid;
ULONG TrustDirection;
ULONG TrustType;
ULONG TrustAttributes;
}
alias TRUSTED_DOMAIN_INFORMATION_EX* PTRUSTED_DOMAIN_INFORMATION_EX;
struct LSA_AUTH_INFORMATION {
LARGE_INTEGER LastUpdateTime;
ULONG AuthType;
ULONG AuthInfoLength;
PUCHAR AuthInfo;
}
alias LSA_AUTH_INFORMATION* PLSA_AUTH_INFORMATION;
struct TRUSTED_DOMAIN_AUTH_INFORMATION {
ULONG IncomingAuthInfos;
PLSA_AUTH_INFORMATION IncomingAuthenticationInformation;
PLSA_AUTH_INFORMATION IncomingPreviousAuthenticationInformation;
ULONG OutgoingAuthInfos;
PLSA_AUTH_INFORMATION OutgoingAuthenticationInformation;
PLSA_AUTH_INFORMATION OutgoingPreviousAuthenticationInformation;
}
alias TRUSTED_DOMAIN_AUTH_INFORMATION* PTRUSTED_DOMAIN_AUTH_INFORMATION;
struct TRUSTED_DOMAIN_FULL_INFORMATION {
TRUSTED_DOMAIN_INFORMATION_EX Information;
TRUSTED_POSIX_OFFSET_INFO PosixOffset;
TRUSTED_DOMAIN_AUTH_INFORMATION AuthInformation;
}
alias TRUSTED_DOMAIN_FULL_INFORMATION* PTRUSTED_DOMAIN_FULL_INFORMATION;
extern (Windows) {
NTSTATUS LsaAddAccountRights(LSA_HANDLE, PSID, PLSA_UNICODE_STRING,
ULONG);
NTSTATUS LsaCallAuthenticationPackage(HANDLE, ULONG, PVOID, ULONG,
PVOID*, PULONG, PNTSTATUS);
NTSTATUS LsaClose(LSA_HANDLE);
NTSTATUS LsaConnectUntrusted(PHANDLE);
NTSTATUS LsaCreateTrustedDomainEx(LSA_HANDLE,
PTRUSTED_DOMAIN_INFORMATION_EX, PTRUSTED_DOMAIN_AUTH_INFORMATION,
ACCESS_MASK, PLSA_HANDLE);
NTSTATUS LsaDeleteTrustedDomain(LSA_HANDLE, PSID);
NTSTATUS LsaDeregisterLogonProcess(HANDLE);
NTSTATUS LsaEnumerateAccountRights(LSA_HANDLE, PSID, PLSA_UNICODE_STRING*,
PULONG);
NTSTATUS LsaEnumerateAccountsWithUserRight(LSA_HANDLE,
PLSA_UNICODE_STRING, PVOID*, PULONG);
NTSTATUS LsaEnumerateTrustedDomains(LSA_HANDLE, PLSA_ENUMERATION_HANDLE,
PVOID*, ULONG, PULONG);
NTSTATUS LsaEnumerateTrustedDomainsEx(LSA_HANDLE, PLSA_ENUMERATION_HANDLE,
TRUSTED_INFORMATION_CLASS, PVOID*, ULONG, PULONG);
NTSTATUS LsaFreeMemory(PVOID);
NTSTATUS LsaFreeReturnBuffer(PVOID);
NTSTATUS LsaLogonUser(HANDLE, PLSA_STRING, SECURITY_LOGON_TYPE, ULONG,
PVOID, ULONG, PTOKEN_GROUPS, PTOKEN_SOURCE, PVOID*, PULONG, PLUID,
PHANDLE, PQUOTA_LIMITS, PNTSTATUS);
NTSTATUS LsaLookupAuthenticationPackage(HANDLE, PLSA_STRING, PULONG);
NTSTATUS LsaLookupNames(LSA_HANDLE, ULONG, PLSA_UNICODE_STRING,
PLSA_REFERENCED_DOMAIN_LIST*, PLSA_TRANSLATED_SID*);
NTSTATUS LsaLookupSids(LSA_HANDLE, ULONG, PSID*,
PLSA_REFERENCED_DOMAIN_LIST*, PLSA_TRANSLATED_NAME*);
ULONG LsaNtStatusToWinError(NTSTATUS);
NTSTATUS LsaOpenPolicy(PLSA_UNICODE_STRING, PLSA_OBJECT_ATTRIBUTES,
ACCESS_MASK, PLSA_HANDLE);
NTSTATUS LsaQueryDomainInformationPolicy(LSA_HANDLE,
POLICY_DOMAIN_INFORMATION_CLASS, PVOID*);
NTSTATUS LsaQueryInformationPolicy(LSA_HANDLE, POLICY_INFORMATION_CLASS,
PVOID*);
NTSTATUS LsaQueryLocalInformationPolicy(LSA_HANDLE,
POLICY_LOCAL_INFORMATION_CLASS, PVOID*);
NTSTATUS LsaQueryTrustedDomainInfo(LSA_HANDLE, PSID,
TRUSTED_INFORMATION_CLASS, PVOID*);
NTSTATUS LsaQueryTrustedDomainInfoByName(LSA_HANDLE, PLSA_UNICODE_STRING,
TRUSTED_INFORMATION_CLASS, PVOID*);
NTSTATUS LsaRegisterLogonProcess(PLSA_STRING, PHANDLE,
PLSA_OPERATIONAL_MODE);
NTSTATUS LsaRemoveAccountRights(LSA_HANDLE, PSID, BOOLEAN,
PLSA_UNICODE_STRING, ULONG);
NTSTATUS LsaRetrievePrivateData(LSA_HANDLE, PLSA_UNICODE_STRING,
PLSA_UNICODE_STRING*);
NTSTATUS LsaSetDomainInformationPolicy(LSA_HANDLE,
POLICY_DOMAIN_INFORMATION_CLASS, PVOID);
NTSTATUS LsaSetInformationPolicy(LSA_HANDLE, POLICY_INFORMATION_CLASS,
PVOID);
NTSTATUS LsaSetLocalInformationPolicy(LSA_HANDLE,
POLICY_LOCAL_INFORMATION_CLASS, PVOID);
NTSTATUS LsaSetTrustedDomainInformation(LSA_HANDLE, PSID,
TRUSTED_INFORMATION_CLASS, PVOID);
NTSTATUS LsaSetTrustedDomainInfoByName(LSA_HANDLE, PLSA_UNICODE_STRING,
TRUSTED_INFORMATION_CLASS, PVOID);
NTSTATUS LsaStorePrivateData(LSA_HANDLE, PLSA_UNICODE_STRING,
PLSA_UNICODE_STRING);
}
alias NTSTATUS function(PUNICODE_STRING, ULONG, PUNICODE_STRING)
PSAM_PASSWORD_NOTIFICATION_ROUTINE;
alias BOOLEAN function() PSAM_INIT_NOTIFICATION_ROUTINE;
alias BOOLEAN function(PUNICODE_STRING, PUNICODE_STRING,
PUNICODE_STRING, BOOLEAN) PSAM_PASSWORD_FILTER_ROUTINE;
|
D
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkAffineWidget;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import vtkAffineRepresentation;
static import vtkAbstractWidget;
class vtkAffineWidget : vtkAbstractWidget.vtkAbstractWidget {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkAffineWidget_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkAffineWidget obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new object.Exception("C++ destructor does not have public access");
}
swigCPtr = null;
super.dispose();
}
}
}
public static vtkAffineWidget New() {
void* cPtr = vtkd_im.vtkAffineWidget_New();
vtkAffineWidget ret = (cPtr is null) ? null : new vtkAffineWidget(cPtr, false);
return ret;
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkAffineWidget_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkAffineWidget SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkAffineWidget_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkAffineWidget ret = (cPtr is null) ? null : new vtkAffineWidget(cPtr, false);
return ret;
}
public vtkAffineWidget NewInstance() const {
void* cPtr = vtkd_im.vtkAffineWidget_NewInstance(cast(void*)swigCPtr);
vtkAffineWidget ret = (cPtr is null) ? null : new vtkAffineWidget(cPtr, false);
return ret;
}
alias vtkAbstractWidget.vtkAbstractWidget.NewInstance NewInstance;
public void SetRepresentation(vtkAffineRepresentation.vtkAffineRepresentation r) {
vtkd_im.vtkAffineWidget_SetRepresentation(cast(void*)swigCPtr, vtkAffineRepresentation.vtkAffineRepresentation.swigGetCPtr(r));
}
public vtkAffineRepresentation.vtkAffineRepresentation GetAffineRepresentation() {
void* cPtr = vtkd_im.vtkAffineWidget_GetAffineRepresentation(cast(void*)swigCPtr);
vtkAffineRepresentation.vtkAffineRepresentation ret = (cPtr is null) ? null : new vtkAffineRepresentation.vtkAffineRepresentation(cPtr, false);
return ret;
}
}
|
D
|
in a widespread way
|
D
|
module dirrlicht.all;
public {
import dirrlicht;
import dirrlicht.core;
import dirrlicht.gui;
import dirrlicht.video;
import dirrlicht.scene;
import dirrlicht.io;
}
|
D
|
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/Service.build/Objects-normal/x86_64/Config.o : /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceID.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/Service.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Extendable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceType.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Config/Config.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Provider/Provider.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/Container.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/SubContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/BasicSubContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/BasicContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/ServiceError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/ContainerAlias.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/Services.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Exports.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Environment/Environment.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceFactory.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/BasicServiceFactory.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/TypeServiceFactory.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/Service.build/Objects-normal/x86_64/Config~partial.swiftmodule : /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceID.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/Service.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Extendable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceType.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Config/Config.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Provider/Provider.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/Container.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/SubContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/BasicSubContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/BasicContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/ServiceError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/ContainerAlias.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/Services.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Exports.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Environment/Environment.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceFactory.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/BasicServiceFactory.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/TypeServiceFactory.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/Service.build/Objects-normal/x86_64/Config~partial.swiftdoc : /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceID.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/Service.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Extendable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceType.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Config/Config.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Provider/Provider.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/Container.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/SubContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/BasicSubContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/BasicContainer.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/ServiceError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Container/ContainerAlias.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/Services.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Utilities/Exports.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Environment/Environment.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/ServiceFactory.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/BasicServiceFactory.swift /Users/brunodaluz/Desktop/project/.build/checkouts/service.git-2477318905239222013/Sources/Service/Services/TypeServiceFactory.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
instance DIA_NAGUR_EXIT(C_INFO)
{
npc = vlk_493_nagur;
nr = 999;
condition = dia_nagur_exit_condition;
information = dia_nagur_exit_info;
permanent = TRUE;
description = DIALOG_ENDE;
};
func int dia_nagur_exit_condition()
{
return TRUE;
};
func void dia_nagur_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_NAGUR_PICKPOCKET(C_INFO)
{
npc = vlk_493_nagur;
nr = 900;
condition = dia_nagur_pickpocket_condition;
information = dia_nagur_pickpocket_info;
permanent = TRUE;
description = PICKPOCKET_80;
};
func int dia_nagur_pickpocket_condition()
{
return c_beklauen(75,150);
};
func void dia_nagur_pickpocket_info()
{
Info_ClearChoices(dia_nagur_pickpocket);
Info_AddChoice(dia_nagur_pickpocket,DIALOG_BACK,dia_nagur_pickpocket_back);
Info_AddChoice(dia_nagur_pickpocket,DIALOG_PICKPOCKET,dia_nagur_pickpocket_doit);
};
func void dia_nagur_pickpocket_doit()
{
b_beklauen();
Info_ClearChoices(dia_nagur_pickpocket);
};
func void dia_nagur_pickpocket_back()
{
Info_ClearChoices(dia_nagur_pickpocket);
};
instance DIA_NAGUR_HALLO(C_INFO)
{
npc = vlk_493_nagur;
nr = 2;
condition = dia_nagur_hallo_condition;
information = dia_nagur_hallo_info;
permanent = TRUE;
important = TRUE;
};
func int dia_nagur_hallo_condition()
{
if(Npc_IsInState(self,zs_talk) && (DIA_KARDIF_DIEBESWERK_PERMANENT == FALSE))
{
return TRUE;
};
};
func void dia_nagur_hallo_info()
{
if(self.aivar[AIV_TALKEDTOPLAYER] == FALSE)
{
AI_Output(self,other,"DIA_Nagur_Hallo_08_00"); //Эй, у меня нет времени, чтобы болтать с тобой. Если тебе нужна информация, поговори с Кардифом.
AI_StopProcessInfos(self);
}
else
{
AI_Output(self,other,"DIA_Nagur_Hallo_08_01"); //Послушай, оставь меня в покое, хорошо?
AI_StopProcessInfos(self);
};
};
func void b_nagur_abfertigen()
{
var C_ITEM heroarmor;
heroarmor = Npc_GetEquippedArmor(other);
if((Hlp_IsItem(heroarmor,itar_mil_l) == FALSE) && (Hlp_IsItem(heroarmor,itar_mil_m) == FALSE) && (Hlp_IsItem(heroarmor,itar_pal_m) == FALSE) && (Hlp_IsItem(heroarmor,itar_pal_h) == FALSE) && (Hlp_IsItem(heroarmor,itar_nov_l) == FALSE) && (Hlp_IsItem(heroarmor,itar_kdf_l) == FALSE) && (Hlp_IsItem(heroarmor,itar_kdf_h) == FALSE))
{
AI_Output(self,other,"DIA_Nagur_Add_08_02"); //Ты думаешь, я не узнаю тебя, раз ты надел другую одежду?!
};
AI_Output(self,other,"DIA_Nagur_Add_08_03"); //(заговорщицки) Не суй нос туда, куда не следует!
AI_Output(self,other,"DIA_Nagur_Add_08_04"); //Проваливай!
MIS_NAGUR_BOTE = LOG_SUCCESS;
AI_StopProcessInfos(self);
};
instance DIA_NAGUR_JOB(C_INFO)
{
npc = vlk_493_nagur;
nr = 3;
condition = dia_nagur_job_condition;
information = dia_nagur_job_info;
permanent = FALSE;
description = "Кардиф говорит, что у тебя может быть работа для меня.";
};
func int dia_nagur_job_condition()
{
if(DIA_KARDIF_DIEBESWERK_PERMANENT == TRUE)
{
return TRUE;
};
};
func void dia_nagur_job_info()
{
AI_Output(other,self,"DIA_Nagur_Job_15_00"); //Кардиф говорит, что у тебя может быть работа для меня.
if((other.guild == GIL_NOV) || (other.guild == GIL_KDF))
{
AI_Output(self,other,"DIA_Nagur_Add_08_00"); //Здесь, в гавани НЕТ работы для людей из монастыря! (смеется)
b_nagur_abfertigen();
}
else if((other.guild == GIL_MIL) || (other.guild == GIL_PAL))
{
AI_Output(self,other,"DIA_Nagur_Add_08_01"); //Здесь, в гавани НЕТ работы для королевских солдат.
b_nagur_abfertigen();
}
else
{
AI_Output(self,other,"DIA_Nagur_Job_08_01"); //(оценивающе) Так, так... Ты ищешь особенную работу. Ладно. Но будем играть по моим правилам, понятно?
AI_Output(other,self,"DIA_Nagur_Job_15_02"); //Что это значит?
AI_Output(self,other,"DIA_Nagur_Job_08_03"); //Это значит, что ты будешь делать, что я скажу, и будешь получать треть от навара.
AI_Output(self,other,"DIA_Nagur_Job_08_04"); //Если тебя это не устраивает, то у меня нет работы для тебя.
Info_ClearChoices(dia_nagur_job);
Info_AddChoice(dia_nagur_job,"Мы партнеры. Поэтому пятьдесят на пятьдесят.",dia_nagur_job_halbe);
Info_AddChoice(dia_nagur_job,"Хорошо, ты здесь главный.",dia_nagur_job_klar);
};
};
func void dia_nagur_job_klar()
{
AI_Output(other,self,"DIA_Nagur_Job_Klar_15_00"); //Хорошо, ты здесь главный.
AI_Output(self,other,"DIA_Nagur_Job_Klar_08_01"); //Отлично. Тогда дай мне знать, когда будешь готов заработать кучу золота.
NAGUR_DEAL = 80;
Info_ClearChoices(dia_nagur_job);
};
func void dia_nagur_job_halbe()
{
AI_Output(other,self,"DIA_Nagur_Job_Halbe_15_00"); //Мы партнеры. Поэтому пятьдесят на пятьдесят.
AI_Output(self,other,"DIA_Nagur_Job_Halbe_08_01"); //Хорошо, это разумно. Конечно же, мы будем делить заработанное честно.
NAGUR_DEAL = 120;
Info_ClearChoices(dia_nagur_job);
};
instance DIA_NAGUR_AUFTRAG(C_INFO)
{
npc = vlk_493_nagur;
nr = 4;
condition = dia_nagur_auftrag_condition;
information = dia_nagur_auftrag_info;
permanent = FALSE;
description = "Договорились. Так какой у тебя план?";
};
func int dia_nagur_auftrag_condition()
{
if(Npc_KnowsInfo(other,dia_nagur_job))
{
return TRUE;
};
};
func void dia_nagur_auftrag_info()
{
AI_Output(other,self,"DIA_Nagur_Auftrag_15_00"); //Договорились. Так какой у тебя план?
AI_Output(self,other,"DIA_Nagur_Auftrag_08_01"); //Ты знаешь торговца Бальтрама, нет? Если нет, пришло время поговорить с ним.
AI_Output(self,other,"DIA_Nagur_Auftrag_08_02"); //У этого Бальтрама есть посыльный, доставлявший ему товары с фермы Акила.
AI_Output(self,other,"DIA_Nagur_Auftrag_08_03"); //Вернее у него БЫЛ посыльный, пока я не перерезал ему глотку. И теперь Бальтраму придется искать нового мальчика на побегушках. И им будешь ты.
AI_Output(self,other,"DIA_Nagur_Auftrag_08_04"); //Ты должен поступить на работу к Бальтраму и взять посылку у Акила.
AI_Output(self,other,"DIA_Nagur_Auftrag_08_05"); //Затем ты принесешь ее мне, а я продам ее заинтересованному покупателю. Он даст неплохую цену за нее.
AI_Output(self,other,"DIA_Nagur_Auftrag_08_06"); //И не пытайся продать эти товары сам. Ты все понял?
Info_ClearChoices(dia_nagur_auftrag);
Info_AddChoice(dia_nagur_auftrag,"Хорошо, договорились (КОНЕЦ)",dia_nagur_auftrag_okay);
Info_AddChoice(dia_nagur_auftrag,"Где мне найти Бальтрама?",dia_nagur_auftrag_baltram);
Info_AddChoice(dia_nagur_auftrag,"Когда мне поговорить с Бальтрамом?",dia_nagur_auftrag_wann);
Info_AddChoice(dia_nagur_auftrag,"Где ферма Акила?",dia_nagur_auftrag_akil);
Info_AddChoice(dia_nagur_auftrag,"Какой ожидается навар?",dia_nagur_auftrag_gewinn);
};
func void dia_nagur_auftrag_akil()
{
AI_Output(other,self,"DIA_Nagur_Auftrag_Akil_15_00"); //Где ферма Акила?
AI_Output(self,other,"DIA_Nagur_Auftrag_Akil_08_01"); //Выйдешь из города через восточные ворота, что находятся на рыночной площади.
AI_Output(self,other,"DIA_Nagur_Auftrag_Akil_08_02"); //Если ты пойдешь по дороге направо, вскоре увидишь лестницу, вырезанную в скале.
AI_Output(self,other,"DIA_Nagur_Auftrag_Akil_08_03"); //Поднимись по ней и окажешься на ферме Акила.
};
func void dia_nagur_auftrag_gewinn()
{
AI_Output(other,self,"DIA_Nagur_Auftrag_Gewinn_15_00"); //Какой ожидается навар?
AI_Output(self,other,"DIA_Nagur_Auftrag_Gewinn_08_01"); //Не могу сказать точно. Но, я думаю, не менее 400 монет.
};
func void dia_nagur_auftrag_baltram()
{
AI_Output(other,self,"DIA_Nagur_Auftrag_Baltram_15_00"); //Где мне найти Бальтрама?
AI_Output(self,other,"DIA_Nagur_Auftrag_Baltram_08_01"); //Его прилавок находится на рыночной площади.
};
func void dia_nagur_auftrag_wann()
{
AI_Output(other,self,"DIA_Nagur_Auftrag_Wann_15_00"); //Когда мне поговорить с Бальтрамом?
AI_Output(self,other,"DIA_Nagur_Auftrag_Wann_08_01"); //Ты можешь сделать это прямо сейчас. Он уже должен понять, что его посыльный никогда уже не появится. (грязный смех)
};
func void dia_nagur_auftrag_okay()
{
AI_Output(other,self,"DIA_Nagur_Auftrag_Okay_15_00"); //Хорошо, договорились.
AI_Output(self,other,"DIA_Nagur_Auftrag_Okay_08_01"); //Отлично. Тогда за дело - но если ты попытаешься обмануть меня, тебя будет ждать та же судьба, что и этого посыльного! Не забывай об этом!
MIS_NAGUR_BOTE = LOG_RUNNING;
Log_CreateTopic(TOPIC_NAGUR,LOG_MISSION);
Log_SetTopicStatus(TOPIC_NAGUR,LOG_RUNNING);
b_logentry(TOPIC_NAGUR,"Я должен заставить Бальтрама взять меня в качестве мальчика на побегушках. Затем я должен забрать посылку у фермера Акила и принести ее Нагуру.");
AI_StopProcessInfos(self);
};
instance DIA_NAGUR_SUCCESS(C_INFO)
{
npc = vlk_493_nagur;
nr = 5;
condition = dia_nagur_success_condition;
information = dia_nagur_success_info;
permanent = FALSE;
description = "Я принес пакет.";
};
func int dia_nagur_success_condition()
{
if((MIS_NAGUR_BOTE == LOG_RUNNING) && (Npc_HasItems(other,itmi_baltrampaket) >= 1) && (NAGUR_AUSGELIEFERT == FALSE))
{
return TRUE;
};
};
func void dia_nagur_success_info()
{
AI_Output(other,self,"DIA_Nagur_Success_15_00"); //Я принес пакет.
AI_Output(self,other,"DIA_Nagur_Success_08_01"); //Отлично. Теперь мне нужно продать его. Заходи завтра.
b_logentry(TOPIC_NAGUR,"Нагур получил посылку. Он заплатит мне золотом завтра.");
AI_StopProcessInfos(self);
if(b_giveinvitems(other,self,itmi_baltrampaket,1))
{
Npc_RemoveInvItems(self,itmi_baltrampaket,1);
};
NAGURDAY = b_getdayplus();
};
instance DIA_NAGUR_DEAL(C_INFO)
{
npc = vlk_493_nagur;
nr = 6;
condition = dia_nagur_deal_condition;
information = dia_nagur_deal_info;
permanent = TRUE;
description = "Ты уже продал товары?";
};
var int dia_nagur_deal_permanent;
func int dia_nagur_deal_condition()
{
if((DIA_NAGUR_DEAL_PERMANENT == FALSE) && (MIS_NAGUR_BOTE == LOG_RUNNING) && (NAGUR_AUSGELIEFERT == FALSE) && Npc_KnowsInfo(other,dia_nagur_success))
{
return TRUE;
};
};
func void dia_nagur_deal_info()
{
AI_Output(other,self,"DIA_Nagur_Deal_15_00"); //Ты уже продал товары?
if(b_getdayplus() > NAGURDAY)
{
AI_Output(self,other,"DIA_Nagur_Deal_08_01"); //Да, но за меньшую сумму, чем рассчитывал. Я получил только 300 монет.
AI_Output(self,other,"DIA_Nagur_Deal_08_02"); //Часть этой суммы пошла моим хозяевам...
AI_Output(self,other,"DIA_Nagur_Deal_08_03"); //И Кардиф получил свой обычный процент - плюс золото за то, что он нашел тебя.
AI_Output(self,other,"DIA_Nagur_Deal_08_04"); //Остается 240 золотых монет. Мы поделим их как договорились. Вот твоя доля.
AI_Output(self,other,"DIA_Nagur_Deal_08_05"); //Ты хорошо поработал. Я сообщил об этом моим хозяевам.
AI_Output(self,other,"DIA_Nagur_Deal_08_06"); //Что из этого выйдет - не знаю.
b_giveinvitems(self,other,itmi_gold,NAGUR_DEAL);
MIS_NAGUR_BOTE = LOG_SUCCESS;
MIS_BALTRAM_SCOUTAKIL = LOG_FAILED;
b_giveplayerxp(XP_NAGUR_BOTE);
DIA_NAGUR_DEAL_PERMANENT = TRUE;
DIEBESGILDE_OKAY = DIEBESGILDE_OKAY + 1;
AI_StopProcessInfos(self);
}
else
{
AI_Output(self,other,"DIA_Nagur_Deal_08_07"); //Пока еще нет. На это нужно время. Я не хочу продешевить.
};
};
instance DIA_NAGUR_AUFTRAGGEBER(C_INFO)
{
npc = vlk_493_nagur;
nr = 7;
condition = dia_nagur_auftraggeber_condition;
information = dia_nagur_auftraggeber_info;
permanent = FALSE;
description = "Кто твои хозяева?";
};
func int dia_nagur_auftraggeber_condition()
{
if(MIS_NAGUR_BOTE == LOG_SUCCESS)
{
return TRUE;
};
};
func void dia_nagur_auftraggeber_info()
{
AI_Output(other,self,"DIA_Nagur_Auftraggeber_15_00"); //Кто твои хозяева?
AI_Output(self,other,"DIA_Nagur_Auftraggeber_08_01"); //Ты что, действительно думаешь, что я просто так возьму и скажу тебе?
};
instance DIA_NAGUR_FAZIT(C_INFO)
{
npc = vlk_493_nagur;
nr = 7;
condition = dia_nagur_fazit_condition;
information = dia_nagur_fazit_info;
permanent = TRUE;
important = TRUE;
};
func int dia_nagur_fazit_condition()
{
if(Npc_KnowsInfo(other,dia_nagur_auftraggeber) && Npc_IsInState(self,zs_talk) && (KNOWS_SECRETSIGN == FALSE))
{
return TRUE;
};
};
func void dia_nagur_fazit_info()
{
AI_Output(self,other,"DIA_Nagur_Fazit_08_00"); //Дело прошло удачно, но я не говорю о своих хозяевах. Так что можешь расслабиться.
AI_StopProcessInfos(self);
};
instance DIA_NAGUR_KNAST(C_INFO)
{
npc = vlk_493_nagur;
nr = 7;
condition = dia_nagur_knast_condition;
information = dia_nagur_knast_info;
permanent = TRUE;
important = TRUE;
};
func int dia_nagur_knast_condition()
{
if(Npc_IsInState(self,zs_talk) && (Npc_GetDistToWP(self,"NW_CITY_HABOUR_KASERN_NAGUR") <= 1000) && (NAGUR_AUSGELIEFERT == TRUE))
{
return TRUE;
};
};
func void dia_nagur_knast_info()
{
AI_Output(self,other,"DIA_Nagur_Knast_08_00"); //Ты предал меня! Это была большая ошибка - а теперь проваливай!
AI_StopProcessInfos(self);
};
instance DIA_NAGUR_SIGN(C_INFO)
{
npc = vlk_493_nagur;
nr = 7;
condition = dia_nagur_sign_condition;
information = dia_nagur_sign_info;
permanent = FALSE;
description = "(показать сигнал воров)";
};
func int dia_nagur_sign_condition()
{
if((MIS_NAGUR_BOTE == LOG_SUCCESS) && (KNOWS_SECRETSIGN == TRUE))
{
return TRUE;
};
};
func void dia_nagur_sign_info()
{
AI_PlayAni(other,"T_YES");
AI_Output(self,other,"DIA_Nagur_Sign_08_00"); //Так тебе удалось это. Теперь ты знаешь, кто мои хозяева.
AI_Output(self,other,"DIA_Nagur_Sign_08_01"); //Не забывай о том, что Кассия говорит тебе - нам не интересно, кто ты такой. Ты один из нас, и только это имеет значение.
AI_StopProcessInfos(self);
};
instance DIA_NAGUR_PERM(C_INFO)
{
npc = vlk_493_nagur;
nr = 7;
condition = dia_nagur_perm_condition;
information = dia_nagur_perm_info;
permanent = TRUE;
important = TRUE;
};
func int dia_nagur_perm_condition()
{
if((MIS_NAGUR_BOTE == LOG_SUCCESS) && Npc_KnowsInfo(other,dia_nagur_sign) && Npc_IsInState(self,zs_talk))
{
return TRUE;
};
};
func void dia_nagur_perm_info()
{
AI_Output(self,other,"DIA_Nagur_Perm_08_00"); //Поищи кого-нибудь еще, здесь бродит много народа. А у меня больше ничего нет для тебя.
AI_StopProcessInfos(self);
};
|
D
|
/home/josh7gas/github.com/Josh7GAS/Oficina/Rust/CLI_tool_practice/subnet_calculator/target/debug/build/syn-7e2dcaf88b4185b5/build_script_build-7e2dcaf88b4185b5: /home/josh7gas/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.39/build.rs
/home/josh7gas/github.com/Josh7GAS/Oficina/Rust/CLI_tool_practice/subnet_calculator/target/debug/build/syn-7e2dcaf88b4185b5/build_script_build-7e2dcaf88b4185b5.d: /home/josh7gas/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.39/build.rs
/home/josh7gas/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.39/build.rs:
|
D
|
/Users/edward.wangcrypto.com/study/substrate_lesson_homework_template/node-template-benchmark/target/release/deps/more_asserts-c414b3da8946fa4b.rmeta: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/more-asserts-0.2.1/src/lib.rs
/Users/edward.wangcrypto.com/study/substrate_lesson_homework_template/node-template-benchmark/target/release/deps/libmore_asserts-c414b3da8946fa4b.rlib: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/more-asserts-0.2.1/src/lib.rs
/Users/edward.wangcrypto.com/study/substrate_lesson_homework_template/node-template-benchmark/target/release/deps/more_asserts-c414b3da8946fa4b.d: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/more-asserts-0.2.1/src/lib.rs
/Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/more-asserts-0.2.1/src/lib.rs:
|
D
|
/Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Marshal.build/Objects-normal/x86_64/ValueType.o : /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/JSON.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/ValueType.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/KeyType.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Marshaling.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Unmarshaling.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/UnmarshalUpdating.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Migration.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Error.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Operators.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/MarshaledObject.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/UnmarshalingWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/MarshalDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Target\ Support\ Files/Marshal/Marshal-umbrella.h /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Marshal.build/unextended-module.modulemap
/Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Marshal.build/Objects-normal/x86_64/ValueType~partial.swiftmodule : /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/JSON.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/ValueType.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/KeyType.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Marshaling.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Unmarshaling.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/UnmarshalUpdating.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Migration.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Error.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Operators.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/MarshaledObject.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/UnmarshalingWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/MarshalDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Target\ Support\ Files/Marshal/Marshal-umbrella.h /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Marshal.build/unextended-module.modulemap
/Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Marshal.build/Objects-normal/x86_64/ValueType~partial.swiftdoc : /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/JSON.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/ValueType.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/KeyType.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Marshaling.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Unmarshaling.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/UnmarshalUpdating.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Migration.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Error.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/Operators.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/MarshaledObject.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/UnmarshalingWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Marshal/Sources/MarshalDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Target\ Support\ Files/Marshal/Marshal-umbrella.h /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Marshal.build/unextended-module.modulemap
|
D
|
// Written in the D programming language.
/**
* Compress/decompress data using the $(WEB www.zlib.net, zlib library).
*
* References:
* $(WEB en.wikipedia.org/wiki/Zlib, Wikipedia)
*
* Macros:
* WIKI = Phobos/StdZlib
*
* Copyright: Copyright Digital Mars 2000 - 2011.
* License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(WEB digitalmars.com, Walter Bright)
* Source: $(PHOBOSSRC std/_zlib.d)
*/
/* Copyright Digital Mars 2000 - 2011.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module mystd.zlib;
//debug=zlib; // uncomment to turn on debugging printf's
import etc.c.zlib;
// Values for 'mode'
enum
{
Z_NO_FLUSH = 0,
Z_SYNC_FLUSH = 2,
Z_FULL_FLUSH = 3,
Z_FINISH = 4,
}
/*************************************
* Errors throw a ZlibException.
*/
class ZlibException : Exception
{
this(int errnum)
{ string msg;
switch (errnum)
{
case Z_STREAM_END: msg = "stream end"; break;
case Z_NEED_DICT: msg = "need dict"; break;
case Z_ERRNO: msg = "errno"; break;
case Z_STREAM_ERROR: msg = "stream error"; break;
case Z_DATA_ERROR: msg = "data error"; break;
case Z_MEM_ERROR: msg = "mem error"; break;
case Z_BUF_ERROR: msg = "buf error"; break;
case Z_VERSION_ERROR: msg = "version error"; break;
default: msg = "unknown error"; break;
}
super(msg);
}
}
/**
* $(P Compute the Adler-32 checksum of a buffer's worth of data.)
*
* Params:
* adler = the starting checksum for the computation. Use 0
* for a new checksum. Use the output of this function
* for a cumulative checksum.
* buf = buffer containing input data
*
* Returns:
* A $(D uint) checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Adler-32)
*/
uint adler32(uint adler, const(void)[] buf)
{
import mystd.range : chunks;
foreach(chunk; (cast(ubyte[])buf).chunks(0xFFFF0000))
{
adler = etc.c.zlib.adler32(adler, chunk.ptr, cast(uint)chunk.length);
}
return adler;
}
unittest
{
static ubyte[] data = [1,2,3,4,5,6,7,8,9,10];
uint adler;
debug(zlib) printf("D.zlib.adler32.unittest\n");
adler = adler32(0u, cast(void[])data);
debug(zlib) printf("adler = %x\n", adler);
assert(adler == 0xdc0037);
}
/**
* $(P Compute the CRC32 checksum of a buffer's worth of data.)
*
* Params:
* crc = the starting checksum for the computation. Use 0
* for a new checksum. Use the output of this function
* for a cumulative checksum.
* buf = buffer containing input data
*
* Returns:
* A $(D uint) checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Cyclic_redundancy_check)
*/
uint crc32(uint crc, const(void)[] buf)
{
import mystd.range : chunks;
foreach(chunk; (cast(ubyte[])buf).chunks(0xFFFF0000))
{
crc = etc.c.zlib.crc32(crc, chunk.ptr, cast(uint)chunk.length);
}
return crc;
}
unittest
{
static ubyte[] data = [1,2,3,4,5,6,7,8,9,10];
uint crc;
debug(zlib) printf("D.zlib.crc32.unittest\n");
crc = crc32(0u, cast(void[])data);
debug(zlib) printf("crc = %x\n", crc);
assert(crc == 0x2520577b);
}
/**
* $(P Compress data)
*
* Params:
* srcbuf = buffer containing the data to compress
* level = compression level. Legal values are 1..9, with 1 being the
* least compression and 9 being the most. The default value
* is 6.
*
* Returns:
* the compressed data
*/
const(void)[] compress(const(void)[] srcbuf, int level)
in
{
assert(-1 <= level && level <= 9);
}
body
{
auto destlen = srcbuf.length + ((srcbuf.length + 1023) / 1024) + 12;
auto destbuf = new ubyte[destlen];
auto err = etc.c.zlib.compress2(destbuf.ptr, &destlen, cast(ubyte *)srcbuf.ptr, srcbuf.length, level);
if (err)
{ delete destbuf;
throw new ZlibException(err);
}
destbuf.length = destlen;
return destbuf;
}
/*********************************************
* ditto
*/
const(void)[] compress(const(void)[] srcbuf)
{
return compress(srcbuf, Z_DEFAULT_COMPRESSION);
}
/*********************************************
* Decompresses the data in srcbuf[].
* Params:
* srcbuf = buffer containing the compressed data.
* destlen = size of the uncompressed data.
* It need not be accurate, but the decompression will be faster
* if the exact size is supplied.
* winbits = the base two logarithm of the maximum window size.
* Returns: the decompressed data.
*/
void[] uncompress(void[] srcbuf, size_t destlen = 0u, int winbits = 15)
{
import mystd.conv : to;
int err;
ubyte[] destbuf;
if (!destlen)
destlen = srcbuf.length * 2 + 1;
etc.c.zlib.z_stream zs;
zs.next_in = cast(typeof(zs.next_in)) srcbuf;
zs.avail_in = to!uint(srcbuf.length);
err = etc.c.zlib.inflateInit2(&zs, winbits);
if (err)
{
throw new ZlibException(err);
}
size_t olddestlen = 0u;
loop:
while (true)
{
destbuf.length = destlen;
zs.next_out = cast(typeof(zs.next_out)) &destbuf[olddestlen];
zs.avail_out = to!uint(destlen - olddestlen);
olddestlen = destlen;
err = etc.c.zlib.inflate(&zs, Z_NO_FLUSH);
switch (err)
{
case Z_OK:
destlen = destbuf.length * 2;
continue loop;
case Z_STREAM_END:
destbuf.length = zs.total_out;
err = etc.c.zlib.inflateEnd(&zs);
if (err != Z_OK)
throw new ZlibException(err);
return destbuf;
default:
etc.c.zlib.inflateEnd(&zs);
throw new ZlibException(err);
}
}
assert(0);
}
unittest
{
ubyte[] src = cast(ubyte[])
"the quick brown fox jumps over the lazy dog\r
the quick brown fox jumps over the lazy dog\r
";
ubyte[] dst;
ubyte[] result;
//arrayPrint(src);
dst = cast(ubyte[])compress(cast(void[])src);
//arrayPrint(dst);
result = cast(ubyte[])uncompress(cast(void[])dst);
//arrayPrint(result);
assert(result == src);
}
unittest
{
ubyte[] src = new ubyte[1000000];
ubyte[] dst;
ubyte[] result;
src[] = 0x80;
dst = cast(ubyte[])compress(cast(void[])src);
assert(dst.length*2 + 1 < src.length);
result = cast(ubyte[])uncompress(cast(void[])dst);
assert(result == src);
}
/+
void arrayPrint(ubyte[] array)
{
//printf("array %p,%d\n", cast(void*)array, array.length);
for (size_t i = 0; i < array.length; i++)
{
printf("%02x ", array[i]);
if (((i + 1) & 15) == 0)
printf("\n");
}
printf("\n\n");
}
+/
/// the header format the compressed stream is wrapped in
enum HeaderFormat {
deflate, /// a standard zlib header
gzip, /// a gzip file format header
determineFromData /// used when decompressing. Try to automatically detect the stream format by looking at the data
}
/*********************************************
* Used when the data to be compressed is not all in one buffer.
*/
class Compress
{
import mystd.conv: to;
private:
z_stream zs;
int level = Z_DEFAULT_COMPRESSION;
int inited;
immutable bool gzip;
void error(int err)
{
if (inited)
{ deflateEnd(&zs);
inited = 0;
}
throw new ZlibException(err);
}
public:
/**
* Constructor.
*
* Params:
* level = compression level. Legal values are 1..9, with 1 being the least
* compression and 9 being the most. The default value is 6.
* header = sets the compression type to one of the options available
* in $(LREF HeaderFormat). Defaults to HeaderFormat.deflate.
*
* See_Also:
* $(LREF compress), $(LREF HeaderFormat)
*/
this(int level, HeaderFormat header = HeaderFormat.deflate)
in
{
assert(1 <= level && level <= 9);
}
body
{
this.level = level;
this.gzip = header == HeaderFormat.gzip;
}
/// ditto
this(HeaderFormat header = HeaderFormat.deflate)
{
this.gzip = header == HeaderFormat.gzip;
}
~this()
{ int err;
if (inited)
{
inited = 0;
deflateEnd(&zs);
}
}
/**
* Compress the data in buf and return the compressed data.
* Params:
* buf = data to compress
*
* Returns:
* the compressed data. The buffers returned from successive calls to this should be concatenated together.
*
*/
const(void)[] compress(const(void)[] buf)
{ int err;
ubyte[] destbuf;
if (buf.length == 0)
return null;
if (!inited)
{
err = deflateInit2(&zs, level, Z_DEFLATED, 15 + (gzip ? 16 : 0), 8, Z_DEFAULT_STRATEGY);
if (err)
error(err);
inited = 1;
}
destbuf = new ubyte[zs.avail_in + buf.length];
zs.next_out = destbuf.ptr;
zs.avail_out = to!uint(destbuf.length);
if (zs.avail_in)
buf = zs.next_in[0 .. zs.avail_in] ~ cast(ubyte[]) buf;
zs.next_in = cast(typeof(zs.next_in)) buf.ptr;
zs.avail_in = to!uint(buf.length);
err = deflate(&zs, Z_NO_FLUSH);
if (err != Z_STREAM_END && err != Z_OK)
{ delete destbuf;
error(err);
}
destbuf.length = destbuf.length - zs.avail_out;
return destbuf;
}
/***
* Compress and return any remaining data.
* The returned data should be appended to that returned by compress().
* Params:
* mode = one of the following:
* $(DL
$(DT Z_SYNC_FLUSH )
$(DD Syncs up flushing to the next byte boundary.
Used when more data is to be compressed later on.)
$(DT Z_FULL_FLUSH )
$(DD Syncs up flushing to the next byte boundary.
Used when more data is to be compressed later on,
and the decompressor needs to be restartable at this
point.)
$(DT Z_FINISH)
$(DD (default) Used when finished compressing the data. )
)
*/
void[] flush(int mode = Z_FINISH)
in
{
assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH);
}
body
{
ubyte[] destbuf;
ubyte[512] tmpbuf = void;
int err;
if (!inited)
return null;
/* may be zs.avail_out+<some constant>
* zs.avail_out is set nonzero by deflate in previous compress()
*/
//tmpbuf = new void[zs.avail_out];
zs.next_out = tmpbuf.ptr;
zs.avail_out = tmpbuf.length;
while( (err = deflate(&zs, mode)) != Z_STREAM_END)
{
if (err == Z_OK)
{
if (zs.avail_out != 0 && mode != Z_FINISH)
break;
else if(zs.avail_out == 0)
{
destbuf ~= tmpbuf;
zs.next_out = tmpbuf.ptr;
zs.avail_out = tmpbuf.length;
continue;
}
err = Z_BUF_ERROR;
}
delete destbuf;
error(err);
}
destbuf ~= tmpbuf[0 .. (tmpbuf.length - zs.avail_out)];
if (mode == Z_FINISH)
{
err = deflateEnd(&zs);
inited = 0;
if (err)
error(err);
}
return destbuf;
}
}
/******
* Used when the data to be decompressed is not all in one buffer.
*/
class UnCompress
{
import mystd.conv: to;
private:
z_stream zs;
int inited;
int done;
size_t destbufsize;
HeaderFormat format;
void error(int err)
{
if (inited)
{ inflateEnd(&zs);
inited = 0;
}
throw new ZlibException(err);
}
public:
/**
* Construct. destbufsize is the same as for D.zlib.uncompress().
*/
this(uint destbufsize)
{
this.destbufsize = destbufsize;
}
/** ditto */
this(HeaderFormat format = HeaderFormat.determineFromData)
{
this.format = format;
}
~this()
{ int err;
if (inited)
{
inited = 0;
inflateEnd(&zs);
}
done = 1;
}
/**
* Decompress the data in buf and return the decompressed data.
* The buffers returned from successive calls to this should be concatenated
* together.
*/
const(void)[] uncompress(const(void)[] buf)
in
{
assert(!done);
}
body
{ int err;
ubyte[] destbuf;
if (buf.length == 0)
return null;
if (!inited)
{
int windowBits = 15;
if(format == HeaderFormat.gzip)
windowBits += 16;
else if(format == HeaderFormat.determineFromData)
windowBits += 32;
err = inflateInit2(&zs, windowBits);
if (err)
error(err);
inited = 1;
}
if (!destbufsize)
destbufsize = to!uint(buf.length) * 2;
destbuf = new ubyte[zs.avail_in * 2 + destbufsize];
zs.next_out = destbuf.ptr;
zs.avail_out = to!uint(destbuf.length);
if (zs.avail_in)
buf = zs.next_in[0 .. zs.avail_in] ~ cast(ubyte[]) buf;
zs.next_in = cast(ubyte*) buf;
zs.avail_in = to!uint(buf.length);
err = inflate(&zs, Z_NO_FLUSH);
if (err != Z_STREAM_END && err != Z_OK)
{ delete destbuf;
error(err);
}
destbuf.length = destbuf.length - zs.avail_out;
return destbuf;
}
/**
* Decompress and return any remaining data.
* The returned data should be appended to that returned by uncompress().
* The UnCompress object cannot be used further.
*/
void[] flush()
in
{
assert(!done);
}
out
{
assert(done);
}
body
{
ubyte[] extra;
ubyte[] destbuf;
int err;
done = 1;
if (!inited)
return null;
L1:
destbuf = new ubyte[zs.avail_in * 2 + 100];
zs.next_out = destbuf.ptr;
zs.avail_out = to!uint(destbuf.length);
err = etc.c.zlib.inflate(&zs, Z_NO_FLUSH);
if (err == Z_OK && zs.avail_out == 0)
{
extra ~= destbuf;
goto L1;
}
if (err != Z_STREAM_END)
{
delete destbuf;
if (err == Z_OK)
err = Z_BUF_ERROR;
error(err);
}
destbuf = destbuf.ptr[0 .. zs.next_out - destbuf.ptr];
err = etc.c.zlib.inflateEnd(&zs);
inited = 0;
if (err)
error(err);
if (extra.length)
destbuf = extra ~ destbuf;
return destbuf;
}
}
/* ========================== unittest ========================= */
private import mystd.stdio;
private import mystd.random;
unittest // by Dave
{
debug(zlib) writeln("mystd.zlib.unittest");
bool CompressThenUncompress (ubyte[] src)
{
ubyte[] dst = cast(ubyte[])mystd.zlib.compress(cast(void[])src);
double ratio = (dst.length / cast(double)src.length);
debug(zlib) writef("src.length: %1$d, dst: %2$d, Ratio = %3$f", src.length, dst.length, ratio);
ubyte[] uncompressedBuf;
uncompressedBuf = cast(ubyte[])mystd.zlib.uncompress(cast(void[])dst);
assert(src.length == uncompressedBuf.length);
assert(src == uncompressedBuf);
return true;
}
// smallish buffers
for(int idx = 0; idx < 25; idx++) {
char[] buf = new char[uniform(0, 100)];
// Alternate between more & less compressible
foreach(ref char c; buf)
c = cast(char) (' ' + (uniform(0, idx % 2 ? 91 : 2)));
if(CompressThenUncompress(cast(ubyte[])buf)) {
debug(zlib) writeln("; Success.");
} else {
return;
}
}
// larger buffers
for(int idx = 0; idx < 25; idx++) {
char[] buf = new char[uniform(0, 1000/*0000*/)];
// Alternate between more & less compressible
foreach(ref char c; buf)
c = cast(char) (' ' + (uniform(0, idx % 2 ? 91 : 10)));
if(CompressThenUncompress(cast(ubyte[])buf)) {
debug(zlib) writefln("; Success.");
} else {
return;
}
}
debug(zlib) writefln("PASSED mystd.zlib.unittest");
}
unittest // by Artem Rebrov
{
Compress cmp = new Compress;
UnCompress decmp = new UnCompress;
const(void)[] input;
input = "tesatdffadf";
const(void)[] buf = cmp.compress(input);
buf ~= cmp.flush();
const(void)[] output = decmp.uncompress(buf);
//writefln("input = '%s'", cast(char[])input);
//writefln("output = '%s'", cast(char[])output);
assert( output[] == input[] );
}
|
D
|
module VMWriter;
import std.conv;
import std.stdio;
import std.algorithm;
import std.array;
import std.file;
import std.string;
import std.path;
import std.uni;
import std.ascii;
enum SEGMENT {STATIC,THIS,CONST,LOCAL,ARG,TEMP,POINTER,THAT};
enum Commands {ADD,SUB ,NEG ,EQ, GT, LT ,AND ,OR ,NOT};
class VMWriter
{
File vmFile;
string[SEGMENT] segments;
this(string path)
{
vmFile =File(chainPath(chomp(dirName(path)),baseName(path,".jack")~".vm"),"w");
segments[SEGMENT.STATIC ]="static";
segments[SEGMENT.THIS ]="this";
segments[SEGMENT.CONST ]="constant";
segments[SEGMENT.LOCAL ]="local";
segments[SEGMENT.ARG ]="argument";
segments[SEGMENT.TEMP ]="temp";
segments[SEGMENT.POINTER]="pointer";
segments[SEGMENT.THAT ]="that";
}
void writePush(SEGMENT segment,int index)
{
vmFile.writeln("push ",segments[segment]," "~to!string(index));
}
void writePop(SEGMENT segment,int index)
{
vmFile.writeln("pop ",segments[segment]," "~to!string(index));
}
void writeArithmetic(Commands command)
{
vmFile.writeln(to!string(command).toLower());
}
void close(){
vmFile.close();
}
void writeLabel(string label)
{
vmFile.writeln("label ",label);
}
void writeGoto(string label)
{
vmFile.writeln("goto ",label);
}
void writeIf(string label)
{
vmFile.writeln("if-goto ",label);
}
void writeCall(string name,int nArgs)
{
vmFile.writeln("call ",name," "~to!string(nArgs));
}
void writeFunction(string name,int nLocals)
{
vmFile.writeln("function ",name," "~to!string(nLocals));
}
void writeReturn()
{
vmFile.writeln("return");
}
}
|
D
|
instance Mod_568_NONE_Cassia_NW (Npc_Default)
{
// ------ NSC ------
name = "Cassia";
guild = GIL_OUT;
id = 568;
voice = 16;
flags = 0;
npctype = NPCTYPE_MAIN;
//----------AIVARS--------------
aivar[AIV_DropDeadAndKill] = TRUE;
aivar[AIV_EnemyOverride] = TRUE;
// ------ Attribute ------
B_SetAttributesToChapter (self, 5);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG;
// ------ Equippte Waffen ------
EquipItem (self, ItMw_Meisterdegen);
// ------ Inventory ------
B_CreateAmbientInv (self);
CreateInvItems (self,ITKE_Thiefguildkey_Hotel_MIS,1);
CreateInvItems (self,ItKe_ThiefTreasure ,1);
// ------ visuals ------
B_SetNpcVisual (self, FEMALE, "Hum_Head_Babe", FaceBabe_N_BlackHair, BodyTexBabe_N, ITAR_VlkBabe_H);
Mdl_SetModelFatness (self,0);
Mdl_ApplyOverlayMds (self, "Humans_Babe.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 90);
// ------ TA anmelden ------
daily_routine = Rtn_Start_568;
};
FUNC VOID Rtn_Start_568()
{
TA_Read_Bookstand (07,00,23,00,"NW_CITY_KANAL_ROOM_05_02");
TA_Sleep (23,00,07,00,"NW_CITY_KANAL_ROOM_05_BED_01");
};
FUNC VOID Rtn_Schiff_568()
{
TA_Smalltalk (08,00,20,00,"SHIP_CREW_03");
TA_Smalltalk (20,00,08,00,"SHIP_CREW_03");
};
FUNC VOID Rtn_Dieb_568()
{
TA_Stand_Guarding (07,00,23,00,"NW_CITY_KANAL_ROOM_05_03");
TA_Stand_Guarding (23,00,07,00,"NW_CITY_KANAL_ROOM_05_03");
};
FUNC VOID Rtn_Tot_568()
{
TA_Stand_Guarding (07,00,23,00,"TOT");
TA_Stand_Guarding (23,00,07,00,"TOT");
};
|
D
|
import std.stdio, std.string;
T gcd(T)(T a, T b)
{
if (a == 0) return b;
return gcd(b % a, a);
}
long _totientPhi(T)(T cur, T num)
{
if (cur == num) return 0;
if (gcd(cur, num) == 1) return 1 + _totientPhi(cur + 1, num);
return _totientPhi(cur + 1, num);
}
long totientPhi(T)(T num)
{
if (num == 1) return 1;
return _totientPhi(1, num);
}
int main(string[] args)
{
assert(totientPhi!int(1) == 1);
assert(totientPhi!int(10) == 4);
return 0;
}
|
D
|
block (3) --- convert text to block letters 01/13/83
_U_s_a_g_e
block [ -c <char> ] [ -w <width> ]
_D_e_s_c_r_i_p_t_i_o_n
'Block' reads lines of text from standard input, converts
them to large block letters, and writes them on standard
output. Each character produced is 5 columns in width by 9
lines in height, with 2 blank columns between consecutive
block letters and 3 blank lines between consecutive lines of
block letters.
The character used to construct the block letters may be
specified with the "-c <char>" argument sequence; the
default character is an asterisk (*). Similarly, the length
(in regular characters) of the lines produced by 'block' may
be specified with the "-w <width>" sequence. If omitted, a
default width of 75 columns is assumed. Input lines that
will not fit on a single output line are broken into as many
consecutive lines as necessary.
Normally, 'block' ignores control characters in the input
stream. The two exceptions to this rule are NEWLINEs, which
force a new output line, and BACKSPACEs, which may be used
to produce underlined, boldfaced or other overstruck charac-
ters.
_E_x_a_m_p_l_e_s
echo "@n@n In Use" | block
cal 1981 | block -w132 >/dev/lps
_M_e_s_s_a_g_e_s
"Usage: block ..." for invalid argument syntax.
_S_e_e _A_l_s_o
banner (1)
block (3) - 1 - block (3)
|
D
|
module d_snprintf.vararg;
@nogc:
nothrow:
version (D_TypeInfo) {
alias Type = TypeInfo;
} else {
// Without TypeInfo we use an opaque hash to identify types.
alias Type = size_t;
}
struct va_list {
void*[] values;
Type[] types;
size_t current;
@nogc:
nothrow:
int opApply(int delegate(va_elem) nothrow @nogc dg) {
int result = 0;
for (size_t i = current; i < values.length; i++) {
result = dg(va_elem(values[i], types[i]));
if (result) {
break;
}
}
return result;
}
}
struct va_elem {
void* value;
Type type;
}
mixin template va_start(a...) {
ubyte[a.length * (size_t.sizeof) * 2] va_args_buffer;
va_list va_args = get_varargs(a, va_args_buffer[]);
}
pragma(inline, true) void va_end(va_list) {}
pragma(inline, true) void va_copy(ref va_list copy, ref va_list args) {
copy = args;
}
va_list get_varargs(A...)(ref A a, ubyte[] buffer) {
va_list result;
result.values = (cast(void**)buffer.ptr)[0..a.length];
result.types = (cast(Type*)buffer.ptr)[a.length..a.length * 2];
static foreach (i, t; a) {
result.values[i] = cast(void*)&t;
result.types[i] = va_get_type!(typeof(t));
}
return result;
}
static if (size_t.sizeof == 8) {
private enum TYPE_MASK = 0x0FFFFFFFFFFFFFFF;
private enum TYPE_POINTER = 0x1000000000000000;
private enum TYPE_ARRAY = 0x2000000000000000;
private enum TYPE_ENUM = 0x4000000000000000;
private enum TYPE_CLASS = 0x8000000000000000;
} else {
private enum TYPE_MASK = 0x0FFFFFFF;
private enum TYPE_POINTER = 0x10000000;
private enum TYPE_ARRAY = 0x20000000;
private enum TYPE_ENUM = 0x40000000;
private enum TYPE_CLASS = 0x80000000;
}
Type va_get_type(T)() {
version(D_TypeInfo) {
return strip_type_info(typeid(T));
} else {
import std.traits : Unqual, isPointer, OriginalType;
size_t result = 0;
alias stripped_T = Unqual!T;
static if (isPointer!(stripped_T)) {
alias actual_T = PointerTarget!stripped_T;
result |= TYPE_POINTER;
} else static if (is(stripped_T : E[], E)) {
alias actual_T = E;
result |= TYPE_ARRAY;
} else static if (is(stripped_T == enum)) {
alias actual_T = OriginalType!stripped_T;
result |= TYPE_ENUM;
} else static if (is(stripped_T == class)) {
alias actual_T = stripped_T;
result |= TYPE_CLASS;
} else {
alias actual_T = stripped_T;
}
// We just have to hope this is unique.
result |= get_type_hash!(Unqual!actual_T) & TYPE_MASK;
return result;
}
}
private template get_type_hash(T) {
// Removes const, immutabe, shared and inout
enum get_type_hash = fnv_1a_hash(T.mangleof);
}
private size_t fnv_1a_hash(string s) {
static if (size_t.sizeof == 8) {
enum fnv_prime = 0x100000001b3;
enum fnv_offset_basis = 0xcbf29ce484222000;
} else {
enum fnv_prime = 0x1000193;
enum fnv_offset_basis = 0x811c9dc5;
}
size_t hash = fnv_offset_basis;
foreach (char value; s) {
hash = hash ^ value;
hash = hash * fnv_prime;
}
return hash;
}
pragma(inline, true) T va_arg(T)(ref va_list list) {
return *(cast(T*)list.values[list.current++]);
}
pragma(inline, true) T va_peek(T)(ref va_list list) {
return *(cast(T*)list.values[list.current]);
}
pragma(inline, true) va_elem va_get_elem(ref va_list list) {
return va_elem(list.values[list.current], list.types[list.current]);
}
pragma(inline, true) va_elem va_get_elem(ref va_list list, int i) {
return va_elem(list.values[list.current + i], list.types[list.current + i]);
}
pragma(inline, true) T va_value(T)(va_elem elem) {
return *(cast(T*)elem.value);
}
pragma(inline, true) size_t va_size(va_list list) {
return list.types.length - list.current;
}
pragma(inline, true) Type va_get_type(va_list list) {
return list.types[list.current];
}
pragma(inline, true) bool va_is_enum(Type type) {
version(D_TypeInfo) {
return (cast(TypeInfo_Enum)type) !is null;
} else {
return (type & TYPE_ENUM) != 0;
}
}
pragma(inline, true) bool va_is_pointer(Type type) {
version(D_TypeInfo) {
return (cast(TypeInfo_Pointer)type) !is null;
} else {
return (type & TYPE_POINTER) != 0;
}
}
pragma(inline, true) bool va_is_class(Type type) {
version(D_TypeInfo) {
return (cast(TypeInfo_Class)type) !is null;
} else {
return (type & TYPE_CLASS) != 0;
}
}
pragma(inline, true) bool va_is_array(Type type) {
version(D_TypeInfo) {
return (cast(TypeInfo_Array)type) !is null;
} else {
return (type & TYPE_ARRAY) != 0;
}
}
pragma(inline, true) Type va_remove_enum(Type type) {
if (va_is_enum(type)) {
version(D_TypeInfo) {
return strip_type_info((cast(TypeInfo_Enum)type).base);
} else {
return type & TYPE_MASK;
}
}
return type;
}
pragma(inline, true) Type va_get_array_elem(Type type) {
assert(va_is_array(type));
version(D_TypeInfo) {
return type = strip_type_info((cast(TypeInfo_Array)type).value);
} else {
return type & TYPE_MASK;
}
}
version (D_TypeInfo) {
// Removes const, immutabe, shared and inout
TypeInfo strip_type_info(TypeInfo type) {
while ((cast(TypeInfo_Const)type) !is null) {
type = (cast(TypeInfo_Const)type).base;
}
return type;
}
}
void* get_any_pointer(ref va_list list) {
Type type = va_get_type(list);
if (va_is_pointer(type)) {
void* result = va_arg!(void*)(list);
return result;
} else if (va_is_array(type)) {
void[] result = va_arg!(void[])(list);
return result.ptr;
} else if (type is va_get_type!(size_t)) {
size_t result = va_arg!(size_t)(list);
return cast(void*)result;
} else if (va_is_class(type)) {
Object result = va_arg!(Object)(list);
return cast(void*)result;
} else {
assert(false, "Tried to read a pointer from varargs but found a different type.");
}
}
long get_any_int(ref va_list list) {
Type type = va_get_type(list);
type = va_remove_enum(type);
if (va_get_type!(byte) is type) {
return va_arg!byte(list);
} else if (va_get_type!(ubyte) is type) {
return va_arg!ubyte(list);
} else if (va_get_type!(short) is type) {
return va_arg!short(list);
} else if (va_get_type!(ushort) is type) {
return va_arg!ushort(list);
} else if (va_get_type!(int) is type) {
return va_arg!int(list);
} else if (va_get_type!(uint) is type) {
return va_arg!uint(list);
} else if (va_get_type!(long) is type) {
return va_arg!long(list);
} else if (va_get_type!(ulong) is type) {
return va_arg!ulong(list);
} else if (va_get_type!(bool) is type) {
return va_arg!bool(list) ? 1 : 0;
} else {
assert(false, "Tried to read a integer from varargs but found a different type.");
}
}
real get_any_float(ref va_list list) {
Type type = va_get_type(list);
type = va_remove_enum(type);
if (va_get_type!(float) is type) {
return va_arg!float(list);
} else if (va_get_type!(double) is type) {
return va_arg!double(list);
} else if (va_get_type!(real) is type) {
return va_arg!real(list);
} else {
assert(false, "Tried to read a floating point number from varargs but found a different type.");
}
}
// Look for string, char[] or (u)byte[]
bool has_string_like_value(ref va_list list) {
Type type = va_get_type(list);
if (va_get_type!(string) is type) {
return true;
} else if (va_is_array(type)) {
type = va_get_array_elem(type);
if (va_get_type!(char) is type || va_get_type!(byte) is type || va_get_type!(ubyte) is type) {
return true;
}
}
return false;
}
|
D
|
/*
* Hunt - A data validation for DLang based on hunt library.
*
* Copyright (C) 2015-2019, HuntLabs
*
* Website: https://www.huntlabs.net
*
* Licensed under the Apache-2.0 License.
*
*/
module hunt.validation.ConstraintValidatorContext;
import hunt.validation.Validator;
interface ConstraintValidatorContext {
/**
* return valid string
*/
string toString();
/**
* append validator
*/
ConstraintValidatorContext append(Validator);
/**
* if it is valid
*/
bool isValid();
/**
* Get all errors associated with a field
* @ the key is filed's name and the value is error message
* Note : Multiple errors for the same field will only return one
*/
string[string] messages();
}
|
D
|
#!/usr/bin/env dub
/+
dub.sdl:
name "snippet96"
dependency "dwt" path="../../../../../../"
libs \
"atk-1.0" \
"cairo" \
"dl" \
"fontconfig" \
"gdk-x11-2.0" \
"gdk_pixbuf-2.0" \
"glib-2.0" \
"gmodule-2.0" \
"gnomeui-2" \
"gnomevfs-2" \
"gobject-2.0" \
"gthread-2.0" \
"gtk-x11-2.0" \
"pango-1.0" \
"pangocairo-1.0" \
"X11" \
"Xcomposite" \
"Xcursor" \
"Xdamage" \
"Xext" \
"Xfixes" \
"Xi" \
"Xinerama" \
"Xrandr" \
"Xrender" \
"Xtst" \
platform="linux"
+/
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* yidabu at gmail dot com ( D China http://www.d-programming-language-china.org/ )
*******************************************************************************/
module org.eclipse.swt.snippets.Snippet96;
// http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java?view=co
/*
* TableCursor example snippet: navigate a table cells with arrow keys.
* Edit when user hits Return key. Exit edit mode by hitting Escape (cancels edit)
* or Return (applies edit to table).
*
* For a list of all SWT example snippets see
* http://www.eclipse.org/swt/snippets/
*/
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.custom.TableCursor;
import org.eclipse.swt.custom.ControlEditor;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseAdapter;
import java.lang.all;
version(Tango){
import tango.util.Convert;
} else { // Phobos
import std.conv;
}
void main() {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
// create a a table with 3 columns and fill with data
Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
TableColumn column1 = new TableColumn(table, SWT.NONE);
TableColumn column2 = new TableColumn(table, SWT.NONE);
TableColumn column3 = new TableColumn(table, SWT.NONE);
for (int i = 0; i < 100; i++) {
TableItem item = new TableItem(table, SWT.NONE);
item.setText(["cell " ~ to!(String)(i) ~ " 0", "cell " ~ to!(String)(i) ~ " 1", "cell " ~ to!(String)(i) ~ " 2" ]);
}
column1.pack();
column2.pack();
column3.pack();
// create a TableCursor to navigate around the table
TableCursor cursor = new TableCursor(table, SWT.NONE);
// create an editor to edit the cell when the user hits "ENTER"
// while over a cell in the table
ControlEditor editor = new ControlEditor(cursor);
editor.grabHorizontal = true;
editor.grabVertical = true;
cursor.addSelectionListener(new class SelectionAdapter {
// when the TableEditor is over a cell, select the corresponding row in
// the table
override
public void widgetSelected(SelectionEvent e) {
table.setSelection([cursor.getRow()]);
}
// when the user hits "ENTER" in the TableCursor, pop up a text editor so that
// they can change the text of the cell
override
public void widgetDefaultSelected(SelectionEvent e) {
Text text = new Text(cursor, SWT.NONE);
TableItem row = cursor.getRow();
int column = cursor.getColumn();
text.setText(row.getText(column));
text.addKeyListener(new class(text, cursor) KeyAdapter {
Text text;
TableCursor cursor;
this(Text text_, TableCursor cursor_)
{
text = text_;
cursor = cursor_;
}
override
public void keyPressed(KeyEvent e) {
// close the text editor and copy the data over
// when the user hits "ENTER"
if (e.character == SWT.CR) {
TableItem row = cursor.getRow();
int column = cursor.getColumn();
row.setText(column, text.getText());
text.dispose();
}
// close the text editor when the user hits "ESC"
if (e.character == SWT.ESC) {
text.dispose();
}
}
});
// close the text editor when the user tabs away
text.addFocusListener(new class(text) FocusAdapter {
Text text;
this(Text text_)
{
text = text_;
}
override
public void focusLost(FocusEvent e) {
text.dispose();
}
});
editor.setEditor(text);
text.setFocus();
}
});
// Hide the TableCursor when the user hits the "CTRL" or "SHIFT" key.
// This alows the user to select multiple items in the table.
cursor.addKeyListener(new class KeyAdapter {
override
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.CTRL
|| e.keyCode == SWT.SHIFT
|| (e.stateMask & SWT.CONTROL) != 0
|| (e.stateMask & SWT.SHIFT) != 0) {
cursor.setVisible(false);
}
}
});
// When the user double clicks in the TableCursor, pop up a text editor so that
// they can change the text of the cell
cursor.addMouseListener(new class MouseAdapter {
override
public void mouseDown(MouseEvent e) {
Text text = new Text(cursor, SWT.NONE);
TableItem row = cursor.getRow();
int column = cursor.getColumn();
text.setText(row.getText(column));
text.addKeyListener(new class(text, cursor) KeyAdapter {
Text text;
TableCursor cursor;
this(Text text_, TableCursor cursor_)
{
text = text_;
cursor = cursor_;
}
override
public void keyPressed(KeyEvent e) {
// close the text editor and copy the data over
// when the user hits "ENTER"
if (e.character == SWT.CR) {
TableItem row = cursor.getRow();
int column = cursor.getColumn();
row.setText(column, text.getText());
text.dispose();
}
// close the text editor when the user hits "ESC"
if (e.character == SWT.ESC) {
text.dispose();
}
}
});
// close the text editor when the user clicks away
text.addFocusListener(new class(text) FocusAdapter {
Text text;
this(Text text_)
{
text = text_;
}
override
public void focusLost(FocusEvent e) {
text.dispose();
}
});
editor.setEditor(text);
text.setFocus();
}
});
// Show the TableCursor when the user releases the "SHIFT" or "CTRL" key.
// This signals the end of the multiple selection task.
table.addKeyListener(new class KeyAdapter {
override
public void keyReleased(KeyEvent e) {
if (e.keyCode == SWT.CONTROL && (e.stateMask & SWT.SHIFT) != 0)
return;
if (e.keyCode == SWT.SHIFT && (e.stateMask & SWT.CONTROL) != 0)
return;
if (e.keyCode != SWT.CONTROL
&& (e.stateMask & SWT.CONTROL) != 0)
return;
if (e.keyCode != SWT.SHIFT && (e.stateMask & SWT.SHIFT) != 0)
return;
TableItem[] selection = table.getSelection();
TableItem row = (selection.length == 0) ? table.getItem(table.getTopIndex()) : selection[0];
table.showItem(row);
cursor.setSelection(row, 0);
cursor.setVisible(true);
cursor.setFocus();
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
|
D
|
/*
* Copyright (c) 2004-2008 Derelict Developers
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the names 'Derelict', 'DerelictGL', nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module derelict.opengl.extension.nv.texture_shader3;
private
{
import derelict.opengl.gltypes;
import derelict.opengl.gl;
import derelict.util.wrapper;
}
private bool enabled = false;
struct NVTextureShader3
{
static bool load(char[] extString)
{
if(extString.findStr("GL_NV_texture_shader3") == -1)
return false;
enabled = true;
return true;
}
static bool isEnabled()
{
return enabled;
}
}
version(DerelictGL_NoExtensionLoaders)
{
}
else
{
static this()
{
DerelictGL.registerExtensionLoader(&NVTextureShader3.load);
}
}
enum : GLenum
{
GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850,
GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851,
GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852,
GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853,
GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854,
GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855,
GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856,
GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857,
GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858,
GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859,
GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A,
GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B,
GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C,
GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D,
GL_HILO8_NV = 0x885E,
GL_SIGNED_HILO8_NV = 0x885F,
GL_FORCE_BLUE_TO_ONE_NV = 0x8860,
}
|
D
|
E: c52, c12, c25, c126, c57, c28, c34, c110, c73, c16, c77, c118, c97, c108, c47, c122, c107, c56, c129, c89, c46, c67, c96, c125, c49, c104, c6, c119, c43, c1, c99, c63, c37, c83, c124, c55, c38, c127, c102, c94, c85, c116, c134, c65.
p6(E,E)
c52,c12
c124,c119
c47,c73
c55,c63
c94,c49
c85,c99
c102,c102
c134,c6
.
p0(E,E)
c25,c126
c57,c126
c16,c77
c118,c97
c47,c122
c47,c77
c56,c28
c89,c28
c46,c97
c67,c126
c47,c96
c56,c122
c125,c77
c57,c122
c47,c28
c57,c77
c104,c77
c43,c97
c1,c97
c67,c28
c125,c96
c57,c97
c107,c77
c43,c77
c16,c28
c73,c96
c46,c77
c125,c122
c108,c97
c25,c77
c57,c96
c25,c97
c43,c126
c108,c77
c89,c122
c104,c126
c47,c97
c16,c126
c56,c97
c1,c126
c16,c97
c16,c96
c25,c122
c43,c122
c47,c126
c125,c97
c89,c96
c108,c122
c1,c96
c1,c122
c104,c96
c107,c96
c118,c126
c73,c122
c73,c97
c56,c77
c67,c77
c89,c77
c118,c28
c118,c96
c73,c28
c108,c28
c107,c126
c67,c96
c1,c28
c67,c122
c1,c77
c67,c97
.
p1(E,E)
c28,c34
c97,c129
c96,c97
c126,c37
c77,c83
c122,c38
c97,c65
.
p2(E,E)
c110,c73
c16,c43
c118,c16
c119,c89
c12,c104
c127,c56
c102,c25
c73,c125
c63,c67
c116,c57
c99,c108
.
p4(E,E)
c108,c108
c107,c107
c47,c47
c46,c46
c1,c1
c25,c25
c89,c89
c43,c43
c73,c73
c57,c57
c118,c118
c56,c56
c67,c67
.
p5(E,E)
c49,c104
c6,c47
c119,c89
c99,c108
c73,c125
c63,c67
c102,c25
c12,c104
.
|
D
|
an act passed by a legislative body
enacted by a legislative body
|
D
|
/*
* Copyright (C) 2008 by Steven Schveighoffer
* all rights reserved.
*
* Examples of how special iterators can be used.
*
* Currently only implemented for Tango.
*/
import dcollections.Iterators;
import dcollections.ArrayList;
import tango.io.Stdout;
void print(V)(Iterator!(V) s, char[] message)
{
Stdout(message ~ " [");
foreach(i; s)
Stdout(" ")(i);
Stdout(" ]").newline;
}
void print(K, V)(KeyedIterator!(K, V) s, char[] message)
{
Stdout(message ~ " [");
foreach(k, v; s)
Stdout(" ")(k)("=>")(v);
Stdout(" ]").newline;
}
void main()
{
auto x = new ArrayList!(int);
for(int i = 0; i < 10; i++)
x.add(i + 1);
print!(uint, int)(x, "original list");
//
// use a filter iterator to filter only elements you want.
//
// Prints only even elements
//
print!(int)(new FilterIterator!(int)(x, function bool(ref int i) {return i % 2 == 0;}), "only even elements");
//
// use a transform iterator to change elements as they are iterated.
//
// Changes all elements to floating point, multiplied by 1.5
//
print!(float)(new TransformIterator!(float, int)(x, function void(ref int i, ref float result) {result = i * 1.5;}), "multiplied by 1.5");
//
// use a chain iterator to chain multiple iterators together
//
// print x three times
print!(int)(new ChainIterator!(int)(x, x, x), "prints elements 3 times");
//
// this function can convert any iterator to an array. You can also do
// this by adding the iterator to an ArrayList, and then calling asArray,
// but this version does not create an extra class on the heap, and is
// more optimized.
//
auto a = toArray!(int)(x);
Stdout("converted to an array: ")(a).newline;
//
// one can use the keyed transform iterator to transform keyed iterators
// to normal iterators
//
print!(long)(new TransformKeyedIterator!(int, long, uint, int)(x, function void(ref uint idx, ref int v, ref int ignored, ref long result){ result = 0x1_0000_0000L * idx + v;}), "indexes and values combined");
//
// chained keyed iterator
//
print!(uint, int)(new ChainKeyedIterator!(uint, int)(x, x, x), "prints elements 3 times (keyed)");
//
// keyed filter iterators
//
print!(uint, int)(new FilterKeyedIterator!(uint, int)(x, function bool(ref uint idx, ref int v){return idx % 2 == 0;}), "prints values at even indexes");
//
// add all elements to an AA
//
Stdout("converted to an AA: ")(toAA!(uint, int)(x)).newline;
}
|
D
|
module UnrealScript.UTGame.UTAvoidMarker;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.Actor;
extern(C++) interface UTAvoidMarker : Actor
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class UTGame.UTAvoidMarker")); }
private static __gshared UTAvoidMarker mDefaultProperties;
@property final static UTAvoidMarker DefaultProperties() { mixin(MGDPC("UTAvoidMarker", "UTAvoidMarker UTGame.Default__UTAvoidMarker")); }
static struct Functions
{
private static __gshared ScriptFunction mTouch;
public @property static final ScriptFunction Touch() { mixin(MGF("mTouch", "Function UTGame.UTAvoidMarker.Touch")); }
}
// ERROR: Unsupported object class 'ComponentProperty' for the property named 'CollisionCylinder'!
final void Touch(Actor Other,
// ERROR: Unknown object class 'Class Core.ComponentProperty'!
void* OtherComp, Vector HitLocation, Vector HitNormal)
{
ubyte params[32];
params[] = 0;
*cast(Actor*)params.ptr = Other;
*cast(
// ERROR: Unknown object class 'Class Core.ComponentProperty'!
void**)¶ms[4] = OtherComp;
*cast(Vector*)¶ms[8] = HitLocation;
*cast(Vector*)¶ms[20] = HitNormal;
(cast(ScriptObject)this).ProcessEvent(Functions.Touch, params.ptr, cast(void*)0);
}
}
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE
238 77 6 77 15 60 64.5999985 -127.900002 1745 11.6000004 11.8000002 0.0444444444 sediments, redbeds
219.300003 68.9000015 2.79999995 90.9000015 15 60 64.5 -128.5 343 5.5999999 5.5999999 0.0444444444 sediments, redbeds
256.399994 77.0999985 13 0 2 56 46 -112 3368 21.7000008 21.7000008 0.037037037 extrusives, intrusives
164 83 5.80000019 32.2000008 15 65 58.5 -119.300003 7737 10 10 0.04 sediments, dolomite
240 82 34 55 2 65 45 -110 2808 49 58 0.0317460317 intrusives, porphyry
83.5 79.8000031 17.2000008 8.80000019 15 17 30.7000008 -84.9000015 6882 11.8000002 20.2000008 1 sediments
275.5 83.5999985 0 0 0 20 46.7999992 -90.6999969 5904 3.4000001 3.4000001 0.1 sediments
45.2999992 81.0999985 12.8999996 51.9000015 14 17 45.2999992 -110.800003 5975 13.5 18.6000004 0.666666667 sediments
|
D
|
datapath=/home/torobo/catkin_ws/src/reaching_task/scripts/data/dataset/large/AC
modelpath=/home/torobo/catkin_ws/src/reaching_task/scripts/data/model/large/AC/W_0_05
activejoints=1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0
nsamples=1,1
w=0.05,0.05
d=40,10
z=4,1
t=2,10
epochs=25000
alpha=0.001
beta1=0.9
beta2=0.999
retrain=false
greedy=false
dsoft=10
sigma=0.2
|
D
|
module sema.name_resolve;
import std.conv;
import std.stdio;
import logger;
import ast;
import sema.visitor;
import sema.analyzer;
import sema.symbol;
import diag.engine;
import sema.type;
import krug_module;
import tok;
import compiler_error;
immutable bool NAME_RESOLVE_DEBUG = false;
class Name_Resolve_Pass : Top_Level_Node_Visitor, Semantic_Pass {
Module mod;
Symbol_Value find_symbol_in_stab(Symbol_Table t, string name) {
for (Symbol_Table s = t; s !is null; s = s.outer) {
static if (NAME_RESOLVE_DEBUG) {
this.log(Log_Level.Verbose, "LOOKING FOR ", name, " in:");
s.dump_values();
}
if (name in s.symbols) {
auto val = s.symbols[name];
static if (NAME_RESOLVE_DEBUG) {
this.log(Log_Level.Verbose, "LOCATED SYMBOL ", name, " . ", to!string(val));
}
return val;
}
}
return null;
}
override void analyze_named_type_node(ast.Named_Type_Node node) {
}
override void analyze_var_stat_node(ast.Variable_Statement_Node var) {
if (var.value !is null) {
analyze_expr(var.value);
}
}
override void analyze_function_node(ast.Function_Node node) {
// some functions have no body!
// these are prototype functions
if (node.func_body !is null) {
visit_block(node.func_body);
}
}
Symbol_Table resolve_type_path(ast.Type_Path_Node type_path) {
Symbol_Table last = curr_sym_table;
foreach (i, p; type_path.values) {
string sym_name = p.lexeme;
Symbol_Value found_sym = find_symbol_in_stab(last, sym_name);
if (found_sym is null) {
Diagnostic_Engine.throw_error(compiler_error.UNRESOLVED_SYMBOL, new Absolute_Token(p));
return null;
}
if (auto stab = cast(Symbol_Table) found_sym) {
last = stab;
}
else if (i != type_path.values.length - 1) {
Token next_tok = type_path.values[i + 1];
// it's not a symbol table so there is no more
// places for us to search and we still have
// iterations left i.e. things to resolve.
// throw an unresolved error
Diagnostic_Engine.throw_error(compiler_error.UNRESOLVED_SYMBOL, new Absolute_Token(next_tok));
assert(0);
}
}
return last;
}
Symbol_Table resolve_tuple(ast.Tuple_Type_Node tuple) {
auto table = new Symbol_Table;
foreach (idx, t; tuple.types) {
table.register_sym(new Symbol(t, to!string(idx), true));
}
return table;
}
Symbol_Table resolve_type(ast.Type_Node t) {
if (auto type_path = cast(Type_Path_Node) t) {
return resolve_type_path(type_path);
}
else if (auto ptr = cast(Pointer_Type_Node) t) {
return resolve_type(ptr.base_type);
}
else if (auto tuple = cast(Tuple_Type_Node) t) {
return resolve_tuple(tuple);
}
// TODO structure type node
else if (auto prim = cast(Primitive_Type_Node) t) {
// all dandy.
// (the parser should have caught this)
return null;
}
if (t is null) {
assert(0, "oh dear");
}
this.log(Log_Level.Error, "unhandled type node ", to!string(t), to!string(typeid(t)));
return null;
}
Symbol_Table resolve_via(Symbol_Value s) {
if (s.reference is null) {
this.log(Log_Level.Error, "Symbol '", to!string(s), "' has no reference to an AST node, can't resolve it to a symbol table!");
return null;
}
if (auto var = cast(ast.Variable_Statement_Node) s.reference) {
return resolve_type(var.type);
}
else if (auto field = cast(ast.Structure_Field) s.reference) {
return resolve_type(field.type);
}
else if (auto param = cast(ast.Function_Parameter) s.reference) {
return resolve_type(param.type);
}
logger.verbose(to!string(s.reference), " has not been handled in resolve_via!");
return null;
}
Symbol_Node unwrap_sym(ast.Expression_Node e) {
if (auto sym = cast(ast.Symbol_Node) e) {
return sym;
}
else if (auto path = cast(ast.Path_Expression_Node) e) {
return unwrap_sym(path.values[$-1]);
}
else if (auto call = cast(ast.Call_Node) e) {
return unwrap_sym(call.left);
}
else if (auto integer = cast(ast.Integer_Constant_Node) e) {
// NOTE this is a hack for tuples. we basically
// wrap the number as a symbol node and since
// a tuple type registers it's fields as the index
// e.g. 0, 1, 2, 3
// this should resolve properly!
return new Symbol_Node(integer.tok);
}
else {
logger.fatal(logger.blame_token(e.get_tok_info()), "unwrap_sym: unhandled expr ", to!string(typeid(e)));
assert(0);
}
}
// looks for the right hand in the module specified on
// the left hand.
void analyze_module_access(ast.Module_Access_Node man) {
const auto name = man.left.value.lexeme;
if (name !in mod.edges) {
Diagnostic_Engine.throw_error(compiler_error.UNRESOLVED_SYMBOL, man.left.get_tok_info);
return;
}
auto other_mod = mod.edges[name];
// we have to manually resolve the left
// we already know what is it though its
// simply the modules symbol table.
man.left.resolved_symbol = other_mod.sym_tables;
look_expr_via(other_mod.sym_tables, man.right);
}
Symbol_Table look_expr_via(Symbol_Table table, Expression_Node[] values...) {
Symbol_Table last = table;
foreach (ref i, e; values) {
// TODO wriet a note here
// about how tuples work.
auto sym = unwrap_sym(e);
if (!sym) {
// what do we do here?
logger.fatal(logger.blame_token(e.get_tok_info()), "not a symbol_node?!", to!string(typeid(e)));
continue;
}
Symbol_Value found_sym = find_symbol_in_stab(last, sym.value.lexeme);
if (found_sym is null) {
Diagnostic_Engine.throw_error(compiler_error.UNRESOLVED_SYMBOL, sym.get_tok_info());
return null;
}
e.resolved_symbol = found_sym;
if (auto stab = cast(Symbol_Table) found_sym) {
last = stab;
}
else if (i != values.length - 1) {
// let's try resolve it TO a symbol table, for example.
// let felix Person
// let blah = felix.age;
// felix wont be a STAB, but Person is
last = resolve_via(found_sym);
if (last !is null) {
// we found a symbol table
// let's continue resolving
continue;
}
Token next_tok = null;
if (auto next_sym = cast(Symbol_Node) values[i + 1]) {
next_tok = next_sym.value;
}
else {
next_tok = sym.value;
}
// it's not a symbol table so there is no more
// places for us to search and we still have
// iterations left i.e. thinks to resolve.
// throw an unresolved error
Diagnostic_Engine.throw_error(compiler_error.UNRESOLVED_SYMBOL, new Absolute_Token(next_tok));
return null;
}
}
return last;
}
void analyze_path_expr(ast.Path_Expression_Node path) {
// if we made it all the way here, our node has been resolved
// nicely. we're going to give the node a link to the symbol table
// it was resolved to
path.resolved_to = look_expr_via(curr_sym_table, path.values);
}
void analyze_unary_unary(ast.Unary_Expression_Node unary) {
analyze_expr(unary.value);
}
// TODO these are resolved via the rhand of the node
// so for example
// let { foo, bar, baz } = blah;
// we look for foo bar and baz in the right hand
// blah symbol tables.
void resolve_structure_destructure(ast.Structure_Destructuring_Statement_Node stat) {
// TODO
analyze_expr(stat.rhand);
}
void analyze_lambda(ast.Lambda_Node lambda) {
visit_block(lambda.block);
assert(0);
}
void analyze_expr(ast.Expression_Node expr) {
if (auto binary = cast(ast.Binary_Expression_Node) expr) {
analyze_binary_expr(binary);
}
else if (auto paren = cast(ast.Paren_Expression_Node) expr) {
analyze_expr(paren.value);
}
else if (auto path = cast(ast.Path_Expression_Node) expr) {
analyze_path_expr(path);
}
else if (auto man = cast(ast.Module_Access_Node) expr) {
analyze_module_access(man);
}
else if (auto call = cast(ast.Call_Node) expr) {
analyze_call(call);
}
else if (auto unary = cast(ast.Unary_Expression_Node) expr) {
analyze_unary_unary(unary);
}
else if (auto c = cast(ast.Cast_Expression_Node) expr) {
resolve_type(c.type);
analyze_expr(c.left);
}
else if (cast(ast.Integer_Constant_Node) expr) {
// NOOP
}
else if (cast(ast.Float_Constant_Node) expr) {
// NOOP
}
else if (cast(ast.String_Constant_Node) expr) {
// NOOP
}
else if (cast(ast.Boolean_Constant_Node) expr) {
// NOP
}
else if (cast(ast.Rune_Constant_Node) expr) {
// NOP
}
else if (auto lambda = cast(ast.Lambda_Node) expr) {
analyze_lambda(lambda);
}
else if (auto index = cast(ast.Index_Expression_Node) expr) {
analyze_expr(index.array);
analyze_expr(index.index);
}
else {
this.log(Log_Level.Error, "name_resolve: unhandled node " ~ to!string(expr) ~ "..." ~ to!string(typeid(expr)),
"\n", logger.blame_token(expr.get_tok_info()));
}
}
void analyze_binary_expr(ast.Binary_Expression_Node binary) {
if (binary.operand.lexeme == "as") {
analyze_expr(binary.left);
// TODO make sure that the right hand
// side is a valid type.
return;
}
analyze_expr(binary.left);
analyze_expr(binary.right);
}
void analyze_while_stat(ast.While_Statement_Node while_loop) {
analyze_expr(while_loop.condition);
visit_block(while_loop.block);
}
void analyze_for_stat(ast.For_Statement_Node for_loop) {
analyze_expr(for_loop.condition);
analyze_expr(for_loop.step);
visit_block(for_loop.block);
}
void analyze_loop_stat(ast.Loop_Statement_Node loop) {
visit_block(loop.block);
}
void analyze_if_stat(ast.If_Statement_Node if_stat) {
analyze_expr(if_stat.condition);
visit_block(if_stat.block);
foreach (ref idx, elif; if_stat.else_ifs) {
analyze_else_if_stat(elif);
}
if (if_stat.else_stat !is null) {
analyze_else_stat(if_stat.else_stat);
}
}
void analyze_else_stat(ast.Else_Statement_Node else_stat) {
visit_block(else_stat.block);
}
void analyze_else_if_stat(ast.Else_If_Statement_Node else_if_stat) {
analyze_expr(else_if_stat.condition);
visit_block(else_if_stat.block);
}
void analyze_call(ast.Call_Node call) {
analyze_expr(call.left);
foreach (a; call.args) {
analyze_expr(a);
}
}
void resolve_match(ast.Switch_Statement_Node match) {
analyze_expr(match.condition);
// TODO scope etc.
foreach (a; match.arms) {
foreach (v; a.expressions) {
analyze_expr(v);
}
visit_block(a.block);
}
}
override void visit_stat(ast.Statement_Node stat) {
if (auto variable = cast(ast.Variable_Statement_Node) stat) {
analyze_var_stat_node(variable);
}
else if (auto expr = cast(ast.Expression_Node) stat) {
analyze_expr(expr);
}
else if (auto while_loop = cast(ast.While_Statement_Node) stat) {
analyze_while_stat(while_loop);
}
else if (auto for_loop = cast(ast.For_Statement_Node) stat) {
analyze_for_stat(for_loop);
}
else if (auto loop = cast(ast.Loop_Statement_Node) stat) {
analyze_loop_stat(loop);
}
else if (auto if_stat = cast(ast.If_Statement_Node) stat) {
analyze_if_stat(if_stat);
}
else if (auto call = cast(ast.Call_Node) stat) {
analyze_call(call);
}
else if (auto ret = cast(ast.Return_Statement_Node) stat) {
if (ret.value !is null) {
analyze_expr(ret.value);
}
}
else if (auto match = cast(ast.Switch_Statement_Node) stat) {
resolve_match(match);
}
else if (auto structure_destructure = cast(ast.Structure_Destructuring_Statement_Node) stat) {
resolve_structure_destructure(structure_destructure);
}
else if (auto eval = cast(ast.Block_Expression_Node) stat) {
// TODO NOP
}
else if (auto next = cast(ast.Next_Statement_Node) stat) {
// NOP
}
else if (auto brk = cast(ast.Break_Statement_Node) stat) {
// NOP
}
else if (auto defer = cast(ast.Defer_Statement_Node) stat) {
visit_stat(defer.stat);
}
else if (cast(ast.Else_Statement_Node) stat) {
assert(0);
}
else if (cast(ast.Else_If_Statement_Node) stat) {
assert(0);
}
else if (auto block = cast(ast.Block_Node) stat) {
// TODO
// i feel like this is not supposed to be here
visit_block(block);
}
else {
this.log(Log_Level.Error, "unhandled statement " ~ to!string(stat), " ... ", to!string(typeid(stat)),
"\n", logger.blame_token(stat.get_tok_info()));
}
}
override void execute(ref Module mod, string sub_mod_name, AST as_tree) {
this.mod = mod;
foreach (node; as_tree) {
if (node !is null) {
super.process_node(node);
}
}
}
override string toString() const {
return "name-resolve-pass";
}
}
|
D
|
void main() {
import std.stdio;
enum width = 512, height = 512;
auto f = File("xor_pattern.ppm", "wb");
f.writefln("P6\n%d %d\n255", width, height);
foreach (immutable y; 0 .. height)
foreach (immutable x; 0 .. width) {
immutable c = (x ^ y) & ubyte.max;
immutable ubyte[3] u3 = [255 - c, c / 2, c];
f.rawWrite(u3);
}
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.TreeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.gtk.OS;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.ImageList;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Decorations;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.TypedListener;
import java.lang.all;
/**
* Instances of this class provide a selectable user interface object
* that displays a hierarchy of items and issues notification when an
* item in the hierarchy is selected.
* <p>
* The item children that may be added to instances of this class
* must be of type <code>TreeItem</code>.
* </p><p>
* Style <code>VIRTUAL</code> is used to create a <code>Tree</code> whose
* <code>TreeItem</code>s are to be populated by the client on an on-demand basis
* instead of up-front. This can provide significant performance improvements for
* trees that are very large or for which <code>TreeItem</code> population is
* expensive (for example, retrieving values from an external source).
* </p><p>
* Here is an example of using a <code>Tree</code> with style <code>VIRTUAL</code>:
* <code><pre>
* final Tree tree = new Tree(parent, SWT.VIRTUAL | SWT.BORDER);
* tree.setItemCount(20);
* tree.addListener(SWT.SetData, new Listener() {
* public void handleEvent(Event event) {
* TreeItem item = (TreeItem)event.item;
* TreeItem parentItem = item.getParentItem();
* String text = null;
* if (parentItem is null) {
* text = "node " + tree.indexOf(item);
* } else {
* text = parentItem.getText() + " - " + parentItem.indexOf(item);
* }
* item.setText(text);
* System.out.println(text);
* item.setItemCount(10);
* }
* });
* </pre></code>
* </p><p>
* Note that although this class is a subclass of <code>Composite</code>,
* it does not normally make sense to add <code>Control</code> children to
* it, or set a layout on it, unless implementing something like a cell
* editor.
* </p><p>
* <dl>
* <dt><b>Styles:</b></dt>
* <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, VIRTUAL, NO_SCROLL</dd>
* <dt><b>Events:</b></dt>
* <dd>Selection, DefaultSelection, Collapse, Expand, SetData, MeasureItem, EraseItem, PaintItem</dd>
* </dl>
* </p><p>
* Note: Only one of the styles SINGLE and MULTI may be specified.
* </p><p>
* IMPORTANT: This class is <em>not</em> intended to be subclassed.
* </p>
*
* @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a>
* @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public class Tree : Composite {
alias Composite.computeSize computeSize;
alias Composite.createHandle createHandle;
alias Composite.dragDetect dragDetect;
alias Composite.mnemonicHit mnemonicHit;
alias Composite.mnemonicMatch mnemonicMatch;
alias Composite.setBackgroundColor setBackgroundColor;
alias Composite.setBounds setBounds;
CallbackData treeSelectionCallbackData;
GtkTreeStore* modelHandle;
GtkCellRenderer* checkRenderer;
int columnCount, sortDirection;
GtkWidget* ignoreCell;
TreeItem[] items;
TreeColumn [] columns;
TreeColumn sortColumn;
TreeItem currentItem;
ImageList imageList, headerImageList;
bool firstCustomDraw;
bool modelChanged;
bool expandAll;
int drawState, drawFlags;
GdkColor* drawForeground;
bool ownerDraw, ignoreSize;
static const int ID_COLUMN = 0;
static const int CHECKED_COLUMN = 1;
static const int GRAYED_COLUMN = 2;
static const int FOREGROUND_COLUMN = 3;
static const int BACKGROUND_COLUMN = 4;
static const int FONT_COLUMN = 5;
static const int FIRST_COLUMN = FONT_COLUMN + 1;
static const int CELL_PIXBUF = 0;
static const int CELL_TEXT = 1;
static const int CELL_FOREGROUND = 2;
static const int CELL_BACKGROUND = 3;
static const int CELL_FONT = 4;
static const int CELL_TYPES = CELL_FONT + 1;
/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
* class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
* Style bits are also inherited from superclasses.
* </p>
*
* @param parent a composite control which will be the parent of the new instance (cannot be null)
* @param style the style of control to construct
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
* <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
* </ul>
*
* @see SWT#SINGLE
* @see SWT#MULTI
* @see SWT#CHECK
* @see SWT#FULL_SELECTION
* @see SWT#VIRTUAL
* @see SWT#NO_SCROLL
* @see Widget#checkSubclass
* @see Widget#getStyle
*/
public this (Composite parent, int style) {
super (parent, checkStyle (style));
}
override void _addListener (int eventType, Listener listener) {
super._addListener (eventType, listener);
if (!ownerDraw) {
switch (eventType) {
case SWT.MeasureItem:
case SWT.EraseItem:
case SWT.PaintItem:
ownerDraw = true;
recreateRenderers ();
break;
default:
}
}
}
TreeItem _getItem (GtkTreeIter* iter) {
int id = getId (iter, true);
if (items [id] !is null) return items [id];
auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
int depth = OS.gtk_tree_path_get_depth (path);
int [] indices = new int [depth];
indices[] = OS.gtk_tree_path_get_indices (path)[ 0 .. depth ];
GtkTreeIter* parentIter;
GtkTreeIter parentIterInst;
if (depth > 1) {
OS.gtk_tree_path_up (path);
parentIter = &parentIterInst;
OS.gtk_tree_model_get_iter (modelHandle, parentIter, path);
}
items [id] = new TreeItem (this, parentIter, SWT.NONE, indices [indices.length -1], false);
OS.gtk_tree_path_free (path);
return items [id];
}
TreeItem _getItem (GtkTreeIter* parentIter, int index) {
GtkTreeIter iter;
OS.gtk_tree_model_iter_nth_child(modelHandle, &iter, parentIter, index);
int id = getId (&iter, true);
if (items [id] !is null) return items [id];
return items [id] = new TreeItem (this, parentIter, SWT.NONE, index, false);
}
int getId (GtkTreeIter* iter, bool queryModel) {
if (queryModel) {
int value;
OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&value);
if (value !is -1) return value ;
}
// find next available id
int id = 0;
while (id < items.length && items [id] !is null) id++;
if (id is items.length) {
TreeItem [] newItems = new TreeItem [items.length + 4];
System.arraycopy (items, 0, newItems, 0, items.length);
items = newItems;
}
OS.gtk_tree_store_set1 (modelHandle, iter, ID_COLUMN, cast(void*)id );
return id;
}
static int checkStyle (int style) {
/*
* Feature in Windows. Even when WS_HSCROLL or
* WS_VSCROLL is not specified, Windows creates
* trees and tables with scroll bars. The fix
* is to set H_SCROLL and V_SCROLL.
*
* NOTE: This code appears on all platforms so that
* applications have consistent scroll bar behavior.
*/
if ((style & SWT.NO_SCROLL) is 0) {
style |= SWT.H_SCROLL | SWT.V_SCROLL;
}
/* GTK is always FULL_SELECTION */
style |= SWT.FULL_SELECTION;
return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
}
override void cellDataProc (
GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
void* data)
{
if (cell is cast(GtkCellRenderer*)ignoreCell) return;
TreeItem item = _getItem (iter);
if (item !is null) OS.g_object_set_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2, item.handle);
bool isPixbuf = OS.GTK_IS_CELL_RENDERER_PIXBUF (cell);
if (!(isPixbuf || OS.GTK_IS_CELL_RENDERER_TEXT (cell))) return;
int modelIndex = -1;
bool customDraw = false;
if (columnCount is 0) {
modelIndex = Tree.FIRST_COLUMN;
customDraw = firstCustomDraw;
} else {
TreeColumn column = cast(TreeColumn) display.getWidget (cast(GtkWidget*)tree_column);
if (column !is null) {
modelIndex = column.modelIndex;
customDraw = column.customDraw;
}
}
if (modelIndex is -1) return;
bool setData = false;
if ((style & SWT.VIRTUAL) !is 0) {
/*
* Feature in GTK. On GTK before 2.4, fixed_height_mode is not
* supported, and the tree asks for the data of all items. The
* fix is to only provide the data if the row is visible.
*/
if (OS.GTK_VERSION < OS.buildVERSION (2, 3, 2)) {
auto path = OS.gtk_tree_model_get_path (tree_model, iter);
OS.gtk_widget_realize (handle);
GdkRectangle visible;
OS.gtk_tree_view_get_visible_rect (handle, &visible);
GdkRectangle area;
OS.gtk_tree_view_get_cell_area (handle, path, tree_column, &area);
OS.gtk_tree_path_free (path);
if (area.y + area.height < 0 || area.y + visible.y > visible.y + visible.height ) {
/* Give an image from the image list to make sure the row has
* the correct height.
*/
if (imageList !is null && imageList.pixbufs.length > 0) {
if (isPixbuf) OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)imageList.pixbufs [0]);
}
return;
}
}
if (!item.cached) {
//lastIndexOf = index [0];
setData = checkData (item);
}
}
void* ptr;
if (setData) {
if (isPixbuf) {
ptr = null;
OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_PIXBUF, &ptr);
OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)ptr);
} else {
ptr = null;
OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_TEXT, &ptr);
if (ptr !is null) {
OS.g_object_set1 (cell, OS.text.ptr, cast(int)ptr);
OS.g_free (ptr);
}
}
}
if (customDraw) {
/*
* Bug on GTK. Gtk renders the background on top of the checkbox and pixbuf.
* This only happens in version 2.2.1 and earlier. The fix is not to set the background.
*/
if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
if (!ownerDraw) {
ptr = null;
OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_BACKGROUND, &ptr);
if (ptr !is null) {
OS.g_object_set1 (cell, OS.cell_background_gdk.ptr, cast(int)ptr);
}
}
}
if (!isPixbuf) {
ptr = null;
OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_FOREGROUND, &ptr);
if (ptr !is null) {
OS.g_object_set1 (cell, OS.foreground_gdk.ptr, cast(int)ptr);
}
ptr = null;
OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_FONT, &ptr);
if (ptr !is null) {
OS.g_object_set1 (cell, OS.font_desc.ptr, cast(int)ptr);
}
}
}
if (setData) {
ignoreCell = cast(GtkWidget*)cell;
setScrollWidth (tree_column, item);
ignoreCell = null;
}
}
bool checkData (TreeItem item) {
if (item.cached) return true;
if ((style & SWT.VIRTUAL) !is 0) {
item.cached = true;
TreeItem parentItem = item.getParentItem ();
Event event = new Event ();
event.item = item;
event.index = parentItem is null ? indexOf (item) : parentItem.indexOf (item);
int mask = OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
int signal_id = OS.g_signal_lookup (OS.row_changed.ptr, OS.gtk_tree_model_get_type ());
OS.g_signal_handlers_block_matched (modelHandle, mask, signal_id, 0, null, null, handle);
currentItem = item;
sendEvent (SWT.SetData, event);
currentItem = null;
//widget could be disposed at this point
if (isDisposed ()) return false;
OS.g_signal_handlers_unblock_matched (modelHandle, mask, signal_id, 0, null, null, handle);
if (item.isDisposed ()) return false;
}
return true;
}
protected override void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
/**
* Adds the listener to the collection of listeners who will
* be notified when the user changes the receiver's selection, by sending
* it one of the messages defined in the <code>SelectionListener</code>
* interface.
* <p>
* When <code>widgetSelected</code> is called, the item field of the event object is valid.
* If the receiver has the <code>SWT.CHECK</code> style and the check selection changes,
* the event object detail field contains the value <code>SWT.CHECK</code>.
* <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
* The item field of the event object is valid for default selection, but the detail field is not used.
* </p>
*
* @param listener the listener which should be notified when the user changes the receiver's selection
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see SelectionListener
* @see #removeSelectionListener
* @see SelectionEvent
*/
public void addSelectionListener (SelectionListener listener) {
checkWidget ();
if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);
}
/**
* Adds the listener to the collection of listeners who will
* be notified when an item in the receiver is expanded or collapsed
* by sending it one of the messages defined in the <code>TreeListener</code>
* interface.
*
* @param listener the listener which should be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see TreeListener
* @see #removeTreeListener
*/
public void addTreeListener(TreeListener listener) {
checkWidget ();
if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Expand, typedListener);
addListener (SWT.Collapse, typedListener);
}
int calculateWidth (GtkTreeViewColumn *column, GtkTreeIter* iter, bool recurse) {
OS.gtk_tree_view_column_cell_set_cell_data (column, modelHandle, iter, false, false);
/*
* Bug in GTK. The width calculated by gtk_tree_view_column_cell_get_size()
* always grows in size regardless of the text or images in the table.
* The fix is to determine the column width from the cell renderers.
*/
// Code intentionally commented
//int [] width = new int [1];
//OS.gtk_tree_view_column_cell_get_size (column, null, null, null, width, null);
//return width [0];
int width = 0;
int w;
GtkTreePath* path = null;
if (OS.gtk_tree_view_get_expander_column (handle) is column) {
/* indent */
GdkRectangle rect;
OS.gtk_widget_realize (handle);
path = OS.gtk_tree_model_get_path (modelHandle, iter);
OS.gtk_tree_view_get_cell_area (handle, path, column, &rect);
width += rect.x;
/* expander */
OS.gtk_widget_style_get1 (handle, OS.expander_size.ptr, &w);
width += w + TreeItem.EXPANDER_EXTRA_PADDING;
}
OS.gtk_widget_style_get1(handle, OS.focus_line_width.ptr, &w);
width += 2 * w ;
auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
if (list is null) return 0;
auto temp = list;
while (temp !is null) {
auto renderer = OS.g_list_data (temp);
if (renderer !is null) {
OS.gtk_cell_renderer_get_size (renderer, handle, null, null, null, &w, null);
width += w ;
}
temp = OS.g_list_next (temp);
}
OS.g_list_free (list);
if (recurse) {
if (path is null) path = OS.gtk_tree_model_get_path (modelHandle, iter);
bool expanded = OS.gtk_tree_view_row_expanded (handle, path) !is 0;
if (expanded) {
GtkTreeIter childIter;
bool valid = OS.gtk_tree_model_iter_children (modelHandle, &childIter, iter) !is 0;
while (valid) {
width = Math.max (width, calculateWidth (column, &childIter, true));
valid = OS.gtk_tree_model_iter_next (modelHandle, &childIter) !is 0;
}
}
}
if (path !is null) OS.gtk_tree_path_free (path);
return width;
}
/**
* Clears the item at the given zero-relative index in the receiver.
* The text, icon and other attributes of the item are set to the default
* value. If the tree was created with the <code>SWT.VIRTUAL</code> style,
* these attributes are requested again as needed.
*
* @param index the index of the item to clear
* @param all <code>true</code> if all child items of the indexed item should be
* cleared recursively, and <code>false</code> otherwise
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see SWT#VIRTUAL
* @see SWT#SetData
*
* @since 3.2
*/
public void clear(int index, bool all) {
checkWidget ();
clear (null, index, all);
}
void clear (GtkTreeIter* parentIter, int index, bool all) {
GtkTreeIter iter;
OS.gtk_tree_model_iter_nth_child(modelHandle, &iter, parentIter, index);
int value;
OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&value);
if (value !is -1) {
TreeItem item = items [value ];
item.clear ();
}
if (all) clearAll (all, &iter);
}
/**
* Clears all the items in the receiver. The text, icon and other
* attributes of the items are set to their default values. If the
* tree was created with the <code>SWT.VIRTUAL</code> style, these
* attributes are requested again as needed.
*
* @param all <code>true</code> if all child items should be cleared
* recursively, and <code>false</code> otherwise
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see SWT#VIRTUAL
* @see SWT#SetData
*
* @since 3.2
*/
public void clearAll (bool all) {
checkWidget ();
clearAll (all, null);
}
void clearAll (bool all, GtkTreeIter* parentIter) {
int length = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
if (length is 0) return;
GtkTreeIter iter;
bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, parentIter);
int value;
while (valid) {
OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&value);
if (value !is -1) {
TreeItem item = items [value ];
item.clear ();
}
if (all) clearAll (all, &iter);
valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
}
}
public override Point computeSize (int wHint, int hHint, bool changed) {
checkWidget ();
if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
Point size = computeNativeSize (handle, wHint, hHint, changed);
Rectangle trim = computeTrim (0, 0, size.x, size.y);
size.x = trim.width;
size.y = trim.height;
return size;
}
void copyModel (void* oldModel, int oldStart, void* newModel, int newStart, uint [] types, void* oldParent, void* newParent, int modelLength) {
GtkTreeIter iter;
if (OS.gtk_tree_model_iter_children (oldModel, &iter, oldParent)) {
GtkTreeIter*[] oldItems = new GtkTreeIter*[]( OS.gtk_tree_model_iter_n_children (oldModel, oldParent));
int oldIndex = 0;
do {
GtkTreeIter* newItem = cast(GtkTreeIter*)OS.g_malloc (GtkTreeIter.sizeof);
if (newItem is null) error (SWT.ERROR_NO_HANDLES);
OS.gtk_tree_store_append (newModel, newItem, newParent);
int index;
OS.gtk_tree_model_get1 (oldModel, &iter, ID_COLUMN, cast(void**)&index);
TreeItem item = null;
if (index !is -1) {
item = items [index ];
if (item !is null) {
auto oldItem = cast(GtkTreeIter*)item.handle;
oldItems[oldIndex++] = oldItem;
void* ptr;
for (int j = 0; j < FIRST_COLUMN; j++) {
OS.gtk_tree_model_get1 (oldModel, oldItem, j, &ptr);
OS.gtk_tree_store_set1 (newModel, newItem, j, ptr );
if (types [j] is OS.G_TYPE_STRING ()) OS.g_free ((ptr ));
}
for (int j= 0; j<modelLength - FIRST_COLUMN; j++) {
OS.gtk_tree_model_get1 (oldModel, oldItem, oldStart + j, &ptr);
OS.gtk_tree_store_set1 (newModel, newItem, newStart + j, ptr );
if (types [j] is OS.G_TYPE_STRING ()) OS.g_free ((ptr ));
}
}
} else {
OS.gtk_tree_store_set1 (newModel, newItem, ID_COLUMN, cast(void*)-1 );
}
// recurse through children
copyModel(oldModel, oldStart, newModel, newStart, types, &iter, newItem, modelLength);
if (item!is null) {
item.handle = cast(GtkWidget*)newItem;
} else {
OS.g_free (newItem);
}
} while (OS.gtk_tree_model_iter_next(oldModel, &iter));
for (int i = 0; i < oldItems.length; i++) {
auto oldItem = oldItems [i];
if (oldItem !is null) {
OS.gtk_tree_store_remove (oldModel, oldItem);
OS.g_free (oldItem);
}
}
}
}
void createColumn (TreeColumn column, int index) {
/*
* Bug in ATK. For some reason, ATK segments fault if
* the GtkTreeView has a column and does not have items.
* The fix is to insert the column only when an item is
* created.
*/
int modelIndex = FIRST_COLUMN;
if (columnCount !is 0) {
int modelLength = OS.gtk_tree_model_get_n_columns (modelHandle);
bool [] usedColumns = new bool [modelLength];
for (int i=0; i<columnCount; i++) {
int columnIndex = columns [i].modelIndex;
for (int j = 0; j < CELL_TYPES; j++) {
usedColumns [columnIndex + j] = true;
}
}
while (modelIndex < modelLength) {
if (!usedColumns [modelIndex]) break;
modelIndex++;
}
if (modelIndex is modelLength) {
auto oldModel = modelHandle;
uint[] types = getColumnTypes (columnCount + 4); // grow by 4 rows at a time
auto newModel = OS.gtk_tree_store_newv (types.length, types.ptr);
if (newModel is null) error (SWT.ERROR_NO_HANDLES);
copyModel (oldModel, FIRST_COLUMN, newModel, FIRST_COLUMN, types, null, null, modelLength);
OS.gtk_tree_view_set_model (handle, newModel);
OS.g_object_unref (oldModel);
modelHandle = newModel;
}
}
auto columnHandle = OS.gtk_tree_view_column_new ();
if (columnHandle is null) error (SWT.ERROR_NO_HANDLES);
if (index is 0 && columnCount > 0) {
TreeColumn checkColumn = columns [0];
createRenderers (cast(GtkTreeViewColumn *)checkColumn.handle, checkColumn.modelIndex, false, checkColumn.style);
}
createRenderers (columnHandle, modelIndex, index is 0, column is null ? 0 : column.style);
/*
* Use GTK_TREE_VIEW_COLUMN_GROW_ONLY on GTK versions < 2.3.2
* because fixed_height_mode is not supported.
*/
bool useVirtual = (style & SWT.VIRTUAL) !is 0 && OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2);
if (!useVirtual && columnCount is 0) {
OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_GROW_ONLY);
} else {
OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_FIXED);
if (columnCount !is 0) OS.gtk_tree_view_column_set_visible (columnHandle, false);
}
OS.gtk_tree_view_column_set_resizable (columnHandle, true);
OS.gtk_tree_view_column_set_clickable (columnHandle, true);
OS.gtk_tree_view_column_set_min_width (columnHandle, 0);
OS.gtk_tree_view_insert_column (handle, columnHandle, index);
if (column !is null) {
column.handle = cast(GtkWidget*)columnHandle;
column.modelIndex = modelIndex;
}
/* Disable searching when using VIRTUAL */
if ((style & SWT.VIRTUAL) !is 0) {
/*
* Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
* would prevent the user from being able to type in text to search the tree.
* After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
* search. This meant that even if FALSE was passed to enable_search, the user
* can still bring up the search pop up using the keybinding. GTK also introduced
* the notion of passing a -1 to gtk_set_search_column to disable searching
* (including the search key binding). The fix is to use the right calls
* for the right version.
*/
if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
OS.gtk_tree_view_set_search_column (handle, -1);
} else {
OS.gtk_tree_view_set_enable_search (handle, false);
}
} else {
/* Set the search column whenever the model changes */
int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
}
}
override void createHandle (int index) {
state |= HANDLE;
fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
OS.gtk_fixed_set_has_window (fixedHandle, true);
scrolledHandle = cast(GtkWidget*)OS.gtk_scrolled_window_new (null, null);
if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
uint[] types = getColumnTypes (1);
modelHandle = cast(GtkTreeStore*)OS.gtk_tree_store_newv (types.length, types.ptr);
if (modelHandle is null) error (SWT.ERROR_NO_HANDLES);
handle = cast(GtkWidget*)OS.gtk_tree_view_new_with_model (modelHandle);
if (handle is null) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.CHECK) !is 0) {
checkRenderer = cast(GtkCellRenderer*)OS.gtk_cell_renderer_toggle_new ();
if (checkRenderer is null) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (checkRenderer);
}
createColumn (null, 0);
OS.gtk_container_add (fixedHandle, scrolledHandle);
OS.gtk_container_add (scrolledHandle, handle);
int mode = (style & SWT.MULTI) !is 0 ? OS.GTK_SELECTION_MULTIPLE : OS.GTK_SELECTION_BROWSE;
auto selectionHandle = OS.gtk_tree_view_get_selection (handle);
OS.gtk_tree_selection_set_mode (selectionHandle, mode);
OS.gtk_tree_view_set_headers_visible (handle, false);
int hsp = (style & SWT.H_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
int vsp = (style & SWT.V_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp);
if ((style & SWT.BORDER) !is 0) OS.gtk_scrolled_window_set_shadow_type (scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
/* Disable searching when using VIRTUAL */
if ((style & SWT.VIRTUAL) !is 0) {
/* The fixed_height_mode property only exists in GTK 2.3.2 and greater */
if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2)) {
OS.g_object_set1 (handle, OS.fixed_height_mode.ptr, true);
}
/*
* Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
* would prevent the user from being able to type in text to search the tree.
* After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
* search. This meant that even if FALSE was passed to enable_search, the user
* can still bring up the search pop up using the keybinding. GTK also introduced
* the notion of passing a -1 to gtk_set_search_column to disable searching
* (including the search key binding). The fix is to use the right calls
* for the right version.
*/
if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
OS.gtk_tree_view_set_search_column (handle, -1);
} else {
OS.gtk_tree_view_set_enable_search (handle, false);
};
}
}
void createItem (TreeColumn column, int index) {
if (!(0 <= index && index <= columnCount)) error (SWT.ERROR_INVALID_RANGE);
if (index is 0) {
// first column must be left aligned
column.style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
column.style |= SWT.LEFT;
}
if (columnCount is 0) {
column.handle = cast(GtkWidget*)OS.gtk_tree_view_get_column (handle, 0);
OS.gtk_tree_view_column_set_sizing (column.handle, OS.GTK_TREE_VIEW_COLUMN_FIXED);
OS.gtk_tree_view_column_set_visible (column.handle, false);
column.modelIndex = FIRST_COLUMN;
createRenderers (cast(GtkTreeViewColumn *)column.handle, column.modelIndex, true, column.style);
column.customDraw = firstCustomDraw;
firstCustomDraw = false;
} else {
createColumn (column, index);
}
auto boxHandle = OS.gtk_hbox_new (false, 3);
if (boxHandle is null) error (SWT.ERROR_NO_HANDLES);
auto labelHandle = OS.gtk_label_new_with_mnemonic (null);
if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
auto imageHandle = OS.gtk_image_new ();
if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (boxHandle, imageHandle);
OS.gtk_container_add (boxHandle, labelHandle);
OS.gtk_widget_show (boxHandle);
OS.gtk_widget_show (labelHandle);
column.labelHandle = labelHandle;
column.imageHandle = imageHandle;
OS.gtk_tree_view_column_set_widget (column.handle, boxHandle);
auto widget = OS.gtk_widget_get_parent (boxHandle);
while (widget !is handle) {
if (OS.GTK_IS_BUTTON (widget)) {
column.buttonHandle = widget;
break;
}
widget = OS.gtk_widget_get_parent (widget);
}
if (columnCount is columns.length) {
TreeColumn [] newColumns = new TreeColumn [columns.length + 4];
System.arraycopy (columns, 0, newColumns, 0, columns.length);
columns = newColumns;
}
System.arraycopy (columns, index, columns, index + 1, columnCount++ - index);
columns [index] = column;
if ((state & FONT) !is 0) {
column.setFontDescription (getFontDescription ());
}
if (columnCount >= 1) {
for (int i=0; i<items.length; i++) {
TreeItem item = items [i];
if (item !is null) {
Font [] cellFont = item.cellFont;
if (cellFont !is null) {
Font [] temp = new Font [columnCount];
System.arraycopy (cellFont, 0, temp, 0, index);
System.arraycopy (cellFont, index, temp, index+1, columnCount-index-1);
item.cellFont = temp;
}
}
}
}
}
void createItem (TreeItem item, GtkTreeIter* parentIter, int index) {
int count = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
if (index is -1) index = count;
if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);
item.handle = cast(GtkWidget*)OS.g_malloc (GtkTreeIter.sizeof);
if (item.handle is null) error(SWT.ERROR_NO_HANDLES);
/*
* Feature in GTK. It is much faster to append to a tree store
* than to insert at the end using gtk_tree_store_insert().
*/
if (index is count) {
OS.gtk_tree_store_append (modelHandle, item.handle, parentIter);
} else {
OS.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index);
}
int id = getId (cast(GtkTreeIter*) item.handle, false);
items [id] = item;
modelChanged = true;
}
void createRenderers (GtkTreeViewColumn* columnHandle, int modelIndex, bool check, int columnStyle) {
OS.gtk_tree_view_column_clear (columnHandle);
if ((style & SWT.CHECK) !is 0 && check) {
OS.gtk_tree_view_column_pack_start (columnHandle, checkRenderer, false);
OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.active.ptr, CHECKED_COLUMN);
/*
* Feature in GTK. The inconsistent property only exists in GTK 2.2.x.
*/
if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) {
OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.inconsistent.ptr, GRAYED_COLUMN);
}
/*
* Bug in GTK. GTK renders the background on top of the checkbox.
* This only happens in version 2.2.1 and earlier. The fix is not to set the background.
*/
if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
if (!ownerDraw) OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
}
if (ownerDraw) {
display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)checkRenderer );
OS.g_object_set_qdata (cast(GObject*)checkRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
}
}
auto pixbufRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_pixbuf_get_type (), null) : OS.gtk_cell_renderer_pixbuf_new ();
if (pixbufRenderer is null) error (SWT.ERROR_NO_HANDLES);
auto textRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_text_get_type (), null) : OS.gtk_cell_renderer_text_new ();
if (textRenderer is null) error (SWT.ERROR_NO_HANDLES);
if (ownerDraw) {
OS.g_object_set_qdata (cast(GObject*)pixbufRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
OS.g_object_set_qdata (cast(GObject*)textRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
}
/*
* Feature in GTK. When a tree view column contains only one activatable
* cell renderer such as a toggle renderer, mouse clicks anywhere in a cell
* activate that renderer. The workaround is to set a second cell renderer
* to be activatable.
*/
if ((style & SWT.CHECK) !is 0 && check) {
OS.g_object_set1 (pixbufRenderer, OS.mode.ptr, OS.GTK_CELL_RENDERER_MODE_ACTIVATABLE);
}
/* Set alignment */
if ((columnStyle & SWT.RIGHT) !is 0) {
OS.g_object_set1_float(textRenderer, OS.xalign.ptr, 1.0f);
OS.gtk_tree_view_column_pack_end (columnHandle, textRenderer, true);
OS.gtk_tree_view_column_pack_end (columnHandle, pixbufRenderer, false);
OS.gtk_tree_view_column_set_alignment (columnHandle, 1f);
} else if ((columnStyle & SWT.CENTER) !is 0) {
OS.g_object_set1_float(textRenderer, OS.xalign.ptr, 0.5f);
OS.gtk_tree_view_column_pack_start (columnHandle, pixbufRenderer, false);
OS.gtk_tree_view_column_pack_end (columnHandle, textRenderer, true);
OS.gtk_tree_view_column_set_alignment (columnHandle, 0.5f);
} else {
OS.gtk_tree_view_column_pack_start (columnHandle, pixbufRenderer, false);
OS.gtk_tree_view_column_pack_start (columnHandle, textRenderer, true);
OS.gtk_tree_view_column_set_alignment (columnHandle, 0f);
}
/* Add attributes */
OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.pixbuf.ptr, modelIndex + CELL_PIXBUF);
/*
* Bug on GTK. Gtk renders the background on top of the pixbuf.
* This only happens in version 2.2.1 and earlier. The fix is not to set the background.
*/
if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
if (!ownerDraw) {
OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
}
}
OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.text.ptr, modelIndex + CELL_TEXT);
OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.foreground_gdk.ptr, FOREGROUND_COLUMN);
OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.font_desc.ptr, FONT_COLUMN);
bool customDraw = firstCustomDraw;
if (columnCount !is 0) {
for (int i=0; i<columnCount; i++) {
if (columns [i].handle is cast(GtkWidget*)columnHandle) {
customDraw = columns [i].customDraw;
break;
}
}
}
if ((style & SWT.VIRTUAL) !is 0 || customDraw || ownerDraw) {
display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)textRenderer );
display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)pixbufRenderer );
}
}
override
void createWidget (int index) {
super.createWidget (index);
items = new TreeItem [4];
columns = new TreeColumn [4];
columnCount = 0;
}
GdkColor* defaultBackground () {
return display.COLOR_LIST_BACKGROUND;
}
GdkColor* defaultForeground () {
return display.COLOR_LIST_FOREGROUND;
}
override void deregister () {
super.deregister ();
display.removeWidget (cast(GtkWidget*)OS.gtk_tree_view_get_selection (handle));
if (checkRenderer !is null) display.removeWidget (cast(GtkWidget*)checkRenderer);
}
/**
* Deselects an item in the receiver. If the item was already
* deselected, it remains deselected.
*
* @param item the item to be deselected
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the item is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.4
*/
public void deselect (TreeItem item) {
checkWidget ();
if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
bool fixColumn = showFirstColumn ();
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_selection_unselect_iter (selection, item.handle);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
if (fixColumn) hideFirstColumn ();
}
/**
* Deselects all selected items in the receiver.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void deselectAll() {
checkWidget();
bool fixColumn = showFirstColumn ();
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_selection_unselect_all (selection);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
if (fixColumn) hideFirstColumn ();
}
void destroyItem (TreeColumn column) {
int index = 0;
while (index < columnCount) {
if (columns [index] is column) break;
index++;
}
if (index is columnCount) return;
auto columnHandle = column.handle;
if (columnCount is 1) {
firstCustomDraw = column.customDraw;
}
System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
columns [columnCount] = null;
OS.gtk_tree_view_remove_column (handle, columnHandle);
if (columnCount is 0) {
auto oldModel = modelHandle;
uint[] types = getColumnTypes (1);
auto newModel = OS.gtk_tree_store_newv (types.length, types.ptr);
if (newModel is null) error (SWT.ERROR_NO_HANDLES);
copyModel(oldModel, column.modelIndex, newModel, FIRST_COLUMN, types, null, null, FIRST_COLUMN + CELL_TYPES);
OS.gtk_tree_view_set_model (handle, newModel);
OS.g_object_unref (oldModel);
modelHandle = newModel;
createColumn (null, 0);
} else {
for (int i=0; i<items.length; i++) {
TreeItem item = items [i];
if (item !is null) {
auto iter = cast(GtkTreeIter*)item.handle;
int modelIndex = column.modelIndex;
OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_PIXBUF, null);
OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_TEXT, null);
OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_FOREGROUND, null);
OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_BACKGROUND, null);
OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_FONT, null);
Font [] cellFont = item.cellFont;
if (cellFont !is null) {
if (columnCount is 0) {
item.cellFont = null;
} else {
Font [] temp = new Font [columnCount];
System.arraycopy (cellFont, 0, temp, 0, index);
System.arraycopy (cellFont, index + 1, temp, index, columnCount - index);
item.cellFont = temp;
}
}
}
}
if (index is 0) {
// first column must be left aligned and must show check box
TreeColumn firstColumn = columns [0];
firstColumn.style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
firstColumn.style |= SWT.LEFT;
createRenderers (cast(GtkTreeViewColumn*)firstColumn.handle, firstColumn.modelIndex, true, firstColumn.style);
}
}
/* Disable searching when using VIRTUAL */
if ((style & SWT.VIRTUAL) !is 0) {
/*
* Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
* would prevent the user from being able to type in text to search the tree.
* After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
* search. This meant that even if FALSE was passed to enable_search, the user
* can still bring up the search pop up using the keybinding. GTK also introduced
* the notion of passing a -1 to gtk_set_search_column to disable searching
* (including the search key binding). The fix is to use the right calls
* for the right version.
*/
if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
OS.gtk_tree_view_set_search_column (handle, -1);
} else {
OS.gtk_tree_view_set_enable_search (handle, false);
}
} else {
/* Set the search column whenever the model changes */
int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
}
}
void destroyItem (TreeItem item) {
/*
* Bug in GTK. GTK segment faults when a root tree item
* is destroyed when the tree is expanded and the last leaf of
* the root is selected. This only happens in versions earlier
* than 2.0.6. The fix is to collapse the tree item being destroyed
* when it is a root, before it is destroyed.
*/
if (OS.GTK_VERSION < OS.buildVERSION (2, 0, 6)) {
int length = OS.gtk_tree_model_iter_n_children (modelHandle, null);
if (length > 0) {
GtkTreeIter iter;
bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, null);
while (valid) {
//PORTING_TODO: is this condition reasonable?
if (item.handle is cast(GtkWidget*)&iter) {
item.setExpanded (false);
break;
}
valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
}
}
}
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_store_remove (modelHandle, item.handle);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
modelChanged = true;
}
override bool dragDetect (int x, int y, bool filter, bool * consume) {
bool selected = false;
if (filter) {
void* path;
if (OS.gtk_tree_view_get_path_at_pos (handle, x, y, &path, null, null, null)) {
if (path !is null) {
auto selection = OS.gtk_tree_view_get_selection (handle);
if (OS.gtk_tree_selection_path_is_selected (selection, path )) selected = true;
OS.gtk_tree_path_free (path );
}
} else {
return false;
}
}
bool dragDetect = super.dragDetect (x, y, filter, consume);
if (dragDetect && selected && consume !is null) consume [0] = true;
return dragDetect;
}
override GdkDrawable* eventWindow () {
return paintWindow ();
}
override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
for (int i=0; i<columnCount; i++) {
TreeColumn column = columns [i];
if (column.toolTipText !is null) {
column.setToolTipText(oldShell, null);
column.setToolTipText(newShell, column.toolTipText);
}
}
}
override GdkColor* getBackgroundColor () {
return getBaseColor ();
}
public override Rectangle getClientArea () {
checkWidget ();
forceResize ();
OS.gtk_widget_realize (handle);
auto fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle);
auto binWindow = OS.gtk_tree_view_get_bin_window (handle);
int binX, binY;
OS.gdk_window_get_origin (binWindow, &binX, &binY);
int fixedX, fixedY;
OS.gdk_window_get_origin (fixedWindow, &fixedX, &fixedY);
auto clientHandle = clientHandle ();
int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (clientHandle);
int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (clientHandle);
return new Rectangle (fixedX - binX , fixedY - binY , width, height);
}
override
int getClientWidth () {
int w, h;
OS.gtk_widget_realize (handle);
OS.gdk_drawable_get_size(OS.gtk_tree_view_get_bin_window(handle), &w, &h);
return w;
}
/**
* Returns the column at the given, zero-relative index in the
* receiver. Throws an exception if the index is out of range.
* Columns are returned in the order that they were created.
* If no <code>TreeColumn</code>s were created by the programmer,
* this method will throw <code>ERROR_INVALID_RANGE</code> despite
* the fact that a single column of data may be visible in the tree.
* This occurs when the programmer uses the tree like a list, adding
* items but never creating a column.
*
* @param index the index of the column to return
* @return the column at the given index
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#getColumnOrder()
* @see Tree#setColumnOrder(int[])
* @see TreeColumn#getMoveable()
* @see TreeColumn#setMoveable(bool)
* @see SWT#Move
*
* @since 3.1
*/
public TreeColumn getColumn (int index) {
checkWidget();
if (!(0 <= index && index < columnCount)) error (SWT.ERROR_INVALID_RANGE);
return columns [index];
}
/**
* Returns the number of columns contained in the receiver.
* If no <code>TreeColumn</code>s were created by the programmer,
* this value is zero, despite the fact that visually, one column
* of items may be visible. This occurs when the programmer uses
* the tree like a list, adding items but never creating a column.
*
* @return the number of columns
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public int getColumnCount () {
checkWidget();
return columnCount;
}
/**
* Returns an array of zero-relative integers that map
* the creation order of the receiver's items to the
* order in which they are currently being displayed.
* <p>
* Specifically, the indices of the returned array represent
* the current visual order of the items, and the contents
* of the array represent the creation order of the items.
* </p><p>
* Note: This is not the actual structure used by the receiver
* to maintain its list of items, so modifying the array will
* not affect the receiver.
* </p>
*
* @return the current visual order of the receiver's items
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#setColumnOrder(int[])
* @see TreeColumn#getMoveable()
* @see TreeColumn#setMoveable(bool)
* @see SWT#Move
*
* @since 3.2
*/
public int [] getColumnOrder () {
checkWidget ();
if (columnCount is 0) return null;
auto list = OS.gtk_tree_view_get_columns (handle);
if (list is null) return null;
int i = 0, count = OS.g_list_length (list);
int [] order = new int [count];
auto temp = list;
while (temp !is null) {
auto column = OS.g_list_data (temp);
if (column !is null) {
for (int j=0; j<columnCount; j++) {
if (columns [j].handle is column) {
order [i++] = j;
break;
}
}
}
temp = OS.g_list_next (temp);
}
OS.g_list_free (list);
return order;
}
uint[] getColumnTypes (int columnCount) {
uint[] types = new uint [FIRST_COLUMN + (columnCount * CELL_TYPES)];
// per row data
types [ID_COLUMN] = OS.G_TYPE_INT ();
types [CHECKED_COLUMN] = OS.G_TYPE_BOOLEAN ();
types [GRAYED_COLUMN] = OS.G_TYPE_BOOLEAN ();
types [FOREGROUND_COLUMN] = OS.GDK_TYPE_COLOR ();
types [BACKGROUND_COLUMN] = OS.GDK_TYPE_COLOR ();
types [FONT_COLUMN] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
// per cell data
for (int i=FIRST_COLUMN; i<types.length; i+=CELL_TYPES) {
types [i + CELL_PIXBUF] = OS.GDK_TYPE_PIXBUF ();
types [i + CELL_TEXT] = OS.G_TYPE_STRING ();
types [i + CELL_FOREGROUND] = OS.GDK_TYPE_COLOR ();
types [i + CELL_BACKGROUND] = OS.GDK_TYPE_COLOR ();
types [i + CELL_FONT] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
}
return types;
}
/**
* Returns an array of <code>TreeColumn</code>s which are the
* columns in the receiver. Columns are returned in the order
* that they were created. If no <code>TreeColumn</code>s were
* created by the programmer, the array is empty, despite the fact
* that visually, one column of items may be visible. This occurs
* when the programmer uses the tree like a list, adding items but
* never creating a column.
* <p>
* Note: This is not the actual structure used by the receiver
* to maintain its list of items, so modifying the array will
* not affect the receiver.
* </p>
*
* @return the items in the receiver
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#getColumnOrder()
* @see Tree#setColumnOrder(int[])
* @see TreeColumn#getMoveable()
* @see TreeColumn#setMoveable(bool)
* @see SWT#Move
*
* @since 3.1
*/
public TreeColumn [] getColumns () {
checkWidget();
TreeColumn [] result = new TreeColumn [columnCount];
System.arraycopy (columns, 0, result, 0, columnCount);
return result;
}
TreeItem getFocusItem () {
GtkTreePath* path;
OS.gtk_tree_view_get_cursor (handle, &path, null);
if (path is null) return null;
TreeItem item = null;
GtkTreeIter iter;
if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) {
int index;
OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
if (index !is -1) item = items [index ]; //TODO should we be creating this item when index is -1?
}
OS.gtk_tree_path_free (path );
return item;
}
override GdkColor* getForegroundColor () {
return getTextColor ();
}
/**
* Returns the width in pixels of a grid line.
*
* @return the width of a grid line in pixels
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public int getGridLineWidth () {
checkWidget();
return 0;
}
/**
* Returns the height of the receiver's header
*
* @return the height of the header or zero if the header is not visible
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public int getHeaderHeight () {
checkWidget ();
if (!OS.gtk_tree_view_get_headers_visible (handle)) return 0;
if (columnCount > 0) {
GtkRequisition requisition;
int height = 0;
for (int i=0; i<columnCount; i++) {
auto buttonHandle = columns [i].buttonHandle;
if (buttonHandle !is null) {
OS.gtk_widget_size_request (buttonHandle, &requisition);
height = Math.max (height, requisition.height);
}
}
return height;
}
OS.gtk_widget_realize (handle);
auto fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle);
auto binWindow = OS.gtk_tree_view_get_bin_window (handle);
int binY ;
OS.gdk_window_get_origin (binWindow, null, &binY);
int fixedY;
OS.gdk_window_get_origin (fixedWindow, null, &fixedY);
return binY - fixedY ;
}
/**
* Returns <code>true</code> if the receiver's header is visible,
* and <code>false</code> otherwise.
* <p>
* If one of the receiver's ancestors is not visible or some
* other condition makes the receiver not visible, this method
* may still indicate that it is considered visible even though
* it may not actually be showing.
* </p>
*
* @return the receiver's header's visibility state
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public bool getHeaderVisible () {
checkWidget();
return cast(bool)OS.gtk_tree_view_get_headers_visible (handle);
}
/**
* Returns the item at the given, zero-relative index in the
* receiver. Throws an exception if the index is out of range.
*
* @param index the index of the item to return
* @return the item at the given index
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public TreeItem getItem (int index) {
checkWidget();
if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, null))) {
error (SWT.ERROR_INVALID_RANGE);
}
return _getItem (null, index);
}
/**
* Returns the item at the given point in the receiver
* or null if no such item exists. The point is in the
* coordinate system of the receiver.
* <p>
* The item that is returned represents an item that could be selected by the user.
* For example, if selection only occurs in items in the first column, then null is
* returned if the point is outside of the item.
* Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy,
* determines the extent of the selection.
* </p>
*
* @param point the point used to locate the item
* @return the item at the given point, or null if the point is not in a selectable item
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the point is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public TreeItem getItem (Point point) {
checkWidget ();
if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
void* path;
OS.gtk_widget_realize (handle);
GtkTreeViewColumn* columnHandle;
if (!OS.gtk_tree_view_get_path_at_pos (handle, point.x, point.y, &path, &columnHandle, null, null)) return null;
if (path is null) return null;
TreeItem item = null;
GtkTreeIter iter;
if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path )) {
bool overExpander = false;
if (OS.gtk_tree_view_get_expander_column (handle) is columnHandle ) {
int buffer;
GdkRectangle rect;
OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, &rect);
if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18)) {
OS.gtk_widget_style_get1 (handle, OS.expander_size.ptr, &buffer);
int expanderSize = buffer + TreeItem.EXPANDER_EXTRA_PADDING;
overExpander = point.x < rect.x + expanderSize;
} else {
overExpander = point.x < rect.x;
}
}
if (!overExpander) {
item = _getItem (&iter);
}
}
OS.gtk_tree_path_free (path );
return item;
}
/**
* Returns the number of items contained in the receiver
* that are direct item children of the receiver. The
* number that is returned is the number of roots in the
* tree.
*
* @return the number of items
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getItemCount () {
checkWidget ();
return OS.gtk_tree_model_iter_n_children (modelHandle, null);
}
/**
* Returns the height of the area which would be used to
* display <em>one</em> of the items in the tree.
*
* @return the height of one item
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getItemHeight () {
checkWidget ();
int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, null);
if (itemCount is 0) {
auto column = OS.gtk_tree_view_get_column (handle, 0);
int w, h;
ignoreSize = true;
OS.gtk_tree_view_column_cell_get_size (column, null, null, null, &w, &h);
ignoreSize = false;
return h ;
} else {
int height = 0;
GtkTreeIter iter;
OS.gtk_tree_model_get_iter_first (modelHandle, &iter);
int columnCount = Math.max (1, this.columnCount);
for (int i=0; i<columnCount; i++) {
auto column = OS.gtk_tree_view_get_column (handle, i);
OS.gtk_tree_view_column_cell_set_cell_data (column, modelHandle, &iter, false, false);
int w, h;
OS.gtk_tree_view_column_cell_get_size (column, null, null, null, &w, &h);
height = Math.max (height, h );
}
return height;
}
}
/**
* Returns a (possibly empty) array of items contained in the
* receiver that are direct item children of the receiver. These
* are the roots of the tree.
* <p>
* Note: This is not the actual structure used by the receiver
* to maintain its list of items, so modifying the array will
* not affect the receiver.
* </p>
*
* @return the items
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public TreeItem [] getItems () {
checkWidget();
return getItems (null);
}
TreeItem [] getItems (GtkTreeIter* parent) {
int length = OS.gtk_tree_model_iter_n_children (modelHandle, parent);
TreeItem[] result = new TreeItem [length];
if (length is 0) return result;
if ((style & SWT.VIRTUAL) !is 0) {
for (int i=0; i<length; i++) {
result [i] = _getItem (parent, i);
}
} else {
int i = 0;
int index;
GtkTreeIter iter;
bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, parent);
while (valid) {
OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
result [i++] = items [index ];
valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
}
}
return result;
}
/**
* Returns <code>true</code> if the receiver's lines are visible,
* and <code>false</code> otherwise.
* <p>
* If one of the receiver's ancestors is not visible or some
* other condition makes the receiver not visible, this method
* may still indicate that it is considered visible even though
* it may not actually be showing.
* </p>
*
* @return the visibility state of the lines
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public bool getLinesVisible() {
checkWidget();
return cast(bool)OS.gtk_tree_view_get_rules_hint (handle);
}
/**
* Returns the receiver's parent item, which must be a
* <code>TreeItem</code> or null when the receiver is a
* root.
*
* @return the receiver's parent item
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public TreeItem getParentItem () {
checkWidget ();
return null;
}
GtkCellRendererPixbuf* getPixbufRenderer (GtkTreeViewColumn* column) {
auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
if (list is null) return null;
int count = OS.g_list_length (list);
GtkCellRendererPixbuf* pixbufRenderer;
int i = 0;
while (i < count) {
auto renderer = OS.g_list_nth_data (list, i);
if (OS.GTK_IS_CELL_RENDERER_PIXBUF (renderer)) {
pixbufRenderer = cast(GtkCellRendererPixbuf*)renderer;
break;
}
i++;
}
OS.g_list_free (list);
return pixbufRenderer;
}
/**
* Returns an array of <code>TreeItem</code>s that are currently
* selected in the receiver. The order of the items is unspecified.
* An empty array indicates that no items are selected.
* <p>
* Note: This is not the actual structure used by the receiver
* to maintain its selection, so modifying the array will
* not affect the receiver.
* </p>
* @return an array representing the selection
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public TreeItem[] getSelection () {
checkWidget();
auto selection = OS.gtk_tree_view_get_selection (handle);
if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
display.treeSelectionLength = 0;
display.treeSelection = new int [items.length];
display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
TreeItem [] result = new TreeItem [display.treeSelectionLength];
for (int i=0; i<result.length; i++) result [i] = items [display.treeSelection [i]];
return result;
}
/*
* Bug in GTK. gtk_tree_selection_get_selected_rows() segmentation faults
* in versions smaller than 2.2.4 if the model is NULL. The fix is
* to give a valid pointer instead.
*/
int dummy;
void* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
auto list = OS.gtk_tree_selection_get_selected_rows (selection, &model);
if (list !is null) {
int count = OS.g_list_length (list);
TreeItem [] treeSelection = new TreeItem [count];
int length_ = 0;
for (int i=0; i<count; i++) {
auto data = OS.g_list_nth_data (list, i);
GtkTreeIter iter;
if (OS.gtk_tree_model_get_iter (modelHandle, &iter, data)) {
treeSelection [length_] = _getItem (&iter);
length_++;
}
}
OS.g_list_free (list);
if (length_ < count) {
TreeItem [] temp = new TreeItem [length_];
System.arraycopy(treeSelection, 0, temp, 0, length_);
treeSelection = temp;
}
return treeSelection;
}
return null;
}
/**
* Returns the number of selected items contained in the receiver.
*
* @return the number of selected items
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getSelectionCount () {
checkWidget();
auto selection = OS.gtk_tree_view_get_selection (handle);
if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
display.treeSelectionLength = 0;
display.treeSelection = null;
display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
return display.treeSelectionLength;
}
return OS.gtk_tree_selection_count_selected_rows (selection);
}
/**
* Returns the column which shows the sort indicator for
* the receiver. The value may be null if no column shows
* the sort indicator.
*
* @return the sort indicator
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see #setSortColumn(TreeColumn)
*
* @since 3.2
*/
public TreeColumn getSortColumn () {
checkWidget ();
return sortColumn;
}
/**
* Returns the direction of the sort indicator for the receiver.
* The value will be one of <code>UP</code>, <code>DOWN</code>
* or <code>NONE</code>.
*
* @return the sort direction
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see #setSortDirection(int)
*
* @since 3.2
*/
public int getSortDirection () {
checkWidget ();
return sortDirection;
}
GtkCellRendererText* getTextRenderer (GtkTreeViewColumn* column) {
auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
if (list is null) return null;
int count = OS.g_list_length (list);
GtkCellRendererText* textRenderer;
int i = 0;
while (i < count) {
auto renderer = OS.g_list_nth_data (list, i);
if (OS.GTK_IS_CELL_RENDERER_TEXT (renderer)) {
textRenderer = cast(GtkCellRendererText*)renderer;
break;
}
i++;
}
OS.g_list_free (list);
return textRenderer;
}
/**
* Returns the item which is currently at the top of the receiver.
* This item can change when items are expanded, collapsed, scrolled
* or new items are added or removed.
*
* @return the item at the top of the receiver
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 2.1
*/
public TreeItem getTopItem () {
checkWidget ();
void* path;
OS.gtk_widget_realize (handle);
if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, &path, null, null, null)) return null;
if (path is null) return null;
TreeItem item = null;
GtkTreeIter iter;
if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path )) {
item = _getItem (&iter);
}
OS.gtk_tree_path_free (path );
return item;
}
override int gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
if (gdkEvent.window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
auto result = super.gtk_button_press_event (widget, gdkEvent);
if (result !is 0) return result;
/*
* Feature in GTK. In a multi-select tree view, when multiple items are already
* selected, the selection state of the item is toggled and the previous selection
* is cleared. This is not the desired behaviour when bringing up a popup menu.
* Also, when an item is reselected with the right button, the tree view issues
* an unwanted selection event. The workaround is to detect that case and not
* run the default handler when the item is already part of the current selection.
*/
int button = gdkEvent.button;
if (button is 3 && gdkEvent.type is OS.GDK_BUTTON_PRESS) {
void* path;
if (OS.gtk_tree_view_get_path_at_pos (handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
if (path !is null) {
auto selection = OS.gtk_tree_view_get_selection (handle);
if (OS.gtk_tree_selection_path_is_selected (selection, path )) result = 1;
OS.gtk_tree_path_free (path );
}
}
}
/*
* Feature in GTK. When the user clicks in a single selection GtkTreeView
* and there are no selected items, the first item is selected automatically
* before the click is processed, causing two selection events. The is fix
* is the set the cursor item to be same as the clicked item to stop the
* widget from automatically selecting the first item.
*/
if ((style & SWT.SINGLE) !is 0 && getSelectionCount () is 0) {
void* path;
if (OS.gtk_tree_view_get_path_at_pos (handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
if (path !is null) {
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_view_set_cursor (handle, path , null, false);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_path_free (path );
}
}
}
/*
* Bug in GTK. GTK segments fault, if the GtkTreeView widget is
* not in focus and all items in the widget are disposed before
* it finishes processing a button press. The fix is to give
* focus to the widget before it starts processing the event.
*/
if (!OS.GTK_WIDGET_HAS_FOCUS (handle)) {
OS.gtk_widget_grab_focus (handle);
}
return result;
}
override int gtk_button_release_event (GtkWidget* widget, GdkEventButton* event) {
auto window = OS.GDK_EVENT_WINDOW (event);
if (window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
return super.gtk_button_release_event (widget, event);
}
override int gtk_changed (GtkWidget* widget) {
TreeItem item = getFocusItem ();
if (item !is null) {
Event event = new Event ();
event.item = item;
postEvent (SWT.Selection, event);
}
return 0;
}
override int gtk_expand_collapse_cursor_row (GtkWidget* widget, int /*long*/ logical, int /*long*/ expand, int /*long*/ open_all) {
// FIXME - this flag is never cleared. It should be cleared when the expand all operation completes.
if (expand !is 0 && open_all !is 0) expandAll = true;
return 0;
}
override int gtk_key_press_event (GtkWidget* widget, GdkEventKey* keyEvent) {
auto result = super.gtk_key_press_event (widget, keyEvent);
if (result !is 0) return result;
if (OS.GTK_VERSION < OS.buildVERSION (2, 2 ,0)) {
/*
* Feature in GTK 2.0.x. When an item is default selected using
* the return key, GTK does not issue notification. The fix is
* to issue this notification when the return key is pressed.
*/
int key = keyEvent.keyval;
switch (key) {
case OS.GDK_Return:
case OS.GDK_KP_Enter: {
Event event = new Event ();
event.item = getFocusItem ();
postEvent (SWT.DefaultSelection, event);
break;
}
default:
}
}
return result;
}
override int gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* event) {
auto window = OS.GDK_EVENT_WINDOW (event);
if (window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
return super.gtk_motion_notify_event (widget, event);
}
override int gtk_popup_menu (GtkWidget* widget) {
auto result = super.gtk_popup_menu (widget);
/*
* Bug in GTK. The context menu for the typeahead in GtkTreeViewer
* opens in the bottom right corner of the screen when Shift+F10
* is pressed and the typeahead window was not visible. The fix is
* to prevent the context menu from opening by stopping the default
* handler.
*
* NOTE: The bug only happens in GTK 2.6.5 and lower.
*/
return OS.GTK_VERSION < OS.buildVERSION (2, 6, 5) ? 1 : result;
}
override void gtk_row_activated (GtkTreeView* tree, GtkTreePath* path, GtkTreeViewColumn* column) {
if (path is null) return;
TreeItem item = null;
GtkTreeIter iter;
if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) {
int index;
OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
item = items [index ];
}
Event event = new Event ();
event.item = item;
postEvent (SWT.DefaultSelection, event);
return;
}
override int gtk_test_collapse_row (
GtkTreeView *tree,
GtkTreeIter *iter,
GtkTreePath *path)
{
int index ;
OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index);
TreeItem item = items [index ];
Event event = new Event ();
event.item = item;
bool oldModelChanged = modelChanged;
modelChanged = false;
sendEvent (SWT.Collapse, event);
/*
* Bug in GTK. Collapsing the target row during the test_collapse_row
* handler will cause a segmentation fault if the animation code is allowed
* to run. The fix is to block the animation if the row is already
* collapsed.
*/
bool changed = modelChanged || !OS.gtk_tree_view_row_expanded (handle, path);
modelChanged = oldModelChanged;
if (isDisposed () || item.isDisposed ()) return 1;
/*
* Bug in GTK. Expanding or collapsing a row which has no more
* children causes the model state to become invalid, causing
* GTK to give warnings and behave strangely. Other changes to
* the model can cause expansion to fail when using the multiple
* expansion keys (such as *). The fix is to stop the expansion
* if there are model changes.
*
* Note: This callback must return 0 for the collapsing
* animation to occur.
*/
if (changed) {
OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_COLLAPSE_ROW);
OS.gtk_tree_view_collapse_row (handle, path);
OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_COLLAPSE_ROW);
return 1;
}
return 0;
}
override int gtk_test_expand_row (
GtkTreeView *tree,
GtkTreeIter *iter,
GtkTreePath *path)
{
int index ;
OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index);
TreeItem item = items [index ];
Event event = new Event ();
event.item = item;
bool oldModelChanged = modelChanged;
modelChanged = false;
sendEvent (SWT.Expand, event);
/*
* Bug in GTK. Expanding the target row during the test_expand_row
* handler will cause a segmentation fault if the animation code is allowed
* to run. The fix is to block the animation if the row is already
* expanded.
*/
bool changed = modelChanged || OS.gtk_tree_view_row_expanded (handle, path);
modelChanged = oldModelChanged;
if (isDisposed () || item.isDisposed ()) return 1;
/*
* Bug in GTK. Expanding or collapsing a row which has no more
* children causes the model state to become invalid, causing
* GTK to give warnings and behave strangely. Other changes to
* the model can cause expansion to fail when using the multiple
* expansion keys (such as *). The fix is to stop the expansion
* if there are model changes.
*
* Bug in GTK. test-expand-row does not get called for each row
* in an expand all operation. The fix is to block the initial
* expansion and only expand a single level.
*
* Note: This callback must return 0 for the collapsing
* animation to occur.
*/
if (changed || expandAll) {
OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_EXPAND_ROW);
OS.gtk_tree_view_expand_row (handle, path, false);
OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_EXPAND_ROW);
return 1;
}
return 0;
}
override int gtk_toggled (int /*long*/ renderer, char* pathStr) {
auto path = OS.gtk_tree_path_new_from_string (pathStr);
if (path is null) return 0;
TreeItem item = null;
GtkTreeIter iter;
if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) {
item = _getItem (&iter);
}
OS.gtk_tree_path_free (path);
if (item !is null) {
item.setChecked (!item.getChecked ());
Event event = new Event ();
event.detail = SWT.CHECK;
event.item = item;
postEvent (SWT.Selection, event);
}
return 0;
}
override void gtk_widget_size_request (GtkWidget* widget, GtkRequisition* requisition) {
/*
* Bug in GTK. For some reason, gtk_widget_size_request() fails
* to include the height of the tree view items when there are
* no columns visible. The fix is to temporarily make one column
* visible.
*/
if (columnCount is 0) {
super.gtk_widget_size_request (widget, requisition);
return;
}
auto columns = OS.gtk_tree_view_get_columns (handle), list = columns;
bool fixVisible = columns !is null;
while (list !is null) {
auto column = OS.g_list_data (list);
if (OS.gtk_tree_view_column_get_visible (column)) {
fixVisible = false;
break;
}
list = OS.g_list_next (list);
}
GtkTreeViewColumn* columnHandle;
if (fixVisible) {
columnHandle = cast(GtkTreeViewColumn*)OS.g_list_data (columns);
OS.gtk_tree_view_column_set_visible (columnHandle, true);
}
super.gtk_widget_size_request (widget, requisition);
if (fixVisible) {
OS.gtk_tree_view_column_set_visible (columnHandle, false);
}
if (columns !is null) OS.g_list_free (columns);
}
void hideFirstColumn () {
auto firstColumn = OS.gtk_tree_view_get_column (handle, 0);
OS.gtk_tree_view_column_set_visible (firstColumn, false);
}
override void hookEvents () {
super.hookEvents ();
auto selection = OS.gtk_tree_view_get_selection(handle);
OS.g_signal_connect_closure (selection, OS.changed.ptr, display.closures [CHANGED], false);
OS.g_signal_connect_closure (handle, OS.row_activated.ptr, display.closures [ROW_ACTIVATED], false);
OS.g_signal_connect_closure (handle, OS.test_expand_row.ptr, display.closures [TEST_EXPAND_ROW], false);
OS.g_signal_connect_closure (handle, OS.test_collapse_row.ptr, display.closures [TEST_COLLAPSE_ROW], false);
OS.g_signal_connect_closure (handle, OS.expand_collapse_cursor_row.ptr, display.closures [EXPAND_COLLAPSE_CURSOR_ROW], false);
if (checkRenderer !is null) {
OS.g_signal_connect_closure (checkRenderer, OS.toggled.ptr, display.closures [TOGGLED], false);
}
}
/**
* Searches the receiver's list starting at the first column
* (index 0) until a column is found that is equal to the
* argument, and returns the index of that column. If no column
* is found, returns -1.
*
* @param column the search column
* @return the index of the column
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the column is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public int indexOf (TreeColumn column) {
checkWidget();
if (column is null) error (SWT.ERROR_NULL_ARGUMENT);
for (int i=0; i<columnCount; i++) {
if (columns [i] is column) return i;
}
return -1;
}
/**
* Searches the receiver's list starting at the first item
* (index 0) until an item is found that is equal to the
* argument, and returns the index of that item. If no item
* is found, returns -1.
*
* @param item the search item
* @return the index of the item
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the item is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public int indexOf (TreeItem item) {
checkWidget();
if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
int index = -1;
auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
int depth = OS.gtk_tree_path_get_depth (path);
if (depth is 1) {
auto indices = OS.gtk_tree_path_get_indices (path);
if (indices !is null) {
index = indices[0];
}
}
OS.gtk_tree_path_free (path);
return index;
}
override bool mnemonicHit (wchar key) {
for (int i=0; i<columnCount; i++) {
auto labelHandle = columns [i].labelHandle;
if (labelHandle !is null && mnemonicHit (labelHandle, key)) return true;
}
return false;
}
override bool mnemonicMatch (wchar key) {
for (int i=0; i<columnCount; i++) {
auto labelHandle = columns [i].labelHandle;
if (labelHandle !is null && mnemonicMatch (labelHandle, key)) return true;
}
return false;
}
override GdkDrawable* paintWindow () {
OS.gtk_widget_realize (handle);
return OS.gtk_tree_view_get_bin_window (handle);
}
void recreateRenderers () {
if (checkRenderer !is null) {
display.removeWidget (cast(GtkWidget*)checkRenderer);
OS.g_object_unref (checkRenderer);
checkRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), null) : OS.gtk_cell_renderer_toggle_new ();
if (checkRenderer is null) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (checkRenderer);
display.addWidget (cast(GtkWidget*)checkRenderer, this);
OS.g_signal_connect_closure (checkRenderer, OS.toggled.ptr, display.closures [TOGGLED], false);
}
if (columnCount is 0) {
createRenderers (OS.gtk_tree_view_get_column (handle, 0), Tree.FIRST_COLUMN, true, 0);
} else {
for (int i = 0; i < columnCount; i++) {
TreeColumn column = columns [i];
createRenderers (cast(GtkTreeViewColumn*)column.handle, column.modelIndex, i is 0, column.style);
}
}
}
override void redrawBackgroundImage () {
Control control = findBackgroundControl ();
if (control !is null && control.backgroundImage !is null) {
redrawWidget (0, 0, 0, 0, true, false, false);
}
}
override void register () {
super.register ();
display.addWidget (cast(GtkWidget*)OS.gtk_tree_view_get_selection (handle), this);
if (checkRenderer !is null) display.addWidget (cast(GtkWidget*)checkRenderer, this);
}
void releaseItem (TreeItem item, bool release) {
int index;
OS.gtk_tree_model_get1 (modelHandle, item.handle, ID_COLUMN, cast(void**)&index);
if (index is -1) return;
if (release) item.release (false);
items [index ] = null;
}
void releaseItems (GtkTreeIter* parentIter) {
int index;
GtkTreeIter iter;
bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, parentIter);
while (valid) {
releaseItems (&iter);
if (!isDisposed ()) {
OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
if (index !is -1) {
TreeItem item = items [index ];
if (item !is null) releaseItem (item, true);
}
}
valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
}
}
override void releaseChildren (bool destroy) {
if (items !is null) {
for (int i=0; i<items.length; i++) {
TreeItem item = items [i];
if (item !is null && !item.isDisposed ()) {
item.release (false);
}
}
items = null;
}
if (columns !is null) {
for (int i=0; i<columnCount; i++) {
TreeColumn column = columns [i];
if (column !is null && !column.isDisposed ()) {
column.release (false);
}
}
columns = null;
}
super.releaseChildren (destroy);
}
override void releaseWidget () {
super.releaseWidget ();
if (modelHandle !is null) OS.g_object_unref (modelHandle);
modelHandle = null;
if (checkRenderer !is null) OS.g_object_unref (checkRenderer);
checkRenderer = null;
if (imageList !is null) imageList.dispose ();
if (headerImageList !is null) headerImageList.dispose ();
imageList = headerImageList = null;
currentItem = null;
}
void remove (GtkTreeIter* parentIter, int start, int end) {
if (start > end) return;
int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
if (!(0 <= start && start <= end && end < itemCount)) {
error (SWT.ERROR_INVALID_RANGE);
}
auto selection = OS.gtk_tree_view_get_selection (handle);
GtkTreeIter iter;
int index = start;
for (int i = start; i <= end; i++) {
OS.gtk_tree_model_iter_nth_child (modelHandle, &iter, parentIter, index);
int value;
OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&value);
TreeItem item = value !is -1 ? items [value ] : null;
if (item !is null && !item.isDisposed ()) {
item.dispose ();
} else {
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_store_remove (modelHandle, &iter);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
}
}
}
/**
* Removes all of the items from the receiver.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void removeAll () {
checkWidget ();
for (int i=0; i<items.length; i++) {
TreeItem item = items [i];
if (item !is null && !item.isDisposed ()) item.release (false);
}
items = new TreeItem[4];
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_store_clear (modelHandle);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
/* Disable searching when using VIRTUAL */
if ((style & SWT.VIRTUAL) !is 0) {
/*
* Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
* would prevent the user from being able to type in text to search the tree.
* After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
* search. This meant that even if FALSE was passed to enable_search, the user
* can still bring up the search pop up using the keybinding. GTK also introduced
* the notion of passing a -1 to gtk_set_search_column to disable searching
* (including the search key binding). The fix is to use the right calls
* for the right version.
*/
if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
OS.gtk_tree_view_set_search_column (handle, -1);
} else {
OS.gtk_tree_view_set_enable_search (handle, false);
}
} else {
/* Set the search column whenever the model changes */
int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
}
}
/**
* Removes the listener from the collection of listeners who will
* be notified when the user changes the receiver's selection.
*
* @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see SelectionListener
* @see #addSelectionListener
*/
public void removeSelectionListener (SelectionListener listener) {
checkWidget ();
if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
eventTable.unhook (SWT.Selection, listener);
eventTable.unhook (SWT.DefaultSelection, listener);
}
/**
* Removes the listener from the collection of listeners who will
* be notified when items in the receiver are expanded or collapsed.
*
* @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see TreeListener
* @see #addTreeListener
*/
public void removeTreeListener(TreeListener listener) {
checkWidget ();
if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable is null) return;
eventTable.unhook (SWT.Expand, listener);
eventTable.unhook (SWT.Collapse, listener);
}
override void rendererGetSizeProc (
GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
int *x_offset,
int *y_offset,
int *width,
int *height)
{
auto g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
klass.get_size( cell, handle, cell_area, x_offset, y_offset, width, height);
if (!ignoreSize && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
auto iter = cast(GtkTreeIter*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2);
TreeItem item = null;
if (iter !is null) item = _getItem (iter);
if (item !is null) {
int columnIndex = 0;
if (columnCount > 0) {
auto columnHandle = cast(GtkTreeViewColumn*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX1);
for (int i = 0; i < columnCount; i++) {
if (columns [i].handle is cast(GtkWidget*)columnHandle) {
columnIndex = i;
break;
}
}
}
if (hooks (SWT.MeasureItem)) {
int contentWidth, contentHeight;
if (width !is null) contentWidth = *width;
if (height !is null) contentHeight = *height;
Image image = item.getImage (columnIndex);
int imageWidth = 0;
if (image !is null) {
Rectangle bounds = image.getBounds ();
imageWidth = bounds.width;
}
contentWidth += imageWidth;
GC gc = new GC (this);
gc.setFont (item.getFont (columnIndex));
Event event = new Event ();
event.item = item;
event.index = columnIndex;
event.gc = gc;
event.width = contentWidth ;
event.height = contentHeight ;
sendEvent (SWT.MeasureItem, event);
gc.dispose ();
contentWidth = event.width - imageWidth;
if (contentHeight < event.height) contentHeight = event.height;
if (width !is null) *width = contentWidth;
if (height !is null) *height = contentHeight;
}
}
}
}
override void rendererRenderProc (
GtkCellRenderer * cell,
GdkDrawable * window,
GtkWidget * widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
int flags)
{
TreeItem item = null;
auto iter = cast(GtkTreeIter*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2);
if (iter !is null) item = _getItem (iter);
auto columnHandle = cast(GtkTreeViewColumn*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX1);
int columnIndex = 0;
if (columnCount > 0) {
for (int i = 0; i < columnCount; i++) {
if (columns [i].handle is cast(GtkWidget*)columnHandle) {
columnIndex = i;
break;
}
}
}
if (item !is null) {
if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex !is 0 || (style & SWT.CHECK) is 0))) {
drawFlags = cast(int)/*64*/flags;
drawState = SWT.FOREGROUND;
void* ptr;
OS.gtk_tree_model_get1 (modelHandle, item.handle, Tree.BACKGROUND_COLUMN, &ptr);
if (ptr is null) {
int modelIndex = columnCount is 0 ? Tree.FIRST_COLUMN : columns [columnIndex].modelIndex;
OS.gtk_tree_model_get1 (modelHandle, item.handle, modelIndex + Tree.CELL_BACKGROUND, &ptr);
}
if (ptr !is null) drawState |= SWT.BACKGROUND;
if ((flags & OS.GTK_CELL_RENDERER_SELECTED) !is 0) drawState |= SWT.SELECTED;
if ((flags & OS.GTK_CELL_RENDERER_FOCUSED) !is 0) drawState |= SWT.FOCUSED;
GdkRectangle rect;
auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
OS.gtk_tree_view_get_background_area (handle, path, columnHandle, &rect);
OS.gtk_tree_path_free (path);
if ((drawState & SWT.SELECTED) is 0) {
Control control = findBackgroundControl ();
if (control !is null && control.backgroundImage !is null) {
OS.gdk_window_clear_area (window, rect.x, rect.y, rect.width, rect.height);
}
}
if (hooks (SWT.EraseItem)) {
bool wasSelected = false;
if ((drawState & SWT.SELECTED) !is 0) {
wasSelected = true;
OS.gdk_window_clear_area (window, rect.x, rect.y, rect.width, rect.height);
}
GC gc = new GC (this);
if ((drawState & SWT.SELECTED) !is 0) {
gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));
gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));
} else {
gc.setBackground (item.getBackground (columnIndex));
gc.setForeground (item.getForeground (columnIndex));
}
gc.setFont (item.getFont (columnIndex));
if ((style & SWT.MIRRORED) !is 0) rect.x = getClientWidth () - rect.width - rect.x;
gc.setClipping (rect.x, rect.y, rect.width, rect.height);
Event event = new Event ();
event.item = item;
event.index = columnIndex;
event.gc = gc;
event.x = rect.x;
event.y = rect.y;
event.width = rect.width;
event.height = rect.height;
event.detail = drawState;
sendEvent (SWT.EraseItem, event);
drawForeground = null;
drawState = event.doit ? event.detail : 0;
drawFlags &= ~(OS.GTK_CELL_RENDERER_FOCUSED | OS.GTK_CELL_RENDERER_SELECTED);
if ((drawState & SWT.SELECTED) !is 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
if ((drawState & SWT.FOCUSED) !is 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
if ((drawState & SWT.SELECTED) !is 0) {
auto style = OS.gtk_widget_get_style (widget);
//TODO - parity and sorted
OS.gtk_paint_flat_box (style, window, OS.GTK_STATE_SELECTED, OS.GTK_SHADOW_NONE, &rect, widget, "cell_odd".ptr, rect.x, rect.y, rect.width, rect.height);
} else {
if (wasSelected) drawForeground = gc.getForeground ().handle;
}
gc.dispose();
}
}
}
int /*long*/ result = 0;
if ((drawState & SWT.BACKGROUND) !is 0 && (drawState & SWT.SELECTED) is 0) {
GC gc = new GC (this);
gc.setBackground (item.getBackground (columnIndex));
gc.fillRectangle (background_area.x, background_area.y, background_area.width, background_area.height);
gc.dispose ();
}
if ((drawState & SWT.FOREGROUND) !is 0 || OS.GTK_IS_CELL_RENDERER_TOGGLE (cell)) {
auto g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
if (drawForeground !is null && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
OS.g_object_set1 (cell, OS.foreground_gdk.ptr, cast(int)drawForeground);
}
klass.render( cell, window, handle, background_area, cell_area, expose_area, drawFlags);
}
if (item !is null) {
if (OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
if (hooks (SWT.PaintItem)) {
GdkRectangle rect;
auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, &rect);
OS.gtk_tree_path_free (path);
if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (handle) is columnHandle) {
int buffer;
OS.gtk_widget_style_get1 (handle, OS.expander_size.ptr, &buffer);
rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
rect.width -= buffer + TreeItem.EXPANDER_EXTRA_PADDING;
//OS.gtk_widget_style_get (handle, OS.horizontal_separator, buffer, 0);
//rect.x += buffer[0];
//rect.width -= buffer [0]; // TODO Is this required for some versions?
}
ignoreSize = true;
int contentX, contentWidth;
OS.gtk_cell_renderer_get_size (cell, handle, null, null, null, &contentWidth, null);
OS.gtk_tree_view_column_cell_get_position (columnHandle, cell, &contentX, null);
ignoreSize = false;
Image image = item.getImage (columnIndex);
int imageWidth = 0;
if (image !is null) {
Rectangle bounds = image.getBounds ();
imageWidth = bounds.width;
}
contentX -= imageWidth;
contentWidth += imageWidth;
GC gc = new GC (this);
if ((drawState & SWT.SELECTED) !is 0) {
gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));
gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));
} else {
gc.setBackground (item.getBackground (columnIndex));
Color foreground = drawForeground !is null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex);
gc.setForeground (foreground);
}
gc.setFont (item.getFont (columnIndex));
if ((style & SWT.MIRRORED) !is 0) rect.x = getClientWidth () - rect.width - rect.x;
gc.setClipping (rect.x, rect.y, rect.width, rect.height);
Event event = new Event ();
event.item = item;
event.index = columnIndex;
event.gc = gc;
event.x = rect.x + contentX;
event.y = rect.y;
event.width = contentWidth;
event.height = rect.height;
event.detail = drawState;
sendEvent (SWT.PaintItem, event);
gc.dispose();
}
}
}
//return result;
}
void resetCustomDraw () {
if ((style & SWT.VIRTUAL) !is 0 || ownerDraw) return;
int end = Math.max (1, columnCount);
for (int i=0; i<end; i++) {
bool customDraw = columnCount !is 0 ? columns [i].customDraw : firstCustomDraw;
if (customDraw) {
auto column = OS.gtk_tree_view_get_column (handle, i);
auto textRenderer = getTextRenderer (column);
OS.gtk_tree_view_column_set_cell_data_func (column, textRenderer, null, null, null);
if (columnCount !is 0) columns [i].customDraw = false;
}
}
firstCustomDraw = false;
}
/**
* Display a mark indicating the point at which an item will be inserted.
* The drop insert item has a visual hint to show where a dragged item
* will be inserted when dropped on the tree.
*
* @param item the insert item. Null will clear the insertion mark.
* @param before true places the insert mark above 'item'. false places
* the insert mark below 'item'.
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void setInsertMark (TreeItem item, bool before) {
checkWidget ();
if (item is null) {
OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
return;
}
if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
if (item.parent !is this) return;
Rectangle rect = item.getBounds();
void* path;
OS.gtk_widget_realize (handle);
if (!OS.gtk_tree_view_get_path_at_pos(handle, rect.x, rect.y, &path, null, null, null)) return;
if (path is null) return;
int position = before ? OS.GTK_TREE_VIEW_DROP_BEFORE : OS.GTK_TREE_VIEW_DROP_AFTER;
OS.gtk_tree_view_set_drag_dest_row(handle, path, position);
OS.gtk_tree_path_free (path );
}
void setItemCount (GtkTreeIter* parentIter, int count) {
int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
if (count is itemCount) return;
bool isVirtual = (style & SWT.VIRTUAL) !is 0;
if (!isVirtual) setRedraw (false);
remove (parentIter, count, itemCount - 1);
if (isVirtual) {
for (int i=itemCount; i<count; i++) {
GtkTreeIter iter;
OS.gtk_tree_store_append (modelHandle, &iter, parentIter);
OS.gtk_tree_store_set1 (modelHandle, &iter, ID_COLUMN, cast(void*)-1);
}
} else {
for (int i=itemCount; i<count; i++) {
new TreeItem (this, parentIter, SWT.NONE, i, true);
}
}
if (!isVirtual) setRedraw (true);
modelChanged = true;
}
/**
* Sets the number of root-level items contained in the receiver.
*
* @param count the number of items
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.2
*/
public void setItemCount (int count) {
checkWidget ();
count = Math.max (0, count);
setItemCount (null, count);
}
/**
* Selects an item in the receiver. If the item was already
* selected, it remains selected.
*
* @param item the item to be selected
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the item is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.4
*/
public void select (TreeItem item) {
checkWidget ();
if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
bool fixColumn = showFirstColumn ();
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_selection_select_iter (selection, item.handle);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
if (fixColumn) hideFirstColumn ();
}
/**
* Selects all of the items in the receiver.
* <p>
* If the receiver is single-select, do nothing.
* </p>
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void selectAll () {
checkWidget();
if ((style & SWT.SINGLE) !is 0) return;
bool fixColumn = showFirstColumn ();
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
OS.gtk_tree_selection_select_all (selection);
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
if (fixColumn) hideFirstColumn ();
}
override void setBackgroundColor (GdkColor* color) {
super.setBackgroundColor (color);
OS.gtk_widget_modify_base (handle, 0, color);
}
override void setBackgroundPixmap (GdkPixmap* pixmap) {
super.setBackgroundPixmap (pixmap);
auto window = paintWindow ();
if (window !is null) OS.gdk_window_set_back_pixmap (window, null, true);
}
override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
int result = super.setBounds (x, y, width, height, move, resize);
/*
* Bug on GTK. The tree view sometimes does not get a paint
* event or resizes to a one pixel square when resized in a new
* shell that is not visible after any event loop has been run. The
* problem is intermittent. It doesn't seem to happen the first time
* a new shell is created. The fix is to ensure the tree view is realized
* after it has been resized.
*/
OS.gtk_widget_realize (handle);
/*
* Bug in GTK. An empty GtkTreeView fails to repaint the focus rectangle
* correctly when resized on versions before 2.6.0. The fix is to force
* the widget to redraw.
*/
if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 0) && OS.gtk_tree_model_iter_n_children (modelHandle, null) is 0) {
redraw (false);
}
return result;
}
/**
* Sets the order that the items in the receiver should
* be displayed in to the given argument which is described
* in terms of the zero-relative ordering of when the items
* were added.
*
* @param order the new order to display the items
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
* </ul>
*
* @see Tree#getColumnOrder()
* @see TreeColumn#getMoveable()
* @see TreeColumn#setMoveable(bool)
* @see SWT#Move
*
* @since 3.2
*/
public void setColumnOrder (int [] order) {
checkWidget ();
// SWT extension: allow null for zero length string
//if (order is null) error (SWT.ERROR_NULL_ARGUMENT);
if (columnCount is 0) {
if (order.length > 0) error (SWT.ERROR_INVALID_ARGUMENT);
return;
}
if (order.length !is columnCount) error (SWT.ERROR_INVALID_ARGUMENT);
bool [] seen = new bool [columnCount];
for (int i = 0; i<order.length; i++) {
int index = order [i];
if (index < 0 || index >= columnCount) error (SWT.ERROR_INVALID_RANGE);
if (seen [index]) error (SWT.ERROR_INVALID_ARGUMENT);
seen [index] = true;
}
void* baseColumn;
for (int i=0; i<order.length; i++) {
auto column = columns [order [i]].handle;
OS.gtk_tree_view_move_column_after (handle, column, baseColumn);
baseColumn = column;
}
}
override void setFontDescription (PangoFontDescription* font) {
super.setFontDescription (font);
TreeColumn[] columns = getColumns ();
for (int i = 0; i < columns.length; i++) {
if (columns[i] !is null) {
columns[i].setFontDescription (font);
}
}
}
/**
* Marks the receiver's header as visible if the argument is <code>true</code>,
* and marks it invisible otherwise.
* <p>
* If one of the receiver's ancestors is not visible or some
* other condition makes the receiver not visible, marking
* it visible may not actually cause it to be displayed.
* </p>
*
* @param show the new visibility state
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public void setHeaderVisible (bool show) {
checkWidget ();
OS.gtk_tree_view_set_headers_visible (handle, show);
}
/**
* Marks the receiver's lines as visible if the argument is <code>true</code>,
* and marks it invisible otherwise.
* <p>
* If one of the receiver's ancestors is not visible or some
* other condition makes the receiver not visible, marking
* it visible may not actually cause it to be displayed.
* </p>
*
* @param show the new visibility state
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public void setLinesVisible (bool show) {
checkWidget();
OS.gtk_tree_view_set_rules_hint (handle, show);
}
override void setParentBackground () {
super.setParentBackground ();
auto window = paintWindow ();
if (window !is null) OS.gdk_window_set_back_pixmap (window, null, true);
}
override void setParentWindow (GtkWidget* widget) {
auto window = eventWindow ();
OS.gtk_widget_set_parent_window (widget, window);
}
void setScrollWidth (GtkTreeViewColumn* column, TreeItem item) {
if (columnCount !is 0 || currentItem is item) return;
/*
* Use GTK_TREE_VIEW_COLUMN_GROW_ONLY on GTK versions < 2.3.2
* because fixed_height_mode is not supported.
*/
if (((style & SWT.VIRTUAL) !is 0) && OS.GTK_VERSION < OS.buildVERSION (2, 3, 2)) return;
int width = OS.gtk_tree_view_column_get_fixed_width (column);
int itemWidth = calculateWidth (column, cast(GtkTreeIter*)item.handle, true);
if (width < itemWidth) {
OS.gtk_tree_view_column_set_fixed_width (column, itemWidth);
}
}
/**
* Sets the receiver's selection to the given item.
* The current selection is cleared before the new item is selected.
* <p>
* If the item is not in the receiver, then it is ignored.
* </p>
*
* @param item the item to select
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the item is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.2
*/
public void setSelection (TreeItem item) {
checkWidget ();
if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
setSelection ([item]);
}
/**
* Sets the receiver's selection to be the given array of items.
* The current selection is cleared before the new items are selected.
* <p>
* Items that are not in the receiver are ignored.
* If the receiver is single-select and multiple items are specified,
* then all items are ignored.
* </p>
*
* @param items the array of items
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#deselectAll()
*/
public void setSelection (TreeItem [] items) {
checkWidget ();
// SWT extension: allow null for zero length string
//if (items is null) error (SWT.ERROR_NULL_ARGUMENT);
deselectAll ();
int length = items.length;
if (length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1)) return;
bool fixColumn = showFirstColumn ();
auto selection = OS.gtk_tree_view_get_selection (handle);
OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
bool first = true;
for (int i = 0; i < length; i++) {
TreeItem item = items [i];
if (item is null) continue;
if (item.isDisposed ()) break;
if (item.parent !is this) continue;
auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
showItem (path, false);
if (first) {
OS.gtk_tree_view_set_cursor (handle, path, null, false);
}
OS.gtk_tree_selection_select_iter (selection, item.handle);
OS.gtk_tree_path_free (path);
first = false;
}
OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
if (fixColumn) hideFirstColumn ();
}
/**
* Sets the column used by the sort indicator for the receiver. A null
* value will clear the sort indicator. The current sort column is cleared
* before the new column is set.
*
* @param column the column used by the sort indicator or <code>null</code>
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.2
*/
public void setSortColumn (TreeColumn column) {
checkWidget ();
if (column !is null && column.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
if (sortColumn !is null && !sortColumn.isDisposed()) {
OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, false);
}
sortColumn = column;
if (sortColumn !is null && sortDirection !is SWT.NONE) {
OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, true);
OS.gtk_tree_view_column_set_sort_order (sortColumn.handle, sortDirection is SWT.DOWN ? 0 : 1);
}
}
/**
* Sets the direction of the sort indicator for the receiver. The value
* can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>.
*
* @param direction the direction of the sort indicator
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.2
*/
public void setSortDirection (int direction) {
checkWidget ();
if (direction !is SWT.UP && direction !is SWT.DOWN && direction !is SWT.NONE) return;
sortDirection = direction;
if (sortColumn is null || sortColumn.isDisposed ()) return;
if (sortDirection is SWT.NONE) {
OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, false);
} else {
OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, true);
OS.gtk_tree_view_column_set_sort_order (sortColumn.handle, sortDirection is SWT.DOWN ? 0 : 1);
}
}
/**
* Sets the item which is currently at the top of the receiver.
* This item can change when items are expanded, collapsed, scrolled
* or new items are added or removed.
*
* @param item the item to be shown
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the item is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#getTopItem()
*
* @since 2.1
*/
public void setTopItem (TreeItem item) {
if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
if (item.parent !is this) return;
auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
showItem (path, false);
OS.gtk_tree_view_scroll_to_cell (handle, path, null, true, 0f, 0f);
if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 0)) {
/*
* Bug in GTK. According to the documentation, gtk_tree_view_scroll_to_cell
* should vertically scroll the cell to the top if use_align is true and row_align is 0.
* However, prior to version 2.8 it does not scroll at all. The fix is to determine
* the new location and use gtk_tree_view_scroll_to_point.
* If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
* will have no effect. Therefore, it is still neccessary to call
* gtk_tree_view_scroll_to_cell.
*/
OS.gtk_widget_realize (handle);
GdkRectangle cellRect;
OS.gtk_tree_view_get_cell_area (handle, path, null, &cellRect);
int tx, ty;
OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, &tx, &ty);
OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
}
OS.gtk_tree_path_free (path);
}
/**
* Shows the column. If the column is already showing in the receiver,
* this method simply returns. Otherwise, the columns are scrolled until
* the column is visible.
*
* @param column the column to be shown
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the item is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.1
*/
public void showColumn (TreeColumn column) {
checkWidget ();
if (column is null) error (SWT.ERROR_NULL_ARGUMENT);
if (column.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
if (column.parent !is this) return;
/*
* This code is intentionally commented. According to the
* documentation, gtk_tree_view_scroll_to_cell should scroll the
* minimum amount to show the column but instead it scrolls strangely.
*/
//OS.gtk_tree_view_scroll_to_cell (handle, 0, column.handle, false, 0, 0);
OS.gtk_widget_realize (handle);
GdkRectangle cellRect;
OS.gtk_tree_view_get_cell_area (handle, null, column.handle, &cellRect);
GdkRectangle visibleRect;
OS.gtk_tree_view_get_visible_rect (handle, &visibleRect);
if (cellRect.x < visibleRect.x) {
OS.gtk_tree_view_scroll_to_point (handle, cellRect.x, -1);
} else {
int width = Math.min (visibleRect.width, cellRect.width);
if (cellRect.x + width > visibleRect.x + visibleRect.width) {
int tree_x = cellRect.x + width - visibleRect.width;
OS.gtk_tree_view_scroll_to_point (handle, tree_x, -1);
}
}
}
bool showFirstColumn () {
/*
* Bug in GTK. If no columns are visible, changing the selection
* will fail. The fix is to temporarily make a column visible.
*/
int columnCount = Math.max (1, this.columnCount);
for (int i=0; i<columnCount; i++) {
auto column = OS.gtk_tree_view_get_column (handle, i);
if (OS.gtk_tree_view_column_get_visible (column)) return false;
}
auto firstColumn = OS.gtk_tree_view_get_column (handle, 0);
OS.gtk_tree_view_column_set_visible (firstColumn, true);
return true;
}
/**
* Shows the selection. If the selection is already showing in the receiver,
* this method simply returns. Otherwise, the items are scrolled until
* the selection is visible.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#showItem(TreeItem)
*/
public void showSelection () {
checkWidget();
TreeItem [] items = getSelection ();
if (items.length !is 0 && items [0] !is null) showItem (items [0]);
}
void showItem (GtkTreePath* path, bool scroll) {
int depth = OS.gtk_tree_path_get_depth (path);
if (depth > 1) {
auto indicesPtr = OS.gtk_tree_path_get_indices (path);
int [] indices = indicesPtr[ 0 .. depth - 1];
auto tempPath = OS.gtk_tree_path_new ();
for (int i=0; i<indices.length; i++) {
OS.gtk_tree_path_append_index (tempPath, indices [i]);
OS.gtk_tree_view_expand_row (handle, tempPath, false);
}
OS.gtk_tree_path_free (tempPath);
}
if (scroll) {
OS.gtk_widget_realize (handle);
GdkRectangle cellRect;
OS.gtk_tree_view_get_cell_area (handle, path, null, &cellRect);
bool isHidden = cellRect.y is 0 && cellRect.height is 0;
int tx, ty;
OS.gtk_tree_view_widget_to_tree_coords (handle, cellRect.x, cellRect.y, &tx, &ty);
GdkRectangle visibleRect;
OS.gtk_tree_view_get_visible_rect (handle, &visibleRect);
if (!isHidden) {
if (ty < visibleRect.y || ty + cellRect.height > visibleRect.y + visibleRect.height) {
isHidden = true;
}
}
if (isHidden) {
/*
* This code intentionally commented.
* Bug in GTK. According to the documentation, gtk_tree_view_scroll_to_cell
* should scroll the minimum amount to show the cell if use_align is false.
* However, what actually happens is the cell is scrolled to the top.
* The fix is to determine the new location and use gtk_tree_view_scroll_to_point.
* If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
* will have no effect. Therefore, it is still neccessary to
* call gtk_tree_view_scroll_to_cell.
*/
// OS.gtk_tree_view_scroll_to_cell (handle, path, 0, depth !is 1, 0.5f, 0.0f);
if (depth !is 1) {
OS.gtk_tree_view_scroll_to_cell (handle, path, null, true, 0.5f, 0.0f);
} else {
if (ty < visibleRect.y ) {
OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
} else {
int height = Math.min (visibleRect.height, cellRect.height);
if (ty + height > visibleRect.y + visibleRect.height) {
OS.gtk_tree_view_scroll_to_point (handle, -1, ty + cellRect.height - visibleRect.height);
}
}
}
}
}
}
/**
* Shows the item. If the item is already showing in the receiver,
* this method simply returns. Otherwise, the items are scrolled
* and expanded until the item is visible.
*
* @param item the item to be shown
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the item is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see Tree#showSelection()
*/
public void showItem (TreeItem item) {
checkWidget ();
if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
if (item.parent !is this) return;
auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
showItem (path, true);
OS.gtk_tree_path_free (path);
}
override void treeSelectionProc (
GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
int[] selection,
int length_)
{
if (selection !is null) {
int index;
OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index);
selection [length_] = index;
}
}
override void updateScrollBarValue (ScrollBar bar) {
super.updateScrollBarValue (bar);
/*
* Bug in GTK. Scrolling changes the XWindow position
* and makes the child widgets appear to scroll even
* though when queried their position is unchanged.
* The fix is to queue a resize event for each child to
* force the position to be corrected.
*/
auto parentHandle = parentingHandle ();
auto list = OS.gtk_container_get_children (parentHandle);
if (list is null) return;
auto temp = list;
while (temp !is null) {
auto widget = OS.g_list_data (temp);
if (widget !is null) OS.gtk_widget_queue_resize (widget);
temp = OS.g_list_next (temp);
}
OS.g_list_free (list);
}
}
|
D
|
/**
This benchmark tests the efficiency of pipelining using AsyncBuf and
Map. We first create an input range for generating a large number of
numeric strings. We then use Map and AsyncBuf to pipeline reading from
this range, converting its values from strings to floats, rounding these
floats to ints, and finding the greatest common divisor of these ints with
the nunmber 8675309.
*/
import std.stdio, std.datetime, std.parallelism, std.random, std.algorithm,
std.range, std.numeric, std.conv, std.getopt;
enum nTake = 1_000_000;
/**This is an input range of random numeric strings.*/
struct StringNums {
Random gen;
string _front;
float maxVal;
this(float maxVal) {
this.maxVal = maxVal;
this.gen = Random(31415); // Random but repeatable.
popFront();
}
string front() @property { return _front; }
void popFront() {
_front = to!string(uniform(0f, maxVal));
}
enum bool empty = false;
}
void main(string[] args) {
uint nCpu = uint.max;
getopt(args, "nCpu", &nCpu);
if(nCpu < uint.max && nCpu > 0) {
defaultPoolThreads = nCpu - 1;
}
auto sw = StopWatch(autoStart);
doSerial();
writefln("Did serial string -> float, euclid in %s milliseconds.",
sw.peek.msecs);
sw.reset();
doParallel();
writefln("Did parallel string -> float, euclid with %s cores in %s milliseconds.",
taskPool.size() + 1, sw.peek.msecs);
}
int gcd8675309(int num) {
return gcd(num, 8675309);
}
void doSerial() {
auto numStrs = StringNums(8675309);
foreach(numStr; take(numStrs, nTake)) {
auto f = to!float(numStr);
auto i = roundTo!int(f);
auto divisor = gcd8675309(i);
}
}
void doParallel() {
auto numStrs = StringNums(8675309);
auto numStrBuf = taskPool.asyncBuf(take(numStrs, nTake), 1024);
auto floats = taskPool.map!(to!float)(numStrBuf);
auto ints = taskPool.map!(to!int)(floats);
auto gcds = taskPool.map!gcd8675309(ints);
foreach(elem; gcds) {}
}
|
D
|
module UnrealScript.UnrealEd.ParticleSystemThumbnailRenderer;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.UnrealEd.TextureThumbnailRenderer;
extern(C++) interface ParticleSystemThumbnailRenderer : TextureThumbnailRenderer
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class UnrealEd.ParticleSystemThumbnailRenderer")); }
private static __gshared ParticleSystemThumbnailRenderer mDefaultProperties;
@property final static ParticleSystemThumbnailRenderer DefaultProperties() { mixin(MGDPC("ParticleSystemThumbnailRenderer", "ParticleSystemThumbnailRenderer UnrealEd.Default__ParticleSystemThumbnailRenderer")); }
}
|
D
|
/**
Pattern based URL router.
Copyright: © 2012 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module vibe.http.router;
public import vibe.http.server;
import vibe.core.log;
import vibe.textfilter.urlencode;
import std.functional;
/**
An interface for HTTP request routers.
*/
interface HTTPRouter : HTTPServerRequestHandler {
/// Adds a new route for request that match the path and method
HTTPRouter match(HTTPMethod method, string path, HTTPServerRequestDelegate cb);
/// ditto
final HTTPRouter match(HTTPMethod method, string path, HTTPServerRequestHandler cb) { return match(method, path, &cb.handleRequest); }
/// ditto
final HTTPRouter match(HTTPMethod method, string path, HTTPServerRequestFunction cb) { return match(method, path, toDelegate(cb)); }
/// Handles the HTTP request by dispatching it to the registered request handlers.
void handleRequest(HTTPServerRequest req, HTTPServerResponse res);
/// Adds a new route for GET requests matching the specified pattern.
final HTTPRouter get(string url_match, HTTPServerRequestHandler cb) { return get(url_match, &cb.handleRequest); }
/// ditto
final HTTPRouter get(string url_match, HTTPServerRequestFunction cb) { return get(url_match, toDelegate(cb)); }
/// ditto
final HTTPRouter get(string url_match, HTTPServerRequestDelegate cb) { return match(HTTPMethod.GET, url_match, cb); }
/// Adds a new route for POST requests matching the specified pattern.
final HTTPRouter post(string url_match, HTTPServerRequestHandler cb) { return post(url_match, &cb.handleRequest); }
/// ditto
final HTTPRouter post(string url_match, HTTPServerRequestFunction cb) { return post(url_match, toDelegate(cb)); }
/// ditto
final HTTPRouter post(string url_match, HTTPServerRequestDelegate cb) { return match(HTTPMethod.POST, url_match, cb); }
/// Adds a new route for PUT requests matching the specified pattern.
final HTTPRouter put(string url_match, HTTPServerRequestHandler cb) { return put(url_match, &cb.handleRequest); }
/// ditto
final HTTPRouter put(string url_match, HTTPServerRequestFunction cb) { return put(url_match, toDelegate(cb)); }
/// ditto
final HTTPRouter put(string url_match, HTTPServerRequestDelegate cb) { return match(HTTPMethod.PUT, url_match, cb); }
/// Adds a new route for DELETE requests matching the specified pattern.
final HTTPRouter delete_(string url_match, HTTPServerRequestHandler cb) { return delete_(url_match, &cb.handleRequest); }
/// ditto
final HTTPRouter delete_(string url_match, HTTPServerRequestFunction cb) { return delete_(url_match, toDelegate(cb)); }
/// ditto
final HTTPRouter delete_(string url_match, HTTPServerRequestDelegate cb) { return match(HTTPMethod.DELETE, url_match, cb); }
/// Adds a new route for PATCH requests matching the specified pattern.
final HTTPRouter patch(string url_match, HTTPServerRequestHandler cb) { return patch(url_match, &cb.handleRequest); }
/// ditto
final HTTPRouter patch(string url_match, HTTPServerRequestFunction cb) { return patch(url_match, toDelegate(cb)); }
/// ditto
final HTTPRouter patch(string url_match, HTTPServerRequestDelegate cb) { return match(HTTPMethod.PATCH, url_match, cb); }
/// Adds a new route for requests matching the specified pattern, regardless of their HTTP verb.
final HTTPRouter any(string url_match, HTTPServerRequestHandler cb) { return any(url_match, &cb.handleRequest); }
/// ditto
final HTTPRouter any(string url_match, HTTPServerRequestFunction cb) { return any(url_match, toDelegate(cb)); }
/// ditto
final HTTPRouter any(string url_match, HTTPServerRequestDelegate cb)
{
return get(url_match, cb).post(url_match, cb)
.put(url_match, cb).delete_(url_match, cb).patch(url_match, cb);
}
}
/// Compatibility alias, will be deprecated soon.
alias HttpRouter = HTTPRouter;
/++
Routes HTTP requests based on the request method and URL.
Routes are matched using a special URL match string that supports two forms of placeholders.
The following example shows how these are used.
Registered routes are matched in the same sequence as initially specified.
Matching ends as soon as a route handler writes a response using res.writeBody()
or similar means. If no route matches or if no route handler writes a response,
the router will simply not handle the request and the HTTP server may generate
a 404 error.
---
void addGroup(HTTPServerRequest req, HTTPServerResponse res)
{
// Route variables are accessible via the params map
logInfo("Getting group %s for user %s.", req.params["groupname"], req.params["username"]);
}
static this()
{
auto router = new URLRouter;
// Matches all GET requests for /users/*/groups/* and places
// the place holders in req.params as 'username' and 'groupname'.
router.get("/users/:username/groups/:groupname", &addGroup);
// Natches all requests. This can be useful for authorization and
// similar tasks. The auth method will only write a response if the
// user is _not_ authorized. Otherwise, the router will fall through
// and continue with the following routes.
router.any("*", &auth);
// Matches a POST request
router.post("/users/:username/delete", &deleteUser);
// Matches all GET requests in /static/ such as /static/img.png or
// /static/styles/sty.css
router.get("/static/*", serveStaticFiles("public/"));
// Setup a HTTP server...
auto settings = new HTTPServerSettings;
// ...
// The router can be directly passed to the listenHTTP function as
// the main request handler.
listenHTTP(settings, router);
}
---
+/
class URLRouter : HTTPRouter {
private {
Route[][HTTPMethod.max+1] m_routes;
}
/// Adds a new route for requests matching the specified HTTP method and pattern.
URLRouter match(HTTPMethod method, string path, HTTPServerRequestDelegate cb)
{
m_routes[method] ~= Route(path, cb);
return this;
}
/// Alias for backwards compatibility
deprecated("Please use match instead.")
alias match addRoute;
/// Handles a HTTP request by dispatching it to the registered route handlers.
void handleRequest(HTTPServerRequest req, HTTPServerResponse res)
{
auto method = req.method;
while(true)
{
if( auto pr = &m_routes[method] ){
foreach( ref r; *pr ){
if( r.matches(req.path, req.params) ){
logTrace("route match: %s -> %s %s", req.path, req.method, r.pattern);
// .. parse fields ..
r.cb(req, res);
if( res.headerWritten )
return;
}
}
}
if( method == HTTPMethod.HEAD ) method = HTTPMethod.GET;
else break;
}
logTrace("no route match: %s %s", req.method, req.requestURL);
}
}
/// Compatibility alias, will be deprecated soon.
alias UrlRouter = URLRouter;
private struct Route {
string pattern;
HTTPServerRequestDelegate cb;
bool matches(string url, ref string[string] params)
const {
size_t i, j;
for( i = 0, j = 0; i < url.length && j < pattern.length; ){
if( pattern[j] == '*' ) return true;
if( url[i] == pattern[j] ){
i++;
j++;
} else if( pattern[j] == ':' ){
j++;
string name = skipPathNode(pattern, j);
string match = skipPathNode(url, i);
params[name] = urlDecode(match);
} else return false;
}
if( j < pattern.length && pattern[j] == '*' )
return true;
return i == url.length && j == pattern.length;
}
}
private string skipPathNode(string str, ref size_t idx)
{
size_t start = idx;
while( idx < str.length && str[idx] != '/' ) idx++;
return str[start .. idx];
}
|
D
|
the sport of siting on the back of a horse while controlling its movements
travel by being carried on horseback
sit and travel on the back of animal, usually while controlling its motions
be carried or travel on or in a vehicle
continue undisturbed and without interference
move like a floating object
harass with persistent criticism or carping
be sustained or supported or borne
have certain properties when driven
be contingent on
lie moored or anchored
sit on and control a vehicle
climb up on the body
ride over, along, or through
keep partially engaged by slightly depressing a pedal with the foot
copulate with
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range;
void get(Args...)(ref Args args)
{
import std.traits, std.meta, std.typecons;
static if (Args.length == 1) {
alias Arg = Args[0];
static if (isArray!Arg) {
static if (isSomeChar!(ElementType!Arg)) {
args[0] = readln.chomp.to!Arg;
} else {
args[0] = readln.split.to!Arg;
}
} else static if (isTuple!Arg) {
auto input = readln.split;
static foreach (i; 0..Fields!Arg.length) {
args[0][i] = input[i].to!(Fields!Arg[i]);
}
} else {
args[0] = readln.chomp.to!Arg;
}
} else {
auto input = readln.split;
assert(input.length == Args.length);
static foreach (i; 0..Args.length) {
args[i] = input[i].to!(Args[i]);
}
}
}
void get_lines(Args...)(size_t N, ref Args args)
{
import std.traits, std.range;
static foreach (i; 0..Args.length) {
static assert(isArray!(Args[i]));
args[i].length = N;
}
foreach (i; 0..N) {
static if (Args.length == 1) {
get(args[0][i]);
} else {
auto input = readln.split;
static foreach (j; 0..Args.length) {
args[j][i] = input[j].to!(ElementType!(Args[j]));
}
}
}
}
enum P = 10L^^9 + 7;
long pow(long x, long n) {
long y = 1;
while (n) {
if (n%2 == 1) y = (y * x) % P;
x = x^^2 % P;
n /= 2;
}
return y;
}
void main()
{
int N; get(N);
int[] AA; get(AA);
if (AA.front != 0) return writeln(0);
auto ps = new long[](AA.maxElement() + 1);
foreach (a; AA) ++ps[a];
if (ps[0] > 1 || ps[1..$].any!"a == 0") return writeln(0);
long r = 1;
foreach (i; 1..ps.length) {
(r *= pow(pow(2, ps[i - 1]) - 1, ps[i])) %= P;
(r *= pow(2, ps[i] * (ps[i] - 1) / 2)) %= P;
}
writeln(r);
}
|
D
|
instance Info_Bau_2_EXIT(C_Info)
{
nr = 999;
condition = Info_Bau_2_EXIT_Condition;
information = Info_Bau_2_EXIT_Info;
permanent = 1;
description = DIALOG_ENDE;
};
func int Info_Bau_2_EXIT_Condition()
{
return 1;
};
func void Info_Bau_2_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance Info_Bau_2_WichtigePersonen(C_Info)
{
nr = 3;
condition = Info_Bau_2_WichtigePersonen_Condition;
information = Info_Bau_2_WichtigePersonen_Info;
permanent = 1;
description = "Pracuješ na rýžových polích dobrovolně?";
};
func int Info_Bau_2_WichtigePersonen_Condition()
{
return 1;
};
func void Info_Bau_2_WichtigePersonen_Info()
{
var C_Npc Ricelord;
AI_Output(other,self,"Info_Bau_2_WichtigePersonen_15_00"); //Pracuješ na rýžových polích dobrovolně?
AI_Output(self,other,"Info_Bau_2_WichtigePersonen_02_01"); //Jasně. V pohodě. Lepší tu pracovat ze své vlastní vůle, než k tomu být donucen hrdlořezy Rýžového Lorda.
AI_Output(other,self,"Info_Bau_2_WichtigePersonen_15_02"); //Aha...
Ricelord = Hlp_GetNpc(Bau_900_Ricelord);
Ricelord.aivar[AIV_FINDABLE] = TRUE;
};
instance Info_Bau_2_DasLager(C_Info)
{
nr = 2;
condition = Info_Bau_2_DasLager_Condition;
information = Info_Bau_2_DasLager_Info;
permanent = 1;
description = "Můžeš mi říci něco o táboře?";
};
func int Info_Bau_2_DasLager_Condition()
{
return 1;
};
func void Info_Bau_2_DasLager_Info()
{
var C_Npc Lee;
var C_Npc Cronos;
AI_Output(other,self,"Info_Bau_2_DasLager_15_00"); //Můžeš mi něco říci o táboře?
AI_Output(self,other,"Info_Bau_2_DasLager_02_01"); //Je nebezpečné tam chodit. Leeovi žoldáci a mágové jsou docela dobří, ale před gaunery se musíš mít na pozoru!
Lee = Hlp_GetNpc(Sld_700_Lee);
Lee.aivar[AIV_FINDABLE] = TRUE;
Cronos = Hlp_GetNpc(KDW_604_Cronos);
Cronos.aivar[AIV_FINDABLE] = TRUE;
};
instance Info_Bau_2_DieLage(C_Info)
{
nr = 1;
condition = Info_Bau_2_DieLage_Condition;
information = Info_Bau_2_DieLage_Info;
permanent = 1;
description = "Jsi v pořádku?";
};
func int Info_Bau_2_DieLage_Condition()
{
return 1;
};
func void Info_Bau_2_DieLage_Info()
{
var C_Npc Ricelord;
AI_Output(other,self,"Info_Bau_2_DieLage_15_00"); //Všechno v pořádku?
AI_Output(self,other,"Info_Bau_2_DieLage_02_01"); //Co chceš? Poslal tě Rýžový Lord? Pracuju, jak nejlépe můžu.
AI_Output(other,self,"Info_Bau_2_DieLage_15_02"); //Nikdo mě neposlal, jen jsem si chtěl popovídat.
Ricelord = Hlp_GetNpc(Bau_900_Ricelord);
Ricelord.aivar[AIV_FINDABLE] = TRUE;
};
instance Info_Bau_2_Wasser(C_Info)
{
nr = 800;
condition = Info_Bau_2_Wasser_Condition;
information = Info_Bau_2_Wasser_Info;
permanent = 1;
description = "Lefty mě poslal. Přinesl jsem ti trochu vody.";
};
func int Info_Bau_2_Wasser_Condition()
{
if((Lefty_Mission == LOG_RUNNING) && Npc_HasItems(other,ItFo_Potion_Water_01) && (self.aivar[AIV_DEALDAY] <= Wld_GetDay()))
{
return 1;
};
};
func void Info_Bau_2_Wasser_Info()
{
AI_Output(other,self,"Info_Bau_2_Wasser_15_00"); //Lefty mě poslal. Přinesl jsem ti trochu vody.
if(Npc_HasItems(other,ItFo_Potion_Water_01) >= 1)
{
AI_Output(self,other,"Info_Bau_2_Wasser_02_01"); //Díky, kamaráde. Umírám žízní!
B_GiveInvItems(other,self,ItFo_Potion_Water_01,1);
if(C_BodyStateContains(self,BS_SIT))
{
AI_Standup(self);
AI_TurnToNPC(self,hero);
};
AI_UseItem(self,ItFo_Potion_Water_01);
An_Bauern_verteilt = An_Bauern_verteilt + 1;
if(An_Bauern_verteilt >= DurstigeBauern)
{
Lefty_Mission = LOG_SUCCESS;
};
self.aivar[AIV_DEALDAY] = Wld_GetDay() + 1;
}
else
{
AI_Output(self,other,"Info_Bau_2_Wasser_NOWATER_02_00"); //Voda! Poslyš, už ti žádná nezbyla! Neříkej mi, že všichni kromě mě dostali?
};
};
func void B_AssignAmbientInfos_Bau_2(var C_Npc slf)
{
Info_Bau_2_EXIT.npc = Hlp_GetInstanceID(slf);
Info_Bau_2_WichtigePersonen.npc = Hlp_GetInstanceID(slf);
Info_Bau_2_DasLager.npc = Hlp_GetInstanceID(slf);
Info_Bau_2_DieLage.npc = Hlp_GetInstanceID(slf);
Info_Bau_2_Wasser.npc = Hlp_GetInstanceID(slf);
};
|
D
|
import std.stdio;
void main()
{
writeln("linux/main.d");
}
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/glue.d, _glue.d)
* Documentation: $(LINK https://dlang.org/phobos/dmd_glue.html)
* Coverage: $(LINK https://codecov.io/gh/dlang/dmd/src/master/src/dmd/glue.d)
*/
module dmd.glue;
import core.stdc.stdio;
import core.stdc.string;
import core.stdc.stdlib;
import dmd.root.array;
import dmd.root.file;
import dmd.root.filename;
import dmd.root.outbuffer;
import dmd.root.rmem;
import dmd.backend.cdef;
import dmd.backend.cc;
import dmd.backend.code;
import dmd.backend.dt;
import dmd.backend.el;
import dmd.backend.global;
import dmd.backend.obj;
import dmd.backend.oper;
import dmd.backend.outbuf;
import dmd.backend.rtlsym;
import dmd.backend.ty;
import dmd.backend.type;
import dmd.aggregate;
import dmd.arraytypes;
import dmd.blockexit;
import dmd.dclass;
import dmd.declaration;
import dmd.dmangle;
import dmd.dmodule;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dtemplate;
import dmd.e2ir;
import dmd.errors;
import dmd.expression;
import dmd.func;
import dmd.globals;
import dmd.identifier;
import dmd.id;
import dmd.irstate;
import dmd.lib;
import dmd.mtype;
import dmd.objc_glue;
import dmd.s2ir;
import dmd.statement;
import dmd.target;
import dmd.tocsym;
import dmd.toctype;
import dmd.toir;
import dmd.toobj;
import dmd.typesem;
import dmd.utils;
extern (C++):
alias symbols = Array!(Symbol*);
alias toSymbol = dmd.tocsym.toSymbol;
//extern
__gshared
{
elem *eictor;
Symbol *ictorlocalgot;
symbols sctors;
StaticDtorDeclarations ectorgates;
symbols sdtors;
symbols stests;
symbols ssharedctors;
SharedStaticDtorDeclarations esharedctorgates;
symbols sshareddtors;
char *lastmname;
}
/**************************************
* Append s to list of object files to generate later.
*/
__gshared Dsymbols obj_symbols_towrite;
void obj_append(Dsymbol s)
{
//printf("deferred: %s\n", s.toChars());
obj_symbols_towrite.push(s);
}
void obj_write_deferred(Library library)
{
for (size_t i = 0; i < obj_symbols_towrite.dim; i++)
{
Dsymbol s = obj_symbols_towrite[i];
Module m = s.getModule();
char *mname;
if (m)
{
mname = cast(char*)m.srcfile.toChars();
lastmname = mname;
}
else
{
//mname = s.ident.toChars();
mname = lastmname;
assert(mname);
}
obj_start(mname);
__gshared int count;
count++; // sequence for generating names
/* Create a module that's a doppelganger of m, with just
* enough to be able to create the moduleinfo.
*/
OutBuffer idbuf;
idbuf.printf("%s.%d", m ? m.ident.toChars() : mname, count);
char *idstr = idbuf.peekString();
if (!m)
{
// it doesn't make sense to make up a module if we don't know where to put the symbol
// so output it into it's own object file without ModuleInfo
objmod.initfile(idstr, null, mname);
toObjFile(s, false);
objmod.termfile();
}
else
{
idbuf.data = null;
Identifier id = Identifier.create(idstr);
Module md = Module.create(mname, id, 0, 0);
md.members = new Dsymbols();
md.members.push(s); // its only 'member' is s
md.doppelganger = 1; // identify this module as doppelganger
md.md = m.md;
md.aimports.push(m); // it only 'imports' m
genObjFile(md, false);
}
/* Set object file name to be source name with sequence number,
* as mangled symbol names get way too long.
*/
const(char)* fname = FileName.removeExt(mname);
OutBuffer namebuf;
uint hash = 0;
for (const(char)* p = s.toChars(); *p; p++)
hash += *p;
namebuf.printf("%s_%x_%x.%s", fname, count, hash, global.obj_ext);
FileName.free(cast(char *)fname);
fname = namebuf.extractString();
//printf("writing '%s'\n", fname);
File *objfile = File.create(fname);
obj_end(library, objfile);
}
obj_symbols_towrite.dim = 0;
}
/***********************************************
* Generate function that calls array of functions and gates.
* Params:
* m = module symbol (for name mangling purposes)
* sctors = array of functions
* ectorgates = array of gates
* id = identifier string for generator function
* Returns:
* function Symbol generated
*/
private Symbol *callFuncsAndGates(Module m, symbols *sctors, StaticDtorDeclarations *ectorgates,
const(char)* id)
{
Symbol *sctor = null;
if ((sctors && sctors.dim) ||
(ectorgates && ectorgates.dim))
{
__gshared type *t;
if (!t)
{
/* t will be the type of the functions generated:
* extern (C) void func();
*/
t = type_function(TYnfunc, null, 0, false, tstypes[TYvoid]);
t.Tmangle = mTYman_c;
}
localgot = null;
sctor = toSymbolX(m, id, SCglobal, t, "FZv");
cstate.CSpsymtab = &sctor.Sfunc.Flocsym;
elem *ector = null;
if (ectorgates)
{
for (size_t i = 0; i < ectorgates.dim; i++)
{ StaticDtorDeclaration f = (*ectorgates)[i];
Symbol *s = toSymbol(f.vgate);
elem *e = el_var(s);
e = el_bin(OPaddass, TYint, e, el_long(TYint, 1));
ector = el_combine(ector, e);
}
}
if (sctors)
{
for (size_t i = 0; i < sctors.dim; i++)
{ Symbol *s = (*sctors)[i];
elem *e = el_una(OPucall, TYvoid, el_var(s));
ector = el_combine(ector, e);
}
}
block *b = block_calloc();
b.BC = BCret;
b.Belem = ector;
sctor.Sfunc.Fstartline.Sfilename = m.arg;
sctor.Sfunc.Fstartblock = b;
writefunc(sctor);
}
return sctor;
}
/**************************************
* Prepare for generating obj file.
*/
__gshared Outbuffer objbuf;
void obj_start(char *srcfile)
{
//printf("obj_start()\n");
rtlsym_reset();
clearStringTab();
version (Windows)
{
// Produce Ms COFF files for 64 bit code, OMF for 32 bit code
assert(objbuf.size() == 0);
objmod = global.params.mscoff ? MsCoffObj.init(&objbuf, srcfile, null)
: Obj.init(&objbuf, srcfile, null);
}
else
{
objmod = Obj.init(&objbuf, srcfile, null);
}
el_reset();
cg87_reset();
out_reset();
}
void obj_end(Library library, File *objfile)
{
const(char)* objfilename = objfile.name.toChars();
objmod.term(objfilename);
//delete objmod;
objmod = null;
if (library)
{
// Transfer image to library
library.addObject(objfilename, objbuf.buf[0 .. objbuf.p - objbuf.buf]);
objbuf.buf = null;
}
else
{
// Transfer image to file
objfile.setbuffer(objbuf.buf, objbuf.p - objbuf.buf);
objbuf.buf = null;
ensurePathToNameExists(Loc(), objfilename);
//printf("write obj %s\n", objfilename);
writeFile(Loc(), objfile);
}
objbuf.pend = null;
objbuf.p = null;
}
bool obj_includelib(const(char)* name)
{
return objmod.includelib(name);
}
void obj_startaddress(Symbol *s)
{
return objmod.startaddress(s);
}
/**************************************
* Generate .obj file for Module.
*/
void genObjFile(Module m, bool multiobj)
{
//EEcontext *ee = env.getEEcontext();
//printf("Module.genobjfile(multiobj = %d) %s\n", multiobj, m.toChars());
if (m.ident == Id.entrypoint)
{
bool v = global.params.verbose;
global.params.verbose = false;
for (size_t i = 0; i < m.members.dim; i++)
{
Dsymbol member = (*m.members)[i];
//printf("toObjFile %s %s\n", member.kind(), member.toChars());
toObjFile(member, global.params.multiobj);
}
global.params.verbose = v;
return;
}
lastmname = cast(char*)m.srcfile.toChars();
objmod.initfile(lastmname, null, m.toPrettyChars());
eictor = null;
ictorlocalgot = null;
sctors.setDim(0);
ectorgates.setDim(0);
sdtors.setDim(0);
ssharedctors.setDim(0);
esharedctorgates.setDim(0);
sshareddtors.setDim(0);
stests.setDim(0);
if (m.doppelganger)
{
/* Generate a reference to the moduleinfo, so the module constructors
* and destructors get linked in.
*/
Module mod = m.aimports[0];
assert(mod);
if (mod.sictor || mod.sctor || mod.sdtor || mod.ssharedctor || mod.sshareddtor)
{
Symbol *s = toSymbol(mod);
//objextern(s);
//if (!s.Sxtrnnum) objextdef(s.Sident);
if (!s.Sxtrnnum)
{
//printf("%s\n", s.Sident);
//#if 0 /* This should work, but causes optlink to fail in common/newlib.asm */
// objextdef(s.Sident);
//#else
Symbol *sref = symbol_generate(SCstatic, type_fake(TYnptr));
sref.Sfl = FLdata;
scope dtb = new DtBuilder();
dtb.xoff(s, 0, TYnptr);
sref.Sdt = dtb.finish();
outdata(sref);
//#endif
}
}
}
if (global.params.cov)
{
/* Create coverage identifier:
* private uint[numlines] __coverage;
*/
m.cov = symbol_calloc("__coverage");
m.cov.Stype = type_fake(TYint);
m.cov.Stype.Tmangle = mTYman_c;
m.cov.Stype.Tcount++;
m.cov.Sclass = SCstatic;
m.cov.Sfl = FLdata;
scope dtb = new DtBuilder();
dtb.nzeros(4 * m.numlines);
m.cov.Sdt = dtb.finish();
outdata(m.cov);
m.covb = cast(uint *)calloc((m.numlines + 32) / 32, (*m.covb).sizeof);
}
for (size_t i = 0; i < m.members.dim; i++)
{
Dsymbol member = (*m.members)[i];
//printf("toObjFile %s %s\n", member.kind(), member.toChars());
toObjFile(member, multiobj);
}
if (global.params.cov)
{
/* Generate
* private bit[numlines] __bcoverage;
*/
Symbol *bcov = symbol_calloc("__bcoverage");
bcov.Stype = type_fake(TYuint);
bcov.Stype.Tcount++;
bcov.Sclass = SCstatic;
bcov.Sfl = FLdata;
scope dtb = new DtBuilder();
dtb.nbytes((m.numlines + 32) / 32 * (*m.covb).sizeof, cast(char *)m.covb);
bcov.Sdt = dtb.finish();
outdata(bcov);
free(m.covb);
m.covb = null;
/* Generate:
* _d_cover_register(uint[] __coverage, BitArray __bcoverage, string filename);
* and prepend it to the static constructor.
*/
/* t will be the type of the functions generated:
* extern (C) void func();
*/
type *t = type_function(TYnfunc, null, 0, false, tstypes[TYvoid]);
t.Tmangle = mTYman_c;
m.sictor = toSymbolX(m, "__modictor", SCglobal, t, "FZv");
cstate.CSpsymtab = &m.sictor.Sfunc.Flocsym;
localgot = ictorlocalgot;
elem *ecov = el_pair(TYdarray, el_long(TYsize_t, m.numlines), el_ptr(m.cov));
elem *ebcov = el_pair(TYdarray, el_long(TYsize_t, m.numlines), el_ptr(bcov));
if (config.exe == EX_WIN64)
{
ecov = addressElem(ecov, Type.tvoid.arrayOf(), false);
ebcov = addressElem(ebcov, Type.tvoid.arrayOf(), false);
}
elem *efilename = toEfilename(m);
if (config.exe == EX_WIN64)
efilename = addressElem(efilename, Type.tstring, true);
elem *e = el_params(
el_long(TYuchar, global.params.covPercent),
ecov,
ebcov,
efilename,
null);
e = el_bin(OPcall, TYvoid, el_var(getRtlsym(RTLSYM_DCOVER2)), e);
eictor = el_combine(e, eictor);
ictorlocalgot = localgot;
}
// If coverage / static constructor / destructor / unittest calls
if (eictor || sctors.dim || ectorgates.dim || sdtors.dim ||
ssharedctors.dim || esharedctorgates.dim || sshareddtors.dim || stests.dim)
{
if (eictor)
{
localgot = ictorlocalgot;
block *b = block_calloc();
b.BC = BCret;
b.Belem = eictor;
m.sictor.Sfunc.Fstartline.Sfilename = m.arg;
m.sictor.Sfunc.Fstartblock = b;
writefunc(m.sictor);
}
m.sctor = callFuncsAndGates(m, &sctors, &ectorgates, "__modctor");
m.sdtor = callFuncsAndGates(m, &sdtors, null, "__moddtor");
m.ssharedctor = callFuncsAndGates(m, &ssharedctors, cast(StaticDtorDeclarations *)&esharedctorgates, "__modsharedctor");
m.sshareddtor = callFuncsAndGates(m, &sshareddtors, null, "__modshareddtor");
m.stest = callFuncsAndGates(m, &stests, null, "__modtest");
if (m.doppelganger)
genModuleInfo(m);
}
if (m.doppelganger)
{
objc.generateModuleInfo();
objmod.termfile();
return;
}
/* Generate module info for templates and -cov.
* Don't generate ModuleInfo if `object.ModuleInfo` is not declared or
* explicitly disabled through compiler switches such as `-betterC`.
*/
if (global.params.useModuleInfo && Module.moduleinfo /*|| needModuleInfo()*/)
genModuleInfo(m);
objmod.termfile();
}
/**************************************
* Search for a druntime array op
*/
bool isDruntimeArrayOp(Identifier ident)
{
/* Some of the array op functions are written as library functions,
* presumably to optimize them with special CPU vector instructions.
* List those library functions here, in alpha order.
*/
__gshared const(char)*[143] libArrayopFuncs =
[
"_arrayExpSliceAddass_a",
"_arrayExpSliceAddass_d",
"_arrayExpSliceAddass_f", // T[]+=T
"_arrayExpSliceAddass_g",
"_arrayExpSliceAddass_h",
"_arrayExpSliceAddass_i",
"_arrayExpSliceAddass_k",
"_arrayExpSliceAddass_s",
"_arrayExpSliceAddass_t",
"_arrayExpSliceAddass_u",
"_arrayExpSliceAddass_w",
"_arrayExpSliceDivass_d", // T[]/=T
"_arrayExpSliceDivass_f", // T[]/=T
"_arrayExpSliceMinSliceAssign_a",
"_arrayExpSliceMinSliceAssign_d", // T[]=T-T[]
"_arrayExpSliceMinSliceAssign_f", // T[]=T-T[]
"_arrayExpSliceMinSliceAssign_g",
"_arrayExpSliceMinSliceAssign_h",
"_arrayExpSliceMinSliceAssign_i",
"_arrayExpSliceMinSliceAssign_k",
"_arrayExpSliceMinSliceAssign_s",
"_arrayExpSliceMinSliceAssign_t",
"_arrayExpSliceMinSliceAssign_u",
"_arrayExpSliceMinSliceAssign_w",
"_arrayExpSliceMinass_a",
"_arrayExpSliceMinass_d", // T[]-=T
"_arrayExpSliceMinass_f", // T[]-=T
"_arrayExpSliceMinass_g",
"_arrayExpSliceMinass_h",
"_arrayExpSliceMinass_i",
"_arrayExpSliceMinass_k",
"_arrayExpSliceMinass_s",
"_arrayExpSliceMinass_t",
"_arrayExpSliceMinass_u",
"_arrayExpSliceMinass_w",
"_arrayExpSliceMulass_d", // T[]*=T
"_arrayExpSliceMulass_f", // T[]*=T
"_arrayExpSliceMulass_i",
"_arrayExpSliceMulass_k",
"_arrayExpSliceMulass_s",
"_arrayExpSliceMulass_t",
"_arrayExpSliceMulass_u",
"_arrayExpSliceMulass_w",
"_arraySliceExpAddSliceAssign_a",
"_arraySliceExpAddSliceAssign_d", // T[]=T[]+T
"_arraySliceExpAddSliceAssign_f", // T[]=T[]+T
"_arraySliceExpAddSliceAssign_g",
"_arraySliceExpAddSliceAssign_h",
"_arraySliceExpAddSliceAssign_i",
"_arraySliceExpAddSliceAssign_k",
"_arraySliceExpAddSliceAssign_s",
"_arraySliceExpAddSliceAssign_t",
"_arraySliceExpAddSliceAssign_u",
"_arraySliceExpAddSliceAssign_w",
"_arraySliceExpDivSliceAssign_d", // T[]=T[]/T
"_arraySliceExpDivSliceAssign_f", // T[]=T[]/T
"_arraySliceExpMinSliceAssign_a",
"_arraySliceExpMinSliceAssign_d", // T[]=T[]-T
"_arraySliceExpMinSliceAssign_f", // T[]=T[]-T
"_arraySliceExpMinSliceAssign_g",
"_arraySliceExpMinSliceAssign_h",
"_arraySliceExpMinSliceAssign_i",
"_arraySliceExpMinSliceAssign_k",
"_arraySliceExpMinSliceAssign_s",
"_arraySliceExpMinSliceAssign_t",
"_arraySliceExpMinSliceAssign_u",
"_arraySliceExpMinSliceAssign_w",
"_arraySliceExpMulSliceAddass_d", // T[] += T[]*T
"_arraySliceExpMulSliceAddass_f",
"_arraySliceExpMulSliceAddass_r",
"_arraySliceExpMulSliceAssign_d", // T[]=T[]*T
"_arraySliceExpMulSliceAssign_f", // T[]=T[]*T
"_arraySliceExpMulSliceAssign_i",
"_arraySliceExpMulSliceAssign_k",
"_arraySliceExpMulSliceAssign_s",
"_arraySliceExpMulSliceAssign_t",
"_arraySliceExpMulSliceAssign_u",
"_arraySliceExpMulSliceAssign_w",
"_arraySliceExpMulSliceMinass_d", // T[] -= T[]*T
"_arraySliceExpMulSliceMinass_f",
"_arraySliceExpMulSliceMinass_r",
"_arraySliceSliceAddSliceAssign_a",
"_arraySliceSliceAddSliceAssign_d", // T[]=T[]+T[]
"_arraySliceSliceAddSliceAssign_f", // T[]=T[]+T[]
"_arraySliceSliceAddSliceAssign_g",
"_arraySliceSliceAddSliceAssign_h",
"_arraySliceSliceAddSliceAssign_i",
"_arraySliceSliceAddSliceAssign_k",
"_arraySliceSliceAddSliceAssign_r", // T[]=T[]+T[]
"_arraySliceSliceAddSliceAssign_s",
"_arraySliceSliceAddSliceAssign_t",
"_arraySliceSliceAddSliceAssign_u",
"_arraySliceSliceAddSliceAssign_w",
"_arraySliceSliceAddass_a",
"_arraySliceSliceAddass_d", // T[]+=T[]
"_arraySliceSliceAddass_f", // T[]+=T[]
"_arraySliceSliceAddass_g",
"_arraySliceSliceAddass_h",
"_arraySliceSliceAddass_i",
"_arraySliceSliceAddass_k",
"_arraySliceSliceAddass_s",
"_arraySliceSliceAddass_t",
"_arraySliceSliceAddass_u",
"_arraySliceSliceAddass_w",
"_arraySliceSliceMinSliceAssign_a",
"_arraySliceSliceMinSliceAssign_d", // T[]=T[]-T[]
"_arraySliceSliceMinSliceAssign_f", // T[]=T[]-T[]
"_arraySliceSliceMinSliceAssign_g",
"_arraySliceSliceMinSliceAssign_h",
"_arraySliceSliceMinSliceAssign_i",
"_arraySliceSliceMinSliceAssign_k",
"_arraySliceSliceMinSliceAssign_r", // T[]=T[]-T[]
"_arraySliceSliceMinSliceAssign_s",
"_arraySliceSliceMinSliceAssign_t",
"_arraySliceSliceMinSliceAssign_u",
"_arraySliceSliceMinSliceAssign_w",
"_arraySliceSliceMinass_a",
"_arraySliceSliceMinass_d", // T[]-=T[]
"_arraySliceSliceMinass_f", // T[]-=T[]
"_arraySliceSliceMinass_g",
"_arraySliceSliceMinass_h",
"_arraySliceSliceMinass_i",
"_arraySliceSliceMinass_k",
"_arraySliceSliceMinass_s",
"_arraySliceSliceMinass_t",
"_arraySliceSliceMinass_u",
"_arraySliceSliceMinass_w",
"_arraySliceSliceMulSliceAssign_d", // T[]=T[]*T[]
"_arraySliceSliceMulSliceAssign_f", // T[]=T[]*T[]
"_arraySliceSliceMulSliceAssign_i",
"_arraySliceSliceMulSliceAssign_k",
"_arraySliceSliceMulSliceAssign_s",
"_arraySliceSliceMulSliceAssign_t",
"_arraySliceSliceMulSliceAssign_u",
"_arraySliceSliceMulSliceAssign_w",
"_arraySliceSliceMulass_d", // T[]*=T[]
"_arraySliceSliceMulass_f", // T[]*=T[]
"_arraySliceSliceMulass_i",
"_arraySliceSliceMulass_k",
"_arraySliceSliceMulass_s",
"_arraySliceSliceMulass_t",
"_arraySliceSliceMulass_u",
"_arraySliceSliceMulass_w",
];
const(char)* name = ident.toChars();
int i = binary(name, libArrayopFuncs.ptr, libArrayopFuncs.length);
if (i != -1)
return true;
debug // Make sure our array is alphabetized
{
for (i = 0; i < libArrayopFuncs.length; i++)
{
if (strcmp(name, libArrayopFuncs[i]) == 0)
assert(0);
}
}
return false;
}
/* ================================================================== */
UnitTestDeclaration needsDeferredNested(FuncDeclaration fd)
{
while (fd && fd.isNested())
{
FuncDeclaration fdp = fd.toParent2().isFuncDeclaration();
if (!fdp)
break;
if (UnitTestDeclaration udp = fdp.isUnitTestDeclaration())
return udp.semanticRun < PASSobj ? udp : null;
fd = fdp;
}
return null;
}
void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj)
{
ClassDeclaration cd = fd.parent.isClassDeclaration();
//printf("FuncDeclaration.toObjFile(%p, %s.%s)\n", fd, fd.parent.toChars(), fd.toChars());
//if (type) printf("type = %s\n", type.toChars());
version (none)
{
//printf("line = %d\n", getWhere() / LINEINC);
EEcontext *ee = env.getEEcontext();
if (ee.EEcompile == 2)
{
if (ee.EElinnum < (getWhere() / LINEINC) ||
ee.EElinnum > (endwhere / LINEINC)
)
return; // don't compile this function
ee.EEfunc = toSymbol(this);
}
}
if (fd.semanticRun >= PASSobj) // if toObjFile() already run
return;
if (fd.type && fd.type.ty == Tfunction && (cast(TypeFunction)fd.type).next is null)
return;
// If errors occurred compiling it, such as https://issues.dlang.org/show_bug.cgi?id=6118
if (fd.type && fd.type.ty == Tfunction && (cast(TypeFunction)fd.type).next.ty == Terror)
return;
if (fd.semantic3Errors)
return;
if (global.errors)
return;
if (!fd.fbody)
return;
UnitTestDeclaration ud = fd.isUnitTestDeclaration();
if (ud && !global.params.useUnitTests)
return;
if (multiobj && !fd.isStaticDtorDeclaration() && !fd.isStaticCtorDeclaration())
{
obj_append(fd);
return;
}
if (fd.semanticRun == PASSsemanticdone)
{
/* What happened is this function failed semantic3() with errors,
* but the errors were gagged.
* Try to reproduce those errors, and then fail.
*/
fd.error("errors compiling the function");
return;
}
assert(fd.semanticRun == PASSsemantic3done);
assert(fd.ident != Id.empty);
for (FuncDeclaration fd2 = fd; fd2; )
{
if (fd2.inNonRoot())
return;
if (fd2.isNested())
fd2 = fd2.toParent2().isFuncDeclaration();
else
break;
}
if (UnitTestDeclaration udp = needsDeferredNested(fd))
{
/* Can't do unittest's out of order, they are order dependent in that their
* execution is done in lexical order.
*/
udp.deferredNested.push(fd);
//printf("%s @[%s]\n\t-. pushed to unittest @[%s]\n",
// fd.toPrettyChars(), fd.loc.toChars(), udp.loc.toChars());
return;
}
if (fd.isArrayOp && isDruntimeArrayOp(fd.ident))
{
// Implementation is in druntime
return;
}
// start code generation
fd.semanticRun = PASSobj;
if (global.params.verbose)
fprintf(global.stdmsg, "function %s\n", fd.toPrettyChars());
Symbol *s = toSymbol(fd);
func_t *f = s.Sfunc;
// tunnel type of "this" to debug info generation
if (AggregateDeclaration ad = fd.parent.isAggregateDeclaration())
{
.type* t = Type_toCtype(ad.getType());
if (cd)
t = t.Tnext; // skip reference
f.Fclass = cast(Classsym *)t;
}
/* This is done so that the 'this' pointer on the stack is the same
* distance away from the function parameters, so that an overriding
* function can call the nested fdensure or fdrequire of its overridden function
* and the stack offsets are the same.
*/
if (fd.isVirtual() && (fd.fensure || fd.frequire))
f.Fflags3 |= Ffakeeh;
if (fd.eh_none)
// Same as config.ehmethod==EH_NONE, but only for this function
f.Fflags3 |= Feh_none;
s.Sclass = global.params.isOSX ? SCcomdat : SCglobal;
for (Dsymbol p = fd.parent; p; p = p.parent)
{
if (p.isTemplateInstance())
{
s.Sclass = SCcomdat;
break;
}
}
/* Vector operations should be comdat's
*/
if (fd.isArrayOp)
s.Sclass = SCcomdat;
if (fd.inlinedNestedCallees)
{
/* https://issues.dlang.org/show_bug.cgi?id=15333
* If fd contains inlined expressions that come from
* nested function bodies, the enclosing of the functions must be
* generated first, in order to calculate correct frame pointer offset.
*/
for (size_t i = 0; i < fd.inlinedNestedCallees.dim; i++)
{
FuncDeclaration fdc = (*fd.inlinedNestedCallees)[i];
FuncDeclaration fp = fdc.toParent2().isFuncDeclaration();
if (fp && fp.semanticRun < PASSobj)
{
toObjFile(fp, multiobj);
}
}
}
if (fd.isNested())
{
//if (!(config.flags3 & CFG3pic))
// s.Sclass = SCstatic;
f.Fflags3 |= Fnested;
/* The enclosing function must have its code generated first,
* in order to calculate correct frame pointer offset.
*/
FuncDeclaration fdp = fd.toParent2().isFuncDeclaration();
if (fdp && fdp.semanticRun < PASSobj)
{
toObjFile(fdp, multiobj);
}
}
else
{
const(char)* libname = (global.params.symdebug)
? global.params.debuglibname
: global.params.defaultlibname;
// Pull in RTL startup code (but only once)
if (fd.isMain() && onlyOneMain(fd.loc))
{
if (global.params.isLinux || global.params.isOSX || global.params.isFreeBSD ||
global.params.isOpenBSD || global.params.isSolaris)
{
objmod.external_def("_main");
}
else if (global.params.mscoff)
{
objmod.external_def("main");
}
else if (config.exe == EX_WIN32)
{
objmod.external_def("_main");
objmod.external_def("__acrtused_con");
}
objmod.includelib(libname);
s.Sclass = SCglobal;
}
else if (fd.isRtInit())
{
if (global.params.isLinux || global.params.isOSX || global.params.isFreeBSD ||
global.params.isOpenBSD || global.params.isSolaris ||
global.params.mscoff)
{
objmod.ehsections(); // initialize exception handling sections
}
}
else if (fd.isCMain())
{
if (global.params.mscoff)
{
if (global.params.mscrtlib && global.params.mscrtlib[0])
objmod.includelib(global.params.mscrtlib);
objmod.includelib("OLDNAMES");
}
else if (config.exe == EX_WIN32)
{
objmod.external_def("__acrtused_con"); // bring in C startup code
objmod.includelib("snn.lib"); // bring in C runtime library
}
s.Sclass = SCglobal;
}
else if (global.params.isWindows && fd.isWinMain() && onlyOneMain(fd.loc))
{
if (global.params.mscoff)
{
objmod.includelib("uuid");
if (global.params.mscrtlib && global.params.mscrtlib[0])
objmod.includelib(global.params.mscrtlib);
objmod.includelib("OLDNAMES");
}
else
{
objmod.external_def("__acrtused");
}
objmod.includelib(libname);
s.Sclass = SCglobal;
}
// Pull in RTL startup code
else if (global.params.isWindows && fd.isDllMain() && onlyOneMain(fd.loc))
{
if (global.params.mscoff)
{
objmod.includelib("uuid");
if (global.params.mscrtlib && global.params.mscrtlib[0])
objmod.includelib(global.params.mscrtlib);
objmod.includelib("OLDNAMES");
}
else
{
objmod.external_def("__acrtused_dll");
}
objmod.includelib(libname);
s.Sclass = SCglobal;
}
}
symtab_t *symtabsave = cstate.CSpsymtab;
cstate.CSpsymtab = &f.Flocsym;
// Find module m for this function
Module m = null;
for (Dsymbol p = fd.parent; p; p = p.parent)
{
m = p.isModule();
if (m)
break;
}
Dsymbols deferToObj; // write these to OBJ file later
Array!(elem*) varsInScope;
Label*[void*] labels = null;
IRState irs = IRState(m, fd, &varsInScope, &deferToObj, &labels);
Symbol *shidden = null;
Symbol *sthis = null;
tym_t tyf = tybasic(s.Stype.Tty);
//printf("linkage = %d, tyf = x%x\n", linkage, tyf);
int reverse = tyrevfunc(s.Stype.Tty);
assert(fd.type.ty == Tfunction);
TypeFunction tf = cast(TypeFunction)fd.type;
RET retmethod = retStyle(tf);
if (retmethod == RETstack)
{
// If function returns a struct, put a pointer to that
// as the first argument
.type *thidden = Type_toCtype(tf.next.pointerTo());
char[5+4+1] hiddenparam = void;
__gshared int hiddenparami; // how many we've generated so far
sprintf(hiddenparam.ptr,"__HID%d",++hiddenparami);
shidden = symbol_name(hiddenparam.ptr,SCparameter,thidden);
shidden.Sflags |= SFLtrue | SFLfree;
if (fd.nrvo_can && fd.nrvo_var && fd.nrvo_var.nestedrefs.dim)
type_setcv(&shidden.Stype, shidden.Stype.Tty | mTYvolatile);
irs.shidden = shidden;
fd.shidden = shidden;
}
else
{
// Register return style cannot make nrvo.
// Auto functions keep the nrvo_can flag up to here,
// so we should eliminate it before entering backend.
fd.nrvo_can = 0;
}
if (fd.vthis)
{
assert(!fd.vthis.csym);
sthis = toSymbol(fd.vthis);
irs.sthis = sthis;
if (!(f.Fflags3 & Fnested))
f.Fflags3 |= Fmember;
}
// Estimate number of parameters, pi
size_t pi = (fd.v_arguments !is null);
if (fd.parameters)
pi += fd.parameters.dim;
// Create a temporary buffer, params[], to hold function parameters
Symbol*[10] paramsbuf = void;
Symbol **params = paramsbuf.ptr; // allocate on stack if possible
if (pi + 2 > paramsbuf.length) // allow extra 2 for sthis and shidden
{
params = cast(Symbol **)malloc((pi + 2) * (Symbol *).sizeof);
assert(params);
}
// Get the actual number of parameters, pi, and fill in the params[]
pi = 0;
if (fd.v_arguments)
{
params[pi] = toSymbol(fd.v_arguments);
pi += 1;
}
if (fd.parameters)
{
for (size_t i = 0; i < fd.parameters.dim; i++)
{
VarDeclaration v = (*fd.parameters)[i];
//printf("param[%d] = %p, %s\n", i, v, v.toChars());
assert(!v.csym);
params[pi + i] = toSymbol(v);
}
pi += fd.parameters.dim;
}
if (reverse)
{
// Reverse params[] entries
for (size_t i = 0; i < pi/2; i++)
{
Symbol *sptmp = params[i];
params[i] = params[pi - 1 - i];
params[pi - 1 - i] = sptmp;
}
}
if (shidden)
{
// shidden becomes last parameter
//params[pi] = shidden;
// shidden becomes first parameter
memmove(params + 1, params, pi * (params[0]).sizeof);
params[0] = shidden;
pi++;
}
if (sthis)
{
// sthis becomes last parameter
//params[pi] = sthis;
// sthis becomes first parameter
memmove(params + 1, params, pi * (params[0]).sizeof);
params[0] = sthis;
pi++;
}
if ((global.params.isLinux || global.params.isOSX || global.params.isFreeBSD || global.params.isSolaris) &&
fd.linkage != LINKd && shidden && sthis)
{
/* swap shidden and sthis
*/
Symbol *sp = params[0];
params[0] = params[1];
params[1] = sp;
}
for (size_t i = 0; i < pi; i++)
{
Symbol *sp = params[i];
sp.Sclass = SCparameter;
sp.Sflags &= ~SFLspill;
sp.Sfl = FLpara;
symbol_add(sp);
}
// Determine register assignments
if (pi)
{
FuncParamRegs fpr = FuncParamRegs.create(tyf);
for (size_t i = 0; i < pi; i++)
{
Symbol *sp = params[i];
if (fpr.alloc(sp.Stype, sp.Stype.Tty, &sp.Spreg, &sp.Spreg2))
{
sp.Sclass = (config.exe == EX_WIN64) ? SCshadowreg : SCfastpar;
sp.Sfl = (sp.Sclass == SCshadowreg) ? FLpara : FLfast;
}
}
}
// Done with params
if (params != paramsbuf.ptr)
free(params);
params = null;
if (fd.fbody)
{
localgot = null;
Statement sbody = fd.fbody;
Blockx bx;
bx.startblock = block_calloc();
bx.curblock = bx.startblock;
bx.funcsym = s;
bx.scope_index = -1;
bx.classdec = cast(void*)cd;
bx.member = cast(void*)fd;
bx._module = cast(void*)fd.getModule();
irs.blx = &bx;
// Initialize argptr
if (fd.v_argptr)
{
// Declare va_argsave
if (global.params.is64bit &&
!global.params.isWindows)
{
type *t = type_struct_class("__va_argsave_t", 16, 8 * 6 + 8 * 16 + 8 * 3, null, null, false, false, true);
// The backend will pick this up by name
Symbol *sv = symbol_name("__va_argsave", SCauto, t);
sv.Stype.Tty |= mTYvolatile;
symbol_add(sv);
}
Symbol *sa = toSymbol(fd.v_argptr);
symbol_add(sa);
elem *e = el_una(OPva_start, TYnptr, el_ptr(sa));
block_appendexp(irs.blx.curblock, e);
}
/* Doing this in semantic3() caused all kinds of problems:
* 1. couldn't reliably get the final mangling of the function name due to fwd refs
* 2. impact on function inlining
* 3. what to do when writing out .di files, or other pretty printing
*/
if (global.params.trace && !fd.isCMain() && !fd.naked)
{
/* The profiler requires TLS, and TLS may not be set up yet when C main()
* gets control (i.e. OSX), leading to a crash.
*/
/* Wrap the entire function body in:
* trace_pro("funcname");
* try
* body;
* finally
* _c_trace_epi();
*/
StringExp se = StringExp.create(Loc(), s.Sident.ptr);
se.type = Type.tstring;
se.type = se.type.typeSemantic(Loc(), null);
Expressions *exps = new Expressions();
exps.push(se);
FuncDeclaration fdpro = FuncDeclaration.genCfunc(null, Type.tvoid, "trace_pro");
Expression ec = VarExp.create(Loc(), fdpro);
Expression e = CallExp.create(Loc(), ec, exps);
e.type = Type.tvoid;
Statement sp = ExpStatement.create(fd.loc, e);
FuncDeclaration fdepi = FuncDeclaration.genCfunc(null, Type.tvoid, "_c_trace_epi");
ec = VarExp.create(Loc(), fdepi);
e = CallExp.create(Loc(), ec);
e.type = Type.tvoid;
Statement sf = ExpStatement.create(fd.loc, e);
Statement stf;
if (sbody.blockExit(fd, false) == BE.fallthru)
stf = CompoundStatement.create(Loc(), sbody, sf);
else
stf = TryFinallyStatement.create(Loc(), sbody, sf);
sbody = CompoundStatement.create(Loc(), sp, stf);
}
if (fd.interfaceVirtual)
{
// Adjust the 'this' pointer instead of using a thunk
assert(irs.sthis);
elem *ethis = el_var(irs.sthis);
elem *e = el_bin(OPminass, TYnptr, ethis, el_long(TYsize_t, fd.interfaceVirtual.offset));
block_appendexp(irs.blx.curblock, e);
}
buildClosure(fd, &irs);
if (config.ehmethod == EHmethod.EH_WIN32 && fd.isSynchronized() && cd &&
!fd.isStatic() && !sbody.usesEH() && !global.params.trace)
{
/* The "jmonitor" hack uses an optimized exception handling frame
* which is a little shorter than the more general EH frame.
*/
s.Sfunc.Fflags3 |= Fjmonitor;
}
Statement_toIR(sbody, &irs);
bx.curblock.BC = BCret;
f.Fstartblock = bx.startblock;
// einit = el_combine(einit,bx.init);
if (fd.isCtorDeclaration())
{
assert(sthis);
for (block *b = f.Fstartblock; b; b = b.Bnext)
{
if (b.BC == BCret)
{
b.BC = BCretexp;
b.Belem = el_combine(b.Belem, el_var(sthis));
}
}
}
if (config.ehmethod == EHmethod.EH_NONE || f.Fflags3 & Feh_none)
insertFinallyBlockGotos(f.Fstartblock);
else if (config.ehmethod == EHmethod.EH_DWARF)
insertFinallyBlockCalls(f.Fstartblock);
}
// If static constructor
if (fd.isSharedStaticCtorDeclaration()) // must come first because it derives from StaticCtorDeclaration
{
ssharedctors.push(s);
}
else if (fd.isStaticCtorDeclaration())
{
sctors.push(s);
}
// If static destructor
if (fd.isSharedStaticDtorDeclaration()) // must come first because it derives from StaticDtorDeclaration
{
SharedStaticDtorDeclaration fs = fd.isSharedStaticDtorDeclaration();
assert(fs);
if (fs.vgate)
{
/* Increment destructor's vgate at construction time
*/
esharedctorgates.push(fs);
}
sshareddtors.shift(s);
}
else if (fd.isStaticDtorDeclaration())
{
StaticDtorDeclaration fs = fd.isStaticDtorDeclaration();
assert(fs);
if (fs.vgate)
{
/* Increment destructor's vgate at construction time
*/
ectorgates.push(fs);
}
sdtors.shift(s);
}
// If unit test
if (ud)
{
stests.push(s);
}
if (global.errors)
{
// Restore symbol table
cstate.CSpsymtab = symtabsave;
return;
}
writefunc(s);
// Restore symbol table
cstate.CSpsymtab = symtabsave;
if (fd.isExport())
objmod.export_symbol(s, cast(uint)Para.offset);
for (size_t i = 0; i < irs.deferToObj.dim; i++)
{
Dsymbol sd = (*irs.deferToObj)[i];
toObjFile(sd, false);
}
if (ud)
{
for (size_t i = 0; i < ud.deferredNested.dim; i++)
{
FuncDeclaration fdn = ud.deferredNested[i];
toObjFile(fdn, false);
}
}
if (global.params.isLinux || global.params.isOSX || global.params.isFreeBSD || global.params.isSolaris)
{
// A hack to get a pointer to this function put in the .dtors segment
if (fd.ident && memcmp(fd.ident.toChars(), "_STD".ptr, 4) == 0)
objmod.staticdtor(s);
}
if (irs.startaddress)
{
//printf("Setting start address\n");
objmod.startaddress(irs.startaddress);
}
}
bool onlyOneMain(Loc loc)
{
__gshared Loc lastLoc;
__gshared bool hasMain = false;
if (hasMain)
{
const(char)* msg = "";
if (global.params.addMain)
msg = ", -main switch added another `main()`";
const(char)* otherMainNames = "";
if (config.exe == EX_WIN32 || config.exe == EX_WIN64)
otherMainNames = ", `WinMain`, or `DllMain`";
error(loc, "only one `main`%s allowed%s. Previously found `main` at %s",
otherMainNames, msg, lastLoc.toChars());
return false;
}
lastLoc = loc;
hasMain = true;
return true;
}
/* ================================================================== */
/*****************************
* Return back end type corresponding to D front end type.
*/
uint totym(Type tx)
{
uint t;
switch (tx.ty)
{
case Tvoid: t = TYvoid; break;
case Tint8: t = TYschar; break;
case Tuns8: t = TYuchar; break;
case Tint16: t = TYshort; break;
case Tuns16: t = TYushort; break;
case Tint32: t = TYint; break;
case Tuns32: t = TYuint; break;
case Tint64: t = TYllong; break;
case Tuns64: t = TYullong; break;
case Tfloat32: t = TYfloat; break;
case Tfloat64: t = TYdouble; break;
case Tfloat80: t = TYldouble; break;
case Timaginary32: t = TYifloat; break;
case Timaginary64: t = TYidouble; break;
case Timaginary80: t = TYildouble; break;
case Tcomplex32: t = TYcfloat; break;
case Tcomplex64: t = TYcdouble; break;
case Tcomplex80: t = TYcldouble; break;
case Tbool: t = TYbool; break;
case Tchar: t = TYchar; break;
case Twchar: t = TYwchar_t; break;
case Tdchar:
t = (global.params.symdebug == 1 || !global.params.isWindows) ? TYdchar : TYulong;
break;
case Taarray: t = TYaarray; break;
case Tclass:
case Treference:
case Tpointer: t = TYnptr; break;
case Tdelegate: t = TYdelegate; break;
case Tarray: t = TYdarray; break;
case Tsarray: t = TYstruct; break;
case Tstruct:
t = TYstruct;
if (tx.toDsymbol(null).ident == Id.__c_long_double)
t = TYdouble;
break;
case Tenum:
t = totym(tx.toBasetype());
break;
case Tident:
case Ttypeof:
//printf("ty = %d, '%s'\n", tx.ty, tx.toChars());
error(Loc(), "forward reference of `%s`", tx.toChars());
t = TYint;
break;
case Tnull:
t = TYnptr;
break;
case Tvector:
{
TypeVector tv = cast(TypeVector)tx;
TypeBasic tb = tv.elementType();
const s32 = tv.alignsize() == 32; // if 32 byte, 256 bit vector
switch (tb.ty)
{
case Tvoid:
case Tint8: t = s32 ? TYschar32 : TYschar16; break;
case Tuns8: t = s32 ? TYuchar32 : TYuchar16; break;
case Tint16: t = s32 ? TYshort16 : TYshort8; break;
case Tuns16: t = s32 ? TYushort16 : TYushort8; break;
case Tint32: t = s32 ? TYlong8 : TYlong4; break;
case Tuns32: t = s32 ? TYulong8 : TYulong4; break;
case Tint64: t = s32 ? TYllong4 : TYllong2; break;
case Tuns64: t = s32 ? TYullong4 : TYullong2; break;
case Tfloat32: t = s32 ? TYfloat8 : TYfloat4; break;
case Tfloat64: t = s32 ? TYdouble4 : TYdouble2; break;
default:
assert(0);
}
assert(global.params.is64bit || global.params.isOSX);
break;
}
case Tfunction:
{
TypeFunction tf = cast(TypeFunction)tx;
switch (tf.linkage)
{
case LINKwindows:
if (global.params.is64bit)
goto Lc;
t = (tf.varargs == 1) ? TYnfunc : TYnsfunc;
break;
case LINKpascal:
t = (tf.varargs == 1) ? TYnfunc : TYnpfunc;
break;
case LINKc:
case LINKcpp:
case LINKobjc:
Lc:
t = TYnfunc;
if (global.params.isWindows)
{
}
else if (!global.params.is64bit && retStyle(tf) == RETstack)
t = TYhfunc;
break;
case LINKd:
t = (tf.varargs == 1) ? TYnfunc : TYjfunc;
break;
default:
printf("linkage = %d\n", tf.linkage);
assert(0);
}
if (tf.isnothrow)
t |= mTYnothrow;
return t;
}
default:
//printf("ty = %d, '%s'\n", tx.ty, tx.toChars());
assert(0);
}
// Add modifiers
switch (tx.mod)
{
case 0:
break;
case MODconst:
case MODwild:
case MODwildconst:
t |= mTYconst;
break;
case MODshared:
t |= mTYshared;
break;
case MODshared | MODconst:
case MODshared | MODwild:
case MODshared | MODwildconst:
t |= mTYshared | mTYconst;
break;
case MODimmutable:
t |= mTYimmutable;
break;
default:
assert(0);
}
return t;
}
/**************************************
*/
Symbol *toSymbol(Type t)
{
if (t.ty == Tclass)
{
return toSymbol((cast(TypeClass)t).sym);
}
assert(0);
}
/**************************************
* Generate elem that is a dynamic array slice of the module file name.
*/
elem *toEfilename(Module m)
{
//printf("toEfilename(%s)\n", m.toChars());
const(char)* id = m.srcfile.toChars();
size_t len = strlen(id);
if (!m.sfilename)
{
// Put out as a static array
m.sfilename = toStringSymbol(id, len, 1);
}
// Turn static array into dynamic array
return el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(m.sfilename));
}
elem *toEfilenamePtr(Module m)
{
//printf("toEfilenamePtr(%s)\n", m.toChars());
const(char)* id = m.srcfile.toChars();
size_t len = strlen(id);
Symbol* s = toStringSymbol(id, len, 1);
return el_ptr(s);
}
|
D
|
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.build/Address/Address+C.swift.o : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address+C.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Pipe.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Config.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Buffer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Error.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Descriptor.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Types.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Conversions.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/SocketOptions.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Exports.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Select.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/FDSet.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Socket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/UDP/UDPSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPEstablishedSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPReadableSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPWriteableSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/InternetSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPInternetSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/RawSocket.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.build/Address+C~partial.swiftmodule : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address+C.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Pipe.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Config.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Buffer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Error.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Descriptor.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Types.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Conversions.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/SocketOptions.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Exports.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Select.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/FDSet.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Socket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/UDP/UDPSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPEstablishedSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPReadableSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPWriteableSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/InternetSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPInternetSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/RawSocket.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.build/Address+C~partial.swiftdoc : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address+C.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Pipe.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Config.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Buffer.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Error.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Descriptor.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Types.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Conversions.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/SocketOptions.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Exports.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Select.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/FDSet.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Socket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/UDP/UDPSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPEstablishedSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPReadableSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPWriteableSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/InternetSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPInternetSocket.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/RawSocket.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/++
Fast BetterC Date type with Boost ABI and mangling compatability.
$(SCRIPT inhibitQuickIndex = 1;)
$(DIVC quickindex,
$(BOOKTABLE,
$(TR $(TH Category) $(TH Functions))
$(TR $(TD Main date types) $(TD
$(LREF Date)
))
$(TR $(TD Other date types) $(TD
$(LREF Month)
$(LREF DayOfWeek)
))
$(TR $(TD Date checking) $(TD
$(LREF valid)
$(LREF yearIsLeapYear)
))
$(TR $(TD Date conversion) $(TD
$(LREF daysToDayOfWeek)
))
$(TR $(TD Other) $(TD
$(LREF AllowDayOverflow)
$(LREF DateTimeException)
))
))
License: $(HTTP www.apache.org/licenses/LICENSE-2.0, Apache-2.0)
Authors: $(HTTP jmdavisprog.com, Jonathan M Davis), Ilya Yaroshenko (boost-like and BetterC rework)
+/
module mir.date;
import mir.primitives: isOutputRange;
import mir.serde: serdeProxy;
import mir.timestamp: Timestamp;
import std.traits: isSomeChar, Unqual;
version(mir_test)
version(D_Exceptions)
version(unittest) import std.exception : assertThrown;
version(test_with_asdf)
unittest
{
import asdf.serialization;
assert(Date(2020, 3, 19).serializeToJson == `"2020-03-19"`);
assert(`"2020-03-19"`.deserialize!Date == Date(2020, 3, 19));
assert(`"20200319"`.deserialize!Date == Date(2020, 3, 19));
assert(`"2020-Mar-19"`.deserialize!Date == Date(2020, 3, 19));
}
/++
Returns whether the given value is valid for the given unit type when in a
time point. Naturally, a duration is not held to a particular range, but
the values in a time point are (e.g. a month must be in the range of
1 - 12 inclusive).
Params:
units = The units of time to validate.
value = The number to validate.
+/
bool valid(string units)(int value) @safe pure nothrow @nogc
if (units == "months" ||
units == "hours" ||
units == "minutes" ||
units == "seconds")
{
static if (units == "months")
return value >= Month.jan && value <= Month.dec;
else static if (units == "hours")
return value >= 0 && value <= 23;
else static if (units == "minutes")
return value >= 0 && value <= 59;
else static if (units == "seconds")
return value >= 0 && value <= 59;
}
///
version (mir_test)
@safe unittest
{
assert(valid!"hours"(12));
assert(!valid!"hours"(32));
assert(valid!"months"(12));
assert(!valid!"months"(13));
}
/++
Returns whether the given day is valid for the given year and month.
Params:
units = The units of time to validate.
year = The year of the day to validate.
month = The month of the day to validate (January is 1).
day = The day to validate.
+/
bool valid(string units)(int year, int month, int day) @safe pure nothrow @nogc
if (units == "days")
{
return day > 0 && day <= maxDay(year, month);
}
///
version (mir_test)
@safe pure nothrow @nogc unittest
{
assert(valid!"days"(2016, 2, 29));
assert(!valid!"days"(2016, 2, 30));
assert(valid!"days"(2017, 2, 20));
assert(!valid!"days"(2017, 2, 29));
}
///
enum AllowDayOverflow : bool
{
///
no,
///
yes
}
/++
Whether the given Gregorian Year is a leap year.
Params:
year = The year to to be tested.
+/
bool yearIsLeapYear(int year) @safe pure nothrow @nogc
{
if (year % 400 == 0)
return true;
if (year % 100 == 0)
return false;
return year % 4 == 0;
}
///
version (mir_test)
@safe unittest
{
foreach (year; [1, 2, 100, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010])
{
assert(!yearIsLeapYear(year));
assert(!yearIsLeapYear(-year));
}
foreach (year; [0, 4, 8, 400, 800, 1600, 1996, 2000, 2004, 2008, 2012])
{
assert(yearIsLeapYear(year));
assert(yearIsLeapYear(-year));
}
}
version (mir_test)
@safe unittest
{
import std.format : format;
foreach (year; [1, 2, 3, 5, 6, 7, 100, 200, 300, 500, 600, 700, 1998, 1999,
2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2011])
{
assert(!yearIsLeapYear(year), format("year: %s.", year));
assert(!yearIsLeapYear(-year), format("year: %s.", year));
}
foreach (year; [0, 4, 8, 400, 800, 1600, 1996, 2000, 2004, 2008, 2012])
{
assert(yearIsLeapYear(year), format("year: %s.", year));
assert(yearIsLeapYear(-year), format("year: %s.", year));
}
}
///
enum Month : short
{
///
jan = 1,
///
feb,
///
mar,
///
apr,
///
may,
///
jun,
///
jul,
///
aug,
///
sep,
///
oct,
///
nov,
///
dec,
}
version(D_Exceptions)
///
class DateTimeException : Exception
{
///
@nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null)
{
super(msg, file, line, nextInChain);
}
/// ditto
@nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__)
{
super(msg, file, line, nextInChain);
}
}
version(D_Exceptions)
{
private static immutable InvalidMonth = new DateTimeException("Invalid Month");
private static immutable InvalidDay = new DateTimeException("Invalid Day");
private static immutable InvalidISOString = new DateTimeException("Invalid ISO String");
private static immutable InvalidISOExtendedString = new DateTimeException("Invalid ISO Extended String");
private static immutable InvalidSimpleString = new DateTimeException("Invalid Simple String");
private static immutable InvalidString = new DateTimeException("Invalid String");
}
version (mir_test)
@safe unittest
{
initializeTests();
}
/++
Represents the 7 days of the Gregorian week (Monday is 0).
+/
extern(C++, "mir")
enum DayOfWeek
{
mon = 0, ///
tue, ///
wed, ///
thu, ///
fri, ///
sat, ///
sun, ///
}
///
@serdeProxy!Timestamp
struct YearMonthDay
{
short year = 1;
Month month = Month.jan;
ubyte day = 1;
///
Timestamp timestamp() @safe pure nothrow @nogc @property
{
return Timestamp(year, cast(ubyte)month, day);
}
///
alias opCast(T : Timestamp) = timestamp;
///
version(mir_test)
unittest
{
import mir.timestamp;
auto timestamp = cast(Timestamp) YearMonthDay(2020, Month.may, 12);
}
///
this(short year, Month month, ubyte day) @safe pure nothrow @nogc
{
this.year = year;
this.month = month;
this.day = day;
}
///
this(Date date) @safe pure nothrow @nogc
{
this = date.yearMonthDay;
}
version(D_Exceptions)
///
this(Timestamp timestamp) @safe pure nothrow @nogc
{
if (timestamp.precision != Timestamp.Precision.day)
{
static immutable exc = new Exception("YearMonthDay: invalid timestamp precision");
}
with(timestamp) this(year, cast(Month)month, day);
}
// Shares documentation with "years" version.
@safe pure nothrow @nogc
ref YearMonthDay add(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
if (units == "months")
{
auto years = months / 12;
months %= 12;
auto newMonth = month + months;
if (months < 0)
{
if (newMonth < 1)
{
newMonth += 12;
--years;
}
}
else if (newMonth > 12)
{
newMonth -= 12;
++years;
}
year += years;
month = cast(Month) newMonth;
immutable currMaxDay = maxDay(year, month);
immutable overflow = day - currMaxDay;
if (overflow > 0)
{
if (allowOverflow == AllowDayOverflow.yes)
{
++month;
day = cast(ubyte) overflow;
}
else
day = cast(ubyte) currMaxDay;
}
return this;
}
// Shares documentation with "years" version.
@safe pure nothrow @nogc
ref YearMonthDay add(string units)(long years, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
if (units == "years")
{
year += years;
immutable currMaxDay = maxDay(year, month);
immutable overflow = day - currMaxDay;
if (overflow > 0)
{
if (allowOverflow == AllowDayOverflow.yes)
{
++month;
day = cast(ubyte) overflow;
}
else
day = cast(ubyte) currMaxDay;
}
return this;
}
/++
Day of the year this $(LREF Date) is on.
+/
@property int dayOfYear() const @safe pure nothrow @nogc
{
if (month >= Month.jan && month <= Month.dec)
{
immutable int[] lastDay = isLeapYear ? lastDayLeap : lastDayNonLeap;
auto monthIndex = month - Month.jan;
return lastDay[monthIndex] + day;
}
assert(0, "Invalid month.");
}
///
version (mir_test)
@safe unittest
{
assert(YearMonthDay(1999, cast(Month) 1, 1).dayOfYear == 1);
assert(YearMonthDay(1999, cast(Month) 12, 31).dayOfYear == 365);
assert(YearMonthDay(2000, cast(Month) 12, 31).dayOfYear == 366);
}
/++
Whether this $(LREF Date) is in a leap year.
+/
@property bool isLeapYear() const @safe pure nothrow @nogc
{
return yearIsLeapYear(year);
}
private void setDayOfYear(bool useExceptions = false)(int days)
{
immutable int[] lastDay = isLeapYear ? lastDayLeap : lastDayNonLeap;
bool dayOutOfRange = days <= 0 || days > (isLeapYear ? daysInLeapYear : daysInYear);
static if (useExceptions)
{
if (dayOutOfRange) throw InvalidDay;
}
else
{
assert(!dayOutOfRange, "Invalid Day");
}
foreach (i; 1 .. lastDay.length)
{
if (days <= lastDay[i])
{
month = cast(Month)(cast(int) Month.jan + i - 1);
day = cast(ubyte)(days - lastDay[i - 1]);
return;
}
}
assert(0, "Invalid day of the year.");
}
/++
The last day in the month that this $(LREF Date) is in.
+/
@property ubyte daysInMonth() const @safe pure nothrow @nogc
{
return maxDay(year, month);
}
/++
Whether the current year is a date in A.D.
+/
@property bool isAD() const @safe pure nothrow @nogc
{
return year > 0;
}
}
/++
Represents a date in the
$(HTTP en.wikipedia.org/wiki/Proleptic_Gregorian_calendar, Proleptic
Gregorian Calendar) ranging from 32,768 B.C. to 32,767 A.D. Positive years
are A.D. Non-positive years are B.C.
Year, month, and day are kept separately internally so that $(D Date) is
optimized for calendar-based operations.
$(D Date) uses the Proleptic Gregorian Calendar, so it assumes the Gregorian
leap year calculations for its entire length. As per
$(HTTP en.wikipedia.org/wiki/ISO_8601, ISO 8601), it treats 1 B.C. as
year 0, i.e. 1 B.C. is 0, 2 B.C. is -1, etc. Use $(LREF yearBC) to use B.C.
as a positive integer with 1 B.C. being the year prior to 1 A.D.
Year 0 is a leap year.
+/
extern(C++, "boost", "gregorian")
extern(C++, class)
@serdeProxy!YearMonthDay
struct date
{
extern(D):
public:
private enum _julianShift = 1_721_425;
///
uint toHash() @safe pure nothrow @nogc const scope
{
return _julianDay;
}
/++
Throws:
$(LREF DateTimeException) if the resulting
$(LREF Date) would not be valid.
Params:
_year = Year of the Gregorian Calendar. Positive values are A.D.
Non-positive values are B.C. with year 0 being the year
prior to 1 A.D.
_month = Month of the year (January is 1).
_day = Day of the month.
+/
pragma(inline, false)
static Date trustedCreate(int _year, int _month, int _day) @safe pure @nogc nothrow
{
Date ret;
immutable int[] lastDay = yearIsLeapYear(_year) ? lastDayLeap : lastDayNonLeap;
auto monthIndex = _month - Month.jan;
const dayOfYear = lastDay[monthIndex] + _day;
if (_month >= Month.jan && _month <= Month.dec) {} else
assert(0, "Invalid month.");
if (_year > 0)
{
if (_year == 1)
{
ret._julianDay = dayOfYear;
goto R;
}
int years = _year - 1;
auto days = (years / 400) * daysIn400Years;
years %= 400;
days += (years / 100) * daysIn100Years;
years %= 100;
days += (years / 4) * daysIn4Years;
years %= 4;
days += years * daysInYear;
days += dayOfYear;
ret._julianDay = days;
}
else if (_year == 0)
{
ret._julianDay = dayOfYear - daysInLeapYear;
}
else
{
int years = _year;
auto days = (years / 400) * daysIn400Years;
years %= 400;
days += (years / 100) * daysIn100Years;
years %= 100;
days += (years / 4) * daysIn4Years;
years %= 4;
if (years < 0)
{
days -= daysInLeapYear;
++years;
days += years * daysInYear;
days -= daysInYear - dayOfYear;
}
else
days -= daysInLeapYear - dayOfYear;
ret._julianDay = days;
}
R:
ret._julianDay += _julianShift;
return ret;
}
///
Timestamp timestamp() @safe pure nothrow @nogc const @property
{
return yearMonthDay.timestamp;
}
version(D_Exceptions)
///
this(Timestamp timestamp) @safe pure @nogc
{
if (timestamp.precision != Timestamp.Precision.day)
{
static immutable exc = new Exception("Date: invalid timestamp precision");
}
}
version(D_Exceptions)
///
this(scope const(char)[] str) @safe pure @nogc
{
this = fromString(str);
}
version(D_Exceptions)
///
this(YearMonthDay ymd) @safe pure @nogc
{
with(ymd) this(year, month, day);
}
version(D_Exceptions)
///
this(int _year, int _month, int _day) @safe pure @nogc
{
if (!valid!"months"(_month))
throw InvalidMonth;
if (!valid!"days"(_year, cast(Month) _month, _day))
throw InvalidDay;
this = trustedCreate(_year, _month, _day);
}
///
static bool fromYMD(int _year, int _month, int _day, out Date value) @safe pure nothrow @nogc
{
if (valid!"months"(_month) && valid!"days"(_year, cast(Month) _month, _day))
{
value = trustedCreate(_year, _month, _day);
return true;
}
return false;
}
version (mir_test)
@safe unittest
{
import std.exception : assertNotThrown;
// assert(Date(0, 12, 31) == Date.init);
// Test A.D.
assertThrown!DateTimeException(Date(1, 0, 1));
assertThrown!DateTimeException(Date(1, 1, 0));
assertThrown!DateTimeException(Date(1999, 13, 1));
assertThrown!DateTimeException(Date(1999, 1, 32));
assertThrown!DateTimeException(Date(1999, 2, 29));
assertThrown!DateTimeException(Date(2000, 2, 30));
assertThrown!DateTimeException(Date(1999, 3, 32));
assertThrown!DateTimeException(Date(1999, 4, 31));
assertThrown!DateTimeException(Date(1999, 5, 32));
assertThrown!DateTimeException(Date(1999, 6, 31));
assertThrown!DateTimeException(Date(1999, 7, 32));
assertThrown!DateTimeException(Date(1999, 8, 32));
assertThrown!DateTimeException(Date(1999, 9, 31));
assertThrown!DateTimeException(Date(1999, 10, 32));
assertThrown!DateTimeException(Date(1999, 11, 31));
assertThrown!DateTimeException(Date(1999, 12, 32));
assertNotThrown!DateTimeException(Date(1999, 1, 31));
assertNotThrown!DateTimeException(Date(1999, 2, 28));
assertNotThrown!DateTimeException(Date(2000, 2, 29));
assertNotThrown!DateTimeException(Date(1999, 3, 31));
assertNotThrown!DateTimeException(Date(1999, 4, 30));
assertNotThrown!DateTimeException(Date(1999, 5, 31));
assertNotThrown!DateTimeException(Date(1999, 6, 30));
assertNotThrown!DateTimeException(Date(1999, 7, 31));
assertNotThrown!DateTimeException(Date(1999, 8, 31));
assertNotThrown!DateTimeException(Date(1999, 9, 30));
assertNotThrown!DateTimeException(Date(1999, 10, 31));
assertNotThrown!DateTimeException(Date(1999, 11, 30));
assertNotThrown!DateTimeException(Date(1999, 12, 31));
// Test B.C.
assertNotThrown!DateTimeException(Date(0, 1, 1));
assertNotThrown!DateTimeException(Date(-1, 1, 1));
assertNotThrown!DateTimeException(Date(-1, 12, 31));
assertNotThrown!DateTimeException(Date(-1, 2, 28));
assertNotThrown!DateTimeException(Date(-4, 2, 29));
assertThrown!DateTimeException(Date(-1, 2, 29));
assertThrown!DateTimeException(Date(-2, 2, 29));
assertThrown!DateTimeException(Date(-3, 2, 29));
}
/++
Params:
day = Julian day.
+/
this(int day) @safe pure nothrow @nogc
{
_julianDay = day;
}
version (mir_test)
@safe unittest
{
import std.range : chain;
// Test A.D.
// foreach (gd; chain(testGregDaysBC, testGregDaysAD))
// assert(Date(gd.day) == gd.date);
}
/++
Compares this $(LREF Date) with the given $(LREF Date).
Returns:
$(BOOKTABLE,
$(TR $(TD this < rhs) $(TD < 0))
$(TR $(TD this == rhs) $(TD 0))
$(TR $(TD this > rhs) $(TD > 0))
)
+/
int opCmp(Date rhs) const @safe pure nothrow @nogc
{
return this._julianDay - rhs._julianDay;
}
version (mir_test)
@safe unittest
{
// Test A.D.
// assert(Date(0, 12, 31).opCmp(Date.init) == 0);
assert(Date(1999, 1, 1).opCmp(Date(1999, 1, 1)) == 0);
assert(Date(1, 7, 1).opCmp(Date(1, 7, 1)) == 0);
assert(Date(1, 1, 6).opCmp(Date(1, 1, 6)) == 0);
assert(Date(1999, 7, 1).opCmp(Date(1999, 7, 1)) == 0);
assert(Date(1999, 7, 6).opCmp(Date(1999, 7, 6)) == 0);
assert(Date(1, 7, 6).opCmp(Date(1, 7, 6)) == 0);
assert(Date(1999, 7, 6).opCmp(Date(2000, 7, 6)) < 0);
assert(Date(2000, 7, 6).opCmp(Date(1999, 7, 6)) > 0);
assert(Date(1999, 7, 6).opCmp(Date(1999, 8, 6)) < 0);
assert(Date(1999, 8, 6).opCmp(Date(1999, 7, 6)) > 0);
assert(Date(1999, 7, 6).opCmp(Date(1999, 7, 7)) < 0);
assert(Date(1999, 7, 7).opCmp(Date(1999, 7, 6)) > 0);
assert(Date(1999, 8, 7).opCmp(Date(2000, 7, 6)) < 0);
assert(Date(2000, 8, 6).opCmp(Date(1999, 7, 7)) > 0);
assert(Date(1999, 7, 7).opCmp(Date(2000, 7, 6)) < 0);
assert(Date(2000, 7, 6).opCmp(Date(1999, 7, 7)) > 0);
assert(Date(1999, 7, 7).opCmp(Date(1999, 8, 6)) < 0);
assert(Date(1999, 8, 6).opCmp(Date(1999, 7, 7)) > 0);
// Test B.C.
assert(Date(0, 1, 1).opCmp(Date(0, 1, 1)) == 0);
assert(Date(-1, 1, 1).opCmp(Date(-1, 1, 1)) == 0);
assert(Date(-1, 7, 1).opCmp(Date(-1, 7, 1)) == 0);
assert(Date(-1, 1, 6).opCmp(Date(-1, 1, 6)) == 0);
assert(Date(-1999, 7, 1).opCmp(Date(-1999, 7, 1)) == 0);
assert(Date(-1999, 7, 6).opCmp(Date(-1999, 7, 6)) == 0);
assert(Date(-1, 7, 6).opCmp(Date(-1, 7, 6)) == 0);
assert(Date(-2000, 7, 6).opCmp(Date(-1999, 7, 6)) < 0);
assert(Date(-1999, 7, 6).opCmp(Date(-2000, 7, 6)) > 0);
assert(Date(-1999, 7, 6).opCmp(Date(-1999, 8, 6)) < 0);
assert(Date(-1999, 8, 6).opCmp(Date(-1999, 7, 6)) > 0);
assert(Date(-1999, 7, 6).opCmp(Date(-1999, 7, 7)) < 0);
assert(Date(-1999, 7, 7).opCmp(Date(-1999, 7, 6)) > 0);
assert(Date(-2000, 8, 6).opCmp(Date(-1999, 7, 7)) < 0);
assert(Date(-1999, 8, 7).opCmp(Date(-2000, 7, 6)) > 0);
assert(Date(-2000, 7, 6).opCmp(Date(-1999, 7, 7)) < 0);
assert(Date(-1999, 7, 7).opCmp(Date(-2000, 7, 6)) > 0);
assert(Date(-1999, 7, 7).opCmp(Date(-1999, 8, 6)) < 0);
assert(Date(-1999, 8, 6).opCmp(Date(-1999, 7, 7)) > 0);
// Test Both
assert(Date(-1999, 7, 6).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 7, 6)) > 0);
assert(Date(-1999, 8, 6).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 8, 6)) > 0);
assert(Date(-1999, 7, 7).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 7, 7)) > 0);
assert(Date(-1999, 8, 7).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 8, 7)) > 0);
assert(Date(-1999, 8, 6).opCmp(Date(1999, 6, 6)) < 0);
assert(Date(1999, 6, 8).opCmp(Date(-1999, 7, 6)) > 0);
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(date.opCmp(date) == 0);
assert(date.opCmp(cdate) == 0);
assert(date.opCmp(idate) == 0);
assert(cdate.opCmp(date) == 0);
assert(cdate.opCmp(cdate) == 0);
assert(cdate.opCmp(idate) == 0);
assert(idate.opCmp(date) == 0);
assert(idate.opCmp(cdate) == 0);
assert(idate.opCmp(idate) == 0);
}
/++
Day of the week this $(LREF Date) is on.
+/
@property DayOfWeek dayOfWeek() const @safe pure nothrow @nogc
{
return getDayOfWeek(_julianDay);
}
version (mir_test)
@safe unittest
{
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(cdate.dayOfWeek == DayOfWeek.tue);
static assert(!__traits(compiles, cdate.dayOfWeek = DayOfWeek.sun));
assert(idate.dayOfWeek == DayOfWeek.tue);
static assert(!__traits(compiles, idate.dayOfWeek = DayOfWeek.sun));
}
/++
The Xth day of the Gregorian Calendar that this $(LREF Date) is on.
+/
@property int dayOfGregorianCal() const @safe pure nothrow @nogc
{
return _julianDay - _julianShift;
}
///
version (mir_test)
@safe unittest
{
assert(Date(1, 1, 1).dayOfGregorianCal == 1);
assert(Date(1, 12, 31).dayOfGregorianCal == 365);
assert(Date(2, 1, 1).dayOfGregorianCal == 366);
assert(Date(0, 12, 31).dayOfGregorianCal == 0);
assert(Date(0, 1, 1).dayOfGregorianCal == -365);
assert(Date(-1, 12, 31).dayOfGregorianCal == -366);
assert(Date(2000, 1, 1).dayOfGregorianCal == 730_120);
assert(Date(2010, 12, 31).dayOfGregorianCal == 734_137);
}
version (mir_test)
@safe unittest
{
import std.range : chain;
foreach (gd; chain(testGregDaysBC, testGregDaysAD))
assert(gd.date.dayOfGregorianCal == gd.day);
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(date.dayOfGregorianCal == 729_941);
assert(cdate.dayOfGregorianCal == 729_941);
assert(idate.dayOfGregorianCal == 729_941);
}
/++
The Xth day of the Gregorian Calendar that this $(LREF Date) is on.
Params:
day = The day of the Gregorian Calendar to set this $(LREF Date) to.
+/
@property void dayOfGregorianCal(int day) @safe pure nothrow @nogc
{
this = Date(day + _julianShift);
}
///
version (mir_test)
@safe unittest
{
auto date = Date.init;
date.dayOfGregorianCal = 1;
assert(date == Date(1, 1, 1));
date.dayOfGregorianCal = 365;
assert(date == Date(1, 12, 31));
date.dayOfGregorianCal = 366;
assert(date == Date(2, 1, 1));
date.dayOfGregorianCal = 0;
assert(date == Date(0, 12, 31));
date.dayOfGregorianCal = -365;
assert(date == Date(-0, 1, 1));
date.dayOfGregorianCal = -366;
assert(date == Date(-1, 12, 31));
date.dayOfGregorianCal = 730_120;
assert(date == Date(2000, 1, 1));
date.dayOfGregorianCal = 734_137;
assert(date == Date(2010, 12, 31));
}
version (mir_test)
@safe unittest
{
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
date.dayOfGregorianCal = 187;
assert(date.dayOfGregorianCal == 187);
static assert(!__traits(compiles, cdate.dayOfGregorianCal = 187));
static assert(!__traits(compiles, idate.dayOfGregorianCal = 187));
}
private enum uint _startDict = Date(1900, 1, 1)._julianDay; // [
private enum uint _endDict = Date(2040, 1, 1)._julianDay; // )
static immutable _dict = ()
{
YearMonthDay[Date._endDict - Date._startDict] dict;
foreach (uint i; 0 .. dict.length)
dict[i] = Date(i + Date._startDict).yearMonthDayImpl;
return dict;
}();
///
YearMonthDay yearMonthDay() const @safe pure nothrow @nogc @property
{
uint day = _julianDay;
if (day < _endDict)
{
import mir.checkedint: subu;
bool overflow;
auto index = subu(day, _startDict, overflow);
if (!overflow)
return _dict[index];
}
return yearMonthDayImpl;
}
///
short year() const @safe pure nothrow @nogc @property
{
return yearMonthDay.year;
}
///
Month month() const @safe pure nothrow @nogc @property
{
return yearMonthDay.month;
}
///
ubyte day() const @safe pure nothrow @nogc @property
{
return yearMonthDay.day;
}
pragma(inline, false)
YearMonthDay yearMonthDayImpl() const @safe pure nothrow @nogc @property
{
YearMonthDay ymd;
int days = dayOfGregorianCal;
with(ymd)
if (days > 0)
{
int years = (days / daysIn400Years) * 400 + 1;
days %= daysIn400Years;
{
immutable tempYears = days / daysIn100Years;
if (tempYears == 4)
{
years += 300;
days -= daysIn100Years * 3;
}
else
{
years += tempYears * 100;
days %= daysIn100Years;
}
}
years += (days / daysIn4Years) * 4;
days %= daysIn4Years;
{
immutable tempYears = days / daysInYear;
if (tempYears == 4)
{
years += 3;
days -= daysInYear * 3;
}
else
{
years += tempYears;
days %= daysInYear;
}
}
if (days == 0)
{
year = cast(short)(years - 1);
month = Month.dec;
day = 31;
}
else
{
year = cast(short) years;
setDayOfYear(days);
}
}
else if (days <= 0 && -days < daysInLeapYear)
{
year = 0;
setDayOfYear(daysInLeapYear + days);
}
else
{
days += daysInLeapYear - 1;
int years = (days / daysIn400Years) * 400 - 1;
days %= daysIn400Years;
{
immutable tempYears = days / daysIn100Years;
if (tempYears == -4)
{
years -= 300;
days += daysIn100Years * 3;
}
else
{
years += tempYears * 100;
days %= daysIn100Years;
}
}
years += (days / daysIn4Years) * 4;
days %= daysIn4Years;
{
immutable tempYears = days / daysInYear;
if (tempYears == -4)
{
years -= 3;
days += daysInYear * 3;
}
else
{
years += tempYears;
days %= daysInYear;
}
}
if (days == 0)
{
year = cast(short)(years + 1);
month = Month.jan;
day = 1;
}
else
{
year = cast(short) years;
immutable newDoY = (yearIsLeapYear(year) ? daysInLeapYear : daysInYear) + days + 1;
setDayOfYear(newDoY);
}
}
return ymd;
}
/++
$(LREF Date) for the last day in the quarter that this $(LREF Date) is in.
+/
@property Date endOfQuarter() const @safe pure nothrow @nogc
{
with(yearMonthDay)
{
int d = _julianDay - day;
final switch (month) with(Month)
{
case jan: d += maxDay(year, jan); goto case;
case feb: d += maxDay(year, feb); goto case;
case mar: d += maxDay(year, mar); break;
case apr: d += maxDay(year, apr); goto case;
case may: d += maxDay(year, may); goto case;
case jun: d += maxDay(year, jun); break;
case jul: d += maxDay(year, jul); goto case;
case aug: d += maxDay(year, aug); goto case;
case sep: d += maxDay(year, sep); break;
case oct: d += maxDay(year, oct); goto case;
case nov: d += maxDay(year, nov); goto case;
case dec: d += maxDay(year, dec); break;
}
return Date(d);
}
}
///
version (mir_test)
@safe unittest
{
assert(Date(1999, 1, 6).endOfQuarter == Date(1999, 3, 31));
assert(Date(1999, 2, 7).endOfQuarter == Date(1999, 3, 31));
assert(Date(2000, 2, 7).endOfQuarter == Date(2000, 3, 31));
assert(Date(2000, 6, 4).endOfQuarter == Date(2000, 6, 30));
}
/++
$(LREF Date) for the last day in the month that this $(LREF Date) is in.
+/
@property Date endOfMonth() const @safe pure nothrow @nogc
{
with(yearMonthDay)
return Date(_julianDay + maxDay(year, month) - day);
}
///
version (mir_test)
@safe unittest
{
assert(Date(1999, 1, 6).endOfMonth == Date(1999, 1, 31));
assert(Date(1999, 2, 7).endOfMonth == Date(1999, 2, 28));
assert(Date(2000, 2, 7).endOfMonth == Date(2000, 2, 29));
assert(Date(2000, 6, 4).endOfMonth == Date(2000, 6, 30));
}
version (mir_test)
@safe unittest
{
// Test A.D.
assert(Date(1999, 1, 1).endOfMonth == Date(1999, 1, 31));
assert(Date(1999, 2, 1).endOfMonth == Date(1999, 2, 28));
assert(Date(2000, 2, 1).endOfMonth == Date(2000, 2, 29));
assert(Date(1999, 3, 1).endOfMonth == Date(1999, 3, 31));
assert(Date(1999, 4, 1).endOfMonth == Date(1999, 4, 30));
assert(Date(1999, 5, 1).endOfMonth == Date(1999, 5, 31));
assert(Date(1999, 6, 1).endOfMonth == Date(1999, 6, 30));
assert(Date(1999, 7, 1).endOfMonth == Date(1999, 7, 31));
assert(Date(1999, 8, 1).endOfMonth == Date(1999, 8, 31));
assert(Date(1999, 9, 1).endOfMonth == Date(1999, 9, 30));
assert(Date(1999, 10, 1).endOfMonth == Date(1999, 10, 31));
assert(Date(1999, 11, 1).endOfMonth == Date(1999, 11, 30));
assert(Date(1999, 12, 1).endOfMonth == Date(1999, 12, 31));
// Test B.C.
assert(Date(-1999, 1, 1).endOfMonth == Date(-1999, 1, 31));
assert(Date(-1999, 2, 1).endOfMonth == Date(-1999, 2, 28));
assert(Date(-2000, 2, 1).endOfMonth == Date(-2000, 2, 29));
assert(Date(-1999, 3, 1).endOfMonth == Date(-1999, 3, 31));
assert(Date(-1999, 4, 1).endOfMonth == Date(-1999, 4, 30));
assert(Date(-1999, 5, 1).endOfMonth == Date(-1999, 5, 31));
assert(Date(-1999, 6, 1).endOfMonth == Date(-1999, 6, 30));
assert(Date(-1999, 7, 1).endOfMonth == Date(-1999, 7, 31));
assert(Date(-1999, 8, 1).endOfMonth == Date(-1999, 8, 31));
assert(Date(-1999, 9, 1).endOfMonth == Date(-1999, 9, 30));
assert(Date(-1999, 10, 1).endOfMonth == Date(-1999, 10, 31));
assert(Date(-1999, 11, 1).endOfMonth == Date(-1999, 11, 30));
assert(Date(-1999, 12, 1).endOfMonth == Date(-1999, 12, 31));
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.endOfMonth = Date(1999, 7, 30)));
static assert(!__traits(compiles, idate.endOfMonth = Date(1999, 7, 30)));
}
///
int opBinary(string op : "-")(Date lhs) const
{
return _julianDay - lhs._julianDay;
}
///
Date opBinary(string op : "+")(int lhs) const
{
return Date(_julianDay + lhs);
}
///
Date opBinaryRight(string op : "+")(int lhs) const
{
return Date(_julianDay + lhs);
}
///
Date opBinary(string op : "-")(int lhs) const
{
return Date(_julianDay - lhs);
}
const nothrow @nogc pure @safe
Date add(string units)(long amount, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
{
with(yearMonthDay.add!units(amount)) return trustedCreate(year, month, day);
}
/++
The $(HTTP en.wikipedia.org/wiki/Julian_day, Julian day) for this
$(LREF Date) at noon (since the Julian day changes at noon).
+/
@property int julianDay() const @safe pure nothrow @nogc
{
return _julianDay;
}
version (mir_test)
@safe unittest
{
assert(Date(-4713, 11, 24).julianDay == 0);
assert(Date(0, 12, 31).julianDay == _julianShift);
assert(Date(1, 1, 1).julianDay == 1_721_426);
assert(Date(1582, 10, 15).julianDay == 2_299_161);
assert(Date(1858, 11, 17).julianDay == 2_400_001);
assert(Date(1982, 1, 4).julianDay == 2_444_974);
assert(Date(1996, 3, 31).julianDay == 2_450_174);
assert(Date(2010, 8, 24).julianDay == 2_455_433);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(cdate.julianDay == 2_451_366);
assert(idate.julianDay == 2_451_366);
}
/++
The modified $(HTTP en.wikipedia.org/wiki/Julian_day, Julian day) for
any time on this date (since, the modified Julian day changes at
midnight).
+/
@property long modJulianDay() const @safe pure nothrow @nogc
{
return julianDay - 2_400_001;
}
version (mir_test)
@safe unittest
{
assert(Date(1858, 11, 17).modJulianDay == 0);
assert(Date(2010, 8, 24).modJulianDay == 55_432);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(cdate.modJulianDay == 51_365);
assert(idate.modJulianDay == 51_365);
}
version(D_BetterC){} else
private string toStringImpl(alias fun)() const @safe pure nothrow
{
import mir.appender: UnsafeArrayBuffer;
char[16] buffer = void;
auto w = UnsafeArrayBuffer!char(buffer);
fun(w);
return w.data.idup;
}
version(D_BetterC){} else
/++
Converts this $(LREF Date) to a string with the format `YYYYMMDD`.
If `writer` is set, the resulting string will be written directly
to it.
Returns:
A `string` when not using an output range; `void` otherwise.
+/
string toISOString() const @safe pure nothrow
{
return toStringImpl!toISOString;
}
///
version (mir_test)
@safe unittest
{
assert(Date.init.toISOString == "null");
assert(Date(2010, 7, 4).toISOString == "20100704");
assert(Date(1998, 12, 25).toISOString == "19981225");
assert(Date(0, 1, 5).toISOString == "00000105");
assert(Date(-4, 1, 5).toISOString == "-00040105", Date(-4, 1, 5).toISOString());
}
version (mir_test)
@safe unittest
{
// Test A.D.
assert(Date(9, 12, 4).toISOString == "00091204");
assert(Date(99, 12, 4).toISOString == "00991204");
assert(Date(999, 12, 4).toISOString == "09991204");
assert(Date(9999, 7, 4).toISOString == "99990704");
assert(Date(10000, 10, 20).toISOString == "+100001020");
// Test B.C.
assert(Date(0, 12, 4).toISOString == "00001204");
assert(Date(-9, 12, 4).toISOString == "-00091204");
assert(Date(-99, 12, 4).toISOString == "-00991204");
assert(Date(-999, 12, 4).toISOString == "-09991204");
assert(Date(-9999, 7, 4).toISOString == "-99990704");
assert(Date(-10000, 10, 20).toISOString == "-100001020");
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(cdate.toISOString == "19990706");
assert(idate.toISOString == "19990706");
}
/// ditto
void toISOString(W)(scope ref W w) const scope
if (isOutputRange!(W, char))
{
import mir.format: printZeroPad;
if(this == Date.init)
{
w.put("null");
return;
}
with(yearMonthDay)
{
if (year >= 10_000)
w.put('+');
w.printZeroPad(year, year >= 0 ? year < 10_000 ? 4 : 5 : year > -10_000 ? 5 : 6);
w.printZeroPad(cast(uint)month, 2);
w.printZeroPad(day, 2);
}
}
version (mir_test)
@safe unittest
{
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(date.toString);
assert(cdate.toString);
assert(idate.toString);
}
version(D_BetterC){} else
/++
Converts this $(LREF Date) to a string with the format `YYYY-MM-DD`.
If `writer` is set, the resulting string will be written directly
to it.
Returns:
A `string` when not using an output range; `void` otherwise.
+/
string toISOExtString() const @safe pure nothrow
{
return toStringImpl!toISOExtString;
}
///ditto
alias toString = toISOExtString;
///
version (mir_test)
@safe unittest
{
assert(Date.init.toISOExtString == "null");
assert(Date(2010, 7, 4).toISOExtString == "2010-07-04");
assert(Date(1998, 12, 25).toISOExtString == "1998-12-25");
assert(Date(0, 1, 5).toISOExtString == "0000-01-05");
assert(Date(-4, 1, 5).toISOExtString == "-0004-01-05");
}
version (mir_test)
@safe pure unittest
{
import std.array : appender;
auto w = appender!(char[])();
Date(2010, 7, 4).toISOString(w);
assert(w.data == "20100704");
w.clear();
Date(1998, 12, 25).toISOString(w);
assert(w.data == "19981225");
}
version (mir_test)
@safe unittest
{
// Test A.D.
assert(Date(9, 12, 4).toISOExtString == "0009-12-04");
assert(Date(99, 12, 4).toISOExtString == "0099-12-04");
assert(Date(999, 12, 4).toISOExtString == "0999-12-04");
assert(Date(9999, 7, 4).toISOExtString == "9999-07-04");
assert(Date(10000, 10, 20).toISOExtString == "+10000-10-20");
// Test B.C.
assert(Date(0, 12, 4).toISOExtString == "0000-12-04");
assert(Date(-9, 12, 4).toISOExtString == "-0009-12-04");
assert(Date(-99, 12, 4).toISOExtString == "-0099-12-04");
assert(Date(-999, 12, 4).toISOExtString == "-0999-12-04");
assert(Date(-9999, 7, 4).toISOExtString == "-9999-07-04");
assert(Date(-10000, 10, 20).toISOExtString == "-10000-10-20");
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(cdate.toISOExtString == "1999-07-06");
assert(idate.toISOExtString == "1999-07-06");
}
/// ditto
void toISOExtString(W)(scope ref W w) const scope
if (isOutputRange!(W, char))
{
import mir.format: printZeroPad;
if(this == Date.init)
{
w.put("null");
return;
}
with(yearMonthDay)
{
if (year >= 10_000)
w.put('+');
w.printZeroPad(year, year >= 0 ? year < 10_000 ? 4 : 5 : year > -10_000 ? 5 : 6);
w.put('-');
w.printZeroPad(cast(uint)month, 2);
w.put('-');
w.printZeroPad(day, 2);
}
}
version (mir_test)
@safe pure unittest
{
import std.array : appender;
auto w = appender!(char[])();
Date(2010, 7, 4).toISOExtString(w);
assert(w.data == "2010-07-04");
w.clear();
Date(-4, 1, 5).toISOExtString(w);
assert(w.data == "-0004-01-05");
}
version(D_BetterC){} else
/++
Converts this $(LREF Date) to a string with the format `YYYY-Mon-DD`.
If `writer` is set, the resulting string will be written directly
to it.
Returns:
A `string` when not using an output range; `void` otherwise.
+/
string toSimpleString() const @safe pure nothrow
{
return toStringImpl!toSimpleString;
}
///
version (mir_test)
@safe unittest
{
assert(Date.init.toSimpleString == "null");
assert(Date(2010, 7, 4).toSimpleString == "2010-Jul-04");
assert(Date(1998, 12, 25).toSimpleString == "1998-Dec-25");
assert(Date(0, 1, 5).toSimpleString == "0000-Jan-05");
assert(Date(-4, 1, 5).toSimpleString == "-0004-Jan-05");
}
version (mir_test)
@safe unittest
{
// Test A.D.
assert(Date(9, 12, 4).toSimpleString == "0009-Dec-04");
assert(Date(99, 12, 4).toSimpleString == "0099-Dec-04");
assert(Date(999, 12, 4).toSimpleString == "0999-Dec-04");
assert(Date(9999, 7, 4).toSimpleString == "9999-Jul-04");
assert(Date(10000, 10, 20).toSimpleString == "+10000-Oct-20");
// Test B.C.
assert(Date(0, 12, 4).toSimpleString == "0000-Dec-04");
assert(Date(-9, 12, 4).toSimpleString == "-0009-Dec-04");
assert(Date(-99, 12, 4).toSimpleString == "-0099-Dec-04");
assert(Date(-999, 12, 4).toSimpleString == "-0999-Dec-04");
assert(Date(-9999, 7, 4).toSimpleString == "-9999-Jul-04");
assert(Date(-10000, 10, 20).toSimpleString == "-10000-Oct-20");
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
assert(cdate.toSimpleString == "1999-Jul-06");
assert(idate.toSimpleString == "1999-Jul-06");
}
/// ditto
void toSimpleString(W)(scope ref W w) const scope
if (isOutputRange!(W, char))
{
import mir.format: printZeroPad;
if(this == Date.init)
{
w.put("null");
return;
}
with(yearMonthDay)
{
if (year >= 10_000)
w.put('+');
w.printZeroPad(year, year >= 0 ? year < 10_000 ? 4 : 5 : year > -10_000 ? 5 : 6);
w.put('-');
w.put(month.monthToString);
w.put('-');
w.printZeroPad(day, 2);
}
}
version (mir_test)
@safe pure unittest
{
import std.array : appender;
auto w = appender!(char[])();
Date(9, 12, 4).toSimpleString(w);
assert(w.data == "0009-Dec-04");
w.clear();
Date(-10000, 10, 20).toSimpleString(w);
assert(w.data == "-10000-Oct-20");
}
/++
Creates a $(LREF Date) from a string with the format YYYYMMDD.
Params:
str = A string formatted in the way that $(LREF .date.toISOString) formats dates.
value = (optional) result value.
Throws:
$(LREF DateTimeException) if the given string is
not in the correct format or if the resulting $(LREF Date) would not
be valid. Two arguments overload is `nothrow`.
Returns:
`bool` on success for two arguments overload, and the resulting date for single argument overdload.
+/
static bool fromISOString(C)(scope const(C)[] str, out Date value) @safe pure nothrow @nogc
if (isSomeChar!C)
{
import mir.parse: fromString;
if (str.length < 8)
return false;
auto yearStr = str[0 .. $ - 4];
if ((yearStr[0] == '+' || yearStr[0] == '-') != (yearStr.length > 4))
return false;
uint day, month;
int year;
return
fromString(str[$ - 2 .. $], day)
&& fromString(str[$ - 4 .. $ - 2], month)
&& fromString(yearStr, year)
&& fromYMD(year, month, day, value);
}
/// ditto
static Date fromISOString(C)(scope const(C)[] str) @safe pure
if (isSomeChar!C)
{
Date ret;
if (fromISOString(str, ret))
return ret;
throw InvalidISOString;
}
///
version (mir_test)
@safe unittest
{
assert(Date.fromISOString("20100704") == Date(2010, 7, 4));
assert(Date.fromISOString("19981225") == Date(1998, 12, 25));
assert(Date.fromISOString("00000105") == Date(0, 1, 5));
assert(Date.fromISOString("-00040105") == Date(-4, 1, 5));
}
version (mir_test)
@safe unittest
{
assertThrown!DateTimeException(Date.fromISOString(""));
assertThrown!DateTimeException(Date.fromISOString("990704"));
assertThrown!DateTimeException(Date.fromISOString("0100704"));
assertThrown!DateTimeException(Date.fromISOString("2010070"));
assertThrown!DateTimeException(Date.fromISOString("120100704"));
assertThrown!DateTimeException(Date.fromISOString("-0100704"));
assertThrown!DateTimeException(Date.fromISOString("+0100704"));
assertThrown!DateTimeException(Date.fromISOString("2010070a"));
assertThrown!DateTimeException(Date.fromISOString("20100a04"));
assertThrown!DateTimeException(Date.fromISOString("2010a704"));
assertThrown!DateTimeException(Date.fromISOString("99-07-04"));
assertThrown!DateTimeException(Date.fromISOString("010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-0"));
assertThrown!DateTimeException(Date.fromISOString("12010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("-010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("+010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-0a"));
assertThrown!DateTimeException(Date.fromISOString("2010-0a-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-a7-04"));
assertThrown!DateTimeException(Date.fromISOString("2010/07/04"));
assertThrown!DateTimeException(Date.fromISOString("2010/7/04"));
assertThrown!DateTimeException(Date.fromISOString("2010/7/4"));
assertThrown!DateTimeException(Date.fromISOString("2010/07/4"));
assertThrown!DateTimeException(Date.fromISOString("2010-7-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-7-4"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-4"));
assertThrown!DateTimeException(Date.fromISOString("99Jul04"));
assertThrown!DateTimeException(Date.fromISOString("010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("2010Jul0"));
assertThrown!DateTimeException(Date.fromISOString("12010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("-010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("+010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("2010Jul0a"));
assertThrown!DateTimeException(Date.fromISOString("2010Jua04"));
assertThrown!DateTimeException(Date.fromISOString("2010aul04"));
assertThrown!DateTimeException(Date.fromISOString("99-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0"));
assertThrown!DateTimeException(Date.fromISOString("12010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("-010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("+010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0a"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jua-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jal-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-aul-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jul-04"));
assert(Date.fromISOString("19990706") == Date(1999, 7, 6));
assert(Date.fromISOString("-19990706") == Date(-1999, 7, 6));
assert(Date.fromISOString("+019990706") == Date(1999, 7, 6));
assert(Date.fromISOString("19990706") == Date(1999, 7, 6));
}
// bug# 17801
version (mir_test)
@safe unittest
{
import std.conv : to;
import std.meta : AliasSeq;
static foreach (C; AliasSeq!(char, wchar, dchar))
{
static foreach (S; AliasSeq!(C[], const(C)[], immutable(C)[]))
assert(Date.fromISOString(to!S("20121221")) == Date(2012, 12, 21));
}
}
/++
Creates a $(LREF Date) from a string with the format YYYY-MM-DD.
Params:
str = A string formatted in the way that $(LREF .date.toISOExtString) formats dates.
value = (optional) result value.
Throws:
$(LREF DateTimeException) if the given string is
not in the correct format or if the resulting $(LREF Date) would not
be valid. Two arguments overload is `nothrow`.
Returns:
`bool` on success for two arguments overload, and the resulting date for single argument overdload.
+/
static bool fromISOExtString(C)(scope const(C)[] str, out Date value) @safe pure nothrow @nogc
if (isSomeChar!C)
{
import mir.parse: fromString;
if (str.length < 10 || str[$-3] != '-' || str[$-6] != '-')
return false;
auto yearStr = str[0 .. $ - 6];
if ((yearStr[0] == '+' || yearStr[0] == '-') != (yearStr.length > 4))
return false;
uint day, month;
int year;
return
fromString(str[$ - 2 .. $], day)
&& fromString(str[$ - 5 .. $ - 3], month)
&& fromString(yearStr, year)
&& fromYMD(year, month, day, value);
}
/// ditto
static Date fromISOExtString(C)(scope const(C)[] str) @safe pure
if (isSomeChar!C)
{
Date ret;
if (fromISOExtString(str, ret))
return ret;
throw InvalidISOExtendedString;
}
///
version (mir_test)
@safe unittest
{
assert(Date.fromISOExtString("2010-07-04") == Date(2010, 7, 4));
assert(Date.fromISOExtString("1998-12-25") == Date(1998, 12, 25));
assert(Date.fromISOExtString("0000-01-05") == Date(0, 1, 5));
assert(Date.fromISOExtString("-0004-01-05") == Date(-4, 1, 5));
}
version (mir_test)
@safe unittest
{
assertThrown!DateTimeException(Date.fromISOExtString(""));
assertThrown!DateTimeException(Date.fromISOExtString("990704"));
assertThrown!DateTimeException(Date.fromISOExtString("0100704"));
assertThrown!DateTimeException(Date.fromISOExtString("120100704"));
assertThrown!DateTimeException(Date.fromISOExtString("-0100704"));
assertThrown!DateTimeException(Date.fromISOExtString("+0100704"));
assertThrown!DateTimeException(Date.fromISOExtString("2010070a"));
assertThrown!DateTimeException(Date.fromISOExtString("20100a04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010a704"));
assertThrown!DateTimeException(Date.fromISOExtString("99-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0"));
assertThrown!DateTimeException(Date.fromISOExtString("12010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("-010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("+010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0a"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-0a-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-a7-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/07/04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/7/04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/7/4"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/07/4"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-7-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-7-4"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-07-4"));
assertThrown!DateTimeException(Date.fromISOExtString("99Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0"));
assertThrown!DateTimeException(Date.fromISOExtString("12010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("-010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("+010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0a"));
assertThrown!DateTimeException(Date.fromISOExtString("2010Jua04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010aul04"));
assertThrown!DateTimeException(Date.fromISOExtString("99-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0"));
assertThrown!DateTimeException(Date.fromISOExtString("12010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("-010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("+010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0a"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jua-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jal-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-aul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("20100704"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-04"));
assert(Date.fromISOExtString("1999-07-06") == Date(1999, 7, 6));
assert(Date.fromISOExtString("-1999-07-06") == Date(-1999, 7, 6));
assert(Date.fromISOExtString("+01999-07-06") == Date(1999, 7, 6));
}
// bug# 17801
version (mir_test)
@safe unittest
{
import std.conv : to;
import std.meta : AliasSeq;
static foreach (C; AliasSeq!(char, wchar, dchar))
{
static foreach (S; AliasSeq!(C[], const(C)[], immutable(C)[]))
assert(Date.fromISOExtString(to!S("2012-12-21")) == Date(2012, 12, 21));
}
}
/++
Creates a $(LREF Date) from a string with the format YYYY-Mon-DD.
Params:
str = A string formatted in the way that $(LREF .date.toSimpleString) formats dates. The function is case sensetive.
value = (optional) result value.
Throws:
$(LREF DateTimeException) if the given string is
not in the correct format or if the resulting $(LREF Date) would not
be valid. Two arguments overload is `nothrow`.
Returns:
`bool` on success for two arguments overload, and the resulting date for single argument overdload.
+/
static bool fromSimpleString(C)(scope const(C)[] str, out Date value) @safe pure nothrow @nogc
if (isSomeChar!C)
{
import mir.parse: fromString;
if (str.length < 11 || str[$-3] != '-' || str[$-7] != '-')
return false;
auto yearStr = str[0 .. $ - 7];
if ((yearStr[0] == '+' || yearStr[0] == '-') != (yearStr.length > 4))
return false;
Month month;
switch (str[$ - 6 .. $ - 3])
{
case "Jan": month = Month.jan; break;
case "Feb": month = Month.feb; break;
case "Mar": month = Month.mar; break;
case "Apr": month = Month.apr; break;
case "May": month = Month.may; break;
case "Jun": month = Month.jun; break;
case "Jul": month = Month.jul; break;
case "Aug": month = Month.aug; break;
case "Sep": month = Month.sep; break;
case "Oct": month = Month.oct; break;
case "Nov": month = Month.nov; break;
case "Dec": month = Month.dec; break;
default: return false;
}
uint day;
int year;
return
fromString(str[$ - 2 .. $], day)
&& fromString(yearStr, year)
&& fromYMD(year, month, day, value);
}
/// ditto
static Date fromSimpleString(C)(scope const(C)[] str) @safe pure
if (isSomeChar!C)
{
Date ret;
if (fromSimpleString(str, ret))
return ret;
throw new DateTimeException("Invalid Simple String");
}
///
version (mir_test)
@safe unittest
{
assert(Date.fromSimpleString("2010-Jul-04") == Date(2010, 7, 4));
assert(Date.fromSimpleString("1998-Dec-25") == Date(1998, 12, 25));
assert(Date.fromSimpleString("0000-Jan-05") == Date(0, 1, 5));
assert(Date.fromSimpleString("-0004-Jan-05") == Date(-4, 1, 5));
}
version (mir_test)
@safe unittest
{
assertThrown!DateTimeException(Date.fromSimpleString(""));
assertThrown!DateTimeException(Date.fromSimpleString("990704"));
assertThrown!DateTimeException(Date.fromSimpleString("0100704"));
assertThrown!DateTimeException(Date.fromSimpleString("2010070"));
assertThrown!DateTimeException(Date.fromSimpleString("120100704"));
assertThrown!DateTimeException(Date.fromSimpleString("-0100704"));
assertThrown!DateTimeException(Date.fromSimpleString("+0100704"));
assertThrown!DateTimeException(Date.fromSimpleString("2010070a"));
assertThrown!DateTimeException(Date.fromSimpleString("20100a04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010a704"));
assertThrown!DateTimeException(Date.fromSimpleString("99-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0"));
assertThrown!DateTimeException(Date.fromSimpleString("12010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("-010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("+010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0a"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-0a-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-a7-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/07/04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/7/04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/7/4"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/07/4"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-7-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-7-4"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-4"));
assertThrown!DateTimeException(Date.fromSimpleString("99Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0"));
assertThrown!DateTimeException(Date.fromSimpleString("12010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("-010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("+010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0a"));
assertThrown!DateTimeException(Date.fromSimpleString("2010Jua04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010aul04"));
assertThrown!DateTimeException(Date.fromSimpleString("99-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0"));
assertThrown!DateTimeException(Date.fromSimpleString("12010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("-010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("+010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0a"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jua-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jal-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-aul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("20100704"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-04"));
assert(Date.fromSimpleString("1999-Jul-06") == Date(1999, 7, 6));
assert(Date.fromSimpleString("-1999-Jul-06") == Date(-1999, 7, 6));
assert(Date.fromSimpleString("+01999-Jul-06") == Date(1999, 7, 6));
}
// bug# 17801
version (mir_test)
@safe unittest
{
import std.conv : to;
import std.meta : AliasSeq;
static foreach (C; AliasSeq!(char, wchar, dchar))
{
static foreach (S; AliasSeq!(C[], const(C)[], immutable(C)[]))
assert(Date.fromSimpleString(to!S("2012-Dec-21")) == Date(2012, 12, 21));
}
}
/++
Creates a $(LREF Date) from a string with the format YYYY-MM-DD, YYYYMMDD, or YYYY-Mon-DD.
Params:
str = A string formatted in the way that $(LREF .date.toISOExtString), $(LREF .date.toISOString), and $(LREF .date.toSimpleString) format dates. The function is case sensetive.
value = (optional) result value.
Throws:
$(LREF DateTimeException) if the given string is
not in the correct format or if the resulting $(LREF Date) would not
be valid. Two arguments overload is `nothrow`.
Returns:
`bool` on success for two arguments overload, and the resulting date for single argument overdload.
+/
static bool fromString(C)(scope const(C)[] str, out Date value) @safe pure nothrow @nogc
{
return fromISOExtString(str, value)
|| fromISOString(str, value)
|| fromSimpleString(str, value);
}
///
version (mir_test)
@safe pure @nogc unittest
{
assert(Date.fromString("2010-07-04") == Date(2010, 7, 4));
assert(Date.fromString("20100704") == Date(2010, 7, 4));
assert(Date.fromString("2010-Jul-04") == Date(2010, 7, 4));
}
/// ditto
static Date fromString(C)(scope const(C)[] str) @safe pure
if (isSomeChar!C)
{
Date ret;
if (fromString(str, ret))
return ret;
throw InvalidString;
}
/++
Returns the $(LREF Date) farthest in the past which is representable by
$(LREF Date).
+/
@property static Date min() @safe pure nothrow @nogc
{
return Date(-(int.max / 2));
}
/++
Returns the $(LREF Date) farthest in the future which is representable
by $(LREF Date).
+/
@property static Date max() @safe pure nothrow @nogc
{
return Date(int.max / 2);
}
private:
/+
Whether the given values form a valid date.
Params:
year = The year to test.
month = The month of the Gregorian Calendar to test.
day = The day of the month to test.
+/
static bool _valid(int year, int month, int day) @safe pure nothrow @nogc
{
if (!valid!"months"(month))
return false;
return valid!"days"(year, month, day);
}
package:
/+
Adds the given number of days to this $(LREF Date). A negative number
will subtract.
The month will be adjusted along with the day if the number of days
added (or subtracted) would overflow (or underflow) the current month.
The year will be adjusted along with the month if the increase (or
decrease) to the month would cause it to overflow (or underflow) the
current year.
$(D _addDays(numDays)) is effectively equivalent to
$(D date.dayOfGregorianCal = date.dayOfGregorianCal + days).
Params:
days = The number of days to add to this Date.
+/
ref Date _addDays(long days) return @safe pure nothrow @nogc
{
_julianDay = cast(int)(_julianDay + days);
return this;
}
version (mir_test)
@safe unittest
{
// Test A.D.
{
auto date = Date(1999, 2, 28);
date._addDays(1);
assert(date == Date(1999, 3, 1));
date._addDays(-1);
assert(date == Date(1999, 2, 28));
}
{
auto date = Date(2000, 2, 28);
date._addDays(1);
assert(date == Date(2000, 2, 29));
date._addDays(1);
assert(date == Date(2000, 3, 1));
date._addDays(-1);
assert(date == Date(2000, 2, 29));
}
{
auto date = Date(1999, 6, 30);
date._addDays(1);
assert(date == Date(1999, 7, 1));
date._addDays(-1);
assert(date == Date(1999, 6, 30));
}
{
auto date = Date(1999, 7, 31);
date._addDays(1);
assert(date == Date(1999, 8, 1));
date._addDays(-1);
assert(date == Date(1999, 7, 31));
}
{
auto date = Date(1999, 1, 1);
date._addDays(-1);
assert(date == Date(1998, 12, 31));
date._addDays(1);
assert(date == Date(1999, 1, 1));
}
{
auto date = Date(1999, 7, 6);
date._addDays(9);
assert(date == Date(1999, 7, 15));
date._addDays(-11);
assert(date == Date(1999, 7, 4));
date._addDays(30);
assert(date == Date(1999, 8, 3));
date._addDays(-3);
assert(date == Date(1999, 7, 31));
}
{
auto date = Date(1999, 7, 6);
date._addDays(365);
assert(date == Date(2000, 7, 5));
date._addDays(-365);
assert(date == Date(1999, 7, 6));
date._addDays(366);
assert(date == Date(2000, 7, 6));
date._addDays(730);
assert(date == Date(2002, 7, 6));
date._addDays(-1096);
assert(date == Date(1999, 7, 6));
}
// Test B.C.
{
auto date = Date(-1999, 2, 28);
date._addDays(1);
assert(date == Date(-1999, 3, 1));
date._addDays(-1);
assert(date == Date(-1999, 2, 28));
}
{
auto date = Date(-2000, 2, 28);
date._addDays(1);
assert(date == Date(-2000, 2, 29));
date._addDays(1);
assert(date == Date(-2000, 3, 1));
date._addDays(-1);
assert(date == Date(-2000, 2, 29));
}
{
auto date = Date(-1999, 6, 30);
date._addDays(1);
assert(date == Date(-1999, 7, 1));
date._addDays(-1);
assert(date == Date(-1999, 6, 30));
}
{
auto date = Date(-1999, 7, 31);
date._addDays(1);
assert(date == Date(-1999, 8, 1));
date._addDays(-1);
assert(date == Date(-1999, 7, 31));
}
{
auto date = Date(-1999, 1, 1);
date._addDays(-1);
assert(date == Date(-2000, 12, 31));
date._addDays(1);
assert(date == Date(-1999, 1, 1));
}
{
auto date = Date(-1999, 7, 6);
date._addDays(9);
assert(date == Date(-1999, 7, 15));
date._addDays(-11);
assert(date == Date(-1999, 7, 4));
date._addDays(30);
assert(date == Date(-1999, 8, 3));
date._addDays(-3);
}
{
auto date = Date(-1999, 7, 6);
date._addDays(365);
assert(date == Date(-1998, 7, 6));
date._addDays(-365);
assert(date == Date(-1999, 7, 6));
date._addDays(366);
assert(date == Date(-1998, 7, 7));
date._addDays(730);
assert(date == Date(-1996, 7, 6));
date._addDays(-1096);
assert(date == Date(-1999, 7, 6));
}
// Test Both
{
auto date = Date(1, 7, 6);
date._addDays(-365);
assert(date == Date(0, 7, 6));
date._addDays(365);
assert(date == Date(1, 7, 6));
date._addDays(-731);
assert(date == Date(-1, 7, 6));
date._addDays(730);
assert(date == Date(1, 7, 5));
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate._addDays(12)));
static assert(!__traits(compiles, idate._addDays(12)));
}
int _julianDay;
}
/// ditto
alias Date = date;
/++
Returns the number of days from the current day of the week to the given
day of the week. If they are the same, then the result is 0.
Params:
currDoW = The current day of the week.
dow = The day of the week to get the number of days to.
+/
int daysToDayOfWeek(DayOfWeek currDoW, DayOfWeek dow) @safe pure nothrow @nogc
{
if (currDoW == dow)
return 0;
if (currDoW < dow)
return dow - currDoW;
return DayOfWeek.sun - currDoW + dow + 1;
}
///
version (mir_test)
@safe pure nothrow @nogc unittest
{
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.mon) == 0);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.sun) == 6);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.wed) == 2);
}
version (mir_test)
@safe unittest
{
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.sun) == 0);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.mon) == 1);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.tue) == 2);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.wed) == 3);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.thu) == 4);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.fri) == 5);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.sat) == 6);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.sun) == 6);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.mon) == 0);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.tue) == 1);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.wed) == 2);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.thu) == 3);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.fri) == 4);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.sat) == 5);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.sun) == 5);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.mon) == 6);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.tue) == 0);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.wed) == 1);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.thu) == 2);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.fri) == 3);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.sat) == 4);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.sun) == 4);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.mon) == 5);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.tue) == 6);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.wed) == 0);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.thu) == 1);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.fri) == 2);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.sat) == 3);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.sun) == 3);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.mon) == 4);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.tue) == 5);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.wed) == 6);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.thu) == 0);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.fri) == 1);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.sat) == 2);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.sun) == 2);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.mon) == 3);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.tue) == 4);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.wed) == 5);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.thu) == 6);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.fri) == 0);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.sat) == 1);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.sun) == 1);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.mon) == 2);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.tue) == 3);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.wed) == 4);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.thu) == 5);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.fri) == 6);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.sat) == 0);
}
package:
/+
Array of the short (three letter) names of each month.
+/
immutable string[12] _monthNames = ["Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"];
/++
The maximum valid Day in the given month in the given year.
Params:
year = The year to get the day for.
month = The month of the Gregorian Calendar to get the day for.
+/
public ubyte maxDay(int year, int month) @safe pure nothrow @nogc
in
{
assert(valid!"months"(month));
}
do
{
switch (month)
{
case Month.jan, Month.mar, Month.may, Month.jul, Month.aug, Month.oct, Month.dec:
return 31;
case Month.feb:
return yearIsLeapYear(year) ? 29 : 28;
case Month.apr, Month.jun, Month.sep, Month.nov:
return 30;
default:
assert(0, "Invalid month.");
}
}
version (mir_test)
@safe unittest
{
// Test A.D.
assert(maxDay(1999, 1) == 31);
assert(maxDay(1999, 2) == 28);
assert(maxDay(1999, 3) == 31);
assert(maxDay(1999, 4) == 30);
assert(maxDay(1999, 5) == 31);
assert(maxDay(1999, 6) == 30);
assert(maxDay(1999, 7) == 31);
assert(maxDay(1999, 8) == 31);
assert(maxDay(1999, 9) == 30);
assert(maxDay(1999, 10) == 31);
assert(maxDay(1999, 11) == 30);
assert(maxDay(1999, 12) == 31);
assert(maxDay(2000, 1) == 31);
assert(maxDay(2000, 2) == 29);
assert(maxDay(2000, 3) == 31);
assert(maxDay(2000, 4) == 30);
assert(maxDay(2000, 5) == 31);
assert(maxDay(2000, 6) == 30);
assert(maxDay(2000, 7) == 31);
assert(maxDay(2000, 8) == 31);
assert(maxDay(2000, 9) == 30);
assert(maxDay(2000, 10) == 31);
assert(maxDay(2000, 11) == 30);
assert(maxDay(2000, 12) == 31);
// Test B.C.
assert(maxDay(-1999, 1) == 31);
assert(maxDay(-1999, 2) == 28);
assert(maxDay(-1999, 3) == 31);
assert(maxDay(-1999, 4) == 30);
assert(maxDay(-1999, 5) == 31);
assert(maxDay(-1999, 6) == 30);
assert(maxDay(-1999, 7) == 31);
assert(maxDay(-1999, 8) == 31);
assert(maxDay(-1999, 9) == 30);
assert(maxDay(-1999, 10) == 31);
assert(maxDay(-1999, 11) == 30);
assert(maxDay(-1999, 12) == 31);
assert(maxDay(-2000, 1) == 31);
assert(maxDay(-2000, 2) == 29);
assert(maxDay(-2000, 3) == 31);
assert(maxDay(-2000, 4) == 30);
assert(maxDay(-2000, 5) == 31);
assert(maxDay(-2000, 6) == 30);
assert(maxDay(-2000, 7) == 31);
assert(maxDay(-2000, 8) == 31);
assert(maxDay(-2000, 9) == 30);
assert(maxDay(-2000, 10) == 31);
assert(maxDay(-2000, 11) == 30);
assert(maxDay(-2000, 12) == 31);
}
/+
Returns the day of the week for the given day of the Gregorian/Julian Calendar.
Params:
day = The day of the Gregorian/Julian Calendar for which to get the day of
the week.
+/
DayOfWeek getDayOfWeek(int day) @safe pure nothrow @nogc
{
// January 1st, 1 A.D. was a Monday
if (day >= 0)
return cast(DayOfWeek)(day % 7);
else
{
immutable dow = cast(DayOfWeek)((day % 7) + 7);
if (dow == 7)
return DayOfWeek.mon;
else
return dow;
}
}
private:
enum daysInYear = 365; // The number of days in a non-leap year.
enum daysInLeapYear = 366; // The numbef or days in a leap year.
enum daysIn4Years = daysInYear * 3 + daysInLeapYear; // Number of days in 4 years.
enum daysIn100Years = daysIn4Years * 25 - 1; // The number of days in 100 years.
enum daysIn400Years = daysIn100Years * 4 + 1; // The number of days in 400 years.
/+
Array of integers representing the last days of each month in a year.
+/
immutable int[13] lastDayNonLeap = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
/+
Array of integers representing the last days of each month in a leap year.
+/
immutable int[13] lastDayLeap = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];
/+
Returns the string representation of the given month.
+/
string monthToString(Month month) @safe pure @nogc nothrow
{
assert(month >= Month.jan && month <= Month.dec, "Invalid month");
return _monthNames[month - Month.jan];
}
version (mir_test)
@safe unittest
{
assert(monthToString(Month.jan) == "Jan");
assert(monthToString(Month.feb) == "Feb");
assert(monthToString(Month.mar) == "Mar");
assert(monthToString(Month.apr) == "Apr");
assert(monthToString(Month.may) == "May");
assert(monthToString(Month.jun) == "Jun");
assert(monthToString(Month.jul) == "Jul");
assert(monthToString(Month.aug) == "Aug");
assert(monthToString(Month.sep) == "Sep");
assert(monthToString(Month.oct) == "Oct");
assert(monthToString(Month.nov) == "Nov");
assert(monthToString(Month.dec) == "Dec");
}
version (mir_test)
version(unittest)
{
// All of these helper arrays are sorted in ascending order.
auto testYearsBC = [-1999, -1200, -600, -4, -1, 0];
auto testYearsAD = [1, 4, 1000, 1999, 2000, 2012];
// I'd use a Tuple, but I get forward reference errors if I try.
struct MonthDay
{
Month month;
short day;
this(int m, short d)
{
month = cast(Month) m;
day = d;
}
}
MonthDay[] testMonthDays = [MonthDay(1, 1),
MonthDay(1, 2),
MonthDay(3, 17),
MonthDay(7, 4),
MonthDay(10, 27),
MonthDay(12, 30),
MonthDay(12, 31)];
auto testDays = [1, 2, 9, 10, 16, 20, 25, 28, 29, 30, 31];
Date[] testDatesBC;
Date[] testDatesAD;
// I'd use a Tuple, but I get forward reference errors if I try.
struct GregDay { int day; Date date; }
auto testGregDaysBC = [GregDay(-1_373_427, Date(-3760, 9, 7)), // Start of the Hebrew Calendar
GregDay(-735_233, Date(-2012, 1, 1)),
GregDay(-735_202, Date(-2012, 2, 1)),
GregDay(-735_175, Date(-2012, 2, 28)),
GregDay(-735_174, Date(-2012, 2, 29)),
GregDay(-735_173, Date(-2012, 3, 1)),
GregDay(-734_502, Date(-2010, 1, 1)),
GregDay(-734_472, Date(-2010, 1, 31)),
GregDay(-734_471, Date(-2010, 2, 1)),
GregDay(-734_444, Date(-2010, 2, 28)),
GregDay(-734_443, Date(-2010, 3, 1)),
GregDay(-734_413, Date(-2010, 3, 31)),
GregDay(-734_412, Date(-2010, 4, 1)),
GregDay(-734_383, Date(-2010, 4, 30)),
GregDay(-734_382, Date(-2010, 5, 1)),
GregDay(-734_352, Date(-2010, 5, 31)),
GregDay(-734_351, Date(-2010, 6, 1)),
GregDay(-734_322, Date(-2010, 6, 30)),
GregDay(-734_321, Date(-2010, 7, 1)),
GregDay(-734_291, Date(-2010, 7, 31)),
GregDay(-734_290, Date(-2010, 8, 1)),
GregDay(-734_260, Date(-2010, 8, 31)),
GregDay(-734_259, Date(-2010, 9, 1)),
GregDay(-734_230, Date(-2010, 9, 30)),
GregDay(-734_229, Date(-2010, 10, 1)),
GregDay(-734_199, Date(-2010, 10, 31)),
GregDay(-734_198, Date(-2010, 11, 1)),
GregDay(-734_169, Date(-2010, 11, 30)),
GregDay(-734_168, Date(-2010, 12, 1)),
GregDay(-734_139, Date(-2010, 12, 30)),
GregDay(-734_138, Date(-2010, 12, 31)),
GregDay(-731_215, Date(-2001, 1, 1)),
GregDay(-730_850, Date(-2000, 1, 1)),
GregDay(-730_849, Date(-2000, 1, 2)),
GregDay(-730_486, Date(-2000, 12, 30)),
GregDay(-730_485, Date(-2000, 12, 31)),
GregDay(-730_484, Date(-1999, 1, 1)),
GregDay(-694_690, Date(-1901, 1, 1)),
GregDay(-694_325, Date(-1900, 1, 1)),
GregDay(-585_118, Date(-1601, 1, 1)),
GregDay(-584_753, Date(-1600, 1, 1)),
GregDay(-584_388, Date(-1600, 12, 31)),
GregDay(-584_387, Date(-1599, 1, 1)),
GregDay(-365_972, Date(-1001, 1, 1)),
GregDay(-365_607, Date(-1000, 1, 1)),
GregDay(-183_351, Date(-501, 1, 1)),
GregDay(-182_986, Date(-500, 1, 1)),
GregDay(-182_621, Date(-499, 1, 1)),
GregDay(-146_827, Date(-401, 1, 1)),
GregDay(-146_462, Date(-400, 1, 1)),
GregDay(-146_097, Date(-400, 12, 31)),
GregDay(-110_302, Date(-301, 1, 1)),
GregDay(-109_937, Date(-300, 1, 1)),
GregDay(-73_778, Date(-201, 1, 1)),
GregDay(-73_413, Date(-200, 1, 1)),
GregDay(-38_715, Date(-105, 1, 1)),
GregDay(-37_254, Date(-101, 1, 1)),
GregDay(-36_889, Date(-100, 1, 1)),
GregDay(-36_524, Date(-99, 1, 1)),
GregDay(-36_160, Date(-99, 12, 31)),
GregDay(-35_794, Date(-97, 1, 1)),
GregDay(-18_627, Date(-50, 1, 1)),
GregDay(-18_262, Date(-49, 1, 1)),
GregDay(-3652, Date(-9, 1, 1)),
GregDay(-2191, Date(-5, 1, 1)),
GregDay(-1827, Date(-5, 12, 31)),
GregDay(-1826, Date(-4, 1, 1)),
GregDay(-1825, Date(-4, 1, 2)),
GregDay(-1462, Date(-4, 12, 30)),
GregDay(-1461, Date(-4, 12, 31)),
GregDay(-1460, Date(-3, 1, 1)),
GregDay(-1096, Date(-3, 12, 31)),
GregDay(-1095, Date(-2, 1, 1)),
GregDay(-731, Date(-2, 12, 31)),
GregDay(-730, Date(-1, 1, 1)),
GregDay(-367, Date(-1, 12, 30)),
GregDay(-366, Date(-1, 12, 31)),
GregDay(-365, Date(0, 1, 1)),
GregDay(-31, Date(0, 11, 30)),
GregDay(-30, Date(0, 12, 1)),
GregDay(-1, Date(0, 12, 30)),
GregDay(0, Date(0, 12, 31))];
auto testGregDaysAD = [GregDay(1, Date(1, 1, 1)),
GregDay(2, Date(1, 1, 2)),
GregDay(32, Date(1, 2, 1)),
GregDay(365, Date(1, 12, 31)),
GregDay(366, Date(2, 1, 1)),
GregDay(731, Date(3, 1, 1)),
GregDay(1096, Date(4, 1, 1)),
GregDay(1097, Date(4, 1, 2)),
GregDay(1460, Date(4, 12, 30)),
GregDay(1461, Date(4, 12, 31)),
GregDay(1462, Date(5, 1, 1)),
GregDay(17_898, Date(50, 1, 1)),
GregDay(35_065, Date(97, 1, 1)),
GregDay(36_160, Date(100, 1, 1)),
GregDay(36_525, Date(101, 1, 1)),
GregDay(37_986, Date(105, 1, 1)),
GregDay(72_684, Date(200, 1, 1)),
GregDay(73_049, Date(201, 1, 1)),
GregDay(109_208, Date(300, 1, 1)),
GregDay(109_573, Date(301, 1, 1)),
GregDay(145_732, Date(400, 1, 1)),
GregDay(146_098, Date(401, 1, 1)),
GregDay(182_257, Date(500, 1, 1)),
GregDay(182_622, Date(501, 1, 1)),
GregDay(364_878, Date(1000, 1, 1)),
GregDay(365_243, Date(1001, 1, 1)),
GregDay(584_023, Date(1600, 1, 1)),
GregDay(584_389, Date(1601, 1, 1)),
GregDay(693_596, Date(1900, 1, 1)),
GregDay(693_961, Date(1901, 1, 1)),
GregDay(729_755, Date(1999, 1, 1)),
GregDay(730_120, Date(2000, 1, 1)),
GregDay(730_121, Date(2000, 1, 2)),
GregDay(730_484, Date(2000, 12, 30)),
GregDay(730_485, Date(2000, 12, 31)),
GregDay(730_486, Date(2001, 1, 1)),
GregDay(733_773, Date(2010, 1, 1)),
GregDay(733_774, Date(2010, 1, 2)),
GregDay(733_803, Date(2010, 1, 31)),
GregDay(733_804, Date(2010, 2, 1)),
GregDay(733_831, Date(2010, 2, 28)),
GregDay(733_832, Date(2010, 3, 1)),
GregDay(733_862, Date(2010, 3, 31)),
GregDay(733_863, Date(2010, 4, 1)),
GregDay(733_892, Date(2010, 4, 30)),
GregDay(733_893, Date(2010, 5, 1)),
GregDay(733_923, Date(2010, 5, 31)),
GregDay(733_924, Date(2010, 6, 1)),
GregDay(733_953, Date(2010, 6, 30)),
GregDay(733_954, Date(2010, 7, 1)),
GregDay(733_984, Date(2010, 7, 31)),
GregDay(733_985, Date(2010, 8, 1)),
GregDay(734_015, Date(2010, 8, 31)),
GregDay(734_016, Date(2010, 9, 1)),
GregDay(734_045, Date(2010, 9, 30)),
GregDay(734_046, Date(2010, 10, 1)),
GregDay(734_076, Date(2010, 10, 31)),
GregDay(734_077, Date(2010, 11, 1)),
GregDay(734_106, Date(2010, 11, 30)),
GregDay(734_107, Date(2010, 12, 1)),
GregDay(734_136, Date(2010, 12, 30)),
GregDay(734_137, Date(2010, 12, 31)),
GregDay(734_503, Date(2012, 1, 1)),
GregDay(734_534, Date(2012, 2, 1)),
GregDay(734_561, Date(2012, 2, 28)),
GregDay(734_562, Date(2012, 2, 29)),
GregDay(734_563, Date(2012, 3, 1)),
GregDay(734_858, Date(2012, 12, 21))];
// I'd use a Tuple, but I get forward reference errors if I try.
struct DayOfYear { int day; MonthDay md; }
auto testDaysOfYear = [DayOfYear(1, MonthDay(1, 1)),
DayOfYear(2, MonthDay(1, 2)),
DayOfYear(3, MonthDay(1, 3)),
DayOfYear(31, MonthDay(1, 31)),
DayOfYear(32, MonthDay(2, 1)),
DayOfYear(59, MonthDay(2, 28)),
DayOfYear(60, MonthDay(3, 1)),
DayOfYear(90, MonthDay(3, 31)),
DayOfYear(91, MonthDay(4, 1)),
DayOfYear(120, MonthDay(4, 30)),
DayOfYear(121, MonthDay(5, 1)),
DayOfYear(151, MonthDay(5, 31)),
DayOfYear(152, MonthDay(6, 1)),
DayOfYear(181, MonthDay(6, 30)),
DayOfYear(182, MonthDay(7, 1)),
DayOfYear(212, MonthDay(7, 31)),
DayOfYear(213, MonthDay(8, 1)),
DayOfYear(243, MonthDay(8, 31)),
DayOfYear(244, MonthDay(9, 1)),
DayOfYear(273, MonthDay(9, 30)),
DayOfYear(274, MonthDay(10, 1)),
DayOfYear(304, MonthDay(10, 31)),
DayOfYear(305, MonthDay(11, 1)),
DayOfYear(334, MonthDay(11, 30)),
DayOfYear(335, MonthDay(12, 1)),
DayOfYear(363, MonthDay(12, 29)),
DayOfYear(364, MonthDay(12, 30)),
DayOfYear(365, MonthDay(12, 31))];
auto testDaysOfLeapYear = [DayOfYear(1, MonthDay(1, 1)),
DayOfYear(2, MonthDay(1, 2)),
DayOfYear(3, MonthDay(1, 3)),
DayOfYear(31, MonthDay(1, 31)),
DayOfYear(32, MonthDay(2, 1)),
DayOfYear(59, MonthDay(2, 28)),
DayOfYear(60, MonthDay(2, 29)),
DayOfYear(61, MonthDay(3, 1)),
DayOfYear(91, MonthDay(3, 31)),
DayOfYear(92, MonthDay(4, 1)),
DayOfYear(121, MonthDay(4, 30)),
DayOfYear(122, MonthDay(5, 1)),
DayOfYear(152, MonthDay(5, 31)),
DayOfYear(153, MonthDay(6, 1)),
DayOfYear(182, MonthDay(6, 30)),
DayOfYear(183, MonthDay(7, 1)),
DayOfYear(213, MonthDay(7, 31)),
DayOfYear(214, MonthDay(8, 1)),
DayOfYear(244, MonthDay(8, 31)),
DayOfYear(245, MonthDay(9, 1)),
DayOfYear(274, MonthDay(9, 30)),
DayOfYear(275, MonthDay(10, 1)),
DayOfYear(305, MonthDay(10, 31)),
DayOfYear(306, MonthDay(11, 1)),
DayOfYear(335, MonthDay(11, 30)),
DayOfYear(336, MonthDay(12, 1)),
DayOfYear(364, MonthDay(12, 29)),
DayOfYear(365, MonthDay(12, 30)),
DayOfYear(366, MonthDay(12, 31))];
void initializeTests() @safe
{
foreach (year; testYearsBC)
{
foreach (md; testMonthDays)
testDatesBC ~= Date(year, md.month, md.day);
}
foreach (year; testYearsAD)
{
foreach (md; testMonthDays)
testDatesAD ~= Date(year, md.month, md.day);
}
}
}
|
D
|
module automem.utils;
import std.traits : isStaticArray;
// This is a destroy() copied and modified from
// druntime, to allow for destruction attribute inference
void destruct(T)(T obj) if (is(T == class)) {
(cast(_finalizeType!T)&rt_finalize)(cast(void*)obj);
}
void destruct(T)(T obj) if (is(T == interface)) {
destruct(cast(Object)obj);
}
void destruct(T)(ref T obj) if (is(T == struct)) {
static if (__traits(hasMember, T, "__xdtor") &&
__traits(isSame, T, __traits(parent, obj.__xdtor)))
obj.__xdtor;
}
void destruct(T : U[n], U, size_t n)(ref T obj) if (!is(T == struct)) {
foreach_reverse (ref e; obj[])
destruct(e);
}
void destruct(T)(ref T obj)
if(!is(T == struct) && !is(T == class) && !is(T == interface) && !isStaticArray!T) {
obj = T.init;
}
@("class dtor inference")
unittest {
class A { ~this() @nogc {} }
class B : A { ~this() {} }
class C : B { ~this() @nogc {} }
static assert( __traits(compiles, () @nogc { A a; destruct(a); }));
static assert(!__traits(compiles, () @nogc { B a; destruct(b); }));
static assert(!__traits(compiles, () @nogc { C a; destruct(c); }));
}
@("class dtor inference with struct members")
unittest {
struct A { ~this() @nogc {} }
struct B { ~this() {} }
class CA { A a; ~this() @nogc {} }
class CB { B b; ~this() @nogc {} }
static assert( __traits(compiles, () @nogc { CA a; destruct(a); }));
static assert(!__traits(compiles, () @nogc { CB a; destruct(b); }));
}
private:
extern(C) void rt_finalize(void* p, bool det = true);
// A slightly better hack than the one presented by
// https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html
//
// This template infers destruction attributes from the given
// class hierarchy. It actually may be incorrect, as by
// the current language rules derived class can still
// have weaker set of destruction attributes.
extern(C)
template _finalizeType(T) {
static if (is(T == Object)) {
alias _finalizeType = typeof(&rt_finalize);
} else {
import std.traits : BaseClassesTuple;
import std.meta : AliasSeq;
alias _finalizeType = typeof((void* p, bool det = true) {
// generate a body that calls all the destructors in the chain,
// compiler should infer the intersection of attributes
foreach (B; AliasSeq!(T, BaseClassesTuple!T)) {
// __dtor, i.e. B.~this
static if (__traits(hasMember, B, "__dtor"))
() { B obj; obj.__dtor; } ();
// __xdtor, i.e. dtors for all RAII members
static if (__traits(hasMember, B, "__xdtor"))
() { B obj; obj.__xdtor; } ();
}
});
}
}
|
D
|
// Diese Datei wurde automatisch durch den Miranda Dialog Creator erstellt!
// Sie sollte nicht manuell editiert werden, da ─nderungen beim erneuten Aufruf
// des Creators Řberschrieben werden!
// **************************************************
instance BAU_230_Stan_Exit (C_INFO)
{
npc = BAU_230_Stan;
condition = BAU_230_Stan_Exit_Condition;
information = BAU_230_Stan_Exit_Info;
important = FALSE;
permanent = TRUE;
nr = 999;
description = DIALOG_ENDE;
};
func int BAU_230_Stan_Exit_Condition()
{
return TRUE;
};
func void BAU_230_Stan_Exit_Info()
{
AI_StopProcessInfos(self);
};
// **************************************************
instance BAU_230_Stan_yourFarm (C_INFO)
{
npc = BAU_230_Stan;
condition = BAU_230_Stan_yourFarm_Condition;
information = BAU_230_Stan_yourFarm_Info;
important = FALSE;
permanent = FALSE;
description = "Ist das dein Hof?";
};
func int BAU_230_Stan_yourFarm_Condition()
{
return TRUE;
};
func void BAU_230_Stan_yourFarm_Info()
{
AI_Output(other, self, "BAU_230_Stan_yourFarm_Info_15_01"); // Ist das dein Hof?
AI_Output(self, other, "BAU_230_Stan_yourFarm_Info_03_02"); // Ganz richtig. Also pass auf, dass du dich benimmst.
};
// **************************************************
instance BAU_230_Stan_canBuySth (C_INFO)
{
npc = BAU_230_Stan;
condition = BAU_230_Stan_canBuySth_Condition;
information = BAU_230_Stan_canBuySth_Info;
important = FALSE;
permanent = FALSE;
description = "Kann ich bei dir was kaufen?";
};
func int BAU_230_Stan_canBuySth_Condition()
{
if (Npc_KnowsInfo(hero, BAU_230_Stan_yourFarm))
{
return TRUE;
};
};
func void BAU_230_Stan_canBuySth_Info()
{
AI_Output(other, self, "BAU_230_Stan_canBuySth_Info_15_01"); // Kann ich bei dir was kaufen?
AI_Output(self, other, "BAU_230_Stan_canBuySth_Info_03_02"); // Frag mal Ron. Er ist mein Lagerverwalter.
AI_Output(self, other, "BAU_230_Stan_canBuySth_Info_03_03"); // Vielleicht haben wir noch was ├╝brig.
};
// **************************************************
instance BAU_230_Stan_bandits (C_INFO)
{
npc = BAU_230_Stan;
condition = BAU_230_Stan_bandits_Condition;
information = BAU_230_Stan_bandits_Info;
important = FALSE;
permanent = FALSE;
description = "Du hast Probleme mit Banditen?";
};
func int BAU_230_Stan_bandits_Condition()
{
if (milPhase == 1)
{
return TRUE;
};
};
func void BAU_230_Stan_bandits_Info()
{
AI_Output(other, self, "BAU_230_Stan_bandits_Info_15_01"); // Du hast Probleme mit Banditen?
AI_Output(self, other, "BAU_230_Stan_bandits_Info_03_02"); // Diese verfluchten Idioten wollen meinen Hof verw├╝sten.
AI_Output(self, other, "BAU_230_Stan_bandits_Info_03_03"); // Sie haben schon ein paar Schafe geschlachtet, als wir vom Hof geflohen sind.
AI_Output(other, self, "BAU_230_Stan_bandits_Info_15_04"); // Sollen wir uns drum k├╝mmern?
AI_Output(self, other, "BAU_230_Stan_bandits_Info_03_05"); // Ja, verdammt! Wof├╝r seid ihr Stadtwachen denn da?
AI_Output(self, other, "BAU_230_Stan_bandits_Info_03_06"); // Sorg daf├╝r, dass sie von meinem Hof verschwinden.
};
// **************************************************
instance BAU_230_Stan_banditsDead (C_INFO)
{
npc = BAU_230_Stan;
condition = BAU_230_Stan_banditsDead_Condition;
information = BAU_230_Stan_banditsDead_Info;
important = FALSE;
permanent = FALSE;
description = "Die Banditen sind tot!";
};
func int BAU_230_Stan_banditsDead_Condition()
{
if ((Npc_KnowsInfo(hero, BAU_230_Stan_bandits)) && (Npc_IsDead(BDT_1009_Bandit_L)) && (Npc_IsDead(BDT_1010_Bandit_L)) && (Npc_IsDead(BDT_1011_Bandit_M)))
{
return TRUE;
};
};
func void BAU_230_Stan_banditsDead_Info()
{
AI_Output(other, self, "BAU_230_Stan_banditsDead_Info_15_01"); // Die Banditen sind tot!
AI_Output(self, other, "BAU_230_Stan_banditsDead_Info_03_02"); // Wirklich? Das ist gut.
AI_Output(self, other, "BAU_230_Stan_banditsDead_Info_03_03"); // Dann k├Ânnen wir endlich weiterarbeiten!
AI_Output(self, other, "BAU_230_Stan_banditsDead_Info_03_04"); // Wenn du irgendwas brauchst, komm zu uns. Wir haben immer etwas im Angebot!
setMilPhaseBack(1);
};
|
D
|
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCommon.build/Model/Quota.swift.o : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Quota.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Filter.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/SimpleResponses.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Sort.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCommon.build/Quota~partial.swiftmodule : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Quota.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Filter.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/SimpleResponses.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Sort.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCommon.build/Quota~partial.swiftdoc : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Quota.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Filter.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/SimpleResponses.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKCommon/Model/Sort.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module fluentasserts.core.string;
public import fluentasserts.core.base;
import fluentasserts.core.results;
import std.string;
import std.conv;
import std.algorithm;
import std.array;
@safe:
struct ShouldString {
private {
const string testData;
}
mixin ShouldCommons;
mixin ShouldThrowableCommons;
this(string value) {
testData = value;
}
this(U)(U value) {
valueEvaluation = value.evaluation;
testData = value.value;
}
auto equal(const string someString, const string file = __FILE__, const size_t line = __LINE__) @trusted {
validateException;
addMessage(" equal `");
addValue(someString.to!string);
addMessage("`");
beginCheck;
auto isSame = testData == someString;
Message[] msg = [
Message(false, "`"),
Message(true, testData),
Message(false, "` is" ~ (expectedValue ? " not" : "") ~ " equal to `"),
Message(true, someString),
Message(false, "`.")
];
version(DisableDiffResult) {
return result(isSame, msg, cast(IResult[])[ new ExpectedActualResult(someString, testData) ], file, line);
} else {
return result(isSame, msg, cast(IResult[])[ new DiffResult(someString, testData), new ExpectedActualResult(someString, testData) ], file, line);
}
}
auto contain(const string[] someStrings, const string file = __FILE__, const size_t line = __LINE__) {
validateException;
addMessage(" contain `");
addValue(someStrings.to!string);
addMessage("`");
beginCheck;
if(expectedValue) {
auto missingValues = someStrings.filter!(a => testData.indexOf(a) == -1).array;
Message[] msg = [
Message(true, missingValues.to!string),
Message(false, " are missing from `"),
Message(true, testData),
Message(false, "`.")
];
return result(missingValues.length == 0, msg, new ExpectedActualResult("to contain all " ~ someStrings.to!string, testData), file, line);
} else {
auto presentValues = someStrings.filter!(a => testData.indexOf(a) != -1).array;
Message[] msg = [
Message(true, presentValues.to!string),
Message(false, " are present in `"),
Message(true, testData),
Message(false, "`.")
];
return result(presentValues.length != 0, msg, new ExpectedActualResult("to not contain any " ~ someStrings.to!string, testData), file, line);
}
}
auto contain(const string someString, const string file = __FILE__, const size_t line = __LINE__) {
validateException;
addMessage(" contain `");
addValue(someString);
addMessage("`");
beginCheck;
auto index = testData.indexOf(someString);
auto isPresent = index >= 0;
Message[] msg = [
Message(false, "`"),
Message(true, someString),
Message(false, expectedValue ? "` is missing from `" : "` is present in `"),
Message(true, testData),
Message(false, "`.")
];
auto mode = expectedValue ? "to contain" : "to not contain";
return result(isPresent, msg, new ExpectedActualResult(mode ~ " `" ~ someString ~ "`", testData), file, line);
}
auto contain(const char someChar, const string file = __FILE__, const size_t line = __LINE__) {
validateException;
addMessage(" contain `");
addValue(someChar.to!string);
addMessage("`");
beginCheck;
auto index = testData.indexOf(someChar);
auto isPresent = index >= 0;
Message[] msg = [
Message(false, "`"),
Message(true, someChar.to!string),
Message(false, isPresent ? "` is present in `" : "` is not present in `"),
Message(true, testData),
Message(false, "`.")
];
auto mode = expectedValue ? "to contain" : "to not contain";
return result(isPresent, msg, new ExpectedActualResult(mode ~ " `" ~ someChar ~ "`", testData), file, line);
}
auto startWith(T)(const T someString, const string file = __FILE__, const size_t line = __LINE__) {
validateException;
addMessage(" start with `");
addValue(someString.to!string);
addMessage("`");
beginCheck;
auto index = testData.indexOf(someString);
auto doesStartWith = index == 0;
Message[] msg = [
Message(false, "`"),
Message(true, testData.to!string),
Message(false, expectedValue ? "` does not start with `" : "` does start with `"),
Message(true, someString.to!string),
Message(false, "`.")
];
auto mode = expectedValue ? "to start with " : "to not start with ";
return result(doesStartWith, msg, new ExpectedActualResult(mode ~ "`" ~ someString.to!string ~ "`", testData), file, line);
}
auto endWith(T)(const T someString, const string file = __FILE__, const size_t line = __LINE__) {
validateException;
addMessage(" end with `");
addValue(someString.to!string);
addMessage("`");
beginCheck;
auto index = testData.lastIndexOf(someString);
static if(is(T == string)) {
auto doesEndWith = index == testData.length - someString.length;
} else {
auto doesEndWith = index == testData.length - 1;
}
Message[] msg = [
Message(false, "`"),
Message(true, testData.to!string),
Message(false, expectedValue ? "` does not end with `" : "` does end with `"),
Message(true, someString.to!string),
Message(false, "`.")
];
auto mode = expectedValue ? "to end with " : "to not end with ";
return result(doesEndWith, msg, new ExpectedActualResult(mode ~ "`" ~ someString.to!string ~ "`", testData), file, line);
}
}
/// When there is a lazy string that throws an it should throw that exception
unittest {
string someLazyString() {
throw new Exception("This is it.");
}
({
someLazyString.should.equal("");
}).should.throwAnyException.withMessage("This is it.");
({
someLazyString.should.contain("");
}).should.throwAnyException.withMessage("This is it.");
({
someLazyString.should.contain([""]);
}).should.throwAnyException.withMessage("This is it.");
({
someLazyString.should.contain(' ');
}).should.throwAnyException.withMessage("This is it.");
({
someLazyString.should.startWith(" ");
}).should.throwAnyException.withMessage("This is it.");
({
someLazyString.should.endWith(" ");
}).should.throwAnyException.withMessage("This is it.");
}
@("string startWith")
unittest {
({
"test string".should.startWith("test");
}).should.not.throwAnyException;
auto msg = ({
"test string".should.startWith("other");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`test string` does not start with `other`");
msg.split("\n")[2].strip.should.equal("Expected:to start with `other`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
({
"test string".should.not.startWith("other");
}).should.not.throwAnyException;
msg = ({
"test string".should.not.startWith("test");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`test string` does start with `test`");
msg.split("\n")[2].strip.should.equal("Expected:to not start with `test`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
({
"test string".should.startWith('t');
}).should.not.throwAnyException;
msg = ({
"test string".should.startWith('o');
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`test string` does not start with `o`");
msg.split("\n")[2].strip.should.equal("Expected:to start with `o`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
({
"test string".should.not.startWith('o');
}).should.not.throwAnyException;
msg = ({
"test string".should.not.startWith('t');
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`test string` does start with `t`");
msg.split("\n")[2].strip.should.equal("Expected:to not start with `t`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
}
@("string endWith")
unittest {
({
"test string".should.endWith("string");
}).should.not.throwAnyException;
auto msg = ({
"test string".should.endWith("other");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`test string` does not end with `other`");
msg.split("\n")[2].strip.should.equal("Expected:to end with `other`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
({
"test string".should.not.endWith("other");
}).should.not.throwAnyException;
msg = ({
"test string".should.not.endWith("string");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should not end with `string`. `test string` does end with `string`.");
msg.split("\n")[2].strip.should.equal("Expected:to not end with `string`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
({
"test string".should.endWith('g');
}).should.not.throwAnyException;
msg = ({
"test string".should.endWith('t');
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`test string` does not end with `t`");
msg.split("\n")[2].strip.should.equal("Expected:to end with `t`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
({
"test string".should.not.endWith('w');
}).should.not.throwAnyException;
msg = ({
"test string".should.not.endWith('g');
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`test string` does end with `g`");
msg.split("\n")[2].strip.should.equal("Expected:to not end with `g`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
}
@("string contain")
unittest {
({
"test string".should.contain(["string", "test"]);
"test string".should.not.contain(["other", "message"]);
}).should.not.throwAnyException;
({
"test string".should.contain("string");
"test string".should.not.contain("other");
}).should.not.throwAnyException;
({
"test string".should.contain('s');
"test string".should.not.contain('z');
}).should.not.throwAnyException;
auto msg = ({
"test string".should.contain(["other", "message"]);
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should contain `[\"other\", \"message\"]`. [\"other\", \"message\"] are missing from `test string`.");
msg.split("\n")[2].strip.should.equal("Expected:to contain all [\"other\", \"message\"]");
msg.split("\n")[3].strip.should.equal("Actual:test string");
msg = ({
"test string".should.not.contain(["test", "string"]);
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should not contain `[\"test\", \"string\"]`. [\"test\", \"string\"] are present in `test string`.");
msg.split("\n")[2].strip.should.equal("Expected:to not contain any [\"test\", \"string\"]");
msg.split("\n")[3].strip.should.equal("Actual:test string");
msg = ({
"test string".should.contain("other");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should contain `other`. `other` is missing from `test string`.");
msg.split("\n")[2].strip.should.equal("Expected:to contain `other`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
msg = ({
"test string".should.not.contain("test");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should not contain `test`. `test` is present in `test string`.");
msg.split("\n")[2].strip.should.equal("Expected:to not contain `test`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
msg = ({
"test string".should.contain('o');
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.contain("`o` is not present in `test string`");
msg.split("\n")[2].strip.should.equal("Expected:to contain `o`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
msg = ({
"test string".should.not.contain('t');
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should not contain `t`. `t` is present in `test string`.");
msg.split("\n")[2].strip.should.equal("Expected:to not contain `t`");
msg.split("\n")[3].strip.should.equal("Actual:test string");
}
@("string equal")
unittest {
({
"test string".should.equal("test string");
}).should.not.throwAnyException;
({
"test string".should.not.equal("test");
}).should.not.throwAnyException;
auto msg = ({
"test string".should.equal("test");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should equal `test`. `test string` is not equal to `test`.");
msg = ({
"test string".should.not.equal("test string");
}).should.throwException!TestException.msg;
msg.split("\n")[0].should.equal("\"test string\" should not equal `test string`. `test string` is equal to `test string`.");
msg = ({
ubyte[] data = [115, 111, 109, 101, 32, 100, 97, 116, 97, 0, 0];
data.assumeUTF.to!string.should.equal("some data");
}).should.throwException!TestException.msg;
msg.should.contain(`Actual:some data\0\0`);
msg.should.contain("data.assumeUTF.to!string should equal `some data`. `some data\\0\\0` is not equal to `some data`.");
msg.should.contain(`some data[+\0\0]`);
}
/// should throw exceptions for delegates that return basic types
unittest {
string value() {
throw new Exception("not implemented");
}
string noException() { return null; }
value().should.throwAnyException.withMessage.equal("not implemented");
bool thrown;
try {
noException.should.throwAnyException;
} catch(TestException e) {
e.msg.should.startWith("noException should throw any exception. Nothing was thrown.");
thrown = true;
}
thrown.should.equal(true);
}
@("const string equal")
unittest {
const string constValue = "test string";
immutable string immutableValue = "test string";
constValue.should.equal("test string");
immutableValue.should.equal("test string");
"test string".should.equal(constValue);
"test string".should.equal(immutableValue);
}
|
D
|
/Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Intermediates/WanAndroid_IOS.build/Debug-iphonesimulator/WanAndroid_IOS.build/Objects-normal/x86_64/homeVC.o : /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/HotTabVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/homeVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/scrollerVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/alterT/alterVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/ProjectVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/imageT/ImagetVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/TextVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/MyTabViewVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/AppDelegate.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableViewCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/Common.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ButtonT/button.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/CollectionHeader.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MyNavigationController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/oneViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MainViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/twoViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/other/otherViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/FeedBackView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Intermediates/WanAndroid_IOS.build/Debug-iphonesimulator/WanAndroid_IOS.build/Objects-normal/x86_64/homeVC~partial.swiftmodule : /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/HotTabVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/homeVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/scrollerVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/alterT/alterVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/ProjectVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/imageT/ImagetVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/TextVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/MyTabViewVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/AppDelegate.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableViewCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/Common.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ButtonT/button.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/CollectionHeader.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MyNavigationController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/oneViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MainViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/twoViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/other/otherViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/FeedBackView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Intermediates/WanAndroid_IOS.build/Debug-iphonesimulator/WanAndroid_IOS.build/Objects-normal/x86_64/homeVC~partial.swiftdoc : /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/HotTabVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/homeVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/scrollerVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/alterT/alterVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/ProjectVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/imageT/ImagetVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/TextVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/MyTabViewVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/AppDelegate.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableViewCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/Common.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ButtonT/button.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/CollectionHeader.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MyNavigationController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/oneViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MainViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/twoViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/other/otherViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/FeedBackView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Intermediates/WanAndroid_IOS.build/Debug-iphonesimulator/WanAndroid_IOS.build/Objects-normal/x86_64/homeVC~partial.swiftsourceinfo : /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/HotTabVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/homeVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/scrollerVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/alterT/alterVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/ProjectVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/imageT/ImagetVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/TextVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/tabVC/MyTabViewVC.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/AppDelegate.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/collectionCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/TableViewCell.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/Common.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ButtonT/button.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/ListT/CollectionHeader.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MyNavigationController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/oneViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/MainViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/scrollerT/twoViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/other/otherViewController.swift /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/WanAndroid_IOS/home/LableText/FeedBackView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/GuoYanjun/Desktop/TestDemo/WanAndroid_IOS/Build/Products/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
#!/usr/bin/env rdmd-dev-module
/** Extensions to std.random.
Copyright: Per Nordlöw 2014-.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB Per Nordlöw)
*/
module random_ex;
import std.range: isIntegral, isFloatingPoint, isNumeric, isInputRange, isIterable, ElementType;
import std.random: uniform;
/** Generate Random Contents in $(D x) in range [$(D low), $(D high)]. */
auto ref randInPlace(T)(ref T x,
T low = T.min,
T high = T.max) @trusted /* nothrow */ if (isIntegral!T)
{
return x = uniform(low, high);
}
/** Generate Random Contents in $(D x) in range [$(D low), $(D high)]. */
auto ref randInPlace(T)(ref T x,
T low = 0/* T.min_normal */,
T high = 1/* T.max */) @trusted /* nothrow */ if (isFloatingPoint!T)
{
return x = uniform(low, high);
}
/** Generate Random Contents in $(D range).
*/
auto ref randInPlace(R)(R range) @safe /* nothrow */ if (isIterable!R)
{
foreach (ref elt; range) {
import std.range: ElementType;
static if (isInputRange!(ElementType!R))
elt[].randInPlace;
else
elt.randInPlace;
}
return range;
}
/** Get Random Instance of Type $(D T).
*/
T randGet(T)() @safe
{
T x;
return x.randInPlace;
}
void test(T, size_t length)()
{
T[length] x;
x.randInPlace;
}
unittest
{
enum n = 3;
test!(byte, n);
test!(byte[2], n);
test!(byte[2][2], n);
test!(short, n);
test!(int, n);
test!(long, n);
test!(double, n);
}
|
D
|
/Users/ming/Desktop/PerfectTemplate/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/Logging.swift.o : /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/PerfectCRUD.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Like.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Table.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Where.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Database.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Update.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Create.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Delete.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/Coding.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Logging.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Logical.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/In.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Join.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Expression.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Comparison.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingNames.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingBindings.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingKeyPaths.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingJoins.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/InInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/ComparisonInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/EqualityInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingRows.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Select.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Insert.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Equality.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ming/Desktop/PerfectTemplate/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/Logging~partial.swiftmodule : /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/PerfectCRUD.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Like.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Table.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Where.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Database.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Update.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Create.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Delete.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/Coding.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Logging.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Logical.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/In.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Join.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Expression.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Comparison.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingNames.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingBindings.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingKeyPaths.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingJoins.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/InInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/ComparisonInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/EqualityInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingRows.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Select.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Insert.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Equality.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ming/Desktop/PerfectTemplate/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/Logging~partial.swiftdoc : /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/PerfectCRUD.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Like.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Table.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Where.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Database.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Update.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Create.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Delete.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/Coding.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Logging.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Logical.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/In.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Join.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Expression.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Comparison.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingNames.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingBindings.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingKeyPaths.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingJoins.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/InInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/ComparisonInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/EqualityInts.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Coding/CodingRows.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Select.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Insert.swift /Users/ming/Desktop/PerfectTemplate/.build/checkouts/Perfect-CRUD/Sources/PerfectCRUD/Expression/Equality.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module engine.uniform;
import std.conv,
std.string,
core.stdc.string;
import engine.opengl;
import derelict.opengl3.gl3;
import gfm.math.vector,
gfm.math.matrix;
/// Represents an OpenGL program uniform. Owned by a GLProgram.
/// Both uniform locations and values are cached, to minimize OpenGL calls.
final class GLUniform {
public {
/// Creates a GLUniform.
/// This is done automatically after linking a GLProgram.
/// See_also: GLProgram.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl, GLuint program, GLenum type, string name, GLsizei size) {
_gl = gl;
_type = type;
_size = size;
_name = name;
_location = glGetUniformLocation(program, toStringz(name));
if (_location == -1) {
// probably rare: the driver said explicitely this variable was active, and there it's not.
throw new OpenGLException(format("can't get uniform %s location", name));
}
size_t cacheSize = sizeOfUniformType(type) * size;
if (cacheSize > 0) {
_value = new ubyte[cacheSize]; // relying on zero initialization here
_valueChanged = false;
_firstSet = true;
_disabled = false;
}
else {
_gl._logger.warningf("uniform %s is unrecognized or has size 0, disabled", _name);
_disabled = true;
}
}
/// Creates a fake disabled uniform variable, designed to cope with variables
/// that have been optimized out by the OpenGL driver, or those which do not exist.
this(OpenGL gl, string name) {
_gl = gl;
_disabled = true;
_gl._logger.warningf("Faking uniform '%s' which either does not exist in the shader program, or was discarded by the driver as unused", name);
}
/// Sets a uniform variable value.
/// T should be the exact type needed, checked at runtime.
/// Throws: $(D OpenGLException) on error.
void set(T)(T newValue) {
set!T(&newValue, 1u);
}
/// Sets multiple uniform variables.
/// Throws: $(D OpenGLException) on error.
void set(T)(T[] newValues) {
set!T(newValues.ptr, newValues.length);
}
/// Sets multiple uniform variables.
/// Throws: $(D OpenGLException) on error.
void set(T)(T* newValues, size_t count) {
if (_disabled)
return;
if (!typeIsCompliant!T(_type))
throw new OpenGLException(format("using type %s for setting uniform '%s' which has GLSL type '%s'",
T.stringof, _name, GLSLTypeNameArray(_type, _size)));
if (count != _size)
throw new OpenGLException(format("cannot set uniform '%s' of size %s with a value of size %s",
_name, _size, count));
// if first time or different value incoming
if (_firstSet || (0 != memcmp(newValues, _value.ptr, _value.length))) {
memcpy(_value.ptr, newValues, _value.length);
_valueChanged = true;
update();
}
_firstSet = false;
}
/// Updates the uniform value.
void use() {
_active = true;
update();
}
/// Unuses this uniform.
void unuse() {
_active = false;
}
/// Returns: Uniform name.
string name() {
return _name;
}
}
private {
OpenGL _gl;
GLint _location;
GLenum _type;
GLsizei _size;
ubyte[] _value;
bool _valueChanged;
bool _firstSet; // force update to ensure we do not relie on the driver initializing uniform to zero
bool _disabled; // allow transparent usage while not doing anything
bool _active;
string _name;
void update() {
if (_disabled)
return;
if (!_active)
return;
// safety check to prevent defaults values in uniforms
if (_firstSet) {
_gl._logger.warningf("uniform '%s' left to default value, driver will probably zero it", _name);
_firstSet = false;
}
// has value changed?
// if so, set OpenGL value
if (_valueChanged) {
setUniform();
_valueChanged = false;
}
}
void setUniform() {
switch(_type) {
case GL_FLOAT: glUniform1fv(_location, _size, cast(GLfloat*)_value); break;
case GL_FLOAT_VEC2: glUniform2fv(_location, _size, cast(GLfloat*)_value); break;
case GL_FLOAT_VEC3: glUniform3fv(_location, _size, cast(GLfloat*)_value); break;
case GL_FLOAT_VEC4: glUniform4fv(_location, _size, cast(GLfloat*)_value); break;
case GL_DOUBLE: glUniform1dv(_location, _size, cast(GLdouble*)_value); break;
case GL_DOUBLE_VEC2: glUniform2dv(_location, _size, cast(GLdouble*)_value); break;
case GL_DOUBLE_VEC3: glUniform3dv(_location, _size, cast(GLdouble*)_value); break;
case GL_DOUBLE_VEC4: glUniform4dv(_location, _size, cast(GLdouble*)_value); break;
case GL_INT: glUniform1iv(_location, _size, cast(GLint*)_value); break;
case GL_INT_VEC2: glUniform2iv(_location, _size, cast(GLint*)_value); break;
case GL_INT_VEC3: glUniform3iv(_location, _size, cast(GLint*)_value); break;
case GL_INT_VEC4: glUniform4iv(_location, _size, cast(GLint*)_value); break;
case GL_UNSIGNED_INT: glUniform1uiv(_location, _size, cast(GLuint*)_value); break;
case GL_UNSIGNED_INT_VEC2: glUniform2uiv(_location, _size, cast(GLuint*)_value); break;
case GL_UNSIGNED_INT_VEC3: glUniform3uiv(_location, _size, cast(GLuint*)_value); break;
case GL_UNSIGNED_INT_VEC4: glUniform4uiv(_location, _size, cast(GLuint*)_value); break;
case GL_BOOL: glUniform1iv(_location, _size, cast(GLint*)_value); break;
case GL_BOOL_VEC2: glUniform2iv(_location, _size, cast(GLint*)_value); break;
case GL_BOOL_VEC3: glUniform3iv(_location, _size, cast(GLint*)_value); break;
case GL_BOOL_VEC4: glUniform4iv(_location, _size, cast(GLint*)_value); break;
case GL_FLOAT_MAT2: glUniformMatrix2fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT3: glUniformMatrix3fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT4: glUniformMatrix4fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT2x3: glUniformMatrix2x3fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT2x4: glUniformMatrix3x2fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT3x2: glUniformMatrix2x4fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT3x4: glUniformMatrix4x2fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT4x2: glUniformMatrix3x4fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_FLOAT_MAT4x3: glUniformMatrix4x3fv(_location, _size, GL_TRUE, cast(GLfloat*)_value); break;
case GL_DOUBLE_MAT2: glUniformMatrix2dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT3: glUniformMatrix3dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT4: glUniformMatrix4dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT2x3: glUniformMatrix2x3dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT2x4: glUniformMatrix3x2dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT3x2: glUniformMatrix2x4dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT3x4: glUniformMatrix4x2dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT4x2: glUniformMatrix3x4dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
case GL_DOUBLE_MAT4x3: glUniformMatrix4x3dv(_location, _size, GL_TRUE, cast(GLdouble*)_value); break;
// image samplers
case GL_IMAGE_1D: .. case GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY:
glUniform1iv(_location, _size, cast(GLint*)_value);
break;
case GL_UNSIGNED_INT_ATOMIC_COUNTER:
glUniform1uiv(_location, _size, cast(GLuint*)_value);
break;
case GL_SAMPLER_1D:
case GL_SAMPLER_2D:
case GL_SAMPLER_3D:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_1D_SHADOW:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_1D_ARRAY:
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_1D_ARRAY_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_BUFFER:
case GL_SAMPLER_2D_RECT:
case GL_SAMPLER_2D_RECT_SHADOW:
case GL_INT_SAMPLER_1D:
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_CUBE:
case GL_INT_SAMPLER_1D_ARRAY:
case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_INT_SAMPLER_BUFFER:
case GL_INT_SAMPLER_2D_RECT:
case GL_UNSIGNED_INT_SAMPLER_1D:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
case GL_UNSIGNED_INT_SAMPLER_2D_RECT:
glUniform1iv(_location, _size, cast(GLint*)_value);
break;
default:
break;
}
_gl.runtimeCheck();
}
public static bool typeIsCompliant(T)(GLenum type) {
switch (type) {
case GL_FLOAT: return is(T == float);
case GL_FLOAT_VEC2: return is(T == vec2f);
case GL_FLOAT_VEC3: return is(T == vec3f);
case GL_FLOAT_VEC4: return is(T == vec4f);
case GL_DOUBLE: return is(T == double);
case GL_DOUBLE_VEC2: return is(T == vec2d);
case GL_DOUBLE_VEC3: return is(T == vec3d);
case GL_DOUBLE_VEC4: return is(T == vec4d);
case GL_INT: return is(T == int);
case GL_INT_VEC2: return is(T == vec2i);
case GL_INT_VEC3: return is(T == vec3i);
case GL_INT_VEC4: return is(T == vec4i);
case GL_UNSIGNED_INT: return is(T == uint);
case GL_UNSIGNED_INT_VEC2: return is(T == vec2ui);
case GL_UNSIGNED_INT_VEC3: return is(T == vec3ui);
case GL_UNSIGNED_INT_VEC4: return is(T == vec4ui);
case GL_BOOL: return is(T == int); // int because bool type is 1 byte
case GL_BOOL_VEC2: return is(T == vec2i);
case GL_BOOL_VEC3: return is(T == vec3i);
case GL_BOOL_VEC4: return is(T == vec4i);
case GL_FLOAT_MAT2: return is(T == mat2f);
case GL_FLOAT_MAT3: return is(T == mat3f);
case GL_FLOAT_MAT4: return is(T == mat4f);
case GL_FLOAT_MAT2x3: return is(T == mat3x2f);
case GL_FLOAT_MAT2x4: return is(T == mat4x2f);
case GL_FLOAT_MAT3x2: return is(T == mat2x3f);
case GL_FLOAT_MAT3x4: return is(T == mat4x3f);
case GL_FLOAT_MAT4x2: return is(T == mat2x4f);
case GL_FLOAT_MAT4x3: return is(T == mat3x4f);
case GL_DOUBLE_MAT2: return is(T == mat2d);
case GL_DOUBLE_MAT3: return is(T == mat3d);
case GL_DOUBLE_MAT4: return is(T == mat4d);
case GL_DOUBLE_MAT2x3: return is(T == mat3x2d);
case GL_DOUBLE_MAT2x4: return is(T == mat4x2d);
case GL_DOUBLE_MAT3x2: return is(T == mat2x3d);
case GL_DOUBLE_MAT3x4: return is(T == mat4x3d);
case GL_DOUBLE_MAT4x2: return is(T == mat2x4d);
case GL_DOUBLE_MAT4x3: return is(T == mat3x4d);
// image samplers
case GL_IMAGE_1D: .. case GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY:
return is(T == int);
case GL_UNSIGNED_INT_ATOMIC_COUNTER:
return is(T == uint);
case GL_SAMPLER_1D:
case GL_SAMPLER_2D:
case GL_SAMPLER_3D:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_1D_SHADOW:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_1D_ARRAY:
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_1D_ARRAY_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_BUFFER:
case GL_SAMPLER_2D_RECT:
case GL_SAMPLER_2D_RECT_SHADOW:
case GL_INT_SAMPLER_1D:
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_CUBE:
case GL_INT_SAMPLER_1D_ARRAY:
case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_INT_SAMPLER_BUFFER:
case GL_INT_SAMPLER_2D_RECT:
case GL_UNSIGNED_INT_SAMPLER_1D:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
case GL_UNSIGNED_INT_SAMPLER_2D_RECT:
return is(T == int) || is(T == uint);
default:
// unrecognized type, in release mode return true
debug {
assert(false);
} else {
return true;
}
}
}
public static size_t sizeOfUniformType(GLenum type) {
switch (type) {
case GL_FLOAT: return float.sizeof;
case GL_FLOAT_VEC2: return vec2f.sizeof;
case GL_FLOAT_VEC3: return vec3f.sizeof;
case GL_FLOAT_VEC4: return vec4f.sizeof;
case GL_DOUBLE: return double.sizeof;
case GL_DOUBLE_VEC2: return vec2d.sizeof;
case GL_DOUBLE_VEC3: return vec3d.sizeof;
case GL_DOUBLE_VEC4: return vec4d.sizeof;
case GL_INT: return int.sizeof;
case GL_INT_VEC2: return vec2i.sizeof;
case GL_INT_VEC3: return vec3i.sizeof;
case GL_INT_VEC4: return vec4i.sizeof;
case GL_UNSIGNED_INT: return uint.sizeof;
case GL_UNSIGNED_INT_VEC2: return vec2ui.sizeof;
case GL_UNSIGNED_INT_VEC3: return vec3ui.sizeof;
case GL_UNSIGNED_INT_VEC4: return vec4ui.sizeof;
case GL_BOOL: return int.sizeof; // int because D bool type is 1 byte
case GL_BOOL_VEC2: return vec2i.sizeof;
case GL_BOOL_VEC3: return vec3i.sizeof;
case GL_BOOL_VEC4: return vec4i.sizeof;
case GL_FLOAT_MAT2: return mat2f.sizeof;
case GL_FLOAT_MAT3: return mat3f.sizeof;
case GL_FLOAT_MAT4: return mat4f.sizeof;
case GL_FLOAT_MAT2x3: return mat3x2f.sizeof;
case GL_FLOAT_MAT2x4: return mat4x2f.sizeof;
case GL_FLOAT_MAT3x2: return mat2x3f.sizeof;
case GL_FLOAT_MAT3x4: return mat4x3f.sizeof;
case GL_FLOAT_MAT4x2: return mat2x4f.sizeof;
case GL_FLOAT_MAT4x3: return mat3x4f.sizeof;
case GL_DOUBLE_MAT2: return mat2d.sizeof;
case GL_DOUBLE_MAT3: return mat3d.sizeof;
case GL_DOUBLE_MAT4: return mat4d.sizeof;
case GL_DOUBLE_MAT2x3: return mat3x2d.sizeof;
case GL_DOUBLE_MAT2x4: return mat4x2d.sizeof;
case GL_DOUBLE_MAT3x2: return mat2x3d.sizeof;
case GL_DOUBLE_MAT3x4: return mat4x3d.sizeof;
case GL_DOUBLE_MAT4x2: return mat2x4d.sizeof;
case GL_DOUBLE_MAT4x3: return mat3x4d.sizeof;
// image samplers
case GL_IMAGE_1D: .. case GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY:
return int.sizeof;
case GL_UNSIGNED_INT_ATOMIC_COUNTER:
return uint.sizeof;
case GL_SAMPLER_1D:
case GL_SAMPLER_2D:
case GL_SAMPLER_3D:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_1D_SHADOW:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_1D_ARRAY:
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_1D_ARRAY_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_BUFFER:
case GL_SAMPLER_2D_RECT:
case GL_SAMPLER_2D_RECT_SHADOW:
case GL_INT_SAMPLER_1D:
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_CUBE:
case GL_INT_SAMPLER_1D_ARRAY:
case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_INT_SAMPLER_BUFFER:
case GL_INT_SAMPLER_2D_RECT:
case GL_UNSIGNED_INT_SAMPLER_1D:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
case GL_UNSIGNED_INT_SAMPLER_2D_RECT:
return int.sizeof;
default:
// unrecognized type
// in debug mode assert, in release mode return 0 to disable this uniform
debug {
assert(false);
}
else {
return 0;
}
}
}
static string GLSLTypeName(GLenum type) {
switch (type) {
case GL_FLOAT: return "float";
case GL_FLOAT_VEC2: return "vec2";
case GL_FLOAT_VEC3: return "vec3";
case GL_FLOAT_VEC4: return "vec4";
case GL_DOUBLE: return "double";
case GL_DOUBLE_VEC2: return "dvec2";
case GL_DOUBLE_VEC3: return "dvec3";
case GL_DOUBLE_VEC4: return "dvec4";
case GL_INT: return "int";
case GL_INT_VEC2: return "ivec2";
case GL_INT_VEC3: return "ivec3";
case GL_INT_VEC4: return "ivec4";
case GL_UNSIGNED_INT: return "uint";
case GL_UNSIGNED_INT_VEC2: return "uvec2";
case GL_UNSIGNED_INT_VEC3: return "uvec3";
case GL_UNSIGNED_INT_VEC4: return "uvec4";
case GL_BOOL: return "bool";
case GL_BOOL_VEC2: return "bvec2";
case GL_BOOL_VEC3: return "bvec3";
case GL_BOOL_VEC4: return "bvec4";
case GL_FLOAT_MAT2: return "mat2";
case GL_FLOAT_MAT3: return "mat3";
case GL_FLOAT_MAT4: return "mat4";
case GL_FLOAT_MAT2x3: return "mat2x3";
case GL_FLOAT_MAT2x4: return "mat2x4";
case GL_FLOAT_MAT3x2: return "mat3x2";
case GL_FLOAT_MAT3x4: return "mat3x4";
case GL_FLOAT_MAT4x2: return "mat4x2";
case GL_FLOAT_MAT4x3: return "mat4x3";
case GL_DOUBLE_MAT2: return "dmat2";
case GL_DOUBLE_MAT3: return "dmat3";
case GL_DOUBLE_MAT4: return "dmat4";
case GL_DOUBLE_MAT2x3: return "dmat2x3";
case GL_DOUBLE_MAT2x4: return "dmat2x4";
case GL_DOUBLE_MAT3x2: return "dmat3x2";
case GL_DOUBLE_MAT3x4: return "dmat3x4";
case GL_DOUBLE_MAT4x2: return "dmat4x2";
case GL_DOUBLE_MAT4x3: return "dmat4x3";
case GL_SAMPLER_1D: return "sampler1D";
case GL_SAMPLER_2D: return "sampler2D";
case GL_SAMPLER_3D: return "sampler3D";
case GL_SAMPLER_CUBE: return "samplerCube";
case GL_SAMPLER_1D_SHADOW: return "sampler1DShadow";
case GL_SAMPLER_2D_SHADOW: return "sampler2DShadow";
case GL_SAMPLER_1D_ARRAY: return "sampler1DArray";
case GL_SAMPLER_2D_ARRAY: return "sampler2DArray";
case GL_SAMPLER_1D_ARRAY_SHADOW: return "sampler1DArrayShadow";
case GL_SAMPLER_2D_ARRAY_SHADOW: return "sampler2DArrayShadow";
case GL_SAMPLER_2D_MULTISAMPLE: return "sampler2DMS";
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY: return "sampler2DMSArray";
case GL_SAMPLER_CUBE_SHADOW: return "samplerCubeShadow";
case GL_SAMPLER_BUFFER: return "samplerBuffer";
case GL_SAMPLER_2D_RECT: return "sampler2DRect";
case GL_SAMPLER_2D_RECT_SHADOW: return "sampler2DRectShadow";
case GL_INT_SAMPLER_1D: return "isampler1D";
case GL_INT_SAMPLER_2D: return "isampler2D";
case GL_INT_SAMPLER_3D: return "isampler3D";
case GL_INT_SAMPLER_CUBE: return "isamplerCube";
case GL_INT_SAMPLER_1D_ARRAY: return "isampler1DArray";
case GL_INT_SAMPLER_2D_ARRAY: return "isampler2DArray";
case GL_INT_SAMPLER_2D_MULTISAMPLE: return "isampler2DMS";
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: return "isampler2DMSArray";
case GL_INT_SAMPLER_BUFFER: return "isamplerBuffer";
case GL_INT_SAMPLER_2D_RECT: return "isampler2DRect";
case GL_UNSIGNED_INT_SAMPLER_1D: return "usampler1D";
case GL_UNSIGNED_INT_SAMPLER_2D: return "usampler2D";
case GL_UNSIGNED_INT_SAMPLER_3D: return "usampler3D";
case GL_UNSIGNED_INT_SAMPLER_CUBE: return "usamplerCube";
case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY: return "usampler2DArray";
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: return "usampler2DArray";
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE: return "usampler2DMS";
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: return "usampler2DMSArray";
case GL_UNSIGNED_INT_SAMPLER_BUFFER: return "usamplerBuffer";
case GL_UNSIGNED_INT_SAMPLER_2D_RECT: return "usampler2DRect";
case GL_IMAGE_1D: return "image1D";
case GL_IMAGE_2D: return "image2D";
case GL_IMAGE_3D: return "image3D";
case GL_IMAGE_2D_RECT: return "image2DRect";
case GL_IMAGE_CUBE: return "imageCube";
case GL_IMAGE_BUFFER: return "imageBuffer";
case GL_IMAGE_1D_ARRAY: return "image1DArray";
case GL_IMAGE_2D_ARRAY: return "image2DArray";
case GL_IMAGE_2D_MULTISAMPLE: return "image2DMS";
case GL_IMAGE_2D_MULTISAMPLE_ARRAY: return "image2DMSArray";
case GL_INT_IMAGE_1D: return "iimage1D";
case GL_INT_IMAGE_2D: return "iimage2D";
case GL_INT_IMAGE_3D: return "iimage3D";
case GL_INT_IMAGE_2D_RECT: return "iimage2DRect";
case GL_INT_IMAGE_CUBE: return "iimageCube";
case GL_INT_IMAGE_BUFFER: return "iimageBuffer";
case GL_INT_IMAGE_1D_ARRAY: return "iimage1DArray";
case GL_INT_IMAGE_2D_ARRAY: return "iimage2DArray";
case GL_INT_IMAGE_2D_MULTISAMPLE: return "iimage2DMS";
case GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY: return "iimage2DMSArray";
case GL_UNSIGNED_INT_IMAGE_1D: return "uimage1D";
case GL_UNSIGNED_INT_IMAGE_2D: return "uimage2D";
case GL_UNSIGNED_INT_IMAGE_3D: return "uimage3D";
case GL_UNSIGNED_INT_IMAGE_2D_RECT: return "uimage2DRect";
case GL_UNSIGNED_INT_IMAGE_CUBE: return "uimageCube";
case GL_UNSIGNED_INT_IMAGE_BUFFER: return "uimageBuffer";
case GL_UNSIGNED_INT_IMAGE_1D_ARRAY: return "uimage1DArray";
case GL_UNSIGNED_INT_IMAGE_2D_ARRAY: return "uimage2DArray";
case GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE: return "uimage2DMS";
case GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY: return "uimage2DMSArray";
case GL_UNSIGNED_INT_ATOMIC_COUNTER: return "atomic_uint";
default:
return "unknown";
}
}
static string GLSLTypeNameArray(GLenum type, size_t multiplicity) {
assert(multiplicity > 0);
if (multiplicity == 1)
return GLSLTypeName(type);
else
return format("%s[%s]", GLSLTypeName(type), multiplicity);
}
}
}
static assert(is(GLint == int));
static assert(is(GLuint == uint));
static assert(is(GLfloat == float));
static assert(is(GLdouble == double));
|
D
|
module blockie.model.model1a.M1aWorldEditor;
import blockie.model;
final class M1aWorldEditor : WorldEditor {
protected:
override void generateDistances() {
auto addedViews = new DistanceFieldsBiDirChunk(storage, views, 31)
.generate()
.getAddedViews();
new DistanceFieldsBiDirCell(views, 1<<model.numRootBits(), 15)
.generate();
this.views ~= addedViews;
writefln("%s views added to the transaction", addedViews.length);
}
public:
this(World world, Model model) {
super(world, model);
}
}
|
D
|
import std.algorithm.iteration : map, each;
import std.array : array;
import std.conv : parse;
import std.range : takeExactly, tee;
import std.stdio;
void main()
{
double mean = 0;
auto sample = File("10numbers.txt")
.byLine
.takeExactly(10)
.map!(line => line.parse!double)
.tee!((x){mean += x;})
.array;
mean /= sample.length;
// prints one element per line
sample.map!(x => x - mean).each!writeln;
}
|
D
|
void main() {
auto K = ri;
dchar[] genarr(dchar c) {
if(c == '0') return ['0', '1'];
if(c == '9') return ['8', '9'];
else return [c-1, c, c+1];
}
dstring[] arr = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
bool comp(dstring a, dstring b) {
if(a.length < b.length) return true;
else if(a.length > b.length) return false;
else return a < b;
}
while(arr.length < 100001) {
dstring[] tmparr;
foreach(d; arr) {
auto T = genarr(d.back);
foreach(t; T) {
tmparr ~= (d ~ t);
}
}
arr ~= tmparr;
arr = arr.sort!(comp)().uniq.array;
}
arr[K-1].writeln;
}
// ===================================
import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;
T readAs(T)() if (isBasicType!T) {
return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
return readln.split.to!T;
}
T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
auto res = new T[][](height, width);
foreach(i; 0..height) {
res[i] = readAs!(T[]);
}
return res;
}
T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
auto res = new T[][](height, width);
foreach(i; 0..height) {
auto s = rs;
foreach(j; 0..width) res[i][j] = s[j].to!T;
}
return res;
}
int ri() {
return readAs!int;
}
double rd() {
return readAs!double;
}
string rs() {
return readln.chomp;
}
|
D
|
///////////////////////////////////////////////////////////////////////
// Info EXIT
///////////////////////////////////////////////////////////////////////
INSTANCE DIA_Fernando_EXIT (C_INFO)
{
npc = VLK_405_Fernando;
nr = 999;
condition = DIA_Fernando_EXIT_Condition;
information = DIA_Fernando_EXIT_Info;
permanent = TRUE;
description = DIALOG_ENDE;
};
FUNC INT DIA_Fernando_EXIT_Condition()
{
return TRUE;
};
FUNC VOID DIA_Fernando_EXIT_Info()
{
B_NpcClearObsessionByDMT (self);
};
// ************************************************************
// PICK POCKET
// ************************************************************
INSTANCE DIA_Fernando_PICKPOCKET (C_INFO)
{
npc = VLK_405_Fernando;
nr = 900;
condition = DIA_Fernando_PICKPOCKET_Condition;
information = DIA_Fernando_PICKPOCKET_Info;
permanent = TRUE;
description = "(Krádež jeho portmonky by byla dosti riskantní.)";
};
FUNC INT DIA_Fernando_PICKPOCKET_Condition()
{
if (Npc_GetTalentSkill (other,NPC_TALENT_PICKPOCKET) == 1)
&& (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE)
&& (Npc_HasItems (self, ItSe_GoldPocket100) >= 1)
&& (other.attribute[ATR_DEXTERITY] >= (50 - Theftdiff))
&& (NpcObsessedByDMT_Fernando == FALSE)
{
return TRUE;
};
};
FUNC VOID DIA_Fernando_PICKPOCKET_Info()
{
Info_ClearChoices (DIA_Fernando_PICKPOCKET);
Info_AddChoice (DIA_Fernando_PICKPOCKET, DIALOG_BACK ,DIA_Fernando_PICKPOCKET_BACK);
Info_AddChoice (DIA_Fernando_PICKPOCKET, DIALOG_PICKPOCKET ,DIA_Fernando_PICKPOCKET_DoIt);
};
func void DIA_Fernando_PICKPOCKET_DoIt()
{
if (other.attribute[ATR_DEXTERITY] >= 50)
{
B_GiveInvItems (self, other, ItSe_GoldPocket100, 1);
self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE;
B_GiveThiefXP ();
Info_ClearChoices (DIA_Fernando_PICKPOCKET);
}
else
{
B_ResetThiefLevel();
B_NpcClearObsessionByDMT (self);
B_Attack (self, other, AR_Theft, 1); //reagiert trotz IGNORE_Theft mit NEWS
};
};
func void DIA_Fernando_PICKPOCKET_BACK()
{
Info_ClearChoices (DIA_Fernando_PICKPOCKET);
};
//*********************************************************************
// Info Na.
//*********************************************************************
INSTANCE DIA_Fernando_Hello (C_INFO)
{
npc = VLK_405_Fernando;
nr = 5;
condition = DIA_Fernando_Hello_Condition;
information = DIA_Fernando_Hello_Info;
permanent = FALSE;
description = "Jak jdou obchody?";
};
FUNC INT DIA_Fernando_Hello_Condition()
{
if (NpcObsessedByDMT_Fernando == FALSE)
{
return TRUE;
};
};
FUNC VOID DIA_Fernando_Hello_Info()
{
AI_Output (other,self ,"DIA_Fernando_Hello_15_00"); //Jak jdou obchody?
AI_Output (self ,other,"DIA_Fernando_Hello_14_01"); //Nic moc. Když ještę stála bariéra, bylo to lepší časy.
AI_Output (self ,other,"DIA_Fernando_Hello_14_02"); //Trestanci dodávali tuny a tuny rudy z dolů a mé lodę ji pak odvážely na pevninu.
AI_Output (self ,other,"DIA_Fernando_Hello_14_03"); //A zpátky zase pâivážely potraviny a jiné zboží.
AI_Output (self ,other,"DIA_Fernando_Hello_14_04"); //Ale teë jsme odâíznuti od pevniny a jsme se zásobami závislí na farmáâích.
};
//*********************************************************************
// Info Perm
//*********************************************************************
INSTANCE DIA_Fernando_Perm (C_INFO)
{
npc = VLK_405_Fernando;
nr = 850;
condition = DIA_Fernando_Perm_Condition;
information = DIA_Fernando_Perm_Info;
permanent = TRUE;
description = "Z čeho teë žiješ?";
};
FUNC INT DIA_Fernando_Perm_Condition()
{
if (Npc_KnowsInfo (other,DIA_Fernando_Hello))
&& (NpcObsessedByDMT_Fernando == FALSE)
{
return TRUE;
};
};
FUNC VOID DIA_Fernando_Perm_Info()
{
AI_Output (other,self ,"DIA_Fernando_Perm_15_00"); //Z čeho teë žiješ?
if (Fernando_ImKnast == TRUE)
{
B_Say (self, other, "$NOTNOW");
}
else
{
if (Fernando_HatsZugegeben == TRUE)
{
AI_Output (self ,other,"DIA_Addon_Fernando_Perm_14_00"); //Nevím. Vyhýbám se černému trhu.
}
else if (Npc_KnowsInfo (other,DIA_Fernando_Success) == FALSE)
{
AI_Output (self ,other,"DIA_Fernando_Perm_14_01"); //Zrovna teë žiju ze svých zásob. Ale jestli se zase nezačne obchodovat, dožiju se strašných časů.
}
else
{
AI_Output (self ,other,"DIA_Fernando_Perm_14_02"); //Je ze mę žebrák. Męl jsem poslechnout svého otce a držet se od toho hornického kšeftu dál.
};
};
};
//*********************************************************************
// Info Minental
//*********************************************************************
INSTANCE DIA_Fernando_Minental (C_INFO)
{
npc = VLK_405_Fernando;
nr = 2;
condition = DIA_Fernando_Minental_Condition;
information = DIA_Fernando_Minental_Info;
permanent = FALSE;
important = TRUE;
};
FUNC INT DIA_Fernando_Minental_Condition()
{
if (NpcObsessedByDMT_Fernando == FALSE)
&& (MIS_OLDWORLD == LOG_RUNNING)
&& (Kapitel == 2)
&& (EnterOW_Kapitel2 == FALSE)
&& (Fernando_HatsZugegeben == FALSE)//ADDON
&& (Fernando_ImKnast == FALSE) //HACK ADDON PATCH
{
return TRUE;
};
};
FUNC VOID DIA_Fernando_Minental_Info()
{
AI_Output (self ,other,"DIA_Fernando_Minental_14_00"); //Hej ty - počkej chvilku. Máš namíâeno do Hornického údolí, že ano?
AI_Output (other ,self,"DIA_Fernando_Minental_15_01"); //A?
AI_Output (self ,other,"DIA_Fernando_Minental_14_02"); //Mám pro tebe nabídku. Ty mi dáš vędęt, jak se to má s rudou a já ti pak za to dám...
if (other.guild == GIL_KDF)
{
AI_Output (self ,other,"DIA_Fernando_Minental_14_03"); //... runový kámen.
}
else
{
AI_Output (self ,other,"DIA_Fernando_Minental_14_04"); //... prsten, co posílí tvou životní energii.
};
AI_Output (other ,self,"DIA_Fernando_Minental_15_05"); //Uvidím, co se dá dęlat.
B_NpcClearObsessionByDMT (self);
Npc_ExchangeRoutine (self, "START");
Log_CreateTopic (TOPIC_Fernando,LOG_MISSION);
Log_SetTopicStatus (TOPIC_Fernando,LOG_RUNNING);
B_LogEntry (TOPIC_Fernando,"Obchodník Fernando chce vędęt, co se v Hornickém údolí dęje s rudou.");
};
///////////////////////////////////////////////////////////////////////
// Info BanditTrader
///////////////////////////////////////////////////////////////////////
instance DIA_Addon_Fernando_BanditTrader (C_INFO)
{
npc = VLK_405_Fernando;
nr = 5;
condition = DIA_Addon_Fernando_BanditTrader_Condition;
information = DIA_Addon_Fernando_BanditTrader_Info;
description = "Prodávals zbranę banditům.";
};
func int DIA_Addon_Fernando_BanditTrader_Condition ()
{
if (Npc_KnowsInfo (other, DIA_Fernando_Hello))
&& (NpcObsessedByDMT_Fernando == FALSE)
&& (
(Npc_HasItems (other,ItMw_Addon_BanditTrader))
||(Npc_HasItems (other,ItRi_Addon_BanditTrader))
||((Npc_HasItems (other,ItWr_Addon_BanditTrader))&&(BanditTrader_Lieferung_Gelesen == TRUE))
)
{
return TRUE;
};
};
func void DIA_Addon_Fernando_BanditTrader_Info ()
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_15_00"); //Prodávals zbranę banditům.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_14_01"); //(pâekvapenę) Huh. Jak jsi pâišel na ten nápad?
B_LogEntry (TOPIC_Addon_BanditTrader,"Fernando, zámoâský kupec, pâiznal, že dodává zbranę banditům.");
B_GivePlayerXP (XP_Addon_Fernando_HatsZugegeben);
Fernando_HatsZugegeben = TRUE;
if ((Npc_HasItems (other,ItWr_Addon_BanditTrader))&&(BanditTrader_Lieferung_Gelesen == TRUE))
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_15_02"); //To je soupis zboží. Dostal jsem ho od banditů. Je na nęm tvůj podpis.
};
if (Npc_HasItems (other,ItRi_Addon_BanditTrader))
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_15_03"); //Našel jsem také tento prsten u zámoâského průvodce Araxosose. A ty jsi zámoâský obchodník.
if (Npc_HasItems (other,ItMw_Addon_BanditTrader))
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_15_04"); //A meče banditů jsou podepsány tvým iniciálem 'F'.
};
}
else //nur (Npc_HasItems (other,ItMw_Addon_BanditTrader))
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_15_05"); //Meče banditů jsou podepsány tvým iniciálem 'F'
};
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_15_06"); //Nemusíš zapírat. Odkryl jsem tvou nekalou činnost.
if (Fernando_ImKnast == TRUE)
{
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_14_07"); //Tak tos byl ty? Tys mę zradil. Za to zaplatíš.
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_15_08"); //Myslím, že z tadyma poputuješ nękam jinam. Nicménę, jsem si jist, že tę nenechají jít zase tak brzy na svętlo.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_14_09"); //(nazlobenę) Můj čas nadešel.
B_NpcClearObsessionByDMT (self);
}
else
{
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_14_10"); //(žebravę) Musíš mi vęâit, že jsem to nechtęl udęlat!
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_14_11"); //(žebravę) Prvnę to bylo pouze jídlo, co chtęli. Můj obchod nešlapal zrovna tak, jak by męl, tak jsem souhlasil.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_14_12"); //(žebravę) A časem mi začali vyhrožovat, že mę zabijí, pokud jim nebudu dodávat víc a víc mečů.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_14_13"); //(žebravę) Nemůžeš mę vinit z toho, co jsem udęlal. Jsem pouze obęă!
if (Fernando_ImKnast == FALSE)//Joly:zur Sicherheit
{
Info_ClearChoices (DIA_Addon_Fernando_BanditTrader);
Info_AddChoice (DIA_Addon_Fernando_BanditTrader, "Kolik mi zaplatíš, pokud tę nechám uprchnout?", DIA_Addon_Fernando_BanditTrader_preis );
Info_AddChoice (DIA_Addon_Fernando_BanditTrader, "Začne se o tebe zajímat domobrana.", DIA_Addon_Fernando_BanditTrader_mil );
Info_AddChoice (DIA_Addon_Fernando_BanditTrader, "Oh, to mę opravdu rozesmutnęlo.", DIA_Addon_Fernando_BanditTrader_Uptown );
};
};
};
func void DIA_Addon_Fernando_BanditTrader_Uptown ()
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_Uptown_15_00"); //Oh, to mę fakt rozesmutnęlo. Víš, jsi docela hnusný na nękoho, kdo žije v horní čtvrti.
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_Uptown_15_01"); //Prodat svou duši za pár kusů zlata.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_Uptown_14_02"); //Musím si vydęlat na živobytí. Když nepokryju náklady, vyhodí mę z pâístavu. Stane se ze mę chátra.
};
func void DIA_Addon_Fernando_BanditTrader_mil ()
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_mil_15_00"); //Domobrana se o tebe začne zajímat.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_mil_14_01"); //Nemůžeš to udęlat!
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_mil_15_02"); //Jistę, že můžu.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_mil_14_03"); //Ve jménu Innosovę, jsem na mizinę.
B_NpcClearObsessionByDMT (self);
};
func void DIA_Addon_Fernando_BanditTrader_preis ()
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_preis_15_00"); //Kolik mi zaplatíš, pokud tę nechám uprchnout?
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_preis_14_01"); //Znáš mou situaci. Nemohu ti moc zaplatit.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_preis_14_02"); //Co tak 200 zlata a cenný prsten?
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_preis_14_03"); //To je vše, co ti mohu dát. Dáš mi teë tu evidenci?
Info_ClearChoices (DIA_Addon_Fernando_BanditTrader);
Info_AddChoice (DIA_Addon_Fernando_BanditTrader, "No, nechystám se ti to dát.", DIA_Addon_Fernando_BanditTrader_nein );
Info_AddChoice (DIA_Addon_Fernando_BanditTrader, "Okay. Ujednáno.", DIA_Addon_Fernando_BanditTrader_ja );
};
func void DIA_Addon_Fernando_BanditTrader_ja ()
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_ja_15_00"); //Okay. Dohodnuto.
B_GivePlayerXP (XP_Ambient);
Npc_RemoveInvItems (hero ,ItMw_Addon_BanditTrader, Npc_HasItems (other,ItMw_Addon_BanditTrader));
Npc_RemoveInvItem (hero ,ItRi_Addon_BanditTrader);
Npc_RemoveInvItem (hero ,ItWr_Addon_BanditTrader);
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_ja_14_01"); //Dobrá, tady je zlato.
CreateInvItems (self, ItMi_Gold, 200);
B_GiveInvItems (self, other, ItMi_Gold, 200);
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_ja_14_02"); //A prsten. Nyní jsme dohodnuti.
CreateInvItems (self, ItRi_Prot_Point_01, 1);
B_GiveInvItems (self, other, ItRi_Prot_Point_01, 1);
Info_ClearChoices (DIA_Addon_Fernando_BanditTrader);
};
func void DIA_Addon_Fernando_BanditTrader_nein ()
{
AI_Output (other, self, "DIA_Addon_Fernando_BanditTrader_nein_15_00"); //Ne, nechystám se ti to dát.
AI_Output (self, other, "DIA_Addon_Fernando_BanditTrader_nein_14_01"); //Okay. Vem si to, ale nezkoušej mę podvést...
Info_ClearChoices (DIA_Addon_Fernando_BanditTrader);
};
//*********************************************************************
// Info Success
//*********************************************************************
INSTANCE DIA_Fernando_Success (C_INFO)
{
npc = VLK_405_Fernando;
nr = 5;
condition = DIA_Fernando_Success_Condition;
information = DIA_Fernando_Success_Info;
permanent = FALSE;
description = "Byl jsem v Hornickém údolí.";
};
FUNC INT DIA_Fernando_Success_Condition()
{
if (NpcObsessedByDMT_Fernando == FALSE)
&& (Kapitel >= 3)
&& (Npc_KnowsInfo (other, DIA_Fernando_Minental))
{
return TRUE;
};
};
FUNC VOID DIA_Fernando_Success_Info()
{
AI_Output (other ,self,"DIA_Fernando_Success_15_00"); //Byl jsem v Hornickém údolí.
if (Fernando_ImKnast == FALSE)
{
Fernando_Erz = TRUE;
B_GivePlayerXP (XP_Ambient);
AI_Output (self ,other,"DIA_Fernando_Success_14_01"); //A? Jak se to tam má?
AI_Output (other ,self,"DIA_Fernando_Success_15_02"); //Všechny doly jsou vytęženy, je tam sotva pár truhel rudy. Nemá cenu tam vůbec kopat.
AI_Output (self ,other,"DIA_Fernando_Success_14_03"); //To nemůže být pravda! To znamená, že je ze mę žebrák.
if (Fernando_HatsZugegeben == FALSE)
{
AI_Output (other ,self,"DIA_Fernando_Success_15_04"); //Co naše dohoda?
AI_Output (self ,other,"DIA_Fernando_Success_14_05"); //Teë k tvé odmęnę...
if (other.guild == GIL_KDF)
{
AI_Output (self ,other,"DIA_Fernando_Minental_14_06"); //Tady, vezmi si ten runový kámen.
B_GiveInvItems (self,other, ItmI_RuneBlank,1);
}
else
{
AI_Output (self ,other,"DIA_Fernando_Minental_14_07"); //Tady je tvůj prsten.
B_GiveInvItems (self,other, ItRi_Hp_02,1);
};
};
}
else
{
B_Say (self, other, "$NOTNOW");
Log_SetTopicStatus (TOPIC_Fernando, LOG_OBSOLETE);
B_LogEntry (TOPIC_Fernando,"Fernando doesn't want the information anymore. And I don't want to get any other fee neither.");
};
};
///////////////////////////////////////////////////////////////////////
// Info Obsession
///////////////////////////////////////////////////////////////////////
instance DIA_Fernando_Obsession (C_INFO)
{
npc = VLK_405_Fernando;
nr = 30;
condition = DIA_Fernando_Obsession_Condition;
information = DIA_Fernando_Obsession_Info;
description = "Jsi v poâádku?";
};
func int DIA_Fernando_Obsession_Condition ()
{
if (Kapitel >= 3)
&& (NpcObsessedByDMT_Fernando == FALSE)
&& (hero.guild == GIL_KDF)
{
return TRUE;
};
};
func void DIA_Fernando_Obsession_Info ()
{
B_NpcObsessedByDMT (self);
};
///////////////////////////////////////////////////////////////////////
// Info Heilung
///////////////////////////////////////////////////////////////////////
instance DIA_Fernando_Heilung (C_INFO)
{
npc = VLK_405_Fernando;
nr = 55;
condition = DIA_Fernando_Heilung_Condition;
information = DIA_Fernando_Heilung_Info;
permanent = TRUE;
description = "Ty jsi posedlý!";
};
func int DIA_Fernando_Heilung_Condition ()
{
if (NpcObsessedByDMT_Fernando == TRUE) && (NpcObsessedByDMT == FALSE)
&& (hero.guild == GIL_KDF)
{
return TRUE;
};
};
func void DIA_Fernando_Heilung_Info ()
{
AI_Output (other, self, "DIA_Fernando_Heilung_15_00"); //Ty jsi posedlý!
AI_Output (self, other, "DIA_Fernando_Heilung_14_01"); //Jdi pryč. Tak jdi už.
B_NpcClearObsessionByDMT (self);
};
|
D
|
/*******************************************************************************
AllFile Generated by AllDGenerator
Authors: ArcLib team, see AUTHORS file
Maintainer: Clay Smith (clayasaurus at gmail dot com)
License: zlib/libpng license: $(LICENSE)
Copyright: ArcLib team
Description:
AllFile Module imports all files below subdirectory
*******************************************************************************/
module arc.memory.all;
public import
arc.memory.freelist,
arc.memory.routines;
|
D
|
/// Page-management code
/// Maps the last PML4E to itself => recursive paging
module novuos.memory.pager;
import novuos.basictypes;
enum PageSize : ubyte
{
Size4k = 0,
Size2m = 1
}
struct PagePML4E
{
@disable this();
ulong field; /// Raw field
alias P = BitField!(ulong, field, 1, 0); /// Present
alias RW = BitField!(ulong, field, 1, 1); /// Read/Write=1, Read-Only=0
alias US = BitField!(ulong, field, 1, 2); /// User=1, Supervisor=0
alias PWT = BitField!(ulong, field, 1, 3); /// Writethrough
alias PCD = BitField!(ulong, field, 1, 4); /// Page-level cache disable
alias A = BitField!(ulong, field, 1, 5); /// Accessed
alias MBZ = BitField!(ulong, field, 2, 7); /// Must be zero
alias AVL = BitField!(ulong, field, 3, 9); /// To software
alias Addr = BitField!(ulong, field, 40, 12); /// Address
alias AvailLong = BitField!(ulong, field, 11, 52); /// Available bits
alias NX = BitField!(ulong, field, 1, 63); /// No-execute
}
alias StaticPageTable = align(4096) PagePML4E[512];
struct PagePDPE
{
@disable this();
ulong field; /// Raw field
alias P = BitField!(ulong, field, 1, 0); /// Present
alias RW = BitField!(ulong, field, 1, 1); /// Read/Write=1, Read-Only=0
alias US = BitField!(ulong, field, 1, 2); /// User=1, Supervisor=0
alias PWT = BitField!(ulong, field, 1, 3); /// Writethrough
alias PCD = BitField!(ulong, field, 1, 4); /// Page-level cache disable
alias A = BitField!(ulong, field, 1, 5); /// Accessed
alias MBZ = BitField!(ulong, field, 2, 7); /// Must be zero
alias AVL = BitField!(ulong, field, 3, 9); /// To software
alias Addr = BitField!(ulong, field, 40, 12); /// Address
alias AvailLong = BitField!(ulong, field, 11, 52); /// Available bits
alias NX = BitField!(ulong, field, 1, 63); /// No-execute
}
struct PagePDE_4k
{
@disable this();
ulong field; /// Raw field
alias P = BitField!(ulong, field, 1, 0); /// Present
alias RW = BitField!(ulong, field, 1, 1); /// Read/Write=1, Read-Only=0
alias US = BitField!(ulong, field, 1, 2); /// User=1, Supervisor=0
alias PWT = BitField!(ulong, field, 1, 3); /// Writethrough
alias PCD = BitField!(ulong, field, 1, 4); /// Page-level cache disable
alias A = BitField!(ulong, field, 1, 5); /// Accessed
alias SizeBit = BitField!(ulong, field, 1, 7); /// PageSize bit, must be 0
alias AVL = BitField!(ulong, field, 3, 9); /// To software
alias Addr = BitField!(ulong, field, 40, 12); /// Address
alias AvailLong = BitField!(ulong, field, 11, 52); /// Available bits
alias NX = BitField!(ulong, field, 1, 63); /// No-execute
}
struct PagePDE_2m
{
@disable this();
ulong field; /// Raw field
alias P = BitField!(ulong, field, 1, 0); /// Present
alias RW = BitField!(ulong, field, 1, 1); /// Read/Write=1, Read-Only=0
alias US = BitField!(ulong, field, 1, 2); /// User=1, Supervisor=0
alias PWT = BitField!(ulong, field, 1, 3); /// Writethrough
alias PCD = BitField!(ulong, field, 1, 4); /// Page-level cache disable
alias A = BitField!(ulong, field, 1, 5); /// Accessed
alias D = BitField!(ulong, field, 1, 6); /// Dirty
alias SizeBit = BitField!(ulong, field, 1, 7); /// PageSize bit, must be 1
alias G = BitField!(ulong, field, 1, 8); /// Global page
alias AVL = BitField!(ulong, field, 3, 9); /// To software
alias PAT = BitField!(ulong, field, 1, 12); /// Page attribute table
alias Addr = BitField!(ulong, field, 39, 13); /// Address
alias AvailLong = BitField!(ulong, field, 11, 52); /// Available bits
alias NX = BitField!(ulong, field, 1, 63); /// No-execute
}
struct PagePTE
{
@disable this();
ulong field; /// Raw field
alias P = BitField!(ulong, field, 1, 0); /// Present
alias RW = BitField!(ulong, field, 1, 1); /// Read/Write=1, Read-Only=0
alias US = BitField!(ulong, field, 1, 2); /// User=1, Supervisor=0
alias PWT = BitField!(ulong, field, 1, 3); /// Writethrough
alias PCD = BitField!(ulong, field, 1, 4); /// Page-level cache disable
alias A = BitField!(ulong, field, 1, 5); /// Accessed
alias D = BitField!(ulong, field, 1, 6); /// Dirty
alias PAT = BitField!(ulong, field, 1, 7); /// Page attribute table
alias G = BitField!(ulong, field, 1, 8); /// Global page
alias AVL = BitField!(ulong, field, 3, 9); /// To software
alias Addr = BitField!(ulong, field, 40, 12); /// Address
alias AvailLong = BitField!(ulong, field, 11, 52); /// Available bits
alias NX = BitField!(ulong, field, 1, 63); /// No-execute
}
enum PageLvl4Shift = 39;
enum PageLvl3Shift = 30;
enum PageLvl2Shift = 21;
enum PageLvl1Shift = 12;
private enum ulong UpperHalfMask = 0xFFFFL << 48;
/// The index of the recursive PML4E page
enum ulong PageRecursiveIdx = 510;
enum PageLvl4Addr = cast(PagePML4E*)(
UpperHalfMask | (PageRecursiveIdx << PageLvl4Shift) | (PageRecursiveIdx << PageLvl3Shift) | (
PageRecursiveIdx << PageLvl2Shift) | (PageRecursiveIdx << PageLvl1Shift));
enum PageLvl3Addr = cast(PagePDPE*)(
UpperHalfMask | (PageRecursiveIdx << PageLvl4Shift) | (PageRecursiveIdx << PageLvl3Shift) | (
PageRecursiveIdx << PageLvl2Shift));
enum PageLvl2Addr_4k = cast(PagePDE_4k*)(
UpperHalfMask | (PageRecursiveIdx << PageLvl4Shift) | (PageRecursiveIdx << PageLvl3Shift));
enum PageLvl2Addr_2m = cast(PagePDE_2m*)(
UpperHalfMask | (PageRecursiveIdx << PageLvl4Shift) | (PageRecursiveIdx << PageLvl3Shift));
enum PageLvl1Addr = cast(PagePTE*)(UpperHalfMask | (PageRecursiveIdx << PageLvl4Shift));
nothrow:
@nogc:
/// Initial paging structures setup (operates in 1:1 mapping mode)
void setupPageTableIdentity(PagePML4E[] pageTable)
{
// zero all
for (ushort i = 0; i < 512; i++)
{
pageTable[i].field = 0;
}
// recursive mapping
pageTable[PageRecursiveIdx].Addr.value = cast(ulong)(pageTable.ptr) >> pageTable[
PageRecursiveIdx].Addr.shift;
pageTable[PageRecursiveIdx].P.value = 1;
pageTable[PageRecursiveIdx].US.value = 0;
pageTable[PageRecursiveIdx].RW.value = 1;
}
/// Or the upper half address mask if necessary
T* pageAddr(T)(const(T)* a)
{
ulong A = cast(ulong) a;
if (A & (1L << 47))
{
return a | UpperHalfMask;
}
else
{
return a;
}
}
struct PageStructureIndices
{
@disable this();
ushort Level4 = void;
ushort Level3 = void;
ushort Level2 = void;
ushort Level1 = void;
}
void getAddressPage(const(void)* VirtAddr, PageStructureIndices* psi)
{
ulong RAddr = cast(ulong)(VirtAddr);
psi.Level4 = (RAddr >> PageLvl4Shift) & 511;
psi.Level3 = (RAddr >> PageLvl3Shift) & 511;
psi.Level2 = (RAddr >> PageLvl2Shift) & 511;
psi.Level1 = (RAddr >> PageLvl1Shift) & 511;
}
|
D
|
/Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Bond.build/Objects-normal/x86_64/ProtocolProxyController.o : /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSObject+KVO.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITextField.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Bond.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/DataSource.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/QueryableDataSource.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Observable.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISwitch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UILabel.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/SignalProtocol.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISegmentedControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIRefreshControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UINavigationItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIBarButtonItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIBarItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIAccessibilityIdentification.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIApplication.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/BNDInvocation.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIButton.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISearchBar.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UINavigationBar.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISlider.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIDatePicker.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/ProtocolProxyController.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIStepper.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NotificationCenter.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/CALayer.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIGestureRecognizer.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSObject.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/DynamicSubject.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableSet.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSLayoutConstraint.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIImageView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITableView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UICollectionView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIActivityIndicatorView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIProgressView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITextView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/Observable2DArray.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableArray.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableDictionary.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Property.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/ProtocolProxy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/Differ/Differ.framework/Modules/Differ.swiftmodule/x86_64.swiftmodule /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/ReactiveKit/ReactiveKit.framework/Modules/ReactiveKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Bond/Bond-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Differ/Differ-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/ReactiveKit/ReactiveKit-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Supporting\ Files/Bond.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/BNDProtocolProxyBase/include/BNDProtocolProxyBase.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/Differ/Differ.framework/Headers/Differ-Swift.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/ReactiveKit/ReactiveKit.framework/Headers/ReactiveKit-Swift.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/ReactiveKit/ReactiveKit/ReactiveKit.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Bond.build/unextended-module.modulemap /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/module.modulemap /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/ReactiveKit.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Bond.build/Objects-normal/x86_64/ProtocolProxyController~partial.swiftmodule : /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSObject+KVO.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITextField.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Bond.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/DataSource.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/QueryableDataSource.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Observable.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISwitch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UILabel.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/SignalProtocol.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISegmentedControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIRefreshControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UINavigationItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIBarButtonItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIBarItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIAccessibilityIdentification.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIApplication.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/BNDInvocation.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIButton.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISearchBar.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UINavigationBar.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISlider.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIDatePicker.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/ProtocolProxyController.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIStepper.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NotificationCenter.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/CALayer.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIGestureRecognizer.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSObject.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/DynamicSubject.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableSet.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSLayoutConstraint.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIImageView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITableView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UICollectionView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIActivityIndicatorView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIProgressView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITextView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/Observable2DArray.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableArray.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableDictionary.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Property.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/ProtocolProxy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/Differ/Differ.framework/Modules/Differ.swiftmodule/x86_64.swiftmodule /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/ReactiveKit/ReactiveKit.framework/Modules/ReactiveKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Bond/Bond-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Differ/Differ-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/ReactiveKit/ReactiveKit-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Supporting\ Files/Bond.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/BNDProtocolProxyBase/include/BNDProtocolProxyBase.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/Differ/Differ.framework/Headers/Differ-Swift.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/ReactiveKit/ReactiveKit.framework/Headers/ReactiveKit-Swift.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/ReactiveKit/ReactiveKit/ReactiveKit.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Bond.build/unextended-module.modulemap /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/module.modulemap /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/ReactiveKit.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Bond.build/Objects-normal/x86_64/ProtocolProxyController~partial.swiftdoc : /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSObject+KVO.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITextField.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Bond.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/DataSource.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/QueryableDataSource.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Observable.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISwitch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UILabel.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/SignalProtocol.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISegmentedControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIRefreshControl.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UINavigationItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIBarButtonItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIBarItem.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIAccessibilityIdentification.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIApplication.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/BNDInvocation.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIButton.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISearchBar.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UINavigationBar.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UISlider.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIDatePicker.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/ProtocolProxyController.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIStepper.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NotificationCenter.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/CALayer.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIGestureRecognizer.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSObject.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/DynamicSubject.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableSet.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Shared/NSLayoutConstraint.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIImageView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITableView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UICollectionView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIActivityIndicatorView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UIProgressView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/UIKit/UITextView.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/Observable2DArray.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableArray.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Collections/ObservableDictionary.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/Property.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/Bond/ProtocolProxy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/Differ/Differ.framework/Modules/Differ.swiftmodule/x86_64.swiftmodule /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/ReactiveKit/ReactiveKit.framework/Modules/ReactiveKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Bond/Bond-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Differ/Differ-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/ReactiveKit/ReactiveKit-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Supporting\ Files/Bond.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Bond/Sources/BNDProtocolProxyBase/include/BNDProtocolProxyBase.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/Differ/Differ.framework/Headers/Differ-Swift.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Products/Debug-iphonesimulator/ReactiveKit/ReactiveKit.framework/Headers/ReactiveKit-Swift.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/ReactiveKit/ReactiveKit/ReactiveKit.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Bond.build/unextended-module.modulemap /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/module.modulemap /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/ReactiveKit.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/Users/mac/Desktop/23March/BEKApp-master/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager.o : /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/MultipartFormData.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Timeline.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Alamofire.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Response.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/TaskDelegate.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/SessionDelegate.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ParameterEncoding.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Validation.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ResponseSerialization.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/SessionManager.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/AFError.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Notifications.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Result.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Request.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mac/Desktop/23March/BEKApp-master/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/mac/Desktop/23March/BEKApp-master/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Desktop/23March/BEKApp-master/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftmodule : /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/MultipartFormData.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Timeline.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Alamofire.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Response.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/TaskDelegate.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/SessionDelegate.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ParameterEncoding.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Validation.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ResponseSerialization.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/SessionManager.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/AFError.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Notifications.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Result.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Request.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mac/Desktop/23March/BEKApp-master/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/mac/Desktop/23March/BEKApp-master/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Desktop/23March/BEKApp-master/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftdoc : /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/MultipartFormData.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Timeline.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Alamofire.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Response.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/TaskDelegate.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/SessionDelegate.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ParameterEncoding.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Validation.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ResponseSerialization.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/SessionManager.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/AFError.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Notifications.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Result.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/Request.swift /Users/mac/Desktop/23March/BEKApp-master/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/mac/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mac/Desktop/23March/BEKApp-master/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/mac/Desktop/23March/BEKApp-master/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/mac/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/*
* Copyright (c) 2007-2013 Scott Lembcke and Howling Moon Software
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
module dchip.cpArbiter;
import std.string;
import dchip.cpBody;
import dchip.chipmunk;
import dchip.chipmunk_private;
import dchip.chipmunk_types;
import dchip.constraints_util;
import dchip.cpSpace;
import dchip.cpSpatialIndex;
import dchip.cpShape;
import dchip.cpVect;
import dchip.util;
/// The cpArbiter struct controls pairs of colliding shapes.
/// They are also used in conjuction with collision handler callbacks
/// allowing you to retrieve information on the collision and control it.
/// Collision begin event function callback type.
/// Returning false from a begin callback causes the collision to be ignored until
/// the the separate callback is called when the objects stop colliding.
alias cpCollisionBeginFunc = cpBool function(cpArbiter* arb, cpSpace* space, void* data);
/// Collision pre-solve event function callback type.
/// Returning false from a pre-step callback causes the collision to be ignored until the next step.
alias cpCollisionPreSolveFunc = cpBool function(cpArbiter* arb, cpSpace* space, void* data);
/// Collision post-solve event function callback type.
alias cpCollisionPostSolveFunc = void function(cpArbiter* arb, cpSpace* space, void* data);
/// Collision separate event function callback type.
alias cpCollisionSeparateFunc = void function(cpArbiter* arb, cpSpace* space, void* data);
/// @private
struct cpCollisionHandler
{
cpCollisionType a;
cpCollisionType b;
cpCollisionBeginFunc begin;
cpCollisionPreSolveFunc preSolve;
cpCollisionPostSolveFunc postSolve;
cpCollisionSeparateFunc separate;
void* data;
}
enum CP_MAX_CONTACTS_PER_ARBITER = 2;
/// @private
enum cpArbiterState
{
// Arbiter is active and its the first collision.
cpArbiterStateFirstColl,
// Arbiter is active and its not the first collision.
cpArbiterStateNormal,
// Collision has been explicitly ignored.
// Either by returning false from a begin collision handler or calling cpArbiterIgnore().
cpArbiterStateIgnore,
// Collison is no longer active. A space will cache an arbiter for up to cpSpace.collisionPersistence more steps.
cpArbiterStateCached,
}
///
mixin _ExportEnumMembers!cpArbiterState;
/// @private
struct cpArbiterThread
{
// Links to next and previous arbiters in the contact graph.
cpArbiter* next;
cpArbiter* prev;
}
/// A colliding pair of shapes.
struct cpArbiter
{
/// Calculated value to use for the elasticity coefficient.
/// Override in a pre-solve collision handler for custom behavior.
cpFloat e = 0;
/// Calculated value to use for the friction coefficient.
/// Override in a pre-solve collision handler for custom behavior.
cpFloat u = 0;
/// Calculated value to use for applying surface velocities.
/// Override in a pre-solve collision handler for custom behavior.
cpVect surface_vr;
/// User definable data pointer.
/// The value will persist for the pair of shapes until the separate() callback is called.
/// NOTE: If you need to clean up this pointer, you should implement the separate() callback to do it.
cpDataPointer data;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpShape * a;
else
package cpShape * a;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpShape * b;
else
package cpShape * b;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpBody * body_a;
else
package cpBody * body_a;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpBody * body_b;
else
package cpBody * body_b;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpArbiterThread thread_a;
else
package cpArbiterThread thread_a;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpArbiterThread thread_b;
else
package cpArbiterThread thread_b;
version (CHIP_ALLOW_PRIVATE_ACCESS)
int numContacts;
else
package int numContacts;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpContact * contacts;
else
package cpContact * contacts;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpTimestamp stamp;
else
package cpTimestamp stamp;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpCollisionHandler * handler;
else
package cpCollisionHandler * handler;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpBool swappedColl;
else
package cpBool swappedColl;
version (CHIP_ALLOW_PRIVATE_ACCESS)
cpArbiterState state;
else
package cpArbiterState state;
}
mixin template CP_DefineArbiterStructGetter(type, string member, string name)
{
mixin(q{
type cpArbiterGet%s(const cpArbiter * arb) { return cast(typeof(return))arb.%s; }
}.format(name, member));
}
mixin template CP_DefineArbiterStructSetter(type, string member, string name)
{
mixin(q{
void cpArbiterSet%s(cpArbiter * arb, type value) { arb.%s = value; }
}.format(name, member));
}
mixin template CP_DefineArbiterStructProperty(type, string member, string name)
{
mixin CP_DefineArbiterStructGetter!(type, member, name);
mixin CP_DefineArbiterStructSetter!(type, member, name);
}
mixin CP_DefineArbiterStructProperty!(cpFloat, "e", "Elasticity");
mixin CP_DefineArbiterStructProperty!(cpFloat, "u", "Friction");
mixin CP_DefineArbiterStructProperty!(cpDataPointer, "data", "UserData");
/// Return the colliding shapes involved for this arbiter.
/// The order of their cpSpace.collision_type values will match
/// the order set when the collision handler was registered.
void cpArbiterGetShapes(const cpArbiter* arb, cpShape** a, cpShape** b)
{
if (arb.swappedColl)
{
(*a) = cast(typeof(*a))arb.b;
(*b) = cast(typeof(*a))arb.a;
}
else
{
(*a) = cast(typeof(*a))arb.a;
(*b) = cast(typeof(*b))arb.b;
}
}
/// A macro shortcut for defining and retrieving the shapes from an arbiter.
string CP_ARBITER_GET_SHAPES(string arb, string a, string b)()
{
return q{
cpShape * %2$s;
cpShape * %3$s;
cpArbiterGetShapes(%1$s, &%2$s, &%3$s);
}.format(arb, a, b);
}
/// Return the colliding bodies involved for this arbiter.
/// The order of the cpSpace.collision_type the bodies are associated with values will match
/// the order set when the collision handler was registered.
void cpArbiterGetBodies(const cpArbiter* arb, cpBody** a, cpBody** b)
{
mixin(CP_ARBITER_GET_SHAPES!("arb", "shape_a", "shape_b"));
(*a) = shape_a.body_;
(*b) = shape_b.body_;
}
/// A macro shortcut for defining and retrieving the bodies from an arbiter.
template CP_ARBITER_GET_BODIES(string arb, string a, string b)
{
enum CP_ARBITER_GET_BODIES = q{
cpBody * %2$s;
cpBody * %3$s;
cpArbiterGetBodies(%1$s, &%2$s, &%3$s);
}.format(arb, a, b);
}
/// A struct that wraps up the important collision data for an arbiter.
struct cpContactPointSet
{
/// The number of contact points in the set.
int count;
/// The array of contact points.
struct Point
{
/// The position of the contact point.
cpVect point;
/// The normal of the contact point.
cpVect normal;
/// The depth of the contact point.
cpFloat dist = 0;
}
Point[CP_MAX_CONTACTS_PER_ARBITER] points;
}
cpContact* cpContactInit(cpContact* con, cpVect p, cpVect n, cpFloat dist, cpHashValue hash)
{
con.p = p;
con.n = n;
con.dist = dist;
con.jnAcc = 0.0f;
con.jtAcc = 0.0f;
con.jBias = 0.0f;
con.hash = hash;
return con;
}
// TODO make this generic so I can reuse it for constraints also.
void unthreadHelper(cpArbiter* arb, cpBody* body_)
{
cpArbiterThread* thread = cpArbiterThreadForBody(arb, body_);
cpArbiter* prev = thread.prev;
cpArbiter* next = thread.next;
if (prev)
{
cpArbiterThreadForBody(prev, body_).next = next;
}
else if (body_.arbiterList == arb)
{
// IFF prev is null and body_.arbiterList == arb, is arb at the head of the list.
// This function may be called for an arbiter that was never in a list.
// In that case, we need to protect it from wiping out the body_.arbiterList pointer.
body_.arbiterList = next;
}
if (next)
cpArbiterThreadForBody(next, body_).prev = prev;
thread.prev = null;
thread.next = null;
}
void cpArbiterUnthread(cpArbiter* arb)
{
unthreadHelper(arb, arb.body_a);
unthreadHelper(arb, arb.body_b);
}
cpBool cpArbiterIsFirstContact(const cpArbiter* arb)
{
return arb.state == cpArbiterStateFirstColl;
}
int cpArbiterGetCount(const cpArbiter* arb)
{
// Return 0 contacts if we are in a separate callback.
return (arb.state != cpArbiterStateCached ? arb.numContacts : 0);
}
cpVect cpArbiterGetNormal(const cpArbiter* arb, int i)
{
cpAssertHard(0 <= i && i < cpArbiterGetCount(arb), "Index error: The specified contact index is invalid for this arbiter");
cpVect n = arb.contacts[i].n;
return arb.swappedColl ? cpvneg(n) : n;
}
cpVect cpArbiterGetPoint(const cpArbiter* arb, int i)
{
cpAssertHard(0 <= i && i < cpArbiterGetCount(arb), "Index error: The specified contact index is invalid for this arbiter");
return arb.contacts[i].p;
}
cpFloat cpArbiterGetDepth(const cpArbiter* arb, int i)
{
cpAssertHard(0 <= i && i < cpArbiterGetCount(arb), "Index error: The specified contact index is invalid for this arbiter");
return arb.contacts[i].dist;
}
cpContactPointSet cpArbiterGetContactPointSet(const cpArbiter* arb)
{
cpContactPointSet set;
set.count = cpArbiterGetCount(arb);
for (int i = 0; i < set.count; i++)
{
set.points[i].point = arb.contacts[i].p;
set.points[i].normal = arb.contacts[i].n;
set.points[i].dist = arb.contacts[i].dist;
}
return set;
}
void cpArbiterSetContactPointSet(cpArbiter* arb, cpContactPointSet* set)
{
int count = set.count;
cpAssertHard(count == arb.numContacts, "The number of contact points cannot be changed.");
for (int i = 0; i < count; i++)
{
arb.contacts[i].p = set.points[i].point;
arb.contacts[i].n = set.points[i].normal;
arb.contacts[i].dist = set.points[i].dist;
}
}
cpVect cpArbiterTotalImpulse(const cpArbiter* arb)
{
cpContact* contacts = cast(cpContact*)arb.contacts;
cpVect sum = cpvzero;
for (int i = 0, count = cpArbiterGetCount(arb); i < count; i++)
{
cpContact* con = &contacts[i];
sum = cpvadd(sum, cpvmult(con.n, con.jnAcc));
}
return (arb.swappedColl ? sum : cpvneg(sum));
}
cpVect cpArbiterTotalImpulseWithFriction(const cpArbiter* arb)
{
cpContact* contacts = cast(cpContact*)arb.contacts;
cpVect sum = cpvzero;
for (int i = 0, count = cpArbiterGetCount(arb); i < count; i++)
{
cpContact* con = &contacts[i];
sum = cpvadd(sum, cpvrotate(con.n, cpv(con.jnAcc, con.jtAcc)));
}
return (arb.swappedColl ? sum : cpvneg(sum));
}
cpFloat cpArbiterTotalKE(const cpArbiter* arb)
{
cpFloat eCoef = (1 - arb.e) / (1 + arb.e);
cpFloat sum = 0.0;
cpContact* contacts = cast(cpContact*)arb.contacts;
for (int i = 0, count = cpArbiterGetCount(arb); i < count; i++)
{
cpContact* con = &contacts[i];
cpFloat jnAcc = con.jnAcc;
cpFloat jtAcc = con.jtAcc;
sum += eCoef * jnAcc * jnAcc / con.nMass + jtAcc * jtAcc / con.tMass;
}
return sum;
}
void cpArbiterIgnore(cpArbiter* arb)
{
arb.state = cpArbiterStateIgnore;
}
cpVect cpArbiterGetSurfaceVelocity(cpArbiter* arb)
{
return cpvmult(arb.surface_vr, arb.swappedColl ? -1.0f : 1.0);
}
void cpArbiterSetSurfaceVelocity(cpArbiter* arb, cpVect vr)
{
arb.surface_vr = cpvmult(vr, arb.swappedColl ? -1.0f : 1.0);
}
cpArbiter* cpArbiterInit(cpArbiter* arb, cpShape* a, cpShape* b)
{
arb.handler = null;
arb.swappedColl = cpFalse;
arb.e = 0.0f;
arb.u = 0.0f;
arb.surface_vr = cpvzero;
arb.numContacts = 0;
arb.contacts = null;
arb.a = a;
arb.body_a = a.body_;
arb.b = b;
arb.body_b = b.body_;
arb.thread_a.next = null;
arb.thread_b.next = null;
arb.thread_a.prev = null;
arb.thread_b.prev = null;
arb.stamp = 0;
arb.state = cpArbiterStateFirstColl;
arb.data = null;
return arb;
}
void cpArbiterUpdate(cpArbiter* arb, cpContact* contacts, int numContacts, cpCollisionHandler* handler, cpShape* a, cpShape* b)
{
// Iterate over the possible pairs to look for hash value matches.
for (int i = 0; i < numContacts; i++)
{
cpContact* con = &contacts[i];
for (int j = 0; j < arb.numContacts; j++)
{
cpContact* old = &arb.contacts[j];
// This could trigger false positives, but is fairly unlikely nor serious if it does.
if (con.hash == old.hash)
{
// Copy the persistant contact information.
con.jnAcc = old.jnAcc;
con.jtAcc = old.jtAcc;
}
}
}
arb.contacts = contacts;
arb.numContacts = numContacts;
arb.handler = handler;
arb.swappedColl = (a.collision_type != handler.a);
arb.e = a.e * b.e;
arb.u = a.u * b.u;
// Currently all contacts will have the same normal.
// This may change in the future.
cpVect n = (numContacts ? contacts[0].n : cpvzero);
cpVect surface_vr = cpvsub(a.surface_v, b.surface_v);
arb.surface_vr = cpvsub(surface_vr, cpvmult(n, cpvdot(surface_vr, n)));
// For collisions between two similar primitive types, the order could have been swapped.
arb.a = a;
arb.body_a = a.body_;
arb.b = b;
arb.body_b = b.body_;
// mark it as new if it's been cached
if (arb.state == cpArbiterStateCached)
arb.state = cpArbiterStateFirstColl;
}
void cpArbiterPreStep(cpArbiter* arb, cpFloat dt, cpFloat slop, cpFloat bias)
{
cpBody* a = arb.body_a;
cpBody* b = arb.body_b;
for (int i = 0; i < arb.numContacts; i++)
{
cpContact* con = &arb.contacts[i];
// Calculate the offsets.
con.r1 = cpvsub(con.p, a.p);
con.r2 = cpvsub(con.p, b.p);
// Calculate the mass normal and mass tangent.
con.nMass = 1.0f / k_scalar(a, b, con.r1, con.r2, con.n);
con.tMass = 1.0f / k_scalar(a, b, con.r1, con.r2, cpvperp(con.n));
// Calculate the target bias velocity.
con.bias = -bias* cpfmin(0.0f, con.dist + slop) / dt;
con.jBias = 0.0f;
// Calculate the target bounce velocity.
con.bounce = normal_relative_velocity(a, b, con.r1, con.r2, con.n) * arb.e;
}
}
void cpArbiterApplyCachedImpulse(cpArbiter* arb, cpFloat dt_coef)
{
if (cpArbiterIsFirstContact(arb))
return;
cpBody* a = arb.body_a;
cpBody* b = arb.body_b;
for (int i = 0; i < arb.numContacts; i++)
{
cpContact* con = &arb.contacts[i];
cpVect j = cpvrotate(con.n, cpv(con.jnAcc, con.jtAcc));
apply_impulses(a, b, con.r1, con.r2, cpvmult(j, dt_coef));
}
}
// TODO is it worth splitting velocity/position correction?
void cpArbiterApplyImpulse(cpArbiter* arb)
{
cpBody* a = arb.body_a;
cpBody* b = arb.body_b;
cpVect surface_vr = arb.surface_vr;
cpFloat friction = arb.u;
for (int i = 0; i < arb.numContacts; i++)
{
cpContact* con = &arb.contacts[i];
cpFloat nMass = con.nMass;
cpVect n = con.n;
cpVect r1 = con.r1;
cpVect r2 = con.r2;
cpVect vb1 = cpvadd(a.v_bias, cpvmult(cpvperp(r1), a.w_bias));
cpVect vb2 = cpvadd(b.v_bias, cpvmult(cpvperp(r2), b.w_bias));
cpVect vr = cpvadd(relative_velocity(a, b, r1, r2), surface_vr);
cpFloat vbn = cpvdot(cpvsub(vb2, vb1), n);
cpFloat vrn = cpvdot(vr, n);
cpFloat vrt = cpvdot(vr, cpvperp(n));
cpFloat jbn = (con.bias - vbn) * nMass;
cpFloat jbnOld = con.jBias;
con.jBias = cpfmax(jbnOld + jbn, 0.0f);
cpFloat jn = -(con.bounce + vrn) * nMass;
cpFloat jnOld = con.jnAcc;
con.jnAcc = cpfmax(jnOld + jn, 0.0f);
cpFloat jtMax = friction * con.jnAcc;
cpFloat jt = -vrt * con.tMass;
cpFloat jtOld = con.jtAcc;
con.jtAcc = cpfclamp(jtOld + jt, -jtMax, jtMax);
apply_bias_impulses(a, b, r1, r2, cpvmult(n, con.jBias - jbnOld));
apply_impulses(a, b, r1, r2, cpvrotate(n, cpv(con.jnAcc - jnOld, con.jtAcc - jtOld)));
}
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.SWT;
import org.eclipse.swt.internal.win32.OS;
import java.lang.all;
/**
* Instances of this class describe operating system fonts.
* <p>
* For platform-independent behaviour, use the get and set methods
* corresponding to the following properties:
* <dl>
* <dt>height</dt><dd>the height of the font in points</dd>
* <dt>name</dt><dd>the face name of the font, which may include the foundry</dd>
* <dt>style</dt><dd>A bitwise combination of NORMAL, ITALIC and BOLD</dd>
* </dl>
* If extra, platform-dependent functionality is required:
* <ul>
* <li>On <em>Windows</em>, the data member of the <code>FontData</code>
* corresponds to a Windows <code>LOGFONT</code> structure whose fields
* may be retrieved and modified.</li>
* <li>On <em>X</em>, the fields of the <code>FontData</code> correspond
* to the entries in the font's XLFD name and may be retrieved and modified.
* </ul>
* Application code does <em>not</em> need to explicitly release the
* resources managed by each instance when those instances are no longer
* required, and thus no <code>dispose()</code> method is provided.
*
* @see Font
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public final class FontData {
/**
* A Win32 LOGFONT struct
* (Warning: This field is platform dependent)
* <p>
* <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
* public API. It is marked public only so that it can be shared
* within the packages provided by SWT. It is not available on all
* platforms and should never be accessed from application code.
* </p>
*/
public LOGFONT data;
/**
* The height of the font data in points
* (Warning: This field is platform dependent)
* <p>
* <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
* public API. It is marked public only so that it can be shared
* within the packages provided by SWT. It is not available on all
* platforms and should never be accessed from application code.
* </p>
*/
public float height = 0;
/**
* The locales of the font
*/
String lang, country, variant;
private static FontData s_this;
/**
* Constructs a new uninitialized font data.
*/
public this() {
// We set the charset field so that
// wildcard searching will work properly
// out of the box
data.lfCharSet = cast(byte)OS.DEFAULT_CHARSET;
height = 12;
}
/**
* Constructs a new font data given the Windows <code>LOGFONT</code>
* that it should represent.
*
* @param data the <code>LOGFONT</code> for the result
*/
this(LOGFONT* data, float height) {
this.data = *data;
this.height = height;
}
/**
* Constructs a new FontData given a string representation
* in the form generated by the <code>FontData.toString</code>
* method.
* <p>
* Note that the representation varies between platforms,
* and a FontData can only be created from a string that was
* generated on the same platform.
* </p>
*
* @param string the string representation of a <code>FontData</code> (must not be null)
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the argument does not represent a valid description</li>
* </ul>
*
* @see #toString
*/
public this(String string) {
if (string is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
int start = 0;
int end = string.indexOf('|');
if (end is -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
String version1 = string.substring(start, end);
try {
if (Integer.parseInt(version1) !is 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
} catch (NumberFormatException e) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
String name = string.substring(start, end);
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
float height = 0;
try {
height = Float.parseFloat(string.substring(start, end));
} catch (NumberFormatException e) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
int style = 0;
try {
style = Integer.parseInt(string.substring(start, end));
} catch (NumberFormatException e) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
start = end + 1;
end = string.indexOf('|', start);
//data = OS.IsUnicode ? cast(LOGFONT)new LOGFONTW() : new LOGFONTA();
data.lfCharSet = cast(byte)OS.DEFAULT_CHARSET;
setName(name);
setHeight(height);
setStyle(style);
if (end is -1) return;
String platform = string.substring(start, end);
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
String version2 = string.substring(start, end);
if (platform ==/*eq*/ "WINDOWS" && version2 ==/*eq*/ "1") { //$NON-NLS-1$//$NON-NLS-2$
LOGFONT newData;// = OS.IsUnicode ? cast(LOGFONT)new LOGFONTW() : new LOGFONTA();
try {
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfHeight = Integer.parseInt(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfWidth = Integer.parseInt(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfEscapement = Integer.parseInt(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfOrientation = Integer.parseInt(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfWeight = Integer.parseInt(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfItalic = Byte.parseByte(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfUnderline = Byte.parseByte(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfStrikeOut = Byte.parseByte(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfCharSet = Byte.parseByte(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfOutPrecision = Byte.parseByte(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfClipPrecision = Byte.parseByte(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfQuality = Byte.parseByte(string.substring(start, end));
start = end + 1;
end = string.indexOf('|', start);
if (end is -1) return;
newData.lfPitchAndFamily = Byte.parseByte(string.substring(start, end));
start = end + 1;
} catch (NumberFormatException e) {
setName(name);
setHeight(height);
setStyle(style);
return;
}
String buffer = string.substring(start);
auto wname = StrToTCHARs(buffer);
int len = Math.min(OS.LF_FACESIZE - 1, wname.length);
newData.lfFaceName[ 0 .. len ] = wname[ 0 .. len ];
newData.lfFaceName[ len .. $ ] = 0;
data = newData;
}
}
/**
* Constructs a new font data given a font name,
* the height of the desired font in points,
* and a font style.
*
* @param name the name of the font (must not be null)
* @param height the font height in points
* @param style a bit or combination of NORMAL, BOLD, ITALIC
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
* </ul>
*/
public this(String name, int height, int style) {
if (name is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
setName(name);
setHeight(height);
setStyle(style);
// We set the charset field so that
// wildcard searching will work properly
// out of the box
data.lfCharSet = cast(byte)OS.DEFAULT_CHARSET;
}
/*public*/ this(String name, float height, int style) {
if (name is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
setName(name);
setHeight(height);
setStyle(style);
// We set the charset field so that
// wildcard searching will work properly
// out of the box
data.lfCharSet = cast(byte)OS.DEFAULT_CHARSET;
}
/**
* Compares the argument to the receiver, and returns true
* if they represent the <em>same</em> object using a class
* specific comparison.
*
* @param object the object to compare with this object
* @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
*
* @see #hashCode
*/
override public equals_t opEquals (Object object) {
if (object is this) return true;
if( auto fd = cast(FontData)object ){
LOGFONT* lf = &fd.data;
return data.lfCharSet is lf.lfCharSet &&
/*
* This code is intentionally commented. When creating
* a FontData, lfHeight is not necessarily set. Instead
* we check the height field which is always set.
*/
// data.lfHeight is lf.lfHeight &&
height is fd.height &&
data.lfWidth is lf.lfWidth &&
data.lfEscapement is lf.lfEscapement &&
data.lfOrientation is lf.lfOrientation &&
data.lfWeight is lf.lfWeight &&
data.lfItalic is lf.lfItalic &&
data.lfUnderline is lf.lfUnderline &&
data.lfStrikeOut is lf.lfStrikeOut &&
data.lfCharSet is lf.lfCharSet &&
data.lfOutPrecision is lf.lfOutPrecision &&
data.lfClipPrecision is lf.lfClipPrecision &&
data.lfQuality is lf.lfQuality &&
data.lfPitchAndFamily is lf.lfPitchAndFamily &&
getName() ==/*eq*/ fd.getName();
}
return false;
}
extern (Windows) static int EnumLocalesProc(TCHAR* lpLocaleString) {
/* Get the locale ID */
int length_ = 8;
String str = .TCHARzToStr( cast(TCHAR*)lpLocaleString, length_);
int lcid = Integer.parseInt(str, 16);
TCHAR[] buffer = new TCHAR[length_];
/* Check the language */
int size = OS.GetLocaleInfo(lcid, OS.LOCALE_SISO639LANGNAME, buffer.ptr, length_);
if (size <= 0 || s_this.lang !=/*eq*/ .TCHARzToStr( buffer.ptr ).substring(0, size - 1)) return 1;
/* Check the country */
if (s_this.country !is null) {
size = OS.GetLocaleInfo(lcid, OS.LOCALE_SISO3166CTRYNAME, buffer.ptr, length_);
if (size <= 0 || s_this.country !=/*eq*/ .TCHARzToStr( buffer.ptr ).substring(0, size - 1)) return 1;
}
/* Get the charset */
size = OS.GetLocaleInfo(lcid, OS.LOCALE_IDEFAULTANSICODEPAGE, buffer.ptr, length_);
if (size <= 0) return 1;
int cp = Integer.parseInt(.TCHARzToStr(buffer.ptr).substring(0, size - 1));
CHARSETINFO lpCs;
OS.TranslateCharsetInfo(cast(DWORD*)cp, &lpCs, OS.TCI_SRCCODEPAGE);
s_this.data.lfCharSet = cast(BYTE)lpCs.ciCharset;
return 0;
}
/**
* Returns the height of the receiver in points.
*
* @return the height of this FontData
*
* @see #setHeight(int)
*/
public int getHeight() {
return cast(int)(0.5f + height);
}
/*public*/ float getHeightF() {
return height;
}
/**
* Returns the locale of the receiver.
* <p>
* The locale determines which platform character set this
* font is going to use. Widgets and graphics operations that
* use this font will convert UNICODE strings to the platform
* character set of the specified locale.
* </p>
* <p>
* On platforms where there are multiple character sets for a
* given language/country locale, the variant portion of the
* locale will determine the character set.
* </p>
*
* @return the <code>String</code> representing a Locale object
* @since 3.0
*/
public String getLocale () {
StringBuffer buffer = new StringBuffer ();
char sep = '_';
if (lang !is null) {
buffer.append (lang);
buffer.append (sep);
}
if (country !is null) {
buffer.append (country);
buffer.append (sep);
}
if (variant !is null) {
buffer.append (variant);
}
String result = buffer.toString ();
int length_ = result.length;
if (length_ > 0) {
if (result.charAt (length_ - 1) is sep) {
result = result.substring (0, length_ - 1);
}
}
return result;
}
/**
* Returns the name of the receiver.
* On platforms that support font foundries, the return value will
* be the foundry followed by a dash ("-") followed by the face name.
*
* @return the name of this <code>FontData</code>
*
* @see #setName
*/
public String getName() {
return .TCHARzToStr( data.lfFaceName.ptr, -1 );
}
/**
* Returns the style of the receiver which is a bitwise OR of
* one or more of the <code>SWT</code> constants NORMAL, BOLD
* and ITALIC.
*
* @return the style of this <code>FontData</code>
*
* @see #setStyle
*/
public int getStyle() {
int style = SWT.NORMAL;
if (data.lfWeight is 700) style |= SWT.BOLD;
if (data.lfItalic !is 0) style |= SWT.ITALIC;
return style;
}
/**
* Returns an integer hash code for the receiver. Any two
* objects that return <code>true</code> when passed to
* <code>equals</code> must return the same value for this
* method.
*
* @return the receiver's hash
*
* @see #equals
*/
override public hash_t toHash () {
hash_t nameHash = 0;
for( size_t i = 0;
'\0' != data.lfFaceName[i] && i < data.lfFaceName.length;
i++ ){
nameHash = nameHash * 31 + data.lfFaceName[i];
}
int height = cast(int)(0.5f + height);
return data.lfCharSet ^ height ^ data.lfWidth ^ data.lfEscapement ^
data.lfOrientation ^ data.lfWeight ^ data.lfItalic ^data.lfUnderline ^
data.lfStrikeOut ^ data.lfCharSet ^ data.lfOutPrecision ^
data.lfClipPrecision ^ data.lfQuality ^ data.lfPitchAndFamily ^
nameHash;
}
/**
* Sets the height of the receiver. The parameter is
* specified in terms of points, where a point is one
* seventy-second of an inch.
*
* @param height the height of the <code>FontData</code>
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
* </ul>
*
* @see #getHeight
*/
public void setHeight(int height) {
if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
this.height = height;
}
/*public*/ void setHeight(float height) {
if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
this.height = height;
}
/**
* Sets the locale of the receiver.
* <p>
* The locale determines which platform character set this
* font is going to use. Widgets and graphics operations that
* use this font will convert UNICODE strings to the platform
* character set of the specified locale.
* </p>
* <p>
* On platforms where there are multiple character sets for a
* given language/country locale, the variant portion of the
* locale will determine the character set.
* </p>
*
* @param locale the <code>String</code> representing a Locale object
* @see java.util.Locale#toString
*/
public void setLocale(String locale) {
lang = country = variant = null;
if (locale !is null) {
char sep = '_';
int length_ = locale.length;
int firstSep, secondSep;
firstSep = locale.indexOf(sep);
if (firstSep is -1) {
firstSep = secondSep = length_;
} else {
secondSep = locale.indexOf(sep, firstSep + 1);
if (secondSep is -1) secondSep = length_;
}
if (firstSep > 0) lang = locale.substring(0, firstSep);
if (secondSep > firstSep + 1) country = locale.substring(firstSep + 1, secondSep);
if (length_ > secondSep + 1) variant = locale.substring(secondSep + 1);
}
if (lang is null) {
data.lfCharSet = cast(byte)OS.DEFAULT_CHARSET;
} else {
synchronized(this.classinfo){
s_this = this;
OS.EnumSystemLocales(&EnumLocalesProc, OS.LCID_SUPPORTED);
s_this = null;
}
}
}
/**
* Sets the name of the receiver.
* <p>
* Some platforms support font foundries. On these platforms, the name
* of the font specified in setName() may have one of the following forms:
* <ol>
* <li>a face name (for example, "courier")</li>
* <li>a foundry followed by a dash ("-") followed by a face name (for example, "adobe-courier")</li>
* </ol>
* In either case, the name returned from getName() will include the
* foundry.
* </p>
* <p>
* On platforms that do not support font foundries, only the face name
* (for example, "courier") is used in <code>setName()</code> and
* <code>getName()</code>.
* </p>
*
* @param name the name of the font data (must not be null)
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
* </ul>
*
* @see #getName
*/
public void setName(String name) {
if (name is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
/* The field lfFaceName must be NULL terminated */
auto wname = StrToTCHARs(name);
int len = Math.min(OS.LF_FACESIZE - 1, wname.length);
data.lfFaceName[0 .. len] = wname[ 0 .. len ];
data.lfFaceName[len .. $] = 0;
}
/**
* Sets the style of the receiver to the argument which must
* be a bitwise OR of one or more of the <code>SWT</code>
* constants NORMAL, BOLD and ITALIC. All other style bits are
* ignored.
*
* @param style the new style for this <code>FontData</code>
*
* @see #getStyle
*/
public void setStyle(int style) {
if ((style & SWT.BOLD) is SWT.BOLD) {
data.lfWeight = 700;
} else {
data.lfWeight = 0;
}
if ((style & SWT.ITALIC) is SWT.ITALIC) {
data.lfItalic = 1;
} else {
data.lfItalic = 0;
}
}
/**
* Returns a string representation of the receiver which is suitable
* for constructing an equivalent instance using the
* <code>FontData(String)</code> constructor.
*
* @return a string representation of the FontData
*
* @see FontData
*/
override public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("1|"); //$NON-NLS-1$
buffer.append(getName());
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(getHeightF()));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(getStyle()));
buffer.append("|"); //$NON-NLS-1$
buffer.append("WINDOWS|1|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfHeight));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfWidth));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfEscapement));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfOrientation));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfWeight));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfItalic));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfUnderline));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfStrikeOut));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfCharSet));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfOutPrecision));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfClipPrecision));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfQuality));
buffer.append("|"); //$NON-NLS-1$
buffer.append(String_valueOf(data.lfPitchAndFamily));
buffer.append("|"); //$NON-NLS-1$
buffer.append(getName());
return buffer.toString();
}
/**
* Invokes platform specific functionality to allocate a new font data.
* <p>
* <b>IMPORTANT:</b> This method is <em>not</em> part of the public
* API for <code>FontData</code>. It is marked public only so that
* it can be shared within the packages provided by SWT. It is not
* available on all platforms, and should never be called from
* application code.
* </p>
*
* @param data the <code>LOGFONT</code> for the font data
* @param height the height of the font data
* @return a new font data object containing the specified <code>LOGFONT</code> and height
*/
public static FontData win32_new(LOGFONT* data, float height) {
return new FontData(data, height);
}
}
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;
void main()
{
auto N = readln.chomp.to!int;
int[] abc;
int s;
foreach (_; 0..3) {
auto n = readln.chomp.to!int;
abc ~= n;
s += n;
}
sort(abc);
auto r = N/s * 3;
auto d = N%s;
foreach_reverse (n; abc) if (d > 0) {
++r;
d -= n;
}
writeln(r);
}
|
D
|
/Users/natasilva/repositories/algoritmos/atividade-4/target/rls/debug/deps/atividade_4-b3ace51b6fb907f4.rmeta: src/main.rs
/Users/natasilva/repositories/algoritmos/atividade-4/target/rls/debug/deps/atividade_4-b3ace51b6fb907f4.d: src/main.rs
src/main.rs:
|
D
|
module dbi.connect;
//Предполагается последующее создание общего модуля Dinrus.DBI.dll
import dbi.sqlite.all;
import dbi.odbc.all;
import dbi.msql.all;
//import dbi.mssql.all;
import dbi.mysql.all;
import dbi.pg.all;
enum ПТипБД
{
Sqlite,
ODBC,
MySQL,
Pg,
MSQL,
//MSSQL
}
class ПодключениеКБазеДанных
{
private:
БДЭскюлайт лайт;
ПгБД пг;
ОдбцБД одбц;
МайЭсКюЭлБД май;
//ЭмЭсЭсКюЭлБД мс;
ЭмЭсКюЭлБД м;
ПТипБД типБд;
public:
this (ПТипБД тип)
{
switch(тип)
{
case ПТипБД.Sqlite:
this.лайт = new БДЭскюлайт();
this.типБд = ПТипБД.Sqlite;
//Здесь реально должно появляться окно запроса параметров подключения
//и вторым шагом - проводиться подключение!))
break;
case ПТипБД.ODBC:
this.одбц = new ОдбцБД();
this.типБд = ПТипБД.ODBC;
//То же (Нереализовано)
break;
case ПТипБД.MySQL:
this.май = new МайЭсКюЭлБД();
this.типБд = ПТипБД.MySQL;
//То же (Нереализовано)
break;
case ПТипБД.Pg:
this.пг = new ПгБД();
this.типБд = ПТипБД.Pg;
//То же (Нереализовано)
break;
case ПТипБД.MSQL:
this.м = new ЭмЭсКюЭлБД();
this.типБд = ПТипБД.MSQL;
//То же (Нереализовано)
break;
/*
case ПТипБД.MSSQL:
this.мс =new ЭмЭсЭсКюЭлБД();
this.типБд = ПТипБД.MSSQL;
//То же (Нереализовано)
break;
*/
default:
}
}
проц подключи(ткст параметры, ткст имя_пользователя = пусто, ткст пароль = пусто)
{
switch(this.типБд)
{
case ПТипБД.Sqlite:
this.лайт.подключись(параметры, имя_пользователя, пароль);
break;
case ПТипБД.ODBC:
this.одбц.подключись(параметры, имя_пользователя, пароль);
break;
case ПТипБД.MySQL:
this.май.подключись (параметры, имя_пользователя, пароль, пусто, пусто);
break;
case ПТипБД.Pg:
this.пг.подключись(параметры, имя_пользователя, пароль);
break;
case ПТипБД.MSQL:
this.м.подключись(параметры, имя_пользователя, пароль);
break;
/*
case ПТипБД.MSSQL:
this.мс.подключись(параметры, имя_пользователя, пароль);
break;
*/
default:
}
}
проц выполни(ткст эскюэл)
{
switch(this.типБд)
{
case ПТипБД.Sqlite:
this.лайт.выполни(эскюэл);
break;
case ПТипБД.ODBC:
this.одбц.выполни(эскюэл);
break;
case ПТипБД.MySQL:
this.май.выполни (эскюэл);
break;
case ПТипБД.Pg:
this.пг.выполни(эскюэл);
break;
case ПТипБД.MSQL:
this.м.выполни(эскюэл);
break;
/*
case ПТипБД.MSSQL:
this.мс.подключись(параметры, имя_пользователя, пароль);
break;
*/
default:
}
проц закрой()
{
switch(this.типБд)
{
case ПТипБД.Sqlite:
this.лайт.закрой();
break;
case ПТипБД.ODBC:
this.одбц.закрой();
break;
case ПТипБД.MySQL:
this.май.закрой ();
break;
case ПТипБД.Pg:
this.пг.закрой();
break;
case ПТипБД.MSQL:
this.м.закрой();
break;
/*
case ПТипБД.MSSQL:
this.мс.подключись(параметры, имя_пользователя, пароль);
break;
*/
default:
}
}
}
}
|
D
|
module hunt.http.client.Http2ClientResponseHandler;
import hunt.http.client.ClientHttpHandler;
import hunt.http.client.HttpClientConnection;
import hunt.http.codec.http.frame;
import hunt.http.codec.http.model.HttpStatus;
import hunt.http.codec.http.model.MetaData;
import hunt.http.codec.http.stream.AbstractHttp2OutputStream;
import hunt.http.codec.http.stream.DataFrameHandler;
import hunt.http.codec.http.stream.HttpOutputStream;
import hunt.http.codec.http.stream.Stream;
import hunt.collection.LinkedList;
import hunt.logging;
import hunt.util.Common;
import hunt.Exceptions;
import hunt.util.Common;
import hunt.concurrency.Promise;
import std.conv;
import std.string;
class Http2ClientResponseHandler : Stream.Listener.Adapter { // , Runnable
enum string OUTPUT_STREAM_KEY = "_outputStream";
enum string RESPONSE_KEY = "_response";
enum string RUN_TASK = "_runTask";
private HttpRequest request;
private ClientHttpHandler handler;
private HttpClientConnection connection;
private LinkedList!(ReceivedFrame) receivedFrames; // = new LinkedList!()();
this(HttpRequest request, ClientHttpHandler handler, HttpClientConnection connection) {
this.request = request;
this.handler = handler;
this.connection = connection;
receivedFrames = new LinkedList!(ReceivedFrame)();
}
override
void onHeaders(Stream stream, HeadersFrame headersFrame) {
// Wait the stream is created.
receivedFrames.add(new ReceivedFrame(stream, headersFrame, Callback.NOOP));
onFrames(stream);
}
override
void onData(Stream stream, DataFrame dataFrame, Callback callback) {
receivedFrames.add(new ReceivedFrame(stream, dataFrame, callback));
onFrames(stream);
}
// override
void run() {
ReceivedFrame receivedFrame;
while ((receivedFrame = receivedFrames.poll()) !is null) {
onReceivedFrame(receivedFrame);
}
}
private void onFrames(Stream stream) {
HttpOutputStream output = getOutputStream(stream);
if (output !is null) { // the stream is created completely
run();
} else {
stream.setAttribute(RUN_TASK, this);
}
}
private void onReceivedFrame(ReceivedFrame receivedFrame) {
Stream stream = receivedFrame.getStream();
HttpOutputStream output = getOutputStream(stream);
switch (receivedFrame.getFrame().getType()) {
case FrameType.HEADERS: {
HeadersFrame headersFrame = cast(HeadersFrame) receivedFrame.getFrame();
if (headersFrame.getMetaData() is null) {
throw new IllegalArgumentException("the stream " ~ stream.getId().to!string() ~ " received a null meta data");
}
if (headersFrame.getMetaData().isResponse()) {
HttpResponse response = cast(HttpResponse) headersFrame.getMetaData();
if (response.getStatus() == HttpStatus.CONTINUE_100) {
handler.continueToSendData(request, response, output, connection);
} else {
stream.setAttribute(RESPONSE_KEY, response);
handler.headerComplete(request, response, output, connection);
if (headersFrame.isEndStream()) {
handler.messageComplete(request, response, output, connection);
}
}
} else {
if (headersFrame.isEndStream()) {
HttpResponse response = getResponse(stream);
response.setTrailerSupplier(() => headersFrame.getMetaData().getFields());
handler.contentComplete(request, response, output, connection);
handler.messageComplete(request, response, output, connection);
} else {
throw new IllegalArgumentException("the stream " ~ stream.getId().to!string() ~ " received illegal meta data");
}
}
}
break;
case FrameType.DATA: {
DataFrame dataFrame = cast(DataFrame) receivedFrame.getFrame();
Callback callback = receivedFrame.getCallback();
HttpResponse response = getResponse(stream);
DataFrameHandler.handleDataFrame(dataFrame, callback, request, response, output, connection, handler);
}
break;
default: break;
}
}
override
void onReset(Stream stream, ResetFrame frame) {
// writeln("Client received reset frame: " ~ stream ~ ", " ~ frame);
HttpOutputStream output = getOutputStream(stream);
HttpResponse response = getResponse(stream);
int errorCode = frame.getError();
string reason = isValidErrorCode(errorCode) ? (cast(ErrorCode)errorCode).to!string().toLower() : "error=" ~ errorCode.to!string();
int status = HttpStatus.INTERNAL_SERVER_ERROR_500;
if(errorCode == ErrorCode.PROTOCOL_ERROR)
status = HttpStatus.BAD_REQUEST_400;
// if (isValidErrorCode(errorCode)) {
// switch (errorCode) {
// case ErrorCode.PROTOCOL_ERROR:
// status = HttpStatus.BAD_REQUEST_400;
// break;
// default:
// status = HttpStatus.INTERNAL_SERVER_ERROR_500;
// break;
// }
// }
handler.badMessage(status, reason, request, response, output, connection);
}
private HttpOutputStream getOutputStream(Stream stream) {
return cast(HttpOutputStream) stream.getAttribute(OUTPUT_STREAM_KEY);
}
private HttpResponse getResponse(Stream stream) {
return cast(HttpResponse) stream.getAttribute(RESPONSE_KEY);
}
static class ReceivedFrame {
private Stream stream;
private Frame frame;
private Callback callback;
this(Stream stream, Frame frame, Callback callback) {
this.stream = stream;
this.frame = frame;
this.callback = callback;
}
Stream getStream() {
return stream;
}
Frame getFrame() {
return frame;
}
Callback getCallback() {
return callback;
}
}
static class ClientHttp2OutputStream : AbstractHttp2OutputStream {
private Stream stream;
this(MetaData info, Stream stream) {
super(info, true);
committed = true;
this.stream = stream;
}
override
protected Stream getStream() {
return stream;
}
}
static class ClientStreamPromise : Promise!(Stream) {
private HttpRequest request;
private Promise!(HttpOutputStream) promise;
this(HttpRequest request, Promise!(HttpOutputStream) promise) {
this.request = request;
this.promise = promise;
}
void succeeded(Stream stream) {
version(HUNT_DEBUG) {
tracef("create a new stream %s", stream.getId());
}
ClientHttp2OutputStream output = new ClientHttp2OutputStream(request, stream);
stream.setAttribute(OUTPUT_STREAM_KEY, output);
Runnable r = cast(Runnable) stream.getAttribute(RUN_TASK);
if(r !is null)
r.run();
// Optional.ofNullable(cast(Runnable) stream.getAttribute(RUN_TASK))
// .ifPresent(Runnable::run);
promise.succeeded(output);
}
void failed(Exception x) {
promise.failed(x);
errorf("client creates stream unsuccessfully", x);
}
string id() { return "undefined"; }
}
}
|
D
|
/Users/student/VGLogger/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ServerTrustPolicy.o : /Users/student/VGLogger/Pods/Alamofire/Source/MultipartFormData.swift /Users/student/VGLogger/Pods/Alamofire/Source/Timeline.swift /Users/student/VGLogger/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/student/VGLogger/Pods/Alamofire/Source/Alamofire.swift /Users/student/VGLogger/Pods/Alamofire/Source/Response.swift /Users/student/VGLogger/Pods/Alamofire/Source/TaskDelegate.swift /Users/student/VGLogger/Pods/Alamofire/Source/SessionDelegate.swift /Users/student/VGLogger/Pods/Alamofire/Source/ParameterEncoding.swift /Users/student/VGLogger/Pods/Alamofire/Source/Validation.swift /Users/student/VGLogger/Pods/Alamofire/Source/ResponseSerialization.swift /Users/student/VGLogger/Pods/Alamofire/Source/SessionManager.swift /Users/student/VGLogger/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/student/VGLogger/Pods/Alamofire/Source/AFError.swift /Users/student/VGLogger/Pods/Alamofire/Source/Notifications.swift /Users/student/VGLogger/Pods/Alamofire/Source/Result.swift /Users/student/VGLogger/Pods/Alamofire/Source/Request.swift /Users/student/VGLogger/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/student/VGLogger/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/student/VGLogger/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/student/VGLogger/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ServerTrustPolicy~partial.swiftmodule : /Users/student/VGLogger/Pods/Alamofire/Source/MultipartFormData.swift /Users/student/VGLogger/Pods/Alamofire/Source/Timeline.swift /Users/student/VGLogger/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/student/VGLogger/Pods/Alamofire/Source/Alamofire.swift /Users/student/VGLogger/Pods/Alamofire/Source/Response.swift /Users/student/VGLogger/Pods/Alamofire/Source/TaskDelegate.swift /Users/student/VGLogger/Pods/Alamofire/Source/SessionDelegate.swift /Users/student/VGLogger/Pods/Alamofire/Source/ParameterEncoding.swift /Users/student/VGLogger/Pods/Alamofire/Source/Validation.swift /Users/student/VGLogger/Pods/Alamofire/Source/ResponseSerialization.swift /Users/student/VGLogger/Pods/Alamofire/Source/SessionManager.swift /Users/student/VGLogger/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/student/VGLogger/Pods/Alamofire/Source/AFError.swift /Users/student/VGLogger/Pods/Alamofire/Source/Notifications.swift /Users/student/VGLogger/Pods/Alamofire/Source/Result.swift /Users/student/VGLogger/Pods/Alamofire/Source/Request.swift /Users/student/VGLogger/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/student/VGLogger/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/student/VGLogger/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/student/VGLogger/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ServerTrustPolicy~partial.swiftdoc : /Users/student/VGLogger/Pods/Alamofire/Source/MultipartFormData.swift /Users/student/VGLogger/Pods/Alamofire/Source/Timeline.swift /Users/student/VGLogger/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/student/VGLogger/Pods/Alamofire/Source/Alamofire.swift /Users/student/VGLogger/Pods/Alamofire/Source/Response.swift /Users/student/VGLogger/Pods/Alamofire/Source/TaskDelegate.swift /Users/student/VGLogger/Pods/Alamofire/Source/SessionDelegate.swift /Users/student/VGLogger/Pods/Alamofire/Source/ParameterEncoding.swift /Users/student/VGLogger/Pods/Alamofire/Source/Validation.swift /Users/student/VGLogger/Pods/Alamofire/Source/ResponseSerialization.swift /Users/student/VGLogger/Pods/Alamofire/Source/SessionManager.swift /Users/student/VGLogger/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/student/VGLogger/Pods/Alamofire/Source/AFError.swift /Users/student/VGLogger/Pods/Alamofire/Source/Notifications.swift /Users/student/VGLogger/Pods/Alamofire/Source/Result.swift /Users/student/VGLogger/Pods/Alamofire/Source/Request.swift /Users/student/VGLogger/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/student/VGLogger/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/student/VGLogger/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
module battle.ai.all;
public import battle.ai.profile;
public import battle.ai.decision;
public import battle.ai.player;
public import battle.ai.goal;
public import battle.ai.helpers;
|
D
|
a person who chooses or selects out
a switch that is used to select among alternatives
|
D
|
/Users/spadakao/Documents/ios/hw2Test/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/Mappable.o : /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/CustomDateFormatTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/DateFormatterTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/DateTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/EnumTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/FromJSON.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/ISO8601DateTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Map.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Mappable.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Mapper.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Operators.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/ToJSON.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/TransformOf.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/TransformType.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/URLTransform.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/spadakao/Documents/ios/hw2Test/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/spadakao/Documents/ios/hw2Test/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/spadakao/Documents/ios/hw2Test/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/Mappable~partial.swiftmodule : /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/CustomDateFormatTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/DateFormatterTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/DateTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/EnumTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/FromJSON.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/ISO8601DateTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Map.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Mappable.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Mapper.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Operators.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/ToJSON.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/TransformOf.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/TransformType.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/URLTransform.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/spadakao/Documents/ios/hw2Test/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/spadakao/Documents/ios/hw2Test/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/spadakao/Documents/ios/hw2Test/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/Mappable~partial.swiftdoc : /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/CustomDateFormatTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/DateFormatterTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/DateTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/EnumTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/FromJSON.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/ISO8601DateTransform.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Map.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Mappable.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Mapper.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/Operators.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Core/ToJSON.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/TransformOf.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/TransformType.swift /Users/spadakao/Documents/ios/hw2Test/Pods/ObjectMapper/ObjectMapper/Transforms/URLTransform.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/spadakao/Documents/ios/hw2Test/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/spadakao/Documents/ios/hw2Test/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
|
D
|
/**************************************************************************
ИСЧЕЗНОВЕНИЕ ПРИЗРАКА
Призраки исчезают, если больше не нужны.
Вызывается в ZS_Ghost.
***************************************************************************/
var int B_RemoveBerny_Once;
// удаление призрака
func void B_RemoveGhost() //испр. - int на void
{
if(C_NpcIs(self,OUT_1214_OldBerny) && !B_RemoveBerny_Once)
{
AI_Teleport(OUT_1214_OldBerny,"TOT");
B_RemoveNpc(OUT_1214_OldBerny);
Snd_Play("MFX_GhostVoice");
Snd_Play("MFX_Firestorm_Cast");
B_RemoveBerny_Once = TRUE;
};
};
|
D
|
//#############################################
//##
//## Neue Welt
//##
//############################################
instance None_101_Mario (Npc_Default)
{
// ------ NSC ------
name = "Mario";
guild = GIL_NONE;
id = 101;
voice = 7;
flags = NPC_FLAG_IMMORTAL; //Joly: NPC_FLAG_IMMORTAL sonst Plottkiller Kapitel 5 //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 6); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_MASTER;
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_2h_SLD_SWORD);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_FatBald", Face_B_Normal_Kirgo, BodyTex_B, ITAR_MIL_M);
Mdl_SetModelFatness (self, 1.2);
Mdl_ApplyOverlayMds (self, "Humans_MILITIA.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 85); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ TA anmelden ------
daily_routine = Rtn_Start_101;
};
FUNC VOID Rtn_Start_101 ()
{
TA_Stand_Drinking (08,00,21,00,"NW_CITY_HABOUR_TAVERN01_STAND_01");
TA_Stand_Drinking (21,00,08,00,"NW_CITY_HABOUR_TAVERN01_STAND_01");
};
FUNC VOID Rtn_WaitForShip_101 ()
{
TA_Stand_Drinking (08,00,19,00,"NW_WAITFOR_SHIP_01");
TA_Stand_Drinking (19,00,08,00,"NW_WAITFOR_SHIP_01");
};
FUNC VOID Rtn_ShipOff_101 ()
{
TA_Stand_Drinking (08,00,21,00,"NW_CITY_HABOUR_TAVERN01_STAND_01");
TA_Stand_Drinking (21,00,08,00,"NW_CITY_HABOUR_TAVERN01_STAND_01");
};
FUNC VOID Rtn_Ship_101 ()
{
TA_Sit_Bench (08,00,23,00,"SHIP_DECK_25");
TA_Sit_Bench (23,00,08,00,"SHIP_DECK_25");
};
|
D
|
.hd out "specify default alternative in a case statement" 02/22/82
case <value>
when <alternative1>
{ <command> }
when <alternative2>
{ <command> }
...
out
{ <command> }
.br
esac
.ds
'Out' is used to flag the default alternative in a 'case' command sequence.
It should appear after any command sequences introduced by 'when'
commands, and will be selected by the 'case'
command if and only if none of the alternatives specified by 'when'
commands are taken.
.sp
'Out' is usually executed only if control falls through from the
commands under the control of a 'when'.
In this instance, commands are skipped until an unmatched 'esac'
command is found.
.sp
Use of 'out' from a terminal may cause input to be ignored until
end-of-file or the typing of an 'esac' command.
.es
case [line]
when 12
set location = REMOTE
out
set location = LOCAL
esac
.me
.in +5
.ti -5
"Missing 'esac'" if end-of-file is encountered before an 'esac' command.
.br
.in -5
.bu
'Out' is a holdover from the ALGOL 68 case-clause syntax.
.sa
case (1), when (1), esac (1), if (1),
.ul
User's Guide for the Software Tools Subsystem Command Interpreter
|
D
|
/**
Defines the behavior of the DUB command line client.
Copyright: © 2012-2013 Matthias Dondorff, Copyright © 2012-2016 Sönke Ludwig
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Matthias Dondorff, Sönke Ludwig
*/
module dub.commandline;
import dub.compilers.compiler;
import dub.dependency;
import dub.dub;
import dub.generators.generator;
import dub.internal.vibecompat.core.file;
import dub.internal.vibecompat.core.log;
import dub.internal.vibecompat.data.json;
import dub.internal.vibecompat.inet.url;
import dub.package_;
import dub.packagemanager;
import dub.packagesupplier;
import dub.platform : determineCompiler;
import dub.project;
import dub.internal.utils : getDUBVersion, getClosestMatch;
import std.algorithm;
import std.array;
import std.conv;
import std.encoding;
import std.exception;
import std.file;
import std.getopt;
import std.process;
import std.stdio;
import std.string;
import std.typecons : Tuple, tuple;
import std.variant;
/** Retrieves a list of all available commands.
Commands are grouped by category.
*/
CommandGroup[] getCommands()
{
return [
CommandGroup("Package creation",
new InitCommand
),
CommandGroup("Build, test and run",
new RunCommand,
new BuildCommand,
new TestCommand,
new GenerateCommand,
new DescribeCommand,
new CleanCommand,
new DustmiteCommand
),
CommandGroup("Package management",
new FetchCommand,
new InstallCommand,
new RemoveCommand,
new UninstallCommand,
new UpgradeCommand,
new AddPathCommand,
new RemovePathCommand,
new AddLocalCommand,
new RemoveLocalCommand,
new ListCommand,
new SearchCommand,
new ListInstalledCommand,
new AddOverrideCommand,
new RemoveOverrideCommand,
new ListOverridesCommand,
new CleanCachesCommand,
new ConvertCommand,
)
];
}
/** Processes the given command line and executes the appropriate actions.
Params:
args = This command line argument array as received in `main`. The first
entry is considered to be the name of the binary invoked.
Returns:
Returns the exit code that is supposed to be returned to the system.
*/
int runDubCommandLine(string[] args)
{
logDiagnostic("DUB version %s", getDUBVersion());
version(Windows){
// rdmd uses $TEMP to compute a temporary path. since cygwin substitutes backslashes
// with slashes, this causes OPTLINK to fail (it thinks path segments are options)
// we substitute the other way around here to fix this.
environment["TEMP"] = environment["TEMP"].replace("/", "\\");
}
// special single-file package shebang syntax
if (args.length >= 2 && args[1].endsWith(".d")) {
args = args[0] ~ ["run", "-q", "--temp-build", "--single", args[1], "--"] ~ args[2 ..$];
}
// split application arguments from DUB arguments
string[] app_args;
auto app_args_idx = args.countUntil("--");
if (app_args_idx >= 0) {
app_args = args[app_args_idx+1 .. $];
args = args[0 .. app_args_idx];
}
args = args[1 .. $]; // strip the application name
// handle direct dub options
if (args.length) switch (args[0])
{
case "--version":
showVersion();
return 0;
default:
break;
}
// parse general options
CommonOptions options;
LogLevel loglevel = LogLevel.info;
options.root_path = getcwd();
auto common_args = new CommandArgs(args);
try {
options.prepare(common_args);
if (options.vverbose) loglevel = LogLevel.debug_;
else if (options.verbose) loglevel = LogLevel.diagnostic;
else if (options.vquiet) loglevel = LogLevel.none;
else if (options.quiet) loglevel = LogLevel.warn;
setLogLevel(loglevel);
} catch (Throwable e) {
logError("Error processing arguments: %s", e.msg);
logDiagnostic("Full exception: %s", e.toString().sanitize);
logInfo("Run 'dub help' for usage information.");
return 1;
}
// create the list of all supported commands
CommandGroup[] commands = getCommands();
// extract the command
string cmdname;
args = common_args.extractRemainingArgs();
if (args.length >= 1 && !args[0].startsWith("-")) {
cmdname = args[0];
args = args[1 .. $];
} else {
if (options.help) {
showHelp(commands, common_args);
return 0;
}
cmdname = "run";
}
auto command_args = new CommandArgs(args);
if (cmdname == "help") {
showHelp(commands, common_args);
return 0;
}
// find the selected command
Command cmd;
foreach (grp; commands)
foreach (c; grp.commands)
if (c.name == cmdname) {
cmd = c;
break;
}
if (!cmd) {
logError("Unknown command: %s", cmdname);
writeln();
showHelp(commands, common_args);
return 1;
}
// process command line options for the selected command
try {
cmd.prepare(command_args);
enforceUsage(cmd.acceptsAppArgs || app_args.length == 0, cmd.name ~ " doesn't accept application arguments.");
} catch (Throwable e) {
logError("Error processing arguments: %s", e.msg);
logDiagnostic("Full exception: %s", e.toString().sanitize);
logInfo("Run 'dub help' for usage information.");
return 1;
}
if (options.help) {
showCommandHelp(cmd, command_args, common_args);
return 0;
}
auto remaining_args = command_args.extractRemainingArgs();
if (remaining_args.any!(a => a.startsWith("-"))) {
logError("Unknown command line flags: %s", remaining_args.filter!(a => a.startsWith("-")).array.join(" "));
logError(`Type "dub %s -h" to get a list of all supported flags.`, cmdname);
return 1;
}
Dub dub;
// initialize the root package
if (!cmd.skipDubInitialization) {
if (options.bare) {
dub = new Dub(Path(getcwd()));
dub.defaultPlacementLocation = options.placementLocation;
} else {
// initialize DUB
auto package_suppliers = options.registry_urls.map!(url => cast(PackageSupplier)new RegistryPackageSupplier(URL(url))).array;
dub = new Dub(options.root_path, package_suppliers, options.skipRegistry);
dub.dryRun = options.annotate;
dub.defaultPlacementLocation = options.placementLocation;
// make the CWD package available so that for example sub packages can reference their
// parent package.
try dub.packageManager.getOrLoadPackage(Path(options.root_path));
catch (Exception e) { logDiagnostic("No package found in current working directory."); }
}
}
// execute the command
try return cmd.execute(dub, remaining_args, app_args);
catch (UsageException e) {
logError("%s", e.msg);
logDebug("Full exception: %s", e.toString().sanitize);
logInfo(`Run "dub %s -h" for more information about the "%s" command.`, cmdname, cmdname);
return 1;
}
catch (Throwable e) {
logError("%s", e.msg);
logDebug("Full exception: %s", e.toString().sanitize);
return 2;
}
}
/** Contains and parses options common to all commands.
*/
struct CommonOptions {
bool verbose, vverbose, quiet, vquiet;
bool help, annotate, bare;
string[] registry_urls;
string root_path;
SkipPackageSuppliers skipRegistry = SkipPackageSuppliers.none;
PlacementLocation placementLocation = PlacementLocation.user;
/// Parses all common options and stores the result in the struct instance.
void prepare(CommandArgs args)
{
args.getopt("h|help", &help, ["Display general or command specific help"]);
args.getopt("root", &root_path, ["Path to operate in instead of the current working dir"]);
args.getopt("registry", ®istry_urls, ["Search the given DUB registry URL first when resolving dependencies. Can be specified multiple times."]);
args.getopt("skip-registry", &skipRegistry, [
"Skips searching certain package registries for dependencies:",
" none: Search all configured registries (default)",
" standard: Don't search on "~defaultRegistryURL,
" all: Search none of the configured registries",
]);
args.getopt("annotate", &annotate, ["Do not perform any action, just print what would be done"]);
args.getopt("bare", &bare, ["Read only packages contained in the current directory"]);
args.getopt("v|verbose", &verbose, ["Print diagnostic output"]);
args.getopt("vverbose", &vverbose, ["Print debug output"]);
args.getopt("q|quiet", &quiet, ["Only print warnings and errors"]);
args.getopt("vquiet", &vquiet, ["Print no messages"]);
args.getopt("cache", &placementLocation, ["Puts any fetched packages in the specified location [local|system|user]."]);
}
}
/** Encapsulates a set of application arguments.
This class serves two purposes. The first is to provide an API for parsing
command line arguments (`getopt`). At the same time it records all calls
to `getopt` and provides a list of all possible options using the
`recognizedArgs` property.
*/
class CommandArgs {
struct Arg {
Variant defaultValue;
Variant value;
string names;
string[] helpText;
}
private {
string[] m_args;
Arg[] m_recognizedArgs;
}
/** Initializes the list of source arguments.
Note that all array entries are considered application arguments (i.e.
no application name entry is present as the first entry)
*/
this(string[] args)
{
m_args = "dummy" ~ args;
}
/** Returns the list of all options recognized.
This list is created by recording all calls to `getopt`.
*/
@property const(Arg)[] recognizedArgs() { return m_recognizedArgs; }
void getopt(T)(string names, T* var, string[] help_text = null)
{
foreach (ref arg; m_recognizedArgs)
if (names == arg.names) {
assert(help_text is null);
*var = arg.value.get!T;
return;
}
assert(help_text.length > 0);
Arg arg;
arg.defaultValue = *var;
arg.names = names;
arg.helpText = help_text;
m_args.getopt(config.passThrough, names, var);
arg.value = *var;
m_recognizedArgs ~= arg;
}
/** Resets the list of available source arguments.
*/
void dropAllArgs()
{
m_args = null;
}
/** Returns the list of unprocessed arguments and calls `dropAllArgs`.
*/
string[] extractRemainingArgs()
{
auto ret = m_args[1 .. $];
m_args = null;
return ret;
}
}
/** Base class for all commands.
This cass contains a high-level description of the command, including brief
and full descriptions and a human readable command line pattern. On top of
that it defines the two main entry functions for command execution.
*/
class Command {
string name;
string argumentsPattern;
string description;
string[] helpText;
bool acceptsAppArgs;
bool hidden = false; // used for deprecated commands
bool skipDubInitialization = false;
/** Parses all known command line options without executing any actions.
This function will be called prior to execute, or may be called as
the only method when collecting the list of recognized command line
options.
Only `args.getopt` should be called within this method.
*/
abstract void prepare(scope CommandArgs args);
/** Executes the actual action.
Note that `prepare` will be called before any call to `execute`.
*/
abstract int execute(Dub dub, string[] free_args, string[] app_args);
private bool loadCwdPackage(Dub dub, bool warn_missing_package)
{
bool found = existsFile(dub.rootPath ~ "source/app.d");
if (!found)
foreach (f; packageInfoFiles)
if (existsFile(dub.rootPath ~ f.filename)) {
found = true;
break;
}
if (!found) {
if (warn_missing_package) {
logInfo("");
logInfo("Neither a package description file, nor source/app.d was found in");
logInfo(dub.rootPath.toNativeString());
logInfo("Please run DUB from the root directory of an existing package, or run");
logInfo("\"dub init --help\" to get information on creating a new package.");
logInfo("");
}
return false;
}
dub.loadPackage();
return true;
}
}
/** Encapsulates a group of commands that fit into a common category.
*/
struct CommandGroup {
/// Caption of the command category
string caption;
/// List of commands contained inthis group
Command[] commands;
this(string caption, Command[] commands...)
{
this.caption = caption;
this.commands = commands.dup;
}
}
/******************************************************************************/
/* INIT */
/******************************************************************************/
class InitCommand : Command {
private{
string m_templateType = "minimal";
PackageFormat m_format = PackageFormat.json;
bool m_nonInteractive;
}
this()
{
this.name = "init";
this.argumentsPattern = "[<directory> [<dependency>...]]";
this.description = "Initializes an empty package skeleton";
this.helpText = [
"Initializes an empty package of the specified type in the given directory. By default, the current working dirctory is used."
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("t|type", &m_templateType, [
"Set the type of project to generate. Available types:",
"",
"minimal - simple \"hello world\" project (default)",
"vibe.d - minimal HTTP server based on vibe.d",
"deimos - skeleton for C header bindings",
]);
args.getopt("f|format", &m_format, [
"Sets the format to use for the package description file. Possible values:",
" " ~ [__traits(allMembers, PackageFormat)].map!(f => f == m_format.init.to!string ? f ~ " (default)" : f).join(", ")
]);
args.getopt("n|non-interactive", &m_nonInteractive, ["Don't enter interactive mode."]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
string dir;
enforceUsage(app_args.empty, "Unexpected application arguments.");
if (free_args.length)
{
dir = free_args[0];
free_args = free_args[1 .. $];
}
string input(string caption, string default_value)
{
writef("%s [%s]: ", caption, default_value);
auto inp = readln();
return inp.length > 1 ? inp[0 .. $-1] : default_value;
}
void depCallback(ref PackageRecipe p, ref PackageFormat fmt) {
if (m_nonInteractive) return;
while (true) {
string rawfmt = input("Package recipe format (sdl/json)", fmt.to!string);
if (!rawfmt.length) break;
try {
fmt = rawfmt.to!PackageFormat;
break;
} catch (Exception) {
logError("Invalid format, \""~rawfmt~"\", enter either \"sdl\" or \"json\".");
}
}
auto author = p.authors.join(", ");
p.name = input("Name", p.name);
p.description = input("Description", p.description);
p.authors = input("Author name", author).split(",").map!(a => a.strip).array;
p.license = input("License", p.license);
p.copyright = input("Copyright string", p.copyright);
while (true) {
auto depname = input("Add dependency (leave empty to skip)", null);
if (!depname.length) break;
try {
auto ver = dub.getLatestVersion(depname);
auto dep = ver.isBranch ? Dependency(ver) : Dependency("~>" ~ ver.toString());
p.buildSettings.dependencies[depname] = dep;
logInfo("Added dependency %s %s", depname, dep.versionSpec);
} catch (Exception e) {
logError("Could not find package '%s'.", depname);
logDebug("Full error: %s", e.toString().sanitize);
}
}
}
//TODO: Remove this block in next version
// Checks if argument uses current method of specifying project type.
if (free_args.length)
{
if (["vibe.d", "deimos", "minimal"].canFind(free_args[0]))
{
m_templateType = free_args[0];
free_args = free_args[1 .. $];
logInfo("Deprecated use of init type. Use --type=[vibe.d | deimos | minimal] in future.");
}
}
dub.createEmptyPackage(Path(dir), free_args, m_templateType, m_format, &depCallback);
logInfo("Package successfully created in %s", dir.length ? dir : ".");
return 0;
}
}
/******************************************************************************/
/* GENERATE / BUILD / RUN / TEST / DESCRIBE */
/******************************************************************************/
abstract class PackageBuildCommand : Command {
protected {
string m_buildType;
BuildMode m_buildMode;
string m_buildConfig;
string m_compilerName;
string m_arch;
string[] m_debugVersions;
Compiler m_compiler;
BuildPlatform m_buildPlatform;
BuildSettings m_buildSettings;
string m_defaultConfig;
bool m_nodeps;
bool m_forceRemove = false;
bool m_single;
}
override void prepare(scope CommandArgs args)
{
args.getopt("b|build", &m_buildType, [
"Specifies the type of build to perform. Note that setting the DFLAGS environment variable will override the build type with custom flags.",
"Possible names:",
" debug (default), plain, release, release-debug, release-nobounds, unittest, profile, profile-gc, docs, ddox, cov, unittest-cov and custom types"
]);
args.getopt("c|config", &m_buildConfig, [
"Builds the specified configuration. Configurations can be defined in dub.json"
]);
args.getopt("compiler", &m_compilerName, [
"Specifies the compiler binary to use (can be a path).",
"Arbitrary pre- and suffixes to the identifiers below are recognized (e.g. ldc2 or dmd-2.063) and matched to the proper compiler type:",
" "~["dmd", "gdc", "ldc", "gdmd", "ldmd"].join(", ")
]);
args.getopt("a|arch", &m_arch, [
"Force a different architecture (e.g. x86 or x86_64)"
]);
args.getopt("d|debug", &m_debugVersions, [
"Define the specified debug version identifier when building - can be used multiple times"
]);
args.getopt("nodeps", &m_nodeps, [
"Do not check/update dependencies before building"
]);
args.getopt("force-remove", &m_forceRemove, [
"Force deletion of fetched packages with untracked files when upgrading"
]);
args.getopt("build-mode", &m_buildMode, [
"Specifies the way the compiler and linker are invoked. Valid values:",
" separate (default), allAtOnce, singleFile"
]);
args.getopt("single", &m_single, [
"Treats the package name as a filename. The file must contain a package recipe comment."
]);
}
protected void setupPackage(Dub dub, string package_name, string default_build_type = "debug")
{
if (!m_compilerName.length) m_compilerName = dub.defaultCompiler;
m_compiler = getCompiler(m_compilerName);
m_buildPlatform = m_compiler.determinePlatform(m_buildSettings, m_compilerName, m_arch);
m_buildSettings.addDebugVersions(m_debugVersions);
m_defaultConfig = null;
enforce (loadSpecificPackage(dub, package_name), "Failed to load package.");
if (m_buildConfig.length != 0 && !dub.configurations.canFind(m_buildConfig))
{
string msg = "Unknown build configuration: "~m_buildConfig;
enum distance = 3;
auto match = dub.configurations.getClosestMatch(m_buildConfig, distance);
if (match !is null) msg ~= ". Did you mean '" ~ match ~ "'?";
enforce(0, msg);
}
if (m_buildType.length == 0) {
if (environment.get("DFLAGS") !is null) m_buildType = "$DFLAGS";
else m_buildType = default_build_type;
}
if (!m_nodeps) {
// TODO: only upgrade(select) if necessary, only upgrade(upgrade) every now and then
// retrieve missing packages
dub.project.reinit();
if (!dub.project.hasAllDependencies) {
logDiagnostic("Checking for missing dependencies.");
if (m_single) dub.upgrade(UpgradeOptions.select | UpgradeOptions.noSaveSelections);
else dub.upgrade(UpgradeOptions.select);
}
if (!m_single) {
logDiagnostic("Checking for upgrades.");
dub.upgrade(UpgradeOptions.upgrade|UpgradeOptions.printUpgradesOnly|UpgradeOptions.useCachedResult);
}
}
dub.project.validate();
}
private bool loadSpecificPackage(Dub dub, string package_name)
{
if (m_single) {
enforce(package_name.length, "Missing file name of single-file package.");
dub.loadSingleFilePackage(package_name);
return true;
}
// load package in root_path to enable searching for sub packages
if (loadCwdPackage(dub, package_name.length == 0)) {
if (package_name.startsWith(":"))
package_name = dub.projectName ~ package_name;
if (!package_name.length) return true;
}
enforce(package_name.length, "No valid root package found - aborting.");
auto pack = dub.packageManager.getFirstPackage(package_name);
enforce(pack, "Failed to find a package named '"~package_name~"'.");
logInfo("Building package %s in %s", pack.name, pack.path.toNativeString());
dub.rootPath = pack.path;
dub.loadPackage(pack);
return true;
}
}
class GenerateCommand : PackageBuildCommand {
protected {
string m_generator;
bool m_rdmd = false;
bool m_tempBuild = false;
bool m_run = false;
bool m_force = false;
bool m_combined = false;
bool m_parallel = false;
bool m_printPlatform, m_printBuilds, m_printConfigs;
}
this()
{
this.name = "generate";
this.argumentsPattern = "<generator> [<package>]";
this.description = "Generates project files using the specified generator";
this.helpText = [
"Generates project files using one of the supported generators:",
"",
"visuald - VisualD project files",
"sublimetext - SublimeText project file",
"cmake - CMake build scripts",
"build - Builds the package directly",
"",
"An optional package name can be given to generate a different package than the root/CWD package."
];
}
override void prepare(scope CommandArgs args)
{
super.prepare(args);
args.getopt("combined", &m_combined, [
"Tries to build the whole project in a single compiler run."
]);
args.getopt("print-builds", &m_printBuilds, [
"Prints the list of available build types"
]);
args.getopt("print-configs", &m_printConfigs, [
"Prints the list of available configurations"
]);
args.getopt("print-platform", &m_printPlatform, [
"Prints the identifiers for the current build platform as used for the build fields in dub.json"
]);
args.getopt("parallel", &m_parallel, [
"Runs multiple compiler instances in parallel, if possible."
]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
string package_name;
if (!m_generator.length) {
enforceUsage(free_args.length >= 1 && free_args.length <= 2, "Expected one or two arguments.");
m_generator = free_args[0];
if (free_args.length >= 2) package_name = free_args[1];
} else {
enforceUsage(free_args.length <= 1, "Expected one or zero arguments.");
if (free_args.length >= 1) package_name = free_args[0];
}
setupPackage(dub, package_name);
if (m_printBuilds) { // FIXME: use actual package data
logInfo("Available build types:");
foreach (tp; ["debug", "release", "unittest", "profile"])
logInfo(" %s", tp);
logInfo("");
}
m_defaultConfig = dub.project.getDefaultConfiguration(m_buildPlatform);
if (m_printConfigs) {
logInfo("Available configurations:");
foreach (tp; dub.configurations)
logInfo(" %s%s", tp, tp == m_defaultConfig ? " [default]" : null);
logInfo("");
}
GeneratorSettings gensettings;
gensettings.platform = m_buildPlatform;
gensettings.config = m_buildConfig.length ? m_buildConfig : m_defaultConfig;
gensettings.buildType = m_buildType;
gensettings.buildMode = m_buildMode;
gensettings.compiler = m_compiler;
gensettings.buildSettings = m_buildSettings;
gensettings.combined = m_combined;
gensettings.run = m_run;
gensettings.runArgs = app_args;
gensettings.force = m_force;
gensettings.rdmd = m_rdmd;
gensettings.tempBuild = m_tempBuild;
gensettings.parallelBuild = m_parallel;
logDiagnostic("Generating using %s", m_generator);
dub.generateProject(m_generator, gensettings);
if (m_buildType == "ddox") dub.runDdox(gensettings.run, app_args);
return 0;
}
}
class BuildCommand : GenerateCommand {
this()
{
this.name = "build";
this.argumentsPattern = "[<package>]";
this.description = "Builds a package (uses the main package in the current working directory by default)";
this.helpText = [
"Builds a package (uses the main package in the current working directory by default)"
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("rdmd", &m_rdmd, [
"Use rdmd instead of directly invoking the compiler"
]);
args.getopt("f|force", &m_force, [
"Forces a recompilation even if the target is up to date"
]);
super.prepare(args);
m_generator = "build";
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
return super.execute(dub, free_args, app_args);
}
}
class RunCommand : BuildCommand {
this()
{
this.name = "run";
this.argumentsPattern = "[<package>]";
this.description = "Builds and runs a package (default command)";
this.helpText = [
"Builds and runs a package (uses the main package in the current working directory by default)"
];
this.acceptsAppArgs = true;
}
override void prepare(scope CommandArgs args)
{
args.getopt("temp-build", &m_tempBuild, [
"Builds the project in the temp folder if possible."
]);
super.prepare(args);
m_run = true;
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
return super.execute(dub, free_args, app_args);
}
}
class TestCommand : PackageBuildCommand {
private {
string m_mainFile;
bool m_combined = false;
bool m_force = false;
}
this()
{
this.name = "test";
this.argumentsPattern = "[<package>]";
this.description = "Executes the tests of the selected package";
this.helpText = [
`Builds the package and executes all contained unit tests.`,
``,
`If no explicit configuration is given, an existing "unittest" ` ~
`configuration will be preferred for testing. If none exists, the ` ~
`first library type configuration will be used, and if that doesn't ` ~
`exist either, the first executable configuration is chosen.`,
``,
`When a custom main file (--main-file) is specified, only library ` ~
`configurations can be used. Otherwise, depending on the type of ` ~
`the selected configuration, either an existing main file will be ` ~
`used (and needs to be properly adjusted to just run the unit ` ~
`tests for 'version(unittest)'), or DUB will generate one for ` ~
`library type configurations.`,
``,
`Finally, if the package contains a dependency to the "tested" ` ~
`package, the automatically generated main file will use it to ` ~
`run the unit tests.`
];
this.acceptsAppArgs = true;
}
override void prepare(scope CommandArgs args)
{
args.getopt("main-file", &m_mainFile, [
"Specifies a custom file containing the main() function to use for running the tests."
]);
args.getopt("combined", &m_combined, [
"Tries to build the whole project in a single compiler run."
]);
args.getopt("f|force", &m_force, [
"Forces a recompilation even if the target is up to date"
]);
bool coverage = false;
args.getopt("coverage", &coverage, [
"Enables code coverage statistics to be generated."
]);
if (coverage) m_buildType = "unittest-cov";
super.prepare(args);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
string package_name;
enforceUsage(free_args.length <= 1, "Expected one or zero arguments.");
if (free_args.length >= 1) package_name = free_args[0];
setupPackage(dub, package_name, "unittest");
GeneratorSettings settings;
settings.platform = m_buildPlatform;
settings.compiler = getCompiler(m_buildPlatform.compilerBinary);
settings.buildType = m_buildType;
settings.buildMode = m_buildMode;
settings.buildSettings = m_buildSettings;
settings.combined = m_combined;
settings.force = m_force;
settings.tempBuild = m_single;
settings.run = true;
settings.runArgs = app_args;
dub.testProject(settings, m_buildConfig, Path(m_mainFile));
return 0;
}
}
class DescribeCommand : PackageBuildCommand {
private {
bool m_importPaths = false;
bool m_stringImportPaths = false;
bool m_dataList = false;
bool m_dataNullDelim = false;
string[] m_data;
}
this()
{
this.name = "describe";
this.argumentsPattern = "[<package>]";
this.description = "Prints a JSON description of the project and its dependencies";
this.helpText = [
"Prints a JSON build description for the root package an all of " ~
"their dependencies in a format similar to a JSON package " ~
"description file. This is useful mostly for IDEs.",
"",
"All usual options that are also used for build/run/generate apply.",
"",
"When --data=VALUE is supplied, specific build settings for a project " ~
"will be printed instead (by default, formatted for the current compiler).",
"",
"The --data=VALUE option can be specified multiple times to retrieve " ~
"several pieces of information at once. A comma-separated list is " ~
"also acceptable (ex: --data=dflags,libs). The data will be output in " ~
"the same order requested on the command line.",
"",
"The accepted values for --data=VALUE are:",
"",
"main-source-file, dflags, lflags, libs, linker-files, " ~
"source-files, versions, debug-versions, import-paths, " ~
"string-import-paths, import-files, options",
"",
"The following are also accepted by --data if --data-list is used:",
"",
"target-type, target-path, target-name, working-directory, " ~
"copy-files, string-import-files, pre-generate-commands, " ~
"post-generate-commands, pre-build-commands, post-build-commands, " ~
"requirements",
];
}
override void prepare(scope CommandArgs args)
{
super.prepare(args);
args.getopt("import-paths", &m_importPaths, [
"Shortcut for --data=import-paths --data-list"
]);
args.getopt("string-import-paths", &m_stringImportPaths, [
"Shortcut for --data=string-import-paths --data-list"
]);
args.getopt("data", &m_data, [
"Just list the values of a particular build setting, either for this "~
"package alone or recursively including all dependencies. Accepts a "~
"comma-separated list. See above for more details and accepted "~
"possibilities for VALUE."
]);
args.getopt("data-list", &m_dataList, [
"Output --data information in list format (line-by-line), instead "~
"of formatting for a compiler command line.",
]);
args.getopt("data-0", &m_dataNullDelim, [
"Output --data information using null-delimiters, rather than "~
"spaces or newlines. Result is usable with, ex., xargs -0.",
]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(
!(m_importPaths && m_stringImportPaths),
"--import-paths and --string-import-paths may not be used together."
);
enforceUsage(
!(m_data && (m_importPaths || m_stringImportPaths)),
"--data may not be used together with --import-paths or --string-import-paths."
);
// disable all log output to stdout and use "writeln" to output the JSON description
auto ll = getLogLevel();
setLogLevel(LogLevel.warn);
scope (exit) setLogLevel(ll);
string package_name;
enforceUsage(free_args.length <= 1, "Expected one or zero arguments.");
if (free_args.length >= 1) package_name = free_args[0];
setupPackage(dub, package_name);
m_defaultConfig = dub.project.getDefaultConfiguration(m_buildPlatform);
auto config = m_buildConfig.length ? m_buildConfig : m_defaultConfig;
GeneratorSettings settings;
settings.platform = m_buildPlatform;
settings.config = config;
settings.buildType = m_buildType;
settings.compiler = m_compiler;
if (m_importPaths) { m_data = ["import-paths"]; m_dataList = true; }
else if (m_stringImportPaths) { m_data = ["string-import-paths"]; m_dataList = true; }
if (m_data.length) {
ListBuildSettingsFormat lt;
with (ListBuildSettingsFormat)
lt = m_dataList ? (m_dataNullDelim ? listNul : list) : (m_dataNullDelim ? commandLineNul : commandLine);
dub.listProjectData(settings, m_data, lt);
} else {
auto desc = dub.project.describe(settings);
writeln(desc.serializeToPrettyJson());
}
return 0;
}
}
class CleanCommand : Command {
private {
bool m_allPackages;
}
this()
{
this.name = "clean";
this.argumentsPattern = "[<package>]";
this.description = "Removes intermediate build files and cached build results";
this.helpText = [
"This command removes any cached build files of the given package(s). The final target file, as well as any copyFiles are currently not removed.",
"Without arguments, the package in the current working directory will be cleaned."
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("all-packages", &m_allPackages, [
"Cleans up *all* known packages (dub list)"
]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length <= 1, "Expected one or zero arguments.");
enforceUsage(app_args.length == 0, "Application arguments are not supported for the clean command.");
enforceUsage(!m_allPackages || !free_args.length, "The --all-packages flag may not be used together with an explicit package name.");
enforce(free_args.length == 0, "Cleaning a specific package isn't possible right now.");
if (m_allPackages) {
foreach (p; dub.packageManager.getPackageIterator())
dub.cleanPackage(p.path);
} else {
dub.cleanPackage(dub.rootPath);
}
return 0;
}
}
/******************************************************************************/
/* FETCH / REMOVE / UPGRADE */
/******************************************************************************/
class UpgradeCommand : Command {
private {
bool m_prerelease = false;
bool m_forceRemove = false;
bool m_missingOnly = false;
bool m_verify = false;
}
this()
{
this.name = "upgrade";
this.argumentsPattern = "[<package>]";
this.description = "Forces an upgrade of all dependencies";
this.helpText = [
"Upgrades all dependencies of the package by querying the package registry(ies) for new versions.",
"",
"This will also update the versions stored in the selections file ("~SelectedVersions.defaultFile~") accordingly.",
"",
"If a package specified, (only) that package will be upgraded. Otherwise all direct and indirect dependencies of the current package will get upgraded."
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("prerelease", &m_prerelease, [
"Uses the latest pre-release version, even if release versions are available"
]);
args.getopt("force-remove", &m_forceRemove, [
"Force deletion of fetched packages with untracked files"
]);
args.getopt("verify", &m_verify, [
"Updates the project and performs a build. If successful, rewrites the selected versions file <to be implemeted>."
]);
args.getopt("missing-only", &m_missingOnly, [
"Performs an upgrade only for dependencies that don't yet have a version selected. This is also done automatically before each build."
]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length <= 1, "Unexpected arguments.");
enforceUsage(app_args.length == 0, "Unexpected application arguments.");
enforceUsage(!m_verify, "--verify is not yet implemented.");
dub.loadPackage();
logInfo("Upgrading project in %s", dub.projectPath.toNativeString());
auto options = UpgradeOptions.upgrade|UpgradeOptions.select;
if (m_missingOnly) options &= ~UpgradeOptions.upgrade;
if (m_prerelease) options |= UpgradeOptions.preRelease;
if (m_forceRemove) options |= UpgradeOptions.forceRemove;
enforceUsage(app_args.length == 0, "Upgrading a specific package is not yet implemented.");
dub.upgrade(options);
return 0;
}
}
class FetchRemoveCommand : Command {
protected {
string m_version;
bool m_forceRemove = false;
}
override void prepare(scope CommandArgs args)
{
args.getopt("version", &m_version, [
"Use the specified version/branch instead of the latest available match",
"The remove command also accepts \"*\" here as a wildcard to remove all versions of the package from the specified location"
]);
args.getopt("force-remove", &m_forceRemove, [
"Force deletion of fetched packages with untracked files"
]);
}
abstract override int execute(Dub dub, string[] free_args, string[] app_args);
}
class FetchCommand : FetchRemoveCommand {
this()
{
this.name = "fetch";
this.argumentsPattern = "<name>";
this.description = "Manually retrieves and caches a package";
this.helpText = [
"Note: Use the \"dependencies\" field in the package description file (e.g. dub.json) if you just want to use a certain package as a dependency, you don't have to explicitly fetch packages.",
"",
"Explicit retrieval/removal of packages is only needed when you want to put packages to a place where several applications can share these. If you just have an dependency to a package, just add it to your dub.json, dub will do the rest for you.",
"",
"Without specified options, placement/removal will default to a user wide shared location.",
"",
"Complete applications can be retrieved and run easily by e.g.",
"$ dub fetch vibelog --local",
"$ cd vibelog",
"$ dub",
"",
"This will grab all needed dependencies and compile and run the application.",
"",
"Note: DUB does not do a system installation of packages. Packages are instead only registered within DUB's internal ecosystem. Generation of native system packages/installers may be added later as a separate feature."
];
}
override void prepare(scope CommandArgs args)
{
super.prepare(args);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length == 1, "Expecting exactly one argument.");
enforceUsage(app_args.length == 0, "Unexpected application arguments.");
auto location = dub.defaultPlacementLocation;
auto name = free_args[0];
FetchOptions fetchOpts;
fetchOpts |= FetchOptions.forceBranchUpgrade;
fetchOpts |= m_forceRemove ? FetchOptions.forceRemove : FetchOptions.none;
if (m_version.length) dub.fetch(name, Dependency(m_version), location, fetchOpts);
else {
try {
dub.fetch(name, Dependency(">=0.0.0"), location, fetchOpts);
logInfo(
"Please note that you need to use `dub run <pkgname>` " ~
"or add it to dependencies of your package to actually use/run it. " ~
"dub does not do actual installation of packages outside of its own ecosystem.");
}
catch(Exception e){
logInfo("Getting a release version failed: %s", e.msg);
logInfo("Retry with ~master...");
dub.fetch(name, Dependency("~master"), location, fetchOpts);
}
}
return 0;
}
}
class InstallCommand : FetchCommand {
this() { this.name = "install"; hidden = true; }
override void prepare(scope CommandArgs args) { super.prepare(args); }
override int execute(Dub dub, string[] free_args, string[] app_args)
{
warnRenamed("install", "fetch");
return super.execute(dub, free_args, app_args);
}
}
class RemoveCommand : FetchRemoveCommand {
private {
bool m_nonInteractive;
}
this()
{
this.name = "remove";
this.argumentsPattern = "<name>";
this.description = "Removes a cached package";
this.helpText = [
"Removes a package that is cached on the local system."
];
}
override void prepare(scope CommandArgs args)
{
super.prepare(args);
args.getopt("n|non-interactive", &m_nonInteractive, ["Don't enter interactive mode."]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length == 1, "Expecting exactly one argument.");
enforceUsage(app_args.length == 0, "Unexpected application arguments.");
auto package_id = free_args[0];
auto location = dub.defaultPlacementLocation;
size_t resolveVersion(in Package[] packages) {
// just remove only package version
if (packages.length == 1)
return 0;
writeln("Select version of '", package_id, "' to remove from location '", location, "':");
foreach (i, pack; packages)
writefln("%s) %s", i + 1, pack.version_);
writeln(packages.length + 1, ") ", "all versions");
while (true) {
writef("> ");
auto inp = readln();
if (!inp.length) // Ctrl+D
return size_t.max;
inp = inp.stripRight;
if (!inp.length) // newline or space
continue;
try {
immutable selection = inp.to!size_t - 1;
if (selection <= packages.length)
return selection;
} catch (ConvException e) {
}
logError("Please enter a number between 1 and %s.", packages.length + 1);
}
}
if (m_nonInteractive || !m_version.empty)
dub.remove(package_id, m_version, location, m_forceRemove);
else
dub.remove(package_id, location, m_forceRemove, &resolveVersion);
return 0;
}
}
class UninstallCommand : RemoveCommand {
this() { this.name = "uninstall"; hidden = true; }
override void prepare(scope CommandArgs args) { super.prepare(args); }
override int execute(Dub dub, string[] free_args, string[] app_args)
{
warnRenamed("uninstall", "remove");
return super.execute(dub, free_args, app_args);
}
}
/******************************************************************************/
/* ADD/REMOVE PATH/LOCAL */
/******************************************************************************/
abstract class RegistrationCommand : Command {
private {
bool m_system;
}
override void prepare(scope CommandArgs args)
{
args.getopt("system", &m_system, [
"Register system-wide instead of user-wide"
]);
}
abstract override int execute(Dub dub, string[] free_args, string[] app_args);
}
class AddPathCommand : RegistrationCommand {
this()
{
this.name = "add-path";
this.argumentsPattern = "<path>";
this.description = "Adds a default package search path";
this.helpText = [
"Adds a default package search path. All direct sub folders of this path will be searched for package descriptions and will be made available as packages. Using this command has the equivalent effect as calling 'dub add-local' on each of the sub folders manually.",
"",
"Any packages registered using add-path will be preferred over packages downloaded from the package registry when searching for dependencies during a build operation.",
"",
"The version of the packages will be determined by one of the following:",
" - For GIT working copies, the last tag (git describe) is used to determine the version",
" - If the package contains a \"version\" field in the package description, this is used",
" - If neither of those apply, \"~master\" is assumed"
];
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length == 1, "Missing search path.");
dub.addSearchPath(free_args[0], m_system);
return 0;
}
}
class RemovePathCommand : RegistrationCommand {
this()
{
this.name = "remove-path";
this.argumentsPattern = "<path>";
this.description = "Removes a package search path";
this.helpText = ["Removes a package search path previously added with add-path."];
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length == 1, "Expected one argument.");
dub.removeSearchPath(free_args[0], m_system);
return 0;
}
}
class AddLocalCommand : RegistrationCommand {
this()
{
this.name = "add-local";
this.argumentsPattern = "<path> [<version>]";
this.description = "Adds a local package directory (e.g. a git repository)";
this.helpText = [
"Adds a local package directory to be used during dependency resolution. This command is useful for registering local packages, such as GIT working copies, that are either not available in the package registry, or are supposed to be overwritten.",
"",
"The version of the package is either determined automatically (see the \"add-path\" command, or can be explicitly overwritten by passing a version on the command line.",
"",
"See 'dub add-path -h' for a way to register multiple local packages at once."
];
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length == 1 || free_args.length == 2, "Expecting one or two arguments.");
string ver = free_args.length == 2 ? free_args[1] : null;
dub.addLocalPackage(free_args[0], ver, m_system);
return 0;
}
}
class RemoveLocalCommand : RegistrationCommand {
this()
{
this.name = "remove-local";
this.argumentsPattern = "<path>";
this.description = "Removes a local package directory";
this.helpText = ["Removes a local package directory"];
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(free_args.length >= 1, "Missing package path argument.");
enforceUsage(free_args.length <= 1, "Expected the package path to be the only argument.");
dub.removeLocalPackage(free_args[0], m_system);
return 0;
}
}
class ListCommand : Command {
this()
{
this.name = "list";
this.argumentsPattern = "";
this.description = "Prints a list of all local packages dub is aware of";
this.helpText = [
"Prints a list of all local packages. This includes all cached packages (user or system wide), all packages in the package search paths (\"dub add-path\") and all manually registered packages (\"dub add-local\")."
];
}
override void prepare(scope CommandArgs args) {}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
logInfo("Packages present in the system and known to dub:");
foreach (p; dub.packageManager.getPackageIterator())
logInfo(" %s %s: %s", p.name, p.version_, p.path.toNativeString());
logInfo("");
return 0;
}
}
class ListInstalledCommand : ListCommand {
this() { this.name = "list-installed"; hidden = true; }
override void prepare(scope CommandArgs args) { super.prepare(args); }
override int execute(Dub dub, string[] free_args, string[] app_args)
{
warnRenamed("list-installed", "list");
return super.execute(dub, free_args, app_args);
}
}
class SearchCommand : Command {
this()
{
this.name = "search";
this.argumentsPattern = "<query>";
this.description = "Search for available packages.";
this.helpText = [
"Search all specified DUB registries for packages matching query."
];
}
override void prepare(scope CommandArgs args) {}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforce(free_args.length == 1, "Expected one argument.");
auto res = dub.searchPackages(free_args[0]);
if (res.empty)
{
logError("No matches found.");
return 1;
}
auto justify = res
.map!((descNmatches) => descNmatches[1])
.joiner
.map!(m => m.name.length + m.version_.length)
.reduce!max + " ()".length;
justify += (~justify & 3) + 1; // round to next multiple of 4
foreach (desc, matches; res)
{
logInfo("==== %s ====", desc);
foreach (m; matches)
logInfo("%s%s", leftJustify(m.name ~ " (" ~ m.version_ ~ ")", justify), m.description);
}
return 0;
}
}
/******************************************************************************/
/* OVERRIDES */
/******************************************************************************/
class AddOverrideCommand : Command {
private {
bool m_system = false;
}
this()
{
this.name = "add-override";
this.argumentsPattern = "<package> <version-spec> <target-path/target-version>";
this.description = "Adds a new package override.";
this.helpText = [
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("system", &m_system, [
"Register system-wide instead of user-wide"
]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(app_args.length == 0, "Unexpected application arguments.");
enforceUsage(free_args.length == 3, "Expected three arguments, not "~free_args.length.to!string);
auto scope_ = m_system ? LocalPackageType.system : LocalPackageType.user;
auto pack = free_args[0];
auto ver = Dependency(free_args[1]);
if (existsFile(Path(free_args[2]))) {
auto target = Path(free_args[2]);
dub.packageManager.addOverride(scope_, pack, ver, target);
logInfo("Added override %s %s => %s", pack, ver, target);
} else {
auto target = Version(free_args[2]);
dub.packageManager.addOverride(scope_, pack, ver, target);
logInfo("Added override %s %s => %s", pack, ver, target);
}
return 0;
}
}
class RemoveOverrideCommand : Command {
private {
bool m_system = false;
}
this()
{
this.name = "remove-override";
this.argumentsPattern = "<package> <version-spec>";
this.description = "Removes an existing package override.";
this.helpText = [
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("system", &m_system, [
"Register system-wide instead of user-wide"
]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(app_args.length == 0, "Unexpected application arguments.");
enforceUsage(free_args.length == 2, "Expected two arguments, not "~free_args.length.to!string);
auto scope_ = m_system ? LocalPackageType.system : LocalPackageType.user;
dub.packageManager.removeOverride(scope_, free_args[0], Dependency(free_args[1]));
return 0;
}
}
class ListOverridesCommand : Command {
this()
{
this.name = "list-overrides";
this.argumentsPattern = "";
this.description = "Prints a list of all local package overrides";
this.helpText = [
"Prints a list of all overridden packages added via \"dub add-override\"."
];
}
override void prepare(scope CommandArgs args) {}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
void printList(in PackageOverride[] overrides, string caption)
{
if (overrides.length == 0) return;
logInfo("# %s", caption);
foreach (ovr; overrides) {
if (!ovr.targetPath.empty) logInfo("%s %s => %s", ovr.package_, ovr.version_, ovr.targetPath);
else logInfo("%s %s => %s", ovr.package_, ovr.version_, ovr.targetVersion);
}
}
printList(dub.packageManager.getOverrides(LocalPackageType.user), "User wide overrides");
printList(dub.packageManager.getOverrides(LocalPackageType.system), "System wide overrides");
return 0;
}
}
/******************************************************************************/
/* Cache cleanup */
/******************************************************************************/
class CleanCachesCommand : Command {
this()
{
this.name = "clean-caches";
this.argumentsPattern = "";
this.description = "Removes cached metadata";
this.helpText = [
"This command removes any cached metadata like the list of available packages and their latest version."
];
}
override void prepare(scope CommandArgs args) {}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
return 0;
}
}
/******************************************************************************/
/* DUSTMITE */
/******************************************************************************/
class DustmiteCommand : PackageBuildCommand {
private {
int m_compilerStatusCode = int.min;
int m_linkerStatusCode = int.min;
int m_programStatusCode = int.min;
string m_compilerRegex;
string m_linkerRegex;
string m_programRegex;
string m_testPackage;
bool m_combined;
}
this()
{
this.name = "dustmite";
this.argumentsPattern = "<destination-path>";
this.acceptsAppArgs = true;
this.description = "Create reduced test cases for build errors";
this.helpText = [
"This command uses the Dustmite utility to isolate the cause of build errors in a DUB project.",
"",
"It will create a copy of all involved packages and run dustmite on this copy, leaving a reduced test case.",
"",
"Determining the desired error condition is done by checking the compiler/linker status code, as well as their output (stdout and stderr combined). If --program-status or --program-regex is given and the generated binary is an executable, it will be executed and its output will also be incorporated into the final decision."
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("compiler-status", &m_compilerStatusCode, ["The expected status code of the compiler run"]);
args.getopt("compiler-regex", &m_compilerRegex, ["A regular expression used to match against the compiler output"]);
args.getopt("linker-status", &m_linkerStatusCode, ["The expected status code of the linker run"]);
args.getopt("linker-regex", &m_linkerRegex, ["A regular expression used to match against the linker output"]);
args.getopt("program-status", &m_programStatusCode, ["The expected status code of the built executable"]);
args.getopt("program-regex", &m_programRegex, ["A regular expression used to match against the program output"]);
args.getopt("test-package", &m_testPackage, ["Perform a test run - usually only used internally"]);
args.getopt("combined", &m_combined, ["Builds multiple packages with one compiler run"]);
super.prepare(args);
// speed up loading when in test mode
if (m_testPackage.length) {
skipDubInitialization = true;
m_nodeps = true;
}
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
import std.format : formattedWrite;
if (m_testPackage.length) {
dub = new Dub(Path(getcwd()));
setupPackage(dub, m_testPackage);
m_defaultConfig = dub.project.getDefaultConfiguration(m_buildPlatform);
GeneratorSettings gensettings;
gensettings.platform = m_buildPlatform;
gensettings.config = m_buildConfig.length ? m_buildConfig : m_defaultConfig;
gensettings.buildType = m_buildType;
gensettings.compiler = m_compiler;
gensettings.buildSettings = m_buildSettings;
gensettings.combined = m_combined;
gensettings.run = m_programStatusCode != int.min || m_programRegex.length;
gensettings.runArgs = app_args;
gensettings.force = true;
gensettings.compileCallback = check(m_compilerStatusCode, m_compilerRegex);
gensettings.linkCallback = check(m_linkerStatusCode, m_linkerRegex);
gensettings.runCallback = check(m_programStatusCode, m_programRegex);
try dub.generateProject("build", gensettings);
catch (DustmiteMismatchException) {
logInfo("Dustmite test doesn't match.");
return 3;
}
catch (DustmiteMatchException) {
logInfo("Dustmite test matches.");
return 0;
}
} else {
enforceUsage(free_args.length == 1, "Expected destination path.");
auto path = Path(free_args[0]);
path.normalize();
enforceUsage(path.length > 0, "Destination path must not be empty.");
if (!path.absolute) path = Path(getcwd()) ~ path;
enforceUsage(!path.startsWith(dub.rootPath), "Destination path must not be a sub directory of the tested package!");
setupPackage(dub, null);
auto prj = dub.project;
if (m_buildConfig.empty)
m_buildConfig = prj.getDefaultConfiguration(m_buildPlatform);
void copyFolderRec(Path folder, Path dstfolder)
{
mkdirRecurse(dstfolder.toNativeString());
foreach (de; iterateDirectory(folder.toNativeString())) {
if (de.name.startsWith(".")) continue;
if (de.isDirectory) {
copyFolderRec(folder ~ de.name, dstfolder ~ de.name);
} else {
if (de.name.endsWith(".o") || de.name.endsWith(".obj")) continue;
if (de.name.endsWith(".exe")) continue;
try copyFile(folder ~ de.name, dstfolder ~ de.name);
catch (Exception e) {
logWarn("Failed to copy file %s: %s", (folder ~ de.name).toNativeString(), e.msg);
}
}
}
}
static void fixPathDependency(string pack, ref Dependency dep) {
if (dep.path.length > 0) {
auto mainpack = getBasePackageName(pack);
dep.path = Path("../") ~ mainpack;
}
}
void fixPathDependencies(ref PackageRecipe recipe, Path base_path)
{
foreach (name, ref dep; recipe.buildSettings.dependencies)
fixPathDependency(name, dep);
foreach (ref cfg; recipe.configurations)
foreach (name, ref dep; cfg.buildSettings.dependencies)
fixPathDependency(name, dep);
foreach (ref subp; recipe.subPackages)
if (subp.path.length) {
auto sub_path = base_path ~ Path(subp.path);
auto pack = prj.packageManager.getOrLoadPackage(sub_path);
fixPathDependencies(pack.recipe, sub_path);
pack.storeInfo(sub_path);
} else fixPathDependencies(subp.recipe, base_path);
}
bool[string] visited;
foreach (pack_; prj.getTopologicalPackageList()) {
auto pack = pack_.basePackage;
if (pack.name in visited) continue;
visited[pack.name] = true;
auto dst_path = path ~ pack.name;
logInfo("Copy package '%s' to destination folder...", pack.name);
copyFolderRec(pack.path, dst_path);
// adjust all path based dependencies
fixPathDependencies(pack.recipe, dst_path);
// overwrite package description file with additional version information
pack.storeInfo(dst_path);
}
logInfo("Executing dustmite...");
auto testcmd = appender!string();
testcmd.formattedWrite("%s dustmite --vquiet --test-package=%s --build=%s --config=%s",
thisExePath, prj.name, m_buildType, m_buildConfig);
if (m_compilerName.length) testcmd.formattedWrite(" \"--compiler=%s\"", m_compilerName);
if (m_arch.length) testcmd.formattedWrite(" --arch=%s", m_arch);
if (m_compilerStatusCode != int.min) testcmd.formattedWrite(" --compiler-status=%s", m_compilerStatusCode);
if (m_compilerRegex.length) testcmd.formattedWrite(" \"--compiler-regex=%s\"", m_compilerRegex);
if (m_linkerStatusCode != int.min) testcmd.formattedWrite(" --linker-status=%s", m_linkerStatusCode);
if (m_linkerRegex.length) testcmd.formattedWrite(" \"--linker-regex=%s\"", m_linkerRegex);
if (m_programStatusCode != int.min) testcmd.formattedWrite(" --program-status=%s", m_programStatusCode);
if (m_programRegex.length) testcmd.formattedWrite(" \"--program-regex=%s\"", m_programRegex);
if (m_combined) testcmd ~= " --combined";
// TODO: pass *all* original parameters
logDiagnostic("Running dustmite: %s", testcmd);
auto dmpid = spawnProcess(["dustmite", path.toNativeString(), testcmd.data]);
return dmpid.wait();
}
return 0;
}
void delegate(int, string) check(int code_match, string regex_match)
{
return (code, output) {
import std.encoding;
import std.regex;
logInfo("%s", output);
if (code_match != int.min && code != code_match) {
logInfo("Exit code %s doesn't match expected value %s", code, code_match);
throw new DustmiteMismatchException;
}
if (regex_match.length > 0 && !match(output.sanitize, regex_match)) {
logInfo("Output doesn't match regex:");
logInfo("%s", output);
throw new DustmiteMismatchException;
}
if (code != 0 && code_match != int.min || regex_match.length > 0) {
logInfo("Tool failed, but matched either exit code or output - counting as match.");
throw new DustmiteMatchException;
}
};
}
static class DustmiteMismatchException : Exception {
this(string message = "", string file = __FILE__, int line = __LINE__, Throwable next = null)
{
super(message, file, line, next);
}
}
static class DustmiteMatchException : Exception {
this(string message = "", string file = __FILE__, int line = __LINE__, Throwable next = null)
{
super(message, file, line, next);
}
}
}
/******************************************************************************/
/* CONVERT command */
/******************************************************************************/
class ConvertCommand : Command {
private {
string m_format;
bool m_stdout;
}
this()
{
this.name = "convert";
this.argumentsPattern = "";
this.description = "Converts the file format of the package recipe.";
this.helpText = [
"This command will convert between JSON and SDLang formatted package recipe files.",
"",
"Warning: Beware that any formatting and comments within the package recipe will get lost in the conversion process."
];
}
override void prepare(scope CommandArgs args)
{
args.getopt("f|format", &m_format, ["Specifies the target package recipe format. Possible values:", " json, sdl"]);
args.getopt("s|stdout", &m_stdout, ["Outputs the converted package recipe to stdout instead of writing to disk."]);
}
override int execute(Dub dub, string[] free_args, string[] app_args)
{
enforceUsage(app_args.length == 0, "Unexpected application arguments.");
enforceUsage(free_args.length == 0, "Unexpected arguments: "~free_args.join(" "));
enforceUsage(m_format.length > 0, "Missing target format file extension (--format=...).");
if (!loadCwdPackage(dub, true)) return 1;
dub.convertRecipe(m_format, m_stdout);
return 0;
}
}
/******************************************************************************/
/* HELP */
/******************************************************************************/
private {
enum shortArgColumn = 2;
enum longArgColumn = 6;
enum descColumn = 24;
enum lineWidth = 80 - 1;
}
private void showHelp(in CommandGroup[] commands, CommandArgs common_args)
{
writeln(
`USAGE: dub [--version] [<command>] [<options...>] [-- [<application arguments...>]]
Manages the DUB project in the current directory. If the command is omitted,
DUB will default to "run". When running an application, "--" can be used to
separate DUB options from options passed to the application.
Run "dub <command> --help" to get help for a specific command.
You can use the "http_proxy" environment variable to configure a proxy server
to be used for fetching packages.
Available commands
==================`);
foreach (grp; commands) {
writeln();
writeWS(shortArgColumn);
writeln(grp.caption);
writeWS(shortArgColumn);
writerep!'-'(grp.caption.length);
writeln();
foreach (cmd; grp.commands) {
if (cmd.hidden) continue;
writeWS(shortArgColumn);
writef("%s %s", cmd.name, cmd.argumentsPattern);
auto chars_output = cmd.name.length + cmd.argumentsPattern.length + shortArgColumn + 1;
if (chars_output < descColumn) {
writeWS(descColumn - chars_output);
} else {
writeln();
writeWS(descColumn);
}
writeWrapped(cmd.description, descColumn, descColumn);
}
}
writeln();
writeln();
writeln(`Common options`);
writeln(`==============`);
writeln();
writeOptions(common_args);
writeln();
showVersion();
}
private void showVersion()
{
writefln("DUB version %s, built on %s", getDUBVersion(), __DATE__);
}
private void showCommandHelp(Command cmd, CommandArgs args, CommandArgs common_args)
{
writefln(`USAGE: dub %s %s [<options...>]%s`, cmd.name, cmd.argumentsPattern, cmd.acceptsAppArgs ? " [-- <application arguments...>]": null);
writeln();
foreach (ln; cmd.helpText)
ln.writeWrapped();
if (args.recognizedArgs.length) {
writeln();
writeln();
writeln("Command specific options");
writeln("========================");
writeln();
writeOptions(args);
}
writeln();
writeln();
writeln("Common options");
writeln("==============");
writeln();
writeOptions(common_args);
writeln();
writefln("DUB version %s, built on %s", getDUBVersion(), __DATE__);
}
private void writeOptions(CommandArgs args)
{
foreach (arg; args.recognizedArgs) {
auto names = arg.names.split("|");
assert(names.length == 1 || names.length == 2);
string sarg = names[0].length == 1 ? names[0] : null;
string larg = names[0].length > 1 ? names[0] : names.length > 1 ? names[1] : null;
if (sarg !is null) {
writeWS(shortArgColumn);
writef("-%s", sarg);
writeWS(longArgColumn - shortArgColumn - 2);
} else writeWS(longArgColumn);
size_t col = longArgColumn;
if (larg !is null) {
if (arg.defaultValue.peek!bool) {
writef("--%s", larg);
col += larg.length + 2;
} else {
writef("--%s=VALUE", larg);
col += larg.length + 8;
}
}
if (col < descColumn) {
writeWS(descColumn - col);
} else {
writeln();
writeWS(descColumn);
}
foreach (i, ln; arg.helpText) {
if (i > 0) writeWS(descColumn);
ln.writeWrapped(descColumn, descColumn);
}
}
}
private void writeWrapped(string string, size_t indent = 0, size_t first_line_pos = 0)
{
// handle pre-indented strings and bullet lists
size_t first_line_indent = 0;
while (string.startsWith(" ")) {
string = string[1 .. $];
indent++;
first_line_indent++;
}
if (string.startsWith("- ")) indent += 2;
auto wrapped = string.wrap(lineWidth, getRepString!' '(first_line_pos+first_line_indent), getRepString!' '(indent));
wrapped = wrapped[first_line_pos .. $];
foreach (ln; wrapped.splitLines())
writeln(ln);
}
private void writeWS(size_t num) { writerep!' '(num); }
private void writerep(char ch)(size_t num) { write(getRepString!ch(num)); }
private string getRepString(char ch)(size_t len)
{
static string buf;
if (len > buf.length) buf ~= [ch].replicate(len-buf.length);
return buf[0 .. len];
}
/***
*/
private void enforceUsage(bool cond, string text)
{
if (!cond) throw new UsageException(text);
}
private class UsageException : Exception {
this(string message, string file = __FILE__, int line = __LINE__, Throwable next = null)
{
super(message, file, line, next);
}
}
private void warnRenamed(string prev, string curr)
{
logWarn("The '%s' Command was renamed to '%s'. Please update your scripts.", prev, curr);
}
|
D
|
/Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/DerivedData/FlickrSwift/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/MultipartFormData.o : /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Alamofire.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Download.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Error.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Manager.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/MultipartFormData.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Notifications.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ParameterEncoding.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Request.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Response.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ResponseSerialization.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Result.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Stream.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Timeline.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Upload.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/DerivedData/FlickrSwift/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/DerivedData/FlickrSwift/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/MultipartFormData~partial.swiftmodule : /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Alamofire.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Download.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Error.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Manager.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/MultipartFormData.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Notifications.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ParameterEncoding.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Request.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Response.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ResponseSerialization.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Result.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Stream.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Timeline.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Upload.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/DerivedData/FlickrSwift/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/DerivedData/FlickrSwift/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/MultipartFormData~partial.swiftdoc : /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Alamofire.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Download.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Error.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Manager.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/MultipartFormData.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Notifications.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ParameterEncoding.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Request.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Response.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ResponseSerialization.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Result.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Stream.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Timeline.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Upload.swift /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/shahid/Desktop/Projects/Swift2/Raywenderlich/RayCore/FlickrSwift/DerivedData/FlickrSwift/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
|
D
|
base/TaskBar.pp.ml: ANSITerminal Array Config Format IStd Int Mtime Mtime_clock Out_channel Printf SpecialChars String
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Translation to D of Linux's melf.h
*
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/melf.d, backend/melf.d)
*/
module dmd.backend.melf;
/* ELF file format */
alias Elf32_Half = ushort;
alias Elf32_Word = uint;
alias Elf32_Sword = int;
alias Elf32_Addr = uint;
alias Elf32_Off = uint;
alias elf_u8_f32 = uint;
enum EI_NIDENT = 16;
nothrow:
@safe:
// EHident
enum EI_MAG0 = 0; /* Identification byte offset 0*/
enum EI_MAG1 = 1; /* Identification byte offset 1*/
enum EI_MAG2 = 2; /* Identification byte offset 2*/
enum EI_MAG3 = 3; /* Identification byte offset 3*/
enum ELFMAG0 = 0x7f; /* Magic number byte 0 */
enum ELFMAG1 = 'E'; /* Magic number byte 1 */
enum ELFMAG2 = 'L'; /* Magic number byte 2 */
enum ELFMAG3 = 'F'; /* Magic number byte 3 */
enum EI_CLASS = 4; /* File class byte offset 4 */
enum ELFCLASSNONE = 0; // invalid
enum ELFCLASS32 = 1; /* 32-bit objects */
enum ELFCLASS64 = 2; /* 64-bit objects */
enum EI_DATA = 5; /* Data encoding byte offset 5 */
enum ELFDATANONE = 0; // invalid
enum ELFDATA2LSB = 1; /* 2's comp,lsb low address */
enum ELFDATA2MSB = 2; /* 2's comp,msb low address */
enum EI_VERSION = 6; /* Header version byte offset 6 */
//enum EV_CURRENT = 1; /* Current header format */
enum EI_OSABI = 7; /* OS ABI byte offset 7 */
enum ELFOSABI_SYSV = 0; /* UNIX System V ABI */
enum ELFOSABI_HPUX = 1; /* HP-UX */
enum ELFOSABI_NETBSD = 2;
enum ELFOSABI_LINUX = 3;
enum ELFOSABI_FREEBSD = 9;
enum ELFOSABI_OPENBSD = 12;
enum ELFOSABI_ARM = 97; /* ARM */
enum ELFOSABI_STANDALONE = 255; /* Standalone/embedded */
enum EI_ABIVERSION = 8; /* ABI version byte offset 8 */
enum EI_PAD = 9; /* Byte to start of padding */
// e_type
enum ET_NONE = 0; /* No specified file type */
enum ET_REL = 1; /* Relocatable object file */
enum ET_EXEC = 2; /* Executable file */
enum ET_DYN = 3; /* Dynamic link object file */
enum ET_CORE = 4; /* Core file */
enum ET_LOPROC = 0xff00; /* Processor low index */
enum ET_HIPROC = 0xffff; /* Processor hi index */
// e_machine
enum EM_386 = 3; /* Intel 80386 */
enum EM_486 = 6; /* Intel 80486 */
enum EM_X86_64 = 62; // Advanced Micro Devices X86-64 processor
// e_version
enum EV_NONE = 0; // invalid version
enum EV_CURRENT = 1; // Current file format
// e_ehsize
enum EH_HEADER_SIZE = 0x34;
// e_phentsize
enum EH_PHTENT_SIZE = 0x20;
// e_shentsize
enum EH_SHTENT_SIZE = 0x28;
struct Elf32_Ehdr
{
ubyte[EI_NIDENT] EHident; /* Header identification info */
Elf32_Half e_type; /* Object file type */
Elf32_Half e_machine; /* Machine architecture */
Elf32_Word e_version; /* File format version */
Elf32_Addr e_entry; /* Entry point virtual address */
Elf32_Off e_phoff; /* Program header table(PHT)offset */
Elf32_Off e_shoff; /* Section header table(SHT)offset */
Elf32_Word e_flags; /* Processor-specific flags */
Elf32_Half e_ehsize; /* Size of ELF header (bytes) */
Elf32_Half e_phentsize; /* Size of PHT (bytes) */
Elf32_Half e_phnum; /* Number of PHT entries */
Elf32_Half e_shentsize; /* Size of SHT entry in bytes */
Elf32_Half e_shnum; /* Number of SHT entries */
Elf32_Half e_shstrndx; /* SHT index for string table */
}
/* Section header. */
// sh_type
enum SHT_NULL = 0; /* SHT entry unused */
enum SHT_PROGBITS = 1; /* Program defined data */
enum SHT_SYMTAB = 2; /* Symbol table */
enum SHT_STRTAB = 3; /* String table */
enum SHT_RELA = 4; /* Relocations with addends */
enum SHT_HASHTAB = 5; /* Symbol hash table */
enum SHT_DYNAMIC = 6; /* String table for dynamic symbols */
enum SHT_NOTE = 7; /* Notes */
enum SHT_RESDATA = 8; /* Reserved data space */
enum SHT_NOBITS = SHT_RESDATA;
enum SHT_REL = 9; /* Relocations no addends */
enum SHT_RESTYPE = 10; /* Reserved section type*/
enum SHT_DYNTAB = 11; /* Dynamic linker symbol table */
enum SHT_INIT_ARRAY = 14; /* Array of constructors */
enum SHT_FINI_ARRAY = 15; /* Array of destructors */
enum SHT_GROUP = 17; /* Section group (COMDAT) */
enum SHT_SYMTAB_SHNDX = 18; /* Extended section indices */
// sh_flags
enum SHF_WRITE = (1 << 0); /* Writable during execution */
enum SHF_ALLOC = (1 << 1); /* In memory during execution */
enum SHF_EXECINSTR = (1 << 2); /* Executable machine instructions*/
enum SHF_MERGE = 0x10;
enum SHF_STRINGS = 0x20;
enum SHF_INFO_LINK = 0x40;
enum SHF_LINK_ORDER = 0x80;
enum SHF_OS_NONCONFORMING = 0x100;
enum SHF_GROUP = 0x200; // Member of a section group
enum SHF_TLS = 0x400; /* Thread local */
enum SHF_MASKPROC = 0xf0000000; /* Mask for processor-specific */
struct Elf32_Shdr
{
Elf32_Word sh_name; /* String table offset for section name */
Elf32_Word sh_type; /* Section type */
Elf32_Word sh_flags; /* Section attribute flags */
Elf32_Addr sh_addr; /* Starting virtual memory address */
Elf32_Off sh_offset; /* Offset to section in file */
Elf32_Word sh_size; /* Size of section */
Elf32_Word sh_link; /* Index to optional related section */
Elf32_Word sh_info; /* Optional extra section information */
Elf32_Word sh_addralign; /* Required section alignment */
Elf32_Word sh_entsize; /* Size of fixed size section entries */
}
// Special Section Header Table Indices
enum SHN_UNDEF = 0; /* Undefined section */
enum SHN_LORESERVE = 0xff00; /* Start of reserved indices */
enum SHN_LOPROC = 0xff00; /* Start of processor-specific */
enum SHN_HIPROC = 0xff1f; /* End of processor-specific */
enum SHN_LOOS = 0xff20; /* Start of OS-specific */
enum SHN_HIOS = 0xff3f; /* End of OS-specific */
enum SHN_ABS = 0xfff1; /* Absolute value for symbol references */
enum SHN_COMMON = 0xfff2; /* Symbol defined in common section */
enum SHN_XINDEX = 0xffff; /* Index is in extra table. */
enum SHN_HIRESERVE = 0xffff; /* End of reserved indices */
/* Symbol Table */
// st_info
ubyte ELF32_ST_BIND(ubyte s) { return s >> 4; }
ubyte ELF32_ST_TYPE(ubyte s) { return s & 0xf; }
ubyte ELF32_ST_INFO(ubyte b, ubyte t) { return cast(ubyte)((b << 4) + (t & 0xf)); }
enum STB_LOCAL = 0; /* Local symbol */
enum STB_GLOBAL = 1; /* Global symbol */
enum STB_WEAK = 2; /* Weak symbol */
enum ST_NUM_BINDINGS = 3; /* Number of defined types. */
enum STB_LOOS = 10; /* Start of OS-specific */
enum STB_HIOS = 12; /* End of OS-specific */
enum STB_LOPROC = 13; /* Start of processor-specific */
enum STB_HIPROC = 15; /* End of processor-specific */
enum STT_NOTYPE = 0; /* Symbol type is unspecified */
enum STT_OBJECT = 1; /* Symbol is a data object */
enum STT_FUNC = 2; /* Symbol is a code object */
enum STT_SECTION = 3; /* Symbol associated with a section */
enum STT_FILE = 4; /* Symbol's name is file name */
enum STT_COMMON = 5;
enum STT_TLS = 6;
enum STT_NUM = 5; /* Number of defined types. */
enum STT_LOOS = 11; /* Start of OS-specific */
enum STT_HIOS = 12; /* End of OS-specific */
enum STT_LOPROC = 13; /* Start of processor-specific */
enum STT_HIPROC = 15; /* End of processor-specific */
enum STV_DEFAULT = 0; /* Default symbol visibility rules */
enum STV_INTERNAL = 1; /* Processor specific hidden class */
enum STV_HIDDEN = 2; /* Sym unavailable in other modules */
enum STV_PROTECTED = 3; /* Not preemptible, not exported */
struct Elf32_Sym
{
Elf32_Word st_name; /* string table index for symbol name */
Elf32_Addr st_value; /* Associated symbol value */
Elf32_Word st_size; /* Symbol size */
ubyte st_info; /* Symbol type and binding */
ubyte st_other; /* Currently not defined */
Elf32_Half st_shndx; /* SHT index for symbol definition */
}
/* Relocation table entry without addend (in section of type SHT_REL). */
// r_info
// 386 Relocation types
uint ELF32_R_SYM(uint i) { return i >> 8; } /* Symbol idx */
uint ELF32_R_TYPE(uint i) { return i & 0xff; } /* Type of relocation */
uint ELF32_R_INFO(uint i, uint t) { return ((i << 8) + (t & 0xff)); }
enum R_386_NONE = 0; /* No reloc */
enum R_386_32 = 1; /* Symbol value 32 bit */
enum R_386_PC32 = 2; /* PC relative 32 bit */
enum R_386_GOT32 = 3; /* 32 bit GOT entry */
enum R_386_PLT32 = 4; /* 32 bit PLT address */
enum R_386_COPY = 5; /* Copy symbol at runtime */
enum R_386_GLOB_DAT = 6; /* Create GOT entry */
enum R_386_JMP_SLOT = 7; /* Create PLT entry */
enum R_386_RELATIVE = 8; /* Adjust by program base */
enum R_386_GOTOFF = 9; /* 32 bit offset to GOT */
enum R_386_GOTPC = 10; /* 32 bit PC relative offset to GOT */
enum R_386_TLS_TPOFF = 14;
enum R_386_TLS_IE = 15;
enum R_386_TLS_GOTIE = 16;
enum R_386_TLS_LE = 17; /* negative offset relative to static TLS */
enum R_386_TLS_GD = 18;
enum R_386_TLS_LDM = 19;
enum R_386_TLS_GD_32 = 24;
enum R_386_TLS_GD_PUSH = 25;
enum R_386_TLS_GD_CALL = 26;
enum R_386_TLS_GD_POP = 27;
enum R_386_TLS_LDM_32 = 28;
enum R_386_TLS_LDM_PUSH = 29;
enum R_386_TLS_LDM_CALL = 30;
enum R_386_TLS_LDM_POP = 31;
enum R_386_TLS_LDO_32 = 32;
enum R_386_TLS_IE_32 = 33;
enum R_386_TLS_LE_32 = 34;
enum R_386_TLS_DTPMOD32 = 35;
enum R_386_TLS_DTPOFF32 = 36;
enum R_386_TLS_TPOFF32 = 37;
struct Elf32_Rel
{
Elf32_Addr r_offset; /* Address */
Elf32_Word r_info; /* Relocation type and symbol index */
}
/* stabs debug records */
// DBtype
enum DBT_UNDEF = 0x00; /* undefined symbol */
enum DBT_EXT = 0x01; /* exernal modifier */
enum DBT_ABS = 0x02; /* absolute */
enum DBT_TEXT = 0x04; /* code text */
enum DBT_DATA = 0x06; /* data */
enum DBT_BSS = 0x08; /* BSS */
enum DBT_INDR = 0x0a; /* indirect to another symbol */
enum DBT_COMM = 0x12; /* common -visible after shr'd lib link */
enum DBT_SETA = 0x14; /* Absolue set element */
enum DBT_SETT = 0x16; /* code text segment set element */
enum DBT_SETD = 0x18; /* data segment set element */
enum DBT_SETB = 0x1a; /* BSS segment set element */
enum DBT_SETV = 0x1c; /* Pointer to set vector */
enum DBT_WARNING = 0x1e; /* print warning during link */
enum DBT_FN = 0x1f; /* name of object file */
enum DBT_GSYM = 0x20; /* global symbol */
enum DBT_FUN = 0x24; /* function name */
enum DBT_STSYM = 0x26; /* static data */
enum DBT_LCSYM = 0x28; /* static bss */
enum DBT_MAIN = 0x2a; /* main routine */
enum DBT_RO = 0x2c; /* read only */
enum DBT_OPT = 0x3c; /* target option? */
enum DBT_REG = 0x40; /* register variable */
enum DBT_TLINE = 0x44; /* text line number */
enum DBT_DLINE = 0x46; /* dat line number */
enum DBT_BLINE = 0x48; /* bss line number */
enum DBT_STUN = 0x62; /* structure or union */
enum DBT_SRCF = 0x64; /* source file */
enum DBT_AUTO = 0x80; /* stack variable */
enum DBT_TYPE = 0x80; /* type definition */
enum DBT_INCS = 0x84; /* include file start */
enum DBT_PARAM = 0xa0; /* parameter */
enum DBT_INCE = 0xa2; /* include file end */
struct elf_stab
{
Elf32_Word DBstring; /* string table index for the symbol */
elf_u8_f32 DBtype; /* type of the symbol */
elf_u8_f32 DBmisc; /* misc. info */
Elf32_Half DBdesc; /* description field */
Elf32_Word DBvalu; /* symbol value */
}
/* Program header. */
// PHtype
enum PHT_NULL = 0; /* SHT entry unused */
struct Elf32_Phdr
{
Elf32_Word PHtype; /* Program type */
Elf32_Off PHoff; /* Offset to segment in file */
Elf32_Addr PHvaddr; /* Starting virtual memory address */
Elf32_Addr PHpaddr; /* Starting absolute memory address */
Elf32_Word PHfilesz; /* Size of file image */
Elf32_Word PHmemsz; /* Size of memory image */
Elf32_Word PHflags; /* Program attribute flags */
Elf32_Word PHalign; /* Program loading alignment */
}
/* Legal values for sh_flags (section flags). */
/***************************** 64 bit Elf *****************************************/
alias Elf64_Addr = ulong;
alias Elf64_Off = ulong;
alias Elf64_Xword = ulong;
alias Elf64_Sxword = long;
alias Elf64_Sword = int;
alias Elf64_Word = uint;
alias Elf64_Half = ushort;
struct Elf64_Ehdr
{
ubyte[EI_NIDENT] EHident; /* Header identification info */
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
}
struct Elf64_Shdr
{
Elf64_Word sh_name;
Elf64_Word sh_type;
Elf64_Xword sh_flags;
Elf64_Addr sh_addr;
Elf64_Off sh_offset;
Elf64_Xword sh_size;
Elf64_Word sh_link;
Elf64_Word sh_info;
Elf64_Xword sh_addralign;
Elf64_Xword sh_entsize;
}
struct Elf64_Phdr
{
Elf64_Word p_type;
Elf64_Word p_flags;
Elf64_Off p_offset;
Elf64_Addr p_vaddr;
Elf64_Addr p_paddr;
Elf64_Xword p_filesz;
Elf64_Xword p_memsz;
Elf64_Xword p_align;
}
struct Elf64_Sym
{
Elf64_Word st_name;
ubyte st_info;
ubyte st_other;
Elf64_Half st_shndx;
Elf64_Addr st_value;
Elf64_Xword st_size;
}
ubyte ELF64_ST_BIND(ubyte s) { return ELF32_ST_BIND(s); }
ubyte ELF64_ST_TYPE(ubyte s) { return ELF32_ST_TYPE(s); }
ubyte ELF64_ST_INFO(ubyte b, ubyte t) { return ELF32_ST_INFO(b,t); }
// r_info
uint ELF64_R_SYM(ulong i) { return cast(Elf64_Word)(i>>32); }
uint ELF64_R_TYPE(ulong i) { return cast(Elf64_Word)(i & 0xFFFF_FFFF); }
ulong ELF64_R_INFO(ulong s, ulong t) { return ((cast(Elf64_Xword)s)<<32)|cast(Elf64_Word)t; }
// X86-64 Relocation types
enum R_X86_64_NONE = 0; // -- No relocation
enum R_X86_64_64 = 1; // 64 Direct 64 bit
enum R_X86_64_PC32 = 2; // 32 PC relative 32 bit signed
enum R_X86_64_GOT32 = 3; // 32 32 bit GOT entry
enum R_X86_64_PLT32 = 4; // 32 bit PLT address
enum R_X86_64_COPY = 5; // -- Copy symbol at runtime
enum R_X86_64_GLOB_DAT = 6; // 64 Create GOT entry
enum R_X86_64_JUMP_SLOT = 7; // 64 Create PLT entry
enum R_X86_64_RELATIVE = 8; // 64 Adjust by program base
enum R_X86_64_GOTPCREL = 9; // 32 32 bit signed pc relative offset to GOT
enum R_X86_64_32 = 10; // 32 Direct 32 bit zero extended
enum R_X86_64_32S = 11; // 32 Direct 32 bit sign extended
enum R_X86_64_16 = 12; // 16 Direct 16 bit zero extended
enum R_X86_64_PC16 = 13; // 16 16 bit sign extended pc relative
enum R_X86_64_8 = 14; // 8 Direct 8 bit sign extended
enum R_X86_64_PC8 = 15; // 8 8 bit sign extended pc relative
enum R_X86_64_DTPMOD64 = 16; // 64 ID of module containing symbol
enum R_X86_64_DTPOFF64 = 17; // 64 Offset in TLS block
enum R_X86_64_TPOFF64 = 18; // 64 Offset in initial TLS block
enum R_X86_64_TLSGD = 19; // 32 PC relative offset to GD GOT block
enum R_X86_64_TLSLD = 20; // 32 PC relative offset to LD GOT block
enum R_X86_64_DTPOFF32 = 21; // 32 Offset in TLS block
enum R_X86_64_GOTTPOFF = 22; // 32 PC relative offset to IE GOT entry
enum R_X86_64_TPOFF32 = 23; // 32 Offset in initial TLS block
enum R_X86_64_PC64 = 24; // 64
enum R_X86_64_GOTOFF64 = 25; // 64
enum R_X86_64_GOTPC32 = 26; // 32
enum R_X86_64_GNU_VTINHERIT = 250; // GNU C++ hack
enum R_X86_64_GNU_VTENTRY = 251; // GNU C++ hack
struct Elf64_Rel
{
Elf64_Addr r_offset;
Elf64_Xword r_info;
}
struct Elf64_Rela
{
Elf64_Addr r_offset;
Elf64_Xword r_info;
Elf64_Sxword r_addend;
}
// Section Group Flags
enum GRP_COMDAT = 1;
enum GRP_MASKOS = 0x0ff0_0000;
enum GRP_MASKPROC = 0xf000_0000;
|
D
|
# FIXED
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/rom_jt.c
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/r1/rom_init.c
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/bcomdef.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/comdef.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h
Startup/rom_jt.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdint.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/inc/hal_defs.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_types.h
Startup/rom_jt.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdbool.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/../inc/hw_chip_def.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/rom_jt.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/map_direct.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/common/cc26xx/onboard.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_mcu.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_nvic.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_ints.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_gpio.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_memmap.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/systick.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/debug.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/interrupt.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/cpu.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_cpu_scs.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../driverlib/rom.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/uart.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_uart.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/gpio.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/flash.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_flash.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_aon_sysctl.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_fcfg1.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/ioc.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_ioc.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/icall/src/inc/icall.h
Startup/rom_jt.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdlib.h
Startup/rom_jt.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/linkage.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/inc/hal_assert.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/inc/hal_sleep.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal.h
Startup/rom_jt.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/limits.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_memory.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_timers.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_pwrmgr.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_bufmgr.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/vims.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_vims.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_tl.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_data.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_event.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_tl.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_trng_wrapper.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/trng.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_trng.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/cc26xx/mb.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_rfc_dbell.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/cc26xx/rf_hal.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_config.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_user_config.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/icall/inc/ble_user_config.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/icall/inc/ble_dispatch.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_sysctl.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_sleep.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_scheduler.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/ecc_rom.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_common.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_enc.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_wl.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_timer_drift.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ble.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_rat.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_rfc_rat.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_privacy.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/r1/common_rom_init.c
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/services/src/aes/cc26xx/aes.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/services/src/aes/cc26xx/ccm.h
Startup/rom_jt.obj: C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/services/src/aes/cc26xx/aes_ccm_api.h
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/rom_jt.c:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/r1/rom_init.c:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/bcomdef.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/comdef.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdint.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/inc/hal_defs.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_types.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdbool.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/../inc/hw_chip_def.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/rom_jt.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/map_direct.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/common/cc26xx/onboard.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_mcu.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_nvic.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_ints.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_gpio.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_memmap.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/systick.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/debug.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/interrupt.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/cpu.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_cpu_scs.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../driverlib/rom.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/uart.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_uart.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/gpio.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/flash.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_flash.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_aon_sysctl.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_fcfg1.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/ioc.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_ioc.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/icall/src/inc/icall.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdlib.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/linkage.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/inc/hal_assert.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/inc/hal_sleep.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/limits.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_memory.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_timers.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_pwrmgr.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/osal/src/inc/osal_bufmgr.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/vims.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_vims.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_tl.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_data.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_event.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/hci_tl.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_trng_wrapper.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/trng.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/driverlib/../inc/hw_trng.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/cc26xx/mb.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_rfc_dbell.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/cc26xx/rf_hal.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_config.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_user_config.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/icall/inc/ble_user_config.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/icall/inc/ble_dispatch.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_sysctl.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_sleep.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_scheduler.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/inc/ecc_rom.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_common.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_enc.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_wl.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_timer_drift.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ble.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_rat.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/devices/cc13x0/inc/hw_rfc_rat.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/controller/cc26xx/inc/ll_privacy.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/rom/r1/common_rom_init.c:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/services/src/aes/cc26xx/aes.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/services/src/aes/cc26xx/ccm.h:
C:/ti/simplelink_cc13x0_sdk_1_60_00_21/source/ti/blestack/services/src/aes/cc26xx/aes_ccm_api.h:
|
D
|
/Users/Thomas_Stuart/Desktop/FakeTumblr-master/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/MultipartFormData.o : /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/MultipartFormData.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Timeline.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Alamofire.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Response.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/TaskDelegate.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/SessionDelegate.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Validation.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/SessionManager.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/AFError.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Notifications.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Result.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Request.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/Thomas_Stuart/Desktop/FakeTumblr-master/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/MultipartFormData~partial.swiftmodule : /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/MultipartFormData.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Timeline.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Alamofire.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Response.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/TaskDelegate.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/SessionDelegate.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Validation.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/SessionManager.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/AFError.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Notifications.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Result.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Request.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/Thomas_Stuart/Desktop/FakeTumblr-master/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/MultipartFormData~partial.swiftdoc : /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/MultipartFormData.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Timeline.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Alamofire.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Response.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/TaskDelegate.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/SessionDelegate.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Validation.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/SessionManager.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/AFError.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Notifications.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Result.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/Request.swift /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Thomas_Stuart/Desktop/FakeTumblr-master/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/run/media/andreby/Docs/GithubCodes/learn_rust/actix-demo/target/debug/build/encoding_rs-22e386b1a1179d62/build_script_build-22e386b1a1179d62: /run/media/andreby/Docs/GithubCodes/learn_rust/actix-demo/~/.cargo/registry/src/github.com-1ecc6299db9ec823/encoding_rs-0.8.20/build.rs
/run/media/andreby/Docs/GithubCodes/learn_rust/actix-demo/target/debug/build/encoding_rs-22e386b1a1179d62/build_script_build-22e386b1a1179d62.d: /run/media/andreby/Docs/GithubCodes/learn_rust/actix-demo/~/.cargo/registry/src/github.com-1ecc6299db9ec823/encoding_rs-0.8.20/build.rs
/run/media/andreby/Docs/GithubCodes/learn_rust/actix-demo/~/.cargo/registry/src/github.com-1ecc6299db9ec823/encoding_rs-0.8.20/build.rs:
|
D
|
module correct;
dafaenfai;
int[] g;
struct Foo {
int a;
void b() {
}
struct Bar {
int c;
}
}
/**
* Params:
* x = something cool
*/
int foo(int x) {
int a = 0;
if (a == 1) {
int b, c, d;
}
for (int i = 0; i < 10; ++i) {
int e;
int j;
e = 7;
}
while (0) {
int f = 5;
}
foreach(k; 0..3) {
int g;
g = 2;
}
int z = a;
return 0;
}
int main(string[] args) {
int y = 0;
int x = 1;
int xx = 2;
int yy = 0;
int k = xx;
return 0;
}
int bar() {return 0;}
|
D
|
// Written in the D programming language.
/*
* main.d
*
* Copyright 2013 Nick Treleaven <nick dot treleaven at btinternet com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
enum OpType
{
braceL,
braceR,
bracketL,
bracketR,
colon,
divide,
divideEquals,
//~ equals,
goesTo,
not,
semiColon,
}
enum TokenType
{
identifier,
//~ keyword,
operator,
string,
}
struct Token
{
TokenType type;
OpType op;
string header;
string src;
string after;
size_t index;
Token next()
{
return tokens[index + 1];
}
bool hasNext()
{
return index + 1 < tokens.length;
}
}
import std.algorithm;
import std.ascii;
import std.range;
import std.stdio;
import std.string;
import std.exception;
Token[] tokens;
size_t tokenIndex;
OpType[string] ops;
size_t maxOpLen;
size_t line = 1;
void error(string msg)
{
import std.c.stdlib;
stderr.writefln("(%s): Error: %s", line, msg);
exit(1);
}
alias drop = popFront;
// Note: some ranges don't have persistent front e.g. ByLine
auto takeFront(T)(T[] r)
{
auto v = r.front;
r.drop;
return v;
}
string readHeader(ref string text)
{
auto start = text;
while (text[0].isWhite)
{
do
{
if (text[0] == '\r')
{
if (text[1] == '\n')
text.drop;
}
else if (text[0] != '\n')
break;
line++;
} while (0);
text.drop;
}
start.length -= text.length;
return start;
}
bool isOpChar(dchar c)
{
return c.isPunctuation && c != '_' && c != '@';
}
Token readToken(ref string text)
{
with (TokenType) {
Token tok;
tok.header = readHeader(text);
auto start = text;
auto c = text.takeFront;
if (c.isOpChar)
{
tok.type = operator;
auto len = 1;
if (text[0].isOpChar)
{
len = 2;
text.drop;
}
tok.src = start[0..len];
auto ptr = tok.src in ops;
tok.op = *ptr;
}
else if (c.isAlpha)
{
tok.type = identifier;
auto len = 0;
do len++; while (text.takeFront.isAlphaNum);
tok.src = start[0..len];
}
else
error(format("Unknown character '%s'", c));
return tok;
}}
static this()
{
with (OpType)
ops = [
"{":braceL,
"}":braceR,
"(":bracketL,
")":bracketR,
":":colon,
"/":divide,
"/=":divideEquals,
//~ "=":equals,
"=>":goesTo,
"!":not,
";":semiColon,
];
maxOpLen = ops.keys.map!(s => s.length).reduce!((a, b) => a + b);
}
void main(string[] args)
{
import std.file;
auto text = args[1].readText;
enforce(!text.find('\0'), "Null bytes not allowed!");
text ~= '\0'; // to avoid checking text.length
Token tok;
do
{
tok = readToken(text);
tok.index = tokenIndex++;
tokens ~= tok;
} while (text[0] != '\0');
tok = tokens[0];
while (true)
{
parse(tok);
if (!tok.hasNext)
break;
tok = tok.next;
}
}
void parse(ref Token tok)
{
version (None)
with (OpType)
{
if (tok.match(identifier, colon, braceL, tok))
{
if (tok.peek.type != braceR)
warn("Note: Labelled blocks are not scoped (move label inside block)");
}
Token tok2;
// 'T& v' but not 'T &v', 'x & y'
if (tok.header == "" && tok.match(identifier, ampersand, tok2))
{
Token t = tok2.next;
// not 'T&v' but '(T&)', '[T&]' ok
if ((t.header.length && t.header[0].isWhite) ||
")]".canFind(t.src[0]))
{
tok.before = "NonNull!(";
tok2.src = ")";
}
tok = tok2;
}
// version(!Foo) -> static if(!Version!"Foo")
if (tok.match("version", bracketL, not, identifier, tok2, bracketR))
{
tok.src = "static if";
tok2.before = "Version!\"";
tok2.after = "\"";
tok = tok2.next;
}
}
// incompatible
version (E)
with (OpType)
{
// typeof(1 / 2) == real;
if (tok.type == divide)
tok.after ~= " cast(real)";
}
}
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Compute common subexpressions for non-optimized builds.
*
* Copyright: Copyright (C) 1985-1995 by Symantec
* Copyright (C) 2000-2020 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: https://github.com/dlang/dmd/blob/master/src/dmd/backend/cgcs.d
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/cgcs.d
*/
module dmd.backend.cgcs;
version (SPP)
{
}
else
{
import core.stdc.stdio;
import core.stdc.stdlib;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.code;
import dmd.backend.el;
import dmd.backend.global;
import dmd.backend.oper;
import dmd.backend.ty;
import dmd.backend.type;
import dmd.backend.barray;
import dmd.backend.dlist;
import dmd.backend.dvec;
nothrow:
/*******************************
* Eliminate common subexpressions across extended basic blocks.
* String together as many blocks as we can.
*/
public extern (C++) void comsubs()
{
//static int xx;
//printf("comsubs() %d\n", ++xx);
//debugx = (xx == 37);
debug if (debugx) printf("comsubs(%p)\n",startblock);
// No longer do we just compute Bcount. We now eliminate unreachable
// blocks.
block_compbcount(); // eliminate unreachable blocks
version (SCPP)
{
if (errcnt)
return;
}
if (!csvec)
{
csvec = vec_calloc(CSVECDIM);
}
block* bln;
for (block* bl = startblock; bl; bl = bln)
{
bln = bl.Bnext;
if (!bl.Belem)
continue; /* if no expression or no parents */
// Count up n, the number of blocks in this extended basic block (EBB)
int n = 1; // always at least one block in EBB
auto blc = bl;
while (bln && list_nitems(bln.Bpred) == 1 &&
((blc.BC == BCiftrue &&
blc.nthSucc(1) == bln) ||
(blc.BC == BCgoto && blc.nthSucc(0) == bln)
) &&
bln.BC != BCasm // no CSE's extending across ASM blocks
)
{
n++; // add block to EBB
blc = bln;
bln = blc.Bnext;
}
vec_clear(csvec);
hcstab.setLength(0);
hcsarray.touchstari = 0;
hcsarray.touchfunci[0] = 0;
hcsarray.touchfunci[1] = 0;
bln = bl;
while (n--) // while more blocks in EBB
{
debug if (debugx)
printf("cses for block %p\n",bln);
if (bln.Belem)
ecom(&bln.Belem); // do the tree
bln = bln.Bnext;
}
}
debug if (debugx)
printf("done with comsubs()\n");
}
/*******************************
*/
public extern (C++) void cgcs_term()
{
vec_free(csvec);
csvec = null;
debug debugw && printf("freeing hcstab\n");
//hcstab.dtor(); // cache allocation for next iteration
}
/***********************************************************************/
private:
alias hash_t = uint; // for hash values
/*********************************
* Struct for each elem:
* Helem pointer to elem
* Hhash hash value for the elem
*/
struct HCS
{
elem* Helem;
hash_t Hhash;
}
struct HCSArray
{
uint touchstari;
uint[2] touchfunci;
}
__gshared
{
Barray!HCS hcstab; // array of hcs's
HCSArray hcsarray;
// Use a bit vector for quick check if expression is possibly in hcstab[].
// This results in much faster compiles when hcstab[] gets big.
vec_t csvec; // vector of used entries
enum CSVECDIM = 16001; //8009 //3001 // dimension of csvec (should be prime)
}
/*************************
* Eliminate common subexpressions for an element.
*/
void ecom(elem **pe)
{
auto e = *pe;
assert(e);
elem_debug(e);
debug assert(e.Ecount == 0);
//assert(e.Ecomsub == 0);
const tym = tybasic(e.Ety);
const op = e.Eoper;
switch (op)
{
case OPconst:
case OPrelconst:
break;
case OPvar:
if (e.EV.Vsym.ty() & mTYshared)
return; // don't cache shared variables
break;
case OPstreq:
case OPpostinc:
case OPpostdec:
case OPeq:
case OPaddass:
case OPminass:
case OPmulass:
case OPdivass:
case OPmodass:
case OPshrass:
case OPashrass:
case OPshlass:
case OPandass:
case OPxorass:
case OPorass:
case OPvecsto:
/* Reverse order of evaluation for double op=. This is so that */
/* the pushing of the address of the second operand is easier. */
/* However, with the 8087 we don't need the kludge. */
if (op != OPeq && tym == TYdouble && !config.inline8087)
{
if (!OTleaf(e.EV.E1.Eoper))
ecom(&e.EV.E1.EV.E1);
ecom(&e.EV.E2);
}
else
{
/* Don't mark the increment of an i++ or i-- as a CSE, if it */
/* can be done with an INC or DEC instruction. */
if (!(OTpost(op) && elemisone(e.EV.E2)))
ecom(&e.EV.E2); /* evaluate 2nd operand first */
case OPnegass:
if (!OTleaf(e.EV.E1.Eoper)) /* if lvalue is an operator */
{
if (e.EV.E1.Eoper != OPind)
elem_print(e);
assert(e.EV.E1.Eoper == OPind);
ecom(&(e.EV.E1.EV.E1));
}
}
touchlvalue(e.EV.E1);
if (!OTpost(op)) /* lvalue of i++ or i-- is not a cse*/
{
const hash = cs_comphash(e.EV.E1);
vec_setbit(hash % CSVECDIM,csvec);
addhcstab(e.EV.E1,hash); // add lvalue to hcstab[]
}
return;
case OPbtc:
case OPbts:
case OPbtr:
case OPcmpxchg:
ecom(&e.EV.E1);
ecom(&e.EV.E2);
touchfunc(0); // indirect assignment
return;
case OPandand:
case OPoror:
{
ecom(&e.EV.E1);
const lengthSave = hcstab.length;
auto hcsarraySave = hcsarray;
ecom(&e.EV.E2);
hcsarray = hcsarraySave; // no common subs by E2
hcstab.setLength(lengthSave);
return; /* if comsub then logexp() will */
}
case OPcond:
{
ecom(&e.EV.E1);
const lengthSave = hcstab.length;
auto hcsarraySave = hcsarray;
ecom(&e.EV.E2.EV.E1); // left condition
hcsarray = hcsarraySave; // no common subs by E2
hcstab.setLength(lengthSave);
ecom(&e.EV.E2.EV.E2); // right condition
hcsarray = hcsarraySave; // no common subs by E2
hcstab.setLength(lengthSave);
return; // can't be a common sub
}
case OPcall:
case OPcallns:
ecom(&e.EV.E2); /* eval right first */
goto case OPucall;
case OPucall:
case OPucallns:
ecom(&e.EV.E1);
touchfunc(1);
return;
case OPstrpar: /* so we don't break logexp() */
case OPinp: /* never CSE the I/O instruction itself */
case OPprefetch: // don't CSE E2 or the instruction
ecom(&e.EV.E1);
goto case OPasm;
case OPasm:
case OPstrthis: // don't CSE these
case OPframeptr:
case OPgot:
case OPctor:
case OPdtor:
case OPdctor:
case OPmark:
return;
case OPddtor:
touchall();
ecom(&e.EV.E1);
touchall();
return;
case OPparam:
case OPoutp:
ecom(&e.EV.E1);
goto case OPinfo;
case OPinfo:
ecom(&e.EV.E2);
return;
case OPcomma:
ecom(&e.EV.E1);
ecom(&e.EV.E2);
return;
case OPremquo:
ecom(&e.EV.E1);
ecom(&e.EV.E2);
break;
case OPvp_fp:
case OPcvp_fp:
ecom(&e.EV.E1);
touchaccess(hcstab, e);
break;
case OPind:
ecom(&e.EV.E1);
/* Generally, CSEing a *(double *) results in worse code */
if (tyfloating(tym))
return;
if (tybasic(e.EV.E1.Ety) == TYsharePtr)
return;
break;
case OPstrcpy:
case OPstrcat:
case OPmemcpy:
case OPmemset:
ecom(&e.EV.E2);
goto case OPsetjmp;
case OPsetjmp:
ecom(&e.EV.E1);
touchfunc(0);
return;
default: /* other operators */
if (!OTbinary(e.Eoper))
WROP(e.Eoper);
assert(OTbinary(e.Eoper));
goto case OPadd;
case OPadd:
case OPmin:
case OPmul:
case OPdiv:
case OPor:
case OPxor:
case OPand:
case OPeqeq:
case OPne:
case OPscale:
case OPyl2x:
case OPyl2xp1:
ecom(&e.EV.E1);
ecom(&e.EV.E2);
break;
case OPstring:
case OPaddr:
case OPbit:
WROP(e.Eoper);
elem_print(e);
assert(0); /* optelem() should have removed these */
/* NOTREACHED */
// Explicitly list all the unary ops for speed
case OPnot: case OPcom: case OPneg: case OPuadd:
case OPabs: case OPrndtol: case OPrint:
case OPpreinc: case OPpredec:
case OPbool: case OPstrlen: case OPs16_32: case OPu16_32:
case OPs32_d: case OPu32_d: case OPd_s16: case OPs16_d: case OP32_16:
case OPf_d:
case OPld_d:
case OPc_r: case OPc_i:
case OPu8_16: case OPs8_16: case OP16_8:
case OPu32_64: case OPs32_64: case OP64_32: case OPmsw:
case OPu64_128: case OPs64_128: case OP128_64:
case OPs64_d: case OPd_u64: case OPu64_d:
case OPstrctor: case OPu16_d: case OPd_u16:
case OParrow:
case OPvoid:
case OPbsf: case OPbsr: case OPbswap: case OPpopcnt: case OPvector:
case OPld_u64:
case OPsqrt: case OPsin: case OPcos:
case OPoffset: case OPnp_fp: case OPnp_f16p: case OPf16p_np:
case OPvecfill:
ecom(&e.EV.E1);
break;
case OPd_ld:
return;
case OPd_f:
{
const op1 = e.EV.E1.Eoper;
if (config.fpxmmregs &&
(op1 == OPs32_d ||
I64 && (op1 == OPs64_d || op1 == OPu32_d))
)
ecom(&e.EV.E1.EV.E1); // e and e1 ops are fused (see xmmcnvt())
else
ecom(&e.EV.E1);
break;
}
case OPd_s32:
case OPd_u32:
case OPd_s64:
if (e.EV.E1.Eoper == OPf_d && config.fpxmmregs)
ecom(&e.EV.E1.EV.E1); // e and e1 ops are fused (see xmmcnvt());
else
ecom(&e.EV.E1);
break;
case OPhalt:
return;
}
/* don't CSE structures or unions or volatile stuff */
if (tym == TYstruct ||
tym == TYvoid ||
e.Ety & mTYvolatile)
return;
if (tyfloating(tym) && config.inline8087)
{
/* can CSE XMM code, but not x87
*/
if (!(config.fpxmmregs && tyxmmreg(tym)))
return;
}
const hash = cs_comphash(e); /* must be AFTER leaves are done */
/* Search for a match in hcstab[].
* Search backwards, as most likely matches will be towards the end
* of the list.
*/
debug if (debugx) printf("elem: %p hash: %6d\n",e,hash);
int csveci = hash % CSVECDIM;
if (vec_testbit(csveci,csvec))
{
foreach_reverse (i, ref hcs; hcstab[])
{
debug if (debugx)
printf("i: %2d Hhash: %6d Helem: %p\n",
i,hcs.Hhash,hcs.Helem);
elem* ehash;
if (hash == hcs.Hhash && (ehash = hcs.Helem) != null)
{
/* if elems are the same and we still have room for more */
if (el_match(e,ehash) && ehash.Ecount < 0xFF)
{
/* Make sure leaves are also common subexpressions
* to avoid false matches.
*/
if (!OTleaf(op))
{
if (!e.EV.E1.Ecount)
continue;
if (OTbinary(op) && !e.EV.E2.Ecount)
continue;
}
ehash.Ecount++;
*pe = ehash;
debug if (debugx)
printf("**MATCH** %p with %p\n",e,*pe);
el_free(e);
return;
}
}
}
}
else
vec_setbit(csveci,csvec);
addhcstab(e,hash); // add this elem to hcstab[]
}
/**************************
* Compute hash function for elem e.
*/
hash_t cs_comphash(const elem *e)
{
elem_debug(e);
const op = e.Eoper;
hash_t hash = (e.Ety & (mTYbasic | mTYconst | mTYvolatile)) + (op << 8);
if (!OTleaf(op))
{
hash += cast(size_t) e.EV.E1;
if (OTbinary(op))
hash += cast(size_t) e.EV.E2;
}
else
{
hash += e.EV.Vint;
if (op == OPvar || op == OPrelconst)
hash += cast(size_t) e.EV.Vsym;
}
return hash;
}
/****************************
* Add an elem to the common subexpression table.
*/
void addhcstab(elem *e, hash_t hash)
{
hcstab.push(HCS(e, hash));
}
/***************************
* "touch" the elem.
* If it is a pointer, "touch" all the suspects
* who could be pointed to.
* Eliminate common subs that are indirect loads.
*/
void touchlvalue(elem *e)
{
if (e.Eoper == OPind) /* if indirect store */
{
/* NOTE: Some types of array assignments do not need
* to touch all variables. (Like a[5], where a is an
* array instead of a pointer.)
*/
touchfunc(0);
return;
}
foreach_reverse (ref hcs; hcstab[])
{
if (hcs.Helem &&
hcs.Helem.EV.Vsym == e.EV.Vsym)
hcs.Helem = null;
}
if (!(e.Eoper == OPvar || e.Eoper == OPrelconst))
elem_print(e);
assert(e.Eoper == OPvar || e.Eoper == OPrelconst);
switch (e.EV.Vsym.Sclass)
{
case SCregpar:
case SCregister:
case SCpseudo:
break;
case SCauto:
case SCparameter:
case SCfastpar:
case SCshadowreg:
case SCbprel:
if (e.EV.Vsym.Sflags & SFLunambig)
break;
goto case SCstatic;
case SCstatic:
case SCextern:
case SCglobal:
case SClocstat:
case SCcomdat:
case SCinline:
case SCsinline:
case SCeinline:
case SCcomdef:
touchstar();
break;
default:
elem_print(e);
symbol_print(e.EV.Vsym);
assert(0);
}
}
/**************************
* "touch" variables that could be changed by a function call or
* an indirect assignment.
* Eliminate any subexpressions that are "starred" (they need to
* be recomputed).
* Params:
* flag = If 1, then this is a function call.
* If 0, then this is an indirect assignment.
*/
void touchfunc(int flag)
{
//printf("touchfunc(%d)\n", flag);
HCS *petop = hcstab.ptr + hcstab.length;
//pe = &hcstab[0]; printf("pe = %p, petop = %p\n",pe,petop);
assert(hcsarray.touchfunci[flag] <= hcstab.length);
for (HCS *pe = hcstab.ptr + hcsarray.touchfunci[flag]; pe < petop; pe++)
{
elem *he = pe.Helem;
if (!he)
continue;
switch (he.Eoper)
{
case OPvar:
if (Symbol_isAffected(*he.EV.Vsym))
{
pe.Helem = null;
continue;
}
break;
case OPind:
if (tybasic(he.EV.E1.Ety) == TYimmutPtr)
break;
goto Ltouch;
case OPstrlen:
case OPstrcmp:
case OPmemcmp:
case OPbt:
goto Ltouch;
case OPvp_fp:
case OPcvp_fp:
if (flag == 0) /* function calls destroy vptrfptr's, */
break; /* not indirect assignments */
Ltouch:
pe.Helem = null;
break;
default:
break;
}
}
hcsarray.touchfunci[flag] = cast(uint)hcstab.length;
}
/*******************************
* Eliminate all common subexpressions that
* do any indirection ("starred" elems).
*/
void touchstar()
{
foreach (ref hcs; hcstab[hcsarray.touchstari .. $])
{
const e = hcs.Helem;
if (e &&
(e.Eoper == OPind && tybasic(e.EV.E1.Ety) != TYimmutPtr ||
e.Eoper == OPbt) )
hcs.Helem = null;
}
hcsarray.touchstari = cast(uint)hcstab.length;
}
/*******************************
* Eliminate all common subexpressions.
*/
void touchall()
{
foreach (ref hcs; hcstab[])
{
hcs.Helem = null;
}
hcsarray.touchstari = cast(uint)hcstab.length;
hcsarray.touchfunci[0] = cast(uint)hcstab.length;
hcsarray.touchfunci[1] = cast(uint)hcstab.length;
}
/*****************************************
* Eliminate any common subexpressions that could be modified
* if a handle pointer access occurs.
*/
void touchaccess(ref Barray!HCS hcstab, const elem *ev) pure nothrow
{
const ev1 = ev.EV.E1;
foreach (ref hcs; hcstab[])
{
const e = hcs.Helem;
/* Invalidate any previous handle pointer accesses that */
/* are not accesses of ev. */
if (e && (e.Eoper == OPvp_fp || e.Eoper == OPcvp_fp) && e.EV.E1 != ev1)
hcs.Helem = null;
}
}
}
|
D
|
/Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Intermediates.noindex/JustAThought.build/Debug-iphonesimulator/JustAThought.build/Objects-normal/x86_64/CitiesModel.o : /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificTopicVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/LikeLeaderboardVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ResetPasswordVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/UserProfileVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/TopicCreateVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/LoginVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/InfoVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificThoughtVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CreateAccountVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/UserDiaryVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificCityVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/DataService.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/KeychainService.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/TutorialPage.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ContactPage.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/AppDelegate.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Global.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/TopicModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/UserModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/CitiesModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/ThoughtModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CellTypes/SearchTopicViewCell.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CellTypes/VCTableViewCell.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/NavigationController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ViewController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Not\ used/FindTopicTableViewController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/AboutPages.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Modules/KeychainSwift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Headers/KeychainSwift-umbrella.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/derrickmu/Desktop/JustAThought/Pods/Firebase/Core/Sources/Firebase.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/derrickmu/Desktop/JustAThought/JustAThought/JustAThought-Bridging-Header.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Headers/KeychainSwift-Swift.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/derrickmu/Desktop/JustAThought/Pods/Firebase/Core/Sources/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Intermediates.noindex/JustAThought.build/Debug-iphonesimulator/JustAThought.build/Objects-normal/x86_64/CitiesModel~partial.swiftmodule : /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificTopicVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/LikeLeaderboardVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ResetPasswordVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/UserProfileVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/TopicCreateVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/LoginVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/InfoVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificThoughtVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CreateAccountVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/UserDiaryVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificCityVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/DataService.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/KeychainService.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/TutorialPage.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ContactPage.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/AppDelegate.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Global.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/TopicModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/UserModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/CitiesModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/ThoughtModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CellTypes/SearchTopicViewCell.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CellTypes/VCTableViewCell.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/NavigationController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ViewController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Not\ used/FindTopicTableViewController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/AboutPages.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Modules/KeychainSwift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Headers/KeychainSwift-umbrella.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/derrickmu/Desktop/JustAThought/Pods/Firebase/Core/Sources/Firebase.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/derrickmu/Desktop/JustAThought/JustAThought/JustAThought-Bridging-Header.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Headers/KeychainSwift-Swift.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/derrickmu/Desktop/JustAThought/Pods/Firebase/Core/Sources/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Intermediates.noindex/JustAThought.build/Debug-iphonesimulator/JustAThought.build/Objects-normal/x86_64/CitiesModel~partial.swiftdoc : /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificTopicVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/LikeLeaderboardVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ResetPasswordVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/UserProfileVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/TopicCreateVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/LoginVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/InfoVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificThoughtVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CreateAccountVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/UserDiaryVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/SpecificCityVC.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/DataService.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/KeychainService.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/TutorialPage.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ContactPage.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/AppDelegate.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Global.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/TopicModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/UserModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/CitiesModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Models/ThoughtModel.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CellTypes/SearchTopicViewCell.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/CellTypes/VCTableViewCell.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/NavigationController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/ViewController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/Not\ used/FindTopicTableViewController.swift /Users/derrickmu/Desktop/JustAThought/JustAThought/AboutPages.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Modules/KeychainSwift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Headers/KeychainSwift-umbrella.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/derrickmu/Desktop/JustAThought/Pods/Firebase/Core/Sources/Firebase.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/derrickmu/Desktop/JustAThought/JustAThought/JustAThought-Bridging-Header.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Headers/KeychainSwift-Swift.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/derrickmu/Desktop/JustAThought/Pods/Firebase/Core/Sources/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/derrickmu/Desktop/JustAThought/DerivedData/JustAThought/Build/Products/Debug-iphonesimulator/KeychainSwift/KeychainSwift.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
// This file is part of Visual D
//
// Visual D integrates the D programming language into Visual Studio
// Copyright (c) 2010-2011 by Rainer Schuetze, All Rights Reserved
//
// License for redistribution is given by the Artistic License 2.0
// see file LICENSE for further details
module vdc.ast.type;
import vdc.util;
import vdc.lexer;
import vdc.semantic;
import vdc.interpret;
import vdc.ast.node;
import vdc.ast.expr;
import vdc.ast.misc;
import vdc.ast.aggr;
import vdc.ast.tmpl;
import vdc.ast.stmt;
import vdc.ast.decl;
import vdc.ast.writer;
import stdext.util;
import std.conv;
class BuiltinPropertyBase : Symbol
{
string ident;
}
class BuiltinProperty(T) : BuiltinPropertyBase
{
Value value;
this(string id, T val)
{
ident = id;
value = Value.create(val);
}
override void toD(CodeWriter writer)
{
_assert(false);
}
override Type calcType()
{
return value.getType();
}
override Value interpret(Context sc)
{
return value;
}
}
Symbol newBuiltinProperty(T)(Scope sc, string id, T val)
{
auto bp = new BuiltinProperty!T(id, val);
sc.addSymbol(id, bp);
return bp;
}
class BuiltinType(T) : Node
{
}
Scope[int] builtInScopes;
Scope getBuiltinBasicTypeScope(int tokid)
{
if(auto ps = tokid in builtInScopes)
return *ps;
Scope sc = new Scope;
foreach(tok; BasicTypeTokens)
{
if (tokid == tok)
{
alias Token2BasicType!(tok) BT;
newBuiltinProperty(sc, "init", BT.init);
newBuiltinProperty(sc, "sizeof", BT.sizeof);
newBuiltinProperty(sc, "mangleof", BT.mangleof);
newBuiltinProperty(sc, "alignof", BT.alignof);
newBuiltinProperty(sc, "stringof", BT.stringof);
static if(__traits(compiles, BT.min))
newBuiltinProperty(sc, "min", BT.min);
static if(__traits(compiles, BT.max))
newBuiltinProperty(sc, "max", BT.max);
static if(__traits(compiles, BT.nan))
newBuiltinProperty(sc, "nan", BT.nan);
}
}
builtInScopes[tokid] = sc;
return sc;
}
class Type : Node
{
// semantic data
TypeInfo typeinfo;
mixin ForwardCtor!();
abstract bool propertyNeedsParens() const;
override Type clone()
{
Type n = static_cast!Type(super.clone());
return n;
}
enum ConversionFlags
{
kAllowBaseClass = 1 << 0,
kAllowConstConversion = 1 << 1,
kAllowBaseTypeConversion = 1 << 2,
// flags to clear on indirection
kIndirectionClear = kAllowBaseClass | kAllowBaseTypeConversion,
kImpliciteConversion = kAllowBaseClass | kAllowConstConversion | kAllowBaseTypeConversion,
}
bool convertableFrom(Type from, ConversionFlags flags)
{
if(from == this)
return true;
return false;
}
final bool convertableFromImplicite(Type from)
{
return convertableFrom(from, ConversionFlags.kImpliciteConversion);
}
Type commonType(Type other)
{
if(convertableFromImplicite(other))
return this;
if(other.convertableFromImplicite(this))
return other;
return semanticErrorType(this, " has no common type with ", other);
}
override void _semantic(Scope sc)
{
if(!typeinfo)
typeSemantic(sc);
}
void typeSemantic(Scope sc)
{
super._semantic(sc);
}
override Type calcType()
{
return this;
}
override Value interpret(Context sc)
{
return new TypeValue(this);
}
Value getProperty(Value sv, string ident)
{
return null;
}
Value getProperty(Value sv, Declarator decl)
{
return null;
}
@disable final Value interpretProperty(Context ctx, string prop)
{
if(Value v = _interpretProperty(ctx, prop))
return v;
return semanticErrorValue("cannot calculate property ", prop, " of type ", this);
}
@disable Value _interpretProperty(Context ctx, string prop)
{
return null;
}
Value createValue(Context ctx, Value initValue)
{
return semanticErrorValue("cannot create value of type ", this);
}
Type opIndex(int v)
{
return semanticErrorType("cannot index a ", this);
}
Type opSlice(int b, int e)
{
return semanticErrorType("cannot slice a ", this);
}
Type opCall(Type args)
{
return semanticErrorType("cannot call a ", this);
}
//////////////////////////////////////////////////////////////
Type unqualified()
{
return this;
}
}
class ErrorType : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return false; }
override void toD(CodeWriter writer) { writer("_errortype_"); }
}
//BasicType only created for standard types associated with tokens
class BasicType : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return false; }
static Type createType(int tokid)
{
BasicType type = new BasicType;
type.id = tokid;
return type;
}
static Type getSizeType()
{
return getType(TOK_uint); // TOK_ulong if compiling for 64-bit
}
static Type getType(int tokid)
{
static Type[] cachedTypes;
if(tokid >= cachedTypes.length)
cachedTypes.length = tokid + 1;
if(!cachedTypes[tokid])
cachedTypes[tokid] = createType(tokid);
return cachedTypes[tokid];
}
static TypeInfo getTypeInfo(int id)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
if (id == tok)
return typeid(Token2BasicType!(tok));
}
return null;
}
static size_t getSizeof(int id)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
if (id == tok)
return Token2BasicType!(tok).sizeof;
}
_assert(false);
return int.sizeof;
}
static string getMangleof(int id)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
if (id == tok)
return Token2BasicType!(tok).mangleof;
}
_assert(false);
return null;
}
static size_t getAlignof(int id)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
if (id == tok)
return Token2BasicType!(tok).alignof;
}
_assert(false);
return int.alignof;
}
static string getStringof(int id)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
if (id == tok)
return Token2BasicType!(tok).stringof;
}
_assert(false);
return null;
}
static Value getMin(int id)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
static if(__traits(compiles, Token2BasicType!(tok).min))
if (id == tok)
return Value.create(Token2BasicType!(tok).min);
}
return .semanticErrorValue(tokenString(id), " has no min property");
}
static Value getMax(int id)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
static if(__traits(compiles, Token2BasicType!(tok).max))
if (id == tok)
return Value.create(Token2BasicType!(tok).max);
}
return .semanticErrorValue(tokenString(id), " has no max property");
}
override Value createValue(Context ctx, Value initValue)
{
// TODO: convert foreach to table access for faster lookup
foreach(tok; BasicTypeTokens)
{
if (id == tok)
{
if(initValue)
return createInitValue!(Token2ValueType!(tok))(ctx, initValue);
return Value.create(Token2BasicType!(tok).init);
}
}
return semanticErrorValue("cannot create value of type ", this);
}
override void typeSemantic(Scope sc)
{
_assert(id != TOK_auto);
typeinfo = getTypeInfo(id);
}
override Scope getScope()
{
if(!scop)
scop = getBuiltinBasicTypeScope(id);
return scop;
}
enum Category { kInteger, kFloat, kComplex, kVoid }
static int categoryLevel(int id)
{
switch(id)
{
case TOK_bool: return 0;
case TOK_byte: return 1;
case TOK_ubyte: return 1;
case TOK_short: return 2;
case TOK_ushort: return 2;
case TOK_int: return 4;
case TOK_uint: return 4;
case TOK_long: return 8;
case TOK_ulong: return 8;
case TOK_char: return 1;
case TOK_wchar: return 2;
case TOK_dchar: return 4;
case TOK_float: return 10; // assume al floats convertable, ignore lost accuracy
case TOK_double: return 10;
case TOK_real: return 10;
case TOK_ifloat: return 10;
case TOK_idouble: return 10;
case TOK_ireal: return 10;
case TOK_cfloat: return 16;
case TOK_cdouble: return 16;
case TOK_creal: return 16;
default: assert(false);
}
}
static Category category(int id)
{
switch(id)
{
case TOK_bool: return Category.kInteger;
case TOK_byte: return Category.kInteger;
case TOK_ubyte: return Category.kInteger;
case TOK_short: return Category.kInteger;
case TOK_ushort: return Category.kInteger;
case TOK_int: return Category.kInteger;
case TOK_uint: return Category.kInteger;
case TOK_long: return Category.kInteger;
case TOK_ulong: return Category.kInteger;
case TOK_char: return Category.kInteger;
case TOK_wchar: return Category.kInteger;
case TOK_dchar: return Category.kInteger;
case TOK_float: return Category.kFloat;
case TOK_double: return Category.kFloat;
case TOK_real: return Category.kFloat;
case TOK_ifloat: return Category.kFloat;
case TOK_idouble: return Category.kFloat;
case TOK_ireal: return Category.kFloat;
case TOK_cfloat: return Category.kComplex;
case TOK_cdouble: return Category.kComplex;
case TOK_creal: return Category.kComplex;
case TOK_void: return Category.kVoid;
default: break;
}
_assert(false);
return Category.kVoid;
}
@disable override Value _interpretProperty(Context ctx, string prop)
{
switch(prop)
{
// all types
case "init":
return createValue(nullContext, null);
case "sizeof":
return Value.create(getSizeof(id));
case "alignof":
return Value.create(getAlignof(id));
case "mangleof":
return Value.create(getMangleof(id));
case "stringof":
return Value.create(getStringof(id));
// integer types
case "min":
return getMin(id);
case "max":
return getMax(id);
// floating point types
case "infinity":
case "nan":
case "dig":
case "epsilon":
case "mant_dig":
case "max_10_exp":
case "max_exp":
case "min_10_exp":
case "min_exp":
case "min_normal":
case "re":
case "im":
default:
return super._interpretProperty(ctx, prop);
}
}
override bool convertableFrom(Type from, ConversionFlags flags)
{
if(super.convertableFrom(from, flags))
return true;
auto bt = cast(BasicType) from;
if(!bt)
return false;
if(id == bt.id)
return true;
Category cat = category(id);
Category fcat = category(bt.id);
if(flags & ConversionFlags.kAllowBaseTypeConversion)
return cat == fcat;
if(flags & ConversionFlags.kImpliciteConversion)
{
if(cat == Category.kVoid || fcat != Category.kVoid)
return cat == fcat;
return (categoryLevel(id) >= categoryLevel(bt.id));
}
return false;
}
override void toD(CodeWriter writer)
{
_assert(id != TOK_auto);
writer(id);
}
}
class NullType : Type
{
override bool propertyNeedsParens() const { return false; }
override void toD(CodeWriter writer)
{
writer("Null");
}
}
//AutoType:
// auto added implicitely if there is no other type specified
class AutoType : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return false; }
override void toD(CodeWriter writer)
{
if(id != TOK_auto) // only implicitely added?
writer(id);
}
override Value createValue(Context ctx, Value initValue)
{
if(!initValue)
return semanticErrorValue("no initializer in auto declaration");
return initValue;
}
override Type calcType()
{
Expression expr;
if(auto decl = cast(Decl) parent)
{
Declarators decls = decl.getDeclarators();
if(auto declinit = cast(DeclaratorInitializer) decls.getMember(0))
expr = declinit.getInitializer();
}
if(expr)
return expr.calcType();
return semanticErrorType("no initializer in auto declaration");
}
override bool convertableFrom(Type from, ConversionFlags flags)
{
return calcType().convertableFrom(from, flags);
}
}
class VectorType : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return true; }
override void toD(CodeWriter writer)
{
writer("__vector(", getMember(0), ")");
}
}
//ModifiedType:
// [Type]
class ModifiedType : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return true; }
Type getType() { return getMember!Type(0); } // ignoring modifiers
override Type unqualified()
{
return getType();
}
override void typeSemantic(Scope sc)
{
TypeInfo_Const ti;
switch(id)
{
case TOK_const: ti = new TypeInfo_Const; break;
case TOK_immutable: ti = new TypeInfo_Invariant; break;
case TOK_inout: ti = new TypeInfo_Inout; break;
case TOK_shared: ti = new TypeInfo_Shared; break;
default: _assert(false);
}
auto type = getType();
type.semantic(sc);
ti.next = type.typeinfo;
typeinfo = ti;
}
override bool convertableFrom(Type from, ConversionFlags flags)
{
if(super.convertableFrom(from, flags))
return true;
Type nextThis = getType();
auto modfrom = cast(ModifiedType) from;
if(modfrom)
{
Type nextFrom = modfrom.getType();
if(id == modfrom.id)
if(nextThis.convertableFrom(nextFrom, flags))
return true;
if(flags & ConversionFlags.kAllowConstConversion)
if(id == TOK_const && modfrom.id == TOK_immutable)
if(nextThis.convertableFrom(nextFrom, flags))
return true;
}
if(flags & ConversionFlags.kAllowConstConversion)
if(id == TOK_const)
if(nextThis.convertableFrom(from, flags))
return true;
return false;
}
override Value createValue(Context ctx, Value initValue)
{
return getType().createValue(ctx, initValue); // TODO: ignores modifier
}
override void toD(CodeWriter writer)
{
writer(id, "(", getMember(0), ")");
}
}
//IdentifierType:
// [IdentifierList]
class IdentifierType : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return false; }
//Node resolved;
Type type;
IdentifierList getIdentifierList() { return getMember!IdentifierList(0); }
override void toD(CodeWriter writer)
{
writer(getMember(0));
}
override bool convertableFrom(Type from, ConversionFlags flags)
{
return calcType().convertableFrom(from, flags);
}
override Type calcType()
{
if(type)
return type;
auto idlist = getIdentifierList();
type = idlist.calcType();
return type;
}
override Value interpret(Context sc)
{
// might also be called inside an alias, actually resolving to a value
return new TypeValue(this);
}
}
//Typeof:
// [Expression/Type_opt IdentifierList_opt]
class Typeof : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return false; }
bool isReturn() { return id == TOK_return; }
IdentifierList getIdentifierList() { return getMember!IdentifierList(1); }
override void toD(CodeWriter writer)
{
if(isReturn())
writer("typeof(return)");
else
writer("typeof(", getMember(0), ")");
if(auto identifierList = getIdentifierList())
writer(".", identifierList);
}
override Value interpret(Context sc)
{
if(isReturn())
{
return semanticErrorValue("typeof(return) not implemented");
}
Node n = getMember(0);
Type t = n.calcType();
return new TypeValue(t);
}
}
// base class for types that have an indirection, i.e. pointer and arrays
class TypeIndirection : Type
{
mixin ForwardCtor!();
Type _next;
override bool propertyNeedsParens() const { return true; }
//Type getType() { return getMember!Type(0); }
void setNextType(Type t)
{
_next = t.calcType();
}
Type getNextType()
{
if(_next)
return _next;
_next = getMember!Type(0).calcType();
return _next;
}
override bool convertableFrom(Type from, ConversionFlags flags)
{
if(super.convertableFrom(from, flags))
return true;
Type nextThis = getNextType();
if(this.classinfo != from.classinfo)
return false;
auto ifrom = static_cast!TypeIndirection(from);
_assert(ifrom !is null);
// could allow A* -> const(B*) if class A derives from B
// even better -> head_const(B*)
return nextThis.convertableFrom(ifrom.getNextType(), flags & ~ConversionFlags.kIndirectionClear);
}
override Type opIndex(int v)
{
//_assert(false);
return getNextType();
}
override Type opSlice(int b, int e)
{
_assert(false);
return this;
}
}
//TypePointer:
// [Type]
class TypePointer : TypeIndirection
{
mixin ForwardCtor!();
override void typeSemantic(Scope sc)
{
auto type = getNextType();
//type.semantic(sc);
auto typeinfo_ptr = new TypeInfo_Pointer;
typeinfo_ptr.m_next = type.typeinfo;
typeinfo = typeinfo_ptr;
}
override Value createValue(Context ctx, Value initValue)
{
auto v = PointerValue._create(this, null);
if(initValue)
v.opBin(ctx, TOK_assign, initValue);
return v;
}
bool convertableTo(TypePointer t)
{
auto type = getNextType();
auto otype = t.getNextType();
return otype.compare(type);
}
override void toD(CodeWriter writer)
{
if(auto m = getMember(0))
writer(m, "*");
else if(_next)
writer(_next, "*");
else
writer("_missingtype_*");
}
}
class LengthProperty : Symbol
{
Type type;
override Type calcType()
{
if(!type)
type = BasicType.createType(TOK_uint);
return type;
}
override Value interpret(Context sc)
{
if(auto ac = cast(AggrContext)sc)
{
if(auto dav = cast(DynArrayValue) ac.instance)
return new SetLengthValue(dav);
return semanticErrorValue("cannot calulate length of ", ac.instance);
}
return semanticErrorValue("no context to length of ", sc);
}
override void toD(CodeWriter writer)
{
writer("length");
}
}
//TypeDynamicArray:
// [Type]
class TypeDynamicArray : TypeIndirection
{
mixin ForwardCtor!();
static Scope cachedScope;
override void typeSemantic(Scope sc)
{
auto type = getNextType();
//type.semantic(sc);
auto typeinfo_arr = new TypeInfo_Array;
typeinfo_arr.value = type.typeinfo;
typeinfo = typeinfo_arr;
}
override bool convertableFrom(Type from, ConversionFlags flags)
{
if(super.convertableFrom(from, flags))
return true;
if(from.classinfo == typeid(TypeStaticArray))
{
Type nextThis = getNextType();
auto arrfrom = static_cast!TypeStaticArray(from);
assert(arrfrom);
// should allow A[] -> const(B[]) if class A derives from B
// even better -> head_const(B[])
if(nextThis.convertableFrom(arrfrom.getNextType(), flags & ~ConversionFlags.kIndirectionClear))
return true;
}
return false;
}
override void toD(CodeWriter writer)
{
writer(getMember(0), "[]");
}
override Scope getScope()
{
if(!scop)
{
Scope sc = parent ? parent.getScope() : null;
scop = sc ? sc.pushClone() : new Scope;
scop.addSymbol("length", new LengthProperty);
}
return scop;
}
override Value createValue(Context ctx, Value initValue)
{
version(none)
if(auto mtype = cast(ModifiedType) getType())
if(mtype.id == TOK_immutable)
if(auto btype = cast(BasicType) mtype.getType())
if(btype.id == TOK_char)
return createInitValue!StringValue(ctx, initValue);
auto val = new DynArrayValue(this);
if(initValue)
val.opBin(ctx, TOK_assign, initValue);
return val;
}
override Type opSlice(int b, int e)
{
//return this;
auto da = new TypeStaticArray;
da.setNextType(getNextType()); //addMember(nextType().clone());
return da;
}
/+ Value deepCopy(Context sc, Value initValue)
{
auto val = new DynArrayValue(this);
if(int dim = initValue ? initValue.interpretProperty(sc, "length").toInt() : 0)
{
auto type = getType();
Value[] values;
values.length = dim;
IntValue idxval = new IntValue;
for(int i = 0; i < dim; i++)
{
*(idxval.pval) = i;
Value v = initValue ? initValue.opIndex(idxval) : null;
values[i] = type.createValue(sc, v);
}
val.values = values;
}
return val;
}
+/
}
//SuffixDynamicArray:
// []
class SuffixDynamicArray : Node
{
mixin ForwardCtor!();
override void toD(CodeWriter writer)
{
writer("[]");
}
}
//TypeStaticArray:
// [Type Expression]
class TypeStaticArray : TypeIndirection
{
mixin ForwardCtor!();
Expression getDimension() { return getMember!Expression(1); }
override void typeSemantic(Scope sc)
{
auto type = getNextType();
//type.semantic(sc);
auto typeinfo_arr = new TypeInfo_StaticArray;
typeinfo_arr.value = type.typeinfo;
Context ctx = new Context(nullContext);
ctx.scop = sc;
typeinfo_arr.len = getDimension().interpret(ctx).toInt();
typeinfo = typeinfo_arr;
}
override Scope getScope()
{
if(!scop)
{
enterScope(parent.getScope());
Context ctx = new Context(nullContext);
ctx.scop = scop;
size_t len = getDimension().interpret(ctx).toInt();
newBuiltinProperty(scop, "length", len);
}
return scop;
}
/+
override Scope getScope()
{
if(!scop)
{
scop = createTypeScope();
//scop.addSymbol("length", new BuiltinProperty!uint(BasicType.getType(TOK_uint), 0));
scop.parent = super.getScope();
}
return scop;
}
+/
override void toD(CodeWriter writer)
{
writer(getMember(0), "[", getMember(1), "]");
}
override Value createValue(Context ctx, Value initValue)
{
int dim = getDimension().interpret(ctx).toInt();
auto val = new StaticArrayValue(this);
val.setLength(ctx, dim);
if(initValue)
val.opBin(ctx, TOK_assign, initValue);
return val;
}
override Type opSlice(int b, int e)
{
//auto da = new TypeDynamicArray;
//da.setNextType(getNextType()); //addMember(nextType().clone());
//return da;
return this;
}
}
//SuffixStaticArray:
// [Expression]
class SuffixStaticArray : Node
{
mixin ForwardCtor!();
Expression getDimension() { return getMember!Expression(0); }
override void toD(CodeWriter writer)
{
writer("[", getMember(0), "]");
}
}
//TypeAssocArray:
// [Type Type]
class TypeAssocArray : TypeIndirection
{
mixin ForwardCtor!();
Type getKeyType() { return getMember!Type(1); }
override void typeSemantic(Scope sc)
{
auto vtype = getNextType();
//vtype.semantic(sc);
auto ktype = getKeyType();
//ktype.semantic(sc);
auto typeinfo_arr = new TypeInfo_AssociativeArray;
typeinfo_arr.value = vtype.typeinfo;
typeinfo_arr.key = ktype.typeinfo;
typeinfo = typeinfo_arr;
}
override bool convertableFrom(Type from, ConversionFlags flags)
{
if(super.convertableFrom(from, flags))
{
auto aafrom = static_cast!TypeAssocArray(from); // verified in super.convertableFrom
if(getKeyType().convertableFrom(aafrom.getKeyType(), flags & ~ConversionFlags.kIndirectionClear))
return true;
}
return false;
}
override void toD(CodeWriter writer)
{
writer(getMember(0), "[", getMember(1), "]");
}
}
//SuffixAssocArray:
// [Type]
class SuffixAssocArray : Node
{
mixin ForwardCtor!();
Type getKeyType() { return getMember!Type(0); }
override void toD(CodeWriter writer)
{
writer("[", getMember(0), "]");
}
}
//TypeArraySlice:
// [Type Expression Expression]
class TypeArraySlice : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return true; }
Type getType() { return getMember!Type(0); }
Expression getLower() { return getMember!Expression(1); }
Expression getUpper() { return getMember!Expression(2); }
override void typeSemantic(Scope sc)
{
auto rtype = getType();
if(auto tpl = cast(TypeInfo_Tuple) rtype.typeinfo)
{
Context ctx = new Context(nullContext);
ctx.scop = sc;
int lo = getLower().interpret(ctx).toInt();
int up = getUpper().interpret(ctx).toInt();
if(lo > up || lo < 0 || up > tpl.elements.length)
{
semanticError("tuple slice out of bounds");
typeinfo = tpl;
}
else
{
auto ntpl = new TypeInfo_Tuple;
ntpl.elements = tpl.elements[lo..up];
typeinfo = ntpl;
}
}
else
{
semanticError("type is not a tuple");
typeinfo = rtype.typeinfo;
}
}
override void toD(CodeWriter writer)
{
writer(getMember(0), "[", getLower(), " .. ", getUpper(), "]");
}
}
//TypeFunction:
// [Type ParameterList]
class TypeFunction : Type
{
mixin ForwardCtor!();
override bool propertyNeedsParens() const { return true; }
Type getReturnType() { return getMember!Type(0); }
ParameterList getParameters() { return getMember!ParameterList(1); }
Declarator funcDecl; // the actual function pointer
override void typeSemantic(Scope sc)
{
auto ti_fn = new TypeInfo_FunctionX;
auto rtype = getReturnType();
rtype.semantic(sc);
auto params = getParameters();
params.semantic(sc);
ti_fn.next = rtype.typeinfo;
ti_fn.parameters = new TypeInfo_Tuple;
for(int p = 0; p < params.members.length; p++)
ti_fn.parameters.elements ~= params.getParameter(p).getParameterDeclarator().getType().typeinfo;
ti_fn.attributes = combineAttributes(attr, params.attr);
typeinfo = ti_fn;
}
override Value createValue(Context ctx, Value initValue)
{
auto fv = new FunctionValue;
if(FunctionValue ifv = cast(FunctionValue) initValue)
{
// TODO: verfy types
fv.functype = ifv.functype;
}
else if(initValue)
return semanticErrorValue("cannot assign ", initValue, " to ", this);
else
fv.functype = this;
return fv;
}
override Type opCall(Type args)
{
return getReturnType().calcType();
}
override void toD(CodeWriter writer)
{
writer(getReturnType(), " function", getParameters());
writer.writeAttributes(attr, true);
}
}
//TypeDelegate:
// [Type ParameterList]
class TypeDelegate : TypeFunction
{
mixin ForwardCtor!();
override void typeSemantic(Scope sc)
{
auto ti_dg = new TypeInfo_DelegateX;
auto rtype = getReturnType();
rtype.semantic(sc);
auto params = getParameters();
params.semantic(sc);
ti_dg.next = rtype.typeinfo;
ti_dg.parameters = new TypeInfo_Tuple;
for(int p = 0; p < params.members.length; p++)
ti_dg.parameters.elements ~= params.getParameter(p).getParameterDeclarator().getType().typeinfo;
ti_dg.attributes = combineAttributes(attr, params.attr);
// no context information when defining the type, only with an instance
typeinfo = ti_dg;
}
override Value createValue(Context ctx, Value initValue)
{
auto fv = new DelegateValue;
if(DelegateValue ifv = cast(DelegateValue) initValue)
{
// TODO: verfy types
fv.functype = ifv.functype;
fv.context = ifv.context;
}
else if(initValue)
return semanticErrorValue("cannot assign ", initValue, " to ", this);
else
{
fv.functype = this;
fv.context = ctx;
}
return fv;
}
override void toD(CodeWriter writer)
{
writer(getReturnType(), " delegate", getParameters());
writer.writeAttributes(attr, true);
}
}
class TypeInfo_FunctionX : TypeInfo_Function
{
TypeInfo_Tuple parameters;
int attributes;
}
class TypeInfo_DelegateX : TypeInfo_Delegate
{
TypeInfo_Tuple parameters;
int attributes;
TypeInfo context;
}
class TypeString : TypeDynamicArray
{
mixin ForwardCtor!();
version(none)
override Value createValue(Context ctx, Value initValue)
{
return createInitValue!StringValue(ctx, initValue);
}
}
TypeDynamicArray createTypeString(C)()
{
TextSpan span;
return createTypeString!C(span);
}
TypeDynamicArray createTypeString(C)(ref const(TextSpan) span)
{
auto arr = new TypeString(span);
BasicType ct = new BasicType(BasicType2Token!C, span);
ModifiedType mt = new ModifiedType(TOK_immutable, span);
mt.addMember(ct);
arr.addMember(mt);
return arr;
}
TypeDynamicArray getTypeString(C)()
{
static TypeDynamicArray cachedTypedString;
if(!cachedTypedString)
{
TextSpan span;
cachedTypedString = createTypeString!C(span);
}
return cachedTypedString;
}
|
D
|
/Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/HistoricalSchedulerTimeConverter.o : /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Deprecated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Cancelable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObserverType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Reactive.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/RecursiveLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Errors.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Event.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/First.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Linux.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sunchuyue/Documents/test/RX_Product/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/HistoricalSchedulerTimeConverter~partial.swiftmodule : /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Deprecated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Cancelable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObserverType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Reactive.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/RecursiveLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Errors.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Event.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/First.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Linux.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sunchuyue/Documents/test/RX_Product/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/HistoricalSchedulerTimeConverter~partial.swiftdoc : /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Deprecated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Cancelable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObserverType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Reactive.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/RecursiveLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Errors.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Event.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/First.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Linux.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sunchuyue/Documents/test/RX_Product/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
; Copyright (C) 2008 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
.source T_check_cast_5.java
.class public dot.junit.opcodes.check_cast.d.T_check_cast_5
.super java/lang/Object
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run(Ljava/lang/Object;)V
.limit regs 5
const v3, 1234
check-cast v3, java/lang/String
return-void
.end method
|
D
|
module calc_squares_mod;
import std.stdio;
double[] calc_squares_A(in double[] x)
{
auto y = x.dup;
foreach(i, xv; x) {
y[i] = xv*xv;
}
return(y);
}
// re-write of _A from Danny
double[] calc_squares_A2(in double[] x)
{
double y[];
foreach(i, xv; x) {
y ~= xv*xv;
}
return(y);
}
void calc_squares_B(in double[] x, double[] y)
{
foreach(i, xv; x) {
y[i] = xv*xv;
}
}
unittest {
writeln(" --Unit test calc_squares_A");
assert(calc_squares_A([1.0, 2.0, 4.0]) == [1.0, 4.0, 16.0]);
writeln(" --Unit test calc_squares_A2");
assert(calc_squares_A2([1.0, 2.0, 4.0]) == [1.0, 4.0, 16.0]);
writeln(" --Unit test calc_squares_B");
auto y = [1.0, 2.0, 4.0];
auto z = new double[](y.length);
calc_squares_B(y, z);
assert(z == [1.0, 4.0, 16.0]);
}
extern(C) void R_calc_squares_A(int *n, double *x, double *output)
{
double[] y = x[0..(*n)];
output[0..(*n)] = calc_squares_A(y);
}
extern(C) void R_calc_squares_A2(int *n, double *x, double *output)
{
double[] y = x[0..(*n)];
output[0..(*n)] = calc_squares_A2(y);
}
// another idea from Danny
extern(C) void R_calc_squares_A2p(int *n, double *x, double *output)
{
double[] y = x[0..(*n)];
output = (calc_squares_A2(y)).ptr;
}
// a different approach
extern(C) void R_calc_squares_A2pp(int *n, double *x, double *output)
{
double[] y = x[0..(*n)];
auto z = calc_squares_A2(y);
foreach(i, zv; z) {
output[i] = zv;
}
}
extern(C) void R_calc_squares_B(int *n, double *x, double *output)
{
double[] y = x[0..(*n)];
double[] z = output[0..(*n)];
calc_squares_B(y, z);
}
extern(C) void R_calc_squares_direct(int *n, double *x, double *output)
{
foreach(i; 0..(*n))
output[i] = x[i]*x[i];
}
|
D
|
module miniorm.queries;
import std.algorithm : joiner, map;
import std.conv : to;
import std.exception : enforce;
import std.format : format;
import std.string : join;
import d2sqlite3;
import sumtype;
import miniorm.api : Miniorm;
import miniorm.exception;
import miniorm.schema : tableName, fieldToCol, fieldToCol, ColumnName;
public import miniorm.query_ast : OrderingTermSort, InsertOpt;
debug (miniorm) import std.stdio : stderr;
version (unittest) {
import unit_threaded.assertions;
}
auto select(T)() {
return Select!T(tableName!T);
}
struct Select(T) {
import miniorm.query_ast;
miniorm.query_ast.Select query;
this(miniorm.query_ast.Select q) {
this.query = q;
}
this(string from) {
this.query.from = Blob(from).From;
}
/// Convert to a SQL statement that can e.g. be pretty printed.
Sql toSql() {
return query.Query.Sql;
}
/// Count the number of matching rows.
auto count() @safe pure {
miniorm.query_ast.Select rval = query;
rval.columns.required = ResultColumn(ResultColumnExpr(Blob("count(*)")));
return Select!T(rval);
}
/// Order the result by `s` in the order the fields are defined in `T`.
auto orderBy(OrderingTermSort s, string[] fields = null) @trusted pure {
OrderingTerm required;
OrderingTerm[] optional;
if (fields) {
required = OrderingTerm(Blob("'" ~ fields[0] ~ "'"), s);
foreach (f; fields[1 .. $])
optional ~= OrderingTerm(Blob("'" ~ f ~ "'"), s);
} else {
enum fields_ = fieldToCol!("", T);
static foreach (i, field; fields_) {
static if (i == 0)
required = OrderingTerm(Blob(field.quoteColumnName), s);
else
optional ~= OrderingTerm(Blob(field.quoteColumnName), s);
}
}
miniorm.query_ast.Select rval = query;
rval.orderBy = OrderBy(required, optional);
return Select!T(rval);
}
/// Limit the query to this number of answers
auto limit(long value) @trusted pure {
import std.conv : to;
miniorm.query_ast.Select rval = query;
rval.limit = Limit(Blob(value.to!string));
return Select!T(rval);
}
mixin WhereMixin!(T, typeof(this), miniorm.query_ast.Select);
}
unittest {
static struct Foo {
ulong id;
string text;
ulong ts;
}
select!Foo.where("foo = :bar", Bind("bar")).or("batman IS NULL")
.and("batman = :hero", Bind("hero")).toSql.toString.shouldEqual(
"SELECT * FROM Foo WHERE foo = :bar OR batman IS NULL AND batman = :hero;");
}
@("shall be possible to have a member of enum type")
unittest {
static struct Foo {
enum MyEnum : string {
foo = "batman",
bar = "robin",
}
ulong id;
MyEnum enum_;
}
select!Foo.where("enum_ = 'robin'")
.toSql.toString.shouldEqual("SELECT * FROM Foo WHERE enum_ = 'robin';");
}
auto insert(T)() {
return Insert!T(tableName!T).insert;
}
auto insertOrReplace(T)() {
return Insert!T(tableName!T).insertOrReplace;
}
auto insertOrIgnore(T)() {
return Insert!T(tableName!T).insertOrIgnore;
}
struct Insert(T) {
import miniorm.query_ast;
miniorm.query_ast.Insert query;
this(miniorm.query_ast.Insert q) {
this.query = q;
}
this(string tableName) {
this.query.table = TableRef(tableName);
}
/// Convert to a SQL statement that can e.g. be pretty printed.
Sql toSql() {
return query.Query.Sql;
}
void run(ref Miniorm db) {
db.run(toSql.toString);
}
auto op(InsertOpt o) @safe pure nothrow const @nogc {
miniorm.query_ast.Insert rval = query;
rval.opt = o;
return Insert!T(rval);
}
/// Returns: number of values that the query is sized for.
size_t getValues() {
return query.values.value.match!((Values v) => 1 + v.optional.length, _ => 0);
}
/// Returns: number of columns to insert per value.
size_t getColumns() {
return query.columns.value.match!((ColumnNames v) => 1 + v.optional.length, (None v) => 0);
}
/// Number of values the user wants to insert.
auto values(size_t cnt)
in(cnt >= 1, "values must be >=1") {
import std.array : array;
import std.range : repeat;
Value val;
val.required = Expr("?");
val.optional = query.columns.value.match!((ColumnNames v) => Expr("?")
.repeat(v.optional.length).array, (None v) => null);
Values values;
foreach (i; 0 .. cnt) {
if (i == 0)
values.required = val;
else
values.optional ~= val;
}
miniorm.query_ast.Insert rval = query;
rval.values = InsertValues(values);
return Insert!T(rval);
}
/// Insert a new row.
auto insert() @safe pure nothrow const {
return op(InsertOpt.Insert).setColumns(true);
}
/// Insert or replace an existing row.
auto insertOrReplace() @safe pure nothrow const {
return op(InsertOpt.InsertOrReplace).setColumns(false);
}
auto insertOrIgnore() @safe pure nothrow const {
return op(InsertOpt.InsertOrIgnore).setColumns(false);
}
// TODO the name is bad.
/// Specify columns to insert/replace values in.
private auto setColumns(bool insert_) @safe pure const {
enum fields = fieldToCol!("", T);
ColumnNames columns;
bool addRequired = true;
foreach (field; fields) {
if (field.isPrimaryKey && insert_)
continue;
if (addRequired) {
columns.required = miniorm.query_ast.ColumnName(field.columnName);
addRequired = false;
} else
columns.optional ~= miniorm.query_ast.ColumnName(field.columnName);
}
miniorm.query_ast.Insert rval = query;
rval.columns = InsertColumns(columns);
return Insert!T(rval);
}
}
unittest {
static struct Foo {
ulong id;
string text;
float val;
ulong ts;
@ColumnName("version")
string version_;
}
insertOrReplace!Foo.values(1).toSql.toString.shouldEqual(
"INSERT OR REPLACE INTO Foo ('id','text','val','ts','version') VALUES (?,?,?,?,?);");
insert!Foo.values(1).toSql.toString.shouldEqual(
"INSERT INTO Foo ('text','val','ts','version') VALUES (?,?,?,?);");
insertOrReplace!Foo.values(2).toSql.toString.shouldEqual(
"INSERT OR REPLACE INTO Foo ('id','text','val','ts','version') VALUES (?,?,?,?,?),(?,?,?,?,?);");
insertOrIgnore!Foo.values(2).toSql.toString.shouldEqual(
"INSERT OR IGNORE INTO Foo ('id','text','val','ts','version') VALUES (?,?,?,?,?),(?,?,?,?,?);");
insert!Foo.values(2).toSql.toString.shouldEqual(
"INSERT INTO Foo ('text','val','ts','version') VALUES (?,?,?,?),(?,?,?,?);");
}
unittest {
static struct Foo {
ulong id;
string text;
float val;
ulong ts;
}
static struct Bar {
ulong id;
float value;
Foo foo;
}
insertOrReplace!Bar.values(1).toSql.toString.shouldEqual(
"INSERT OR REPLACE INTO Bar ('id','value','foo.id','foo.text','foo.val','foo.ts') VALUES (?,?,?,?,?,?);");
insertOrIgnore!Bar.values(1).toSql.toString.shouldEqual(
"INSERT OR IGNORE INTO Bar ('id','value','foo.id','foo.text','foo.val','foo.ts') VALUES (?,?,?,?,?,?);");
insert!Bar.values(1).toSql.toString.shouldEqual(
"INSERT INTO Bar ('value','foo.id','foo.text','foo.val','foo.ts') VALUES (?,?,?,?,?);");
insert!Bar.values(3).toSql.toString.shouldEqual(
"INSERT INTO Bar ('value','foo.id','foo.text','foo.val','foo.ts') VALUES (?,?,?,?,?),(?,?,?,?,?),(?,?,?,?,?);");
}
unittest {
struct Foo {
string text;
float val;
ulong ts;
}
struct Bar {
float v;
Foo foo;
}
struct Baz {
ulong id;
float v;
Bar xyz;
float w;
}
insertOrReplace!Baz.values(1).toSql.toString.shouldEqual("INSERT OR REPLACE INTO Baz ('id','v','xyz.v','xyz.foo.text','xyz.foo.val','xyz.foo.ts','w') VALUES (?,?,?,?,?,?,?);");
}
auto delete_(T)() {
return Delete!T(tableName!T);
}
struct Delete(T) {
import miniorm.query_ast;
miniorm.query_ast.Delete query;
this(miniorm.query_ast.Delete q) {
this.query = q;
}
this(string tableName) {
this.query.table = TableRef(tableName);
}
/// Convert to a SQL statement that can e.g. be pretty printed.
Sql toSql() {
return query.Query.Sql;
}
void run(ref Miniorm db) {
db.run(toSql.toString);
}
mixin WhereMixin!(T, typeof(this), miniorm.query_ast.Delete);
}
mixin template WhereMixin(T, QueryT, AstT) {
import std.datetime : SysTime;
import std.traits : isNumeric, isSomeString;
Bind[] binds;
/// Add a WHERE clause with a bound value.
auto where(string lhs, Bind[] b = null) {
binds ~= b;
return this.where(lhs);
}
auto where(string lhs, Bind b) {
return this.where(lhs, [b]);
}
/// Add a WHERE condition.
private auto where(string condition) @trusted pure {
import miniorm.query_ast;
static struct WhereOptional {
QueryT value;
alias value this;
private auto where(string condition, WhereOp op, Bind[] b) @trusted pure {
QueryT rval = value;
rval.binds ~= b;
Where w = value.query.where.tryMatch!((Where v) => v);
WhereExpr we = w.tryMatch!((WhereExpr v) => v);
we.optional ~= WhereExpr.Opt(op, Expr(condition));
rval.query.where = Where(we);
return WhereOptional(rval);
}
WhereOptional and(string lhs, Bind[] b = null) @safe pure {
return where(lhs, WhereOp.AND, b);
}
WhereOptional and(string lhs, Bind b) @safe pure {
return where(lhs, WhereOp.AND, [b]);
}
WhereOptional or(string lhs, Bind[] b = null) @safe pure {
return where(lhs, WhereOp.OR, b);
}
WhereOptional or(string lhs, Bind b) @safe pure {
return where(lhs, WhereOp.OR, [b]);
}
}
AstT ast = query;
ast.where = WhereExpr(Expr(condition)).Where;
auto rval = QueryT(ast);
rval.binds = binds;
return WhereOptional(rval);
}
}
struct Bind {
import std.range : isOutputRange, put;
alias Key = SumType!(string, int);
Key key;
this(string k) {
key = Key(k);
}
this(int k) {
key = Key(k);
}
string toString() @safe pure const {
import std.array : appender;
auto buf = appender!string;
toString(buf);
return buf.data;
}
void toString(Writer)(ref Writer w) const if (isOutputRange!(Writer, char)) {
key.match!((string k) { put(w, ":"); put(w, k); }, (int k) {
put(w, k.to!string);
});
}
}
unittest {
static struct Foo {
ulong id;
string text;
ulong ts;
}
delete_!Foo.where("text = privet").and("ts > 123")
.toSql.toString.shouldEqual("DELETE FROM Foo WHERE text = privet AND ts > 123;");
}
auto count(T)() {
return Count!T(tableName!T);
}
struct Count(T) {
import miniorm.query_ast : Sql;
Select!T query_;
this(miniorm.query_ast.Select q) {
this.query_ = Select!T(q);
}
this(string from) {
this.query_ = Select!T(from).count;
}
/// Convert to a SQL statement that can e.g. be pretty printed.
Sql toSql() {
return query_.toSql;
}
private ref miniorm.query_ast.Select query() @safe pure nothrow @nogc {
return query_.query;
}
mixin WhereMixin!(T, typeof(this), miniorm.query_ast.Select);
}
unittest {
static struct Foo {
ulong id;
string text;
ulong ts;
}
count!Foo.where("text = privet").and("ts > 123").toSql.toString.shouldEqual(
"SELECT count(*) FROM Foo WHERE text = privet AND ts > 123;");
}
|
D
|
instance DJG_713_BIFF_NW(NPC_DEFAULT)
{
name[0] = "Áèôô";
guild = GIL_DJG;
id = 7130;
voice = 7;
flags = 0;
npctype = NPCTYPE_MAIN;
aivar[AIV_TOUGHGUY] = TRUE;
aivar[AIV_TOUGHGUYNEWSOVERRIDE] = TRUE;
b_setattributestochapter(self,5);
fight_tactic = FAI_HUMAN_STRONG;
EquipItem(self,itmw_2h_sld_axe);
b_createambientinv(self);
b_setnpcvisual(self,MALE,"Hum_Head_Bald",FACE_N_NORMAL16,BODYTEX_N,itar_djg_m);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
b_givenpctalents(self);
b_setfightskills(self,65);
daily_routine = rtn_start_7130;
};
func void rtn_start_7130()
{
ta_stand_guarding(8,0,23,0,"LEVELCHANGE");
ta_stand_guarding(23,0,8,0,"LEVELCHANGE");
};
func void rtn_waitforship_7130()
{
ta_stand_guarding(8,0,23,0,"NW_WAITFOR_SHIP_03");
ta_stand_guarding(23,0,8,0,"NW_WAITFOR_SHIP_03");
};
func void rtn_ship_7130()
{
ta_stand_guarding(6,0,7,0,"SHIP_DECK_32");
ta_stand_guarding(7,0,7,10,"SHIP_DECK_15");
ta_stand_guarding(7,10,7,20,"SHIP_DECK_32");
ta_stand_guarding(7,20,7,30,"SHIP_DECK_15");
ta_stand_guarding(7,30,7,40,"SHIP_DECK_32");
ta_stand_guarding(7,40,7,50,"SHIP_DECK_29");
ta_stand_guarding(7,50,8,0,"SHIP_DECK_32");
ta_stand_guarding(8,0,8,10,"SHIP_DECK_15");
ta_stand_guarding(8,10,8,20,"SHIP_DECK_32");
ta_stand_guarding(8,20,8,30,"SHIP_DECK_15");
ta_stand_guarding(8,30,8,40,"SHIP_DECK_32");
ta_stand_guarding(8,40,8,50,"SHIP_DECK_29");
ta_stand_guarding(8,50,9,0,"SHIP_DECK_32");
ta_stand_guarding(9,0,9,10,"SHIP_DECK_15");
ta_stand_guarding(9,10,9,20,"SHIP_DECK_32");
ta_stand_guarding(9,20,9,30,"SHIP_DECK_15");
ta_stand_guarding(9,30,9,40,"SHIP_DECK_32");
ta_stand_guarding(9,40,9,50,"SHIP_DECK_29");
ta_stand_guarding(9,50,10,0,"SHIP_DECK_32");
ta_stand_guarding(10,0,10,10,"SHIP_DECK_15");
ta_stand_guarding(10,10,10,20,"SHIP_DECK_32");
ta_stand_guarding(10,20,10,30,"SHIP_DECK_15");
ta_stand_guarding(10,30,10,40,"SHIP_DECK_32");
ta_stand_guarding(10,40,10,50,"SHIP_DECK_29");
ta_stand_guarding(10,50,11,0,"SHIP_DECK_32");
ta_stand_guarding(11,0,11,10,"SHIP_DECK_15");
ta_stand_guarding(11,10,11,20,"SHIP_DECK_32");
ta_stand_guarding(11,20,11,30,"SHIP_DECK_15");
ta_stand_guarding(11,30,11,40,"SHIP_DECK_32");
ta_stand_guarding(11,40,11,50,"SHIP_DECK_29");
ta_stand_guarding(11,50,12,0,"SHIP_DECK_32");
ta_stand_guarding(12,0,12,10,"SHIP_DECK_15");
ta_stand_guarding(12,10,12,20,"SHIP_DECK_32");
ta_stand_guarding(12,20,12,30,"SHIP_DECK_15");
ta_stand_guarding(12,30,12,40,"SHIP_DECK_32");
ta_stand_guarding(12,40,12,50,"SHIP_DECK_29");
ta_stand_guarding(12,50,13,0,"SHIP_DECK_32");
ta_stand_guarding(13,0,13,10,"SHIP_DECK_15");
ta_stand_guarding(13,10,13,20,"SHIP_DECK_32");
ta_stand_guarding(13,20,13,30,"SHIP_DECK_15");
ta_stand_guarding(13,30,13,40,"SHIP_DECK_32");
ta_stand_guarding(13,40,13,50,"SHIP_DECK_29");
ta_stand_guarding(13,50,14,0,"SHIP_DECK_32");
ta_stand_guarding(14,0,14,10,"SHIP_DECK_15");
ta_stand_guarding(14,10,14,20,"SHIP_DECK_32");
ta_stand_guarding(14,20,14,30,"SHIP_DECK_15");
ta_stand_guarding(14,30,14,40,"SHIP_DECK_32");
ta_stand_guarding(14,40,14,50,"SHIP_DECK_29");
ta_stand_guarding(14,50,15,0,"SHIP_DECK_32");
ta_stand_guarding(15,0,15,10,"SHIP_DECK_15");
ta_stand_guarding(15,10,15,20,"SHIP_DECK_32");
ta_stand_guarding(15,20,15,30,"SHIP_DECK_15");
ta_stand_guarding(15,30,15,40,"SHIP_DECK_32");
ta_stand_guarding(15,40,15,50,"SHIP_DECK_29");
ta_stand_guarding(15,50,16,0,"SHIP_DECK_32");
ta_stand_guarding(16,0,16,10,"SHIP_DECK_15");
ta_stand_guarding(16,10,16,20,"SHIP_DECK_32");
ta_stand_guarding(16,20,16,30,"SHIP_DECK_15");
ta_stand_guarding(16,30,16,40,"SHIP_DECK_32");
ta_stand_guarding(16,40,16,50,"SHIP_DECK_29");
ta_stand_guarding(16,50,17,0,"SHIP_DECK_32");
ta_stand_guarding(17,0,17,10,"SHIP_DECK_15");
ta_stand_guarding(17,10,17,20,"SHIP_DECK_32");
ta_stand_guarding(17,20,17,30,"SHIP_DECK_15");
ta_stand_guarding(17,30,17,40,"SHIP_DECK_32");
ta_stand_guarding(17,40,17,50,"SHIP_DECK_29");
ta_stand_guarding(17,50,18,0,"SHIP_DECK_32");
ta_stand_guarding(18,0,18,10,"SHIP_DECK_15");
ta_stand_guarding(18,10,18,20,"SHIP_DECK_32");
ta_stand_guarding(18,20,18,30,"SHIP_DECK_15");
ta_stand_guarding(18,30,18,40,"SHIP_DECK_32");
ta_stand_guarding(18,40,18,50,"SHIP_DECK_29");
ta_stand_guarding(18,50,19,0,"SHIP_DECK_32");
ta_stand_guarding(19,0,19,10,"SHIP_DECK_15");
ta_stand_guarding(19,10,19,20,"SHIP_DECK_32");
ta_stand_guarding(19,20,19,30,"SHIP_DECK_15");
ta_stand_guarding(19,30,19,40,"SHIP_DECK_32");
ta_stand_guarding(19,40,19,50,"SHIP_DECK_29");
ta_stand_guarding(19,50,20,0,"SHIP_DECK_32");
ta_stand_guarding(20,0,20,10,"SHIP_DECK_15");
ta_stand_guarding(20,10,20,20,"SHIP_DECK_32");
ta_stand_guarding(20,20,20,30,"SHIP_DECK_15");
ta_stand_guarding(20,30,20,40,"SHIP_DECK_32");
ta_stand_guarding(20,40,20,50,"SHIP_DECK_29");
ta_stand_guarding(20,50,21,0,"SHIP_DECK_32");
ta_stand_guarding(21,0,21,10,"SHIP_DECK_15");
ta_stand_guarding(21,10,21,20,"SHIP_DECK_32");
ta_stand_guarding(21,20,21,30,"SHIP_DECK_15");
ta_stand_guarding(21,30,21,40,"SHIP_DECK_32");
ta_stand_guarding(21,40,21,50,"SHIP_DECK_29");
ta_stand_guarding(21,50,22,0,"SHIP_DECK_32");
ta_stand_guarding(22,0,23,0,"SHIP_DECK_15");
ta_stand_guarding(23,0,0,0,"SHIP_DECK_29");
ta_stand_guarding(0,0,1,0,"SHIP_DECK_32");
ta_stand_guarding(1,0,2,0,"SHIP_DECK_29");
ta_stand_guarding(2,0,3,0,"SHIP_DECK_32");
ta_stand_guarding(3,0,4,0,"SHIP_DECK_29");
ta_stand_guarding(4,0,5,0,"SHIP_DECK_32");
ta_stand_guarding(5,0,6,0,"SHIP_DECK_29");
};
|
D
|
/* Header code adapted from SDL_video.h */
module sdl.video;
import core.stdc.stdint;
import std.bitmanip;
import sdl.rwops;
public import sdl.rwops : SDL_RWops;
extern (C) {
/*
* SDL - Simple DirectMedia Layer
* Copyright (C) 1997-2012 Sam Lantinga
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Sam Lantinga
* slouken@libsdl.org
*/
/** @file SDL_video.h
* Header file for access to the SDL raw framebuffer window
*/
/* Private structure declaration whose definition is unknown. */
struct private_hwdata;
struct SDL_BlitMap;
struct private_yuvhwfuncs;
struct private_yuvhwdata;
/** @name Transparency definitions
* These define alpha as the opacity of a surface
*/
/*@{*/
enum SDL_Alpha {
OPAQUE = 255,
TRANSPARENT = 0
}
/*@}*/
/** @name Useful data types */
/*@{*/
struct SDL_Rect {
int16_t x, y;
uint16_t w, h;
};
struct SDL_Color {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t unused;
};
alias SDL_Colour = SDL_Color;
struct SDL_Palette {
int ncolors;
SDL_Color *colors;
};
/*@}*/
/** Everything in the pixel format structure is read-only */
struct SDL_PixelFormat {
SDL_Palette *palette;
uint8_t BitsPerPixel;
uint8_t BytesPerPixel;
uint8_t Rloss;
uint8_t Gloss;
uint8_t Bloss;
uint8_t Aloss;
uint8_t Rshift;
uint8_t Gshift;
uint8_t Bshift;
uint8_t Ashift;
uint32_t Rmask;
uint32_t Gmask;
uint32_t Bmask;
uint32_t Amask;
/** RGB color key information */
uint32_t colorkey;
/** Alpha value information (per-surface alpha) */
uint8_t alpha;
};
/** This structure should be treated as read-only, except for 'pixels',
* which, if not NULL, contains the raw pixel data for the surface.
*/
struct SDL_Surface {
uint32_t flags; /**< Read-only */
SDL_PixelFormat *format; /**< Read-only */
int w, h; /**< Read-only */
uint16_t pitch; /**< Read-only */
void *pixels; /**< Read-write */
int offset; /**< Private */
/** Hardware-specific surface info */
private_hwdata *hwdata;
/** clipping information */
SDL_Rect clip_rect; /**< Read-only */
uint32_t unused1; /**< for binary compatibility */
/** Allow recursive locks */
uint32_t locked; /**< Private */
/** info for fast blit mapping to other surfaces */
SDL_BlitMap *map; /**< Private */
/** format version, bumped at every change to invalidate blit maps */
uint format_version; /**< Private */
/** Reference count -- used when freeing surface */
int refcount; /**< Read-mostly */
};
/** @name SDL_Surface Flags
* These are the currently supported flags for the SDL_surface
*/
/*@{*/
/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
/*@{*/
enum SDL_SurfaceFlags : uint32_t {
SWSURFACE = 0x00000000, /**< Surface is in system memory */
HWSURFACE = 0x00000001, /**< Surface is in video memory */
ASYNCBLIT = 0x00000004 /**< Use asynchronous blits if possible */
}
/*@}*/
/** Available for SDL_SetVideoMode() */
/*@{*/
enum SDL_VideoFlags : uint32_t {
/* Those 3 first flags are copied from SDL_SurfaceFlags */
SWSURFACE = SDL_SurfaceFlags.SWSURFACE,
HWSURFACE = SDL_SurfaceFlags.HWSURFACE,
ASYNCBLIT = SDL_SurfaceFlags.ASYNCBLIT,
ANYFORMAT = 0x10000000, /**< Allow any video depth/pixel-format */
HWPALETTE = 0x20000000, /**< Surface has exclusive palette */
DOUBLEBUF = 0x40000000, /**< Set up double-buffered video mode */
FULLSCREEN = 0x80000000, /**< Surface is a full screen display */
OPENGL = 0x00000002, /**< Create an OpenGL rendering context */
OPENGLBLIT = 0x0000000A, /**< Create an OpenGL rendering context and use it for blitting */
RESIZABLE = 0x00000010, /**< This video mode may be resized */
NOFRAME = 0x00000020 /**< No window caption or edge frame */
}
/*@}*/
/** Used internally (read-only) */
/*@{*/
enum SDL_InternalFlags : uint32_t {
SWSURFACE = SDL_VideoFlags.SWSURFACE,
HWSURFACE = SDL_VideoFlags.HWSURFACE,
ASYNCBLIT = SDL_VideoFlags.ASYNCBLIT,
ANYFORMAT = SDL_VideoFlags.ANYFORMAT,
HWPALETTE = SDL_VideoFlags.HWPALETTE,
DOUBLEBUF = SDL_VideoFlags.DOUBLEBUF,
FULLSCREEN = SDL_VideoFlags.FULLSCREEN,
OPENGL = SDL_VideoFlags.OPENGL,
OPENGLBLIT = SDL_VideoFlags.OPENGLBLIT,
RESIZABLE = SDL_VideoFlags.RESIZABLE,
NOFRAME = SDL_VideoFlags.NOFRAME,
HWACCEL = 0x00000100, /**< Blit uses hardware acceleration */
SRCCOLORKEY = 0x00001000, /**< Blit uses a source color key */
RLEACCELOK = 0x00002000, /**< Private flag */
RLEACCEL = 0x00004000, /**< Surface is RLE encoded */
SRCALPHA = 0x00010000, /**< Blit uses source alpha blending */
PREALLOC = 0x01000000 /**< Surface uses preallocated memory */
}
/*@}*/
/*@}*/
/** Evaluates to true if the surface needs to be locked before access */
bool SDL_MUSTLOCK(SDL_Surface *surface) {
with (SDL_InternalFlags) {
return surface.offset ||
(surface.flags & (HWSURFACE|ASYNCBLIT|RLEACCEL));
}
}
/** typedef for private surface blitting functions */
alias SDL_blit = int function(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/** Useful for determining the video hardware capabilities */
struct SDL_VideoInfo {
mixin(bitfields!(
uint32_t, "hw_available", 1, /**< Flag: Can you create hardware surfaces? */
uint32_t, "wm_available", 1, /**< Flag: Can you talk to a window manager? */
uint32_t, "UnusedBits1", 6,
uint32_t, "UnusedBits2", 1,
uint32_t, "blit_hw", 1, /**< Flag: Accelerated blits HW --> HW */
uint32_t, "blit_hw_CC", 1, /**< Flag: Accelerated blits with Colorkey */
uint32_t, "blit_hw_A", 1, /**< Flag: Accelerated blits with Alpha */
uint32_t, "blit_sw", 1, /**< Flag: Accelerated blits SW --> HW */
uint32_t, "blit_sw_CC", 1, /**< Flag: Accelerated blits with Colorkey */
uint32_t, "blit_sw_A", 1, /**< Flag: Accelerated blits with Alpha */
uint32_t, "blit_fill", 1, /**< Flag: Accelerated color fill */
uint32_t, "UnusedBits3", 16
));
uint32_t video_mem; /**< The total amount of video memory (in K) */
SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */
int current_w; /**< Value: The current video mode width */
int current_h; /**< Value: The current video mode height */
};
/** @name Overlay Formats
* The most common video overlay formats.
* For an explanation of these pixel formats, see:
* http://www.webartz.com/fourcc/indexyuv.htm
*
* For information on the relationship between color spaces, see:
* http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
*/
/*@{*/
enum SDL_OverlayFormats {
YV12_OVERLAY = 0x32315659, /**< Planar mode: Y + V + U (3 planes) */
IYUV_OVERLAY = 0x56555949, /**< Planar mode: Y + U + V (3 planes) */
YUY2_OVERLAY = 0x32595559, /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
UYVY_OVERLAY = 0x59565955, /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
YVYU_OVERLAY = 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
}
/*@}*/
/** The YUV hardware video overlay */
struct SDL_Overlay {
uint32_t format; /**< Read-only */
int w, h; /**< Read-only */
int planes; /**< Read-only */
uint16_t *pitches; /**< Read-only */
uint8_t **pixels; /**< Read-write */
/** @name Hardware-specific surface info */
/*@{*/
private_yuvhwfuncs *hwfuncs;
private_yuvhwdata *hwdata;
/*@{*/
/** @name Special flags */
/*@{*/
mixin(bitfields!(
uint32_t, "hw_overlay", 1, /**< Flag: This overlay hardware accelerated? */
uint32_t, "UnusedBits", 31
));
/*@}*/
};
/** Public enumeration for setting the OpenGL window attributes. */
enum SDL_GLattr {
RED_SIZE,
GREEN_SIZE,
BLUE_SIZE,
ALPHA_SIZE,
BUFFER_SIZE,
DOUBLEBUFFER,
DEPTH_SIZE,
STENCIL_SIZE,
ACCUM_RED_SIZE,
ACCUM_GREEN_SIZE,
ACCUM_BLUE_SIZE,
ACCUM_ALPHA_SIZE,
STEREO,
MULTISAMPLEBUFFERS,
MULTISAMPLESAMPLES,
ACCELERATED_VISUAL,
SWAP_CONTROL
};
/** @name flags for SDL_SetPalette() */
/*@{*/
enum SDL_PaletteFlags {
LOGPAL = 0x01,
PHYSPAL = 0x02
}
/*@}*/
/* Function prototypes */
/**
* @name Video Init and Quit
* These functions are used internally, and should not be used unless you
* have a specific need to specify the video driver you want to use.
* You should normally use SDL_Init() or SDL_InitSubSystem().
*/
/*@{*/
/**
* Initializes the video subsystem. Sets up a connection
* to the window manager, etc, and determines the current video mode and
* pixel format, but does not initialize a window or graphics mode.
* Note that event handling is activated by this routine.
*
* If you use both sound and video in your application, you need to call
* SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
* you won't be able to set full-screen display modes.
*/
int SDL_VideoInit(const char *driver_name, uint32_t flags);
void SDL_VideoQuit();
/*@}*/
/**
* This function fills the given character buffer with the name of the
* video driver, and returns a pointer to it if the video driver has
* been initialized. It returns NULL if no driver has been initialized.
*/
char *SDL_VideoDriverName(char *namebuf, int maxlen);
/**
* This function returns a pointer to the current display surface.
* If SDL is doing format conversion on the display surface, this
* function returns the publicly visible surface, not the real video
* surface.
*/
SDL_Surface *SDL_GetVideoSurface();
/**
* This function returns a read-only pointer to information about the
* video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
* member of the returned structure will contain the pixel format of the
* "best" video mode.
*/
const(SDL_VideoInfo) *SDL_GetVideoInfo();
/**
* Check to see if a particular video mode is supported.
* It returns 0 if the requested mode is not supported under any bit depth,
* or returns the bits-per-pixel of the closest available mode with the
* given width and height. If this bits-per-pixel is different from the
* one used when setting the video mode, SDL_SetVideoMode() will succeed,
* but will emulate the requested bits-per-pixel with a shadow surface.
*
* The arguments to SDL_VideoModeOK() are the same ones you would pass to
* SDL_SetVideoMode()
*/
int SDL_VideoModeOK(int width, int height, int bpp, uint32_t flags);
/**
* Return a pointer to an array of available screen dimensions for the
* given format and video flags, sorted largest to smallest. Returns
* NULL if there are no dimensions available for a particular format,
* or (SDL_Rect **)-1 if any dimension is okay for the given format.
*
* If 'format' is NULL, the mode list will be for the format given
* by SDL_GetVideoInfo()->vfmt
*/
SDL_Rect **SDL_ListModes(SDL_PixelFormat *format, uint32_t flags);
/**
* Set up a video mode with the specified width, height and bits-per-pixel.
*
* If 'bpp' is 0, it is treated as the current display bits per pixel.
*
* If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
* requested bits-per-pixel, but will return whatever video pixel format is
* available. The default is to emulate the requested pixel format if it
* is not natively available.
*
* If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
* video memory, if possible, and you may have to call SDL_LockSurface()
* in order to access the raw framebuffer. Otherwise, the video surface
* will be created in system memory.
*
* If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
* updates asynchronously, but you must always lock before accessing pixels.
* SDL will wait for updates to complete before returning from the lock.
*
* If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
* that the colors set by SDL_SetColors() will be the colors you get.
* Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
* of the colors exactly the way they are requested, and you should look
* at the video surface structure to determine the actual palette.
* If SDL cannot guarantee that the colors you request can be set,
* i.e. if the colormap is shared, then the video surface may be created
* under emulation in system memory, overriding the SDL_HWSURFACE flag.
*
* If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
* a fullscreen video mode. The default is to create a windowed mode
* if the current graphics system has a window manager.
* If the SDL library is able to set a fullscreen video mode, this flag
* will be set in the surface that is returned.
*
* If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
* two surfaces in video memory and swap between them when you call
* SDL_Flip(). This is usually slower than the normal single-buffering
* scheme, but prevents "tearing" artifacts caused by modifying video
* memory while the monitor is refreshing. It should only be used by
* applications that redraw the entire screen on every update.
*
* If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
* window manager, if any, to resize the window at runtime. When this
* occurs, SDL will send a SDL_VIDEORESIZE event to you application,
* and you must respond to the event by re-calling SDL_SetVideoMode()
* with the requested size (or another size that suits the application).
*
* If SDL_NOFRAME is set in 'flags', the SDL library will create a window
* without any title bar or frame decoration. Fullscreen video modes have
* this flag set automatically.
*
* This function returns the video framebuffer surface, or NULL if it fails.
*
* If you rely on functionality provided by certain video flags, check the
* flags of the returned surface to make sure that functionality is available.
* SDL will fall back to reduced functionality if the exact flags you wanted
* are not available.
*/
SDL_Surface *SDL_SetVideoMode
(int width, int height, int bpp, uint32_t flags);
/** @name SDL_Update Functions
* These functions should not be called while 'screen' is locked.
*/
/*@{*/
/**
* Makes sure the given list of rectangles is updated on the given screen.
*/
void SDL_UpdateRects
(SDL_Surface *screen, int numrects, SDL_Rect *rects);
/**
* If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
* screen.
*/
void SDL_UpdateRect
(SDL_Surface *screen, int32_t x, int32_t y, uint32_t w, uint32_t h);
/*@}*/
/**
* On hardware that supports double-buffering, this function sets up a flip
* and returns. The hardware will wait for vertical retrace, and then swap
* video buffers before the next video surface blit or lock will return.
* On hardware that doesn not support double-buffering, this is equivalent
* to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
* The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
* setting the video mode for this function to perform hardware flipping.
* This function returns 0 if successful, or -1 if there was an error.
*/
int SDL_Flip(SDL_Surface *screen);
/**
* Set the gamma correction for each of the color channels.
* The gamma values range (approximately) between 0.1 and 10.0
*
* If this function isn't supported directly by the hardware, it will
* be emulated using gamma ramps, if available. If successful, this
* function returns 0, otherwise it returns -1.
*/
int SDL_SetGamma(float red, float green, float blue);
/**
* Set the gamma translation table for the red, green, and blue channels
* of the video hardware. Each table is an array of 256 16-bit quantities,
* representing a mapping between the input and output for that channel.
* The input is the index into the array, and the output is the 16-bit
* gamma value at that index, scaled to the output color precision.
*
* You may pass NULL for any of the channels to leave it unchanged.
* If the call succeeds, it will return 0. If the display driver or
* hardware does not support gamma translation, or otherwise fails,
* this function will return -1.
*/
int SDL_SetGammaRamp(const uint16_t *red, const uint16_t *green, const uint16_t *blue);
/**
* Retrieve the current values of the gamma translation tables.
*
* You must pass in valid pointers to arrays of 256 16-bit quantities.
* Any of the pointers may be NULL to ignore that channel.
* If the call succeeds, it will return 0. If the display driver or
* hardware does not support gamma translation, or otherwise fails,
* this function will return -1.
*/
int SDL_GetGammaRamp(uint16_t *red, uint16_t *green, uint16_t *blue);
/**
* Sets a portion of the colormap for the given 8-bit surface. If 'surface'
* is not a palettized surface, this function does nothing, returning 0.
* If all of the colors were set as passed to SDL_SetColors(), it will
* return 1. If not all the color entries were set exactly as given,
* it will return 0, and you should look at the surface palette to
* determine the actual color palette.
*
* When 'surface' is the surface associated with the current display, the
* display colormap will be updated with the requested colors. If
* SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
* will always return 1, and the palette is guaranteed to be set the way
* you desire, even if the window colormap has to be warped or run under
* emulation.
*/
int SDL_SetColors(SDL_Surface *surface,
SDL_Color *colors, int firstcolor, int ncolors);
/**
* Sets a portion of the colormap for a given 8-bit surface.
* 'flags' is one or both of:
* SDL_LOGPAL -- set logical palette, which controls how blits are mapped
* to/from the surface,
* SDL_PHYSPAL -- set physical palette, which controls how pixels look on
* the screen
* Only screens have physical palettes. Separate change of physical/logical
* palettes is only possible if the screen has SDL_HWPALETTE set.
*
* The return value is 1 if all colours could be set as requested, and 0
* otherwise.
*
* SDL_SetColors() is equivalent to calling this function with
* flags = (SDL_LOGPAL|SDL_PHYSPAL).
*/
int SDL_SetPalette(SDL_Surface *surface, int flags,
SDL_Color *colors, int firstcolor,
int ncolors);
/**
* Maps an RGB triple to an opaque pixel value for a given pixel format
*/
uint32_t SDL_MapRGB
(const SDL_PixelFormat *format,
const uint8_t r, const uint8_t g, const uint8_t b);
/**
* Maps an RGBA quadruple to a pixel value for a given pixel format
*/
uint32_t SDL_MapRGBA
(const SDL_PixelFormat *format,
const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a);
/**
* Maps a pixel value into the RGB components for a given pixel format
*/
void SDL_GetRGB(uint32_t pixel,
const SDL_PixelFormat *fmt,
uint8_t *r, uint8_t *g, uint8_t *b);
/**
* Maps a pixel value into the RGBA components for a given pixel format
*/
void SDL_GetRGBA(uint32_t pixel,
const SDL_PixelFormat *fmt,
uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a);
/** @sa SDL_CreateRGBSurface */
alias SDL_AllocSurface = SDL_CreateRGBSurface;
/**
* Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
* If the depth is greater than 8 bits, the pixel format is set using the
* flags '[RGB]mask'.
* If the function runs out of memory, it will return NULL.
*
* The 'flags' tell what kind of surface to create.
* SDL_SWSURFACE means that the surface should be created in system memory.
* SDL_HWSURFACE means that the surface should be created in video memory,
* with the same format as the display surface. This is useful for surfaces
* that will not change much, to take advantage of hardware acceleration
* when being blitted to the display surface.
* SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
* this surface, but you must always lock it before accessing the pixels.
* SDL will wait for current blits to finish before returning from the lock.
* SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
* If the hardware supports acceleration of colorkey blits between
* two surfaces in video memory, SDL will try to place the surface in
* video memory. If this isn't possible or if there is no hardware
* acceleration available, the surface will be placed in system memory.
* SDL_SRCALPHA means that the surface will be used for alpha blits and
* if the hardware supports hardware acceleration of alpha blits between
* two surfaces in video memory, to place the surface in video memory
* if possible, otherwise it will be placed in system memory.
* If the surface is created in video memory, blits will be _much_ faster,
* but the surface format must be identical to the video surface format,
* and the only way to access the pixels member of the surface is to use
* the SDL_LockSurface() and SDL_UnlockSurface() calls.
* If the requested surface actually resides in video memory, SDL_HWSURFACE
* will be set in the flags member of the returned surface. If for some
* reason the surface could not be placed in video memory, it will not have
* the SDL_HWSURFACE flag set, and will be created in system memory instead.
*/
SDL_Surface *SDL_CreateRGBSurface
(uint32_t flags, int width, int height, int depth,
uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask);
/** @sa SDL_CreateRGBSurface */
SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels,
int width, int height, int depth, int pitch,
uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask);
void SDL_FreeSurface(SDL_Surface *surface);
/**
* SDL_LockSurface() sets up a surface for directly accessing the pixels.
* Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
* to and read from 'surface->pixels', using the pixel format stored in
* 'surface->format'. Once you are done accessing the surface, you should
* use SDL_UnlockSurface() to release it.
*
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
* to 0, then you can read and write to the surface at any time, and the
* pixel format of the surface will not change. In particular, if the
* SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
* will not need to lock the display surface before accessing it.
*
* No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time.
*
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
*/
int SDL_LockSurface(SDL_Surface *surface);
void SDL_UnlockSurface(SDL_Surface *surface);
/**
* Load a surface from a seekable SDL data source (memory or file.)
* If 'freesrc' is non-zero, the source will be closed after being read.
* Returns the new surface, or NULL if there was an error.
* The new surface should be freed with SDL_FreeSurface().
*/
SDL_Surface *SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
/** Convenience macro -- load a surface from a file */
SDL_Surface *SDL_LoadBMP(const char *file) {
return SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1);
}
/**
* Save a surface to a seekable SDL data source (memory or file.)
* If 'freedst' is non-zero, the source will be closed after being written.
* Returns 0 if successful or -1 if there was an error.
*/
int SDL_SaveBMP_RW
(SDL_Surface *surface, SDL_RWops *dst, int freedst);
/** Convenience macro -- save a surface to a file */
int SDL_SaveBMP(SDL_Surface *surface, const char *file) {
return SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1);
}
/**
* Sets the color key (transparent pixel) in a blittable surface.
* If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
* 'key' will be the transparent pixel in the source image of a blit.
* SDL_RLEACCEL requests RLE acceleration for the surface if present,
* and removes RLE acceleration if absent.
* If 'flag' is 0, this function clears any current color key.
* This function returns 0, or -1 if there was an error.
*/
int SDL_SetColorKey
(SDL_Surface *surface, uint32_t flag, uint32_t key);
/**
* This function sets the alpha value for the entire surface, as opposed to
* using the alpha component of each pixel. This value measures the range
* of transparency of the surface, 0 being completely transparent to 255
* being completely opaque. An 'alpha' value of 255 causes blits to be
* opaque, the source pixels copied to the destination (the default). Note
* that per-surface alpha can be combined with colorkey transparency.
*
* If 'flag' is 0, alpha blending is disabled for the surface.
* If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
* OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
* surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
*
* The 'alpha' parameter is ignored for surfaces that have an alpha channel.
*/
int SDL_SetAlpha(SDL_Surface *surface, uint32_t flag, uint8_t alpha);
/**
* Sets the clipping rectangle for the destination surface in a blit.
*
* If the clip rectangle is NULL, clipping will be disabled.
* If the clip rectangle doesn't intersect the surface, the function will
* return SDL_FALSE and blits will be completely clipped. Otherwise the
* function returns SDL_TRUE and blits to the surface will be clipped to
* the intersection of the surface area and the clipping rectangle.
*
* Note that blits are automatically clipped to the edges of the source
* and destination surfaces.
*/
bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);
/**
* Gets the clipping rectangle for the destination surface in a blit.
* 'rect' must be a pointer to a valid rectangle which will be filled
* with the correct values.
*/
void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
/**
* Creates a new surface of the specified format, and then copies and maps
* the given surface to it so the blit of the converted surface will be as
* fast as possible. If this function fails, it returns NULL.
*
* The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
* semantics. You can also pass SDL_RLEACCEL in the flags parameter and
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
* surface.
*
* This function is used internally by SDL_DisplayFormat().
*/
SDL_Surface *SDL_ConvertSurface
(SDL_Surface *src, SDL_PixelFormat *fmt, uint32_t flags);
/**
* This performs a fast blit from the source surface to the destination
* surface. It assumes that the source and destination rectangles are
* the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
* surface (src or dst) is copied. The final blit rectangles are saved
* in 'srcrect' and 'dstrect' after all clipping is performed.
* If the blit is successful, it returns 0, otherwise it returns -1.
*
* The blit function should not be called on a locked surface.
*
* The blit semantics for surfaces with and without alpha and colorkey
* are defined as follows:
*
* RGBA->RGB:
* SDL_SRCALPHA set:
* alpha-blend (using alpha-channel).
* SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
* copy RGB.
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* RGB values of the source colour key, ignoring alpha in the
* comparison.
*
* RGB->RGBA:
* SDL_SRCALPHA set:
* alpha-blend (using the source per-surface alpha value);
* set destination alpha to opaque.
* SDL_SRCALPHA not set:
* copy RGB, set destination alpha to source per-surface alpha value.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source colour key.
*
* RGBA->RGBA:
* SDL_SRCALPHA set:
* alpha-blend (using the source alpha channel) the RGB values;
* leave destination alpha untouched. [Note: is this correct?]
* SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
* copy all of RGBA to the destination.
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* RGB values of the source colour key, ignoring alpha in the
* comparison.
*
* RGB->RGB:
* SDL_SRCALPHA set:
* alpha-blend (using the source per-surface alpha value).
* SDL_SRCALPHA not set:
* copy RGB.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source colour key.
*
* If either of the surfaces were in video memory, and the blit returns -2,
* the video memory was lost, so it should be reloaded with artwork and
* re-blitted:
* @code
* while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
* while ( SDL_LockSurface(image) < 0 )
* Sleep(10);
* -- Write image pixels to image->pixels --
* SDL_UnlockSurface(image);
* }
* @endcode
*
* This happens under DirectX 5.0 when the system switches away from your
* fullscreen application. The lock will also fail until you have access
* to the video memory again.
*
* You should call SDL_BlitSurface() unless you know exactly how SDL
* blitting works internally and how to use the other blit functions.
*/
alias SDL_BlitSurface = SDL_UpperBlit;
/** This is the public blit function, SDL_BlitSurface(), and it performs
* rectangle validation and clipping before passing it to SDL_LowerBlit()
*/
int SDL_UpperBlit
(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/** This is a semi-private blit function and it performs low-level surface
* blitting only.
*/
int SDL_LowerBlit
(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/**
* This function performs a fast fill of the given rectangle with 'color'
* The given rectangle is clipped to the destination surface clip area
* and the final fill rectangle is saved in the passed in pointer.
* If 'dstrect' is NULL, the whole surface will be filled with 'color'
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
* This function returns 0 on success, or -1 on error.
*/
int SDL_FillRect
(SDL_Surface *dst, SDL_Rect *dstrect, uint32_t color);
/**
* This function takes a surface and copies it to a new surface of the
* pixel format and colors of the video framebuffer, suitable for fast
* blitting onto the display surface. It calls SDL_ConvertSurface()
*
* If you want to take advantage of hardware colorkey or alpha blit
* acceleration, you should set the colorkey and alpha value before
* calling this function.
*
* If the conversion fails or runs out of memory, it returns NULL
*/
SDL_Surface *SDL_DisplayFormat(SDL_Surface *surface);
/**
* This function takes a surface and copies it to a new surface of the
* pixel format and colors of the video framebuffer (if possible),
* suitable for fast alpha blitting onto the display surface.
* The new surface will always have an alpha channel.
*
* If you want to take advantage of hardware colorkey or alpha blit
* acceleration, you should set the colorkey and alpha value before
* calling this function.
*
* If the conversion fails or runs out of memory, it returns NULL
*/
SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** @name YUV video surface overlay functions */ /*@{*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** This function creates a video output overlay
* Calling the returned surface an overlay is something of a misnomer because
* the contents of the display surface underneath the area where the overlay
* is shown is undefined - it may be overwritten with the converted YUV data.
*/
SDL_Overlay *SDL_CreateYUVOverlay(int width, int height,
uint32_t format, SDL_Surface *display);
/** Lock an overlay for direct access, and unlock it when you are done */
int SDL_LockYUVOverlay(SDL_Overlay *overlay);
void SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
/** Blit a video overlay to the display surface.
* The contents of the video surface underneath the blit destination are
* not defined.
* The width and height of the destination rectangle may be different from
* that of the overlay, but currently only 2x scaling is supported.
*/
int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
/** Free a video overlay */
void SDL_FreeYUVOverlay(SDL_Overlay *overlay);
/*@}*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** @name OpenGL support functions. */ /*@{*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Dynamically load an OpenGL library, or the default one if path is NULL
*
* If you do this, you need to retrieve all of the GL functions used in
* your program from the dynamic library using SDL_GL_GetProcAddress().
*/
int SDL_GL_LoadLibrary(const char *path);
/**
* Get the address of a GL function
*/
void *SDL_GL_GetProcAddress(const char *proc);
/**
* Set an attribute of the OpenGL subsystem before intialization.
*/
int SDL_GL_SetAttribute(SDL_GLattr attr, int value);
/**
* Get an attribute of the OpenGL subsystem from the windowing
* interface, such as glX. This is of course different from getting
* the values from SDL's internal OpenGL subsystem, which only
* stores the values you request before initialization.
*
* Developers should track the values they pass into SDL_GL_SetAttribute
* themselves if they want to retrieve these values.
*/
int SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
/**
* Swap the OpenGL buffers, if double-buffering is supported.
*/
void SDL_GL_SwapBuffers();
/** @name OpenGL Internal Functions
* Internal functions that should not be called unless you have read
* and understood the source code for these functions.
*/
/*@{*/
void SDL_GL_UpdateRects(int numrects, SDL_Rect *rects);
void SDL_GL_Lock();
void SDL_GL_Unlock();
/*@}*/
/*@}*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** @name Window Manager Functions */
/** These functions allow interaction with the window manager, if any. */ /*@{*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Sets the title and icon text of the display window (UTF-8 encoded)
*/
void SDL_WM_SetCaption(const char *title, const char *icon);
/**
* Gets the title and icon text of the display window (UTF-8 encoded)
*/
void SDL_WM_GetCaption(char **title, char **icon);
/**
* Sets the icon for the display window.
* This function must be called before the first call to SDL_SetVideoMode().
* It takes an icon surface, and a mask in MSB format.
* If 'mask' is NULL, the entire icon surface will be used as the icon.
*/
void SDL_WM_SetIcon(SDL_Surface *icon, uint8_t *mask);
/**
* This function iconifies the window, and returns 1 if it succeeded.
* If the function succeeds, it generates an SDL_APPACTIVE loss event.
* This function is a noop and returns 0 in non-windowed environments.
*/
int SDL_WM_IconifyWindow();
/**
* Toggle fullscreen mode without changing the contents of the screen.
* If the display surface does not require locking before accessing
* the pixel information, then the memory pointers will not change.
*
* If this function was able to toggle fullscreen mode (change from
* running in a window to fullscreen, or vice-versa), it will return 1.
* If it is not implemented, or fails, it returns 0.
*
* The next call to SDL_SetVideoMode() will set the mode fullscreen
* attribute based on the flags parameter - if SDL_FULLSCREEN is not
* set, then the display will be windowed by default where supported.
*
* This is currently only implemented in the X11 video driver.
*/
int SDL_WM_ToggleFullScreen(SDL_Surface *surface);
enum SDL_GrabMode {
QUERY = -1,
OFF = 0,
ON = 1,
FULLSCREEN /**< Used internally */
};
/**
* This function allows you to set and query the input grab state of
* the application. It returns the new input grab state.
*
* Grabbing means that the mouse is confined to the application window,
* and nearly all keyboard input is passed directly to the application,
* and not interpreted by a window manager, if any.
*/
SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);
/*@}*/
/** @internal Not in public API at the moment - do not use! */
int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
}
|
D
|
//Author Ratzenfutz
/*
Problem 127
Anagrams
*/
import std.algorithm, std.string, std.stdio, std.array, std.conv;
immutable string filename = "problem127.txt";
int main()
{
string[] temporary;
/* read from source, sort entry, write to temp */
File anagrams = File(filename, "r");
while (!anagrams.eof())
{
temporary ~= array(anagrams.readln.strip).sort.to!string;
}
anagrams.close();
/* work with sorted temp */
temporary.sort;
uint words = readln.strip.to!uint;
uint[] shuffle;
for (uint k = 0; k < words; k++)
{
string w = array(readln.strip).sort.to!string;
int p = countUntil(temporary, w);
if (p >= 0)
{
uint a = 0;
while (temporary[p] == w)
{
a++; p++;
}
shuffle ~= (a - 1);
}
else
shuffle ~= 0;
}
writeln;
for (uint k = 0; k < shuffle.length; k++) write(shuffle[k], " ");
writeln;
return 0;
}
|
D
|
/*********************************************************
Авторское право: (C) 2008 принадлежит Steven Schveighoffer.
Все права защищены
Лицензия: $(LICENSE)
**********************************************************/
module col.LinkList;
public import col.model.List;
private import col.Link;
private import col.Functions;
/+ ИНТЕРФЕЙС:
class СвязкаСписок(З, alias ШаблРеализац = ГоловаСвязки) : Список!(З)
{
alias ГоловаСвязки!(З) Реализ;
alias СвязкаСписок!(З, ШаблРеализац) ТипСвязкаСписок;
struct курсор
{
З значение();
З значение(З з);
курсор opPostInc();
курсор opPostDec();
курсор opAddAssign(цел прир);
курсор opSubAssign(цел прир);
бул opEquals(курсор обх);
}
this();
private this(ref Реализ дубИз, бул копироватьУзлы);
ТипСвязкаСписок очисти();
бцел длина();
alias длина length;
курсор начало();
курсор конец();
курсор удали(курсор обх);
курсор удали(курсор первый, курсор последн);
ТипСвязкаСписок удали(З з);
ТипСвязкаСписок удали(З з, ref бул был_Удалён);
курсор найди(курсор обх, З з);
курсор найди(З з);
бул содержит(З з);
цел opApply(цел delegate(ref З значение) дг);
final цел очистить(цел delegate(ref бул удалить_ли, ref З значение) дг);
ТипСвязкаСписок добавь(З з);
ТипСвязкаСписок добавь(З з, ref бул был_добавлен);
ТипСвязкаСписок добавь(Обходчик!(З) колл);
ТипСвязкаСписок добавь(Обходчик!(З) колл, ref бцел чло_добавленных);
ТипСвязкаСписок добавь(З[] массив);
ТипСвязкаСписок добавь(З[] массив, ref бцел чло_добавленных);
бцел счёт(З з);
ТипСвязкаСписок удалиВсе(З з);
ТипСвязкаСписок удалиВсе(З з, ref бцел чло_Удалённых);
курсор вставь(курсор обх, З з);
курсор приставь(З з);
курсор поставь(З з);
З тыл();
З фронт();
З возьмиФронт();
З возьмиТыл();
ТипСвязкаСписок opCat(Список!(З) rhs);
ТипСвязкаСписок opCat(З[] массив);
ТипСвязкаСписок opCat_r(З[] массив);
ТипСвязкаСписок opCatAssign(Список!(З) rhs);
ТипСвязкаСписок opCatAssign(З[] массив);
ТипСвязкаСписок dup();
цел opEquals(Объект o);
СвязкаСписок сортируй(цел delegate(ref З, ref З) comp);
СвязкаСписок сортируй(цел function(ref З, ref З) comp);
СвязкаСписок сортируй();
СвязкаСписок сортируйИкс(Сравниватель)(Сравниватель comp);
}
+/
/**
* Этот класс реализует интерфейс списка, использующего узлы Связка. Это даётs
*преимущество O(1) добавления и удаления, но не даёт случайного доступа.
*
* Добавление элементов не влияет ни на какой курсор.
*
* Удаление элементов не влияет ни на какой курсор, если он не указывает
* на удалённый элемент, в случае чего обх повреждается.
*
* Реализация может быть swapped out для другой реализации
* дваджы линкованного списка. Эта реалзация должна быть структурой, использующей один
* шаблонный аргумент З со следующими членами (если не указано иного, то члены
* могут реализовываться как свойства):
*
* параметры -> тип данных, передаваемый набору в помощь при установке Узел.
* Для этого типа нет особых требований.
*
* Узел -> тип данных, представляющий Узел в списке. Желательно, чтобы был
* ссылочного типа. Каждый Узел должен определять следующие члены:
* З значение -> значение, хранимое в этом Узел. Не может быть свойством.
* Узел предш -> (только получение) предыдущий Узел в списке
* Узел следщ -> (только получение (get)) следщ Узел в списке
*
* Узел конец -> (только получение (get)) Инвалидный Узел, который указывает сразу за последн валидный
* Узел. конец.предш должно быть последн валидным Узел. конец.следщ не определён.
*
* Узел начало -> (только получение (get)) Первый валидный Узел. начало.предш не определено.
*
* бцел счёт -> (только получение (get)) Число узлов в списке. Может быть
* вычислено за O(n) раз, ради эффективного удаления нескольких
* узлов.
*
* проц установка(параметры p) -> установить список. Подобно конструктору.
*
* Узел удали(Узел n) -> удаляет данный Узел из списка. Возвращает
* следщ Узел в списке.
*
* Узел удали(Узел первый, Узел последн) -> удаляет узлы отпервый до последн,
* не включая последн. Возвращает последн. Может выполняться за O(n) раз, если счёт
* O(1), или O(1) раз, если счёт is O(n).
*
* Узел вставь(Узел перед, З з) -> добавить новый Узел перед Узел 'перед',
* возвращает указатель на новый Узел.
*
* проц очисти() -> удалить все узлы из списка.
*
* проц сортируй(ФункцСравнения!(З) comp) -> сортировать список, согласно
* функции сравнения
*
*/
class СвязкаСписок(З, alias ШаблРеализац = ГоловаСвязки) : Список!(З)
{
/**
* алиас для удобства
*/
alias ГоловаСвязки!(З) Реализ;
/**
* алиас для удобства
*/
alias СвязкаСписок!(З, ШаблРеализац) ТипСвязкаСписок;
private Реализ _связка;
/**
* Курсор для линк-списка
*/
struct курсор
{
private Реализ.Узел укз; alias укз ptr;
/**
* Выдаст значение, на которое указывает this курсор
*/
З значение()
{
return укз.значение;
}
/**
* Установит значение, на которое указывает this курсор
*/
З значение(З з)
{
return (укз.значение = з);
}
/**
* Увеличивает этот курсор, возвращая то значение, которое было до
* этого.
*/
курсор opPostInc()
{
курсор врм = *this;
укз = укз.следщ;
return врм;
}
/**
* Уменьшает этот курсор, возращая значение, которое было до
* декрементации.
*/
курсор opPostDec()
{
курсор врм = *this;
укз = укз.предш;
return врм;
}
/**
* Увеличивает курсор на указанное количество.
*
* Это операция O(прир)! * Следует лишь использовать этот оператор в
* такой форме:
*
* ++i;
*/
курсор opAddAssign(цел прир)
{
if(прир < 0)
return opSubAssign(-прир);
while(прир--)
укз = укз.следщ;
return *this;
}
/**
* Уменьшает курсор на заданное значение.
*
* Это операция O(прир)! * Следует лишь использовать этот оператор в
* такой форме:
*
* --i;
*/
курсор opSubAssign(цел прир)
{
if(прир < 0)
return opAddAssign(-прир);
while(прир--)
укз = укз.предш;
return *this;
}
/**
* Сравнивает два курсора на равенство
*/
бул opEquals(курсор обх)
{
return укз is обх.ptr;
}
}
/**
* Конструктор
*/
this()
{
_связка.установка();
}
//
// Приватный конструктор для dup
//
private this(ref Реализ дубИз, бул копироватьУзлы)
{
дубИз.копируйВ(_связка, копироватьУзлы);
}
/**
*Очистить все элементы коллекции
*/
ТипСвязкаСписок очисти()
{
_связка.очисти();
return this;
}
/**
* Возвращает число элементов в коллекции
*/
бцел длина()
{
return _связка.счёт;
}
alias длина length;
/**
* Возвращает курсор на первый элемент в коллекции.
*/
курсор начало()
{
курсор обх;
обх.ptr = _связка.начало;
return обх;
}
/**
* Возвращает курсор, который указывает сразу после последнего элемента
* коллекции.
*/
курсор конец()
{
курсор обх;
обх.ptr = _связка.конец;
return обх;
}
/**
* Удаляет элемент, на который указывает данный курсор, возвращая
* курсор, указывающий на следующий элемент в коллекции.
*
* Выполняется за O(1) раз.
*/
курсор удали(курсор обх)
{
обх.ptr = _связка.удали(обх.ptr);
return обх;
}
/**
* Удалить элементы, на которые указывает диапазон данного курсора, возвращая
* курсор, указывающий на элемент, на который указывал последн.
*
* Выполняется за O(последн-первый) раз.
*/
курсор удали(курсор первый, курсор последн)
{
последн.ptr = _связка.удали(первый.ptr, последн.ptr);
return последн;
}
/**
*Удаляет первый элемент, у которого значение з. Возвращает да, если
* значение имелось и было удалено.
*
* Выполняется за O(n) раз.
*/
ТипСвязкаСписок удали(З з)
{
бул пропущен;
return удали(з, пропущен);
}
/**
*Удаляет первый элемент, у которого значение з. Возвращает да, если
* значение имелось и было удалено.
*
* Выполняется за O(n) раз.
*/
ТипСвязкаСписок удали(З з, ref бул был_Удалён)
{
auto обх = найди(з);
if(обх == конец)
{
был_Удалён = нет;
}
else
{
был_Удалён = да;
удали(обх);
}
return this;
}
/**
* Найти указанное значение в коллекции, начиная с данного курсора.
* Это полезно для итерации по всем элементам с одинаковыми значениями.
*
* Выполняется за O(n) раз.
*/
курсор найди(курсор обх, З з)
{
return _найди(обх, конец, з);
}
/**
* Найти экземпляр значения в коллекции. Эквивалентно
* найди(начало, з);
*
* Выполняется за O(n) раз.
*/
курсор найди(З з)
{
return _найди(начало, конец, з);
}
private курсор _найди(курсор обх, курсор последн, З з)
{
while(обх != последн && обх.значение != з)
обх++;
return обх;
}
/**
*Возвращает да, если данное значение есть в коллекции.
*
* Выполняется за O(n) раз.
*/
бул содержит(З з)
{
return найди(з) != конец;
}
private цел _примени(цел delegate(ref бул, ref З) дг, курсор старт, курсор последн)
{
курсор i = старт;
цел возврдг = 0;
бул удалить_ли;
while(i != последн && i.ptr !is _связка.конец)
{
удалить_ли = нет;
if((возврдг = дг(удалить_ли, i.ptr.значение)) != 0)
break;
if(удалить_ли)
удали(i++);
else
i++;
}
return возврдг;
}
private цел _примени(цел delegate(ref З значение) дг, курсор первый, курсор последн)
{
цел возврзнач = 0;
for(курсор i = первый; i != последн; i++)
if((возврзнач = дг(i.ptr.значение)) != 0)
break;
return возврзнач;
}
/**
* Итерирует по значениям коллекции
*/
цел opApply(цел delegate(ref З значение) дг)
{
return _примени(дг, начало, конец);
}
/**
* Итерирует по значениям коллекции, определяя те, которые следует
* удалить
*
* Используйте таким образом:
*
* -----------
* // удалить все нечётные значения
* foreach(ref чистить_ли, з; &list.очистить)
* {
* чистить_ли = ((з & 1) == 1);
* }
* -----------
*/
final цел очистить(цел delegate(ref бул удалить_ли, ref З значение) дг)
{
return _примени(дг, начало, конец);
}
/**
* Добавляет элемент в список. * Возвращает да, если элемент ещё не
* присутствовал.
*
* Выполняется за O(1) раз.
*/
ТипСвязкаСписок добавь(З з)
{
_связка.вставь(_связка.конец, з);
return this;
}
/**
* Добавляет элемент в список. * Возвращает да, если элемент ещё не
* присутствовал.
*
* Выполняется за O(1) раз.
*/
ТипСвязкаСписок добавь(З з, ref бул был_добавлен)
{
_связка.вставь(_связка.конец, з);
был_добавлен = да;
return this;
}
/**
* Добавляет все значения из данного итератора в список.
*
*Возвращает this.
*/
ТипСвязкаСписок добавь(Обходчик!(З) колл)
{
foreach(з; колл)
добавь(з);
return this;
}
/**
* Добавляет все значения из данного итератора в список.
*
* Возвращает число добавленных элементов.
*/
ТипСвязкаСписок добавь(Обходчик!(З) колл, ref бцел чло_добавленных)
{
бцел оригДлина = длина;
добавь(колл);
чло_добавленных = длина - оригДлина;
return this;
}
/**
* Добавляет все значения из данного массива массив в список.
*
* Возвращает число добавленных элементов.
*/
ТипСвязкаСписок добавь(З[] массив)
{
foreach(з; массив)
добавь(з);
return this;
}
/**
* Добавляет все значения из данного массива массив в список.
*
* Возвращает число добавленных элементов.
*/
ТипСвязкаСписок добавь(З[] массив, ref бцел чло_добавленных)
{
foreach(з; массив)
добавь(з);
чло_добавленных = массив.length;
return this;
}
/**
*Посчитать число случаев з<начения>
*
* Выполняется за O(n) раз.
*/
бцел счёт(З з)
{
бцел экземпляры = 0;
foreach(x; this)
if(з == x)
экземпляры++;
return экземпляры;
}
/**
* Удалить все случаи з<начения>. Возвращаает число экземпляров, которые
* были удалены.
*
* Выполняется за O(n) раз.
*/
ТипСвязкаСписок удалиВсе(З з)
{
foreach(ref dp, x; &очистить)
{
dp = cast(бул)(x == з);
}
return this;
}
/**
* Удалить все случаи з<начения>. Возвращаает число экземпляров, которые
* были удалены.
*
* Выполняется за O(n) раз.
*/
ТипСвязкаСписок удалиВсе(З з, ref бцел чло_Удалённых)
{
бцел оригДлина;
удалиВсе(з);
чло_Удалённых = оригДлина - длина;
return this;
}
//
// handy link-list only functions
//
/**
* Вставить элемент по указанной позиция. Returns a курсор to the
* вновь вставленный элемент.
*/
курсор вставь(курсор обх, З з)
{
обх.ptr = _связка.вставь(обх.ptr, з);
return обх;
}
/**
* Приставить элемент к первый элемент в списке. Возвращает
* курсор на нов приставленный (prepended) элемент.
*/
курсор приставь(З з)
{
return вставь(начало, з);
}
/**
* Поставить элемент в последн элемент в списке. Возвращает курсор
* на вновь добавленный (appended) элемент.
*/
курсор поставь(З з)
{
return вставь(конец, з);
}
/**
* Вернуть последний элемент в списке. Неопределённо, если список пустой.
*/
З тыл()
{
return _связка.конец.предш.значение;
}
/**
* Вернуть первый элемент в списке. Неопределённо, если список пустой.
*/
З фронт()
{
return _связка.начало.значение;
}
/**
* Удалить первый элемент в списке, и вернуть его значение.
*
* Не вызывайте при пустом списке!
*/
З возьмиФронт()
{
auto возврзнач = фронт;
_связка.удали(_связка.начало);
return возврзнач;
}
/**
* Удалить последн элемент в списке, и вернуть его значение
* Не вызывайте при пустом списке!
*/
З возьмиТыл()
{
auto возврзнач = тыл;
_связка.удали(_связка.конец.предш);
return возврзнач;
}
/**
* Создать новый список с this и rhs, конкатенированными вместе
*/
ТипСвязкаСписок opCat(Список!(З) rhs)
{
return dup.добавь(rhs);
}
/**
* Создать новый список с this и массивом, конкатенированными вместе
*/
ТипСвязкаСписок opCat(З[] массив)
{
return dup.добавь(массив);
}
/**
* Создать новый список с массивом и списком this, конкатенированными вместе.
*/
ТипСвязкаСписок opCat_r(З[] массив)
{
auto рез = new ТипСвязкаСписок(_связка, нет);
return рез.добавь(массив).добавь(this);
}
/**
* Приставить данный список в конец списка this.
*/
ТипСвязкаСписок opCatAssign(Список!(З) rhs)
{
return добавь(rhs);
}
/**
* Приставить данный массив в конец списка this.
*/
ТипСвязкаСписок opCatAssign(З[] массив)
{
return добавь(массив);
}
/**
* Дублировать список
*/
ТипСвязкаСписок dup()
{
return new ТипСвязкаСписок(_связка, да);
}
/**
* Сравнить список this с другим. Возвращает да, если у обеих списков
* одинаковая длина и все элементы одинаковы.
*
* Если o is пусто или не Список, return 0.
*/
цел opEquals(Объект o)
{
if(o !is пусто)
{
auto li = cast(Список!(З))o;
if(li !is пусто && li.length == длина)
{
auto c = начало;
foreach(элт; li)
{
if(элт != c++.значение)
return 0;
}
return 1;
}
}
return 0;
}
/**
* Сортировать список, в соответствии с заданной функцией сравнения.
*
*Выполняется за O(n lg(n)) раз
*
* После сортировки возвращает this
*/
СвязкаСписок сортируй(цел delegate(ref З, ref З) comp)
{
_связка.сортируй(comp);
return this;
}
/**
* Сортировать список, в соответствии с заданной функцией сравнения.
*
*Выполняется за O(n lg(n)) раз
*
* После сортировки возвращает this
*/
СвязкаСписок сортируй(цел function(ref З, ref З) comp)
{
_связка.сортируй(comp);
return this;
}
/**
* Сортирует линкованный список в соответствии с дефолтной функцией сравнения для З.
*
*Выполняется за O(n lg(n)) раз
*
* Возвращает this
*/
СвязкаСписок сортируй()
{
return сортируй(&ДефСравнить!(З));
}
/**
* Сортирует линкованный список в согласии с указанным функтором сравнения. Является
* шаблонизированной версией, и поэтому может использоваться с функторами, и может быть
* inlined.
*/
СвязкаСписок сортируйИкс(Сравниватель)(Сравниватель comp)
{
_связка.сортируй(comp);
return this;
}
}
version(UnitTest)
{
unittest
{
auto ll = new СвязкаСписок!(бцел);
Список!(бцел) l = ll;
l.добавь([0U, 1, 2, 3, 4, 5]);
assert(l.length == 6);
assert(l.содержит(5));
foreach(ref чистить_ли, i; &l.очистить)
чистить_ли = (i % 2 == 1);
assert(l.length == 3);
assert(!l.содержит(5));
}
}
|
D
|
/*
Copyright © 2020, Luna Nielsen
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna Nielsen
*/
module engine.vn.render.dialg;
import engine;
import std.conv;
import std.string : split;
import std.random;
private struct textInstr {
dstring instr;
dstring value;
}
private textInstr parseInstr(dstring txt) {
textInstr instr;
instr.instr = txt[0..2];
instr.value = txt[2..$];
return instr;
}
/**
Renderer for visual novel dialogue, supports slow-typing
*/
class DialogueRenderer {
private:
enum DEFAULT_TIMEOUT = 0.045;
dstring current;
size_t rendOffset = 0;
double accum = 0;
double timeout = DEFAULT_TIMEOUT;
double sleep = 0;
bool requestHide = false;
public:
/**
Resets text speed
*/
void resetSpeed() {
timeout = DEFAULT_TIMEOUT;
}
/**
Gets the current text buffer being rendered
*/
dstring currentTextBuffer() {
return current;
}
/**
Whether the text requested for the dialogue to be hidden
*/
bool isHidingRequested() {
return requestHide;
}
/**
Skip to end of dialogue
*/
void skip() {
if (!done) {
rendOffset = current.length;
resetSpeed();
}
}
/**
Gets whether the renderer is empty
*/
bool empty() {
return current.length == 0;
}
/**
Gets whether this line is done
*/
bool done() {
return rendOffset == current.length;
}
/**
Push text for rendering
*/
void pushText(dstring text) {
current = text;
rendOffset = 0;
accum = 0;
}
void update() {
// Don't try to uupdate empty text
if (empty) return;
// Accumulator
accum += 1*deltaTime;
// Handle sleeping
if (sleep > 0) {
if (accum >= sleep) {
sleep = 0;
accum = 0;
while(!done && current[rendOffset] != ']') rendOffset++;
rendOffset++;
}
else return;
}
// If we're past the end for some reason, fix it
// Handle slowtyping text
if (accum >= timeout) {
accum -= timeout;
if (!done) {
if (current[rendOffset] == '\n') rendOffset++;
size_t i = rendOffset;
// Parse time changes
while (i < current.length-3 && current[i] == '[' && current[i+1] == '&') {
i += 2;
while(i < current.length && current[i] != ']') i++;
i++;
// Get the instruction
textInstr instr = parseInstr(current[rendOffset+2..i-1]);
switch(instr.instr) {
case "tm"d:
if (instr.value == "clear") {
timeout = DEFAULT_TIMEOUT;
break;
}
timeout = parse!double(instr.value);
break;
case "sl"d:
sleep = parse!double(instr.value);
return;
case "rh"d:
requestHide = true;
break;
case "rs"d:
requestHide = false;
break;
default: break;
}
}
// Extra increment
if (i < current.length) i++;
rendOffset = i;
}
}
}
void draw(vec2 at, int size = 48) {
// Don't try to render empty text
if (empty) return;
// Always flush drawing when done
scope(exit) GameFont.flush();
// Setup
GameFont.changeSize(size);
vec2 metrics = GameFont.getMetrics();
at += vec2(metrics.x/2, metrics.y/2);;
vec2 cursor = at;
int shake = 0;
int wave = 0;
int waveSpeed = 5;
bool waveRot = false;
vec4 color = vec4(1, 1, 1, 1);
for(int i = 0; i < rendOffset; i++) {
// Values for this iteration
dchar c = current[i];
vec2 advance = GameFont.advance(c);
// Parse mode changes
if (i < current.length-3) {
while (current[i] == '[' && current[i+1] == '&') {
i += 2;
// Go till end of instruction
size_t startOffset = i;
while(i != current.length-1 && current[i] != ']') i++;
i++;
// Get the instruction
textInstr instr = parseInstr(current[startOffset..i-1]);
switch(instr.instr) {
case "cl"d:
// Handle clear
if (instr.value == "clear") {
color = vec4(1, 1, 1, 1);
break;
}
// Try to figure out color
dstring[] vals = instr.value.split(',');
if (vals.length != 3) break;
// Parse colors
color.r = parse!float(vals[0]);
color.g = parse!float(vals[1]);
color.b = parse!float(vals[2]);
break;
case "wv"d:
// Handle clear
if (instr.value == "clear") {
wave = 0;
break;
}
shake = 0;
wave = parse!int(instr.value);
break;
case "wr"d:
waveRot = parse!bool(instr.value);
break;
case "ws"d:
// Handle clear
if (instr.value == "clear") {
waveSpeed = 5;
break;
}
waveSpeed = parse!int(instr.value);
break;
case "sh"d:
// Handle clear
if (instr.value == "clear") {
shake = 0;
break;
}
wave = 0;
shake = parse!int(instr.value);
break;
default: break;
}
if (i < current.length) {
c = current[i];
advance = GameFont.advance(c);
} else return;
}
}
// Handle newlines
if (c == '\n') {
cursor.x = at.x;
cursor.y += metrics.y;
continue;
}
// Skip all the parsing stuff for whitespace
if (c == ' ') {
cursor.x += advance.x;
continue;
}
vec2 lCursor = cursor;
float rot = 0;
if (wave > 0) {
cursor.y += sin((currTime()+cast(float)i)*waveSpeed)*wave;
if (waveRot) rot += sin((currTime()+cast(float)i)*waveSpeed)*(0.015*wave);
}
if (shake > 0) {
cursor.x += ((uniform01()*2)-1)*shake;
cursor.y += ((uniform01()*2)-1)*shake;
}
// Draw font
GameFont.draw(c, cursor, vec2(advance.x/2, metrics.y/2), rot, color);
cursor = lCursor;
cursor.x += advance.x;
}
}
}
|
D
|
/*
Copyright (c) 2015 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module dlib.core.thread;
/*
* GC-free, Phobos-independent thread module.
* Inspired by core.thread, with an additional support for thread termination.
*/
version(Windows)
{
extern(Windows):
struct SECURITY_ATTRIBUTES
{
uint nLength;
void* lpSecurityDescriptor;
int bInheritHandle;
}
alias extern(Windows) uint function(in void*) LPTHREAD_START_ROUTINE;
void* CreateThread(
in SECURITY_ATTRIBUTES* lpThreadAttributes,
in size_t dwStackSize,
in LPTHREAD_START_ROUTINE lpStartAddress,
in void* lpParameter,
in uint dwCreationFlags,
uint* lpThreadId
);
uint WaitForMultipleObjects(
in uint nCount,
in void** lpHandles,
in int bWaitAll,
in uint dwMilliseconds
);
int TerminateThread(
void* hThread,
in uint dwExitCode
);
int GetExitCodeThread(
in void* hThread,
uint* lpExitCode
);
int CloseHandle(
in void* hObject
);
enum INFINITE = uint.max;
enum STILL_ACTIVE = 259;
}
version(Posix)
{
import core.sys.posix.pthread;
}
class Thread
{
private void function() func;
private void delegate() dlgt;
private bool callFunc;
private bool initialized = false;
version(Windows)
{
private void* winThread;
}
version(Posix)
{
private pthread_t posixThread;
private bool running = false;
}
this(void function() func)
{
this.func = func;
callFunc = true;
}
this(void delegate() dlgt)
{
this.dlgt = dlgt;
callFunc = false;
}
~this()
{
version(Windows)
{
if (winThread)
CloseHandle(winThread);
}
version(Posix)
{
if (initialized)
pthread_detach(posixThread);
}
}
void start()
{
version(Windows)
{
if (winThread)
CloseHandle(winThread);
uint threadId;
winThread = CreateThread(null, cast(size_t)0, &winThreadFunc, cast(void*)this, cast(uint)0, &threadId);
assert(winThread !is null);
initialized = true;
}
version(Posix)
{
running = true;
pthread_create(&posixThread, null, &posixThreadFunc, cast(void*)this);
// TODO: validate thread creation
initialized = true;
}
}
void join()
{
version(Windows)
{
WaitForMultipleObjects(1, &winThread, 1, INFINITE);
}
version(Posix)
{
pthread_join(posixThread, null);
}
}
bool isRunning()
{
version(Windows)
{
uint c = 0;
GetExitCodeThread(winThread, &c);
return (c == STILL_ACTIVE);
}
version(Posix)
{
return running;
}
}
void terminate()
{
version(Windows)
{
TerminateThread(winThread, 1);
}
version(Posix)
{
pthread_cancel(posixThread);
running = false;
}
}
version(Windows)
{
extern(Windows) static uint winThreadFunc(in void* lpParam)
{
Thread t = cast(Thread)lpParam;
if (t.callFunc)
t.func();
else
t.dlgt();
return 0;
}
}
version(Posix)
{
extern(C) static void* posixThreadFunc(void* arg)
{
Thread t = cast(Thread)arg;
if (t.callFunc)
t.func();
else
t.dlgt();
t.running = false;
return null;
}
}
}
|
D
|
/**
* Semantic analysis of expressions.
*
* Specification: ($LINK2 https://dlang.org/spec/expression.html, Expressions)
*
* Copyright: Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/expressionsem.d, _expressionsem.d)
* Documentation: https://dlang.org/phobos/dmd_expressionsem.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/expressionsem.d
*/
module dmd.expressionsem;
import core.stdc.stdio;
import dmd.access;
import dmd.aggregate;
import dmd.aliasthis;
import dmd.arrayop;
import dmd.arraytypes;
import dmd.attrib;
import dmd.astcodegen;
import dmd.astenums;
import dmd.canthrow;
import dmd.chkformat;
import dmd.ctorflow;
import dmd.dscope;
import dmd.dsymbol;
import dmd.declaration;
import dmd.dclass;
import dmd.dcast;
import dmd.delegatize;
import dmd.denum;
import dmd.dimport;
import dmd.dinterpret;
import dmd.dmangle;
import dmd.dmodule;
import dmd.dstruct;
import dmd.dsymbolsem;
import dmd.dtemplate;
import dmd.errors;
import dmd.escape;
import dmd.expression;
import dmd.file_manager;
import dmd.func;
import dmd.globals;
import dmd.hdrgen;
import dmd.id;
import dmd.identifier;
import dmd.imphint;
import dmd.importc;
import dmd.init;
import dmd.initsem;
import dmd.inline;
import dmd.intrange;
import dmd.location;
import dmd.mtype;
import dmd.mustuse;
import dmd.nspace;
import dmd.opover;
import dmd.optimize;
import dmd.parse;
import dmd.printast;
import dmd.root.array;
import dmd.root.ctfloat;
import dmd.root.filename;
import dmd.common.outbuffer;
import dmd.root.rootobject;
import dmd.root.string;
import dmd.root.utf;
import dmd.semantic2;
import dmd.semantic3;
import dmd.sideeffect;
import dmd.safe;
import dmd.target;
import dmd.tokens;
import dmd.traits;
import dmd.typesem;
import dmd.typinf;
import dmd.utils;
import dmd.visitor;
enum LOGSEMANTIC = false;
/********************************************************
* Perform semantic analysis and CTFE on expressions to produce
* a string.
* Params:
* buf = append generated string to buffer
* sc = context
* exps = array of Expressions
* Returns:
* true on error
*/
bool expressionsToString(ref OutBuffer buf, Scope* sc, Expressions* exps)
{
if (!exps)
return false;
foreach (ex; *exps)
{
if (!ex)
continue;
auto sc2 = sc.startCTFE();
sc2.tinst = null;
sc2.minst = null; // prevents emission of any instantiated templates to object file
auto e2 = ex.expressionSemantic(sc2);
auto e3 = resolveProperties(sc2, e2);
sc2.endCTFE();
// allowed to contain types as well as expressions
auto e4 = ctfeInterpretForPragmaMsg(e3);
if (!e4 || e4.op == EXP.error)
return true;
// expand tuple
if (auto te = e4.isTupleExp())
{
if (expressionsToString(buf, sc, te.exps))
return true;
continue;
}
// char literals exp `.toStringExp` return `null` but we cant override it
// because in most contexts we don't want the conversion to succeed.
IntegerExp ie = e4.isIntegerExp();
const ty = (ie && ie.type) ? ie.type.ty : Terror;
if (ty.isSomeChar)
{
auto tsa = new TypeSArray(ie.type, IntegerExp.literal!1);
e4 = new ArrayLiteralExp(ex.loc, tsa, ie);
}
if (StringExp se = e4.toStringExp())
buf.writestring(se.toUTF8(sc).peekString());
else
buf.writestring(e4.toString());
}
return false;
}
/***********************************************************
* Resolve `exp` as a compile-time known string.
* Params:
* sc = scope
* exp = Expression which expected as a string
* s = What the string is expected for, will be used in error diagnostic.
* Returns:
* String literal, or `null` if error happens.
*/
StringExp semanticString(Scope *sc, Expression exp, const char* s)
{
sc = sc.startCTFE();
exp = exp.expressionSemantic(sc);
exp = resolveProperties(sc, exp);
sc = sc.endCTFE();
if (exp.op == EXP.error)
return null;
auto e = exp;
if (exp.type.isString())
{
e = e.ctfeInterpret();
if (e.op == EXP.error)
return null;
}
auto se = e.toStringExp();
if (!se)
{
exp.error("`string` expected for %s, not `(%s)` of type `%s`",
s, exp.toChars(), exp.type.toChars());
return null;
}
return se;
}
private Expression extractOpDollarSideEffect(Scope* sc, UnaExp ue)
{
Expression e0;
Expression e1 = Expression.extractLast(ue.e1, e0);
// https://issues.dlang.org/show_bug.cgi?id=12585
// Extract the side effect part if ue.e1 is comma.
if ((sc.flags & SCOPE.ctfe) ? hasSideEffect(e1) : !isTrivialExp(e1)) // match logic in extractSideEffect()
{
/* Even if opDollar is needed, 'e1' should be evaluate only once. So
* Rewrite:
* e1.opIndex( ... use of $ ... )
* e1.opSlice( ... use of $ ... )
* as:
* (ref __dop = e1, __dop).opIndex( ... __dop.opDollar ...)
* (ref __dop = e1, __dop).opSlice( ... __dop.opDollar ...)
*/
e1 = extractSideEffect(sc, "__dop", e0, e1, false);
assert(e1.isVarExp());
e1.isVarExp().var.storage_class |= STC.exptemp; // lifetime limited to expression
}
ue.e1 = e1;
return e0;
}
/**************************************
* Runs semantic on ae.arguments. Declares temporary variables
* if '$' was used.
*/
Expression resolveOpDollar(Scope* sc, ArrayExp ae, Expression* pe0)
{
assert(!ae.lengthVar);
*pe0 = null;
AggregateDeclaration ad = isAggregate(ae.e1.type);
Dsymbol slice = search_function(ad, Id.slice);
//printf("slice = %s %s\n", slice.kind(), slice.toChars());
foreach (i, e; *ae.arguments)
{
if (i == 0)
*pe0 = extractOpDollarSideEffect(sc, ae);
if (e.op == EXP.interval && !(slice && slice.isTemplateDeclaration()))
{
Lfallback:
if (ae.arguments.length == 1)
return null;
ae.error("multi-dimensional slicing requires template `opSlice`");
return ErrorExp.get();
}
//printf("[%d] e = %s\n", i, e.toChars());
// Create scope for '$' variable for this dimension
auto sym = new ArrayScopeSymbol(sc, ae);
sym.parent = sc.scopesym;
sc = sc.push(sym);
ae.lengthVar = null; // Create it only if required
ae.currentDimension = i; // Dimension for $, if required
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
if (ae.lengthVar && sc.func)
{
// If $ was used, declare it now
Expression de = new DeclarationExp(ae.loc, ae.lengthVar);
de = de.expressionSemantic(sc);
*pe0 = Expression.combine(*pe0, de);
}
sc = sc.pop();
if (auto ie = e.isIntervalExp())
{
auto tiargs = new Objects();
Expression edim = new IntegerExp(ae.loc, i, Type.tsize_t);
edim = edim.expressionSemantic(sc);
tiargs.push(edim);
auto fargs = new Expressions(2);
(*fargs)[0] = ie.lwr;
(*fargs)[1] = ie.upr;
uint xerrors = global.startGagging();
sc = sc.push();
FuncDeclaration fslice = resolveFuncCall(ae.loc, sc, slice, tiargs, ae.e1.type, ArgumentList(fargs), FuncResolveFlag.quiet);
sc = sc.pop();
global.endGagging(xerrors);
if (!fslice)
goto Lfallback;
e = new DotTemplateInstanceExp(ae.loc, ae.e1, slice.ident, tiargs);
e = new CallExp(ae.loc, e, fargs);
e = e.expressionSemantic(sc);
}
if (!e.type)
{
ae.error("`%s` has no value", e.toChars());
e = ErrorExp.get();
}
if (e.op == EXP.error)
return e;
(*ae.arguments)[i] = e;
}
return ae;
}
/**************************************
* Runs semantic on se.lwr and se.upr. Declares a temporary variable
* if '$' was used.
* Returns:
* ae, or ErrorExp if errors occurred
*/
Expression resolveOpDollar(Scope* sc, ArrayExp ae, IntervalExp ie, Expression* pe0)
{
//assert(!ae.lengthVar);
if (!ie)
return ae;
VarDeclaration lengthVar = ae.lengthVar;
bool errors = false;
// create scope for '$'
auto sym = new ArrayScopeSymbol(sc, ae);
sym.parent = sc.scopesym;
sc = sc.push(sym);
Expression sem(Expression e)
{
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
if (!e.type)
{
ae.error("`%s` has no value", e.toChars());
errors = true;
}
return e;
}
ie.lwr = sem(ie.lwr);
ie.upr = sem(ie.upr);
if (ie.lwr.isErrorExp() || ie.upr.isErrorExp())
errors = true;
if (lengthVar != ae.lengthVar && sc.func)
{
// If $ was used, declare it now
Expression de = new DeclarationExp(ae.loc, ae.lengthVar);
de = de.expressionSemantic(sc);
*pe0 = Expression.combine(*pe0, de);
}
sc = sc.pop();
return errors ? ErrorExp.get() : ae;
}
/******************************
* Perform semantic() on an array of Expressions.
*/
extern(D) bool arrayExpressionSemantic(
Expression[] exps, Scope* sc, bool preserveErrors = false)
{
bool err = false;
foreach (ref e; exps)
{
if (e is null) continue;
auto e2 = e.expressionSemantic(sc);
if (e2.op == EXP.error)
err = true;
if (preserveErrors || e2.op != EXP.error)
e = e2;
}
return err;
}
/*
Checks if `exp` contains a direct access to a `noreturn`
variable. If that is the case, an `assert(0)` expression
is generated and returned. This function should be called
only after semantic analysis has been performed on `exp`.
Params:
exp = expression that is checked
Returns:
An `assert(0)` expression if `exp` contains a `noreturn`
variable access, `exp` otherwise.
*/
Expression checkNoreturnVarAccess(Expression exp)
{
assert(exp.type);
Expression result = exp;
if (exp.type.isTypeNoreturn() && !exp.isAssertExp() &&
!exp.isThrowExp() && !exp.isCallExp())
{
auto msg = new StringExp(exp.loc, "Accessed expression of type `noreturn`");
msg.type = Type.tstring;
result = new AssertExp(exp.loc, IntegerExp.literal!0, msg);
result.type = exp.type;
}
return result;
}
/******************************
* Find symbol in accordance with the UFCS name look up rule
*/
private Expression searchUFCS(Scope* sc, UnaExp ue, Identifier ident)
{
//printf("searchUFCS(ident = %s)\n", ident.toChars());
Loc loc = ue.loc;
// TODO: merge with Scope.search.searchScopes()
Dsymbol searchScopes(int flags)
{
Dsymbol s = null;
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (!scx.scopesym)
continue;
if (scx.scopesym.isModule())
flags |= SearchUnqualifiedModule; // tell Module.search() that SearchLocalsOnly is to be obeyed
s = scx.scopesym.search(loc, ident, flags);
if (s)
{
// overload set contains only module scope symbols.
if (s.isOverloadSet())
break;
// selective/renamed imports also be picked up
if (AliasDeclaration ad = s.isAliasDeclaration())
{
if (ad._import)
break;
}
// See only module scope symbols for UFCS target.
Dsymbol p = s.toParent2();
if (p && p.isModule())
break;
}
s = null;
// Stop when we hit a module, but keep going if that is not just under the global scope
if (scx.scopesym.isModule() && !(scx.enclosing && !scx.enclosing.enclosing))
break;
}
return s;
}
int flags = 0;
Dsymbol s;
if (sc.flags & SCOPE.ignoresymbolvisibility)
flags |= IgnoreSymbolVisibility;
// First look in local scopes
s = searchScopes(flags | SearchLocalsOnly);
if (!s)
{
// Second look in imported modules
s = searchScopes(flags | SearchImportsOnly);
}
if (!s)
return ue.e1.type.getProperty(sc, loc, ident, 0, ue.e1);
FuncDeclaration f = s.isFuncDeclaration();
if (f)
{
TemplateDeclaration td = getFuncTemplateDecl(f);
if (td)
{
if (td.overroot)
td = td.overroot;
s = td;
}
}
if (auto dti = ue.isDotTemplateInstanceExp())
{
// https://issues.dlang.org/show_bug.cgi?id=23968
// Typically, deprecated alias declarations are caught
// when `TemplateInstance.findTempDecl` is called,
// however, in this case the tempdecl field is updated
// therefore `findTempDecl` will return immediately
// and not get the chance to issue the deprecation.
if (s.isAliasDeclaration())
s.checkDeprecated(ue.loc, sc);
auto ti = new TemplateInstance(loc, s.ident, dti.ti.tiargs);
if (!ti.updateTempDecl(sc, s))
return ErrorExp.get();
return new ScopeExp(loc, ti);
}
else
{
//printf("-searchUFCS() %s\n", s.toChars());
return new DsymbolExp(loc, s);
}
}
/******************************
* Pull out callable entity with UFCS.
*/
private Expression resolveUFCS(Scope* sc, CallExp ce)
{
Loc loc = ce.loc;
Expression eleft;
Expression e;
if (auto die = ce.e1.isDotIdExp())
{
Identifier ident = die.ident;
Expression ex = die.dotIdSemanticPropX(sc);
if (ex != die)
{
ce.e1 = ex;
return null;
}
eleft = die.e1;
Type t = eleft.type.toBasetype();
if (t.ty == Tarray || t.ty == Tsarray || t.ty == Tnull || (t.isTypeBasic() && t.ty != Tvoid))
{
/* Built-in types and arrays have no callable properties, so do shortcut.
* It is necessary in: e.init()
*/
}
else if (t.ty == Taarray)
{
if (ident == Id.remove)
{
/* Transform:
* aa.remove(arg) into delete aa[arg]
*/
if (!ce.arguments || ce.arguments.length != 1)
{
ce.error("expected key as argument to `aa.remove()`");
return ErrorExp.get();
}
if (!eleft.type.isMutable())
{
ce.error("cannot remove key from `%s` associative array `%s`", MODtoChars(t.mod), eleft.toChars());
return ErrorExp.get();
}
Expression key = (*ce.arguments)[0];
key = key.expressionSemantic(sc);
key = resolveProperties(sc, key);
TypeAArray taa = t.isTypeAArray();
key = key.implicitCastTo(sc, taa.index);
if (key.checkValue() || key.checkSharedAccess(sc))
return ErrorExp.get();
semanticTypeInfo(sc, taa.index);
return new RemoveExp(loc, eleft, key);
}
}
else
{
if (Expression ey = die.dotIdSemanticProp(sc, 1))
{
if (ey.op == EXP.error)
return ey;
ce.e1 = ey;
if (isDotOpDispatch(ey))
{
// even opDispatch and UFCS must have valid arguments,
// so now that we've seen indication of a problem,
// check them for issues.
Expressions* originalArguments = Expression.arraySyntaxCopy(ce.arguments);
uint errors = global.startGagging();
e = ce.expressionSemantic(sc);
if (!global.endGagging(errors))
return e;
if (arrayExpressionSemantic(originalArguments.peekSlice(), sc))
return ErrorExp.get();
/* fall down to UFCS */
}
else
return null;
}
}
/* https://issues.dlang.org/show_bug.cgi?id=13953
*
* If a struct has an alias this to an associative array
* and remove is used on a struct instance, we have to
* check first if there is a remove function that can be called
* on the struct. If not we must check the alias this.
*
* struct A
* {
* string[string] a;
* alias a this;
* }
*
* void fun()
* {
* A s;
* s.remove("foo");
* }
*/
const errors = global.startGagging();
e = searchUFCS(sc, die, ident);
// if there were any errors and the identifier was remove
if (global.endGagging(errors))
{
if (ident == Id.remove)
{
// check alias this
Expression alias_e = resolveAliasThis(sc, die.e1, 1);
if (alias_e && alias_e != die.e1)
{
die.e1 = alias_e;
CallExp ce2 = ce.syntaxCopy();
ce2.e1 = die;
e = ce2.isCallExp().trySemantic(sc);
if (e)
return e;
}
}
// if alias this did not work out, print the initial errors
searchUFCS(sc, die, ident);
}
}
else if (auto dti = ce.e1.isDotTemplateInstanceExp())
{
if (Expression ey = dti.dotTemplateSemanticProp(sc, DotExpFlag.gag))
{
ce.e1 = ey;
return null;
}
eleft = dti.e1;
e = searchUFCS(sc, dti, dti.ti.name);
}
else
return null;
// Rewrite
ce.e1 = e;
if (!ce.arguments)
ce.arguments = new Expressions();
ce.arguments.shift(eleft);
if (!ce.names)
ce.names = new Identifiers();
ce.names.shift(null);
ce.isUfcsRewrite = true;
return null;
}
/******************************
* Pull out property with UFCS.
*/
private Expression resolveUFCSProperties(Scope* sc, Expression e1, Expression e2 = null)
{
Loc loc = e1.loc;
Expression eleft;
Expression e;
if (auto die = e1.isDotIdExp())
{
eleft = die.e1;
e = searchUFCS(sc, die, die.ident);
}
else if (auto dti = e1.isDotTemplateInstanceExp())
{
eleft = dti.e1;
e = searchUFCS(sc, dti, dti.ti.name);
}
else
return null;
if (e is null)
return null;
// Rewrite
if (e2)
{
// run semantic without gagging
e2 = e2.expressionSemantic(sc);
/* f(e1) = e2
*/
Expression ex = e.copy();
auto a1 = new Expressions(1);
(*a1)[0] = eleft;
ex = new CallExp(loc, ex, a1);
auto e1PassSemantic = ex.trySemantic(sc);
/* f(e1, e2)
*/
auto a2 = new Expressions(2);
(*a2)[0] = eleft;
(*a2)[1] = e2;
e = new CallExp(loc, e, a2);
e = e.trySemantic(sc);
if (!e1PassSemantic && !e)
{
/* https://issues.dlang.org/show_bug.cgi?id=20448
*
* If both versions have failed to pass semantic,
* f(e1) = e2 gets priority in error printing
* because f might be a templated function that
* failed to instantiate and we have to print
* the instantiation errors.
*/
return e1.expressionSemantic(sc);
}
else if (ex && !e)
{
ex = new AssignExp(loc, ex, e2);
return ex.expressionSemantic(sc);
}
else
{
// strict setter prints errors if fails
e = e.expressionSemantic(sc);
}
return e;
}
else
{
/* f(e1)
*/
auto arguments = new Expressions(1);
(*arguments)[0] = eleft;
e = new CallExp(loc, e, arguments);
// https://issues.dlang.org/show_bug.cgi?id=24017
if (sc.flags & SCOPE.debug_)
e.isCallExp().inDebugStatement = true;
e = e.expressionSemantic(sc);
return e;
}
}
/******************************
* If e1 is a property function (template), resolve it.
*/
Expression resolvePropertiesOnly(Scope* sc, Expression e1)
{
//printf("e1 = %s %s\n", Token.toChars(e1.op), e1.toChars());
Expression handleOverloadSet(OverloadSet os)
{
assert(os);
foreach (s; os.a)
{
auto fd = s.isFuncDeclaration();
auto td = s.isTemplateDeclaration();
if (fd)
{
if (fd.type.isTypeFunction().isproperty)
return resolveProperties(sc, e1);
}
else if (td && td.onemember && (fd = td.onemember.isFuncDeclaration()) !is null)
{
if (fd.type.isTypeFunction().isproperty ||
(fd.storage_class2 & STC.property) ||
(td._scope.stc & STC.property))
return resolveProperties(sc, e1);
}
}
return e1;
}
Expression handleTemplateDecl(TemplateDeclaration td)
{
assert(td);
if (td.onemember)
{
if (auto fd = td.onemember.isFuncDeclaration())
{
if (fd.type.isTypeFunction().isproperty ||
(fd.storage_class2 & STC.property) ||
(td._scope.stc & STC.property))
return resolveProperties(sc, e1);
}
}
return e1;
}
Expression handleFuncDecl(FuncDeclaration fd)
{
assert(fd);
if (fd.type.isTypeFunction().isproperty)
return resolveProperties(sc, e1);
return e1;
}
if (auto de = e1.isDotExp())
{
if (auto os = de.e2.isOverExp())
return handleOverloadSet(os.vars);
}
else if (auto oe = e1.isOverExp())
return handleOverloadSet(oe.vars);
else if (auto dti = e1.isDotTemplateInstanceExp())
{
if (dti.ti.tempdecl)
if (auto td = dti.ti.tempdecl.isTemplateDeclaration())
return handleTemplateDecl(td);
}
else if (auto dte = e1.isDotTemplateExp())
return handleTemplateDecl(dte.td);
else if (auto se = e1.isScopeExp())
{
Dsymbol s = se.sds;
TemplateInstance ti = s.isTemplateInstance();
if (ti && !ti.semanticRun && ti.tempdecl)
if (auto td = ti.tempdecl.isTemplateDeclaration())
return handleTemplateDecl(td);
}
else if (auto et = e1.isTemplateExp())
return handleTemplateDecl(et.td);
else if (e1.isDotVarExp() && e1.type.isTypeFunction())
{
DotVarExp dve = e1.isDotVarExp();
return handleFuncDecl(dve.var.isFuncDeclaration());
}
else if (e1.isVarExp() && e1.type && e1.type.isTypeFunction() && (sc.intypeof || !e1.isVarExp().var.needThis()))
return handleFuncDecl(e1.isVarExp().var.isFuncDeclaration());
return e1;
}
/****************************************
* Turn symbol `s` into the expression it represents.
*
* Params:
* s = symbol to resolve
* loc = location of use of `s`
* sc = context
* hasOverloads = applies if `s` represents a function.
* true means it's overloaded and will be resolved later,
* false means it's the exact function symbol.
* Returns:
* `s` turned into an expression, `ErrorExp` if an error occurred
*/
Expression symbolToExp(Dsymbol s, const ref Loc loc, Scope *sc, bool hasOverloads)
{
static if (LOGSEMANTIC)
{
printf("DsymbolExp::resolve(%s %s)\n", s.kind(), s.toChars());
}
Lagain:
Expression e;
//printf("DsymbolExp:: %p '%s' is a symbol\n", this, toChars());
//printf("s = '%s', s.kind = '%s'\n", s.toChars(), s.kind());
Dsymbol olds = s;
Declaration d = s.isDeclaration();
if (d && (d.storage_class & STC.templateparameter))
{
s = s.toAlias();
}
else
{
// functions are checked after overloading
// templates are checked after matching constraints
if (!s.isFuncDeclaration() && !s.isTemplateDeclaration())
{
s.checkDeprecated(loc, sc);
if (d)
d.checkDisabled(loc, sc);
}
// https://issues.dlang.org/show_bug.cgi?id=12023
// if 's' is a tuple variable, the tuple is returned.
s = s.toAlias();
//printf("s = '%s', s.kind = '%s', s.needThis() = %p\n", s.toChars(), s.kind(), s.needThis());
if (s != olds && !s.isFuncDeclaration() && !s.isTemplateDeclaration())
{
s.checkDeprecated(loc, sc);
if (d)
d.checkDisabled(loc, sc);
}
if (auto sd = s.isDeclaration())
{
if (sd.isSystem())
{
if (sc.setUnsafePreview(global.params.systemVariables, false, loc,
"cannot access `@system` variable `%s` in @safe code", sd))
{
if (auto v = sd.isVarDeclaration())
{
if (v.systemInferred)
errorSupplemental(v.loc, "`%s` is inferred to be `@system` from its initializer here", v.toChars());
else
errorSupplemental(v.loc, "`%s` is declared here", v.toChars());
}
return ErrorExp.get();
}
}
}
}
if (auto em = s.isEnumMember())
{
return em.getVarExp(loc, sc);
}
if (auto v = s.isVarDeclaration())
{
//printf("Identifier '%s' is a variable, type '%s'\n", s.toChars(), v.type.toChars());
if (sc.intypeof == 1 && !v.inuse)
v.dsymbolSemantic(sc);
if (!v.type || // during variable type inference
!v.type.deco && v.inuse) // during variable type semantic
{
if (v.inuse) // variable type depends on the variable itself
error(loc, "circular reference to %s `%s`", v.kind(), v.toPrettyChars());
else // variable type cannot be determined
error(loc, "forward reference to %s `%s`", v.kind(), v.toPrettyChars());
return ErrorExp.get();
}
if (v.type.ty == Terror)
return ErrorExp.get();
if ((v.storage_class & STC.manifest) && v._init)
{
if (v.inuse)
{
error(loc, "circular initialization of %s `%s`", v.kind(), v.toPrettyChars());
return ErrorExp.get();
}
e = v.expandInitializer(loc);
v.inuse++;
e = e.expressionSemantic(sc);
v.inuse--;
return e;
}
// We need to run semantics to correctly set 'STC.field' if it is a member variable
// that could be forward referenced. This is needed for 'v.needThis()' to work
if (v.isThis())
v.dsymbolSemantic(sc);
// Change the ancestor lambdas to delegate before hasThis(sc) call.
if (v.checkNestedReference(sc, loc))
return ErrorExp.get();
if (v.needThis() && hasThis(sc))
e = new DotVarExp(loc, new ThisExp(loc), v);
else
e = new VarExp(loc, v);
e = e.expressionSemantic(sc);
return e;
}
if (auto fld = s.isFuncLiteralDeclaration())
{
//printf("'%s' is a function literal\n", fld.toChars());
e = new FuncExp(loc, fld);
return e.expressionSemantic(sc);
}
if (auto f = s.isFuncDeclaration())
{
f = f.toAliasFunc();
if (!f.functionSemantic())
return ErrorExp.get();
if (!hasOverloads && f.checkForwardRef(loc))
return ErrorExp.get();
auto fd = s.isFuncDeclaration();
fd.type = f.type;
return new VarExp(loc, fd, hasOverloads);
}
if (OverDeclaration od = s.isOverDeclaration())
{
e = new VarExp(loc, od, true);
e.type = Type.tvoid;
return e;
}
if (OverloadSet o = s.isOverloadSet())
{
//printf("'%s' is an overload set\n", o.toChars());
return new OverExp(loc, o);
}
if (Import imp = s.isImport())
{
if (!imp.pkg)
{
.error(loc, "forward reference of import `%s`", imp.toChars());
return ErrorExp.get();
}
auto ie = new ScopeExp(loc, imp.pkg);
return ie.expressionSemantic(sc);
}
if (Package pkg = s.isPackage())
{
auto ie = new ScopeExp(loc, pkg);
return ie.expressionSemantic(sc);
}
if (Module mod = s.isModule())
{
auto ie = new ScopeExp(loc, mod);
return ie.expressionSemantic(sc);
}
if (Nspace ns = s.isNspace())
{
auto ie = new ScopeExp(loc, ns);
return ie.expressionSemantic(sc);
}
if (Type t = s.getType())
{
return (new TypeExp(loc, t)).expressionSemantic(sc);
}
if (TupleDeclaration tup = s.isTupleDeclaration())
{
if (tup.needThis() && hasThis(sc))
e = new DotVarExp(loc, new ThisExp(loc), tup);
else
e = new TupleExp(loc, tup);
e = e.expressionSemantic(sc);
return e;
}
if (TemplateInstance ti = s.isTemplateInstance())
{
ti.dsymbolSemantic(sc);
if (!ti.inst || ti.errors)
return ErrorExp.get();
s = ti.toAlias();
if (!s.isTemplateInstance())
goto Lagain;
e = new ScopeExp(loc, ti);
e = e.expressionSemantic(sc);
return e;
}
if (TemplateDeclaration td = s.isTemplateDeclaration())
{
Dsymbol p = td.toParentLocal();
FuncDeclaration fdthis = hasThis(sc);
AggregateDeclaration ad = p ? p.isAggregateDeclaration() : null;
if (fdthis && ad && fdthis.isMemberLocal() == ad && (td._scope.stc & STC.static_) == 0)
{
e = new DotTemplateExp(loc, new ThisExp(loc), td);
}
else
e = new TemplateExp(loc, td);
e = e.expressionSemantic(sc);
return e;
}
.error(loc, "%s `%s` is not a variable", s.kind(), s.toChars());
return ErrorExp.get();
}
/*************************************************************
* Given var, get the
* right `this` pointer if var is in an outer class, but our
* existing `this` pointer is in an inner class.
* Params:
* loc = location to use for error messages
* sc = context
* ad = struct or class we need the correct `this` for
* e1 = existing `this`
* var = the specific member of ad we're accessing
* flag = if true, return `null` instead of throwing an error
* Returns:
* Expression representing the `this` for the var
*/
private Expression getRightThis(const ref Loc loc, Scope* sc, AggregateDeclaration ad, Expression e1, Dsymbol var, int flag = 0)
{
//printf("\ngetRightThis(e1 = %s, ad = %s, var = %s)\n", e1.toChars(), ad.toChars(), var.toChars());
L1:
Type t = e1.type.toBasetype();
//printf("e1.type = %s, var.type = %s\n", e1.type.toChars(), var.type.toChars());
if (e1.op == EXP.objcClassReference)
{
// We already have an Objective-C class reference, just use that as 'this'.
return e1;
}
else if (ad && ad.isClassDeclaration && ad.isClassDeclaration.classKind == ClassKind.objc &&
var.isFuncDeclaration && var.isFuncDeclaration.isStatic &&
var.isFuncDeclaration.objc.selector)
{
return new ObjcClassReferenceExp(e1.loc, ad.isClassDeclaration());
}
/* Access of a member which is a template parameter in dual-scope scenario
* class A { inc(alias m)() { ++m; } } // `m` needs `this` of `B`
* class B {int m; inc() { new A().inc!m(); } }
*/
if (e1.op == EXP.this_)
{
FuncDeclaration f = hasThis(sc);
if (f && f.hasDualContext())
{
if (f.followInstantiationContext(ad))
{
e1 = new VarExp(loc, f.vthis);
e1 = new PtrExp(loc, e1);
e1 = new IndexExp(loc, e1, IntegerExp.literal!1);
e1 = getThisSkipNestedFuncs(loc, sc, f.toParent2(), ad, e1, t, var);
if (e1.op == EXP.error)
return e1;
goto L1;
}
}
}
/* If e1 is not the 'this' pointer for ad
*/
if (ad &&
!(t.isTypePointer() && t.nextOf().isTypeStruct() && t.nextOf().isTypeStruct().sym == ad) &&
!(t.isTypeStruct() && t.isTypeStruct().sym == ad))
{
ClassDeclaration cd = ad.isClassDeclaration();
ClassDeclaration tcd = t.isClassHandle();
/* e1 is the right this if ad is a base class of e1
*/
if (!cd || !tcd || !(tcd == cd || cd.isBaseOf(tcd, null)))
{
/* Only classes can be inner classes with an 'outer'
* member pointing to the enclosing class instance
*/
if (tcd && tcd.isNested())
{
/* e1 is the 'this' pointer for an inner class: tcd.
* Rewrite it as the 'this' pointer for the outer class.
*/
auto vthis = tcd.followInstantiationContext(ad) ? tcd.vthis2 : tcd.vthis;
e1 = new DotVarExp(loc, e1, vthis);
e1.type = vthis.type;
e1.type = e1.type.addMod(t.mod);
// Do not call ensureStaticLinkTo()
//e1 = e1.semantic(sc);
// Skip up over nested functions, and get the enclosing
// class type.
e1 = getThisSkipNestedFuncs(loc, sc, tcd.toParentP(ad), ad, e1, t, var);
if (e1.op == EXP.error)
return e1;
goto L1;
}
/* Can't find a path from e1 to ad
*/
if (flag)
return null;
e1.error("`this` for `%s` needs to be type `%s` not type `%s`", var.toChars(), ad.toChars(), t.toChars());
return ErrorExp.get();
}
}
return e1;
}
/*
* Check whether `outerFunc` and `calledFunc` have the same `this`.
* If `calledFunc` is the member of a base class of the class that contains
* `outerFunc` we consider that they have the same this.
*
* This function is used to test whether `this` needs to be prepended to
* a function call or function symbol. For example:
*
* struct X
* {
* void gun() {}
* }
* struct A
* {
* void fun() {}
* void sun()
* {
* fun();
* X.gun(); // error
* }
* }
*
* When `fun` is called, `outerfunc` = `sun` and `calledFunc = `fun`.
* `sun` is a member of `A` and `fun` is also a member of `A`, therefore
* `this` can be prepended to `fun`. When `gun` is called (it will result
* in an error, but that is not relevant here), which is a member of `X`,
* no `this` is needed because the outer function does not have the same
* `this` as `gun`.
*
* Returns:
* `true` if outerFunc and calledFunc may use the same `this` pointer.
* `false` otherwise.
*/
private bool haveSameThis(FuncDeclaration outerFunc, FuncDeclaration calledFunc)
{
// https://issues.dlang.org/show_bug.cgi?id=24013
// traits(getOverloads) inserts an alias to select the overload.
// When searching for the right this we need to use the aliased
// overload/function, not the alias.
outerFunc = outerFunc.toAliasFunc();
calledFunc = calledFunc.toAliasFunc();
auto thisAd = outerFunc.isMemberLocal();
if (!thisAd)
return false;
auto requiredAd = calledFunc.isMemberLocal();
if (!requiredAd)
return false;
if (thisAd == requiredAd)
return true;
// outerfunc is the member of a base class that contains calledFunc,
// then we consider that they have the same this.
auto cd = requiredAd.isClassDeclaration();
if (!cd)
return false;
if (cd.isBaseOf2(thisAd.isClassDeclaration()))
return true;
// if outerfunc is the member of a nested aggregate, then let
// getRightThis take care of this.
if (thisAd.isNested())
return true;
return false;
}
/***************************************
* Pull out any properties.
*/
private Expression resolvePropertiesX(Scope* sc, Expression e1, Expression e2 = null, BinExp saveAtts = null)
{
//printf("resolvePropertiesX, e1 = %s %s, e2 = %s\n", EXPtoString(e1.op).ptr, e1.toChars(), e2 ? e2.toChars() : null);
Loc loc = e1.loc;
OverloadSet os;
Dsymbol s;
Objects* tiargs;
Type tthis;
if (auto de = e1.isDotExp())
{
if (auto oe = de.e2.isOverExp())
{
tiargs = null;
tthis = de.e1.type;
os = oe.vars;
goto Los;
}
}
else if (e1.isOverExp())
{
tiargs = null;
tthis = null;
os = e1.isOverExp().vars;
Los:
assert(os);
FuncDeclaration fd = null;
if (e2)
{
e2 = e2.expressionSemantic(sc);
if (e2.op == EXP.error)
return ErrorExp.get();
e2 = resolveProperties(sc, e2);
Expressions* a = new Expressions();
a.push(e2);
for (size_t i = 0; i < os.a.length; i++)
{
if (FuncDeclaration f = resolveFuncCall(loc, sc, os.a[i], tiargs, tthis, ArgumentList(a), FuncResolveFlag.quiet))
{
if (f.errors)
return ErrorExp.get();
fd = f;
assert(fd.type.ty == Tfunction);
}
}
if (fd)
{
Expression e = new CallExp(loc, e1, e2);
return e.expressionSemantic(sc);
}
}
{
for (size_t i = 0; i < os.a.length; i++)
{
if (FuncDeclaration f = resolveFuncCall(loc, sc, os.a[i], tiargs, tthis, ArgumentList(), FuncResolveFlag.quiet))
{
if (f.errors)
return ErrorExp.get();
fd = f;
assert(fd.type.ty == Tfunction);
auto tf = fd.type.isTypeFunction();
if (!tf.isref && e2)
{
error(loc, "%s is not an lvalue", e1.toChars());
return ErrorExp.get();
}
}
}
if (fd)
{
Expression e = new CallExp(loc, e1);
if (e2)
{
e = new AssignExp(loc, e, e2);
if (saveAtts)
{
(cast(BinExp)e).att1 = saveAtts.att1;
(cast(BinExp)e).att2 = saveAtts.att2;
}
}
return e.expressionSemantic(sc);
}
}
if (e2)
goto Leprop;
}
else if (auto dti = e1.isDotTemplateInstanceExp())
{
if (!dti.findTempDecl(sc))
goto Leprop;
if (!dti.ti.semanticTiargs(sc))
goto Leprop;
tiargs = dti.ti.tiargs;
tthis = dti.e1.type;
if ((os = dti.ti.tempdecl.isOverloadSet()) !is null)
goto Los;
if ((s = dti.ti.tempdecl) !is null)
goto Lfd;
}
else if (auto dte = e1.isDotTemplateExp())
{
s = dte.td;
tiargs = null;
tthis = dte.e1.type;
goto Lfd;
}
else if (auto se = e1.isScopeExp())
{
s = se.sds;
TemplateInstance ti = s.isTemplateInstance();
if (ti && !ti.semanticRun && ti.tempdecl)
{
//assert(ti.needsTypeInference(sc));
if (!ti.semanticTiargs(sc))
goto Leprop;
tiargs = ti.tiargs;
tthis = null;
if ((os = ti.tempdecl.isOverloadSet()) !is null)
goto Los;
if ((s = ti.tempdecl) !is null)
goto Lfd;
}
}
else if (auto te = e1.isTemplateExp())
{
s = te.td;
tiargs = null;
tthis = null;
goto Lfd;
}
else if (e1.isDotVarExp() && e1.type && (e1.type.toBasetype().isTypeFunction() || e1.isDotVarExp().var.isOverDeclaration()))
{
DotVarExp dve = e1.isDotVarExp();
s = dve.var;
tiargs = null;
tthis = dve.e1.type;
goto Lfd;
}
else if (sc && sc.flags & SCOPE.Cfile && e1.isVarExp() && !e2)
{
// ImportC: do not implicitly call function if no ( ) are present
}
else if (e1.isVarExp() && e1.type && (e1.type.toBasetype().isTypeFunction() || e1.isVarExp().var.isOverDeclaration()))
{
s = e1.isVarExp().var;
tiargs = null;
tthis = null;
Lfd:
assert(s);
if (e2)
{
e2 = e2.expressionSemantic(sc);
if (e2.op == EXP.error)
return ErrorExp.get();
e2 = resolveProperties(sc, e2);
Expressions* a = new Expressions();
a.push(e2);
FuncDeclaration fd = resolveFuncCall(loc, sc, s, tiargs, tthis, ArgumentList(a), FuncResolveFlag.quiet);
if (fd && fd.type)
{
if (fd.errors)
return ErrorExp.get();
assert(fd.type.ty == Tfunction);
Expression e = new CallExp(loc, e1, e2);
return e.expressionSemantic(sc);
}
}
{
FuncDeclaration fd = resolveFuncCall(loc, sc, s, tiargs, tthis, ArgumentList(), FuncResolveFlag.quiet);
if (fd && fd.type)
{
if (fd.errors)
return ErrorExp.get();
TypeFunction tf = fd.type.isTypeFunction();
if (!e2 || tf.isref)
{
Expression e = new CallExp(loc, e1);
if (e2)
{
e = new AssignExp(loc, e, e2);
if (saveAtts)
{
(cast(BinExp)e).att1 = saveAtts.att1;
(cast(BinExp)e).att2 = saveAtts.att2;
}
}
return e.expressionSemantic(sc);
}
}
}
if (FuncDeclaration fd = s.isFuncDeclaration())
{
// Keep better diagnostic message for invalid property usage of functions
assert(fd.type.ty == Tfunction);
Expression e = new CallExp(loc, e1, e2);
return e.expressionSemantic(sc);
}
if (e2)
goto Leprop;
}
if (auto ve = e1.isVarExp())
{
if (auto v = ve.var.isVarDeclaration())
{
if (ve.checkPurity(sc, v))
return ErrorExp.get();
}
}
if (e2)
return null;
if (e1.type && !e1.isTypeExp()) // function type is not a property
{
/* Look for e1 being a lazy parameter; rewrite as delegate call
* only if the symbol wasn't already treated as a delegate
*/
auto ve = e1.isVarExp();
if (ve && ve.var.storage_class & STC.lazy_ && !ve.delegateWasExtracted)
{
Expression e = new CallExp(loc, e1);
return e.expressionSemantic(sc);
}
else if (e1.isDotVarExp())
{
// Check for reading overlapped pointer field in @safe code.
if (checkUnsafeAccess(sc, e1, true, true))
return ErrorExp.get();
}
else if (auto ce = e1.isCallExp())
{
// Check for reading overlapped pointer field in @safe code.
if (checkUnsafeAccess(sc, ce.e1, true, true))
return ErrorExp.get();
}
}
if (!e1.type)
{
error(loc, "cannot resolve type for %s", e1.toChars());
e1 = ErrorExp.get();
}
return e1;
Leprop:
error(loc, "not a property %s", e1.toChars());
return ErrorExp.get();
}
extern (C++) Expression resolveProperties(Scope* sc, Expression e)
{
//printf("resolveProperties(%s)\n", e.toChars());
e = resolvePropertiesX(sc, e);
if (e.checkRightThis(sc))
return ErrorExp.get();
return e;
}
/****************************************
* The common type is determined by applying ?: to each pair.
* Output:
* exps[] properties resolved, implicitly cast to common type, rewritten in place
* Returns:
* The common type, or `null` if an error has occured
*/
private Type arrayExpressionToCommonType(Scope* sc, ref Expressions exps)
{
/* Still have a problem with:
* ubyte[][] = [ cast(ubyte[])"hello", [1]];
* which works if the array literal is initialized top down with the ubyte[][]
* type, but fails with this function doing bottom up typing.
*/
//printf("arrayExpressionToCommonType()\n");
scope IntegerExp integerexp = IntegerExp.literal!0;
scope CondExp condexp = new CondExp(Loc.initial, integerexp, null, null);
Type t0 = null;
Expression e0 = null;
bool foundType;
for (size_t i = 0; i < exps.length; i++)
{
Expression e = exps[i];
if (!e)
continue;
e = resolveProperties(sc, e);
if (!e.type)
{
e.error("`%s` has no value", e.toChars());
t0 = Type.terror;
continue;
}
if (e.op == EXP.type)
{
foundType = true; // do not break immediately, there might be more errors
e.checkValue(); // report an error "type T has no value"
t0 = Type.terror;
continue;
}
if (e.type.ty == Tvoid)
{
// void expressions do not concur to the determination of the common
// type.
continue;
}
if (checkNonAssignmentArrayOp(e))
{
t0 = Type.terror;
continue;
}
e = doCopyOrMove(sc, e);
if (!foundType && t0 && !t0.equals(e.type))
{
/* This applies ?: to merge the types. It's backwards;
* ?: should call this function to merge types.
*/
condexp.type = null;
condexp.e1 = e0;
condexp.e2 = e;
condexp.loc = e.loc;
Expression ex = condexp.expressionSemantic(sc);
if (ex.op == EXP.error)
e = ex;
else
{
// Convert to common type
exps[i] = condexp.e1.castTo(sc, condexp.type);
e = condexp.e2.castTo(sc, condexp.type);
}
}
e0 = e;
t0 = e.type;
if (e.op != EXP.error)
exps[i] = e;
}
// [] is typed as void[]
if (!t0)
return Type.tvoid;
// It's an error, don't do the cast
if (t0.ty == Terror)
return null;
for (size_t i = 0; i < exps.length; i++)
{
Expression e = exps[i];
if (!e)
continue;
e = e.implicitCastTo(sc, t0);
if (e.op == EXP.error)
{
/* https://issues.dlang.org/show_bug.cgi?id=13024
* a workaround for the bug in typeMerge -
* it should paint e1 and e2 by deduced common type,
* but doesn't in this particular case.
*/
return null;
}
exps[i] = e;
}
return t0;
}
private Expression opAssignToOp(const ref Loc loc, EXP op, Expression e1, Expression e2) @safe
{
Expression e;
switch (op)
{
case EXP.addAssign:
e = new AddExp(loc, e1, e2);
break;
case EXP.minAssign:
e = new MinExp(loc, e1, e2);
break;
case EXP.mulAssign:
e = new MulExp(loc, e1, e2);
break;
case EXP.divAssign:
e = new DivExp(loc, e1, e2);
break;
case EXP.modAssign:
e = new ModExp(loc, e1, e2);
break;
case EXP.andAssign:
e = new AndExp(loc, e1, e2);
break;
case EXP.orAssign:
e = new OrExp(loc, e1, e2);
break;
case EXP.xorAssign:
e = new XorExp(loc, e1, e2);
break;
case EXP.leftShiftAssign:
e = new ShlExp(loc, e1, e2);
break;
case EXP.rightShiftAssign:
e = new ShrExp(loc, e1, e2);
break;
case EXP.unsignedRightShiftAssign:
e = new UshrExp(loc, e1, e2);
break;
default:
assert(0);
}
return e;
}
/*********************
* Rewrite:
* array.length op= e2
*/
private Expression rewriteOpAssign(BinExp exp)
{
ArrayLengthExp ale = exp.e1.isArrayLengthExp();
if (ale.e1.isVarExp())
{
// array.length = array.length op e2
Expression e = opAssignToOp(exp.loc, exp.op, ale, exp.e2);
e = new AssignExp(exp.loc, ale.syntaxCopy(), e);
return e;
}
else
{
// (ref tmp = array;), tmp.length = tmp.length op e2
auto tmp = copyToTemp(STC.ref_, "__arraylength", ale.e1);
Expression e1 = new ArrayLengthExp(ale.loc, new VarExp(ale.loc, tmp));
Expression elvalue = e1.syntaxCopy();
Expression e = opAssignToOp(exp.loc, exp.op, e1, exp.e2);
e = new AssignExp(exp.loc, elvalue, e);
e = new CommaExp(exp.loc, new DeclarationExp(ale.loc, tmp), e);
return e;
}
}
/****************************************
* Preprocess arguments to function.
*
* Tuples in argumentList get expanded, properties resolved, rewritten in place
*
* Params:
* sc = scope
* argumentList = arguments to function
* reportErrors = whether or not to report errors here. Some callers are not
* checking actual function params, so they'll do their own error reporting
* Returns:
* `true` when a semantic error occurred
*/
private bool preFunctionParameters(Scope* sc, ArgumentList argumentList, const bool reportErrors = true)
{
Expressions* exps = argumentList.arguments;
bool err = false;
if (exps)
{
expandTuples(exps, argumentList.names);
for (size_t i = 0; i < exps.length; i++)
{
Expression arg = (*exps)[i];
arg = resolveProperties(sc, arg);
arg = arg.arrayFuncConv(sc);
if (arg.op == EXP.type)
{
// for static alias this: https://issues.dlang.org/show_bug.cgi?id=17684
arg = resolveAliasThis(sc, arg);
if (arg.op == EXP.type)
{
if (reportErrors)
{
arg.error("cannot pass type `%s` as a function argument", arg.toChars());
arg = ErrorExp.get();
}
err = true;
}
}
else if (arg.type.toBasetype().ty == Tfunction)
{
if (reportErrors)
{
arg.error("cannot pass function `%s` as a function argument", arg.toChars());
arg = ErrorExp.get();
}
err = true;
}
else if (checkNonAssignmentArrayOp(arg))
{
arg = ErrorExp.get();
err = true;
}
(*exps)[i] = arg;
}
}
return err;
}
/********************************************
* Issue an error if default construction is disabled for type t.
* Default construction is required for arrays and 'out' parameters.
* Returns:
* true an error was issued
*/
private bool checkDefCtor(Loc loc, Type t)
{
if (auto ts = t.baseElemOf().isTypeStruct())
{
StructDeclaration sd = ts.sym;
if (sd.noDefaultCtor)
{
sd.error(loc, "default construction is disabled");
return true;
}
}
return false;
}
/****************************************
* Now that we know the exact type of the function we're calling,
* the arguments[] need to be adjusted:
* 1. implicitly convert argument to the corresponding parameter type
* 2. add default arguments for any missing arguments
* 3. do default promotions on arguments corresponding to ...
* 4. add hidden _arguments[] argument
* 5. call copy constructor for struct value arguments
* Params:
* loc = location of function call
* sc = context
* tf = type of the function
* ethis = `this` argument, `null` if none or not known
* tthis = type of `this` argument, `null` if no `this` argument
* argumentsList = array of actual arguments to function call
* fd = the function being called, `null` if called indirectly
* prettype = set to return type of function
* peprefix = set to expression to execute before `arguments[]` are evaluated, `null` if none
* Returns:
* true errors happened
*/
private bool functionParameters(const ref Loc loc, Scope* sc,
TypeFunction tf, Expression ethis, Type tthis, ArgumentList argumentList, FuncDeclaration fd,
Type* prettype, Expression* peprefix)
{
Expressions* arguments = argumentList.arguments;
//printf("functionParameters() %s\n", fd ? fd.toChars() : "");
assert(arguments);
assert(fd || tf.next);
const size_t nparams = tf.parameterList.length;
const olderrors = global.errors;
bool err = false;
Expression eprefix = null;
*peprefix = null;
if (argumentList.names)
{
const(char)* msg = null;
auto resolvedArgs = tf.resolveNamedArgs(argumentList, &msg);
if (!resolvedArgs)
{
// while errors are usually already caught by `tf.callMatch`,
// this can happen when calling `typeof(freefunc)`
if (msg)
error(loc, "%s", msg);
return true;
}
// note: the argument list should be mutated with named arguments / default arguments,
// so we can't simply change the pointer like `arguments = resolvedArgs;`
arguments.setDim(0);
arguments.pushSlice((*resolvedArgs)[]);
}
size_t nargs = arguments ? arguments.length : 0;
if (nargs > nparams && tf.parameterList.varargs == VarArg.none)
{
error(loc, "expected %llu arguments, not %llu for non-variadic function type `%s`", cast(ulong)nparams, cast(ulong)nargs, tf.toChars());
return true;
}
// If inferring return type, and semantic3() needs to be run if not already run
if (!tf.next && fd.inferRetType)
{
fd.functionSemantic();
}
else if (fd && fd.parent)
{
TemplateInstance ti = fd.parent.isTemplateInstance();
if (ti && ti.tempdecl)
{
fd.functionSemantic3();
}
}
/* If calling a pragma(inline, true) function,
* set flag to later scan for inlines.
*/
if (fd && fd.inlining == PINLINE.always)
{
if (sc._module)
sc._module.hasAlwaysInlines = true;
if (sc.func)
sc.func.hasAlwaysInlines = true;
}
const isCtorCall = fd && fd.needThis() && fd.isCtorDeclaration();
const size_t n = (nargs > nparams) ? nargs : nparams; // n = max(nargs, nparams)
/* If the function return type has wildcards in it, we'll need to figure out the actual type
* based on the actual argument types.
* Start with the `this` argument, later on merge into wildmatch the mod bits of the rest
* of the arguments.
*/
MOD wildmatch = (tthis && !isCtorCall) ? tthis.Type.deduceWild(tf, false) : 0;
bool done = false;
foreach (const i; 0 .. n)
{
Expression arg = (i < nargs) ? (*arguments)[i] : null;
if (i < nparams)
{
bool errorArgs()
{
error(loc, "expected %llu function arguments, not %llu", cast(ulong)nparams, cast(ulong)nargs);
return true;
}
Parameter p = tf.parameterList[i];
if (!arg)
{
if (!p.defaultArg)
{
if (tf.parameterList.varargs == VarArg.typesafe && i + 1 == nparams)
goto L2;
return errorArgs();
}
arg = p.defaultArg;
if (!arg.type)
arg = arg.expressionSemantic(sc);
arg = inlineCopy(arg, sc);
// __FILE__, __LINE__, __MODULE__, __FUNCTION__, and __PRETTY_FUNCTION__
arg = arg.resolveLoc(loc, sc);
if (i >= nargs)
{
arguments.push(arg);
nargs++;
}
else
(*arguments)[i] = arg;
}
else
{
if (isDefaultInitOp(arg.op))
{
arg = arg.resolveLoc(loc, sc);
(*arguments)[i] = arg;
}
}
if (tf.parameterList.varargs == VarArg.typesafe && i + 1 == nparams) // https://dlang.org/spec/function.html#variadic
{
//printf("\t\tvarargs == 2, p.type = '%s'\n", p.type.toChars());
{
MATCH m;
if ((m = arg.implicitConvTo(p.type)) > MATCH.nomatch)
{
if (p.type.nextOf() && arg.implicitConvTo(p.type.nextOf()) >= m)
goto L2;
else if (nargs != nparams)
return errorArgs();
goto L1;
}
}
L2:
Type tb = p.type.toBasetype();
switch (tb.ty)
{
case Tsarray:
case Tarray:
{
/* Create a static array variable v of type arg.type:
* T[dim] __arrayArg = [ arguments[i], ..., arguments[nargs-1] ];
*
* The array literal in the initializer of the hidden variable
* is now optimized.
* https://issues.dlang.org/show_bug.cgi?id=2356
*/
Type tbn = (cast(TypeArray)tb).next; // array element type
Type tret = p.isLazyArray();
auto elements = new Expressions(nargs - i);
foreach (u; 0 .. elements.length)
{
Expression a = (*arguments)[i + u];
if (tret && a.implicitConvTo(tret))
{
// p is a lazy array of delegates, tret is return type of the delegates
a = a.implicitCastTo(sc, tret)
.optimize(WANTvalue)
.toDelegate(tret, sc);
}
else
a = a.implicitCastTo(sc, tbn);
a = a.addDtorHook(sc);
(*elements)[u] = a;
}
// https://issues.dlang.org/show_bug.cgi?id=14395
// Convert to a static array literal, or its slice.
arg = new ArrayLiteralExp(loc, tbn.sarrayOf(nargs - i), elements);
if (tb.ty == Tarray)
{
arg = new SliceExp(loc, arg, null, null);
arg.type = p.type;
}
break;
}
case Tclass:
{
/* Set arg to be:
* new Tclass(arg0, arg1, ..., argn)
*/
auto args = new Expressions(nargs - i);
foreach (u; i .. nargs)
(*args)[u - i] = (*arguments)[u];
arg = new NewExp(loc, null, p.type, args);
break;
}
default:
if (!arg)
{
error(loc, "not enough arguments");
return true;
}
break;
}
arg = arg.expressionSemantic(sc);
//printf("\targ = '%s'\n", arg.toChars());
arguments.setDim(i + 1);
(*arguments)[i] = arg;
nargs = i + 1;
done = true;
}
L1:
if (!(p.isLazy() && p.type.ty == Tvoid))
{
if (ubyte wm = arg.type.deduceWild(p.type, p.isReference()))
{
wildmatch = wildmatch ? MODmerge(wildmatch, wm) : wm;
//printf("[%d] p = %s, a = %s, wm = %d, wildmatch = %d\n", i, p.type.toChars(), arg.type.toChars(), wm, wildmatch);
}
}
}
if (done)
break;
}
if ((wildmatch == MODFlags.mutable || wildmatch == MODFlags.immutable_) &&
tf.next && tf.next.hasWild() &&
(tf.isref || !tf.next.implicitConvTo(tf.next.immutableOf())))
{
bool errorInout(MOD wildmatch)
{
const(char)* s = wildmatch == MODFlags.mutable ? "mutable" : MODtoChars(wildmatch);
error(loc, "modify `inout` to `%s` is not allowed inside `inout` function", s);
return true;
}
if (fd)
{
/* If the called function may return the reference to
* outer inout data, it should be rejected.
*
* void foo(ref inout(int) x) {
* ref inout(int) bar(inout(int)) { return x; }
* struct S {
* ref inout(int) bar() inout { return x; }
* ref inout(int) baz(alias a)() inout { return x; }
* }
* bar(int.init) = 1; // bad!
* S().bar() = 1; // bad!
* }
* void test() {
* int a;
* auto s = foo(a);
* s.baz!a() = 1; // bad!
* }
*
*/
bool checkEnclosingWild(Dsymbol s)
{
bool checkWild(Dsymbol s)
{
if (!s)
return false;
if (auto ad = s.isAggregateDeclaration())
{
if (ad.isNested())
return checkEnclosingWild(s);
}
else if (auto ff = s.isFuncDeclaration())
{
if (ff.type.isTypeFunction().iswild)
return errorInout(wildmatch);
if (ff.isNested() || ff.isThis())
return checkEnclosingWild(s);
}
return false;
}
Dsymbol ctx0 = s.toParent2();
Dsymbol ctx1 = s.toParentLocal();
if (checkWild(ctx0))
return true;
if (ctx0 != ctx1)
return checkWild(ctx1);
return false;
}
if ((fd.isThis() || fd.isNested()) && checkEnclosingWild(fd))
return true;
}
else if (tf.isWild())
return errorInout(wildmatch);
}
Expression firstArg = null;
final switch (returnParamDest(tf, tthis))
{
case ReturnParamDest.returnVal:
break;
case ReturnParamDest.firstArg:
firstArg = nargs > 0 ? (*arguments)[0] : null;
break;
case ReturnParamDest.this_:
firstArg = ethis;
break;
}
assert(nargs >= nparams);
foreach (const i, arg; (*arguments)[0 .. nargs])
{
assert(arg);
if (i < nparams)
{
Parameter p = tf.parameterList[i];
Type targ = arg.type; // keep original type for isCopyable() because alias this
// resolution may hide an uncopyable type
if (!(p.isLazy() && p.type.ty == Tvoid))
{
Type tprm = p.type.hasWild()
? p.type.substWildTo(wildmatch)
: p.type;
const hasCopyCtor = arg.type.isTypeStruct() && arg.type.isTypeStruct().sym.hasCopyCtor;
const typesMatch = arg.type.mutableOf().unSharedOf().equals(tprm.mutableOf().unSharedOf());
if (!((hasCopyCtor && typesMatch) || tprm.equals(arg.type)))
{
//printf("arg.type = %s, p.type = %s\n", arg.type.toChars(), p.type.toChars());
arg = arg.implicitCastTo(sc, tprm);
arg = arg.optimize(WANTvalue, p.isReference());
}
}
// Support passing rvalue to `in` parameters
if ((p.storageClass & (STC.in_ | STC.ref_)) == (STC.in_ | STC.ref_))
{
if (!arg.isLvalue())
{
auto v = copyToTemp(STC.exptemp, "__rvalue", arg);
Expression ev = new DeclarationExp(arg.loc, v);
ev = new CommaExp(arg.loc, ev, new VarExp(arg.loc, v));
arg = ev.expressionSemantic(sc);
}
arg = arg.toLvalue(sc, arg);
// Look for mutable misaligned pointer, etc., in @safe mode
err |= checkUnsafeAccess(sc, arg, false, true);
}
else if (p.storageClass & STC.ref_)
{
if (global.params.rvalueRefParam == FeatureState.enabled &&
!arg.isLvalue() &&
targ.isCopyable())
{ /* allow rvalues to be passed to ref parameters by copying
* them to a temp, then pass the temp as the argument
*/
auto v = copyToTemp(0, "__rvalue", arg);
Expression ev = new DeclarationExp(arg.loc, v);
ev = new CommaExp(arg.loc, ev, new VarExp(arg.loc, v));
arg = ev.expressionSemantic(sc);
}
arg = arg.toLvalue(sc, arg);
// Look for mutable misaligned pointer, etc., in @safe mode
err |= checkUnsafeAccess(sc, arg, false, true);
}
else if (p.storageClass & STC.out_)
{
Type t = arg.type;
if (!t.isMutable() || !t.isAssignable()) // check blit assignable
{
arg.error("cannot modify struct `%s` with immutable members", arg.toChars());
err = true;
}
else
{
// Look for misaligned pointer, etc., in @safe mode
err |= checkUnsafeAccess(sc, arg, false, true);
err |= checkDefCtor(arg.loc, t); // t must be default constructible
}
arg = arg.toLvalue(sc, arg);
}
else if (p.isLazy())
{
// Convert lazy argument to a delegate
auto t = (p.type.ty == Tvoid) ? p.type : arg.type;
arg = toDelegate(arg, t, sc);
}
//printf("arg: %s\n", arg.toChars());
//printf("type: %s\n", arg.type.toChars());
//printf("param: %s\n", p.toChars());
const pStc = tf.parameterStorageClass(tthis, p);
if (firstArg && (pStc & STC.return_))
{
/* Argument value can be assigned to firstArg.
* Check arg to see if it matters.
*/
err |= checkParamArgumentReturn(sc, firstArg, arg, p, false);
}
// Allow 'lazy' to imply 'scope' - lazy parameters can be passed along
// as lazy parameters to the next function, but that isn't escaping.
// The arguments of `_d_arraycatnTX` are already handled in
// expressionsem.d, via `checkNewEscape`. Without `-dip1000`, the
// check does not return an error, so the lowering of `a ~ b` to
// `_d_arraycatnTX(a, b)` still occurs.
else if (!(pStc & STC.lazy_) && (!fd || fd.ident != Id._d_arraycatnTX))
{
/* Argument value can escape from the called function.
* Check arg to see if it matters.
*/
VarDeclaration vPar = fd ? (fd.parameters ? (*fd.parameters)[i] : null) : null;
err |= checkParamArgumentEscape(sc, fd, p.ident, vPar, cast(STC) pStc, arg, false, false);
}
// Turning heap allocations into stack allocations is dangerous without dip1000, since `scope` inference
// may be unreliable when scope violations only manifest as deprecation warnings.
// However, existing `@nogc` code may rely on it, so still do it when the parameter is explicitly marked `scope`
const explicitScope = p.isLazy() ||
((p.storageClass & STC.scope_) && !(p.storageClass & STC.scopeinferred));
if ((pStc & (STC.scope_ | STC.lazy_)) &&
((global.params.useDIP1000 == FeatureState.enabled) || explicitScope) &&
!(pStc & STC.return_))
{
/* Argument value cannot escape from the called function.
*/
Expression a = arg;
if (auto ce = a.isCastExp())
a = ce.e1;
ArrayLiteralExp ale;
if (p.type.toBasetype().ty == Tarray &&
(ale = a.isArrayLiteralExp()) !is null && ale.elements && ale.elements.length > 0)
{
// allocate the array literal as temporary static array on the stack
ale.type = ale.type.nextOf().sarrayOf(ale.elements.length);
auto tmp = copyToTemp(0, "__arrayliteral_on_stack", ale);
tmp.storage_class |= STC.exptemp;
auto declareTmp = new DeclarationExp(ale.loc, tmp);
auto castToSlice = new CastExp(ale.loc, new VarExp(ale.loc, tmp),
p.type.substWildTo(MODFlags.mutable));
arg = CommaExp.combine(declareTmp, castToSlice);
arg = arg.expressionSemantic(sc);
}
else if (auto fe = a.isFuncExp())
{
/* Function literals can only appear once, so if this
* appearance was scoped, there cannot be any others.
*/
fe.fd.tookAddressOf = 0;
}
else if (auto de = a.isDelegateExp())
{
/* For passing a delegate to a scoped parameter,
* this doesn't count as taking the address of it.
* We only worry about 'escaping' references to the function.
*/
if (auto ve = de.e1.isVarExp())
{
if (auto f = ve.var.isFuncDeclaration())
{
if (f.tookAddressOf)
--f.tookAddressOf;
//printf("--tookAddressOf = %d\n", f.tookAddressOf);
}
}
}
}
if (!p.isReference())
err |= arg.checkSharedAccess(sc);
arg = arg.optimize(WANTvalue, p.isReference());
}
else
{
// These will be the trailing ... arguments
// If not D linkage, do promotions
if (tf.linkage != LINK.d)
{
// Promote bytes, words, etc., to ints
arg = integralPromotions(arg, sc);
// Promote floats to doubles
switch (arg.type.ty)
{
case Tfloat32:
arg = arg.castTo(sc, Type.tfloat64);
break;
case Timaginary32:
arg = arg.castTo(sc, Type.timaginary64);
break;
default:
break;
}
if (tf.parameterList.varargs == VarArg.variadic ||
tf.parameterList.varargs == VarArg.KRvariadic)
{
const(char)* p = tf.linkage == LINK.c ? "extern(C)" : "extern(C++)";
if (arg.type.ty == Tarray)
{
arg.error("cannot pass dynamic arrays to `%s` vararg functions", p);
err = true;
}
if (arg.type.ty == Tsarray)
{
arg.error("cannot pass static arrays to `%s` vararg functions", p);
err = true;
}
}
}
// Do not allow types that need destructors or copy constructors.
if (arg.type.needsDestruction())
{
arg.error("cannot pass types that need destruction as variadic arguments");
err = true;
}
if (arg.type.needsCopyOrPostblit())
{
arg.error("cannot pass types with postblits or copy constructors as variadic arguments");
err = true;
}
// Convert static arrays to dynamic arrays
// BUG: I don't think this is right for D2
Type tb = arg.type.toBasetype();
if (auto ts = tb.isTypeSArray())
{
Type ta = ts.next.arrayOf();
if (ts.size(arg.loc) == 0)
arg = new NullExp(arg.loc, ta);
else
arg = arg.castTo(sc, ta);
}
if (tb.ty == Tstruct)
{
//arg = callCpCtor(sc, arg);
}
// Give error for overloaded function addresses
if (auto se = arg.isSymOffExp())
{
if (se.hasOverloads && !se.var.isFuncDeclaration().isUnique())
{
arg.error("function `%s` is overloaded", arg.toChars());
err = true;
}
}
err |= arg.checkValue();
err |= arg.checkSharedAccess(sc);
arg = arg.optimize(WANTvalue);
}
(*arguments)[i] = arg;
}
/* If calling C scanf(), printf(), or any variants, check the format string against the arguments
*/
const isVa_list = tf.parameterList.varargs == VarArg.none;
if (fd && fd.printf)
{
if (auto se = (*arguments)[nparams - 1 - isVa_list].isStringExp())
{
checkPrintfFormat(se.loc, se.peekString(), (*arguments)[nparams .. nargs], isVa_list);
}
}
else if (fd && fd.scanf)
{
if (auto se = (*arguments)[nparams - 1 - isVa_list].isStringExp())
{
checkScanfFormat(se.loc, se.peekString(), (*arguments)[nparams .. nargs], isVa_list);
}
}
else
{
// TODO: not checking the "v" functions yet (for those, check format string only, not args)
}
/* Remaining problems:
* 1. value structs (or static arrays of them) that need to be copy constructed
* 2. value structs (or static arrays of them) that have destructors, and subsequent arguments that may throw before the
* function gets called.
* 3. value structs need to be destructed after the function call for platforms where the caller destroys the arguments.
* Those are handled by doing the argument construction in 'eprefix' so that if a later argument throws, they are cleaned
* up properly. Pushing arguments on the stack then cannot fail.
*/
{
/* Does Problem (3) apply?
*/
const bool callerDestroysArgs = !target.isCalleeDestroyingArgs(tf);
/* Compute indices of last throwing argument and first arg needing destruction.
* Used to not set up destructors unless an arg needs destruction on a throw
* in a later argument.
*/
ptrdiff_t lastthrow = -1; // last argument that may throw
ptrdiff_t firstdtor = -1; // first argument that needs destruction
ptrdiff_t lastdtor = -1; // last argument that needs destruction
for (ptrdiff_t i = 0; i != nargs; i++)
{
Expression arg = (*arguments)[i];
if (canThrow(arg, sc.func, false))
lastthrow = i;
if (arg.type.needsDestruction())
{
Parameter p = (i >= nparams ? null : tf.parameterList[i]);
if (!(p && (p.isLazy() || p.isReference())))
{
if (firstdtor == -1)
firstdtor = i;
lastdtor = i;
}
}
}
/* Do we need 'eprefix' for problems 2 or 3?
*/
const bool needsPrefix = callerDestroysArgs
? firstdtor >= 0 // true if any argument needs destruction
: firstdtor >= 0 && lastthrow >= 0 &&
(lastthrow - firstdtor) > 0; // last throw after first destruction
const ptrdiff_t lastPrefix = callerDestroysArgs
? lastdtor // up to last argument requiring destruction
: lastthrow; // up to last potentially throwing argument
/* Problem 3: initialize 'eprefix' by declaring the gate
*/
VarDeclaration gate;
if (needsPrefix && !callerDestroysArgs)
{
// eprefix => bool __gate [= false]
Identifier idtmp = Identifier.generateId("__gate");
gate = new VarDeclaration(loc, Type.tbool, idtmp, null);
gate.storage_class |= STC.temp | STC.ctfe | STC.volatile_;
gate.dsymbolSemantic(sc);
auto ae = new DeclarationExp(loc, gate);
eprefix = ae.expressionSemantic(sc);
}
for (ptrdiff_t i = 0; i != nargs; i++)
{
Expression arg = (*arguments)[i];
//printf("arg[%d]: %s\n", cast(int)i, arg.toChars());
Parameter parameter = (i >= nparams ? null : tf.parameterList[i]);
const bool isRef = parameter && parameter.isReference();
const bool isLazy = parameter && parameter.isLazy();
/* Skip lazy parameters
*/
if (isLazy)
continue;
/* Do we have 'eprefix' and aren't past 'lastPrefix' yet?
* Then declare a temporary variable for this arg and append that declaration
* to 'eprefix', which will implicitly take care of potential problem 1) for
* this arg.
* 'eprefix' will therefore finally contain all args up to and including 'lastPrefix',
* excluding all lazy parameters.
*/
if (needsPrefix && (lastPrefix - i) >= 0)
{
const bool needsDtor = !isRef && arg.type.needsDestruction() &&
// Problem 3: last throwing arg doesn't require dtor patching
(callerDestroysArgs || i != lastPrefix);
/* Declare temporary 'auto __pfx = arg' (needsDtor) or 'auto __pfy = arg' (!needsDtor)
*/
auto tmp = copyToTemp(
(parameter ? parameter.storageClass : tf.parameterList.stc) & (STC.scope_),
needsDtor ? "__pfx" : "__pfy",
!isRef ? arg : arg.addressOf());
tmp.dsymbolSemantic(sc);
if (callerDestroysArgs)
{
/* Problem 4: Normal temporary, destructed after the call
*/
if (needsDtor)
tmp.isArgDtorVar = true; // mark it so that the backend passes it by ref to the function being called
}
else
{
/* Problem 2: Modify the destructor so it only runs if gate==false,
* i.e., only if there was a throw while constructing the args
*/
if (!needsDtor)
{
if (tmp.edtor)
{
assert(i == lastPrefix);
tmp.edtor = null;
}
}
else
{
// edtor => (__gate || edtor)
assert(tmp.edtor);
Expression e = tmp.edtor;
e = new LogicalExp(e.loc, EXP.orOr, new VarExp(e.loc, gate), e);
tmp.edtor = e.expressionSemantic(sc);
//printf("edtor: %s\n", tmp.edtor.toChars());
}
}
// eprefix => (eprefix, auto __pfx/y = arg)
auto ae = new DeclarationExp(loc, tmp);
eprefix = Expression.combine(eprefix, ae.expressionSemantic(sc));
// arg => __pfx/y
arg = new VarExp(loc, tmp);
arg = arg.expressionSemantic(sc);
if (isRef)
{
arg = new PtrExp(loc, arg);
arg = arg.expressionSemantic(sc);
}
/* Problem 2: Last throwing arg?
* Then finalize eprefix => (eprefix, gate = true), i.e., disable the
* dtors right after constructing the last throwing arg.
* From now on, the callee will take care of destructing the args because
* the args are implicitly moved into function parameters.
*/
if (!callerDestroysArgs && i == lastPrefix)
{
auto e = new AssignExp(gate.loc, new VarExp(gate.loc, gate), IntegerExp.createBool(true));
eprefix = Expression.combine(eprefix, e.expressionSemantic(sc));
}
}
else // not part of 'eprefix'
{
/* Handle problem 1) by calling the copy constructor for value structs
* (or static arrays of them) if appropriate.
*/
Type tv = arg.type.baseElemOf();
if (!isRef && tv.ty == Tstruct)
arg = doCopyOrMove(sc, arg, parameter ? parameter.type : null);
}
(*arguments)[i] = arg;
}
}
//if (eprefix) printf("eprefix: %s\n", eprefix.toChars());
/* Test compliance with DIP1021 Argument Ownership and Function Calls
*/
if (global.params.useDIP1021 && (tf.trust == TRUST.safe || tf.trust == TRUST.default_) ||
tf.islive)
err |= checkMutableArguments(sc, fd, tf, ethis, arguments, false);
// If D linkage and variadic, add _arguments[] as first argument
if (tf.isDstyleVariadic())
{
assert(arguments.length >= nparams);
auto args = new Parameters(arguments.length - nparams);
for (size_t i = 0; i < arguments.length - nparams; i++)
{
Expression earg = (*arguments)[nparams + i];
auto arg = new Parameter(earg.loc, STC.in_, earg.type, null, null, null);
(*args)[i] = arg;
}
auto tup = new TypeTuple(args);
Expression e = (new TypeidExp(loc, tup)).expressionSemantic(sc);
arguments.insert(0, e);
}
/* Determine function return type: tret
*/
Type tret = tf.next;
if (isCtorCall)
{
//printf("[%s] fd = %s %s, %d %d %d\n", loc.toChars(), fd.toChars(), fd.type.toChars(),
// wildmatch, tf.isWild(), fd.isReturnIsolated());
if (!tthis)
{
assert(sc.intypeof || global.errors);
tthis = fd.isThis().type.addMod(fd.type.mod);
}
if (tf.isWild() && !fd.isReturnIsolated())
{
if (wildmatch)
tret = tret.substWildTo(wildmatch);
int offset;
if (!tret.implicitConvTo(tthis) && !(MODimplicitConv(tret.mod, tthis.mod) && tret.isBaseOf(tthis, &offset) && offset == 0))
{
const(char)* s1 = tret.isNaked() ? " mutable" : tret.modToChars();
const(char)* s2 = tthis.isNaked() ? " mutable" : tthis.modToChars();
.error(loc, "`inout` constructor `%s` creates%s object, not%s", fd.toPrettyChars(), s1, s2);
err = true;
}
}
tret = tthis;
}
else if (wildmatch && tret)
{
/* Adjust function return type based on wildmatch
*/
//printf("wildmatch = x%x, tret = %s\n", wildmatch, tret.toChars());
tret = tret.substWildTo(wildmatch);
}
*prettype = tret;
*peprefix = eprefix;
return (err || olderrors != global.errors);
}
/**
* Determines whether a symbol represents a module or package
* (Used as a helper for is(type == module) and is(type == package))
*
* Params:
* sym = the symbol to be checked
*
* Returns:
* the symbol which `sym` represents (or `null` if it doesn't represent a `Package`)
*/
Package resolveIsPackage(Dsymbol sym)
{
Package pkg;
if (Import imp = sym.isImport())
{
if (imp.pkg is null)
{
.error(sym.loc, "internal compiler error: unable to process forward-referenced import `%s`",
imp.toChars());
assert(0);
}
pkg = imp.pkg;
}
else if (auto mod = sym.isModule())
pkg = mod.isPackageFile ? mod.pkg : sym.isPackage();
else
pkg = sym.isPackage();
if (pkg)
pkg.resolvePKGunknown();
return pkg;
}
private extern (C++) final class ExpressionSemanticVisitor : Visitor
{
alias visit = Visitor.visit;
Scope* sc;
Expression result;
this(Scope* sc) scope @safe
{
this.sc = sc;
}
private void setError()
{
result = ErrorExp.get();
}
private void needThisError(Loc loc, FuncDeclaration f)
{
auto t = f.isThis();
assert(t);
.error(loc, "calling non-static function `%s` requires an instance of type `%s`", f.toChars(), t.toChars());
setError();
}
/**************************
* Semantically analyze Expression.
* Determine types, fold constants, etc.
*/
override void visit(Expression e)
{
static if (LOGSEMANTIC)
{
printf("Expression::semantic() %s\n", e.toChars());
}
if (e.type)
e.type = e.type.typeSemantic(e.loc, sc);
else
e.type = Type.tvoid;
result = e;
}
override void visit(IntegerExp e)
{
assert(e.type);
if (e.type.ty == Terror)
return setError();
assert(e.type.deco);
e.setInteger(e.getInteger());
result = e;
}
override void visit(RealExp e)
{
if (!e.type)
e.type = Type.tfloat64;
else if (e.type.isimaginary && sc.flags & SCOPE.Cfile)
{
/* Convert to core.stdc.config.complex
*/
Type t = getComplexLibraryType(e.loc, sc, e.type.ty);
if (t.ty == Terror)
return setError();
Type tf;
switch (e.type.ty)
{
case Timaginary32: tf = Type.tfloat32; break;
case Timaginary64: tf = Type.tfloat64; break;
case Timaginary80: tf = Type.tfloat80; break;
default:
assert(0);
}
/* Construct ts{re : 0.0, im : e}
*/
TypeStruct ts = t.isTypeStruct;
Expressions* elements = new Expressions(2);
(*elements)[0] = new RealExp(e.loc, CTFloat.zero, tf);
(*elements)[1] = new RealExp(e.loc, e.toImaginary(), tf);
Expression sle = new StructLiteralExp(e.loc, ts.sym, elements);
result = sle.expressionSemantic(sc);
return;
}
else
e.type = e.type.typeSemantic(e.loc, sc);
result = e;
}
override void visit(ComplexExp e)
{
if (!e.type)
e.type = Type.tcomplex80;
else
e.type = e.type.typeSemantic(e.loc, sc);
result = e;
}
override void visit(IdentifierExp exp)
{
static if (LOGSEMANTIC)
{
printf("IdentifierExp::semantic('%s')\n", exp.ident.toChars());
}
if (exp.type) // This is used as the dummy expression
{
result = exp;
return;
}
Dsymbol scopesym;
Dsymbol s = sc.search(exp.loc, exp.ident, &scopesym);
if (s)
{
if (s.errors)
return setError();
Expression e;
/* See if the symbol was a member of an enclosing 'with'
*/
WithScopeSymbol withsym = scopesym.isWithScopeSymbol();
if (withsym && withsym.withstate.wthis && symbolIsVisible(sc, s))
{
/* Disallow shadowing
*/
// First find the scope of the with
Scope* scwith = sc;
while (scwith.scopesym != scopesym)
{
scwith = scwith.enclosing;
assert(scwith);
}
// Look at enclosing scopes for symbols with the same name,
// in the same function
for (Scope* scx = scwith; scx && scx.func == scwith.func; scx = scx.enclosing)
{
Dsymbol s2;
if (scx.scopesym && scx.scopesym.symtab && (s2 = scx.scopesym.symtab.lookup(s.ident)) !is null && s != s2)
{
exp.error("with symbol `%s` is shadowing local symbol `%s`", s.toPrettyChars(), s2.toPrettyChars());
return setError();
}
}
s = s.toAlias();
// Same as wthis.ident
// TODO: DotIdExp.semantic will find 'ident' from 'wthis' again.
// The redudancy should be removed.
e = new VarExp(exp.loc, withsym.withstate.wthis);
e = new DotIdExp(exp.loc, e, exp.ident);
e = e.expressionSemantic(sc);
}
else
{
if (withsym)
{
if (withsym.withstate.exp.type.ty != Tvoid)
{
// 'with (exp)' is a type expression
// or 's' is not visible there (for error message)
e = new TypeExp(exp.loc, withsym.withstate.exp.type);
}
else
{
// 'with (exp)' is a Package/Module
e = withsym.withstate.exp;
}
e = new DotIdExp(exp.loc, e, exp.ident);
result = e.expressionSemantic(sc);
return;
}
/* If f is really a function template,
* then replace f with the function template declaration.
*/
FuncDeclaration f = s.isFuncDeclaration();
if (f)
{
TemplateDeclaration td = getFuncTemplateDecl(f);
if (td)
{
if (td.overroot) // if not start of overloaded list of TemplateDeclaration's
td = td.overroot; // then get the start
e = new TemplateExp(exp.loc, td, f);
e = e.expressionSemantic(sc);
result = e;
return;
}
}
if (global.params.fixAliasThis)
{
ExpressionDsymbol expDsym = scopesym.isExpressionDsymbol();
if (expDsym)
{
//printf("expDsym = %s\n", expDsym.exp.toChars());
result = expDsym.exp.expressionSemantic(sc);
return;
}
}
// Haven't done overload resolution yet, so pass 1
e = symbolToExp(s, exp.loc, sc, true);
}
result = e;
return;
}
if (!global.params.fixAliasThis && hasThis(sc))
{
for (AggregateDeclaration ad = sc.getStructClassScope(); ad;)
{
if (ad.aliasthis)
{
Expression e;
e = new ThisExp(exp.loc);
e = new DotIdExp(exp.loc, e, ad.aliasthis.ident);
e = new DotIdExp(exp.loc, e, exp.ident);
e = e.trySemantic(sc);
if (e)
{
result = e;
return;
}
}
auto cd = ad.isClassDeclaration();
if (cd && cd.baseClass && cd.baseClass != ClassDeclaration.object)
{
ad = cd.baseClass;
continue;
}
break;
}
}
if (exp.ident == Id.ctfe)
{
if (sc.flags & SCOPE.ctfe)
{
exp.error("variable `__ctfe` cannot be read at compile time");
return setError();
}
// Create the magic __ctfe bool variable
auto vd = new VarDeclaration(exp.loc, Type.tbool, Id.ctfe, null);
vd.storage_class |= STC.temp;
vd.semanticRun = PASS.semanticdone;
Expression e = new VarExp(exp.loc, vd);
e = e.expressionSemantic(sc);
result = e;
return;
}
// If we've reached this point and are inside a with() scope then we may
// try one last attempt by checking whether the 'wthis' object supports
// dynamic dispatching via opDispatch.
// This is done by rewriting this expression as wthis.ident.
// The innermost with() scope of the hierarchy to satisfy the condition
// above wins.
// https://issues.dlang.org/show_bug.cgi?id=6400
for (Scope* sc2 = sc; sc2; sc2 = sc2.enclosing)
{
if (!sc2.scopesym)
continue;
if (auto ss = sc2.scopesym.isWithScopeSymbol())
{
if (ss.withstate.wthis)
{
Expression e;
e = new VarExp(exp.loc, ss.withstate.wthis);
e = new DotIdExp(exp.loc, e, exp.ident);
e = e.trySemantic(sc);
if (e)
{
result = e;
return;
}
}
// Try Type.opDispatch (so the static version)
else if (ss.withstate.exp && ss.withstate.exp.op == EXP.type)
{
if (Type t = ss.withstate.exp.isTypeExp().type)
{
Expression e;
e = new TypeExp(exp.loc, t);
e = new DotIdExp(exp.loc, e, exp.ident);
e = e.trySemantic(sc);
if (e)
{
result = e;
return;
}
}
}
}
}
/* Look for what user might have meant
*/
if (const n = importHint(exp.ident.toString()))
exp.error("`%s` is not defined, perhaps `import %.*s;` is needed?", exp.ident.toChars(), cast(int)n.length, n.ptr);
else if (auto s2 = sc.search_correct(exp.ident))
exp.error("undefined identifier `%s`, did you mean %s `%s`?", exp.ident.toChars(), s2.kind(), s2.toChars());
else if (const p = Scope.search_correct_C(exp.ident))
exp.error("undefined identifier `%s`, did you mean `%s`?", exp.ident.toChars(), p);
else if (exp.ident == Id.dollar)
exp.error("undefined identifier `$`");
else
exp.error("undefined identifier `%s`", exp.ident.toChars());
result = ErrorExp.get();
}
override void visit(DsymbolExp e)
{
result = symbolToExp(e.s, e.loc, sc, e.hasOverloads);
}
override void visit(ThisExp e)
{
static if (LOGSEMANTIC)
{
printf("ThisExp::semantic()\n");
}
if (e.type)
{
result = e;
return;
}
FuncDeclaration fd = hasThis(sc); // fd is the uplevel function with the 'this' variable
AggregateDeclaration ad;
/* Special case for typeof(this) and typeof(super) since both
* should work even if they are not inside a non-static member function
*/
if (!fd && sc.intypeof == 1)
{
// Find enclosing struct or class
for (Dsymbol s = sc.getStructClassScope(); 1; s = s.parent)
{
if (!s)
{
e.error("`%s` is not in a class or struct scope", e.toChars());
return setError();
}
ClassDeclaration cd = s.isClassDeclaration();
if (cd)
{
e.type = cd.type;
result = e;
return;
}
StructDeclaration sd = s.isStructDeclaration();
if (sd)
{
e.type = sd.type;
result = e;
return;
}
}
}
if (!fd)
{
e.error("`this` is only defined in non-static member functions, not `%s`", sc.parent.toChars());
return setError();
}
assert(fd.vthis);
e.var = fd.vthis;
assert(e.var.parent);
ad = fd.isMemberLocal();
if (!ad)
ad = fd.isMember2();
assert(ad);
e.type = ad.type.addMod(e.var.type.mod);
if (e.var.checkNestedReference(sc, e.loc))
return setError();
result = e;
}
override void visit(SuperExp e)
{
static if (LOGSEMANTIC)
{
printf("SuperExp::semantic('%s')\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
FuncDeclaration fd = hasThis(sc);
ClassDeclaration cd;
Dsymbol s;
/* Special case for typeof(this) and typeof(super) since both
* should work even if they are not inside a non-static member function
*/
if (!fd && sc.intypeof == 1)
{
// Find enclosing class
for (s = sc.getStructClassScope(); 1; s = s.parent)
{
if (!s)
{
e.error("`%s` is not in a class scope", e.toChars());
return setError();
}
cd = s.isClassDeclaration();
if (cd)
{
cd = cd.baseClass;
if (!cd)
{
e.error("class `%s` has no `super`", s.toChars());
return setError();
}
e.type = cd.type;
result = e;
return;
}
}
}
if (!fd)
goto Lerr;
e.var = fd.vthis;
assert(e.var && e.var.parent);
s = fd.toParentDecl();
if (s.isTemplateDeclaration()) // allow inside template constraint
s = s.toParent();
assert(s);
cd = s.isClassDeclaration();
//printf("parent is %s %s\n", fd.toParent().kind(), fd.toParent().toChars());
if (!cd)
goto Lerr;
if (!cd.baseClass)
{
e.error("no base class for `%s`", cd.toChars());
e.type = cd.type.addMod(e.var.type.mod);
}
else
{
e.type = cd.baseClass.type;
e.type = e.type.castMod(e.var.type.mod);
}
if (e.var.checkNestedReference(sc, e.loc))
return setError();
result = e;
return;
Lerr:
e.error("`super` is only allowed in non-static class member functions");
result = ErrorExp.get();
}
override void visit(NullExp e)
{
static if (LOGSEMANTIC)
{
printf("NullExp::semantic('%s')\n", e.toChars());
}
// NULL is the same as (void *)0
if (e.type)
{
result = e;
return;
}
e.type = Type.tnull;
result = e;
}
override void visit(StringExp e)
{
static if (LOGSEMANTIC)
{
printf("StringExp::semantic() %s\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
OutBuffer buffer;
size_t newlen = 0;
size_t u;
dchar c;
switch (e.postfix)
{
case 'd':
for (u = 0; u < e.len;)
{
if (const p = utf_decodeChar(e.peekString(), u, c))
{
e.error("%.*s", cast(int)p.length, p.ptr);
return setError();
}
else
{
buffer.write4(c);
newlen++;
}
}
buffer.write4(0);
e.setData(buffer.extractData(), newlen, 4);
if (sc && sc.flags & SCOPE.Cfile)
e.type = Type.tuns32.sarrayOf(e.len + 1);
else
e.type = Type.tdchar.immutableOf().arrayOf();
e.committed = true;
break;
case 'w':
for (u = 0; u < e.len;)
{
if (const p = utf_decodeChar(e.peekString(), u, c))
{
e.error("%.*s", cast(int)p.length, p.ptr);
return setError();
}
else
{
buffer.writeUTF16(c);
newlen++;
if (c >= 0x10000)
newlen++;
}
}
buffer.writeUTF16(0);
e.setData(buffer.extractData(), newlen, 2);
if (sc && sc.flags & SCOPE.Cfile)
e.type = Type.tuns16.sarrayOf(e.len + 1);
else
e.type = Type.twchar.immutableOf().arrayOf();
e.committed = true;
break;
case 'c':
e.committed = true;
goto default;
default:
if (sc && sc.flags & SCOPE.Cfile)
e.type = Type.tchar.sarrayOf(e.len + 1);
else
e.type = Type.tchar.immutableOf().arrayOf();
break;
}
e.type = e.type.typeSemantic(e.loc, sc);
//type = type.immutableOf();
//printf("type = %s\n", type.toChars());
result = e;
}
override void visit(TupleExp exp)
{
static if (LOGSEMANTIC)
{
printf("+TupleExp::semantic(%s)\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (exp.e0)
exp.e0 = exp.e0.expressionSemantic(sc);
// Run semantic() on each argument
bool err = false;
for (size_t i = 0; i < exp.exps.length; i++)
{
Expression e = (*exp.exps)[i];
e = e.expressionSemantic(sc);
if (!e.type)
{
exp.error("`%s` has no value", e.toChars());
err = true;
}
else if (e.op == EXP.error)
err = true;
else
(*exp.exps)[i] = e;
}
if (err)
return setError();
expandTuples(exp.exps);
exp.type = new TypeTuple(exp.exps);
exp.type = exp.type.typeSemantic(exp.loc, sc);
//printf("-TupleExp::semantic(%s)\n", toChars());
result = exp;
}
override void visit(ArrayLiteralExp e)
{
static if (LOGSEMANTIC)
{
printf("ArrayLiteralExp::semantic('%s')\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
/* Perhaps an empty array literal [ ] should be rewritten as null?
*/
if (e.basis)
e.basis = e.basis.expressionSemantic(sc);
if (arrayExpressionSemantic(e.elements.peekSlice(), sc) || (e.basis && e.basis.op == EXP.error))
return setError();
expandTuples(e.elements);
if (e.basis)
e.elements.push(e.basis);
Type t0 = arrayExpressionToCommonType(sc, *e.elements);
if (e.basis)
e.basis = e.elements.pop();
if (t0 is null)
return setError();
e.type = t0.arrayOf();
e.type = e.type.typeSemantic(e.loc, sc);
/* Disallow array literals of type void being used.
*/
if (e.elements.length > 0 && t0.ty == Tvoid)
{
e.error("`%s` of type `%s` has no value", e.toChars(), e.type.toChars());
return setError();
}
if (global.params.useTypeInfo && Type.dtypeinfo)
semanticTypeInfo(sc, e.type);
result = e;
}
override void visit(AssocArrayLiteralExp e)
{
static if (LOGSEMANTIC)
{
printf("AssocArrayLiteralExp::semantic('%s')\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
// Run semantic() on each element
bool err_keys = arrayExpressionSemantic(e.keys.peekSlice(), sc);
bool err_vals = arrayExpressionSemantic(e.values.peekSlice(), sc);
if (err_keys || err_vals)
return setError();
expandTuples(e.keys);
expandTuples(e.values);
if (e.keys.length != e.values.length)
{
e.error("number of keys is %llu, must match number of values %llu",
cast(ulong) e.keys.length, cast(ulong) e.values.length);
return setError();
}
Type tkey = arrayExpressionToCommonType(sc, *e.keys);
Type tvalue = arrayExpressionToCommonType(sc, *e.values);
if (tkey is null || tvalue is null)
return setError();
e.type = new TypeAArray(tvalue, tkey);
e.type = e.type.typeSemantic(e.loc, sc);
semanticTypeInfo(sc, e.type);
if (checkAssocArrayLiteralEscape(sc, e, false))
return setError();
result = e;
}
override void visit(StructLiteralExp e)
{
static if (LOGSEMANTIC)
{
printf("StructLiteralExp::semantic('%s')\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
e.sd.size(e.loc);
if (e.sd.sizeok != Sizeok.done)
return setError();
// run semantic() on each element
if (arrayExpressionSemantic(e.elements.peekSlice(), sc))
return setError();
expandTuples(e.elements);
/* Fit elements[] to the corresponding type of field[].
*/
if (!e.sd.fit(e.loc, sc, e.elements, e.stype))
return setError();
/* Fill out remainder of elements[] with default initializers for fields[]
*/
if (!e.sd.fill(e.loc, *e.elements, false))
{
/* An error in the initializer needs to be recorded as an error
* in the enclosing function or template, since the initializer
* will be part of the stuct declaration.
*/
global.increaseErrorCount();
return setError();
}
if (checkFrameAccess(e.loc, sc, e.sd, e.elements.length))
return setError();
e.type = e.stype ? e.stype : e.sd.type;
result = e;
}
override void visit(CompoundLiteralExp cle)
{
static if (LOGSEMANTIC)
{
printf("CompoundLiteralExp::semantic('%s')\n", cle.toChars());
}
Type t = cle.type.typeSemantic(cle.loc, sc);
auto init = initializerSemantic(cle.initializer, sc, t, INITnointerpret);
auto e = initializerToExpression(init, t, (sc.flags & SCOPE.Cfile) != 0);
if (!e)
{
error(cle.loc, "cannot convert initializer `%s` to expression", init.toChars());
return setError();
}
result = e;
return;
}
override void visit(TypeExp exp)
{
if (exp.type.ty == Terror)
return setError();
//printf("TypeExp::semantic(%s)\n", exp.type.toChars());
Expression e;
Type t;
Dsymbol s;
dmd.typesem.resolve(exp.type, exp.loc, sc, e, t, s, true);
if (e)
{
// `(Type)` is actually `(var)` so if `(var)` is a member requiring `this`
// then rewrite as `(this.var)` in case it would be followed by a DotVar
// to fix https://issues.dlang.org/show_bug.cgi?id=9490
VarExp ve = e.isVarExp();
if (ve && ve.var && exp.parens && !ve.var.isStatic() && !(sc.stc & STC.static_) &&
sc.func && sc.func.needThis && ve.var.isMember2())
{
// printf("apply fix for bugzilla issue 9490: add `this.` to `%s`...\n", e.toChars());
e = new DotVarExp(exp.loc, new ThisExp(exp.loc), ve.var, false);
}
//printf("e = %s %s\n", Token.toChars(e.op), e.toChars());
e = e.expressionSemantic(sc);
}
else if (t)
{
//printf("t = %d %s\n", t.ty, t.toChars());
exp.type = t.typeSemantic(exp.loc, sc);
e = exp;
}
else if (s)
{
//printf("s = %s %s\n", s.kind(), s.toChars());
e = symbolToExp(s, exp.loc, sc, true);
}
else
assert(0);
exp.type.checkComplexTransition(exp.loc, sc);
result = e;
}
override void visit(ScopeExp exp)
{
static if (LOGSEMANTIC)
{
printf("+ScopeExp::semantic(%p '%s')\n", exp, exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
ScopeDsymbol sds2 = exp.sds;
TemplateInstance ti = sds2.isTemplateInstance();
while (ti)
{
WithScopeSymbol withsym;
if (!ti.findTempDecl(sc, &withsym) || !ti.semanticTiargs(sc))
return setError();
if (withsym && withsym.withstate.wthis)
{
Expression e = new VarExp(exp.loc, withsym.withstate.wthis);
e = new DotTemplateInstanceExp(exp.loc, e, ti);
result = e.expressionSemantic(sc);
return;
}
if (ti.needsTypeInference(sc))
{
if (TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration())
{
Dsymbol p = td.toParentLocal();
FuncDeclaration fdthis = hasThis(sc);
AggregateDeclaration ad = p ? p.isAggregateDeclaration() : null;
if (fdthis && ad && fdthis.isMemberLocal() == ad && (td._scope.stc & STC.static_) == 0)
{
Expression e = new DotTemplateInstanceExp(exp.loc, new ThisExp(exp.loc), ti);
result = e.expressionSemantic(sc);
return;
}
}
else if (OverloadSet os = ti.tempdecl.isOverloadSet())
{
FuncDeclaration fdthis = hasThis(sc);
AggregateDeclaration ad = os.parent.isAggregateDeclaration();
if (fdthis && ad && fdthis.isMemberLocal() == ad)
{
Expression e = new DotTemplateInstanceExp(exp.loc, new ThisExp(exp.loc), ti);
result = e.expressionSemantic(sc);
return;
}
}
// ti is an instance which requires IFTI.
exp.sds = ti;
exp.type = Type.tvoid;
result = exp;
return;
}
ti.dsymbolSemantic(sc);
if (!ti.inst || ti.errors)
return setError();
Dsymbol s = ti.toAlias();
if (s == ti)
{
exp.sds = ti;
exp.type = Type.tvoid;
result = exp;
return;
}
sds2 = s.isScopeDsymbol();
if (sds2)
{
ti = sds2.isTemplateInstance();
//printf("+ sds2 = %s, '%s'\n", sds2.kind(), sds2.toChars());
continue;
}
if (auto v = s.isVarDeclaration())
{
if (!v.type)
{
exp.error("forward reference of %s `%s`", v.kind(), v.toChars());
return setError();
}
if ((v.storage_class & STC.manifest) && v._init)
{
/* When an instance that will be converted to a constant exists,
* the instance representation "foo!tiargs" is treated like a
* variable name, and its recursive appearance check (note that
* it's equivalent with a recursive instantiation of foo) is done
* separately from the circular initialization check for the
* eponymous enum variable declaration.
*
* template foo(T) {
* enum bool foo = foo; // recursive definition check (v.inuse)
* }
* template bar(T) {
* enum bool bar = bar!T; // recursive instantiation check (ti.inuse)
* }
*/
if (ti.inuse)
{
exp.error("recursive expansion of %s `%s`", ti.kind(), ti.toPrettyChars());
return setError();
}
v.checkDeprecated(exp.loc, sc);
auto e = v.expandInitializer(exp.loc);
ti.inuse++;
e = e.expressionSemantic(sc);
ti.inuse--;
result = e;
return;
}
}
//printf("s = %s, '%s'\n", s.kind(), s.toChars());
auto e = symbolToExp(s, exp.loc, sc, true);
//printf("-1ScopeExp::semantic()\n");
result = e;
return;
}
//printf("sds2 = %s, '%s'\n", sds2.kind(), sds2.toChars());
//printf("\tparent = '%s'\n", sds2.parent.toChars());
sds2.dsymbolSemantic(sc);
// (Aggregate|Enum)Declaration
if (auto t = sds2.getType())
{
result = (new TypeExp(exp.loc, t)).expressionSemantic(sc);
return;
}
if (auto td = sds2.isTemplateDeclaration())
{
result = (new TemplateExp(exp.loc, td)).expressionSemantic(sc);
return;
}
exp.sds = sds2;
exp.type = Type.tvoid;
//printf("-2ScopeExp::semantic() %s\n", toChars());
result = exp;
}
/**
* Sets the `lowering` field of a `NewExp` to a call to `_d_newitemT` unless
* compiling with `-betterC` or within `__traits(compiles)`.
*
* Params:
* ne = the `NewExp` to lower
*/
private void tryLowerToNewItem(NewExp ne)
{
if (!global.params.useGC || !sc.needsCodegen())
return;
auto hook = global.params.tracegc ? Id._d_newitemTTrace : Id._d_newitemT;
if (!verifyHookExist(ne.loc, *sc, hook, "new struct"))
return;
/* Lower the memory allocation and initialization of `new T()` to
* `_d_newitemT!T()`.
*/
Expression id = new IdentifierExp(ne.loc, Id.empty);
id = new DotIdExp(ne.loc, id, Id.object);
auto tiargs = new Objects();
/*
* Remove `inout`, `const`, `immutable` and `shared` to reduce the
* number of generated `_d_newitemT` instances.
*/
auto t = ne.type.nextOf.unqualify(MODFlags.wild | MODFlags.const_ |
MODFlags.immutable_ | MODFlags.shared_);
tiargs.push(t);
id = new DotTemplateInstanceExp(ne.loc, id, hook, tiargs);
auto arguments = new Expressions();
if (global.params.tracegc)
{
auto funcname = (sc.callsc && sc.callsc.func) ?
sc.callsc.func.toPrettyChars() : sc.func.toPrettyChars();
arguments.push(new StringExp(ne.loc, ne.loc.filename.toDString()));
arguments.push(new IntegerExp(ne.loc, ne.loc.linnum, Type.tint32));
arguments.push(new StringExp(ne.loc, funcname.toDString()));
}
id = new CallExp(ne.loc, id, arguments);
ne.lowering = id.expressionSemantic(sc);
}
override void visit(NewExp exp)
{
static if (LOGSEMANTIC)
{
printf("NewExp::semantic() %s\n", exp.toChars());
if (exp.thisexp)
printf("\tthisexp = %s\n", exp.thisexp.toChars());
printf("\tnewtype: %s\n", exp.newtype.toChars());
}
if (exp.type) // if semantic() already run
{
result = exp;
return;
}
//for error messages if the argument in [] is not convertible to size_t
const originalNewtype = exp.newtype;
// https://issues.dlang.org/show_bug.cgi?id=11581
// With the syntax `new T[edim]` or `thisexp.new T[edim]`,
// T should be analyzed first and edim should go into arguments iff it's
// not a tuple.
Expression edim = null;
if (!exp.arguments && exp.newtype.isTypeSArray())
{
auto ts = exp.newtype.isTypeSArray();
// check `new Value[Key]`
ts.dim = ts.dim.expressionSemantic(sc);
if (ts.dim.op == EXP.type)
{
exp.newtype = new TypeAArray(ts.next, ts.dim.isTypeExp().type);
}
else
{
edim = ts.dim;
exp.newtype = ts.next;
}
}
ClassDeclaration cdthis = null;
if (exp.thisexp)
{
exp.thisexp = exp.thisexp.expressionSemantic(sc);
if (exp.thisexp.op == EXP.error)
return setError();
cdthis = exp.thisexp.type.isClassHandle();
if (!cdthis)
{
exp.error("`this` for nested class must be a class type, not `%s`", exp.thisexp.type.toChars());
return setError();
}
sc = sc.push(cdthis);
exp.type = exp.newtype.typeSemantic(exp.loc, sc);
sc = sc.pop();
}
else
{
exp.type = exp.newtype.typeSemantic(exp.loc, sc);
}
if (exp.type.ty == Terror)
return setError();
if (edim)
{
if (exp.type.toBasetype().ty == Ttuple)
{
// --> new T[edim]
exp.type = new TypeSArray(exp.type, edim);
exp.type = exp.type.typeSemantic(exp.loc, sc);
if (exp.type.ty == Terror)
return setError();
}
else
{
// --> new T[](edim)
exp.arguments = new Expressions();
exp.arguments.push(edim);
exp.type = exp.type.arrayOf();
}
}
exp.newtype = exp.type; // in case type gets cast to something else
Type tb = exp.type.toBasetype();
//printf("tb: %s, deco = %s\n", tb.toChars(), tb.deco);
if (arrayExpressionSemantic(exp.arguments.peekSlice(), sc))
{
return setError();
}
if (preFunctionParameters(sc, exp.argumentList))
{
return setError();
}
if (exp.thisexp && tb.ty != Tclass)
{
exp.error("`.new` is only for allocating nested classes, not `%s`", tb.toChars());
return setError();
}
const size_t nargs = exp.arguments ? exp.arguments.length : 0;
Expression newprefix = null;
if (auto tc = tb.isTypeClass())
{
auto cd = tc.sym;
if (cd.errors)
return setError();
cd.size(exp.loc);
if (cd.sizeok != Sizeok.done)
return setError();
if (!cd.ctor)
cd.ctor = cd.searchCtor();
if (cd.noDefaultCtor && !nargs && !cd.defaultCtor)
{
exp.error("default construction is disabled for type `%s`", cd.type.toChars());
return setError();
}
if (cd.isInterfaceDeclaration())
{
exp.error("cannot create instance of interface `%s`", cd.toChars());
return setError();
}
if (cd.isAbstract())
{
exp.error("cannot create instance of abstract class `%s`", cd.toChars());
errorSupplemental(cd.loc, "class `%s` is declared here", cd.toChars());
for (size_t i = 0; i < cd.vtbl.length; i++)
{
FuncDeclaration fd = cd.vtbl[i].isFuncDeclaration();
if (fd && fd.isAbstract())
{
errorSupplemental(fd.loc, "function `%s` is not implemented",
fd.toFullSignature());
}
}
return setError();
}
// checkDeprecated() is already done in newtype.typeSemantic().
if (cd.isNested())
{
/* We need a 'this' pointer for the nested class.
* Ensure we have the right one.
*/
Dsymbol s = cd.toParentLocal();
//printf("cd isNested, parent = %s '%s'\n", s.kind(), s.toPrettyChars());
if (auto cdn = s.isClassDeclaration())
{
if (!cdthis)
{
void noReferenceToOuterClass()
{
if (cd.isAnonymous)
exp.error("cannot construct anonymous nested class because no implicit `this` reference to outer class is available");
else
exp.error("cannot construct nested class `%s` because no implicit `this` reference to outer class `%s` is available",
cd.toChars(), cdn.toChars());
return setError();
}
if (!sc.hasThis)
return noReferenceToOuterClass();
// Supply an implicit 'this' and try again
exp.thisexp = new ThisExp(exp.loc);
for (Dsymbol sp = sc.parent; 1; sp = sp.toParentLocal())
{
if (!sp)
return noReferenceToOuterClass();
ClassDeclaration cdp = sp.isClassDeclaration();
if (!cdp)
continue;
if (cdp == cdn || cdn.isBaseOf(cdp, null))
break;
// Add a '.outer' and try again
exp.thisexp = new DotIdExp(exp.loc, exp.thisexp, Id.outer);
}
exp.thisexp = exp.thisexp.expressionSemantic(sc);
if (exp.thisexp.op == EXP.error)
return setError();
cdthis = exp.thisexp.type.isClassHandle();
}
if (cdthis != cdn && !cdn.isBaseOf(cdthis, null))
{
//printf("cdthis = %s\n", cdthis.toChars());
exp.error("`this` for nested class must be of type `%s`, not `%s`",
cdn.toChars(), exp.thisexp.type.toChars());
return setError();
}
if (!MODimplicitConv(exp.thisexp.type.mod, exp.newtype.mod))
{
exp.error("nested type `%s` should have the same or weaker constancy as enclosing type `%s`",
exp.newtype.toChars(), exp.thisexp.type.toChars());
return setError();
}
}
else if (exp.thisexp)
{
exp.error("`.new` is only for allocating nested classes");
return setError();
}
else if (auto fdn = s.isFuncDeclaration())
{
// make sure the parent context fdn of cd is reachable from sc
if (!ensureStaticLinkTo(sc.parent, fdn))
{
exp.error("outer function context of `%s` is needed to `new` nested class `%s`",
fdn.toPrettyChars(), cd.toPrettyChars());
return setError();
}
}
else
assert(0);
}
else if (exp.thisexp)
{
exp.error("`.new` is only for allocating nested classes");
return setError();
}
if (cd.vthis2)
{
if (AggregateDeclaration ad2 = cd.isMember2())
{
Expression te = new ThisExp(exp.loc).expressionSemantic(sc);
if (te.op != EXP.error)
te = getRightThis(exp.loc, sc, ad2, te, cd);
if (te.op == EXP.error)
{
exp.error("need `this` of type `%s` needed to `new` nested class `%s`", ad2.toChars(), cd.toChars());
return setError();
}
}
}
if (cd.disableNew && !exp.onstack)
{
exp.error("cannot allocate `class %s` with `new` because it is annotated with `@disable new()`",
originalNewtype.toChars());
return setError();
}
if (cd.ctor)
{
FuncDeclaration f = resolveFuncCall(exp.loc, sc, cd.ctor, null, tb, exp.argumentList, FuncResolveFlag.standard);
if (!f || f.errors)
return setError();
checkFunctionAttributes(exp, sc, f);
checkAccess(cd, exp.loc, sc, f);
TypeFunction tf = f.type.isTypeFunction();
if (!exp.arguments)
exp.arguments = new Expressions();
if (functionParameters(exp.loc, sc, tf, null, exp.type, exp.argumentList, f, &exp.type, &exp.argprefix))
return setError();
exp.member = f.isCtorDeclaration();
assert(exp.member);
}
else
{
if (nargs)
{
exp.error("no constructor for `%s`", cd.toChars());
return setError();
}
// https://issues.dlang.org/show_bug.cgi?id=19941
// Run semantic on all field initializers to resolve any forward
// references. This is the same as done for structs in sd.fill().
for (ClassDeclaration c = cd; c; c = c.baseClass)
{
foreach (v; c.fields)
{
if (v.inuse || v._scope is null || v._init is null ||
v._init.isVoidInitializer())
continue;
v.inuse++;
v._init = v._init.initializerSemantic(v._scope, v.type, INITinterpret);
v.inuse--;
}
}
}
// When using `@nogc` exception handling, lower `throw new E(args)` to
// `throw (__tmp = _d_newThrowable!E(), __tmp.__ctor(args), __tmp)`.
if (global.params.ehnogc && exp.thrownew &&
!cd.isCOMclass() && !cd.isCPPclass())
{
assert(cd.ctor);
Expression id = new IdentifierExp(exp.loc, Id.empty);
id = new DotIdExp(exp.loc, id, Id.object);
auto tiargs = new Objects();
tiargs.push(exp.newtype);
id = new DotTemplateInstanceExp(exp.loc, id, Id._d_newThrowable, tiargs);
id = new CallExp(exp.loc, id).expressionSemantic(sc);
Expression idVal;
Expression tmp = extractSideEffect(sc, "__tmpThrowable", idVal, id, true);
// auto castTmp = new CastExp(exp.loc, tmp, exp.type);
auto ctor = new DotIdExp(exp.loc, tmp, Id.ctor).expressionSemantic(sc);
auto ctorCall = new CallExp(exp.loc, ctor, exp.arguments);
id = Expression.combine(idVal, exp.argprefix).expressionSemantic(sc);
id = Expression.combine(id, ctorCall).expressionSemantic(sc);
// id = Expression.combine(id, castTmp).expressionSemantic(sc);
result = id.expressionSemantic(sc);
return;
}
else if (sc.needsCodegen() && // interpreter doesn't need this lowered
!exp.onstack && !exp.type.isscope()) // these won't use the GC
{
/* replace `new T(arguments)` with `core.lifetime._d_newclassT!T(arguments)`
* or `_d_newclassTTrace`
*/
auto hook = global.params.tracegc ? Id._d_newclassTTrace : Id._d_newclassT;
if (!verifyHookExist(exp.loc, *sc, hook, "new class"))
return setError();
Expression id = new IdentifierExp(exp.loc, Id.empty);
id = new DotIdExp(exp.loc, id, Id.object);
auto tiargs = new Objects();
auto t = exp.newtype.unqualify(MODFlags.wild); // remove `inout`
tiargs.push(t);
id = new DotTemplateInstanceExp(exp.loc, id, hook, tiargs);
auto arguments = new Expressions();
if (global.params.tracegc)
{
auto funcname = (sc.callsc && sc.callsc.func) ?
sc.callsc.func.toPrettyChars() : sc.func.toPrettyChars();
arguments.push(new StringExp(exp.loc, exp.loc.filename.toDString()));
arguments.push(new IntegerExp(exp.loc, exp.loc.linnum, Type.tint32));
arguments.push(new StringExp(exp.loc, funcname.toDString()));
}
id = new CallExp(exp.loc, id, arguments);
exp.lowering = id.expressionSemantic(sc);
}
}
else if (auto ts = tb.isTypeStruct())
{
auto sd = ts.sym;
sd.size(exp.loc);
if (sd.sizeok != Sizeok.done)
return setError();
if (!sd.ctor)
sd.ctor = sd.searchCtor();
if (sd.noDefaultCtor && !nargs)
{
exp.error("default construction is disabled for type `%s`", sd.type.toChars());
return setError();
}
// checkDeprecated() is already done in newtype.typeSemantic().
if (sd.disableNew)
{
exp.error("cannot allocate `struct %s` with `new` because it is annotated with `@disable new()`",
originalNewtype.toChars());
return setError();
}
// https://issues.dlang.org/show_bug.cgi?id=22639
// If the new expression has arguments, we either should call a
// regular constructor of a copy constructor if the first argument
// is the same type as the struct
if (nargs && (sd.hasRegularCtor() || (sd.ctor && (*exp.arguments)[0].type.mutableOf() == sd.type.mutableOf())))
{
FuncDeclaration f = resolveFuncCall(exp.loc, sc, sd.ctor, null, tb, exp.argumentList, FuncResolveFlag.standard);
if (!f || f.errors)
return setError();
checkFunctionAttributes(exp, sc, f);
checkAccess(sd, exp.loc, sc, f);
TypeFunction tf = f.type.isTypeFunction();
if (!exp.arguments)
exp.arguments = new Expressions();
if (functionParameters(exp.loc, sc, tf, null, exp.type, exp.argumentList, f, &exp.type, &exp.argprefix))
return setError();
exp.member = f.isCtorDeclaration();
assert(exp.member);
if (checkFrameAccess(exp.loc, sc, sd, sd.fields.length))
return setError();
}
else
{
if (exp.names)
{
exp.arguments = resolveStructLiteralNamedArgs(sd, exp.type, sc, exp.loc,
exp.names ? (*exp.names)[] : null,
(size_t i, Type t) => (*exp.arguments)[i],
i => (*exp.arguments)[i].loc
);
if (!exp.arguments)
return setError();
}
else if (!exp.arguments)
{
exp.arguments = new Expressions();
}
if (!sd.fit(exp.loc, sc, exp.arguments, tb))
return setError();
if (!sd.fill(exp.loc, *exp.arguments, false))
return setError();
if (checkFrameAccess(exp.loc, sc, sd, exp.arguments ? exp.arguments.length : 0))
return setError();
/* Since a `new` allocation may escape, check each of the arguments for escaping
*/
foreach (arg; *exp.arguments)
{
if (arg && checkNewEscape(sc, arg, false))
return setError();
}
}
exp.type = exp.type.pointerTo();
tryLowerToNewItem(exp);
}
else if (tb.ty == Tarray)
{
if (!nargs)
{
// https://issues.dlang.org/show_bug.cgi?id=20422
// Without this check the compiler would give a misleading error
exp.error("missing length argument for array");
return setError();
}
Type tn = tb.nextOf().baseElemOf();
Dsymbol s = tn.toDsymbol(sc);
AggregateDeclaration ad = s ? s.isAggregateDeclaration() : null;
if (ad && ad.noDefaultCtor)
{
exp.error("default construction is disabled for type `%s`", tb.nextOf().toChars());
return setError();
}
for (size_t i = 0; i < nargs; i++)
{
if (tb.ty != Tarray)
{
exp.error("too many arguments for array");
return setError();
}
Expression arg = (*exp.arguments)[i];
if (exp.names && (*exp.names)[i])
{
exp.error("no named argument `%s` allowed for array dimension", (*exp.names)[i].toChars());
return setError();
}
arg = resolveProperties(sc, arg);
arg = arg.implicitCastTo(sc, Type.tsize_t);
if (arg.op == EXP.error)
return setError();
arg = arg.optimize(WANTvalue);
if (arg.op == EXP.int64 && (target.isLP64 ?
cast(sinteger_t)arg.toInteger() : cast(int)arg.toInteger()) < 0)
{
exp.error("negative array dimension `%s`", (*exp.arguments)[i].toChars());
return setError();
}
(*exp.arguments)[i] = arg;
tb = tb.isTypeDArray().next.toBasetype();
}
}
else if (tb.isscalar())
{
if (!nargs)
{
}
else if (nargs == 1)
{
if (exp.names && (*exp.names)[0])
{
exp.error("no named argument `%s` allowed for scalar", (*exp.names)[0].toChars());
return setError();
}
Expression e = (*exp.arguments)[0];
e = e.implicitCastTo(sc, tb);
(*exp.arguments)[0] = e;
}
else
{
exp.error("more than one argument for construction of `%s`", exp.type.toChars());
return setError();
}
exp.type = exp.type.pointerTo();
tryLowerToNewItem(exp);
}
else if (tb.ty == Taarray)
{
// e.g. `new Alias(args)`
if (nargs)
{
exp.error("`new` cannot take arguments for an associative array");
return setError();
}
}
else
{
exp.error("cannot create a `%s` with `new`", exp.type.toChars());
return setError();
}
//printf("NewExp: '%s'\n", toChars());
//printf("NewExp:type '%s'\n", type.toChars());
semanticTypeInfo(sc, exp.type);
if (newprefix)
{
result = Expression.combine(newprefix, exp);
return;
}
result = exp;
}
override void visit(NewAnonClassExp e)
{
static if (LOGSEMANTIC)
{
printf("NewAnonClassExp::semantic() %s\n", e.toChars());
//printf("thisexp = %p\n", thisexp);
//printf("type: %s\n", type.toChars());
}
Expression d = new DeclarationExp(e.loc, e.cd);
sc = sc.push(); // just create new scope
sc.flags &= ~SCOPE.ctfe; // temporary stop CTFE
d = d.expressionSemantic(sc);
sc = sc.pop();
if (!e.cd.errors && sc.intypeof && !sc.parent.inNonRoot())
{
ScopeDsymbol sds = sc.tinst ? cast(ScopeDsymbol)sc.tinst : sc._module;
if (!sds.members)
sds.members = new Dsymbols();
sds.members.push(e.cd);
}
Expression n = new NewExp(e.loc, e.thisexp, e.cd.type, e.arguments);
Expression c = new CommaExp(e.loc, d, n);
result = c.expressionSemantic(sc);
}
override void visit(SymOffExp e)
{
static if (LOGSEMANTIC)
{
printf("SymOffExp::semantic('%s')\n", e.toChars());
}
//var.dsymbolSemantic(sc);
if (!e.type)
e.type = e.var.type.pointerTo();
if (auto v = e.var.isVarDeclaration())
{
if (v.checkNestedReference(sc, e.loc))
return setError();
}
else if (auto f = e.var.isFuncDeclaration())
{
if (f.checkNestedReference(sc, e.loc))
return setError();
}
result = e;
}
override void visit(VarExp e)
{
static if (LOGSEMANTIC)
{
printf("VarExp::semantic(%s)\n", e.toChars());
}
auto vd = e.var.isVarDeclaration();
auto fd = e.var.isFuncDeclaration();
if (fd)
{
//printf("L%d fd = %s\n", __LINE__, f.toChars());
if (!fd.functionSemantic())
return setError();
}
if (!e.type)
e.type = e.var.type;
if (e.type && !e.type.deco)
{
auto decl = e.var.isDeclaration();
if (decl)
decl.inuse++;
e.type = e.type.typeSemantic(e.loc, sc);
if (decl)
decl.inuse--;
}
/* Fix for 1161 doesn't work because it causes visibility
* problems when instantiating imported templates passing private
* variables as alias template parameters.
*/
//checkAccess(loc, sc, NULL, var);
if (vd)
{
if (vd.checkNestedReference(sc, e.loc))
return setError();
// https://issues.dlang.org/show_bug.cgi?id=12025
// If the variable is not actually used in runtime code,
// the purity violation error is redundant.
//checkPurity(sc, vd);
}
else if (fd)
{
// TODO: If fd isn't yet resolved its overload, the checkNestedReference
// call would cause incorrect validation.
// Maybe here should be moved in CallExp, or AddrExp for functions.
if (fd.checkNestedReference(sc, e.loc))
return setError();
}
else if (auto od = e.var.isOverDeclaration())
{
e.type = Type.tvoid; // ambiguous type?
}
result = e;
}
override void visit(FuncExp exp)
{
static if (LOGSEMANTIC)
{
printf("FuncExp::semantic(%s)\n", exp.toChars());
if (exp.fd.treq)
printf(" treq = %s\n", exp.fd.treq.toChars());
}
if (exp.type)
{
result = exp;
return;
}
Expression e = exp;
uint olderrors;
sc = sc.push(); // just create new scope
sc.flags &= ~SCOPE.ctfe; // temporary stop CTFE
sc.visibility = Visibility(Visibility.Kind.public_); // https://issues.dlang.org/show_bug.cgi?id=12506
/* fd.treq might be incomplete type,
* so should not semantic it.
* void foo(T)(T delegate(int) dg){}
* foo(a=>a); // in IFTI, treq == T delegate(int)
*/
//if (fd.treq)
// fd.treq = fd.treq.dsymbolSemantic(loc, sc);
exp.genIdent(sc);
// Set target of return type inference
if (exp.fd.treq && !exp.fd.type.nextOf())
{
TypeFunction tfv = null;
if (exp.fd.treq.ty == Tdelegate || exp.fd.treq.isPtrToFunction())
tfv = cast(TypeFunction)exp.fd.treq.nextOf();
if (tfv)
{
TypeFunction tfl = cast(TypeFunction)exp.fd.type;
tfl.next = tfv.nextOf();
}
}
//printf("td = %p, treq = %p\n", td, fd.treq);
if (exp.td)
{
assert(exp.td.parameters && exp.td.parameters.length);
exp.td.dsymbolSemantic(sc);
exp.type = Type.tvoid; // temporary type
if (exp.fd.treq) // defer type determination
{
FuncExp fe;
if (exp.matchType(exp.fd.treq, sc, &fe) > MATCH.nomatch)
e = fe;
else
e = ErrorExp.get();
}
goto Ldone;
}
olderrors = global.errors;
exp.fd.dsymbolSemantic(sc);
if (olderrors == global.errors)
{
exp.fd.semantic2(sc);
if (olderrors == global.errors)
exp.fd.semantic3(sc);
}
if (olderrors != global.errors)
{
if (exp.fd.type && exp.fd.type.ty == Tfunction && !exp.fd.type.nextOf())
(cast(TypeFunction)exp.fd.type).next = Type.terror;
e = ErrorExp.get();
goto Ldone;
}
// Type is a "delegate to" or "pointer to" the function literal
if ((exp.fd.isNested() && exp.fd.tok == TOK.delegate_) || (exp.tok == TOK.reserved && exp.fd.treq && exp.fd.treq.ty == Tdelegate))
{
// https://issues.dlang.org/show_bug.cgi?id=22686
// if the delegate return type is an error
// abort semantic of the FuncExp and propagate
// the error
if (exp.fd.type.isTypeError())
{
e = ErrorExp.get();
goto Ldone;
}
exp.type = new TypeDelegate(exp.fd.type.isTypeFunction());
exp.type = exp.type.typeSemantic(exp.loc, sc);
exp.fd.tok = TOK.delegate_;
}
else
{
exp.type = new TypePointer(exp.fd.type);
exp.type = exp.type.typeSemantic(exp.loc, sc);
//type = fd.type.pointerTo();
/* A lambda expression deduced to function pointer might become
* to a delegate literal implicitly.
*
* auto foo(void function() fp) { return 1; }
* assert(foo({}) == 1);
*
* So, should keep fd.tok == TOK.reserve if fd.treq == NULL.
*/
if (exp.fd.treq && exp.fd.treq.ty == Tpointer)
{
// change to non-nested
exp.fd.tok = TOK.function_;
exp.fd.vthis = null;
}
}
exp.fd.tookAddressOf++;
Ldone:
sc = sc.pop();
result = e;
}
/**
* Perform semantic analysis on function literals
*
* Test the following construct:
* ---
* (x, y, z) { return x + y + z; }(42, 84, 1992);
* ---
*/
Expression callExpSemantic(FuncExp exp, Scope* sc, Expressions* arguments)
{
if ((!exp.type || exp.type == Type.tvoid) && exp.td && arguments && arguments.length)
{
for (size_t k = 0; k < arguments.length; k++)
{
Expression checkarg = (*arguments)[k];
if (checkarg.op == EXP.error)
return checkarg;
}
exp.genIdent(sc);
assert(exp.td.parameters && exp.td.parameters.length);
exp.td.dsymbolSemantic(sc);
TypeFunction tfl = cast(TypeFunction)exp.fd.type;
size_t dim = tfl.parameterList.length;
if (arguments.length < dim)
{
// Default arguments are always typed, so they don't need inference.
Parameter p = tfl.parameterList[arguments.length];
if (p.defaultArg)
dim = arguments.length;
}
if ((tfl.parameterList.varargs == VarArg.none && arguments.length > dim) ||
arguments.length < dim)
{
OutBuffer buf;
foreach (idx, ref arg; *arguments)
buf.printf("%s%s", (idx ? ", ".ptr : "".ptr), arg.type.toChars());
exp.error("function literal `%s%s` is not callable using argument types `(%s)`",
exp.fd.toChars(), parametersTypeToChars(tfl.parameterList),
buf.peekChars());
exp.errorSupplemental("too %s arguments, expected %d, got %d",
arguments.length < dim ? "few".ptr : "many".ptr,
cast(int)dim, cast(int)arguments.length);
return ErrorExp.get();
}
auto tiargs = new Objects();
tiargs.reserve(exp.td.parameters.length);
for (size_t i = 0; i < exp.td.parameters.length; i++)
{
TemplateParameter tp = (*exp.td.parameters)[i];
assert(dim <= tfl.parameterList.length);
foreach (u, p; tfl.parameterList)
{
if (u == dim)
break;
if (p.type.ty == Tident && (cast(TypeIdentifier)p.type).ident == tp.ident)
{
Expression e = (*arguments)[u];
tiargs.push(e.type);
break;
}
}
}
auto ti = new TemplateInstance(exp.loc, exp.td, tiargs);
return (new ScopeExp(exp.loc, ti)).expressionSemantic(sc);
}
return exp.expressionSemantic(sc);
}
override void visit(CallExp exp)
{
static if (LOGSEMANTIC)
{
printf("CallExp::semantic() %s\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return; // semantic() already run
}
Objects* tiargs = null; // initial list of template arguments
Expression ethis = null;
Type tthis = null;
Expression e1org = exp.e1;
if (auto ce = exp.e1.isCommaExp())
{
/* Rewrite (a,b)(args) as (a,(b(args)))
*/
exp.e1 = ce.e2;
ce.e2 = exp;
result = ce.expressionSemantic(sc);
return;
}
if (DelegateExp de = exp.e1.isDelegateExp())
{
exp.e1 = new DotVarExp(de.loc, de.e1, de.func, de.hasOverloads);
visit(exp);
return;
}
if (FuncExp fe = exp.e1.isFuncExp())
{
if (arrayExpressionSemantic(exp.arguments.peekSlice(), sc) ||
preFunctionParameters(sc, exp.argumentList))
return setError();
// Run e1 semantic even if arguments have any errors
exp.e1 = callExpSemantic(fe, sc, exp.arguments);
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
}
if (sc.flags & SCOPE.Cfile)
{
/* See if need to rewrite the AST because of cast/call ambiguity
*/
if (auto e = castCallAmbiguity(exp, sc))
{
result = expressionSemantic(e, sc);
return;
}
}
if (Expression ex = resolveUFCS(sc, exp))
{
result = ex;
return;
}
/* This recognizes:
* foo!(tiargs)(funcargs)
*/
if (ScopeExp se = exp.e1.isScopeExp())
{
TemplateInstance ti = se.sds.isTemplateInstance();
if (ti)
{
/* Attempt to instantiate ti. If that works, go with it.
* If not, go with partial explicit specialization.
*/
WithScopeSymbol withsym;
if (!ti.findTempDecl(sc, &withsym) || !ti.semanticTiargs(sc))
return setError();
if (withsym && withsym.withstate.wthis)
{
exp.e1 = new VarExp(exp.e1.loc, withsym.withstate.wthis);
exp.e1 = new DotTemplateInstanceExp(exp.e1.loc, exp.e1, ti);
goto Ldotti;
}
if (ti.needsTypeInference(sc, 1))
{
/* Go with partial explicit specialization
*/
tiargs = ti.tiargs;
assert(ti.tempdecl);
if (TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration())
exp.e1 = new TemplateExp(exp.loc, td);
else if (OverDeclaration od = ti.tempdecl.isOverDeclaration())
exp.e1 = new VarExp(exp.loc, od);
else
exp.e1 = new OverExp(exp.loc, ti.tempdecl.isOverloadSet());
}
else
{
Expression e1x = exp.e1.expressionSemantic(sc);
if (e1x.op == EXP.error)
{
result = e1x;
return;
}
exp.e1 = e1x;
}
}
}
/* This recognizes:
* expr.foo!(tiargs)(funcargs)
*/
Ldotti:
if (DotTemplateInstanceExp se = exp.e1.isDotTemplateInstanceExp())
{
TemplateInstance ti = se.ti;
{
/* Attempt to instantiate ti. If that works, go with it.
* If not, go with partial explicit specialization.
*/
if (!se.findTempDecl(sc) || !ti.semanticTiargs(sc))
return setError();
if (ti.needsTypeInference(sc, 1))
{
/* Go with partial explicit specialization
*/
tiargs = ti.tiargs;
assert(ti.tempdecl);
if (TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration())
exp.e1 = new DotTemplateExp(exp.loc, se.e1, td);
else if (OverDeclaration od = ti.tempdecl.isOverDeclaration())
{
exp.e1 = new DotVarExp(exp.loc, se.e1, od, true);
}
else
exp.e1 = new DotExp(exp.loc, se.e1, new OverExp(exp.loc, ti.tempdecl.isOverloadSet()));
}
else
{
Expression e1x = exp.e1.expressionSemantic(sc);
if (e1x.op == EXP.error)
{
result = e1x;
return;
}
exp.e1 = e1x;
}
}
}
Type att = null;
Lagain:
//printf("Lagain: %s\n", toChars());
exp.f = null;
if (exp.e1.op == EXP.this_ || exp.e1.op == EXP.super_)
{
// semantic() run later for these
}
else
{
if (DotIdExp die = exp.e1.isDotIdExp())
{
exp.e1 = die.expressionSemantic(sc);
/* Look for e1 having been rewritten to expr.opDispatch!(string)
* We handle such earlier, so go back.
* Note that in the rewrite, we carefully did not run semantic() on e1
*/
if (exp.e1.op == EXP.dotTemplateInstance)
{
goto Ldotti;
}
}
else
{
__gshared int nest;
if (++nest > global.recursionLimit)
{
exp.error("recursive evaluation of `%s`", exp.toChars());
--nest;
return setError();
}
Expression ex = unaSemantic(exp, sc);
--nest;
if (ex)
{
result = ex;
return;
}
}
/* Look for e1 being a lazy parameter
*/
if (VarExp ve = exp.e1.isVarExp())
{
if (ve.var.storage_class & STC.lazy_)
{
// lazy parameters can be called without violating purity and safety
Type tw = ve.var.type;
Type tc = ve.var.type.substWildTo(MODFlags.const_);
auto tf = new TypeFunction(ParameterList(), tc, LINK.d, STC.safe | STC.pure_);
(tf = cast(TypeFunction)tf.typeSemantic(exp.loc, sc)).next = tw; // hack for bug7757
auto t = new TypeDelegate(tf);
ve.type = t.typeSemantic(exp.loc, sc);
}
VarDeclaration v = ve.var.isVarDeclaration();
if (v && ve.checkPurity(sc, v))
return setError();
}
if (exp.e1.op == EXP.symbolOffset && (cast(SymOffExp)exp.e1).hasOverloads)
{
SymOffExp se = cast(SymOffExp)exp.e1;
exp.e1 = new VarExp(se.loc, se.var, true);
exp.e1 = exp.e1.expressionSemantic(sc);
}
else if (DotExp de = exp.e1.isDotExp())
{
if (de.e2.op == EXP.overloadSet)
{
ethis = de.e1;
tthis = de.e1.type;
exp.e1 = de.e2;
}
}
else if (exp.e1.op == EXP.star && exp.e1.type.ty == Tfunction)
{
// Rewrite (*fp)(arguments) to fp(arguments)
exp.e1 = (cast(PtrExp)exp.e1).e1;
}
else if (exp.e1.op == EXP.type && (sc && sc.flags & SCOPE.Cfile))
{
const numArgs = exp.arguments ? exp.arguments.length : 0;
/* Ambiguous cases arise from CParser where there is not enough
* information to determine if we have a function call or declaration.
* type-name ( identifier ) ;
* identifier ( identifier ) ;
* If exp.e1 is a type-name, then this is a declaration. C11 does not
* have type construction syntax, so don't convert this to a cast().
*/
if (numArgs == 1)
{
Expression arg = (*exp.arguments)[0];
if (auto ie = (*exp.arguments)[0].isIdentifierExp())
{
TypeExp te = cast(TypeExp)exp.e1;
auto initializer = new VoidInitializer(ie.loc);
Dsymbol s = new VarDeclaration(ie.loc, te.type, ie.ident, initializer);
auto decls = new Dsymbols(1);
(*decls)[0] = s;
s = new LinkDeclaration(s.loc, LINK.c, decls);
result = new DeclarationExp(exp.loc, s);
result = result.expressionSemantic(sc);
}
else
{
arg.error("identifier or `(` expected");
result = ErrorExp.get();
}
return;
}
exp.error("identifier or `(` expected before `)`");
result = ErrorExp.get();
return;
}
}
Type t1 = exp.e1.type ? exp.e1.type.toBasetype() : null;
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
if (arrayExpressionSemantic(exp.arguments.peekSlice(), sc) ||
preFunctionParameters(sc, exp.argumentList))
return setError();
// Check for call operator overload
if (t1)
{
if (t1.ty == Tstruct)
{
auto sd = (cast(TypeStruct)t1).sym;
sd.size(exp.loc); // Resolve forward references to construct object
if (sd.sizeok != Sizeok.done)
return setError();
if (!sd.ctor)
sd.ctor = sd.searchCtor();
/* If `sd.ctor` is a generated copy constructor, this means that it
is the single constructor that this struct has. In order to not
disable default construction, the ctor is nullified. The side effect
of this is that the generated copy constructor cannot be called
explicitly, but that is ok, because when calling a constructor the
default constructor should have priority over the generated copy
constructor.
*/
if (sd.ctor)
{
auto ctor = sd.ctor.isCtorDeclaration();
if (ctor && ctor.isCpCtor && ctor.isGenerated())
sd.ctor = null;
}
// First look for constructor
if (exp.e1.op == EXP.type && sd.ctor)
{
if (!sd.noDefaultCtor && !(exp.arguments && exp.arguments.length))
goto Lx;
/* https://issues.dlang.org/show_bug.cgi?id=20695
If all constructors are copy constructors, then
try default construction.
*/
if (!sd.hasRegularCtor &&
// https://issues.dlang.org/show_bug.cgi?id=22639
// we might still have a copy constructor that could be called
(*exp.arguments)[0].type.mutableOf != sd.type.mutableOf())
goto Lx;
auto sle = new StructLiteralExp(exp.loc, sd, null, exp.e1.type);
if (!sd.fill(exp.loc, *sle.elements, true))
return setError();
if (checkFrameAccess(exp.loc, sc, sd, sle.elements.length))
return setError();
// https://issues.dlang.org/show_bug.cgi?id=14556
// Set concrete type to avoid further redundant semantic().
sle.type = exp.e1.type;
/* Constructor takes a mutable object, so don't use
* the immutable initializer symbol.
*/
sle.useStaticInit = false;
Expression e = sle;
if (auto cf = sd.ctor.isCtorDeclaration())
{
e = new DotVarExp(exp.loc, e, cf, true);
}
else if (auto td = sd.ctor.isTemplateDeclaration())
{
e = new DotIdExp(exp.loc, e, td.ident);
}
else if (auto os = sd.ctor.isOverloadSet())
{
e = new DotExp(exp.loc, e, new OverExp(exp.loc, os));
}
else
assert(0);
e = new CallExp(exp.loc, e, exp.arguments);
e = e.expressionSemantic(sc);
result = e;
return;
}
// No constructor, look for overload of opCall
if (search_function(sd, Id.call))
goto L1;
// overload of opCall, therefore it's a call
if (exp.e1.op != EXP.type)
{
if (sd.aliasthis && !isRecursiveAliasThis(att, exp.e1.type))
{
exp.e1 = resolveAliasThis(sc, exp.e1);
goto Lagain;
}
exp.error("%s `%s` does not overload ()", sd.kind(), sd.toChars());
return setError();
}
/* It's a struct literal
*/
Lx:
Expressions* resolvedArgs = exp.arguments;
if (exp.names)
{
resolvedArgs = resolveStructLiteralNamedArgs(sd, exp.e1.type, sc, exp.loc,
(*exp.names)[],
(size_t i, Type t) => (*exp.arguments)[i],
i => (*exp.arguments)[i].loc
);
if (!resolvedArgs)
{
result = ErrorExp.get();
return;
}
}
Expression e = new StructLiteralExp(exp.loc, sd, resolvedArgs, exp.e1.type);
e = e.expressionSemantic(sc);
result = e;
return;
}
else if (t1.ty == Tclass)
{
L1:
// Rewrite as e1.call(arguments)
Expression e = new DotIdExp(exp.loc, exp.e1, Id.call);
e = new CallExp(exp.loc, e, exp.arguments, exp.names);
e = e.expressionSemantic(sc);
result = e;
return;
}
else if (exp.e1.op == EXP.type && t1.isscalar())
{
Expression e;
// Make sure to use the enum type itself rather than its
// base type
// https://issues.dlang.org/show_bug.cgi?id=16346
if (exp.e1.type.ty == Tenum)
{
t1 = exp.e1.type;
}
if (!exp.arguments || exp.arguments.length == 0)
{
e = t1.defaultInitLiteral(exp.loc);
}
else if (exp.arguments.length == 1)
{
e = (*exp.arguments)[0];
e = e.implicitCastTo(sc, t1);
e = new CastExp(exp.loc, e, t1);
}
else
{
exp.error("more than one argument for construction of `%s`", t1.toChars());
return setError();
}
e = e.expressionSemantic(sc);
result = e;
return;
}
}
FuncDeclaration resolveOverloadSet(Loc loc, Scope* sc,
OverloadSet os, Objects* tiargs, Type tthis, ArgumentList argumentList)
{
FuncDeclaration f = null;
foreach (s; os.a)
{
if (tiargs && s.isFuncDeclaration())
continue;
if (auto f2 = resolveFuncCall(loc, sc, s, tiargs, tthis, argumentList, FuncResolveFlag.quiet))
{
if (f2.errors)
return null;
if (f)
{
/* Match in more than one overload set,
* even if one is a 'better' match than the other.
*/
if (f.isCsymbol() && f2.isCsymbol())
{
/* C has global name space, so just pick one, such as f.
* If f and f2 are not compatible, that's how C rolls.
*/
}
else
ScopeDsymbol.multiplyDefined(loc, f, f2); // issue error
}
else
f = f2;
}
}
if (!f)
{
.error(loc, "no overload matches for `%s`", exp.toChars());
errorSupplemental(loc, "Candidates are:");
foreach (s; os.a)
{
overloadApply(s, (ds){
if (auto fd = ds.isFuncDeclaration())
.errorSupplemental(ds.loc, "%s%s", fd.toChars(),
fd.type.toTypeFunction().parameterList.parametersTypeToChars());
else
.errorSupplemental(ds.loc, "%s", ds.toChars());
return 0;
});
}
}
else if (f.errors)
f = null;
return f;
}
bool isSuper = false;
if (exp.e1.op == EXP.dotVariable && t1.ty == Tfunction || exp.e1.op == EXP.dotTemplateDeclaration)
{
UnaExp ue = cast(UnaExp)exp.e1;
Expression ue1old = ue.e1; // need for 'right this' check
DotVarExp dve;
DotTemplateExp dte;
Dsymbol s;
if (exp.e1.op == EXP.dotVariable)
{
dve = cast(DotVarExp)exp.e1;
dte = null;
s = dve.var;
tiargs = null;
}
else
{
dve = null;
dte = cast(DotTemplateExp)exp.e1;
s = dte.td;
}
// Do overload resolution
exp.f = resolveFuncCall(exp.loc, sc, s, tiargs, ue.e1.type, exp.argumentList, FuncResolveFlag.standard);
if (!exp.f || exp.f.errors || exp.f.type.ty == Terror)
return setError();
if (exp.f.interfaceVirtual)
{
/* Cast 'this' to the type of the interface, and replace f with the interface's equivalent
*/
auto b = exp.f.interfaceVirtual;
auto ad2 = b.sym;
ue.e1 = ue.e1.castTo(sc, ad2.type.addMod(ue.e1.type.mod));
ue.e1 = ue.e1.expressionSemantic(sc);
auto vi = exp.f.findVtblIndex(&ad2.vtbl, cast(int)ad2.vtbl.length);
assert(vi >= 0);
exp.f = ad2.vtbl[vi].isFuncDeclaration();
assert(exp.f);
}
if (exp.f.needThis())
{
AggregateDeclaration ad = exp.f.isMemberLocal();
ue.e1 = getRightThis(exp.loc, sc, ad, ue.e1, exp.f);
if (ue.e1.op == EXP.error)
{
result = ue.e1;
return;
}
ethis = ue.e1;
tthis = ue.e1.type;
if (!(exp.f.type.ty == Tfunction && (cast(TypeFunction)exp.f.type).isScopeQual))
{
if (checkParamArgumentEscape(sc, exp.f, Id.This, exp.f.vthis, STC.undefined_, ethis, false, false))
return setError();
}
}
/* Cannot call public functions from inside invariant
* (because then the invariant would have infinite recursion)
*/
if (sc.func && sc.func.isInvariantDeclaration() && ue.e1.op == EXP.this_ && exp.f.addPostInvariant())
{
exp.error("cannot call `public`/`export` function `%s` from invariant", exp.f.toChars());
return setError();
}
if (!exp.ignoreAttributes)
checkFunctionAttributes(exp, sc, exp.f);
// Cut-down version of checkAccess() that doesn't use the "most visible" version of exp.f.
// We've already selected an overload here.
const parent = exp.f.toParent();
if (parent && parent.isTemplateInstance())
{
// already a deprecation
}
else if (!checkSymbolAccess(sc, exp.f))
{
exp.error("%s `%s` of type `%s` is not accessible from module `%s`",
exp.f.kind(), exp.f.toPrettyChars(), exp.f.type.toChars(), sc._module.toChars);
return setError();
}
if (!exp.f.needThis())
{
exp.e1 = Expression.combine(ue.e1, new VarExp(exp.loc, exp.f, false));
}
else
{
if (ue1old.checkRightThis(sc))
return setError();
if (exp.e1.op == EXP.dotVariable)
{
dve.var = exp.f;
exp.e1.type = exp.f.type;
}
else
{
exp.e1 = new DotVarExp(exp.loc, dte.e1, exp.f, false);
exp.e1 = exp.e1.expressionSemantic(sc);
if (exp.e1.op == EXP.error)
return setError();
ue = cast(UnaExp)exp.e1;
}
version (none)
{
printf("ue.e1 = %s\n", ue.e1.toChars());
printf("f = %s\n", exp.f.toChars());
printf("t1 = %s\n", t1.toChars());
printf("e1 = %s\n", exp.e1.toChars());
printf("e1.type = %s\n", exp.e1.type.toChars());
}
// See if we need to adjust the 'this' pointer
AggregateDeclaration ad = exp.f.isThis();
ClassDeclaration cd = ue.e1.type.isClassHandle();
if (ad && cd && ad.isClassDeclaration())
{
if (ue.e1.op == EXP.dotType)
{
ue.e1 = (cast(DotTypeExp)ue.e1).e1;
exp.directcall = true;
}
else if (ue.e1.op == EXP.super_)
exp.directcall = true;
else if ((cd.storage_class & STC.final_) != 0) // https://issues.dlang.org/show_bug.cgi?id=14211
exp.directcall = true;
if (ad != cd)
{
ue.e1 = ue.e1.castTo(sc, ad.type.addMod(ue.e1.type.mod));
ue.e1 = ue.e1.expressionSemantic(sc);
}
}
}
// If we've got a pointer to a function then deference it
// https://issues.dlang.org/show_bug.cgi?id=16483
if (exp.e1.type.isPtrToFunction())
{
Expression e = new PtrExp(exp.loc, exp.e1);
e.type = exp.e1.type.nextOf();
exp.e1 = e;
}
t1 = exp.e1.type;
}
else if (exp.e1.op == EXP.super_ || exp.e1.op == EXP.this_)
{
auto ad = sc.func ? sc.func.isThis() : null;
auto cd = ad ? ad.isClassDeclaration() : null;
isSuper = exp.e1.op == EXP.super_;
if (isSuper)
{
// Base class constructor call
if (!cd || !cd.baseClass || !sc.func.isCtorDeclaration())
{
exp.error("super class constructor call must be in a constructor");
return setError();
}
if (!cd.baseClass.ctor)
{
exp.error("no super class constructor for `%s`", cd.baseClass.toChars());
return setError();
}
}
else
{
// `this` call expression must be inside a
// constructor
if (!ad || !sc.func.isCtorDeclaration())
{
exp.error("constructor call must be in a constructor");
return setError();
}
// https://issues.dlang.org/show_bug.cgi?id=18719
// If `exp` is a call expression to another constructor
// then it means that all struct/class fields will be
// initialized after this call.
foreach (ref field; sc.ctorflow.fieldinit)
{
field.csx |= CSX.this_ctor;
}
}
if (!sc.intypeof && !(sc.ctorflow.callSuper & CSX.halt))
{
if (sc.inLoop || sc.ctorflow.callSuper & CSX.label)
exp.error("constructor calls not allowed in loops or after labels");
if (sc.ctorflow.callSuper & (CSX.super_ctor | CSX.this_ctor))
exp.error("multiple constructor calls");
if ((sc.ctorflow.callSuper & CSX.return_) && !(sc.ctorflow.callSuper & CSX.any_ctor))
exp.error("an earlier `return` statement skips constructor");
sc.ctorflow.callSuper |= CSX.any_ctor | (isSuper ? CSX.super_ctor : CSX.this_ctor);
}
tthis = ad.type.addMod(sc.func.type.mod);
auto ctor = isSuper ? cd.baseClass.ctor : ad.ctor;
if (auto os = ctor.isOverloadSet())
exp.f = resolveOverloadSet(exp.loc, sc, os, null, tthis, exp.argumentList);
else
exp.f = resolveFuncCall(exp.loc, sc, ctor, null, tthis, exp.argumentList, FuncResolveFlag.standard);
if (!exp.f || exp.f.errors)
return setError();
checkFunctionAttributes(exp, sc, exp.f);
checkAccess(exp.loc, sc, null, exp.f);
exp.e1 = new DotVarExp(exp.e1.loc, exp.e1, exp.f, false);
exp.e1 = exp.e1.expressionSemantic(sc);
// https://issues.dlang.org/show_bug.cgi?id=21095
if (exp.e1.op == EXP.error)
return setError();
t1 = exp.e1.type;
// BUG: this should really be done by checking the static
// call graph
if (exp.f == sc.func)
{
exp.error("cyclic constructor call");
return setError();
}
}
else if (auto oe = exp.e1.isOverExp())
{
exp.f = resolveOverloadSet(exp.loc, sc, oe.vars, tiargs, tthis, exp.argumentList);
if (!exp.f)
return setError();
if (ethis)
exp.e1 = new DotVarExp(exp.loc, ethis, exp.f, false);
else
exp.e1 = new VarExp(exp.loc, exp.f, false);
goto Lagain;
}
else if (!t1)
{
exp.error("function expected before `()`, not `%s`", exp.e1.toChars());
return setError();
}
else if (t1.ty == Terror)
{
return setError();
}
else if (t1.ty != Tfunction)
{
TypeFunction tf;
const(char)* p;
Dsymbol s;
exp.f = null;
if (auto fe = exp.e1.isFuncExp())
{
// function literal that direct called is always inferred.
assert(fe.fd);
exp.f = fe.fd;
tf = cast(TypeFunction)exp.f.type;
p = "function literal";
}
else if (t1.ty == Tdelegate)
{
TypeDelegate td = cast(TypeDelegate)t1;
assert(td.next.ty == Tfunction);
tf = cast(TypeFunction)td.next;
p = "delegate";
}
else if (auto tfx = t1.isPtrToFunction())
{
tf = tfx;
p = "function pointer";
}
else if (exp.e1.op == EXP.dotVariable && (cast(DotVarExp)exp.e1).var.isOverDeclaration())
{
DotVarExp dve = cast(DotVarExp)exp.e1;
exp.f = resolveFuncCall(exp.loc, sc, dve.var, tiargs, dve.e1.type, exp.argumentList, FuncResolveFlag.overloadOnly);
if (!exp.f)
return setError();
if (exp.f.needThis())
{
dve.var = exp.f;
dve.type = exp.f.type;
dve.hasOverloads = false;
goto Lagain;
}
exp.e1 = new VarExp(dve.loc, exp.f, false);
Expression e = new CommaExp(exp.loc, dve.e1, exp);
result = e.expressionSemantic(sc);
return;
}
else if (exp.e1.op == EXP.variable && (cast(VarExp)exp.e1).var.isOverDeclaration())
{
s = (cast(VarExp)exp.e1).var;
goto L2;
}
else if (exp.e1.op == EXP.template_)
{
s = (cast(TemplateExp)exp.e1).td;
L2:
exp.f = resolveFuncCall(exp.loc, sc, s, tiargs, null, exp.argumentList,
exp.isUfcsRewrite ? FuncResolveFlag.ufcs : FuncResolveFlag.standard);
if (!exp.f || exp.f.errors)
return setError();
if (exp.f.needThis())
{
if (hasThis(sc))
{
// Supply an implicit 'this', as in
// this.ident
exp.e1 = new DotVarExp(exp.loc, (new ThisExp(exp.loc)).expressionSemantic(sc), exp.f, false);
goto Lagain;
}
else if (isNeedThisScope(sc, exp.f))
{
return needThisError(exp.loc, exp.f);
}
}
exp.e1 = new VarExp(exp.e1.loc, exp.f, false);
goto Lagain;
}
else
{
exp.error("function expected before `()`, not `%s` of type `%s`", exp.e1.toChars(), exp.e1.type.toChars());
return setError();
}
const(char)* failMessage;
if (!tf.callMatch(null, exp.argumentList, 0, &failMessage, sc))
{
OutBuffer buf;
buf.writeByte('(');
argExpTypesToCBuffer(&buf, exp.arguments);
buf.writeByte(')');
if (tthis)
tthis.modToBuffer(&buf);
//printf("tf = %s, args = %s\n", tf.deco, (*arguments)[0].type.deco);
.error(exp.loc, "%s `%s%s` is not callable using argument types `%s`",
p, exp.e1.toChars(), parametersTypeToChars(tf.parameterList), buf.peekChars());
if (failMessage)
errorSupplemental(exp.loc, "%s", failMessage);
return setError();
}
// Purity and safety check should run after testing arguments matching
if (exp.f)
{
exp.checkPurity(sc, exp.f);
exp.checkSafety(sc, exp.f);
exp.checkNogc(sc, exp.f);
if (exp.f.checkNestedReference(sc, exp.loc))
return setError();
}
else if (sc.func && sc.intypeof != 1 && !(sc.flags & (SCOPE.ctfe | SCOPE.debug_)))
{
bool err = false;
if (!tf.purity && sc.func.setImpure(exp.loc, "`pure` %s `%s` cannot call impure `%s`", exp.e1))
{
exp.error("`pure` %s `%s` cannot call impure %s `%s`",
sc.func.kind(), sc.func.toPrettyChars(), p, exp.e1.toChars());
err = true;
}
if (!tf.isnogc && sc.func.setGC(exp.loc, "`@nogc` %s `%s` cannot call non-@nogc `%s`", exp.e1))
{
exp.error("`@nogc` %s `%s` cannot call non-@nogc %s `%s`",
sc.func.kind(), sc.func.toPrettyChars(), p, exp.e1.toChars());
err = true;
}
if (tf.trust <= TRUST.system && sc.setUnsafe(true, exp.loc,
"`@safe` function `%s` cannot call `@system` `%s`", sc.func, exp.e1))
{
exp.error("`@safe` %s `%s` cannot call `@system` %s `%s`",
sc.func.kind(), sc.func.toPrettyChars(), p, exp.e1.toChars());
err = true;
}
if (err)
return setError();
}
if (t1.ty == Tpointer)
{
Expression e = new PtrExp(exp.loc, exp.e1);
e.type = tf;
exp.e1 = e;
}
t1 = tf;
}
else if (VarExp ve = exp.e1.isVarExp())
{
// Do overload resolution
exp.f = ve.var.isFuncDeclaration();
assert(exp.f);
tiargs = null;
if (exp.f.overnext)
exp.f = resolveFuncCall(exp.loc, sc, exp.f, tiargs, null, exp.argumentList, FuncResolveFlag.overloadOnly);
else
{
exp.f = exp.f.toAliasFunc();
TypeFunction tf = cast(TypeFunction)exp.f.type;
const(char)* failMessage;
if (!tf.callMatch(null, exp.argumentList, 0, &failMessage, sc))
{
OutBuffer buf;
buf.writeByte('(');
argExpTypesToCBuffer(&buf, exp.arguments);
buf.writeByte(')');
//printf("tf = %s, args = %s\n", tf.deco, (*arguments)[0].type.deco);
if (exp.isUfcsRewrite)
{
const arg = (*exp.argumentList.arguments)[0];
.error(exp.loc, "no property `%s` for `%s` of type `%s`", exp.f.ident.toChars(), arg.toChars(), arg.type.toChars());
.errorSupplemental(exp.loc, "the following error occured while looking for a UFCS match");
}
.error(exp.loc, "%s `%s%s` is not callable using argument types `%s`",
exp.f.kind(), exp.f.toPrettyChars(), parametersTypeToChars(tf.parameterList), buf.peekChars());
if (failMessage)
errorSupplemental(exp.loc, "%s", failMessage);
exp.f = null;
}
}
if (!exp.f || exp.f.errors)
return setError();
if (exp.f.needThis())
{
// Change the ancestor lambdas to delegate before hasThis(sc) call.
if (exp.f.checkNestedReference(sc, exp.loc))
return setError();
auto memberFunc = hasThis(sc);
if (memberFunc && haveSameThis(memberFunc, exp.f))
{
// Supply an implicit 'this', as in
// this.ident
exp.e1 = new DotVarExp(exp.loc, (new ThisExp(exp.loc)).expressionSemantic(sc), ve.var);
// Note: we cannot use f directly, because further overload resolution
// through the supplied 'this' may cause different result.
goto Lagain;
}
else if (isNeedThisScope(sc, exp.f))
{
// At this point it is possible that `exp.f` had an ambiguity error that was
// silenced because the previous call to `resolveFuncCall` was done using
// `FuncResolveFlag.overloadOnly`. To make sure that a proper error message
// is printed, redo the call with `FuncResolveFlag.standard`.
//
// https://issues.dlang.org/show_bug.cgi?id=22157
if (exp.f.overnext)
exp.f = resolveFuncCall(exp.loc, sc, exp.f, tiargs, null, exp.argumentList, FuncResolveFlag.standard);
if (!exp.f || exp.f.errors)
return setError();
// If no error is printed, it means that `f` is the single matching overload
// and it needs `this`.
return needThisError(exp.loc, exp.f);
}
}
checkFunctionAttributes(exp, sc, exp.f);
checkAccess(exp.loc, sc, null, exp.f);
if (exp.f.checkNestedReference(sc, exp.loc))
return setError();
ethis = null;
tthis = null;
if (ve.hasOverloads)
{
exp.e1 = new VarExp(ve.loc, exp.f, false);
exp.e1.type = exp.f.type;
}
t1 = exp.f.type;
}
assert(t1.ty == Tfunction);
Expression argprefix;
if (!exp.arguments)
exp.arguments = new Expressions();
if (functionParameters(exp.loc, sc, cast(TypeFunction)t1, ethis, tthis, exp.argumentList, exp.f, &exp.type, &argprefix))
return setError();
if (!exp.type)
{
exp.e1 = e1org; // https://issues.dlang.org/show_bug.cgi?id=10922
// avoid recursive expression printing
exp.error("forward reference to inferred return type of function call `%s`", exp.toChars());
return setError();
}
if (exp.f && exp.f.tintro)
{
Type t = exp.type;
int offset = 0;
TypeFunction tf = cast(TypeFunction)exp.f.tintro;
if (tf.next.isBaseOf(t, &offset) && offset)
{
exp.type = tf.next;
result = Expression.combine(argprefix, exp.castTo(sc, t));
return;
}
}
// Handle the case of a direct lambda call
if (exp.f && exp.f.isFuncLiteralDeclaration() && sc.func && !sc.intypeof)
{
exp.f.tookAddressOf = 0;
}
result = Expression.combine(argprefix, exp);
if (isSuper)
{
auto ad = sc.func ? sc.func.isThis() : null;
auto cd = ad ? ad.isClassDeclaration() : null;
if (cd && cd.classKind == ClassKind.cpp && exp.f && !exp.f.fbody)
{
// if super is defined in C++, it sets the vtable pointer to the base class
// so we have to restore it, but still return 'this' from super() call:
// (auto __vptrTmp = this.__vptr, auto __superTmp = super()), (this.__vptr = __vptrTmp, __superTmp)
Loc loc = exp.loc;
auto vptr = new DotIdExp(loc, new ThisExp(loc), Id.__vptr);
auto vptrTmpDecl = copyToTemp(0, "__vptrTmp", vptr);
auto declareVptrTmp = new DeclarationExp(loc, vptrTmpDecl);
auto superTmpDecl = copyToTemp(0, "__superTmp", result);
auto declareSuperTmp = new DeclarationExp(loc, superTmpDecl);
auto declareTmps = new CommaExp(loc, declareVptrTmp, declareSuperTmp);
auto restoreVptr = new AssignExp(loc, vptr.syntaxCopy(), new VarExp(loc, vptrTmpDecl));
Expression e = new CommaExp(loc, declareTmps, new CommaExp(loc, restoreVptr, new VarExp(loc, superTmpDecl)));
result = e.expressionSemantic(sc);
}
}
// declare dual-context container
if (exp.f && exp.f.hasDualContext() && !sc.intypeof && sc.func)
{
// check access to second `this`
if (AggregateDeclaration ad2 = exp.f.isMember2())
{
Expression te = new ThisExp(exp.loc).expressionSemantic(sc);
if (te.op != EXP.error)
te = getRightThis(exp.loc, sc, ad2, te, exp.f);
if (te.op == EXP.error)
{
exp.error("need `this` of type `%s` to call function `%s`", ad2.toChars(), exp.f.toChars());
return setError();
}
}
exp.vthis2 = makeThis2Argument(exp.loc, sc, exp.f);
Expression de = new DeclarationExp(exp.loc, exp.vthis2);
result = Expression.combine(de, result);
result = result.expressionSemantic(sc);
}
}
override void visit(DeclarationExp e)
{
if (e.type)
{
result = e;
return;
}
static if (LOGSEMANTIC)
{
printf("DeclarationExp::semantic() %s\n", e.toChars());
}
uint olderrors = global.errors;
/* This is here to support extern(linkage) declaration,
* where the extern(linkage) winds up being an AttribDeclaration
* wrapper.
*/
Dsymbol s = e.declaration;
while (1)
{
AttribDeclaration ad = s.isAttribDeclaration();
if (ad)
{
if (ad.decl && ad.decl.length == 1)
{
s = (*ad.decl)[0];
continue;
}
}
break;
}
//printf("inserting '%s' %p into sc = %p\n", s.toChars(), s, sc);
// Insert into both local scope and function scope.
// Must be unique in both.
if (s.ident)
{
VarDeclaration v = s.isVarDeclaration();
if (v)
{
if (sc.flags & SCOPE.Cfile)
{
/* Do semantic() on the type before inserting v into the symbol table
*/
if (!v.originalType)
v.originalType = v.type.syntaxCopy();
Scope* sc2 = sc.push();
sc2.stc |= v.storage_class & STC.FUNCATTR;
sc2.linkage = LINK.c; // account for the extern(C) in front of the declaration
v.inuse++;
v.type = v.type.typeSemantic(v.loc, sc2);
v.inuse--;
sc2.pop();
}
else
{
/* Do semantic() on initializer first so this will be illegal:
* int a = a;
*/
e.declaration.dsymbolSemantic(sc);
s.parent = sc.parent;
}
}
if (!sc.insert(s))
{
auto conflict = sc.search(Loc.initial, s.ident, null);
e.error("declaration `%s` is already defined", s.toPrettyChars());
errorSupplemental(conflict.loc, "`%s` `%s` is defined here",
conflict.kind(), conflict.toChars());
return setError();
}
if (v && (sc.flags & SCOPE.Cfile))
{
/* Do semantic() on initializer last so this will be legal:
* int a = a;
*/
e.declaration.dsymbolSemantic(sc);
s.parent = sc.parent;
}
if (sc.func)
{
// https://issues.dlang.org/show_bug.cgi?id=11720
if ((s.isFuncDeclaration() ||
s.isAggregateDeclaration() ||
s.isEnumDeclaration() ||
s.isTemplateDeclaration() ||
v
) && !sc.func.localsymtab.insert(s))
{
// Get the previous symbol
Dsymbol originalSymbol = sc.func.localsymtab.lookup(s.ident);
// Perturb the name mangling so that the symbols can co-exist
// instead of colliding
s.localNum = cast(ushort)(originalSymbol.localNum + 1);
// 65535 should be enough for anyone
if (!s.localNum)
{
e.error("more than 65535 symbols with name `%s` generated", s.ident.toChars());
return setError();
}
// Replace originalSymbol with s, which updates the localCount
sc.func.localsymtab.update(s);
// The mangling change only works for D mangling
}
if (!(sc.flags & SCOPE.Cfile))
{
/* https://issues.dlang.org/show_bug.cgi?id=21272
* If we are in a foreach body we need to extract the
* function containing the foreach
*/
FuncDeclaration fes_enclosing_func;
if (sc.func && sc.func.fes)
fes_enclosing_func = sc.enclosing.enclosing.func;
// Disallow shadowing
for (Scope* scx = sc.enclosing; scx && (scx.func == sc.func || (fes_enclosing_func && scx.func == fes_enclosing_func)); scx = scx.enclosing)
{
Dsymbol s2;
if (scx.scopesym && scx.scopesym.symtab && (s2 = scx.scopesym.symtab.lookup(s.ident)) !is null && s != s2)
{
// allow STC.local symbols to be shadowed
// TODO: not really an optimal design
auto decl = s2.isDeclaration();
if (!decl || !(decl.storage_class & STC.local))
{
if (sc.func.fes)
{
e.deprecation("%s `%s` is shadowing %s `%s`. Rename the `foreach` variable.", s.kind(), s.ident.toChars(), s2.kind(), s2.toPrettyChars());
}
else
{
e.error("%s `%s` is shadowing %s `%s`", s.kind(), s.ident.toChars(), s2.kind(), s2.toPrettyChars());
return setError();
}
}
}
}
}
}
}
if (!s.isVarDeclaration())
{
Scope* sc2 = sc;
if (sc2.stc & (STC.pure_ | STC.nothrow_ | STC.nogc))
sc2 = sc.push();
sc2.stc &= ~(STC.pure_ | STC.nothrow_ | STC.nogc);
e.declaration.dsymbolSemantic(sc2);
if (sc2 != sc)
sc2.pop();
s.parent = sc.parent;
}
if (global.errors == olderrors)
{
e.declaration.semantic2(sc);
if (global.errors == olderrors)
{
e.declaration.semantic3(sc);
}
}
// todo: error in declaration should be propagated.
e.type = Type.tvoid;
result = e;
}
override void visit(TypeidExp exp)
{
static if (LOGSEMANTIC)
{
printf("TypeidExp::semantic() %s\n", exp.toChars());
}
Type ta = isType(exp.obj);
Expression ea = isExpression(exp.obj);
Dsymbol sa = isDsymbol(exp.obj);
//printf("ta %p ea %p sa %p\n", ta, ea, sa);
if (ta)
{
dmd.typesem.resolve(ta, exp.loc, sc, ea, ta, sa, true);
}
if (ea)
{
if (auto sym = getDsymbol(ea))
ea = symbolToExp(sym, exp.loc, sc, false);
else
ea = ea.expressionSemantic(sc);
ea = resolveProperties(sc, ea);
ta = ea.type;
if (ea.op == EXP.type)
ea = null;
}
if (!ta)
{
//printf("ta %p ea %p sa %p\n", ta, ea, sa);
exp.error("no type for `typeid(%s)`", ea ? ea.toChars() : (sa ? sa.toChars() : ""));
return setError();
}
ta.checkComplexTransition(exp.loc, sc);
Expression e;
auto tb = ta.toBasetype();
if (ea && tb.ty == Tclass)
{
if (tb.toDsymbol(sc).isClassDeclaration().classKind == ClassKind.cpp)
{
error(exp.loc, "runtime type information is not supported for `extern(C++)` classes");
e = ErrorExp.get();
}
else if (!Type.typeinfoclass)
{
error(exp.loc, "`object.TypeInfo_Class` could not be found, but is implicitly used");
e = ErrorExp.get();
}
else
{
/* Get the dynamic type, which is .classinfo
*/
ea = ea.expressionSemantic(sc);
e = new TypeidExp(ea.loc, ea);
e.type = Type.typeinfoclass.type;
}
}
else if (ta.ty == Terror)
{
e = ErrorExp.get();
}
else
{
// Handle this in the glue layer
e = new TypeidExp(exp.loc, ta);
bool genObjCode = true;
// https://issues.dlang.org/show_bug.cgi?id=23650
// We generate object code for typeinfo, required
// by typeid, only if in non-speculative context
if (sc.flags & SCOPE.compile)
{
genObjCode = false;
}
e.type = getTypeInfoType(exp.loc, ta, sc, genObjCode);
semanticTypeInfo(sc, ta);
if (ea)
{
e = new CommaExp(exp.loc, ea, e); // execute ea
e = e.expressionSemantic(sc);
}
}
result = e;
}
override void visit(TraitsExp e)
{
result = semanticTraits(e, sc);
}
override void visit(HaltExp e)
{
static if (LOGSEMANTIC)
{
printf("HaltExp::semantic()\n");
}
e.type = Type.tnoreturn;
result = e;
}
override void visit(IsExp e)
{
/* is(targ id tok tspec)
* is(targ id : tok2)
* is(targ id == tok2)
*/
Type tded = null;
void yes()
{
//printf("yes\n");
if (!e.id)
{
result = IntegerExp.createBool(true);
return;
}
Dsymbol s;
Tuple tup = isTuple(tded);
if (tup)
s = new TupleDeclaration(e.loc, e.id, &tup.objects);
else
s = new AliasDeclaration(e.loc, e.id, tded);
s.dsymbolSemantic(sc);
/* The reason for the !tup is unclear. It fails Phobos unittests if it is not there.
* More investigation is needed.
*/
if (!tup && !sc.insert(s))
{
auto conflict = sc.search(Loc.initial, s.ident, null);
e.error("declaration `%s` is already defined", s.toPrettyChars());
errorSupplemental(conflict.loc, "`%s` `%s` is defined here",
conflict.kind(), conflict.toChars());
}
unSpeculative(sc, s);
result = IntegerExp.createBool(true);
}
void no()
{
result = IntegerExp.createBool(false);
//printf("no\n");
}
static if (LOGSEMANTIC)
{
printf("IsExp::semantic(%s)\n", e.toChars());
}
if (e.id && !(sc.flags & SCOPE.condition))
{
e.error("can only declare type aliases within `static if` conditionals or `static assert`s");
return setError();
}
if (e.tok2 == TOK.package_ || e.tok2 == TOK.module_) // These is() expressions are special because they can work on modules, not just types.
{
const oldErrors = global.startGagging();
Dsymbol sym = e.targ.toDsymbol(sc);
global.endGagging(oldErrors);
if (sym is null)
return no();
Package p = resolveIsPackage(sym);
if (p is null)
return no();
if (e.tok2 == TOK.package_ && p.isModule()) // Note that isModule() will return null for package modules because they're not actually instances of Module.
return no();
else if(e.tok2 == TOK.module_ && !(p.isModule() || p.isPackageMod()))
return no();
tded = e.targ;
return yes();
}
{
Scope* sc2 = sc.copy(); // keep sc.flags
sc2.tinst = null;
sc2.minst = null;
sc2.flags |= SCOPE.fullinst;
Type t = e.targ.trySemantic(e.loc, sc2);
sc2.pop();
if (!t) // errors, so condition is false
return no();
e.targ = t;
}
if (e.tok2 != TOK.reserved)
{
switch (e.tok2)
{
case TOK.struct_:
if (e.targ.ty != Tstruct)
return no();
if ((cast(TypeStruct)e.targ).sym.isUnionDeclaration())
return no();
tded = e.targ;
break;
case TOK.union_:
if (e.targ.ty != Tstruct)
return no();
if (!(cast(TypeStruct)e.targ).sym.isUnionDeclaration())
return no();
tded = e.targ;
break;
case TOK.class_:
if (e.targ.ty != Tclass)
return no();
if ((cast(TypeClass)e.targ).sym.isInterfaceDeclaration())
return no();
tded = e.targ;
break;
case TOK.interface_:
if (e.targ.ty != Tclass)
return no();
if (!(cast(TypeClass)e.targ).sym.isInterfaceDeclaration())
return no();
tded = e.targ;
break;
case TOK.const_:
if (!e.targ.isConst())
return no();
tded = e.targ;
break;
case TOK.immutable_:
if (!e.targ.isImmutable())
return no();
tded = e.targ;
break;
case TOK.shared_:
if (!e.targ.isShared())
return no();
tded = e.targ;
break;
case TOK.inout_:
if (!e.targ.isWild())
return no();
tded = e.targ;
break;
case TOK.super_:
// If class or interface, get the base class and interfaces
if (e.targ.ty != Tclass)
return no();
else
{
ClassDeclaration cd = (cast(TypeClass)e.targ).sym;
auto args = new Parameters();
args.reserve(cd.baseclasses.length);
if (cd.semanticRun < PASS.semanticdone)
cd.dsymbolSemantic(null);
for (size_t i = 0; i < cd.baseclasses.length; i++)
{
BaseClass* b = (*cd.baseclasses)[i];
args.push(new Parameter(Loc.initial, STC.in_, b.type, null, null, null));
}
tded = new TypeTuple(args);
}
break;
case TOK.enum_:
if (e.targ.ty != Tenum)
return no();
if (e.id)
tded = (cast(TypeEnum)e.targ).sym.getMemtype(e.loc);
else
tded = e.targ;
if (tded.ty == Terror)
return setError();
break;
case TOK.delegate_:
if (e.targ.ty != Tdelegate)
return no();
tded = (cast(TypeDelegate)e.targ).next; // the underlying function type
break;
case TOK.function_:
if (e.targ.ty != Tfunction)
return no();
goto case;
case TOK.parameters:
{
if (auto tf = e.targ.isFunction_Delegate_PtrToFunction())
tded = tf;
else
return no();
/* Generate tuple from function parameter types.
*/
auto args = new Parameters();
foreach (i, arg; tded.isTypeFunction().parameterList)
{
assert(arg && arg.type);
/* If one of the default arguments was an error,
don't return an invalid tuple
*/
if (e.tok2 == TOK.parameters && arg.defaultArg && arg.defaultArg.op == EXP.error)
return setError();
args.push(new Parameter(arg.loc, arg.storageClass, arg.type, (e.tok2 == TOK.parameters) ? arg.ident : null, (e.tok2 == TOK.parameters) ? arg.defaultArg : null, arg.userAttribDecl));
}
tded = new TypeTuple(args);
break;
}
case TOK.return_:
/* Get the 'return type' for the function,
* delegate, or pointer to function.
*/
if (auto tf = e.targ.isFunction_Delegate_PtrToFunction())
tded = tf.next;
else
return no();
break;
case TOK.argumentTypes:
/* Generate a type tuple of the equivalent types used to determine if a
* function argument of this type can be passed in registers.
* The results of this are highly platform dependent, and intended
* primarly for use in implementing va_arg().
*/
tded = target.toArgTypes(e.targ);
if (!tded)
return no();
// not valid for a parameter
break;
case TOK.vector:
if (e.targ.ty != Tvector)
return no();
tded = (cast(TypeVector)e.targ).basetype;
break;
default:
assert(0);
}
// https://issues.dlang.org/show_bug.cgi?id=18753
if (tded)
return yes();
return no();
}
else if (e.tspec && !e.id && !(e.parameters && e.parameters.length))
{
/* Evaluate to true if targ matches tspec
* is(targ == tspec)
* is(targ : tspec)
*/
e.tspec = e.tspec.typeSemantic(e.loc, sc);
//printf("targ = %s, %s\n", e.targ.toChars(), e.targ.deco);
//printf("tspec = %s, %s\n", e.tspec.toChars(), e.tspec.deco);
if (e.tok == TOK.colon)
{
// current scope is itself deprecated, or deprecations are not errors
const bool deprecationAllowed = sc.isDeprecated
|| global.params.useDeprecated != DiagnosticReporting.error;
const bool preventAliasThis = e.targ.hasDeprecatedAliasThis && !deprecationAllowed;
if (preventAliasThis && e.targ.ty == Tstruct)
{
if ((cast(TypeStruct) e.targ).implicitConvToWithoutAliasThis(e.tspec))
return yes();
else
return no();
}
else if (preventAliasThis && e.targ.ty == Tclass)
{
if ((cast(TypeClass) e.targ).implicitConvToWithoutAliasThis(e.tspec))
return yes();
else
return no();
}
else if (e.targ.implicitConvTo(e.tspec))
return yes();
else
return no();
}
else /* == */
{
if (e.targ.equals(e.tspec))
return yes();
else
return no();
}
}
else if (e.tspec)
{
/* Evaluate to true if targ matches tspec.
* If true, declare id as an alias for the specialized type.
* is(targ == tspec, tpl)
* is(targ : tspec, tpl)
* is(targ id == tspec)
* is(targ id : tspec)
* is(targ id == tspec, tpl)
* is(targ id : tspec, tpl)
*/
Identifier tid = e.id ? e.id : Identifier.generateId("__isexp_id");
e.parameters.insert(0, new TemplateTypeParameter(e.loc, tid, null, null));
Objects dedtypes = Objects(e.parameters.length);
dedtypes.zero();
MATCH m = deduceType(e.targ, sc, e.tspec, e.parameters, &dedtypes, null, 0, e.tok == TOK.equal);
if (m == MATCH.nomatch || (m != MATCH.exact && e.tok == TOK.equal))
{
return no();
}
else
{
tded = cast(Type)dedtypes[0];
if (!tded)
tded = e.targ;
Objects tiargs = Objects(1);
tiargs[0] = e.targ;
/* Declare trailing parameters
*/
for (size_t i = 1; i < e.parameters.length; i++)
{
TemplateParameter tp = (*e.parameters)[i];
Declaration s = null;
m = tp.matchArg(e.loc, sc, &tiargs, i, e.parameters, &dedtypes, &s);
if (m == MATCH.nomatch)
return no();
s.dsymbolSemantic(sc);
if (!sc.insert(s))
{
auto conflict = sc.search(Loc.initial, s.ident, null);
e.error("declaration `%s` is already defined", s.toPrettyChars());
errorSupplemental(conflict.loc, "`%s` `%s` is defined here",
conflict.kind(), conflict.toChars());
}
unSpeculative(sc, s);
}
return yes();
}
}
else if (e.id)
{
/* Declare id as an alias for type targ. Evaluate to true
* is(targ id)
*/
tded = e.targ;
}
return yes();
}
override void visit(BinAssignExp exp)
{
if (exp.type)
{
result = exp;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.e1.op == EXP.arrayLength)
{
// arr.length op= e2;
e = rewriteOpAssign(exp);
e = e.expressionSemantic(sc);
result = e;
return;
}
if (exp.e1.op == EXP.slice || exp.e1.type.ty == Tarray || exp.e1.type.ty == Tsarray)
{
if (checkNonAssignmentArrayOp(exp.e1))
return setError();
if (exp.e1.op == EXP.slice)
(cast(SliceExp)exp.e1).arrayop = true;
// T[] op= ...
if (exp.e2.implicitConvTo(exp.e1.type.nextOf()))
{
// T[] op= T
exp.e2 = exp.e2.castTo(sc, exp.e1.type.nextOf());
}
else if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
exp.type = exp.e1.type;
result = arrayOp(exp, sc);
return;
}
exp.e1 = exp.e1.expressionSemantic(sc);
exp.e1 = exp.e1.modifiableLvalue(sc, exp.e1);
exp.e1 = exp.e1.optimize(WANTvalue, /*keepLvalue*/ true);
exp.type = exp.e1.type;
if (auto ad = isAggregate(exp.e1.type))
{
if (const s = search_function(ad, Id.opOpAssign))
{
error(exp.loc, "none of the `opOpAssign` overloads of `%s` are callable for `%s` of type `%s`", ad.toChars(), exp.e1.toChars(), exp.e1.type.toChars());
return setError();
}
}
if (exp.e1.checkScalar() ||
exp.e1.checkReadModifyWrite(exp.op, exp.e2) ||
exp.e1.checkSharedAccess(sc))
return setError();
int arith = (exp.op == EXP.addAssign || exp.op == EXP.minAssign || exp.op == EXP.mulAssign || exp.op == EXP.divAssign || exp.op == EXP.modAssign || exp.op == EXP.powAssign);
int bitwise = (exp.op == EXP.andAssign || exp.op == EXP.orAssign || exp.op == EXP.xorAssign);
int shift = (exp.op == EXP.leftShiftAssign || exp.op == EXP.rightShiftAssign || exp.op == EXP.unsignedRightShiftAssign);
if (bitwise && exp.type.toBasetype().ty == Tbool)
exp.e2 = exp.e2.implicitCastTo(sc, exp.type);
else if (exp.checkNoBool())
return setError();
if ((exp.op == EXP.addAssign || exp.op == EXP.minAssign) && exp.e1.type.toBasetype().ty == Tpointer && exp.e2.type.toBasetype().isintegral())
{
result = scaleFactor(exp, sc);
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
if (arith && (exp.checkArithmeticBin() || exp.checkSharedAccessBin(sc)))
return setError();
if ((bitwise || shift) && (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc)))
return setError();
if (shift)
{
if (exp.e2.type.toBasetype().ty != Tvector)
exp.e2 = exp.e2.castTo(sc, Type.tshiftcnt);
}
if (!target.isVectorOpSupported(exp.type.toBasetype(), exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
if (exp.e1.op == EXP.error || exp.e2.op == EXP.error)
return setError();
e = exp.checkOpAssignTypes(sc);
if (e.op == EXP.error)
{
result = e;
return;
}
assert(e.op == EXP.assign || e == exp);
result = (cast(BinExp)e).reorderSettingAAElem(sc);
}
private Expression compileIt(MixinExp exp)
{
OutBuffer buf;
if (expressionsToString(buf, sc, exp.exps))
return null;
uint errors = global.errors;
const len = buf.length;
const str = buf.extractChars()[0 .. len];
const bool doUnittests = global.params.useUnitTests || global.params.ddoc.doOutput || global.params.dihdr.doOutput;
auto loc = adjustLocForMixin(str, exp.loc, global.params.mixinOut);
scope p = new Parser!ASTCodegen(loc, sc._module, str, false, global.errorSink, &global.compileEnv, doUnittests);
p.transitionIn = global.params.vin;
p.nextToken();
//printf("p.loc.linnum = %d\n", p.loc.linnum);
Expression e = p.parseExpression();
if (global.errors != errors)
return null;
if (p.token.value != TOK.endOfFile)
{
e.error("unexpected token `%s` after %s expression",
p.token.toChars(), EXPtoString(e.op).ptr);
e.errorSupplemental("while parsing string mixin expression `%s`",
str.ptr);
return null;
}
return e;
}
override void visit(MixinExp exp)
{
/* https://dlang.org/spec/expression.html#mixin_expressions
*/
static if (LOGSEMANTIC)
{
printf("MixinExp::semantic('%s')\n", exp.toChars());
}
auto e = compileIt(exp);
if (!e)
return setError();
result = e.expressionSemantic(sc);
}
override void visit(ImportExp e)
{
static if (LOGSEMANTIC)
{
printf("ImportExp::semantic('%s')\n", e.toChars());
}
auto se = semanticString(sc, e.e1, "file name argument");
if (!se)
return setError();
se = se.toUTF8(sc);
auto namez = se.toStringz();
if (!global.filePath)
{
e.error("need `-J` switch to import text file `%s`", namez.ptr);
return setError();
}
/* Be wary of CWE-22: Improper Limitation of a Pathname to a Restricted Directory
* ('Path Traversal') attacks.
* https://cwe.mitre.org/data/definitions/22.html
*/
if (FileName.absolute(namez))
{
e.error("absolute path is not allowed in import expression: `%s`", se.toChars());
return setError();
}
auto idxReserved = FileName.findReservedChar(namez);
if (idxReserved != size_t.max)
{
e.error("`%s` is not a valid filename on this platform", se.toChars());
e.errorSupplemental("Character `'%c'` is reserved and cannot be used", namez[idxReserved]);
return setError();
}
if (FileName.refersToParentDir(namez))
{
e.error("path refers to parent (`..`) directory: `%s`", se.toChars());
return setError();
}
auto resolvedNamez = FileName.searchPath(global.filePath, namez, false);
if (!resolvedNamez)
{
e.error("file `%s` cannot be found or not in a path specified with `-J`", se.toChars());
e.errorSupplemental("Path(s) searched (as provided by `-J`):");
foreach (idx, path; *global.filePath)
{
const attr = FileName.exists(path);
const(char)* err = attr == 2 ? "" :
(attr == 1 ? " (not a directory)" : " (path not found)");
e.errorSupplemental("[%llu]: `%s`%s", cast(ulong)idx, path, err);
}
return setError();
}
sc._module.contentImportedFiles.push(resolvedNamez.ptr);
if (global.params.verbose)
{
const slice = se.peekString();
message("file %.*s\t(%s)", cast(int)slice.length, slice.ptr, resolvedNamez.ptr);
}
if (global.params.moduleDeps.buffer !is null)
{
OutBuffer* ob = global.params.moduleDeps.buffer;
Module imod = sc._module;
if (!global.params.moduleDeps.name)
ob.writestring("depsFile ");
ob.writestring(imod.toPrettyChars());
ob.writestring(" (");
escapePath(ob, imod.srcfile.toChars());
ob.writestring(") : ");
if (global.params.moduleDeps.name)
ob.writestring("string : ");
ob.write(se.peekString());
ob.writestring(" (");
escapePath(ob, resolvedNamez.ptr);
ob.writestring(")");
ob.writenl();
}
if (global.params.makeDeps.doOutput)
{
global.params.makeDeps.files.push(resolvedNamez.ptr);
}
{
auto fileName = FileName(resolvedNamez);
if (auto fmResult = global.fileManager.lookup(fileName))
{
se = new StringExp(e.loc, fmResult);
}
else
{
e.error("cannot read file `%s`", resolvedNamez.ptr);
return setError();
}
}
result = se.expressionSemantic(sc);
}
override void visit(AssertExp exp)
{
// https://dlang.org/spec/expression.html#assert_expressions
static if (LOGSEMANTIC)
{
printf("AssertExp::semantic('%s')\n", exp.toChars());
}
const generateMsg = !exp.msg &&
sc.needsCodegen() && // let ctfe interpreter handle the error message
global.params.checkAction == CHECKACTION.context &&
global.params.useAssert == CHECKENABLE.on;
Expression temporariesPrefix;
if (generateMsg)
// no message - use assert expression as msg
{
if (!verifyHookExist(exp.loc, *sc, Id._d_assert_fail, "generating assert messages"))
return setError();
/*
{
auto a = e1, b = e2;
assert(a == b, _d_assert_fail!"=="(a, b));
}()
*/
/*
Stores the result of an operand expression into a temporary
if necessary, e.g. if it is an impure fuction call containing side
effects as in https://issues.dlang.org/show_bug.cgi?id=20114
Params:
op = an expression which may require a temporary (added to
`temporariesPrefix`: `auto tmp = op`) and will be replaced
by `tmp` if necessary
Returns: (possibly replaced) `op`
*/
Expression maybePromoteToTmp(ref Expression op)
{
// https://issues.dlang.org/show_bug.cgi?id=20989
// Flag that _d_assert_fail will never dereference `array.ptr` to avoid safety
// errors for `assert(!array.ptr)` => `_d_assert_fail!"!"(array.ptr)`
{
auto die = op.isDotIdExp();
if (die && die.ident == Id.ptr)
die.noderef = true;
}
op = op.expressionSemantic(sc);
op = resolveProperties(sc, op);
// Detect assert's using static operator overloads (e.g. `"var" in environment`)
if (auto te = op.isTypeExp())
{
// Replace the TypeExp with it's textual representation
// Including "..." in the error message isn't quite right but
// proper solutions require more drastic changes, e.g. directly
// using miniFormat and combine instead of calling _d_assert_fail
auto name = new StringExp(te.loc, te.toString());
return name.expressionSemantic(sc);
}
// Create a temporary for expressions with side effects
// Defensively assume that function calls may have side effects even
// though it's not detected by hasSideEffect (e.g. `debug puts("Hello")` )
// Rewriting CallExp's also avoids some issues with the inliner/debug generation
if (op.hasSideEffect(true))
{
// Don't create an invalid temporary for void-expressions
// Further semantic will issue an appropriate error
if (op.type.ty == Tvoid)
return op;
// https://issues.dlang.org/show_bug.cgi?id=21590
// Don't create unnecessary temporaries and detect `assert(a = b)`
if (op.isAssignExp() || op.isBinAssignExp())
{
auto left = (cast(BinExp) op).e1;
// Find leftmost expression to handle other rewrites,
// e.g. --(++a) => a += 1 -= 1
while (left.isAssignExp() || left.isBinAssignExp())
left = (cast(BinExp) left).e1;
// Only use the assignee if it's a variable and skip
// other lvalues (e.g. ref's returned by functions)
if (left.isVarExp())
return left;
// Sanity check that `op` can be converted to boolean
// But don't raise errors for assignments enclosed in another expression
if (op is exp.e1)
op.toBoolean(sc);
}
// Tuples with side-effects already receive a temporary during semantic
if (op.type.isTypeTuple())
{
auto te = op.isTupleExp();
assert(te);
// Create a new tuple without the associated temporary
auto res = new TupleExp(op.loc, te.exps);
return res.expressionSemantic(sc);
}
const stc = op.isLvalue() ? STC.ref_ : 0;
auto tmp = copyToTemp(stc, "__assertOp", op);
tmp.dsymbolSemantic(sc);
auto decl = new DeclarationExp(op.loc, tmp);
temporariesPrefix = Expression.combine(temporariesPrefix, decl);
op = new VarExp(op.loc, tmp);
op = op.expressionSemantic(sc);
}
return op;
}
// if the assert condition is a mixin expression, try to compile it
if (auto ce = exp.e1.isMixinExp())
{
if (auto e1 = compileIt(ce))
exp.e1 = e1;
}
Expressions* es;
Objects* tiargs;
Loc loc = exp.e1.loc;
const op = exp.e1.op;
bool isEqualsCallExpression;
if (const callExp = exp.e1.isCallExp())
{
// https://issues.dlang.org/show_bug.cgi?id=20331
// callExp.f may be null if the assert contains a call to
// a function pointer or literal
if (const callExpFunc = callExp.f)
{
const callExpIdent = callExpFunc.ident;
isEqualsCallExpression = callExpIdent == Id.__equals ||
callExpIdent == Id.eq;
}
}
if (op == EXP.equal || op == EXP.notEqual ||
op == EXP.lessThan || op == EXP.greaterThan ||
op == EXP.lessOrEqual || op == EXP.greaterOrEqual ||
op == EXP.identity || op == EXP.notIdentity ||
op == EXP.in_ ||
isEqualsCallExpression)
{
es = new Expressions(3);
tiargs = new Objects(1);
if (isEqualsCallExpression)
{
auto callExp = cast(CallExp) exp.e1;
auto args = callExp.arguments;
// structs with opEquals get rewritten to a DotVarExp:
// a.opEquals(b)
// https://issues.dlang.org/show_bug.cgi?id=20100
if (args.length == 1)
{
auto dv = callExp.e1.isDotVarExp();
assert(dv);
// runtime args
(*es)[1] = maybePromoteToTmp(dv.e1);
(*es)[2] = maybePromoteToTmp((*args)[0]);
}
else
{
// runtime args
(*es)[1] = maybePromoteToTmp((*args)[0]);
(*es)[2] = maybePromoteToTmp((*args)[1]);
}
}
else
{
auto binExp = cast(EqualExp) exp.e1;
// runtime args
(*es)[1] = maybePromoteToTmp(binExp.e1);
(*es)[2] = maybePromoteToTmp(binExp.e2);
}
// template args
Expression comp = new StringExp(loc, isEqualsCallExpression ? "==" : EXPtoString(exp.e1.op));
comp = comp.expressionSemantic(sc);
(*es)[0] = comp;
(*tiargs)[0] = (*es)[1].type;
}
// Format exp.e1 before any additional boolean conversion
// Ignore &&/|| because "assert(...) failed" is more informative than "false != true"
else if (op != EXP.andAnd && op != EXP.orOr)
{
es = new Expressions(2);
tiargs = new Objects(1);
if (auto ne = exp.e1.isNotExp())
{
// Fetch the (potential non-bool) expression and fold
// (n) negations into (n % 2) negations, e.g. !!a => a
for (bool neg = true; ; neg = !neg)
{
if (auto ne2 = ne.e1.isNotExp())
ne = ne2;
else
{
(*es)[0] = new StringExp(loc, neg ? "!" : "");
(*es)[1] = maybePromoteToTmp(ne.e1);
break;
}
}
}
else
{ // Simply format exp.e1
(*es)[0] = new StringExp(loc, "");
(*es)[1] = maybePromoteToTmp(exp.e1);
}
(*tiargs)[0] = (*es)[1].type;
// Passing __ctfe to auto ref infers ref and aborts compilation:
// "cannot modify compiler-generated variable __ctfe"
auto ve = (*es)[1].isVarExp();
if (ve && ve.var.ident == Id.ctfe)
{
exp.msg = new StringExp(loc, "assert(__ctfe) failed!");
goto LSkip;
}
}
else
{
OutBuffer buf;
buf.printf("`%s` failed", exp.toChars());
exp.msg = new StringExp(Loc.initial, buf.extractSlice());
goto LSkip;
}
Expression __assertFail = new IdentifierExp(exp.loc, Id.empty);
auto assertFail = new DotIdExp(loc, __assertFail, Id.object);
auto dt = new DotTemplateInstanceExp(loc, assertFail, Id._d_assert_fail, tiargs);
auto ec = CallExp.create(loc, dt, es);
exp.msg = ec;
}
LSkip:
if (Expression ex = unaSemantic(exp, sc))
{
result = ex;
return;
}
exp.e1 = resolveProperties(sc, exp.e1);
// BUG: see if we can do compile time elimination of the Assert
exp.e1 = exp.e1.optimize(WANTvalue);
exp.e1 = exp.e1.toBoolean(sc);
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
if (exp.msg)
{
exp.msg = expressionSemantic(exp.msg, sc);
exp.msg = resolveProperties(sc, exp.msg);
exp.msg = exp.msg.implicitCastTo(sc, Type.tchar.constOf().arrayOf());
exp.msg = exp.msg.optimize(WANTvalue);
checkParamArgumentEscape(sc, null, null, null, STC.undefined_, exp.msg, true, false);
}
if (exp.msg && exp.msg.op == EXP.error)
{
result = exp.msg;
return;
}
auto f1 = checkNonAssignmentArrayOp(exp.e1);
auto f2 = exp.msg && checkNonAssignmentArrayOp(exp.msg);
if (f1 || f2)
return setError();
if (exp.e1.toBool().hasValue(false))
{
/* This is an `assert(0)` which means halt program execution
*/
FuncDeclaration fd = sc.parent.isFuncDeclaration();
if (fd)
fd.hasReturnExp |= 4;
sc.ctorflow.orCSX(CSX.halt);
if (global.params.useAssert == CHECKENABLE.off)
{
Expression e = new HaltExp(exp.loc);
e = e.expressionSemantic(sc);
result = e;
return;
}
// Only override the type when it isn't already some flavour of noreturn,
// e.g. when this assert was generated by defaultInitLiteral
if (!exp.type || !exp.type.isTypeNoreturn())
exp.type = Type.tnoreturn;
}
else
exp.type = Type.tvoid;
result = !temporariesPrefix
? exp
: Expression.combine(temporariesPrefix, exp).expressionSemantic(sc);
}
override void visit(ThrowExp te)
{
import dmd.statementsem;
if (throwSemantic(te.loc, te.e1, sc))
result = te;
else
setError();
}
override void visit(DotIdExp exp)
{
static if (LOGSEMANTIC)
{
printf("DotIdExp::semantic(this = %p, '%s')\n", exp, exp.toChars());
//printf("e1.op = %d, '%s'\n", e1.op, Token.toChars(e1.op));
}
if (sc.flags & SCOPE.Cfile)
{
/* See if need to rewrite the AST because of cast/call ambiguity
*/
if (auto e = castCallAmbiguity(exp, sc))
{
result = expressionSemantic(e, sc);
return;
}
if (exp.arrow) // ImportC only
exp.e1 = exp.e1.expressionSemantic(sc).arrayFuncConv(sc);
if (exp.ident == Id.__xalignof && exp.e1.isTypeExp())
{
// C11 6.5.3 says _Alignof only applies to types
Expression e;
Type t;
Dsymbol s;
dmd.typesem.resolve(exp.e1.type, exp.e1.loc, sc, e, t, s, true);
if (e)
{
exp.e1.error("argument to `_Alignof` must be a type");
return setError();
}
else if (t)
{
// Note similarity to getProperty() implementation of __xalignof
const explicitAlignment = t.alignment();
const naturalAlignment = t.alignsize();
const actualAlignment = (explicitAlignment.isDefault() ? naturalAlignment : explicitAlignment.get());
result = new IntegerExp(exp.loc, actualAlignment, Type.tsize_t);
}
else if (s)
{
exp.e1.error("argument to `_Alignof` must be a type");
return setError();
}
else
assert(0);
return;
}
if (exp.ident != Id.__sizeof)
{
result = fieldLookup(exp.e1, sc, exp.ident, exp.arrow);
return;
}
}
Expression e = exp.dotIdSemanticProp(sc, 1);
if (e && isDotOpDispatch(e))
{
auto ode = e;
uint errors = global.startGagging();
e = resolvePropertiesX(sc, e);
// Any error or if 'e' is not resolved, go to UFCS
if (global.endGagging(errors) || e is ode)
e = null; /* fall down to UFCS */
else
{
result = e;
return;
}
}
if (!e) // if failed to find the property
{
/* If ident is not a valid property, rewrite:
* e1.ident
* as:
* .ident(e1)
*/
e = resolveUFCSProperties(sc, exp);
}
result = e;
}
override void visit(DotTemplateExp e)
{
if (e.type)
{
result = e;
return;
}
if (Expression ex = unaSemantic(e, sc))
{
result = ex;
return;
}
// 'void' like TemplateExp
e.type = Type.tvoid;
result = e;
}
override void visit(DotVarExp exp)
{
static if (LOGSEMANTIC)
{
printf("DotVarExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
exp.var = exp.var.toAlias().isDeclaration();
exp.e1 = exp.e1.expressionSemantic(sc);
if (auto tup = exp.var.isTupleDeclaration())
{
/* Replace:
* e1.tuple(a, b, c)
* with:
* tuple(e1.a, e1.b, e1.c)
*/
Expression e0;
Expression ev = sc.func ? extractSideEffect(sc, "__tup", e0, exp.e1) : exp.e1;
auto exps = new Expressions();
exps.reserve(tup.objects.length);
for (size_t i = 0; i < tup.objects.length; i++)
{
RootObject o = (*tup.objects)[i];
Expression e;
Declaration var;
switch (o.dyncast()) with (DYNCAST)
{
case expression:
e = cast(Expression)o;
if (auto se = e.isDsymbolExp())
var = se.s.isDeclaration();
else if (auto ve = e.isVarExp())
if (!ve.var.isFuncDeclaration())
// Exempt functions for backwards compatibility reasons.
// See: https://issues.dlang.org/show_bug.cgi?id=20470#c1
var = ve.var;
break;
case dsymbol:
Dsymbol s = cast(Dsymbol) o;
Declaration d = s.isDeclaration();
if (!d || d.isFuncDeclaration())
// Exempt functions for backwards compatibility reasons.
// See: https://issues.dlang.org/show_bug.cgi?id=20470#c1
e = new DsymbolExp(exp.loc, s);
else
var = d;
break;
case type:
e = new TypeExp(exp.loc, cast(Type)o);
break;
default:
exp.error("`%s` is not an expression", o.toChars());
return setError();
}
if (var)
e = new DotVarExp(exp.loc, ev, var);
exps.push(e);
}
Expression e = new TupleExp(exp.loc, e0, exps);
e = e.expressionSemantic(sc);
result = e;
return;
}
else if (auto ad = exp.var.isAliasDeclaration())
{
if (auto t = ad.getType())
{
result = new TypeExp(exp.loc, t).expressionSemantic(sc);
return;
}
}
exp.e1 = exp.e1.addDtorHook(sc);
Type t1 = exp.e1.type;
if (FuncDeclaration fd = exp.var.isFuncDeclaration())
{
// for functions, do checks after overload resolution
if (!fd.functionSemantic())
return setError();
/* https://issues.dlang.org/show_bug.cgi?id=13843
* If fd obviously has no overloads, we should
* normalize AST, and it will give a chance to wrap fd with FuncExp.
*/
if ((fd.isNested() && !fd.isThis()) || fd.isFuncLiteralDeclaration())
{
// (e1, fd)
auto e = symbolToExp(fd, exp.loc, sc, false);
result = Expression.combine(exp.e1, e);
return;
}
exp.type = fd.type;
assert(exp.type);
}
else if (OverDeclaration od = exp.var.isOverDeclaration())
{
exp.type = Type.tvoid; // ambiguous type?
}
else
{
exp.type = exp.var.type;
if (!exp.type && global.errors) // var is goofed up, just return error.
return setError();
assert(exp.type);
if (t1.ty == Tpointer)
t1 = t1.nextOf();
exp.type = exp.type.addMod(t1.mod);
// https://issues.dlang.org/show_bug.cgi?id=23109
// Run semantic on the DotVarExp type
if (auto handle = exp.type.isClassHandle())
{
if (handle.semanticRun < PASS.semanticdone && !handle.isBaseInfoComplete())
handle.dsymbolSemantic(null);
}
Dsymbol vparent = exp.var.toParent();
AggregateDeclaration ad = vparent ? vparent.isAggregateDeclaration() : null;
if (Expression e1x = getRightThis(exp.loc, sc, ad, exp.e1, exp.var, 1))
exp.e1 = e1x;
else
{
/* Later checkRightThis will report correct error for invalid field variable access.
*/
Expression e = new VarExp(exp.loc, exp.var);
e = e.expressionSemantic(sc);
result = e;
return;
}
checkAccess(exp.loc, sc, exp.e1, exp.var);
VarDeclaration v = exp.var.isVarDeclaration();
if (v && (v.isDataseg() || (v.storage_class & STC.manifest)))
{
Expression e = expandVar(WANTvalue, v);
if (e)
{
result = e;
return;
}
}
if (v && (v.isDataseg() || // fix https://issues.dlang.org/show_bug.cgi?id=8238
(!v.needThis() && v.semanticRun > PASS.initial))) // fix https://issues.dlang.org/show_bug.cgi?id=17258
{
// (e1, v)
checkAccess(exp.loc, sc, exp.e1, v);
Expression e = new VarExp(exp.loc, v);
e = new CommaExp(exp.loc, exp.e1, e);
e = e.expressionSemantic(sc);
result = e;
return;
}
}
//printf("-DotVarExp::semantic('%s')\n", toChars());
result = exp;
}
override void visit(DotTemplateInstanceExp exp)
{
static if (LOGSEMANTIC)
{
printf("DotTemplateInstanceExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
// Indicate we need to resolve by UFCS.
Expression e = exp.dotTemplateSemanticProp(sc, DotExpFlag.gag);
if (!e)
e = resolveUFCSProperties(sc, exp);
if (e is exp)
e.type = Type.tvoid; // Unresolved type, because it needs inference
result = e;
}
override void visit(DelegateExp e)
{
static if (LOGSEMANTIC)
{
printf("DelegateExp::semantic('%s')\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
e.e1 = e.e1.expressionSemantic(sc);
e.type = new TypeDelegate(e.func.type.isTypeFunction());
e.type = e.type.typeSemantic(e.loc, sc);
FuncDeclaration f = e.func.toAliasFunc();
AggregateDeclaration ad = f.isMemberLocal();
if (f.needThis())
e.e1 = getRightThis(e.loc, sc, ad, e.e1, f);
if (f.type.ty == Tfunction)
{
TypeFunction tf = cast(TypeFunction)f.type;
if (!MODmethodConv(e.e1.type.mod, f.type.mod))
{
OutBuffer thisBuf, funcBuf;
MODMatchToBuffer(&thisBuf, e.e1.type.mod, tf.mod);
MODMatchToBuffer(&funcBuf, tf.mod, e.e1.type.mod);
e.error("%smethod `%s` is not callable using a %s`%s`",
funcBuf.peekChars(), f.toPrettyChars(), thisBuf.peekChars(), e.e1.toChars());
return setError();
}
}
if (ad && ad.isClassDeclaration() && ad.type != e.e1.type)
{
// A downcast is required for interfaces
// https://issues.dlang.org/show_bug.cgi?id=3706
e.e1 = new CastExp(e.loc, e.e1, ad.type);
e.e1 = e.e1.expressionSemantic(sc);
}
result = e;
// declare dual-context container
if (f.hasDualContext() && !sc.intypeof && sc.func)
{
// check access to second `this`
if (AggregateDeclaration ad2 = f.isMember2())
{
Expression te = new ThisExp(e.loc).expressionSemantic(sc);
if (te.op != EXP.error)
te = getRightThis(e.loc, sc, ad2, te, f);
if (te.op == EXP.error)
{
e.error("need `this` of type `%s` to make delegate from function `%s`", ad2.toChars(), f.toChars());
return setError();
}
}
VarDeclaration vthis2 = makeThis2Argument(e.loc, sc, f);
e.vthis2 = vthis2;
Expression de = new DeclarationExp(e.loc, vthis2);
result = Expression.combine(de, result);
result = result.expressionSemantic(sc);
}
}
override void visit(DotTypeExp exp)
{
static if (LOGSEMANTIC)
{
printf("DotTypeExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (auto e = unaSemantic(exp, sc))
{
result = e;
return;
}
exp.type = exp.sym.getType().addMod(exp.e1.type.mod);
result = exp;
}
override void visit(AddrExp exp)
{
static if (LOGSEMANTIC)
{
printf("AddrExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = unaSemantic(exp, sc))
{
result = ex;
return;
}
if (sc.flags & SCOPE.Cfile)
{
/* Special handling for &"string"/&(T[]){0, 1}
* since C regards string/array literals as lvalues
*/
auto e = exp.e1;
if(e.isStringExp() || e.isArrayLiteralExp())
{
e.type = typeSemantic(e.type, Loc.initial, sc);
// if type is already a pointer exp is an illegal expression of the form `&(&"")`
if (!e.type.isTypePointer())
{
e.type = e.type.pointerTo();
result = e;
return;
}
else
{
// `toLvalue` call further below is upon exp.e1, omitting & from the error message
exp.toLvalue(sc, null);
return setError();
}
}
}
int wasCond = exp.e1.op == EXP.question;
if (exp.e1.op == EXP.dotTemplateInstance)
{
DotTemplateInstanceExp dti = cast(DotTemplateInstanceExp)exp.e1;
TemplateInstance ti = dti.ti;
{
//assert(ti.needsTypeInference(sc));
ti.dsymbolSemantic(sc);
if (!ti.inst || ti.errors) // if template failed to expand
return setError();
Dsymbol s = ti.toAlias();
FuncDeclaration f = s.isFuncDeclaration();
if (f)
{
exp.e1 = new DotVarExp(exp.e1.loc, dti.e1, f);
exp.e1 = exp.e1.expressionSemantic(sc);
}
}
}
else if (exp.e1.op == EXP.scope_)
{
TemplateInstance ti = (cast(ScopeExp)exp.e1).sds.isTemplateInstance();
if (ti)
{
//assert(ti.needsTypeInference(sc));
ti.dsymbolSemantic(sc);
if (!ti.inst || ti.errors) // if template failed to expand
return setError();
Dsymbol s = ti.toAlias();
FuncDeclaration f = s.isFuncDeclaration();
if (f)
{
exp.e1 = new VarExp(exp.e1.loc, f);
exp.e1 = exp.e1.expressionSemantic(sc);
}
}
}
/* https://issues.dlang.org/show_bug.cgi?id=809
*
* If the address of a lazy variable is taken,
* the expression is rewritten so that the type
* of it is the delegate type. This means that
* the symbol is not going to represent a call
* to the delegate anymore, but rather, the
* actual symbol.
*/
if (auto ve = exp.e1.isVarExp())
{
if (ve.var.storage_class & STC.lazy_)
{
exp.e1 = exp.e1.expressionSemantic(sc);
exp.e1 = resolveProperties(sc, exp.e1);
if (auto callExp = exp.e1.isCallExp())
{
if (callExp.e1.type.toBasetype().ty == Tdelegate)
{
/* https://issues.dlang.org/show_bug.cgi?id=20551
*
* Cannot take address of lazy parameter in @safe code
* because it might end up being a pointer to undefined
* memory.
*/
if (1)
{
if (sc.setUnsafe(false, exp.loc,
"cannot take address of lazy parameter `%s` in `@safe` function `%s`", ve, sc.func))
{
setError();
return;
}
}
VarExp ve2 = callExp.e1.isVarExp();
ve2.delegateWasExtracted = true;
ve2.var.storage_class |= STC.scope_;
result = ve2;
return;
}
}
}
}
exp.e1 = exp.e1.toLvalue(sc, null);
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
if (checkNonAssignmentArrayOp(exp.e1))
return setError();
if (!exp.e1.type)
{
exp.error("cannot take address of `%s`", exp.e1.toChars());
return setError();
}
if (!checkAddressable(exp, sc))
return setError();
bool hasOverloads;
if (auto f = isFuncAddress(exp, &hasOverloads))
{
if (!hasOverloads && f.checkForwardRef(exp.loc))
return setError();
}
else if (!exp.e1.type.deco)
{
// try to resolve the type
exp.e1.type = exp.e1.type.typeSemantic(exp.e1.loc, null);
if (!exp.e1.type.deco) // still couldn't resolve it
{
if (auto ve = exp.e1.isVarExp())
{
Declaration d = ve.var;
exp.error("forward reference to %s `%s`", d.kind(), d.toChars());
}
else
exp.error("forward reference to type `%s` of expression `%s`", exp.e1.type.toChars(), exp.e1.toChars());
return setError();
}
}
exp.type = exp.e1.type.pointerTo();
// See if this should really be a delegate
if (exp.e1.op == EXP.dotVariable)
{
DotVarExp dve = cast(DotVarExp)exp.e1;
FuncDeclaration f = dve.var.isFuncDeclaration();
if (f)
{
f = f.toAliasFunc(); // FIXME, should see overloads
// https://issues.dlang.org/show_bug.cgi?id=1983
if (!dve.hasOverloads)
f.tookAddressOf++;
Expression e;
if (f.needThis())
e = new DelegateExp(exp.loc, dve.e1, f, dve.hasOverloads);
else // It is a function pointer. Convert &v.f() --> (v, &V.f())
e = new CommaExp(exp.loc, dve.e1, new AddrExp(exp.loc, new VarExp(exp.loc, f, dve.hasOverloads)));
e = e.expressionSemantic(sc);
result = e;
return;
}
// Look for misaligned pointer in @safe mode
if (checkUnsafeAccess(sc, dve, !exp.type.isMutable(), true))
return setError();
}
else if (exp.e1.op == EXP.variable)
{
VarExp ve = cast(VarExp)exp.e1;
VarDeclaration v = ve.var.isVarDeclaration();
if (v)
{
if (!checkAddressVar(sc, exp.e1, v))
return setError();
ve.checkPurity(sc, v);
}
FuncDeclaration f = ve.var.isFuncDeclaration();
if (f)
{
/* Because nested functions cannot be overloaded,
* mark here that we took its address because castTo()
* may not be called with an exact match.
*
* https://issues.dlang.org/show_bug.cgi?id=19285 :
* We also need to make sure we aren't inside a typeof. Ideally the compiler
* would do typeof(...) semantic analysis speculatively then collect information
* about what it used rather than relying on what are effectively semantically-global
* variables but it doesn't.
*/
if (!sc.isFromSpeculativeSemanticContext() && (!ve.hasOverloads || (f.isNested() && !f.needThis())))
{
// TODO: Refactor to use a proper interface that can keep track of causes.
f.tookAddressOf++;
}
if (f.isNested() && !f.needThis())
{
if (f.isFuncLiteralDeclaration())
{
if (!f.FuncDeclaration.isNested())
{
/* Supply a 'null' for a this pointer if no this is available
*/
Expression e = new DelegateExp(exp.loc, new NullExp(exp.loc, Type.tnull), f, ve.hasOverloads);
e = e.expressionSemantic(sc);
result = e;
return;
}
}
Expression e = new DelegateExp(exp.loc, exp.e1, f, ve.hasOverloads);
e = e.expressionSemantic(sc);
result = e;
return;
}
if (f.needThis())
{
auto memberFunc = hasThis(sc);
if (memberFunc && haveSameThis(memberFunc, f))
{
/* Should probably supply 'this' after overload resolution,
* not before.
*/
Expression ethis = new ThisExp(exp.loc);
Expression e = new DelegateExp(exp.loc, ethis, f, ve.hasOverloads);
e = e.expressionSemantic(sc);
result = e;
return;
}
if (sc.func && !sc.intypeof && !(sc.flags & SCOPE.debug_))
{
sc.setUnsafe(false, exp.loc,
"`this` reference necessary to take address of member `%s` in `@safe` function `%s`",
f, sc.func);
}
}
}
}
else if (exp.e1.op == EXP.index)
{
/* For:
* int[3] a;
* &a[i]
* check 'a' the same as for a regular variable
*/
if (VarDeclaration v = expToVariable(exp.e1))
{
exp.e1.checkPurity(sc, v);
}
}
else if (wasCond)
{
/* a ? b : c was transformed to *(a ? &b : &c), but we still
* need to do safety checks
*/
assert(exp.e1.op == EXP.star);
PtrExp pe = cast(PtrExp)exp.e1;
assert(pe.e1.op == EXP.question);
CondExp ce = cast(CondExp)pe.e1;
assert(ce.e1.op == EXP.address);
assert(ce.e2.op == EXP.address);
// Re-run semantic on the address expressions only
ce.e1.type = null;
ce.e1 = ce.e1.expressionSemantic(sc);
ce.e2.type = null;
ce.e2 = ce.e2.expressionSemantic(sc);
}
result = exp.optimize(WANTvalue);
}
override void visit(PtrExp exp)
{
static if (LOGSEMANTIC)
{
printf("PtrExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
exp.e1 = exp.e1.arrayFuncConv(sc);
Type tb = exp.e1.type.toBasetype();
switch (tb.ty)
{
case Tpointer:
exp.type = (cast(TypePointer)tb).next;
break;
case Tsarray:
case Tarray:
if (isNonAssignmentArrayOp(exp.e1))
goto default;
exp.error("using `*` on an array is no longer supported; use `*(%s).ptr` instead", exp.e1.toChars());
exp.type = (cast(TypeArray)tb).next;
exp.e1 = exp.e1.castTo(sc, exp.type.pointerTo());
break;
case Terror:
return setError();
case Tnull:
exp.type = Type.tnoreturn; // typeof(*null) is bottom type
break;
default:
exp.error("can only `*` a pointer, not a `%s`", exp.e1.type.toChars());
goto case Terror;
}
if (sc.flags & SCOPE.Cfile && exp.type && exp.type.toBasetype().ty == Tvoid)
{
// https://issues.dlang.org/show_bug.cgi?id=23752
// `&*((void*)(0))` is allowed in C
result = exp;
return;
}
if (exp.checkValue())
return setError();
result = exp;
}
override void visit(NegExp exp)
{
static if (LOGSEMANTIC)
{
printf("NegExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
fix16997(sc, exp);
exp.type = exp.e1.type;
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp.e1))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (!target.isVectorOpSupported(tb, exp.op))
{
result = exp.incompatibleTypes();
return;
}
if (exp.e1.checkNoBool())
return setError();
if (exp.e1.checkArithmetic() ||
exp.e1.checkSharedAccess(sc))
return setError();
result = exp;
}
override void visit(UAddExp exp)
{
static if (LOGSEMANTIC)
{
printf("UAddExp::semantic('%s')\n", exp.toChars());
}
assert(!exp.type);
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
fix16997(sc, exp);
if (!target.isVectorOpSupported(exp.e1.type.toBasetype(), exp.op))
{
result = exp.incompatibleTypes();
return;
}
if (exp.e1.checkNoBool())
return setError();
if (exp.e1.checkArithmetic())
return setError();
if (exp.e1.checkSharedAccess(sc))
return setError();
result = exp.e1;
}
override void visit(ComExp exp)
{
if (exp.type)
{
result = exp;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
fix16997(sc, exp);
exp.type = exp.e1.type;
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp.e1))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (!target.isVectorOpSupported(tb, exp.op))
{
result = exp.incompatibleTypes();
return;
}
if (exp.e1.checkNoBool())
return setError();
if (exp.e1.checkIntegral() ||
exp.e1.checkSharedAccess(sc))
return setError();
result = exp;
}
override void visit(NotExp e)
{
if (e.type)
{
result = e;
return;
}
e.setNoderefOperand();
// Note there is no operator overload
if (Expression ex = unaSemantic(e, sc))
{
result = ex;
return;
}
// for static alias this: https://issues.dlang.org/show_bug.cgi?id=17684
if (e.e1.op == EXP.type)
e.e1 = resolveAliasThis(sc, e.e1);
e.e1 = resolveProperties(sc, e.e1);
e.e1 = e.e1.toBoolean(sc);
if (e.e1.type == Type.terror)
{
result = e.e1;
return;
}
if (!target.isVectorOpSupported(e.e1.type.toBasetype(), e.op))
{
result = e.incompatibleTypes();
}
// https://issues.dlang.org/show_bug.cgi?id=13910
// Today NotExp can take an array as its operand.
if (checkNonAssignmentArrayOp(e.e1))
return setError();
e.type = (sc && sc.flags & SCOPE.Cfile) ? Type.tint32 : Type.tbool;
result = e;
}
override void visit(DeleteExp exp)
{
// @@@DEPRECATED_2.109@@@
// 1. Deprecated since 2.079
// 2. Error since 2.099
// 3. Removal of keyword, "delete" can be used for other identities
if (!exp.isRAII)
{
error(exp.loc, "the `delete` keyword is obsolete");
errorSupplemental(exp.loc, "use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead");
return setError();
}
Expression e = exp;
if (Expression ex = unaSemantic(exp, sc))
{
result = ex;
return;
}
exp.e1 = resolveProperties(sc, exp.e1);
exp.e1 = exp.e1.modifiableLvalue(sc, null);
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
exp.type = Type.tvoid;
Type tb = exp.e1.type.toBasetype();
/* Now that `delete` in user code is an error, we only get here when
* `isRAII` has been set to true for the deletion of a `scope class`. */
if (tb.ty != Tclass)
{
exp.error("cannot delete type `%s`", exp.e1.type.toChars());
return setError();
}
ClassDeclaration cd = (cast(TypeClass)tb).sym;
if (cd.isCOMinterface())
{
/* Because COM classes are deleted by IUnknown.Release()
*/
exp.error("cannot `delete` instance of COM interface `%s`", cd.toChars());
return setError();
}
bool err = false;
if (cd.dtor)
{
err |= !cd.dtor.functionSemantic();
err |= exp.checkPurity(sc, cd.dtor);
err |= exp.checkSafety(sc, cd.dtor);
err |= exp.checkNogc(sc, cd.dtor);
}
if (err)
return setError();
result = e;
}
override void visit(CastExp exp)
{
static if (LOGSEMANTIC)
{
printf("CastExp::semantic('%s')\n", exp.toChars());
}
//static int x; assert(++x < 10);
if (exp.type)
{
result = exp;
return;
}
if ((sc && sc.flags & SCOPE.Cfile) &&
exp.to && (exp.to.ty == Tident || exp.to.ty == Tsarray) &&
(exp.e1.op == EXP.address || exp.e1.op == EXP.star ||
exp.e1.op == EXP.uadd || exp.e1.op == EXP.negate))
{
/* Ambiguous cases arise from CParser if type-name is just an identifier.
* ( identifier ) cast-expression
* ( identifier [expression]) cast-expression
* If we determine that `identifier` is a variable, and cast-expression
* is one of the unary operators (& * + -), then rewrite this cast
* as a binary expression.
*/
Loc loc = exp.loc;
Type t;
Expression e;
Dsymbol s;
exp.to.resolve(loc, sc, e, t, s);
if (e !is null)
{
if (auto ex = exp.e1.isAddrExp()) // (ident) &exp -> (ident & exp)
result = new AndExp(loc, e, ex.e1);
else if (auto ex = exp.e1.isPtrExp()) // (ident) *exp -> (ident * exp)
result = new MulExp(loc, e, ex.e1);
else if (auto ex = exp.e1.isUAddExp()) // (ident) +exp -> (ident + exp)
result = new AddExp(loc, e, ex.e1);
else if (auto ex = exp.e1.isNegExp()) // (ident) -exp -> (ident - exp)
result = new MinExp(loc, e, ex.e1);
assert(result);
result = result.expressionSemantic(sc);
return;
}
}
if (exp.to)
{
exp.to = exp.to.typeSemantic(exp.loc, sc);
if (exp.to == Type.terror)
return setError();
if (!exp.to.hasPointers())
exp.setNoderefOperand();
// When e1 is a template lambda, this cast may instantiate it with
// the type 'to'.
exp.e1 = inferType(exp.e1, exp.to);
}
if (auto e = unaSemantic(exp, sc))
{
result = e;
return;
}
if (exp.to && !exp.to.isTypeSArray() && !exp.to.isTypeFunction())
exp.e1 = exp.e1.arrayFuncConv(sc);
// for static alias this: https://issues.dlang.org/show_bug.cgi?id=17684
if (exp.e1.op == EXP.type)
exp.e1 = resolveAliasThis(sc, exp.e1);
auto e1x = resolveProperties(sc, exp.e1);
if (e1x.op == EXP.error)
{
result = e1x;
return;
}
if (e1x.checkType())
return setError();
exp.e1 = e1x;
if (!exp.e1.type)
{
exp.error("cannot cast `%s`", exp.e1.toChars());
return setError();
}
// https://issues.dlang.org/show_bug.cgi?id=19954
if (exp.e1.type.ty == Ttuple)
{
if (exp.to)
{
if (TypeTuple tt = exp.to.isTypeTuple())
{
if (exp.e1.type.implicitConvTo(tt))
{
result = exp.e1.castTo(sc, tt);
return;
}
}
}
TupleExp te = exp.e1.isTupleExp();
if (te.exps.length == 1)
exp.e1 = (*te.exps)[0];
}
// only allow S(x) rewrite if cast specified S explicitly.
// See https://issues.dlang.org/show_bug.cgi?id=18545
const bool allowImplicitConstruction = exp.to !is null;
if (!exp.to) // Handle cast(const) and cast(immutable), etc.
{
exp.to = exp.e1.type.castMod(exp.mod);
exp.to = exp.to.typeSemantic(exp.loc, sc);
if (exp.to == Type.terror)
return setError();
}
if (exp.to.ty == Ttuple)
{
exp.error("cannot cast `%s` of type `%s` to type sequence `%s`", exp.e1.toChars(), exp.e1.type.toChars(), exp.to.toChars());
return setError();
}
// cast(void) is used to mark e1 as unused, so it is safe
if (exp.to.ty == Tvoid)
{
exp.type = exp.to;
result = exp;
return;
}
if (!exp.to.equals(exp.e1.type) && exp.mod == cast(ubyte)~0)
{
if (Expression e = exp.op_overload(sc))
{
result = e.implicitCastTo(sc, exp.to);
return;
}
}
Type t1b = exp.e1.type.toBasetype();
Type tob = exp.to.toBasetype();
if (allowImplicitConstruction && tob.ty == Tstruct && !tob.equals(t1b))
{
/* Look to replace:
* cast(S)t
* with:
* S(t)
*/
// Rewrite as to.call(e1)
Expression e = new TypeExp(exp.loc, exp.to);
e = new CallExp(exp.loc, e, exp.e1);
e = e.trySemantic(sc);
if (e)
{
result = e;
return;
}
}
if (!t1b.equals(tob) && (t1b.ty == Tarray || t1b.ty == Tsarray))
{
if (checkNonAssignmentArrayOp(exp.e1))
return setError();
}
// Look for casting to a vector type
if (tob.ty == Tvector && t1b.ty != Tvector)
{
result = new VectorExp(exp.loc, exp.e1, exp.to);
result = result.expressionSemantic(sc);
return;
}
Expression ex = exp.e1.castTo(sc, exp.to);
if (ex.op == EXP.error)
{
result = ex;
return;
}
// Check for unsafe casts
if (!isSafeCast(ex, t1b, tob))
{
if (sc.setUnsafe(false, exp.loc, "cast from `%s` to `%s` not allowed in safe code", exp.e1.type, exp.to))
{
return setError();
}
}
// `object.__ArrayCast` is a rewrite of an old runtime hook `_d_arraycast`. `_d_arraycast` was not built
// to handle certain casts. Those casts which `object.__ArrayCast` does not support are filtered out.
// See `e2ir.toElemCast` for other types of casts. If `object.__ArrayCast` is improved to support more
// casts these conditions and potentially some logic in `e2ir.toElemCast` can be removed.
if (tob.ty == Tarray)
{
// https://issues.dlang.org/show_bug.cgi?id=19840
if (auto ad = isAggregate(t1b))
{
if (ad.aliasthis)
{
Expression e = resolveAliasThis(sc, exp.e1);
e = new CastExp(exp.loc, e, exp.to);
result = e.expressionSemantic(sc);
return;
}
}
if(t1b.ty == Tarray && exp.e1.op != EXP.arrayLiteral && sc.needsCodegen())
{
auto tFrom = t1b.nextOf();
auto tTo = tob.nextOf();
// https://issues.dlang.org/show_bug.cgi?id=20130
if (exp.e1.op != EXP.string_ || !ex.isStringExp)
{
const uint fromSize = cast(uint)tFrom.size();
const uint toSize = cast(uint)tTo.size();
if (fromSize == SIZE_INVALID || toSize == SIZE_INVALID)
return setError();
// If array element sizes do not match, we must adjust the dimensions
if (fromSize != toSize)
{
if (!verifyHookExist(exp.loc, *sc, Id.__ArrayCast, "casting array of structs"))
return setError();
// A runtime check is needed in case arrays don't line up. That check should
// be done in the implementation of `object.__ArrayCast`
if (toSize == 0 || (fromSize % toSize) != 0)
{
// lower to `object.__ArrayCast!(TFrom, TTo)(from)`
// fully qualify as `object.__ArrayCast`
Expression id = new IdentifierExp(exp.loc, Id.empty);
auto dotid = new DotIdExp(exp.loc, id, Id.object);
auto tiargs = new Objects();
tiargs.push(tFrom);
tiargs.push(tTo);
auto dt = new DotTemplateInstanceExp(exp.loc, dotid, Id.__ArrayCast, tiargs);
auto arguments = new Expressions();
arguments.push(exp.e1);
Expression ce = new CallExp(exp.loc, dt, arguments);
result = expressionSemantic(ce, sc);
return;
}
}
}
}
}
if (sc && sc.flags & SCOPE.Cfile)
{
/* C11 6.5.4-5: A cast does not yield an lvalue.
* So ensure that castTo does not strip away the cast so that this
* can be enforced in other semantic visitor methods.
*/
if (!ex.isCastExp())
{
ex = new CastExp(exp.loc, ex, exp.to);
ex.type = exp.to;
}
}
result = ex;
}
override void visit(VectorExp exp)
{
static if (LOGSEMANTIC)
{
printf("VectorExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
exp.e1 = exp.e1.expressionSemantic(sc);
exp.type = exp.to.typeSemantic(exp.loc, sc);
if (exp.e1.op == EXP.error || exp.type.ty == Terror)
{
result = exp.e1;
return;
}
Type tb = exp.type.toBasetype();
assert(tb.ty == Tvector);
TypeVector tv = cast(TypeVector)tb;
Type te = tv.elementType();
exp.dim = cast(int)(tv.size(exp.loc) / te.size(exp.loc));
bool checkElem(Expression elem)
{
if (elem.isConst() == 1)
return false;
exp.error("constant expression expected, not `%s`", elem.toChars());
return true;
}
exp.e1 = exp.e1.optimize(WANTvalue);
bool res;
if (exp.e1.op == EXP.arrayLiteral)
{
foreach (i; 0 .. exp.dim)
{
// Do not stop on first error - check all AST nodes even if error found
res |= checkElem(exp.e1.isArrayLiteralExp()[i]);
}
}
else if (exp.e1.type.ty == Tvoid)
checkElem(exp.e1);
result = res ? ErrorExp.get() : exp;
}
override void visit(VectorArrayExp e)
{
static if (LOGSEMANTIC)
{
printf("VectorArrayExp::semantic('%s')\n", e.toChars());
}
if (!e.type)
{
unaSemantic(e, sc);
e.e1 = resolveProperties(sc, e.e1);
if (e.e1.op == EXP.error)
{
result = e.e1;
return;
}
assert(e.e1.type.ty == Tvector);
e.type = e.e1.type.isTypeVector().basetype;
}
result = e;
}
override void visit(SliceExp exp)
{
static if (LOGSEMANTIC)
{
printf("SliceExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
// operator overloading should be handled in ArrayExp already.
if (Expression ex = unaSemantic(exp, sc))
{
result = ex;
return;
}
exp.e1 = resolveProperties(sc, exp.e1);
if (exp.e1.op == EXP.type && exp.e1.type.ty != Ttuple)
{
if (exp.lwr || exp.upr)
{
exp.error("cannot slice type `%s`", exp.e1.toChars());
return setError();
}
Expression e = new TypeExp(exp.loc, exp.e1.type.arrayOf());
result = e.expressionSemantic(sc);
return;
}
if (!exp.lwr && !exp.upr)
{
if (exp.e1.op == EXP.arrayLiteral)
{
// Convert [a,b,c][] to [a,b,c]
Type t1b = exp.e1.type.toBasetype();
Expression e = exp.e1;
if (t1b.ty == Tsarray)
{
e = e.copy();
e.type = t1b.nextOf().arrayOf();
}
result = e;
return;
}
if (exp.e1.op == EXP.slice)
{
// Convert e[][] to e[]
SliceExp se = cast(SliceExp)exp.e1;
if (!se.lwr && !se.upr)
{
result = se;
return;
}
}
if (isArrayOpOperand(exp.e1))
{
// Convert (a[]+b[])[] to a[]+b[]
result = exp.e1;
return;
}
}
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
if (exp.e1.type.ty == Terror)
return setError();
Type t1b = exp.e1.type.toBasetype();
if (auto tp = t1b.isTypePointer())
{
if (t1b.isPtrToFunction())
{
exp.error("cannot slice function pointer `%s`", exp.e1.toChars());
return setError();
}
if (!exp.lwr || !exp.upr)
{
exp.error("upper and lower bounds are needed to slice a pointer");
if (auto ad = isAggregate(tp.next.toBasetype()))
{
auto s = search_function(ad, Id.index);
if (!s) s = search_function(ad, Id.slice);
if (s)
{
auto fd = s.isFuncDeclaration();
if ((fd && !fd.getParameterList().length) || s.isTemplateDeclaration())
{
exp.errorSupplemental(
"pointer `%s` points to an aggregate that defines an `%s`, perhaps you meant `(*%s)[]`",
exp.e1.toChars(),
s.ident.toChars(),
exp.e1.toChars()
);
}
}
}
return setError();
}
if (sc.setUnsafe(false, exp.loc, "pointer slicing not allowed in safe functions"))
return setError();
}
else if (t1b.ty == Tarray)
{
}
else if (t1b.ty == Tsarray)
{
}
else if (t1b.ty == Ttuple)
{
if (!exp.lwr && !exp.upr)
{
result = exp.e1;
return;
}
if (!exp.lwr || !exp.upr)
{
exp.error("need upper and lower bound to slice a sequence");
return setError();
}
}
else if (t1b.ty == Tvector && exp.e1.isLvalue())
{
// Convert e1 to corresponding static array
TypeVector tv1 = cast(TypeVector)t1b;
t1b = tv1.basetype;
t1b = t1b.castMod(tv1.mod);
exp.e1.type = t1b;
}
else
{
exp.error("`%s` cannot be sliced with `[]`", t1b.ty == Tvoid ? exp.e1.toChars() : t1b.toChars());
return setError();
}
/* Run semantic on lwr and upr.
*/
Scope* scx = sc;
if (t1b.ty == Tsarray || t1b.ty == Tarray || t1b.ty == Ttuple)
{
// Create scope for 'length' variable
ScopeDsymbol sym = new ArrayScopeSymbol(sc, exp);
sym.parent = sc.scopesym;
sc = sc.push(sym);
}
if (exp.lwr)
{
if (t1b.ty == Ttuple)
sc = sc.startCTFE();
exp.lwr = exp.lwr.expressionSemantic(sc);
exp.lwr = resolveProperties(sc, exp.lwr);
if (t1b.ty == Ttuple)
sc = sc.endCTFE();
exp.lwr = exp.lwr.implicitCastTo(sc, Type.tsize_t);
}
if (exp.upr)
{
if (t1b.ty == Ttuple)
sc = sc.startCTFE();
exp.upr = exp.upr.expressionSemantic(sc);
exp.upr = resolveProperties(sc, exp.upr);
if (t1b.ty == Ttuple)
sc = sc.endCTFE();
exp.upr = exp.upr.implicitCastTo(sc, Type.tsize_t);
}
if (sc != scx)
sc = sc.pop();
if (exp.lwr && exp.lwr.type == Type.terror || exp.upr && exp.upr.type == Type.terror)
return setError();
if (t1b.ty == Ttuple)
{
exp.lwr = exp.lwr.ctfeInterpret();
exp.upr = exp.upr.ctfeInterpret();
uinteger_t i1 = exp.lwr.toUInteger();
uinteger_t i2 = exp.upr.toUInteger();
TupleExp te;
TypeTuple tup;
size_t length;
if (exp.e1.op == EXP.tuple) // slicing an expression tuple
{
te = cast(TupleExp)exp.e1;
tup = null;
length = te.exps.length;
}
else if (exp.e1.op == EXP.type) // slicing a type tuple
{
te = null;
tup = cast(TypeTuple)t1b;
length = Parameter.dim(tup.arguments);
}
else
assert(0);
if (i2 < i1 || length < i2)
{
exp.error("string slice `[%llu .. %llu]` is out of bounds", i1, i2);
return setError();
}
size_t j1 = cast(size_t)i1;
size_t j2 = cast(size_t)i2;
Expression e;
if (exp.e1.op == EXP.tuple)
{
auto exps = new Expressions(j2 - j1);
for (size_t i = 0; i < j2 - j1; i++)
{
(*exps)[i] = (*te.exps)[j1 + i];
}
e = new TupleExp(exp.loc, te.e0, exps);
}
else
{
auto args = new Parameters();
args.reserve(j2 - j1);
for (size_t i = j1; i < j2; i++)
{
Parameter arg = Parameter.getNth(tup.arguments, i);
args.push(arg);
}
e = new TypeExp(exp.e1.loc, new TypeTuple(args));
}
e = e.expressionSemantic(sc);
result = e;
return;
}
exp.type = t1b.nextOf().arrayOf();
// Allow typedef[] -> typedef[]
if (exp.type.equals(t1b))
exp.type = exp.e1.type;
// We might know $ now
setLengthVarIfKnown(exp.lengthVar, t1b);
if (exp.lwr && exp.upr)
{
exp.lwr = exp.lwr.optimize(WANTvalue);
exp.upr = exp.upr.optimize(WANTvalue);
IntRange lwrRange = getIntRange(exp.lwr);
IntRange uprRange = getIntRange(exp.upr);
if (t1b.ty == Tsarray || t1b.ty == Tarray)
{
Expression el = new ArrayLengthExp(exp.loc, exp.e1);
el = el.expressionSemantic(sc);
el = el.optimize(WANTvalue);
if (el.op == EXP.int64)
{
// Array length is known at compile-time. Upper is in bounds if it fits length.
dinteger_t length = el.toInteger();
auto bounds = IntRange(SignExtendedNumber(0), SignExtendedNumber(length));
exp.upperIsInBounds = bounds.contains(uprRange);
}
else if (exp.upr.op == EXP.int64 && exp.upr.toInteger() == 0)
{
// Upper slice expression is '0'. Value is always in bounds.
exp.upperIsInBounds = true;
}
else if (exp.upr.op == EXP.variable && (cast(VarExp)exp.upr).var.ident == Id.dollar)
{
// Upper slice expression is '$'. Value is always in bounds.
exp.upperIsInBounds = true;
}
}
else if (t1b.ty == Tpointer)
{
exp.upperIsInBounds = true;
}
else
assert(0);
exp.lowerIsLessThanUpper = (lwrRange.imax <= uprRange.imin);
//printf("upperIsInBounds = %d lowerIsLessThanUpper = %d\n", exp.upperIsInBounds, exp.lowerIsLessThanUpper);
}
result = exp;
}
override void visit(ArrayLengthExp e)
{
static if (LOGSEMANTIC)
{
printf("ArrayLengthExp::semantic('%s')\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
if (Expression ex = unaSemantic(e, sc))
{
result = ex;
return;
}
e.e1 = resolveProperties(sc, e.e1);
e.type = Type.tsize_t;
result = e;
}
override void visit(ArrayExp exp)
{
static if (LOGSEMANTIC)
{
printf("ArrayExp::semantic('%s')\n", exp.toChars());
}
assert(!exp.type);
if (sc.flags & SCOPE.Cfile)
{
/* See if need to rewrite the AST because of cast/call ambiguity
*/
if (auto e = castCallAmbiguity(exp, sc))
{
result = expressionSemantic(e, sc);
return;
}
}
result = exp.carraySemantic(sc); // C semantics
if (result)
return;
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (isAggregate(exp.e1.type))
exp.error("no `[]` operator overload for type `%s`", exp.e1.type.toChars());
else if (exp.e1.op == EXP.type && exp.e1.type.ty != Ttuple)
exp.error("static array of `%s` with multiple lengths not allowed", exp.e1.type.toChars());
else if (isIndexableNonAggregate(exp.e1.type))
exp.error("only one index allowed to index `%s`", exp.e1.type.toChars());
else
exp.error("cannot use `[]` operator on expression of type `%s`", exp.e1.type.toChars());
result = ErrorExp.get();
}
override void visit(DotExp exp)
{
static if (LOGSEMANTIC)
{
printf("DotExp::semantic('%s')\n", exp.toChars());
if (exp.type)
printf("\ttype = %s\n", exp.type.toChars());
}
exp.e1 = exp.e1.expressionSemantic(sc);
exp.e2 = exp.e2.expressionSemantic(sc);
if (exp.e1.op == EXP.type)
{
result = exp.e2;
return;
}
if (exp.e2.op == EXP.type)
{
result = exp.e2;
return;
}
if (auto te = exp.e2.isTemplateExp())
{
Expression e = new DotTemplateExp(exp.loc, exp.e1, te.td);
result = e.expressionSemantic(sc);
return;
}
if (!exp.type)
exp.type = exp.e2.type;
result = exp;
}
override void visit(CommaExp e)
{
//printf("Semantic.CommaExp() %s\n", e.toChars());
if (e.type)
{
result = e;
return;
}
// Allow `((a,b),(x,y))`
if (e.allowCommaExp)
{
CommaExp.allow(e.e1);
CommaExp.allow(e.e2);
}
if (Expression ex = binSemanticProp(e, sc))
{
result = ex;
return;
}
e.e1 = e.e1.addDtorHook(sc);
if (checkNonAssignmentArrayOp(e.e1))
return setError();
// Comma expressions trigger this conversion
e.e2 = e.e2.arrayFuncConv(sc);
e.type = e.e2.type;
result = e;
if (sc.flags & SCOPE.Cfile)
return;
if (e.type is Type.tvoid)
{
checkMustUse(e.e1, sc);
discardValue(e.e1);
}
else if (!e.allowCommaExp && !e.isGenerated)
e.error("using the result of a comma expression is not allowed");
}
override void visit(IntervalExp e)
{
static if (LOGSEMANTIC)
{
printf("IntervalExp::semantic('%s')\n", e.toChars());
}
if (e.type)
{
result = e;
return;
}
Expression le = e.lwr;
le = le.expressionSemantic(sc);
le = resolveProperties(sc, le);
Expression ue = e.upr;
ue = ue.expressionSemantic(sc);
ue = resolveProperties(sc, ue);
if (le.op == EXP.error)
{
result = le;
return;
}
if (ue.op == EXP.error)
{
result = ue;
return;
}
e.lwr = le;
e.upr = ue;
e.type = Type.tvoid;
result = e;
}
override void visit(DelegatePtrExp e)
{
static if (LOGSEMANTIC)
{
printf("DelegatePtrExp::semantic('%s')\n", e.toChars());
}
if (!e.type)
{
unaSemantic(e, sc);
e.e1 = resolveProperties(sc, e.e1);
if (e.e1.op == EXP.error)
{
result = e.e1;
return;
}
e.type = Type.tvoidptr;
}
result = e;
}
override void visit(DelegateFuncptrExp e)
{
static if (LOGSEMANTIC)
{
printf("DelegateFuncptrExp::semantic('%s')\n", e.toChars());
}
if (!e.type)
{
unaSemantic(e, sc);
e.e1 = resolveProperties(sc, e.e1);
if (e.e1.op == EXP.error)
{
result = e.e1;
return;
}
e.type = e.e1.type.nextOf().pointerTo();
}
result = e;
}
override void visit(IndexExp exp)
{
static if (LOGSEMANTIC)
{
printf("IndexExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
// operator overloading should be handled in ArrayExp already.
if (!exp.e1.type)
exp.e1 = exp.e1.expressionSemantic(sc).arrayFuncConv(sc);
assert(exp.e1.type); // semantic() should already be run on it
if (exp.e1.op == EXP.type && exp.e1.type.ty != Ttuple)
{
exp.e2 = exp.e2.expressionSemantic(sc);
exp.e2 = resolveProperties(sc, exp.e2);
Type nt;
if (exp.e2.op == EXP.type)
nt = new TypeAArray(exp.e1.type, exp.e2.type);
else
nt = new TypeSArray(exp.e1.type, exp.e2);
Expression e = new TypeExp(exp.loc, nt);
result = e.expressionSemantic(sc);
return;
}
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
if (exp.e1.type.ty == Terror)
return setError();
// Note that unlike C we do not implement the int[ptr]
Type t1b = exp.e1.type.toBasetype();
if (TypeVector tv1 = t1b.isTypeVector())
{
// Convert e1 to corresponding static array
t1b = tv1.basetype;
t1b = t1b.castMod(tv1.mod);
exp.e1 = exp.e1.castTo(sc, t1b);
}
if (t1b.ty == Tsarray || t1b.ty == Tarray)
{
if (!checkAddressable(exp, sc))
return setError();
}
/* Run semantic on e2
*/
Scope* scx = sc;
if (t1b.ty == Tsarray || t1b.ty == Tarray || t1b.ty == Ttuple)
{
// Create scope for 'length' variable
ScopeDsymbol sym = new ArrayScopeSymbol(sc, exp);
sym.parent = sc.scopesym;
sc = sc.push(sym);
}
if (t1b.ty == Ttuple)
sc = sc.startCTFE();
exp.e2 = exp.e2.expressionSemantic(sc).arrayFuncConv(sc);
exp.e2 = resolveProperties(sc, exp.e2);
if (t1b.ty == Ttuple)
sc = sc.endCTFE();
if (exp.e2.op == EXP.tuple)
{
TupleExp te = cast(TupleExp)exp.e2;
if (te.exps && te.exps.length == 1)
exp.e2 = Expression.combine(te.e0, (*te.exps)[0]); // bug 4444 fix
}
if (sc != scx)
sc = sc.pop();
if (exp.e2.type == Type.terror)
return setError();
if (checkNonAssignmentArrayOp(exp.e1))
return setError();
switch (t1b.ty)
{
case Tpointer:
if (t1b.isPtrToFunction())
{
exp.error("cannot index function pointer `%s`", exp.e1.toChars());
return setError();
}
exp.e2 = exp.e2.implicitCastTo(sc, Type.tsize_t);
if (exp.e2.type == Type.terror)
return setError();
exp.e2 = exp.e2.optimize(WANTvalue);
if (exp.e2.op == EXP.int64 && exp.e2.toInteger() == 0)
{
}
else if (sc.setUnsafe(false, exp.loc, "`@safe` function `%s` cannot index pointer `%s`", sc.func, exp.e1))
{
return setError();
}
exp.type = (cast(TypeNext)t1b).next;
break;
case Tarray:
exp.e2 = exp.e2.implicitCastTo(sc, Type.tsize_t);
if (exp.e2.type == Type.terror)
return setError();
exp.type = (cast(TypeNext)t1b).next;
break;
case Tsarray:
{
exp.e2 = exp.e2.implicitCastTo(sc, Type.tsize_t);
if (exp.e2.type == Type.terror)
return setError();
exp.type = t1b.nextOf();
break;
}
case Taarray:
{
TypeAArray taa = cast(TypeAArray)t1b;
/* We can skip the implicit conversion if they differ only by
* constness
* https://issues.dlang.org/show_bug.cgi?id=2684
* see also bug https://issues.dlang.org/show_bug.cgi?id=2954 b
*/
if (!arrayTypeCompatibleWithoutCasting(exp.e2.type, taa.index))
{
exp.e2 = exp.e2.implicitCastTo(sc, taa.index); // type checking
if (exp.e2.type == Type.terror)
return setError();
}
semanticTypeInfo(sc, taa);
checkNewEscape(sc, exp.e2, false);
exp.type = taa.next;
break;
}
case Ttuple:
{
exp.e2 = exp.e2.implicitCastTo(sc, Type.tsize_t);
if (exp.e2.type == Type.terror)
return setError();
exp.e2 = exp.e2.ctfeInterpret();
uinteger_t index = exp.e2.toUInteger();
TupleExp te;
TypeTuple tup;
size_t length;
if (exp.e1.op == EXP.tuple)
{
te = cast(TupleExp)exp.e1;
tup = null;
length = te.exps.length;
}
else if (exp.e1.op == EXP.type)
{
te = null;
tup = cast(TypeTuple)t1b;
length = Parameter.dim(tup.arguments);
}
else
assert(0);
if (length <= index)
{
exp.error("array index `[%llu]` is outside array bounds `[0 .. %llu]`", index, cast(ulong)length);
return setError();
}
Expression e;
if (exp.e1.op == EXP.tuple)
{
e = (*te.exps)[cast(size_t)index];
e = Expression.combine(te.e0, e);
}
else
e = new TypeExp(exp.e1.loc, Parameter.getNth(tup.arguments, cast(size_t)index).type);
result = e;
return;
}
default:
exp.error("`%s` must be an array or pointer type, not `%s`", exp.e1.toChars(), exp.e1.type.toChars());
return setError();
}
// We might know $ now
setLengthVarIfKnown(exp.lengthVar, t1b);
if (t1b.ty == Tsarray || t1b.ty == Tarray)
{
Expression el = new ArrayLengthExp(exp.loc, exp.e1);
el = el.expressionSemantic(sc);
el = el.optimize(WANTvalue);
if (el.op == EXP.int64)
{
exp.e2 = exp.e2.optimize(WANTvalue);
dinteger_t length = el.toInteger();
if (length)
{
auto bounds = IntRange(SignExtendedNumber(0), SignExtendedNumber(length - 1));
// OR it in, because it might already be set for C array indexing
exp.indexIsInBounds |= bounds.contains(getIntRange(exp.e2));
}
else if (sc.flags & SCOPE.Cfile && t1b.ty == Tsarray)
{
if (auto ve = exp.e1.isVarExp())
{
/* Rewrite 0-length C array ve[exp.e2] as *(ve + exp.e2)
*/
auto vp = ve.castTo(sc, t1b.isTypeSArray().next.pointerTo());
auto e = new AddExp(exp.loc, vp, exp.e2);
auto pe = new PtrExp(exp.loc, e);
result = pe.expressionSemantic(sc).optimize(WANTvalue);
return;
}
}
}
}
result = exp;
}
override void visit(PostExp exp)
{
static if (LOGSEMANTIC)
{
printf("PostExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (sc.flags & SCOPE.Cfile)
{
/* See if need to rewrite the AST because of cast/call ambiguity
*/
if (auto e = castCallAmbiguity(exp, sc))
{
result = expressionSemantic(e, sc);
return;
}
}
if (Expression ex = binSemantic(exp, sc))
{
result = ex;
return;
}
Expression e1x = resolveProperties(sc, exp.e1);
if (e1x.op == EXP.error)
{
result = e1x;
return;
}
exp.e1 = e1x;
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.e1.checkReadModifyWrite(exp.op))
return setError();
if (exp.e1.op == EXP.slice)
{
const(char)* s = exp.op == EXP.plusPlus ? "increment" : "decrement";
exp.error("cannot post-%s array slice `%s`, use pre-%s instead", s, exp.e1.toChars(), s);
return setError();
}
Type t1 = exp.e1.type.toBasetype();
if (t1.ty == Tclass || t1.ty == Tstruct || exp.e1.op == EXP.arrayLength)
{
/* Check for operator overloading,
* but rewrite in terms of ++e instead of e++
*/
/* If e1 is not trivial, take a reference to it
*/
Expression de = null;
if (exp.e1.op != EXP.variable && exp.e1.op != EXP.arrayLength)
{
// ref v = e1;
auto v = copyToTemp(STC.ref_, "__postref", exp.e1);
de = new DeclarationExp(exp.loc, v);
exp.e1 = new VarExp(exp.e1.loc, v);
}
/* Rewrite as:
* auto tmp = e1; ++e1; tmp
*/
auto tmp = copyToTemp(0, "__pitmp", exp.e1);
Expression ea = new DeclarationExp(exp.loc, tmp);
Expression eb = exp.e1.syntaxCopy();
eb = new PreExp(exp.op == EXP.plusPlus ? EXP.prePlusPlus : EXP.preMinusMinus, exp.loc, eb);
Expression ec = new VarExp(exp.loc, tmp);
// Combine de,ea,eb,ec
if (de)
ea = new CommaExp(exp.loc, de, ea);
e = new CommaExp(exp.loc, ea, eb);
e = new CommaExp(exp.loc, e, ec);
e = e.expressionSemantic(sc);
result = e;
return;
}
exp.e1 = exp.e1.modifiableLvalue(sc, exp.e1);
exp.e1 = exp.e1.optimize(WANTvalue, /*keepLvalue*/ true);
e = exp;
if (exp.e1.checkScalar() ||
exp.e1.checkSharedAccess(sc))
return setError();
if (exp.e1.checkNoBool())
return setError();
if (exp.e1.type.ty == Tpointer)
e = scaleFactor(exp, sc);
else
exp.e2 = exp.e2.castTo(sc, exp.e1.type);
e.type = exp.e1.type;
result = e;
}
override void visit(PreExp exp)
{
Expression e = exp.op_overload(sc);
// printf("PreExp::semantic('%s')\n", toChars());
if (e)
{
result = e;
return;
}
// Rewrite as e1+=1 or e1-=1
if (exp.op == EXP.prePlusPlus)
e = new AddAssignExp(exp.loc, exp.e1, IntegerExp.literal!1);
else
e = new MinAssignExp(exp.loc, exp.e1, IntegerExp.literal!1);
result = e.expressionSemantic(sc);
}
/*
* Get the expression initializer for a specific struct
*
* Params:
* sd = the struct for which the expression initializer is needed
* loc = the location of the initializer
* sc = the scope where the expression is located
* t = the type of the expression
*
* Returns:
* The expression initializer or error expression if any errors occured
*/
private Expression getInitExp(StructDeclaration sd, Loc loc, Scope* sc, Type t)
{
if (sd.zeroInit && !sd.isNested())
{
// https://issues.dlang.org/show_bug.cgi?id=14606
// Always use BlitExp for the special expression: (struct = 0)
return IntegerExp.literal!0;
}
if (sd.isNested())
{
auto sle = new StructLiteralExp(loc, sd, null, t);
if (!sd.fill(loc, *sle.elements, true))
return ErrorExp.get();
if (checkFrameAccess(loc, sc, sd, sle.elements.length))
return ErrorExp.get();
sle.type = t;
return sle;
}
return t.defaultInit(loc);
}
override void visit(AssignExp exp)
{
static if (LOGSEMANTIC)
{
if (exp.op == EXP.blit) printf("BlitExp.toElem('%s')\n", exp.toChars());
if (exp.op == EXP.assign) printf("AssignExp.toElem('%s')\n", exp.toChars());
if (exp.op == EXP.construct) printf("ConstructExp.toElem('%s')\n", exp.toChars());
}
void setResult(Expression e, int line = __LINE__)
{
//printf("line %d\n", line);
result = e;
}
if (exp.type)
{
return setResult(exp);
}
Expression e1old = exp.e1;
if (auto e2comma = exp.e2.isCommaExp())
{
if (!e2comma.isGenerated && !(sc.flags & SCOPE.Cfile))
exp.error("using the result of a comma expression is not allowed");
/* Rewrite to get rid of the comma from rvalue
* e1=(e0,e2) => e0,(e1=e2)
*/
Expression e0;
exp.e2 = Expression.extractLast(e2comma, e0);
Expression e = Expression.combine(e0, exp);
return setResult(e.expressionSemantic(sc));
}
/* Look for operator overloading of a[arguments] = e2.
* Do it before e1.expressionSemantic() otherwise the ArrayExp will have been
* converted to unary operator overloading already.
*/
if (auto ae = exp.e1.isArrayExp())
{
Expression res;
ae.e1 = ae.e1.expressionSemantic(sc);
ae.e1 = resolveProperties(sc, ae.e1);
Expression ae1old = ae.e1;
const(bool) maybeSlice =
(ae.arguments.length == 0 ||
ae.arguments.length == 1 && (*ae.arguments)[0].op == EXP.interval);
IntervalExp ie = null;
if (maybeSlice && ae.arguments.length)
{
assert((*ae.arguments)[0].op == EXP.interval);
ie = cast(IntervalExp)(*ae.arguments)[0];
}
Type att = null; // first cyclic `alias this` type
while (true)
{
if (ae.e1.op == EXP.error)
return setResult(ae.e1);
Expression e0 = null;
Expression ae1save = ae.e1;
ae.lengthVar = null;
Type t1b = ae.e1.type.toBasetype();
AggregateDeclaration ad = isAggregate(t1b);
if (!ad)
break;
if (search_function(ad, Id.indexass))
{
// Deal with $
res = resolveOpDollar(sc, ae, &e0);
if (!res) // a[i..j] = e2 might be: a.opSliceAssign(e2, i, j)
goto Lfallback;
if (res.op == EXP.error)
return setResult(res);
res = exp.e2.expressionSemantic(sc);
if (res.op == EXP.error)
return setResult(res);
exp.e2 = res;
/* Rewrite (a[arguments] = e2) as:
* a.opIndexAssign(e2, arguments)
*/
Expressions* a = ae.arguments.copy();
a.insert(0, exp.e2);
res = new DotIdExp(exp.loc, ae.e1, Id.indexass);
res = new CallExp(exp.loc, res, a);
if (maybeSlice) // a[] = e2 might be: a.opSliceAssign(e2)
res = res.trySemantic(sc);
else
res = res.expressionSemantic(sc);
if (res)
return setResult(Expression.combine(e0, res));
}
Lfallback:
if (maybeSlice && search_function(ad, Id.sliceass))
{
// Deal with $
res = resolveOpDollar(sc, ae, ie, &e0);
if (res.op == EXP.error)
return setResult(res);
res = exp.e2.expressionSemantic(sc);
if (res.op == EXP.error)
return setResult(res);
exp.e2 = res;
/* Rewrite (a[i..j] = e2) as:
* a.opSliceAssign(e2, i, j)
*/
auto a = new Expressions();
a.push(exp.e2);
if (ie)
{
a.push(ie.lwr);
a.push(ie.upr);
}
res = new DotIdExp(exp.loc, ae.e1, Id.sliceass);
res = new CallExp(exp.loc, res, a);
res = res.expressionSemantic(sc);
return setResult(Expression.combine(e0, res));
}
// No operator overloading member function found yet, but
// there might be an alias this to try.
if (ad.aliasthis && !isRecursiveAliasThis(att, ae.e1.type))
{
/* Rewrite (a[arguments] op e2) as:
* a.aliasthis[arguments] op e2
*/
ae.e1 = resolveAliasThis(sc, ae1save, true);
if (ae.e1)
continue;
}
break;
}
ae.e1 = ae1old; // recovery
ae.lengthVar = null;
}
/* Run this.e1 semantic.
*/
{
Expression e1x = exp.e1;
/* With UFCS, e.f = value
* Could mean:
* .f(e, value)
* or:
* .f(e) = value
*/
if (auto dti = e1x.isDotTemplateInstanceExp())
{
Expression e = dti.dotTemplateSemanticProp(sc, DotExpFlag.gag);
if (!e)
{
return setResult(resolveUFCSProperties(sc, e1x, exp.e2));
}
e1x = e;
}
else if (sc.flags & SCOPE.Cfile && e1x.isDotIdExp())
{
auto die = e1x.isDotIdExp();
e1x = fieldLookup(die.e1, sc, die.ident, die.arrow);
}
else if (auto die = e1x.isDotIdExp())
{
Expression e = die.dotIdSemanticProp(sc, 1);
if (e && isDotOpDispatch(e))
{
/* https://issues.dlang.org/show_bug.cgi?id=19687
*
* On this branch, e2 is semantically analyzed in resolvePropertiesX,
* but that call is done with gagged errors. That is the only time when
* semantic gets ran on e2, that is why the error never gets to be printed.
* In order to make sure that UFCS is tried with correct parameters, e2
* needs to have semantic ran on it.
*/
auto ode = e;
exp.e2 = exp.e2.expressionSemantic(sc);
uint errors = global.startGagging();
e = resolvePropertiesX(sc, e, exp.e2);
// Any error or if 'e' is not resolved, go to UFCS
if (global.endGagging(errors) || e is ode)
e = null; /* fall down to UFCS */
else
return setResult(e);
}
if (!e)
return setResult(resolveUFCSProperties(sc, e1x, exp.e2));
e1x = e;
}
else
{
if (auto se = e1x.isSliceExp())
se.arrayop = true;
e1x = e1x.expressionSemantic(sc);
}
/* We have f = value.
* Could mean:
* f(value)
* or:
* f() = value
*/
if (Expression e = resolvePropertiesX(sc, e1x, exp.e2, exp))
return setResult(e);
if (e1x.checkRightThis(sc))
{
return setError();
}
exp.e1 = e1x;
assert(exp.e1.type);
}
Type t1 = exp.e1.type.isTypeEnum() ? exp.e1.type : exp.e1.type.toBasetype();
/* Run this.e2 semantic.
* Different from other binary expressions, the analysis of e2
* depends on the result of e1 in assignments.
*/
{
Expression e2x = inferType(exp.e2, t1.baseElemOf());
e2x = e2x.expressionSemantic(sc);
if (!t1.isTypeSArray())
e2x = e2x.arrayFuncConv(sc);
e2x = resolveProperties(sc, e2x);
if (e2x.op == EXP.type)
e2x = resolveAliasThis(sc, e2x); //https://issues.dlang.org/show_bug.cgi?id=17684
if (e2x.op == EXP.error)
return setResult(e2x);
// We delay checking the value for structs/classes as these might have
// an opAssign defined.
if ((t1.ty != Tstruct && t1.ty != Tclass && e2x.checkValue()) ||
e2x.checkSharedAccess(sc))
return setError();
auto etmp = checkNoreturnVarAccess(e2x);
if (etmp != e2x)
return setResult(etmp);
exp.e2 = e2x;
}
/* Rewrite tuple assignment as a tuple of assignments.
*/
{
Expression e2x = exp.e2;
Ltupleassign:
if (exp.e1.op == EXP.tuple && e2x.op == EXP.tuple)
{
TupleExp tup1 = cast(TupleExp)exp.e1;
TupleExp tup2 = cast(TupleExp)e2x;
size_t dim = tup1.exps.length;
Expression e = null;
if (dim != tup2.exps.length)
{
exp.error("mismatched sequence lengths, %d and %d", cast(int)dim, cast(int)tup2.exps.length);
return setError();
}
if (dim == 0)
{
e = IntegerExp.literal!0;
e = new CastExp(exp.loc, e, Type.tvoid); // avoid "has no effect" error
e = Expression.combine(tup1.e0, tup2.e0, e);
}
else
{
auto exps = new Expressions(dim);
for (size_t i = 0; i < dim; i++)
{
Expression ex1 = (*tup1.exps)[i];
Expression ex2 = (*tup2.exps)[i];
(*exps)[i] = new AssignExp(exp.loc, ex1, ex2);
}
e = new TupleExp(exp.loc, Expression.combine(tup1.e0, tup2.e0), exps);
}
return setResult(e.expressionSemantic(sc));
}
/* Look for form: e1 = e2.aliasthis.
*/
if (exp.e1.op == EXP.tuple)
{
TupleDeclaration td = isAliasThisTuple(e2x);
if (!td)
goto Lnomatch;
assert(exp.e1.type.ty == Ttuple);
TypeTuple tt = cast(TypeTuple)exp.e1.type;
Expression e0;
Expression ev = extractSideEffect(sc, "__tup", e0, e2x);
auto iexps = new Expressions();
iexps.push(ev);
for (size_t u = 0; u < iexps.length; u++)
{
Lexpand:
Expression e = (*iexps)[u];
Parameter arg = Parameter.getNth(tt.arguments, u);
//printf("[%d] iexps.length = %d, ", u, iexps.length);
//printf("e = (%s %s, %s), ", Token.toChars[e.op], e.toChars(), e.type.toChars());
//printf("arg = (%s, %s)\n", arg.toChars(), arg.type.toChars());
if (!arg || !e.type.implicitConvTo(arg.type))
{
// expand initializer to tuple
if (expandAliasThisTuples(iexps, u) != -1)
{
if (iexps.length <= u)
break;
goto Lexpand;
}
goto Lnomatch;
}
}
e2x = new TupleExp(e2x.loc, e0, iexps);
e2x = e2x.expressionSemantic(sc);
if (e2x.op == EXP.error)
{
result = e2x;
return;
}
// Do not need to overwrite this.e2
goto Ltupleassign;
}
Lnomatch:
}
/* Inside constructor, if this is the first assignment of object field,
* rewrite this to initializing the field.
*/
if (exp.op == EXP.assign
&& exp.e1.checkModifiable(sc) == Modifiable.initialization)
{
//printf("[%s] change to init - %s\n", exp.loc.toChars(), exp.toChars());
auto t = exp.type;
exp = new ConstructExp(exp.loc, exp.e1, exp.e2);
exp.type = t;
// https://issues.dlang.org/show_bug.cgi?id=13515
// set Index::modifiable flag for complex AA element initialization
if (auto ie1 = exp.e1.isIndexExp())
{
Expression e1x = ie1.markSettingAAElem();
if (e1x.op == EXP.error)
{
result = e1x;
return;
}
}
}
else if (exp.op == EXP.construct && exp.e1.op == EXP.variable &&
(cast(VarExp)exp.e1).var.storage_class & (STC.out_ | STC.ref_))
{
exp.memset = MemorySet.referenceInit;
}
if (exp.op == EXP.assign) // skip EXP.blit and EXP.construct, which are initializations
{
exp.e1.checkSharedAccess(sc);
checkUnsafeAccess(sc, exp.e1, false, true);
}
checkUnsafeAccess(sc, exp.e2, true, true); // Initializer must always be checked
/* If it is an assignment from a 'foreign' type,
* check for operator overloading.
*/
if (exp.memset == MemorySet.referenceInit)
{
// If this is an initialization of a reference,
// do nothing
}
else if (t1.ty == Tstruct)
{
auto e1x = exp.e1;
auto e2x = exp.e2;
auto sd = (cast(TypeStruct)t1).sym;
if (exp.op == EXP.construct)
{
Type t2 = e2x.type.toBasetype();
if (t2.ty == Tstruct && sd == (cast(TypeStruct)t2).sym)
{
sd.size(exp.loc);
if (sd.sizeok != Sizeok.done)
return setError();
if (!sd.ctor)
sd.ctor = sd.searchCtor();
// https://issues.dlang.org/show_bug.cgi?id=15661
// Look for the form from last of comma chain.
auto e2y = lastComma(e2x);
CallExp ce = (e2y.op == EXP.call) ? cast(CallExp)e2y : null;
DotVarExp dve = (ce && ce.e1.op == EXP.dotVariable)
? cast(DotVarExp)ce.e1 : null;
if (sd.ctor && ce && dve && dve.var.isCtorDeclaration() &&
// https://issues.dlang.org/show_bug.cgi?id=19389
dve.e1.op != EXP.dotVariable &&
e2y.type.implicitConvTo(t1))
{
/* Look for form of constructor call which is:
* __ctmp.ctor(arguments...)
*/
/* Before calling the constructor, initialize
* variable with a bit copy of the default
* initializer
*/
Expression einit = getInitExp(sd, exp.loc, sc, t1);
if (einit.op == EXP.error)
{
result = einit;
return;
}
auto ae = new BlitExp(exp.loc, exp.e1, einit);
ae.type = e1x.type;
/* Replace __ctmp being constructed with e1.
* We need to copy constructor call expression,
* because it may be used in other place.
*/
auto dvx = cast(DotVarExp)dve.copy();
dvx.e1 = e1x;
auto cx = cast(CallExp)ce.copy();
cx.e1 = dvx;
if (checkConstructorEscape(sc, cx, false))
return setError();
Expression e0;
Expression.extractLast(e2x, e0);
auto e = Expression.combine(e0, ae, cx);
e = e.expressionSemantic(sc);
result = e;
return;
}
// https://issues.dlang.org/show_bug.cgi?id=21586
// Rewrite CondExp or e1 will miss direct construction, e.g.
// e1 = a ? S(1) : ...; -> AST: e1 = a ? (S(0)).this(1) : ...;
// a temporary created and an extra destructor call.
// AST will be rewritten to:
// a ? e1 = 0, e1.this(1) : ...; -> blitting plus construction
if (e2x.op == EXP.question)
{
/* Rewrite as:
* a ? e1 = b : e1 = c;
*/
CondExp econd = cast(CondExp)e2x;
Expression ea1 = new ConstructExp(econd.e1.loc, e1x, econd.e1);
Expression ea2 = new ConstructExp(econd.e2.loc, e1x, econd.e2);
Expression e = new CondExp(exp.loc, econd.econd, ea1, ea2);
result = e.expressionSemantic(sc);
return;
}
if (sd.postblit || sd.hasCopyCtor)
{
/* We have a copy constructor for this
*/
if (e2x.isLvalue())
{
if (sd.hasCopyCtor)
{
/* Rewrite as:
* e1 = init, e1.copyCtor(e2);
*/
Expression einit = new BlitExp(exp.loc, exp.e1, getInitExp(sd, exp.loc, sc, t1));
einit.type = e1x.type;
Expression e;
e = new DotIdExp(exp.loc, e1x, Id.ctor);
e = new CallExp(exp.loc, e, e2x);
e = new CommaExp(exp.loc, einit, e);
//printf("e: %s\n", e.toChars());
result = e.expressionSemantic(sc);
return;
}
else
{
if (!e2x.type.implicitConvTo(e1x.type))
{
exp.error("conversion error from `%s` to `%s`",
e2x.type.toChars(), e1x.type.toChars());
return setError();
}
/* Rewrite as:
* (e1 = e2).postblit();
*
* Blit assignment e1 = e2 returns a reference to the original e1,
* then call the postblit on it.
*/
Expression e = e1x.copy();
e.type = e.type.mutableOf();
if (e.type.isShared && !sd.type.isShared)
e.type = e.type.unSharedOf();
e = new BlitExp(exp.loc, e, e2x);
e = new DotVarExp(exp.loc, e, sd.postblit, false);
e = new CallExp(exp.loc, e);
result = e.expressionSemantic(sc);
return;
}
}
else
{
/* The struct value returned from the function is transferred
* so should not call the destructor on it.
*/
e2x = valueNoDtor(e2x);
}
}
// https://issues.dlang.org/show_bug.cgi?id=19251
// if e2 cannot be converted to e1.type, maybe there is an alias this
if (!e2x.implicitConvTo(t1))
{
AggregateDeclaration ad2 = isAggregate(e2x.type);
if (ad2 && ad2.aliasthis && !isRecursiveAliasThis(exp.att2, exp.e2.type))
{
/* Rewrite (e1 op e2) as:
* (e1 op e2.aliasthis)
*/
exp.e2 = new DotIdExp(exp.e2.loc, exp.e2, ad2.aliasthis.ident);
result = exp.expressionSemantic(sc);
return;
}
}
}
else if (!e2x.implicitConvTo(t1))
{
sd.size(exp.loc);
if (sd.sizeok != Sizeok.done)
return setError();
if (!sd.ctor)
sd.ctor = sd.searchCtor();
if (sd.ctor)
{
/* Look for implicit constructor call
* Rewrite as:
* e1 = init, e1.ctor(e2)
*/
/* Fix Issue 5153 : https://issues.dlang.org/show_bug.cgi?id=5153
* Using `new` to initialize a struct object is a common mistake, but
* the error message from the compiler is not very helpful in that
* case. If exp.e2 is a NewExp and the type of new is the same as
* the type as exp.e1 (struct in this case), then we know for sure
* that the user wants to instantiate a struct. This is done to avoid
* issuing an error when the user actually wants to call a constructor
* which receives a class object.
*
* Foo f = new Foo2(0); is a valid expression if Foo has a constructor
* which receives an instance of a Foo2 class
*/
if (exp.e2.op == EXP.new_)
{
auto newExp = cast(NewExp)(exp.e2);
if (newExp.newtype && newExp.newtype == t1)
{
error(exp.loc, "cannot implicitly convert expression `%s` of type `%s` to `%s`",
newExp.toChars(), newExp.type.toChars(), t1.toChars());
errorSupplemental(exp.loc, "Perhaps remove the `new` keyword?");
return setError();
}
}
Expression einit = new BlitExp(exp.loc, e1x, getInitExp(sd, exp.loc, sc, t1));
einit.type = e1x.type;
Expression e;
e = new DotIdExp(exp.loc, e1x, Id.ctor);
e = new CallExp(exp.loc, e, e2x);
e = new CommaExp(exp.loc, einit, e);
e = e.expressionSemantic(sc);
result = e;
return;
}
if (search_function(sd, Id.call))
{
/* Look for static opCall
* https://issues.dlang.org/show_bug.cgi?id=2702
* Rewrite as:
* e1 = typeof(e1).opCall(arguments)
*/
e2x = typeDotIdExp(e2x.loc, e1x.type, Id.call);
e2x = new CallExp(exp.loc, e2x, exp.e2);
e2x = e2x.expressionSemantic(sc);
e2x = resolveProperties(sc, e2x);
if (e2x.op == EXP.error)
{
result = e2x;
return;
}
if (e2x.checkValue() || e2x.checkSharedAccess(sc))
return setError();
}
}
else // https://issues.dlang.org/show_bug.cgi?id=11355
{
AggregateDeclaration ad2 = isAggregate(e2x.type);
if (ad2 && ad2.aliasthis && !isRecursiveAliasThis(exp.att2, exp.e2.type))
{
/* Rewrite (e1 op e2) as:
* (e1 op e2.aliasthis)
*/
exp.e2 = new DotIdExp(exp.e2.loc, exp.e2, ad2.aliasthis.ident);
result = exp.expressionSemantic(sc);
return;
}
}
}
else if (exp.op == EXP.assign)
{
if (e1x.op == EXP.index && (cast(IndexExp)e1x).e1.type.toBasetype().ty == Taarray)
{
/*
* Rewrite:
* aa[key] = e2;
* as:
* ref __aatmp = aa;
* ref __aakey = key;
* ref __aaval = e2;
* (__aakey in __aatmp
* ? __aatmp[__aakey].opAssign(__aaval)
* : ConstructExp(__aatmp[__aakey], __aaval));
*/
// ensure we keep the expr modifiable
Expression esetting = (cast(IndexExp)e1x).markSettingAAElem();
if (esetting.op == EXP.error)
{
result = esetting;
return;
}
assert(esetting.op == EXP.index);
IndexExp ie = cast(IndexExp) esetting;
Type t2 = e2x.type.toBasetype();
Expression e0 = null;
Expression ea = extractSideEffect(sc, "__aatmp", e0, ie.e1);
Expression ek = extractSideEffect(sc, "__aakey", e0, ie.e2);
Expression ev = extractSideEffect(sc, "__aaval", e0, e2x);
AssignExp ae = cast(AssignExp)exp.copy();
ae.e1 = new IndexExp(exp.loc, ea, ek);
ae.e1 = ae.e1.expressionSemantic(sc);
ae.e1 = ae.e1.optimize(WANTvalue);
ae.e2 = ev;
Expression e = ae.op_overload(sc);
if (e)
{
Expression ey = null;
if (t2.ty == Tstruct && sd == t2.toDsymbol(sc))
{
ey = ev;
}
else if (!ev.implicitConvTo(ie.type) && sd.ctor)
{
// Look for implicit constructor call
// Rewrite as S().ctor(e2)
ey = new StructLiteralExp(exp.loc, sd, null);
ey = new DotIdExp(exp.loc, ey, Id.ctor);
ey = new CallExp(exp.loc, ey, ev);
ey = ey.trySemantic(sc);
}
if (ey)
{
Expression ex;
ex = new IndexExp(exp.loc, ea, ek);
ex = ex.expressionSemantic(sc);
ex = ex.modifiableLvalue(sc, ex); // allocate new slot
ex = ex.optimize(WANTvalue);
ey = new ConstructExp(exp.loc, ex, ey);
ey = ey.expressionSemantic(sc);
if (ey.op == EXP.error)
{
result = ey;
return;
}
ex = e;
// https://issues.dlang.org/show_bug.cgi?id=14144
// The whole expression should have the common type
// of opAssign() return and assigned AA entry.
// Even if there's no common type, expression should be typed as void.
if (!typeMerge(sc, EXP.question, ex, ey))
{
ex = new CastExp(ex.loc, ex, Type.tvoid);
ey = new CastExp(ey.loc, ey, Type.tvoid);
}
e = new CondExp(exp.loc, new InExp(exp.loc, ek, ea), ex, ey);
}
e = Expression.combine(e0, e);
e = e.expressionSemantic(sc);
result = e;
return;
}
}
else
{
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
}
}
else
assert(exp.op == EXP.blit);
if (e2x.checkValue())
return setError();
exp.e1 = e1x;
exp.e2 = e2x;
}
else if (t1.ty == Tclass)
{
// Disallow assignment operator overloads for same type
if (exp.op == EXP.assign && !exp.e2.implicitConvTo(exp.e1.type))
{
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
}
if (exp.e2.checkValue())
return setError();
}
else if (t1.ty == Tsarray)
{
// SliceExp cannot have static array type without context inference.
assert(exp.e1.op != EXP.slice);
Expression e1x = exp.e1;
Expression e2x = exp.e2;
/* C strings come through as static arrays. May need to adjust the size of the
* string to match the size of e1.
*/
Type t2 = e2x.type.toBasetype();
if (sc.flags & SCOPE.Cfile && e2x.isStringExp() && t2.isTypeSArray())
{
uinteger_t dim1 = t1.isTypeSArray().dim.toInteger();
uinteger_t dim2 = t2.isTypeSArray().dim.toInteger();
if (dim1 + 1 == dim2 || dim2 < dim1)
{
auto tsa2 = t2.isTypeSArray();
auto newt = tsa2.next.sarrayOf(dim1).immutableOf();
e2x = castTo(e2x, sc, newt);
exp.e2 = e2x;
}
}
if (e2x.implicitConvTo(e1x.type))
{
if (exp.op != EXP.blit && (e2x.op == EXP.slice && (cast(UnaExp)e2x).e1.isLvalue() || e2x.op == EXP.cast_ && (cast(UnaExp)e2x).e1.isLvalue() || e2x.op != EXP.slice && e2x.isLvalue()))
{
if (e1x.checkPostblit(sc, t1))
return setError();
}
// e2 matches to t1 because of the implicit length match, so
if (isUnaArrayOp(e2x.op) || isBinArrayOp(e2x.op))
{
// convert e1 to e1[]
// e.g. e1[] = a[] + b[];
auto sle = new SliceExp(e1x.loc, e1x, null, null);
sle.arrayop = true;
e1x = sle.expressionSemantic(sc);
}
else
{
// convert e2 to t1 later
// e.g. e1 = [1, 2, 3];
}
}
else
{
if (e2x.implicitConvTo(t1.nextOf().arrayOf()) > MATCH.nomatch)
{
uinteger_t dim1 = (cast(TypeSArray)t1).dim.toInteger();
uinteger_t dim2 = dim1;
if (auto ale = e2x.isArrayLiteralExp())
{
dim2 = ale.elements ? ale.elements.length : 0;
}
else if (auto se = e2x.isSliceExp())
{
Type tx = toStaticArrayType(se);
if (tx)
dim2 = (cast(TypeSArray)tx).dim.toInteger();
}
if (dim1 != dim2)
{
exp.error("mismatched array lengths, %d and %d", cast(int)dim1, cast(int)dim2);
return setError();
}
}
// May be block or element-wise assignment, so
// convert e1 to e1[]
if (exp.op != EXP.assign)
{
// If multidimensional static array, treat as one large array
//
// Find the appropriate array type depending on the assignment, e.g.
// int[3] = int => int[3]
// int[3][2] = int => int[6]
// int[3][2] = int[] => int[3][2]
// int[3][2][4] + int => int[24]
// int[3][2][4] + int[] => int[3][8]
ulong dim = t1.isTypeSArray().dim.toUInteger();
auto type = t1.nextOf();
for (TypeSArray tsa; (tsa = type.isTypeSArray()) !is null; )
{
import core.checkedint : mulu;
// Accumulate skipped dimensions
bool overflow = false;
dim = mulu(dim, tsa.dim.toUInteger(), overflow);
if (overflow || dim >= uint.max)
{
// dym exceeds maximum array size
exp.error("static array `%s` size overflowed to %llu",
e1x.type.toChars(), cast(ulong) dim);
return setError();
}
// Move to the element type
type = tsa.nextOf().toBasetype();
// Rewrite ex1 as a static array if a matching type was found
if (e2x.implicitConvTo(type) > MATCH.nomatch)
{
e1x.type = type.sarrayOf(dim);
break;
}
}
}
auto sle = new SliceExp(e1x.loc, e1x, null, null);
sle.arrayop = true;
e1x = sle.expressionSemantic(sc);
}
if (e1x.op == EXP.error)
return setResult(e1x);
if (e2x.op == EXP.error)
return setResult(e2x);
exp.e1 = e1x;
exp.e2 = e2x;
t1 = e1x.type.toBasetype();
}
/* Check the mutability of e1.
*/
if (auto ale = exp.e1.isArrayLengthExp())
{
// e1 is not an lvalue, but we let code generator handle it
auto ale1x = ale.e1.modifiableLvalue(sc, exp.e1);
if (ale1x.op == EXP.error)
return setResult(ale1x);
ale.e1 = ale1x;
Type tn = ale.e1.type.toBasetype().nextOf();
checkDefCtor(ale.loc, tn);
Identifier hook = global.params.tracegc ? Id._d_arraysetlengthTTrace : Id._d_arraysetlengthT;
if (!verifyHookExist(exp.loc, *sc, Id._d_arraysetlengthTImpl, "resizing arrays"))
return setError();
exp.e2 = exp.e2.expressionSemantic(sc);
auto lc = lastComma(exp.e2);
lc = lc.optimize(WANTvalue);
// use slice expression when arr.length = 0 to avoid runtime call
if(lc.op == EXP.int64 && lc.toInteger() == 0)
{
Expression se = new SliceExp(ale.loc, ale.e1, lc, lc);
Expression as = new AssignExp(ale.loc, ale.e1, se);
as = as.expressionSemantic(sc);
auto res = Expression.combine(as, exp.e2);
res.type = ale.type;
return setResult(res);
}
if (!sc.needsCodegen()) // if compile time creature only
{
exp.type = Type.tsize_t;
return setResult(exp);
}
// Lower to object._d_arraysetlengthTImpl!(typeof(e1))._d_arraysetlengthT{,Trace}(e1, e2)
Expression id = new IdentifierExp(ale.loc, Id.empty);
id = new DotIdExp(ale.loc, id, Id.object);
auto tiargs = new Objects();
tiargs.push(ale.e1.type);
id = new DotTemplateInstanceExp(ale.loc, id, Id._d_arraysetlengthTImpl, tiargs);
id = new DotIdExp(ale.loc, id, hook);
id = id.expressionSemantic(sc);
auto arguments = new Expressions();
arguments.reserve(5);
if (global.params.tracegc)
{
auto funcname = (sc.callsc && sc.callsc.func) ? sc.callsc.func.toPrettyChars() : sc.func.toPrettyChars();
arguments.push(new StringExp(exp.loc, exp.loc.filename.toDString()));
arguments.push(new IntegerExp(exp.loc, exp.loc.linnum, Type.tint32));
arguments.push(new StringExp(exp.loc, funcname.toDString()));
}
arguments.push(ale.e1);
arguments.push(exp.e2);
Expression ce = new CallExp(ale.loc, id, arguments).expressionSemantic(sc);
auto res = new LoweredAssignExp(exp, ce);
// if (global.params.verbose)
// message("lowered %s =>\n %s", exp.toChars(), res.toChars());
res.type = Type.tsize_t;
return setResult(res);
}
else if (auto se = exp.e1.isSliceExp())
{
Type tn = se.type.nextOf();
const fun = sc.func;
if (exp.op == EXP.assign && !tn.isMutable() &&
// allow modifiation in module ctor, see
// https://issues.dlang.org/show_bug.cgi?id=9884
(!fun || (fun && !fun.isStaticCtorDeclaration())))
{
exp.error("slice `%s` is not mutable", se.toChars());
return setError();
}
if (exp.op == EXP.assign && !tn.baseElemOf().isAssignable())
{
exp.error("slice `%s` is not mutable, struct `%s` has immutable members",
exp.e1.toChars(), tn.baseElemOf().toChars());
result = ErrorExp.get();
return;
}
// For conditional operator, both branches need conversion.
while (se.e1.op == EXP.slice)
se = cast(SliceExp)se.e1;
if (se.e1.op == EXP.question && se.e1.type.toBasetype().ty == Tsarray)
{
se.e1 = se.e1.modifiableLvalue(sc, exp.e1);
if (se.e1.op == EXP.error)
return setResult(se.e1);
}
}
else
{
if (t1.ty == Tsarray && exp.op == EXP.assign)
{
Type tn = exp.e1.type.nextOf();
if (tn && !tn.baseElemOf().isAssignable())
{
exp.error("array `%s` is not mutable, struct `%s` has immutable members",
exp.e1.toChars(), tn.baseElemOf().toChars());
result = ErrorExp.get();
return;
}
}
Expression e1x = exp.e1;
// Try to do a decent error message with the expression
// before it gets constant folded
if (exp.op == EXP.assign)
e1x = e1x.modifiableLvalue(sc, e1old);
e1x = e1x.optimize(WANTvalue, /*keepLvalue*/ true);
if (e1x.op == EXP.error)
{
result = e1x;
return;
}
exp.e1 = e1x;
}
/* Tweak e2 based on the type of e1.
*/
Expression e2x = exp.e2;
Type t2 = e2x.type.toBasetype();
// If it is a array, get the element type. Note that it may be
// multi-dimensional.
Type telem = t1;
while (telem.ty == Tarray)
telem = telem.nextOf();
if (exp.e1.op == EXP.slice && t1.nextOf() &&
(telem.ty != Tvoid || e2x.op == EXP.null_) &&
e2x.implicitConvTo(t1.nextOf()))
{
// Check for block assignment. If it is of type void[], void[][], etc,
// '= null' is the only allowable block assignment (Bug 7493)
exp.memset = MemorySet.blockAssign; // make it easy for back end to tell what this is
e2x = e2x.implicitCastTo(sc, t1.nextOf());
if (exp.op != EXP.blit && e2x.isLvalue() && exp.e1.checkPostblit(sc, t1.nextOf()))
return setError();
}
else if (exp.e1.op == EXP.slice &&
(t2.ty == Tarray || t2.ty == Tsarray) &&
t2.nextOf().implicitConvTo(t1.nextOf()))
{
// Check element-wise assignment.
/* If assigned elements number is known at compile time,
* check the mismatch.
*/
SliceExp se1 = cast(SliceExp)exp.e1;
TypeSArray tsa1 = cast(TypeSArray)toStaticArrayType(se1);
TypeSArray tsa2 = null;
if (auto ale = e2x.isArrayLiteralExp())
tsa2 = cast(TypeSArray)t2.nextOf().sarrayOf(ale.elements.length);
else if (auto se = e2x.isSliceExp())
tsa2 = cast(TypeSArray)toStaticArrayType(se);
else
tsa2 = t2.isTypeSArray();
if (tsa1 && tsa2)
{
uinteger_t dim1 = tsa1.dim.toInteger();
uinteger_t dim2 = tsa2.dim.toInteger();
if (dim1 != dim2)
{
exp.error("mismatched array lengths %d and %d for assignment `%s`", cast(int)dim1, cast(int)dim2, exp.toChars());
return setError();
}
}
if (exp.op != EXP.blit &&
(e2x.op == EXP.slice && (cast(UnaExp)e2x).e1.isLvalue() ||
e2x.op == EXP.cast_ && (cast(UnaExp)e2x).e1.isLvalue() ||
e2x.op != EXP.slice && e2x.isLvalue()))
{
if (exp.e1.checkPostblit(sc, t1.nextOf()))
return setError();
}
if (0 && global.params.warnings != DiagnosticReporting.off && !global.gag && exp.op == EXP.assign &&
e2x.op != EXP.slice && e2x.op != EXP.assign &&
e2x.op != EXP.arrayLiteral && e2x.op != EXP.string_ &&
!(e2x.op == EXP.add || e2x.op == EXP.min ||
e2x.op == EXP.mul || e2x.op == EXP.div ||
e2x.op == EXP.mod || e2x.op == EXP.xor ||
e2x.op == EXP.and || e2x.op == EXP.or ||
e2x.op == EXP.pow ||
e2x.op == EXP.tilde || e2x.op == EXP.negate))
{
const(char)* e1str = exp.e1.toChars();
const(char)* e2str = e2x.toChars();
exp.warning("explicit element-wise assignment `%s = (%s)[]` is better than `%s = %s`", e1str, e2str, e1str, e2str);
}
Type t2n = t2.nextOf();
Type t1n = t1.nextOf();
int offset;
if (t2n.equivalent(t1n) ||
t1n.isBaseOf(t2n, &offset) && offset == 0)
{
/* Allow copy of distinct qualifier elements.
* eg.
* char[] dst; const(char)[] src;
* dst[] = src;
*
* class C {} class D : C {}
* C[2] ca; D[] da;
* ca[] = da;
*/
if (isArrayOpValid(e2x))
{
// Don't add CastExp to keep AST for array operations
e2x = e2x.copy();
e2x.type = exp.e1.type.constOf();
}
else
e2x = e2x.castTo(sc, exp.e1.type.constOf());
}
else
{
/* https://issues.dlang.org/show_bug.cgi?id=15778
* A string literal has an array type of immutable
* elements by default, and normally it cannot be convertible to
* array type of mutable elements. But for element-wise assignment,
* elements need to be const at best. So we should give a chance
* to change code unit size for polysemous string literal.
*/
if (e2x.op == EXP.string_)
e2x = e2x.implicitCastTo(sc, exp.e1.type.constOf());
else
e2x = e2x.implicitCastTo(sc, exp.e1.type);
}
if (t1n.toBasetype.ty == Tvoid && t2n.toBasetype.ty == Tvoid)
{
if (sc.setUnsafe(false, exp.loc, "cannot copy `void[]` to `void[]` in `@safe` code"))
return setError();
}
}
else
{
if (0 && global.params.warnings != DiagnosticReporting.off && !global.gag && exp.op == EXP.assign &&
t1.ty == Tarray && t2.ty == Tsarray &&
e2x.op != EXP.slice &&
t2.implicitConvTo(t1))
{
// Disallow ar[] = sa (Converted to ar[] = sa[])
// Disallow da = sa (Converted to da = sa[])
const(char)* e1str = exp.e1.toChars();
const(char)* e2str = e2x.toChars();
const(char)* atypestr = exp.e1.op == EXP.slice ? "element-wise" : "slice";
exp.warning("explicit %s assignment `%s = (%s)[]` is better than `%s = %s`", atypestr, e1str, e2str, e1str, e2str);
}
if (exp.op == EXP.blit)
e2x = e2x.castTo(sc, exp.e1.type);
else
{
e2x = e2x.implicitCastTo(sc, exp.e1.type);
// Fix Issue 13435: https://issues.dlang.org/show_bug.cgi?id=13435
// If the implicit cast has failed and the assign expression is
// the initialization of a struct member field
if (e2x.op == EXP.error && exp.op == EXP.construct && t1.ty == Tstruct)
{
scope sd = (cast(TypeStruct)t1).sym;
Dsymbol opAssign = search_function(sd, Id.assign);
// and the struct defines an opAssign
if (opAssign)
{
// offer more information about the cause of the problem
errorSupplemental(exp.loc,
"`%s` is the first assignment of `%s` therefore it represents its initialization",
exp.toChars(), exp.e1.toChars());
errorSupplemental(exp.loc,
"`opAssign` methods are not used for initialization, but for subsequent assignments");
}
}
}
}
if (e2x.op == EXP.error)
{
result = e2x;
return;
}
exp.e2 = e2x;
t2 = exp.e2.type.toBasetype();
/* Look for array operations
*/
if ((t2.ty == Tarray || t2.ty == Tsarray) && isArrayOpValid(exp.e2))
{
// Look for valid array operations
if (exp.memset != MemorySet.blockAssign &&
exp.e1.op == EXP.slice &&
(isUnaArrayOp(exp.e2.op) || isBinArrayOp(exp.e2.op)))
{
exp.type = exp.e1.type;
if (exp.op == EXP.construct) // https://issues.dlang.org/show_bug.cgi?id=10282
// tweak mutability of e1 element
exp.e1.type = exp.e1.type.nextOf().mutableOf().arrayOf();
result = arrayOp(exp, sc);
return;
}
// Drop invalid array operations in e2
// d = a[] + b[], d = (a[] + b[])[0..2], etc
if (checkNonAssignmentArrayOp(exp.e2, exp.memset != MemorySet.blockAssign && exp.op == EXP.assign))
return setError();
// Remains valid array assignments
// d = d[], d = [1,2,3], etc
}
/* Don't allow assignment to classes that were allocated on the stack with:
* scope Class c = new Class();
*/
if (exp.e1.op == EXP.variable && exp.op == EXP.assign)
{
VarExp ve = cast(VarExp)exp.e1;
VarDeclaration vd = ve.var.isVarDeclaration();
if (vd && vd.onstack)
{
assert(t1.ty == Tclass);
exp.error("cannot rebind scope variables");
}
}
if (exp.e1.op == EXP.variable && (cast(VarExp)exp.e1).var.ident == Id.ctfe)
{
exp.error("cannot modify compiler-generated variable `__ctfe`");
}
exp.type = exp.e1.type;
assert(exp.type);
auto assignElem = exp.e2;
auto res = exp.op == EXP.assign ? exp.reorderSettingAAElem(sc) : exp;
/* https://issues.dlang.org/show_bug.cgi?id=22366
*
* `reorderSettingAAElem` creates a tree of comma expressions, however,
* `checkAssignExp` expects only AssignExps.
*/
if (res == exp) // no `AA[k] = v` rewrite was performed
checkAssignEscape(sc, res, false, false);
else
checkNewEscape(sc, assignElem, false); // assigning to AA puts it on heap
if (auto ae = res.isConstructExp())
{
Type t1b = ae.e1.type.toBasetype();
if (t1b.ty != Tsarray && t1b.ty != Tarray)
return setResult(res);
// only non-trivial array constructions may need to be lowered (non-POD elements basically)
Type t1e = t1b.nextOf();
TypeStruct ts = t1e.baseElemOf().isTypeStruct();
if (!ts || (!ts.sym.postblit && !ts.sym.hasCopyCtor && !ts.sym.dtor))
return setResult(res);
// don't lower ref-constructions etc.
if (!(t1b.ty == Tsarray || ae.e1.isSliceExp) ||
(ae.e1.isVarExp && ae.e1.isVarExp.var.isVarDeclaration.isReference))
return setResult(res);
// Construction from an equivalent other array?
// Only lower with lvalue RHS elements; let the glue layer move rvalue elements.
Type t2b = ae.e2.type.toBasetype();
// skip over a (possibly implicit) cast of a static array RHS to a slice
Expression rhs = ae.e2;
Type rhsType = t2b;
if (t2b.ty == Tarray)
{
if (auto ce = rhs.isCastExp())
{
auto ct = ce.e1.type.toBasetype();
if (ct.ty == Tsarray)
{
rhs = ce.e1;
rhsType = ct;
}
}
}
if (!sc.needsCodegen()) // interpreter can handle these
return setResult(res);
const lowerToArrayCtor =
( (rhsType.ty == Tarray && !rhs.isArrayLiteralExp) ||
(rhsType.ty == Tsarray && rhs.isLvalue) ) &&
t1e.equivalent(t2b.nextOf);
// Construction from a single element?
// If the RHS is an rvalue, then we'll need to make a temporary for it (copied multiple times).
const lowerToArraySetCtor = !lowerToArrayCtor && t1e.equivalent(t2b);
if (lowerToArrayCtor || lowerToArraySetCtor)
{
auto func = lowerToArrayCtor ? Id._d_arrayctor : Id._d_arraysetctor;
const other = lowerToArrayCtor ? "other array" : "value";
if (!verifyHookExist(exp.loc, *sc, func, "construct array with " ~ other, Id.object))
return setError();
// Lower to object._d_array{,set}ctor(e1, e2)
Expression id = new IdentifierExp(exp.loc, Id.empty);
id = new DotIdExp(exp.loc, id, Id.object);
id = new DotIdExp(exp.loc, id, func);
auto arguments = new Expressions();
arguments.push(new CastExp(ae.loc, ae.e1, t1e.arrayOf).expressionSemantic(sc));
if (lowerToArrayCtor)
{
arguments.push(new CastExp(ae.loc, rhs, t2b.nextOf.arrayOf).expressionSemantic(sc));
Expression ce = new CallExp(exp.loc, id, arguments);
res = ce.expressionSemantic(sc);
}
else
{
Expression e0;
// promote an rvalue RHS element to a temporary, it's passed by ref to _d_arraysetctor
if (!ae.e2.isLvalue)
{
auto vd = copyToTemp(STC.scope_, "__setctor", ae.e2);
e0 = new DeclarationExp(vd.loc, vd).expressionSemantic(sc);
arguments.push(new VarExp(vd.loc, vd).expressionSemantic(sc));
}
else
arguments.push(ae.e2);
Expression ce = new CallExp(exp.loc, id, arguments);
res = Expression.combine(e0, ce).expressionSemantic(sc);
}
if (global.params.verbose)
message("lowered %s =>\n %s", exp.toChars(), res.toChars());
}
}
else if (auto ae = res.isAssignExp())
res = lowerArrayAssign(ae);
else if (auto ce = res.isCommaExp())
{
if (auto ae1 = ce.e1.isAssignExp())
ce.e1 = lowerArrayAssign(ae1, true);
if (auto ae2 = ce.e2.isAssignExp())
ce.e2 = lowerArrayAssign(ae2, true);
}
return setResult(res);
}
/***************************************
* Lower AssignExp to `_d_array{setassign,assign_l,assign_r}` if needed.
*
* Params:
* ae = the AssignExp to be lowered
* fromCommaExp = indicates whether `ae` is part of a CommaExp or not,
* so no unnecessary temporay variable is created.
* Returns:
* a CommaExp contiaining call a to `_d_array{setassign,assign_l,assign_r}`
* if needed or `ae` otherwise
*/
private Expression lowerArrayAssign(AssignExp ae, bool fromCommaExp = false)
{
Type t1b = ae.e1.type.toBasetype();
if (t1b.ty != Tsarray && t1b.ty != Tarray)
return ae;
const isArrayAssign = (ae.e1.isSliceExp() || ae.e1.type.ty == Tsarray) &&
(ae.e2.type.ty == Tsarray || ae.e2.type.ty == Tarray) &&
(ae.e1.type.nextOf() && ae.e2.type.nextOf() && ae.e1.type.nextOf.mutableOf.equals(ae.e2.type.nextOf.mutableOf()));
const isArraySetAssign = (ae.e1.isSliceExp() || ae.e1.type.ty == Tsarray) &&
(ae.e1.type.nextOf() && ae.e2.type.implicitConvTo(ae.e1.type.nextOf()));
if (!isArrayAssign && !isArraySetAssign)
return ae;
const ts = t1b.nextOf().baseElemOf().isTypeStruct();
if (!ts || (!ts.sym.postblit && !ts.sym.dtor))
return ae;
Expression res;
Identifier func = isArraySetAssign ? Id._d_arraysetassign :
ae.e2.isLvalue() || ae.e2.isSliceExp() ? Id._d_arrayassign_l : Id._d_arrayassign_r;
// Lower to `.object._d_array{setassign,assign_l,assign_r}(e1, e2)``
Expression id = new IdentifierExp(ae.loc, Id.empty);
id = new DotIdExp(ae.loc, id, Id.object);
id = new DotIdExp(ae.loc, id, func);
auto arguments = new Expressions();
arguments.push(new CastExp(ae.loc, ae.e1, ae.e1.type.nextOf.arrayOf)
.expressionSemantic(sc));
Expression eValue2, value2 = ae.e2;
if (isArrayAssign && value2.isLvalue())
value2 = new CastExp(ae.loc, ae.e2, ae.e2.type.nextOf.arrayOf())
.expressionSemantic(sc);
else if (!fromCommaExp &&
(isArrayAssign || (isArraySetAssign && !value2.isLvalue())))
{
// Rvalues from CommaExps were introduced in `visit(AssignExp)`
// and are temporary variables themselves. Rvalues from trivial
// SliceExps are simply passed by reference without any copying.
// `__assigntmp` will be destroyed together with the array `ae.e1`.
// When `ae.e2` is a variadic arg array, it is also `scope`, so
// `__assigntmp` may also be scope.
StorageClass stc = STC.nodtor;
if (isArrayAssign)
stc |= STC.rvalue | STC.scope_;
auto vd = copyToTemp(stc, "__assigntmp", ae.e2);
eValue2 = new DeclarationExp(vd.loc, vd).expressionSemantic(sc);
value2 = new VarExp(vd.loc, vd).expressionSemantic(sc);
}
arguments.push(value2);
Expression ce = new CallExp(ae.loc, id, arguments);
res = Expression.combine(eValue2, ce).expressionSemantic(sc);
if (isArrayAssign)
res = Expression.combine(res, ae.e1).expressionSemantic(sc);
if (global.params.verbose)
message("lowered %s =>\n %s", ae.toChars(), res.toChars());
res = new LoweredAssignExp(ae, res);
res.type = ae.type;
return res;
}
override void visit(PowAssignExp exp)
{
if (exp.type)
{
result = exp;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.e1.checkReadModifyWrite(exp.op, exp.e2))
return setError();
assert(exp.e1.type && exp.e2.type);
if (exp.e1.op == EXP.slice || exp.e1.type.ty == Tarray || exp.e1.type.ty == Tsarray)
{
if (checkNonAssignmentArrayOp(exp.e1))
return setError();
// T[] ^^= ...
if (exp.e2.implicitConvTo(exp.e1.type.nextOf()))
{
// T[] ^^= T
exp.e2 = exp.e2.castTo(sc, exp.e1.type.nextOf());
}
else if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
// Check element types are arithmetic
Type tb1 = exp.e1.type.nextOf().toBasetype();
Type tb2 = exp.e2.type.toBasetype();
if (tb2.ty == Tarray || tb2.ty == Tsarray)
tb2 = tb2.nextOf().toBasetype();
if ((tb1.isintegral() || tb1.isfloating()) && (tb2.isintegral() || tb2.isfloating()))
{
exp.type = exp.e1.type;
result = arrayOp(exp, sc);
return;
}
}
else
{
exp.e1 = exp.e1.modifiableLvalue(sc, exp.e1);
}
if ((exp.e1.type.isintegral() || exp.e1.type.isfloating()) && (exp.e2.type.isintegral() || exp.e2.type.isfloating()))
{
Expression e0 = null;
e = exp.reorderSettingAAElem(sc);
e = Expression.extractLast(e, e0);
assert(e == exp);
if (exp.e1.op == EXP.variable)
{
// Rewrite: e1 = e1 ^^ e2
e = new PowExp(exp.loc, exp.e1.syntaxCopy(), exp.e2);
e = new AssignExp(exp.loc, exp.e1, e);
}
else
{
// Rewrite: ref tmp = e1; tmp = tmp ^^ e2
auto v = copyToTemp(STC.ref_, "__powtmp", exp.e1);
auto de = new DeclarationExp(exp.e1.loc, v);
auto ve = new VarExp(exp.e1.loc, v);
e = new PowExp(exp.loc, ve, exp.e2);
e = new AssignExp(exp.loc, new VarExp(exp.e1.loc, v), e);
e = new CommaExp(exp.loc, de, e);
}
e = Expression.combine(e0, e);
e = e.expressionSemantic(sc);
result = e;
return;
}
result = exp.incompatibleTypes();
}
override void visit(CatAssignExp exp)
{
if (exp.type)
{
result = exp;
return;
}
//printf("CatAssignExp::semantic() %s\n", exp.toChars());
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (SliceExp se = exp.e1.isSliceExp())
{
if (se.e1.type.toBasetype().ty == Tsarray)
{
exp.error("cannot append to static array `%s`", se.e1.type.toChars());
return setError();
}
}
exp.e1 = exp.e1.modifiableLvalue(sc, exp.e1);
if (exp.e1.op == EXP.error)
{
result = exp.e1;
return;
}
if (exp.e2.op == EXP.error)
{
result = exp.e2;
return;
}
if (checkNonAssignmentArrayOp(exp.e2))
return setError();
Type tb1 = exp.e1.type.toBasetype();
Type tb1next = tb1.nextOf();
Type tb2 = exp.e2.type.toBasetype();
/* Possibilities:
* EXP.concatenateAssign: appending T[] to T[]
* EXP.concatenateElemAssign: appending T to T[]
* EXP.concatenateDcharAssign: appending dchar to T[]
*/
if ((tb1.ty == Tarray) &&
(tb2.ty == Tarray || tb2.ty == Tsarray) &&
(exp.e2.implicitConvTo(exp.e1.type) ||
(tb2.nextOf().implicitConvTo(tb1next) &&
(tb2.nextOf().size(Loc.initial) == tb1next.size(Loc.initial)))))
{
// EXP.concatenateAssign
assert(exp.op == EXP.concatenateAssign);
if (exp.e1.checkPostblit(sc, tb1next))
return setError();
exp.e2 = exp.e2.castTo(sc, exp.e1.type);
}
else if ((tb1.ty == Tarray) && exp.e2.implicitConvTo(tb1next))
{
/* https://issues.dlang.org/show_bug.cgi?id=19782
*
* If e2 is implicitly convertible to tb1next, the conversion
* might be done through alias this, in which case, e2 needs to
* be modified accordingly (e2 => e2.aliasthis).
*/
if (tb2.ty == Tstruct && (cast(TypeStruct)tb2).implicitConvToThroughAliasThis(tb1next))
goto Laliasthis;
if (tb2.ty == Tclass && (cast(TypeClass)tb2).implicitConvToThroughAliasThis(tb1next))
goto Laliasthis;
// Append element
if (exp.e2.checkPostblit(sc, tb2))
return setError();
if (checkNewEscape(sc, exp.e2, false))
return setError();
exp = new CatElemAssignExp(exp.loc, exp.type, exp.e1, exp.e2.castTo(sc, tb1next));
exp.e2 = doCopyOrMove(sc, exp.e2);
}
else if (tb1.ty == Tarray &&
(tb1next.ty == Tchar || tb1next.ty == Twchar) &&
exp.e2.type.ty != tb1next.ty &&
exp.e2.implicitConvTo(Type.tdchar))
{
// Append dchar to char[] or wchar[]
exp = new CatDcharAssignExp(exp.loc, exp.type, exp.e1, exp.e2.castTo(sc, Type.tdchar));
/* Do not allow appending wchar to char[] because if wchar happens
* to be a surrogate pair, nothing good can result.
*/
}
else
{
// Try alias this on first operand
static Expression tryAliasThisForLhs(BinAssignExp exp, Scope* sc)
{
AggregateDeclaration ad1 = isAggregate(exp.e1.type);
if (!ad1 || !ad1.aliasthis)
return null;
/* Rewrite (e1 op e2) as:
* (e1.aliasthis op e2)
*/
if (isRecursiveAliasThis(exp.att1, exp.e1.type))
return null;
//printf("att %s e1 = %s\n", Token.toChars(e.op), e.e1.type.toChars());
Expression e1 = new DotIdExp(exp.loc, exp.e1, ad1.aliasthis.ident);
BinExp be = cast(BinExp)exp.copy();
be.e1 = e1;
return be.trySemantic(sc);
}
// Try alias this on second operand
static Expression tryAliasThisForRhs(BinAssignExp exp, Scope* sc)
{
AggregateDeclaration ad2 = isAggregate(exp.e2.type);
if (!ad2 || !ad2.aliasthis)
return null;
/* Rewrite (e1 op e2) as:
* (e1 op e2.aliasthis)
*/
if (isRecursiveAliasThis(exp.att2, exp.e2.type))
return null;
//printf("att %s e2 = %s\n", Token.toChars(e.op), e.e2.type.toChars());
Expression e2 = new DotIdExp(exp.loc, exp.e2, ad2.aliasthis.ident);
BinExp be = cast(BinExp)exp.copy();
be.e2 = e2;
return be.trySemantic(sc);
}
Laliasthis:
result = tryAliasThisForLhs(exp, sc);
if (result)
return;
result = tryAliasThisForRhs(exp, sc);
if (result)
return;
exp.error("cannot append type `%s` to type `%s`", tb2.toChars(), tb1.toChars());
return setError();
}
if (exp.e2.checkValue() || exp.e2.checkSharedAccess(sc))
return setError();
exp.type = exp.e1.type;
auto assignElem = exp.e2;
auto res = exp.reorderSettingAAElem(sc);
if (res != exp) // `AA[k] = v` rewrite was performed
checkNewEscape(sc, assignElem, false);
else if (exp.op == EXP.concatenateElemAssign || exp.op == EXP.concatenateDcharAssign)
checkAssignEscape(sc, res, false, false);
result = res;
if ((exp.op == EXP.concatenateAssign || exp.op == EXP.concatenateElemAssign) &&
sc.needsCodegen())
{
// if aa ordering is triggered, `res` will be a CommaExp
// and `.e2` will be the rewritten original expression.
// `output` will point to the expression that the lowering will overwrite
Expression* output;
if (auto comma = res.isCommaExp())
{
output = &comma.e2;
// manual cast because it could be either CatAssignExp or CatElemAssignExp
exp = cast(CatAssignExp)comma.e2;
}
else
{
output = &result;
exp = cast(CatAssignExp)result;
}
if (exp.op == EXP.concatenateAssign)
{
Identifier hook = global.params.tracegc ? Id._d_arrayappendTTrace : Id._d_arrayappendT;
if (!verifyHookExist(exp.loc, *sc, hook, "appending array to arrays", Id.object))
return setError();
// Lower to object._d_arrayappendT{,Trace}({file, line, funcname}, e1, e2)
Expression id = new IdentifierExp(exp.loc, Id.empty);
id = new DotIdExp(exp.loc, id, Id.object);
id = new DotIdExp(exp.loc, id, hook);
auto arguments = new Expressions();
arguments.reserve(5);
if (global.params.tracegc)
{
auto funcname = (sc.callsc && sc.callsc.func) ? sc.callsc.func.toPrettyChars() : sc.func.toPrettyChars();
arguments.push(new StringExp(exp.loc, exp.loc.filename.toDString()));
arguments.push(new IntegerExp(exp.loc, exp.loc.linnum, Type.tint32));
arguments.push(new StringExp(exp.loc, funcname.toDString()));
}
arguments.push(exp.e1);
arguments.push(exp.e2);
Expression ce = new CallExp(exp.loc, id, arguments);
*output = ce.expressionSemantic(sc);
}
else if (exp.op == EXP.concatenateElemAssign)
{
/* Do not lower concats to the indices array returned by
*`static foreach`, as this array is only used at compile-time.
*/
if (auto ve = exp.e1.isVarExp)
{
import core.stdc.ctype : isdigit;
// The name of the indices array that static foreach loops uses.
// See dmd.cond.lowerNonArrayAggregate
enum varName = "__res";
const(char)[] id = ve.var.ident.toString;
if (ve.var.storage_class & STC.temp && id.length > varName.length &&
id[0 .. varName.length] == varName && id[varName.length].isdigit)
return;
}
Identifier hook = global.params.tracegc ? Id._d_arrayappendcTXTrace : Id._d_arrayappendcTX;
if (!verifyHookExist(exp.loc, *sc, Id._d_arrayappendcTXImpl, "appending element to arrays", Id.object))
return setError();
// Lower to object._d_arrayappendcTXImpl!(typeof(e1))._d_arrayappendcTX{,Trace}(e1, 1), e1[$-1]=e2
Expression id = new IdentifierExp(exp.loc, Id.empty);
id = new DotIdExp(exp.loc, id, Id.object);
auto tiargs = new Objects();
tiargs.push(exp.e1.type);
id = new DotTemplateInstanceExp(exp.loc, id, Id._d_arrayappendcTXImpl, tiargs);
id = new DotIdExp(exp.loc, id, hook);
auto arguments = new Expressions();
arguments.reserve(5);
if (global.params.tracegc)
{
auto funcname = (sc.callsc && sc.callsc.func) ? sc.callsc.func.toPrettyChars() : sc.func.toPrettyChars();
arguments.push(new StringExp(exp.loc, exp.loc.filename.toDString()));
arguments.push(new IntegerExp(exp.loc, exp.loc.linnum, Type.tint32));
arguments.push(new StringExp(exp.loc, funcname.toDString()));
}
Expression eValue1;
Expression value1 = extractSideEffect(sc, "__appendtmp", eValue1, exp.e1);
arguments.push(value1);
arguments.push(new IntegerExp(exp.loc, 1, Type.tsize_t));
Expression ce = new CallExp(exp.loc, id, arguments);
Expression eValue2;
Expression value2 = exp.e2;
if (!value2.isVarExp() && !value2.isConst())
{
/* Before the template hook, this check was performed in e2ir.d
* for expressions like `a ~= a[$-1]`. Here, $ will be modified
* by calling `_d_arrayappendcT`, so we need to save `a[$-1]` in
* a temporary variable.
*/
value2 = extractSideEffect(sc, "__appendtmp", eValue2, value2, true);
exp.e2 = value2;
// `__appendtmp*` will be destroyed together with the array `exp.e1`.
auto vd = eValue2.isDeclarationExp().declaration.isVarDeclaration();
vd.storage_class |= STC.nodtor;
// Be more explicit that this "declaration" is local to the expression
vd.storage_class |= STC.exptemp;
}
auto ale = new ArrayLengthExp(exp.loc, value1);
auto elem = new IndexExp(exp.loc, value1, new MinExp(exp.loc, ale, IntegerExp.literal!1));
auto ae = new ConstructExp(exp.loc, elem, value2);
auto e0 = Expression.combine(ce, ae).expressionSemantic(sc);
e0 = Expression.combine(e0, value1);
e0 = Expression.combine(eValue1, e0);
e0 = Expression.combine(eValue2, e0);
*output = e0.expressionSemantic(sc);
}
}
}
override void visit(AddExp exp)
{
static if (LOGSEMANTIC)
{
printf("AddExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
/* ImportC: convert arrays to pointers, functions to pointers to functions
*/
exp.e1 = exp.e1.arrayFuncConv(sc);
exp.e2 = exp.e2.arrayFuncConv(sc);
Type tb1 = exp.e1.type.toBasetype();
Type tb2 = exp.e2.type.toBasetype();
bool err = false;
if (tb1.ty == Tdelegate || tb1.isPtrToFunction())
{
err |= exp.e1.checkArithmetic() || exp.e1.checkSharedAccess(sc);
}
if (tb2.ty == Tdelegate || tb2.isPtrToFunction())
{
err |= exp.e2.checkArithmetic() || exp.e2.checkSharedAccess(sc);
}
if (err)
return setError();
if (tb1.ty == Tpointer && exp.e2.type.isintegral() || tb2.ty == Tpointer && exp.e1.type.isintegral())
{
result = scaleFactor(exp, sc);
return;
}
if (tb1.ty == Tpointer && tb2.ty == Tpointer)
{
result = exp.incompatibleTypes();
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
tb1 = exp.e1.type.toBasetype();
if (!target.isVectorOpSupported(tb1, exp.op, tb2))
{
result = exp.incompatibleTypes();
return;
}
if ((tb1.isreal() && exp.e2.type.isimaginary()) || (tb1.isimaginary() && exp.e2.type.isreal()))
{
switch (exp.type.toBasetype().ty)
{
case Tfloat32:
case Timaginary32:
exp.type = Type.tcomplex32;
break;
case Tfloat64:
case Timaginary64:
exp.type = Type.tcomplex64;
break;
case Tfloat80:
case Timaginary80:
exp.type = Type.tcomplex80;
break;
default:
assert(0);
}
}
result = exp;
}
override void visit(MinExp exp)
{
static if (LOGSEMANTIC)
{
printf("MinExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
/* ImportC: convert arrays to pointers, functions to pointers to functions
*/
exp.e1 = exp.e1.arrayFuncConv(sc);
exp.e2 = exp.e2.arrayFuncConv(sc);
Type t1 = exp.e1.type.toBasetype();
Type t2 = exp.e2.type.toBasetype();
bool err = false;
if (t1.ty == Tdelegate || t1.isPtrToFunction())
{
err |= exp.e1.checkArithmetic() || exp.e1.checkSharedAccess(sc);
}
if (t2.ty == Tdelegate || t2.isPtrToFunction())
{
err |= exp.e2.checkArithmetic() || exp.e2.checkSharedAccess(sc);
}
if (err)
return setError();
if (t1.ty == Tpointer)
{
if (t2.ty == Tpointer)
{
// https://dlang.org/spec/expression.html#add_expressions
// "If both operands are pointers, and the operator is -, the pointers are
// subtracted and the result is divided by the size of the type pointed to
// by the operands. It is an error if the pointers point to different types."
Type p1 = t1.nextOf();
Type p2 = t2.nextOf();
if (!p1.equivalent(p2))
{
// Deprecation to remain for at least a year, after which this should be
// changed to an error
// See https://github.com/dlang/dmd/pull/7332
deprecation(exp.loc,
"cannot subtract pointers to different types: `%s` and `%s`.",
t1.toChars(), t2.toChars());
}
// Need to divide the result by the stride
// Replace (ptr - ptr) with (ptr - ptr) / stride
long stride;
// make sure pointer types are compatible
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
exp.type = Type.tptrdiff_t;
stride = t2.nextOf().size();
if (stride == 0)
{
e = new IntegerExp(exp.loc, 0, Type.tptrdiff_t);
}
else if (stride == cast(long)SIZE_INVALID)
e = ErrorExp.get();
else
{
e = new DivExp(exp.loc, exp, new IntegerExp(Loc.initial, stride, Type.tptrdiff_t));
e.type = Type.tptrdiff_t;
}
}
else if (t2.isintegral())
e = scaleFactor(exp, sc);
else
{
exp.error("can't subtract `%s` from pointer", t2.toChars());
e = ErrorExp.get();
}
result = e;
return;
}
if (t2.ty == Tpointer)
{
exp.type = exp.e2.type;
exp.error("can't subtract pointer from `%s`", exp.e1.type.toChars());
return setError();
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
t1 = exp.e1.type.toBasetype();
t2 = exp.e2.type.toBasetype();
if (!target.isVectorOpSupported(t1, exp.op, t2))
{
result = exp.incompatibleTypes();
return;
}
if ((t1.isreal() && t2.isimaginary()) || (t1.isimaginary() && t2.isreal()))
{
switch (exp.type.ty)
{
case Tfloat32:
case Timaginary32:
exp.type = Type.tcomplex32;
break;
case Tfloat64:
case Timaginary64:
exp.type = Type.tcomplex64;
break;
case Tfloat80:
case Timaginary80:
exp.type = Type.tcomplex80;
break;
default:
assert(0);
}
}
result = exp;
return;
}
/**
* If the given expression is a `CatExp`, the function tries to lower it to
* `_d_arraycatnTX`.
*
* Params:
* ee = the `CatExp` to lower
* Returns:
* `_d_arraycatnTX(e1, e2, ..., en)` if `ee` is `e1 ~ e2 ~ ... en`
* `ee` otherwise
*/
private Expression lowerToArrayCat(CatExp exp)
{
// String literals are concatenated by the compiler. No lowering is needed.
if ((exp.e1.isStringExp() && (exp.e2.isIntegerExp() || exp.e2.isStringExp())) ||
(exp.e2.isStringExp() && (exp.e1.isIntegerExp() || exp.e1.isStringExp())))
return exp;
Identifier hook = global.params.tracegc ? Id._d_arraycatnTXTrace : Id._d_arraycatnTX;
if (!verifyHookExist(exp.loc, *sc, hook, "concatenating arrays"))
{
setError();
return result;
}
void handleCatArgument(Expressions *arguments, Expression e)
{
if (auto ce = e.isCatExp())
{
Expression lowering = ce.lowering;
/* Skip `file`, `line`, and `funcname` if the hook of the parent
* `CatExp` is `_d_arraycatnTXTrace`.
*/
if (auto callExp = isRuntimeHook(lowering, hook))
{
if (hook == Id._d_arraycatnTX)
arguments.pushSlice((*callExp.arguments)[]);
else
arguments.pushSlice((*callExp.arguments)[3 .. $]);
}
}
else
arguments.push(e);
}
auto arguments = new Expressions();
if (global.params.tracegc)
{
auto funcname = (sc.callsc && sc.callsc.func) ?
sc.callsc.func.toPrettyChars() : sc.func.toPrettyChars();
arguments.push(new StringExp(exp.loc, exp.loc.filename.toDString()));
arguments.push(new IntegerExp(exp.loc, exp.loc.linnum, Type.tint32));
arguments.push(new StringExp(exp.loc, funcname.toDString()));
}
handleCatArgument(arguments, exp.e1);
handleCatArgument(arguments, exp.e2);
Expression id = new IdentifierExp(exp.loc, Id.empty);
id = new DotIdExp(exp.loc, id, Id.object);
auto tiargs = new Objects();
tiargs.push(exp.type);
id = new DotTemplateInstanceExp(exp.loc, id, hook, tiargs);
id = new CallExp(exp.loc, id, arguments);
return id.expressionSemantic(sc);
}
void trySetCatExpLowering(Expression exp)
{
/* `_d_arraycatnTX` canot be used with `-betterC`, but `CatExp`s may be
* used with `-betterC`, but only during CTFE.
*/
if (!global.params.useGC || !sc.needsCodegen())
return;
if (auto ce = exp.isCatExp())
ce.lowering = lowerToArrayCat(ce);
}
override void visit(CatExp exp)
{
// https://dlang.org/spec/expression.html#cat_expressions
//printf("CatExp.semantic() %s\n", toChars());
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
Type tb1 = exp.e1.type.toBasetype();
Type tb2 = exp.e2.type.toBasetype();
auto f1 = checkNonAssignmentArrayOp(exp.e1);
auto f2 = checkNonAssignmentArrayOp(exp.e2);
if (f1 || f2)
return setError();
Type tb1next = tb1.nextOf();
Type tb2next = tb2.nextOf();
// Check for: array ~ array
if (tb1next && tb2next && (tb1next.implicitConvTo(tb2next) >= MATCH.constant || tb2next.implicitConvTo(tb1next) >= MATCH.constant || exp.e1.op == EXP.arrayLiteral && exp.e1.implicitConvTo(tb2) || exp.e2.op == EXP.arrayLiteral && exp.e2.implicitConvTo(tb1)))
{
/* https://issues.dlang.org/show_bug.cgi?id=9248
* Here to avoid the case of:
* void*[] a = [cast(void*)1];
* void*[] b = [cast(void*)2];
* a ~ b;
* becoming:
* a ~ [cast(void*)b];
*/
/* https://issues.dlang.org/show_bug.cgi?id=14682
* Also to avoid the case of:
* int[][] a;
* a ~ [];
* becoming:
* a ~ cast(int[])[];
*/
goto Lpeer;
}
// Check for: array ~ element
if ((tb1.ty == Tsarray || tb1.ty == Tarray) && tb2.ty != Tvoid)
{
if (exp.e1.op == EXP.arrayLiteral)
{
exp.e2 = doCopyOrMove(sc, exp.e2);
// https://issues.dlang.org/show_bug.cgi?id=14686
// Postblit call appears in AST, and this is
// finally translated to an ArrayLiteralExp in below optimize().
}
else if (exp.e1.op == EXP.string_)
{
// No postblit call exists on character (integer) value.
}
else
{
if (exp.e2.checkPostblit(sc, tb2))
return setError();
// Postblit call will be done in runtime helper function
}
if (exp.e1.op == EXP.arrayLiteral && exp.e1.implicitConvTo(tb2.arrayOf()))
{
exp.e1 = exp.e1.implicitCastTo(sc, tb2.arrayOf());
exp.type = tb2.arrayOf();
goto L2elem;
}
if (exp.e2.implicitConvTo(tb1next) >= MATCH.convert)
{
exp.e2 = exp.e2.implicitCastTo(sc, tb1next);
exp.type = tb1next.arrayOf();
L2elem:
if (checkNewEscape(sc, exp.e2, false))
return setError();
result = exp.optimize(WANTvalue);
trySetCatExpLowering(result);
return;
}
}
// Check for: element ~ array
if ((tb2.ty == Tsarray || tb2.ty == Tarray) && tb1.ty != Tvoid)
{
if (exp.e2.op == EXP.arrayLiteral)
{
exp.e1 = doCopyOrMove(sc, exp.e1);
}
else if (exp.e2.op == EXP.string_)
{
}
else
{
if (exp.e1.checkPostblit(sc, tb1))
return setError();
}
if (exp.e2.op == EXP.arrayLiteral && exp.e2.implicitConvTo(tb1.arrayOf()))
{
exp.e2 = exp.e2.implicitCastTo(sc, tb1.arrayOf());
exp.type = tb1.arrayOf();
goto L1elem;
}
if (exp.e1.implicitConvTo(tb2next) >= MATCH.convert)
{
exp.e1 = exp.e1.implicitCastTo(sc, tb2next);
exp.type = tb2next.arrayOf();
L1elem:
if (checkNewEscape(sc, exp.e1, false))
return setError();
result = exp.optimize(WANTvalue);
trySetCatExpLowering(result);
return;
}
}
Lpeer:
if ((tb1.ty == Tsarray || tb1.ty == Tarray) && (tb2.ty == Tsarray || tb2.ty == Tarray) && (tb1next.mod || tb2next.mod) && (tb1next.mod != tb2next.mod))
{
Type t1 = tb1next.mutableOf().constOf().arrayOf();
Type t2 = tb2next.mutableOf().constOf().arrayOf();
if (exp.e1.op == EXP.string_ && !(cast(StringExp)exp.e1).committed)
exp.e1.type = t1;
else
exp.e1 = exp.e1.castTo(sc, t1);
if (exp.e2.op == EXP.string_ && !(cast(StringExp)exp.e2).committed)
exp.e2.type = t2;
else
exp.e2 = exp.e2.castTo(sc, t2);
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
trySetCatExpLowering(result);
return;
}
exp.type = exp.type.toHeadMutable();
Type tb = exp.type.toBasetype();
if (tb.ty == Tsarray)
exp.type = tb.nextOf().arrayOf();
if (exp.type.ty == Tarray && tb1next && tb2next && tb1next.mod != tb2next.mod)
{
exp.type = exp.type.nextOf().toHeadMutable().arrayOf();
}
if (Type tbn = tb.nextOf())
{
if (exp.checkPostblit(sc, tbn))
return setError();
}
Type t1 = exp.e1.type.toBasetype();
Type t2 = exp.e2.type.toBasetype();
if ((t1.ty == Tarray || t1.ty == Tsarray) &&
(t2.ty == Tarray || t2.ty == Tsarray))
{
// Normalize to ArrayLiteralExp or StringExp as far as possible
e = exp.optimize(WANTvalue);
}
else
{
//printf("(%s) ~ (%s)\n", e1.toChars(), e2.toChars());
result = exp.incompatibleTypes();
return;
}
result = e;
trySetCatExpLowering(result);
}
override void visit(MulExp exp)
{
version (none)
{
printf("MulExp::semantic() %s\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (exp.checkArithmeticBin() || exp.checkSharedAccessBin(sc))
return setError();
if (exp.type.isfloating())
{
Type t1 = exp.e1.type;
Type t2 = exp.e2.type;
if (t1.isreal())
{
exp.type = t2;
}
else if (t2.isreal())
{
exp.type = t1;
}
else if (t1.isimaginary())
{
if (t2.isimaginary())
{
switch (t1.toBasetype().ty)
{
case Timaginary32:
exp.type = Type.tfloat32;
break;
case Timaginary64:
exp.type = Type.tfloat64;
break;
case Timaginary80:
exp.type = Type.tfloat80;
break;
default:
assert(0);
}
// iy * iv = -yv
exp.e1.type = exp.type;
exp.e2.type = exp.type;
e = new NegExp(exp.loc, exp);
e = e.expressionSemantic(sc);
result = e;
return;
}
else
exp.type = t2; // t2 is complex
}
else if (t2.isimaginary())
{
exp.type = t1; // t1 is complex
}
}
else if (!target.isVectorOpSupported(tb, exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
result = exp;
}
override void visit(DivExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (exp.checkArithmeticBin() || exp.checkSharedAccessBin(sc))
return setError();
if (exp.type.isfloating())
{
Type t1 = exp.e1.type;
Type t2 = exp.e2.type;
if (t1.isreal())
{
exp.type = t2;
if (t2.isimaginary())
{
// x/iv = i(-x/v)
exp.e2.type = t1;
e = new NegExp(exp.loc, exp);
e = e.expressionSemantic(sc);
result = e;
return;
}
}
else if (t2.isreal())
{
exp.type = t1;
}
else if (t1.isimaginary())
{
if (t2.isimaginary())
{
switch (t1.toBasetype().ty)
{
case Timaginary32:
exp.type = Type.tfloat32;
break;
case Timaginary64:
exp.type = Type.tfloat64;
break;
case Timaginary80:
exp.type = Type.tfloat80;
break;
default:
assert(0);
}
}
else
exp.type = t2; // t2 is complex
}
else if (t2.isimaginary())
{
exp.type = t1; // t1 is complex
}
}
else if (!target.isVectorOpSupported(tb, exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
result = exp;
}
override void visit(ModExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (!target.isVectorOpSupported(tb, exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
if (exp.checkArithmeticBin() || exp.checkSharedAccessBin(sc))
return setError();
if (exp.type.isfloating())
{
exp.type = exp.e1.type;
if (exp.e2.type.iscomplex())
{
exp.error("cannot perform modulo complex arithmetic");
return setError();
}
}
result = exp;
}
override void visit(PowExp exp)
{
if (exp.type)
{
result = exp;
return;
}
//printf("PowExp::semantic() %s\n", toChars());
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (exp.checkArithmeticBin() || exp.checkSharedAccessBin(sc))
return setError();
if (!target.isVectorOpSupported(tb, exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
// First, attempt to fold the expression.
e = exp.optimize(WANTvalue);
if (e.op != EXP.pow)
{
e = e.expressionSemantic(sc);
result = e;
return;
}
Module mmath = Module.loadStdMath();
if (!mmath)
{
e.error("`%s` requires `std.math` for `^^` operators", e.toChars());
return setError();
}
e = new ScopeExp(exp.loc, mmath);
if (exp.e2.op == EXP.float64 && exp.e2.toReal() == CTFloat.half)
{
// Replace e1 ^^ 0.5 with .std.math.sqrt(e1)
e = new CallExp(exp.loc, new DotIdExp(exp.loc, e, Id._sqrt), exp.e1);
}
else
{
// Replace e1 ^^ e2 with .std.math.pow(e1, e2)
e = new CallExp(exp.loc, new DotIdExp(exp.loc, e, Id._pow), exp.e1, exp.e2);
}
e = e.expressionSemantic(sc);
result = e;
return;
}
override void visit(ShlExp exp)
{
//printf("ShlExp::semantic(), type = %p\n", type);
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
return setError();
if (!target.isVectorOpSupported(exp.e1.type.toBasetype(), exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
exp.e1 = integralPromotions(exp.e1, sc);
if (exp.e2.type.toBasetype().ty != Tvector)
exp.e2 = exp.e2.castTo(sc, Type.tshiftcnt);
exp.type = exp.e1.type;
result = exp;
}
override void visit(ShrExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
return setError();
if (!target.isVectorOpSupported(exp.e1.type.toBasetype(), exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
exp.e1 = integralPromotions(exp.e1, sc);
if (exp.e2.type.toBasetype().ty != Tvector)
exp.e2 = exp.e2.castTo(sc, Type.tshiftcnt);
exp.type = exp.e1.type;
result = exp;
}
override void visit(UshrExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
return setError();
if (!target.isVectorOpSupported(exp.e1.type.toBasetype(), exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
exp.e1 = integralPromotions(exp.e1, sc);
if (exp.e2.type.toBasetype().ty != Tvector)
exp.e2 = exp.e2.castTo(sc, Type.tshiftcnt);
exp.type = exp.e1.type;
result = exp;
}
override void visit(AndExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.e1.type.toBasetype().ty == Tbool && exp.e2.type.toBasetype().ty == Tbool)
{
exp.type = exp.e1.type;
result = exp;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (!target.isVectorOpSupported(tb, exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
return setError();
result = exp;
}
override void visit(OrExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.e1.type.toBasetype().ty == Tbool && exp.e2.type.toBasetype().ty == Tbool)
{
exp.type = exp.e1.type;
result = exp;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (!target.isVectorOpSupported(tb, exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
return setError();
result = exp;
}
override void visit(XorExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
if (exp.e1.type.toBasetype().ty == Tbool && exp.e2.type.toBasetype().ty == Tbool)
{
exp.type = exp.e1.type;
result = exp;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
Type tb = exp.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
{
if (!isArrayOpValid(exp))
{
result = arrayOpInvalidError(exp);
return;
}
result = exp;
return;
}
if (!target.isVectorOpSupported(tb, exp.op, exp.e2.type.toBasetype()))
{
result = exp.incompatibleTypes();
return;
}
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
return setError();
result = exp;
}
override void visit(LogicalExp exp)
{
static if (LOGSEMANTIC)
{
printf("LogicalExp::semantic() %s\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
exp.setNoderefOperands();
Expression e1x = exp.e1.expressionSemantic(sc);
// for static alias this: https://issues.dlang.org/show_bug.cgi?id=17684
if (e1x.op == EXP.type)
e1x = resolveAliasThis(sc, e1x);
e1x = resolveProperties(sc, e1x);
e1x = e1x.toBoolean(sc);
if (sc.flags & SCOPE.condition)
{
/* If in static if, don't evaluate e2 if we don't have to.
*/
e1x = e1x.optimize(WANTvalue);
if (e1x.toBool().hasValue(exp.op == EXP.orOr))
{
if (sc.flags & SCOPE.Cfile)
result = new IntegerExp(exp.op == EXP.orOr);
else
result = IntegerExp.createBool(exp.op == EXP.orOr);
return;
}
}
CtorFlow ctorflow = sc.ctorflow.clone();
Expression e2x = exp.e2.expressionSemantic(sc);
sc.merge(exp.loc, ctorflow);
ctorflow.freeFieldinit();
// for static alias this: https://issues.dlang.org/show_bug.cgi?id=17684
if (e2x.op == EXP.type)
e2x = resolveAliasThis(sc, e2x);
e2x = resolveProperties(sc, e2x);
auto f1 = checkNonAssignmentArrayOp(e1x);
auto f2 = checkNonAssignmentArrayOp(e2x);
if (f1 || f2)
return setError();
// Unless the right operand is 'void', the expression is converted to 'bool'.
if (e2x.type.ty != Tvoid)
e2x = e2x.toBoolean(sc);
if (e2x.op == EXP.type || e2x.op == EXP.scope_)
{
exp.error("`%s` is not an expression", exp.e2.toChars());
return setError();
}
if (e1x.op == EXP.error || e1x.type.ty == Tnoreturn)
{
result = e1x;
return;
}
if (e2x.op == EXP.error)
{
result = e2x;
return;
}
// The result type is 'bool', unless the right operand has type 'void'.
if (e2x.type.ty == Tvoid)
exp.type = Type.tvoid;
else
exp.type = (sc && sc.flags & SCOPE.Cfile) ? Type.tint32 : Type.tbool;
exp.e1 = e1x;
exp.e2 = e2x;
result = exp;
}
override void visit(CmpExp exp)
{
static if (LOGSEMANTIC)
{
printf("CmpExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
exp.setNoderefOperands();
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Type t1 = exp.e1.type.toBasetype();
Type t2 = exp.e2.type.toBasetype();
if (t1.ty == Tclass && exp.e2.op == EXP.null_ || t2.ty == Tclass && exp.e1.op == EXP.null_)
{
exp.error("do not use `null` when comparing class types");
return setError();
}
EXP cmpop = exp.op;
if (auto e = exp.op_overload(sc, &cmpop))
{
if (!e.type.isscalar() && e.type.equals(exp.e1.type))
{
exp.error("recursive `opCmp` expansion");
return setError();
}
if (e.op == EXP.call)
{
if (t1.ty == Tclass && t2.ty == Tclass)
{
// Lower to object.__cmp(e1, e2)
Expression cl = new IdentifierExp(exp.loc, Id.empty);
cl = new DotIdExp(exp.loc, cl, Id.object);
cl = new DotIdExp(exp.loc, cl, Id.__cmp);
cl = cl.expressionSemantic(sc);
auto arguments = new Expressions();
// Check if op_overload found a better match by calling e2.opCmp(e1)
// If the operands were swapped, then the result must be reversed
// e1.opCmp(e2) == -e2.opCmp(e1)
// cmpop takes care of this
if (exp.op == cmpop)
{
arguments.push(exp.e1);
arguments.push(exp.e2);
}
else
{
// Use better match found by op_overload
arguments.push(exp.e2);
arguments.push(exp.e1);
}
cl = new CallExp(exp.loc, cl, arguments);
cl = new CmpExp(cmpop, exp.loc, cl, new IntegerExp(0));
result = cl.expressionSemantic(sc);
return;
}
e = new CmpExp(cmpop, exp.loc, e, IntegerExp.literal!0);
e = e.expressionSemantic(sc);
}
result = e;
return;
}
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
auto f1 = checkNonAssignmentArrayOp(exp.e1);
auto f2 = checkNonAssignmentArrayOp(exp.e2);
if (f1 || f2)
return setError();
exp.type = (sc && sc.flags & SCOPE.Cfile) ? Type.tint32 : Type.tbool;
// Special handling for array comparisons
Expression arrayLowering = null;
t1 = exp.e1.type.toBasetype();
t2 = exp.e2.type.toBasetype();
if ((t1.ty == Tarray || t1.ty == Tsarray || t1.ty == Tpointer) && (t2.ty == Tarray || t2.ty == Tsarray || t2.ty == Tpointer))
{
Type t1next = t1.nextOf();
Type t2next = t2.nextOf();
if (t1next.implicitConvTo(t2next) < MATCH.constant && t2next.implicitConvTo(t1next) < MATCH.constant && (t1next.ty != Tvoid && t2next.ty != Tvoid))
{
exp.error("array comparison type mismatch, `%s` vs `%s`", t1next.toChars(), t2next.toChars());
return setError();
}
if (sc.needsCodegen() &&
(t1.ty == Tarray || t1.ty == Tsarray) &&
(t2.ty == Tarray || t2.ty == Tsarray))
{
if (!verifyHookExist(exp.loc, *sc, Id.__cmp, "comparing arrays"))
return setError();
// Lower to object.__cmp(e1, e2)
Expression al = new IdentifierExp(exp.loc, Id.empty);
al = new DotIdExp(exp.loc, al, Id.object);
al = new DotIdExp(exp.loc, al, Id.__cmp);
al = al.expressionSemantic(sc);
auto arguments = new Expressions(2);
(*arguments)[0] = exp.e1;
(*arguments)[1] = exp.e2;
al = new CallExp(exp.loc, al, arguments);
al = new CmpExp(exp.op, exp.loc, al, IntegerExp.literal!0);
arrayLowering = al;
}
}
else if (t1.ty == Tstruct || t2.ty == Tstruct || (t1.ty == Tclass && t2.ty == Tclass))
{
if (t2.ty == Tstruct)
exp.error("need member function `opCmp()` for %s `%s` to compare", t2.toDsymbol(sc).kind(), t2.toChars());
else
exp.error("need member function `opCmp()` for %s `%s` to compare", t1.toDsymbol(sc).kind(), t1.toChars());
return setError();
}
else if (t1.iscomplex() || t2.iscomplex())
{
exp.error("compare not defined for complex operands");
return setError();
}
else if (t1.ty == Taarray || t2.ty == Taarray)
{
exp.error("`%s` is not defined for associative arrays", EXPtoString(exp.op).ptr);
return setError();
}
else if (!target.isVectorOpSupported(t1, exp.op, t2))
{
result = exp.incompatibleTypes();
return;
}
else
{
bool r1 = exp.e1.checkValue() || exp.e1.checkSharedAccess(sc);
bool r2 = exp.e2.checkValue() || exp.e2.checkSharedAccess(sc);
if (r1 || r2)
return setError();
}
//printf("CmpExp: %s, type = %s\n", e.toChars(), e.type.toChars());
if (arrayLowering)
{
arrayLowering = arrayLowering.expressionSemantic(sc);
result = arrayLowering;
return;
}
if (auto tv = t1.isTypeVector())
exp.type = tv.toBooleanVector();
result = exp;
return;
}
override void visit(InExp exp)
{
if (exp.type)
{
result = exp;
return;
}
if (Expression ex = binSemanticProp(exp, sc))
{
result = ex;
return;
}
Expression e = exp.op_overload(sc);
if (e)
{
result = e;
return;
}
Type t2b = exp.e2.type.toBasetype();
switch (t2b.ty)
{
case Taarray:
{
TypeAArray ta = cast(TypeAArray)t2b;
// Special handling for array keys
if (!arrayTypeCompatibleWithoutCasting(exp.e1.type, ta.index))
{
// Convert key to type of key
exp.e1 = exp.e1.implicitCastTo(sc, ta.index);
}
semanticTypeInfo(sc, ta.index);
// Return type is pointer to value
exp.type = ta.nextOf().pointerTo();
break;
}
case Terror:
return setError();
case Tarray, Tsarray:
result = exp.incompatibleTypes();
exp.errorSupplemental("`in` is only allowed on associative arrays");
const(char)* slice = (t2b.ty == Tsarray) ? "[]" : "";
exp.errorSupplemental("perhaps use `std.algorithm.find(%s, %s%s)` instead",
exp.e1.toChars(), exp.e2.toChars(), slice);
return;
default:
result = exp.incompatibleTypes();
return;
}
result = exp;
}
override void visit(RemoveExp e)
{
if (Expression ex = binSemantic(e, sc))
{
result = ex;
return;
}
result = e;
}
override void visit(EqualExp exp)
{
//printf("EqualExp::semantic('%s')\n", exp.toChars());
if (exp.type)
{
result = exp;
return;
}
exp.setNoderefOperands();
if (auto e = binSemanticProp(exp, sc))
{
result = e;
return;
}
if (exp.e1.op == EXP.type || exp.e2.op == EXP.type)
{
/* https://issues.dlang.org/show_bug.cgi?id=12520
* empty tuples are represented as types so special cases are added
* so that they can be compared for equality with tuples of values.
*/
static auto extractTypeTupAndExpTup(Expression e)
{
static struct Result { bool ttEmpty; bool te; }
auto tt = e.op == EXP.type ? e.isTypeExp().type.isTypeTuple() : null;
return Result(tt && (!tt.arguments || !tt.arguments.length), e.isTupleExp() !is null);
}
auto tups1 = extractTypeTupAndExpTup(exp.e1);
auto tups2 = extractTypeTupAndExpTup(exp.e2);
// AliasSeq!() == AliasSeq!(<at least a value>)
if (tups1.ttEmpty && tups2.te)
{
result = IntegerExp.createBool(exp.op != EXP.equal);
return;
}
// AliasSeq!(<at least a value>) == AliasSeq!()
else if (tups1.te && tups2.ttEmpty)
{
result = IntegerExp.createBool(exp.op != EXP.equal);
return;
}
// AliasSeq!() == AliasSeq!()
else if (tups1.ttEmpty && tups2.ttEmpty)
{
result = IntegerExp.createBool(exp.op == EXP.equal);
return;
}
// otherwise, two types are really not comparable
result = exp.incompatibleTypes();
return;
}
{
auto t1 = exp.e1.type;
auto t2 = exp.e2.type;
if (t1.ty == Tenum && t2.ty == Tenum && !t1.equivalent(t2))
exp.error("comparison between different enumeration types `%s` and `%s`; If this behavior is intended consider using `std.conv.asOriginalType`",
t1.toChars(), t2.toChars());
}
/* Before checking for operator overloading, check to see if we're
* comparing the addresses of two statics. If so, we can just see
* if they are the same symbol.
*/
if (exp.e1.op == EXP.address && exp.e2.op == EXP.address)
{
AddrExp ae1 = cast(AddrExp)exp.e1;
AddrExp ae2 = cast(AddrExp)exp.e2;
if (ae1.e1.op == EXP.variable && ae2.e1.op == EXP.variable)
{
VarExp ve1 = cast(VarExp)ae1.e1;
VarExp ve2 = cast(VarExp)ae2.e1;
if (ve1.var == ve2.var)
{
// They are the same, result is 'true' for ==, 'false' for !=
result = IntegerExp.createBool(exp.op == EXP.equal);
return;
}
}
}
Type t1 = exp.e1.type.toBasetype();
Type t2 = exp.e2.type.toBasetype();
// Indicates whether the comparison of the 2 specified array types
// requires an object.__equals() lowering.
static bool needsDirectEq(Type t1, Type t2, Scope* sc)
{
Type t1n = t1.nextOf().toBasetype();
Type t2n = t2.nextOf().toBasetype();
if ((t1n.ty.isSomeChar && t2n.ty.isSomeChar) ||
(t1n.ty == Tvoid || t2n.ty == Tvoid))
{
return false;
}
if (t1n.constOf() != t2n.constOf())
return true;
Type t = t1n;
while (t.toBasetype().nextOf())
t = t.nextOf().toBasetype();
if (auto ts = t.isTypeStruct())
{
// semanticTypeInfo() makes sure hasIdentityEquals has been computed
if (global.params.useTypeInfo && Type.dtypeinfo)
semanticTypeInfo(sc, ts);
return ts.sym.hasIdentityEquals; // has custom opEquals
}
return false;
}
if (auto e = exp.op_overload(sc))
{
result = e;
return;
}
const isArrayComparison = (t1.ty == Tarray || t1.ty == Tsarray) &&
(t2.ty == Tarray || t2.ty == Tsarray);
const needsArrayLowering = isArrayComparison && needsDirectEq(t1, t2, sc);
if (!needsArrayLowering)
{
// https://issues.dlang.org/show_bug.cgi?id=23783
if (exp.e1.checkSharedAccess(sc) || exp.e2.checkSharedAccess(sc))
return setError();
if (auto e = typeCombine(exp, sc))
{
result = e;
return;
}
}
auto f1 = checkNonAssignmentArrayOp(exp.e1);
auto f2 = checkNonAssignmentArrayOp(exp.e2);
if (f1 || f2)
return setError();
exp.type = (sc && sc.flags & SCOPE.Cfile) ? Type.tint32 : Type.tbool;
if (!isArrayComparison)
{
if (exp.e1.type != exp.e2.type && exp.e1.type.isfloating() && exp.e2.type.isfloating())
{
// Cast both to complex
exp.e1 = exp.e1.castTo(sc, Type.tcomplex80);
exp.e2 = exp.e2.castTo(sc, Type.tcomplex80);
}
}
// lower some array comparisons to object.__equals(e1, e2)
if (needsArrayLowering || (t1.ty == Tarray && t2.ty == Tarray))
{
//printf("Lowering to __equals %s %s\n", exp.e1.toChars(), exp.e2.toChars());
// https://issues.dlang.org/show_bug.cgi?id=22390
// Equality comparison between array of noreturns simply lowers to length equality comparison
if (t1.nextOf.isTypeNoreturn() && t2.nextOf.isTypeNoreturn())
{
Expression exp_l1 = new DotIdExp(exp.e1.loc, exp.e1, Id.length);
Expression exp_l2 = new DotIdExp(exp.e2.loc, exp.e2, Id.length);
auto e = new EqualExp(EXP.equal, exp.loc, exp_l1, exp_l2);
result = e.expressionSemantic(sc);
return;
}
if (!verifyHookExist(exp.loc, *sc, Id.__equals, "equal checks on arrays"))
return setError();
Expression __equals = new IdentifierExp(exp.loc, Id.empty);
Identifier id = Identifier.idPool("__equals");
__equals = new DotIdExp(exp.loc, __equals, Id.object);
__equals = new DotIdExp(exp.loc, __equals, id);
/* https://issues.dlang.org/show_bug.cgi?id=23674
*
* Optimize before creating the call expression to the
* druntime hook as the optimizer may output errors
* that will get swallowed otherwise.
*/
exp.e1 = exp.e1.optimize(WANTvalue);
exp.e2 = exp.e2.optimize(WANTvalue);
auto arguments = new Expressions(2);
(*arguments)[0] = exp.e1;
(*arguments)[1] = exp.e2;
__equals = new CallExp(exp.loc, __equals, arguments);
if (exp.op == EXP.notEqual)
{
__equals = new NotExp(exp.loc, __equals);
}
__equals = __equals.trySemantic(sc); // for better error message
if (!__equals)
{
exp.error("incompatible types for array comparison: `%s` and `%s`",
exp.e1.type.toChars(), exp.e2.type.toChars());
__equals = ErrorExp.get();
}
result = __equals;
return;
}
if (exp.e1.type.toBasetype().ty == Taarray)
semanticTypeInfo(sc, exp.e1.type.toBasetype());
if (!target.isVectorOpSupported(t1, exp.op, t2))
{
result = exp.incompatibleTypes();
return;
}
if (auto tv = t1.isTypeVector())
exp.type = tv.toBooleanVector();
result = exp;
}
override void visit(IdentityExp exp)
{
if (exp.type)
{
result = exp;
return;
}
exp.setNoderefOperands();
if (auto e = binSemanticProp(exp, sc))
{
result = e;
return;
}
if (auto e = typeCombine(exp, sc))
{
result = e;
return;
}
auto f1 = checkNonAssignmentArrayOp(exp.e1);
auto f2 = checkNonAssignmentArrayOp(exp.e2);
if (f1 || f2)
return setError();
if (exp.e1.op == EXP.type || exp.e2.op == EXP.type)
{
result = exp.incompatibleTypes();
return;
}
exp.type = Type.tbool;
if (exp.e1.type != exp.e2.type && exp.e1.type.isfloating() && exp.e2.type.isfloating())
{
// Cast both to complex
exp.e1 = exp.e1.castTo(sc, Type.tcomplex80);
exp.e2 = exp.e2.castTo(sc, Type.tcomplex80);
}
auto tb1 = exp.e1.type.toBasetype();
auto tb2 = exp.e2.type.toBasetype();
if (!target.isVectorOpSupported(tb1, exp.op, tb2))
{
result = exp.incompatibleTypes();
return;
}
if (exp.e1.op == EXP.call)
exp.e1 = (cast(CallExp)exp.e1).addDtorHook(sc);
if (exp.e2.op == EXP.call)
exp.e2 = (cast(CallExp)exp.e2).addDtorHook(sc);
if (exp.e1.type.toBasetype().ty == Tsarray ||
exp.e2.type.toBasetype().ty == Tsarray)
exp.deprecation("identity comparison of static arrays "
~ "implicitly coerces them to slices, "
~ "which are compared by reference");
result = exp;
}
override void visit(CondExp exp)
{
static if (LOGSEMANTIC)
{
printf("CondExp::semantic('%s')\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
if (auto die = exp.econd.isDotIdExp())
die.noderef = true;
Expression ec = exp.econd.expressionSemantic(sc);
ec = resolveProperties(sc, ec);
ec = ec.toBoolean(sc);
CtorFlow ctorflow_root = sc.ctorflow.clone();
Expression e1x = exp.e1.expressionSemantic(sc).arrayFuncConv(sc);
e1x = resolveProperties(sc, e1x);
CtorFlow ctorflow1 = sc.ctorflow;
sc.ctorflow = ctorflow_root;
Expression e2x = exp.e2.expressionSemantic(sc).arrayFuncConv(sc);
e2x = resolveProperties(sc, e2x);
sc.merge(exp.loc, ctorflow1);
ctorflow1.freeFieldinit();
if (ec.op == EXP.error)
{
result = ec;
return;
}
if (ec.type == Type.terror)
return setError();
exp.econd = ec;
if (e1x.op == EXP.error)
{
result = e1x;
return;
}
if (e1x.type == Type.terror)
return setError();
exp.e1 = e1x;
if (e2x.op == EXP.error)
{
result = e2x;
return;
}
if (e2x.type == Type.terror)
return setError();
exp.e2 = e2x;
auto f0 = checkNonAssignmentArrayOp(exp.econd);
auto f1 = checkNonAssignmentArrayOp(exp.e1);
auto f2 = checkNonAssignmentArrayOp(exp.e2);
if (f0 || f1 || f2)
return setError();
Type t1 = exp.e1.type;
Type t2 = exp.e2.type;
// https://issues.dlang.org/show_bug.cgi?id=23767
// `cast(void*) 0` should be treated as `null` so the ternary expression
// gets the pointer type of the other branch
if (sc.flags & SCOPE.Cfile)
{
static void rewriteCNull(ref Expression e, ref Type t)
{
if (!t.isTypePointer())
return;
if (auto ie = e.optimize(WANTvalue).isIntegerExp())
{
if (ie.getInteger() == 0)
{
e = new NullExp(e.loc, Type.tnull);
t = Type.tnull;
}
}
}
rewriteCNull(exp.e1, t1);
rewriteCNull(exp.e2, t2);
}
if (t1.ty == Tnoreturn)
{
exp.type = t2;
exp.e1 = specialNoreturnCast(exp.e1, exp.type);
}
else if (t2.ty == Tnoreturn)
{
exp.type = t1;
exp.e2 = specialNoreturnCast(exp.e2, exp.type);
}
// If either operand is void the result is void, we have to cast both
// the expression to void so that we explicitly discard the expression
// value if any
// https://issues.dlang.org/show_bug.cgi?id=16598
else if (t1.ty == Tvoid || t2.ty == Tvoid)
{
exp.type = Type.tvoid;
exp.e1 = exp.e1.castTo(sc, exp.type);
exp.e2 = exp.e2.castTo(sc, exp.type);
}
else if (t1 == t2)
exp.type = t1;
else
{
if (Expression ex = typeCombine(exp, sc))
{
result = ex;
return;
}
switch (exp.e1.type.toBasetype().ty)
{
case Tcomplex32:
case Tcomplex64:
case Tcomplex80:
exp.e2 = exp.e2.castTo(sc, exp.e1.type);
break;
default:
break;
}
switch (exp.e2.type.toBasetype().ty)
{
case Tcomplex32:
case Tcomplex64:
case Tcomplex80:
exp.e1 = exp.e1.castTo(sc, exp.e2.type);
break;
default:
break;
}
if (exp.type.toBasetype().ty == Tarray)
{
exp.e1 = exp.e1.castTo(sc, exp.type);
exp.e2 = exp.e2.castTo(sc, exp.type);
}
}
exp.type = exp.type.merge2();
version (none)
{
printf("res: %s\n", exp.type.toChars());
printf("e1 : %s\n", exp.e1.type.toChars());
printf("e2 : %s\n", exp.e2.type.toChars());
}
/* https://issues.dlang.org/show_bug.cgi?id=14696
* If either e1 or e2 contain temporaries which need dtor,
* make them conditional.
* Rewrite:
* cond ? (__tmp1 = ..., __tmp1) : (__tmp2 = ..., __tmp2)
* to:
* (auto __cond = cond) ? (... __tmp1) : (... __tmp2)
* and replace edtors of __tmp1 and __tmp2 with:
* __tmp1.edtor --> __cond && __tmp1.dtor()
* __tmp2.edtor --> __cond || __tmp2.dtor()
*/
exp.hookDtors(sc);
result = exp;
}
override void visit(GenericExp exp)
{
static if (LOGSEMANTIC)
{
printf("GenericExp::semantic('%s')\n", exp.toChars());
}
// C11 6.5.1.1 Generic Selection
auto ec = exp.cntlExp.expressionSemantic(sc).arrayFuncConv(sc);
bool errors = ec.isErrorExp() !is null;
auto tc = ec.type;
auto types = (*exp.types)[];
foreach (i, ref t; types)
{
if (!t)
continue; // `default:` case
t = t.typeSemantic(ec.loc, sc);
if (t.isTypeError())
{
errors = true;
continue;
}
/* C11 6.5.1-2 duplicate check
*/
/* C11 distinguishes int, long, and long long. But D doesn't, so depending on the
* C target, a long may have the same type as `int` in the D type system.
* So, skip checks when this may be the case. Later pick the first match
*/
if (
(t.ty == Tint32 || t.ty == Tuns32) && target.c.longsize == 4 ||
(t.ty == Tint64 || t.ty == Tuns64) && target.c.longsize == 8 ||
(t.ty == Tfloat64 || t.ty == Timaginary64 || t.ty == Tcomplex64) && target.c.long_doublesize == 8
)
continue;
foreach (t2; types[0 .. i])
{
if (t2 && t2.equals(t))
{
error(ec.loc, "generic association type `%s` can only appear once", t.toChars());
errors = true;
break;
}
}
}
auto exps = (*exp.exps)[];
foreach (ref e; exps)
{
e = e.expressionSemantic(sc);
if (e.isErrorExp())
errors = true;
}
if (errors)
return setError();
enum size_t None = ~0;
size_t imatch = None;
size_t idefault = None;
foreach (const i, t; types)
{
if (t)
{
/* if tc is compatible with t, it's a match
* C11 6.2.7 defines a compatible type as being the same type, including qualifiers
*/
if (tc.equals(t))
{
assert(imatch == None);
imatch = i;
break; // pick first match
}
}
else
idefault = i; // multiple defaults are not allowed, and are caught by cparse
}
if (imatch == None)
imatch = idefault;
if (imatch == None)
{
error(exp.loc, "no compatible generic association type for controlling expression type `%s`", tc.toChars());
return setError();
}
result = exps[imatch];
}
override void visit(FileInitExp e)
{
//printf("FileInitExp::semantic()\n");
e.type = Type.tstring;
result = e;
}
override void visit(LineInitExp e)
{
e.type = Type.tint32;
result = e;
}
override void visit(ModuleInitExp e)
{
//printf("ModuleInitExp::semantic()\n");
e.type = Type.tstring;
result = e;
}
override void visit(FuncInitExp e)
{
//printf("FuncInitExp::semantic()\n");
e.type = Type.tstring;
if (sc.func)
{
result = e.resolveLoc(Loc.initial, sc);
return;
}
result = e;
}
override void visit(PrettyFuncInitExp e)
{
//printf("PrettyFuncInitExp::semantic()\n");
e.type = Type.tstring;
if (sc.func)
{
result = e.resolveLoc(Loc.initial, sc);
return;
}
result = e;
}
}
/**********************************
* Try to run semantic routines.
* If they fail, return NULL.
*/
Expression trySemantic(Expression exp, Scope* sc)
{
//printf("+trySemantic(%s)\n", exp.toChars());
uint errors = global.startGagging();
Expression e = expressionSemantic(exp, sc);
if (global.endGagging(errors))
{
e = null;
}
//printf("-trySemantic(%s)\n", exp.toChars());
return e;
}
/**************************
* Helper function for easy error propagation.
* If error occurs, returns ErrorExp. Otherwise returns NULL.
*/
Expression unaSemantic(UnaExp e, Scope* sc)
{
static if (LOGSEMANTIC)
{
printf("UnaExp::semantic('%s')\n", e.toChars());
}
Expression e1x = e.e1.expressionSemantic(sc);
if (e1x.op == EXP.error)
return e1x;
e.e1 = e1x;
return null;
}
/**************************
* Helper function for easy error propagation.
* If error occurs, returns ErrorExp. Otherwise returns NULL.
*/
Expression binSemantic(BinExp e, Scope* sc)
{
static if (LOGSEMANTIC)
{
printf("BinExp::semantic('%s')\n", e.toChars());
}
Expression e1x = e.e1.expressionSemantic(sc);
Expression e2x = e.e2.expressionSemantic(sc);
// for static alias this: https://issues.dlang.org/show_bug.cgi?id=17684
if (e1x.op == EXP.type)
e1x = resolveAliasThis(sc, e1x);
if (e2x.op == EXP.type)
e2x = resolveAliasThis(sc, e2x);
if (e1x.op == EXP.error)
return e1x;
if (e2x.op == EXP.error)
return e2x;
e.e1 = e1x;
e.e2 = e2x;
return null;
}
Expression binSemanticProp(BinExp e, Scope* sc)
{
if (Expression ex = binSemantic(e, sc))
return ex;
Expression e1x = resolveProperties(sc, e.e1);
Expression e2x = resolveProperties(sc, e.e2);
if (e1x.op == EXP.error)
return e1x;
if (e2x.op == EXP.error)
return e2x;
e.e1 = e1x;
e.e2 = e2x;
return null;
}
// entrypoint for semantic ExpressionSemanticVisitor
extern (C++) Expression expressionSemantic(Expression e, Scope* sc)
{
scope v = new ExpressionSemanticVisitor(sc);
e.accept(v);
return v.result;
}
private Expression dotIdSemanticPropX(DotIdExp exp, Scope* sc)
{
//printf("DotIdExp::semanticX(this = %p, '%s')\n", this, toChars());
if (Expression ex = unaSemantic(exp, sc))
return ex;
if (!(sc.flags & SCOPE.Cfile) && exp.ident == Id._mangleof)
{
// symbol.mangleof
// return mangleof as an Expression
static Expression dotMangleof(const ref Loc loc, Scope* sc, Dsymbol ds)
{
assert(ds);
if (auto f = ds.isFuncDeclaration())
{
if (f.checkForwardRef(loc))
return ErrorExp.get();
if (f.purityInprocess || f.safetyInprocess || f.nothrowInprocess || f.nogcInprocess)
{
f.error(loc, "cannot retrieve its `.mangleof` while inferring attributes");
return ErrorExp.get();
}
}
OutBuffer buf;
mangleToBuffer(ds, buf);
Expression e = new StringExp(loc, buf.extractSlice());
return e.expressionSemantic(sc);
}
Dsymbol ds;
switch (exp.e1.op)
{
case EXP.scope_: return dotMangleof(exp.loc, sc, exp.e1.isScopeExp().sds);
case EXP.variable: return dotMangleof(exp.loc, sc, exp.e1.isVarExp().var);
case EXP.dotVariable: return dotMangleof(exp.loc, sc, exp.e1.isDotVarExp().var);
case EXP.overloadSet: return dotMangleof(exp.loc, sc, exp.e1.isOverExp().vars);
case EXP.template_:
{
TemplateExp te = exp.e1.isTemplateExp();
return dotMangleof(exp.loc, sc, ds = te.fd ? te.fd.isDsymbol() : te.td);
}
default:
break;
}
}
if (exp.e1.isVarExp() && exp.e1.type.toBasetype().isTypeSArray() && exp.ident == Id.length)
{
// bypass checkPurity
return exp.e1.type.dotExp(sc, exp.e1, exp.ident, cast(DotExpFlag) (exp.noderef * DotExpFlag.noDeref));
}
if (!exp.e1.isDotExp())
{
exp.e1 = resolvePropertiesX(sc, exp.e1);
}
if (auto te = exp.e1.isTupleExp())
{
if (exp.ident == Id.offsetof)
{
/* 'distribute' the .offsetof to each of the tuple elements.
*/
auto exps = new Expressions(te.exps.length);
foreach (i, e; (*te.exps)[])
{
(*exps)[i] = new DotIdExp(e.loc, e, Id.offsetof);
}
// Don't evaluate te.e0 in runtime
Expression e = new TupleExp(exp.loc, null, exps);
e = e.expressionSemantic(sc);
return e;
}
if (exp.ident == Id.length)
{
// Don't evaluate te.e0 in runtime
return new IntegerExp(exp.loc, te.exps.length, Type.tsize_t);
}
}
// https://issues.dlang.org/show_bug.cgi?id=14416
// Template has no built-in properties except for 'stringof'.
if ((exp.e1.isDotTemplateExp() || exp.e1.isTemplateExp()) && exp.ident != Id.stringof)
{
exp.error("template `%s` does not have property `%s`", exp.e1.toChars(), exp.ident.toChars());
return ErrorExp.get();
}
if (!exp.e1.type)
{
exp.error("expression `%s` does not have property `%s`", exp.e1.toChars(), exp.ident.toChars());
return ErrorExp.get();
}
return exp;
}
/******************************
* Resolve properties, i.e. `e1.ident`, without seeing UFCS.
* Params:
* exp = expression to resolve
* sc = context
* gag = do not emit error messages, just return `null`
* Returns:
* resolved expression, null if error
*/
Expression dotIdSemanticProp(DotIdExp exp, Scope* sc, bool gag)
{
//printf("DotIdExp::semanticY(this = %p, '%s')\n", exp, exp.toChars());
//{ static int z; fflush(stdout); if (++z == 10) *(char*)0=0; }
const cfile = (sc.flags & SCOPE.Cfile) != 0;
/* Special case: rewrite this.id and super.id
* to be classtype.id and baseclasstype.id
* if we have no this pointer.
*/
if ((exp.e1.isThisExp() || exp.e1.isSuperExp()) && !hasThis(sc))
{
if (AggregateDeclaration ad = sc.getStructClassScope())
{
if (exp.e1.isThisExp())
{
exp.e1 = new TypeExp(exp.e1.loc, ad.type);
}
else
{
if (auto cd = ad.isClassDeclaration())
{
if (cd.baseClass)
exp.e1 = new TypeExp(exp.e1.loc, cd.baseClass.type);
}
}
}
}
{
Expression e = dotIdSemanticPropX(exp, sc);
if (e != exp)
return e;
}
Expression eleft;
Expression eright;
if (auto de = exp.e1.isDotExp())
{
eleft = de.e1;
eright = de.e2;
}
else
{
eleft = null;
eright = exp.e1;
}
Type t1b = exp.e1.type.toBasetype();
if (auto ie = eright.isScopeExp()) // also used for template alias's
{
auto flags = SearchLocalsOnly;
/* Disable access to another module's private imports.
* The check for 'is sds our current module' is because
* the current module should have access to its own imports.
*/
if (ie.sds.isModule() && ie.sds != sc._module)
flags |= IgnorePrivateImports;
if (sc.flags & SCOPE.ignoresymbolvisibility)
flags |= IgnoreSymbolVisibility;
Dsymbol s = ie.sds.search(exp.loc, exp.ident, flags);
/* Check for visibility before resolving aliases because public
* aliases to private symbols are public.
*/
if (s && !(sc.flags & SCOPE.ignoresymbolvisibility) && !symbolIsVisible(sc._module, s))
{
s = null;
}
if (s)
{
auto p = s.isPackage();
if (p && checkAccess(sc, p))
{
s = null;
}
}
if (s)
{
// if 's' is a tuple variable, the tuple is returned.
s = s.toAlias();
exp.checkDeprecated(sc, s);
exp.checkDisabled(sc, s);
if (auto em = s.isEnumMember())
{
return em.getVarExp(exp.loc, sc);
}
if (auto v = s.isVarDeclaration())
{
//printf("DotIdExp:: Identifier '%s' is a variable, type '%s'\n", toChars(), v.type.toChars());
if (!v.type ||
!v.type.deco && v.inuse)
{
if (v.inuse)
exp.error("circular reference to %s `%s`", v.kind(), v.toPrettyChars());
else
exp.error("forward reference to %s `%s`", v.kind(), v.toPrettyChars());
return ErrorExp.get();
}
if (v.type.isTypeError())
return ErrorExp.get();
if ((v.storage_class & STC.manifest) && v._init && !exp.wantsym)
{
/* Normally, the replacement of a symbol with its initializer is supposed to be in semantic2().
* Introduced by https://github.com/dlang/dmd/pull/5588 which should probably
* be reverted. `wantsym` is the hack to work around the problem.
*/
if (v.inuse)
{
error(exp.loc, "circular initialization of %s `%s`", v.kind(), v.toPrettyChars());
return ErrorExp.get();
}
auto e = v.expandInitializer(exp.loc);
v.inuse++;
e = e.expressionSemantic(sc);
v.inuse--;
return e;
}
Expression e;
if (v.needThis())
{
if (!eleft)
eleft = new ThisExp(exp.loc);
e = new DotVarExp(exp.loc, eleft, v);
e = e.expressionSemantic(sc);
}
else
{
e = new VarExp(exp.loc, v);
if (eleft)
{
e = new CommaExp(exp.loc, eleft, e);
e.type = v.type;
}
}
e = e.deref();
return e.expressionSemantic(sc);
}
if (auto f = s.isFuncDeclaration())
{
//printf("it's a function\n");
if (!f.functionSemantic())
return ErrorExp.get();
Expression e;
if (f.needThis())
{
if (!eleft)
eleft = new ThisExp(exp.loc);
e = new DotVarExp(exp.loc, eleft, f, true);
e = e.expressionSemantic(sc);
}
else
{
e = new VarExp(exp.loc, f, true);
if (eleft)
{
e = new CommaExp(exp.loc, eleft, e);
e.type = f.type;
}
}
return e;
}
if (auto td = s.isTemplateDeclaration())
{
Expression e;
if (eleft)
e = new DotTemplateExp(exp.loc, eleft, td);
else
e = new TemplateExp(exp.loc, td);
e = e.expressionSemantic(sc);
return e;
}
if (OverDeclaration od = s.isOverDeclaration())
{
Expression e = new VarExp(exp.loc, od, true);
if (eleft)
{
e = new CommaExp(exp.loc, eleft, e);
e.type = Type.tvoid; // ambiguous type?
}
return e.expressionSemantic(sc);
}
if (auto o = s.isOverloadSet())
{
//printf("'%s' is an overload set\n", o.toChars());
return new OverExp(exp.loc, o);
}
if (auto t = s.getType())
{
return (new TypeExp(exp.loc, t)).expressionSemantic(sc);
}
if (auto tup = s.isTupleDeclaration())
{
if (eleft)
{
Expression e = new DotVarExp(exp.loc, eleft, tup);
e = e.expressionSemantic(sc);
return e;
}
Expression e = new TupleExp(exp.loc, tup);
e = e.expressionSemantic(sc);
return e;
}
if (auto sds = s.isScopeDsymbol())
{
//printf("it's a ScopeDsymbol %s\n", ident.toChars());
Expression e = new ScopeExp(exp.loc, sds);
e = e.expressionSemantic(sc);
if (eleft)
e = new DotExp(exp.loc, eleft, e);
return e;
}
if (auto imp = s.isImport())
{
Expression se = new ScopeExp(exp.loc, imp.pkg);
return se.expressionSemantic(sc);
}
if (auto attr = s.isAttribDeclaration())
{
if (auto sm = ie.sds.search(exp.loc, exp.ident, flags))
{
auto es = new DsymbolExp(exp.loc, sm);
return es;
}
}
// BUG: handle other cases like in IdentifierExp::semantic()
debug
{
printf("s = %p '%s', kind = '%s'\n", s, s.toChars(), s.kind());
}
assert(0);
}
else if (exp.ident == Id.stringof)
{
Expression e = new StringExp(exp.loc, ie.toString());
e = e.expressionSemantic(sc);
return e;
}
if (ie.sds.isPackage() || ie.sds.isImport() || ie.sds.isModule())
{
gag = false;
}
if (gag)
return null;
s = ie.sds.search_correct(exp.ident);
if (s && symbolIsVisible(sc, s))
{
if (s.isPackage())
exp.error("undefined identifier `%s` in %s `%s`, perhaps add `static import %s;`", exp.ident.toChars(), ie.sds.kind(), ie.sds.toPrettyChars(), s.toPrettyChars());
else
exp.error("undefined identifier `%s` in %s `%s`, did you mean %s `%s`?", exp.ident.toChars(), ie.sds.kind(), ie.sds.toPrettyChars(), s.kind(), s.toChars());
}
else
exp.error("undefined identifier `%s` in %s `%s`", exp.ident.toChars(), ie.sds.kind(), ie.sds.toPrettyChars());
return ErrorExp.get();
}
else if (t1b.ty == Tpointer && exp.e1.type.ty != Tenum &&
!(
exp.ident == Id.__sizeof ||
exp.ident == Id.__xalignof ||
!cfile &&
(exp.ident == Id._mangleof ||
exp.ident == Id.offsetof ||
exp.ident == Id._init ||
exp.ident == Id.stringof)
))
{
Type t1bn = t1b.nextOf();
if (gag)
{
if (AggregateDeclaration ad = isAggregate(t1bn))
{
if (!ad.members) // https://issues.dlang.org/show_bug.cgi?id=11312
return null;
}
}
/* Rewrite:
* p.ident
* as:
* (*p).ident
*/
if (gag && t1bn.ty == Tvoid)
return null;
Expression e = new PtrExp(exp.loc, exp.e1);
e = e.expressionSemantic(sc);
const newFlag = cast(DotExpFlag) (gag * DotExpFlag.gag | exp.noderef * DotExpFlag.noDeref);
return e.type.dotExp(sc, e, exp.ident, newFlag);
}
else if (exp.ident == Id.__xalignof &&
exp.e1.isVarExp() &&
exp.e1.isVarExp().var.isVarDeclaration() &&
!exp.e1.isVarExp().var.isVarDeclaration().alignment.isUnknown())
{
// For `x.alignof` get the alignment of the variable, not the alignment of its type
const explicitAlignment = exp.e1.isVarExp().var.isVarDeclaration().alignment;
const naturalAlignment = exp.e1.type.alignsize();
const actualAlignment = explicitAlignment.isDefault() ? naturalAlignment : explicitAlignment.get();
Expression e = new IntegerExp(exp.loc, actualAlignment, Type.tsize_t);
return e;
}
else if ((exp.ident == Id.max || exp.ident == Id.min) &&
exp.e1.isVarExp() &&
exp.e1.isVarExp().var.isBitFieldDeclaration())
{
// For `x.max` and `x.min` get the max/min of the bitfield, not the max/min of its type
auto bf = exp.e1.isVarExp().var.isBitFieldDeclaration();
return new IntegerExp(exp.loc, bf.getMinMax(exp.ident), bf.type);
}
else if ((exp.ident == Id.max || exp.ident == Id.min) &&
exp.e1.isDotVarExp() &&
exp.e1.isDotVarExp().var.isBitFieldDeclaration())
{
// For `x.max` and `x.min` get the max/min of the bitfield, not the max/min of its type
auto bf = exp.e1.isDotVarExp().var.isBitFieldDeclaration();
return new IntegerExp(exp.loc, bf.getMinMax(exp.ident), bf.type);
}
else
{
if (exp.e1.isTypeExp() || exp.e1.isTemplateExp())
gag = false;
const flag = cast(DotExpFlag) (exp.noderef * DotExpFlag.noDeref | gag * DotExpFlag.gag);
Expression e = exp.e1.type.dotExp(sc, exp.e1, exp.ident, flag);
if (e)
{
e = e.expressionSemantic(sc);
}
return e;
}
}
/**
* Resolve `e1.ident!tiargs` without seeing UFCS.
* Params:
* exp = the `DotTemplateInstanceExp` to resolve
* sc = the semantic scope
* gag = stop "not a property" error and return `null`.
* Returns:
* `null` if error or not found, or the resolved expression.
*/
Expression dotTemplateSemanticProp(DotTemplateInstanceExp exp, Scope* sc, bool gag)
{
static if (LOGSEMANTIC)
{
printf("DotTemplateInstanceExpY::semantic('%s')\n", exp.toChars());
}
static Expression errorExp()
{
return ErrorExp.get();
}
Expression e1 = exp.e1;
if (exp.ti.tempdecl && exp.ti.tempdecl.parent && exp.ti.tempdecl.parent.isTemplateMixin())
{
// if 'ti.tempdecl' happens to be found in a mixin template don't lose that info
// and do the symbol search in that context (Issue: 19476)
auto tm = cast(TemplateMixin)exp.ti.tempdecl.parent;
e1 = new DotExp(exp.e1.loc, exp.e1, new ScopeExp(tm.loc, tm));
}
auto die = new DotIdExp(exp.loc, e1, exp.ti.name);
Expression e = die.dotIdSemanticPropX(sc);
if (e == die)
{
exp.e1 = die.e1; // take back
Type t1b = exp.e1.type.toBasetype();
if (t1b.ty == Tarray || t1b.ty == Tsarray || t1b.ty == Taarray || t1b.ty == Tnull || (t1b.isTypeBasic() && t1b.ty != Tvoid))
{
/* No built-in type has templatized properties, so do shortcut.
* It is necessary in: 1024.max!"a < b"
*/
if (gag)
return null;
}
e = die.dotIdSemanticProp(sc, gag);
if (gag)
{
if (!e ||
isDotOpDispatch(e))
{
/* opDispatch!tiargs would be a function template that needs IFTI,
* so it's not a template
*/
return null;
}
}
}
assert(e);
if (e.op == EXP.error)
return e;
if (DotVarExp dve = e.isDotVarExp())
{
if (FuncDeclaration fd = dve.var.isFuncDeclaration())
{
if (TemplateDeclaration td = fd.findTemplateDeclRoot())
{
e = new DotTemplateExp(dve.loc, dve.e1, td);
e = e.expressionSemantic(sc);
}
}
else if (OverDeclaration od = dve.var.isOverDeclaration())
{
exp.e1 = dve.e1; // pull semantic() result
if (!exp.findTempDecl(sc))
goto Lerr;
if (exp.ti.needsTypeInference(sc))
return exp;
exp.ti.dsymbolSemantic(sc);
if (!exp.ti.inst || exp.ti.errors) // if template failed to expand
return errorExp();
if (Declaration v = exp.ti.toAlias().isDeclaration())
{
if (v.type && !v.type.deco)
v.type = v.type.typeSemantic(v.loc, sc);
return new DotVarExp(exp.loc, exp.e1, v)
.expressionSemantic(sc);
}
return new DotExp(exp.loc, exp.e1, new ScopeExp(exp.loc, exp.ti))
.expressionSemantic(sc);
}
}
else if (e.op == EXP.variable)
{
VarExp ve = cast(VarExp)e;
if (FuncDeclaration fd = ve.var.isFuncDeclaration())
{
if (TemplateDeclaration td = fd.findTemplateDeclRoot())
{
e = new TemplateExp(ve.loc, td)
.expressionSemantic(sc);
}
}
else if (OverDeclaration od = ve.var.isOverDeclaration())
{
exp.ti.tempdecl = od;
return new ScopeExp(exp.loc, exp.ti)
.expressionSemantic(sc);
}
}
if (DotTemplateExp dte = e.isDotTemplateExp())
{
exp.e1 = dte.e1; // pull semantic() result
exp.ti.tempdecl = dte.td;
if (!exp.ti.semanticTiargs(sc))
return errorExp();
if (exp.ti.needsTypeInference(sc))
return exp;
exp.ti.dsymbolSemantic(sc);
if (!exp.ti.inst || exp.ti.errors) // if template failed to expand
return errorExp();
if (Declaration v = exp.ti.toAlias().isDeclaration())
{
return new DotVarExp(exp.loc, exp.e1, v)
.expressionSemantic(sc);
}
return new DotExp(exp.loc, exp.e1, new ScopeExp(exp.loc, exp.ti))
.expressionSemantic(sc);
}
else if (e.op == EXP.template_)
{
exp.ti.tempdecl = (cast(TemplateExp)e).td;
return new ScopeExp(exp.loc, exp.ti)
.expressionSemantic(sc);
}
else if (DotExp de = e.isDotExp())
{
if (de.e2.op == EXP.overloadSet)
{
if (!exp.findTempDecl(sc) || !exp.ti.semanticTiargs(sc))
{
return errorExp();
}
if (exp.ti.needsTypeInference(sc))
return exp;
exp.ti.dsymbolSemantic(sc);
if (!exp.ti.inst || exp.ti.errors) // if template failed to expand
return errorExp();
if (Declaration v = exp.ti.toAlias().isDeclaration())
{
if (v.type && !v.type.deco)
v.type = v.type.typeSemantic(v.loc, sc);
return new DotVarExp(exp.loc, exp.e1, v)
.expressionSemantic(sc);
}
return new DotExp(exp.loc, exp.e1, new ScopeExp(exp.loc, exp.ti))
.expressionSemantic(sc);
}
}
else if (OverExp oe = e.isOverExp())
{
exp.ti.tempdecl = oe.vars;
return new ScopeExp(exp.loc, exp.ti)
.expressionSemantic(sc);
}
Lerr:
exp.error("`%s` isn't a template", e.toChars());
return errorExp();
}
/***************************************
* If expression is shared, check that we can access it.
* Give error message if not.
*
* Params:
* e = expression to check
* sc = context
* returnRef = Whether this expression is for a `return` statement
* off a `ref` function, in which case a single level
* of dereference is allowed (e.g. `shared(int)*`).
* Returns:
* true on error
*/
bool checkSharedAccess(Expression e, Scope* sc, bool returnRef = false)
{
if (global.params.noSharedAccess != FeatureState.enabled ||
!sc ||
sc.intypeof ||
sc.flags & SCOPE.ctfe)
{
return false;
}
//printf("checkSharedAccess() `%s` returnRef: %d\n", e.toChars(), returnRef);
bool check(Expression e, bool allowRef)
{
bool sharedError(Expression e)
{
// https://dlang.org/phobos/core_atomic.html
e.error("direct access to shared `%s` is not allowed, see `core.atomic`", e.toChars());
return true;
}
// Error by default
bool visit(Expression e)
{
// https://issues.dlang.org/show_bug.cgi?id=23639
// Should be able to cast(shared)
if (!e.isCastExp() && e.type.isShared())
return sharedError(e);
return false;
}
bool visitNew(NewExp e)
{
if (e.thisexp)
check(e.thisexp, false);
return false;
}
bool visitVar(VarExp e)
{
// https://issues.dlang.org/show_bug.cgi?id=20908
// direct access to init symbols is ok as they
// cannot be modified.
if (e.var.isSymbolDeclaration())
return false;
// https://issues.dlang.org/show_bug.cgi?id=22626
// Synchronized functions don't need to use core.atomic
// when accessing `this`.
if (sc.func && sc.func.isSynchronized())
{
if (e.var.isThisDeclaration())
return false;
else
return sharedError(e);
}
else if (!allowRef && e.var.type.isShared())
return sharedError(e);
return false;
}
bool visitAddr(AddrExp e)
{
return check(e.e1, true);
}
bool visitPtr(PtrExp e)
{
if (!allowRef && e.type.isShared())
return sharedError(e);
if (e.e1.type.isShared())
return sharedError(e);
return check(e.e1, false);
}
bool visitDotVar(DotVarExp e)
{
//printf("dotvarexp = %s\n", e.toChars());
if (e.type.isShared())
{
if (e.e1.isThisExp())
{
// https://issues.dlang.org/show_bug.cgi?id=22626
if (sc.func && sc.func.isSynchronized())
return false;
// https://issues.dlang.org/show_bug.cgi?id=23790
if (e.e1.type.isTypeStruct())
return false;
}
auto fd = e.var.isFuncDeclaration();
const sharedFunc = fd && fd.type.isShared;
if (!allowRef && !sharedFunc)
return sharedError(e);
// Allow using `DotVarExp` within value types
if (e.e1.type.isTypeSArray() || e.e1.type.isTypeStruct())
return check(e.e1, allowRef);
// If we end up with a single `VarExp`, it might be a `ref` param
// `shared ref T` param == `shared(T)*`.
if (auto ve = e.e1.isVarExp())
{
return check(e.e1, allowRef && (ve.var.storage_class & STC.ref_));
}
return sharedError(e);
}
return check(e.e1, false);
}
bool visitIndex(IndexExp e)
{
if (!allowRef && e.type.isShared())
return sharedError(e);
if (e.e1.type.isShared())
return sharedError(e);
return check(e.e1, false);
}
bool visitComma(CommaExp e)
{
// Cannot be `return ref` since we can't use the return,
// but it's better to show that error than an unrelated `shared` one
return check(e.e2, true);
}
switch (e.op)
{
default: return visit(e);
// Those have no indirections / can be ignored
case EXP.call:
case EXP.error:
case EXP.complex80:
case EXP.int64:
case EXP.null_: return false;
case EXP.variable: return visitVar(e.isVarExp());
case EXP.new_: return visitNew(e.isNewExp());
case EXP.address: return visitAddr(e.isAddrExp());
case EXP.star: return visitPtr(e.isPtrExp());
case EXP.dotVariable: return visitDotVar(e.isDotVarExp());
case EXP.index: return visitIndex(e.isIndexExp());
}
}
return check(e, returnRef);
}
/****************************************************
* Determine if `exp`, which gets its address taken, can do so safely.
* Params:
* sc = context
* exp = expression having its address taken
* v = the variable getting its address taken
* Returns:
* `true` if ok, `false` for error
*/
bool checkAddressVar(Scope* sc, Expression exp, VarDeclaration v)
{
//printf("checkAddressVar(exp: %s, v: %s)\n", exp.toChars(), v.toChars());
if (v is null)
return true;
if (!v.canTakeAddressOf())
{
exp.error("cannot take address of `%s`", exp.toChars());
return false;
}
if (sc.func && !sc.intypeof && !v.isDataseg())
{
if (global.params.useDIP1000 != FeatureState.enabled &&
!(v.storage_class & STC.temp) &&
sc.setUnsafe(false, exp.loc, "cannot take address of local `%s` in `@safe` function `%s`", v, sc.func))
{
return false;
}
}
return true;
}
/**************************************
* This check ensures that the object in `exp` can have its address taken, or
* issue a diagnostic error.
* Params:
* e = expression to check
* sc = context
* Returns:
* true if the expression is addressable
*/
bool checkAddressable(Expression e, Scope* sc)
{
Expression ex = e;
while (true)
{
switch (ex.op)
{
case EXP.dotVariable:
// https://issues.dlang.org/show_bug.cgi?id=22749
// Error about taking address of any bit-field, regardless of
// whether SCOPE.Cfile is set.
if (auto bf = ex.isDotVarExp().var.isBitFieldDeclaration())
{
e.error("cannot take address of bit-field `%s`", bf.toChars());
return false;
}
goto case EXP.cast_;
case EXP.index:
ex = ex.isBinExp().e1;
continue;
case EXP.address:
case EXP.array:
case EXP.cast_:
ex = ex.isUnaExp().e1;
continue;
case EXP.variable:
if (sc.flags & SCOPE.Cfile)
{
// C11 6.5.3.2: A variable that has its address taken cannot be
// stored in a register.
// C11 6.3.2.1: An array that has its address computed with `[]`
// or cast to an lvalue pointer cannot be stored in a register.
if (ex.isVarExp().var.storage_class & STC.register)
{
if (e.isIndexExp())
e.error("cannot index through register variable `%s`", ex.toChars());
else
e.error("cannot take address of register variable `%s`", ex.toChars());
return false;
}
}
break;
default:
break;
}
break;
}
return true;
}
/*******************************
* Checks the attributes of a function.
* Purity (`pure`), safety (`@safe`), no GC allocations(`@nogc`)
* and usage of `deprecated` and `@disabled`-ed symbols are checked.
*
* Params:
* exp = expression to check attributes for
* sc = scope of the function
* f = function to be checked
* Returns: `true` if error occur.
*/
private bool checkFunctionAttributes(Expression exp, Scope* sc, FuncDeclaration f)
{
with(exp)
{
bool error = checkDisabled(sc, f);
error |= checkDeprecated(sc, f);
error |= checkPurity(sc, f);
error |= checkSafety(sc, f);
error |= checkNogc(sc, f);
return error;
}
}
/*******************************
* Helper function for `getRightThis()`.
* Gets `this` of the next outer aggregate.
* Params:
* loc = location to use for error messages
* sc = context
* s = the parent symbol of the existing `this`
* ad = struct or class we need the correct `this` for
* e1 = existing `this`
* t = type of the existing `this`
* var = the specific member of ad we're accessing
* flag = if true, return `null` instead of throwing an error
* Returns:
* Expression representing the `this` for the var
*/
Expression getThisSkipNestedFuncs(const ref Loc loc, Scope* sc, Dsymbol s, AggregateDeclaration ad, Expression e1, Type t, Dsymbol var, bool flag = false)
{
int n = 0;
while (s && s.isFuncDeclaration())
{
FuncDeclaration f = s.isFuncDeclaration();
if (f.vthis)
{
n++;
e1 = new VarExp(loc, f.vthis);
if (f.hasDualContext())
{
// (*__this)[i]
if (n > 1)
e1 = e1.expressionSemantic(sc);
e1 = new PtrExp(loc, e1);
uint i = f.followInstantiationContext(ad);
e1 = new IndexExp(loc, e1, new IntegerExp(i));
s = f.toParentP(ad);
continue;
}
}
else
{
if (flag)
return null;
e1.error("need `this` of type `%s` to access member `%s` from static function `%s`", ad.toChars(), var.toChars(), f.toChars());
e1 = ErrorExp.get();
return e1;
}
s = s.toParent2();
}
if (n > 1 || e1.op == EXP.index)
e1 = e1.expressionSemantic(sc);
if (s && e1.type.equivalent(Type.tvoidptr))
{
if (auto sad = s.isAggregateDeclaration())
{
Type ta = sad.handleType();
if (ta.ty == Tstruct)
ta = ta.pointerTo();
e1.type = ta;
}
}
e1.type = e1.type.addMod(t.mod);
return e1;
}
/*******************************
* Make a dual-context container for use as a `this` argument.
* Params:
* loc = location to use for error messages
* sc = current scope
* fd = target function that will take the `this` argument
* Returns:
* Temporary closure variable.
* Note:
* The function `fd` is added to the nested references of the
* newly created variable such that a closure is made for the variable when
* the address of `fd` is taken.
*/
VarDeclaration makeThis2Argument(const ref Loc loc, Scope* sc, FuncDeclaration fd)
{
Type tthis2 = Type.tvoidptr.sarrayOf(2);
VarDeclaration vthis2 = new VarDeclaration(loc, tthis2, Identifier.generateId("__this"), null);
vthis2.storage_class |= STC.temp;
vthis2.dsymbolSemantic(sc);
vthis2.parent = sc.parent;
// make it a closure var
assert(sc.func);
sc.func.closureVars.push(vthis2);
// add `fd` to the nested refs
vthis2.nestedrefs.push(fd);
return vthis2;
}
/*******************************
* Make sure that the runtime hook `id` exists.
* Params:
* loc = location to use for error messages
* sc = current scope
* id = the hook identifier
* description = what the hook does
* module_ = what module the hook is located in
* Returns:
* a `bool` indicating if the hook is present.
*/
bool verifyHookExist(const ref Loc loc, ref Scope sc, Identifier id, string description, Identifier module_ = Id.object)
{
auto rootSymbol = sc.search(loc, Id.empty, null);
if (auto moduleSymbol = rootSymbol.search(loc, module_))
if (moduleSymbol.search(loc, id))
return true;
error(loc, "`%s.%s` not found. The current runtime does not support %.*s, or the runtime is corrupt.", module_.toChars(), id.toChars(), cast(int)description.length, description.ptr);
return false;
}
/***************************************
* Fit elements[] to the corresponding types of the `sd`'s fields.
*
* Params:
* sd = the struct declaration
* loc = location to use for error messages
* sc = context
* elements = explicit arguments used to construct object
* stype = the constructed object type.
* Returns:
* false if any errors occur,
* otherwise true and elements[] are rewritten for the output.
*/
private bool fit(StructDeclaration sd, const ref Loc loc, Scope* sc, Expressions* elements, Type stype)
{
if (!elements)
return true;
const nfields = sd.nonHiddenFields();
size_t offset = 0;
for (size_t i = 0; i < elements.length; i++)
{
Expression e = (*elements)[i];
if (!e)
continue;
e = resolveProperties(sc, e);
if (i >= nfields)
{
if (i < sd.fields.length && e.op == EXP.null_)
{
// CTFE sometimes creates null as hidden pointer; we'll allow this.
continue;
}
.error(loc, "more initializers than fields (%llu) of `%s`", cast(ulong)nfields, sd.toChars());
return false;
}
VarDeclaration v = sd.fields[i];
if (v.offset < offset)
{
.error(loc, "overlapping initialization for `%s`", v.toChars());
if (!sd.isUnionDeclaration())
{
enum errorMsg = "`struct` initializers that contain anonymous unions" ~
" must initialize only the first member of a `union`. All subsequent" ~
" non-overlapping fields are default initialized";
.errorSupplemental(loc, errorMsg);
}
return false;
}
const vsize = v.type.size();
if (vsize == SIZE_INVALID)
return false;
offset = cast(uint)(v.offset + vsize);
Type t = v.type;
if (stype)
t = t.addMod(stype.mod);
Type origType = t;
Type tb = t.toBasetype();
const hasPointers = tb.hasPointers();
if (hasPointers)
{
if ((!stype.alignment.isDefault() && stype.alignment.get() < target.ptrsize ||
(v.offset & (target.ptrsize - 1))) &&
(sc.setUnsafe(false, loc,
"field `%s.%s` cannot assign to misaligned pointers in `@safe` code", sd, v)))
{
return false;
}
}
/* Look for case of initializing a static array with a too-short
* string literal, such as:
* char[5] foo = "abc";
* Allow this by doing an explicit cast, which will lengthen the string
* literal.
*/
if (e.op == EXP.string_ && tb.ty == Tsarray)
{
StringExp se = cast(StringExp)e;
Type typeb = se.type.toBasetype();
TY tynto = tb.nextOf().ty;
if (!se.committed &&
(typeb.ty == Tarray || typeb.ty == Tsarray) && tynto.isSomeChar &&
se.numberOfCodeUnits(tynto) < (cast(TypeSArray)tb).dim.toInteger())
{
e = se.castTo(sc, t);
goto L1;
}
}
while (!e.implicitConvTo(t) && tb.ty == Tsarray)
{
/* Static array initialization, as in:
* T[3][5] = e;
*/
t = tb.nextOf();
tb = t.toBasetype();
}
if (!e.implicitConvTo(t))
t = origType; // restore type for better diagnostic
e = e.implicitCastTo(sc, t);
L1:
if (e.op == EXP.error)
return false;
(*elements)[i] = doCopyOrMove(sc, e);
}
return true;
}
/**
* Returns `em` as a VariableExp
* Params:
* em = the EnumMember to wrap
* loc = location of use of em
* sc = scope of use of em
* Returns:
* VarExp referenceing `em` or ErrorExp if `em` if disabled/deprecated
*/
Expression getVarExp(EnumMember em, const ref Loc loc, Scope* sc)
{
dsymbolSemantic(em, sc);
if (em.errors)
return ErrorExp.get();
em.checkDisabled(loc, sc);
if (em.depdecl && !em.depdecl._scope)
em.depdecl._scope = sc;
em.checkDeprecated(loc, sc);
if (em.errors)
return ErrorExp.get();
Expression e = new VarExp(loc, em);
e = e.expressionSemantic(sc);
if (!(sc.flags & SCOPE.Cfile) && em.isCsymbol())
{
/* C11 types them as int. But if in D file,
* type qualified names as the enum
*/
e.type = em.parent.isEnumDeclaration().type;
assert(e.type);
}
return e;
}
/*****************************
* Try to treat `exp` as a boolean,
* Params:
* exp = the expression
* sc = scope to evalute `exp` in
* Returns:
* Modified expression on success, ErrorExp on error
*/
Expression toBoolean(Expression exp, Scope* sc)
{
switch(exp.op)
{
case EXP.delete_:
exp.error("`delete` does not give a boolean result");
return ErrorExp.get();
case EXP.comma:
auto ce = exp.isCommaExp();
auto ex2 = ce.e2.toBoolean(sc);
if (ex2.op == EXP.error)
return ex2;
ce.e2 = ex2;
ce.type = ce.e2.type;
return ce;
case EXP.assign:
case EXP.construct:
case EXP.blit:
case EXP.loweredAssignExp:
if (sc.flags & SCOPE.Cfile)
return exp;
// Things like:
// if (a = b) ...
// are usually mistakes.
exp.error("assignment cannot be used as a condition, perhaps `==` was meant?");
return ErrorExp.get();
//LogicalExp
case EXP.andAnd:
case EXP.orOr:
auto le = exp.isLogicalExp();
auto ex2 = le.e2.toBoolean(sc);
if (ex2.op == EXP.error)
return ex2;
le.e2 = ex2;
return le;
case EXP.question:
auto ce = exp.isCondExp();
auto ex1 = ce.e1.toBoolean(sc);
auto ex2 = ce.e2.toBoolean(sc);
if (ex1.op == EXP.error)
return ex1;
if (ex2.op == EXP.error)
return ex2;
ce.e1 = ex1;
ce.e2 = ex2;
return ce;
default:
// Default is 'yes' - do nothing
Expression e = arrayFuncConv(exp, sc);
Type t = e.type;
Type tb = t.toBasetype();
Type att = null;
while (1)
{
// Structs can be converted to bool using opCast(bool)()
if (auto ts = tb.isTypeStruct())
{
AggregateDeclaration ad = ts.sym;
/* Don't really need to check for opCast first, but by doing so we
* get better error messages if it isn't there.
*/
if (Dsymbol fd = search_function(ad, Id._cast))
{
e = new CastExp(exp.loc, e, Type.tbool);
e = e.expressionSemantic(sc);
return e;
}
// Forward to aliasthis.
if (ad.aliasthis && !isRecursiveAliasThis(att, tb))
{
e = resolveAliasThis(sc, e);
t = e.type;
tb = e.type.toBasetype();
continue;
}
}
break;
}
if (!t.isBoolean())
{
if (tb != Type.terror)
exp.error("expression `%s` of type `%s` does not have a boolean value",
exp.toChars(), t.toChars());
return ErrorExp.get();
}
return e;
}
}
|
D
|
/home/hoover/u10/breber/458/sem_proj/rust-parallelism/gaussian_elimination/target/release/deps/gaussian_elimination-068fe3e3f54fb25e: src/main.rs
/home/hoover/u10/breber/458/sem_proj/rust-parallelism/gaussian_elimination/target/release/deps/gaussian_elimination-068fe3e3f54fb25e.d: src/main.rs
src/main.rs:
|
D
|
/*
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module hunt.stomp.simp.stomp.StompReactorNettyCodec;
// import java.nio.ByteBuffer;
// import java.util.List;
// import hunt.stomp.Message;
// import hunt.stomp.tcp.reactor.AbstractNioBufferReactorNettyCodec;
// /**
// * Simple delegation to StompDecoder and StompEncoder.
// *
// * @author Rossen Stoyanchev
// * @since 5.0
// */
// public class StompReactorNettyCodec : AbstractNioBufferReactorNettyCodec!(byte[]) {
// private final StompDecoder decoder;
// private final StompEncoder encoder;
// public StompReactorNettyCodec() {
// this(new StompDecoder());
// }
// public StompReactorNettyCodec(StompDecoder decoder) {
// this(decoder, new StompEncoder());
// }
// public StompReactorNettyCodec(StompDecoder decoder, StompEncoder encoder) {
// this.decoder = decoder;
// this.encoder = encoder;
// }
// override
// protected List!(Message!(byte[])) decodeInternal(ByteBuffer nioBuffer) {
// return this.decoder.decode(nioBuffer);
// }
// protected ByteBuffer encodeInternal(Message!(byte[]) message) {
// return ByteBuffer.wrap(this.encoder.encode(message));
// }
// }
|
D
|
// Written in the D programming language.
/**
* This test program pulls in all the library modules in order to run the unit
* tests on them. Then, it prints out the arguments passed to main().
*
* Copyright: Copyright Digital Mars 2000 - 2009.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: $(WEB digitalmars.com, Walter Bright)
*
* Copyright Digital Mars 2000 - 2009.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
public import std.base64;
public import std.compiler;
public import std.concurrency;
public import std.conv;
public import std.cpuid;
public import std.cstream;
public import std.ctype;
public import std.datetime;
public import std.demangle;
public import std.file;
public import std.format;
public import std.getopt;
public import std.math;
public import std.mathspecial;
public import std.md5;
public import std.metastrings;
public import std.mmfile;
public import std.outbuffer;
public import std.parallelism;
public import std.path;
public import std.perf;
public import std.process;
public import std.random;
public import std.regexp;
public import std.signals;
//public import std.slist;
public import std.socket;
public import std.socketstream;
public import std.stdint;
public import std.stdio;
public import std.stream;
public import std.string;
public import std.syserror;
public import std.system;
public import std.traits;
public import std.typetuple;
public import std.uni;
public import std.uri;
public import std.utf;
public import std.uuid;
public import std.variant;
public import std.zip;
public import std.zlib;
public import std.net.isemail;
public import std.net.curl;
public import std.digest.digest;
public import std.digest.crc;
public import std.digest.sha;
public import std.digest.md;
int main(char[][] args)
{
version (all)
{
// Bring in unit test for module by referencing function in it
cmp("foo", "bar"); // string
fncharmatch('a', 'b'); // path
isNaN(1.0); // math
std.conv.to!double("1.0"); // std.conv
OutBuffer b = new OutBuffer(); // outbuffer
std.ctype.tolower('A'); // ctype
RegExp r = new RegExp(null, null); // regexp
uint ranseed = std.random.unpredictableSeed();
thisTid();
int a[];
a.reverse; // adi
a.sort; // qsort
Clock.currTime(); // datetime
Exception e = new ReadException(""); // stream
din.eof(); // cstream
isValidDchar(cast(dchar)0); // utf
std.uri.ascii2hex(0); // uri
std.zlib.adler32(0,null); // D.zlib
auto t = task!cmp("foo", "bar"); // parallelism
ubyte[16] buf;
std.md5.sum(buf,"");
creal c = 3.0 + 4.0i;
c = sqrt(c);
assert(c.re == 2);
assert(c.im == 1);
printf("args.length = %d\n", args.length);
for (int i = 0; i < args.length; i++)
printf("args[%d] = '%s'\n", i, cast(char *)args[i]);
int[3] x;
x[0] = 3;
x[1] = 45;
x[2] = -1;
x.sort;
assert(x[0] == -1);
assert(x[1] == 3);
assert(x[2] == 45);
std.math.sin(3.0);
std.mathspecial.gamma(6.2);
std.demangle.demangle("hello");
std.uni.isUniAlpha('A');
std.file.exists("foo");
foreach_reverse (dchar d; "hello"c) { }
foreach_reverse (k, dchar d; "hello"c) { }
std.signals.linkin();
writefln(std.cpuid.toString());
bool isEmail = std.net.isemail.isEmail("abc");
auto http = std.net.curl.HTTP("dlang.org");
auto uuid = randomUUID();
auto md5 = md5Of("hello");
auto sha1 = sha1Of("hello");
auto crc = crc32Of("hello");
auto string = toHexString(crc);
}
puts("Success!");
return 0;
}
|
D
|
instance DIA_Attila_EXIT(C_Info)
{
npc = VLK_494_Attila;
nr = 999;
condition = DIA_Attila_EXIT_Condition;
information = DIA_Attila_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Attila_EXIT_Condition()
{
return TRUE;
};
func void DIA_Attila_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Attila_PICKPOCKET(C_Info)
{
npc = VLK_494_Attila;
nr = 900;
condition = DIA_Attila_PICKPOCKET_Condition;
information = DIA_Attila_PICKPOCKET_Info;
permanent = TRUE;
description = Pickpocket_60;
};
func int DIA_Attila_PICKPOCKET_Condition()
{
return C_Beklauen(55,100);
};
func void DIA_Attila_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Attila_PICKPOCKET);
Info_AddChoice(DIA_Attila_PICKPOCKET,Dialog_Back,DIA_Attila_PICKPOCKET_BACK);
Info_AddChoice(DIA_Attila_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Attila_PICKPOCKET_DoIt);
};
func void DIA_Attila_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Attila_PICKPOCKET);
};
func void DIA_Attila_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Attila_PICKPOCKET);
};
instance DIA_Attila_Hallo(C_Info)
{
npc = VLK_494_Attila;
nr = 1;
condition = DIA_Attila_Hallo_Condition;
information = DIA_Attila_Hallo_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Attila_Hallo_Condition()
{
if(MIS_ThiefGuild_sucked == TRUE)
{
return TRUE;
};
};
func void DIA_Attila_Hallo_Info()
{
AI_Output(self,other,"DIA_Attila_Hallo_09_00"); //(quietly) Ah - finally. I've been waiting for you, stranger.
Info_ClearChoices(DIA_Attila_Hallo);
Info_AddChoice(DIA_Attila_Hallo,"What do you want from me?",DIA_Attila_Hallo_Was);
Info_AddChoice(DIA_Attila_Hallo,"Who are you?",DIA_Attila_Hallo_Wer);
B_GivePlayerXP(XP_Attila_MetHim);
};
func void DIA_Attila_Hallo_Wer()
{
AI_Output(other,self,"DIA_Attila_Hallo_Wer_15_00"); //Who are you?
AI_Output(self,other,"DIA_Attila_Hallo_Wer_09_01"); //I'm called Attila ... but is my name important? Our names are meaningless.
AI_Output(self,other,"DIA_Attila_Hallo_Wer_09_02"); //You should know that best, stranger. (laughs quietly)
Knows_Attila_Wer = TRUE;
Info_ClearChoices(DIA_Attila_Hallo);
if(Knows_Attila_Was == FALSE)
{
Info_AddChoice(DIA_Attila_Hallo,"What do you want from me?",DIA_Attila_Hallo_Was);
};
Info_AddChoice(DIA_Attila_Hallo,"What's this farce about?",DIA_Attila_Hallo_Theater);
};
func void DIA_Attila_Hallo_Was()
{
AI_Output(other,self,"DIA_Attila_Hallo_Was_15_00"); //What do you want from me?
AI_Output(self,other,"DIA_Attila_Hallo_Was_09_01"); //I'm here to explain a few things to you. And afterwards, I'm going to kill you.
Knows_Attila_Was = TRUE;
Info_ClearChoices(DIA_Attila_Hallo);
if(Knows_Attila_Wer == FALSE)
{
Info_AddChoice(DIA_Attila_Hallo,"Who are you?",DIA_Attila_Hallo_Wer);
};
Info_AddChoice(DIA_Attila_Hallo,"Who pays you for this?",DIA_Attila_Hallo_Auftrag);
Info_AddChoice(DIA_Attila_Hallo,"What's this farce about?",DIA_Attila_Hallo_Theater);
};
func void DIA_Attila_Hallo_Theater()
{
AI_Output(other,self,"DIA_Attila_Hallo_Theater_15_00"); //What's this farce about?
AI_Output(self,other,"DIA_Attila_Hallo_Theater_09_01"); //You shouldn't die ignorant at the end of your journey. Consider it a final show of respect to the condemned.
Info_ClearChoices(DIA_Attila_Hallo);
Info_AddChoice(DIA_Attila_Hallo,"I'm going to leave now (END)",DIA_Attila_Hallo_Ende);
Info_AddChoice(DIA_Attila_Hallo,"Who pays you for this?",DIA_Attila_Hallo_Auftrag);
Info_AddChoice(DIA_Attila_Hallo,"Why do you want to kill me?",DIA_Attila_Hallo_Warum);
};
func void DIA_Attila_Hallo_Ende()
{
AI_Output(other,self,"DIA_Attila_Hallo_Ende_15_00"); //I'm going to leave now ...
AI_Output(self,other,"DIA_Attila_Hallo_Ende_09_01"); //I'm afraid ... I can't allow that. Resign yourself to it. It is time to die.
AI_DrawWeapon(self);
Info_ClearChoices(DIA_Attila_Hallo);
Info_AddChoice(DIA_Attila_Hallo,"Who pays you for this?",DIA_Attila_Hallo_Auftrag);
Info_AddChoice(DIA_Attila_Hallo,"Why do you want to kill me?",DIA_Attila_Hallo_Warum);
};
func void DIA_Attila_Hallo_Auftrag()
{
AI_Output(other,self,"DIA_Attila_Hallo_Auftrag_15_00"); //Who pays you for this?
AI_Output(self,other,"DIA_Attila_Hallo_Auftrag_09_01"); //My employers work out of the public view, as do I.
AI_Output(self,other,"DIA_Attila_Hallo_Auftrag_09_02"); //A condition of my contract is that I name neither their names nor their residences.
Info_ClearChoices(DIA_Attila_Hallo);
Info_AddChoice(DIA_Attila_Hallo,"Why do you want to kill me?",DIA_Attila_Hallo_Warum);
};
func void DIA_Attila_Hallo_Warum()
{
AI_Output(other,self,"DIA_Attila_Hallo_Warum_15_00"); //Why do you want to kill me?
if(Betrayal_Halvor == TRUE)
{
AI_Output(self,other,"DIA_Attila_Hallo_Warum_09_01"); //You blew the whistle on Halvor. Now he's sitting in jail. That was not part of the plan.
};
if(Rengaru_InKnast == TRUE)
{
AI_Output(self,other,"DIA_Attila_Hallo_Warum_09_02"); //You sold Rengaru to the city. He is only a petty thief, but you shouldn't have done that.
};
if(Nagur_Ausgeliefert == TRUE)
{
AI_Output(self,other,"DIA_Attila_Hallo_Warum_09_03"); //Nagur is behind bars because of your interference. An unforgivable mistake, as some see it.
};
AI_Output(self,other,"DIA_Attila_Hallo_Warum_09_04"); //My employers are not exactly pleased about it. To prevent you from making yet another mistake, they have sent me.
Info_ClearChoices(DIA_Attila_Hallo);
Info_AddChoice(DIA_Attila_Hallo,"I can give you gold ...",DIA_Attila_Hallo_Gold);
Info_AddChoice(DIA_Attila_Hallo,"Let me at least draw my weapon.",DIA_Attila_Hallo_Attacke);
};
func void DIA_Attila_Hallo_Gold()
{
AI_Output(other,self,"DIA_Attila_Hallo_Gold_15_00"); //I can give you gold - a lot of gold.
AI_Output(self,other,"DIA_Attila_Hallo_Gold_09_01"); //Futile. That's not why I have come. The only price that you will pay is your life. And right now.
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
func void DIA_Attila_Hallo_Attacke()
{
AI_Output(other,self,"DIA_Attila_Hallo_Attacke_15_00"); //Let me at least draw my weapon.
if(Npc_HasEquippedWeapon(other) == TRUE)
{
AI_Output(self,other,"DIA_Attila_Hallo_Attacke_09_01"); //Good, then prepare for your last battle.
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
}
else
{
AI_Output(self,other,"DIA_Attila_Hallo_Attacke_09_02"); //You're not even wearing one on your belt. You don't have much time left, stranger. Your death awaits you.
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,2);
};
};
instance DIA_Attila_Willkommen(C_Info)
{
npc = VLK_494_Attila;
nr = 1;
condition = DIA_Attila_Willkommen_Condition;
information = DIA_Attila_Willkommen_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Attila_Willkommen_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (MIS_ThiefGuild_sucked == FALSE))
{
return TRUE;
};
};
func void DIA_Attila_Willkommen_Info()
{
AI_Output(self,other,"DIA_Attila_Willkommen_09_00"); //Ah - finally. I've been waiting for you, stranger.
B_GivePlayerXP(XP_Attila_Friend);
AI_Output(other,self,"DIA_Attila_Willkommen_15_01"); //Who are you, and what do you want from me?
AI_Output(self,other,"DIA_Attila_Willkommen_09_02"); //That isn't important. What is important is what you've done. You have remained loyal - even if you weren't aware of it.
AI_Output(self,other,"DIA_Attila_Willkommen_09_03"); //Some benefactors have become aware of your loyalty. And they are offering you a chance. So use it.
AI_Output(other,self,"DIA_Attila_Willkommen_15_04"); //Hey, just tell me why you're here.
AI_Output(self,other,"DIA_Attila_Willkommen_09_05"); //I have a gift for you. Everything else is up to you, stranger. (laughs quietly)
B_GiveInvItems(self,other,ItKe_ThiefGuildKey_MIS,1);
Attila_Key = TRUE;
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"AFTER");
};
instance DIA_Attila_NachSchluessel(C_Info)
{
npc = VLK_494_Attila;
nr = 1;
condition = DIA_Attila_NachSchluessel_Condition;
information = DIA_Attila_NachSchluessel_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_Attila_NachSchluessel_Condition()
{
if(Npc_KnowsInfo(other,DIA_Attila_Wer) && Npc_IsInState(self,ZS_Talk))
{
return TRUE;
};
};
func void DIA_Attila_NachSchluessel_Info()
{
AI_Output(self,other,"DIA_Attila_NachSchluessel_09_00"); //My task is done - for now.
AI_Output(self,other,"DIA_Attila_NachSchluessel_09_01"); //But who knows, perhaps our paths will cross again...
AI_StopProcessInfos(self);
};
instance DIA_Attila_Wer(C_Info)
{
npc = VLK_494_Attila;
nr = 1;
condition = DIA_Attila_Wer_Condition;
information = DIA_Attila_Wer_Info;
permanent = FALSE;
description = "Who are you?";
};
func int DIA_Attila_Wer_Condition()
{
if(Npc_KnowsInfo(other,DIA_Attila_Willkommen))
{
return TRUE;
};
};
func void DIA_Attila_Wer_Info()
{
AI_Output(other,self,"DIA_Attila_Hallo_Wer_15_00"); //Who are you?
AI_Output(self,other,"DIA_Attila_Hallo_Wer_09_01"); //I'm called Attila ... but is my name important? Our names are meaningless.
AI_Output(self,other,"DIA_Attila_Hallo_Wer_09_02"); //You should know that best, stranger. (laughs quietly)
AI_StopProcessInfos(self);
};
|
D
|
instance DIA_AkilsSchaf_KommMit(C_Info)
{
npc = Follow_Sheep_AKIL;
nr = 1;
condition = DIA_AkilsSchaf_KommMit_Condition;
information = DIA_AkilsSchaf_KommMit_Info;
description = "Пойдем со мной!";
};
func int DIA_AkilsSchaf_KommMit_Condition()
{
if(self.aivar[AIV_PARTYMEMBER] == FALSE)
{
return TRUE;
};
};
func void DIA_AkilsSchaf_KommMit_Info()
{
B_KommMit();
B_LieselMaeh();
self.aivar[AIV_PARTYMEMBER] = TRUE;
if(Npc_IsDead(BDT_1025_Bandit_H) == FALSE)
{
BDT_1025_Bandit_H.aivar[AIV_EnemyOverride] = FALSE;
};
if(Npc_IsDead(BDT_1026_Bandit_H) == FALSE)
{
BDT_1026_Bandit_H.aivar[AIV_EnemyOverride] = FALSE;
};
AI_StopProcessInfos(self);
};
|
D
|
module kernel.arch.x86_64.core.descriptor;
// This list provides the types allowed for a system segment descriptor
enum SystemSegmentType {
LocalDescriptorTable = 0b0010,
AvailableTSS = 0b1001,
BusyTSS = 0b1011,
CallGate = 0b1100,
InterruptGate = 0b1110,
TrapGate = 0b1111
}
|
D
|
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableIdentifier.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableIdentifier~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableIdentifier~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableIdentifier~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module solution;
export int makeNegative(int number)
{
if(number < 0)
{
return number;
}
return -number;
}
|
D
|
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC src/core/sys/windows/_ole2.d)
*/
module core.sys.windows.ole2;
version (Windows):
pragma(lib, "ole32");
public import core.sys.windows.basetyps, core.sys.windows.objbase, core.sys.windows.oleauto, core.sys.windows.olectlid,
core.sys.windows.oleidl, core.sys.windows.unknwn, core.sys.windows.winerror, core.sys.windows.uuid;
private import core.sys.windows.objfwd, core.sys.windows.objidl, core.sys.windows.windef, core.sys.windows.wtypes;
private import core.sys.windows.winuser; // for LPMSG
const E_DRAW = VIEW_E_DRAW;
const DATA_E_FORMATETC = DV_E_FORMATETC;
enum {
OLEIVERB_PRIMARY = 0,
OLEIVERB_SHOW = -1,
OLEIVERB_OPEN = -2,
OLEIVERB_HIDE = -3,
OLEIVERB_UIACTIVATE = -4,
OLEIVERB_INPLACEACTIVATE = -5,
OLEIVERB_DISCARDUNDOSTATE = -6
}
const EMBDHLP_INPROC_HANDLER = 0x0000L;
const EMBDHLP_INPROC_SERVER = 0x0001L;
const EMBDHLP_CREATENOW = 0x00000000L;
const EMBDHLP_DELAYCREATE = 0x00010000L;
align(8):
struct OLESTREAM {
LPOLESTREAMVTBL lpstbl;
}
alias OLESTREAM* LPOLESTREAM;
extern (Windows) {
struct OLESTREAMVTBL {
DWORD function (LPOLESTREAM, void*, DWORD) Get;
DWORD function (LPOLESTREAM, void*, DWORD) Put;
}
}
alias OLESTREAMVTBL* LPOLESTREAMVTBL;
extern (Windows) {
HRESULT CreateDataAdviseHolder(LPDATAADVISEHOLDER*);
DWORD OleBuildVersion();
HRESULT ReadClassStg(LPSTORAGE, CLSID*);
HRESULT WriteClassStg(LPSTORAGE, REFCLSID);
HRESULT ReadClassStm(LPSTREAM, CLSID*);
HRESULT WriteClassStm(LPSTREAM, REFCLSID);
HRESULT WriteFmtUserTypeStg(LPSTORAGE, CLIPFORMAT, LPOLESTR);
HRESULT ReadFmtUserTypeStg(LPSTORAGE, CLIPFORMAT*, LPOLESTR*);
HRESULT OleInitialize(PVOID);
void OleUninitialize();
HRESULT OleQueryLinkFromData(LPDATAOBJECT);
HRESULT OleQueryCreateFromData(LPDATAOBJECT);
HRESULT OleCreate(REFCLSID, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
HRESULT OleCreateFromData(LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
HRESULT OleCreateLinkFromData(LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
HRESULT OleCreateStaticFromData(LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
HRESULT OleCreateLink(LPMONIKER, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
HRESULT OleCreateLinkToFile(LPCOLESTR, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
HRESULT OleCreateFromFile(REFCLSID, LPCOLESTR, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
HRESULT OleLoad(LPSTORAGE, REFIID, LPOLECLIENTSITE, PVOID*);
HRESULT OleSave(LPPERSISTSTORAGE, LPSTORAGE, BOOL);
HRESULT OleLoadFromStream(LPSTREAM, REFIID, PVOID*);
HRESULT OleSaveToStream(LPPERSISTSTREAM, LPSTREAM);
HRESULT OleSetContainedObject(LPUNKNOWN, BOOL);
HRESULT OleNoteObjectVisible(LPUNKNOWN, BOOL);
HRESULT RegisterDragDrop(HWND, LPDROPTARGET);
HRESULT RevokeDragDrop(HWND);
HRESULT DoDragDrop(LPDATAOBJECT, LPDROPSOURCE, DWORD, PDWORD);
HRESULT OleSetClipboard(LPDATAOBJECT);
HRESULT OleGetClipboard(LPDATAOBJECT*);
HRESULT OleFlushClipboard();
HRESULT OleIsCurrentClipboard(LPDATAOBJECT);
HOLEMENU OleCreateMenuDescriptor(HMENU, LPOLEMENUGROUPWIDTHS);
HRESULT OleSetMenuDescriptor(HOLEMENU, HWND, HWND, LPOLEINPLACEFRAME, LPOLEINPLACEACTIVEOBJECT);
HRESULT OleDestroyMenuDescriptor(HOLEMENU);
HRESULT OleTranslateAccelerator(LPOLEINPLACEFRAME, LPOLEINPLACEFRAMEINFO, LPMSG);
HANDLE OleDuplicateData(HANDLE, CLIPFORMAT, UINT);
HRESULT OleDraw(LPUNKNOWN, DWORD, HDC, LPCRECT);
HRESULT OleRun(LPUNKNOWN);
BOOL OleIsRunning(LPOLEOBJECT);
HRESULT OleLockRunning(LPUNKNOWN, BOOL, BOOL);
void ReleaseStgMedium(LPSTGMEDIUM);
HRESULT CreateOleAdviseHolder(LPOLEADVISEHOLDER*);
HRESULT OleCreateDefaultHandler(REFCLSID, LPUNKNOWN, REFIID, PVOID*);
HRESULT OleCreateEmbeddingHelper(REFCLSID, LPUNKNOWN, DWORD, LPCLASSFACTORY, REFIID, PVOID*);
BOOL IsAccelerator(HACCEL, int, LPMSG, WORD*);
HGLOBAL OleGetIconOfFile(LPOLESTR, BOOL);
HGLOBAL OleGetIconOfClass(REFCLSID, LPOLESTR, BOOL);
HGLOBAL OleMetafilePictFromIconAndLabel(HICON, LPOLESTR, LPOLESTR, UINT);
HRESULT OleRegGetUserType(REFCLSID, DWORD, LPOLESTR*);
HRESULT OleRegGetMiscStatus(REFCLSID, DWORD, DWORD*);
HRESULT OleRegEnumFormatEtc (REFCLSID, DWORD, LPENUMFORMATETC*);
HRESULT OleRegEnumVerbs (REFCLSID, LPENUMOLEVERB*);
HRESULT OleConvertOLESTREAMToIStorage(LPOLESTREAM, LPSTORAGE, DVTARGETDEVICE*);
HRESULT OleConvertIStorageToOLESTREAM(LPSTORAGE, LPOLESTREAM);
HRESULT GetHGlobalFromILockBytes(LPLOCKBYTES, HGLOBAL*);
HRESULT CreateILockBytesOnHGlobal(HGLOBAL, BOOL, LPLOCKBYTES*);
HRESULT GetHGlobalFromStream(LPSTREAM, HGLOBAL*);
HRESULT CreateStreamOnHGlobal(HGLOBAL, BOOL, LPSTREAM*);
HRESULT OleDoAutoConvert(LPSTORAGE, LPCLSID);
HRESULT OleGetAutoConvert(REFCLSID, LPCLSID);
HRESULT OleSetAutoConvert(REFCLSID, REFCLSID);
HRESULT GetConvertStg(LPSTORAGE);
HRESULT SetConvertStg(LPSTORAGE, BOOL);
HRESULT OleConvertIStorageToOLESTREAMEx(LPSTORAGE, CLIPFORMAT, LONG, LONG, DWORD, LPSTGMEDIUM, LPOLESTREAM);
HRESULT OleConvertOLESTREAMToIStorageEx(LPOLESTREAM, LPSTORAGE, CLIPFORMAT*, LONG*, LONG*, DWORD*, LPSTGMEDIUM);
}
|
D
|
/Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Leaf.build/Tag/Models/Else.swift.o : /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/libc.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Polymorphic.swiftmodule
/Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Leaf.build/Else~partial.swiftmodule : /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/libc.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Polymorphic.swiftmodule
/Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Leaf.build/Else~partial.swiftdoc : /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/libc.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Polymorphic.swiftmodule
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.