code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
import std.stdio;
import std.math;
bool isPrime(int n)
{
for(int i=2; i <= cast(int)sqrt(cast(double)n); i++)
{
if (n % i == 0)
return false;
}
return true;
}
int largestPrimeFactor()
{
long n = 600851475143;
int max = 0;
for (int i=2; i<cast(int)sqrt(cast(double)n); i++)
{
if (n % i == 0)
{
if (isPrime(i))
{
writefln("Found another prime: %s", i);
max = i;
}
}
}
return max;
}
void main()
{
writeln(largestPrimeFactor());
}
|
D
|
/**
* TypeInfo support code.
*
* Copyright: Copyright Digital Mars 2004 - 2009.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Walter Bright
*/
/* Copyright Digital Mars 2004 - 2009.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module rt.typeinfo.ti_void;
// void
class TypeInfo_v : TypeInfo
{
@trusted:
const:
pure:
nothrow:
override string toString() const pure nothrow @safe { return "void"; }
override hash_t getHash(in void* p)
{
assert(0);
}
override equals_t equals(in void* p1, in void* p2)
{
return *cast(byte *)p1 == *cast(byte *)p2;
}
override int compare(in void* p1, in void* p2)
{
return *cast(byte *)p1 - *cast(byte *)p2;
}
override @property size_t tsize() nothrow pure
{
return void.sizeof;
}
override void swap(void *p1, void *p2)
{
byte t;
t = *cast(byte *)p1;
*cast(byte *)p1 = *cast(byte *)p2;
*cast(byte *)p2 = t;
}
override @property uint flags() nothrow pure
{
return 1;
}
}
|
D
|
import test19746a;
class Qux: Bar { }
|
D
|
instance BDT_1072_Addon_Logan (Npc_Default)
{
// ------ NSC ------
name = "Logan";
guild = GIL_BDT;
id = 1072;
voice = 10;
flags = 0;
npctype = NPCTYPE_MAIN;
//aivars
aivar[AIV_NewsOverride] = TRUE;
// ------ Attribute ------
B_SetAttributesToChapter (self, 3);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG;
// ------ Equippte Waffen ------
EquipItem (self, ItMw_1h_Sld_Sword);
EquipItem (self, ItRw_Bow_M_02);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------
B_SetNpcVisual (self, MALE, "Hum_Head_Thief", Face_N_Cipher_neu, BodyTex_N, ITAR_BDT_M);
Mdl_SetModelFatness (self, - 0.5);
Mdl_ApplyOverlayMds (self, "Humans_Militia.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 70);
// ------ TA anmelden ------
daily_routine = Rtn_Start_1072;
};
FUNC VOID Rtn_Start_1072 ()
{
TA_Stand_Guarding (09,00,21,00,"ADW_BANDIT_VP3_03");
TA_Stand_Guarding (21,00,09,00,"ADW_BANDIT_VP3_03");
};
FUNC VOID Rtn_Jagd_1072 ()
{
TA_Stand_Guarding (09,00,21,00,"ADW_BANDIT_VP3_05");
TA_Stand_Guarding (21,00,09,00,"ADW_BANDIT_VP3_05");
};
FUNC VOID Rtn_Lager_1072 ()
{
TA_Stand_Drinking (09,00,21,00,"BL_INN_03_C");
TA_Stand_Drinking (21,00,09,00,"BL_INN_03_C");
};
FUNC VOID Rtn_Mine_1072()
{
TA_Pick_Ore (10,00,20,00,"ADW_MINE_PICK_08");
TA_Pick_Ore (20,00,10,00,"ADW_MINE_PICK_08");
};
|
D
|
/**
* Does the semantic 1 pass on the AST, which looks at symbol declarations but not initializers
* or function bodies.
*
* Copyright: Copyright (C) 1999-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: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/dsymbolsem.d, _dsymbolsem.d)
* Documentation: https://dlang.org/phobos/dmd_dsymbolsem.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/dsymbolsem.d
*/
module dmd.dsymbolsem;
import core.stdc.stdio;
import core.stdc.string;
import dmd.aggregate;
import dmd.aliasthis;
import dmd.arraytypes;
import dmd.astcodegen;
import dmd.attrib;
import dmd.blockexit;
import dmd.clone;
import dmd.compiler;
import dmd.dcast;
import dmd.dclass;
import dmd.declaration;
import dmd.denum;
import dmd.dimport;
import dmd.dinterpret;
import dmd.dmangle;
import dmd.dmodule;
import dmd.dscope;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dtemplate;
import dmd.dversion;
import dmd.errors;
import dmd.escape;
import dmd.expression;
import dmd.expressionsem;
import dmd.func;
import dmd.globals;
import dmd.id;
import dmd.identifier;
import dmd.init;
import dmd.initsem;
import dmd.hdrgen;
import dmd.mtype;
import dmd.nogc;
import dmd.nspace;
import dmd.objc;
import dmd.opover;
import dmd.parse;
import dmd.root.filename;
import dmd.root.outbuffer;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.semantic2;
import dmd.semantic3;
import dmd.sideeffect;
import dmd.statementsem;
import dmd.staticassert;
import dmd.tokens;
import dmd.utf;
import dmd.utils;
import dmd.statement;
import dmd.target;
import dmd.templateparamsem;
import dmd.typesem;
import dmd.visitor;
enum LOG = false;
/*****************************************
* Create inclusive postblit for struct by aggregating
* all the postblits in postblits[] with the postblits for
* all the members.
* Note the close similarity with AggregateDeclaration::buildDtor(),
* and the ordering changes (runs forward instead of backwards).
*/
private FuncDeclaration buildPostBlit(StructDeclaration sd, Scope* sc)
{
//printf("StructDeclaration::buildPostBlit() %s\n", sd.toChars());
if (sd.isUnionDeclaration())
return null;
// by default, the storage class of the created postblit
StorageClass stc = STC.safe | STC.nothrow_ | STC.pure_ | STC.nogc;
Loc declLoc = sd.postblits.dim ? sd.postblits[0].loc : sd.loc;
Loc loc; // internal code should have no loc to prevent coverage
// if any of the postblits are disabled, then the generated postblit
// will be disabled
for (size_t i = 0; i < sd.postblits.dim; i++)
{
stc |= sd.postblits[i].storage_class & STC.disable;
}
VarDeclaration[] fieldsToDestroy;
auto postblitCalls = new Statements();
// iterate through all the struct fields that are not disabled
for (size_t i = 0; i < sd.fields.dim && !(stc & STC.disable); i++)
{
auto structField = sd.fields[i];
if (structField.storage_class & STC.ref_)
continue;
if (structField.overlapped)
continue;
// if it's a struct declaration or an array of structs
Type tv = structField.type.baseElemOf();
if (tv.ty != Tstruct)
continue;
auto sdv = (cast(TypeStruct)tv).sym;
// which has a postblit declaration
if (!sdv.postblit)
continue;
assert(!sdv.isUnionDeclaration());
// if this field's postblit is not `nothrow`, add a `scope(failure)`
// block to destroy any prior successfully postblitted fields should
// this field's postblit fail
if (fieldsToDestroy.length > 0 && !(cast(TypeFunction)sdv.postblit.type).isnothrow)
{
// create a list of destructors that need to be called
Expression[] dtorCalls;
foreach(sf; fieldsToDestroy)
{
Expression ex;
tv = sf.type.toBasetype();
if (tv.ty == Tstruct)
{
// this.v.__xdtor()
ex = new ThisExp(loc);
ex = new DotVarExp(loc, ex, sf);
// This is a hack so we can call destructors on const/immutable objects.
ex = new AddrExp(loc, ex);
ex = new CastExp(loc, ex, sf.type.mutableOf().pointerTo());
ex = new PtrExp(loc, ex);
if (stc & STC.safe)
stc = (stc & ~STC.safe) | STC.trusted;
auto sfv = (cast(TypeStruct)sf.type.baseElemOf()).sym;
ex = new DotVarExp(loc, ex, sfv.dtor, false);
ex = new CallExp(loc, ex);
dtorCalls ~= ex;
}
else
{
// _ArrayDtor((cast(S*)this.v.ptr)[0 .. n])
const length = tv.numberOfElems(loc);
ex = new ThisExp(loc);
ex = new DotVarExp(loc, ex, sf);
// This is a hack so we can call destructors on const/immutable objects.
ex = new DotIdExp(loc, ex, Id.ptr);
ex = new CastExp(loc, ex, sdv.type.pointerTo());
if (stc & STC.safe)
stc = (stc & ~STC.safe) | STC.trusted;
auto se = new SliceExp(loc, ex, new IntegerExp(loc, 0, Type.tsize_t),
new IntegerExp(loc, length, Type.tsize_t));
// Prevent redundant bounds check
se.upperIsInBounds = true;
se.lowerIsLessThanUpper = true;
ex = new CallExp(loc, new IdentifierExp(loc, Id.__ArrayDtor), se);
dtorCalls ~= ex;
}
}
fieldsToDestroy = [];
// aggregate the destructor calls
auto dtors = new Statements();
foreach_reverse(dc; dtorCalls)
{
dtors.push(new ExpStatement(loc, dc));
}
// put destructor calls in a `scope(failure)` block
postblitCalls.push(new ScopeGuardStatement(loc, TOK.onScopeFailure, new CompoundStatement(loc, dtors)));
}
// perform semantic on the member postblit in order to
// be able to aggregate it later on with the rest of the
// postblits
sdv.postblit.functionSemantic();
stc = mergeFuncAttrs(stc, sdv.postblit);
stc = mergeFuncAttrs(stc, sdv.dtor);
// if any of the struct member fields has disabled
// its postblit, then `sd` is not copyable, so no
// postblit is generated
if (stc & STC.disable)
{
postblitCalls.setDim(0);
break;
}
Expression ex;
tv = structField.type.toBasetype();
if (tv.ty == Tstruct)
{
// this.v.__xpostblit()
ex = new ThisExp(loc);
ex = new DotVarExp(loc, ex, structField);
// This is a hack so we can call postblits on const/immutable objects.
ex = new AddrExp(loc, ex);
ex = new CastExp(loc, ex, structField.type.mutableOf().pointerTo());
ex = new PtrExp(loc, ex);
if (stc & STC.safe)
stc = (stc & ~STC.safe) | STC.trusted;
ex = new DotVarExp(loc, ex, sdv.postblit, false);
ex = new CallExp(loc, ex);
}
else
{
// _ArrayPostblit((cast(S*)this.v.ptr)[0 .. n])
const length = tv.numberOfElems(loc);
if (length == 0)
continue;
ex = new ThisExp(loc);
ex = new DotVarExp(loc, ex, structField);
// This is a hack so we can call postblits on const/immutable objects.
ex = new DotIdExp(loc, ex, Id.ptr);
ex = new CastExp(loc, ex, sdv.type.pointerTo());
if (stc & STC.safe)
stc = (stc & ~STC.safe) | STC.trusted;
auto se = new SliceExp(loc, ex, new IntegerExp(loc, 0, Type.tsize_t),
new IntegerExp(loc, length, Type.tsize_t));
// Prevent redundant bounds check
se.upperIsInBounds = true;
se.lowerIsLessThanUpper = true;
ex = new CallExp(loc, new IdentifierExp(loc, Id.__ArrayPostblit), se);
}
postblitCalls.push(new ExpStatement(loc, ex)); // combine in forward order
/* https://issues.dlang.org/show_bug.cgi?id=10972
* When subsequent field postblit calls fail,
* this field should be destructed for Exception Safety.
*/
if (sdv.dtor)
{
sdv.dtor.functionSemantic();
// keep a list of fields that need to be destroyed in case
// of a future postblit failure
fieldsToDestroy ~= structField;
}
}
void checkShared()
{
if (sd.type.isShared())
stc |= STC.shared_;
}
// Build our own "postblit" which executes a, but only if needed.
if (postblitCalls.dim || (stc & STC.disable))
{
//printf("Building __fieldPostBlit()\n");
checkShared();
auto dd = new PostBlitDeclaration(declLoc, Loc.initial, stc, Id.__fieldPostblit);
dd.generated = true;
dd.storage_class |= STC.inference;
dd.fbody = (stc & STC.disable) ? null : new CompoundStatement(loc, postblitCalls);
sd.postblits.shift(dd);
sd.members.push(dd);
dd.dsymbolSemantic(sc);
}
// create __xpostblit, which is the generated postblit
FuncDeclaration xpostblit = null;
switch (sd.postblits.dim)
{
case 0:
break;
case 1:
xpostblit = sd.postblits[0];
break;
default:
Expression e = null;
stc = STC.safe | STC.nothrow_ | STC.pure_ | STC.nogc;
for (size_t i = 0; i < sd.postblits.dim; i++)
{
auto fd = sd.postblits[i];
stc = mergeFuncAttrs(stc, fd);
if (stc & STC.disable)
{
e = null;
break;
}
Expression ex = new ThisExp(loc);
ex = new DotVarExp(loc, ex, fd, false);
ex = new CallExp(loc, ex);
e = Expression.combine(e, ex);
}
checkShared();
auto dd = new PostBlitDeclaration(declLoc, Loc.initial, stc, Id.__aggrPostblit);
dd.generated = true;
dd.storage_class |= STC.inference;
dd.fbody = new ExpStatement(loc, e);
sd.members.push(dd);
dd.dsymbolSemantic(sc);
xpostblit = dd;
break;
}
// Add an __xpostblit alias to make the inclusive postblit accessible
if (xpostblit)
{
auto _alias = new AliasDeclaration(Loc.initial, Id.__xpostblit, xpostblit);
_alias.dsymbolSemantic(sc);
sd.members.push(_alias);
_alias.addMember(sc, sd); // add to symbol table
}
return xpostblit;
}
/**
* Generates a copy constructor declaration with the specified storage
* class for the parameter and the function.
*
* Params:
* sd = the `struct` that contains the copy constructor
* paramStc = the storage class of the copy constructor parameter
* funcStc = the storage class for the copy constructor declaration
*
* Returns:
* The copy constructor declaration for struct `sd`.
*/
private CtorDeclaration generateCopyCtorDeclaration(StructDeclaration sd, const StorageClass paramStc, const StorageClass funcStc)
{
auto fparams = new Parameters();
auto structType = sd.type;
fparams.push(new Parameter(paramStc | STC.ref_ | STC.return_ | STC.scope_, structType, Id.p, null, null));
ParameterList pList = ParameterList(fparams);
auto tf = new TypeFunction(pList, structType, LINK.d, STC.ref_);
auto ccd = new CtorDeclaration(sd.loc, Loc.initial, STC.ref_, tf, true);
ccd.storage_class |= funcStc;
ccd.storage_class |= STC.inference;
ccd.generated = true;
return ccd;
}
/**
* Generates a trivial copy constructor body that simply does memberwise
* initialization:
*
* this.field1 = rhs.field1;
* this.field2 = rhs.field2;
* ...
*
* Params:
* sd = the `struct` declaration that contains the copy constructor
*
* Returns:
* A `CompoundStatement` containing the body of the copy constructor.
*/
private Statement generateCopyCtorBody(StructDeclaration sd)
{
Loc loc;
Expression e;
foreach (v; sd.fields)
{
auto ec = new AssignExp(loc,
new DotVarExp(loc, new ThisExp(loc), v),
new DotVarExp(loc, new IdentifierExp(loc, Id.p), v));
e = Expression.combine(e, ec);
//printf("e.toChars = %s\n", e.toChars());
}
Statement s1 = new ExpStatement(loc, e);
return new CompoundStatement(loc, s1);
}
/**
* Generates a copy constructor for a specified `struct` sd if
* the following conditions are met:
*
* 1. sd does not define a copy constructor
* 2. at least one field of sd defines a copy constructor
*
* If the above conditions are met, the following copy constructor
* is generated:
*
* this(ref return scope inout(S) rhs) inout
* {
* this.field1 = rhs.field1;
* this.field2 = rhs.field2;
* ...
* }
*
* Params:
* sd = the `struct` for which the copy constructor is generated
* sc = the scope where the copy constructor is generated
*
* Returns:
* `true` if `struct` sd defines a copy constructor (explicitly or generated),
* `false` otherwise.
*/
private bool buildCopyCtor(StructDeclaration sd, Scope* sc)
{
if (global.errors)
return false;
bool hasPostblit;
if (sd.postblit && !sd.postblit.isDisabled())
hasPostblit = true;
auto ctor = sd.search(sd.loc, Id.ctor);
CtorDeclaration cpCtor;
CtorDeclaration rvalueCtor;
if (ctor)
{
if (ctor.isOverloadSet())
return false;
if (auto td = ctor.isTemplateDeclaration())
ctor = td.funcroot;
}
if (!ctor)
goto LcheckFields;
overloadApply(ctor, (Dsymbol s)
{
if (s.isTemplateDeclaration())
return 0;
auto ctorDecl = s.isCtorDeclaration();
assert(ctorDecl);
if (ctorDecl.isCpCtor)
{
if (!cpCtor)
cpCtor = ctorDecl;
return 0;
}
auto tf = ctorDecl.type.toTypeFunction();
const dim = tf.parameterList.length;
if (dim == 1)
{
auto param = tf.parameterList[0];
if (param.type.mutableOf().unSharedOf() == sd.type.mutableOf().unSharedOf())
{
rvalueCtor = ctorDecl;
}
}
return 0;
});
if (cpCtor && rvalueCtor)
{
.error(sd.loc, "`struct %s` may not define both a rvalue constructor and a copy constructor", sd.toChars());
errorSupplemental(rvalueCtor.loc,"rvalue constructor defined here");
errorSupplemental(cpCtor.loc, "copy constructor defined here");
return true;
}
else if (cpCtor)
{
return !hasPostblit;
}
LcheckFields:
VarDeclaration fieldWithCpCtor;
// see if any struct members define a copy constructor
foreach (v; sd.fields)
{
if (v.storage_class & STC.ref_)
continue;
if (v.overlapped)
continue;
auto ts = v.type.baseElemOf().isTypeStruct();
if (!ts)
continue;
if (ts.sym.hasCopyCtor)
{
fieldWithCpCtor = v;
break;
}
}
if (fieldWithCpCtor && rvalueCtor)
{
.error(sd.loc, "`struct %s` may not define a rvalue constructor and have fields with copy constructors", sd.toChars());
errorSupplemental(rvalueCtor.loc,"rvalue constructor defined here");
errorSupplemental(fieldWithCpCtor.loc, "field with copy constructor defined here");
return false;
}
else if (!fieldWithCpCtor)
return false;
if (hasPostblit)
return false;
//printf("generating copy constructor for %s\n", sd.toChars());
const MOD paramMod = MODFlags.wild;
const MOD funcMod = MODFlags.wild;
auto ccd = generateCopyCtorDeclaration(sd, ModToStc(paramMod), ModToStc(funcMod));
auto copyCtorBody = generateCopyCtorBody(sd);
ccd.fbody = copyCtorBody;
sd.members.push(ccd);
ccd.addMember(sc, sd);
const errors = global.startGagging();
Scope* sc2 = sc.push();
sc2.stc = 0;
sc2.linkage = LINK.d;
ccd.dsymbolSemantic(sc2);
ccd.semantic2(sc2);
ccd.semantic3(sc2);
//printf("ccd semantic: %s\n", ccd.type.toChars());
sc2.pop();
if (global.endGagging(errors))
{
ccd.storage_class |= STC.disable;
ccd.fbody = null;
}
return true;
}
private uint setMangleOverride(Dsymbol s, const(char)[] sym)
{
if (s.isFuncDeclaration() || s.isVarDeclaration())
{
s.isDeclaration().mangleOverride = sym;
return 1;
}
if (auto ad = s.isAttribDeclaration())
{
uint nestedCount = 0;
ad.include(null).foreachDsymbol( (s) { nestedCount += setMangleOverride(s, sym); } );
return nestedCount;
}
return 0;
}
/*************************************
* Does semantic analysis on the public face of declarations.
*/
extern(C++) void dsymbolSemantic(Dsymbol dsym, Scope* sc)
{
scope v = new DsymbolSemanticVisitor(sc);
dsym.accept(v);
}
structalign_t getAlignment(AlignDeclaration ad, Scope* sc)
{
if (ad.salign != ad.UNKNOWN)
return ad.salign;
if (!ad.ealign)
return ad.salign = STRUCTALIGN_DEFAULT;
sc = sc.startCTFE();
ad.ealign = ad.ealign.expressionSemantic(sc);
ad.ealign = resolveProperties(sc, ad.ealign);
sc = sc.endCTFE();
ad.ealign = ad.ealign.ctfeInterpret();
if (ad.ealign.op == TOK.error)
return ad.salign = STRUCTALIGN_DEFAULT;
Type tb = ad.ealign.type.toBasetype();
auto n = ad.ealign.toInteger();
if (n < 1 || n & (n - 1) || structalign_t.max < n || !tb.isintegral())
{
error(ad.loc, "alignment must be an integer positive power of 2, not %s", ad.ealign.toChars());
return ad.salign = STRUCTALIGN_DEFAULT;
}
return ad.salign = cast(structalign_t)n;
}
const(char)* getMessage(DeprecatedDeclaration dd)
{
if (auto sc = dd._scope)
{
dd._scope = null;
sc = sc.startCTFE();
dd.msg = dd.msg.expressionSemantic(sc);
dd.msg = resolveProperties(sc, dd.msg);
sc = sc.endCTFE();
dd.msg = dd.msg.ctfeInterpret();
if (auto se = dd.msg.toStringExp())
dd.msgstr = se.toStringz().ptr;
else
dd.msg.error("compile time constant expected, not `%s`", dd.msg.toChars());
}
return dd.msgstr;
}
// Returns true if a contract can appear without a function body.
package bool allowsContractWithoutBody(FuncDeclaration funcdecl)
{
assert(!funcdecl.fbody);
/* Contracts can only appear without a body when they are virtual
* interface functions or abstract.
*/
Dsymbol parent = funcdecl.toParent();
InterfaceDeclaration id = parent.isInterfaceDeclaration();
if (!funcdecl.isAbstract() &&
(funcdecl.fensures || funcdecl.frequires) &&
!(id && funcdecl.isVirtual()))
{
auto cd = parent.isClassDeclaration();
if (!(cd && cd.isAbstract()))
return false;
}
return true;
}
private extern(C++) final class DsymbolSemanticVisitor : Visitor
{
alias visit = Visitor.visit;
Scope* sc;
this(Scope* sc)
{
this.sc = sc;
}
// Save the scope and defer semantic analysis on the Dsymbol.
private void deferDsymbolSemantic(Dsymbol s, Scope *scx)
{
s._scope = scx ? scx : sc.copy();
s._scope.setNoFree();
Module.addDeferredSemantic(s);
}
override void visit(Dsymbol dsym)
{
dsym.error("%p has no semantic routine", dsym);
}
override void visit(ScopeDsymbol) { }
override void visit(Declaration) { }
override void visit(AliasThis dsym)
{
if (dsym.semanticRun != PASS.init)
return;
if (dsym._scope)
{
sc = dsym._scope;
dsym._scope = null;
}
if (!sc)
return;
dsym.semanticRun = PASS.semantic;
dsym.isDeprecated_ = !!(sc.stc & STC.deprecated_);
Dsymbol p = sc.parent.pastMixin();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(dsym.loc, "alias this can only be a member of aggregate, not %s `%s`", p.kind(), p.toChars());
return;
}
assert(ad.members);
Dsymbol s = ad.search(dsym.loc, dsym.ident);
if (!s)
{
s = sc.search(dsym.loc, dsym.ident, null);
if (s)
error(dsym.loc, "`%s` is not a member of `%s`", s.toChars(), ad.toChars());
else
error(dsym.loc, "undefined identifier `%s`", dsym.ident.toChars());
return;
}
if (ad.aliasthis && s != ad.aliasthis)
{
error(dsym.loc, "there can be only one alias this");
return;
}
/* disable the alias this conversion so the implicit conversion check
* doesn't use it.
*/
ad.aliasthis = null;
Dsymbol sx = s;
if (sx.isAliasDeclaration())
sx = sx.toAlias();
Declaration d = sx.isDeclaration();
if (d && !d.isTupleDeclaration())
{
/* https://issues.dlang.org/show_bug.cgi?id=18429
*
* If the identifier in the AliasThis declaration
* is defined later and is a voldemort type, we must
* perform semantic on the declaration to deduce the type.
*/
if (!d.type)
d.dsymbolSemantic(sc);
Type t = d.type;
assert(t);
if (ad.type.implicitConvTo(t) > MATCH.nomatch)
{
error(dsym.loc, "alias this is not reachable as `%s` already converts to `%s`", ad.toChars(), t.toChars());
}
}
dsym.sym = s;
// Restore alias this
ad.aliasthis = dsym;
dsym.semanticRun = PASS.semanticdone;
}
override void visit(AliasDeclaration dsym)
{
if (dsym.semanticRun >= PASS.semanticdone)
return;
assert(dsym.semanticRun <= PASS.semantic);
dsym.storage_class |= sc.stc & STC.deprecated_;
dsym.protection = sc.protection;
dsym.userAttribDecl = sc.userAttribDecl;
if (!sc.func && dsym.inNonRoot())
return;
aliasSemantic(dsym, sc);
}
override void visit(VarDeclaration dsym)
{
version (none)
{
printf("VarDeclaration::semantic('%s', parent = '%s') sem = %d\n",
dsym.toChars(), sc.parent ? sc.parent.toChars() : null, dsym.semanticRun);
printf(" type = %s\n", dsym.type ? dsym.type.toChars() : "null");
printf(" stc = x%llx\n", dsym.storage_class);
printf(" storage_class = x%llx\n", dsym.storage_class);
printf("linkage = %d\n", dsym.linkage);
//if (strcmp(toChars(), "mul") == 0) assert(0);
}
//if (semanticRun > PASS.init)
// return;
//semanticRun = PSSsemantic;
if (dsym.semanticRun >= PASS.semanticdone)
return;
if (sc && sc.inunion && sc.inunion.isAnonDeclaration())
dsym.overlapped = true;
Scope* scx = null;
if (dsym._scope)
{
sc = dsym._scope;
scx = sc;
dsym._scope = null;
}
if (!sc)
return;
dsym.semanticRun = PASS.semantic;
/* Pick up storage classes from context, but except synchronized,
* override, abstract, and final.
*/
dsym.storage_class |= (sc.stc & ~(STC.synchronized_ | STC.override_ | STC.abstract_ | STC.final_));
if (dsym.storage_class & STC.extern_ && dsym._init)
dsym.error("extern symbols cannot have initializers");
dsym.userAttribDecl = sc.userAttribDecl;
dsym.cppnamespace = sc.namespace;
AggregateDeclaration ad = dsym.isThis();
if (ad)
dsym.storage_class |= ad.storage_class & STC.TYPECTOR;
/* If auto type inference, do the inference
*/
int inferred = 0;
if (!dsym.type)
{
dsym.inuse++;
// Infering the type requires running semantic,
// so mark the scope as ctfe if required
bool needctfe = (dsym.storage_class & (STC.manifest | STC.static_)) != 0;
if (needctfe)
{
sc.flags |= SCOPE.condition;
sc = sc.startCTFE();
}
//printf("inferring type for %s with init %s\n", dsym.toChars(), dsym._init.toChars());
dsym._init = dsym._init.inferType(sc);
dsym.type = dsym._init.initializerToExpression().type;
if (needctfe)
sc = sc.endCTFE();
dsym.inuse--;
inferred = 1;
/* This is a kludge to support the existing syntax for RAII
* declarations.
*/
dsym.storage_class &= ~STC.auto_;
dsym.originalType = dsym.type.syntaxCopy();
}
else
{
if (!dsym.originalType)
dsym.originalType = dsym.type.syntaxCopy();
/* Prefix function attributes of variable declaration can affect
* its type:
* pure nothrow void function() fp;
* static assert(is(typeof(fp) == void function() pure nothrow));
*/
Scope* sc2 = sc.push();
sc2.stc |= (dsym.storage_class & STC.FUNCATTR);
dsym.inuse++;
dsym.type = dsym.type.typeSemantic(dsym.loc, sc2);
dsym.inuse--;
sc2.pop();
}
//printf(" semantic type = %s\n", dsym.type ? dsym.type.toChars() : "null");
if (dsym.type.ty == Terror)
dsym.errors = true;
dsym.type.checkDeprecated(dsym.loc, sc);
dsym.linkage = sc.linkage;
dsym.parent = sc.parent;
//printf("this = %p, parent = %p, '%s'\n", dsym, dsym.parent, dsym.parent.toChars());
dsym.protection = sc.protection;
/* If scope's alignment is the default, use the type's alignment,
* otherwise the scope overrrides.
*/
dsym.alignment = sc.alignment();
if (dsym.alignment == STRUCTALIGN_DEFAULT)
dsym.alignment = dsym.type.alignment(); // use type's alignment
//printf("sc.stc = %x\n", sc.stc);
//printf("storage_class = x%x\n", storage_class);
if (global.params.vcomplex)
dsym.type.checkComplexTransition(dsym.loc, sc);
// Calculate type size + safety checks
if (sc.func && !sc.intypeof)
{
if (dsym.storage_class & STC.gshared && !dsym.isMember())
{
if (sc.func.setUnsafe())
dsym.error("__gshared not allowed in safe functions; use shared");
}
}
Dsymbol parent = dsym.toParent();
Type tb = dsym.type.toBasetype();
Type tbn = tb.baseElemOf();
if (tb.ty == Tvoid && !(dsym.storage_class & STC.lazy_))
{
if (inferred)
{
dsym.error("type `%s` is inferred from initializer `%s`, and variables cannot be of type `void`", dsym.type.toChars(), dsym._init.toChars());
}
else
dsym.error("variables cannot be of type `void`");
dsym.type = Type.terror;
tb = dsym.type;
}
if (tb.ty == Tfunction)
{
dsym.error("cannot be declared to be a function");
dsym.type = Type.terror;
tb = dsym.type;
}
if (auto ts = tb.isTypeStruct())
{
if (!ts.sym.members)
{
dsym.error("no definition of struct `%s`", ts.toChars());
}
}
if ((dsym.storage_class & STC.auto_) && !inferred)
dsym.error("storage class `auto` has no effect if type is not inferred, did you mean `scope`?");
if (auto tt = tb.isTypeTuple())
{
/* Instead, declare variables for each of the tuple elements
* and add those.
*/
size_t nelems = Parameter.dim(tt.arguments);
Expression ie = (dsym._init && !dsym._init.isVoidInitializer()) ? dsym._init.initializerToExpression() : null;
if (ie)
ie = ie.expressionSemantic(sc);
if (nelems > 0 && ie)
{
auto iexps = new Expressions();
iexps.push(ie);
auto exps = new Expressions();
for (size_t pos = 0; pos < iexps.dim; pos++)
{
Lexpand1:
Expression e = (*iexps)[pos];
Parameter arg = Parameter.getNth(tt.arguments, pos);
arg.type = arg.type.typeSemantic(dsym.loc, sc);
//printf("[%d] iexps.dim = %d, ", pos, iexps.dim);
//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 (e != ie)
{
if (iexps.dim > nelems)
goto Lnomatch;
if (e.type.implicitConvTo(arg.type))
continue;
}
if (e.op == TOK.tuple)
{
TupleExp te = cast(TupleExp)e;
if (iexps.dim - 1 + te.exps.dim > nelems)
goto Lnomatch;
iexps.remove(pos);
iexps.insert(pos, te.exps);
(*iexps)[pos] = Expression.combine(te.e0, (*iexps)[pos]);
goto Lexpand1;
}
else if (isAliasThisTuple(e))
{
auto v = copyToTemp(0, "__tup", e);
v.dsymbolSemantic(sc);
auto ve = new VarExp(dsym.loc, v);
ve.type = e.type;
exps.setDim(1);
(*exps)[0] = ve;
expandAliasThisTuples(exps, 0);
for (size_t u = 0; u < exps.dim; u++)
{
Lexpand2:
Expression ee = (*exps)[u];
arg = Parameter.getNth(tt.arguments, pos + u);
arg.type = arg.type.typeSemantic(dsym.loc, sc);
//printf("[%d+%d] exps.dim = %d, ", pos, u, exps.dim);
//printf("ee = (%s %s, %s), ", Token::tochars[ee.op], ee.toChars(), ee.type.toChars());
//printf("arg = (%s, %s)\n", arg.toChars(), arg.type.toChars());
size_t iexps_dim = iexps.dim - 1 + exps.dim;
if (iexps_dim > nelems)
goto Lnomatch;
if (ee.type.implicitConvTo(arg.type))
continue;
if (expandAliasThisTuples(exps, u) != -1)
goto Lexpand2;
}
if ((*exps)[0] != ve)
{
Expression e0 = (*exps)[0];
(*exps)[0] = new CommaExp(dsym.loc, new DeclarationExp(dsym.loc, v), e0);
(*exps)[0].type = e0.type;
iexps.remove(pos);
iexps.insert(pos, exps);
goto Lexpand1;
}
}
}
if (iexps.dim < nelems)
goto Lnomatch;
ie = new TupleExp(dsym._init.loc, iexps);
}
Lnomatch:
if (ie && ie.op == TOK.tuple)
{
TupleExp te = cast(TupleExp)ie;
size_t tedim = te.exps.dim;
if (tedim != nelems)
{
error(dsym.loc, "tuple of %d elements cannot be assigned to tuple of %d elements", cast(int)tedim, cast(int)nelems);
for (size_t u = tedim; u < nelems; u++) // fill dummy expression
te.exps.push(ErrorExp.get());
}
}
auto exps = new Objects(nelems);
for (size_t i = 0; i < nelems; i++)
{
Parameter arg = Parameter.getNth(tt.arguments, i);
OutBuffer buf;
buf.printf("__%s_field_%llu", dsym.ident.toChars(), cast(ulong)i);
auto id = Identifier.idPool(buf[]);
Initializer ti;
if (ie)
{
Expression einit = ie;
if (ie.op == TOK.tuple)
{
TupleExp te = cast(TupleExp)ie;
einit = (*te.exps)[i];
if (i == 0)
einit = Expression.combine(te.e0, einit);
}
ti = new ExpInitializer(einit.loc, einit);
}
else
ti = dsym._init ? dsym._init.syntaxCopy() : null;
StorageClass storage_class = STC.temp | dsym.storage_class;
if ((dsym.storage_class & STC.parameter) && (arg.storageClass & STC.parameter))
storage_class |= arg.storageClass;
auto v = new VarDeclaration(dsym.loc, arg.type, id, ti, storage_class);
//printf("declaring field %s of type %s\n", v.toChars(), v.type.toChars());
v.dsymbolSemantic(sc);
if (sc.scopesym)
{
//printf("adding %s to %s\n", v.toChars(), sc.scopesym.toChars());
if (sc.scopesym.members)
// Note this prevents using foreach() over members, because the limits can change
sc.scopesym.members.push(v);
}
Expression e = new DsymbolExp(dsym.loc, v);
(*exps)[i] = e;
}
auto v2 = new TupleDeclaration(dsym.loc, dsym.ident, exps);
v2.parent = dsym.parent;
v2.isexp = true;
dsym.aliassym = v2;
dsym.semanticRun = PASS.semanticdone;
return;
}
/* Storage class can modify the type
*/
dsym.type = dsym.type.addStorageClass(dsym.storage_class);
/* Adjust storage class to reflect type
*/
if (dsym.type.isConst())
{
dsym.storage_class |= STC.const_;
if (dsym.type.isShared())
dsym.storage_class |= STC.shared_;
}
else if (dsym.type.isImmutable())
dsym.storage_class |= STC.immutable_;
else if (dsym.type.isShared())
dsym.storage_class |= STC.shared_;
else if (dsym.type.isWild())
dsym.storage_class |= STC.wild;
if (StorageClass stc = dsym.storage_class & (STC.synchronized_ | STC.override_ | STC.abstract_ | STC.final_))
{
if (stc == STC.final_)
dsym.error("cannot be `final`, perhaps you meant `const`?");
else
{
OutBuffer buf;
stcToBuffer(&buf, stc);
dsym.error("cannot be `%s`", buf.peekChars());
}
dsym.storage_class &= ~stc; // strip off
}
// At this point we can add `scope` to the STC instead of `in`,
// because we are never going to use this variable's STC for user messages
if (dsym.storage_class & STC.in_ && global.params.previewIn)
dsym.storage_class |= STC.scope_;
if (dsym.storage_class & STC.scope_)
{
StorageClass stc = dsym.storage_class & (STC.static_ | STC.extern_ | STC.manifest | STC.tls | STC.gshared);
if (stc)
{
OutBuffer buf;
stcToBuffer(&buf, stc);
dsym.error("cannot be `scope` and `%s`", buf.peekChars());
}
else if (dsym.isMember())
{
dsym.error("field cannot be `scope`");
}
else if (!dsym.type.hasPointers())
{
dsym.storage_class &= ~STC.scope_; // silently ignore; may occur in generic code
}
}
if (dsym.storage_class & (STC.static_ | STC.extern_ | STC.manifest | STC.templateparameter | STC.tls | STC.gshared | STC.ctfe))
{
}
else
{
AggregateDeclaration aad = parent.isAggregateDeclaration();
if (aad)
{
if (global.params.vfield && dsym.storage_class & (STC.const_ | STC.immutable_) && dsym._init && !dsym._init.isVoidInitializer())
{
const(char)* s = (dsym.storage_class & STC.immutable_) ? "immutable" : "const";
message(dsym.loc, "`%s.%s` is `%s` field", ad.toPrettyChars(), dsym.toChars(), s);
}
dsym.storage_class |= STC.field;
if (auto ts = tbn.isTypeStruct())
if (ts.sym.noDefaultCtor)
{
if (!dsym.isThisDeclaration() && !dsym._init)
aad.noDefaultCtor = true;
}
}
InterfaceDeclaration id = parent.isInterfaceDeclaration();
if (id)
{
dsym.error("field not allowed in interface");
}
else if (aad && aad.sizeok == Sizeok.done)
{
dsym.error("cannot be further field because it will change the determined %s size", aad.toChars());
}
/* Templates cannot add fields to aggregates
*/
TemplateInstance ti = parent.isTemplateInstance();
if (ti)
{
// Take care of nested templates
while (1)
{
TemplateInstance ti2 = ti.tempdecl.parent.isTemplateInstance();
if (!ti2)
break;
ti = ti2;
}
// If it's a member template
AggregateDeclaration ad2 = ti.tempdecl.isMember();
if (ad2 && dsym.storage_class != STC.undefined_)
{
dsym.error("cannot use template to add field to aggregate `%s`", ad2.toChars());
}
}
}
if ((dsym.storage_class & (STC.ref_ | STC.parameter | STC.foreach_ | STC.temp | STC.result)) == STC.ref_ && dsym.ident != Id.This)
{
dsym.error("only parameters or `foreach` declarations can be `ref`");
}
if (dsym.type.hasWild())
{
if (dsym.storage_class & (STC.static_ | STC.extern_ | STC.tls | STC.gshared | STC.manifest | STC.field) || dsym.isDataseg())
{
dsym.error("only parameters or stack based variables can be `inout`");
}
FuncDeclaration func = sc.func;
if (func)
{
if (func.fes)
func = func.fes.func;
bool isWild = false;
for (FuncDeclaration fd = func; fd; fd = fd.toParentDecl().isFuncDeclaration())
{
if ((cast(TypeFunction)fd.type).iswild)
{
isWild = true;
break;
}
}
if (!isWild)
{
dsym.error("`inout` variables can only be declared inside `inout` functions");
}
}
}
if (!(dsym.storage_class & (STC.ctfe | STC.ref_ | STC.result)) &&
tbn.ty == Tstruct && (cast(TypeStruct)tbn).sym.noDefaultCtor)
{
if (!dsym._init)
{
if (dsym.isField())
{
/* For fields, we'll check the constructor later to make sure it is initialized
*/
dsym.storage_class |= STC.nodefaultctor;
}
else if (dsym.storage_class & STC.parameter)
{
}
else
dsym.error("default construction is disabled for type `%s`", dsym.type.toChars());
}
}
FuncDeclaration fd = parent.isFuncDeclaration();
if (dsym.type.isscope() && !(dsym.storage_class & STC.nodtor))
{
if (dsym.storage_class & (STC.field | STC.out_ | STC.ref_ | STC.static_ | STC.manifest | STC.tls | STC.gshared) || !fd)
{
dsym.error("globals, statics, fields, manifest constants, ref and out parameters cannot be `scope`");
}
// @@@DEPRECATED@@@ https://dlang.org/deprecate.html#scope%20as%20a%20type%20constraint
// Deprecated in 2.087
// Remove this when the feature is removed from the language
if (0 && // deprecation disabled for now to accommodate existing extensive use
!(dsym.storage_class & STC.scope_))
{
if (!(dsym.storage_class & STC.parameter) && dsym.ident != Id.withSym)
dsym.error("reference to `scope class` must be `scope`");
}
}
// Calculate type size + safety checks
if (sc.func && !sc.intypeof)
{
if (dsym._init && dsym._init.isVoidInitializer() && dsym.type.hasPointers()) // get type size
{
if (sc.func.setUnsafe())
dsym.error("`void` initializers for pointers not allowed in safe functions");
}
else if (!dsym._init &&
!(dsym.storage_class & (STC.static_ | STC.extern_ | STC.tls | STC.gshared | STC.manifest | STC.field | STC.parameter)) &&
dsym.type.hasVoidInitPointers())
{
if (sc.func.setUnsafe())
dsym.error("`void` initializers for pointers not allowed in safe functions");
}
}
if ((!dsym._init || dsym._init.isVoidInitializer) && !fd)
{
// If not mutable, initializable by constructor only
dsym.storage_class |= STC.ctorinit;
}
if (dsym._init)
dsym.storage_class |= STC.init; // remember we had an explicit initializer
else if (dsym.storage_class & STC.manifest)
dsym.error("manifest constants must have initializers");
bool isBlit = false;
d_uns64 sz;
if (!dsym._init &&
!(dsym.storage_class & (STC.static_ | STC.gshared | STC.extern_)) &&
fd &&
(!(dsym.storage_class & (STC.field | STC.in_ | STC.foreach_ | STC.parameter | STC.result)) ||
(dsym.storage_class & STC.out_)) &&
(sz = dsym.type.size()) != 0)
{
// Provide a default initializer
//printf("Providing default initializer for '%s'\n", toChars());
if (sz == SIZE_INVALID && dsym.type.ty != Terror)
dsym.error("size of type `%s` is invalid", dsym.type.toChars());
Type tv = dsym.type;
while (tv.ty == Tsarray) // Don't skip Tenum
tv = tv.nextOf();
if (tv.needsNested())
{
/* Nested struct requires valid enclosing frame pointer.
* In StructLiteralExp::toElem(), it's calculated.
*/
assert(tbn.ty == Tstruct);
checkFrameAccess(dsym.loc, sc, tbn.isTypeStruct().sym);
Expression e = tv.defaultInitLiteral(dsym.loc);
e = new BlitExp(dsym.loc, new VarExp(dsym.loc, dsym), e);
e = e.expressionSemantic(sc);
dsym._init = new ExpInitializer(dsym.loc, e);
goto Ldtor;
}
if (tv.ty == Tstruct && (cast(TypeStruct)tv).sym.zeroInit)
{
/* If a struct is all zeros, as a special case
* set it's initializer to the integer 0.
* In AssignExp::toElem(), we check for this and issue
* a memset() to initialize the struct.
* Must do same check in interpreter.
*/
Expression e = IntegerExp.literal!0;
e = new BlitExp(dsym.loc, new VarExp(dsym.loc, dsym), e);
e.type = dsym.type; // don't type check this, it would fail
dsym._init = new ExpInitializer(dsym.loc, e);
goto Ldtor;
}
if (dsym.type.baseElemOf().ty == Tvoid)
{
dsym.error("`%s` does not have a default initializer", dsym.type.toChars());
}
else if (auto e = dsym.type.defaultInit(dsym.loc))
{
dsym._init = new ExpInitializer(dsym.loc, e);
}
// Default initializer is always a blit
isBlit = true;
}
if (dsym._init)
{
sc = sc.push();
sc.stc &= ~(STC.TYPECTOR | STC.pure_ | STC.nothrow_ | STC.nogc | STC.ref_ | STC.disable);
ExpInitializer ei = dsym._init.isExpInitializer();
if (ei) // https://issues.dlang.org/show_bug.cgi?id=13424
// Preset the required type to fail in FuncLiteralDeclaration::semantic3
ei.exp = inferType(ei.exp, dsym.type);
// If inside function, there is no semantic3() call
if (sc.func || sc.intypeof == 1)
{
// If local variable, use AssignExp to handle all the various
// possibilities.
if (fd && !(dsym.storage_class & (STC.manifest | STC.static_ | STC.tls | STC.gshared | STC.extern_)) && !dsym._init.isVoidInitializer())
{
//printf("fd = '%s', var = '%s'\n", fd.toChars(), toChars());
if (!ei)
{
ArrayInitializer ai = dsym._init.isArrayInitializer();
Expression e;
if (ai && tb.ty == Taarray)
e = ai.toAssocArrayLiteral();
else
e = dsym._init.initializerToExpression();
if (!e)
{
// Run semantic, but don't need to interpret
dsym._init = dsym._init.initializerSemantic(sc, dsym.type, INITnointerpret);
e = dsym._init.initializerToExpression();
if (!e)
{
dsym.error("is not a static and cannot have static initializer");
e = ErrorExp.get();
}
}
ei = new ExpInitializer(dsym._init.loc, e);
dsym._init = ei;
}
Expression exp = ei.exp;
Expression e1 = new VarExp(dsym.loc, dsym);
if (isBlit)
exp = new BlitExp(dsym.loc, e1, exp);
else
exp = new ConstructExp(dsym.loc, e1, exp);
dsym.canassign++;
exp = exp.expressionSemantic(sc);
dsym.canassign--;
exp = exp.optimize(WANTvalue);
if (exp.op == TOK.error)
{
dsym._init = new ErrorInitializer();
ei = null;
}
else
ei.exp = exp;
if (ei && dsym.isScope())
{
Expression ex = ei.exp.lastComma();
if (ex.op == TOK.blit || ex.op == TOK.construct)
ex = (cast(AssignExp)ex).e2;
if (ex.op == TOK.new_)
{
// See if initializer is a NewExp that can be allocated on the stack
NewExp ne = cast(NewExp)ex;
if (dsym.type.toBasetype().ty == Tclass)
{
if (ne.newargs && ne.newargs.dim > 1)
{
dsym.mynew = true;
}
else
{
ne.onstack = 1;
dsym.onstack = true;
}
}
}
else if (ex.op == TOK.function_)
{
// or a delegate that doesn't escape a reference to the function
FuncDeclaration f = (cast(FuncExp)ex).fd;
if (f.tookAddressOf)
f.tookAddressOf--;
}
}
}
else
{
// https://issues.dlang.org/show_bug.cgi?id=14166
// Don't run CTFE for the temporary variables inside typeof
dsym._init = dsym._init.initializerSemantic(sc, dsym.type, sc.intypeof == 1 ? INITnointerpret : INITinterpret);
const init_err = dsym._init.isExpInitializer();
if (init_err && init_err.exp.op == TOK.showCtfeContext)
{
errorSupplemental(dsym.loc, "compile time context created here");
}
}
}
else if (parent.isAggregateDeclaration())
{
dsym._scope = scx ? scx : sc.copy();
dsym._scope.setNoFree();
}
else if (dsym.storage_class & (STC.const_ | STC.immutable_ | STC.manifest) || dsym.type.isConst() || dsym.type.isImmutable())
{
/* Because we may need the results of a const declaration in a
* subsequent type, such as an array dimension, before semantic2()
* gets ordinarily run, try to run semantic2() now.
* Ignore failure.
*/
if (!inferred)
{
uint errors = global.errors;
dsym.inuse++;
// Bug 20549. Don't try this on modules or packages, syntaxCopy
// could crash (inf. recursion) on a mod/pkg referencing itself
if (ei && (ei.exp.op != TOK.scope_ ? true : !(cast(ScopeExp)ei.exp).sds.isPackage()))
{
Expression exp = ei.exp.syntaxCopy();
bool needctfe = dsym.isDataseg() || (dsym.storage_class & STC.manifest);
if (needctfe)
sc = sc.startCTFE();
exp = exp.expressionSemantic(sc);
exp = resolveProperties(sc, exp);
if (needctfe)
sc = sc.endCTFE();
Type tb2 = dsym.type.toBasetype();
Type ti = exp.type.toBasetype();
/* The problem is the following code:
* struct CopyTest {
* double x;
* this(double a) { x = a * 10.0;}
* this(this) { x += 2.0; }
* }
* const CopyTest z = CopyTest(5.3); // ok
* const CopyTest w = z; // not ok, postblit not run
* static assert(w.x == 55.0);
* because the postblit doesn't get run on the initialization of w.
*/
if (auto ts = ti.isTypeStruct())
{
StructDeclaration sd = ts.sym;
/* Look to see if initializer involves a copy constructor
* (which implies a postblit)
*/
// there is a copy constructor
// and exp is the same struct
if (sd.postblit && tb2.toDsymbol(null) == sd)
{
// The only allowable initializer is a (non-copy) constructor
if (exp.isLvalue())
dsym.error("of type struct `%s` uses `this(this)`, which is not allowed in static initialization", tb2.toChars());
}
}
ei.exp = exp;
}
dsym._init = dsym._init.initializerSemantic(sc, dsym.type, INITinterpret);
dsym.inuse--;
if (global.errors > errors)
{
dsym._init = new ErrorInitializer();
dsym.type = Type.terror;
}
}
else
{
dsym._scope = scx ? scx : sc.copy();
dsym._scope.setNoFree();
}
}
sc = sc.pop();
}
Ldtor:
/* Build code to execute destruction, if necessary
*/
dsym.edtor = dsym.callScopeDtor(sc);
if (dsym.edtor)
{
/* If dsym is a local variable, who's type is a struct with a scope destructor,
* then make dsym scope, too.
*/
if (global.params.vsafe &&
!(dsym.storage_class & (STC.parameter | STC.temp | STC.field | STC.in_ | STC.foreach_ | STC.result | STC.manifest)) &&
!dsym.isDataseg() &&
!dsym.doNotInferScope &&
dsym.type.hasPointers())
{
auto tv = dsym.type.baseElemOf();
if (tv.ty == Tstruct &&
(cast(TypeStruct)tv).sym.dtor.storage_class & STC.scope_)
{
dsym.storage_class |= STC.scope_;
}
}
if (sc.func && dsym.storage_class & (STC.static_ | STC.gshared))
dsym.edtor = dsym.edtor.expressionSemantic(sc._module._scope);
else
dsym.edtor = dsym.edtor.expressionSemantic(sc);
version (none)
{
// currently disabled because of std.stdio.stdin, stdout and stderr
if (dsym.isDataseg() && !(dsym.storage_class & STC.extern_))
dsym.error("static storage variables cannot have destructors");
}
}
dsym.semanticRun = PASS.semanticdone;
if (dsym.type.toBasetype().ty == Terror)
dsym.errors = true;
if(sc.scopesym && !sc.scopesym.isAggregateDeclaration())
{
for (ScopeDsymbol sym = sc.scopesym; sym && dsym.endlinnum == 0;
sym = sym.parent ? sym.parent.isScopeDsymbol() : null)
dsym.endlinnum = sym.endlinnum;
}
}
override void visit(TypeInfoDeclaration dsym)
{
assert(dsym.linkage == LINK.c);
}
override void visit(Import imp)
{
//printf("Import::semantic('%s') %s\n", toPrettyChars(), id.toChars());
if (imp.semanticRun > PASS.init)
return;
if (imp._scope)
{
sc = imp._scope;
imp._scope = null;
}
if (!sc)
return;
imp.semanticRun = PASS.semantic;
// Load if not already done so
bool loadErrored = false;
if (!imp.mod)
{
loadErrored = imp.load(sc);
if (imp.mod)
{
imp.mod.importAll(null);
imp.mod.checkImportDeprecation(imp.loc, sc);
}
}
if (imp.mod)
{
// Modules need a list of each imported module
// if inside a template instantiation, the instantianting
// module gets the import.
// https://issues.dlang.org/show_bug.cgi?id=17181
Module importer = sc._module;
if (sc.minst && sc.tinst)
{
importer = sc.minst;
if (!sc.tinst.importedModules.contains(imp.mod))
sc.tinst.importedModules.push(imp.mod);
}
//printf("%s imports %s\n", importer.toChars(), imp.mod.toChars());
if (!importer.aimports.contains(imp.mod))
importer.aimports.push(imp.mod);
if (sc.explicitProtection)
imp.protection = sc.protection;
if (!imp.aliasId && !imp.names.dim) // neither a selective nor a renamed import
{
ScopeDsymbol scopesym;
for (Scope* scd = sc; scd; scd = scd.enclosing)
{
if (!scd.scopesym)
continue;
scopesym = scd.scopesym;
break;
}
if (!imp.isstatic)
{
scopesym.importScope(imp.mod, imp.protection);
}
// Mark the imported packages as accessible from the current
// scope. This access check is necessary when using FQN b/c
// we're using a single global package tree.
// https://issues.dlang.org/show_bug.cgi?id=313
if (imp.packages)
{
// import a.b.c.d;
auto p = imp.pkg; // a
scopesym.addAccessiblePackage(p, imp.protection);
foreach (id; (*imp.packages)[1 .. imp.packages.dim]) // [b, c]
{
p = cast(Package) p.symtab.lookup(id);
// https://issues.dlang.org/show_bug.cgi?id=17991
// An import of truly empty file/package can happen
// https://issues.dlang.org/show_bug.cgi?id=20151
// Package in the path conflicts with a module name
if (p is null)
break;
scopesym.addAccessiblePackage(p, imp.protection);
}
}
scopesym.addAccessiblePackage(imp.mod, imp.protection); // d
}
if (!loadErrored)
{
imp.mod.dsymbolSemantic(null);
}
if (imp.mod.needmoduleinfo)
{
//printf("module4 %s because of %s\n", importer.toChars(), imp.mod.toChars());
importer.needmoduleinfo = 1;
}
sc = sc.push(imp.mod);
sc.protection = imp.protection;
for (size_t i = 0; i < imp.aliasdecls.dim; i++)
{
AliasDeclaration ad = imp.aliasdecls[i];
//printf("\tImport %s alias %s = %s, scope = %p\n", toPrettyChars(), aliases[i].toChars(), names[i].toChars(), ad._scope);
Dsymbol sym = imp.mod.search(imp.loc, imp.names[i], IgnorePrivateImports);
if (sym)
{
import dmd.access : symbolIsVisible;
if (!symbolIsVisible(sc, sym))
imp.mod.error(imp.loc, "member `%s` is not visible from module `%s`",
imp.names[i].toChars(), sc._module.toChars());
ad.dsymbolSemantic(sc);
// If the import declaration is in non-root module,
// analysis of the aliased symbol is deferred.
// Therefore, don't see the ad.aliassym or ad.type here.
}
else
{
Dsymbol s = imp.mod.search_correct(imp.names[i]);
if (s)
imp.mod.error(imp.loc, "import `%s` not found, did you mean %s `%s`?", imp.names[i].toChars(), s.kind(), s.toPrettyChars());
else
imp.mod.error(imp.loc, "import `%s` not found", imp.names[i].toChars());
ad.type = Type.terror;
}
}
sc = sc.pop();
}
imp.semanticRun = PASS.semanticdone;
// object self-imports itself, so skip that
// https://issues.dlang.org/show_bug.cgi?id=7547
// don't list pseudo modules __entrypoint.d, __main.d
// https://issues.dlang.org/show_bug.cgi?id=11117
// https://issues.dlang.org/show_bug.cgi?id=11164
if (global.params.moduleDeps !is null && !(imp.id == Id.object && sc._module.ident == Id.object) &&
strcmp(sc._module.ident.toChars(), "__main") != 0)
{
/* The grammar of the file is:
* ImportDeclaration
* ::= BasicImportDeclaration [ " : " ImportBindList ] [ " -> "
* ModuleAliasIdentifier ] "\n"
*
* BasicImportDeclaration
* ::= ModuleFullyQualifiedName " (" FilePath ") : " Protection|"string"
* " [ " static" ] : " ModuleFullyQualifiedName " (" FilePath ")"
*
* FilePath
* - any string with '(', ')' and '\' escaped with the '\' character
*/
OutBuffer* ob = global.params.moduleDeps;
Module imod = sc.instantiatingModule();
if (!global.params.moduleDepsFile)
ob.writestring("depsImport ");
ob.writestring(imod.toPrettyChars());
ob.writestring(" (");
escapePath(ob, imod.srcfile.toChars());
ob.writestring(") : ");
// use protection instead of sc.protection because it couldn't be
// resolved yet, see the comment above
protectionToBuffer(ob, imp.protection);
ob.writeByte(' ');
if (imp.isstatic)
{
stcToBuffer(ob, STC.static_);
ob.writeByte(' ');
}
ob.writestring(": ");
if (imp.packages)
{
for (size_t i = 0; i < imp.packages.dim; i++)
{
Identifier pid = (*imp.packages)[i];
ob.printf("%s.", pid.toChars());
}
}
ob.writestring(imp.id.toString());
ob.writestring(" (");
if (imp.mod)
escapePath(ob, imp.mod.srcfile.toChars());
else
ob.writestring("???");
ob.writeByte(')');
foreach (i, name; imp.names)
{
if (i == 0)
ob.writeByte(':');
else
ob.writeByte(',');
Identifier _alias = imp.aliases[i];
if (!_alias)
{
ob.printf("%s", name.toChars());
_alias = name;
}
else
ob.printf("%s=%s", _alias.toChars(), name.toChars());
}
if (imp.aliasId)
ob.printf(" -> %s", imp.aliasId.toChars());
ob.writenl();
}
//printf("-Import::semantic('%s'), pkg = %p\n", toChars(), pkg);
}
void attribSemantic(AttribDeclaration ad)
{
if (ad.semanticRun != PASS.init)
return;
ad.semanticRun = PASS.semantic;
Dsymbols* d = ad.include(sc);
//printf("\tAttribDeclaration::semantic '%s', d = %p\n",toChars(), d);
if (d)
{
Scope* sc2 = ad.newScope(sc);
bool errors;
for (size_t i = 0; i < d.dim; i++)
{
Dsymbol s = (*d)[i];
s.dsymbolSemantic(sc2);
errors |= s.errors;
}
ad.errors |= errors;
if (sc2 != sc)
sc2.pop();
}
ad.semanticRun = PASS.semanticdone;
}
override void visit(AttribDeclaration atd)
{
attribSemantic(atd);
}
override void visit(AnonDeclaration scd)
{
//printf("\tAnonDeclaration::semantic %s %p\n", isunion ? "union" : "struct", this);
assert(sc.parent);
auto p = sc.parent.pastMixin();
auto ad = p.isAggregateDeclaration();
if (!ad)
{
error(scd.loc, "%s can only be a part of an aggregate, not %s `%s`", scd.kind(), p.kind(), p.toChars());
scd.errors = true;
return;
}
if (scd.decl)
{
sc = sc.push();
sc.stc &= ~(STC.auto_ | STC.scope_ | STC.static_ | STC.tls | STC.gshared);
sc.inunion = scd.isunion ? scd : null;
sc.flags = 0;
for (size_t i = 0; i < scd.decl.dim; i++)
{
Dsymbol s = (*scd.decl)[i];
s.dsymbolSemantic(sc);
}
sc = sc.pop();
}
}
override void visit(PragmaDeclaration pd)
{
// Should be merged with PragmaStatement
//printf("\tPragmaDeclaration::semantic '%s'\n", pd.toChars());
if (global.params.mscoff)
{
if (pd.ident == Id.linkerDirective)
{
if (!pd.args || pd.args.dim != 1)
pd.error("one string argument expected for pragma(linkerDirective)");
else
{
auto se = semanticString(sc, (*pd.args)[0], "linker directive");
if (!se)
goto Lnodecl;
(*pd.args)[0] = se;
if (global.params.verbose)
message("linkopt %.*s", cast(int)se.len, se.peekString().ptr);
}
goto Lnodecl;
}
}
if (pd.ident == Id.msg)
{
if (pd.args)
{
for (size_t i = 0; i < pd.args.dim; i++)
{
Expression e = (*pd.args)[i];
sc = sc.startCTFE();
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
sc = sc.endCTFE();
// pragma(msg) is allowed to contain types as well as expressions
if (e.type && e.type.ty == Tvoid)
{
error(pd.loc, "Cannot pass argument `%s` to `pragma msg` because it is `void`", e.toChars());
return;
}
e = ctfeInterpretForPragmaMsg(e);
if (e.op == TOK.error)
{
errorSupplemental(pd.loc, "while evaluating `pragma(msg, %s)`", (*pd.args)[i].toChars());
return;
}
StringExp se = e.toStringExp();
if (se)
{
se = se.toUTF8(sc);
fprintf(stderr, "%.*s", cast(int)se.len, se.peekString().ptr);
}
else
fprintf(stderr, "%s", e.toChars());
}
fprintf(stderr, "\n");
}
goto Lnodecl;
}
else if (pd.ident == Id.lib)
{
if (!pd.args || pd.args.dim != 1)
pd.error("string expected for library name");
else
{
auto se = semanticString(sc, (*pd.args)[0], "library name");
if (!se)
goto Lnodecl;
(*pd.args)[0] = se;
auto name = se.peekString().xarraydup;
if (global.params.verbose)
message("library %s", name.ptr);
if (global.params.moduleDeps && !global.params.moduleDepsFile)
{
OutBuffer* ob = global.params.moduleDeps;
Module imod = sc.instantiatingModule();
ob.writestring("depsLib ");
ob.writestring(imod.toPrettyChars());
ob.writestring(" (");
escapePath(ob, imod.srcfile.toChars());
ob.writestring(") : ");
ob.writestring(name);
ob.writenl();
}
mem.xfree(name.ptr);
}
goto Lnodecl;
}
else if (pd.ident == Id.startaddress)
{
if (!pd.args || pd.args.dim != 1)
pd.error("function name expected for start address");
else
{
/* https://issues.dlang.org/show_bug.cgi?id=11980
* resolveProperties and ctfeInterpret call are not necessary.
*/
Expression e = (*pd.args)[0];
sc = sc.startCTFE();
e = e.expressionSemantic(sc);
sc = sc.endCTFE();
(*pd.args)[0] = e;
Dsymbol sa = getDsymbol(e);
if (!sa || !sa.isFuncDeclaration())
pd.error("function name expected for start address, not `%s`", e.toChars());
}
goto Lnodecl;
}
else if (pd.ident == Id.Pinline)
{
goto Ldecl;
}
else if (pd.ident == Id.mangle)
{
if (!pd.args)
pd.args = new Expressions();
if (pd.args.dim != 1)
{
pd.error("string expected for mangled name");
pd.args.setDim(1);
(*pd.args)[0] = ErrorExp.get(); // error recovery
goto Ldecl;
}
auto se = semanticString(sc, (*pd.args)[0], "mangled name");
if (!se)
goto Ldecl;
(*pd.args)[0] = se; // Will be used later
if (!se.len)
{
pd.error("zero-length string not allowed for mangled name");
goto Ldecl;
}
if (se.sz != 1)
{
pd.error("mangled name characters can only be of type `char`");
goto Ldecl;
}
version (all)
{
/* Note: D language specification should not have any assumption about backend
* implementation. Ideally pragma(mangle) can accept a string of any content.
*
* Therefore, this validation is compiler implementation specific.
*/
auto slice = se.peekString();
for (size_t i = 0; i < se.len;)
{
dchar c = slice[i];
if (c < 0x80)
{
if (c.isValidMangling)
{
++i;
continue;
}
else
{
pd.error("char 0x%02x not allowed in mangled name", c);
break;
}
}
if (const msg = utf_decodeChar(slice, i, c))
{
pd.error("%.*s", cast(int)msg.length, msg.ptr);
break;
}
if (!isUniAlpha(c))
{
pd.error("char `0x%04x` not allowed in mangled name", c);
break;
}
}
}
}
else if (pd.ident == Id.crt_constructor || pd.ident == Id.crt_destructor)
{
if (pd.args && pd.args.dim != 0)
pd.error("takes no argument");
goto Ldecl;
}
else if (pd.ident == Id.printf || pd.ident == Id.scanf)
{
if (pd.args && pd.args.dim != 0)
pd.error("takes no argument");
goto Ldecl;
}
else if (global.params.ignoreUnsupportedPragmas)
{
if (global.params.verbose)
{
/* Print unrecognized pragmas
*/
OutBuffer buf;
buf.writestring(pd.ident.toString());
if (pd.args)
{
const errors_save = global.startGagging();
for (size_t i = 0; i < pd.args.dim; i++)
{
Expression e = (*pd.args)[i];
sc = sc.startCTFE();
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
sc = sc.endCTFE();
e = e.ctfeInterpret();
if (i == 0)
buf.writestring(" (");
else
buf.writeByte(',');
buf.writestring(e.toChars());
}
if (pd.args.dim)
buf.writeByte(')');
global.endGagging(errors_save);
}
message("pragma %s", buf.peekChars());
}
}
else
error(pd.loc, "unrecognized `pragma(%s)`", pd.ident.toChars());
Ldecl:
if (pd.decl)
{
Scope* sc2 = pd.newScope(sc);
for (size_t i = 0; i < pd.decl.dim; i++)
{
Dsymbol s = (*pd.decl)[i];
s.dsymbolSemantic(sc2);
if (pd.ident == Id.mangle)
{
assert(pd.args && pd.args.dim == 1);
if (auto se = (*pd.args)[0].toStringExp())
{
const name = (cast(const(char)[])se.peekData()).xarraydup;
uint cnt = setMangleOverride(s, name);
if (cnt > 1)
pd.error("can only apply to a single declaration");
}
}
}
if (sc2 != sc)
sc2.pop();
}
return;
Lnodecl:
if (pd.decl)
{
pd.error("is missing a terminating `;`");
goto Ldecl;
// do them anyway, to avoid segfaults.
}
}
override void visit(StaticIfDeclaration sid)
{
attribSemantic(sid);
}
override void visit(StaticForeachDeclaration sfd)
{
attribSemantic(sfd);
}
private Dsymbols* compileIt(CompileDeclaration cd)
{
//printf("CompileDeclaration::compileIt(loc = %d) %s\n", cd.loc.linnum, cd.exp.toChars());
OutBuffer buf;
if (expressionsToString(buf, sc, cd.exps))
return null;
const errors = global.errors;
const len = buf.length;
buf.writeByte(0);
const str = buf.extractSlice()[0 .. len];
scope p = new Parser!ASTCodegen(cd.loc, sc._module, str, false);
p.nextToken();
auto d = p.parseDeclDefs(0);
if (global.errors != errors)
return null;
if (p.token.value != TOK.endOfFile)
{
cd.error("incomplete mixin declaration `%s`", str.ptr);
return null;
}
return d;
}
/***********************************************************
* https://dlang.org/spec/module.html#mixin-declaration
*/
override void visit(CompileDeclaration cd)
{
//printf("CompileDeclaration::semantic()\n");
if (!cd.compiled)
{
cd.decl = compileIt(cd);
cd.AttribDeclaration.addMember(sc, cd.scopesym);
cd.compiled = true;
if (cd._scope && cd.decl)
{
for (size_t i = 0; i < cd.decl.dim; i++)
{
Dsymbol s = (*cd.decl)[i];
s.setScope(cd._scope);
}
}
}
attribSemantic(cd);
}
override void visit(CPPNamespaceDeclaration ns)
{
Identifier identFromSE (StringExp se)
{
const sident = se.toStringz();
if (!sident.length || !Identifier.isValidIdentifier(sident))
{
ns.exp.error("expected valid identifer for C++ namespace but got `%.*s`",
cast(int)sident.length, sident.ptr);
return null;
}
else
return Identifier.idPool(sident);
}
if (ns.ident is null)
{
ns.cppnamespace = sc.namespace;
sc = sc.startCTFE();
ns.exp = ns.exp.expressionSemantic(sc);
ns.exp = resolveProperties(sc, ns.exp);
sc = sc.endCTFE();
ns.exp = ns.exp.ctfeInterpret();
// Can be either a tuple of strings or a string itself
if (auto te = ns.exp.isTupleExp())
{
expandTuples(te.exps);
CPPNamespaceDeclaration current = ns.cppnamespace;
for (size_t d = 0; d < te.exps.dim; ++d)
{
auto exp = (*te.exps)[d];
auto prev = d ? current : ns.cppnamespace;
current = (d + 1) != te.exps.dim
? new CPPNamespaceDeclaration(exp, null)
: ns;
current.exp = exp;
current.cppnamespace = prev;
if (auto se = exp.toStringExp())
{
current.ident = identFromSE(se);
if (current.ident is null)
return; // An error happened in `identFromSE`
}
else
ns.exp.error("`%s`: index %llu is not a string constant, it is a `%s`",
ns.exp.toChars(), cast(ulong) d, ns.exp.type.toChars());
}
}
else if (auto se = ns.exp.toStringExp())
ns.ident = identFromSE(se);
else
ns.exp.error("compile time string constant (or tuple) expected, not `%s`",
ns.exp.toChars());
}
if (ns.ident)
attribSemantic(ns);
}
override void visit(UserAttributeDeclaration uad)
{
//printf("UserAttributeDeclaration::semantic() %p\n", this);
if (uad.decl && !uad._scope)
uad.Dsymbol.setScope(sc); // for function local symbols
arrayExpressionSemantic(uad.atts, sc, true);
return attribSemantic(uad);
}
override void visit(StaticAssert sa)
{
if (sa.semanticRun < PASS.semanticdone)
sa.semanticRun = PASS.semanticdone;
}
override void visit(DebugSymbol ds)
{
//printf("DebugSymbol::semantic() %s\n", toChars());
if (ds.semanticRun < PASS.semanticdone)
ds.semanticRun = PASS.semanticdone;
}
override void visit(VersionSymbol vs)
{
if (vs.semanticRun < PASS.semanticdone)
vs.semanticRun = PASS.semanticdone;
}
override void visit(Package pkg)
{
if (pkg.semanticRun < PASS.semanticdone)
pkg.semanticRun = PASS.semanticdone;
}
override void visit(Module m)
{
if (m.semanticRun != PASS.init)
return;
//printf("+Module::semantic(this = %p, '%s'): parent = %p\n", this, toChars(), parent);
m.semanticRun = PASS.semantic;
// Note that modules get their own scope, from scratch.
// This is so regardless of where in the syntax a module
// gets imported, it is unaffected by context.
Scope* sc = m._scope; // see if already got one from importAll()
if (!sc)
{
Scope.createGlobal(m); // create root scope
}
//printf("Module = %p, linkage = %d\n", sc.scopesym, sc.linkage);
// Pass 1 semantic routines: do public side of the definition
m.members.foreachDsymbol( (s)
{
//printf("\tModule('%s'): '%s'.dsymbolSemantic()\n", toChars(), s.toChars());
s.dsymbolSemantic(sc);
m.runDeferredSemantic();
});
if (m.userAttribDecl)
{
m.userAttribDecl.dsymbolSemantic(sc);
}
if (!m._scope)
{
sc = sc.pop();
sc.pop(); // 2 pops because Scope::createGlobal() created 2
}
m.semanticRun = PASS.semanticdone;
//printf("-Module::semantic(this = %p, '%s'): parent = %p\n", this, toChars(), parent);
}
override void visit(EnumDeclaration ed)
{
//printf("EnumDeclaration::semantic(sd = %p, '%s') %s\n", sc.scopesym, sc.scopesym.toChars(), toChars());
//printf("EnumDeclaration::semantic() %p %s\n", this, toChars());
if (ed.semanticRun >= PASS.semanticdone)
return; // semantic() already completed
if (ed.semanticRun == PASS.semantic)
{
assert(ed.memtype);
error(ed.loc, "circular reference to enum base type `%s`", ed.memtype.toChars());
ed.errors = true;
ed.semanticRun = PASS.semanticdone;
return;
}
uint dprogress_save = Module.dprogress;
Scope* scx = null;
if (ed._scope)
{
sc = ed._scope;
scx = ed._scope; // save so we don't make redundant copies
ed._scope = null;
}
if (!sc)
return;
ed.parent = sc.parent;
ed.type = ed.type.typeSemantic(ed.loc, sc);
ed.protection = sc.protection;
if (sc.stc & STC.deprecated_)
ed.isdeprecated = true;
ed.userAttribDecl = sc.userAttribDecl;
ed.cppnamespace = sc.namespace;
ed.semanticRun = PASS.semantic;
UserAttributeDeclaration.checkGNUABITag(ed, sc.linkage);
if (!ed.members && !ed.memtype) // enum ident;
{
ed.semanticRun = PASS.semanticdone;
return;
}
if (!ed.symtab)
ed.symtab = new DsymbolTable();
/* The separate, and distinct, cases are:
* 1. enum { ... }
* 2. enum : memtype { ... }
* 3. enum ident { ... }
* 4. enum ident : memtype { ... }
* 5. enum ident : memtype;
* 6. enum ident;
*/
if (ed.memtype)
{
ed.memtype = ed.memtype.typeSemantic(ed.loc, sc);
/* Check to see if memtype is forward referenced
*/
if (auto te = ed.memtype.isTypeEnum())
{
EnumDeclaration sym = cast(EnumDeclaration)te.toDsymbol(sc);
if (!sym.memtype || !sym.members || !sym.symtab || sym._scope)
{
// memtype is forward referenced, so try again later
deferDsymbolSemantic(ed, scx);
Module.dprogress = dprogress_save;
//printf("\tdeferring %s\n", toChars());
ed.semanticRun = PASS.init;
return;
}
}
if (ed.memtype.ty == Tvoid)
{
ed.error("base type must not be `void`");
ed.memtype = Type.terror;
}
if (ed.memtype.ty == Terror)
{
ed.errors = true;
// poison all the members
ed.members.foreachDsymbol( (s) { s.errors = true; } );
ed.semanticRun = PASS.semanticdone;
return;
}
}
ed.semanticRun = PASS.semanticdone;
if (!ed.members) // enum ident : memtype;
return;
if (ed.members.dim == 0)
{
ed.error("enum `%s` must have at least one member", ed.toChars());
ed.errors = true;
return;
}
Module.dprogress++;
Scope* sce;
if (ed.isAnonymous())
sce = sc;
else
{
sce = sc.push(ed);
sce.parent = ed;
}
sce = sce.startCTFE();
sce.setNoFree(); // needed for getMaxMinValue()
/* Each enum member gets the sce scope
*/
ed.members.foreachDsymbol( (s)
{
EnumMember em = s.isEnumMember();
if (em)
em._scope = sce;
});
if (!ed.added)
{
/* addMember() is not called when the EnumDeclaration appears as a function statement,
* so we have to do what addMember() does and install the enum members in the right symbol
* table
*/
ScopeDsymbol scopesym = null;
if (ed.isAnonymous())
{
/* Anonymous enum members get added to enclosing scope.
*/
for (Scope* sct = sce; 1; sct = sct.enclosing)
{
assert(sct);
if (sct.scopesym)
{
scopesym = sct.scopesym;
if (!sct.scopesym.symtab)
sct.scopesym.symtab = new DsymbolTable();
break;
}
}
}
else
{
// Otherwise enum members are in the EnumDeclaration's symbol table
scopesym = ed;
}
ed.members.foreachDsymbol( (s)
{
EnumMember em = s.isEnumMember();
if (em)
{
em.ed = ed;
em.addMember(sc, scopesym);
}
});
}
ed.members.foreachDsymbol( (s)
{
EnumMember em = s.isEnumMember();
if (em)
em.dsymbolSemantic(em._scope);
});
//printf("defaultval = %lld\n", defaultval);
//if (defaultval) printf("defaultval: %s %s\n", defaultval.toChars(), defaultval.type.toChars());
//printf("members = %s\n", members.toChars());
}
override void visit(EnumMember em)
{
//printf("EnumMember::semantic() %s\n", toChars());
void errorReturn()
{
em.errors = true;
em.semanticRun = PASS.semanticdone;
}
if (em.errors || em.semanticRun >= PASS.semanticdone)
return;
if (em.semanticRun == PASS.semantic)
{
em.error("circular reference to `enum` member");
return errorReturn();
}
assert(em.ed);
em.ed.dsymbolSemantic(sc);
if (em.ed.errors)
return errorReturn();
if (em.errors || em.semanticRun >= PASS.semanticdone)
return;
if (em._scope)
sc = em._scope;
if (!sc)
return;
em.semanticRun = PASS.semantic;
em.protection = em.ed.isAnonymous() ? em.ed.protection : Prot(Prot.Kind.public_);
em.linkage = LINK.d;
em.storage_class |= STC.manifest;
// https://issues.dlang.org/show_bug.cgi?id=9701
if (em.ed.isAnonymous())
{
if (em.userAttribDecl)
em.userAttribDecl.userAttribDecl = em.ed.userAttribDecl;
else
em.userAttribDecl = em.ed.userAttribDecl;
}
// Eval UDA in this same scope. Issues 19344, 20835, 21122
if (em.userAttribDecl)
em.userAttribDecl.setScope(sc);
// The first enum member is special
bool first = (em == (*em.ed.members)[0]);
if (em.origType)
{
em.origType = em.origType.typeSemantic(em.loc, sc);
em.type = em.origType;
assert(em.value); // "type id;" is not a valid enum member declaration
}
if (em.value)
{
Expression e = em.value;
assert(e.dyncast() == DYNCAST.expression);
e = e.expressionSemantic(sc);
e = resolveProperties(sc, e);
e = e.ctfeInterpret();
if (e.op == TOK.error)
return errorReturn();
if (first && !em.ed.memtype && !em.ed.isAnonymous())
{
em.ed.memtype = e.type;
if (em.ed.memtype.ty == Terror)
{
em.ed.errors = true;
return errorReturn();
}
if (em.ed.memtype.ty != Terror)
{
/* https://issues.dlang.org/show_bug.cgi?id=11746
* All of named enum members should have same type
* with the first member. If the following members were referenced
* during the first member semantic, their types should be unified.
*/
em.ed.members.foreachDsymbol( (s)
{
EnumMember enm = s.isEnumMember();
if (!enm || enm == em || enm.semanticRun < PASS.semanticdone || enm.origType)
return;
//printf("[%d] em = %s, em.semanticRun = %d\n", i, toChars(), em.semanticRun);
Expression ev = enm.value;
ev = ev.implicitCastTo(sc, em.ed.memtype);
ev = ev.ctfeInterpret();
ev = ev.castTo(sc, em.ed.type);
if (ev.op == TOK.error)
em.ed.errors = true;
enm.value = ev;
});
if (em.ed.errors)
{
em.ed.memtype = Type.terror;
return errorReturn();
}
}
}
if (em.ed.memtype && !em.origType)
{
e = e.implicitCastTo(sc, em.ed.memtype);
e = e.ctfeInterpret();
// save origValue for better json output
em.origValue = e;
if (!em.ed.isAnonymous())
{
e = e.castTo(sc, em.ed.type.addMod(e.type.mod)); // https://issues.dlang.org/show_bug.cgi?id=12385
e = e.ctfeInterpret();
}
}
else if (em.origType)
{
e = e.implicitCastTo(sc, em.origType);
e = e.ctfeInterpret();
assert(em.ed.isAnonymous());
// save origValue for better json output
em.origValue = e;
}
em.value = e;
}
else if (first)
{
Type t;
if (em.ed.memtype)
t = em.ed.memtype;
else
{
t = Type.tint32;
if (!em.ed.isAnonymous())
em.ed.memtype = t;
}
Expression e = new IntegerExp(em.loc, 0, t);
e = e.ctfeInterpret();
// save origValue for better json output
em.origValue = e;
if (!em.ed.isAnonymous())
{
e = e.castTo(sc, em.ed.type);
e = e.ctfeInterpret();
}
em.value = e;
}
else
{
/* Find the previous enum member,
* and set this to be the previous value + 1
*/
EnumMember emprev = null;
em.ed.members.foreachDsymbol( (s)
{
if (auto enm = s.isEnumMember())
{
if (enm == em)
return 1; // found
emprev = enm;
}
return 0; // continue
});
assert(emprev);
if (emprev.semanticRun < PASS.semanticdone) // if forward reference
emprev.dsymbolSemantic(emprev._scope); // resolve it
if (emprev.errors)
return errorReturn();
Expression eprev = emprev.value;
// .toHeadMutable() due to https://issues.dlang.org/show_bug.cgi?id=18645
Type tprev = eprev.type.toHeadMutable().equals(em.ed.type.toHeadMutable())
? em.ed.memtype
: eprev.type;
Expression emax = tprev.getProperty(sc, em.ed.loc, Id.max, 0);
emax = emax.expressionSemantic(sc);
emax = emax.ctfeInterpret();
// Set value to (eprev + 1).
// But first check that (eprev != emax)
assert(eprev);
Expression e = new EqualExp(TOK.equal, em.loc, eprev, emax);
e = e.expressionSemantic(sc);
e = e.ctfeInterpret();
if (e.toInteger())
{
em.error("initialization with `%s.%s+1` causes overflow for type `%s`",
emprev.ed.toChars(), emprev.toChars(), em.ed.memtype.toChars());
return errorReturn();
}
// Now set e to (eprev + 1)
e = new AddExp(em.loc, eprev, IntegerExp.literal!1);
e = e.expressionSemantic(sc);
e = e.castTo(sc, eprev.type);
e = e.ctfeInterpret();
// save origValue (without cast) for better json output
if (e.op != TOK.error) // avoid duplicate diagnostics
{
assert(emprev.origValue);
em.origValue = new AddExp(em.loc, emprev.origValue, IntegerExp.literal!1);
em.origValue = em.origValue.expressionSemantic(sc);
em.origValue = em.origValue.ctfeInterpret();
}
if (e.op == TOK.error)
return errorReturn();
if (e.type.isfloating())
{
// Check that e != eprev (not always true for floats)
Expression etest = new EqualExp(TOK.equal, em.loc, e, eprev);
etest = etest.expressionSemantic(sc);
etest = etest.ctfeInterpret();
if (etest.toInteger())
{
em.error("has inexact value due to loss of precision");
return errorReturn();
}
}
em.value = e;
}
if (!em.origType)
em.type = em.value.type;
assert(em.origValue);
em.semanticRun = PASS.semanticdone;
}
override void visit(TemplateDeclaration tempdecl)
{
static if (LOG)
{
printf("TemplateDeclaration.dsymbolSemantic(this = %p, id = '%s')\n", this, tempdecl.ident.toChars());
printf("sc.stc = %llx\n", sc.stc);
printf("sc.module = %s\n", sc._module.toChars());
}
if (tempdecl.semanticRun != PASS.init)
return; // semantic() already run
if (tempdecl._scope)
{
sc = tempdecl._scope;
tempdecl._scope = null;
}
if (!sc)
return;
// Remember templates defined in module object that we need to know about
if (sc._module && sc._module.ident == Id.object)
{
if (tempdecl.ident == Id.RTInfo)
Type.rtinfo = tempdecl;
}
/* Remember Scope for later instantiations, but make
* a copy since attributes can change.
*/
if (!tempdecl._scope)
{
tempdecl._scope = sc.copy();
tempdecl._scope.setNoFree();
}
tempdecl.semanticRun = PASS.semantic;
tempdecl.parent = sc.parent;
tempdecl.protection = sc.protection;
tempdecl.cppnamespace = sc.namespace;
tempdecl.isstatic = tempdecl.toParent().isModule() || (tempdecl._scope.stc & STC.static_);
tempdecl.deprecated_ = !!(sc.stc & STC.deprecated_);
UserAttributeDeclaration.checkGNUABITag(tempdecl, sc.linkage);
if (!tempdecl.isstatic)
{
if (auto ad = tempdecl.parent.pastMixin().isAggregateDeclaration())
ad.makeNested();
}
// Set up scope for parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = tempdecl.parent;
Scope* paramscope = sc.push(paramsym);
paramscope.stc = 0;
if (global.params.doDocComments)
{
tempdecl.origParameters = new TemplateParameters(tempdecl.parameters.dim);
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
(*tempdecl.origParameters)[i] = tp.syntaxCopy();
}
}
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
if (!tp.declareParameter(paramscope))
{
error(tp.loc, "parameter `%s` multiply defined", tp.ident.toChars());
tempdecl.errors = true;
}
if (!tp.tpsemantic(paramscope, tempdecl.parameters))
{
tempdecl.errors = true;
}
if (i + 1 != tempdecl.parameters.dim && tp.isTemplateTupleParameter())
{
tempdecl.error("template tuple parameter must be last one");
tempdecl.errors = true;
}
}
/* Calculate TemplateParameter.dependent
*/
TemplateParameters tparams = TemplateParameters(1);
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
tparams[0] = tp;
for (size_t j = 0; j < tempdecl.parameters.dim; j++)
{
// Skip cases like: X(T : T)
if (i == j)
continue;
if (TemplateTypeParameter ttp = (*tempdecl.parameters)[j].isTemplateTypeParameter())
{
if (reliesOnTident(ttp.specType, &tparams))
tp.dependent = true;
}
else if (TemplateAliasParameter tap = (*tempdecl.parameters)[j].isTemplateAliasParameter())
{
if (reliesOnTident(tap.specType, &tparams) ||
reliesOnTident(isType(tap.specAlias), &tparams))
{
tp.dependent = true;
}
}
}
}
paramscope.pop();
// Compute again
tempdecl.onemember = null;
if (tempdecl.members)
{
Dsymbol s;
if (Dsymbol.oneMembers(tempdecl.members, &s, tempdecl.ident) && s)
{
tempdecl.onemember = s;
s.parent = tempdecl;
}
}
/* BUG: should check:
* 1. template functions must not introduce virtual functions, as they
* cannot be accomodated in the vtbl[]
* 2. templates cannot introduce non-static data members (i.e. fields)
* as they would change the instance size of the aggregate.
*/
tempdecl.semanticRun = PASS.semanticdone;
}
override void visit(TemplateInstance ti)
{
templateInstanceSemantic(ti, sc, null);
}
override void visit(TemplateMixin tm)
{
static if (LOG)
{
printf("+TemplateMixin.dsymbolSemantic('%s', this=%p)\n", tm.toChars(), tm);
fflush(stdout);
}
if (tm.semanticRun != PASS.init)
{
// When a class/struct contains mixin members, and is done over
// because of forward references, never reach here so semanticRun
// has been reset to PASS.init.
static if (LOG)
{
printf("\tsemantic done\n");
}
return;
}
tm.semanticRun = PASS.semantic;
static if (LOG)
{
printf("\tdo semantic\n");
}
Scope* scx = null;
if (tm._scope)
{
sc = tm._scope;
scx = tm._scope; // save so we don't make redundant copies
tm._scope = null;
}
/* Run semantic on each argument, place results in tiargs[],
* then find best match template with tiargs
*/
if (!tm.findTempDecl(sc) || !tm.semanticTiargs(sc) || !tm.findBestMatch(sc, null))
{
if (tm.semanticRun == PASS.init) // forward reference had occurred
{
//printf("forward reference - deferring\n");
return deferDsymbolSemantic(tm, scx);
}
tm.inst = tm;
tm.errors = true;
return; // error recovery
}
auto tempdecl = tm.tempdecl.isTemplateDeclaration();
assert(tempdecl);
if (!tm.ident)
{
/* Assign scope local unique identifier, as same as lambdas.
*/
const(char)[] s = "__mixin";
if (FuncDeclaration func = sc.parent.isFuncDeclaration())
{
tm.symtab = func.localsymtab;
if (tm.symtab)
{
// Inside template constraint, symtab is not set yet.
goto L1;
}
}
else
{
tm.symtab = sc.parent.isScopeDsymbol().symtab;
L1:
assert(tm.symtab);
tm.ident = Identifier.generateId(s, tm.symtab.length + 1);
tm.symtab.insert(tm);
}
}
tm.inst = tm;
tm.parent = sc.parent;
/* Detect recursive mixin instantiations.
*/
for (Dsymbol s = tm.parent; s; s = s.parent)
{
//printf("\ts = '%s'\n", s.toChars());
TemplateMixin tmix = s.isTemplateMixin();
if (!tmix || tempdecl != tmix.tempdecl)
continue;
/* Different argument list lengths happen with variadic args
*/
if (tm.tiargs.dim != tmix.tiargs.dim)
continue;
for (size_t i = 0; i < tm.tiargs.dim; i++)
{
RootObject o = (*tm.tiargs)[i];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
RootObject tmo = (*tmix.tiargs)[i];
if (ta)
{
Type tmta = isType(tmo);
if (!tmta)
goto Lcontinue;
if (!ta.equals(tmta))
goto Lcontinue;
}
else if (ea)
{
Expression tme = isExpression(tmo);
if (!tme || !ea.equals(tme))
goto Lcontinue;
}
else if (sa)
{
Dsymbol tmsa = isDsymbol(tmo);
if (sa != tmsa)
goto Lcontinue;
}
else
assert(0);
}
tm.error("recursive mixin instantiation");
return;
Lcontinue:
continue;
}
// Copy the syntax trees from the TemplateDeclaration
tm.members = Dsymbol.arraySyntaxCopy(tempdecl.members);
if (!tm.members)
return;
tm.symtab = new DsymbolTable();
for (Scope* sce = sc; 1; sce = sce.enclosing)
{
ScopeDsymbol sds = sce.scopesym;
if (sds)
{
sds.importScope(tm, Prot(Prot.Kind.public_));
break;
}
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", tm.toChars());
}
Scope* scy = sc.push(tm);
scy.parent = tm;
/* https://issues.dlang.org/show_bug.cgi?id=930
*
* If the template that is to be mixed in is in the scope of a template
* instance, we have to also declare the type aliases in the new mixin scope.
*/
auto parentInstance = tempdecl.parent ? tempdecl.parent.isTemplateInstance() : null;
if (parentInstance)
parentInstance.declareParameters(scy);
tm.argsym = new ScopeDsymbol();
tm.argsym.parent = scy.parent;
Scope* argscope = scy.push(tm.argsym);
uint errorsave = global.errors;
// Declare each template parameter as an alias for the argument type
tm.declareParameters(argscope);
// Add members to enclosing scope, as well as this scope
tm.members.foreachDsymbol(s => s.addMember(argscope, tm));
// Do semantic() analysis on template instance members
static if (LOG)
{
printf("\tdo semantic() on template instance members '%s'\n", tm.toChars());
}
Scope* sc2 = argscope.push(tm);
//size_t deferred_dim = Module.deferred.dim;
__gshared int nest;
//printf("%d\n", nest);
if (++nest > global.recursionLimit)
{
global.gag = 0; // ensure error message gets printed
tm.error("recursive expansion");
fatal();
}
tm.members.foreachDsymbol( s => s.setScope(sc2) );
tm.members.foreachDsymbol( s => s.importAll(sc2) );
tm.members.foreachDsymbol( s => s.dsymbolSemantic(sc2) );
nest--;
/* In DeclDefs scope, TemplateMixin does not have to handle deferred symbols.
* Because the members would already call Module.addDeferredSemantic() for themselves.
* See Struct, Class, Interface, and EnumDeclaration.dsymbolSemantic().
*/
//if (!sc.func && Module.deferred.dim > deferred_dim) {}
AggregateDeclaration ad = tm.toParent().isAggregateDeclaration();
if (sc.func && !ad)
{
tm.semantic2(sc2);
tm.semantic3(sc2);
}
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
tm.error("error instantiating");
tm.errors = true;
}
sc2.pop();
argscope.pop();
scy.pop();
static if (LOG)
{
printf("-TemplateMixin.dsymbolSemantic('%s', this=%p)\n", tm.toChars(), tm);
}
}
override void visit(Nspace ns)
{
if (ns.semanticRun != PASS.init)
return;
static if (LOG)
{
printf("+Nspace::semantic('%s')\n", ns.toChars());
}
if (ns._scope)
{
sc = ns._scope;
ns._scope = null;
}
if (!sc)
return;
bool repopulateMembers = false;
if (ns.identExp)
{
// resolve the namespace identifier
sc = sc.startCTFE();
Expression resolved = ns.identExp.expressionSemantic(sc);
resolved = resolveProperties(sc, resolved);
sc = sc.endCTFE();
resolved = resolved.ctfeInterpret();
StringExp name = resolved.toStringExp();
TupleExp tup = name ? null : resolved.toTupleExp();
if (!tup && !name)
{
error(ns.loc, "expected string expression for namespace name, got `%s`", ns.identExp.toChars());
return;
}
ns.identExp = resolved; // we don't need to keep the old AST around
if (name)
{
const(char)[] ident = name.toStringz();
if (ident.length == 0 || !Identifier.isValidIdentifier(ident))
{
error(ns.loc, "expected valid identifer for C++ namespace but got `%.*s`", cast(int)ident.length, ident.ptr);
return;
}
ns.ident = Identifier.idPool(ident);
}
else
{
// create namespace stack from the tuple
Nspace parentns = ns;
foreach (i, exp; *tup.exps)
{
name = exp.toStringExp();
if (!name)
{
error(ns.loc, "expected string expression for namespace name, got `%s`", exp.toChars());
return;
}
const(char)[] ident = name.toStringz();
if (ident.length == 0 || !Identifier.isValidIdentifier(ident))
{
error(ns.loc, "expected valid identifer for C++ namespace but got `%.*s`", cast(int)ident.length, ident.ptr);
return;
}
if (i == 0)
{
ns.ident = Identifier.idPool(ident);
}
else
{
// insert the new namespace
Nspace childns = new Nspace(ns.loc, Identifier.idPool(ident), null, parentns.members);
parentns.members = new Dsymbols;
parentns.members.push(childns);
parentns = childns;
repopulateMembers = true;
}
}
}
}
ns.semanticRun = PASS.semantic;
ns.parent = sc.parent;
// Link does not matter here, if the UDA is present it will error
UserAttributeDeclaration.checkGNUABITag(ns, LINK.cpp);
if (ns.members)
{
assert(sc);
sc = sc.push(ns);
sc.linkage = LINK.cpp; // note that namespaces imply C++ linkage
sc.parent = ns;
foreach (s; *ns.members)
{
if (repopulateMembers)
{
s.addMember(sc, sc.scopesym);
s.setScope(sc);
}
s.importAll(sc);
}
foreach (s; *ns.members)
{
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.dsymbolSemantic(sc);
}
sc.pop();
}
ns.semanticRun = PASS.semanticdone;
static if (LOG)
{
printf("-Nspace::semantic('%s')\n", ns.toChars());
}
}
void funcDeclarationSemantic(FuncDeclaration funcdecl)
{
TypeFunction f;
AggregateDeclaration ad;
InterfaceDeclaration id;
version (none)
{
printf("FuncDeclaration::semantic(sc = %p, this = %p, '%s', linkage = %d)\n", sc, funcdecl, funcdecl.toPrettyChars(), sc.linkage);
if (funcdecl.isFuncLiteralDeclaration())
printf("\tFuncLiteralDeclaration()\n");
printf("sc.parent = %s, parent = %s\n", sc.parent.toChars(), funcdecl.parent ? funcdecl.parent.toChars() : "");
printf("type: %p, %s\n", funcdecl.type, funcdecl.type.toChars());
}
if (funcdecl.semanticRun != PASS.init && funcdecl.isFuncLiteralDeclaration())
{
/* Member functions that have return types that are
* forward references can have semantic() run more than
* once on them.
* See test\interface2.d, test20
*/
return;
}
if (funcdecl.semanticRun >= PASS.semanticdone)
return;
assert(funcdecl.semanticRun <= PASS.semantic);
funcdecl.semanticRun = PASS.semantic;
if (funcdecl._scope)
{
sc = funcdecl._scope;
funcdecl._scope = null;
}
if (!sc || funcdecl.errors)
return;
funcdecl.cppnamespace = sc.namespace;
funcdecl.parent = sc.parent;
Dsymbol parent = funcdecl.toParent();
funcdecl.foverrides.setDim(0); // reset in case semantic() is being retried for this function
funcdecl.storage_class |= sc.stc & ~STC.ref_;
ad = funcdecl.isThis();
// Don't nest structs b/c of generated methods which should not access the outer scopes.
// https://issues.dlang.org/show_bug.cgi?id=16627
if (ad && !funcdecl.generated)
{
funcdecl.storage_class |= ad.storage_class & (STC.TYPECTOR | STC.synchronized_);
ad.makeNested();
}
if (sc.func)
funcdecl.storage_class |= sc.func.storage_class & STC.disable;
// Remove prefix storage classes silently.
if ((funcdecl.storage_class & STC.TYPECTOR) && !(ad || funcdecl.isNested()))
funcdecl.storage_class &= ~STC.TYPECTOR;
//printf("function storage_class = x%llx, sc.stc = x%llx, %x\n", storage_class, sc.stc, Declaration::isFinal());
if (sc.flags & SCOPE.compile)
funcdecl.flags |= FUNCFLAG.compileTimeOnly; // don't emit code for this function
FuncLiteralDeclaration fld = funcdecl.isFuncLiteralDeclaration();
if (fld && fld.treq)
{
Type treq = fld.treq;
assert(treq.nextOf().ty == Tfunction);
if (treq.ty == Tdelegate)
fld.tok = TOK.delegate_;
else if (treq.ty == Tpointer && treq.nextOf().ty == Tfunction)
fld.tok = TOK.function_;
else
assert(0);
funcdecl.linkage = treq.nextOf().toTypeFunction().linkage;
}
else
funcdecl.linkage = sc.linkage;
funcdecl.inlining = sc.inlining;
funcdecl.protection = sc.protection;
funcdecl.userAttribDecl = sc.userAttribDecl;
UserAttributeDeclaration.checkGNUABITag(funcdecl, funcdecl.linkage);
if (!funcdecl.originalType)
funcdecl.originalType = funcdecl.type.syntaxCopy();
if (funcdecl.type.ty != Tfunction)
{
if (funcdecl.type.ty != Terror)
{
funcdecl.error("`%s` must be a function instead of `%s`", funcdecl.toChars(), funcdecl.type.toChars());
funcdecl.type = Type.terror;
}
funcdecl.errors = true;
return;
}
if (!funcdecl.type.deco)
{
sc = sc.push();
sc.stc |= funcdecl.storage_class & (STC.disable | STC.deprecated_); // forward to function type
TypeFunction tf = funcdecl.type.toTypeFunction();
if (sc.func)
{
/* If the nesting parent is pure without inference,
* then this function defaults to pure too.
*
* auto foo() pure {
* auto bar() {} // become a weak purity function
* class C { // nested class
* auto baz() {} // become a weak purity function
* }
*
* static auto boo() {} // typed as impure
* // Even though, boo cannot call any impure functions.
* // See also Expression::checkPurity().
* }
*/
if (tf.purity == PURE.impure && (funcdecl.isNested() || funcdecl.isThis()))
{
FuncDeclaration fd = null;
for (Dsymbol p = funcdecl.toParent2(); p; p = p.toParent2())
{
if (AggregateDeclaration adx = p.isAggregateDeclaration())
{
if (adx.isNested())
continue;
break;
}
if ((fd = p.isFuncDeclaration()) !is null)
break;
}
/* If the parent's purity is inferred, then this function's purity needs
* to be inferred first.
*/
if (fd && fd.isPureBypassingInference() >= PURE.weak && !funcdecl.isInstantiated())
{
tf.purity = PURE.fwdref; // default to pure
}
}
}
if (tf.isref)
sc.stc |= STC.ref_;
if (tf.isScopeQual)
sc.stc |= STC.scope_;
if (tf.isnothrow)
sc.stc |= STC.nothrow_;
if (tf.isnogc)
sc.stc |= STC.nogc;
if (tf.isproperty)
sc.stc |= STC.property;
if (tf.purity == PURE.fwdref)
sc.stc |= STC.pure_;
if (tf.trust != TRUST.default_)
sc.stc &= ~STC.safeGroup;
if (tf.trust == TRUST.safe)
sc.stc |= STC.safe;
if (tf.trust == TRUST.system)
sc.stc |= STC.system;
if (tf.trust == TRUST.trusted)
sc.stc |= STC.trusted;
if (funcdecl.isCtorDeclaration())
{
sc.flags |= SCOPE.ctor;
Type tret = ad.handleType();
assert(tret);
tret = tret.addStorageClass(funcdecl.storage_class | sc.stc);
tret = tret.addMod(funcdecl.type.mod);
tf.next = tret;
if (ad.isStructDeclaration())
sc.stc |= STC.ref_;
}
// 'return' on a non-static class member function implies 'scope' as well
if (ad && ad.isClassDeclaration() && (tf.isreturn || sc.stc & STC.return_) && !(sc.stc & STC.static_))
sc.stc |= STC.scope_;
// If 'this' has no pointers, remove 'scope' as it has no meaning
if (sc.stc & STC.scope_ && ad && ad.isStructDeclaration() && !ad.type.hasPointers())
{
sc.stc &= ~STC.scope_;
tf.isScopeQual = false;
}
sc.linkage = funcdecl.linkage;
if (!tf.isNaked() && !(funcdecl.isThis() || funcdecl.isNested()))
{
OutBuffer buf;
MODtoBuffer(&buf, tf.mod);
funcdecl.error("without `this` cannot be `%s`", buf.peekChars());
tf.mod = 0; // remove qualifiers
}
/* Apply const, immutable, wild and shared storage class
* to the function type. Do this before type semantic.
*/
auto stc = funcdecl.storage_class;
if (funcdecl.type.isImmutable())
stc |= STC.immutable_;
if (funcdecl.type.isConst())
stc |= STC.const_;
if (funcdecl.type.isShared() || funcdecl.storage_class & STC.synchronized_)
stc |= STC.shared_;
if (funcdecl.type.isWild())
stc |= STC.wild;
funcdecl.type = funcdecl.type.addSTC(stc);
funcdecl.type = funcdecl.type.typeSemantic(funcdecl.loc, sc);
sc = sc.pop();
}
if (funcdecl.type.ty != Tfunction)
{
if (funcdecl.type.ty != Terror)
{
funcdecl.error("`%s` must be a function instead of `%s`", funcdecl.toChars(), funcdecl.type.toChars());
funcdecl.type = Type.terror;
}
funcdecl.errors = true;
return;
}
else
{
// Merge back function attributes into 'originalType'.
// It's used for mangling, ddoc, and json output.
TypeFunction tfo = funcdecl.originalType.toTypeFunction();
TypeFunction tfx = funcdecl.type.toTypeFunction();
tfo.mod = tfx.mod;
tfo.isScopeQual = tfx.isScopeQual;
tfo.isreturninferred = tfx.isreturninferred;
tfo.isscopeinferred = tfx.isscopeinferred;
tfo.isref = tfx.isref;
tfo.isnothrow = tfx.isnothrow;
tfo.isnogc = tfx.isnogc;
tfo.isproperty = tfx.isproperty;
tfo.purity = tfx.purity;
tfo.trust = tfx.trust;
funcdecl.storage_class &= ~(STC.TYPECTOR | STC.FUNCATTR);
}
f = cast(TypeFunction)funcdecl.type;
if ((funcdecl.storage_class & STC.auto_) && !f.isref && !funcdecl.inferRetType)
funcdecl.error("storage class `auto` has no effect if return type is not inferred");
/* Functions can only be 'scope' if they have a 'this'
*/
if (f.isScopeQual && !funcdecl.isNested() && !ad)
{
funcdecl.error("functions cannot be `scope`");
}
if (f.isreturn && !funcdecl.needThis() && !funcdecl.isNested())
{
/* Non-static nested functions have a hidden 'this' pointer to which
* the 'return' applies
*/
if (sc.scopesym && sc.scopesym.isAggregateDeclaration())
funcdecl.error("`static` member has no `this` to which `return` can apply");
else
error(funcdecl.loc, "Top-level function `%s` has no `this` to which `return` can apply", funcdecl.toChars());
}
if (funcdecl.isAbstract() && !funcdecl.isVirtual())
{
const(char)* sfunc;
if (funcdecl.isStatic())
sfunc = "static";
else if (funcdecl.protection.kind == Prot.Kind.private_ || funcdecl.protection.kind == Prot.Kind.package_)
sfunc = protectionToChars(funcdecl.protection.kind);
else
sfunc = "final";
funcdecl.error("`%s` functions cannot be `abstract`", sfunc);
}
if (funcdecl.isOverride() && !funcdecl.isVirtual() && !funcdecl.isFuncLiteralDeclaration())
{
Prot.Kind kind = funcdecl.prot().kind;
if ((kind == Prot.Kind.private_ || kind == Prot.Kind.package_) && funcdecl.isMember())
funcdecl.error("`%s` method is not virtual and cannot override", protectionToChars(kind));
else
funcdecl.error("cannot override a non-virtual function");
}
if (funcdecl.isAbstract() && funcdecl.isFinalFunc())
funcdecl.error("cannot be both `final` and `abstract`");
version (none)
{
if (funcdecl.isAbstract() && funcdecl.fbody)
funcdecl.error("`abstract` functions cannot have bodies");
}
version (none)
{
if (funcdecl.isStaticConstructor() || funcdecl.isStaticDestructor())
{
if (!funcdecl.isStatic() || funcdecl.type.nextOf().ty != Tvoid)
funcdecl.error("static constructors / destructors must be `static void`");
if (f.arguments && f.arguments.dim)
funcdecl.error("static constructors / destructors must have empty parameter list");
// BUG: check for invalid storage classes
}
}
if (const pors = sc.flags & (SCOPE.printf | SCOPE.scanf))
{
/* printf/scanf-like functions must be of the form:
* extern (C/C++) T printf([parameters...], const(char)* format, ...);
* or:
* extern (C/C++) T vprintf([parameters...], const(char)* format, va_list);
*/
static bool isPointerToChar(Parameter p)
{
if (auto tptr = p.type.isTypePointer())
{
return tptr.next.ty == Tchar;
}
return false;
}
bool isVa_list(Parameter p)
{
return p.type.equals(target.va_listType(funcdecl.loc, sc));
}
const nparams = f.parameterList.length;
if ((f.linkage == LINK.c || f.linkage == LINK.cpp) &&
(f.parameterList.varargs == VarArg.variadic &&
nparams >= 1 &&
isPointerToChar(f.parameterList[nparams - 1]) ||
f.parameterList.varargs == VarArg.none &&
nparams >= 2 &&
isPointerToChar(f.parameterList[nparams - 2]) &&
isVa_list(f.parameterList[nparams - 1])
)
)
{
funcdecl.flags |= (pors == SCOPE.printf) ? FUNCFLAG.printf : FUNCFLAG.scanf;
}
else
{
const p = (pors == SCOPE.printf ? Id.printf : Id.scanf).toChars();
if (f.parameterList.varargs == VarArg.variadic)
{
funcdecl.error("`pragma(%s)` functions must be `extern(C) %s %s([parameters...], const(char)*, ...)`"
~ " not `%s`",
p, f.next.toChars(), funcdecl.toChars(), funcdecl.type.toChars());
}
else
{
funcdecl.error("`pragma(%s)` functions must be `extern(C) %s %s([parameters...], const(char)*, va_list)`",
p, f.next.toChars(), funcdecl.toChars());
}
}
}
id = parent.isInterfaceDeclaration();
if (id)
{
funcdecl.storage_class |= STC.abstract_;
if (funcdecl.isCtorDeclaration() || funcdecl.isPostBlitDeclaration() || funcdecl.isDtorDeclaration() || funcdecl.isInvariantDeclaration() || funcdecl.isNewDeclaration() || funcdecl.isDelete())
funcdecl.error("constructors, destructors, postblits, invariants, new and delete functions are not allowed in interface `%s`", id.toChars());
if (funcdecl.fbody && funcdecl.isVirtual())
funcdecl.error("function body only allowed in `final` functions in interface `%s`", id.toChars());
}
if (UnionDeclaration ud = parent.isUnionDeclaration())
{
if (funcdecl.isPostBlitDeclaration() || funcdecl.isDtorDeclaration() || funcdecl.isInvariantDeclaration())
funcdecl.error("destructors, postblits and invariants are not allowed in union `%s`", ud.toChars());
}
if (StructDeclaration sd = parent.isStructDeclaration())
{
if (funcdecl.isCtorDeclaration())
{
goto Ldone;
}
}
if (ClassDeclaration cd = parent.isClassDeclaration())
{
parent = cd = objc.getParent(funcdecl, cd);
if (funcdecl.isCtorDeclaration())
{
goto Ldone;
}
if (funcdecl.storage_class & STC.abstract_)
cd.isabstract = Abstract.yes;
// if static function, do not put in vtbl[]
if (!funcdecl.isVirtual())
{
//printf("\tnot virtual\n");
goto Ldone;
}
// Suppress further errors if the return type is an error
if (funcdecl.type.nextOf() == Type.terror)
goto Ldone;
bool may_override = false;
for (size_t i = 0; i < cd.baseclasses.dim; i++)
{
BaseClass* b = (*cd.baseclasses)[i];
ClassDeclaration cbd = b.type.toBasetype().isClassHandle();
if (!cbd)
continue;
for (size_t j = 0; j < cbd.vtbl.dim; j++)
{
FuncDeclaration f2 = cbd.vtbl[j].isFuncDeclaration();
if (!f2 || f2.ident != funcdecl.ident)
continue;
if (cbd.parent && cbd.parent.isTemplateInstance())
{
if (!f2.functionSemantic())
goto Ldone;
}
may_override = true;
}
}
if (may_override && funcdecl.type.nextOf() is null)
{
/* If same name function exists in base class but 'this' is auto return,
* cannot find index of base class's vtbl[] to override.
*/
funcdecl.error("return type inference is not supported if may override base class function");
}
/* Find index of existing function in base class's vtbl[] to override
* (the index will be the same as in cd's current vtbl[])
*/
int vi = cd.baseClass ? funcdecl.findVtblIndex(&cd.baseClass.vtbl, cast(int)cd.baseClass.vtbl.dim) : -1;
bool doesoverride = false;
switch (vi)
{
case -1:
Lintro:
/* Didn't find one, so
* This is an 'introducing' function which gets a new
* slot in the vtbl[].
*/
// Verify this doesn't override previous final function
if (cd.baseClass)
{
Dsymbol s = cd.baseClass.search(funcdecl.loc, funcdecl.ident);
if (s)
{
FuncDeclaration f2 = s.isFuncDeclaration();
if (f2)
{
f2 = f2.overloadExactMatch(funcdecl.type);
if (f2 && f2.isFinalFunc() && f2.prot().kind != Prot.Kind.private_)
funcdecl.error("cannot override `final` function `%s`", f2.toPrettyChars());
}
}
}
/* These quirky conditions mimic what VC++ appears to do
*/
if (global.params.mscoff && cd.classKind == ClassKind.cpp &&
cd.baseClass && cd.baseClass.vtbl.dim)
{
/* if overriding an interface function, then this is not
* introducing and don't put it in the class vtbl[]
*/
funcdecl.interfaceVirtual = funcdecl.overrideInterface();
if (funcdecl.interfaceVirtual)
{
//printf("\tinterface function %s\n", toChars());
cd.vtblFinal.push(funcdecl);
goto Linterfaces;
}
}
if (funcdecl.isFinalFunc())
{
// Don't check here, as it may override an interface function
//if (isOverride())
// error("is marked as override, but does not override any function");
cd.vtblFinal.push(funcdecl);
}
else
{
//printf("\tintroducing function %s\n", funcdecl.toChars());
funcdecl.introducing = 1;
if (cd.classKind == ClassKind.cpp && target.cpp.reverseOverloads)
{
/* Overloaded functions with same name are grouped and in reverse order.
* Search for first function of overload group, and insert
* funcdecl into vtbl[] immediately before it.
*/
funcdecl.vtblIndex = cast(int)cd.vtbl.dim;
bool found;
foreach (const i, s; cd.vtbl)
{
if (found)
// the rest get shifted forward
++s.isFuncDeclaration().vtblIndex;
else if (s.ident == funcdecl.ident && s.parent == parent)
{
// found first function of overload group
funcdecl.vtblIndex = cast(int)i;
found = true;
++s.isFuncDeclaration().vtblIndex;
}
}
cd.vtbl.insert(funcdecl.vtblIndex, funcdecl);
debug foreach (const i, s; cd.vtbl)
{
// a C++ dtor gets its vtblIndex later (and might even be added twice to the vtbl),
// e.g. when compiling druntime with a debug compiler, namely with core.stdcpp.exception.
if (auto fd = s.isFuncDeclaration())
assert(fd.vtblIndex == i ||
(cd.classKind == ClassKind.cpp && fd.isDtorDeclaration) ||
funcdecl.parent.isInterfaceDeclaration); // interface functions can be in multiple vtbls
}
}
else
{
// Append to end of vtbl[]
vi = cast(int)cd.vtbl.dim;
cd.vtbl.push(funcdecl);
funcdecl.vtblIndex = vi;
}
}
break;
case -2:
// can't determine because of forward references
funcdecl.errors = true;
return;
default:
{
FuncDeclaration fdv = cd.baseClass.vtbl[vi].isFuncDeclaration();
FuncDeclaration fdc = cd.vtbl[vi].isFuncDeclaration();
// This function is covariant with fdv
if (fdc == funcdecl)
{
doesoverride = true;
break;
}
if (fdc.toParent() == parent)
{
//printf("vi = %d,\tthis = %p %s %s @ [%s]\n\tfdc = %p %s %s @ [%s]\n\tfdv = %p %s %s @ [%s]\n",
// vi, this, this.toChars(), this.type.toChars(), this.loc.toChars(),
// fdc, fdc .toChars(), fdc .type.toChars(), fdc .loc.toChars(),
// fdv, fdv .toChars(), fdv .type.toChars(), fdv .loc.toChars());
// fdc overrides fdv exactly, then this introduces new function.
if (fdc.type.mod == fdv.type.mod && funcdecl.type.mod != fdv.type.mod)
goto Lintro;
}
if (fdv.isDeprecated)
deprecation(funcdecl.loc, "`%s` is overriding the deprecated method `%s`",
funcdecl.toPrettyChars, fdv.toPrettyChars);
// This function overrides fdv
if (fdv.isFinalFunc())
funcdecl.error("cannot override `final` function `%s`", fdv.toPrettyChars());
if (!funcdecl.isOverride())
{
if (fdv.isFuture())
{
deprecation(funcdecl.loc, "`@__future` base class method `%s` is being overridden by `%s`; rename the latter", fdv.toPrettyChars(), funcdecl.toPrettyChars());
// Treat 'this' as an introducing function, giving it a separate hierarchy in the vtbl[]
goto Lintro;
}
else
{
// https://issues.dlang.org/show_bug.cgi?id=17349
error(funcdecl.loc, "cannot implicitly override base class method `%s` with `%s`; add `override` attribute",
fdv.toPrettyChars(), funcdecl.toPrettyChars());
}
}
doesoverride = true;
if (fdc.toParent() == parent)
{
// If both are mixins, or both are not, then error.
// If either is not, the one that is not overrides the other.
bool thismixin = funcdecl.parent.isClassDeclaration() !is null;
bool fdcmixin = fdc.parent.isClassDeclaration() !is null;
if (thismixin == fdcmixin)
{
funcdecl.error("multiple overrides of same function");
}
/*
* https://issues.dlang.org/show_bug.cgi?id=711
*
* If an overriding method is introduced through a mixin,
* we need to update the vtbl so that both methods are
* present.
*/
else if (thismixin)
{
/* if the mixin introduced the overriding method, then reintroduce it
* in the vtbl. The initial entry for the mixined method
* will be updated at the end of the enclosing `if` block
* to point to the current (non-mixined) function.
*/
auto vitmp = cast(int)cd.vtbl.dim;
cd.vtbl.push(fdc);
fdc.vtblIndex = vitmp;
}
else if (fdcmixin)
{
/* if the current overriding function is coming from a
* mixined block, then push the current function in the
* vtbl, but keep the previous (non-mixined) function as
* the overriding one.
*/
auto vitmp = cast(int)cd.vtbl.dim;
cd.vtbl.push(funcdecl);
funcdecl.vtblIndex = vitmp;
break;
}
else // fdc overrides fdv
{
// this doesn't override any function
break;
}
}
cd.vtbl[vi] = funcdecl;
funcdecl.vtblIndex = vi;
/* Remember which functions this overrides
*/
funcdecl.foverrides.push(fdv);
/* This works by whenever this function is called,
* it actually returns tintro, which gets dynamically
* cast to type. But we know that tintro is a base
* of type, so we could optimize it by not doing a
* dynamic cast, but just subtracting the isBaseOf()
* offset if the value is != null.
*/
if (fdv.tintro)
funcdecl.tintro = fdv.tintro;
else if (!funcdecl.type.equals(fdv.type))
{
/* Only need to have a tintro if the vptr
* offsets differ
*/
int offset;
if (fdv.type.nextOf().isBaseOf(funcdecl.type.nextOf(), &offset))
{
funcdecl.tintro = fdv.type;
}
}
break;
}
}
/* Go through all the interface bases.
* If this function is covariant with any members of those interface
* functions, set the tintro.
*/
Linterfaces:
bool foundVtblMatch = false;
foreach (b; cd.interfaces)
{
vi = funcdecl.findVtblIndex(&b.sym.vtbl, cast(int)b.sym.vtbl.dim);
switch (vi)
{
case -1:
break;
case -2:
// can't determine because of forward references
funcdecl.errors = true;
return;
default:
{
auto fdv = cast(FuncDeclaration)b.sym.vtbl[vi];
Type ti = null;
foundVtblMatch = true;
/* Remember which functions this overrides
*/
funcdecl.foverrides.push(fdv);
/* Should we really require 'override' when implementing
* an interface function?
*/
//if (!isOverride())
// warning(loc, "overrides base class function %s, but is not marked with 'override'", fdv.toPrettyChars());
if (fdv.tintro)
ti = fdv.tintro;
else if (!funcdecl.type.equals(fdv.type))
{
/* Only need to have a tintro if the vptr
* offsets differ
*/
int offset;
if (fdv.type.nextOf().isBaseOf(funcdecl.type.nextOf(), &offset))
{
ti = fdv.type;
}
}
if (ti)
{
if (funcdecl.tintro)
{
if (!funcdecl.tintro.nextOf().equals(ti.nextOf()) && !funcdecl.tintro.nextOf().isBaseOf(ti.nextOf(), null) && !ti.nextOf().isBaseOf(funcdecl.tintro.nextOf(), null))
{
funcdecl.error("incompatible covariant types `%s` and `%s`", funcdecl.tintro.toChars(), ti.toChars());
}
}
else
{
funcdecl.tintro = ti;
}
}
}
}
}
if (foundVtblMatch)
{
goto L2;
}
if (!doesoverride && funcdecl.isOverride() && (funcdecl.type.nextOf() || !may_override))
{
BaseClass* bc = null;
Dsymbol s = null;
for (size_t i = 0; i < cd.baseclasses.dim; i++)
{
bc = (*cd.baseclasses)[i];
s = bc.sym.search_correct(funcdecl.ident);
if (s)
break;
}
if (s)
{
HdrGenState hgs;
OutBuffer buf;
auto fd = s.isFuncDeclaration();
functionToBufferFull(cast(TypeFunction)(funcdecl.type), &buf,
new Identifier(funcdecl.toPrettyChars()), &hgs, null);
const(char)* funcdeclToChars = buf.peekChars();
if (fd)
{
OutBuffer buf1;
functionToBufferFull(cast(TypeFunction)(fd.type), &buf1,
new Identifier(fd.toPrettyChars()), &hgs, null);
error(funcdecl.loc, "function `%s` does not override any function, did you mean to override `%s`?",
funcdeclToChars, buf1.peekChars());
}
else
{
error(funcdecl.loc, "function `%s` does not override any function, did you mean to override %s `%s`?",
funcdeclToChars, s.kind, s.toPrettyChars());
errorSupplemental(funcdecl.loc, "Functions are the only declarations that may be overriden");
}
}
else
funcdecl.error("does not override any function");
}
L2:
objc.setSelector(funcdecl, sc);
objc.checkLinkage(funcdecl);
objc.addToClassMethodList(funcdecl, cd);
/* Go through all the interface bases.
* Disallow overriding any final functions in the interface(s).
*/
foreach (b; cd.interfaces)
{
if (b.sym)
{
Dsymbol s = search_function(b.sym, funcdecl.ident);
if (s)
{
FuncDeclaration f2 = s.isFuncDeclaration();
if (f2)
{
f2 = f2.overloadExactMatch(funcdecl.type);
if (f2 && f2.isFinalFunc() && f2.prot().kind != Prot.Kind.private_)
funcdecl.error("cannot override `final` function `%s.%s`", b.sym.toChars(), f2.toPrettyChars());
}
}
}
}
if (funcdecl.isOverride)
{
if (funcdecl.storage_class & STC.disable)
deprecation(funcdecl.loc,
"`%s` cannot be annotated with `@disable` because it is overriding a function in the base class",
funcdecl.toPrettyChars);
if (funcdecl.isDeprecated)
deprecation(funcdecl.loc,
"`%s` cannot be marked as `deprecated` because it is overriding a function in the base class",
funcdecl.toPrettyChars);
}
}
else if (funcdecl.isOverride() && !parent.isTemplateInstance())
funcdecl.error("`override` only applies to class member functions");
if (auto ti = parent.isTemplateInstance)
objc.setSelector(funcdecl, sc);
objc.validateSelector(funcdecl);
// Reflect this.type to f because it could be changed by findVtblIndex
f = funcdecl.type.toTypeFunction();
Ldone:
if (!funcdecl.fbody && !funcdecl.allowsContractWithoutBody())
funcdecl.error("`in` and `out` contracts can only appear without a body when they are virtual interface functions or abstract");
/* Do not allow template instances to add virtual functions
* to a class.
*/
if (funcdecl.isVirtual())
{
TemplateInstance ti = parent.isTemplateInstance();
if (ti)
{
// Take care of nested templates
while (1)
{
TemplateInstance ti2 = ti.tempdecl.parent.isTemplateInstance();
if (!ti2)
break;
ti = ti2;
}
// If it's a member template
ClassDeclaration cd = ti.tempdecl.isClassMember();
if (cd)
{
funcdecl.error("cannot use template to add virtual function to class `%s`", cd.toChars());
}
}
}
if (funcdecl.isMain())
funcdecl.checkDmain(); // Check main() parameters and return type
/* Purity and safety can be inferred for some functions by examining
* the function body.
*/
if (funcdecl.canInferAttributes(sc))
funcdecl.initInferAttributes();
Module.dprogress++;
funcdecl.semanticRun = PASS.semanticdone;
/* Save scope for possible later use (if we need the
* function internals)
*/
funcdecl._scope = sc.copy();
funcdecl._scope.setNoFree();
__gshared bool printedMain = false; // semantic might run more than once
if (global.params.verbose && !printedMain)
{
const(char)* type = funcdecl.isMain() ? "main" : funcdecl.isWinMain() ? "winmain" : funcdecl.isDllMain() ? "dllmain" : cast(const(char)*)null;
Module mod = sc._module;
if (type && mod)
{
printedMain = true;
auto name = mod.srcfile.toChars();
auto path = FileName.searchPath(global.path, name, true);
message("entry %-10s\t%s", type, path ? path : name);
}
}
if (funcdecl.fbody && funcdecl.isMain() && sc._module.isRoot())
{
// check if `_d_cmain` is defined
bool cmainTemplateExists()
{
auto rootSymbol = sc.search(funcdecl.loc, Id.empty, null);
if (auto moduleSymbol = rootSymbol.search(funcdecl.loc, Id.object))
if (moduleSymbol.search(funcdecl.loc, Id.CMain))
return true;
return false;
}
// Only mixin `_d_cmain` if it is defined
if (cmainTemplateExists())
{
// add `mixin _d_cmain!();` to the declaring module
auto tqual = Pool!TypeIdentifier.make(funcdecl.loc, Id.CMain);
auto tm = new TemplateMixin(funcdecl.loc, null, tqual, null);
sc._module.members.push(tm);
}
rootHasMain = sc._module;
}
assert(funcdecl.type.ty != Terror || funcdecl.errors);
// semantic for parameters' UDAs
foreach (i, param; f.parameterList)
{
if (param && param.userAttribDecl)
param.userAttribDecl.dsymbolSemantic(sc);
}
}
/// Do the semantic analysis on the external interface to the function.
override void visit(FuncDeclaration funcdecl)
{
funcDeclarationSemantic(funcdecl);
}
override void visit(CtorDeclaration ctd)
{
//printf("CtorDeclaration::semantic() %s\n", toChars());
if (ctd.semanticRun >= PASS.semanticdone)
return;
if (ctd._scope)
{
sc = ctd._scope;
ctd._scope = null;
}
ctd.parent = sc.parent;
Dsymbol p = ctd.toParentDecl();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(ctd.loc, "constructor can only be a member of aggregate, not %s `%s`", p.kind(), p.toChars());
ctd.type = Type.terror;
ctd.errors = true;
return;
}
sc = sc.push();
if (sc.stc & STC.static_)
{
if (sc.stc & STC.shared_)
error(ctd.loc, "`shared static` has no effect on a constructor inside a `shared static` block. Use `shared static this()`");
else
error(ctd.loc, "`static` has no effect on a constructor inside a `static` block. Use `static this()`");
}
sc.stc &= ~STC.static_; // not a static constructor
sc.flags |= SCOPE.ctor;
funcDeclarationSemantic(ctd);
sc.pop();
if (ctd.errors)
return;
TypeFunction tf = ctd.type.toTypeFunction();
/* See if it's the default constructor
* But, template constructor should not become a default constructor.
*/
if (ad && (!ctd.parent.isTemplateInstance() || ctd.parent.isTemplateMixin()))
{
immutable dim = tf.parameterList.length;
if (auto sd = ad.isStructDeclaration())
{
if (dim == 0 && tf.parameterList.varargs == VarArg.none) // empty default ctor w/o any varargs
{
if (ctd.fbody || !(ctd.storage_class & STC.disable))
{
ctd.error("default constructor for structs only allowed " ~
"with `@disable`, no body, and no parameters");
ctd.storage_class |= STC.disable;
ctd.fbody = null;
}
sd.noDefaultCtor = true;
}
else if (dim == 0 && tf.parameterList.varargs != VarArg.none) // allow varargs only ctor
{
}
else if (dim && tf.parameterList[0].defaultArg)
{
// if the first parameter has a default argument, then the rest does as well
if (ctd.storage_class & STC.disable)
{
ctd.error("is marked `@disable`, so it cannot have default "~
"arguments for all parameters.");
errorSupplemental(ctd.loc, "Use `@disable this();` if you want to disable default initialization.");
}
else
ctd.error("all parameters have default arguments, "~
"but structs cannot have default constructors.");
}
else if ((dim == 1 || (dim > 1 && tf.parameterList[1].defaultArg)))
{
//printf("tf: %s\n", tf.toChars());
auto param = tf.parameterList[0];
if (param.storageClass & STC.ref_ && param.type.mutableOf().unSharedOf() == sd.type.mutableOf().unSharedOf())
{
//printf("copy constructor\n");
ctd.isCpCtor = true;
}
}
}
else if (dim == 0 && tf.parameterList.varargs == VarArg.none)
{
ad.defaultCtor = ctd;
}
}
}
override void visit(PostBlitDeclaration pbd)
{
//printf("PostBlitDeclaration::semantic() %s\n", toChars());
//printf("ident: %s, %s, %p, %p\n", ident.toChars(), Id::dtor.toChars(), ident, Id::dtor);
//printf("stc = x%llx\n", sc.stc);
if (pbd.semanticRun >= PASS.semanticdone)
return;
if (pbd._scope)
{
sc = pbd._scope;
pbd._scope = null;
}
pbd.parent = sc.parent;
Dsymbol p = pbd.toParent2();
StructDeclaration ad = p.isStructDeclaration();
if (!ad)
{
error(pbd.loc, "postblit can only be a member of struct, not %s `%s`", p.kind(), p.toChars());
pbd.type = Type.terror;
pbd.errors = true;
return;
}
if (pbd.ident == Id.postblit && pbd.semanticRun < PASS.semantic)
ad.postblits.push(pbd);
if (!pbd.type)
pbd.type = new TypeFunction(ParameterList(), Type.tvoid, LINK.d, pbd.storage_class);
sc = sc.push();
sc.stc &= ~STC.static_; // not static
sc.linkage = LINK.d;
funcDeclarationSemantic(pbd);
sc.pop();
}
override void visit(DtorDeclaration dd)
{
//printf("DtorDeclaration::semantic() %s\n", toChars());
//printf("ident: %s, %s, %p, %p\n", ident.toChars(), Id::dtor.toChars(), ident, Id::dtor);
if (dd.semanticRun >= PASS.semanticdone)
return;
if (dd._scope)
{
sc = dd._scope;
dd._scope = null;
}
dd.parent = sc.parent;
Dsymbol p = dd.toParent2();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(dd.loc, "destructor can only be a member of aggregate, not %s `%s`", p.kind(), p.toChars());
dd.type = Type.terror;
dd.errors = true;
return;
}
if (dd.ident == Id.dtor && dd.semanticRun < PASS.semantic)
ad.dtors.push(dd);
if (!dd.type)
{
dd.type = new TypeFunction(ParameterList(), Type.tvoid, LINK.d, dd.storage_class);
if (ad.classKind == ClassKind.cpp && dd.ident == Id.dtor)
{
if (auto cldec = ad.isClassDeclaration())
{
assert (cldec.cppDtorVtblIndex == -1); // double-call check already by dd.type
if (cldec.baseClass && cldec.baseClass.cppDtorVtblIndex != -1)
{
// override the base virtual
cldec.cppDtorVtblIndex = cldec.baseClass.cppDtorVtblIndex;
}
else if (!dd.isFinal())
{
// reserve the dtor slot for the destructor (which we'll create later)
cldec.cppDtorVtblIndex = cast(int)cldec.vtbl.dim;
cldec.vtbl.push(dd);
if (target.cpp.twoDtorInVtable)
cldec.vtbl.push(dd); // deleting destructor uses a second slot
}
}
}
}
sc = sc.push();
sc.stc &= ~STC.static_; // not a static destructor
if (sc.linkage != LINK.cpp)
sc.linkage = LINK.d;
funcDeclarationSemantic(dd);
sc.pop();
}
override void visit(StaticCtorDeclaration scd)
{
//printf("StaticCtorDeclaration::semantic()\n");
if (scd.semanticRun >= PASS.semanticdone)
return;
if (scd._scope)
{
sc = scd._scope;
scd._scope = null;
}
scd.parent = sc.parent;
Dsymbol p = scd.parent.pastMixin();
if (!p.isScopeDsymbol())
{
const(char)* s = (scd.isSharedStaticCtorDeclaration() ? "shared " : "");
error(scd.loc, "`%sstatic` constructor can only be member of module/aggregate/template, not %s `%s`", s, p.kind(), p.toChars());
scd.type = Type.terror;
scd.errors = true;
return;
}
if (!scd.type)
scd.type = new TypeFunction(ParameterList(), Type.tvoid, LINK.d, scd.storage_class);
/* If the static ctor appears within a template instantiation,
* it could get called multiple times by the module constructors
* for different modules. Thus, protect it with a gate.
*/
if (scd.isInstantiated() && scd.semanticRun < PASS.semantic)
{
/* Add this prefix to the function:
* static int gate;
* if (++gate != 1) return;
* Note that this is not thread safe; should not have threads
* during static construction.
*/
auto v = new VarDeclaration(Loc.initial, Type.tint32, Id.gate, null);
v.storage_class = STC.temp | (scd.isSharedStaticCtorDeclaration() ? STC.static_ : STC.tls);
auto sa = new Statements();
Statement s = new ExpStatement(Loc.initial, v);
sa.push(s);
Expression e = new IdentifierExp(Loc.initial, v.ident);
e = new AddAssignExp(Loc.initial, e, IntegerExp.literal!1);
e = new EqualExp(TOK.notEqual, Loc.initial, e, IntegerExp.literal!1);
s = new IfStatement(Loc.initial, null, e, new ReturnStatement(Loc.initial, null), null, Loc.initial);
sa.push(s);
if (scd.fbody)
sa.push(scd.fbody);
scd.fbody = new CompoundStatement(Loc.initial, sa);
}
const LINK save = sc.linkage;
if (save != LINK.d)
{
const(char)* s = (scd.isSharedStaticCtorDeclaration() ? "shared " : "");
deprecation(scd.loc, "`%sstatic` constructor can only be of D linkage", s);
// Just correct it
sc.linkage = LINK.d;
}
funcDeclarationSemantic(scd);
sc.linkage = save;
// We're going to need ModuleInfo
Module m = scd.getModule();
if (!m)
m = sc._module;
if (m)
{
m.needmoduleinfo = 1;
//printf("module1 %s needs moduleinfo\n", m.toChars());
}
}
override void visit(StaticDtorDeclaration sdd)
{
if (sdd.semanticRun >= PASS.semanticdone)
return;
if (sdd._scope)
{
sc = sdd._scope;
sdd._scope = null;
}
sdd.parent = sc.parent;
Dsymbol p = sdd.parent.pastMixin();
if (!p.isScopeDsymbol())
{
const(char)* s = (sdd.isSharedStaticDtorDeclaration() ? "shared " : "");
error(sdd.loc, "`%sstatic` destructor can only be member of module/aggregate/template, not %s `%s`", s, p.kind(), p.toChars());
sdd.type = Type.terror;
sdd.errors = true;
return;
}
if (!sdd.type)
sdd.type = new TypeFunction(ParameterList(), Type.tvoid, LINK.d, sdd.storage_class);
/* If the static ctor appears within a template instantiation,
* it could get called multiple times by the module constructors
* for different modules. Thus, protect it with a gate.
*/
if (sdd.isInstantiated() && sdd.semanticRun < PASS.semantic)
{
/* Add this prefix to the function:
* static int gate;
* if (--gate != 0) return;
* Increment gate during constructor execution.
* Note that this is not thread safe; should not have threads
* during static destruction.
*/
auto v = new VarDeclaration(Loc.initial, Type.tint32, Id.gate, null);
v.storage_class = STC.temp | (sdd.isSharedStaticDtorDeclaration() ? STC.static_ : STC.tls);
auto sa = new Statements();
Statement s = new ExpStatement(Loc.initial, v);
sa.push(s);
Expression e = new IdentifierExp(Loc.initial, v.ident);
e = new AddAssignExp(Loc.initial, e, IntegerExp.literal!(-1));
e = new EqualExp(TOK.notEqual, Loc.initial, e, IntegerExp.literal!0);
s = new IfStatement(Loc.initial, null, e, new ReturnStatement(Loc.initial, null), null, Loc.initial);
sa.push(s);
if (sdd.fbody)
sa.push(sdd.fbody);
sdd.fbody = new CompoundStatement(Loc.initial, sa);
sdd.vgate = v;
}
const LINK save = sc.linkage;
if (save != LINK.d)
{
const(char)* s = (sdd.isSharedStaticDtorDeclaration() ? "shared " : "");
deprecation(sdd.loc, "`%sstatic` destructor can only be of D linkage", s);
// Just correct it
sc.linkage = LINK.d;
}
funcDeclarationSemantic(sdd);
sc.linkage = save;
// We're going to need ModuleInfo
Module m = sdd.getModule();
if (!m)
m = sc._module;
if (m)
{
m.needmoduleinfo = 1;
//printf("module2 %s needs moduleinfo\n", m.toChars());
}
}
override void visit(InvariantDeclaration invd)
{
if (invd.semanticRun >= PASS.semanticdone)
return;
if (invd._scope)
{
sc = invd._scope;
invd._scope = null;
}
invd.parent = sc.parent;
Dsymbol p = invd.parent.pastMixin();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
error(invd.loc, "`invariant` can only be a member of aggregate, not %s `%s`", p.kind(), p.toChars());
invd.type = Type.terror;
invd.errors = true;
return;
}
if (invd.ident != Id.classInvariant &&
invd.semanticRun < PASS.semantic &&
!ad.isUnionDeclaration() // users are on their own with union fields
)
ad.invs.push(invd);
if (!invd.type)
invd.type = new TypeFunction(ParameterList(), Type.tvoid, LINK.d, invd.storage_class);
sc = sc.push();
sc.stc &= ~STC.static_; // not a static invariant
sc.stc |= STC.const_; // invariant() is always const
sc.flags = (sc.flags & ~SCOPE.contract) | SCOPE.invariant_;
sc.linkage = LINK.d;
funcDeclarationSemantic(invd);
sc.pop();
}
override void visit(UnitTestDeclaration utd)
{
if (utd.semanticRun >= PASS.semanticdone)
return;
if (utd._scope)
{
sc = utd._scope;
utd._scope = null;
}
utd.protection = sc.protection;
utd.parent = sc.parent;
Dsymbol p = utd.parent.pastMixin();
if (!p.isScopeDsymbol())
{
error(utd.loc, "`unittest` can only be a member of module/aggregate/template, not %s `%s`", p.kind(), p.toChars());
utd.type = Type.terror;
utd.errors = true;
return;
}
if (global.params.useUnitTests)
{
if (!utd.type)
utd.type = new TypeFunction(ParameterList(), Type.tvoid, LINK.d, utd.storage_class);
Scope* sc2 = sc.push();
sc2.linkage = LINK.d;
funcDeclarationSemantic(utd);
sc2.pop();
}
version (none)
{
// We're going to need ModuleInfo even if the unit tests are not
// compiled in, because other modules may import this module and refer
// to this ModuleInfo.
// (This doesn't make sense to me?)
Module m = utd.getModule();
if (!m)
m = sc._module;
if (m)
{
//printf("module3 %s needs moduleinfo\n", m.toChars());
m.needmoduleinfo = 1;
}
}
}
override void visit(NewDeclaration nd)
{
//printf("NewDeclaration::semantic()\n");
// `@disable new();` should not be deprecated
if (!nd.isDisabled())
{
// @@@DEPRECATED_2.091@@@
// Made an error in 2.087.
// Should be removed in 2.091
error(nd.loc, "class allocators are obsolete, consider moving the allocation strategy outside of the class");
}
if (nd.semanticRun >= PASS.semanticdone)
return;
if (nd._scope)
{
sc = nd._scope;
nd._scope = null;
}
nd.parent = sc.parent;
Dsymbol p = nd.parent.pastMixin();
if (!p.isAggregateDeclaration())
{
error(nd.loc, "allocator can only be a member of aggregate, not %s `%s`", p.kind(), p.toChars());
nd.type = Type.terror;
nd.errors = true;
return;
}
Type tret = Type.tvoid.pointerTo();
if (!nd.type)
nd.type = new TypeFunction(nd.parameterList, tret, LINK.d, nd.storage_class);
nd.type = nd.type.typeSemantic(nd.loc, sc);
// allow for `@disable new();` to force users of a type to use an external allocation strategy
if (!nd.isDisabled())
{
// Check that there is at least one argument of type size_t
TypeFunction tf = nd.type.toTypeFunction();
if (tf.parameterList.length < 1)
{
nd.error("at least one argument of type `size_t` expected");
}
else
{
Parameter fparam = tf.parameterList[0];
if (!fparam.type.equals(Type.tsize_t))
nd.error("first argument must be type `size_t`, not `%s`", fparam.type.toChars());
}
}
funcDeclarationSemantic(nd);
}
/* https://issues.dlang.org/show_bug.cgi?id=19731
*
* Some aggregate member functions might have had
* semantic 3 ran on them despite being in semantic1
* (e.g. auto functions); if that is the case, then
* invariants will not be taken into account for them
* because at the time of the analysis it would appear
* as if the struct declaration does not have any
* invariants. To solve this issue, we need to redo
* semantic3 on the function declaration.
*/
private void reinforceInvariant(AggregateDeclaration ad, Scope* sc)
{
// for each member
for(int i = 0; i < ad.members.dim; i++)
{
if (!(*ad.members)[i])
continue;
auto fd = (*ad.members)[i].isFuncDeclaration();
if (!fd || fd.generated || fd.semanticRun != PASS.semantic3done)
continue;
/* if it's a user defined function declaration and semantic3
* was already performed on it, create a syntax copy and
* redo the first semantic step.
*/
auto fd_temp = fd.syntaxCopy(null).isFuncDeclaration();
fd_temp.storage_class &= ~STC.auto_; // type has already been inferred
if (auto cd = ad.isClassDeclaration())
cd.vtbl.remove(fd.vtblIndex);
fd_temp.dsymbolSemantic(sc);
(*ad.members)[i] = fd_temp;
}
}
override void visit(StructDeclaration sd)
{
//printf("StructDeclaration::semantic(this=%p, '%s', sizeok = %d)\n", sd, sd.toPrettyChars(), sd.sizeok);
//static int count; if (++count == 20) assert(0);
if (sd.semanticRun >= PASS.semanticdone)
return;
int errors = global.errors;
//printf("+StructDeclaration::semantic(this=%p, '%s', sizeok = %d)\n", this, toPrettyChars(), sizeok);
Scope* scx = null;
if (sd._scope)
{
sc = sd._scope;
scx = sd._scope; // save so we don't make redundant copies
sd._scope = null;
}
if (!sd.parent)
{
assert(sc.parent && sc.func);
sd.parent = sc.parent;
}
assert(sd.parent && !sd.isAnonymous());
if (sd.errors)
sd.type = Type.terror;
if (sd.semanticRun == PASS.init)
sd.type = sd.type.addSTC(sc.stc | sd.storage_class);
sd.type = sd.type.typeSemantic(sd.loc, sc);
if (auto ts = sd.type.isTypeStruct())
if (ts.sym != sd)
{
auto ti = ts.sym.isInstantiated();
if (ti && isError(ti))
ts.sym = sd;
}
// Ungag errors when not speculative
Ungag ungag = sd.ungagSpeculative();
if (sd.semanticRun == PASS.init)
{
sd.protection = sc.protection;
sd.alignment = sc.alignment();
sd.storage_class |= sc.stc;
if (sd.storage_class & STC.abstract_)
sd.error("structs, unions cannot be `abstract`");
sd.userAttribDecl = sc.userAttribDecl;
if (sc.linkage == LINK.cpp)
sd.classKind = ClassKind.cpp;
sd.cppnamespace = sc.namespace;
sd.cppmangle = sc.cppmangle;
}
else if (sd.symtab && !scx)
return;
sd.semanticRun = PASS.semantic;
UserAttributeDeclaration.checkGNUABITag(sd, sc.linkage);
if (!sd.members) // if opaque declaration
{
sd.semanticRun = PASS.semanticdone;
return;
}
if (!sd.symtab)
{
sd.symtab = new DsymbolTable();
sd.members.foreachDsymbol( s => s.addMember(sc, sd) );
}
auto sc2 = sd.newScope(sc);
/* Set scope so if there are forward references, we still might be able to
* resolve individual members like enums.
*/
sd.members.foreachDsymbol( s => s.setScope(sc2) );
sd.members.foreachDsymbol( s => s.importAll(sc2) );
sd.members.foreachDsymbol( (s) { s.dsymbolSemantic(sc2); sd.errors |= s.errors; } );
if (sd.errors)
sd.type = Type.terror;
if (!sd.determineFields())
{
if (sd.type.ty != Terror)
{
sd.error(sd.loc, "circular or forward reference");
sd.errors = true;
sd.type = Type.terror;
}
sc2.pop();
sd.semanticRun = PASS.semanticdone;
return;
}
/* Following special member functions creation needs semantic analysis
* completion of sub-structs in each field types. For example, buildDtor
* needs to check existence of elaborate dtor in type of each fields.
* See the case in compilable/test14838.d
*/
foreach (v; sd.fields)
{
Type tb = v.type.baseElemOf();
if (tb.ty != Tstruct)
continue;
auto sdec = (cast(TypeStruct)tb).sym;
if (sdec.semanticRun >= PASS.semanticdone)
continue;
sc2.pop();
//printf("\tdeferring %s\n", toChars());
return deferDsymbolSemantic(sd, scx);
}
/* Look for special member functions.
*/
sd.aggNew = cast(NewDeclaration)sd.search(Loc.initial, Id.classNew);
// Look for the constructor
sd.ctor = sd.searchCtor();
sd.dtor = buildDtor(sd, sc2);
sd.tidtor = buildExternDDtor(sd, sc2);
sd.postblit = buildPostBlit(sd, sc2);
sd.hasCopyCtor = buildCopyCtor(sd, sc2);
buildOpAssign(sd, sc2);
buildOpEquals(sd, sc2);
if (global.params.useTypeInfo && Type.dtypeinfo) // these functions are used for TypeInfo
{
sd.xeq = buildXopEquals(sd, sc2);
sd.xcmp = buildXopCmp(sd, sc2);
sd.xhash = buildXtoHash(sd, sc2);
}
sd.inv = buildInv(sd, sc2);
if (sd.inv)
reinforceInvariant(sd, sc2);
Module.dprogress++;
sd.semanticRun = PASS.semanticdone;
//printf("-StructDeclaration::semantic(this=%p, '%s')\n", sd, sd.toChars());
sc2.pop();
if (sd.ctor)
{
Dsymbol scall = sd.search(Loc.initial, Id.call);
if (scall)
{
uint xerrors = global.startGagging();
sc = sc.push();
sc.tinst = null;
sc.minst = null;
auto fcall = resolveFuncCall(sd.loc, sc, scall, null, null, null, FuncResolveFlag.quiet);
sc = sc.pop();
global.endGagging(xerrors);
if (fcall && fcall.isStatic())
{
sd.error(fcall.loc, "`static opCall` is hidden by constructors and can never be called");
errorSupplemental(fcall.loc, "Please use a factory method instead, or replace all constructors with `static opCall`.");
}
}
}
if (sd.type.ty == Tstruct && (cast(TypeStruct)sd.type).sym != sd)
{
// https://issues.dlang.org/show_bug.cgi?id=19024
StructDeclaration sym = (cast(TypeStruct)sd.type).sym;
version (none)
{
printf("this = %p %s\n", sd, sd.toChars());
printf("type = %d sym = %p, %s\n", sd.type.ty, sym, sym.toPrettyChars());
}
sd.error("already exists at %s. Perhaps in another function with the same name?", sym.loc.toChars());
}
if (global.errors != errors)
{
// The type is no good.
sd.type = Type.terror;
sd.errors = true;
if (sd.deferred)
sd.deferred.errors = true;
}
if (sd.deferred && !global.gag)
{
sd.deferred.semantic2(sc);
sd.deferred.semantic3(sc);
}
}
void interfaceSemantic(ClassDeclaration cd)
{
cd.vtblInterfaces = new BaseClasses();
cd.vtblInterfaces.reserve(cd.interfaces.length);
foreach (b; cd.interfaces)
{
cd.vtblInterfaces.push(b);
b.copyBaseInterfaces(cd.vtblInterfaces);
}
}
override void visit(ClassDeclaration cldec)
{
/// Checks that the given class implements all methods of its interfaces.
static void checkInterfaceImplementations(ClassDeclaration cd)
{
foreach (base; cd.interfaces)
{
// first entry is ClassInfo reference
auto methods = base.sym.vtbl[base.sym.vtblOffset .. $];
foreach (m; methods)
{
auto ifd = m.isFuncDeclaration;
assert(ifd);
auto type = ifd.type.toTypeFunction();
auto fd = cd.findFunc(ifd.ident, type);
if (fd && !fd.isAbstract)
{
//printf(" found\n");
// Check that calling conventions match
if (fd.linkage != ifd.linkage)
fd.error("linkage doesn't match interface function");
// Check that it is current
//printf("newinstance = %d fd.toParent() = %s ifd.toParent() = %s\n",
//newinstance, fd.toParent().toChars(), ifd.toParent().toChars());
if (fd.toParent() != cd && ifd.toParent() == base.sym)
cd.error("interface function `%s` is not implemented", ifd.toFullSignature());
}
else
{
//printf(" not found %p\n", fd);
// BUG: should mark this class as abstract?
if (!cd.isAbstract())
cd.error("interface function `%s` is not implemented", ifd.toFullSignature());
}
}
}
}
//printf("ClassDeclaration.dsymbolSemantic(%s), type = %p, sizeok = %d, this = %p\n", cldec.toChars(), cldec.type, cldec.sizeok, this);
//printf("\tparent = %p, '%s'\n", sc.parent, sc.parent ? sc.parent.toChars() : "");
//printf("sc.stc = %x\n", sc.stc);
//{ static int n; if (++n == 20) *(char*)0=0; }
if (cldec.semanticRun >= PASS.semanticdone)
return;
int errors = global.errors;
//printf("+ClassDeclaration.dsymbolSemantic(%s), type = %p, sizeok = %d, this = %p\n", toChars(), type, sizeok, this);
Scope* scx = null;
if (cldec._scope)
{
sc = cldec._scope;
scx = cldec._scope; // save so we don't make redundant copies
cldec._scope = null;
}
if (!cldec.parent)
{
assert(sc.parent);
cldec.parent = sc.parent;
}
if (cldec.errors)
cldec.type = Type.terror;
cldec.type = cldec.type.typeSemantic(cldec.loc, sc);
if (auto tc = cldec.type.isTypeClass())
if (tc.sym != cldec)
{
auto ti = tc.sym.isInstantiated();
if (ti && isError(ti))
tc.sym = cldec;
}
// Ungag errors when not speculative
Ungag ungag = cldec.ungagSpeculative();
if (cldec.semanticRun == PASS.init)
{
cldec.protection = sc.protection;
cldec.storage_class |= sc.stc;
if (cldec.storage_class & STC.auto_)
cldec.error("storage class `auto` is invalid when declaring a class, did you mean to use `scope`?");
if (cldec.storage_class & STC.scope_)
cldec.stack = true;
if (cldec.storage_class & STC.abstract_)
cldec.isabstract = Abstract.yes;
cldec.userAttribDecl = sc.userAttribDecl;
if (sc.linkage == LINK.cpp)
cldec.classKind = ClassKind.cpp;
cldec.cppnamespace = sc.namespace;
cldec.cppmangle = sc.cppmangle;
if (sc.linkage == LINK.objc)
objc.setObjc(cldec);
}
else if (cldec.symtab && !scx)
{
return;
}
cldec.semanticRun = PASS.semantic;
UserAttributeDeclaration.checkGNUABITag(cldec, sc.linkage);
if (cldec.baseok < Baseok.done)
{
/* https://issues.dlang.org/show_bug.cgi?id=12078
* https://issues.dlang.org/show_bug.cgi?id=12143
* https://issues.dlang.org/show_bug.cgi?id=15733
* While resolving base classes and interfaces, a base may refer
* the member of this derived class. In that time, if all bases of
* this class can be determined, we can go forward the semantc process
* beyond the Lancestorsdone. To do the recursive semantic analysis,
* temporarily set and unset `_scope` around exp().
*/
T resolveBase(T)(lazy T exp)
{
if (!scx)
{
scx = sc.copy();
scx.setNoFree();
}
static if (!is(T == void))
{
cldec._scope = scx;
auto r = exp();
cldec._scope = null;
return r;
}
else
{
cldec._scope = scx;
exp();
cldec._scope = null;
}
}
cldec.baseok = Baseok.start;
// Expand any tuples in baseclasses[]
for (size_t i = 0; i < cldec.baseclasses.dim;)
{
auto b = (*cldec.baseclasses)[i];
b.type = resolveBase(b.type.typeSemantic(cldec.loc, sc));
Type tb = b.type.toBasetype();
if (auto tup = tb.isTypeTuple())
{
cldec.baseclasses.remove(i);
size_t dim = Parameter.dim(tup.arguments);
for (size_t j = 0; j < dim; j++)
{
Parameter arg = Parameter.getNth(tup.arguments, j);
b = new BaseClass(arg.type);
cldec.baseclasses.insert(i + j, b);
}
}
else
i++;
}
if (cldec.baseok >= Baseok.done)
{
//printf("%s already semantic analyzed, semanticRun = %d\n", toChars(), semanticRun);
if (cldec.semanticRun >= PASS.semanticdone)
return;
goto Lancestorsdone;
}
// See if there's a base class as first in baseclasses[]
if (cldec.baseclasses.dim)
{
BaseClass* b = (*cldec.baseclasses)[0];
Type tb = b.type.toBasetype();
TypeClass tc = tb.isTypeClass();
if (!tc)
{
if (b.type != Type.terror)
cldec.error("base type must be `class` or `interface`, not `%s`", b.type.toChars());
cldec.baseclasses.remove(0);
goto L7;
}
if (tc.sym.isDeprecated())
{
if (!cldec.isDeprecated())
{
// Deriving from deprecated class makes this one deprecated too
cldec.setDeprecated();
tc.checkDeprecated(cldec.loc, sc);
}
}
if (tc.sym.isInterfaceDeclaration())
goto L7;
for (ClassDeclaration cdb = tc.sym; cdb; cdb = cdb.baseClass)
{
if (cdb == cldec)
{
cldec.error("circular inheritance");
cldec.baseclasses.remove(0);
goto L7;
}
}
/* https://issues.dlang.org/show_bug.cgi?id=11034
* Class inheritance hierarchy
* and instance size of each classes are orthogonal information.
* Therefore, even if tc.sym.sizeof == Sizeok.none,
* we need to set baseClass field for class covariance check.
*/
cldec.baseClass = tc.sym;
b.sym = cldec.baseClass;
if (tc.sym.baseok < Baseok.done)
resolveBase(tc.sym.dsymbolSemantic(null)); // Try to resolve forward reference
if (tc.sym.baseok < Baseok.done)
{
//printf("\ttry later, forward reference of base class %s\n", tc.sym.toChars());
if (tc.sym._scope)
Module.addDeferredSemantic(tc.sym);
cldec.baseok = Baseok.none;
}
L7:
}
// Treat the remaining entries in baseclasses as interfaces
// Check for errors, handle forward references
bool multiClassError = false;
BCLoop:
for (size_t i = (cldec.baseClass ? 1 : 0); i < cldec.baseclasses.dim;)
{
BaseClass* b = (*cldec.baseclasses)[i];
Type tb = b.type.toBasetype();
TypeClass tc = tb.isTypeClass();
if (!tc || !tc.sym.isInterfaceDeclaration())
{
// It's a class
if (tc)
{
if (!multiClassError)
{
error(cldec.loc,"`%s`: multiple class inheritance is not supported." ~
" Use multiple interface inheritance and/or composition.", cldec.toPrettyChars());
multiClassError = true;
}
if (tc.sym.fields.dim)
errorSupplemental(cldec.loc,"`%s` has fields, consider making it a member of `%s`",
b.type.toChars(), cldec.type.toChars());
else
errorSupplemental(cldec.loc,"`%s` has no fields, consider making it an `interface`",
b.type.toChars());
}
// It's something else: e.g. `int` in `class Foo : Bar, int { ... }`
else if (b.type != Type.terror)
{
error(cldec.loc,"`%s`: base type must be `interface`, not `%s`",
cldec.toPrettyChars(), b.type.toChars());
}
cldec.baseclasses.remove(i);
continue;
}
// Check for duplicate interfaces
for (size_t j = (cldec.baseClass ? 1 : 0); j < i; j++)
{
BaseClass* b2 = (*cldec.baseclasses)[j];
if (b2.sym == tc.sym)
{
cldec.error("inherits from duplicate interface `%s`", b2.sym.toChars());
cldec.baseclasses.remove(i);
continue BCLoop;
}
}
if (tc.sym.isDeprecated())
{
if (!cldec.isDeprecated())
{
// Deriving from deprecated class makes this one deprecated too
cldec.setDeprecated();
tc.checkDeprecated(cldec.loc, sc);
}
}
b.sym = tc.sym;
if (tc.sym.baseok < Baseok.done)
resolveBase(tc.sym.dsymbolSemantic(null)); // Try to resolve forward reference
if (tc.sym.baseok < Baseok.done)
{
//printf("\ttry later, forward reference of base %s\n", tc.sym.toChars());
if (tc.sym._scope)
Module.addDeferredSemantic(tc.sym);
cldec.baseok = Baseok.none;
}
i++;
}
if (cldec.baseok == Baseok.none)
{
// Forward referencee of one or more bases, try again later
//printf("\tL%d semantic('%s') failed due to forward references\n", __LINE__, toChars());
return deferDsymbolSemantic(cldec, scx);
}
cldec.baseok = Baseok.done;
if (cldec.classKind == ClassKind.objc || (cldec.baseClass && cldec.baseClass.classKind == ClassKind.objc))
cldec.classKind = ClassKind.objc; // Objective-C classes do not inherit from Object
// If no base class, and this is not an Object, use Object as base class
if (!cldec.baseClass && cldec.ident != Id.Object && cldec.object && cldec.classKind == ClassKind.d)
{
void badObjectDotD()
{
cldec.error("missing or corrupt object.d");
fatal();
}
if (!cldec.object || cldec.object.errors)
badObjectDotD();
Type t = cldec.object.type;
t = t.typeSemantic(cldec.loc, sc).toBasetype();
if (t.ty == Terror)
badObjectDotD();
TypeClass tc = t.isTypeClass();
assert(tc);
auto b = new BaseClass(tc);
cldec.baseclasses.shift(b);
cldec.baseClass = tc.sym;
assert(!cldec.baseClass.isInterfaceDeclaration());
b.sym = cldec.baseClass;
}
if (cldec.baseClass)
{
if (cldec.baseClass.storage_class & STC.final_)
cldec.error("cannot inherit from class `%s` because it is `final`", cldec.baseClass.toChars());
// Inherit properties from base class
if (cldec.baseClass.isCOMclass())
cldec.com = true;
if (cldec.baseClass.isCPPclass())
cldec.classKind = ClassKind.cpp;
if (cldec.baseClass.stack)
cldec.stack = true;
cldec.enclosing = cldec.baseClass.enclosing;
cldec.storage_class |= cldec.baseClass.storage_class & STC.TYPECTOR;
}
cldec.interfaces = cldec.baseclasses.tdata()[(cldec.baseClass ? 1 : 0) .. cldec.baseclasses.dim];
foreach (b; cldec.interfaces)
{
// If this is an interface, and it derives from a COM interface,
// then this is a COM interface too.
if (b.sym.isCOMinterface())
cldec.com = true;
if (cldec.classKind == ClassKind.cpp && !b.sym.isCPPinterface())
{
error(cldec.loc, "C++ class `%s` cannot implement D interface `%s`",
cldec.toPrettyChars(), b.sym.toPrettyChars());
}
}
interfaceSemantic(cldec);
}
Lancestorsdone:
//printf("\tClassDeclaration.dsymbolSemantic(%s) baseok = %d\n", toChars(), baseok);
if (!cldec.members) // if opaque declaration
{
cldec.semanticRun = PASS.semanticdone;
return;
}
if (!cldec.symtab)
{
cldec.symtab = new DsymbolTable();
/* https://issues.dlang.org/show_bug.cgi?id=12152
* The semantic analysis of base classes should be finished
* before the members semantic analysis of this class, in order to determine
* vtbl in this class. However if a base class refers the member of this class,
* it can be resolved as a normal forward reference.
* Call addMember() and setScope() to make this class members visible from the base classes.
*/
cldec.members.foreachDsymbol( s => s.addMember(sc, cldec) );
auto sc2 = cldec.newScope(sc);
/* Set scope so if there are forward references, we still might be able to
* resolve individual members like enums.
*/
cldec.members.foreachDsymbol( s => s.setScope(sc2) );
sc2.pop();
}
for (size_t i = 0; i < cldec.baseclasses.dim; i++)
{
BaseClass* b = (*cldec.baseclasses)[i];
Type tb = b.type.toBasetype();
TypeClass tc = tb.isTypeClass();
if (tc.sym.semanticRun < PASS.semanticdone)
{
// Forward referencee of one or more bases, try again later
if (tc.sym._scope)
Module.addDeferredSemantic(tc.sym);
//printf("\tL%d semantic('%s') failed due to forward references\n", __LINE__, toChars());
return deferDsymbolSemantic(cldec, scx);
}
}
if (cldec.baseok == Baseok.done)
{
cldec.baseok = Baseok.semanticdone;
objc.setMetaclass(cldec, sc);
// initialize vtbl
if (cldec.baseClass)
{
if (cldec.classKind == ClassKind.cpp && cldec.baseClass.vtbl.dim == 0)
{
cldec.error("C++ base class `%s` needs at least one virtual function", cldec.baseClass.toChars());
}
// Copy vtbl[] from base class
cldec.vtbl.setDim(cldec.baseClass.vtbl.dim);
memcpy(cldec.vtbl.tdata(), cldec.baseClass.vtbl.tdata(), (void*).sizeof * cldec.vtbl.dim);
cldec.vthis = cldec.baseClass.vthis;
cldec.vthis2 = cldec.baseClass.vthis2;
}
else
{
// No base class, so this is the root of the class hierarchy
cldec.vtbl.setDim(0);
if (cldec.vtblOffset())
cldec.vtbl.push(cldec); // leave room for classinfo as first member
}
/* If this is a nested class, add the hidden 'this'
* member which is a pointer to the enclosing scope.
*/
if (cldec.vthis) // if inheriting from nested class
{
// Use the base class's 'this' member
if (cldec.storage_class & STC.static_)
cldec.error("static class cannot inherit from nested class `%s`", cldec.baseClass.toChars());
if (cldec.toParentLocal() != cldec.baseClass.toParentLocal() &&
(!cldec.toParentLocal() ||
!cldec.baseClass.toParentLocal().getType() ||
!cldec.baseClass.toParentLocal().getType().isBaseOf(cldec.toParentLocal().getType(), null)))
{
if (cldec.toParentLocal())
{
cldec.error("is nested within `%s`, but super class `%s` is nested within `%s`",
cldec.toParentLocal().toChars(),
cldec.baseClass.toChars(),
cldec.baseClass.toParentLocal().toChars());
}
else
{
cldec.error("is not nested, but super class `%s` is nested within `%s`",
cldec.baseClass.toChars(),
cldec.baseClass.toParentLocal().toChars());
}
cldec.enclosing = null;
}
if (cldec.vthis2)
{
if (cldec.toParent2() != cldec.baseClass.toParent2() &&
(!cldec.toParent2() ||
!cldec.baseClass.toParent2().getType() ||
!cldec.baseClass.toParent2().getType().isBaseOf(cldec.toParent2().getType(), null)))
{
if (cldec.toParent2() && cldec.toParent2() != cldec.toParentLocal())
{
cldec.error("needs the frame pointer of `%s`, but super class `%s` needs the frame pointer of `%s`",
cldec.toParent2().toChars(),
cldec.baseClass.toChars(),
cldec.baseClass.toParent2().toChars());
}
else
{
cldec.error("doesn't need a frame pointer, but super class `%s` needs the frame pointer of `%s`",
cldec.baseClass.toChars(),
cldec.baseClass.toParent2().toChars());
}
}
}
else
cldec.makeNested2();
}
else
cldec.makeNested();
}
auto sc2 = cldec.newScope(sc);
cldec.members.foreachDsymbol( s => s.importAll(sc2) );
// Note that members.dim can grow due to tuple expansion during semantic()
cldec.members.foreachDsymbol( s => s.dsymbolSemantic(sc2) );
if (!cldec.determineFields())
{
assert(cldec.type == Type.terror);
sc2.pop();
return;
}
/* Following special member functions creation needs semantic analysis
* completion of sub-structs in each field types.
*/
foreach (v; cldec.fields)
{
Type tb = v.type.baseElemOf();
if (tb.ty != Tstruct)
continue;
auto sd = (cast(TypeStruct)tb).sym;
if (sd.semanticRun >= PASS.semanticdone)
continue;
sc2.pop();
//printf("\tdeferring %s\n", toChars());
return deferDsymbolSemantic(cldec, scx);
}
/* Look for special member functions.
* They must be in this class, not in a base class.
*/
// Can be in base class
cldec.aggNew = cast(NewDeclaration)cldec.search(Loc.initial, Id.classNew);
// Look for the constructor
cldec.ctor = cldec.searchCtor();
if (!cldec.ctor && cldec.noDefaultCtor)
{
// A class object is always created by constructor, so this check is legitimate.
foreach (v; cldec.fields)
{
if (v.storage_class & STC.nodefaultctor)
error(v.loc, "field `%s` must be initialized in constructor", v.toChars());
}
}
// If this class has no constructor, but base class has a default
// ctor, create a constructor:
// this() { }
if (!cldec.ctor && cldec.baseClass && cldec.baseClass.ctor)
{
auto fd = resolveFuncCall(cldec.loc, sc2, cldec.baseClass.ctor, null, cldec.type, null, FuncResolveFlag.quiet);
if (!fd) // try shared base ctor instead
fd = resolveFuncCall(cldec.loc, sc2, cldec.baseClass.ctor, null, cldec.type.sharedOf, null, FuncResolveFlag.quiet);
if (fd && !fd.errors)
{
//printf("Creating default this(){} for class %s\n", toChars());
auto btf = fd.type.toTypeFunction();
auto tf = new TypeFunction(ParameterList(), null, LINK.d, fd.storage_class);
tf.mod = btf.mod;
tf.purity = btf.purity;
tf.isnothrow = btf.isnothrow;
tf.isnogc = btf.isnogc;
tf.trust = btf.trust;
auto ctor = new CtorDeclaration(cldec.loc, Loc.initial, 0, tf);
ctor.fbody = new CompoundStatement(Loc.initial, new Statements());
cldec.members.push(ctor);
ctor.addMember(sc, cldec);
ctor.dsymbolSemantic(sc2);
cldec.ctor = ctor;
cldec.defaultCtor = ctor;
}
else
{
cldec.error("cannot implicitly generate a default constructor when base class `%s` is missing a default constructor",
cldec.baseClass.toPrettyChars());
}
}
cldec.dtor = buildDtor(cldec, sc2);
cldec.tidtor = buildExternDDtor(cldec, sc2);
if (cldec.classKind == ClassKind.cpp && cldec.cppDtorVtblIndex != -1)
{
// now we've built the aggregate destructor, we'll make it virtual and assign it to the reserved vtable slot
cldec.dtor.vtblIndex = cldec.cppDtorVtblIndex;
cldec.vtbl[cldec.cppDtorVtblIndex] = cldec.dtor;
if (target.cpp.twoDtorInVtable)
{
// TODO: create a C++ compatible deleting destructor (call out to `operator delete`)
// for the moment, we'll call the non-deleting destructor and leak
cldec.vtbl[cldec.cppDtorVtblIndex + 1] = cldec.dtor;
}
}
if (auto f = hasIdentityOpAssign(cldec, sc2))
{
if (!(f.storage_class & STC.disable))
cldec.error(f.loc, "identity assignment operator overload is illegal");
}
cldec.inv = buildInv(cldec, sc2);
if (cldec.inv)
reinforceInvariant(cldec, sc2);
Module.dprogress++;
cldec.semanticRun = PASS.semanticdone;
//printf("-ClassDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
sc2.pop();
/* isAbstract() is undecidable in some cases because of circular dependencies.
* Now that semantic is finished, get a definitive result, and error if it is not the same.
*/
if (cldec.isabstract != Abstract.fwdref) // if evaluated it before completion
{
const isabstractsave = cldec.isabstract;
cldec.isabstract = Abstract.fwdref;
cldec.isAbstract(); // recalculate
if (cldec.isabstract != isabstractsave)
{
cldec.error("cannot infer `abstract` attribute due to circular dependencies");
}
}
if (cldec.type.ty == Tclass && (cast(TypeClass)cldec.type).sym != cldec)
{
// https://issues.dlang.org/show_bug.cgi?id=17492
ClassDeclaration cd = (cast(TypeClass)cldec.type).sym;
version (none)
{
printf("this = %p %s\n", cldec, cldec.toPrettyChars());
printf("type = %d sym = %p, %s\n", cldec.type.ty, cd, cd.toPrettyChars());
}
cldec.error("already exists at %s. Perhaps in another function with the same name?", cd.loc.toChars());
}
if (global.errors != errors)
{
// The type is no good.
cldec.type = Type.terror;
cldec.errors = true;
if (cldec.deferred)
cldec.deferred.errors = true;
}
// Verify fields of a synchronized class are not public
if (cldec.storage_class & STC.synchronized_)
{
foreach (vd; cldec.fields)
{
if (!vd.isThisDeclaration() &&
!vd.prot().isMoreRestrictiveThan(Prot(Prot.Kind.public_)))
{
vd.error("Field members of a `synchronized` class cannot be `%s`",
protectionToChars(vd.prot().kind));
}
}
}
if (cldec.deferred && !global.gag)
{
cldec.deferred.semantic2(sc);
cldec.deferred.semantic3(sc);
}
//printf("-ClassDeclaration.dsymbolSemantic(%s), type = %p, sizeok = %d, this = %p\n", toChars(), type, sizeok, this);
// @@@DEPRECATED@@@ https://dlang.org/deprecate.html#scope%20as%20a%20type%20constraint
// Deprecated in 2.087
// Make an error in 2.091
// Don't forget to remove code at https://github.com/dlang/dmd/blob/b2f8274ba76358607fc3297a1e9f361480f9bcf9/src/dmd/dsymbolsem.d#L1032-L1036
if (0 && // deprecation disabled for now to accommodate existing extensive use
cldec.storage_class & STC.scope_)
deprecation(cldec.loc, "`scope` as a type constraint is deprecated. Use `scope` at the usage site.");
checkInterfaceImplementations(cldec);
}
override void visit(InterfaceDeclaration idec)
{
/// Returns: `true` is this is an anonymous Objective-C metaclass
static bool isAnonymousMetaclass(InterfaceDeclaration idec)
{
return idec.classKind == ClassKind.objc &&
idec.objc.isMeta &&
idec.isAnonymous;
}
//printf("InterfaceDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
if (idec.semanticRun >= PASS.semanticdone)
return;
int errors = global.errors;
//printf("+InterfaceDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
Scope* scx = null;
if (idec._scope)
{
sc = idec._scope;
scx = idec._scope; // save so we don't make redundant copies
idec._scope = null;
}
if (!idec.parent)
{
assert(sc.parent && sc.func);
idec.parent = sc.parent;
}
// Objective-C metaclasses are anonymous
assert(idec.parent && !idec.isAnonymous || isAnonymousMetaclass(idec));
if (idec.errors)
idec.type = Type.terror;
idec.type = idec.type.typeSemantic(idec.loc, sc);
if (idec.type.ty == Tclass && (cast(TypeClass)idec.type).sym != idec)
{
auto ti = (cast(TypeClass)idec.type).sym.isInstantiated();
if (ti && isError(ti))
(cast(TypeClass)idec.type).sym = idec;
}
// Ungag errors when not speculative
Ungag ungag = idec.ungagSpeculative();
if (idec.semanticRun == PASS.init)
{
idec.protection = sc.protection;
idec.storage_class |= sc.stc;
idec.userAttribDecl = sc.userAttribDecl;
}
else if (idec.symtab)
{
if (idec.sizeok == Sizeok.done || !scx)
{
idec.semanticRun = PASS.semanticdone;
return;
}
}
idec.semanticRun = PASS.semantic;
if (idec.baseok < Baseok.done)
{
T resolveBase(T)(lazy T exp)
{
if (!scx)
{
scx = sc.copy();
scx.setNoFree();
}
static if (!is(T == void))
{
idec._scope = scx;
auto r = exp();
idec._scope = null;
return r;
}
else
{
idec._scope = scx;
exp();
idec._scope = null;
}
}
idec.baseok = Baseok.start;
// Expand any tuples in baseclasses[]
for (size_t i = 0; i < idec.baseclasses.dim;)
{
auto b = (*idec.baseclasses)[i];
b.type = resolveBase(b.type.typeSemantic(idec.loc, sc));
Type tb = b.type.toBasetype();
if (auto tup = tb.isTypeTuple())
{
idec.baseclasses.remove(i);
size_t dim = Parameter.dim(tup.arguments);
for (size_t j = 0; j < dim; j++)
{
Parameter arg = Parameter.getNth(tup.arguments, j);
b = new BaseClass(arg.type);
idec.baseclasses.insert(i + j, b);
}
}
else
i++;
}
if (idec.baseok >= Baseok.done)
{
//printf("%s already semantic analyzed, semanticRun = %d\n", toChars(), semanticRun);
if (idec.semanticRun >= PASS.semanticdone)
return;
goto Lancestorsdone;
}
if (!idec.baseclasses.dim && sc.linkage == LINK.cpp)
idec.classKind = ClassKind.cpp;
idec.cppnamespace = sc.namespace;
UserAttributeDeclaration.checkGNUABITag(idec, sc.linkage);
if (sc.linkage == LINK.objc)
{
objc.setObjc(idec);
objc.deprecate(idec);
}
// Check for errors, handle forward references
BCLoop:
for (size_t i = 0; i < idec.baseclasses.dim;)
{
BaseClass* b = (*idec.baseclasses)[i];
Type tb = b.type.toBasetype();
TypeClass tc = (tb.ty == Tclass) ? cast(TypeClass)tb : null;
if (!tc || !tc.sym.isInterfaceDeclaration())
{
if (b.type != Type.terror)
idec.error("base type must be `interface`, not `%s`", b.type.toChars());
idec.baseclasses.remove(i);
continue;
}
// Check for duplicate interfaces
for (size_t j = 0; j < i; j++)
{
BaseClass* b2 = (*idec.baseclasses)[j];
if (b2.sym == tc.sym)
{
idec.error("inherits from duplicate interface `%s`", b2.sym.toChars());
idec.baseclasses.remove(i);
continue BCLoop;
}
}
if (tc.sym == idec || idec.isBaseOf2(tc.sym))
{
idec.error("circular inheritance of interface");
idec.baseclasses.remove(i);
continue;
}
if (tc.sym.isDeprecated())
{
if (!idec.isDeprecated())
{
// Deriving from deprecated interface makes this one deprecated too
idec.setDeprecated();
tc.checkDeprecated(idec.loc, sc);
}
}
b.sym = tc.sym;
if (tc.sym.baseok < Baseok.done)
resolveBase(tc.sym.dsymbolSemantic(null)); // Try to resolve forward reference
if (tc.sym.baseok < Baseok.done)
{
//printf("\ttry later, forward reference of base %s\n", tc.sym.toChars());
if (tc.sym._scope)
Module.addDeferredSemantic(tc.sym);
idec.baseok = Baseok.none;
}
i++;
}
if (idec.baseok == Baseok.none)
{
// Forward referencee of one or more bases, try again later
return deferDsymbolSemantic(idec, scx);
}
idec.baseok = Baseok.done;
idec.interfaces = idec.baseclasses.tdata()[0 .. idec.baseclasses.dim];
foreach (b; idec.interfaces)
{
// If this is an interface, and it derives from a COM interface,
// then this is a COM interface too.
if (b.sym.isCOMinterface())
idec.com = true;
if (b.sym.isCPPinterface())
idec.classKind = ClassKind.cpp;
}
interfaceSemantic(idec);
}
Lancestorsdone:
if (!idec.members) // if opaque declaration
{
idec.semanticRun = PASS.semanticdone;
return;
}
if (!idec.symtab)
idec.symtab = new DsymbolTable();
for (size_t i = 0; i < idec.baseclasses.dim; i++)
{
BaseClass* b = (*idec.baseclasses)[i];
Type tb = b.type.toBasetype();
TypeClass tc = tb.isTypeClass();
if (tc.sym.semanticRun < PASS.semanticdone)
{
// Forward referencee of one or more bases, try again later
if (tc.sym._scope)
Module.addDeferredSemantic(tc.sym);
return deferDsymbolSemantic(idec, scx);
}
}
if (idec.baseok == Baseok.done)
{
idec.baseok = Baseok.semanticdone;
objc.setMetaclass(idec, sc);
// initialize vtbl
if (idec.vtblOffset())
idec.vtbl.push(idec); // leave room at vtbl[0] for classinfo
// Cat together the vtbl[]'s from base interfaces
foreach (i, b; idec.interfaces)
{
// Skip if b has already appeared
for (size_t k = 0; k < i; k++)
{
if (b == idec.interfaces[k])
goto Lcontinue;
}
// Copy vtbl[] from base class
if (b.sym.vtblOffset())
{
size_t d = b.sym.vtbl.dim;
if (d > 1)
{
idec.vtbl.pushSlice(b.sym.vtbl[1 .. d]);
}
}
else
{
idec.vtbl.append(&b.sym.vtbl);
}
Lcontinue:
}
}
idec.members.foreachDsymbol( s => s.addMember(sc, idec) );
auto sc2 = idec.newScope(sc);
/* Set scope so if there are forward references, we still might be able to
* resolve individual members like enums.
*/
idec.members.foreachDsymbol( s => s.setScope(sc2) );
idec.members.foreachDsymbol( s => s.importAll(sc2) );
idec.members.foreachDsymbol( s => s.dsymbolSemantic(sc2) );
Module.dprogress++;
idec.semanticRun = PASS.semanticdone;
//printf("-InterfaceDeclaration.dsymbolSemantic(%s), type = %p\n", toChars(), type);
sc2.pop();
if (global.errors != errors)
{
// The type is no good.
idec.type = Type.terror;
}
version (none)
{
if (type.ty == Tclass && (cast(TypeClass)idec.type).sym != idec)
{
printf("this = %p %s\n", idec, idec.toChars());
printf("type = %d sym = %p\n", idec.type.ty, (cast(TypeClass)idec.type).sym);
}
}
assert(idec.type.ty != Tclass || (cast(TypeClass)idec.type).sym == idec);
// @@@DEPRECATED@@@https://dlang.org/deprecate.html#scope%20as%20a%20type%20constraint
// Deprecated in 2.087
// Remove in 2.091
// Don't forget to remove code at https://github.com/dlang/dmd/blob/b2f8274ba76358607fc3297a1e9f361480f9bcf9/src/dmd/dsymbolsem.d#L1032-L1036
if (idec.storage_class & STC.scope_)
deprecation(idec.loc, "`scope` as a type constraint is deprecated. Use `scope` at the usage site.");
}
}
void templateInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions* fargs)
{
//printf("[%s] TemplateInstance.dsymbolSemantic('%s', this=%p, gag = %d, sc = %p)\n", tempinst.loc.toChars(), tempinst.toChars(), tempinst, global.gag, sc);
version (none)
{
for (Dsymbol s = tempinst; s; s = s.parent)
{
printf("\t%s\n", s.toChars());
}
printf("Scope\n");
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
printf("\t%s parent %s\n", scx._module ? scx._module.toChars() : "null", scx.parent ? scx.parent.toChars() : "null");
}
}
static if (LOG)
{
printf("\n+TemplateInstance.dsymbolSemantic('%s', this=%p)\n", tempinst.toChars(), tempinst);
}
if (tempinst.inst) // if semantic() was already run
{
static if (LOG)
{
printf("-TemplateInstance.dsymbolSemantic('%s', this=%p) already run\n",
tempinst.inst.toChars(), tempinst.inst);
}
return;
}
if (tempinst.semanticRun != PASS.init)
{
static if (LOG)
{
printf("Recursive template expansion\n");
}
auto ungag = Ungag(global.gag);
if (!tempinst.gagged)
global.gag = 0;
tempinst.error(tempinst.loc, "recursive template expansion");
if (tempinst.gagged)
tempinst.semanticRun = PASS.init;
else
tempinst.inst = tempinst;
tempinst.errors = true;
return;
}
// Get the enclosing template instance from the scope tinst
tempinst.tinst = sc.tinst;
// Get the instantiating module from the scope minst
tempinst.minst = sc.minst;
// https://issues.dlang.org/show_bug.cgi?id=10920
// If the enclosing function is non-root symbol,
// this instance should be speculative.
if (!tempinst.tinst && sc.func && sc.func.inNonRoot())
{
tempinst.minst = null;
}
tempinst.gagged = (global.gag > 0);
tempinst.semanticRun = PASS.semantic;
static if (LOG)
{
printf("\tdo semantic\n");
}
/* Find template declaration first,
* then run semantic on each argument (place results in tiargs[]),
* last find most specialized template from overload list/set.
*/
if (!tempinst.findTempDecl(sc, null) || !tempinst.semanticTiargs(sc) || !tempinst.findBestMatch(sc, fargs))
{
Lerror:
if (tempinst.gagged)
{
// https://issues.dlang.org/show_bug.cgi?id=13220
// Roll back status for later semantic re-running
tempinst.semanticRun = PASS.init;
}
else
tempinst.inst = tempinst;
tempinst.errors = true;
return;
}
TemplateDeclaration tempdecl = tempinst.tempdecl.isTemplateDeclaration();
assert(tempdecl);
TemplateStats.incInstance(tempdecl, tempinst);
tempdecl.checkDeprecated(tempinst.loc, sc);
// If tempdecl is a mixin, disallow it
if (tempdecl.ismixin)
{
tempinst.error("mixin templates are not regular templates");
goto Lerror;
}
tempinst.hasNestedArgs(tempinst.tiargs, tempdecl.isstatic);
if (tempinst.errors)
goto Lerror;
// Copy the tempdecl namespace (not the scope one)
tempinst.cppnamespace = tempdecl.cppnamespace;
if (tempinst.cppnamespace)
tempinst.cppnamespace.dsymbolSemantic(sc);
/* Greatly simplified semantic processing for AliasSeq templates
*/
if (tempdecl.isTrivialAliasSeq)
{
tempinst.inst = tempinst;
return aliasSeqInstanceSemantic(tempinst, sc, fargs, tempdecl);
}
/* Greatly simplified semantic processing for Alias templates
*/
else if (tempdecl.isTrivialAlias)
{
tempinst.inst = tempinst;
return aliasInstanceSemantic(tempinst, sc, fargs, tempdecl);
}
/* See if there is an existing TemplateInstantiation that already
* implements the typeargs. If so, just refer to that one instead.
*/
tempinst.inst = tempdecl.findExistingInstance(tempinst, fargs);
TemplateInstance errinst = null;
if (!tempinst.inst)
{
// So, we need to implement 'this' instance.
}
else if (tempinst.inst.gagged && !tempinst.gagged && tempinst.inst.errors)
{
// If the first instantiation had failed, re-run semantic,
// so that error messages are shown.
errinst = tempinst.inst;
}
else
{
// It's a match
tempinst.parent = tempinst.inst.parent;
tempinst.errors = tempinst.inst.errors;
// If both this and the previous instantiation were gagged,
// use the number of errors that happened last time.
global.errors += tempinst.errors;
global.gaggedErrors += tempinst.errors;
// If the first instantiation was gagged, but this is not:
if (tempinst.inst.gagged)
{
// It had succeeded, mark it is a non-gagged instantiation,
// and reuse it.
tempinst.inst.gagged = tempinst.gagged;
}
tempinst.tnext = tempinst.inst.tnext;
tempinst.inst.tnext = tempinst;
/* A module can have explicit template instance and its alias
* in module scope (e,g, `alias Base64 = Base64Impl!('+', '/');`).
* If the first instantiation 'inst' had happened in non-root module,
* compiler can assume that its instantiated code would be included
* in the separately compiled obj/lib file (e.g. phobos.lib).
*
* However, if 'this' second instantiation happened in root module,
* compiler might need to invoke its codegen
* (https://issues.dlang.org/show_bug.cgi?id=2500 & https://issues.dlang.org/show_bug.cgi?id=2644).
* But whole import graph is not determined until all semantic pass finished,
* so 'inst' should conservatively finish the semantic3 pass for the codegen.
*/
if (tempinst.minst && tempinst.minst.isRoot() && !(tempinst.inst.minst && tempinst.inst.minst.isRoot()))
{
/* Swap the position of 'inst' and 'this' in the instantiation graph.
* Then, the primary instance `inst` will be changed to a root instance.
*
* Before:
* non-root -> A!() -> B!()[inst] -> C!()
* |
* root -> D!() -> B!()[this]
*
* After:
* non-root -> A!() -> B!()[this]
* |
* root -> D!() -> B!()[inst] -> C!()
*/
Module mi = tempinst.minst;
TemplateInstance ti = tempinst.tinst;
tempinst.minst = tempinst.inst.minst;
tempinst.tinst = tempinst.inst.tinst;
tempinst.inst.minst = mi;
tempinst.inst.tinst = ti;
if (tempinst.minst) // if inst was not speculative
{
/* Add 'inst' once again to the root module members[], then the
* instance members will get codegen chances.
*/
tempinst.inst.appendToModuleMember();
}
}
// modules imported by an existing instance should be added to the module
// that instantiates the instance.
if (tempinst.minst)
foreach(imp; tempinst.inst.importedModules)
if (!tempinst.minst.aimports.contains(imp))
tempinst.minst.aimports.push(imp);
static if (LOG)
{
printf("\tit's a match with instance %p, %d\n", tempinst.inst, tempinst.inst.semanticRun);
}
return;
}
static if (LOG)
{
printf("\timplement template instance %s '%s'\n", tempdecl.parent.toChars(), tempinst.toChars());
printf("\ttempdecl %s\n", tempdecl.toChars());
}
uint errorsave = global.errors;
tempinst.inst = tempinst;
tempinst.parent = tempinst.enclosing ? tempinst.enclosing : tempdecl.parent;
//printf("parent = '%s'\n", parent.kind());
TemplateStats.incUnique(tempdecl, tempinst);
TemplateInstance tempdecl_instance_idx = tempdecl.addInstance(tempinst);
//getIdent();
// Store the place we added it to in target_symbol_list(_idx) so we can
// remove it later if we encounter an error.
Dsymbols* target_symbol_list = tempinst.appendToModuleMember();
size_t target_symbol_list_idx = target_symbol_list ? target_symbol_list.dim - 1 : 0;
// Copy the syntax trees from the TemplateDeclaration
tempinst.members = Dsymbol.arraySyntaxCopy(tempdecl.members);
// resolve TemplateThisParameter
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
if ((*tempdecl.parameters)[i].isTemplateThisParameter() is null)
continue;
Type t = isType((*tempinst.tiargs)[i]);
assert(t);
if (StorageClass stc = ModToStc(t.mod))
{
//printf("t = %s, stc = x%llx\n", t.toChars(), stc);
auto s = new Dsymbols();
s.push(new StorageClassDeclaration(stc, tempinst.members));
tempinst.members = s;
}
break;
}
// Create our own scope for the template parameters
Scope* _scope = tempdecl._scope;
if (tempdecl.semanticRun == PASS.init)
{
tempinst.error("template instantiation `%s` forward references template declaration `%s`", tempinst.toChars(), tempdecl.toChars());
return;
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", tempinst.toChars());
}
tempinst.argsym = new ScopeDsymbol();
tempinst.argsym.parent = _scope.parent;
_scope = _scope.push(tempinst.argsym);
_scope.tinst = tempinst;
_scope.minst = tempinst.minst;
//scope.stc = 0;
// Declare each template parameter as an alias for the argument type
Scope* paramscope = _scope.push();
paramscope.stc = 0;
paramscope.protection = Prot(Prot.Kind.public_); // https://issues.dlang.org/show_bug.cgi?id=14169
// template parameters should be public
tempinst.declareParameters(paramscope);
paramscope.pop();
// Add members of template instance to template instance symbol table
//parent = scope.scopesym;
tempinst.symtab = new DsymbolTable();
tempinst.members.foreachDsymbol( (s)
{
static if (LOG)
{
printf("\t adding member '%s' %p kind %s to '%s'\n", s.toChars(), s, s.kind(), tempinst.toChars());
}
s.addMember(_scope, tempinst);
});
static if (LOG)
{
printf("adding members done\n");
}
/* See if there is only one member of template instance, and that
* member has the same name as the template instance.
* If so, this template instance becomes an alias for that member.
*/
//printf("members.dim = %d\n", tempinst.members.dim);
if (tempinst.members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(tempinst.members, &s, tempdecl.ident) && s)
{
//printf("tempdecl.ident = %s, s = '%s'\n", tempdecl.ident.toChars(), s.kind(), s.toPrettyChars());
//printf("setting aliasdecl\n");
tempinst.aliasdecl = s;
}
}
/* If function template declaration
*/
if (fargs && tempinst.aliasdecl)
{
if (auto fd = tempinst.aliasdecl.isFuncDeclaration())
{
/* Transmit fargs to type so that TypeFunction.dsymbolSemantic() can
* resolve any "auto ref" storage classes.
*/
if (fd.type)
if (auto tf = fd.type.isTypeFunction())
tf.fargs = fargs;
}
}
// Do semantic() analysis on template instance members
static if (LOG)
{
printf("\tdo semantic() on template instance members '%s'\n", tempinst.toChars());
}
Scope* sc2;
sc2 = _scope.push(tempinst);
//printf("enclosing = %d, sc.parent = %s\n", tempinst.enclosing, sc.parent.toChars());
sc2.parent = tempinst;
sc2.tinst = tempinst;
sc2.minst = tempinst.minst;
sc2.stc &= ~STC.deprecated_;
tempinst.tryExpandMembers(sc2);
tempinst.semanticRun = PASS.semanticdone;
/* ConditionalDeclaration may introduce eponymous declaration,
* so we should find it once again after semantic.
*/
if (tempinst.members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(tempinst.members, &s, tempdecl.ident) && s)
{
if (!tempinst.aliasdecl || tempinst.aliasdecl != s)
{
//printf("tempdecl.ident = %s, s = '%s'\n", tempdecl.ident.toChars(), s.kind(), s.toPrettyChars());
//printf("setting aliasdecl 2\n");
tempinst.aliasdecl = s;
}
}
}
if (global.errors != errorsave)
goto Laftersemantic;
/* If any of the instantiation members didn't get semantic() run
* on them due to forward references, we cannot run semantic2()
* or semantic3() yet.
*/
{
bool found_deferred_ad = false;
for (size_t i = 0; i < Module.deferred.dim; i++)
{
Dsymbol sd = Module.deferred[i];
AggregateDeclaration ad = sd.isAggregateDeclaration();
if (ad && ad.parent && ad.parent.isTemplateInstance())
{
//printf("deferred template aggregate: %s %s\n",
// sd.parent.toChars(), sd.toChars());
found_deferred_ad = true;
if (ad.parent == tempinst)
{
ad.deferred = tempinst;
break;
}
}
}
if (found_deferred_ad || Module.deferred.dim)
goto Laftersemantic;
}
/* The problem is when to parse the initializer for a variable.
* Perhaps VarDeclaration.dsymbolSemantic() should do it like it does
* for initializers inside a function.
*/
//if (sc.parent.isFuncDeclaration())
{
/* https://issues.dlang.org/show_bug.cgi?id=782
* this has problems if the classes this depends on
* are forward referenced. Find a way to defer semantic()
* on this template.
*/
tempinst.semantic2(sc2);
}
if (global.errors != errorsave)
goto Laftersemantic;
if ((sc.func || (sc.flags & SCOPE.fullinst)) && !tempinst.tinst)
{
/* If a template is instantiated inside function, the whole instantiation
* should be done at that position. But, immediate running semantic3 of
* dependent templates may cause unresolved forward reference.
* https://issues.dlang.org/show_bug.cgi?id=9050
* To avoid the issue, don't run semantic3 until semantic and semantic2 done.
*/
TemplateInstances deferred;
tempinst.deferred = &deferred;
//printf("Run semantic3 on %s\n", toChars());
tempinst.trySemantic3(sc2);
for (size_t i = 0; i < deferred.dim; i++)
{
//printf("+ run deferred semantic3 on %s\n", deferred[i].toChars());
deferred[i].semantic3(null);
}
tempinst.deferred = null;
}
else if (tempinst.tinst)
{
bool doSemantic3 = false;
FuncDeclaration fd;
if (tempinst.aliasdecl)
fd = tempinst.aliasdecl.toAlias2().isFuncDeclaration();
if (fd)
{
/* Template function instantiation should run semantic3 immediately
* for attribute inference.
*/
scope fld = fd.isFuncLiteralDeclaration();
if (fld && fld.tok == TOK.reserved)
doSemantic3 = true;
else if (sc.func)
doSemantic3 = true;
}
else if (sc.func)
{
/* A lambda function in template arguments might capture the
* instantiated scope context. For the correct context inference,
* all instantiated functions should run the semantic3 immediately.
* See also compilable/test14973.d
*/
foreach (oarg; tempinst.tdtypes)
{
auto s = getDsymbol(oarg);
if (!s)
continue;
if (auto td = s.isTemplateDeclaration())
{
if (!td.literal)
continue;
assert(td.members && td.members.dim == 1);
s = (*td.members)[0];
}
if (auto fld = s.isFuncLiteralDeclaration())
{
if (fld.tok == TOK.reserved)
{
doSemantic3 = true;
break;
}
}
}
//printf("[%s] %s doSemantic3 = %d\n", tempinst.tinst.loc.toChars(), tempinst.tinst.toChars(), doSemantic3);
}
if (doSemantic3)
tempinst.trySemantic3(sc2);
TemplateInstance ti = tempinst.tinst;
int nest = 0;
while (ti && !ti.deferred && ti.tinst)
{
ti = ti.tinst;
if (++nest > global.recursionLimit)
{
global.gag = 0; // ensure error message gets printed
tempinst.error("recursive expansion");
fatal();
}
}
if (ti && ti.deferred)
{
//printf("deferred semantic3 of %p %s, ti = %s, ti.deferred = %p\n", this, toChars(), ti.toChars());
for (size_t i = 0;; i++)
{
if (i == ti.deferred.dim)
{
ti.deferred.push(tempinst);
break;
}
if ((*ti.deferred)[i] == tempinst)
break;
}
}
}
if (tempinst.aliasdecl)
{
/* https://issues.dlang.org/show_bug.cgi?id=13816
* AliasDeclaration tries to resolve forward reference
* twice (See inuse check in AliasDeclaration.toAlias()). It's
* necessary to resolve mutual references of instantiated symbols, but
* it will left a true recursive alias in tuple declaration - an
* AliasDeclaration A refers TupleDeclaration B, and B contains A
* in its elements. To correctly make it an error, we strictly need to
* resolve the alias of eponymous member.
*/
tempinst.aliasdecl = tempinst.aliasdecl.toAlias2();
}
Laftersemantic:
sc2.pop();
_scope.pop();
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
if (!tempinst.errors)
{
if (!tempdecl.literal)
tempinst.error(tempinst.loc, "error instantiating");
if (tempinst.tinst)
tempinst.tinst.printInstantiationTrace();
}
tempinst.errors = true;
if (tempinst.gagged)
{
// Errors are gagged, so remove the template instance from the
// instance/symbol lists we added it to and reset our state to
// finish clean and so we can try to instantiate it again later
// (see https://issues.dlang.org/show_bug.cgi?id=4302 and https://issues.dlang.org/show_bug.cgi?id=6602).
tempdecl.removeInstance(tempdecl_instance_idx);
if (target_symbol_list)
{
// Because we added 'this' in the last position above, we
// should be able to remove it without messing other indices up.
assert((*target_symbol_list)[target_symbol_list_idx] == tempinst);
target_symbol_list.remove(target_symbol_list_idx);
tempinst.memberOf = null; // no longer a member
}
tempinst.semanticRun = PASS.init;
tempinst.inst = null;
tempinst.symtab = null;
}
}
else if (errinst)
{
/* https://issues.dlang.org/show_bug.cgi?id=14541
* If the previous gagged instance had failed by
* circular references, currrent "error reproduction instantiation"
* might succeed, because of the difference of instantiated context.
* On such case, the cached error instance needs to be overridden by the
* succeeded instance.
*/
//printf("replaceInstance()\n");
assert(errinst.errors);
auto ti1 = TemplateInstanceBox(errinst);
tempdecl.instances.remove(ti1);
auto ti2 = TemplateInstanceBox(tempinst);
tempdecl.instances[ti2] = tempinst;
}
static if (LOG)
{
printf("-TemplateInstance.dsymbolSemantic('%s', this=%p)\n", tempinst.toChars(), tempinst);
}
}
/******************************************************
* Do template instance semantic for isAliasSeq templates.
* This is a greatly simplified version of templateInstanceSemantic().
*/
private
void aliasSeqInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions* fargs, TemplateDeclaration tempdecl)
{
//printf("[%s] aliasSeqInstance.dsymbolSemantic('%s')\n", tempinst.loc.toChars(), tempinst.toChars());
Scope* paramscope = sc.push();
paramscope.stc = 0;
paramscope.protection = Prot(Prot.Kind.public_);
TemplateTupleParameter ttp = (*tempdecl.parameters)[0].isTemplateTupleParameter();
Tuple va = tempinst.tdtypes[0].isTuple();
Declaration d = new TupleDeclaration(tempinst.loc, ttp.ident, &va.objects);
d.storage_class |= STC.templateparameter;
d.dsymbolSemantic(sc);
paramscope.pop();
tempinst.aliasdecl = d;
tempinst.semanticRun = PASS.semanticdone;
}
/******************************************************
* Do template instance semantic for isAlias templates.
* This is a greatly simplified version of templateInstanceSemantic().
*/
private
void aliasInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions* fargs, TemplateDeclaration tempdecl)
{
//printf("[%s] aliasInstance.dsymbolSemantic('%s')\n", tempinst.loc.toChars(), tempinst.toChars());
Scope* paramscope = sc.push();
paramscope.stc = 0;
paramscope.protection = Prot(Prot.Kind.public_);
TemplateTypeParameter ttp = (*tempdecl.parameters)[0].isTemplateTypeParameter();
Type ta = tempinst.tdtypes[0].isType();
Declaration d = new AliasDeclaration(tempinst.loc, ttp.ident, ta.addMod(tempdecl.onemember.isAliasDeclaration.type.mod));
d.storage_class |= STC.templateparameter;
d.dsymbolSemantic(sc);
paramscope.pop();
tempinst.aliasdecl = d;
tempinst.semanticRun = PASS.semanticdone;
}
// function used to perform semantic on AliasDeclaration
void aliasSemantic(AliasDeclaration ds, Scope* sc)
{
//printf("AliasDeclaration::semantic() %s\n", ds.toChars());
// as DsymbolSemanticVisitor::visit(AliasDeclaration), in case we're called first.
// see https://issues.dlang.org/show_bug.cgi?id=21001
ds.storage_class |= sc.stc & STC.deprecated_;
ds.protection = sc.protection;
ds.userAttribDecl = sc.userAttribDecl;
// TypeTraits needs to know if it's located in an AliasDeclaration
const oldflags = sc.flags;
sc.flags |= SCOPE.alias_;
scope(exit)
sc.flags = oldflags;
// preserve the original type
if (!ds.originalType && ds.type)
ds.originalType = ds.type.syntaxCopy();
if (ds.aliassym)
{
auto fd = ds.aliassym.isFuncLiteralDeclaration();
auto td = ds.aliassym.isTemplateDeclaration();
if (fd || td && td.literal)
{
if (fd && fd.semanticRun >= PASS.semanticdone)
return;
Expression e = new FuncExp(ds.loc, ds.aliassym);
e = e.expressionSemantic(sc);
if (e.op == TOK.function_)
{
FuncExp fe = cast(FuncExp)e;
ds.aliassym = fe.td ? cast(Dsymbol)fe.td : fe.fd;
}
else
{
ds.aliassym = null;
ds.type = Type.terror;
}
return;
}
if (ds.aliassym.isTemplateInstance())
ds.aliassym.dsymbolSemantic(sc);
return;
}
ds.inuse = 1;
// Given:
// alias foo.bar.abc def;
// it is not knowable from the syntax whether this is an alias
// for a type or an alias for a symbol. It is up to the semantic()
// pass to distinguish.
// If it is a type, then type is set and getType() will return that
// type. If it is a symbol, then aliassym is set and type is NULL -
// toAlias() will return aliasssym.
uint errors = global.errors;
Type oldtype = ds.type;
// Ungag errors when not instantiated DeclDefs scope alias
auto ungag = Ungag(global.gag);
//printf("%s parent = %s, gag = %d, instantiated = %d\n", toChars(), parent, global.gag, isInstantiated());
if (ds.parent && global.gag && !ds.isInstantiated() && !ds.toParent2().isFuncDeclaration())
{
//printf("%s type = %s\n", toPrettyChars(), type.toChars());
global.gag = 0;
}
// https://issues.dlang.org/show_bug.cgi?id=18480
// Detect `alias sym = sym;` to prevent creating loops in overload overnext lists.
// Selective imports are allowed to alias to the same name `import mod : sym=sym`.
if (ds.type.ty == Tident && !ds._import)
{
auto tident = cast(TypeIdentifier)ds.type;
if (tident.ident is ds.ident && !tident.idents.dim)
{
error(ds.loc, "`alias %s = %s;` cannot alias itself, use a qualified name to create an overload set",
ds.ident.toChars(), tident.ident.toChars());
ds.type = Type.terror;
}
}
/* This section is needed because Type.resolve() will:
* const x = 3;
* alias y = x;
* try to convert identifier x to 3.
*/
auto s = ds.type.toDsymbol(sc);
if (errors != global.errors)
{
s = null;
ds.type = Type.terror;
}
if (s && s == ds)
{
ds.error("cannot resolve");
s = null;
ds.type = Type.terror;
}
if (!s || !s.isEnumMember())
{
Type t;
Expression e;
Scope* sc2 = sc;
if (ds.storage_class & (STC.ref_ | STC.nothrow_ | STC.nogc | STC.pure_ | STC.disable))
{
// For 'ref' to be attached to function types, and picked
// up by Type.resolve(), it has to go into sc.
sc2 = sc.push();
sc2.stc |= ds.storage_class & (STC.ref_ | STC.nothrow_ | STC.nogc | STC.pure_ | STC.shared_ | STC.disable);
}
ds.type = ds.type.addSTC(ds.storage_class);
ds.type.resolve(ds.loc, sc2, &e, &t, &s);
if (sc2 != sc)
sc2.pop();
if (e) // Try to convert Expression to Dsymbol
{
s = getDsymbol(e);
if (!s)
{
if (e.op != TOK.error)
ds.error("cannot alias an expression `%s`", e.toChars());
t = Type.terror;
}
}
ds.type = t;
}
if (s == ds)
{
assert(global.errors);
ds.type = Type.terror;
s = null;
}
if (!s) // it's a type alias
{
//printf("alias %s resolved to type %s\n", toChars(), type.toChars());
ds.type = ds.type.typeSemantic(ds.loc, sc);
ds.aliassym = null;
}
else // it's a symbolic alias
{
//printf("alias %s resolved to %s %s\n", toChars(), s.kind(), s.toChars());
ds.type = null;
ds.aliassym = s;
}
if (global.gag && errors != global.errors)
{
ds.type = Type.terror;
ds.aliassym = null;
}
ds.inuse = 0;
ds.semanticRun = PASS.semanticdone;
if (auto sx = ds.overnext)
{
ds.overnext = null;
if (!ds.overloadInsert(sx))
ScopeDsymbol.multiplyDefined(Loc.initial, sx, ds);
}
}
|
D
|
/**
libevent based driver
Copyright: © 2012-2013 RejectedSoftware e.K.
Authors: Sönke Ludwig
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
*/
module vibe.core.drivers.libevent2;
version(VibeLibeventDriver)
{
import vibe.core.driver;
import vibe.core.drivers.libevent2_tcp;
import vibe.core.drivers.threadedfile;
import vibe.core.drivers.utils;
import vibe.core.log;
import vibe.utils.array : ArraySet;
import vibe.utils.hashmap;
import vibe.utils.memory;
import core.memory;
import core.atomic;
import core.stdc.config;
import core.stdc.errno;
import core.stdc.stdlib;
import core.sync.condition;
import core.sync.mutex;
import core.sync.rwmutex;
import core.sys.posix.netinet.in_;
import core.sys.posix.netinet.tcp;
import core.thread;
import deimos.event2.bufferevent;
import deimos.event2.dns;
import deimos.event2.event;
import deimos.event2.thread;
import deimos.event2.util;
import std.conv;
import std.encoding : sanitize;
import std.exception;
import std.string;
version (Windows)
{
version(VibePragmaLib) pragma(lib, "event2");
pragma(lib, "ws2_32.lib");
}
else
version(VibePragmaLib) pragma(lib, "event");
version(Windows)
{
import std.c.windows.winsock;
alias WSAEWOULDBLOCK EWOULDBLOCK;
}
class Libevent2Driver : EventDriver {
import std.container : Array, BinaryHeap, heapify;
import std.datetime : Clock;
private {
DriverCore m_core;
event_base* m_eventLoop;
evdns_base* m_dnsBase;
bool m_exit = false;
ArraySet!size_t m_ownedObjects;
debug Thread m_ownerThread;
event* m_timerEvent;
int m_timerIDCounter = 1;
HashMap!(size_t, TimerInfo) m_timers;
Array!TimeoutEntry m_timeoutHeapStore;
BinaryHeap!(Array!TimeoutEntry, "a.timeout > b.timeout") m_timeoutHeap;
}
this(DriverCore core)
{
debug m_ownerThread = Thread.getThis();
m_core = core;
s_driverCore = core;
if (!s_threadObjectsMutex) s_threadObjectsMutex = new Mutex;
// set the malloc/free versions of our runtime so we don't run into trouble
// because the libevent DLL uses a different one.
event_set_mem_functions(&lev_alloc, &lev_realloc, &lev_free);
evthread_lock_callbacks lcb;
lcb.lock_api_version = EVTHREAD_LOCK_API_VERSION;
lcb.supported_locktypes = EVTHREAD_LOCKTYPE_RECURSIVE|EVTHREAD_LOCKTYPE_READWRITE;
lcb.alloc = &lev_alloc_mutex;
lcb.free = &lev_free_mutex;
lcb.lock = &lev_lock_mutex;
lcb.unlock = &lev_unlock_mutex;
evthread_set_lock_callbacks(&lcb);
evthread_condition_callbacks ccb;
ccb.condition_api_version = EVTHREAD_CONDITION_API_VERSION;
ccb.alloc_condition = &lev_alloc_condition;
ccb.free_condition = &lev_free_condition;
ccb.signal_condition = &lev_signal_condition;
ccb.wait_condition = &lev_wait_condition;
evthread_set_condition_callbacks(&ccb);
evthread_set_id_callback(&lev_get_thread_id);
// initialize libevent
logDiagnostic("libevent version: %s", to!string(event_get_version()));
m_eventLoop = event_base_new();
s_eventLoop = m_eventLoop;
logDiagnostic("libevent is using %s for events.", to!string(event_base_get_method(m_eventLoop)));
evthread_make_base_notifiable(m_eventLoop);
m_dnsBase = evdns_base_new(m_eventLoop, 1);
if( !m_dnsBase ) logError("Failed to initialize DNS lookup.");
string hosts_file;
version (Windows) hosts_file = `C:\Windows\System32\drivers\etc\hosts`;
else hosts_file = `/etc/hosts`;
if (existsFile(hosts_file)) {
if (evdns_base_load_hosts(m_dnsBase, hosts_file.toStringz()) != 0)
logError("Failed to load hosts file at %s", hosts_file);
}
m_timerEvent = event_new(m_eventLoop, -1, EV_TIMEOUT, &onTimerTimeout, cast(void*)this);
}
~this()
{
debug assert(Thread.getThis() is m_ownerThread, "Event loop destroyed in foreign thread.");
event_free(m_timerEvent);
// notify all other living objects about the shutdown
synchronized (s_threadObjectsMutex) {
// destroy all living objects owned by this driver
foreach (ref key; m_ownedObjects) {
assert(key);
auto obj = cast(Libevent2Object)cast(void*)key;
debug assert(obj.m_ownerThread is m_ownerThread, "Owned object with foreign thread ID detected.");
debug assert(obj.m_driver is this, "Owned object with foreign driver reference detected.");
key = 0;
destroy(obj);
}
foreach (ref key; s_threadObjects) {
assert(key);
auto obj = cast(Libevent2Object)cast(void*)key;
debug assert(obj.m_ownerThread !is m_ownerThread, "Live object of this thread detected after all owned mutexes have been destroyed.");
debug assert(obj.m_driver !is this, "Live object of this driver detected with different thread ID after all owned mutexes have been destroyed.");
obj.onThreadShutdown();
}
}
// shutdown libevent for this thread
evdns_base_free(m_dnsBase, 1);
event_base_free(m_eventLoop);
s_eventLoop = null;
s_alreadyDeinitialized = true;
}
@property event_base* eventLoop() { return m_eventLoop; }
@property evdns_base* dnsEngine() { return m_dnsBase; }
int runEventLoop()
{
int ret;
m_exit = false;
while (!m_exit && (ret = event_base_loop(m_eventLoop, EVLOOP_ONCE)) == 0) {
processTimers();
s_driverCore.notifyIdle();
}
return ret;
}
int runEventLoopOnce()
{
auto ret = event_base_loop(m_eventLoop, EVLOOP_ONCE);
processTimers();
m_core.notifyIdle();
return ret;
}
bool processEvents()
{
event_base_loop(m_eventLoop, EVLOOP_NONBLOCK);
processTimers();
if (m_exit) {
m_exit = false;
return false;
}
return true;
}
void exitEventLoop()
{
m_exit = true;
enforce(event_base_loopbreak(m_eventLoop) == 0, "Failed to exit libevent event loop.");
}
FileStream openFile(Path path, FileMode mode)
{
return new ThreadedFileStream(path, mode);
}
DirectoryWatcher watchDirectory(Path path, bool recursive)
{
assert(false);
}
NetworkAddress resolveHost(string host, ushort family = AF_UNSPEC, bool use_dns = true)
{
assert(m_dnsBase);
evutil_addrinfo hints;
hints.ai_family = family;
if (!use_dns) {
//When this flag is set, we only resolve numeric IPv4 and IPv6
//addresses; if the nodename would require a name lookup, we instead
//give an EVUTIL_EAI_NONAME error.
hints.ai_flags = EVUTIL_AI_NUMERICHOST;
}
logDebug("dnsresolve %s", host);
GetAddrInfoMsg msg;
msg.core = m_core;
evdns_getaddrinfo_request* dnsReq = evdns_getaddrinfo(m_dnsBase, toStringz(host), null,
&hints, &onAddrInfo, &msg);
// wait if the request couldn't be fulfilled instantly
if (!msg.done) {
msg.task = Task.getThis();
logDebug("dnsresolve yield");
while (!msg.done) m_core.yieldForEvent();
}
logDebug("dnsresolve ret");
enforce(msg.err == DNS_ERR_NONE, format("Failed to lookup host '%s': %s", host, evutil_gai_strerror(msg.err)));
return msg.addr;
}
TCPConnection connectTCP(string host, ushort port)
{
auto addr = resolveHost(host);
addr.port = port;
auto sockfd_raw = socket(addr.family, SOCK_STREAM, 0);
// on Win64 socket() returns a 64-bit value but libevent expects an int
static if (typeof(sockfd_raw).max > int.max) assert(sockfd_raw <= int.max || sockfd_raw == ~0);
auto sockfd = cast(int)sockfd_raw;
socketEnforce(sockfd != -1, "Failed to create socket.");
NetworkAddress bind_addr;
bind_addr.family = addr.family;
if (addr.family == AF_INET) bind_addr.sockAddrInet4.sin_addr.s_addr = 0;
else bind_addr.sockAddrInet6.sin6_addr.s6_addr[] = 0;
socketEnforce(bind(sockfd, bind_addr.sockAddr, bind_addr.sockAddrLen) == 0, "Failed to bind socket.");
socklen_t balen = bind_addr.sockAddrLen;
socketEnforce(getsockname(sockfd, bind_addr.sockAddr, &balen) == 0, "getsockname failed.");
if( evutil_make_socket_nonblocking(sockfd) )
throw new Exception("Failed to make socket non-blocking.");
auto buf_event = bufferevent_socket_new(m_eventLoop, sockfd, bufferevent_options.BEV_OPT_CLOSE_ON_FREE);
if( !buf_event ) throw new Exception("Failed to create buffer event for socket.");
auto cctx = TCPContextAlloc.alloc(m_core, m_eventLoop, sockfd, buf_event, bind_addr, addr);
bufferevent_setcb(buf_event, &onSocketRead, &onSocketWrite, &onSocketEvent, cctx);
if( bufferevent_enable(buf_event, EV_READ|EV_WRITE) )
throw new Exception("Error enabling buffered I/O event for socket.");
cctx.readOwner = Task.getThis();
scope(exit) cctx.readOwner = Task();
socketEnforce(bufferevent_socket_connect(buf_event, addr.sockAddr, addr.sockAddrLen) == 0,
"Failed to connect to host "~host~" on port "~to!string(port));
// TODO: cctx.remove_addr6 = ...;
try {
while (cctx.status == 0)
m_core.yieldForEvent();
} catch (Exception e) {
throw new Exception(format("Failed to connect to %s:%s: %s", host, port, e.msg));
}
logTrace("Connect result status: %d", cctx.status);
enforce(cctx.status == BEV_EVENT_CONNECTED, format("Failed to connect to host %s:%s: %s", host, port, cctx.status));
return new Libevent2TCPConnection(cctx);
}
TCPListener listenTCP(ushort port, void delegate(TCPConnection conn) connection_callback, string address, TCPListenOptions options)
{
auto bind_addr = resolveHost(address, AF_UNSPEC, false);
bind_addr.port = port;
auto listenfd_raw = socket(bind_addr.family, SOCK_STREAM, 0);
// on Win64 socket() returns a 64-bit value but libevent expects an int
static if (typeof(listenfd_raw).max > int.max) assert(listenfd_raw <= int.max || listenfd_raw == ~0);
auto listenfd = cast(int)listenfd_raw;
socketEnforce(listenfd != -1, "Error creating listening socket");
int tmp_reuse = 1;
socketEnforce(setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &tmp_reuse, tmp_reuse.sizeof) == 0,
"Error enabling socket address reuse on listening socket");
socketEnforce(bind(listenfd, bind_addr.sockAddr, bind_addr.sockAddrLen) == 0,
"Error binding listening socket");
socketEnforce(listen(listenfd, 128) == 0,
"Error listening to listening socket");
// Set socket for non-blocking I/O
enforce(evutil_make_socket_nonblocking(listenfd) == 0,
"Error setting listening socket to non-blocking I/O.");
auto ret = new LibeventTCPListener;
static void setupConnectionHandler(shared(LibeventTCPListener) listener, typeof(listenfd) listenfd, NetworkAddress bind_addr, shared(void delegate(TCPConnection conn)) connection_callback)
{
auto evloop = getThreadLibeventEventLoop();
auto core = getThreadLibeventDriverCore();
// Add an event to wait for connections
auto ctx = TCPContextAlloc.alloc(core, evloop, listenfd, null, bind_addr, NetworkAddress());
ctx.connectionCallback = cast()connection_callback;
ctx.listenEvent = event_new(evloop, listenfd, EV_READ | EV_PERSIST, &onConnect, ctx);
enforce(event_add(ctx.listenEvent, null) == 0,
"Error scheduling connection event on the event loop.");
(cast()listener).addContext(ctx);
}
// FIXME: the API needs improvement with proper shared annotations, so the the following casts are not necessary
if (options & TCPListenOptions.distribute) runWorkerTaskDist(&setupConnectionHandler, cast(shared)ret, listenfd, bind_addr, cast(shared)connection_callback);
else setupConnectionHandler(cast(shared)ret, listenfd, bind_addr, cast(shared)connection_callback);
return ret;
}
UDPConnection listenUDP(ushort port, string bind_address = "0.0.0.0")
{
NetworkAddress bindaddr = resolveHost(bind_address, AF_UNSPEC, false);
bindaddr.port = port;
return new Libevent2UDPConnection(bindaddr, this);
}
Libevent2ManualEvent createManualEvent()
{
return new Libevent2ManualEvent(this);
}
Libevent2FileDescriptorEvent createFileDescriptorEvent(int fd, FileDescriptorEvent.Trigger events)
{
return new Libevent2FileDescriptorEvent(this, fd, events);
}
size_t createTimer(void delegate() callback)
{
debug assert(m_ownerThread is Thread.getThis());
auto id = m_timerIDCounter++;
if (!id) id = m_timerIDCounter++;
m_timers[id] = TimerInfo(callback);
return id;
}
void acquireTimer(size_t timer_id) { m_timers[timer_id].refCount++; }
void releaseTimer(size_t timer_id)
{
if (!--m_timers[timer_id].refCount)
m_timers.remove(timer_id);
}
bool isTimerPending(size_t timer_id) { return m_timers[timer_id].pending; }
void rearmTimer(size_t timer_id, Duration dur, bool periodic)
{
debug assert(m_ownerThread is Thread.getThis());
auto timeout = Clock.currStdTime() + dur.total!"hnsecs";
auto pt = timer_id in m_timers;
assert(pt !is null, "Accessing non-existent timer ID.");
pt.timeout = timeout;
pt.repeatDuration = periodic ? dur.total!"hnsecs" : 0;
if (!pt.pending) {
pt.pending = true;
acquireTimer(timer_id);
}
scheduleTimer(timeout, timer_id);
}
void stopTimer(size_t timer_id)
{
logTrace("Stopping timer %s", timer_id);
auto pt = timer_id in m_timers;
if (pt.pending) {
pt.pending = false;
releaseTimer(timer_id);
}
}
void waitTimer(size_t timer_id)
{
debug assert(m_ownerThread is Thread.getThis());
while (true) {
{
auto pt = timer_id in m_timers;
if (!pt || !pt.pending) return;
assert(pt.repeatDuration == 0, "Cannot wait for a periodic timer.");
assert(pt.owner == Task.init, "Waiting for the same timer from multiple tasks is not supported.");
pt.owner = Task.getThis();
}
scope (exit) {
auto pt = timer_id in m_timers;
if (pt) pt.owner = Task.init;
}
m_core.yieldForEvent();
}
}
private void processTimers()
{
logTrace("Processing due timers");
// process all timers that have expired up to now
auto now = Clock.currStdTime();
if (m_timeoutHeap.empty) logTrace("no timers scheduled");
else logTrace("first timeout: %s", (m_timeoutHeap.front.timeout - now) * 1e-7);
while (!m_timeoutHeap.empty && (m_timeoutHeap.front.timeout - now) / 10_000 <= 0) {
auto tm = m_timeoutHeap.front.id;
m_timeoutHeap.removeFront();
auto pt = tm in m_timers;
if (!pt || !pt.pending) continue;
Task owner = pt.owner;
auto callback = pt.callback;
if (pt.repeatDuration > 0) {
pt.timeout += pt.repeatDuration;
scheduleTimer(pt.timeout, tm);
} else {
pt.pending = false;
releaseTimer(tm);
}
logTrace("Timer %s fired (%s/%s)", tm, owner != Task.init, callback !is null);
if (owner) m_core.resumeTask(owner);
if (callback) runTask(callback);
}
if (!m_timeoutHeap.empty) rescheduleTimerEvent((m_timeoutHeap.front.timeout - now).hnsecs);
}
private void scheduleTimer(long timeout, size_t id)
{
logTrace("Schedule timer %s", id);
if (m_timeoutHeap.empty || timeout < m_timeoutHeap.front.timeout) {
rescheduleTimerEvent((timeout - Clock.currStdTime()).hnsecs);
}
m_timeoutHeap.insert(TimeoutEntry(timeout, id));
}
private void rescheduleTimerEvent(Duration dur)
{
event_del(m_timerEvent);
assert(dur.total!"seconds"() <= int.max);
dur += 9.hnsecs(); // round up to the next usec to avoid premature timer eventss
timeval tvdur;
tvdur.tv_sec = cast(int)dur.total!"seconds"();
tvdur.tv_usec = dur.fracSec().usecs();
event_add(m_timerEvent, &tvdur);
assert(event_pending(m_timerEvent, EV_TIMEOUT, null));
logTrace("Rescheduled timer event for %s seconds", dur.total!"usecs" * 1e-6);
}
private static nothrow extern(C)
void onTimerTimeout(evutil_socket_t, short events, void* userptr)
{
logTrace("timer event fired");
auto drv = cast(Libevent2Driver)userptr;
try drv.processTimers();
catch (Exception e) {
logError("Failed to process timers: %s", e.msg);
try logDiagnostic("Full error: %s", e.toString().sanitize); catch {}
}
}
private static nothrow extern(C) void onAddrInfo(int err, evutil_addrinfo* res, void* arg)
{
auto msg = cast(GetAddrInfoMsg*)arg;
msg.err = err;
msg.done = true;
if (err == DNS_ERR_NONE) {
assert(res !is null);
scope (exit) evutil_freeaddrinfo(res);
// Note that we are only returning the first address and ignoring the
// rest. Ideally we should return all of the NetworkAddress
msg.addr.family = cast(ushort)res.ai_family;
assert(res.ai_addrlen == msg.addr.sockAddrLen());
switch (msg.addr.family) {
case AF_INET:
auto sock4 = cast(sockaddr_in*)res.ai_addr;
msg.addr.sockAddrInet4.sin_addr.s_addr = sock4.sin_addr.s_addr;
break;
case AF_INET6:
auto sock6 = cast(sockaddr_in6*)res.ai_addr;
msg.addr.sockAddrInet6.sin6_addr.s6_addr = sock6.sin6_addr.s6_addr;
break;
default:
logDiagnostic("DNS lookup yielded unknown address family: %s", msg.addr.family);
err = DNS_ERR_UNKNOWN;
break;
}
}
if (msg.task && msg.task.running) {
try msg.core.resumeTask(msg.task);
catch (Exception e) logWarn("Error resuming DNS query task: %s", e.msg);
}
}
private void registerObject(Libevent2Object obj)
{
debug assert(Thread.getThis() is m_ownerThread, "Event object created in foreign thread.");
auto key = cast(size_t)cast(void*)obj;
synchronized (s_threadObjectsMutex) {
m_ownedObjects.insert(key);
s_threadObjects.insert(key);
}
}
private void unregisterObject(Libevent2Object obj)
{
auto key = cast(size_t)cast(void*)obj;
synchronized (s_threadObjectsMutex) {
m_ownedObjects.remove(key);
s_threadObjects.remove(key);
}
}
}
private struct TimerInfo {
long timeout;
long repeatDuration;
size_t refCount = 1;
void delegate() callback;
Task owner;
bool pending;
this(void delegate() callback) { this.callback = callback; }
}
private struct TimeoutEntry {
long timeout;
size_t id;
}
private struct GetAddrInfoMsg {
NetworkAddress addr;
bool done = false;
int err = 0;
DriverCore core;
Task task;
}
private class Libevent2Object {
protected Libevent2Driver m_driver;
debug private Thread m_ownerThread;
this(Libevent2Driver driver)
{
m_driver = driver;
m_driver.registerObject(this);
debug m_ownerThread = driver.m_ownerThread;
}
~this()
{
// NOTE: m_driver will always be destroyed deterministically
// in static ~this(), so it can be used here safely
m_driver.unregisterObject(this);
}
protected void onThreadShutdown() {}
}
/// private
struct ThreadSlot {
Libevent2Driver driver;
deimos.event2.event.event* event;
ArraySet!Task tasks;
}
/// private
alias ThreadSlotMap = HashMap!(Thread, ThreadSlot);
class Libevent2ManualEvent : Libevent2Object, ManualEvent {
private {
shared(int) m_emitCount = 0;
core.sync.mutex.Mutex m_mutex;
ThreadSlotMap m_waiters;
}
this(Libevent2Driver driver)
{
super(driver);
m_mutex = new core.sync.mutex.Mutex;
m_waiters = ThreadSlotMap(manualAllocator());
}
~this()
{
foreach (ts; m_waiters)
event_free(ts.event);
}
void emit()
{
atomicOp!"+="(m_emitCount, 1);
synchronized (m_mutex) {
foreach (ref sl; m_waiters)
event_active(sl.event, 0, 0);
}
}
void wait()
{
wait(m_emitCount);
}
int wait(int reference_emit_count)
{
assert(!amOwner());
acquire();
scope(exit) release();
auto ec = this.emitCount;
while( ec == reference_emit_count ){
getThreadLibeventDriverCore().yieldForEvent();
ec = this.emitCount;
}
return ec;
}
int wait(Duration timeout, int reference_emit_count)
{
assert(!amOwner());
acquire();
scope(exit) release();
auto tm = m_driver.createTimer(null);
scope (exit) m_driver.releaseTimer(tm);
m_driver.m_timers[tm].owner = Task.getThis();
m_driver.rearmTimer(tm, timeout, false);
auto ec = this.emitCount;
while( ec == reference_emit_count ){
getThreadLibeventDriverCore().yieldForEvent();
ec = this.emitCount;
if (!m_driver.isTimerPending(tm)) break;
}
return ec;
}
void acquire()
{
auto task = Task.getThis();
assert(task != Task(), "ManualEvent.wait works only when called from a task.");
auto thread = task.thread;
synchronized (m_mutex) {
if (thread !in m_waiters) {
ThreadSlot slot;
slot.driver = cast(Libevent2Driver)getEventDriver();
slot.event = event_new(slot.driver.eventLoop, -1, EV_PERSIST, &onSignalTriggered, cast(void*)this);
event_add(slot.event, null);
m_waiters[thread] = slot;
}
assert(task !in m_waiters[thread].tasks, "Double acquisition of signal.");
m_waiters[thread].tasks.insert(task);
}
}
void release()
{
auto self = Task.getThis();
synchronized (m_mutex) {
assert(self.thread in m_waiters && self in m_waiters[self.thread].tasks,
"Releasing non-acquired signal.");
m_waiters[self.thread].tasks.remove(self);
}
}
bool amOwner()
{
auto self = Task.getThis();
synchronized (m_mutex) {
if (self.thread !in m_waiters) return false;
return self in m_waiters[self.thread].tasks;
}
}
@property int emitCount() const { return atomicLoad(m_emitCount); }
protected override void onThreadShutdown()
{
auto thr = Thread.getThis();
synchronized (m_mutex) {
if (thr in m_waiters) {
event_free(m_waiters[thr].event);
m_waiters.remove(thr);
}
}
}
private static nothrow extern(C)
void onSignalTriggered(evutil_socket_t, short events, void* userptr)
{
try {
auto sig = cast(Libevent2ManualEvent)userptr;
auto thread = Thread.getThis();
auto core = getThreadLibeventDriverCore();
ArraySet!Task lst;
synchronized (sig.m_mutex) {
assert(thread in sig.m_waiters);
lst = sig.m_waiters[thread].tasks.dup;
}
foreach (l; lst)
core.resumeTask(l);
} catch (Exception e) {
logError("Exception while handling signal event: %s", e.msg);
try logDiagnostic("Full error: %s", sanitize(e.msg));
catch(Exception) {}
debug assert(false);
}
}
}
class Libevent2FileDescriptorEvent : Libevent2Object, FileDescriptorEvent {
private {
int m_fd;
deimos.event2.event.event* m_event;
Trigger m_activeEvents;
Task m_waiter;
}
this(Libevent2Driver driver, int file_descriptor, Trigger events)
{
assert(events != Trigger.none);
super(driver);
m_fd = file_descriptor;
short evts = 0;
if (events & Trigger.read) evts |= EV_READ;
if (events & Trigger.write) evts |= EV_WRITE;
m_event = event_new(driver.eventLoop, file_descriptor, evts|EV_PERSIST, &onFileTriggered, cast(void*)this);
event_add(m_event, null);
}
~this()
{
event_free(m_event);
}
void wait(Trigger which)
{
assert(!m_waiter, "Only one task may wait on a Libevent2FileEvent.");
m_waiter = Task.getThis();
scope (exit) {
m_waiter = Task.init;
m_activeEvents &= ~which;
}
while ((m_activeEvents & which) == Trigger.none)
getThreadLibeventDriverCore().yieldForEvent();
}
bool wait(Duration timeout, Trigger which)
{
assert(!m_waiter, "Only one task may wait on a Libevent2FileEvent.");
m_waiter = Task.getThis();
scope (exit) {
m_waiter = Task.init;
m_activeEvents &= ~which;
}
auto tm = m_driver.createTimer(null);
scope (exit) m_driver.releaseTimer(tm);
m_driver.m_timers[tm].owner = Task.getThis();
m_driver.rearmTimer(tm, timeout, false);
while ((m_activeEvents & which) == Trigger.none) {
getThreadLibeventDriverCore().yieldForEvent();
if (!m_driver.isTimerPending(tm)) break;
}
return (m_activeEvents & which) != Trigger.none;
}
private static nothrow extern(C)
void onFileTriggered(evutil_socket_t fd, short events, void* userptr)
{
try {
auto core = getThreadLibeventDriverCore();
auto evt = cast(Libevent2FileDescriptorEvent)userptr;
evt.m_activeEvents = Trigger.none;
if (events & EV_READ) evt.m_activeEvents |= Trigger.read;
if (events & EV_WRITE) evt.m_activeEvents |= Trigger.write;
if (evt.m_waiter) core.resumeTask(evt.m_waiter);
} catch (Exception e) {
logError("Exception while handling file event: %s", e.msg);
try logDiagnostic("Full error: %s", sanitize(e.msg));
catch(Exception) {}
debug assert(false);
}
}
}
class Libevent2UDPConnection : UDPConnection {
private {
Libevent2Driver m_driver;
TCPContext* m_ctx;
NetworkAddress m_bindAddress;
string m_bindAddressString;
bool m_canBroadcast = false;
}
this(NetworkAddress bind_addr, Libevent2Driver driver)
{
m_driver = driver;
m_bindAddress = bind_addr;
char buf[64];
void* ptr;
if( bind_addr.family == AF_INET ) ptr = &bind_addr.sockAddrInet4.sin_addr;
else ptr = &bind_addr.sockAddrInet6.sin6_addr;
evutil_inet_ntop(bind_addr.family, ptr, buf.ptr, buf.length);
m_bindAddressString = to!string(buf.ptr);
auto sockfd_raw = socket(bind_addr.family, SOCK_DGRAM, IPPROTO_UDP);
// on Win64 socket() returns a 64-bit value but libevent expects an int
static if (typeof(sockfd_raw).max > int.max) assert(sockfd_raw <= int.max || sockfd_raw == ~0);
auto sockfd = cast(int)sockfd_raw;
socketEnforce(sockfd != -1, "Failed to create socket.");
enforce(evutil_make_socket_nonblocking(sockfd) == 0, "Failed to make socket non-blocking.");
int tmp_reuse = 1;
socketEnforce(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &tmp_reuse, tmp_reuse.sizeof) == 0,
"Error enabling socket address reuse on listening socket");
if( bind_addr.port )
socketEnforce(bind(sockfd, bind_addr.sockAddr, bind_addr.sockAddrLen) == 0, "Failed to bind UDP socket.");
m_ctx = TCPContextAlloc.alloc(driver.m_core, driver.m_eventLoop, sockfd, null, bind_addr, NetworkAddress());
auto evt = event_new(driver.m_eventLoop, sockfd, EV_READ|EV_PERSIST, &onUDPRead, m_ctx);
if( !evt ) throw new Exception("Failed to create buffer event for socket.");
enforce(event_add(evt, null) == 0);
}
@property string bindAddress() const { return m_bindAddressString; }
@property NetworkAddress localAddress() const { return m_bindAddress; }
@property bool canBroadcast() const { return m_canBroadcast; }
@property void canBroadcast(bool val)
{
int tmp_broad = val;
enforce(setsockopt(m_ctx.socketfd, SOL_SOCKET, SO_BROADCAST, &tmp_broad, tmp_broad.sizeof) == 0,
"Failed to change the socket broadcast flag.");
m_canBroadcast = val;
}
bool amOwner() {
return m_ctx !is null && m_ctx.readOwner != Task() && m_ctx.readOwner == Task.getThis() && m_ctx.readOwner == m_ctx.writeOwner;
}
void acquire()
{
assert(m_ctx, "Trying to acquire a closed TCP connection.");
assert(m_ctx.readOwner == Task() && m_ctx.writeOwner == Task(), "Trying to acquire a TCP connection that is currently owned.");
m_ctx.readOwner = m_ctx.writeOwner = Task.getThis();
}
void release()
{
if( !m_ctx ) return;
assert(m_ctx.readOwner != Task() && m_ctx.writeOwner != Task(), "Trying to release a TCP connection that is not owned.");
assert(m_ctx.readOwner == Task.getThis() && m_ctx.readOwner == m_ctx.writeOwner, "Trying to release a foreign TCP connection.");
m_ctx.readOwner = m_ctx.writeOwner = Task();
}
void connect(string host, ushort port)
{
NetworkAddress addr = m_driver.resolveHost(host, m_ctx.local_addr.family);
addr.port = port;
connect(addr);
}
void connect(NetworkAddress addr)
{
enforce(.connect(m_ctx.socketfd, addr.sockAddr, addr.sockAddrLen) == 0, "Failed to connect UDP socket."~to!string(getLastSocketError()));
}
void send(in ubyte[] data, in NetworkAddress* peer_address = null)
{
sizediff_t ret;
assert(data.length <= int.max);
if( peer_address ){
ret = .sendto(m_ctx.socketfd, data.ptr, cast(int)data.length, 0, peer_address.sockAddr, peer_address.sockAddrLen);
} else {
ret = .send(m_ctx.socketfd, data.ptr, cast(int)data.length, 0);
}
logTrace("send ret: %s, %s", ret, getLastSocketError());
enforce(ret >= 0, "Error sending UDP packet.");
enforce(ret == data.length, "Unable to send full packet.");
}
ubyte[] recv(ubyte[] buf = null, NetworkAddress* peer_address = null)
{
if( buf.length == 0 ) buf.length = 65507;
NetworkAddress from;
from.family = m_ctx.local_addr.family;
assert(buf.length <= int.max);
while(true){
socklen_t addr_len = from.sockAddrLen;
auto ret = .recvfrom(m_ctx.socketfd, buf.ptr, cast(int)buf.length, 0, from.sockAddr, &addr_len);
if( ret > 0 ){
if( peer_address ) *peer_address = from;
return buf[0 .. ret];
}
if( ret < 0 ){
auto err = getLastSocketError();
logDiagnostic("UDP recv err: %s", err);
enforce(err == EWOULDBLOCK, "Error receiving UDP packet.");
}
m_ctx.core.yieldForEvent();
}
}
private static nothrow extern(C) void onUDPRead(evutil_socket_t sockfd, short evts, void* arg)
{
auto ctx = cast(TCPContext*)arg;
logTrace("udp socket %d read event!", ctx.socketfd);
try {
auto f = ctx.readOwner;
if (f && f.running)
ctx.core.resumeTask(f);
} catch( Throwable e ){
logError("Exception onUDPRead: %s", e.msg);
debug assert(false);
}
}
}
private {
event_base* s_eventLoop; // TLS
__gshared DriverCore s_driverCore;
__gshared Mutex s_threadObjectsMutex;
__gshared ArraySet!size_t s_threadObjects;
bool s_alreadyDeinitialized = false;
}
package event_base* getThreadLibeventEventLoop()
{
return s_eventLoop;
}
package DriverCore getThreadLibeventDriverCore()
{
return s_driverCore;
}
private int getLastSocketError()
{
version(Windows) return WSAGetLastError();
else {
import core.stdc.errno;
return errno;
}
}
struct LevCondition {
Condition cond;
LevMutex* mutex;
}
struct LevMutex {
core.sync.mutex.Mutex mutex;
ReadWriteMutex rwmutex;
}
alias FreeListObjectAlloc!(LevCondition, false) LevConditionAlloc;
alias FreeListObjectAlloc!(LevMutex, false) LevMutexAlloc;
alias FreeListObjectAlloc!(core.sync.mutex.Mutex, false) MutexAlloc;
alias FreeListObjectAlloc!(ReadWriteMutex, false) ReadWriteMutexAlloc;
alias FreeListObjectAlloc!(Condition, false) ConditionAlloc;
private nothrow extern(C)
{
void* lev_alloc(size_t size)
{
try {
auto mem = manualAllocator().alloc(size+size_t.sizeof);
*cast(size_t*)mem.ptr = size;
return mem.ptr + size_t.sizeof;
} catch( Throwable th ){
logWarn("Exception in lev_alloc: %s", th.msg);
return null;
}
}
void* lev_realloc(void* p, size_t newsize)
{
try {
if( !p ) return lev_alloc(newsize);
auto oldsize = *cast(size_t*)(p-size_t.sizeof);
auto oldmem = (p-size_t.sizeof)[0 .. oldsize+size_t.sizeof];
auto newmem = manualAllocator().realloc(oldmem, newsize+size_t.sizeof);
*cast(size_t*)newmem.ptr = newsize;
return newmem.ptr + size_t.sizeof;
} catch( Throwable th ){
logWarn("Exception in lev_realloc: %s", th.msg);
return null;
}
}
void lev_free(void* p)
{
try {
auto size = *cast(size_t*)(p-size_t.sizeof);
auto mem = (p-size_t.sizeof)[0 .. size+size_t.sizeof];
manualAllocator().free(mem);
} catch( Throwable th ){
logWarn("Exception in lev_free: %s", th.msg);
}
}
debug __gshared size_t[void*] s_mutexes;
debug __gshared Mutex s_mutexesLock;
void* lev_alloc_mutex(uint locktype)
{
try {
auto ret = LevMutexAlloc.alloc();
if( locktype == EVTHREAD_LOCKTYPE_READWRITE ) ret.rwmutex = ReadWriteMutexAlloc.alloc();
else ret.mutex = MutexAlloc.alloc();
//logInfo("alloc mutex %s", cast(void*)ret);
debug if (!s_mutexesLock) s_mutexesLock = new Mutex;
debug synchronized (s_mutexesLock) s_mutexes[cast(void*)ret] = 0;
return ret;
} catch( Throwable th ){
logWarn("Exception in lev_alloc_mutex: %s", th.msg);
return null;
}
}
void lev_free_mutex(void* lock, uint locktype)
{
try {
import core.runtime;
//logInfo("free mutex %s: %s", cast(void*)lock, defaultTraceHandler());
debug synchronized (s_mutexesLock) {
auto pl = lock in s_mutexes;
assert(pl !is null);
assert(*pl == 0);
s_mutexes.remove(lock);
}
auto lm = cast(LevMutex*)lock;
if (lm.mutex) MutexAlloc.free(lm.mutex);
if (lm.rwmutex) ReadWriteMutexAlloc.free(lm.rwmutex);
LevMutexAlloc.free(lm);
} catch( Throwable th ){
logWarn("Exception in lev_free_mutex: %s", th.msg);
}
}
int lev_lock_mutex(uint mode, void* lock)
{
try {
//logInfo("lock mutex %s", cast(void*)lock);
debug synchronized (s_mutexesLock) {
auto pl = lock in s_mutexes;
assert(pl !is null, "Unknown lock handle");
(*pl)++;
}
auto mtx = cast(LevMutex*)lock;
assert(mtx !is null, "null lock");
assert(mtx.mutex !is null || mtx.rwmutex !is null, "lock contains no mutex");
if( mode & EVTHREAD_WRITE ){
if( mode & EVTHREAD_TRY ) return mtx.rwmutex.writer().tryLock() ? 0 : 1;
else mtx.rwmutex.writer().lock();
} else if( mode & EVTHREAD_READ ){
if( mode & EVTHREAD_TRY ) return mtx.rwmutex.reader().tryLock() ? 0 : 1;
else mtx.rwmutex.reader().lock();
} else {
assert(mtx.mutex !is null, "lock mutex is null");
if( mode & EVTHREAD_TRY ) return mtx.mutex.tryLock() ? 0 : 1;
else mtx.mutex.lock();
}
return 0;
} catch( Throwable th ){
logWarn("Exception in lev_lock_mutex: %s", th.msg);
return -1;
}
}
int lev_unlock_mutex(uint mode, void* lock)
{
try {
//logInfo("unlock mutex %s", cast(void*)lock);
debug synchronized (s_mutexesLock) {
auto pl = lock in s_mutexes;
assert(pl !is null, "Unknown lock handle");
assert(*pl > 0, "Unlocking unlocked mutex");
(*pl)--;
}
auto mtx = cast(LevMutex*)lock;
if( mode & EVTHREAD_WRITE ){
mtx.rwmutex.writer().unlock();
} else if( mode & EVTHREAD_READ ){
mtx.rwmutex.reader().unlock();
} else {
mtx.mutex.unlock();
}
return 0;
} catch( Throwable th ){
logWarn("Exception in lev_unlock_mutex: %s", th.msg);
return -1;
}
}
void* lev_alloc_condition(uint condtype)
{
try {
return LevConditionAlloc.alloc();
} catch( Throwable th ){
logWarn("Exception in lev_alloc_condition: %s", th.msg);
return null;
}
}
void lev_free_condition(void* cond)
{
try {
auto lc = cast(LevCondition*)cond;
if (lc.cond) ConditionAlloc.free(lc.cond);
LevConditionAlloc.free(lc);
} catch( Throwable th ){
logWarn("Exception in lev_free_condition: %s", th.msg);
}
}
int lev_signal_condition(void* cond, int broadcast)
{
try {
auto c = cast(LevCondition*)cond;
if( c.cond ) c.cond.notifyAll();
return 0;
} catch( Throwable th ){
logWarn("Exception in lev_signal_condition: %s", th.msg);
return -1;
}
}
int lev_wait_condition(void* cond, void* lock, const(timeval)* timeout)
{
try {
auto c = cast(LevCondition*)cond;
if( c.mutex is null ) c.mutex = cast(LevMutex*)lock;
assert(c.mutex.mutex !is null); // RW mutexes are not supported for conditions!
assert(c.mutex is lock);
if( c.cond is null ) c.cond = ConditionAlloc.alloc(c.mutex.mutex);
if( timeout ){
if( !c.cond.wait(dur!"seconds"(timeout.tv_sec) + dur!"usecs"(timeout.tv_usec)) )
return 1;
} else c.cond.wait();
return 0;
} catch( Throwable th ){
logWarn("Exception in lev_wait_condition: %s", th.msg);
return -1;
}
}
c_ulong lev_get_thread_id()
{
try return cast(c_ulong)cast(void*)Thread.getThis();
catch( Throwable th ){
logWarn("Exception in lev_get_thread_id: %s", th.msg);
return 0;
}
}
}
}
|
D
|
/*
TEST_OUTPUT:
----
fail_compilation/ice12727.d(16): Error: alias ice12727.IndexTuple!(1, 0).IndexTuple recursive alias declaration
fail_compilation/ice12727.d(23): Error: template instance ice12727.IndexTuple!(1, 0) error instantiating
fail_compilation/ice12727.d(27): instantiated from here: Matrix!(float, 3)
fail_compilation/ice12727.d(28): instantiated from here: Vector!(float, 3)
----
*/
template IndexTuple(int e, int s = 0, T...)
{
static if (s == e)
alias IndexTuple = T;
else
alias IndexTuple = IndexTuple!(e);
}
struct Matrix(T, int N = M)
{
pure decomposeLUP()
{
foreach (j; IndexTuple!(1)) {}
}
}
alias Vector(T, int M) = Matrix!(T, M);
alias Vector3 = Vector!(float, 3);
|
D
|
module org.serviio.library.search.IndexFields;
import java.lang.String;
public abstract interface IndexFields
{
public static immutable String ID = "id";
public static immutable String ENTITY_ID = "entityId";
public static immutable String CDS_OBJECT_ID = "cdsObjectId";
public static immutable String CDS_PARENT_ID = "cdsParentId";
public static immutable String FILE_TYPE = "fileType";
public static immutable String CATEGORY = "category";
public static immutable String VALUE = "value";
public static immutable String OBJECT_TYPE = "objectType";
public static immutable String THUMBNAIL_ID = "thumbnailId";
public static immutable String CONTEXT = "context";
public static immutable String ONLINE_REPOSITORY_ID = "onlineRepoId";
}
/* Location: C:\Users\Main\Downloads\serviio.jar
* Qualified Name: org.serviio.library.search.IndexFields
* JD-Core Version: 0.7.0.1
*/
|
D
|
instance VLK_421_Valentino(Npc_Default)
{
name[0] = "Валентино";
guild = GIL_VLK;
id = 421;
voice = 23;//3;
flags = 0;
npcType = npctype_main;
B_SetAttributesToChapter(self,3);
fight_tactic = FAI_HUMAN_NORMAL;
EquipItem(self,ItMw_1h_Vlk_Mace);
CreateInvItems(self,ItMi_Gold,200);
CreateInvItems(self,ItKe_Valentino,1);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald.",Face_N_Normal03,BodyTex_N,ITAR_Vlk_H);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,70);
daily_routine = Rtn_Start_421;
aivar[AIV_TheftDex] = 30;
};
func void Rtn_Start_421()
{
TA_Stand_ArmsCrossed(9,0,12,0,"NW_CITY_MERCHANT_PATH_16");
TA_Smalltalk(12,0,17,0,"NW_CITY_MERCHANT_TAVERN01_01");
TA_Sit_Chair(17,0,23,57,"NW_CITY_TAVERN_IN_06");
TA_Smalltalk(23,57,4,5,"NW_CITY_TAVERN_IN_06");//VLK_426_Buergerin
TA_Pee(4,5,4,10,"NW_CITY_MERCHANT_PATH_09");
TA_Sleep(4,10,9,0,"NW_CITY_REICH03_BED_01");
};
func void Rtn_Tot_421()
{
TA_Stand_Guarding(0,0,12,0,"TOT");
TA_Stand_Guarding(12,0,0,0,"TOT");
};
|
D
|
module dau.gui.manager;
import dau.setup;
import dau.input;
import dau.sound;
import dau.gui.element;
import dau.gui.tooltip;
import dau.gui.data;
import dau.geometry.all;
import dau.graphics.cursor;
class GUIManager {
this() {
auto data = getGUIData("dauGUIDefaults");
_clickSound = ("clickSound" in data) ? new SoundSample(data["clickSound"]) : nullAudio;
clear(); // set up initial guielement
}
void manageCursor(CursorManager cursor, string inactiveCursorSprite, string activeCursorSprite) {
_cursor = cursor;
_inactiveCursorSprite = inactiveCursorSprite;
_activeCursorSprite = activeCursorSprite;
}
T addElement(T : GUIElement)(T el) {
return _topElement.addChild(el);
}
void clear() {
_topElement = new GUIElement(new GUIData, Rect2i(0, 0, Settings.screenW, Settings.screenH));
}
void update(float time, InputManager input) {
_topElement.update(time);
_mousePos = input.mousePos;
bool highlight; // whether to highlight mouse
auto underMouse = _topElement.handleMouseHover(input.mousePos, input.prevMousePos, highlight);
if (underMouse != _elementUnderMouse) {
adjustCursor(highlight);
_elementUnderMouse = underMouse;
if (underMouse is null) {
_toolTip = null;
}
else {
auto text = underMouse.toolTipText;
auto title = underMouse.toolTipTitle;
if (text is null && title is null) {
_toolTip = null;
}
else {
_toolTip = new ToolTip(title, text);
}
}
}
if (input.select) {
bool handled = _topElement.handleMouseClick(input.mousePos);
if (handled) { _clickSound.play; }
}
}
void draw() {
_topElement.draw(Vector2i.zero);
if (_toolTip !is null) {
_toolTip.draw(_mousePos);
}
}
private:
GUIElement _topElement;
GUIElement _elementUnderMouse;
ToolTip _toolTip;
Vector2i _mousePos;
CursorManager _cursor;
string _inactiveCursorSprite, _activeCursorSprite;
AudioSample _clickSound;
void adjustCursor(bool active) {
if (_cursor !is null) {
_cursor.setSprite(active ? _activeCursorSprite : _inactiveCursorSprite);
}
}
}
|
D
|
import std.array;
import std.conv;
import std.exception;
import std.stdio;
import std.string;
import google.protobuf;
import tutorial.addressbook;
/// This function fills in a Person message based on user input.
Person promptForAddress()
{
auto person = new Person;
write("Enter person ID number: ");
readf("%d", &person.id);
readln!string;
write("Enter name: ");
person.name = readln!string.strip;
write("Enter email address (blank for none): ");
person.email = readln!string.strip;
while (true)
{
auto phoneNumber = new Person.PhoneNumber;
write("Enter a phone number (or leave blank to finish): ");
phoneNumber.number = readln!string.strip;
if (phoneNumber.number.empty)
break;
write("Is this a mobile, home, or work phone? ");
string phoneType = readln!string.strip.toUpper;
try
{
phoneNumber.type = phoneType.to!(Person.PhoneType);
}
catch (ConvException exception)
{
writeln("Unknown phone type. Using default.");
}
person.phones ~= phoneNumber;
}
return person;
}
// Main function: Reads the entire address book from a file,
// adds one person based on user input, then writes it back out to the same
// file.
int main(string[] args)
{
if (args.length != 2)
{
stderr.writefln("Usage: %s ADDRESS_BOOK_FILE", args[0]);
return -1;
}
auto addressBook = new AddressBook;
try
{
auto input = File(args[1], "rb");
scope(exit) input.close;
ubyte[] inputBuffer = input.rawRead(new ubyte[input.size.to!size_t]);
inputBuffer.fromProtobuf!AddressBook(addressBook);
}
catch (ErrnoException exception)
{
stderr.writefln("%s: File not found. Creating a new file.", args[1]);
}
// Add an address.
addressBook.people ~= promptForAddress;
{
auto output = File(args[1], "wb");
scope(exit) output.close;
output.rawWrite(addressBook.toProtobuf.array);
}
return 0;
}
|
D
|
/Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Single.o : /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Deprecated.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Cancelable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObserverType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Reactive.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/RecursiveLock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Errors.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Event.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/First.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/Platform.Linux.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/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/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap
/Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Single~partial.swiftmodule : /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Deprecated.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Cancelable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObserverType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Reactive.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/RecursiveLock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Errors.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Event.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/First.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/Platform.Linux.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/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/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap
/Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Single~partial.swiftdoc : /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Deprecated.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Cancelable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObserverType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Reactive.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/RecursiveLock.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Errors.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Event.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/First.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Rx.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/Platform/Platform.Linux.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/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/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/Polina/XcodeApp/CoreML_test_10.03/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap
|
D
|
in a fluent manner
|
D
|
/*
* Copyright (C) 2004-2007 by Digital Mars, www.digitalmars.com
* Written by Walter Bright
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, in both source and binary form, subject to the following
* restrictions:
*
* o The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* o Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
* o This notice may not be removed or altered from any source
* distribution.
*/
/*
* Modified by Sean Kelly <sean@f4.ca> for use with Tango.
*/
module rt.arraycast;
/******************************************
* Runtime helper to convert dynamic array of one
* type to dynamic array of another.
* Adjusts the length of the array.
* Throws exception if new length is not aligned.
*/
extern (C)
void[] _d_arraycast(size_t tsize, size_t fsize, void[] a)
{
auto length = a.length;
auto nbytes = length * fsize;
if (nbytes % tsize != 0)
{
throw new Exception("array cast misalignment");
}
length = nbytes / tsize;
*cast(size_t *)&a = length; // jam new length
return a;
}
unittest
{
byte[int.sizeof * 3] b;
int[] i;
short[] s;
i = cast(int[])b;
assert(i.length == 3);
s = cast(short[])b;
assert(s.length == 6);
s = cast(short[])i;
assert(s.length == 6);
}
/******************************************
* Runtime helper to convert dynamic array of bits
* dynamic array of another.
* Adjusts the length of the array.
* Throws exception if new length is not aligned.
*/
version (none)
{
extern (C)
void[] _d_arraycast_frombit(uint tsize, void[] a)
{
uint length = a.length;
if (length & 7)
{
throw new Exception("bit[] array cast misalignment");
}
length /= 8 * tsize;
*cast(size_t *)&a = length; // jam new length
return a;
}
unittest
{
version (D_Bits)
{
bit[int.sizeof * 3 * 8] b;
int[] i;
short[] s;
i = cast(int[])b;
assert(i.length == 3);
s = cast(short[])b;
assert(s.length == 6);
}
}
}
|
D
|
// URL: https://yukicoder.me/problems/no/668
import std.algorithm, std.array, std.container, std.math, std.range, std.typecons, std.string;
import std.conv, std.format;
version(unittest) {} else
void main()
{
string N; io.getV(N);
int a = N[0..2].to!int;
if (N[2] >= '5') ++a;
if (a == 100)
io.put(format("1.0*10^%d", N.length));
else
io.put(format("%d.%d*10^%d", a/10, a%10, N.length-1));
}
auto io = IO!()();
import lib.io;
|
D
|
module android.java.java.security.Principal_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import1 = android.java.java.lang.Class_d_interface;
import import0 = android.java.javax.security.auth.Subject_d_interface;
final class Principal : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import int hashCode();
@Import string getName();
@Import bool implies(import0.Subject);
@Import import1.Class getClass();
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Ljava/security/Principal;";
}
|
D
|
/home/drees/Code/Caelum/bet-contract/target/debug/deps/libthiserror_impl-3fd4ae840ee24805.so: /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/lib.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/ast.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/attr.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/expand.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/fmt.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/prop.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/valid.rs
/home/drees/Code/Caelum/bet-contract/target/debug/deps/thiserror_impl-3fd4ae840ee24805.d: /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/lib.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/ast.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/attr.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/expand.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/fmt.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/prop.rs /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/valid.rs
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/lib.rs:
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/ast.rs:
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/attr.rs:
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/expand.rs:
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/fmt.rs:
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/prop.rs:
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.26/src/valid.rs:
|
D
|
instance VLK_424_ALWIN(NPC_DEFAULT)
{
name[0] = "Алвин";
guild = GIL_VLK;
id = 424;
voice = 12;
flags = 0;
npctype = NPCTYPE_MAIN;
aivar[AIV_TOUGHGUY] = TRUE;
b_setattributestochapter(self,3);
fight_tactic = FAI_HUMAN_STRONG;
EquipItem(self,itmw_1h_vlk_axe);
b_createambientinv(self);
b_setnpcvisual(self,MALE,"Hum_Head_Bald",FACE_P_NORMALBART_RIORDIAN,BODYTEX_P,itar_barkeeper);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
b_givenpctalents(self);
b_setfightskills(self,30);
daily_routine = rtn_start_424;
};
func void rtn_start_424()
{
ta_sit_bench(8,0,22,0,"NW_CITY_PATH_HABOUR_18");
ta_sleep(22,0,8,0,"NW_CITY_HABOUR_HUT_07_BED_01");
};
|
D
|
/home/ankit/pandora/substrate-node-template/target/release/deps/unicode_width-b72199703ba264b4.rmeta: /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/lib.rs /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/tables.rs
/home/ankit/pandora/substrate-node-template/target/release/deps/libunicode_width-b72199703ba264b4.rlib: /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/lib.rs /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/tables.rs
/home/ankit/pandora/substrate-node-template/target/release/deps/unicode_width-b72199703ba264b4.d: /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/lib.rs /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/tables.rs
/home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/lib.rs:
/home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/src/tables.rs:
|
D
|
// Written in the D programming language.
/**
* This module defines an Abstract Syntax Tree for the D language
*
* Examples:
* ---
* // TODO
* ---
*
* Copyright: Brian Schott 2013
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt Boost, License 1.0)
* Authors: Brian Schott
*/
module dparse.ast;
import dparse.lexer;
import std.traits;
import std.algorithm;
import std.array;
import std.string;
private immutable uint[TypeInfo] typeMap;
shared static this()
{
typeMap[typeid(AddExpression)] = 1;
typeMap[typeid(AndAndExpression)] = 2;
typeMap[typeid(AndExpression)] = 3;
typeMap[typeid(AsmAddExp)] = 4;
typeMap[typeid(AsmAndExp)] = 5;
typeMap[typeid(AsmBrExp)] = 6;
typeMap[typeid(AsmExp)] = 7;
typeMap[typeid(AsmEqualExp)] = 8;
typeMap[typeid(AsmLogAndExp)] = 9;
typeMap[typeid(AsmLogOrExp)] = 10;
typeMap[typeid(AsmMulExp)] = 11;
typeMap[typeid(AsmOrExp)] = 12;
typeMap[typeid(AsmRelExp)] = 13;
typeMap[typeid(AsmUnaExp)] = 14;
typeMap[typeid(AsmShiftExp)] = 15;
typeMap[typeid(AsmXorExp)] = 16;
typeMap[typeid(AssertExpression)] = 17;
typeMap[typeid(AssignExpression)] = 18;
typeMap[typeid(CmpExpression)] = 19;
typeMap[typeid(DeleteExpression)] = 20;
typeMap[typeid(EqualExpression)] = 21;
typeMap[typeid(Expression)] = 22;
typeMap[typeid(FunctionCallExpression)] = 23;
typeMap[typeid(FunctionLiteralExpression)] = 24;
typeMap[typeid(IdentityExpression)] = 25;
typeMap[typeid(ImportExpression)] = 26;
typeMap[typeid(IndexExpression)] = 27;
typeMap[typeid(InExpression)] = 28;
typeMap[typeid(IsExpression)] = 29;
typeMap[typeid(MixinExpression)] = 30;
typeMap[typeid(MulExpression)] = 31;
typeMap[typeid(NewAnonClassExpression)] = 32;
typeMap[typeid(NewExpression)] = 33;
typeMap[typeid(OrExpression)] = 34;
typeMap[typeid(OrOrExpression)] = 35;
typeMap[typeid(PowExpression)] = 36;
typeMap[typeid(PragmaExpression)] = 37;
typeMap[typeid(PrimaryExpression)] = 38;
typeMap[typeid(RelExpression)] = 39;
typeMap[typeid(ShiftExpression)] = 40;
typeMap[typeid(Index)] = 41;
typeMap[typeid(TemplateMixinExpression)] = 42;
typeMap[typeid(TernaryExpression)] = 43;
typeMap[typeid(TraitsExpression)] = 44;
typeMap[typeid(TypeidExpression)] = 45;
typeMap[typeid(TypeofExpression)] = 46;
typeMap[typeid(UnaryExpression)] = 47;
typeMap[typeid(XorExpression)] = 48;
}
/**
* Implements the $(LINK2 http://en.wikipedia.org/wiki/Visitor_pattern, Visitor Pattern)
* for the various AST classes
*/
abstract class ASTVisitor
{
public:
/** */
void visit(const ExpressionNode n)
{
switch (typeMap[typeid(n)])
{
case 1: visit(cast(AddExpression) n); break;
case 2: visit(cast(AndAndExpression) n); break;
case 3: visit(cast(AndExpression) n); break;
case 4: visit(cast(AsmAddExp) n); break;
case 5: visit(cast(AsmAndExp) n); break;
case 6: visit(cast(AsmBrExp) n); break;
case 7: visit(cast(AsmExp) n); break;
case 8: visit(cast(AsmEqualExp) n); break;
case 9: visit(cast(AsmLogAndExp) n); break;
case 10: visit(cast(AsmLogOrExp) n); break;
case 11: visit(cast(AsmMulExp) n); break;
case 12: visit(cast(AsmOrExp) n); break;
case 13: visit(cast(AsmRelExp) n); break;
case 14: visit(cast(AsmUnaExp) n); break;
case 15: visit(cast(AsmShiftExp) n); break;
case 16: visit(cast(AsmXorExp) n); break;
case 17: visit(cast(AssertExpression) n); break;
case 18: visit(cast(AssignExpression) n); break;
case 19: visit(cast(CmpExpression) n); break;
case 20: visit(cast(DeleteExpression) n); break;
case 21: visit(cast(EqualExpression) n); break;
case 22: visit(cast(Expression) n); break;
case 23: visit(cast(FunctionCallExpression) n); break;
case 24: visit(cast(FunctionLiteralExpression) n); break;
case 25: visit(cast(IdentityExpression) n); break;
case 26: visit(cast(ImportExpression) n); break;
case 27: visit(cast(IndexExpression) n); break;
case 28: visit(cast(InExpression) n); break;
case 29: visit(cast(IsExpression) n); break;
case 30: visit(cast(MixinExpression) n); break;
case 31: visit(cast(MulExpression) n); break;
case 32: visit(cast(NewAnonClassExpression) n); break;
case 33: visit(cast(NewExpression) n); break;
case 34: visit(cast(OrExpression) n); break;
case 35: visit(cast(OrOrExpression) n); break;
case 36: visit(cast(PowExpression) n); break;
case 37: visit(cast(PragmaExpression) n); break;
case 38: visit(cast(PrimaryExpression) n); break;
case 39: visit(cast(RelExpression) n); break;
case 40: visit(cast(ShiftExpression) n); break;
case 41: visit(cast(Index) n); break;
case 42: visit(cast(TemplateMixinExpression) n); break;
case 43: visit(cast(TernaryExpression) n); break;
case 44: visit(cast(TraitsExpression) n); break;
case 45: visit(cast(TypeidExpression) n); break;
case 46: visit(cast(TypeofExpression) n); break;
case 47: visit(cast(UnaryExpression) n); break;
case 48: visit(cast(XorExpression) n); break;
default: assert(false, __MODULE__ ~ " has a bug");
}
}
/** */ void visit(const AddExpression addExpression) { addExpression.accept(this); }
/** */ void visit(const AliasDeclaration aliasDeclaration) { aliasDeclaration.accept(this); }
/** */ void visit(const AliasInitializer aliasInitializer) { aliasInitializer.accept(this); }
/** */ void visit(const AliasThisDeclaration aliasThisDeclaration) { aliasThisDeclaration.accept(this); }
/** */ void visit(const AlignAttribute alignAttribute) { alignAttribute.accept(this); }
/** */ void visit(const AndAndExpression andAndExpression) { andAndExpression.accept(this); }
/** */ void visit(const AndExpression andExpression) { andExpression.accept(this); }
/** */ void visit(const AnonymousEnumDeclaration anonymousEnumDeclaration) { anonymousEnumDeclaration.accept(this); }
/** */ void visit(const AnonymousEnumMember anonymousEnumMember) { anonymousEnumMember.accept(this); }
/** */ void visit(const ArgumentList argumentList) { argumentList.accept(this); }
/** */ void visit(const Arguments arguments) { arguments.accept(this); }
/** */ void visit(const ArrayInitializer arrayInitializer) { arrayInitializer.accept(this); }
/** */ void visit(const ArrayLiteral arrayLiteral) { arrayLiteral.accept(this); }
/** */ void visit(const ArrayMemberInitialization arrayMemberInitialization) { arrayMemberInitialization.accept(this); }
/** */ void visit(const AsmAddExp asmAddExp) { asmAddExp.accept(this); }
/** */ void visit(const AsmAndExp asmAndExp) { asmAndExp.accept(this); }
/** */ void visit(const AsmBrExp asmBrExp) { asmBrExp.accept(this); }
/** */ void visit(const AsmEqualExp asmEqualExp) { asmEqualExp.accept(this); }
/** */ void visit(const AsmExp asmExp) { asmExp.accept(this); }
/** */ void visit(const AsmInstruction asmInstruction) { asmInstruction.accept(this); }
/** */ void visit(const AsmLogAndExp asmLogAndExp) { asmLogAndExp.accept(this); }
/** */ void visit(const AsmLogOrExp asmLogOrExp) { asmLogOrExp.accept(this); }
/** */ void visit(const AsmMulExp asmMulExp) { asmMulExp.accept(this); }
/** */ void visit(const AsmOrExp asmOrExp) { asmOrExp.accept(this); }
/** */ void visit(const AsmPrimaryExp asmPrimaryExp) { asmPrimaryExp.accept(this); }
/** */ void visit(const AsmRelExp asmRelExp) { asmRelExp.accept(this); }
/** */ void visit(const AsmShiftExp asmShiftExp) { asmShiftExp.accept(this); }
/** */ void visit(const AsmStatement asmStatement) { asmStatement.accept(this); }
/** */ void visit(const AsmTypePrefix asmTypePrefix) { asmTypePrefix.accept(this); }
/** */ void visit(const AsmUnaExp asmUnaExp) { asmUnaExp.accept(this); }
/** */ void visit(const AsmXorExp asmXorExp) { asmXorExp.accept(this); }
/** */ void visit(const AssertExpression assertExpression) { assertExpression.accept(this); }
/** */ void visit(const AssignExpression assignExpression) { assignExpression.accept(this); }
/** */ void visit(const AssocArrayLiteral assocArrayLiteral) { assocArrayLiteral.accept(this); }
/** */ void visit(const AtAttribute atAttribute) { atAttribute.accept(this); }
/** */ void visit(const Attribute attribute) { attribute.accept(this); }
/** */ void visit(const AttributeDeclaration attributeDeclaration) { attributeDeclaration.accept(this); }
/** */ void visit(const AutoDeclaration autoDeclaration) { autoDeclaration.accept(this); }
/** */ void visit(const BlockStatement blockStatement) { blockStatement.accept(this); }
/** */ void visit(const BodyStatement bodyStatement) { bodyStatement.accept(this); }
/** */ void visit(const BreakStatement breakStatement) { breakStatement.accept(this); }
/** */ void visit(const BaseClass baseClass) { baseClass.accept(this); }
/** */ void visit(const BaseClassList baseClassList) { baseClassList.accept(this); }
/** */ void visit(const CaseRangeStatement caseRangeStatement) { caseRangeStatement.accept(this); }
/** */ void visit(const CaseStatement caseStatement) { caseStatement.accept(this); }
/** */ void visit(const CastExpression castExpression) { castExpression.accept(this); }
/** */ void visit(const CastQualifier castQualifier) { castQualifier.accept(this); }
/** */ void visit(const Catch catch_) { catch_.accept(this); }
/** */ void visit(const Catches catches) { catches.accept(this); }
/** */ void visit(const ClassDeclaration classDeclaration) { classDeclaration.accept(this); }
/** */ void visit(const CmpExpression cmpExpression) { cmpExpression.accept(this); }
/** */ void visit(const CompileCondition compileCondition) { compileCondition.accept(this); }
/** */ void visit(const ConditionalDeclaration conditionalDeclaration) { conditionalDeclaration.accept(this); }
/** */ void visit(const ConditionalStatement conditionalStatement) { conditionalStatement.accept(this); }
/** */ void visit(const Constraint constraint) { constraint.accept(this); }
/** */ void visit(const Constructor constructor) { constructor.accept(this); }
/** */ void visit(const ContinueStatement continueStatement) { continueStatement.accept(this); }
/** */ void visit(const DebugCondition debugCondition) { debugCondition.accept(this); }
/** */ void visit(const DebugSpecification debugSpecification) { debugSpecification.accept(this); }
/** */ void visit(const Declaration declaration) { declaration.accept(this); }
/** */ void visit(const DeclarationOrStatement declarationsOrStatement) { declarationsOrStatement.accept(this); }
/** */ void visit(const DeclarationsAndStatements declarationsAndStatements) { declarationsAndStatements.accept(this); }
/** */ void visit(const Declarator declarator) { declarator.accept(this); }
/** */ void visit(const DefaultStatement defaultStatement) { defaultStatement.accept(this); }
/** */ void visit(const DeleteExpression deleteExpression) { deleteExpression.accept(this); }
/** */ void visit(const DeleteStatement deleteStatement) { deleteStatement.accept(this); }
/** */ void visit(const Deprecated deprecated_) { deprecated_.accept(this); }
/** */ void visit(const Destructor destructor) { destructor.accept(this); }
/** */ void visit(const DoStatement doStatement) { doStatement.accept(this); }
/** */ void visit(const EnumBody enumBody) { enumBody.accept(this); }
/** */ void visit(const EnumDeclaration enumDeclaration) { enumDeclaration.accept(this); }
/** */ void visit(const EnumMember enumMember) { enumMember.accept(this); }
/** */ void visit(const EponymousTemplateDeclaration eponymousTemplateDeclaration) { eponymousTemplateDeclaration.accept(this); }
/** */ void visit(const EqualExpression equalExpression) { equalExpression.accept(this); }
/** */ void visit(const Expression expression) { expression.accept(this); }
/** */ void visit(const ExpressionStatement expressionStatement) { expressionStatement.accept(this); }
/** */ void visit(const FinalSwitchStatement finalSwitchStatement) { finalSwitchStatement.accept(this); }
/** */ void visit(const Finally finally_) { finally_.accept(this); }
/** */ void visit(const ForStatement forStatement) { forStatement.accept(this); }
/** */ void visit(const ForeachStatement foreachStatement) { foreachStatement.accept(this); }
/** */ void visit(const ForeachType foreachType) { foreachType.accept(this); }
/** */ void visit(const ForeachTypeList foreachTypeList) { foreachTypeList.accept(this); }
/** */ void visit(const FunctionAttribute functionAttribute) { functionAttribute.accept(this); }
/** */ void visit(const FunctionBody functionBody) { functionBody.accept(this); }
/** */ void visit(const FunctionCallExpression functionCallExpression) { functionCallExpression.accept(this); }
/** */ void visit(const FunctionDeclaration functionDeclaration) { functionDeclaration.accept(this); }
/** */ void visit(const FunctionLiteralExpression functionLiteralExpression) { functionLiteralExpression.accept(this); }
/** */ void visit(const GotoStatement gotoStatement) { gotoStatement.accept(this); }
/** */ void visit(const IdentifierChain identifierChain) { identifierChain.accept(this); }
/** */ void visit(const IdentifierList identifierList) { identifierList.accept(this); }
/** */ void visit(const IdentifierOrTemplateChain identifierOrTemplateChain) { identifierOrTemplateChain.accept(this); }
/** */ void visit(const IdentifierOrTemplateInstance identifierOrTemplateInstance) { identifierOrTemplateInstance.accept(this); }
/** */ void visit(const IdentityExpression identityExpression) { identityExpression.accept(this); }
/** */ void visit(const IfStatement ifStatement) { ifStatement.accept(this); }
/** */ void visit(const ImportBind importBind) { importBind.accept(this); }
/** */ void visit(const ImportBindings importBindings) { importBindings.accept(this); }
/** */ void visit(const ImportDeclaration importDeclaration) { importDeclaration.accept(this); }
/** */ void visit(const ImportExpression importExpression) { importExpression.accept(this); }
/** */ void visit(const IndexExpression indexExpression) { indexExpression.accept(this); }
/** */ void visit(const InExpression inExpression) { inExpression.accept(this); }
/** */ void visit(const InStatement inStatement) { inStatement.accept(this); }
/** */ void visit(const Initialize initialize) { initialize.accept(this); }
/** */ void visit(const Initializer initializer) { initializer.accept(this); }
/** */ void visit(const InterfaceDeclaration interfaceDeclaration) { interfaceDeclaration.accept(this); }
/** */ void visit(const Invariant invariant_) { invariant_.accept(this); }
/** */ void visit(const IsExpression isExpression) { isExpression.accept(this); }
/** */ void visit(const KeyValuePair keyValuePair) { keyValuePair.accept(this); }
/** */ void visit(const KeyValuePairs keyValuePairs) { keyValuePairs.accept(this); }
/** */ void visit(const LabeledStatement labeledStatement) { labeledStatement.accept(this); }
/** */ void visit(const LastCatch lastCatch) { lastCatch.accept(this); }
/** */ void visit(const LinkageAttribute linkageAttribute) { linkageAttribute.accept(this); }
/** */ void visit(const MemberFunctionAttribute memberFunctionAttribute) { memberFunctionAttribute.accept(this); }
/** */ void visit(const MixinDeclaration mixinDeclaration) { mixinDeclaration.accept(this); }
/** */ void visit(const MixinExpression mixinExpression) { mixinExpression.accept(this); }
/** */ void visit(const MixinTemplateDeclaration mixinTemplateDeclaration) { mixinTemplateDeclaration.accept(this); }
/** */ void visit(const MixinTemplateName mixinTemplateName) { mixinTemplateName.accept(this); }
/** */ void visit(const Module module_) { module_.accept(this); }
/** */ void visit(const ModuleDeclaration moduleDeclaration) { moduleDeclaration.accept(this); }
/** */ void visit(const MulExpression mulExpression) { mulExpression.accept(this); }
/** */ void visit(const NewAnonClassExpression newAnonClassExpression) { newAnonClassExpression.accept(this); }
/** */ void visit(const NewExpression newExpression) { newExpression.accept(this); }
/** */ void visit(const NonVoidInitializer nonVoidInitializer) { nonVoidInitializer.accept(this); }
/** */ void visit(const Operands operands) { operands.accept(this); }
/** */ void visit(const OrExpression orExpression) { orExpression.accept(this); }
/** */ void visit(const OrOrExpression orOrExpression) { orOrExpression.accept(this); }
/** */ void visit(const OutStatement outStatement) { outStatement.accept(this); }
/** */ void visit(const Parameter parameter) { parameter.accept(this); }
/** */ void visit(const Parameters parameters) { parameters.accept(this); }
/** */ void visit(const Postblit postblit) { postblit.accept(this); }
/** */ void visit(const PowExpression powExpression) { powExpression.accept(this); }
/** */ void visit(const PragmaDeclaration pragmaDeclaration) { pragmaDeclaration.accept(this); }
/** */ void visit(const PragmaExpression pragmaExpression) { pragmaExpression.accept(this); }
/** */ void visit(const PrimaryExpression primaryExpression) { primaryExpression.accept(this); }
/** */ void visit(const Register register) { register.accept(this); }
/** */ void visit(const RelExpression relExpression) { relExpression.accept(this); }
/** */ void visit(const ReturnStatement returnStatement) { returnStatement.accept(this); }
/** */ void visit(const ScopeGuardStatement scopeGuardStatement) { scopeGuardStatement.accept(this); }
/** */ void visit(const SharedStaticConstructor sharedStaticConstructor) { sharedStaticConstructor.accept(this); }
/** */ void visit(const SharedStaticDestructor sharedStaticDestructor) { sharedStaticDestructor.accept(this); }
/** */ void visit(const ShiftExpression shiftExpression) { shiftExpression.accept(this); }
/** */ void visit(const SingleImport singleImport) { singleImport.accept(this); }
/** */ void visit(const Index index) { index.accept(this); }
/** */ void visit(const Statement statement) { statement.accept(this); }
/** */ void visit(const StatementNoCaseNoDefault statementNoCaseNoDefault) { statementNoCaseNoDefault.accept(this); }
/** */ void visit(const StaticAssertDeclaration staticAssertDeclaration) { staticAssertDeclaration.accept(this); }
/** */ void visit(const StaticAssertStatement staticAssertStatement) { staticAssertStatement.accept(this); }
/** */ void visit(const StaticConstructor staticConstructor) { staticConstructor.accept(this); }
/** */ void visit(const StaticDestructor staticDestructor) { staticDestructor.accept(this); }
/** */ void visit(const StaticIfCondition staticIfCondition) { staticIfCondition.accept(this); }
/** */ void visit(const StorageClass storageClass) { storageClass.accept(this); }
/** */ void visit(const StructBody structBody) { structBody.accept(this); }
/** */ void visit(const StructDeclaration structDeclaration) { structDeclaration.accept(this); }
/** */ void visit(const StructInitializer structInitializer) { structInitializer.accept(this); }
/** */ void visit(const StructMemberInitializer structMemberInitializer) { structMemberInitializer.accept(this); }
/** */ void visit(const StructMemberInitializers structMemberInitializers) { structMemberInitializers.accept(this); }
/** */ void visit(const SwitchStatement switchStatement) { switchStatement.accept(this); }
/** */ void visit(const Symbol symbol) { symbol.accept(this); }
/** */ void visit(const SynchronizedStatement synchronizedStatement) { synchronizedStatement.accept(this); }
/** */ void visit(const TemplateAliasParameter templateAliasParameter) { templateAliasParameter.accept(this); }
/** */ void visit(const TemplateArgument templateArgument) { templateArgument.accept(this); }
/** */ void visit(const TemplateArgumentList templateArgumentList) { templateArgumentList.accept(this); }
/** */ void visit(const TemplateArguments templateArguments) { templateArguments.accept(this); }
/** */ void visit(const TemplateDeclaration templateDeclaration) { templateDeclaration.accept(this); }
/** */ void visit(const TemplateInstance templateInstance) { templateInstance.accept(this); }
/** */ void visit(const TemplateMixinExpression templateMixinExpression) { templateMixinExpression.accept(this); }
/** */ void visit(const TemplateParameter templateParameter) { templateParameter.accept(this); }
/** */ void visit(const TemplateParameterList templateParameterList) { templateParameterList.accept(this); }
/** */ void visit(const TemplateParameters templateParameters) { templateParameters.accept(this); }
/** */ void visit(const TemplateSingleArgument templateSingleArgument) { templateSingleArgument.accept(this); }
/** */ void visit(const TemplateThisParameter templateThisParameter) { templateThisParameter.accept(this); }
/** */ void visit(const TemplateTupleParameter templateTupleParameter) { templateTupleParameter.accept(this); }
/** */ void visit(const TemplateTypeParameter templateTypeParameter) { templateTypeParameter.accept(this); }
/** */ void visit(const TemplateValueParameter templateValueParameter) { templateValueParameter.accept(this); }
/** */ void visit(const TemplateValueParameterDefault templateValueParameterDefault) { templateValueParameterDefault.accept(this); }
/** */ void visit(const TernaryExpression ternaryExpression) { ternaryExpression.accept(this); }
/** */ void visit(const ThrowStatement throwStatement) { throwStatement.accept(this); }
/** */ void visit(const Token) { }
/** */ void visit(const TraitsExpression traitsExpression) { traitsExpression.accept(this); }
/** */ void visit(const TryStatement tryStatement) { tryStatement.accept(this); }
/** */ void visit(const Type type) { type.accept(this); }
/** */ void visit(const Type2 type2) { type2.accept(this); }
/** */ void visit(const TypeSpecialization typeSpecialization) { typeSpecialization.accept(this); }
/** */ void visit(const TypeSuffix typeSuffix) { typeSuffix.accept(this); }
/** */ void visit(const TypeidExpression typeidExpression) { typeidExpression.accept(this); }
/** */ void visit(const TypeofExpression typeofExpression) { typeofExpression.accept(this); }
/** */ void visit(const UnaryExpression unaryExpression) { unaryExpression.accept(this); }
/** */ void visit(const UnionDeclaration unionDeclaration) { unionDeclaration.accept(this); }
/** */ void visit(const Unittest unittest_) { unittest_.accept(this); }
/** */ void visit(const VariableDeclaration variableDeclaration) { variableDeclaration.accept(this); }
/** */ void visit(const Vector vector) { vector.accept(this); }
/** */ void visit(const VersionCondition versionCondition) { versionCondition.accept(this); }
/** */ void visit(const VersionSpecification versionSpecification) { versionSpecification.accept(this); }
/** */ void visit(const WhileStatement whileStatement) { whileStatement.accept(this); }
/** */ void visit(const WithStatement withStatement) { withStatement.accept(this); }
/** */ void visit(const XorExpression xorExpression) { xorExpression.accept(this); }
}
interface ASTNode
{
public:
/** */ void accept(ASTVisitor visitor) const;
}
template visitIfNotNull(fields ...)
{
static if (fields.length > 1)
immutable visitIfNotNull = visitIfNotNull!(fields[0]) ~ visitIfNotNull!(fields[1..$]);
else
{
static if (typeof(fields[0]).stringof[$ - 2 .. $] == "[]")
{
static if (__traits(hasMember, typeof(fields[0][0]), "classinfo"))
immutable visitIfNotNull = "foreach (i; " ~ fields[0].stringof ~ ") if (i !is null) visitor.visit(i);\n";
else
immutable visitIfNotNull = "foreach (i; " ~ fields[0].stringof ~ ") visitor.visit(i);\n";
}
else static if (__traits(hasMember, typeof(fields[0]), "classinfo"))
immutable visitIfNotNull = "if (" ~ fields[0].stringof ~ " !is null) visitor.visit(" ~ fields[0].stringof ~ ");\n";
else
immutable visitIfNotNull = "visitor.visit(" ~ fields[0].stringof ~ ");\n";
}
}
mixin template OpEquals(bool print = false)
{
override bool opEquals(Object other) const
{
static if (print)
pragma(msg, generateOpEquals!(typeof(this)));
mixin (generateOpEquals!(typeof(this)));
}
}
template generateOpEquals(T)
{
template opEqualsPart(p ...)
{
import std.traits;
static if (p.length == 0)
enum opEqualsPart = "";
else static if (!isSomeFunction!(__traits(getMember, T, p[0]))
&& p[0] != "line" && p[0] != "column" && p[0] != "startLocation"
&& p[0] != "endLocation" && p[0] != "index")
{
static if (typeof(__traits(getMember, T, p[0])).stringof[$ - 2 .. $] == "[]")
{
enum opEqualsPart = "\nif (obj." ~ p[0] ~ ".length != this." ~ p[0] ~ ".length) return false;\n"
~ "foreach (i; 0 .. this." ~ p[0] ~ ".length)\n"
~ "\tif (this." ~ p[0] ~ "[i] != obj." ~ p[0] ~ "[i]) return false;" ~ opEqualsPart!(p[1 .. $]);
}
else
enum opEqualsPart = "\nif (obj." ~ p[0] ~ " != this." ~ p[0] ~ ") return false;" ~ opEqualsPart!(p[1 .. $]);
}
else
enum opEqualsPart = opEqualsPart!(p[1 .. $]);
}
enum generateOpEquals = T.stringof ~ " obj = cast(" ~ T.stringof ~ ") other;\n"
~ "if (obj is null) return false;"
~ opEqualsPart!(__traits(derivedMembers, T)) ~ "\n"
~ "return true;";
}
abstract class ExpressionNode : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
assert (false);
}
}
mixin template BinaryExpressionBody()
{
ExpressionNode left;
ExpressionNode right;
size_t line;
size_t column;
}
///
final class AddExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
/** */ IdType operator;
mixin BinaryExpressionBody;
}
///
final class AliasDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(storageClasses, type, identifierList, initializers));
}
mixin OpEquals;
/** */ StorageClass[] storageClasses;
/** */ Type type;
/** */ IdentifierList identifierList;
/** */ AliasInitializer[] initializers;
/** */ string comment;
}
///
final class AliasInitializer : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, storageClasses, type,
functionLiteralExpression));
}
mixin OpEquals;
/** */ Token name;
/** */ StorageClass[] storageClasses;
/** */ TemplateParameters templateParameters;
/** */ Type type;
/** */ FunctionLiteralExpression functionLiteralExpression;
}
///
final class AliasThisDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier));
}
mixin OpEquals;
/** */ Token identifier;
/** */ string comment;
}
///
final class AlignAttribute : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(intLiteral));
}
mixin OpEquals;
/** */ Token intLiteral;
}
///
final class AndAndExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
mixin BinaryExpressionBody;
}
///
final class AndExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
mixin BinaryExpressionBody;
}
///
final class AnonymousEnumDeclaration : ASTNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(baseType, members));
}
mixin OpEquals;
/** */ Type baseType;
/** */ AnonymousEnumMember[] members;
}
///
final class AnonymousEnumMember : ASTNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, name, assignExpression));
}
/** */ Type type;
/** */ Token name;
/** */ ExpressionNode assignExpression;
/** */ string comment;
}
///
final class ArgumentList : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
mixin OpEquals;
/** */ ExpressionNode[] items;
/** */ size_t startLocation;
/** */ size_t endLocation;
}
///
final class Arguments : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(argumentList));
}
mixin OpEquals;
/** */ ArgumentList argumentList;
}
///
final class ArrayInitializer : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(arrayMemberInitializations));
}
mixin OpEquals;
/** */ size_t startLocation;
/** */ size_t endLocation;
/** */ ArrayMemberInitialization[] arrayMemberInitializations;
}
///
final class ArrayLiteral : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(argumentList));
}
mixin OpEquals;
/** */ ArgumentList argumentList;
}
///
final class ArrayMemberInitialization : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression, nonVoidInitializer));
}
mixin OpEquals;
/** */ ExpressionNode assignExpression;
/** */ NonVoidInitializer nonVoidInitializer;
}
///
final class AsmAddExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
/** */ IdType operator;
mixin BinaryExpressionBody;
}
///
final class AsmAndExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
mixin BinaryExpressionBody;
}
///
final class AsmBrExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(asmBrExp, asmExp, asmUnaExp));
}
mixin OpEquals;
size_t line;
size_t column;
/** */ AsmBrExp asmBrExp;
/** */ ExpressionNode asmExp;
/** */ AsmUnaExp asmUnaExp;
}
///
final class AsmEqualExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
/** */ IdType operator;
}
///
final class AsmExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, middle, right));
}
mixin OpEquals;
/** */ ExpressionNode left;
/** */ ExpressionNode middle;
/** */ ExpressionNode right;
}
///
final class AsmInstruction : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrIntegerOrOpcode, asmInstruction, operands));
}
mixin OpEquals;
/** */ Token identifierOrIntegerOrOpcode;
/** */ bool hasAlign;
/** */ AsmInstruction asmInstruction;
/** */ Operands operands;
}
///
final class AsmLogAndExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmLogOrExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmMulExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmOrExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmPrimaryExp : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, register, asmExp, identifierChain));
}
/** */ ExpressionNode asmExp;
/** */ IdentifierChain identifierChain;
/** */ Register register;
/** */ Token token;
mixin OpEquals;
}
///
final class AsmRelExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
/** */ IdType operator;
mixin OpEquals;
}
///
final class AsmShiftExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
/** */ IdType operator;
mixin OpEquals;
}
///
final class AsmStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!asmInstructions);
}
/** */ AsmInstruction[] asmInstructions;
/** */ FunctionAttribute[] functionAttributes;
mixin OpEquals;
}
///
final class AsmTypePrefix : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ Token left;
/** */ Token right;
mixin OpEquals;
}
///
final class AsmUnaExp : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(prefix, asmTypePrefix, asmExp, asmPrimaryExp, asmUnaExp));
}
/** */ AsmTypePrefix asmTypePrefix;
/** */ ExpressionNode asmExp;
/** */ Token prefix;
/** */ AsmPrimaryExp asmPrimaryExp;
/** */ AsmUnaExp asmUnaExp;
mixin OpEquals;
}
///
final class AsmXorExp : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AssertExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assertion, message));
}
/** */ size_t line;
/** */ size_t column;
/** */ ExpressionNode assertion;
/** */ ExpressionNode message;
mixin OpEquals;
}
///
final class AssignExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(ternaryExpression, expression));
}
/** */ ExpressionNode ternaryExpression;
/** */ ExpressionNode expression;
/** */ IdType operator;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class AssocArrayLiteral : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(keyValuePairs));
}
/** */ KeyValuePairs keyValuePairs;
mixin OpEquals;
}
///
final class AtAttribute : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateInstance, argumentList));
}
/** */ ArgumentList argumentList;
/** */ TemplateInstance templateInstance;
/** */ Token identifier;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class Attribute : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(pragmaExpression, deprecated_, atAttribute,
alignAttribute, identifierChain));
}
/** */ PragmaExpression pragmaExpression;
/** */ Deprecated deprecated_;
/** */ AtAttribute atAttribute;
/** */ AlignAttribute alignAttribute;
/** */ LinkageAttribute linkageAttribute;
/** */ Token attribute;
/** */ IdentifierChain identifierChain;
mixin OpEquals;
}
///
final class AttributeDeclaration : ASTNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(attribute));
}
/** */ Attribute attribute;
/** */ size_t line;
mixin OpEquals;
}
///
final class AutoDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
foreach (sc; storageClasses)
visitor.visit(sc);
foreach (i; 0 .. initializers.length)
{
visitor.visit(initializers[i]);
}
}
/** */ Token[] identifiers;
/** */ Initializer[] initializers;
/** */ StorageClass[] storageClasses;
/** */ string comment;
mixin OpEquals;
}
///
final class BlockStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationsAndStatements));
}
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
/** */ DeclarationsAndStatements declarationsAndStatements;
mixin OpEquals;
}
///
final class BodyStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(blockStatement));
}
/** */ BlockStatement blockStatement;
mixin OpEquals;
}
///
final class BreakStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(label));
}
/** */ Token label;
mixin OpEquals;
}
///
final class BaseClass : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type2));
}
/** */ Type2 type2;
mixin OpEquals;
}
///
final class BaseClassList : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ BaseClass[] items;
mixin OpEquals;
}
///
final class CaseRangeStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(low, high, declarationsAndStatements));
}
/** */ ExpressionNode low;
/** */ ExpressionNode high;
/** */ DeclarationsAndStatements declarationsAndStatements;
/** */ size_t colonLocation;
mixin OpEquals;
}
///
final class CaseStatement: ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(argumentList, declarationsAndStatements));
}
/** */ ArgumentList argumentList;
/** */ DeclarationsAndStatements declarationsAndStatements;
/** */ size_t colonLocation;
mixin OpEquals;
}
///
final class CastExpression: ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, castQualifier, unaryExpression));
}
/** */ Type type;
/** */ CastQualifier castQualifier;
/** */ UnaryExpression unaryExpression;
mixin OpEquals;
}
///
final class CastQualifier: ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(first, second));
}
/** */ Token first;
/** */ Token second;
mixin OpEquals;
}
///
final class Catches: ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(catches, lastCatch));
}
/** */ Catch[] catches;
/** */ LastCatch lastCatch;
mixin OpEquals;
}
///
final class Catch: ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, declarationOrStatement));
}
/** */ Type type;
/** */ Token identifier;
/** */ DeclarationOrStatement declarationOrStatement;
mixin OpEquals;
}
///
final class ClassDeclaration: ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, constraint, baseClassList,
structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ BaseClassList baseClassList;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class CmpExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(shiftExpression, equalExpression,
identityExpression, relExpression, inExpression));
}
/** */ ExpressionNode shiftExpression;
/** */ ExpressionNode equalExpression;
/** */ ExpressionNode identityExpression;
/** */ ExpressionNode relExpression;
/** */ ExpressionNode inExpression;
mixin OpEquals;
}
///
final class CompileCondition : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(versionCondition, debugCondition, staticIfCondition));
}
/** */ VersionCondition versionCondition;
/** */ DebugCondition debugCondition;
/** */ StaticIfCondition staticIfCondition;
mixin OpEquals;
}
///
final class ConditionalDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(compileCondition, trueDeclarations, falseDeclarations));
}
/** */ CompileCondition compileCondition;
/** */ Declaration[] trueDeclarations;
/** */ Declaration[] falseDeclarations;
/** */ bool hasElse;
mixin OpEquals;
}
///
final class ConditionalStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(compileCondition, trueStatement, falseStatement));
}
/** */ CompileCondition compileCondition;
/** */ DeclarationOrStatement trueStatement;
/** */ DeclarationOrStatement falseStatement;
mixin OpEquals;
}
///
final class Constraint : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
/** */ size_t location;
mixin OpEquals;
}
///
final class Constructor : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(parameters, templateParameters, constraint,
memberFunctionAttributes, functionBody));
}
/** */ Parameters parameters;
/** */ FunctionBody functionBody;
/** */ Constraint constraint;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ TemplateParameters templateParameters;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class ContinueStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(label));
}
/** */ Token label;
mixin OpEquals;
}
///
final class DebugCondition : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrInteger));
}
/** */ size_t debugIndex;
/** */ Token identifierOrInteger;
mixin OpEquals;
}
///
final class DebugSpecification : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrInteger));
}
/** */ Token identifierOrInteger;
mixin OpEquals;
}
///
final class Declaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
foreach (attr; attributes)
visitor.visit(attr);
foreach (dec; declarations)
visitor.visit(dec);
foreach (Type; DeclarationTypes)
{
const(Type)* value = storage.peek!Type;
if (value !is null)
{
static if (isArray!Type)
foreach (item; *(cast(Type*) value))
visitor.visit(item);
else if (*value !is null)
visitor.visit(*(cast(Type*) value));
}
}
}
private import std.variant:Algebraic;
private import std.typetuple:TypeTuple;
alias DeclarationTypes = TypeTuple!(AliasDeclaration, AliasThisDeclaration,
AnonymousEnumDeclaration, AttributeDeclaration,
ClassDeclaration, ConditionalDeclaration, Constructor, DebugSpecification,
Destructor, EnumDeclaration, EponymousTemplateDeclaration,
FunctionDeclaration, ImportDeclaration, InterfaceDeclaration, Invariant,
MixinDeclaration, MixinTemplateDeclaration, Postblit, PragmaDeclaration,
SharedStaticConstructor, SharedStaticDestructor, StaticAssertDeclaration,
StaticConstructor, StaticDestructor, StructDeclaration,
TemplateDeclaration, UnionDeclaration, Unittest, VariableDeclaration,
VersionSpecification);
private Algebraic!(DeclarationTypes) storage;
private static string generateProperty(string type, string name)
{
return "const(" ~ type ~ ") " ~ name ~ "() const @property { auto p = storage.peek!" ~ type ~ "; return p is null? null : *p;}\n"
~ "const(" ~ type ~ ") " ~ name ~ "(" ~ type ~ " node) @property { storage = node; return node; }";
}
/** */ Attribute[] attributes;
/** */ Declaration[] declarations;
mixin(generateProperty("AliasDeclaration", "aliasDeclaration"));
mixin(generateProperty("AliasThisDeclaration", "aliasThisDeclaration"));
mixin(generateProperty("AnonymousEnumDeclaration", "anonymousEnumDeclaration"));
mixin(generateProperty("AttributeDeclaration", "attributeDeclaration"));
mixin(generateProperty("ClassDeclaration", "classDeclaration"));
mixin(generateProperty("ConditionalDeclaration", "conditionalDeclaration"));
mixin(generateProperty("Constructor", "constructor"));
mixin(generateProperty("DebugSpecification", "debugSpecification"));
mixin(generateProperty("Destructor", "destructor"));
mixin(generateProperty("EnumDeclaration", "enumDeclaration"));
mixin(generateProperty("EponymousTemplateDeclaration", "eponymousTemplateDeclaration"));
mixin(generateProperty("FunctionDeclaration", "functionDeclaration"));
mixin(generateProperty("ImportDeclaration", "importDeclaration"));
mixin(generateProperty("InterfaceDeclaration", "interfaceDeclaration"));
mixin(generateProperty("Invariant", "invariant_"));
mixin(generateProperty("MixinDeclaration", "mixinDeclaration"));
mixin(generateProperty("MixinTemplateDeclaration", "mixinTemplateDeclaration"));
mixin(generateProperty("Postblit", "postblit"));
mixin(generateProperty("PragmaDeclaration", "pragmaDeclaration"));
mixin(generateProperty("SharedStaticConstructor", "sharedStaticConstructor"));
mixin(generateProperty("SharedStaticDestructor", "sharedStaticDestructor"));
mixin(generateProperty("StaticAssertDeclaration", "staticAssertDeclaration"));
mixin(generateProperty("StaticConstructor", "staticConstructor"));
mixin(generateProperty("StaticDestructor", "staticDestructor"));
mixin(generateProperty("StructDeclaration", "structDeclaration"));
mixin(generateProperty("TemplateDeclaration", "templateDeclaration"));
mixin(generateProperty("UnionDeclaration", "unionDeclaration"));
mixin(generateProperty("Unittest", "unittest_"));
mixin(generateProperty("VariableDeclaration", "variableDeclaration"));
mixin(generateProperty("VersionSpecification", "versionSpecification"));
bool opEquals(const Object other) const
{
auto otherDeclaration = cast(Declaration) other;
if (otherDeclaration is null)
return false;
return attributes == otherDeclaration.attributes
&& declarations == otherDeclaration.declarations
&& storage == otherDeclaration.storage;
}
}
///
final class DeclarationsAndStatements : ASTNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationsAndStatements));
}
/** */ DeclarationOrStatement[] declarationsAndStatements;
mixin OpEquals;
}
///
final class DeclarationOrStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declaration, statement));
}
/** */ Declaration declaration;
/** */ Statement statement;
mixin OpEquals;
}
///
final class Declarator : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, initializer));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Initializer initializer;
/** */ TypeSuffix[] cstyle;
/** */ string comment;
mixin OpEquals;
}
///
final class DefaultStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationsAndStatements));
}
/** */ DeclarationsAndStatements declarationsAndStatements;
/** */ size_t colonLocation;
mixin OpEquals;
}
///
final class DeleteExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(unaryExpression));
}
/** */ UnaryExpression unaryExpression;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class DeleteStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(deleteExpression));
}
/** */ DeleteExpression deleteExpression;
mixin OpEquals;
}
///
final class Deprecated : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class Destructor : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t line;
/** */ size_t column;
/** */ size_t index;
/** */ string comment;
mixin OpEquals;
}
///
final class DoStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, statementNoCaseNoDefault));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
/** */ Expression expression;
mixin OpEquals;
}
///
final class EnumBody : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(enumMembers));
}
/** */ EnumMember[] enumMembers;
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
mixin OpEquals;
}
///
final class EnumDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, enumBody));
}
/** */ Token name;
/** */ Type type;
/** */ EnumBody enumBody;
/** */ string comment;
mixin OpEquals;
}
///
final class EnumMember : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, type, assignExpression));
}
/** */ Token name;
/** */ Type type;
/** */ ExpressionNode assignExpression;
/** */ string comment;
mixin OpEquals;
}
///
final class EponymousTemplateDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, assignExpression));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ ExpressionNode assignExpression;
/** */ Type type;
mixin OpEquals;
}
///
final class EqualExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class Expression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ ExpressionNode[] items;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class ExpressionStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
mixin OpEquals;
}
///
final class FinalSwitchStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(switchStatement));
}
/** */ SwitchStatement switchStatement;
mixin OpEquals;
}
///
final class Finally : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationOrStatement));
}
/** */ DeclarationOrStatement declarationOrStatement;
mixin OpEquals;
}
///
final class ForStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(initialization, test, increment,
declarationOrStatement));
}
/** */ DeclarationOrStatement initialization;
/** */ Expression test;
/** */ Expression increment;
/** */ DeclarationOrStatement declarationOrStatement;
/** */ size_t startIndex;
mixin OpEquals;
}
///
final class ForeachStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(foreachType, foreachTypeList, low, high,
declarationOrStatement));
}
/** */ IdType type;
/** */ ForeachTypeList foreachTypeList;
/** */ ForeachType foreachType;
/** */ Expression low;
/** */ Expression high;
/** */ DeclarationOrStatement declarationOrStatement;
/** */ size_t startIndex;
mixin OpEquals;
}
///
final class ForeachType : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier));
}
/** */ bool isRef;
/** */ IdType[] typeConstructors;
/** */ Type type;
/** */ Token identifier;
mixin OpEquals;
}
///
final class ForeachTypeList : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ ForeachType[] items;
mixin OpEquals;
}
///
final class FunctionAttribute : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, atAttribute));
}
/** */ Token token;
/** */ AtAttribute atAttribute;
mixin OpEquals;
}
///
final class FunctionBody : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(inStatement, outStatement, bodyStatement,
blockStatement));
}
/** */ BlockStatement blockStatement;
/** */ BodyStatement bodyStatement;
/** */ OutStatement outStatement;
/** */ InStatement inStatement;
mixin OpEquals;
}
///
final class FunctionCallExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, unaryExpression, templateArguments, arguments));
}
/** */ Type type;
/** */ UnaryExpression unaryExpression;
/** */ TemplateArguments templateArguments;
/** */ Arguments arguments;
mixin OpEquals;
}
///
final class FunctionDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(attributes, storageClasses, returnType, parameters,
templateParameters, constraint, memberFunctionAttributes,
functionBody));
}
/** */ bool hasAuto;
/** */ bool hasRef;
/** */ Type returnType;
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Parameters parameters;
/** */ Constraint constraint;
/** */ FunctionBody functionBody;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ string comment;
/** */ Attribute[] attributes;
/** */ StorageClass[] storageClasses;
mixin OpEquals;
}
///
final class FunctionLiteralExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(returnType, parameters, functionAttributes,
memberFunctionAttributes, functionBody, assignExpression));
}
/** */ ExpressionNode assignExpression;
/** */ FunctionAttribute[] functionAttributes;
/** */ FunctionBody functionBody;
/** */ IdType functionOrDelegate;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ Parameters parameters;
/** */ Token identifier;
/** */ Type returnType;
mixin OpEquals;
}
///
final class GotoStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(label, expression));
}
/** */ Expression expression;
/** */ Token label;
mixin OpEquals;
}
///
final class IdentifierChain : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifiers));
}
/** */ Token[] identifiers;
mixin OpEquals;
}
///
final class IdentifierList : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifiers));
}
/** */ Token[] identifiers;
mixin OpEquals;
}
///
final class IdentifierOrTemplateChain : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifiersOrTemplateInstances));
}
/** */ IdentifierOrTemplateInstance[] identifiersOrTemplateInstances;
mixin OpEquals;
}
///
final class IdentifierOrTemplateInstance : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateInstance));
}
/** */ Token identifier;
/** */ TemplateInstance templateInstance;
mixin OpEquals;
}
///
final class IdentityExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ bool negated;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class IfStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, type, expression, thenStatement,
elseStatement));
}
/** */ Token identifier;
/** */ Type type;
/** */ Expression expression;
/** */ DeclarationOrStatement thenStatement;
/** */ DeclarationOrStatement elseStatement;
/** */ size_t startIndex;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class ImportBind : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ Token left;
/** */ Token right;
mixin OpEquals;
}
///
final class ImportBindings : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(singleImport, importBinds));
}
/** */ SingleImport singleImport;
/** */ ImportBind[] importBinds;
mixin OpEquals;
}
///
final class ImportDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(singleImports, importBindings));
}
/** */ SingleImport[] singleImports;
/** */ ImportBindings importBindings;
mixin OpEquals;
}
///
final class ImportExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class Index : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(low, high));
}
/** */ ExpressionNode low;
/** */ ExpressionNode high;
mixin OpEquals;
}
///
final class IndexExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(unaryExpression, indexes));
}
/** */ UnaryExpression unaryExpression;
/** */ Index[] indexes;
mixin OpEquals;
}
///
final class InExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
bool negated;
mixin OpEquals;
}
///
final class InStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(blockStatement));
}
/** */ size_t inTokenLocation;
/** */ BlockStatement blockStatement;
mixin OpEquals;
}
///
final class Initialize : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(statementNoCaseNoDefault));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
mixin OpEquals;
}
///
final class Initializer : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(nonVoidInitializer));
}
/** */ NonVoidInitializer nonVoidInitializer;
mixin OpEquals;
}
///
final class InterfaceDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, constraint, baseClassList,
structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ BaseClassList baseClassList;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class Invariant : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(blockStatement));
}
/** */ BlockStatement blockStatement;
/** */ string comment;
size_t line;
size_t index;
mixin OpEquals;
}
///
final class IsExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, typeSpecialization,
templateParameterList));
}
/** */ Type type;
/** */ Token identifier;
/** */ TypeSpecialization typeSpecialization;
/** */ TemplateParameterList templateParameterList;
/** */ IdType equalsOrColon;
mixin OpEquals;
}
///
final class KeyValuePair : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(key, value));
}
/** */ ExpressionNode key;
/** */ ExpressionNode value;
mixin OpEquals;
}
///
final class KeyValuePairs : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(keyValuePairs));
}
/** */ KeyValuePair[] keyValuePairs;
mixin OpEquals;
}
///
final class LabeledStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, declarationOrStatement));
}
Token identifier;
/** */ DeclarationOrStatement declarationOrStatement;
mixin OpEquals;
}
///
final class LastCatch : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(statementNoCaseNoDefault));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
size_t line;
size_t column;
mixin OpEquals;
}
///
final class LinkageAttribute : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, identifierChain));
}
/** */ Token identifier;
/** */ bool hasPlusPlus;
/** */ IdentifierChain identifierChain;
mixin OpEquals;
}
///
final class MemberFunctionAttribute : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(atAttribute));
}
/** */ IdType tokenType;
/** */ AtAttribute atAttribute;
mixin OpEquals;
}
///
final class MixinDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(mixinExpression, templateMixinExpression));
}
/** */ MixinExpression mixinExpression;
/** */ TemplateMixinExpression templateMixinExpression;
mixin OpEquals;
}
///
final class MixinExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class MixinTemplateDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateDeclaration));
}
/** */ TemplateDeclaration templateDeclaration;
mixin OpEquals;
}
///
final class MixinTemplateName : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(symbol, typeofExpression, identifierOrTemplateChain));
}
/** */ Symbol symbol;
/** */ IdentifierOrTemplateChain identifierOrTemplateChain;
/** */ TypeofExpression typeofExpression;
mixin OpEquals;
}
///
final class Module : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(scriptLine, moduleDeclaration, declarations));
}
/** */ Token scriptLine;
/** */ ModuleDeclaration moduleDeclaration;
/** */ Declaration[] declarations;
mixin OpEquals;
}
///
final class ModuleDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(moduleName, deprecated_));
}
/** */ Deprecated deprecated_;
/** */ IdentifierChain moduleName;
/** */ size_t startLocation;
/** */ size_t endLocation;
/** */ string comment;
mixin OpEquals;
}
///
final class MulExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class NewAnonClassExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(allocatorArguments, constructorArguments,
baseClassList, structBody));
}
/** */ Arguments allocatorArguments;
/** */ Arguments constructorArguments;
/** */ BaseClassList baseClassList;
/** */ StructBody structBody;
mixin OpEquals;
}
///
final class NewExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(newAnonClassExpression, type, arguments,
assignExpression));
}
/** */ Type type;
/** */ NewAnonClassExpression newAnonClassExpression;
/** */ Arguments arguments;
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class StatementNoCaseNoDefault : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(labeledStatement, blockStatement, ifStatement,
whileStatement, doStatement, forStatement, foreachStatement,
switchStatement, finalSwitchStatement, continueStatement,
breakStatement, returnStatement, gotoStatement, withStatement,
synchronizedStatement, tryStatement, throwStatement,
scopeGuardStatement, asmStatement, conditionalStatement,
staticAssertStatement, versionSpecification, debugSpecification,
expressionStatement));
}
/** */ LabeledStatement labeledStatement;
/** */ BlockStatement blockStatement;
/** */ IfStatement ifStatement;
/** */ WhileStatement whileStatement;
/** */ DoStatement doStatement;
/** */ ForStatement forStatement;
/** */ ForeachStatement foreachStatement;
/** */ SwitchStatement switchStatement;
/** */ FinalSwitchStatement finalSwitchStatement;
/** */ ContinueStatement continueStatement;
/** */ BreakStatement breakStatement;
/** */ ReturnStatement returnStatement;
/** */ GotoStatement gotoStatement;
/** */ WithStatement withStatement;
/** */ SynchronizedStatement synchronizedStatement;
/** */ TryStatement tryStatement;
/** */ ThrowStatement throwStatement;
/** */ ScopeGuardStatement scopeGuardStatement;
/** */ AsmStatement asmStatement;
/** */ ConditionalStatement conditionalStatement;
/** */ StaticAssertStatement staticAssertStatement;
/** */ VersionSpecification versionSpecification;
/** */ DebugSpecification debugSpecification;
/** */ ExpressionStatement expressionStatement;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class NonVoidInitializer : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression, arrayInitializer,
structInitializer));
}
/** */ ExpressionNode assignExpression;
/** */ ArrayInitializer arrayInitializer;
/** */ StructInitializer structInitializer;
mixin OpEquals;
}
///
final class Operands : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(operands));
}
/** */ ExpressionNode[] operands;
mixin OpEquals;
}
///
final class OrExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class OrOrExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class OutStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(parameter, blockStatement));
}
/** */ size_t outTokenLocation;
/** */ Token parameter;
/** */ BlockStatement blockStatement;
mixin OpEquals;
}
///
final class Parameter : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, name, default_));
}
/** */ IdType[] parameterAttributes;
/** */ Type type;
/** */ Token name;
/** */ bool vararg;
/** */ ExpressionNode default_;
/** */ TypeSuffix[] cstyle;
mixin OpEquals;
}
///
final class Parameters : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(parameters));
}
/** */ Parameter[] parameters;
/** */ bool hasVarargs;
mixin OpEquals;
}
///
final class Postblit : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(functionBody));
}
/** */ FunctionBody functionBody;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
mixin OpEquals;
}
///
final class PowExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class PragmaDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(pragmaExpression));
}
/** */ PragmaExpression pragmaExpression;
mixin OpEquals;
}
///
final class PragmaExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, argumentList));
}
/** */ Token identifier;
/** */ ArgumentList argumentList;
mixin OpEquals;
}
///
final class PrimaryExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin(visitIfNotNull!(basicType, typeConstructor, type, primary,
typeofExpression, typeidExpression, arrayLiteral, assocArrayLiteral,
expression, dot, identifierOrTemplateInstance, isExpression,
functionLiteralExpression,traitsExpression, mixinExpression,
importExpression, vector, arguments));
}
/** */ Token dot;
/** */ Token primary;
/** */ IdentifierOrTemplateInstance identifierOrTemplateInstance;
/** */ Token basicType;
/** */ TypeofExpression typeofExpression;
/** */ TypeidExpression typeidExpression;
/** */ ArrayLiteral arrayLiteral;
/** */ AssocArrayLiteral assocArrayLiteral;
/** */ Expression expression;
/** */ IsExpression isExpression;
/** */ FunctionLiteralExpression functionLiteralExpression;
/** */ TraitsExpression traitsExpression;
/** */ MixinExpression mixinExpression;
/** */ ImportExpression importExpression;
/** */ Vector vector;
/** */ Type type;
/** */ Token typeConstructor;
/** */ Arguments arguments;
mixin OpEquals;
}
///
final class Register : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, intLiteral));
}
/** */ Token identifier;
/** */ Token intLiteral;
/** */ bool hasIntegerLiteral;
mixin OpEquals;
}
///
final class RelExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class ReturnStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class ScopeGuardStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, statementNoCaseNoDefault));
}
/** */ Token identifier;
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
mixin OpEquals;
}
///
final class SharedStaticConstructor : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class SharedStaticDestructor : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class ShiftExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class SingleImport : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(rename, identifierChain));
}
/** */ Token rename;
/** */ IdentifierChain identifierChain;
mixin OpEquals;
}
///
final class Statement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(statementNoCaseNoDefault, caseStatement,
caseRangeStatement, defaultStatement));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
/** */ CaseStatement caseStatement;
/** */ CaseRangeStatement caseRangeStatement;
/** */ DefaultStatement defaultStatement;
mixin OpEquals;
}
///
final class StaticAssertDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(staticAssertStatement));
}
/** */ StaticAssertStatement staticAssertStatement;
mixin OpEquals;
}
///
final class StaticAssertStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assertExpression));
}
/** */ AssertExpression assertExpression;
mixin OpEquals;
}
///
final class StaticConstructor : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class StaticDestructor : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class StaticIfCondition : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class StorageClass : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, alignAttribute, linkageAttribute,
atAttribute, deprecated_));
}
/** */ AlignAttribute alignAttribute;
/** */ LinkageAttribute linkageAttribute;
/** */ AtAttribute atAttribute;
/** */ Deprecated deprecated_;
/** */ Token token;
mixin OpEquals;
}
///
final class StructBody : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarations));
}
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
/** */ Declaration[] declarations;
mixin OpEquals;
}
///
final class StructDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, constraint, structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class StructInitializer : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(structMemberInitializers));
}
/** */ StructMemberInitializers structMemberInitializers;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class StructMemberInitializer : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, nonVoidInitializer));
}
/** */ Token identifier;
/** */ NonVoidInitializer nonVoidInitializer;
mixin OpEquals;
}
///
final class StructMemberInitializers : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(structMemberInitializers));
}
/** */ StructMemberInitializer[] structMemberInitializers;
mixin OpEquals;
}
///
final class SwitchStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, statement));
}
/** */ Expression expression;
/** */ Statement statement;
mixin OpEquals;
}
///
final class Symbol : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrTemplateChain));
}
/** */ IdentifierOrTemplateChain identifierOrTemplateChain;
/** */ bool dot;
mixin OpEquals;
}
///
final class SynchronizedStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, statementNoCaseNoDefault));
}
/** */ Expression expression;
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
mixin OpEquals;
}
///
final class TemplateAliasParameter : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, colonType, colonExpression,
assignType, assignExpression));
}
/** */ Type type;
/** */ Token identifier;
/** */ Type colonType;
/** */ ExpressionNode colonExpression;
/** */ Type assignType;
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class TemplateArgument : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, assignExpression));
}
/** */ Type type;
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class TemplateArgumentList : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ TemplateArgument[] items;
mixin OpEquals;
}
///
final class TemplateArguments : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateArgumentList, templateSingleArgument));
}
/** */ TemplateArgumentList templateArgumentList;
/** */ TemplateSingleArgument templateSingleArgument;
mixin OpEquals;
}
///
final class TemplateDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, constraint,
declarations));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ Declaration[] declarations;
/** */ string comment;
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
mixin OpEquals;
}
///
final class TemplateInstance : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateArguments));
}
/** */ Token identifier;
/** */ TemplateArguments templateArguments;
mixin OpEquals;
}
///
final class TemplateMixinExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateArguments, mixinTemplateName));
}
/** */ Token identifier;
/** */ TemplateArguments templateArguments;
/** */ MixinTemplateName mixinTemplateName;
mixin OpEquals;
}
///
final class TemplateParameter : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateTypeParameter, templateValueParameter,
templateAliasParameter, templateTupleParameter,
templateThisParameter));
}
/** */ TemplateTypeParameter templateTypeParameter;
/** */ TemplateValueParameter templateValueParameter;
/** */ TemplateAliasParameter templateAliasParameter;
/** */ TemplateTupleParameter templateTupleParameter;
/** */ TemplateThisParameter templateThisParameter;
mixin OpEquals;
}
///
final class TemplateParameterList : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ TemplateParameter[] items;
mixin OpEquals;
}
///
final class TemplateParameters : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameterList));
}
/** */ TemplateParameterList templateParameterList;
mixin OpEquals;
}
///
final class TemplateSingleArgument : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token));
}
/** */ Token token;
mixin OpEquals;
}
///
final class TemplateThisParameter : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateTypeParameter));
}
/** */ TemplateTypeParameter templateTypeParameter;
mixin OpEquals;
}
///
final class TemplateTupleParameter : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier));
}
/** */ Token identifier;
mixin OpEquals;
}
///
final class TemplateTypeParameter : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, colonType, assignType));
}
/** */ Token identifier;
/** */ Type colonType;
/** */ Type assignType;
mixin OpEquals;
}
///
final class TemplateValueParameter : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, assignExpression,
templateValueParameterDefault));
}
/** */ Type type;
/** */ Token identifier;
/** */ ExpressionNode assignExpression;
/** */ TemplateValueParameterDefault templateValueParameterDefault;
mixin OpEquals;
}
///
final class TemplateValueParameterDefault : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, assignExpression));
}
/** */ ExpressionNode assignExpression;
/** */ Token token;
mixin OpEquals;
}
///
final class TernaryExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(orOrExpression, expression, ternaryExpression));
}
/** */ ExpressionNode orOrExpression;
/** */ ExpressionNode expression;
/** */ ExpressionNode ternaryExpression;
/// Store this so that we know where the ':' is
Token colon;
mixin OpEquals;
}
///
final class ThrowStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
mixin OpEquals;
}
///
final class TraitsExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateArgumentList));
}
/** */ Token identifier;
/** */ TemplateArgumentList templateArgumentList;
mixin OpEquals;
}
///
final class TryStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationOrStatement, catches, finally_));
}
/** */ DeclarationOrStatement declarationOrStatement;
/** */ Catches catches;
/** */ Finally finally_;
mixin OpEquals;
}
///
final class Type : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type2, typeSuffixes));
}
/** */ IdType[] typeConstructors;
/** */ TypeSuffix[] typeSuffixes;
/** */ Type2 type2;
mixin OpEquals;
}
///
final class Type2 : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(symbol, typeofExpression,
identifierOrTemplateChain, type, vector));
}
/** */ IdType builtinType;
/** */ alias superOrThis = builtinType;
/** */ Symbol symbol;
/** */ TypeofExpression typeofExpression;
/** */ IdentifierOrTemplateChain identifierOrTemplateChain;
/** */ IdType typeConstructor;
/** */ Type type;
/** */ Vector vector;
mixin OpEquals;
}
///
final class TypeSpecialization : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, type));
}
/** */ Token token;
/** */ Type type;
mixin OpEquals;
}
///
final class TypeSuffix : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, low, high, delegateOrFunction, parameters,
memberFunctionAttributes));
}
/** */ Token delegateOrFunction;
/** */ Token star;
/** */ bool array;
/** */ Type type;
/** */ ExpressionNode low;
/** */ ExpressionNode high;
/** */ Parameters parameters;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
mixin OpEquals;
}
///
final class TypeidExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, expression));
}
/** */ Type type;
/** */ Expression expression;
mixin OpEquals;
}
///
final class TypeofExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, return_));
}
/** */ Expression expression;
/** */ Token return_;
mixin OpEquals;
}
///
final class UnaryExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
// TODO prefix, postfix, unary
mixin (visitIfNotNull!(primaryExpression, newExpression, deleteExpression,
castExpression, functionCallExpression, argumentList, unaryExpression,
type, identifierOrTemplateInstance, assertExpression, indexExpression));
}
/** */ Type type;
/** */ PrimaryExpression primaryExpression;
/** */ Token prefix;
/** */ Token suffix;
/** */ UnaryExpression unaryExpression;
/** */ NewExpression newExpression;
/** */ DeleteExpression deleteExpression;
/** */ CastExpression castExpression;
/** */ FunctionCallExpression functionCallExpression;
/** */ ArgumentList argumentList;
/** */ IdentifierOrTemplateInstance identifierOrTemplateInstance;
/** */ AssertExpression assertExpression;
/** */ IndexExpression indexExpression;
mixin OpEquals;
}
///
final class UnionDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, constraint, structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class Unittest : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(blockStatement));
}
/** */ BlockStatement blockStatement;
/** */ string comment;
mixin OpEquals;
}
///
final class VariableDeclaration : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(storageClasses, type, declarators, autoDeclaration));
}
/** */ Type type;
/** */ Declarator[] declarators;
/** */ StorageClass[] storageClasses;
/** */ AutoDeclaration autoDeclaration;
/** */ string comment;
mixin OpEquals;
}
///
final class Vector : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type));
}
/** */ Type type;
mixin OpEquals;
}
///
final class VersionCondition : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token));
}
/** */ size_t versionIndex;
/** */ Token token;
mixin OpEquals;
}
///
final class VersionSpecification : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token));
}
/** */ Token token;
mixin OpEquals;
}
///
final class WhileStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, declarationOrStatement));
}
/** */ Expression expression;
/** */ DeclarationOrStatement declarationOrStatement;
/** */ size_t startIndex;
mixin OpEquals;
}
///
final class WithStatement : ASTNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, statementNoCaseNoDefault));
}
/** */ Expression expression;
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
mixin OpEquals;
}
///
final class XorExpression : ExpressionNode
{
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
|
D
|
/// Minimalistic low-overhead wrapper for nodejs/http-parser
/// Used for benchmarks with simple server
module utils.http_parser;
private:
import std.range.primitives;
import core.stdc.string;
alias http_data_cb = extern(C) int function (http_parser*, const ubyte *at, size_t length);
alias http_cb = extern(C) int function (http_parser*);
public enum HttpParserType: uint {
request = 0,
response = 1,
both = 2
}
public enum HttpMethod: uint {
DELETE = 0,
GET = 1,
HEAD = 2,
POST = 3,
PUT = 4,
/* pathological */
CONNECT = 5,
OPTIONS = 6,
TRACE = 7,
/* WebDAV */
COPY = 8,
LOCK = 9,
MKCOL = 10,
MOVE = 11,
PROPFIND = 12,
PROPPATCH = 13,
SEARCH = 14,
UNLOCK = 15,
BIND = 16,
REBIND = 17,
UNBIND = 18,
ACL = 19,
/* subversion */
REPORT = 20,
MKACTIVITY = 21,
CHECKOUT = 22,
MERGE = 23,
/* upnp */
MSEARCH = 24,
NOTIFY = 25,
SUBSCRIBE = 26,
UNSUBSCRIBE = 27,
/* RFC-5789 */
PATCH = 28,
PURGE = 29,
/* CalDAV */
MKCALENDAR = 30,
/* RFC-2068, section 19.6.1.2 */
LINK = 31,
UNLINK = 32,
/* icecast */
SOURCE = 33,
}
enum HttpError : uint {
OK,
/* Callback-related errors */
CB_message_begin,
CB_url,
CB_header_field,
CB_header_value,
CB_headers_complete,
CB_body,
CB_message_complete,
CB_status,
CB_chunk_header,
CB_chunk_complete,
/* Parsing-related errors */
INVALID_EOF_STATE,
HEADER_OVERFLOW,
CLOSED_CONNECTION,
INVALID_VERSION,
INVALID_STATUS,
INVALID_METHOD,
INVALID_URL,
INVALID_HOST,
INVALID_PORT,
INVALID_PATH,
INVALID_QUERY_STRING,
INVALID_FRAGMENT,
LF_EXPECTED,
INVALID_HEADER_TOKEN,
INVALID_CONTENT_LENGTH,
UNEXPECTED_CONTENT_LENGTH,
INVALID_CHUNK_SIZE,
INVALID_CONSTANT,
INVALID_INTERNAL_STATE,
STRICT,
PAUSED,
UNKNOWN,
};
struct http_parser {
/** PRIVATE **/
uint state; // bitfield
uint nread; /* # bytes read in various scenarios */
ulong content_length; /* # bytes in body (0 if no Content-Length header) */
/** READ-ONLY **/
ushort http_major;
ushort http_minor;
// bitfield
uint status_code_method_http_errono_upgrade;
/** PUBLIC **/
void *data; /* A pointer to get hook to the "connection" or "socket" object */
}
struct http_parser_settings {
http_cb on_message_begin;
http_data_cb on_url;
http_data_cb on_status;
http_data_cb on_header_field;
http_data_cb on_header_value;
http_cb on_headers_complete;
http_data_cb on_body;
http_cb on_message_complete;
/* When on_chunk_header is called, the current chunk length is stored
* in parser->content_length.
*/
http_cb on_chunk_header;
http_cb on_chunk_complete;
};
extern(C) pure @nogc nothrow void http_parser_init(http_parser *parser, HttpParserType type);
extern(C) pure @nogc nothrow int http_should_keep_alive(const http_parser *parser);
/* Return a string description of the given error */
extern(C) pure @nogc nothrow immutable(char)* http_errno_description(HttpError err);
/* Checks if this is the final chunk of the body. */
extern(C) pure @nogc nothrow int http_body_is_final(const http_parser *parser);
/* Executes the parser. Returns number of parsed bytes. Sets
* `parser->http_errno` on error. */
extern(C) pure @nogc nothrow size_t http_parser_execute(
http_parser *parser,
const http_parser_settings *settings,
const ubyte *data,
size_t len
);
extern (C) uint http_parser_flags(const http_parser* parser);
// =========== Public interface starts here =============
public:
class HttpException : Exception {
HttpError error;
pure @nogc nothrow this(HttpError error, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null)
{
this.error = error;
immutable char* str = http_errno_description(error);
super(str[0..strlen(str)], file, line, nextInChain);
}
}
struct HttpParser(Interceptor)
{
http_parser parser;
http_parser_settings settings;
Interceptor interceptor;
Throwable failure;
uint flags;
static generateCallback(string cName, string dName)
{
import std.format;
return format(`
static if(__traits(hasMember, interceptor, "%2$s"))
{
extern(C) static int %1$s(http_parser* p) {
auto parser = cast(HttpParser*)p;
try {
parser.flags = http_parser_flags(p);
return parser.interceptor.%2$s(parser);
}
catch (Throwable t) {
parser.failure = t;
return 1;
}
}
settings.%1$s = &%1$s;
}
`, cName, dName);
}
static generateCallbackWithData(string cName, string dName)
{
import std.format;
return format(`
static if(__traits(hasMember, interceptor, "%2$s"))
{
extern(C) static int %1$s(http_parser* p, const ubyte* at, size_t size) {
auto parser = cast(HttpParser*)p;
try {
parser.flags = http_parser_flags(p);
return parser.interceptor.%2$s(parser, at[0..size]);
}
catch (Throwable t) {
parser.failure = t;
return 1;
}
}
settings.%1$s = &%1$s;
}
`, cName, dName);
}
@property HttpError errorCode() pure @safe nothrow { return cast(HttpError)((flags >> 24) & 0x7f); }
public:
alias interceptor this;
@property uint status() pure @safe nothrow { return flags & 0xffff; }
@property HttpMethod method() pure @safe nothrow { return cast(HttpMethod)((flags >> 16) & 0xFF); }
this(Interceptor interceptor, HttpParserType type)
{
this.interceptor = interceptor;
http_parser_init(&parser, type);
mixin(generateCallback("on_message_begin", "onMessageBegin"));
mixin(generateCallbackWithData("on_url", "onUrl"));
mixin(generateCallbackWithData("on_status", "onStatus"));
mixin(generateCallbackWithData("on_body", "onBody"));
mixin(generateCallbackWithData("on_header_field", "onHeaderField"));
mixin(generateCallbackWithData("on_header_value", "onHeaderValue"));
mixin(generateCallback("on_headers_complete", "onHeadersComplete"));
mixin(generateCallback("on_message_complete", "onMessageComplete"));
}
@property bool shouldKeepAlive() pure nothrow { return http_should_keep_alive(&parser) == 1; }
@property ushort httpMajor() @safe pure nothrow { return parser.http_major; }
@property ushort httpMinor() @safe pure nothrow { return parser.http_minor; }
size_t execute(const(ubyte)[] chunk)
{
size_t size = http_parser_execute(&parser, &settings, chunk.ptr, chunk.length);
flags = http_parser_flags(&parser);
if (errorCode) {
auto f = failure;
failure = null;
if (f is null) f = new HttpException(errorCode);
throw f;
}
return size;
}
size_t execute(const(char)[] str)
{
return execute(cast(const(ubyte)[])str);
}
}
auto httpParser(Interceptor)(Interceptor interceptor, HttpParserType type)
{
return HttpParser!Interceptor(interceptor, type);
}
unittest
{
import std.conv : to, text;
struct TestCase {
HttpParserType type;
string raw;
string url;
string _body;
bool shouldKeepAlive;
ushort major;
ushort minor;
string[2][] headers;
}
auto tests = [
TestCase(
HttpParserType.request,
"GET /test HTTP/1.1\r\n" ~
"User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1\r\n" ~
"Host: 0.0.0.0=5000\r\n" ~
"Accept: */*\r\n" ~
"Content-Length: 2\r\n" ~
"\r\n42",
"/test",
"42",
true, 1, 1,
[
[ "User-Agent", "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1" ],
[ "Host", "0.0.0.0=5000" ],
[ "Accept", "*/*" ],
[ "Content-Length", "2"]
]
)
];
// Tests consume inout in one go, we just test that proper callbacks get called
struct Callbacks {
int testCase;
string url;
string[] headerFields;
string[] headerValues;
string _body;
bool headersCompleted = false;
int onMessageBegin(HttpParser!Callbacks* parser) {
headerValues = [];
headerFields = [];
headersCompleted = false;
url = "";
return 0;
}
int onUrl(HttpParser!Callbacks* parser, const(ubyte)[] chunk){
url = cast(string)chunk.idup;
return 0;
}
int onHeaderField(HttpParser!Callbacks* parser, const(ubyte)[] chunk) {
headerFields ~= cast(string)chunk;
return 0;
}
int onHeaderValue(HttpParser!Callbacks* parser, const(ubyte)[] chunk) {
headerValues ~= cast(string)chunk;
return 0;
}
int onBody(HttpParser!Callbacks* parser, const(ubyte)[] chunk) {
_body = cast(string)chunk;
return 0;
}
int onStatus(HttpParser!Callbacks* parser, const(ubyte)[] chunk) { return 0; }
int onHeadersComplete(HttpParser!Callbacks* parser) {
auto test = tests[testCase];
assert(test.url == url);
assert(test.major == parser.httpMajor);
assert(test.minor == parser.httpMinor);
foreach(i, header; test.headers) {
assert(headerFields[i] == header[0],
text("header field mismatch got `", headerFields[i], "` expected `", header[0], "`"));
assert(headerValues[i] == header[1],
text("header value mismatch got `", headerValues[i], "` expected `", header[1], "`"));
}
headersCompleted = true;
return 0;
}
int onMessageComplete(HttpParser!Callbacks* parser) {
auto test = tests[testCase++];
assert(headersCompleted);
assert(test.url == url);
assert(test.major == parser.httpMajor);
assert(test.minor == parser.httpMinor);
assert(test._body == _body);
foreach(i, header; test.headers) {
assert(headerFields[i] == header[0],
text("header field mismatch got `", headerFields[i], "` expected `", header[0], "`"));
assert(headerValues[i] == header[1],
text("header value mismatch got `", headerValues[i], "` expected `", header[1], "`"));
}
return 0;
}
}
auto parser = httpParser(Callbacks(), HttpParserType.both);
foreach(t; tests) {
parser.execute(t.raw);
}
assert(parser.testCase == tests.length);
}
|
D
|
instance DIA_Haupttorwache_EXIT(C_Info)
{
npc = VLK_4143_HaupttorWache;
nr = 999;
condition = DIA_Haupttorwache_EXIT_Condition;
information = DIA_Haupttorwache_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Haupttorwache_EXIT_Condition()
{
return TRUE;
};
func void DIA_Haupttorwache_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Haupttorwache_AUFGABE(C_Info)
{
npc = VLK_4143_HaupttorWache;
nr = 4;
condition = DIA_Haupttorwache_AUFGABE_Condition;
information = DIA_Haupttorwache_AUFGABE_Info;
permanent = TRUE;
description = "What's your job?";
};
func int DIA_Haupttorwache_AUFGABE_Condition()
{
return TRUE;
};
func void DIA_Haupttorwache_AUFGABE_Info()
{
AI_Output(other,self,"DIA_Haupttorwache_AUFGABE_15_00"); //What's your task?
AI_Output(self,other,"DIA_Haupttorwache_AUFGABE_13_01"); //My assignment is simple. I'm supposed to make sure that the orcs stay away more than 30 feet from the gate.
AI_Output(self,other,"DIA_Haupttorwache_AUFGABE_13_02"); //If they try to break through the portcullis, I sound the alarm. That's all.
};
instance DIA_Haupttorwache_TOROEFFNEN(C_Info)
{
npc = VLK_4143_HaupttorWache;
nr = 5;
condition = DIA_Haupttorwache_TOROEFFNEN_Condition;
information = DIA_Haupttorwache_TOROEFFNEN_Info;
permanent = TRUE;
description = "What would one have to do to open the main gate?";
};
func int DIA_Haupttorwache_TOROEFFNEN_Condition()
{
if(Kapitel >= 5)
{
return TRUE;
};
};
func void DIA_Haupttorwache_TOROEFFNEN_Info()
{
AI_Output(other,self,"DIA_Haupttorwache_TOROEFFNEN_15_00"); //What would one have to do to open the main gate?
AI_Output(self,other,"DIA_Haupttorwache_TOROEFFNEN_13_01"); //For heaven's sake. Why would you want to know that?
self.flags = 0;
Info_ClearChoices(DIA_Haupttorwache_TOROEFFNEN);
Info_AddChoice(DIA_Haupttorwache_TOROEFFNEN,"I'm worried about the safety of the castle.",DIA_Haupttorwache_TOROEFFNEN_sicherheit);
Info_AddChoice(DIA_Haupttorwache_TOROEFFNEN,"Never mind. Just asking.",DIA_Haupttorwache_TOROEFFNEN_frage);
};
func void DIA_Haupttorwache_TOROEFFNEN_sicherheit()
{
AI_Output(other,self,"DIA_Haupttorwache_TOROEFFNEN_sicherheit_15_00"); //I'm worried about the safety of the castle.
AI_Output(self,other,"DIA_Haupttorwache_TOROEFFNEN_sicherheit_13_01"); //So am I, all the time, believe me.
AI_Output(self,other,"DIA_Haupttorwache_TOROEFFNEN_sicherheit_13_02"); //And since I am such a faithful guardian, Garond has finally entrusted the key to the gate room to me.
AI_Output(self,other,"DIA_Haupttorwache_TOROEFFNEN_sicherheit_13_03"); //(proudly) That's a great responsibility. I shall guard it well. I had to swear that to Garond.
AI_Output(self,other,"DIA_Haupttorwache_TOROEFFNEN_sicherheit_13_04"); //Yes. Just imagine someone coming and simply pulling the lever to open the gate, and that rusty, old steel grating getting jammed.
AI_Output(self,other,"DIA_Haupttorwache_TOROEFFNEN_sicherheit_13_05"); //Nobody could close the gate then. I mustn't think about what would happen next. It's a good thing no one knows that I have the key.
AI_StopProcessInfos(self);
};
func void DIA_Haupttorwache_TOROEFFNEN_frage()
{
AI_Output(other,self,"DIA_Haupttorwache_TOROEFFNEN_frage_15_00"); //Never mind. Just asking.
AI_Output(self,other,"DIA_Haupttorwache_TOROEFFNEN_frage_13_01"); //Don't invite trouble by talking like that. Times are hard enough as it is. Now go. I'm busy.
AI_StopProcessInfos(self);
};
instance DIA_Haupttorwache_PICKPOCKET(C_Info)
{
npc = VLK_4143_HaupttorWache;
nr = 900;
condition = DIA_Haupttorwache_PICKPOCKET_Condition;
information = DIA_Haupttorwache_PICKPOCKET_Info;
permanent = TRUE;
description = "(It would be child's play to steal his key)";
};
func int DIA_Haupttorwache_PICKPOCKET_Condition()
{
if((Npc_GetTalentSkill(other,NPC_TALENT_PICKPOCKET) == 1) && (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE) && (Npc_HasItems(self,itke_oc_maingate_mis) >= 1) && (Kapitel >= 5) && (other.attribute[ATR_DEXTERITY] >= (20 - Theftdiff)))
{
return TRUE;
};
};
func void DIA_Haupttorwache_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Haupttorwache_PICKPOCKET);
Info_AddChoice(DIA_Haupttorwache_PICKPOCKET,Dialog_Back,DIA_Haupttorwache_PICKPOCKET_BACK);
Info_AddChoice(DIA_Haupttorwache_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Haupttorwache_PICKPOCKET_DoIt);
};
func void DIA_Haupttorwache_PICKPOCKET_DoIt()
{
if(other.attribute[ATR_DEXTERITY] >= 20)
{
B_GiveInvItems(self,other,itke_oc_maingate_mis,1);
self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE;
B_GivePlayerXP(XP_Ambient);
Info_ClearChoices(DIA_Haupttorwache_PICKPOCKET);
}
else
{
AI_StopProcessInfos(self);
B_Attack(self,other,AR_Theft,1);
};
};
func void DIA_Haupttorwache_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Haupttorwache_PICKPOCKET);
};
|
D
|
# FIXED
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/stack/ble_dispatch_lite.c
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_snv.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/../_common/cc26xx/_hal_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/stdint.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/_stdint40.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/stdint.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/cdefs.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/machine/_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/machine/_stdint.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/_stdint.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/stdbool.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_board_cfg.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_mcu.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/inc/hal_defs.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_nvic.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_ints.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/../inc/hw_chip_def.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_gpio.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_memmap.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/systick.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/debug.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/interrupt.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/cpu.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_cpu_scs.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../driverlib/rom.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/uart.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_uart.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/gpio.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/flash.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_flash.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_aon_sysctl.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_fcfg1.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/ioc.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_ioc.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/src/inc/icall.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/stdlib.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/_ti_config.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/linkage.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/inc/hal_assert.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_bufmgr.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/ble_dispatch.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/ble_dispatch_lite.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/sm.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/bcomdef.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/comdef.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/limits.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_memory.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_timers.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_ae.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/cc26xx/rf_hal.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ble.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_wl.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_common.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/rf/RF.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/dpl/ClockP.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/stddef.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/dpl/SemaphoreP.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/utils/List.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/DeviceFamily.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_common_cmd.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_mailbox.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/ti-cgt-arm_18.12.5.LTS/include/string.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_prop_cmd.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_ble_cmd.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_scheduler.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_config.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_user_config.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/ble_user_config.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/src/inc/icall_user_config.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gatt.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/att.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/l2cap.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gatt_uuid.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gattservapp.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gapbondmgr.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/icall_ble_apimsg.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_ext.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_tl.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_data.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_event.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_tl.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gapgattserver.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/linkdb.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/linkdb_internal.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap_advertiser.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap_scanner.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap_initiator.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gatt_profile_uuid.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/../rom/rom_jt.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/../rom/map_direct.h
ICallBLE/ble_dispatch_lite.obj: C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/src/inc/icall_lite_translation.h
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/stack/ble_dispatch_lite.c:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_snv.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/../_common/cc26xx/_hal_types.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/stdint.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/_stdint40.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/stdint.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/cdefs.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/_types.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/machine/_types.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/machine/_stdint.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/sys/_stdint.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/stdbool.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_board_cfg.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_mcu.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/inc/hal_defs.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_nvic.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_ints.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_types.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/../inc/hw_chip_def.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_gpio.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_memmap.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/systick.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/debug.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/interrupt.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/cpu.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_cpu_scs.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../driverlib/rom.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/uart.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_uart.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/gpio.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/flash.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_flash.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_aon_sysctl.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_fcfg1.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/ioc.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/../inc/hw_ioc.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/src/inc/icall.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/stdlib.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/_ti_config.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/linkage.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/inc/hal_assert.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_bufmgr.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/ble_dispatch.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/ble_dispatch_lite.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/sm.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/bcomdef.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/comdef.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/limits.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_memory.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/osal/src/inc/osal_timers.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_ae.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/cc26xx/rf_hal.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ble.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_wl.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_common.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/rf/RF.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/dpl/ClockP.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/stddef.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/dpl/SemaphoreP.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/utils/List.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/DeviceFamily.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_common_cmd.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_mailbox.h:
C:/ti/ti-cgt-arm_18.12.5.LTS/include/string.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_prop_cmd.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/driverlib/rf_ble_cmd.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_scheduler.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_config.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/controller/cc26xx/inc/ll_user_config.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/ble_user_config.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/src/inc/icall_user_config.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gatt.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/att.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/l2cap.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gatt_uuid.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gattservapp.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gapbondmgr.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/inc/icall_ble_apimsg.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_ext.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_tl.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_data.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_event.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/hci_tl.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gapgattserver.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/linkdb.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/linkdb_internal.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap_advertiser.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap_scanner.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gap_initiator.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/gatt_profile_uuid.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/../rom/rom_jt.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/inc/../rom/map_direct.h:
C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/ble5stack/icall/src/inc/icall_lite_translation.h:
|
D
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_21_MobileMedia-1744741917.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_21_MobileMedia-1744741917.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
INSTANCE Mod_556_NOV_Theodor_NW (Npc_Default)
{
// ------ NSC ------
name = "Novize";
guild = GIL_VLK;
id = 556;
voice = 13;
flags = 0;
npctype = NPCTYPE_nw_feuernovize;
B_SetAttributesToChapter (self, 2);
fight_tactic = FAI_HUMAN_COWARD;
aivar[AIV_MagicUser] = MAGIC_ALWAYS;
EquipItem (self, ItMw_1h_Nov_Mace);
B_CreateAmbientInv (self);
CreateInvItems (self,ItSc_Sleep,1);
B_SetNpcVisual (self, MALE, "Hum_Head_Thief", Face_P_Tough_Torrez, BodyTex_P, ITAR_NOV_L);
Mdl_SetModelFatness (self, -1);
Mdl_ApplyOverlayMds (self, "Humans_Mage.mds");
B_GiveNpcTalents (self);
B_SetFightSkills (self, 25);
daily_routine = Rtn_Start_556;
};
FUNC VOID Rtn_Start_556()
{
TA_Stomp_Herb (08,00,10,00,"NW_MONASTERY_WINEMAKER_04");
TA_Stomp_Herb (10,00,11,00,"NW_MONASTERY_WINEMAKER_04");
TA_Stomp_Herb (11,00,23,30,"NW_MONASTERY_WINEMAKER_04");
TA_Stomp_Herb (23,30,08,00,"NW_MONASTERY_WINEMAKER_04");
};
|
D
|
/Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/SPMDanger.swift.o : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerCommand.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Runtime.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CreateConfig.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/GetDangerJSPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerfileArgumentsPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerSwiftOption.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerJSVersionFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/ImportsFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/SPMDanger.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgsParser.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/HelpMessagePresenter.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/DangerFileGenerator.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgs.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/NSRegularExpression+FilesImport.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.swiftmodule /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.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/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Require.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/MarathonCore.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Danger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerFixtures.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Releases.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/OctoKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RequestKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/dangertest.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/ShellOut.build/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/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/SPMDanger~partial.swiftmodule : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerCommand.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Runtime.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CreateConfig.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/GetDangerJSPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerfileArgumentsPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerSwiftOption.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerJSVersionFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/ImportsFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/SPMDanger.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgsParser.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/HelpMessagePresenter.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/DangerFileGenerator.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgs.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/NSRegularExpression+FilesImport.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.swiftmodule /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.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/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Require.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/MarathonCore.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Danger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerFixtures.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Releases.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/OctoKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RequestKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/dangertest.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/ShellOut.build/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/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/SPMDanger~partial.swiftdoc : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerCommand.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Runtime.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CreateConfig.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/GetDangerJSPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerfileArgumentsPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerSwiftOption.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerJSVersionFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/ImportsFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/SPMDanger.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgsParser.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/HelpMessagePresenter.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/DangerFileGenerator.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgs.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/NSRegularExpression+FilesImport.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.swiftmodule /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.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/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Require.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/MarathonCore.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Danger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerFixtures.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Releases.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/OctoKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RequestKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/dangertest.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/ShellOut.build/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/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/SPMDanger~partial.swiftsourceinfo : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerCommand.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Runtime.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CreateConfig.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/GetDangerJSPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerfileArgumentsPath.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerSwiftOption.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/DangerJSVersionFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/ImportsFinder.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/SPMDanger.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgsParser.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/HelpMessagePresenter.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/Files\ Import/DangerFileGenerator.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/CliArgs/CliArgs.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/swift/Sources/RunnerLib/NSRegularExpression+FilesImport.swift /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.swiftmodule /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.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/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RunnerLib.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Require.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/MarathonCore.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Logger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Danger.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerShellExecutor.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/DangerFixtures.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Releases.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/OctoKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/RequestKit.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/dangertest.build/module.modulemap /Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/ShellOut.build/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
|
; 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_aget_char_7.java
.class public dot.junit.opcodes.aget_char.d.T_aget_char_7
.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([CI)C
.limit regs 9
aget-char v0, v7, v6
return v0
.end method
|
D
|
/Users/davefol/punts/rust/competitive-programming-in-rust/codeforces/149_div2/B_Big_Segment/target/debug/deps/template-6cc8aa51f936b7c6.rmeta: src/main.rs
/Users/davefol/punts/rust/competitive-programming-in-rust/codeforces/149_div2/B_Big_Segment/target/debug/deps/template-6cc8aa51f936b7c6.d: src/main.rs
src/main.rs:
|
D
|
/Users/jaison/Documents/Drive/custom-api/.build/debug/JSON.build/JSONRepresentable.swift.o : /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/File.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Bytes.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Equatable.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Node.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Parse.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Serialize.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSONRepresentable.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/Sequence+Convertible.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/jaison/Documents/Drive/custom-api/.build/debug/Node.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/PathIndexable.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Polymorphic.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/CLibreSSL.build/module.modulemap /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/jaison/Documents/Drive/custom-api/.build/debug/libc.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Jay.swiftmodule
/Users/jaison/Documents/Drive/custom-api/.build/debug/JSON.build/JSONRepresentable~partial.swiftmodule : /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/File.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Bytes.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Equatable.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Node.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Parse.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Serialize.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSONRepresentable.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/Sequence+Convertible.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/jaison/Documents/Drive/custom-api/.build/debug/Node.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/PathIndexable.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Polymorphic.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/CLibreSSL.build/module.modulemap /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/jaison/Documents/Drive/custom-api/.build/debug/libc.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Jay.swiftmodule
/Users/jaison/Documents/Drive/custom-api/.build/debug/JSON.build/JSONRepresentable~partial.swiftdoc : /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/File.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Bytes.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Equatable.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Node.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Parse.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON+Serialize.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSON.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/JSONRepresentable.swift /Users/jaison/Documents/Drive/custom-api/Packages/JSON-1.0.6/Sources/JSON/Sequence+Convertible.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/jaison/Documents/Drive/custom-api/.build/debug/Node.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/PathIndexable.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Polymorphic.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/CLibreSSL.build/module.modulemap /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/jaison/Documents/Drive/custom-api/.build/debug/libc.swiftmodule /Users/jaison/Documents/Drive/custom-api/.build/debug/Jay.swiftmodule
|
D
|
// REQUIRED_ARGS:
// PERMUTE_ARGS: -mcpu=native -inline -O
version (D_SIMD)
{
import core.simd;
import core.stdc.stdio;
import core.stdc.string;
alias TypeTuple(T...) = T;
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=16087
static if (__traits(compiles, void8)) static assert(void8.alignof == 8);
static if (__traits(compiles, double1)) static assert(double1.alignof == 8);
static if (__traits(compiles, float2)) static assert(float2.alignof == 8);
static if (__traits(compiles, byte8)) static assert(byte8.alignof == 8);
static if (__traits(compiles, ubyte8)) static assert(ubyte8.alignof == 8);
static if (__traits(compiles, short4)) static assert(short4.alignof == 8);
static if (__traits(compiles, ushort4)) static assert(ushort4.alignof == 8);
static if (__traits(compiles, int2)) static assert(int2.alignof == 8);
static if (__traits(compiles, uint2)) static assert(uint2.alignof == 8);
static if (__traits(compiles, long1)) static assert(long1.alignof == 8);
static if (__traits(compiles, ulong1)) static assert(ulong1.alignof == 8);
static if (__traits(compiles, void8)) static assert(void8.sizeof == 8);
static if (__traits(compiles, double1)) static assert(double1.sizeof == 8);
static if (__traits(compiles, float2)) static assert(float2.sizeof == 8);
static if (__traits(compiles, byte8)) static assert(byte8.sizeof == 8);
static if (__traits(compiles, ubyte8)) static assert(ubyte8.sizeof == 8);
static if (__traits(compiles, short4)) static assert(short4.sizeof == 8);
static if (__traits(compiles, ushort4)) static assert(ushort4.sizeof == 8);
static if (__traits(compiles, int2)) static assert(int2.sizeof == 8);
static if (__traits(compiles, uint2)) static assert(uint2.sizeof == 8);
static if (__traits(compiles, long1)) static assert(long1.sizeof == 8);
static if (__traits(compiles, ulong1)) static assert(ulong1.sizeof == 8);
static if (__traits(compiles, void16)) static assert(void16.alignof == 16);
static if (__traits(compiles, double2)) static assert(double2.alignof == 16);
static if (__traits(compiles, float4)) static assert(float4.alignof == 16);
static if (__traits(compiles, byte16)) static assert(byte16.alignof == 16);
static if (__traits(compiles, ubyte16)) static assert(ubyte16.alignof == 16);
static if (__traits(compiles, short8)) static assert(short8.alignof == 16);
static if (__traits(compiles, ushort8)) static assert(ushort8.alignof == 16);
static if (__traits(compiles, int4)) static assert(int4.alignof == 16);
static if (__traits(compiles, uint4)) static assert(uint4.alignof == 16);
static if (__traits(compiles, long2)) static assert(long2.alignof == 16);
static if (__traits(compiles, ulong2)) static assert(ulong2.alignof == 16);
static if (__traits(compiles, void16)) static assert(void16.sizeof == 16);
static if (__traits(compiles, double2)) static assert(double2.sizeof == 16);
static if (__traits(compiles, float4)) static assert(float4.sizeof == 16);
static if (__traits(compiles, byte16)) static assert(byte16.sizeof == 16);
static if (__traits(compiles, ubyte16)) static assert(ubyte16.sizeof == 16);
static if (__traits(compiles, short8)) static assert(short8.sizeof == 16);
static if (__traits(compiles, ushort8)) static assert(ushort8.sizeof == 16);
static if (__traits(compiles, int4)) static assert(int4.sizeof == 16);
static if (__traits(compiles, uint4)) static assert(uint4.sizeof == 16);
static if (__traits(compiles, long2)) static assert(long2.sizeof == 16);
static if (__traits(compiles, ulong2)) static assert(ulong2.sizeof == 16);
static if (__traits(compiles, void32)) static assert(void32.alignof == 32);
static if (__traits(compiles, double4)) static assert(double4.alignof == 32);
static if (__traits(compiles, float8)) static assert(float8.alignof == 32);
static if (__traits(compiles, byte32)) static assert(byte32.alignof == 32);
static if (__traits(compiles, ubyte32)) static assert(ubyte32.alignof == 32);
static if (__traits(compiles, short16)) static assert(short16.alignof == 32);
static if (__traits(compiles, ushort16)) static assert(ushort16.alignof == 32);
static if (__traits(compiles, int8)) static assert(int8.alignof == 32);
static if (__traits(compiles, uint8)) static assert(uint8.alignof == 32);
static if (__traits(compiles, long4)) static assert(long4.alignof == 32);
static if (__traits(compiles, ulong4)) static assert(ulong4.alignof == 32);
static if (__traits(compiles, void32)) static assert(void32.sizeof == 32);
static if (__traits(compiles, double4)) static assert(double4.sizeof == 32);
static if (__traits(compiles, float8)) static assert(float8.sizeof == 32);
static if (__traits(compiles, byte32)) static assert(byte32.sizeof == 32);
static if (__traits(compiles, ubyte32)) static assert(ubyte32.sizeof == 32);
static if (__traits(compiles, short16)) static assert(short16.sizeof == 32);
static if (__traits(compiles, ushort16)) static assert(ushort16.sizeof == 32);
static if (__traits(compiles, int8)) static assert(int8.sizeof == 32);
static if (__traits(compiles, uint8)) static assert(uint8.sizeof == 32);
static if (__traits(compiles, long4)) static assert(long4.sizeof == 32);
static if (__traits(compiles, ulong4)) static assert(ulong4.sizeof == 32);
static if (__traits(compiles, void64)) static assert(void64.alignof == 64);
static if (__traits(compiles, double8)) static assert(double8.alignof == 64);
static if (__traits(compiles, float16)) static assert(float16.alignof == 64);
static if (__traits(compiles, byte64)) static assert(byte64.alignof == 64);
static if (__traits(compiles, ubyte64)) static assert(ubyte64.alignof == 64);
static if (__traits(compiles, short32)) static assert(short32.alignof == 64);
static if (__traits(compiles, ushort32)) static assert(ushort32.alignof == 64);
static if (__traits(compiles, int16)) static assert(int16.alignof == 64);
static if (__traits(compiles, uint16)) static assert(uint16.alignof == 64);
static if (__traits(compiles, long8)) static assert(long8.alignof == 64);
static if (__traits(compiles, ulong8)) static assert(ulong8.alignof == 64);
static if (__traits(compiles, void64)) static assert(void64.sizeof == 64);
static if (__traits(compiles, double8)) static assert(double8.sizeof == 64);
static if (__traits(compiles, float16)) static assert(float16.sizeof == 64);
static if (__traits(compiles, byte64)) static assert(byte64.sizeof == 64);
static if (__traits(compiles, ubyte64)) static assert(ubyte64.sizeof == 64);
static if (__traits(compiles, short32)) static assert(short32.sizeof == 64);
static if (__traits(compiles, ushort32)) static assert(ushort32.sizeof == 64);
static if (__traits(compiles, int16)) static assert(int16.sizeof == 64);
static if (__traits(compiles, uint16)) static assert(uint16.sizeof == 64);
static if (__traits(compiles, long8)) static assert(long8.sizeof == 64);
static if (__traits(compiles, ulong8)) static assert(ulong8.sizeof == 64);
/*****************************************/
void test1()
{
void16 v1 = void,v2 = void;
byte16 b;
v2 = b;
v1 = v2;
static assert(!__traits(compiles, v1 + v2));
static assert(!__traits(compiles, v1 - v2));
static assert(!__traits(compiles, v1 * v2));
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
static assert(!__traits(compiles, v1 & v2));
static assert(!__traits(compiles, v1 | v2));
static assert(!__traits(compiles, v1 ^ v2));
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
static assert(!__traits(compiles, ~v1));
static assert(!__traits(compiles, -v1));
static assert(!__traits(compiles, +v1));
static assert(!__traits(compiles, !v1));
static assert(!__traits(compiles, v1 += v2));
static assert(!__traits(compiles, v1 -= v2));
static assert(!__traits(compiles, v1 *= v2));
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
static assert(!__traits(compiles, v1 &= v2));
static assert(!__traits(compiles, v1 |= v2));
static assert(!__traits(compiles, v1 ^= v2));
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2()
{
byte16 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
static assert(!__traits(compiles, v1 * v2));
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
static assert(!__traits(compiles, v1 *= v2));
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2b()
{
ubyte16 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
static assert(!__traits(compiles, v1 * v2));
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
static assert(!__traits(compiles, v1 *= v2));
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2c()
{
short8 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
v1 = v2 * v3;
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
v1 *= v2;
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
v1 = v1 * 3;
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2d()
{
ushort8 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
v1 = v2 * v3;
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
v1 *= v2;
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2e()
{
int4 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
static if (__traits(compiles, { v1 = v2 * v3; })) // SSE4.1
v1 = v2 * v3;
else
static assert(!__traits(compiles, v1 * v2));
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
static if (__traits(compiles, { v1 *= v2; })) // SSE4.1
v1 *= v2;
else
static assert(!__traits(compiles, v1 *= v2));
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2f()
{
uint4 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
static if (__traits(compiles, { v1 = v2 * v3; })) // SSE4.1
v1 = v2 * v3;
else
static assert(!__traits(compiles, v1 * v2));
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
static if (__traits(compiles, { v1 *= v2; })) // SSE4.1
v1 *= v2;
else
static assert(!__traits(compiles, v1 *= v2));
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2g()
{
long2 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
static assert(!__traits(compiles, v1 * v2));
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
static assert(!__traits(compiles, v1 *= v2));
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2h()
{
ulong2 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
static assert(!__traits(compiles, v1 * v2));
static assert(!__traits(compiles, v1 / v2));
static assert(!__traits(compiles, v1 % v2));
v1 = v2 & v3;
v1 = v2 | v3;
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
v1 = ~v2;
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
static assert(!__traits(compiles, v1 *= v2));
static assert(!__traits(compiles, v1 /= v2));
static assert(!__traits(compiles, v1 %= v2));
v1 &= v2;
v1 |= v2;
v1 ^= v2;
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2i()
{
float4 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
v1 = v2 * v3;
v1 = v2 / v3;
static assert(!__traits(compiles, v1 % v2));
static assert(!__traits(compiles, v1 & v2));
static assert(!__traits(compiles, v1 | v2));
static assert(!__traits(compiles, v1 ^ v2));
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
static assert(!__traits(compiles, ~v1));
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
v1 *= v2;
v1 /= v2;
static assert(!__traits(compiles, v1 %= v2));
static assert(!__traits(compiles, v1 &= v2));
static assert(!__traits(compiles, v1 |= v2));
static assert(!__traits(compiles, v1 ^= v2));
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
void test2j()
{
double2 v1, v2 = 1, v3 = 1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
v1 = v2 * v3;
v1 = v2 / v3;
static assert(!__traits(compiles, v1 % v2));
static assert(!__traits(compiles, v1 & v2));
static assert(!__traits(compiles, v1 | v2));
static assert(!__traits(compiles, v1 ^ v2));
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
static assert(!__traits(compiles, v1 is v2));
static assert(!__traits(compiles, v1 !is v2));
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
static assert( __traits(compiles, v1 > v2));
static assert( __traits(compiles, v1 <= v2));
static assert( __traits(compiles, v1 >= v2));
static assert(!__traits(compiles, v1 << 1));
static assert(!__traits(compiles, v1 >> 1));
static assert(!__traits(compiles, v1 >>> 1));
static assert(!__traits(compiles, v1 && v2));
static assert(!__traits(compiles, v1 || v2));
static assert(!__traits(compiles, ~v1));
v1 = -v2;
v1 = +v2;
static assert(!__traits(compiles, !v1));
v1 += v2;
v1 -= v2;
v1 *= v2;
v1 /= v2;
static assert(!__traits(compiles, v1 %= v2));
static assert(!__traits(compiles, v1 &= v2));
static assert(!__traits(compiles, v1 |= v2));
static assert(!__traits(compiles, v1 ^= v2));
static assert(!__traits(compiles, v1 ~= v2));
static assert(!__traits(compiles, v1 ^^= v2));
static assert(!__traits(compiles, v1 <<= 1));
static assert(!__traits(compiles, v1 >>= 1));
static assert(!__traits(compiles, v1 >>>= 1));
// A cast from vector to non-vector is allowed only when the target is same size Tsarray.
static assert(!__traits(compiles, cast(byte)v1)); // 1byte
static assert(!__traits(compiles, cast(short)v1)); // 2byte
static assert(!__traits(compiles, cast(int)v1)); // 4byte
static assert(!__traits(compiles, cast(long)v1)); // 8byte
static assert(!__traits(compiles, cast(float)v1)); // 4byte
static assert(!__traits(compiles, cast(double)v1)); // 8byte
static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray
static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK
static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK
}
/*****************************************/
float4 test3()
{
float4 a;
a = cast(float4)__simd(XMM.PXOR, a, a);
return a;
}
/*****************************************/
void test4()
{
int4 c = 7;
(cast(int[4])c)[3] = 4;
(cast(int*)&c)[2] = 4;
c.array[1] = 4;
c.ptr[3] = 4;
assert(c.length == 4);
}
/*****************************************/
void BaseTypeOfVector(T : __vector(T[N]), size_t N)(int i)
{
assert(is(T == int));
assert(N == 4);
}
void test7411()
{
BaseTypeOfVector!(__vector(int[4]))(3);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=7951
float[4] test7951()
{
float4 v1;
float4 v2;
return cast(float[4])(v1+v2);
}
/*****************************************/
void test7951_2()
{
float[4] v1 = [1,2,3,4];
float[4] v2 = [1,2,3,4];
float4 f1, f2, f3;
f1.array = v1;
f2.array = v2;
f3 = f1 + f2;
assert((cast(float[4])f3)[2] == 6);
}
/*****************************************/
void test7949()
{
int[4] o = [1,2,3,4];
int4 v1;
v1.array = o;
int4 v2;
v2.array = o;
auto r = __simd(XMM.ADDPS, v1,v2);
assert(cast(int[4])r.array == [2, 4, 6, 8]);
}
/*****************************************/
immutable ulong2 gulong2 = 0x8000_0000_0000_0000;
immutable uint4 guint4 = 0x8000_0000;
immutable ushort8 gushort8 = 0x8000;
immutable ubyte16 gubyte16 = 0x80;
immutable long2 glong2 = 0x7000_0000_0000_0000;
immutable int4 gint4 = 0x7000_0000;
immutable short8 gshort8 = 0x7000;
immutable byte16 gbyte16 = 0x70;
immutable float4 gfloat4 = 4.0;
immutable double2 gdouble2 = 8.0;
void test7414()
{
immutable ulong2 lulong2 = 0x8000_0000_0000_0000;
assert(memcmp(&lulong2, &gulong2, gulong2.sizeof) == 0);
immutable uint4 luint4 = 0x8000_0000;
assert(memcmp(&luint4, &guint4, guint4.sizeof) == 0);
immutable ushort8 lushort8 = 0x8000;
assert(memcmp(&lushort8, &gushort8, gushort8.sizeof) == 0);
immutable ubyte16 lubyte16 = 0x80;
assert(memcmp(&lubyte16, &gubyte16, gubyte16.sizeof) == 0);
immutable long2 llong2 = 0x7000_0000_0000_0000;
assert(memcmp(&llong2, &glong2, glong2.sizeof) == 0);
immutable int4 lint4 = 0x7000_0000;
assert(memcmp(&lint4, &gint4, gint4.sizeof) == 0);
immutable short8 lshort8 = 0x7000;
assert(memcmp(&lshort8, &gshort8, gshort8.sizeof) == 0);
immutable byte16 lbyte16 = 0x70;
assert(memcmp(&lbyte16, &gbyte16, gbyte16.sizeof) == 0);
immutable float4 lfloat4 = 4.0;
assert(memcmp(&lfloat4, &gfloat4, gfloat4.sizeof) == 0);
immutable double2 ldouble2 = 8.0;
assert(memcmp(&ldouble2, &gdouble2, gdouble2.sizeof) == 0);
}
/*****************************************/
void test7413()
{
byte16 b = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
assert(b.array[0] == 1);
assert(b.array[1] == 2);
assert(b.array[2] == 3);
assert(b.array[3] == 4);
assert(b.array[4] == 5);
assert(b.array[5] == 6);
assert(b.array[6] == 7);
assert(b.array[7] == 8);
assert(b.array[8] == 9);
assert(b.array[9] == 10);
assert(b.array[10] == 11);
assert(b.array[11] == 12);
assert(b.array[12] == 13);
assert(b.array[13] == 14);
assert(b.array[14] == 15);
assert(b.array[15] == 16);
ubyte16 ub = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
assert(ub.array[0] == 1);
assert(ub.array[1] == 2);
assert(ub.array[2] == 3);
assert(ub.array[3] == 4);
assert(ub.array[4] == 5);
assert(ub.array[5] == 6);
assert(ub.array[6] == 7);
assert(ub.array[7] == 8);
assert(ub.array[8] == 9);
assert(ub.array[9] == 10);
assert(ub.array[10] == 11);
assert(ub.array[11] == 12);
assert(ub.array[12] == 13);
assert(ub.array[13] == 14);
assert(ub.array[14] == 15);
assert(ub.array[15] == 16);
short8 s = [1,2,3,4,5,6,7,8];
assert(s.array[0] == 1);
assert(s.array[1] == 2);
assert(s.array[2] == 3);
assert(s.array[3] == 4);
assert(s.array[4] == 5);
assert(s.array[5] == 6);
assert(s.array[6] == 7);
assert(s.array[7] == 8);
ushort8 us = [1,2,3,4,5,6,7,8];
assert(us.array[0] == 1);
assert(us.array[1] == 2);
assert(us.array[2] == 3);
assert(us.array[3] == 4);
assert(us.array[4] == 5);
assert(us.array[5] == 6);
assert(us.array[6] == 7);
assert(us.array[7] == 8);
int4 i = [1,2,3,4];
assert(i.array[0] == 1);
assert(i.array[1] == 2);
assert(i.array[2] == 3);
assert(i.array[3] == 4);
uint4 ui = [1,2,3,4];
assert(ui.array[0] == 1);
assert(ui.array[1] == 2);
assert(ui.array[2] == 3);
assert(ui.array[3] == 4);
long2 l = [1,2];
assert(l.array[0] == 1);
assert(l.array[1] == 2);
ulong2 ul = [1,2];
assert(ul.array[0] == 1);
assert(ul.array[1] == 2);
float4 f = [1,2,3,4];
assert(f.array[0] == 1);
assert(f.array[1] == 2);
assert(f.array[2] == 3);
assert(f.array[3] == 4);
double2 d = [1,2];
assert(d.array[0] == 1);
assert(d.array[1] == 2);
}
/*****************************************/
byte16 b = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
ubyte16 ub = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
short8 s = [1,2,3,4,5,6,7,8];
ushort8 us = [1,2,3,4,5,6,7,8];
int4 i = [1,2,3,4];
uint4 ui = [1,2,3,4];
long2 l = [1,2];
ulong2 ul = [1,2];
float4 f = [1,2,3,4];
double2 d = [1,2];
void test7413_2()
{
assert(b.array[0] == 1);
assert(b.array[1] == 2);
assert(b.array[2] == 3);
assert(b.array[3] == 4);
assert(b.array[4] == 5);
assert(b.array[5] == 6);
assert(b.array[6] == 7);
assert(b.array[7] == 8);
assert(b.array[8] == 9);
assert(b.array[9] == 10);
assert(b.array[10] == 11);
assert(b.array[11] == 12);
assert(b.array[12] == 13);
assert(b.array[13] == 14);
assert(b.array[14] == 15);
assert(b.array[15] == 16);
assert(ub.array[0] == 1);
assert(ub.array[1] == 2);
assert(ub.array[2] == 3);
assert(ub.array[3] == 4);
assert(ub.array[4] == 5);
assert(ub.array[5] == 6);
assert(ub.array[6] == 7);
assert(ub.array[7] == 8);
assert(ub.array[8] == 9);
assert(ub.array[9] == 10);
assert(ub.array[10] == 11);
assert(ub.array[11] == 12);
assert(ub.array[12] == 13);
assert(ub.array[13] == 14);
assert(ub.array[14] == 15);
assert(ub.array[15] == 16);
assert(s.array[0] == 1);
assert(s.array[1] == 2);
assert(s.array[2] == 3);
assert(s.array[3] == 4);
assert(s.array[4] == 5);
assert(s.array[5] == 6);
assert(s.array[6] == 7);
assert(s.array[7] == 8);
assert(us.array[0] == 1);
assert(us.array[1] == 2);
assert(us.array[2] == 3);
assert(us.array[3] == 4);
assert(us.array[4] == 5);
assert(us.array[5] == 6);
assert(us.array[6] == 7);
assert(us.array[7] == 8);
assert(i.array[0] == 1);
assert(i.array[1] == 2);
assert(i.array[2] == 3);
assert(i.array[3] == 4);
assert(ui.array[0] == 1);
assert(ui.array[1] == 2);
assert(ui.array[2] == 3);
assert(ui.array[3] == 4);
assert(l.array[0] == 1);
assert(l.array[1] == 2);
assert(ul.array[0] == 1);
assert(ul.array[1] == 2);
assert(f.array[0] == 1);
assert(f.array[1] == 2);
assert(f.array[2] == 3);
assert(f.array[3] == 4);
assert(d.array[0] == 1);
assert(d.array[1] == 2);
}
/*****************************************/
float bug8060(float x) {
int i = *cast(int*)&x;
++i;
return *cast(float*)&i;
}
/*****************************************/
float4 test5(void16 a, void16 b)
{
a = __simd(XMM.ADDPD, a, b);
a = __simd(XMM.ADDSS, a, b);
a = __simd(XMM.ADDSD, a, b);
a = __simd(XMM.ADDPS, a, b);
a = __simd(XMM.PADDB, a, b);
a = __simd(XMM.PADDW, a, b);
a = __simd(XMM.PADDD, a, b);
a = __simd(XMM.PADDQ, a, b);
a = __simd(XMM.SUBPD, a, b);
a = __simd(XMM.SUBSS, a, b);
a = __simd(XMM.SUBSD, a, b);
a = __simd(XMM.SUBPS, a, b);
a = __simd(XMM.PSUBB, a, b);
a = __simd(XMM.PSUBW, a, b);
a = __simd(XMM.PSUBD, a, b);
a = __simd(XMM.PSUBQ, a, b);
a = __simd(XMM.MULPD, a, b);
a = __simd(XMM.MULSS, a, b);
a = __simd(XMM.MULSD, a, b);
a = __simd(XMM.MULPS, a, b);
a = __simd(XMM.PMULLW, a, b);
a = __simd(XMM.DIVPD, a, b);
a = __simd(XMM.DIVSS, a, b);
a = __simd(XMM.DIVSD, a, b);
a = __simd(XMM.DIVPS, a, b);
a = __simd(XMM.PAND, a, b);
a = __simd(XMM.POR, a, b);
a = __simd(XMM.UCOMISS, a, b);
a = __simd(XMM.UCOMISD, a, b);
a = __simd(XMM.XORPS, a, b);
a = __simd(XMM.XORPD, a, b);
a = __simd_sto(XMM.STOSS, a, b);
a = __simd_sto(XMM.STOSD, a, b);
a = __simd_sto(XMM.STOD, a, b);
a = __simd_sto(XMM.STOQ, a, b);
a = __simd_sto(XMM.STOAPS, a, b);
a = __simd_sto(XMM.STOAPD, a, b);
a = __simd_sto(XMM.STODQA, a, b);
a = __simd_sto(XMM.STOUPS, a, b);
a = __simd_sto(XMM.STOUPD, a, b);
a = __simd_sto(XMM.STODQU, a, b);
a = __simd_sto(XMM.STOHPD, a, b);
a = __simd_sto(XMM.STOHPS, a, b);
a = __simd_sto(XMM.STOLPD, a, b);
a = __simd_sto(XMM.STOLPS, a, b);
a = __simd(XMM.LODSS, a);
a = __simd(XMM.LODSD, a);
a = __simd(XMM.LODAPS, a);
a = __simd(XMM.LODAPD, a);
a = __simd(XMM.LODDQA, a);
a = __simd(XMM.LODUPS, a);
a = __simd(XMM.LODUPD, a);
a = __simd(XMM.LODDQU, a);
a = __simd(XMM.LODD, a);
a = __simd(XMM.LODQ, a);
a = __simd(XMM.LODHPD, a);
a = __simd(XMM.LODHPS, a);
a = __simd(XMM.LODLPD, a);
a = __simd(XMM.LODLPS, a);
//MOVDQ2Q = 0xF20FD6, // MOVDQ2Q mmx, xmm F2 0F D6 /r
/+
LODHPD = 0x660F16, // MOVHPD xmm, mem64 66 0F 16 /r
STOHPD = 0x660F17, // MOVHPD mem64, xmm 66 0F 17 /r
LODHPS = 0x0F16, // MOVHPS xmm, mem64 0F 16 /r
STOHPS = 0x0F17, // MOVHPS mem64, xmm 0F 17 /r
MOVLHPS = 0x0F16, // MOVLHPS xmm1, xmm2 0F 16 /r
LODLPD = 0x660F12, // MOVLPD xmm, mem64 66 0F 12 /r
STOLPD = 0x660F13, // MOVLPD mem64, xmm 66 0F 13 /r
a = __simd(XMM.LODLPS, a, b);
STOLPS = 0x0F13, // MOVLPS mem64, xmm 0F 13 /r
MOVMSKPD = 0x660F50, // MOVMSKPD reg32, xmm 66 0F 50 /r
MOVMSKPS = 0x0F50, // MOVMSKPS reg32, xmm 0F 50 /r
MOVNTDQ = 0x660FE7, // MOVNTDQ mem128, xmm 66 0F E7 /r
MOVNTI = 0x0FC3, // MOVNTI m32,r32 0F C3 /r
// MOVNTI m64,r64 0F C3 /r
MOVNTPD = 0x660F2B, // MOVNTPD mem128, xmm 66 0F 2B /r
MOVNTPS = 0x0F2B, // MOVNTPS mem128, xmm 0F 2B /r
//MOVNTQ = 0x0FE7, // MOVNTQ m64, mmx 0F E7 /r
//MOVQ2DQ = 0xF30FD6, // MOVQ2DQ xmm, mmx F3 0F D6 /r
+/
a = __simd(XMM.LODUPD, a, b);
a = __simd_sto(XMM.STOUPD, a, b);
a = __simd(XMM.LODUPS, a, b);
a = __simd_sto(XMM.STOUPS, a, b);
a = __simd(XMM.PACKSSDW, a, b);
a = __simd(XMM.PACKSSWB, a, b);
a = __simd(XMM.PACKUSWB, a, b);
a = __simd(XMM.PADDSB, a, b);
a = __simd(XMM.PADDSW, a, b);
a = __simd(XMM.PADDUSB, a, b);
a = __simd(XMM.PADDUSW, a, b);
a = __simd(XMM.PANDN, a, b);
a = __simd(XMM.PCMPEQB, a, b);
a = __simd(XMM.PCMPEQD, a, b);
a = __simd(XMM.PCMPEQW, a, b);
a = __simd(XMM.PCMPGTB, a, b);
a = __simd(XMM.PCMPGTD, a, b);
a = __simd(XMM.PCMPGTW, a, b);
a = __simd(XMM.PMADDWD, a, b);
a = __simd(XMM.PSLLW, a, b);
a = __simd_ib(XMM.PSLLW, a, cast(ubyte)0x7A);
a = __simd(XMM.PSLLD, a, b);
a = __simd_ib(XMM.PSLLD, a, cast(ubyte)0x7A);
a = __simd(XMM.PSLLQ, a, b);
a = __simd_ib(XMM.PSLLQ, a, cast(ubyte)0x7A);
a = __simd(XMM.PSRAW, a, b);
a = __simd_ib(XMM.PSRAW, a, cast(ubyte)0x7A);
a = __simd(XMM.PSRAD, a, b);
a = __simd_ib(XMM.PSRAD, a, cast(ubyte)0x7A);
a = __simd(XMM.PSRLW, a, b);
a = __simd_ib(XMM.PSRLW, a, cast(ubyte)0x7A);
a = __simd(XMM.PSRLD, a, b);
a = __simd_ib(XMM.PSRLD, a, cast(ubyte)0x7A);
a = __simd(XMM.PSRLQ, a, b);
a = __simd_ib(XMM.PSRLQ, a, cast(ubyte)0x7A);
a = __simd(XMM.PSUBSB, a, b);
a = __simd(XMM.PSUBSW, a, b);
a = __simd(XMM.PSUBUSB, a, b);
a = __simd(XMM.PSUBUSW, a, b);
a = __simd(XMM.PUNPCKHBW, a, b);
a = __simd(XMM.PUNPCKHDQ, a, b);
a = __simd(XMM.PUNPCKHWD, a, b);
a = __simd(XMM.PUNPCKLBW, a, b);
a = __simd(XMM.PUNPCKLDQ, a, b);
a = __simd(XMM.PUNPCKLWD, a, b);
a = __simd(XMM.PXOR, a, b);
a = __simd(XMM.ANDPD, a, b);
a = __simd(XMM.ANDPS, a, b);
a = __simd(XMM.ANDNPD, a, b);
a = __simd(XMM.ANDNPS, a, b);
a = __simd(XMM.CMPPD, a, b, 0x7A);
a = __simd(XMM.CMPSS, a, b, 0x7A);
a = __simd(XMM.CMPSD, a, b, 0x7A);
a = __simd(XMM.CMPPS, a, b, 0x7A);
a = __simd(XMM.CVTDQ2PD, a, b);
a = __simd(XMM.CVTDQ2PS, a, b);
a = __simd(XMM.CVTPD2DQ, a, b);
//a = __simd(XMM.CVTPD2PI, a, b);
a = __simd(XMM.CVTPD2PS, a, b);
a = __simd(XMM.CVTPI2PD, a, b);
a = __simd(XMM.CVTPI2PS, a, b);
a = __simd(XMM.CVTPS2DQ, a, b);
a = __simd(XMM.CVTPS2PD, a, b);
//a = __simd(XMM.CVTPS2PI, a, b);
//a = __simd(XMM.CVTSD2SI, a, b);
//a = __simd(XMM.CVTSD2SI, a, b);
a = __simd(XMM.CVTSD2SS, a, b);
//a = __simd(XMM.CVTSI2SD, a, b);
//a = __simd(XMM.CVTSI2SD, a, b);
//a = __simd(XMM.CVTSI2SS, a, b);
//a = __simd(XMM.CVTSI2SS, a, b);
a = __simd(XMM.CVTSS2SD, a, b);
//a = __simd(XMM.CVTSS2SI, a, b);
//a = __simd(XMM.CVTSS2SI, a, b);
//a = __simd(XMM.CVTTPD2PI, a, b);
a = __simd(XMM.CVTTPD2DQ, a, b);
a = __simd(XMM.CVTTPS2DQ, a, b);
//a = __simd(XMM.CVTTPS2PI, a, b);
//a = __simd(XMM.CVTTSD2SI, a, b);
//a = __simd(XMM.CVTTSD2SI, a, b);
//a = __simd(XMM.CVTTSS2SI, a, b);
//a = __simd(XMM.CVTTSS2SI, a, b);
a = __simd(XMM.MASKMOVDQU, a, b);
//a = __simd(XMM.MASKMOVQ, a, b);
a = __simd(XMM.MAXPD, a, b);
a = __simd(XMM.MAXPS, a, b);
a = __simd(XMM.MAXSD, a, b);
a = __simd(XMM.MAXSS, a, b);
a = __simd(XMM.MINPD, a, b);
a = __simd(XMM.MINPS, a, b);
a = __simd(XMM.MINSD, a, b);
a = __simd(XMM.MINSS, a, b);
a = __simd(XMM.ORPD, a, b);
a = __simd(XMM.ORPS, a, b);
a = __simd(XMM.PAVGB, a, b);
a = __simd(XMM.PAVGW, a, b);
a = __simd(XMM.PMAXSW, a, b);
//a = __simd(XMM.PINSRW, a, b);
a = __simd(XMM.PMAXUB, a, b);
a = __simd(XMM.PMINSB, a, b);
a = __simd(XMM.PMINUB, a, b);
//a = __simd(XMM.PMOVMSKB, a, b);
a = __simd(XMM.PMULHUW, a, b);
a = __simd(XMM.PMULHW, a, b);
a = __simd(XMM.PMULUDQ, a, b);
a = __simd(XMM.PSADBW, a, b);
a = __simd(XMM.PUNPCKHQDQ, a, b);
a = __simd(XMM.PUNPCKLQDQ, a, b);
a = __simd(XMM.RCPPS, a, b);
a = __simd(XMM.RCPSS, a, b);
a = __simd(XMM.RSQRTPS, a, b);
a = __simd(XMM.RSQRTSS, a, b);
a = __simd(XMM.SQRTPD, a, b);
a = __simd(XMM.SHUFPD, a, b, 0xA7);
a = __simd(XMM.SHUFPS, a, b, 0x7A);
a = __simd(XMM.SQRTPS, a, b);
a = __simd(XMM.SQRTSD, a, b);
a = __simd(XMM.SQRTSS, a, b);
a = __simd(XMM.UNPCKHPD, a, b);
a = __simd(XMM.UNPCKHPS, a, b);
a = __simd(XMM.UNPCKLPD, a, b);
a = __simd(XMM.UNPCKLPS, a, b);
a = __simd(XMM.PSHUFD, a, b, 0x7A);
a = __simd(XMM.PSHUFHW, a, b, 0x7A);
a = __simd(XMM.PSHUFLW, a, b, 0x7A);
//a = __simd(XMM.PSHUFW, a, b, 0x7A);
a = __simd_ib(XMM.PSLLDQ, a, cast(ubyte)0x7A);
a = __simd_ib(XMM.PSRLDQ, a, cast(ubyte)0x7A);
/**/
a = __simd(XMM.BLENDPD, a, b, 0x7A);
a = __simd(XMM.BLENDPS, a, b, 0x7A);
a = __simd(XMM.DPPD, a, b, 0x7A);
a = __simd(XMM.DPPS, a, b, 0x7A);
a = __simd(XMM.MPSADBW, a, b, 0x7A);
a = __simd(XMM.PBLENDW, a, b, 0x7A);
a = __simd(XMM.ROUNDPD, a, b, 0x7A);
a = __simd(XMM.ROUNDPS, a, b, 0x7A);
a = __simd(XMM.ROUNDSD, a, b, 0x7A);
a = __simd(XMM.ROUNDSS, a, b, 0x7A);
return cast(float4)a;
}
/*****************************************/
/+
// https://issues.dlang.org/show_bug.cgi?id=9200
void bar9200(double[2] a)
{
assert(a[0] == 1);
assert(a[1] == 2);
}
double2 * v9200(double2* a)
{
return a;
}
void test9200()
{
double2 a = [1, 2];
*v9200(&a) = a;
bar9200(a.array);
}
+/
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=9304
// https://issues.dlang.org/show_bug.cgi?id=9322
float4 foo9304(float4 a)
{
return -a;
}
void test9304()
{
auto a = foo9304([0, 1, 2, 3]);
assert(a.array == [0,-1,-2,-3]);
}
/*****************************************/
void test9910()
{
float4 f = [1, 1, 1, 1];
auto works = f + 3;
auto bug = 3 + f;
assert (works.array == [4,4,4,4]);
assert (bug.array == [4,4,4,4]); // no property 'array' for type 'int'
}
/*****************************************/
bool normalize(double[] range, double sum = 1)
{
double s = 0;
const length = range.length;
foreach (e; range)
{
s += e;
}
if (s == 0)
{
return false;
}
return true;
}
void test12852()
{
double[3] range = [0.0, 0.0, 0.0];
assert(normalize(range[]) == false);
range[1] = 3.0;
assert(normalize(range[]) == true);
}
/*****************************************/
void test9449()
{
ubyte16[1] table;
}
/*****************************************/
void test9449_2()
{
float[4][2] m = [[2.0, 1, 3, 4], [5.0, 6, 7, 8]]; // segfault
assert(m[0][0] == 2.0);
assert(m[0][1] == 1);
assert(m[0][2] == 3);
assert(m[0][3] == 4);
assert(m[1][0] == 5.0);
assert(m[1][1] == 6);
assert(m[1][2] == 7);
assert(m[1][3] == 8);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=13841
void test13841()
{
alias Vector16s = TypeTuple!(
void16, byte16, short8, int4, long2,
ubyte16, ushort8, uint4, ulong2, float4, double2);
foreach (V1; Vector16s)
{
foreach (V2; Vector16s)
{
V1 v1 = void;
V2 v2 = void;
static if (is(V1 == V2))
{
static assert( is(typeof(true ? v1 : v2) == V1));
}
else
{
static assert(!is(typeof(true ? v1 : v2)));
}
}
}
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=12776
void test12776()
{
alias Vector16s = TypeTuple!(
void16, byte16, short8, int4, long2,
ubyte16, ushort8, uint4, ulong2, float4, double2);
foreach (V; Vector16s)
{
static assert(is(typeof( V .init) == V ));
static assert(is(typeof( const(V).init) == const(V)));
static assert(is(typeof( inout( V).init) == inout( V)));
static assert(is(typeof( inout(const V).init) == inout(const V)));
static assert(is(typeof(shared( V).init) == shared( V)));
static assert(is(typeof(shared( const V).init) == shared( const V)));
static assert(is(typeof(shared(inout V).init) == shared(inout V)));
static assert(is(typeof(shared(inout const V).init) == shared(inout const V)));
static assert(is(typeof( immutable(V).init) == immutable(V)));
}
}
/*****************************************/
void foo13988(double[] arr)
{
static ulong repr(double d) { return *cast(ulong*)&d; }
foreach (x; arr)
assert(repr(arr[0]) == *cast(ulong*)&(arr[0]));
}
void test13988()
{
double[] arr = [3.0];
foo13988(arr);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=15123
void test15123()
{
alias Vector16s = TypeTuple!(
void16, byte16, short8, int4, long2,
ubyte16, ushort8, uint4, ulong2, float4, double2);
foreach (V; Vector16s)
{
auto x = V.init;
}
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=15144
void test15144()
{
enum ubyte16 csXMM1 = ['a','b','c',0,0,0,0,0];
__gshared ubyte16 csXMM2 = ['a','b','c',0,0,0,0,0];
immutable ubyte16 csXMM3 = ['a','b','c',0,0,0,0,0];
version (D_PIC)
{
}
else version (D_PIE)
{
}
else
{
asm @nogc nothrow
{
movdqa XMM0, [csXMM1];
movdqa XMM0, [csXMM2];
movdqa XMM0, [csXMM3];
}
}
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=11585
ubyte16 test11585(ubyte16* d)
{
ubyte16 a;
if (d is null) return a;
return cast(ubyte16)__simd(XMM.PCMPEQB, *d, *d);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=13927
void test13927(ulong2 a)
{
ulong2 b = [long.min, long.min];
auto tmp = a - b;
}
/*****************************************/
int fooprefetch(byte a)
{
/* These should be run only if the CPUID PRFCHW
* bit 0 of cpuid.{EAX = 7, ECX = 0}.ECX
* Unfortunately, that bit isn't yet set by core.cpuid
* so disable for the moment.
*/
version (none)
{
prefetch!(false, 0)(&a);
prefetch!(false, 1)(&a);
prefetch!(false, 2)(&a);
prefetch!(false, 3)(&a);
prefetch!(true, 0)(&a);
prefetch!(true, 1)(&a);
prefetch!(true, 2)(&a);
prefetch!(true, 3)(&a);
}
return 3;
}
void testprefetch()
{
byte b;
int i = fooprefetch(1);
assert(i == 3);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=16488
void foo_byte16(byte t, byte s)
{
byte16 f = s;
auto p = cast(byte*)&f;
foreach (i; 0 .. 16)
assert(p[i] == s);
}
void foo_ubyte16(ubyte t, ubyte s)
{
ubyte16 f = s;
auto p = cast(ubyte*)&f;
foreach (i; 0 .. 16)
assert(p[i] == s);
}
void foo_short8(short t, short s)
{
short8 f = s;
auto p = cast(short*)&f;
foreach (i; 0 .. 8)
assert(p[i] == s);
}
void foo_ushort8(ushort t, ushort s)
{
ushort8 f = s;
auto p = cast(ushort*)&f;
foreach (i; 0 .. 8)
assert(p[i] == s);
}
void foo_int4(int t, int s)
{
int4 f = s;
auto p = cast(int*)&f;
foreach (i; 0 .. 4)
assert(p[i] == s);
}
void foo_uint4(uint t, uint s, uint u)
{
uint4 f = s;
auto p = cast(uint*)&f;
foreach (i; 0 .. 4)
assert(p[i] == s);
}
void foo_long2(long t, long s, long u)
{
long2 f = s;
auto p = cast(long*)&f;
foreach (i; 0 .. 2)
assert(p[i] == s);
}
void foo_ulong2(ulong t, ulong s)
{
ulong2 f = s;
auto p = cast(ulong*)&f;
foreach (i; 0 .. 2)
assert(p[i] == s);
}
void foo_float4(float t, float s)
{
float4 f = s;
auto p = cast(float*)&f;
foreach (i; 0 .. 4)
assert(p[i] == s);
}
void foo_double2(double t, double s, double u)
{
double2 f = s;
auto p = cast(double*)&f;
foreach (i; 0 .. 2)
assert(p[i] == s);
}
void test16448()
{
foo_byte16(5, -10);
foo_ubyte16(5, 11);
foo_short8(5, -6);
foo_short8(5, 7);
foo_int4(5, -6);
foo_uint4(5, 0x12345678, 22);
foo_long2(5, -6, 1);
foo_ulong2(5, 0x12345678_87654321L);
foo_float4(5, -6);
foo_double2(5, -6, 2);
}
/*****************************************/
static if (__traits(compiles, byte32))
{
void foo_byte32(byte t, byte s)
{
byte32 f = s;
auto p = cast(byte*)&f;
foreach (i; 0 .. 32)
assert(p[i] == s);
}
void foo_ubyte32(ubyte t, ubyte s)
{
ubyte32 f = s;
auto p = cast(ubyte*)&f;
foreach (i; 0 .. 32)
assert(p[i] == s);
}
void foo_short16(short t, short s)
{
short16 f = s;
auto p = cast(short*)&f;
foreach (i; 0 .. 16)
assert(p[i] == s);
}
void foo_ushort16(ushort t, ushort s)
{
ushort16 f = s;
auto p = cast(ushort*)&f;
foreach (i; 0 .. 16)
assert(p[i] == s);
}
void foo_int8(int t, int s)
{
int8 f = s;
auto p = cast(int*)&f;
foreach (i; 0 .. 8)
assert(p[i] == s);
}
void foo_uint8(uint t, uint s, uint u)
{
uint8 f = s;
auto p = cast(uint*)&f;
foreach (i; 0 .. 8)
assert(p[i] == s);
}
void foo_long4(long t, long s, long u)
{
long4 f = s;
auto p = cast(long*)&f;
foreach (i; 0 .. 4)
assert(p[i] == s);
}
void foo_ulong4(ulong t, ulong s)
{
ulong4 f = s;
auto p = cast(ulong*)&f;
foreach (i; 0 .. 4)
assert(p[i] == s);
}
void foo_float8(float t, float s)
{
float8 f = s;
auto p = cast(float*)&f;
foreach (i; 0 .. 8)
assert(p[i] == s);
}
void foo_double4(double t, double s, double u)
{
double4 f = s;
auto p = cast(double*)&f;
foreach (i; 0 .. 4)
assert(p[i] == s);
}
void test16448_32()
{
foo_byte32(5, -10);
foo_ubyte32(5, 11);
foo_short16(5, -6);
foo_short16(5, 7);
foo_int8(5, -6);
foo_uint8(5, 0x12345678, 22);
foo_long4(5, -6, 1);
foo_ulong4(5, 0x12345678_87654321L);
foo_float8(5, -6);
foo_double4(5, -6, 2);
}
}
else
{
void test16448_32()
{
}
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=16703
float index(float4 f4, size_t i)
{
return f4[i];
//return (*cast(float[4]*)&f4)[2];
}
float[4] slice(float4 f4)
{
return f4[];
}
float slice2(float4 f4, size_t lwr, size_t upr, size_t i)
{
float[] fa = f4[lwr .. upr];
return fa[i];
}
void test16703()
{
float4 f4 = [1,2,3,4];
assert(index(f4, 0) == 1);
assert(index(f4, 1) == 2);
assert(index(f4, 2) == 3);
assert(index(f4, 3) == 4);
float[4] fsa = slice(f4);
assert(fsa == [1.0f,2,3,4]);
assert(slice2(f4, 1, 3, 0) == 2);
assert(slice2(f4, 1, 3, 1) == 3);
}
/*****************************************/
struct Sunsto
{
align (1): // make sure f4 is misaligned
byte b;
union
{
float4 f4;
ubyte[16] a;
}
}
ubyte[16] foounsto()
{
float4 vf = 6;
Sunsto s;
s.f4 = vf * 2;
vf = s.f4;
return s.a;
}
void testOPvecunsto()
{
auto a = foounsto();
version (LittleEndian)
assert(a == [0, 0, 64, 65, 0, 0, 64, 65, 0, 0, 64, 65, 0, 0, 64, 65]);
version (BigEndian)
assert(a == [65, 64, 0, 0, 65, 64, 0, 0, 65, 64, 0, 0, 65, 64, 0, 0]);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=10447
void test10447()
{
immutable __vector(double[2]) a = [1.0, 2.0];
__vector(double[2]) r;
r += a;
r = r * a;
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=17237
static if (__traits(compiles, int8))
{
struct S17237
{
bool a;
struct
{
bool b;
int8 c;
}
}
static assert(S17237.a.offsetof == 0);
static assert(S17237.b.offsetof == 32);
static assert(S17237.c.offsetof == 64);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=17344
void test17344()
{
__vector(int[4]) vec1 = 2, vec2 = vec1++;
assert(cast(int[4])vec1 == [3, 3, 3, 3]);
assert(cast(int[4])vec2 == [2, 2, 2, 2]);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=17356
void test17356()
{
float4 a = 13, b = 0;
__simd_sto(XMM.STOUPS, b, a);
assert(b.array == [13, 13, 13, 13]);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=17695
void test17695(__vector(ubyte[16]) a)
{
auto b = -a;
}
/*****************************************/
void refIntrinsics()
{
// never called, but check for link errors
void16 v;
void16 a;
float f = 1;
double d = 1;
a = __simd(XMM.ADDPD, a, v);
a = __simd(XMM.CMPSS, a, v, cast(ubyte)0x7A);
a = __simd(XMM.LODSS, v);
a = __simd(XMM.LODSS, f);
a = __simd(XMM.LODSS, d);
__simd_sto(XMM.STOUPS, v, a);
__simd_sto(XMM.STOUPS, f, a);
__simd_sto(XMM.STOUPS, d, a);
a = __simd_ib(XMM.PSLLW, a, cast(ubyte)0x7A);
prefetch!(false, 0)(&a);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=17720
void test17720()
{
alias Vector16s = TypeTuple!(
void16, byte16, short8, int4, long2,
ubyte16, ushort8, uint4, ulong2, float4, double2);
// OK: __vector(T) -> __vector(void[]) of same size.
// NG: __vector(T) -> __vector(void[]) of different size.
// NG: explicit cast __vector(T) -> __vector(void[]) of different size.
foreach (V; Vector16s)
{
static assert( __traits(compiles, { void16 v = V.init; }));
static assert(!__traits(compiles, { void32 v = V.init; }));
static assert(!__traits(compiles, { void32 v = cast(void32)V.init; }));
}
// NG: __vector(T) -> __vector(T) of same size.
// OK: explicit cast __vector(T) -> __vector(T) of same size.
// NG: __vector(T) -> __vector(T) of different size.
// NG: explicit cast __vector(T) -> __vector(T) of different size.
foreach (V; Vector16s)
{
static if (is(V == double2))
{
static assert(!__traits(compiles, { long2 v = V.init; }));
static assert( __traits(compiles, { long2 v = cast(long2)V.init; }));
}
else
{
static assert(!__traits(compiles, { double2 v = V.init; }));
static assert( __traits(compiles, { double2 v = cast(double2)V.init; }));
}
static assert(!__traits(compiles, { double4 v = V.init; }));
static assert(!__traits(compiles, { double4 v = cast(double4)V.init; }));
}
// 32-byte __vector(T) tests.
static if (__traits(compiles, void32))
{
alias Vector32s = TypeTuple!(
void32, byte32, short16, int8, long4,
ubyte32, ushort16, uint8, ulong4, float8, double4);
foreach (V; Vector32s)
{
static assert( __traits(compiles, { void32 v = V.init; }));
static assert(!__traits(compiles, { void16 v = V.init; }));
static assert(!__traits(compiles, { void16 v = cast(void16)V.init; }));
}
foreach (V; Vector32s)
{
static if (is(V == double4))
{
static assert(!__traits(compiles, { long4 v = V.init; }));
static assert( __traits(compiles, { long4 v = cast(long4)V.init; }));
}
else
{
static assert(!__traits(compiles, { double4 v = V.init; }));
static assert( __traits(compiles, { double4 v = cast(double4)V.init; }));
}
static assert(!__traits(compiles, { double2 v = V.init; }));
static assert(!__traits(compiles, { double2 v = cast(double2)V.init; }));
}
}
}
/*****************************************/
void test6a()
{
static if (__traits(compiles, { long4 x; x += 1; }))
{
// stack occasionally misaligned
float f = 0;
long4 v;
assert((cast(size_t)&v) % 32 == 0);
v += 1;
}
}
void test6b()
{
static if (__traits(compiles, long4))
{
struct S {long4 v;}
S s;
assert((cast(size_t)&s) % 32 == 0);
}
}
void test6()
{
test6a();
test6b();
}
/*****************************************/
static if (__traits(compiles, double4))
{
double4 test7r(double4 v)
{
return v;
}
}
void test7()
{
static if (__traits(compiles, double4))
{
// 32 bytes sliced down to 16 bytes
double4 v = 1;
double4 r = test7r(v);
assert(v[2] == r[2]);
assert(v[3] == r[3]);
}
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=18867
ulong2 foo18867(ulong s)
{
ulong2 v;
v[0] = s;
return v;
}
/*****************************************/
auto test20052()
{
static if (__traits(compiles, long4))
{
struct S { long4 v; }
S s;
return s;
}
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=20981
void test20981()
{
void16 a;
simd_stox!(XMM.STOUPS)(a, a);
}
void16 simd_stox(XMM opcode)(void16 op1, void16 op2)
{
return cast(void16) __simd_sto(opcode, op1, op2);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=21469
int4 foo21469(short a)
{
return cast(int4)(short8(a));
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=20041
immutable(float4) foo20041()
{
float4 raw = 2.0f;
raw.array[0] = 1;
return cast(immutable)raw;
}
void test20041()
{
static immutable float4 v = foo20041();
assert(v.array[0] == 1);
assert(v.array[1] == 2);
assert(v.array[2] == 2);
assert(v.array[3] == 2);
// foreach(d; 0 .. 4)
// printf("%g ", v[d]);
// printf("\n");
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=21364
struct X21364
{
float x0;
long x1;
}
version (X86_64)
static assert(X21364.alignof == 8);
void foo21364(int bar, X21364 x, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
{
assert(i1 == 2);
assert(bar == 1);
}
void test21364()
{
X21364 x = X21364();
foo21364(1, x, 2, 3, 4, 5, 6, 7, 8, 9, 10);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=19632
void test19632()
{
int4 v = [1, 2, 3, 4];
int sum = 0;
foreach (ref e; v)
sum += (e *= 2);
assert(v.array[] == [2, 4, 6, 8]);
assert(sum == 20);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=19443
void test19443()
{
float4 a = [1.0f, 2.0f, 3.0f, 4.0f];
float4 b = [5.0f, 6.0f, 7.0f, 8.0f];
float4 r = cast(float4) __simd(XMM.MOVHLPS, a, b);
float[4] correct = [7.0f, 8.0f, 3.0f, 4.0f];
assert(r.array == correct); // FAIL, produces [5, 6, 3, 4] instead
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=22438
struct T22438 { int x; double d; }
T22438 foo22438(int x, double d) { return T22438(x, d); }
struct S22438 { T22438 t; string r; }
void test22438()
{
S22438 s = S22438(foo22438(10, 3.14), "str");
assert(s.t.x == 10);
assert(s.t.d == 3.14);
assert(s.r == "str");
}
/*****************************************/
__gshared int testsroa_x;
template SROA(T1, T2)
{
struct FPoint
{
T1 x;
T2 y;
}
void sroa(FPoint p1, ref FPoint quad)
{
quad = FPoint(p1.x, p1.y);
}
void testit()
{
FPoint p1 = FPoint(1, 2);
FPoint quad;
sroa(p1, quad);
if (quad != p1)
{
printf("failing iteration %d\n", testsroa_x);
assert(0);
}
++testsroa_x;
}
}
void testsroa()
{
SROA!(int, int ).testit();
SROA!(int, float).testit();
SROA!(float, float).testit();
SROA!(float, int ).testit();
SROA!(long, long ).testit();
SROA!(long, double).testit();
SROA!(double, double).testit();
SROA!(double, long ).testit();
}
/*****************************************/
// https://github.com/AuburnSounds/intel-intrinsics/blob/master/source/inteli/pmmintrin.d
alias __m128 = float4;
__m128 _mm_setr_ps (float e3, float e2, float e1, float e0) pure @trusted
{
float[4] result = [e3, e2, e1, e0];
return loadUnaligned!(float4)(cast(float4*)result.ptr);
}
__m128 _mm_movehdup_ps (__m128 a) pure @trusted
{
a.ptr[0] = a.array[1];
a.ptr[2] = a.array[3];
return a;
}
void testshdup()
{
__m128 A = _mm_movehdup_ps(_mm_setr_ps(1, 2, 3, 4));
float[4] correct = [2.0f, 2, 4, 4 ];
assert(A.array == correct);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=21673
float4 _mm_move_ss(float4 a, float4 b)
{
a.ptr[0] = b.array[0];
return a;
}
void test21673()
{
float4 A = [1.0f, 2.0f, 3.0f, 4.0f];
float4 B = [5.0f, 6.0f, 7.0f, 8.0f];
float4 R = _mm_move_ss(A, B);
float[4] correct = [5.0f, 2.0f, 3.0f, 4.0f];
assert(R.array == correct);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=21676
double2 loadUnaligned21676(const(double)* pvec)
{
double2 result;
foreach(i; 0..2)
{
result[i] = pvec[i];
}
return result;
}
double2 _mm_setr_pd(double e1, double e0)
{
double[2] result = [e1, e0];
return loadUnaligned21676(result.ptr);
}
double2 fun(double2 a, double2 b)
{
a[0] = (a[0] < b[0]) ? a[0] : b[0];
return a;
}
void test21676()
{
double2 A = _mm_setr_pd(1.0, 2.0);
double2 B = _mm_setr_pd(4.0, 1.0);
double2 C = fun(A, B);
assert(C.array[0] == 1.0);
assert(C.array[1] == 2.0);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=23009
double2 _mm_loadl_pd(double2 a, const(double)* mem_addr)
{
a[0] = *mem_addr;
return a;
}
void test23009()
{
double A = 7.0;
double2 B;
B[0] = 4.0;
B[1] = -5.0;
double2 R = _mm_loadl_pd(B, &A);
double[2] correct = [ 7.0, -5.0 ];
assert(R.array == correct);
}
/*****************************************/
// https://issues.dlang.org/show_bug.cgi?id=23077
float test23077(float x)
{
short i = *cast(short*)&x;
++i;
return *cast(float*)&i; // this cast is not allowed in @safe code
}
// https://issues.dlang.org/show_bug.cgi?id=23085
float test23085(float x)
{
byte i = *cast(byte*)&x;
++i;
return *cast(float*)&i; // this cast is not allowed in @safe code
}
// https://issues.dlang.org/show_bug.cgi?id=23084
__vector(int[4]) test23084a(__vector(int[4]) a)
{
__vector(short[8]) r = cast(short)(a.array[0]);
return cast(__vector(int[4]))r;
}
__vector(int[4]) test23084b(__vector(int[4]) a)
{
__vector(byte[16]) r = cast(byte)(a.array[0]);
return cast(__vector(int[4]))r;
}
/*****************************************/
int main()
{
test1();
test2();
test2b();
test2c();
test2d();
test2e();
test2f();
test2g();
test2h();
test2i();
test2j();
test3();
test4();
test7411();
test7951();
test7951_2();
test7949();
test7414();
test7413();
test7413_2();
// test9200();
test9304();
test9910();
test12852();
test9449();
test9449_2();
test13988();
testprefetch();
test16448();
test16448_32();
test16703();
testOPvecunsto();
test10447();
test17344();
test17356();
test20052();
test6();
test7();
test20981();
test20041();
test21364();
test19632();
test19443();
test22438();
testsroa();
testshdup();
test21673();
test21676();
test23009();
return 0;
}
}
else
{
int main() { return 0; }
}
|
D
|
/**
* MediaInfoDLL - All info about media files, for DLL (JNA version)
*
* Copyright (C) 2009-2009 Jerome Martinez, Zen@MediaArea.net
*
* 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 3 of the License, or
* 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, see <http://www.gnu.org/licenses/>.
*
**/
// Note: the original stuff was well packaged with Java style,
// but I (the main developer) prefer to keep an easiest for me
// way to have all sources and example in the same place
// Removed stuff:
// "package net.sourceforge.mediainfo;"
// directory was /net/sourceforge/mediainfo
module net.pms.dlna.MediaInfo;
import com.sun.jna.Platform;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Method;
import java.util.Collections : singletonMap;
public class MediaInfo {
private static Logger LOGGER = LoggerFactory.getLogger!MediaInfo();
static String libraryName;
static this() {
if (Platform.isWindows() && Platform.is64Bit()) {
libraryName = "mediainfo64";
} else {
libraryName = "mediainfo";
}
// libmediainfo for Linux depends on libzen
if (!Platform.isWindows() && !Platform.isMac()) {
try {
// We need to load dependencies first, because we know where our native libs are (e.g. Java Web Start Cache).
// If we do not, the system will look for dependencies, but only in the library path.
NativeLibrary.getInstance("zen");
} catch (LinkageError e) {
LOGGER.warn("Error loading libzen: " ~ e.getMessage());
}
}
}
// Internal stuff
interface MediaInfoDLL_Internal : Library {
MediaInfoDLL_Internal INSTANCE = cast(MediaInfoDLL_Internal) Native.loadLibrary(
libraryName,
MediaInfoDLL_Internal._class,
singletonMap(OPTION_FUNCTION_MAPPER, new class() FunctionMapper {
override
public String getFunctionName(NativeLibrary lib, Method method) {
// e.g. MediaInfo_New(), MediaInfo_Open() ...
return "MediaInfo_" ~ method.getName();
}
}));
// Constructor/Destructor
Pointer New();
void Delete(Pointer Handle);
// File
int Open(Pointer Handle, WString file);
void Close(Pointer Handle);
// Info
WString Inform(Pointer Handle);
WString Get(Pointer Handle, int StreamKind, int StreamNumber, WString parameter, int infoKind, int searchKind);
WString GetI(Pointer Handle, int StreamKind, int StreamNumber, int parameterIndex, int infoKind);
int Count_Get(Pointer Handle, int StreamKind, int StreamNumber);
// Options
WString Option(Pointer Handle, WString option, WString value);
}
private Pointer Handle;
deprecated
// FIXME rename StreamType
public enum StreamKind {
General,
Video,
Audio,
Text,
Chapters,
Image,
Menu
}
// Enums
deprecated
// FIXME rename InfoType
public enum InfoKind {
/**
* Unique name of parameter.
*/
Name,
/**
* Value of parameter.
*/
Text,
/**
* Unique name of measure unit of parameter.
*/
Measure,
Options,
/**
* Translated name of parameter.
*/
Name_Text,
/**
* Translated name of measure unit.
*/
Measure_Text,
/**
* More information about the parameter.
*/
Info,
/**
* How this parameter is supported, could be N (No), B (Beta), R (Read only), W
* (Read/Write).
*/
HowTo,
/**
* Domain of this piece of information.
*/
Domain
}
// Constructor/Destructor
public this() {
try {
LOGGER.info("Loading MediaInfo library");
Handle = MediaInfoDLL_Internal.INSTANCE.New();
LOGGER.info("Loaded " ~ Option_Static("Info_Version"));
} catch (Throwable e) {
if (e !is null) {
LOGGER.info("Error loading MediaInfo library: " ~ e.getMessage());
}
if (!Platform.isWindows() && !Platform.isMac()) {
LOGGER.info("Make sure you have libmediainfo and libzen installed");
}
LOGGER.info("The server will now use the less accurate ffmpeg parsing method");
}
}
public bool isValid() {
return Handle !is null;
}
public void dispose() {
if (Handle is null) {
throw new IllegalStateException();
}
MediaInfoDLL_Internal.INSTANCE.Delete(Handle);
Handle = null;
}
public ~this() {
if (Handle !is null) {
dispose();
}
}
// File
/**
* Open a file and collect information about it (technical information and tags).
*
* @param File_Name full name of the file to open
* @return 1 if file was opened, 0 if file was not not opened
*/
public int Open(String File_Name) {
return MediaInfoDLL_Internal.INSTANCE.Open(Handle, new WString(File_Name));
}
/**
* Close a file opened before with Open().
*
*/
public void Close() {
MediaInfoDLL_Internal.INSTANCE.Close(Handle);
}
// Information
/**
* Get all details about a file.
*
* @return All details about a file in one string
*/
public String Inform() {
return MediaInfoDLL_Internal.INSTANCE.Inform(Handle).toString();
}
/**
* Get a piece of information about a file (parameter is a string).
*
* @param StreamKind Kind of Stream (general, video, audio...)
* @param StreamNumber Stream number in Kind of Stream (first, second...)
* @param parameter Parameter you are looking for in the Stream (Codec, width, bitrate...),
* in string format ("Codec", "Width"...)
* @return a string about information you search, an empty string if there is a problem
*/
public String Get(StreamKind StreamKind, int StreamNumber, String parameter) {
return Get(StreamKind, StreamNumber, parameter, InfoKind.Text, InfoKind.Name);
}
/**
* Get a piece of information about a file (parameter is a string).
*
* @param StreamKind Kind of Stream (general, video, audio...)
* @param StreamNumber Stream number in Kind of Stream (first, second...)
* @param parameter Parameter you are looking for in the Stream (Codec, width, bitrate...),
* in string format ("Codec", "Width"...)
* @param infoKind Kind of information you want about the parameter (the text, the measure,
* the help...)
*/
public String Get(StreamKind StreamKind, int StreamNumber, String parameter, InfoKind infoKind) {
return Get(StreamKind, StreamNumber, parameter, infoKind, InfoKind.Name);
}
/**
* Get a piece of information about a file (parameter is a string).
*
* @param StreamKind Kind of Stream (general, video, audio...)
* @param StreamNumber Stream number in Kind of Stream (first, second...)
* @param parameter Parameter you are looking for in the Stream (Codec, width, bitrate...),
* in string format ("Codec", "Width"...)
* @param infoKind Kind of information you want about the parameter (the text, the measure,
* the help...)
* @param searchKind Where to look for the parameter
* @return a string about information you search, an empty string if there is a problem
*/
public String Get(StreamKind StreamKind, int StreamNumber, String parameter, InfoKind infoKind, InfoKind searchKind) {
return MediaInfoDLL_Internal.INSTANCE.Get(
Handle,
StreamKind.ordinal(),
StreamNumber,
new WString(parameter),
infoKind.ordinal(),
searchKind.ordinal()).toString();
}
/**
* Get a piece of information about a file (parameter is an integer).
*
* @param StreamKind Kind of Stream (general, video, audio...)
* @param StreamNumber Stream number in Kind of Stream (first, second...)
* @param parameterIndex Parameter you are looking for in the Stream (Codec, width, bitrate...),
* in integer format (first parameter, second parameter...)
* @return a string about information you search, an empty string if there is a problem
*/
public String get(StreamKind StreamKind, int StreamNumber, int parameterIndex) {
return Get(StreamKind, StreamNumber, parameterIndex, InfoKind.Text);
}
/**
* Get a piece of information about a file (parameter is an integer).
*
* @param StreamKind Kind of Stream (general, video, audio...)
* @param StreamNumber Stream number in Kind of Stream (first, second...)
* @param parameterIndex Parameter you are looking for in the Stream (Codec, width, bitrate...),
* in integer format (first parameter, second parameter...)
* @param infoKind Kind of information you want about the parameter (the text, the measure,
* the help...)
* @return a string about information you search, an empty string if there is a problem
*/
public String Get(StreamKind StreamKind, int StreamNumber, int parameterIndex, InfoKind infoKind) {
return MediaInfoDLL_Internal.INSTANCE.GetI(
Handle,
StreamKind.ordinal(),
StreamNumber,
parameterIndex,
infoKind.ordinal()).toString();
}
/**
* Count of Streams of a Stream kind (StreamNumber not filled), or count of piece of
* information in this Stream.
*
* @param StreamKind Kind of Stream (general, video, audio...)
* @return number of Streams of the given Stream kind
*/
public int Count_Get(StreamKind StreamKind) {
return MediaInfoDLL_Internal.INSTANCE.Count_Get(Handle, StreamKind.ordinal(), -1);
}
/**
* Count of Streams of a Stream kind (StreamNumber not filled), or count of piece of
* information in this Stream.
*
* @param StreamKind Kind of Stream (general, video, audio...)
* @param StreamNumber Stream number in this kind of Stream (first, second...)
* @return number of Streams of the given Stream kind
*/
public int Count_Get(StreamKind StreamKind, int StreamNumber) {
return MediaInfoDLL_Internal.INSTANCE.Count_Get(Handle, StreamKind.ordinal(), StreamNumber);
}
// Options
/**
* Configure or get information about MediaInfo.
*
* @param Option The name of option
* @return Depends on the option: by default "" (nothing) means No, other means Yes
*/
public String Option(String Option) {
return MediaInfoDLL_Internal.INSTANCE.Option(Handle, new WString(Option), new WString("")).toString();
}
/**
* Configure or get information about MediaInfo.
*
* @param Option The name of option
* @param Value The value of option
* @return Depends on the option: by default "" (nothing) means No, other means Yes
*/
public String Option(String Option, String Value) {
return MediaInfoDLL_Internal.INSTANCE.Option(Handle, new WString(Option), new WString(Value)).toString();
}
/**
* Configure or get information about MediaInfo (Static version).
*
* @param Option The name of option
* @return Depends on the option: by default "" (nothing) means No, other means Yes
*/
public static String Option_Static(String Option) {
return MediaInfoDLL_Internal.INSTANCE.Option(
MediaInfoDLL_Internal.INSTANCE.New(),
new WString(Option),
new WString("")).toString();
}
/**
* Configure or get information about MediaInfo (Static version).
*
* @param Option The name of option
* @param Value The value of option
* @return Depends on the option: by default "" (nothing) means No, other means Yes
*/
public static String Option_Static(String Option, String Value) {
return MediaInfoDLL_Internal.INSTANCE.Option(
MediaInfoDLL_Internal.INSTANCE.New(),
new WString(Option),
new WString(Value)).toString();
}
}
|
D
|
/Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/Permission.o : /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /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/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FacebookCore.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/QuartzCore.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/SwiftOnoneSupport.swiftmodule /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/Bolts.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTask.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFURL.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/Permission~partial.swiftmodule : /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /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/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FacebookCore.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/QuartzCore.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/SwiftOnoneSupport.swiftmodule /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/Bolts.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTask.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFURL.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/Permission~partial.swiftdoc : /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /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/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FacebookCore.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/QuartzCore.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/SwiftOnoneSupport.swiftmodule /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/Bolts.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTask.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFURL.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/KatiaHajjar/Documents/WhereAtV2/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/KatiaHajjar/Documents/WhereAtV2/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
|
D
|
unittest
{
import std.stdio : writeln;
auto calculate(string op, T)(T lhs, T rhs)
{
return mixin("lhs " ~ op ~ " rhs");
}
// pass the operation to perform as a
// template parameter.
assert(calculate!"+"(5,12) == 17);
assert(calculate!"-"(10,8) == 2);
assert(calculate!"*"(8,8) == 64);
assert(calculate!"/"(100,5) == 20);
mixin(`writeln("Test #1 passed");`);
}
|
D
|
// Copyright © 2012, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/charge/charge.d (GPLv2 only).
module charge.game.dcpu.cpu;
import lib.gl.gl;
import lib.dcpu.dcpu;
/**
* Info struct for attached hw.
*/
struct DcpuHwInfo
{
uint id;
uint manufacturer;
ushort ver;
ushort index;
}
/**
* A attached hardware to a dcpu.
*/
interface DcpuHw
{
DcpuHwInfo* getHwInfo();
void interupt();
void notifyUnregister();
}
final class Dcpu
{
public:
vm_t* vm;
DcpuHw[] hws;
public:
this()
{
vm = vm_create();
}
~this()
{
assert(vm is null);
assert(hws is null);
}
void close()
{
foreach(hw; hws) {
hw.notifyUnregister();
}
hws = null;
if (vm !is null) {
vm_free(vm);
vm = null;
}
}
bool step(int cycles)
{
return vm_run_cycles(vm, cycles);
}
ushort* ram()
{
return vm.ram.ptr;
}
ushort reg(uint reg)
{
if (reg >= REG_NUM)
throw new Exception("Reg out of bounds");
// Spill into sp, pc, ia & ex.
return vm.registers.ptr[reg];
}
/**
* Safely get a slice of ram, returns default if it failed.
*/
ushort[] getSliceSafe(ushort offset, size_t size, ushort[] def)
{
if (offset + size > RAM_SIZE)
return def;
return vm.ram[offset .. offset + size];
}
void addSleep(ushort sleep)
{
vm.sleep_cycles += sleep;
}
/*
*
* Attached hardware.
*
*/
void register(DcpuHw hw)
{
auto info = hw.getHwInfo();
hw_t hwStruct;
hwStruct.id = info.id;
hwStruct.ver = info.ver;
hwStruct.manufacturer = info.manufacturer;
hwStruct.handler = &handler;
hwStruct.userdata = cast(void*)hw;
hws ~= hw;
info.index = vm_hw_register(vm, hwStruct);
}
void unregister(DcpuHw hw)
{
vm_hw_unregister(vm, hw.getHwInfo().index);
hw.notifyUnregister();
}
private static extern(C) void handler(vm_t* vm, void* ud)
{
auto hw = cast(DcpuHw)ud;
hw.interupt();
}
}
|
D
|
// Compiler implementation of the D programming language
// Copyright (c) 1999-2016 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
module ddmd.dinterpret;
import core.stdc.stdio;
import core.stdc.string;
import ddmd.apply;
import ddmd.arraytypes;
import ddmd.attrib;
import ddmd.builtin;
import ddmd.constfold;
import ddmd.ctfeexpr;
import ddmd.dclass;
import ddmd.declaration;
import ddmd.dstruct;
import ddmd.dsymbol;
import ddmd.dtemplate;
import ddmd.errors;
import ddmd.expression;
import ddmd.func;
import ddmd.globals;
import ddmd.id;
import ddmd.identifier;
import ddmd.init;
import ddmd.mtype;
import ddmd.root.array;
import ddmd.root.rootobject;
import ddmd.statement;
import ddmd.tokens;
import ddmd.utf;
import ddmd.visitor;
enum CtfeGoal : int
{
ctfeNeedRvalue, // Must return an Rvalue (== CTFE value)
ctfeNeedLvalue, // Must return an Lvalue (== CTFE reference)
ctfeNeedNothing, // The return value is not required
}
alias ctfeNeedRvalue = CtfeGoal.ctfeNeedRvalue;
alias ctfeNeedLvalue = CtfeGoal.ctfeNeedLvalue;
alias ctfeNeedNothing = CtfeGoal.ctfeNeedNothing;
//debug = LOG;
//debug = LOGASSIGN;
//debug = LOGCOMPILE;
//debug = SHOWPERFORMANCE;
// Maximum allowable recursive function calls in CTFE
enum CTFE_RECURSION_LIMIT = 1000;
/**
The values of all CTFE variables
*/
struct CtfeStack
{
private:
/* The stack. Every declaration we encounter is pushed here,
* together with the VarDeclaration, and the previous
* stack address of that variable, so that we can restore it
* when we leave the stack frame.
* Note that when a function is forward referenced, the interpreter must
* run semantic3, and that may start CTFE again with a NULL istate. Thus
* the stack might not be empty when CTFE begins.
*
* Ctfe Stack addresses are just 0-based integers, but we save
* them as 'void *' because Array can only do pointers.
*/
Expressions values; // values on the stack
VarDeclarations vars; // corresponding variables
Array!(void*) savedId; // id of the previous state of that var
Array!(void*) frames; // all previous frame pointers
Expressions savedThis; // all previous values of localThis
/* Global constants get saved here after evaluation, so we never
* have to redo them. This saves a lot of time and memory.
*/
Expressions globalValues; // values of global constants
size_t framepointer; // current frame pointer
size_t maxStackPointer; // most stack we've ever used
Expression localThis; // value of 'this', or NULL if none
public:
extern (C++) size_t stackPointer()
{
return values.dim;
}
// The current value of 'this', or NULL if none
extern (C++) Expression getThis()
{
return localThis;
}
// Largest number of stack positions we've used
extern (C++) size_t maxStackUsage()
{
return maxStackPointer;
}
// Start a new stack frame, using the provided 'this'.
extern (C++) void startFrame(Expression thisexp)
{
frames.push(cast(void*)cast(size_t)framepointer);
savedThis.push(localThis);
framepointer = stackPointer();
localThis = thisexp;
}
extern (C++) void endFrame()
{
size_t oldframe = cast(size_t)frames[frames.dim - 1];
localThis = savedThis[savedThis.dim - 1];
popAll(framepointer);
framepointer = oldframe;
frames.setDim(frames.dim - 1);
savedThis.setDim(savedThis.dim - 1);
}
extern (C++) bool isInCurrentFrame(VarDeclaration v)
{
if (v.isDataseg() && !v.isCTFE())
return false; // It's a global
return v.ctfeAdrOnStack >= framepointer;
}
extern (C++) Expression getValue(VarDeclaration v)
{
if ((v.isDataseg() || v.storage_class & STCmanifest) && !v.isCTFE())
{
assert(v.ctfeAdrOnStack >= 0 && v.ctfeAdrOnStack < globalValues.dim);
return globalValues[v.ctfeAdrOnStack];
}
assert(v.ctfeAdrOnStack >= 0 && v.ctfeAdrOnStack < stackPointer());
return values[v.ctfeAdrOnStack];
}
extern (C++) void setValue(VarDeclaration v, Expression e)
{
assert(!v.isDataseg() || v.isCTFE());
assert(v.ctfeAdrOnStack >= 0 && v.ctfeAdrOnStack < stackPointer());
values[v.ctfeAdrOnStack] = e;
}
extern (C++) void push(VarDeclaration v)
{
assert(!v.isDataseg() || v.isCTFE());
if (v.ctfeAdrOnStack != cast(size_t)-1 && v.ctfeAdrOnStack >= framepointer)
{
// Already exists in this frame, reuse it.
values[v.ctfeAdrOnStack] = null;
return;
}
savedId.push(cast(void*)cast(size_t)v.ctfeAdrOnStack);
v.ctfeAdrOnStack = cast(int)values.dim;
vars.push(v);
values.push(null);
}
extern (C++) void pop(VarDeclaration v)
{
assert(!v.isDataseg() || v.isCTFE());
assert(!(v.storage_class & (STCref | STCout)));
int oldid = v.ctfeAdrOnStack;
v.ctfeAdrOnStack = cast(int)cast(size_t)savedId[oldid];
if (v.ctfeAdrOnStack == values.dim - 1)
{
values.pop();
vars.pop();
savedId.pop();
}
}
extern (C++) void popAll(size_t stackpointer)
{
if (stackPointer() > maxStackPointer)
maxStackPointer = stackPointer();
assert(values.dim >= stackpointer);
for (size_t i = stackpointer; i < values.dim; ++i)
{
VarDeclaration v = vars[i];
v.ctfeAdrOnStack = cast(int)cast(size_t)savedId[i];
}
values.setDim(stackpointer);
vars.setDim(stackpointer);
savedId.setDim(stackpointer);
}
extern (C++) void saveGlobalConstant(VarDeclaration v, Expression e)
{
assert(v._init && (v.isConst() || v.isImmutable() || v.storage_class & STCmanifest) && !v.isCTFE());
v.ctfeAdrOnStack = cast(int)globalValues.dim;
globalValues.push(e);
}
}
struct InterState
{
InterState* caller; // calling function's InterState
FuncDeclaration fd; // function being interpreted
Statement start; // if !=NULL, start execution at this statement
/* target of CTFEExp result; also
* target of labelled CTFEExp or
* CTFEExp. (null if no label).
*/
Statement gotoTarget;
}
extern (C++) __gshared CtfeStack ctfeStack;
// CTFE diagnostic information
extern (C++) void printCtfePerformanceStats()
{
debug (SHOWPERFORMANCE)
{
printf(" ---- CTFE Performance ----\n");
printf("max call depth = %d\tmax stack = %d\n", CtfeStatus.maxCallDepth, ctfeStack.maxStackUsage());
printf("array allocs = %d\tassignments = %d\n\n", CtfeStatus.numArrayAllocs, CtfeStatus.numAssignments);
}
}
/***********************************************************
* CTFE-object code for a single function
*
* Currently only counts the number of local variables in the function
*/
struct CompiledCtfeFunction
{
FuncDeclaration func; // Function being compiled, NULL if global scope
int numVars; // Number of variables declared in this function
Loc callingloc;
extern (D) this(FuncDeclaration f)
{
func = f;
}
extern (C++) void onDeclaration(VarDeclaration v)
{
//printf("%s CTFE declare %s\n", v->loc.toChars(), v->toChars());
++numVars;
}
extern (C++) void onExpression(Expression e)
{
extern (C++) final class VarWalker : StoppableVisitor
{
alias visit = super.visit;
public:
CompiledCtfeFunction* ccf;
extern (D) this(CompiledCtfeFunction* ccf)
{
this.ccf = ccf;
}
override void visit(Expression e)
{
}
override void visit(ErrorExp e)
{
// Currently there's a front-end bug: silent errors
// can occur inside delegate literals inside is(typeof()).
// Suppress the check in this case.
if (global.gag && ccf.func)
{
stop = 1;
return;
}
.error(e.loc, "CTFE internal error: ErrorExp in %s\n", ccf.func ? ccf.func.loc.toChars() : ccf.callingloc.toChars());
assert(0);
}
override void visit(DeclarationExp e)
{
VarDeclaration v = e.declaration.isVarDeclaration();
if (!v)
return;
TupleDeclaration td = v.toAlias().isTupleDeclaration();
if (td)
{
if (!td.objects)
return;
for (size_t i = 0; i < td.objects.dim; ++i)
{
RootObject o = td.objects.tdata()[i];
Expression ex = isExpression(o);
DsymbolExp s = (ex && ex.op == TOKdsymbol) ? cast(DsymbolExp)ex : null;
assert(s);
VarDeclaration v2 = s.s.isVarDeclaration();
assert(v2);
if (!v2.isDataseg() || v2.isCTFE())
ccf.onDeclaration(v2);
}
}
else if (!(v.isDataseg() || v.storage_class & STCmanifest) || v.isCTFE())
ccf.onDeclaration(v);
Dsymbol s = v.toAlias();
if (s == v && !v.isStatic() && v._init)
{
ExpInitializer ie = v._init.isExpInitializer();
if (ie)
ccf.onExpression(ie.exp);
}
}
override void visit(IndexExp e)
{
if (e.lengthVar)
ccf.onDeclaration(e.lengthVar);
}
override void visit(SliceExp e)
{
if (e.lengthVar)
ccf.onDeclaration(e.lengthVar);
}
}
scope VarWalker v = new VarWalker(&this);
walkPostorder(e, v);
}
}
extern (C++) final class CtfeCompiler : Visitor
{
alias visit = super.visit;
public:
CompiledCtfeFunction* ccf;
extern (D) this(CompiledCtfeFunction* ccf)
{
this.ccf = ccf;
}
override void visit(Statement s)
{
debug (LOGCOMPILE)
{
printf("%s Statement::ctfeCompile %s\n", s.loc.toChars(), s.toChars());
}
assert(0);
}
override void visit(ExpStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ExpStatement::ctfeCompile\n", s.loc.toChars());
}
if (s.exp)
ccf.onExpression(s.exp);
}
override void visit(CompoundStatement s)
{
debug (LOGCOMPILE)
{
printf("%s CompoundStatement::ctfeCompile\n", s.loc.toChars());
}
for (size_t i = 0; i < s.statements.dim; i++)
{
Statement sx = (*s.statements)[i];
if (sx)
ctfeCompile(sx);
}
}
override void visit(UnrolledLoopStatement s)
{
debug (LOGCOMPILE)
{
printf("%s UnrolledLoopStatement::ctfeCompile\n", s.loc.toChars());
}
for (size_t i = 0; i < s.statements.dim; i++)
{
Statement sx = (*s.statements)[i];
if (sx)
ctfeCompile(sx);
}
}
override void visit(IfStatement s)
{
debug (LOGCOMPILE)
{
printf("%s IfStatement::ctfeCompile\n", s.loc.toChars());
}
ccf.onExpression(s.condition);
if (s.ifbody)
ctfeCompile(s.ifbody);
if (s.elsebody)
ctfeCompile(s.elsebody);
}
override void visit(ScopeStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ScopeStatement::ctfeCompile\n", s.loc.toChars());
}
if (s.statement)
ctfeCompile(s.statement);
}
override void visit(OnScopeStatement s)
{
debug (LOGCOMPILE)
{
printf("%s OnScopeStatement::ctfeCompile\n", s.loc.toChars());
}
// rewritten to try/catch/finally
assert(0);
}
override void visit(DoStatement s)
{
debug (LOGCOMPILE)
{
printf("%s DoStatement::ctfeCompile\n", s.loc.toChars());
}
ccf.onExpression(s.condition);
if (s._body)
ctfeCompile(s._body);
}
override void visit(WhileStatement s)
{
debug (LOGCOMPILE)
{
printf("%s WhileStatement::ctfeCompile\n", s.loc.toChars());
}
// rewritten to ForStatement
assert(0);
}
override void visit(ForStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ForStatement::ctfeCompile\n", s.loc.toChars());
}
if (s._init)
ctfeCompile(s._init);
if (s.condition)
ccf.onExpression(s.condition);
if (s.increment)
ccf.onExpression(s.increment);
if (s._body)
ctfeCompile(s._body);
}
override void visit(ForeachStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ForeachStatement::ctfeCompile\n", s.loc.toChars());
}
// rewritten for ForStatement
assert(0);
}
override void visit(SwitchStatement s)
{
debug (LOGCOMPILE)
{
printf("%s SwitchStatement::ctfeCompile\n", s.loc.toChars());
}
ccf.onExpression(s.condition);
// Note that the body contains the the Case and Default
// statements, so we only need to compile the expressions
for (size_t i = 0; i < s.cases.dim; i++)
{
ccf.onExpression((*s.cases)[i].exp);
}
if (s._body)
ctfeCompile(s._body);
}
override void visit(CaseStatement s)
{
debug (LOGCOMPILE)
{
printf("%s CaseStatement::ctfeCompile\n", s.loc.toChars());
}
if (s.statement)
ctfeCompile(s.statement);
}
override void visit(DefaultStatement s)
{
debug (LOGCOMPILE)
{
printf("%s DefaultStatement::ctfeCompile\n", s.loc.toChars());
}
if (s.statement)
ctfeCompile(s.statement);
}
override void visit(GotoDefaultStatement s)
{
debug (LOGCOMPILE)
{
printf("%s GotoDefaultStatement::ctfeCompile\n", s.loc.toChars());
}
}
override void visit(GotoCaseStatement s)
{
debug (LOGCOMPILE)
{
printf("%s GotoCaseStatement::ctfeCompile\n", s.loc.toChars());
}
}
override void visit(SwitchErrorStatement s)
{
debug (LOGCOMPILE)
{
printf("%s SwitchErrorStatement::ctfeCompile\n", s.loc.toChars());
}
}
override void visit(ReturnStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ReturnStatement::ctfeCompile\n", s.loc.toChars());
}
if (s.exp)
ccf.onExpression(s.exp);
}
override void visit(BreakStatement s)
{
debug (LOGCOMPILE)
{
printf("%s BreakStatement::ctfeCompile\n", s.loc.toChars());
}
}
override void visit(ContinueStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ContinueStatement::ctfeCompile\n", s.loc.toChars());
}
}
override void visit(WithStatement s)
{
debug (LOGCOMPILE)
{
printf("%s WithStatement::ctfeCompile\n", s.loc.toChars());
}
// If it is with(Enum) {...}, just execute the body.
if (s.exp.op == TOKscope || s.exp.op == TOKtype)
{
}
else
{
ccf.onDeclaration(s.wthis);
ccf.onExpression(s.exp);
}
if (s._body)
ctfeCompile(s._body);
}
override void visit(TryCatchStatement s)
{
debug (LOGCOMPILE)
{
printf("%s TryCatchStatement::ctfeCompile\n", s.loc.toChars());
}
if (s._body)
ctfeCompile(s._body);
for (size_t i = 0; i < s.catches.dim; i++)
{
Catch ca = (*s.catches)[i];
if (ca.var)
ccf.onDeclaration(ca.var);
if (ca.handler)
ctfeCompile(ca.handler);
}
}
override void visit(TryFinallyStatement s)
{
debug (LOGCOMPILE)
{
printf("%s TryFinallyStatement::ctfeCompile\n", s.loc.toChars());
}
if (s._body)
ctfeCompile(s._body);
if (s.finalbody)
ctfeCompile(s.finalbody);
}
override void visit(ThrowStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ThrowStatement::ctfeCompile\n", s.loc.toChars());
}
ccf.onExpression(s.exp);
}
override void visit(GotoStatement s)
{
debug (LOGCOMPILE)
{
printf("%s GotoStatement::ctfeCompile\n", s.loc.toChars());
}
}
override void visit(LabelStatement s)
{
debug (LOGCOMPILE)
{
printf("%s LabelStatement::ctfeCompile\n", s.loc.toChars());
}
if (s.statement)
ctfeCompile(s.statement);
}
override void visit(ImportStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ImportStatement::ctfeCompile\n", s.loc.toChars());
}
// Contains no variables or executable code
}
override void visit(ForeachRangeStatement s)
{
debug (LOGCOMPILE)
{
printf("%s ForeachRangeStatement::ctfeCompile\n", s.loc.toChars());
}
// rewritten for ForStatement
assert(0);
}
override void visit(AsmStatement s)
{
debug (LOGCOMPILE)
{
printf("%s AsmStatement::ctfeCompile\n", s.loc.toChars());
}
// we can't compile asm statements
}
void ctfeCompile(Statement s)
{
s.accept(this);
}
}
/*************************************
* Compile this function for CTFE.
* At present, this merely allocates variables.
*/
extern (C++) void ctfeCompile(FuncDeclaration fd)
{
debug (LOGCOMPILE)
{
printf("\n%s FuncDeclaration::ctfeCompile %s\n", fd.loc.toChars(), fd.toChars());
}
assert(!fd.ctfeCode);
assert(!fd.semantic3Errors);
assert(fd.semanticRun == PASSsemantic3done);
fd.ctfeCode = new CompiledCtfeFunction(fd);
if (fd.parameters)
{
Type tb = fd.type.toBasetype();
assert(tb.ty == Tfunction);
for (size_t i = 0; i < fd.parameters.dim; i++)
{
VarDeclaration v = (*fd.parameters)[i];
fd.ctfeCode.onDeclaration(v);
}
}
if (fd.vresult)
fd.ctfeCode.onDeclaration(fd.vresult);
scope CtfeCompiler v = new CtfeCompiler(fd.ctfeCode);
v.ctfeCompile(fd.fbody);
}
/*************************************
* Entry point for CTFE.
* A compile-time result is required. Give an error if not possible.
*
* `e` must be semantically valid expression. In other words, it should not
* contain any `ErrorExp`s in it. But, CTFE interpretation will cross over
* functions and may invoke a function that contains `ErrorStatement` in its body.
* If that, the "CTFE failed because of previous errors" error is raised.
*/
extern (C++) Expression ctfeInterpret(Expression e)
{
if (e.op == TOKerror)
return e;
assert(e.type); // Bugzilla 14642
//assert(e->type->ty != Terror); // FIXME
if (e.type.ty == Terror)
return new ErrorExp();
// This code is outside a function, but still needs to be compiled
// (there are compiler-generated temporary variables such as __dollar).
// However, this will only be run once and can then be discarded.
auto ctfeCodeGlobal = CompiledCtfeFunction(null);
ctfeCodeGlobal.callingloc = e.loc;
ctfeCodeGlobal.onExpression(e);
Expression result = interpret(e, null);
if (!CTFEExp.isCantExp(result))
result = scrubReturnValue(e.loc, result);
if (CTFEExp.isCantExp(result))
result = new ErrorExp();
return result;
}
/* Run CTFE on the expression, but allow the expression to be a TypeExp
* or a tuple containing a TypeExp. (This is required by pragma(msg)).
*/
extern (C++) Expression ctfeInterpretForPragmaMsg(Expression e)
{
if (e.op == TOKerror || e.op == TOKtype)
return e;
// It's also OK for it to be a function declaration (happens only with
// __traits(getOverloads))
if (e.op == TOKvar && (cast(VarExp)e).var.isFuncDeclaration())
{
return e;
}
if (e.op != TOKtuple)
return e.ctfeInterpret();
// Tuples need to be treated seperately, since they are
// allowed to contain a TypeExp in this case.
TupleExp tup = cast(TupleExp)e;
Expressions* expsx = null;
for (size_t i = 0; i < tup.exps.dim; ++i)
{
Expression g = (*tup.exps)[i];
Expression h = g;
h = ctfeInterpretForPragmaMsg(g);
if (h != g)
{
if (!expsx)
{
expsx = new Expressions();
expsx.setDim(tup.exps.dim);
for (size_t j = 0; j < tup.exps.dim; j++)
(*expsx)[j] = (*tup.exps)[j];
}
(*expsx)[i] = h;
}
}
if (expsx)
{
auto te = new TupleExp(e.loc, expsx);
expandTuples(te.exps);
te.type = new TypeTuple(te.exps);
return te;
}
return e;
}
/*************************************
* Attempt to interpret a function given the arguments.
* Input:
* istate state for calling function (NULL if none)
* arguments function arguments
* thisarg 'this', if a needThis() function, NULL if not.
*
* Return result expression if successful, TOKcantexp if not,
* or CTFEExp if function returned void.
*/
extern (C++) Expression interpret(FuncDeclaration fd, InterState* istate, Expressions* arguments, Expression thisarg)
{
debug (LOG)
{
printf("\n********\n%s FuncDeclaration::interpret(istate = %p) %s\n", fd.loc.toChars(), istate, fd.toChars());
}
if (fd.semanticRun == PASSsemantic3)
{
fd.error("circular dependency. Functions cannot be interpreted while being compiled");
return CTFEExp.cantexp;
}
if (!fd.functionSemantic3())
return CTFEExp.cantexp;
if (fd.semanticRun < PASSsemantic3done)
return CTFEExp.cantexp;
// CTFE-compile the function
if (!fd.ctfeCode)
ctfeCompile(fd);
Type tb = fd.type.toBasetype();
assert(tb.ty == Tfunction);
TypeFunction tf = cast(TypeFunction)tb;
if (tf.varargs && arguments && ((fd.parameters && arguments.dim != fd.parameters.dim) || (!fd.parameters && arguments.dim)))
{
fd.error("C-style variadic functions are not yet implemented in CTFE");
return CTFEExp.cantexp;
}
// Nested functions always inherit the 'this' pointer from the parent,
// except for delegates. (Note that the 'this' pointer may be null).
// Func literals report isNested() even if they are in global scope,
// so we need to check that the parent is a function.
if (fd.isNested() && fd.toParent2().isFuncDeclaration() && !thisarg && istate)
thisarg = ctfeStack.getThis();
if (fd.needThis() && !thisarg)
{
// error, no this. Prevent segfault.
// Here should be unreachable by the strict 'this' check in front-end.
fd.error("need 'this' to access member %s", fd.toChars());
return CTFEExp.cantexp;
}
// Place to hold all the arguments to the function while
// we are evaluating them.
Expressions eargs;
size_t dim = arguments ? arguments.dim : 0;
assert((fd.parameters ? fd.parameters.dim : 0) == dim);
/* Evaluate all the arguments to the function,
* store the results in eargs[]
*/
eargs.setDim(dim);
for (size_t i = 0; i < dim; i++)
{
Expression earg = (*arguments)[i];
Parameter fparam = Parameter.getNth(tf.parameters, i);
if (fparam.storageClass & (STCout | STCref))
{
if (!istate && (fparam.storageClass & STCout))
{
// initializing an out parameter involves writing to it.
earg.error("global %s cannot be passed as an 'out' parameter at compile time", earg.toChars());
return CTFEExp.cantexp;
}
// Convert all reference arguments into lvalue references
earg = interpret(earg, istate, ctfeNeedLvalue);
if (CTFEExp.isCantExp(earg))
return earg;
}
else if (fparam.storageClass & STClazy)
{
}
else
{
/* Value parameters
*/
Type ta = fparam.type.toBasetype();
if (ta.ty == Tsarray && earg.op == TOKaddress)
{
/* Static arrays are passed by a simple pointer.
* Skip past this to get at the actual arg.
*/
earg = (cast(AddrExp)earg).e1;
}
earg = interpret(earg, istate);
if (CTFEExp.isCantExp(earg))
return earg;
/* Struct literals are passed by value, but we don't need to
* copy them if they are passed as const
*/
if (earg.op == TOKstructliteral && !(fparam.storageClass & (STCconst | STCimmutable)))
earg = copyLiteral(earg).copy();
}
if (earg.op == TOKthrownexception)
{
if (istate)
return earg;
(cast(ThrownExceptionExp)earg).generateUncaughtError();
return CTFEExp.cantexp;
}
eargs[i] = earg;
}
// Now that we've evaluated all the arguments, we can start the frame
// (this is the moment when the 'call' actually takes place).
InterState istatex;
istatex.caller = istate;
istatex.fd = fd;
ctfeStack.startFrame(thisarg);
if (fd.vthis && thisarg)
{
ctfeStack.push(fd.vthis);
setValue(fd.vthis, thisarg);
}
for (size_t i = 0; i < dim; i++)
{
Expression earg = eargs[i];
Parameter fparam = Parameter.getNth(tf.parameters, i);
VarDeclaration v = (*fd.parameters)[i];
debug (LOG)
{
printf("arg[%d] = %s\n", i, earg.toChars());
}
ctfeStack.push(v);
if ((fparam.storageClass & (STCout | STCref)) && earg.op == TOKvar && (cast(VarExp)earg).var.toParent2() == fd)
{
VarDeclaration vx = (cast(VarExp)earg).var.isVarDeclaration();
if (!vx)
{
fd.error("cannot interpret %s as a ref parameter", earg.toChars());
return CTFEExp.cantexp;
}
/* vx is a variable that is declared in fd.
* It means that fd is recursively called. e.g.
*
* void fd(int n, ref int v = dummy) {
* int vx;
* if (n == 1) fd(2, vx);
* }
* fd(1);
*
* The old value of vx on the stack in fd(1)
* should be saved at the start of fd(2, vx) call.
*/
int oldadr = vx.ctfeAdrOnStack;
ctfeStack.push(vx);
assert(!hasValue(vx)); // vx is made uninitialized
// Bugzilla 14299: v->ctfeAdrOnStack should be saved already
// in the stack before the overwrite.
v.ctfeAdrOnStack = oldadr;
assert(hasValue(v)); // ref parameter v should refer existing value.
}
else
{
// Value parameters and non-trivial references
setValueWithoutChecking(v, earg);
}
debug (LOG)
{
printf("interpreted arg[%d] = %s\n", i, earg.toChars());
showCtfeExpr(earg);
}
debug (LOGASSIGN)
{
printf("interpreted arg[%d] = %s\n", i, earg.toChars());
showCtfeExpr(earg);
}
}
if (fd.vresult)
ctfeStack.push(fd.vresult);
// Enter the function
++CtfeStatus.callDepth;
if (CtfeStatus.callDepth > CtfeStatus.maxCallDepth)
CtfeStatus.maxCallDepth = CtfeStatus.callDepth;
Expression e = null;
while (1)
{
if (CtfeStatus.callDepth > CTFE_RECURSION_LIMIT)
{
// This is a compiler error. It must not be suppressed.
global.gag = 0;
fd.error("CTFE recursion limit exceeded");
e = CTFEExp.cantexp;
break;
}
e = interpret(fd.fbody, &istatex);
if (CTFEExp.isCantExp(e))
{
debug (LOG)
{
printf("function body failed to interpret\n");
}
}
if (istatex.start)
{
fd.error("CTFE internal error: failed to resume at statement %s", istatex.start.toChars());
return CTFEExp.cantexp;
}
/* This is how we deal with a recursive statement AST
* that has arbitrary goto statements in it.
* Bubble up a 'result' which is the target of the goto
* statement, then go recursively down the AST looking
* for that statement, then execute starting there.
*/
if (CTFEExp.isGotoExp(e))
{
istatex.start = istatex.gotoTarget; // set starting statement
istatex.gotoTarget = null;
}
else
{
assert(!e || (e.op != TOKcontinue && e.op != TOKbreak));
break;
}
}
// If fell off the end of a void function, return void
if (!e && tf.next.ty == Tvoid)
e = CTFEExp.voidexp;
if (tf.isref && e.op == TOKvar && (cast(VarExp)e).var == fd.vthis)
e = thisarg;
assert(e !is null);
// Leave the function
--CtfeStatus.callDepth;
ctfeStack.endFrame();
// If it generated an uncaught exception, report error.
if (!istate && e.op == TOKthrownexception)
{
(cast(ThrownExceptionExp)e).generateUncaughtError();
e = CTFEExp.cantexp;
}
return e;
}
extern (C++) final class Interpreter : Visitor
{
alias visit = super.visit;
public:
InterState* istate;
CtfeGoal goal;
Expression result;
extern (D) this(InterState* istate, CtfeGoal goal)
{
this.istate = istate;
this.goal = goal;
}
// If e is TOKthrowexception or TOKcantexp,
// set it to 'result' and returns true.
bool exceptionOrCant(Expression e)
{
if (exceptionOrCantInterpret(e))
{
result = e;
return true;
}
return false;
}
static Expressions* copyArrayOnWrite(Expressions* exps, Expressions* original)
{
if (exps is original)
{
if (!original)
exps = new Expressions();
else
exps = original.copy();
++CtfeStatus.numArrayAllocs;
}
return exps;
}
/******************************** Statement ***************************/
override void visit(Statement s)
{
debug (LOG)
{
printf("%s Statement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
s.error("statement %s cannot be interpreted at compile time", s.toChars());
result = CTFEExp.cantexp;
}
override void visit(ExpStatement s)
{
debug (LOG)
{
printf("%s ExpStatement::interpret(%s)\n", s.loc.toChars(), s.exp ? s.exp.toChars() : "");
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
Expression e = interpret(s.exp, istate, ctfeNeedNothing);
if (exceptionOrCant(e))
return;
}
override void visit(CompoundStatement s)
{
debug (LOG)
{
printf("%s CompoundStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
size_t dim = s.statements ? s.statements.dim : 0;
for (size_t i = 0; i < dim; i++)
{
Statement sx = (*s.statements)[i];
result = interpret(sx, istate);
if (result)
break;
}
debug (LOG)
{
printf("%s -CompoundStatement::interpret() %p\n", s.loc.toChars(), result);
}
}
override void visit(UnrolledLoopStatement s)
{
debug (LOG)
{
printf("%s UnrolledLoopStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
size_t dim = s.statements ? s.statements.dim : 0;
for (size_t i = 0; i < dim; i++)
{
Statement sx = (*s.statements)[i];
Expression e = interpret(sx, istate);
if (!e) // suceeds to interpret, or goto target was not found
continue;
if (exceptionOrCant(e))
return;
if (e.op == TOKbreak)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // break at a higher level
return;
}
istate.gotoTarget = null;
result = null;
return;
}
if (e.op == TOKcontinue)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // continue at a higher level
return;
}
istate.gotoTarget = null;
continue;
}
// expression from return statement, or thrown exception
result = e;
break;
}
}
override void visit(IfStatement s)
{
debug (LOG)
{
printf("%s IfStatement::interpret(%s)\n", s.loc.toChars(), s.condition.toChars());
}
if (istate.start == s)
istate.start = null;
if (istate.start)
{
Expression e = null;
e = interpret(s.ifbody, istate);
if (!e && istate.start)
e = interpret(s.elsebody, istate);
result = e;
return;
}
Expression e = interpret(s.condition, istate);
assert(e);
if (exceptionOrCant(e))
return;
if (isTrueBool(e))
result = interpret(s.ifbody, istate);
else if (e.isBool(false))
result = interpret(s.elsebody, istate);
else
{
// no error, or assert(0)?
result = CTFEExp.cantexp;
}
}
override void visit(ScopeStatement s)
{
debug (LOG)
{
printf("%s ScopeStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
result = interpret(s.statement, istate);
}
/**
Given an expression e which is about to be returned from the current
function, generate an error if it contains pointers to local variables.
Return true if it is safe to return, false if an error was generated.
Only checks expressions passed by value (pointers to local variables
may already be stored in members of classes, arrays, or AAs which
were passed as mutable function parameters).
*/
static bool stopPointersEscaping(Loc loc, Expression e)
{
if (!e.type.hasPointers())
return true;
if (isPointer(e.type))
{
Expression x = e;
if (e.op == TOKaddress)
x = (cast(AddrExp)e).e1;
VarDeclaration v;
while (x.op == TOKvar && (v = (cast(VarExp)x).var.isVarDeclaration()) !is null)
{
if (v.storage_class & STCref)
{
x = getValue(v);
if (e.op == TOKaddress)
(cast(AddrExp)e).e1 = x;
continue;
}
if (ctfeStack.isInCurrentFrame(v))
{
error(loc, "returning a pointer to a local stack variable");
return false;
}
else
break;
}
// TODO: If it is a TOKdotvar or TOKindex, we should check that it is not
// pointing to a local struct or static array.
}
if (e.op == TOKstructliteral)
{
StructLiteralExp se = cast(StructLiteralExp)e;
return stopPointersEscapingFromArray(loc, se.elements);
}
if (e.op == TOKarrayliteral)
{
return stopPointersEscapingFromArray(loc, (cast(ArrayLiteralExp)e).elements);
}
if (e.op == TOKassocarrayliteral)
{
AssocArrayLiteralExp aae = cast(AssocArrayLiteralExp)e;
if (!stopPointersEscapingFromArray(loc, aae.keys))
return false;
return stopPointersEscapingFromArray(loc, aae.values);
}
return true;
}
// Check all members of an array for escaping local variables. Return false if error
static bool stopPointersEscapingFromArray(Loc loc, Expressions* elems)
{
for (size_t i = 0; i < elems.dim; i++)
{
Expression m = (*elems)[i];
if (!m)
continue;
if (!stopPointersEscaping(loc, m))
return false;
}
return true;
}
override void visit(ReturnStatement s)
{
debug (LOG)
{
printf("%s ReturnStatement::interpret(%s)\n", s.loc.toChars(), s.exp ? s.exp.toChars() : "");
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
if (!s.exp)
{
result = CTFEExp.voidexp;
return;
}
assert(istate && istate.fd && istate.fd.type && istate.fd.type.ty == Tfunction);
TypeFunction tf = cast(TypeFunction)istate.fd.type;
/* If the function returns a ref AND it's been called from an assignment,
* we need to return an lvalue. Otherwise, just do an (rvalue) interpret.
*/
if (tf.isref)
{
result = interpret(s.exp, istate, ctfeNeedLvalue);
return;
}
if (tf.next && tf.next.ty == Tdelegate && istate.fd.closureVars.dim > 0)
{
// To support this, we need to copy all the closure vars
// into the delegate literal.
s.error("closures are not yet supported in CTFE");
result = CTFEExp.cantexp;
return;
}
// We need to treat pointers specially, because TOKsymoff can be used to
// return a value OR a pointer
Expression e = interpret(s.exp, istate);
if (exceptionOrCant(e))
return;
// Disallow returning pointers to stack-allocated variables (bug 7876)
if (!stopPointersEscaping(s.loc, e))
{
result = CTFEExp.cantexp;
return;
}
if (needToCopyLiteral(e))
e = copyLiteral(e).copy();
debug (LOGASSIGN)
{
printf("RETURN %s\n", s.loc.toChars());
showCtfeExpr(e);
}
result = e;
}
static Statement findGotoTarget(InterState* istate, Identifier ident)
{
Statement target = null;
if (ident)
{
LabelDsymbol label = istate.fd.searchLabel(ident);
assert(label && label.statement);
LabelStatement ls = label.statement;
target = ls.gotoTarget ? ls.gotoTarget : ls.statement;
}
return target;
}
override void visit(BreakStatement s)
{
debug (LOG)
{
printf("%s BreakStatement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
istate.gotoTarget = findGotoTarget(istate, s.ident);
result = CTFEExp.breakexp;
}
override void visit(ContinueStatement s)
{
debug (LOG)
{
printf("%s ContinueStatement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
istate.gotoTarget = findGotoTarget(istate, s.ident);
result = CTFEExp.continueexp;
}
override void visit(WhileStatement s)
{
debug (LOG)
{
printf("WhileStatement::interpret()\n");
}
assert(0); // rewritten to ForStatement
}
override void visit(DoStatement s)
{
debug (LOG)
{
printf("%s DoStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
while (1)
{
Expression e = interpret(s._body, istate);
if (!e && istate.start) // goto target was not found
return;
assert(!istate.start);
if (exceptionOrCant(e))
return;
if (e && e.op == TOKbreak)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // break at a higher level
return;
}
istate.gotoTarget = null;
break;
}
if (e && e.op == TOKcontinue)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // continue at a higher level
return;
}
istate.gotoTarget = null;
e = null;
}
if (e)
{
result = e; // bubbled up from ReturnStatement
return;
}
e = interpret(s.condition, istate);
if (exceptionOrCant(e))
return;
if (!e.isConst())
{
result = CTFEExp.cantexp;
return;
}
if (e.isBool(false))
break;
assert(isTrueBool(e));
}
assert(result is null);
}
override void visit(ForStatement s)
{
debug (LOG)
{
printf("%s ForStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
Expression ei = interpret(s._init, istate);
if (exceptionOrCant(ei))
return;
assert(!ei); // s->init never returns from function, or jumps out from it
while (1)
{
if (s.condition && !istate.start)
{
Expression e = interpret(s.condition, istate);
if (exceptionOrCant(e))
return;
if (e.isBool(false))
break;
assert(isTrueBool(e));
}
Expression e = interpret(s._body, istate);
if (!e && istate.start) // goto target was not found
return;
assert(!istate.start);
if (exceptionOrCant(e))
return;
if (e && e.op == TOKbreak)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // break at a higher level
return;
}
istate.gotoTarget = null;
break;
}
if (e && e.op == TOKcontinue)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // continue at a higher level
return;
}
istate.gotoTarget = null;
e = null;
}
if (e)
{
result = e; // bubbled up from ReturnStatement
return;
}
e = interpret(s.increment, istate, ctfeNeedNothing);
if (exceptionOrCant(e))
return;
}
assert(result is null);
}
override void visit(ForeachStatement s)
{
assert(0); // rewritten to ForStatement
}
override void visit(ForeachRangeStatement s)
{
assert(0); // rewritten to ForStatement
}
override void visit(SwitchStatement s)
{
debug (LOG)
{
printf("%s SwitchStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
if (istate.start)
{
Expression e = interpret(s._body, istate);
if (istate.start) // goto target was not found
return;
if (exceptionOrCant(e))
return;
if (e && e.op == TOKbreak)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // break at a higher level
return;
}
istate.gotoTarget = null;
e = null;
}
result = e;
return;
}
Expression econdition = interpret(s.condition, istate);
if (exceptionOrCant(econdition))
return;
Statement scase = null;
size_t dim = s.cases ? s.cases.dim : 0;
for (size_t i = 0; i < dim; i++)
{
CaseStatement cs = (*s.cases)[i];
Expression ecase = interpret(cs.exp, istate);
if (exceptionOrCant(ecase))
return;
if (ctfeEqual(cs.exp.loc, TOKequal, econdition, ecase))
{
scase = cs;
break;
}
}
if (!scase)
{
if (s.hasNoDefault)
s.error("no default or case for %s in switch statement", econdition.toChars());
scase = s.sdefault;
}
assert(scase);
/* Jump to scase
*/
istate.start = scase;
Expression e = interpret(s._body, istate);
assert(!istate.start); // jump must not fail
if (e && e.op == TOKbreak)
{
if (istate.gotoTarget && istate.gotoTarget != s)
{
result = e; // break at a higher level
return;
}
istate.gotoTarget = null;
e = null;
}
result = e;
}
override void visit(CaseStatement s)
{
debug (LOG)
{
printf("%s CaseStatement::interpret(%s) this = %p\n", s.loc.toChars(), s.exp.toChars(), s);
}
if (istate.start == s)
istate.start = null;
result = interpret(s.statement, istate);
}
override void visit(DefaultStatement s)
{
debug (LOG)
{
printf("%s DefaultStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
result = interpret(s.statement, istate);
}
override void visit(GotoStatement s)
{
debug (LOG)
{
printf("%s GotoStatement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
assert(s.label && s.label.statement);
istate.gotoTarget = s.label.statement;
result = CTFEExp.gotoexp;
}
override void visit(GotoCaseStatement s)
{
debug (LOG)
{
printf("%s GotoCaseStatement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
assert(s.cs);
istate.gotoTarget = s.cs;
result = CTFEExp.gotoexp;
}
override void visit(GotoDefaultStatement s)
{
debug (LOG)
{
printf("%s GotoDefaultStatement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
assert(s.sw && s.sw.sdefault);
istate.gotoTarget = s.sw.sdefault;
result = CTFEExp.gotoexp;
}
override void visit(LabelStatement s)
{
debug (LOG)
{
printf("%s LabelStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
result = interpret(s.statement, istate);
}
override void visit(TryCatchStatement s)
{
debug (LOG)
{
printf("%s TryCatchStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
if (istate.start)
{
Expression e = null;
e = interpret(s._body, istate);
for (size_t i = 0; i < s.catches.dim; i++)
{
if (e || !istate.start) // goto target was found
break;
Catch ca = (*s.catches)[i];
e = interpret(ca.handler, istate);
}
result = e;
return;
}
Expression e = interpret(s._body, istate);
// An exception was thrown
if (e && e.op == TOKthrownexception)
{
ThrownExceptionExp ex = cast(ThrownExceptionExp)e;
Type extype = ex.thrown.originalClass().type;
// Search for an appropriate catch clause.
for (size_t i = 0; i < s.catches.dim; i++)
{
Catch ca = (*s.catches)[i];
Type catype = ca.type;
if (!catype.equals(extype) && !catype.isBaseOf(extype, null))
continue;
// Execute the handler
if (ca.var)
{
ctfeStack.push(ca.var);
setValue(ca.var, ex.thrown);
}
e = interpret(ca.handler, istate);
if (CTFEExp.isGotoExp(e))
{
/* This is an optimization that relies on the locality of the jump target.
* If the label is in the same catch handler, the following scan
* would find it quickly and can reduce jump cost.
* Otherwise, the catch block may be unnnecessary scanned again
* so it would make CTFE speed slower.
*/
InterState istatex = *istate;
istatex.start = istate.gotoTarget; // set starting statement
istatex.gotoTarget = null;
Expression eh = interpret(ca.handler, &istatex);
if (!istatex.start)
{
istate.gotoTarget = null;
e = eh;
}
}
break;
}
}
result = e;
}
static bool isAnErrorException(ClassDeclaration cd)
{
return cd == ClassDeclaration.errorException || ClassDeclaration.errorException.isBaseOf(cd, null);
}
static ThrownExceptionExp chainExceptions(ThrownExceptionExp oldest, ThrownExceptionExp newest)
{
debug (LOG)
{
printf("Collided exceptions %s %s\n", oldest.thrown.toChars(), newest.thrown.toChars());
}
// Little sanity check to make sure it's really a Throwable
ClassReferenceExp boss = oldest.thrown;
assert((*boss.value.elements)[4].type.ty == Tclass); // Throwable.next
ClassReferenceExp collateral = newest.thrown;
if (isAnErrorException(collateral.originalClass()) && !isAnErrorException(boss.originalClass()))
{
// The new exception bypass the existing chain
assert((*collateral.value.elements)[5].type.ty == Tclass);
(*collateral.value.elements)[5] = boss;
return newest;
}
while ((*boss.value.elements)[4].op == TOKclassreference)
{
boss = cast(ClassReferenceExp)(*boss.value.elements)[4];
}
(*boss.value.elements)[4] = collateral;
return oldest;
}
override void visit(TryFinallyStatement s)
{
debug (LOG)
{
printf("%s TryFinallyStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
if (istate.start)
{
Expression e = null;
e = interpret(s._body, istate);
// Jump into/out from finalbody is disabled in semantic analysis.
// and jump inside will be handled by the ScopeStatement == finalbody.
result = e;
return;
}
Expression ex = interpret(s._body, istate);
if (CTFEExp.isCantExp(ex))
{
result = ex;
return;
}
while (CTFEExp.isGotoExp(ex))
{
// If the goto target is within the body, we must not interpret the finally statement,
// because that will call destructors for objects within the scope, which we should not do.
InterState istatex = *istate;
istatex.start = istate.gotoTarget; // set starting statement
istatex.gotoTarget = null;
Expression bex = interpret(s._body, &istatex);
if (istatex.start)
{
// The goto target is outside the current scope.
break;
}
// The goto target was within the body.
if (CTFEExp.isCantExp(bex))
{
result = bex;
return;
}
*istate = istatex;
ex = bex;
}
Expression ey = interpret(s.finalbody, istate);
if (CTFEExp.isCantExp(ey))
{
result = ey;
return;
}
if (ey && ey.op == TOKthrownexception)
{
// Check for collided exceptions
if (ex && ex.op == TOKthrownexception)
ex = chainExceptions(cast(ThrownExceptionExp)ex, cast(ThrownExceptionExp)ey);
else
ex = ey;
}
result = ex;
}
override void visit(ThrowStatement s)
{
debug (LOG)
{
printf("%s ThrowStatement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
Expression e = interpret(s.exp, istate);
if (exceptionOrCant(e))
return;
assert(e.op == TOKclassreference);
result = new ThrownExceptionExp(s.loc, cast(ClassReferenceExp)e);
}
override void visit(OnScopeStatement s)
{
assert(0);
}
override void visit(WithStatement s)
{
debug (LOG)
{
printf("%s WithStatement::interpret()\n", s.loc.toChars());
}
if (istate.start == s)
istate.start = null;
if (istate.start)
{
result = s._body ? interpret(s._body, istate) : null;
return;
}
// If it is with(Enum) {...}, just execute the body.
if (s.exp.op == TOKscope || s.exp.op == TOKtype)
{
result = interpret(s._body, istate);
return;
}
Expression e = interpret(s.exp, istate);
if (exceptionOrCant(e))
return;
if (s.wthis.type.ty == Tpointer && s.exp.type.ty != Tpointer)
{
e = new AddrExp(s.loc, e);
e.type = s.wthis.type;
}
ctfeStack.push(s.wthis);
setValue(s.wthis, e);
e = interpret(s._body, istate);
if (CTFEExp.isGotoExp(e))
{
/* This is an optimization that relies on the locality of the jump target.
* If the label is in the same WithStatement, the following scan
* would find it quickly and can reduce jump cost.
* Otherwise, the statement body may be unnnecessary scanned again
* so it would make CTFE speed slower.
*/
InterState istatex = *istate;
istatex.start = istate.gotoTarget; // set starting statement
istatex.gotoTarget = null;
Expression ex = interpret(s._body, &istatex);
if (!istatex.start)
{
istate.gotoTarget = null;
e = ex;
}
}
ctfeStack.pop(s.wthis);
result = e;
}
override void visit(AsmStatement s)
{
debug (LOG)
{
printf("%s AsmStatement::interpret()\n", s.loc.toChars());
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
s.error("asm statements cannot be interpreted at compile time");
result = CTFEExp.cantexp;
}
override void visit(ImportStatement s)
{
debug (LOG)
{
printf("ImportStatement::interpret()\n");
}
if (istate.start)
{
if (istate.start != s)
return;
istate.start = null;
}
}
/******************************** Expression ***************************/
override void visit(Expression e)
{
debug (LOG)
{
printf("%s Expression::interpret() '%s' %s\n", e.loc.toChars(), Token.toChars(e.op), e.toChars());
printf("type = %s\n", e.type.toChars());
e.print();
}
e.error("cannot interpret %s at compile time", e.toChars());
result = CTFEExp.cantexp;
}
override void visit(ThisExp e)
{
debug (LOG)
{
printf("%s ThisExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (goal == ctfeNeedLvalue)
{
if (istate.fd.vthis)
{
result = new VarExp(e.loc, istate.fd.vthis);
result.type = e.type;
}
else
result = e;
return;
}
result = ctfeStack.getThis();
if (result)
{
assert(result.op == TOKstructliteral || result.op == TOKclassreference);
return;
}
e.error("value of 'this' is not known at compile time");
result = CTFEExp.cantexp;
}
override void visit(NullExp e)
{
result = e;
}
override void visit(IntegerExp e)
{
debug (LOG)
{
printf("%s IntegerExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
result = e;
}
override void visit(RealExp e)
{
debug (LOG)
{
printf("%s RealExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
result = e;
}
override void visit(ComplexExp e)
{
result = e;
}
override void visit(StringExp e)
{
debug (LOG)
{
printf("%s StringExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
/* Attempts to modify string literals are prevented
* in BinExp::interpretAssignCommon.
*/
result = e;
}
override void visit(FuncExp e)
{
debug (LOG)
{
printf("%s FuncExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
result = e;
}
override void visit(SymOffExp e)
{
debug (LOG)
{
printf("%s SymOffExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (e.var.isFuncDeclaration() && e.offset == 0)
{
result = e;
return;
}
if (isTypeInfo_Class(e.type) && e.offset == 0)
{
result = e;
return;
}
if (e.type.ty != Tpointer)
{
// Probably impossible
e.error("cannot interpret %s at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
Type pointee = (cast(TypePointer)e.type).next;
if (e.var.isThreadlocal())
{
e.error("cannot take address of thread-local variable %s at compile time", e.var.toChars());
result = CTFEExp.cantexp;
return;
}
// Check for taking an address of a shared variable.
// If the shared variable is an array, the offset might not be zero.
Type fromType = null;
if (e.var.type.ty == Tarray || e.var.type.ty == Tsarray)
{
fromType = (cast(TypeArray)e.var.type).next;
}
if (e.var.isDataseg() && ((e.offset == 0 && isSafePointerCast(e.var.type, pointee)) || (fromType && isSafePointerCast(fromType, pointee))))
{
result = e;
return;
}
Expression val = getVarExp(e.loc, istate, e.var, goal);
if (exceptionOrCant(val))
return;
if (val.type.ty == Tarray || val.type.ty == Tsarray)
{
// Check for unsupported type painting operations
Type elemtype = (cast(TypeArray)val.type).next;
d_uns64 elemsize = elemtype.size();
// It's OK to cast from fixed length to dynamic array, eg &int[3] to int[]*
if (val.type.ty == Tsarray && pointee.ty == Tarray && elemsize == pointee.nextOf().size())
{
result = new AddrExp(e.loc, val);
result.type = e.type;
return;
}
// It's OK to cast from fixed length to fixed length array, eg &int[n] to int[d]*.
if (val.type.ty == Tsarray && pointee.ty == Tsarray && elemsize == pointee.nextOf().size())
{
size_t d = cast(size_t)(cast(TypeSArray)pointee).dim.toInteger();
Expression elwr = new IntegerExp(e.loc, e.offset / elemsize, Type.tsize_t);
Expression eupr = new IntegerExp(e.loc, e.offset / elemsize + d, Type.tsize_t);
// Create a CTFE pointer &val[ofs..ofs+d]
result = new SliceExp(e.loc, val, elwr, eupr);
result.type = pointee;
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
if (!isSafePointerCast(elemtype, pointee))
{
// It's also OK to cast from &string to string*.
if (e.offset == 0 && isSafePointerCast(e.var.type, pointee))
{
// Create a CTFE pointer &var
result = new VarExp(e.loc, e.var);
result.type = elemtype;
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
e.error("reinterpreting cast from %s to %s is not supported in CTFE", val.type.toChars(), e.type.toChars());
result = CTFEExp.cantexp;
return;
}
dinteger_t sz = pointee.size();
dinteger_t indx = e.offset / sz;
assert(sz * indx == e.offset);
Expression aggregate = null;
if (val.op == TOKarrayliteral || val.op == TOKstring)
{
aggregate = val;
}
else if (val.op == TOKslice)
{
aggregate = (cast(SliceExp)val).e1;
Expression lwr = interpret((cast(SliceExp)val).lwr, istate);
indx += lwr.toInteger();
}
if (aggregate)
{
// Create a CTFE pointer &aggregate[ofs]
auto ofs = new IntegerExp(e.loc, indx, Type.tsize_t);
result = new IndexExp(e.loc, aggregate, ofs);
result.type = elemtype;
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
}
else if (e.offset == 0 && isSafePointerCast(e.var.type, pointee))
{
// Create a CTFE pointer &var
auto ve = new VarExp(e.loc, e.var);
ve.type = e.var.type;
result = new AddrExp(e.loc, ve);
result.type = e.type;
return;
}
e.error("cannot convert &%s to %s at compile time", e.var.type.toChars(), e.type.toChars());
result = CTFEExp.cantexp;
}
override void visit(AddrExp e)
{
debug (LOG)
{
printf("%s AddrExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (e.e1.op == TOKvar && (cast(VarExp)e.e1).var.isDataseg())
{
// Normally this is already done by optimize()
// Do it here in case optimize(WANTvalue) wasn't run before CTFE
result = new SymOffExp(e.loc, (cast(VarExp)e.e1).var, 0);
result.type = e.type;
return;
}
result = interpret(e.e1, istate, ctfeNeedLvalue);
if (result.op == TOKvar && (cast(VarExp)result).var == istate.fd.vthis)
result = interpret(result, istate);
if (exceptionOrCant(result))
return;
// Return a simplified address expression
result = new AddrExp(e.loc, result);
result.type = e.type;
}
override void visit(DelegateExp e)
{
debug (LOG)
{
printf("%s DelegateExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
// TODO: Really we should create a CTFE-only delegate expression
// of a pointer and a funcptr.
// If it is &nestedfunc, just return it
// TODO: We should save the context pointer
if (e.e1.op == TOKvar && (cast(VarExp)e.e1).var == e.func)
{
result = e;
return;
}
result = interpret(e.e1, istate);
if (exceptionOrCant(result))
return;
if (result == e.e1)
{
// If it has already been CTFE'd, just return it
result = e;
}
else
{
result = new DelegateExp(e.loc, result, e.func, false);
result.type = e.type;
}
}
static Expression getVarExp(Loc loc, InterState* istate, Declaration d, CtfeGoal goal)
{
Expression e = CTFEExp.cantexp;
if (VarDeclaration v = d.isVarDeclaration())
{
/* Magic variable __ctfe always returns true when interpreting
*/
if (v.ident == Id.ctfe)
return new IntegerExp(loc, 1, Type.tbool);
if (!v.originalType && v._scope) // semantic() not yet run
{
v.semantic(v._scope);
if (v.type.ty == Terror)
return CTFEExp.cantexp;
}
if ((v.isConst() || v.isImmutable() || v.storage_class & STCmanifest) && !hasValue(v) && v._init && !v.isCTFE())
{
if (v.inuse)
{
error(loc, "circular initialization of %s '%s'", v.kind(), v.toPrettyChars());
return CTFEExp.cantexp;
}
if (v._scope)
{
v.inuse++;
v._init = v._init.semantic(v._scope, v.type, INITinterpret); // might not be run on aggregate members
v.inuse--;
}
e = v._init.toExpression(v.type);
if (!e)
return CTFEExp.cantexp;
assert(e.type);
if (e.op == TOKconstruct || e.op == TOKblit)
{
AssignExp ae = cast(AssignExp)e;
e = ae.e2;
}
if (e.op == TOKerror)
{
// FIXME: Ultimately all errors should be detected in prior semantic analysis stage.
}
else if (v.isDataseg() || (v.storage_class & STCmanifest))
{
/* Bugzilla 14304: e is a value that is not yet owned by CTFE.
* Mark as "cached", and use it directly during interpretation.
*/
e = scrubCacheValue(v.loc, e);
ctfeStack.saveGlobalConstant(v, e);
}
else
{
v.inuse++;
e = interpret(e, istate);
v.inuse--;
if (CTFEExp.isCantExp(e) && !global.gag && !CtfeStatus.stackTraceCallsToSuppress)
errorSupplemental(loc, "while evaluating %s.init", v.toChars());
if (exceptionOrCantInterpret(e))
return e;
}
}
else if (v.isCTFE() && !hasValue(v))
{
if (v._init && v.type.size() != 0)
{
if (v._init.isVoidInitializer())
{
// var should have been initialized when it was created
error(loc, "CTFE internal error: trying to access uninitialized var");
assert(0);
}
e = v._init.toExpression();
}
else
e = v.type.defaultInitLiteral(e.loc);
e = interpret(e, istate);
}
else if (!(v.isDataseg() || v.storage_class & STCmanifest) && !v.isCTFE() && !istate)
{
error(loc, "variable %s cannot be read at compile time", v.toChars());
return CTFEExp.cantexp;
}
else
{
e = hasValue(v) ? getValue(v) : null;
if (!e && !v.isCTFE() && v.isDataseg())
{
error(loc, "static variable %s cannot be read at compile time", v.toChars());
return CTFEExp.cantexp;
}
if (!e)
{
assert(!(v._init && v._init.isVoidInitializer()));
// CTFE initiated from inside a function
error(loc, "variable %s cannot be read at compile time", v.toChars());
return CTFEExp.cantexp;
}
if (e.op == TOKvoid)
{
VoidInitExp ve = cast(VoidInitExp)e;
error(loc, "cannot read uninitialized variable %s in ctfe", v.toPrettyChars());
errorSupplemental(ve.var.loc, "%s was uninitialized and used before set", ve.var.toChars());
return CTFEExp.cantexp;
}
if (goal != ctfeNeedLvalue && (v.isRef() || v.isOut()))
e = interpret(e, istate, goal);
}
if (!e)
e = CTFEExp.cantexp;
}
else if (SymbolDeclaration s = d.isSymbolDeclaration())
{
// Struct static initializers, for example
e = s.dsym.type.defaultInitLiteral(loc);
if (e.op == TOKerror)
error(loc, "CTFE failed because of previous errors in %s.init", s.toChars());
e = e.semantic(null);
if (e.op == TOKerror)
e = CTFEExp.cantexp;
else // Convert NULL to CTFEExp
e = interpret(e, istate, goal);
}
else
error(loc, "cannot interpret declaration %s at compile time", d.toChars());
return e;
}
override void visit(VarExp e)
{
debug (LOG)
{
printf("%s VarExp::interpret() %s, goal = %d\n", e.loc.toChars(), e.toChars(), goal);
}
if (e.var.isFuncDeclaration())
{
result = e;
return;
}
if (goal == ctfeNeedLvalue)
{
VarDeclaration v = e.var.isVarDeclaration();
if (v && !v.isDataseg() && !v.isCTFE() && !istate)
{
e.error("variable %s cannot be read at compile time", v.toChars());
result = CTFEExp.cantexp;
return;
}
if (v && !hasValue(v))
{
if (!v.isCTFE() && v.isDataseg())
e.error("static variable %s cannot be read at compile time", v.toChars());
else // CTFE initiated from inside a function
e.error("variable %s cannot be read at compile time", v.toChars());
result = CTFEExp.cantexp;
return;
}
if (v && (v.storage_class & (STCout | STCref)) && hasValue(v))
{
// Strip off the nest of ref variables
Expression ev = getValue(v);
if (ev.op == TOKvar || ev.op == TOKindex || ev.op == TOKdotvar)
{
result = interpret(ev, istate, goal);
return;
}
}
result = e;
return;
}
result = getVarExp(e.loc, istate, e.var, goal);
if (exceptionOrCant(result))
return;
if ((e.var.storage_class & (STCref | STCout)) == 0 && e.type.baseElemOf().ty != Tstruct)
{
/* Ultimately, STCref|STCout check should be enough to see the
* necessity of type repainting. But currently front-end paints
* non-ref struct variables by the const type.
*
* auto foo(ref const S cs);
* S s;
* foo(s); // VarExp('s') will have const(S)
*/
// A VarExp may include an implicit cast. It must be done explicitly.
result = paintTypeOntoLiteral(e.type, result);
}
}
override void visit(DeclarationExp e)
{
debug (LOG)
{
printf("%s DeclarationExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Dsymbol s = e.declaration;
if (VarDeclaration v = s.isVarDeclaration())
{
if (TupleDeclaration td = v.toAlias().isTupleDeclaration())
{
result = null;
// Reserve stack space for all tuple members
if (!td.objects)
return;
for (size_t i = 0; i < td.objects.dim; ++i)
{
RootObject o = (*td.objects)[i];
Expression ex = isExpression(o);
DsymbolExp ds = (ex && ex.op == TOKdsymbol) ? cast(DsymbolExp)ex : null;
VarDeclaration v2 = ds ? ds.s.isVarDeclaration() : null;
assert(v2);
if (v2.isDataseg() && !v2.isCTFE())
continue;
ctfeStack.push(v2);
if (v2._init)
{
Expression einit;
if (ExpInitializer ie = v2._init.isExpInitializer())
{
einit = interpret(ie.exp, istate, goal);
if (exceptionOrCant(einit))
return;
}
else if (v2._init.isVoidInitializer())
{
einit = voidInitLiteral(v2.type, v2).copy();
}
else
{
e.error("declaration %s is not yet implemented in CTFE", e.toChars());
result = CTFEExp.cantexp;
return;
}
setValue(v2, einit);
}
}
return;
}
if (v.isStatic())
{
// Just ignore static variables which aren't read or written yet
result = null;
return;
}
if (!(v.isDataseg() || v.storage_class & STCmanifest) || v.isCTFE())
ctfeStack.push(v);
if (v._init)
{
if (ExpInitializer ie = v._init.isExpInitializer())
{
result = interpret(ie.exp, istate, goal);
}
else if (v._init.isVoidInitializer())
{
result = voidInitLiteral(v.type, v).copy();
// There is no AssignExp for void initializers,
// so set it here.
setValue(v, result);
}
else
{
e.error("declaration %s is not yet implemented in CTFE", e.toChars());
result = CTFEExp.cantexp;
}
}
else if (v.type.size() == 0)
{
// Zero-length arrays don't need an initializer
result = v.type.defaultInitLiteral(e.loc);
}
else
{
e.error("variable %s cannot be modified at compile time", v.toChars());
result = CTFEExp.cantexp;
}
return;
}
if (s.isAttribDeclaration() || s.isTemplateMixin() || s.isTupleDeclaration())
{
// Check for static struct declarations, which aren't executable
AttribDeclaration ad = e.declaration.isAttribDeclaration();
if (ad && ad.decl && ad.decl.dim == 1)
{
Dsymbol sparent = (*ad.decl)[0];
if (sparent.isAggregateDeclaration() || sparent.isTemplateDeclaration() || sparent.isAliasDeclaration())
{
result = null;
return; // static (template) struct declaration. Nothing to do.
}
}
// These can be made to work, too lazy now
e.error("declaration %s is not yet implemented in CTFE", e.toChars());
result = CTFEExp.cantexp;
return;
}
// Others should not contain executable code, so are trivial to evaluate
result = null;
debug (LOG)
{
printf("-DeclarationExp::interpret(%s): %p\n", e.toChars(), result);
}
}
override void visit(TypeidExp e)
{
debug (LOG)
{
printf("%s TypeidExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (Type t = isType(e.obj))
{
result = e;
return;
}
if (Expression ex = isExpression(e.obj))
{
result = interpret(ex, istate);
if (exceptionOrCant(ex))
return;
if (result.op == TOKnull)
{
e.error("null pointer dereference evaluating typeid. '%s' is null", ex.toChars());
result = CTFEExp.cantexp;
return;
}
if (result.op != TOKclassreference)
{
e.error("CTFE internal error: determining classinfo");
result = CTFEExp.cantexp;
return;
}
ClassDeclaration cd = (cast(ClassReferenceExp)result).originalClass();
assert(cd);
result = new TypeidExp(e.loc, cd.type);
result.type = e.type;
return;
}
visit(cast(Expression)e);
}
override void visit(TupleExp e)
{
debug (LOG)
{
printf("%s TupleExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (exceptionOrCant(interpret(e.e0, istate, ctfeNeedNothing)))
return;
auto expsx = e.exps;
for (size_t i = 0; i < expsx.dim; i++)
{
Expression exp = (*expsx)[i];
Expression ex = interpret(exp, istate);
if (exceptionOrCant(ex))
return;
// A tuple of assignments can contain void (Bug 5676).
if (goal == ctfeNeedNothing)
continue;
if (ex.op == TOKvoidexp)
{
e.error("CTFE internal error: void element %s in tuple", exp.toChars());
assert(0);
}
/* If any changes, do Copy On Write
*/
if (ex !is exp)
{
expsx = copyArrayOnWrite(expsx, e.exps);
(*expsx)[i] = ex;
}
}
if (expsx !is e.exps)
{
expandTuples(expsx);
auto te = new TupleExp(e.loc, expsx);
te.type = new TypeTuple(te.exps);
result = te;
}
else
result = e;
}
override void visit(ArrayLiteralExp e)
{
debug (LOG)
{
printf("%s ArrayLiteralExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (e.ownedByCtfe >= OWNEDctfe) // We've already interpreted all the elements
{
result = e;
return;
}
Type tn = e.type.toBasetype().nextOf().toBasetype();
bool wantCopy = (tn.ty == Tsarray || tn.ty == Tstruct);
auto basis = interpret(e.basis, istate);
if (exceptionOrCant(basis))
return;
auto expsx = e.elements;
size_t dim = expsx ? expsx.dim : 0;
for (size_t i = 0; i < dim; i++)
{
Expression exp = (*expsx)[i];
Expression ex;
if (!exp)
{
ex = copyLiteral(basis).copy();
}
else
{
// segfault bug 6250
assert(exp.op != TOKindex || (cast(IndexExp)exp).e1 != e);
ex = interpret(exp, istate);
if (exceptionOrCant(ex))
return;
/* Each elements should have distinct CTFE memory.
* int[1] z = 7;
* int[1][] pieces = [z,z]; // here
*/
if (wantCopy)
ex = copyLiteral(ex).copy();
}
/* If any changes, do Copy On Write
*/
if (ex !is exp)
{
expsx = copyArrayOnWrite(expsx, e.elements);
(*expsx)[i] = ex;
}
}
if (expsx !is e.elements)
{
// todo: all tuple expansions should go in semantic phase.
expandTuples(expsx);
if (expsx.dim != dim)
{
e.error("CTFE internal error: invalid array literal");
result = CTFEExp.cantexp;
return;
}
auto ale = new ArrayLiteralExp(e.loc, basis, expsx);
ale.type = e.type;
ale.ownedByCtfe = OWNEDctfe;
result = ale;
}
else if ((cast(TypeNext)e.type).next.mod & (MODconst | MODimmutable))
{
// If it's immutable, we don't need to dup it
result = e;
}
else
result = copyLiteral(e).copy();
}
override void visit(AssocArrayLiteralExp e)
{
debug (LOG)
{
printf("%s AssocArrayLiteralExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (e.ownedByCtfe >= OWNEDctfe) // We've already interpreted all the elements
{
result = e;
return;
}
auto keysx = e.keys;
auto valuesx = e.values;
for (size_t i = 0; i < keysx.dim; i++)
{
auto ekey = (*keysx)[i];
auto evalue = (*valuesx)[i];
auto ek = interpret(ekey, istate);
if (exceptionOrCant(ek))
return;
auto ev = interpret(evalue, istate);
if (exceptionOrCant(ev))
return;
/* If any changes, do Copy On Write
*/
if (ek !is ekey ||
ev !is evalue)
{
keysx = copyArrayOnWrite(keysx, e.keys);
valuesx = copyArrayOnWrite(valuesx, e.values);
(*keysx)[i] = ek;
(*valuesx)[i] = ev;
}
}
if (keysx !is e.keys)
expandTuples(keysx);
if (valuesx !is e.values)
expandTuples(valuesx);
if (keysx.dim != valuesx.dim)
{
e.error("CTFE internal error: invalid AA");
result = CTFEExp.cantexp;
return;
}
/* Remove duplicate keys
*/
for (size_t i = 1; i < keysx.dim; i++)
{
auto ekey = (*keysx)[i - 1];
for (size_t j = i; j < keysx.dim; j++)
{
auto ekey2 = (*keysx)[j];
if (!ctfeEqual(e.loc, TOKequal, ekey, ekey2))
continue;
// Remove ekey
keysx = copyArrayOnWrite(keysx, e.keys);
valuesx = copyArrayOnWrite(valuesx, e.values);
keysx.remove(i - 1);
valuesx.remove(i - 1);
i -= 1; // redo the i'th iteration
break;
}
}
if (keysx !is e.keys ||
valuesx !is e.values)
{
assert(keysx !is e.keys &&
valuesx !is e.values);
auto aae = new AssocArrayLiteralExp(e.loc, keysx, valuesx);
aae.type = e.type;
aae.ownedByCtfe = OWNEDctfe;
result = aae;
}
else
result = copyLiteral(e).copy();
}
override void visit(StructLiteralExp e)
{
debug (LOG)
{
printf("%s StructLiteralExp::interpret() %s ownedByCtfe = %d\n", e.loc.toChars(), e.toChars(), e.ownedByCtfe);
}
if (e.ownedByCtfe >= OWNEDctfe)
{
result = e;
return;
}
size_t dim = e.elements ? e.elements.dim : 0;
auto expsx = e.elements;
if (dim != e.sd.fields.dim)
{
// guaranteed by AggregateDeclaration.fill and TypeStruct.defaultInitLiteral
assert(e.sd.isNested() && dim == e.sd.fields.dim - 1);
/* If a nested struct has no initialized hidden pointer,
* set it to null to match the runtime behaviour.
*/
auto ne = new NullExp(e.loc);
ne.type = e.sd.vthis.type;
expsx = copyArrayOnWrite(expsx, e.elements);
expsx.push(ne);
++dim;
}
assert(dim == e.sd.fields.dim);
foreach (i; 0 .. dim)
{
auto v = e.sd.fields[i];
Expression exp = (*expsx)[i];
Expression ex;
if (!exp)
{
ex = voidInitLiteral(v.type, v).copy();
}
else
{
ex = interpret(exp, istate);
if (exceptionOrCant(ex))
return;
if ((v.type.ty != ex.type.ty) && v.type.ty == Tsarray)
{
// Block assignment from inside struct literals
auto tsa = cast(TypeSArray)v.type;
auto len = cast(size_t)tsa.dim.toInteger();
ex = createBlockDuplicatedArrayLiteral(ex.loc, v.type, ex, len);
}
}
/* If any changes, do Copy On Write
*/
if (ex !is exp)
{
expsx = copyArrayOnWrite(expsx, e.elements);
(*expsx)[i] = ex;
}
}
if (expsx !is e.elements)
{
expandTuples(expsx);
if (expsx.dim != e.sd.fields.dim)
{
e.error("CTFE internal error: invalid struct literal");
result = CTFEExp.cantexp;
return;
}
auto sle = new StructLiteralExp(e.loc, e.sd, expsx);
sle.type = e.type;
sle.ownedByCtfe = OWNEDctfe;
result = sle;
}
else
result = copyLiteral(e).copy();
}
// Create an array literal of type 'newtype' with dimensions given by
// 'arguments'[argnum..$]
static Expression recursivelyCreateArrayLiteral(Loc loc, Type newtype, InterState* istate, Expressions* arguments, int argnum)
{
Expression lenExpr = interpret((*arguments)[argnum], istate);
if (exceptionOrCantInterpret(lenExpr))
return lenExpr;
size_t len = cast(size_t)lenExpr.toInteger();
Type elemType = (cast(TypeArray)newtype).next;
if (elemType.ty == Tarray && argnum < arguments.dim - 1)
{
Expression elem = recursivelyCreateArrayLiteral(loc, elemType, istate, arguments, argnum + 1);
if (exceptionOrCantInterpret(elem))
return elem;
auto elements = new Expressions();
elements.setDim(len);
for (size_t i = 0; i < len; i++)
(*elements)[i] = copyLiteral(elem).copy();
auto ae = new ArrayLiteralExp(loc, elements);
ae.type = newtype;
ae.ownedByCtfe = OWNEDctfe;
return ae;
}
assert(argnum == arguments.dim - 1);
if (elemType.ty == Tchar || elemType.ty == Twchar || elemType.ty == Tdchar)
{
const ch = cast(dchar)elemType.defaultInitLiteral(loc).toInteger();
const sz = cast(ubyte)elemType.size();
return createBlockDuplicatedStringLiteral(loc, newtype, ch, len, sz);
}
else
{
auto el = interpret(elemType.defaultInitLiteral(loc), istate);
return createBlockDuplicatedArrayLiteral(loc, newtype, el, len);
}
}
override void visit(NewExp e)
{
debug (LOG)
{
printf("%s NewExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (e.allocator)
{
e.error("member allocators not supported by CTFE");
result = CTFEExp.cantexp;
return;
}
result = interpret(e.argprefix, istate, ctfeNeedNothing);
if (exceptionOrCant(result))
return;
if (e.newtype.ty == Tarray && e.arguments)
{
result = recursivelyCreateArrayLiteral(e.loc, e.newtype, istate, e.arguments, 0);
return;
}
if (e.newtype.toBasetype().ty == Tstruct)
{
if (e.member)
{
Expression se = e.newtype.defaultInitLiteral(e.loc);
se = interpret(se, istate);
if (exceptionOrCant(se))
return;
result = interpret(e.member, istate, e.arguments, se);
// Repaint as same as CallExp::interpret() does.
result.loc = e.loc;
}
else
{
StructDeclaration sd = (cast(TypeStruct)e.newtype.toBasetype()).sym;
auto exps = new Expressions();
exps.reserve(sd.fields.dim);
if (e.arguments)
{
exps.setDim(e.arguments.dim);
for (size_t i = 0; i < exps.dim; i++)
{
Expression ex = (*e.arguments)[i];
ex = interpret(ex, istate);
if (exceptionOrCant(ex))
return;
(*exps)[i] = ex;
}
}
sd.fill(e.loc, exps, false);
auto se = new StructLiteralExp(e.loc, sd, exps, e.newtype);
se.type = e.newtype;
se.ownedByCtfe = OWNEDctfe;
result = interpret(se, istate);
}
if (exceptionOrCant(result))
return;
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
if (e.newtype.toBasetype().ty == Tclass)
{
ClassDeclaration cd = (cast(TypeClass)e.newtype.toBasetype()).sym;
size_t totalFieldCount = 0;
for (ClassDeclaration c = cd; c; c = c.baseClass)
totalFieldCount += c.fields.dim;
auto elems = new Expressions();
elems.setDim(totalFieldCount);
size_t fieldsSoFar = totalFieldCount;
for (ClassDeclaration c = cd; c; c = c.baseClass)
{
fieldsSoFar -= c.fields.dim;
for (size_t i = 0; i < c.fields.dim; i++)
{
VarDeclaration v = c.fields[i];
if (v.inuse)
{
e.error("circular reference to '%s'", v.toPrettyChars());
result = CTFEExp.cantexp;
return;
}
Expression m;
if (v._init)
{
if (v._init.isVoidInitializer())
m = voidInitLiteral(v.type, v).copy();
else
m = v.getConstInitializer(true);
}
else
m = v.type.defaultInitLiteral(e.loc);
if (exceptionOrCant(m))
return;
(*elems)[fieldsSoFar + i] = copyLiteral(m).copy();
}
}
// Hack: we store a ClassDeclaration instead of a StructDeclaration.
// We probably won't get away with this.
auto se = new StructLiteralExp(e.loc, cast(StructDeclaration)cd, elems, e.newtype);
se.ownedByCtfe = OWNEDctfe;
Expression eref = new ClassReferenceExp(e.loc, se, e.type);
if (e.member)
{
// Call constructor
if (!e.member.fbody)
{
Expression ctorfail = evaluateIfBuiltin(istate, e.loc, e.member, e.arguments, eref);
if (ctorfail)
{
if (exceptionOrCant(ctorfail))
return;
result = eref;
return;
}
e.member.error("%s cannot be constructed at compile time, because the constructor has no available source code", e.newtype.toChars());
result = CTFEExp.cantexp;
return;
}
Expression ctorfail = interpret(e.member, istate, e.arguments, eref);
if (exceptionOrCant(ctorfail))
return;
/* Bugzilla 14465: Repaint the loc, because a super() call
* in the constructor modifies the loc of ClassReferenceExp
* in CallExp::interpret().
*/
eref.loc = e.loc;
}
result = eref;
return;
}
if (e.newtype.toBasetype().isscalar())
{
Expression newval;
if (e.arguments && e.arguments.dim)
newval = (*e.arguments)[0];
else
newval = e.newtype.defaultInitLiteral(e.loc);
newval = interpret(newval, istate);
if (exceptionOrCant(newval))
return;
// Create a CTFE pointer &[newval][0]
auto elements = new Expressions();
elements.setDim(1);
(*elements)[0] = newval;
auto ae = new ArrayLiteralExp(e.loc, elements);
ae.type = e.newtype.arrayOf();
ae.ownedByCtfe = OWNEDctfe;
result = new IndexExp(e.loc, ae, new IntegerExp(Loc(), 0, Type.tsize_t));
result.type = e.newtype;
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
e.error("cannot interpret %s at compile time", e.toChars());
result = CTFEExp.cantexp;
}
override void visit(UnaExp e)
{
debug (LOG)
{
printf("%s UnaExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
UnionExp ue;
switch (e.op)
{
case TOKneg:
ue = Neg(e.type, e1);
break;
case TOKtilde:
ue = Com(e.type, e1);
break;
case TOKnot:
ue = Not(e.type, e1);
break;
case TOKvector:
result = e;
return; // do nothing
default:
assert(0);
}
result = ue.copy();
}
override void visit(DotTypeExp e)
{
debug (LOG)
{
printf("%s DotTypeExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
if (e1 == e.e1)
result = e; // optimize: reuse this CTFE reference
else
{
result = e.copy();
(cast(DotTypeExp)result).e1 = e1;
}
}
void interpretCommon(BinExp e, fp_t fp)
{
debug (LOG)
{
printf("%s BinExp::interpretCommon() %s\n", e.loc.toChars(), e.toChars());
}
if (e.e1.type.ty == Tpointer && e.e2.type.ty == Tpointer && e.op == TOKmin)
{
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
result = pointerDifference(e.loc, e.type, e1, e2).copy();
return;
}
if (e.e1.type.ty == Tpointer && e.e2.type.isintegral())
{
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
result = pointerArithmetic(e.loc, e.op, e.type, e1, e2).copy();
return;
}
if (e.e2.type.ty == Tpointer && e.e1.type.isintegral() && e.op == TOKadd)
{
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
result = pointerArithmetic(e.loc, e.op, e.type, e2, e1).copy();
return;
}
if (e.e1.type.ty == Tpointer || e.e2.type.ty == Tpointer)
{
e.error("pointer expression %s cannot be interpreted at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
bool evalOperand(Expression ex, out Expression er)
{
er = interpret(ex, istate);
if (exceptionOrCant(er))
return false;
if (er.isConst() != 1)
{
if (er.op == TOKarrayliteral)
// Until we get it to work, issue a reasonable error message
e.error("cannot interpret array literal expression %s at compile time", e.toChars());
else
e.error("CTFE internal error: non-constant value %s", ex.toChars());
result = CTFEExp.cantexp;
return false;
}
return true;
}
Expression e1;
if (!evalOperand(e.e1, e1))
return;
Expression e2;
if (!evalOperand(e.e2, e2))
return;
if (e.op == TOKshr || e.op == TOKshl || e.op == TOKushr)
{
sinteger_t i2 = e2.toInteger();
d_uns64 sz = e1.type.size() * 8;
if (i2 < 0 || i2 >= sz)
{
e.error("shift by %lld is outside the range 0..%llu", i2, cast(ulong)sz - 1);
result = CTFEExp.cantexp;
return;
}
}
result = (*fp)(e.loc, e.type, e1, e2).copy();
if (CTFEExp.isCantExp(result))
e.error("%s cannot be interpreted at compile time", e.toChars());
}
void interpretCompareCommon(BinExp e, fp2_t fp)
{
debug (LOG)
{
printf("%s BinExp::interpretCompareCommon() %s\n", e.loc.toChars(), e.toChars());
}
if (e.e1.type.ty == Tpointer && e.e2.type.ty == Tpointer)
{
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
//printf("e1 = %s %s, e2 = %s %s\n", e1->type->toChars(), e1->toChars(), e2->type->toChars(), e2->toChars());
dinteger_t ofs1, ofs2;
Expression agg1 = getAggregateFromPointer(e1, &ofs1);
Expression agg2 = getAggregateFromPointer(e2, &ofs2);
//printf("agg1 = %p %s, agg2 = %p %s\n", agg1, agg1->toChars(), agg2, agg2->toChars());
int cmp = comparePointers(e.loc, e.op, e.type, agg1, ofs1, agg2, ofs2);
if (cmp == -1)
{
char dir = (e.op == TOKgt || e.op == TOKge) ? '<' : '>';
e.error("the ordering of pointers to unrelated memory blocks is indeterminate in CTFE. To check if they point to the same memory block, use both > and < inside && or ||, eg (%s && %s %c= %s + 1)", e.toChars(), e.e1.toChars(), dir, e.e2.toChars());
result = CTFEExp.cantexp;
return;
}
result = new IntegerExp(e.loc, cmp, e.type);
return;
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
if (!isCtfeComparable(e1))
{
e.error("cannot compare %s at compile time", e1.toChars());
result = CTFEExp.cantexp;
return;
}
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
if (!isCtfeComparable(e2))
{
e.error("cannot compare %s at compile time", e2.toChars());
result = CTFEExp.cantexp;
return;
}
int cmp = (*fp)(e.loc, e.op, e1, e2);
result = new IntegerExp(e.loc, cmp, e.type);
}
override void visit(BinExp e)
{
switch (e.op)
{
case TOKadd:
interpretCommon(e, &Add);
return;
case TOKmin:
interpretCommon(e, &Min);
return;
case TOKmul:
interpretCommon(e, &Mul);
return;
case TOKdiv:
interpretCommon(e, &Div);
return;
case TOKmod:
interpretCommon(e, &Mod);
return;
case TOKshl:
interpretCommon(e, &Shl);
return;
case TOKshr:
interpretCommon(e, &Shr);
return;
case TOKushr:
interpretCommon(e, &Ushr);
return;
case TOKand:
interpretCommon(e, &And);
return;
case TOKor:
interpretCommon(e, &Or);
return;
case TOKxor:
interpretCommon(e, &Xor);
return;
case TOKpow:
interpretCommon(e, &Pow);
return;
case TOKequal:
case TOKnotequal:
interpretCompareCommon(e, &ctfeEqual);
return;
case TOKidentity:
case TOKnotidentity:
interpretCompareCommon(e, &ctfeIdentity);
return;
case TOKlt:
case TOKle:
case TOKgt:
case TOKge:
interpretCompareCommon(e, &ctfeCmp);
return;
default:
printf("be = '%s' %s at [%s]\n", Token.toChars(e.op), e.toChars(), e.loc.toChars());
assert(0);
}
}
/* Helper functions for BinExp::interpretAssignCommon
*/
// Returns the variable which is eventually modified, or NULL if an rvalue.
// thisval is the current value of 'this'.
static VarDeclaration findParentVar(Expression e)
{
for (;;)
{
if (e.op == TOKvar)
break;
if (e.op == TOKindex)
e = (cast(IndexExp)e).e1;
else if (e.op == TOKdotvar)
e = (cast(DotVarExp)e).e1;
else if (e.op == TOKdotti)
e = (cast(DotTemplateInstanceExp)e).e1;
else if (e.op == TOKslice)
e = (cast(SliceExp)e).e1;
else
return null;
}
VarDeclaration v = (cast(VarExp)e).var.isVarDeclaration();
assert(v);
return v;
}
void interpretAssignCommon(BinExp e, fp_t fp, int post = 0)
{
debug (LOG)
{
printf("%s BinExp::interpretAssignCommon() %s\n", e.loc.toChars(), e.toChars());
}
result = CTFEExp.cantexp;
Expression e1 = e.e1;
if (!istate)
{
e.error("value of %s is not known at compile time", e1.toChars());
return;
}
++CtfeStatus.numAssignments;
/* Before we begin, we need to know if this is a reference assignment
* (dynamic array, AA, or class) or a value assignment.
* Determining this for slice assignments are tricky: we need to know
* if it is a block assignment (a[] = e) rather than a direct slice
* assignment (a[] = b[]). Note that initializers of multi-dimensional
* static arrays can have 2D block assignments (eg, int[7][7] x = 6;).
* So we need to recurse to determine if it is a block assignment.
*/
bool isBlockAssignment = false;
if (e1.op == TOKslice)
{
// a[] = e can have const e. So we compare the naked types.
Type tdst = e1.type.toBasetype();
Type tsrc = e.e2.type.toBasetype();
while (tdst.ty == Tsarray || tdst.ty == Tarray)
{
tdst = (cast(TypeArray)tdst).next.toBasetype();
if (tsrc.equivalent(tdst))
{
isBlockAssignment = true;
break;
}
}
}
// ---------------------------------------
// Deal with reference assignment
// ---------------------------------------
// If it is a construction of a ref variable, it is a ref assignment
if ((e.op == TOKconstruct || e.op == TOKblit) &&
((cast(AssignExp)e).memset & MemorySet.referenceInit))
{
assert(!fp);
Expression newval = interpret(e.e2, istate, ctfeNeedLvalue);
if (exceptionOrCant(newval))
return;
VarDeclaration v = (cast(VarExp)e1).var.isVarDeclaration();
setValue(v, newval);
// Get the value to return. Note that 'newval' is an Lvalue,
// so if we need an Rvalue, we have to interpret again.
if (goal == ctfeNeedRvalue)
result = interpret(newval, istate);
else
result = e1; // VarExp is a CTFE reference
return;
}
if (fp)
{
while (e1.op == TOKcast)
{
CastExp ce = cast(CastExp)e1;
e1 = ce.e1;
}
}
// ---------------------------------------
// Interpret left hand side
// ---------------------------------------
AssocArrayLiteralExp existingAA = null;
Expression lastIndex = null;
Expression oldval = null;
if (e1.op == TOKindex && (cast(IndexExp)e1).e1.type.toBasetype().ty == Taarray)
{
// ---------------------------------------
// Deal with AA index assignment
// ---------------------------------------
/* This needs special treatment if the AA doesn't exist yet.
* There are two special cases:
* (1) If the AA is itself an index of another AA, we may need to create
* multiple nested AA literals before we can insert the new value.
* (2) If the ultimate AA is null, no insertion happens at all. Instead,
* we create nested AA literals, and change it into a assignment.
*/
IndexExp ie = cast(IndexExp)e1;
int depth = 0; // how many nested AA indices are there?
while (ie.e1.op == TOKindex && (cast(IndexExp)ie.e1).e1.type.toBasetype().ty == Taarray)
{
assert(ie.modifiable);
ie = cast(IndexExp)ie.e1;
++depth;
}
// Get the AA value to be modified.
Expression aggregate = interpret(ie.e1, istate);
if (exceptionOrCant(aggregate))
return;
if (aggregate.op == TOKassocarrayliteral)
{
existingAA = cast(AssocArrayLiteralExp)aggregate;
// Normal case, ultimate parent AA already exists
// We need to walk from the deepest index up, checking that an AA literal
// already exists on each level.
lastIndex = interpret((cast(IndexExp)e1).e2, istate);
lastIndex = resolveSlice(lastIndex); // only happens with AA assignment
if (exceptionOrCant(lastIndex))
return;
while (depth > 0)
{
// Walk the syntax tree to find the indexExp at this depth
IndexExp xe = cast(IndexExp)e1;
for (int d = 0; d < depth; ++d)
xe = cast(IndexExp)xe.e1;
Expression ekey = interpret(xe.e2, istate);
if (exceptionOrCant(ekey))
return;
ekey = resolveSlice(ekey); // only happens with AA assignment
// Look up this index in it up in the existing AA, to get the next level of AA.
AssocArrayLiteralExp newAA = cast(AssocArrayLiteralExp)findKeyInAA(e.loc, existingAA, ekey);
if (exceptionOrCant(newAA))
return;
if (!newAA)
{
// Doesn't exist yet, create an empty AA...
auto keysx = new Expressions();
auto valuesx = new Expressions();
newAA = new AssocArrayLiteralExp(e.loc, keysx, valuesx);
newAA.type = xe.type;
newAA.ownedByCtfe = OWNEDctfe;
//... and insert it into the existing AA.
existingAA.keys.push(ekey);
existingAA.values.push(newAA);
}
existingAA = newAA;
--depth;
}
if (fp)
{
oldval = findKeyInAA(e.loc, existingAA, lastIndex);
if (!oldval)
oldval = copyLiteral(e.e1.type.defaultInitLiteral(e.loc)).copy();
}
}
else
{
/* The AA is currently null. 'aggregate' is actually a reference to
* whatever contains it. It could be anything: var, dotvarexp, ...
* We rewrite the assignment from:
* aa[i][j] op= newval;
* into:
* aa = [i:[j:T.init]];
* aa[j] op= newval;
*/
oldval = copyLiteral(e.e1.type.defaultInitLiteral(e.loc)).copy();
Expression newaae = oldval;
while (e1.op == TOKindex && (cast(IndexExp)e1).e1.type.toBasetype().ty == Taarray)
{
Expression ekey = interpret((cast(IndexExp)e1).e2, istate);
if (exceptionOrCant(ekey))
return;
ekey = resolveSlice(ekey); // only happens with AA assignment
auto keysx = new Expressions();
auto valuesx = new Expressions();
keysx.push(ekey);
valuesx.push(newaae);
auto aae = new AssocArrayLiteralExp(e.loc, keysx, valuesx);
aae.type = (cast(IndexExp)e1).e1.type;
aae.ownedByCtfe = OWNEDctfe;
if (!existingAA)
{
existingAA = aae;
lastIndex = ekey;
}
newaae = aae;
e1 = (cast(IndexExp)e1).e1;
}
// We must set to aggregate with newaae
e1 = interpret(e1, istate, ctfeNeedLvalue);
if (exceptionOrCant(e1))
return;
e1 = assignToLvalue(e, e1, newaae);
if (exceptionOrCant(e1))
return;
}
assert(existingAA && lastIndex);
e1 = null; // stomp
}
else if (e1.op == TOKarraylength)
{
oldval = interpret(e1, istate);
if (exceptionOrCant(oldval))
return;
}
else if (e.op == TOKconstruct || e.op == TOKblit)
{
// Unless we have a simple var assignment, we're
// only modifying part of the variable. So we need to make sure
// that the parent variable exists.
VarDeclaration ultimateVar = findParentVar(e1);
if (e1.op == TOKvar)
{
VarDeclaration v = (cast(VarExp)e1).var.isVarDeclaration();
assert(v);
if (v.storage_class & STCout)
goto L1;
}
else if (ultimateVar && !getValue(ultimateVar))
{
Expression ex = interpret(ultimateVar.type.defaultInitLiteral(e.loc), istate);
if (exceptionOrCant(ex))
return;
setValue(ultimateVar, ex);
}
else
goto L1;
}
else
{
L1:
e1 = interpret(e1, istate, ctfeNeedLvalue);
if (exceptionOrCant(e1))
return;
if (e1.op == TOKindex && (cast(IndexExp)e1).e1.type.toBasetype().ty == Taarray)
{
IndexExp ie = cast(IndexExp)e1;
assert(ie.e1.op == TOKassocarrayliteral);
existingAA = cast(AssocArrayLiteralExp)ie.e1;
lastIndex = ie.e2;
}
}
// If it isn't a simple assignment, we need the existing value
if (fp && !oldval)
{
oldval = interpret(e1, istate);
if (exceptionOrCant(oldval))
return;
}
// ---------------------------------------
// Interpret right hand side
// ---------------------------------------
Expression newval = interpret(e.e2, istate);
if (exceptionOrCant(newval))
return;
if (e.op == TOKblit && newval.op == TOKint64)
{
Type tbn = e.type.baseElemOf();
if (tbn.ty == Tstruct)
{
/* Look for special case of struct being initialized with 0.
*/
newval = e.type.defaultInitLiteral(e.loc);
if (newval.op == TOKerror)
{
result = CTFEExp.cantexp;
return;
}
newval = interpret(newval, istate); // copy and set ownedByCtfe flag
if (exceptionOrCant(newval))
return;
}
}
// ----------------------------------------------------
// Deal with read-modify-write assignments.
// Set 'newval' to the final assignment value
// Also determine the return value (except for slice
// assignments, which are more complicated)
// ----------------------------------------------------
if (fp)
{
assert(oldval);
if (e.e1.type.ty != Tpointer)
{
// ~= can create new values (see bug 6052)
if (e.op == TOKcatass)
{
// We need to dup it and repaint the type. For a dynamic array
// we can skip duplication, because it gets copied later anyway.
if (newval.type.ty != Tarray)
{
newval = copyLiteral(newval).copy();
newval.type = e.e2.type; // repaint type
}
else
{
newval = paintTypeOntoLiteral(e.e2.type, newval);
newval = resolveSlice(newval);
}
}
oldval = resolveSlice(oldval);
newval = (*fp)(e.loc, e.type, oldval, newval).copy();
}
else if (e.e2.type.isintegral() &&
(e.op == TOKaddass ||
e.op == TOKminass ||
e.op == TOKplusplus ||
e.op == TOKminusminus))
{
newval = pointerArithmetic(e.loc, e.op, e.type, oldval, newval).copy();
}
else
{
e.error("pointer expression %s cannot be interpreted at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
if (exceptionOrCant(newval))
{
if (CTFEExp.isCantExp(newval))
e.error("cannot interpret %s at compile time", e.toChars());
return;
}
}
if (existingAA)
{
if (existingAA.ownedByCtfe != OWNEDctfe)
{
e.error("cannot modify read-only constant %s", existingAA.toChars());
result = CTFEExp.cantexp;
return;
}
//printf("\t+L%d existingAA = %s, lastIndex = %s, oldval = %s, newval = %s\n",
// __LINE__, existingAA->toChars(), lastIndex->toChars(), oldval ? oldval->toChars() : NULL, newval->toChars());
assignAssocArrayElement(e.loc, existingAA, lastIndex, newval);
// Determine the return value
result = ctfeCast(e.loc, e.type, e.type, fp && post ? oldval : newval);
return;
}
if (e1.op == TOKarraylength)
{
/* Change the assignment from:
* arr.length = n;
* into:
* arr = new_length_array; (result is n)
*/
// Determine the return value
result = ctfeCast(e.loc, e.type, e.type, fp && post ? oldval : newval);
if (exceptionOrCant(result))
return;
size_t oldlen = cast(size_t)oldval.toInteger();
size_t newlen = cast(size_t)newval.toInteger();
if (oldlen == newlen) // no change required -- we're done!
return;
// We have changed it into a reference assignment
// Note that returnValue is still the new length.
e1 = (cast(ArrayLengthExp)e1).e1;
Type t = e1.type.toBasetype();
if (t.ty != Tarray)
{
e.error("%s is not yet supported at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
e1 = interpret(e1, istate, ctfeNeedLvalue);
if (exceptionOrCant(e1))
return;
if (oldlen != 0) // Get the old array literal.
oldval = interpret(e1, istate);
newval = changeArrayLiteralLength(e.loc, cast(TypeArray)t, oldval, oldlen, newlen).copy();
e1 = assignToLvalue(e, e1, newval);
if (exceptionOrCant(e1))
return;
return;
}
if (!isBlockAssignment)
{
newval = ctfeCast(e.loc, e.type, e.type, newval);
if (exceptionOrCant(newval))
return;
// Determine the return value
if (goal == ctfeNeedLvalue) // Bugzilla 14371
result = e1;
else
result = ctfeCast(e.loc, e.type, e.type, fp && post ? oldval : newval);
if (exceptionOrCant(result))
return;
}
if (exceptionOrCant(newval))
return;
debug (LOGASSIGN)
{
printf("ASSIGN: %s=%s\n", e1.toChars(), newval.toChars());
showCtfeExpr(newval);
}
/* Block assignment or element-wise assignment.
*/
if (e1.op == TOKslice ||
e1.op == TOKvector ||
e1.op == TOKarrayliteral ||
e1.op == TOKstring ||
e1.op == TOKnull && e1.type.toBasetype().ty == Tarray)
{
// Note that slice assignments don't support things like ++, so
// we don't need to remember 'returnValue'.
result = interpretAssignToSlice(e, e1, newval, isBlockAssignment);
if (exceptionOrCant(result))
return;
if (e.e1.op == TOKslice)
{
Expression e1x = interpret((cast(SliceExp)e.e1).e1, istate, ctfeNeedLvalue);
if (e1x.op == TOKdotvar)
{
auto dve = cast(DotVarExp)e1x;
auto ex = dve.e1;
auto sle = ex.op == TOKstructliteral ? (cast(StructLiteralExp)ex)
: ex.op == TOKclassreference ? (cast(ClassReferenceExp)ex).value
: null;
auto v = dve.var.isVarDeclaration();
if (!sle || !v)
{
e.error("CTFE internal error: dotvar slice assignment");
result = CTFEExp.cantexp;
return;
}
stompOverlappedFields(sle, v);
}
}
return;
}
assert(result);
/* Assignment to a CTFE reference.
*/
if (Expression ex = assignToLvalue(e, e1, newval))
result = ex;
return;
}
/* Set all sibling fields which overlap with v to VoidExp.
*/
void stompOverlappedFields(StructLiteralExp sle, VarDeclaration v)
{
if (!v.overlapped)
return;
foreach (size_t i, v2; sle.sd.fields)
{
if (v is v2 || !v.isOverlappedWith(v2))
continue;
auto e = (*sle.elements)[i];
if (e.op != TOKvoid)
(*sle.elements)[i] = voidInitLiteral(e.type, v).copy();
}
}
Expression assignToLvalue(BinExp e, Expression e1, Expression newval)
{
VarDeclaration vd = null;
Expression* payload = null; // dead-store to prevent spurious warning
Expression oldval;
if (e1.op == TOKvar)
{
vd = (cast(VarExp)e1).var.isVarDeclaration();
oldval = getValue(vd);
}
else if (e1.op == TOKdotvar)
{
/* Assignment to member variable of the form:
* e.v = newval
*/
auto ex = (cast(DotVarExp)e1).e1;
auto sle = ex.op == TOKstructliteral ? (cast(StructLiteralExp)ex)
: ex.op == TOKclassreference ? (cast(ClassReferenceExp)ex).value
: null;
auto v = (cast(DotVarExp)e1).var.isVarDeclaration();
if (!sle || !v)
{
e.error("CTFE internal error: dotvar assignment");
return CTFEExp.cantexp;
}
if (sle.ownedByCtfe != OWNEDctfe)
{
e.error("cannot modify read-only constant %s", sle.toChars());
return CTFEExp.cantexp;
}
int fieldi = ex.op == TOKstructliteral ? findFieldIndexByName(sle.sd, v)
: (cast(ClassReferenceExp)ex).findFieldIndexByName(v);
if (fieldi == -1)
{
e.error("CTFE internal error: cannot find field %s in %s", v.toChars(), ex.toChars());
return CTFEExp.cantexp;
}
assert(0 <= fieldi && fieldi < sle.elements.dim);
// If it's a union, set all other members of this union to void
stompOverlappedFields(sle, v);
payload = &(*sle.elements)[fieldi];
oldval = *payload;
}
else if (e1.op == TOKindex)
{
IndexExp ie = cast(IndexExp)e1;
assert(ie.e1.type.toBasetype().ty != Taarray);
Expression aggregate;
uinteger_t indexToModify;
if (!resolveIndexing(ie, istate, &aggregate, &indexToModify, true))
{
return CTFEExp.cantexp;
}
size_t index = cast(size_t)indexToModify;
if (aggregate.op == TOKstring)
{
StringExp existingSE = cast(StringExp)aggregate;
if (existingSE.ownedByCtfe != OWNEDctfe)
{
e.error("cannot modify read-only string literal %s", ie.e1.toChars());
return CTFEExp.cantexp;
}
existingSE.setCodeUnit(index, cast(dchar)newval.toInteger());
return null;
}
if (aggregate.op != TOKarrayliteral)
{
e.error("index assignment %s is not yet supported in CTFE ", e.toChars());
return CTFEExp.cantexp;
}
ArrayLiteralExp existingAE = cast(ArrayLiteralExp)aggregate;
if (existingAE.ownedByCtfe != OWNEDctfe)
{
e.error("cannot modify read-only constant %s", existingAE.toChars());
return CTFEExp.cantexp;
}
payload = &(*existingAE.elements)[index];
oldval = *payload;
}
else
{
e.error("%s cannot be evaluated at compile time", e.toChars());
return CTFEExp.cantexp;
}
Type t1b = e1.type.toBasetype();
bool wantCopy = t1b.baseElemOf().ty == Tstruct;
if (newval.op == TOKstructliteral && oldval)
{
newval = copyLiteral(newval).copy();
assignInPlace(oldval, newval);
}
else if (wantCopy && e.op == TOKassign)
{
// Currently postblit/destructor calls on static array are done
// in the druntime internal functions so they don't appear in AST.
// Therefore interpreter should handle them specially.
assert(oldval);
version (all) // todo: instead we can directly access to each elements of the slice
{
newval = resolveSlice(newval);
if (CTFEExp.isCantExp(newval))
{
e.error("CTFE internal error: assignment %s", e.toChars());
return CTFEExp.cantexp;
}
}
assert(oldval.op == TOKarrayliteral);
assert(newval.op == TOKarrayliteral);
Expressions* oldelems = (cast(ArrayLiteralExp)oldval).elements;
Expressions* newelems = (cast(ArrayLiteralExp)newval).elements;
assert(oldelems.dim == newelems.dim);
Type elemtype = oldval.type.nextOf();
for (size_t i = 0; i < newelems.dim; i++)
{
Expression oldelem = (*oldelems)[i];
Expression newelem = paintTypeOntoLiteral(elemtype, (*newelems)[i]);
// Bugzilla 9245
if (e.e2.isLvalue())
{
if (Expression ex = evaluatePostblit(istate, newelem))
return ex;
}
// Bugzilla 13661
if (Expression ex = evaluateDtor(istate, oldelem))
return ex;
(*oldelems)[i] = newelem;
}
}
else
{
// e1 has its own payload, so we have to create a new literal.
if (wantCopy)
newval = copyLiteral(newval).copy();
if (t1b.ty == Tsarray && e.op == TOKconstruct && e.e2.isLvalue())
{
// Bugzilla 9245
if (Expression ex = evaluatePostblit(istate, newval))
return ex;
}
oldval = newval;
}
if (vd)
setValue(vd, oldval);
else
*payload = oldval;
// Blit assignment should return the newly created value.
if (e.op == TOKblit)
return oldval;
return null;
}
/*************
* Deal with assignments of the form:
* dest[] = newval
* dest[low..upp] = newval
* where newval has already been interpreted
*
* This could be a slice assignment or a block assignment, and
* dest could be either an array literal, or a string.
*
* Returns TOKcantexp on failure. If there are no errors,
* it returns aggregate[low..upp], except that as an optimisation,
* if goal == ctfeNeedNothing, it will return NULL
*/
Expression interpretAssignToSlice(BinExp e, Expression e1, Expression newval, bool isBlockAssignment)
{
dinteger_t lowerbound;
dinteger_t upperbound;
dinteger_t firstIndex;
Expression aggregate;
if (e1.op == TOKvector)
e1 = (cast(VectorExp)e1).e1;
if (e1.op == TOKslice)
{
// ------------------------------
// aggregate[] = newval
// aggregate[low..upp] = newval
// ------------------------------
SliceExp se = cast(SliceExp)e1;
version (all) // should be move in interpretAssignCommon as the evaluation of e1
{
Expression oldval = interpret(se.e1, istate);
// Set the $ variable
uinteger_t dollar = resolveArrayLength(oldval);
if (se.lengthVar)
{
Expression dollarExp = new IntegerExp(e1.loc, dollar, Type.tsize_t);
ctfeStack.push(se.lengthVar);
setValue(se.lengthVar, dollarExp);
}
Expression lwr = interpret(se.lwr, istate);
if (exceptionOrCantInterpret(lwr))
{
if (se.lengthVar)
ctfeStack.pop(se.lengthVar);
return lwr;
}
Expression upr = interpret(se.upr, istate);
if (exceptionOrCantInterpret(upr))
{
if (se.lengthVar)
ctfeStack.pop(se.lengthVar);
return upr;
}
if (se.lengthVar)
ctfeStack.pop(se.lengthVar); // $ is defined only in [L..U]
const dim = dollar;
lowerbound = lwr ? lwr.toInteger() : 0;
upperbound = upr ? upr.toInteger() : dim;
if (lowerbound < 0 || dim < upperbound)
{
e.error("array bounds [0..%llu] exceeded in slice [%llu..%llu]",
ulong(dim), ulong(lowerbound), ulong(upperbound));
return CTFEExp.cantexp;
}
}
aggregate = oldval;
firstIndex = lowerbound;
if (aggregate.op == TOKslice)
{
// Slice of a slice --> change the bounds
SliceExp oldse = cast(SliceExp)aggregate;
if (oldse.upr.toInteger() < upperbound + oldse.lwr.toInteger())
{
e.error("slice [%llu..%llu] exceeds array bounds [0..%llu]",
ulong(lowerbound), ulong(upperbound), oldse.upr.toInteger() - oldse.lwr.toInteger());
return CTFEExp.cantexp;
}
aggregate = oldse.e1;
firstIndex = lowerbound + oldse.lwr.toInteger();
}
}
else
{
if (e1.op == TOKarrayliteral)
{
lowerbound = 0;
upperbound = (cast(ArrayLiteralExp)e1).elements.dim;
}
else if (e1.op == TOKstring)
{
lowerbound = 0;
upperbound = (cast(StringExp)e1).len;
}
else if (e1.op == TOKnull)
{
lowerbound = 0;
upperbound = 0;
}
else
assert(0);
aggregate = e1;
firstIndex = lowerbound;
}
if (upperbound == lowerbound)
return newval;
// For slice assignment, we check that the lengths match.
if (!isBlockAssignment)
{
const srclen = resolveArrayLength(newval);
if (srclen != (upperbound - lowerbound))
{
e.error("array length mismatch assigning [0..%llu] to [%llu..%llu]",
ulong(srclen), ulong(lowerbound), ulong(upperbound));
return CTFEExp.cantexp;
}
}
if (aggregate.op == TOKstring)
{
StringExp existingSE = cast(StringExp)aggregate;
if (existingSE.ownedByCtfe != OWNEDctfe)
{
e.error("cannot modify read-only string literal %s", existingSE.toChars());
return CTFEExp.cantexp;
}
if (newval.op == TOKslice)
{
auto se = cast(SliceExp)newval;
auto aggr2 = se.e1;
const srclower = se.lwr.toInteger();
const srcupper = se.upr.toInteger();
if (aggregate == aggr2 &&
lowerbound < srcupper && srclower < upperbound)
{
e.error("overlapping slice assignment [%llu..%llu] = [%llu..%llu]",
ulong(lowerbound), ulong(upperbound), ulong(srclower), ulong(srcupper));
return CTFEExp.cantexp;
}
version (all) // todo: instead we can directly access to each elements of the slice
{
Expression orignewval = newval;
newval = resolveSlice(newval);
if (CTFEExp.isCantExp(newval))
{
e.error("CTFE internal error: slice %s", orignewval.toChars());
return CTFEExp.cantexp;
}
}
assert(newval.op != TOKslice);
}
if (newval.op == TOKstring)
{
sliceAssignStringFromString(existingSE, cast(StringExp)newval, cast(size_t)firstIndex);
return newval;
}
if (newval.op == TOKarrayliteral)
{
/* Mixed slice: it was initialized as a string literal.
* Now a slice of it is being set with an array literal.
*/
sliceAssignStringFromArrayLiteral(existingSE, cast(ArrayLiteralExp)newval, cast(size_t)firstIndex);
return newval;
}
// String literal block slice assign
const value = cast(dchar)newval.toInteger();
foreach (i; 0 .. upperbound - lowerbound)
{
existingSE.setCodeUnit(cast(size_t)(i + firstIndex), value);
}
if (goal == ctfeNeedNothing)
return null; // avoid creating an unused literal
auto retslice = new SliceExp(e.loc, existingSE, new IntegerExp(e.loc, firstIndex, Type.tsize_t), new IntegerExp(e.loc, firstIndex + upperbound - lowerbound, Type.tsize_t));
retslice.type = e.type;
return interpret(retslice, istate);
}
if (aggregate.op == TOKarrayliteral)
{
ArrayLiteralExp existingAE = cast(ArrayLiteralExp)aggregate;
if (existingAE.ownedByCtfe != OWNEDctfe)
{
e.error("cannot modify read-only constant %s", existingAE.toChars());
return CTFEExp.cantexp;
}
if (newval.op == TOKslice && !isBlockAssignment)
{
auto se = cast(SliceExp)newval;
auto aggr2 = se.e1;
const srclower = se.lwr.toInteger();
const srcupper = se.upr.toInteger();
const wantCopy = (newval.type.toBasetype().nextOf().baseElemOf().ty == Tstruct);
//printf("oldval = %p %s[%d..%u]\nnewval = %p %s[%llu..%llu] wantCopy = %d\n",
// aggregate, aggregate->toChars(), lowerbound, upperbound,
// aggr2, aggr2->toChars(), srclower, srcupper, wantCopy);
if (wantCopy)
{
// Currently overlapping for struct array is allowed.
// The order of elements processing depends on the overlapping.
// See bugzilla 14024.
assert(aggr2.op == TOKarrayliteral);
Expressions* oldelems = existingAE.elements;
Expressions* newelems = (cast(ArrayLiteralExp)aggr2).elements;
Type elemtype = aggregate.type.nextOf();
bool needsPostblit = e.e2.isLvalue();
if (aggregate == aggr2 && srclower < lowerbound && lowerbound < srcupper)
{
// reverse order
for (auto i = upperbound - lowerbound; 0 < i--;)
{
Expression oldelem = (*oldelems)[cast(size_t)(i + firstIndex)];
Expression newelem = (*newelems)[cast(size_t)(i + srclower)];
newelem = copyLiteral(newelem).copy();
newelem.type = elemtype;
if (needsPostblit)
{
if (Expression x = evaluatePostblit(istate, newelem))
return x;
}
if (Expression x = evaluateDtor(istate, oldelem))
return x;
(*oldelems)[cast(size_t)(lowerbound + i)] = newelem;
}
}
else
{
// normal order
for (auto i = 0; i < upperbound - lowerbound; i++)
{
Expression oldelem = (*oldelems)[cast(size_t)(i + firstIndex)];
Expression newelem = (*newelems)[cast(size_t)(i + srclower)];
newelem = copyLiteral(newelem).copy();
newelem.type = elemtype;
if (needsPostblit)
{
if (Expression x = evaluatePostblit(istate, newelem))
return x;
}
if (Expression x = evaluateDtor(istate, oldelem))
return x;
(*oldelems)[cast(size_t)(lowerbound + i)] = newelem;
}
}
//assert(0);
return newval; // oldval?
}
if (aggregate == aggr2 &&
lowerbound < srcupper && srclower < upperbound)
{
e.error("overlapping slice assignment [%llu..%llu] = [%llu..%llu]",
ulong(lowerbound), ulong(upperbound), ulong(srclower), ulong(srcupper));
return CTFEExp.cantexp;
}
version (all) // todo: instead we can directly access to each elements of the slice
{
Expression orignewval = newval;
newval = resolveSlice(newval);
if (CTFEExp.isCantExp(newval))
{
e.error("CTFE internal error: slice %s", orignewval.toChars());
return CTFEExp.cantexp;
}
}
// no overlapping
//length?
assert(newval.op != TOKslice);
}
if (newval.op == TOKstring && !isBlockAssignment)
{
/* Mixed slice: it was initialized as an array literal of chars/integers.
* Now a slice of it is being set with a string.
*/
sliceAssignArrayLiteralFromString(existingAE, cast(StringExp)newval, cast(size_t)firstIndex);
return newval;
}
if (newval.op == TOKarrayliteral && !isBlockAssignment)
{
Expressions* oldelems = existingAE.elements;
Expressions* newelems = (cast(ArrayLiteralExp)newval).elements;
Type elemtype = existingAE.type.nextOf();
bool needsPostblit = e.op != TOKblit && e.e2.isLvalue();
for (size_t j = 0; j < newelems.dim; j++)
{
Expression newelem = (*newelems)[j];
newelem = paintTypeOntoLiteral(elemtype, newelem);
if (needsPostblit)
{
Expression x = evaluatePostblit(istate, newelem);
if (exceptionOrCantInterpret(x))
return x;
}
(*oldelems)[cast(size_t)(j + firstIndex)] = newelem;
}
return newval;
}
/* Block assignment, initialization of static arrays
* x[] = newval
* x may be a multidimensional static array. (Note that this
* only happens with array literals, never with strings).
*/
struct RecursiveBlock
{
InterState* istate;
Expression newval;
bool refCopy;
bool needsPostblit;
bool needsDtor;
extern (C++) Expression assignTo(ArrayLiteralExp ae)
{
return assignTo(ae, 0, ae.elements.dim);
}
extern (C++) Expression assignTo(ArrayLiteralExp ae, size_t lwr, size_t upr)
{
Expressions* w = ae.elements;
assert(ae.type.ty == Tsarray || ae.type.ty == Tarray);
bool directblk = (cast(TypeArray)ae.type).next.equivalent(newval.type);
for (size_t k = lwr; k < upr; k++)
{
if (!directblk && (*w)[k].op == TOKarrayliteral)
{
// Multidimensional array block assign
if (Expression ex = assignTo(cast(ArrayLiteralExp)(*w)[k]))
return ex;
}
else if (refCopy)
{
(*w)[k] = newval;
}
else if (!needsPostblit && !needsDtor)
{
assignInPlace((*w)[k], newval);
}
else
{
Expression oldelem = (*w)[k];
Expression tmpelem = needsDtor ? copyLiteral(oldelem).copy() : null;
assignInPlace(oldelem, newval);
if (needsPostblit)
{
if (Expression ex = evaluatePostblit(istate, oldelem))
return ex;
}
if (needsDtor)
{
// Bugzilla 14860
if (Expression ex = evaluateDtor(istate, tmpelem))
return ex;
}
}
}
return null;
}
}
Type tn = newval.type.toBasetype();
bool wantRef = (tn.ty == Tarray || isAssocArray(tn) || tn.ty == Tclass);
bool cow = newval.op != TOKstructliteral && newval.op != TOKarrayliteral && newval.op != TOKstring;
Type tb = tn.baseElemOf();
StructDeclaration sd = (tb.ty == Tstruct ? (cast(TypeStruct)tb).sym : null);
RecursiveBlock rb;
rb.istate = istate;
rb.newval = newval;
rb.refCopy = wantRef || cow;
rb.needsPostblit = sd && sd.postblit && e.op != TOKblit && e.e2.isLvalue();
rb.needsDtor = sd && sd.dtor && e.op == TOKassign;
if (Expression ex = rb.assignTo(existingAE, cast(size_t)lowerbound, cast(size_t)upperbound))
return ex;
if (goal == ctfeNeedNothing)
return null; // avoid creating an unused literal
auto retslice = new SliceExp(e.loc, existingAE, new IntegerExp(e.loc, firstIndex, Type.tsize_t), new IntegerExp(e.loc, firstIndex + upperbound - lowerbound, Type.tsize_t));
retslice.type = e.type;
return interpret(retslice, istate);
}
e.error("slice operation %s = %s cannot be evaluated at compile time", e1.toChars(), newval.toChars());
return CTFEExp.cantexp;
}
override void visit(AssignExp e)
{
interpretAssignCommon(e, null);
}
override void visit(BinAssignExp e)
{
switch (e.op)
{
case TOKaddass:
interpretAssignCommon(e, &Add);
return;
case TOKminass:
interpretAssignCommon(e, &Min);
return;
case TOKcatass:
interpretAssignCommon(e, &ctfeCat);
return;
case TOKmulass:
interpretAssignCommon(e, &Mul);
return;
case TOKdivass:
interpretAssignCommon(e, &Div);
return;
case TOKmodass:
interpretAssignCommon(e, &Mod);
return;
case TOKshlass:
interpretAssignCommon(e, &Shl);
return;
case TOKshrass:
interpretAssignCommon(e, &Shr);
return;
case TOKushrass:
interpretAssignCommon(e, &Ushr);
return;
case TOKandass:
interpretAssignCommon(e, &And);
return;
case TOKorass:
interpretAssignCommon(e, &Or);
return;
case TOKxorass:
interpretAssignCommon(e, &Xor);
return;
case TOKpowass:
interpretAssignCommon(e, &Pow);
return;
default:
assert(0);
}
}
override void visit(PostExp e)
{
debug (LOG)
{
printf("%s PostExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (e.op == TOKplusplus)
interpretAssignCommon(e, &Add, 1);
else
interpretAssignCommon(e, &Min, 1);
debug (LOG)
{
if (CTFEExp.isCantExp(result))
printf("PostExp::interpret() CANT\n");
}
}
/* Return 1 if e is a p1 > p2 or p1 >= p2 pointer comparison;
* -1 if e is a p1 < p2 or p1 <= p2 pointer comparison;
* 0 otherwise
*/
static int isPointerCmpExp(Expression e, Expression* p1, Expression* p2)
{
int ret = 1;
while (e.op == TOKnot)
{
ret *= -1;
e = (cast(NotExp)e).e1;
}
switch (e.op)
{
case TOKlt:
case TOKle:
ret *= -1;
goto case; /+ fall through +/
case TOKgt:
case TOKge:
*p1 = (cast(BinExp)e).e1;
*p2 = (cast(BinExp)e).e2;
if (!(isPointer((*p1).type) && isPointer((*p2).type)))
ret = 0;
break;
default:
ret = 0;
break;
}
return ret;
}
/** Negate a relational operator, eg >= becomes <
*/
static TOK reverseRelation(TOK op)
{
switch (op)
{
case TOKge:
return TOKlt;
case TOKgt:
return TOKle;
case TOKle:
return TOKgt;
case TOKlt:
return TOKge;
default:
assert(0);
}
}
/** If this is a four pointer relation, evaluate it, else return NULL.
*
* This is an expression of the form (p1 > q1 && p2 < q2) or (p1 < q1 || p2 > q2)
* where p1, p2 are expressions yielding pointers to memory block p,
* and q1, q2 are expressions yielding pointers to memory block q.
* This expression is valid even if p and q are independent memory
* blocks and are therefore not normally comparable; the && form returns true
* if [p1..p2] lies inside [q1..q2], and false otherwise; the || form returns
* true if [p1..p2] lies outside [q1..q2], and false otherwise.
*
* Within the expression, any ordering of p1, p2, q1, q2 is permissible;
* the comparison operators can be any of >, <, <=, >=, provided that
* both directions (p > q and p < q) are checked. Additionally the
* relational sub-expressions can be negated, eg
* (!(q1 < p1) && p2 <= q2) is valid.
*/
void interpretFourPointerRelation(BinExp e)
{
assert(e.op == TOKandand || e.op == TOKoror);
/* It can only be an isInside expression, if both e1 and e2 are
* directional pointer comparisons.
* Note that this check can be made statically; it does not depends on
* any runtime values. This allows a JIT implementation to compile a
* special AndAndPossiblyInside, keeping the normal AndAnd case efficient.
*/
// Save the pointer expressions and the comparison directions,
// so we can use them later.
Expression p1 = null;
Expression p2 = null;
Expression p3 = null;
Expression p4 = null;
int dir1 = isPointerCmpExp(e.e1, &p1, &p2);
int dir2 = isPointerCmpExp(e.e2, &p3, &p4);
if (dir1 == 0 || dir2 == 0)
{
result = null;
return;
}
//printf("FourPointerRelation %s\n", toChars());
// Evaluate the first two pointers
p1 = interpret(p1, istate);
if (exceptionOrCant(p1))
return;
p2 = interpret(p2, istate);
if (exceptionOrCant(p2))
return;
dinteger_t ofs1, ofs2;
Expression agg1 = getAggregateFromPointer(p1, &ofs1);
Expression agg2 = getAggregateFromPointer(p2, &ofs2);
if (!pointToSameMemoryBlock(agg1, agg2) && agg1.op != TOKnull && agg2.op != TOKnull)
{
// Here it is either CANT_INTERPRET,
// or an IsInside comparison returning false.
p3 = interpret(p3, istate);
if (CTFEExp.isCantExp(p3))
return;
// Note that it is NOT legal for it to throw an exception!
Expression except = null;
if (exceptionOrCantInterpret(p3))
except = p3;
else
{
p4 = interpret(p4, istate);
if (CTFEExp.isCantExp(p4))
{
result = p4;
return;
}
if (exceptionOrCantInterpret(p4))
except = p4;
}
if (except)
{
e.error("comparison %s of pointers to unrelated memory blocks remains indeterminate at compile time because exception %s was thrown while evaluating %s", e.e1.toChars(), except.toChars(), e.e2.toChars());
result = CTFEExp.cantexp;
return;
}
dinteger_t ofs3, ofs4;
Expression agg3 = getAggregateFromPointer(p3, &ofs3);
Expression agg4 = getAggregateFromPointer(p4, &ofs4);
// The valid cases are:
// p1 > p2 && p3 > p4 (same direction, also for < && <)
// p1 > p2 && p3 < p4 (different direction, also < && >)
// Changing any > into >= doesnt affect the result
if ((dir1 == dir2 && pointToSameMemoryBlock(agg1, agg4) && pointToSameMemoryBlock(agg2, agg3)) || (dir1 != dir2 && pointToSameMemoryBlock(agg1, agg3) && pointToSameMemoryBlock(agg2, agg4)))
{
// it's a legal two-sided comparison
result = new IntegerExp(e.loc, (e.op == TOKandand) ? 0 : 1, e.type);
return;
}
// It's an invalid four-pointer comparison. Either the second
// comparison is in the same direction as the first, or else
// more than two memory blocks are involved (either two independent
// invalid comparisons are present, or else agg3 == agg4).
e.error("comparison %s of pointers to unrelated memory blocks is indeterminate at compile time, even when combined with %s.", e.e1.toChars(), e.e2.toChars());
result = CTFEExp.cantexp;
return;
}
// The first pointer expression didn't need special treatment, so we
// we need to interpret the entire expression exactly as a normal && or ||.
// This is easy because we haven't evaluated e2 at all yet, and we already
// know it will return a bool.
// But we mustn't evaluate the pointer expressions in e1 again, in case
// they have side-effects.
bool nott = false;
Expression ex = e.e1;
while (ex.op == TOKnot)
{
nott = !nott;
ex = (cast(NotExp)ex).e1;
}
TOK cmpop = ex.op;
if (nott)
cmpop = reverseRelation(cmpop);
int cmp = comparePointers(e.loc, cmpop, e.e1.type, agg1, ofs1, agg2, ofs2);
// We already know this is a valid comparison.
assert(cmp >= 0);
if (e.op == TOKandand && cmp == 1 || e.op == TOKoror && cmp == 0)
{
result = interpret(e.e2, istate);
return;
}
result = new IntegerExp(e.loc, (e.op == TOKandand) ? 0 : 1, e.type);
}
override void visit(AndAndExp e)
{
debug (LOG)
{
printf("%s AndAndExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
// Check for an insidePointer expression, evaluate it if so
interpretFourPointerRelation(e);
if (result)
return;
result = interpret(e.e1, istate);
if (exceptionOrCant(result))
return;
int res;
if (result.isBool(false))
res = 0;
else if (isTrueBool(result))
{
result = interpret(e.e2, istate);
if (exceptionOrCant(result))
return;
if (result.op == TOKvoidexp)
{
assert(e.type.ty == Tvoid);
result = null;
return;
}
if (result.isBool(false))
res = 0;
else if (isTrueBool(result))
res = 1;
else
{
result.error("%s does not evaluate to a boolean", result.toChars());
result = CTFEExp.cantexp;
return;
}
}
else
{
result.error("%s cannot be interpreted as a boolean", result.toChars());
result = CTFEExp.cantexp;
return;
}
if (goal != ctfeNeedNothing)
result = new IntegerExp(e.loc, res, e.type);
}
override void visit(OrOrExp e)
{
debug (LOG)
{
printf("%s OrOrExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
// Check for an insidePointer expression, evaluate it if so
interpretFourPointerRelation(e);
if (result)
return;
result = interpret(e.e1, istate);
if (exceptionOrCant(result))
return;
int res;
if (isTrueBool(result))
res = 1;
else if (result.isBool(false))
{
result = interpret(e.e2, istate);
if (exceptionOrCant(result))
return;
if (result.op == TOKvoidexp)
{
assert(e.type.ty == Tvoid);
result = null;
return;
}
if (result.isBool(false))
res = 0;
else if (isTrueBool(result))
res = 1;
else
{
result.error("%s cannot be interpreted as a boolean", result.toChars());
result = CTFEExp.cantexp;
return;
}
}
else
{
result.error("%s cannot be interpreted as a boolean", result.toChars());
result = CTFEExp.cantexp;
return;
}
if (goal != ctfeNeedNothing)
result = new IntegerExp(e.loc, res, e.type);
}
// Print a stack trace, starting from callingExp which called fd.
// To shorten the stack trace, try to detect recursion.
void showCtfeBackTrace(CallExp callingExp, FuncDeclaration fd)
{
if (CtfeStatus.stackTraceCallsToSuppress > 0)
{
--CtfeStatus.stackTraceCallsToSuppress;
return;
}
errorSupplemental(callingExp.loc, "called from here: %s", callingExp.toChars());
// Quit if it's not worth trying to compress the stack trace
if (CtfeStatus.callDepth < 6 || global.params.verbose)
return;
// Recursion happens if the current function already exists in the call stack.
int numToSuppress = 0;
int recurseCount = 0;
int depthSoFar = 0;
InterState* lastRecurse = istate;
for (InterState* cur = istate; cur; cur = cur.caller)
{
if (cur.fd == fd)
{
++recurseCount;
numToSuppress = depthSoFar;
lastRecurse = cur;
}
++depthSoFar;
}
// We need at least three calls to the same function, to make compression worthwhile
if (recurseCount < 2)
return;
// We found a useful recursion. Print all the calls involved in the recursion
errorSupplemental(fd.loc, "%d recursive calls to function %s", recurseCount, fd.toChars());
for (InterState* cur = istate; cur.fd != fd; cur = cur.caller)
{
errorSupplemental(cur.fd.loc, "recursively called from function %s", cur.fd.toChars());
}
// We probably didn't enter the recursion in this function.
// Go deeper to find the real beginning.
InterState* cur = istate;
while (lastRecurse.caller && cur.fd == lastRecurse.caller.fd)
{
cur = cur.caller;
lastRecurse = lastRecurse.caller;
++numToSuppress;
}
CtfeStatus.stackTraceCallsToSuppress = numToSuppress;
}
override void visit(CallExp e)
{
debug (LOG)
{
printf("%s CallExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression pthis = null;
FuncDeclaration fd = null;
Expression ecall = interpret(e.e1, istate);
if (exceptionOrCant(ecall))
return;
if (ecall.op == TOKdotvar)
{
DotVarExp dve = cast(DotVarExp)ecall;
// Calling a member function
pthis = dve.e1;
fd = dve.var.isFuncDeclaration();
assert(fd);
if (pthis.op == TOKdottype)
pthis = (cast(DotTypeExp)dve.e1).e1;
}
else if (ecall.op == TOKvar)
{
fd = (cast(VarExp)ecall).var.isFuncDeclaration();
assert(fd);
if (fd.ident == Id._ArrayPostblit || fd.ident == Id._ArrayDtor)
{
assert(e.arguments.dim == 1);
Expression ea = (*e.arguments)[0];
//printf("1 ea = %s %s\n", ea->type->toChars(), ea->toChars());
if (ea.op == TOKslice)
ea = (cast(SliceExp)ea).e1;
if (ea.op == TOKcast)
ea = (cast(CastExp)ea).e1;
//printf("2 ea = %s, %s %s\n", ea->type->toChars(), Token::toChars(ea->op), ea->toChars());
if (ea.op == TOKvar || ea.op == TOKsymoff)
result = getVarExp(e.loc, istate, (cast(SymbolExp)ea).var, ctfeNeedRvalue);
else if (ea.op == TOKaddress)
result = interpret((cast(AddrExp)ea).e1, istate);
else
assert(0);
if (CTFEExp.isCantExp(result))
return;
if (fd.ident == Id._ArrayPostblit)
result = evaluatePostblit(istate, result);
else
result = evaluateDtor(istate, result);
if (!result)
result = CTFEExp.voidexp;
return;
}
}
else if (ecall.op == TOKsymoff)
{
SymOffExp soe = cast(SymOffExp)ecall;
fd = soe.var.isFuncDeclaration();
assert(fd && soe.offset == 0);
}
else if (ecall.op == TOKdelegate)
{
// Calling a delegate
fd = (cast(DelegateExp)ecall).func;
pthis = (cast(DelegateExp)ecall).e1;
// Special handling for: &nestedfunc --> DelegateExp(VarExp(nestedfunc), nestedfunc)
if (pthis.op == TOKvar && (cast(VarExp)pthis).var == fd)
pthis = null; // context is not necessary for CTFE
}
else if (ecall.op == TOKfunction)
{
// Calling a delegate literal
fd = (cast(FuncExp)ecall).fd;
}
else
{
// delegate.funcptr()
// others
e.error("cannot call %s at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
if (!fd)
{
e.error("CTFE internal error: cannot evaluate %s at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
if (pthis)
{
// Member function call
// Currently this is satisfied because closure is not yet supported.
assert(!fd.isNested());
if (pthis.op == TOKtypeid)
{
pthis.error("static variable %s cannot be read at compile time", pthis.toChars());
result = CTFEExp.cantexp;
return;
}
assert(pthis);
if (pthis.op == TOKnull)
{
assert(pthis.type.toBasetype().ty == Tclass);
e.error("function call through null class reference %s", pthis.toChars());
result = CTFEExp.cantexp;
return;
}
assert(pthis.op == TOKstructliteral || pthis.op == TOKclassreference);
if (fd.isVirtual() && !e.directcall)
{
// Make a virtual function call.
// Get the function from the vtable of the original class
assert(pthis.op == TOKclassreference);
ClassDeclaration cd = (cast(ClassReferenceExp)pthis).originalClass();
// We can't just use the vtable index to look it up, because
// vtables for interfaces don't get populated until the glue layer.
fd = cd.findFunc(fd.ident, cast(TypeFunction)fd.type);
assert(fd);
}
}
if (fd && fd.semanticRun >= PASSsemantic3done && fd.semantic3Errors)
{
e.error("CTFE failed because of previous errors in %s", fd.toChars());
result = CTFEExp.cantexp;
return;
}
// Check for built-in functions
result = evaluateIfBuiltin(istate, e.loc, fd, e.arguments, pthis);
if (result)
return;
if (!fd.fbody)
{
e.error("%s cannot be interpreted at compile time, because it has no available source code", fd.toChars());
result = CTFEExp.cantexp;
return;
}
result = interpret(fd, istate, e.arguments, pthis);
if (result.op == TOKvoidexp)
return;
if (!exceptionOrCantInterpret(result))
{
if (goal != ctfeNeedLvalue) // Peel off CTFE reference if it's unnesessary
result = interpret(result, istate);
}
if (!exceptionOrCantInterpret(result))
{
result = paintTypeOntoLiteral(e.type, result);
result.loc = e.loc;
}
else if (CTFEExp.isCantExp(result) && !global.gag)
showCtfeBackTrace(e, fd); // Print a stack trace.
}
override void visit(CommaExp e)
{
debug (LOG)
{
printf("%s CommaExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
CommaExp firstComma = e;
while (firstComma.e1.op == TOKcomma)
firstComma = cast(CommaExp)firstComma.e1;
// If it creates a variable, and there's no context for
// the variable to be created in, we need to create one now.
InterState istateComma;
if (!istate && firstComma.e1.op == TOKdeclaration)
{
ctfeStack.startFrame(null);
istate = &istateComma;
}
result = CTFEExp.cantexp;
// If the comma returns a temporary variable, it needs to be an lvalue
// (this is particularly important for struct constructors)
if (e.e1.op == TOKdeclaration &&
e.e2.op == TOKvar &&
(cast(DeclarationExp)e.e1).declaration == (cast(VarExp)e.e2).var &&
(cast(VarExp)e.e2).var.storage_class & STCctfe)
{
VarExp ve = cast(VarExp)e.e2;
VarDeclaration v = ve.var.isVarDeclaration();
ctfeStack.push(v);
if (!v._init && !getValue(v))
{
setValue(v, copyLiteral(v.type.defaultInitLiteral(e.loc)).copy());
}
if (!getValue(v))
{
Expression newval = v._init.toExpression();
// Bug 4027. Copy constructors are a weird case where the
// initializer is a void function (the variable is modified
// through a reference parameter instead).
newval = interpret(newval, istate);
if (exceptionOrCant(newval))
goto Lfin;
if (newval.op != TOKvoidexp)
{
// v isn't necessarily null.
setValueWithoutChecking(v, copyLiteral(newval).copy());
}
}
result = interpret(e.e2, istate, goal);
}
else
{
result = interpret(e.e1, istate, ctfeNeedNothing);
if (exceptionOrCant(result))
goto Lfin;
result = interpret(e.e2, istate, goal);
}
Lfin:
// If we created a temporary stack frame, end it now.
if (istate == &istateComma)
ctfeStack.endFrame();
}
override void visit(CondExp e)
{
debug (LOG)
{
printf("%s CondExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (isPointer(e.econd.type))
{
result = interpret(e.econd, istate);
if (exceptionOrCant(result))
return;
if (result.op != TOKnull)
result = new IntegerExp(e.loc, 1, Type.tbool);
}
else
result = interpret(e.econd, istate);
if (exceptionOrCant(result))
return;
if (isTrueBool(result))
result = interpret(e.e1, istate, goal);
else if (result.isBool(false))
result = interpret(e.e2, istate, goal);
else
{
e.error("%s does not evaluate to boolean result at compile time", e.econd.toChars());
result = CTFEExp.cantexp;
}
}
override void visit(ArrayLengthExp e)
{
debug (LOG)
{
printf("%s ArrayLengthExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
assert(e1);
if (exceptionOrCant(e1))
return;
if (e1.op != TOKstring && e1.op != TOKarrayliteral && e1.op != TOKslice && e1.op != TOKnull)
{
e.error("%s cannot be evaluated at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
result = new IntegerExp(e.loc, resolveArrayLength(e1), e.type);
}
override void visit(DelegatePtrExp e)
{
debug (LOG)
{
printf("%s DelegatePtrExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
assert(e1);
if (exceptionOrCant(e1))
return;
e.error("%s cannot be evaluated at compile time", e.toChars());
result = CTFEExp.cantexp;
}
override void visit(DelegateFuncptrExp e)
{
debug (LOG)
{
printf("%s DelegateFuncptrExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
assert(e1);
if (exceptionOrCant(e1))
return;
e.error("%s cannot be evaluated at compile time", e.toChars());
result = CTFEExp.cantexp;
}
static bool resolveIndexing(IndexExp e, InterState* istate, Expression* pagg, uinteger_t* pidx, bool modify)
{
assert(e.e1.type.toBasetype().ty != Taarray);
if (e.e1.type.toBasetype().ty == Tpointer)
{
// Indexing a pointer. Note that there is no $ in this case.
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCantInterpret(e1))
return false;
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCantInterpret(e2))
return false;
sinteger_t indx = e2.toInteger();
dinteger_t ofs;
Expression agg = getAggregateFromPointer(e1, &ofs);
if (agg.op == TOKnull)
{
e.error("cannot index through null pointer %s", e.e1.toChars());
return false;
}
if (agg.op == TOKint64)
{
e.error("cannot index through invalid pointer %s of value %s", e.e1.toChars(), e1.toChars());
return false;
}
// Pointer to a non-array variable
if (agg.op == TOKsymoff)
{
e.error("mutable variable %s cannot be %s at compile time, even through a pointer", cast(char*)(modify ? "modified" : "read"), (cast(SymOffExp)agg).var.toChars());
return false;
}
if (agg.op == TOKarrayliteral || agg.op == TOKstring)
{
dinteger_t len = resolveArrayLength(agg);
if (ofs + indx >= len)
{
e.error("pointer index [%lld] exceeds allocated memory block [0..%lld]", ofs + indx, len);
return false;
}
}
else
{
if (ofs + indx != 0)
{
e.error("pointer index [%lld] lies outside memory block [0..1]", ofs + indx);
return false;
}
}
*pagg = agg;
*pidx = ofs + indx;
return true;
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCantInterpret(e1))
return false;
if (e1.op == TOKnull)
{
e.error("cannot index null array %s", e.e1.toChars());
return false;
}
if (e1.op == TOKvector)
e1 = (cast(VectorExp)e1).e1;
// Set the $ variable, and find the array literal to modify
if (e1.op != TOKarrayliteral && e1.op != TOKstring && e1.op != TOKslice)
{
e.error("cannot determine length of %s at compile time", e.e1.toChars());
return false;
}
dinteger_t len = resolveArrayLength(e1);
if (e.lengthVar)
{
Expression dollarExp = new IntegerExp(e.loc, len, Type.tsize_t);
ctfeStack.push(e.lengthVar);
setValue(e.lengthVar, dollarExp);
}
Expression e2 = interpret(e.e2, istate);
if (e.lengthVar)
ctfeStack.pop(e.lengthVar); // $ is defined only inside []
if (exceptionOrCantInterpret(e2))
return false;
if (e2.op != TOKint64)
{
e.error("CTFE internal error: non-integral index [%s]", e.e2.toChars());
return false;
}
if (e1.op == TOKslice)
{
// Simplify index of slice: agg[lwr..upr][indx] --> agg[indx']
uinteger_t index = e2.toInteger();
uinteger_t ilwr = (cast(SliceExp)e1).lwr.toInteger();
uinteger_t iupr = (cast(SliceExp)e1).upr.toInteger();
if (index > iupr - ilwr)
{
e.error("index %llu exceeds array length %llu", index, iupr - ilwr);
return false;
}
*pagg = (cast(SliceExp)e1).e1;
*pidx = index + ilwr;
}
else
{
*pagg = e1;
*pidx = e2.toInteger();
if (len <= *pidx)
{
e.error("array index %lld is out of bounds [0..%lld]", *pidx, len);
return false;
}
}
return true;
}
override void visit(IndexExp e)
{
debug (LOG)
{
printf("%s IndexExp::interpret() %s, goal = %d\n", e.loc.toChars(), e.toChars(), goal);
}
if (e.e1.type.toBasetype().ty == Tpointer)
{
Expression agg;
uinteger_t indexToAccess;
if (!resolveIndexing(e, istate, &agg, &indexToAccess, false))
{
result = CTFEExp.cantexp;
return;
}
if (agg.op == TOKarrayliteral || agg.op == TOKstring)
{
if (goal == ctfeNeedLvalue)
{
// if we need a reference, IndexExp shouldn't be interpreting
// the expression to a value, it should stay as a reference
result = new IndexExp(e.loc, agg, new IntegerExp(e.e2.loc, indexToAccess, e.e2.type));
result.type = e.type;
return;
}
result = ctfeIndex(e.loc, e.type, agg, indexToAccess);
return;
}
else
{
assert(indexToAccess == 0);
result = interpret(agg, istate, goal);
if (exceptionOrCant(result))
return;
result = paintTypeOntoLiteral(e.type, result);
return;
}
}
if (e.e1.type.toBasetype().ty == Taarray)
{
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
if (e1.op == TOKnull)
{
if (goal == ctfeNeedLvalue && e1.type.ty == Taarray && e.modifiable)
{
assert(0); // does not reach here?
}
e.error("cannot index null array %s", e.e1.toChars());
result = CTFEExp.cantexp;
return;
}
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
if (goal == ctfeNeedLvalue)
{
// Pointer or reference of a scalar type
if (e1 == e.e1 && e2 == e.e2)
result = e;
else
{
result = new IndexExp(e.loc, e1, e2);
result.type = e.type;
}
return;
}
assert(e1.op == TOKassocarrayliteral);
e2 = resolveSlice(e2);
result = findKeyInAA(e.loc, cast(AssocArrayLiteralExp)e1, e2);
if (!result)
{
e.error("key %s not found in associative array %s", e2.toChars(), e.e1.toChars());
result = CTFEExp.cantexp;
}
return;
}
Expression agg;
uinteger_t indexToAccess;
if (!resolveIndexing(e, istate, &agg, &indexToAccess, false))
{
result = CTFEExp.cantexp;
return;
}
if (goal == ctfeNeedLvalue)
{
Expression e2 = new IntegerExp(e.e2.loc, indexToAccess, Type.tsize_t);
result = new IndexExp(e.loc, agg, e2);
result.type = e.type;
return;
}
result = ctfeIndex(e.loc, e.type, agg, indexToAccess);
if (exceptionOrCant(result))
return;
if (result.op == TOKvoid)
{
e.error("%s is used before initialized", e.toChars());
errorSupplemental(result.loc, "originally uninitialized here");
result = CTFEExp.cantexp;
return;
}
result = paintTypeOntoLiteral(e.type, result);
}
override void visit(SliceExp e)
{
debug (LOG)
{
printf("%s SliceExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
if (e.e1.type.toBasetype().ty == Tpointer)
{
// Slicing a pointer. Note that there is no $ in this case.
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
if (e1.op == TOKint64)
{
e.error("cannot slice invalid pointer %s of value %s", e.e1.toChars(), e1.toChars());
result = CTFEExp.cantexp;
return;
}
/* Evaluate lower and upper bounds of slice
*/
Expression lwr = interpret(e.lwr, istate);
if (exceptionOrCant(lwr))
return;
Expression upr = interpret(e.upr, istate);
if (exceptionOrCant(upr))
return;
uinteger_t ilwr = lwr.toInteger();
uinteger_t iupr = upr.toInteger();
dinteger_t ofs;
Expression agg = getAggregateFromPointer(e1, &ofs);
ilwr += ofs;
iupr += ofs;
if (agg.op == TOKnull)
{
if (iupr == ilwr)
{
result = new NullExp(e.loc);
result.type = e.type;
return;
}
e.error("cannot slice null pointer %s", e.e1.toChars());
result = CTFEExp.cantexp;
return;
}
if (agg.op == TOKsymoff)
{
e.error("slicing pointers to static variables is not supported in CTFE");
result = CTFEExp.cantexp;
return;
}
if (agg.op != TOKarrayliteral && agg.op != TOKstring)
{
e.error("pointer %s cannot be sliced at compile time (it does not point to an array)", e.e1.toChars());
result = CTFEExp.cantexp;
return;
}
assert(agg.op == TOKarrayliteral || agg.op == TOKstring);
dinteger_t len = ArrayLength(Type.tsize_t, agg).exp().toInteger();
//Type *pointee = ((TypePointer *)agg->type)->next;
if (iupr > (len + 1) || iupr < ilwr)
{
e.error("pointer slice [%lld..%lld] exceeds allocated memory block [0..%lld]", ilwr, iupr, len);
result = CTFEExp.cantexp;
return;
}
if (ofs != 0)
{
lwr = new IntegerExp(e.loc, ilwr, lwr.type);
upr = new IntegerExp(e.loc, iupr, upr.type);
}
result = new SliceExp(e.loc, agg, lwr, upr);
result.type = e.type;
return;
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
if (!e.lwr)
{
result = paintTypeOntoLiteral(e.type, e1);
return;
}
/* Set the $ variable
*/
if (e1.op != TOKarrayliteral && e1.op != TOKstring && e1.op != TOKnull && e1.op != TOKslice)
{
e.error("cannot determine length of %s at compile time", e1.toChars());
result = CTFEExp.cantexp;
return;
}
uinteger_t dollar = resolveArrayLength(e1);
if (e.lengthVar)
{
auto dollarExp = new IntegerExp(e.loc, dollar, Type.tsize_t);
ctfeStack.push(e.lengthVar);
setValue(e.lengthVar, dollarExp);
}
/* Evaluate lower and upper bounds of slice
*/
Expression lwr = interpret(e.lwr, istate);
if (exceptionOrCant(lwr))
{
if (e.lengthVar)
ctfeStack.pop(e.lengthVar);
return;
}
Expression upr = interpret(e.upr, istate);
if (exceptionOrCant(upr))
{
if (e.lengthVar)
ctfeStack.pop(e.lengthVar);
return;
}
if (e.lengthVar)
ctfeStack.pop(e.lengthVar); // $ is defined only inside [L..U]
uinteger_t ilwr = lwr.toInteger();
uinteger_t iupr = upr.toInteger();
if (e1.op == TOKnull)
{
if (ilwr == 0 && iupr == 0)
{
result = e1;
return;
}
e1.error("slice [%llu..%llu] is out of bounds", ilwr, iupr);
result = CTFEExp.cantexp;
return;
}
if (e1.op == TOKslice)
{
SliceExp se = cast(SliceExp)e1;
// Simplify slice of slice:
// aggregate[lo1..up1][lwr..upr] ---> aggregate[lwr'..upr']
uinteger_t lo1 = se.lwr.toInteger();
uinteger_t up1 = se.upr.toInteger();
if (ilwr > iupr || iupr > up1 - lo1)
{
e.error("slice[%llu..%llu] exceeds array bounds[%llu..%llu]", ilwr, iupr, lo1, up1);
result = CTFEExp.cantexp;
return;
}
ilwr += lo1;
iupr += lo1;
result = new SliceExp(e.loc, se.e1, new IntegerExp(e.loc, ilwr, lwr.type), new IntegerExp(e.loc, iupr, upr.type));
result.type = e.type;
return;
}
if (e1.op == TOKarrayliteral || e1.op == TOKstring)
{
if (iupr < ilwr || dollar < iupr)
{
e.error("slice [%lld..%lld] exceeds array bounds [0..%lld]", ilwr, iupr, dollar);
result = CTFEExp.cantexp;
return;
}
}
result = new SliceExp(e.loc, e1, lwr, upr);
result.type = e.type;
}
override void visit(InExp e)
{
debug (LOG)
{
printf("%s InExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
if (e2.op == TOKnull)
{
result = new NullExp(e.loc, e.type);
return;
}
if (e2.op != TOKassocarrayliteral)
{
e.error("%s cannot be interpreted at compile time", e.toChars());
result = CTFEExp.cantexp;
return;
}
e1 = resolveSlice(e1);
result = findKeyInAA(e.loc, cast(AssocArrayLiteralExp)e2, e1);
if (exceptionOrCant(result))
return;
if (!result)
{
result = new NullExp(e.loc, e.type);
}
else
{
// Create a CTFE pointer &aa[index]
result = new IndexExp(e.loc, e2, e1);
result.type = e.type.nextOf();
result = new AddrExp(e.loc, result);
result.type = e.type;
}
}
override void visit(CatExp e)
{
debug (LOG)
{
printf("%s CatExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
Expression e2 = interpret(e.e2, istate);
if (exceptionOrCant(e2))
return;
e1 = resolveSlice(e1);
e2 = resolveSlice(e2);
result = ctfeCat(e.loc, e.type, e1, e2).copy();
if (CTFEExp.isCantExp(result))
{
e.error("%s cannot be interpreted at compile time", e.toChars());
return;
}
// We know we still own it, because we interpreted both e1 and e2
if (result.op == TOKarrayliteral)
{
ArrayLiteralExp ale = cast(ArrayLiteralExp)result;
ale.ownedByCtfe = OWNEDctfe;
// Bugzilla 14686
for (size_t i = 0; i < ale.elements.dim; i++)
{
Expression ex = evaluatePostblit(istate, (*ale.elements)[i]);
if (exceptionOrCant(ex))
return;
}
}
if (result.op == TOKstring)
(cast(StringExp)result).ownedByCtfe = OWNEDctfe;
}
override void visit(DeleteExp e)
{
debug (LOG)
{
printf("%s DeleteExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
result = interpret(e.e1, istate);
if (exceptionOrCant(result))
return;
if (result.op == TOKnull)
{
result = CTFEExp.voidexp;
return;
}
auto tb = e.e1.type.toBasetype();
switch (tb.ty)
{
case Tclass:
if (result.op != TOKclassreference)
{
e.error("delete on invalid class reference '%s'", result.toChars());
result = CTFEExp.cantexp;
return;
}
auto cre = cast(ClassReferenceExp)result;
auto cd = cre.originalClass();
if (cd.aggDelete)
{
e.error("member deallocators not supported by CTFE");
result = CTFEExp.cantexp;
return;
}
if (cd.dtor)
{
result = interpret(cd.dtor, istate, null, cre);
if (exceptionOrCant(result))
return;
}
break;
case Tpointer:
tb = (cast(TypePointer)tb).next.toBasetype();
if (tb.ty == Tstruct)
{
if (result.op != TOKaddress ||
(cast(AddrExp)result).e1.op != TOKstructliteral)
{
e.error("delete on invalid struct pointer '%s'", result.toChars());
result = CTFEExp.cantexp;
return;
}
auto sd = (cast(TypeStruct)tb).sym;
auto sle = cast(StructLiteralExp)(cast(AddrExp)result).e1;
if (sd.aggDelete)
{
e.error("member deallocators not supported by CTFE");
result = CTFEExp.cantexp;
return;
}
if (sd.dtor)
{
result = interpret(sd.dtor, istate, null, sle);
if (exceptionOrCant(result))
return;
}
}
break;
case Tarray:
auto tv = tb.nextOf().baseElemOf();
if (tv.ty == Tstruct)
{
if (result.op != TOKarrayliteral)
{
e.error("delete on invalid struct array '%s'", result.toChars());
result = CTFEExp.cantexp;
return;
}
auto sd = (cast(TypeStruct)tv).sym;
if (sd.aggDelete)
{
e.error("member deallocators not supported by CTFE");
result = CTFEExp.cantexp;
return;
}
if (sd.dtor)
{
auto ale = cast(ArrayLiteralExp)result;
foreach (el; *ale.elements)
{
result = interpret(sd.dtor, istate, null, el);
if (exceptionOrCant(result))
return;
}
}
}
break;
default:
assert(0);
}
result = CTFEExp.voidexp;
}
override void visit(CastExp e)
{
debug (LOG)
{
printf("%s CastExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate, goal);
if (exceptionOrCant(e1))
return;
// If the expression has been cast to void, do nothing.
if (e.to.ty == Tvoid)
{
result = CTFEExp.voidexp;
return;
}
if (e.to.ty == Tpointer && e1.op != TOKnull)
{
Type pointee = (cast(TypePointer)e.type).next;
// Implement special cases of normally-unsafe casts
if (e1.op == TOKint64)
{
// Happens with Windows HANDLEs, for example.
result = paintTypeOntoLiteral(e.to, e1);
return;
}
bool castToSarrayPointer = false;
bool castBackFromVoid = false;
if (e1.type.ty == Tarray || e1.type.ty == Tsarray || e1.type.ty == Tpointer)
{
// Check for unsupported type painting operations
// For slices, we need the type being sliced,
// since it may have already been type painted
Type elemtype = e1.type.nextOf();
if (e1.op == TOKslice)
elemtype = (cast(SliceExp)e1).e1.type.nextOf();
// Allow casts from X* to void *, and X** to void** for any X.
// But don't allow cast from X* to void**.
// So, we strip all matching * from source and target to find X.
// Allow casts to X* from void* only if the 'void' was originally an X;
// we check this later on.
Type ultimatePointee = pointee;
Type ultimateSrc = elemtype;
while (ultimatePointee.ty == Tpointer && ultimateSrc.ty == Tpointer)
{
ultimatePointee = ultimatePointee.nextOf();
ultimateSrc = ultimateSrc.nextOf();
}
if (ultimatePointee.ty == Tsarray && ultimatePointee.nextOf().equivalent(ultimateSrc))
{
castToSarrayPointer = true;
}
else if (ultimatePointee.ty != Tvoid && ultimateSrc.ty != Tvoid && !isSafePointerCast(elemtype, pointee))
{
e.error("reinterpreting cast from %s* to %s* is not supported in CTFE", elemtype.toChars(), pointee.toChars());
result = CTFEExp.cantexp;
return;
}
if (ultimateSrc.ty == Tvoid)
castBackFromVoid = true;
}
if (e1.op == TOKslice)
{
if ((cast(SliceExp)e1).e1.op == TOKnull)
{
result = paintTypeOntoLiteral(e.type, (cast(SliceExp)e1).e1);
return;
}
// Create a CTFE pointer &aggregate[1..2]
result = new IndexExp(e.loc, (cast(SliceExp)e1).e1, (cast(SliceExp)e1).lwr);
result.type = e.type.nextOf();
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
if (e1.op == TOKarrayliteral || e1.op == TOKstring)
{
// Create a CTFE pointer &[1,2,3][0] or &"abc"[0]
result = new IndexExp(e.loc, e1, new IntegerExp(e.loc, 0, Type.tsize_t));
result.type = e.type.nextOf();
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
if (e1.op == TOKindex && !(cast(IndexExp)e1).e1.type.equals(e1.type))
{
// type painting operation
IndexExp ie = cast(IndexExp)e1;
result = new IndexExp(e1.loc, ie.e1, ie.e2);
if (castBackFromVoid)
{
// get the original type. For strings, it's just the type...
Type origType = ie.e1.type.nextOf();
// ..but for arrays of type void*, it's the type of the element
Expression xx = null;
if (ie.e1.op == TOKarrayliteral && ie.e2.op == TOKint64)
{
ArrayLiteralExp ale = cast(ArrayLiteralExp)ie.e1;
size_t indx = cast(size_t)ie.e2.toInteger();
if (indx < ale.elements.dim)
xx = (*ale.elements)[indx];
}
if (xx && xx.op == TOKindex)
origType = (cast(IndexExp)xx).e1.type.nextOf();
else if (xx && xx.op == TOKaddress)
origType = (cast(AddrExp)xx).e1.type;
else if (xx && xx.op == TOKvar)
origType = (cast(VarExp)xx).var.type;
if (!isSafePointerCast(origType, pointee))
{
e.error("using void* to reinterpret cast from %s* to %s* is not supported in CTFE", origType.toChars(), pointee.toChars());
result = CTFEExp.cantexp;
return;
}
}
result.type = e.type;
return;
}
if (e1.op == TOKaddress)
{
Type origType = (cast(AddrExp)e1).e1.type;
if (isSafePointerCast(origType, pointee))
{
result = new AddrExp(e.loc, (cast(AddrExp)e1).e1);
result.type = e.type;
return;
}
if (castToSarrayPointer && pointee.toBasetype().ty == Tsarray && (cast(AddrExp)e1).e1.op == TOKindex)
{
// &val[idx]
dinteger_t dim = (cast(TypeSArray)pointee.toBasetype()).dim.toInteger();
IndexExp ie = cast(IndexExp)(cast(AddrExp)e1).e1;
Expression lwr = ie.e2;
Expression upr = new IntegerExp(ie.e2.loc, ie.e2.toInteger() + dim, Type.tsize_t);
// Create a CTFE pointer &val[idx..idx+dim]
result = new SliceExp(e.loc, ie.e1, lwr, upr);
result.type = pointee;
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
}
if (e1.op == TOKvar || e1.op == TOKsymoff)
{
// type painting operation
Type origType = (cast(SymbolExp)e1).var.type;
if (castBackFromVoid && !isSafePointerCast(origType, pointee))
{
e.error("using void* to reinterpret cast from %s* to %s* is not supported in CTFE", origType.toChars(), pointee.toChars());
result = CTFEExp.cantexp;
return;
}
if (e1.op == TOKvar)
result = new VarExp(e.loc, (cast(VarExp)e1).var);
else
result = new SymOffExp(e.loc, (cast(SymOffExp)e1).var, (cast(SymOffExp)e1).offset);
result.type = e.to;
return;
}
// Check if we have a null pointer (eg, inside a struct)
e1 = interpret(e1, istate);
if (e1.op != TOKnull)
{
e.error("pointer cast from %s to %s is not supported at compile time", e1.type.toChars(), e.to.toChars());
result = CTFEExp.cantexp;
return;
}
}
if (e.to.ty == Tsarray && e.e1.type.ty == Tvector)
{
// Special handling for: cast(float[4])__vector([w, x, y, z])
e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
assert(e1.op == TOKvector);
e1 = (cast(VectorExp)e1).e1;
}
if (e.to.ty == Tarray && e1.op == TOKslice)
{
// Note that the slice may be void[], so when checking for dangerous
// casts, we need to use the original type, which is se->e1.
SliceExp se = cast(SliceExp)e1;
if (!isSafePointerCast(se.e1.type.nextOf(), e.to.nextOf()))
{
e.error("array cast from %s to %s is not supported at compile time", se.e1.type.toChars(), e.to.toChars());
result = CTFEExp.cantexp;
return;
}
e1 = new SliceExp(e1.loc, se.e1, se.lwr, se.upr);
e1.type = e.to;
result = e1;
return;
}
// Disallow array type painting, except for conversions between built-in
// types of identical size.
if ((e.to.ty == Tsarray || e.to.ty == Tarray) && (e1.type.ty == Tsarray || e1.type.ty == Tarray) && !isSafePointerCast(e1.type.nextOf(), e.to.nextOf()))
{
e.error("array cast from %s to %s is not supported at compile time", e1.type.toChars(), e.to.toChars());
result = CTFEExp.cantexp;
return;
}
if (e.to.ty == Tsarray)
e1 = resolveSlice(e1);
if (e.to.toBasetype().ty == Tbool && e1.type.ty == Tpointer)
{
result = new IntegerExp(e.loc, e1.op != TOKnull, e.to);
return;
}
result = ctfeCast(e.loc, e.type, e.to, e1);
}
override void visit(AssertExp e)
{
debug (LOG)
{
printf("%s AssertExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression e1 = interpret(e.e1, istate);
if (exceptionOrCant(e1))
return;
if (isTrueBool(e1))
{
}
else if (e1.isBool(false))
{
if (e.msg)
{
result = interpret(e.msg, istate);
if (exceptionOrCant(result))
return;
e.error("%s", result.toChars());
}
else
e.error("%s failed", e.toChars());
result = CTFEExp.cantexp;
return;
}
else
{
e.error("%s is not a compile time boolean expression", e1.toChars());
result = CTFEExp.cantexp;
return;
}
result = e1;
return;
}
override void visit(PtrExp e)
{
debug (LOG)
{
printf("%s PtrExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
// Check for int<->float and long<->double casts.
if (e.e1.op == TOKsymoff && (cast(SymOffExp)e.e1).offset == 0 && (cast(SymOffExp)e.e1).var.isVarDeclaration() && isFloatIntPaint(e.type, (cast(SymOffExp)e.e1).var.type))
{
// *(cast(int*)&v), where v is a float variable
result = paintFloatInt(getVarExp(e.loc, istate, (cast(SymOffExp)e.e1).var, ctfeNeedRvalue), e.type);
return;
}
if (e.e1.op == TOKcast && (cast(CastExp)e.e1).e1.op == TOKaddress)
{
// *(cast(int*)&x), where x is a float expression
Expression x = (cast(AddrExp)(cast(CastExp)e.e1).e1).e1;
if (isFloatIntPaint(e.type, x.type))
{
result = paintFloatInt(interpret(x, istate), e.type);
return;
}
}
// Constant fold *(&structliteral + offset)
if (e.e1.op == TOKadd)
{
AddExp ae = cast(AddExp)e.e1;
if (ae.e1.op == TOKaddress && ae.e2.op == TOKint64)
{
AddrExp ade = cast(AddrExp)ae.e1;
Expression ex = interpret(ade.e1, istate);
if (exceptionOrCant(ex))
return;
if (ex.op == TOKstructliteral)
{
StructLiteralExp se = cast(StructLiteralExp)ex;
dinteger_t offset = ae.e2.toInteger();
result = se.getField(e.type, cast(uint)offset);
if (result)
return;
}
}
}
// It's possible we have an array bounds error. We need to make sure it
// errors with this line number, not the one where the pointer was set.
result = interpret(e.e1, istate);
if (exceptionOrCant(result))
return;
if (result.op == TOKfunction)
return;
if (result.op == TOKsymoff)
{
SymOffExp soe = cast(SymOffExp)result;
if (soe.offset == 0 && soe.var.isFuncDeclaration())
return;
e.error("cannot dereference pointer to static variable %s at compile time", soe.var.toChars());
result = CTFEExp.cantexp;
return;
}
if (result.op != TOKaddress)
{
if (result.op == TOKnull)
e.error("dereference of null pointer '%s'", e.e1.toChars());
else
e.error("dereference of invalid pointer '%s'", result.toChars());
result = CTFEExp.cantexp;
return;
}
// *(&x) ==> x
result = (cast(AddrExp)result).e1;
if (result.op == TOKslice && e.type.toBasetype().ty == Tsarray)
{
/* aggr[lwr..upr]
* upr may exceed the upper boundary of aggr, but the check is deferred
* until those out-of-bounds elements will be touched.
*/
return;
}
result = interpret(result, istate, goal);
if (exceptionOrCant(result))
return;
debug (LOG)
{
if (CTFEExp.isCantExp(result))
printf("PtrExp::interpret() %s = CTFEExp::cantexp\n", e.toChars());
}
}
override void visit(DotVarExp e)
{
debug (LOG)
{
printf("%s DotVarExp::interpret() %s, goal = %d\n", e.loc.toChars(), e.toChars(), goal);
}
Expression ex = interpret(e.e1, istate);
if (exceptionOrCant(ex))
return;
if (FuncDeclaration f = e.var.isFuncDeclaration())
{
if (ex == e.e1)
result = e; // optimize: reuse this CTFE reference
else
{
result = new DotVarExp(e.loc, ex, f, false);
result.type = e.type;
}
return;
}
VarDeclaration v = e.var.isVarDeclaration();
if (!v)
{
e.error("CTFE internal error: %s", e.toChars());
result = CTFEExp.cantexp;
return;
}
if (ex.op == TOKnull)
{
if (ex.type.toBasetype().ty == Tclass)
e.error("class '%s' is null and cannot be dereferenced", e.e1.toChars());
else
e.error("CTFE internal error: null this '%s'", e.e1.toChars());
result = CTFEExp.cantexp;
return;
}
if (ex.op != TOKstructliteral && ex.op != TOKclassreference)
{
e.error("%s.%s is not yet implemented at compile time", e.e1.toChars(), e.var.toChars());
result = CTFEExp.cantexp;
return;
}
StructLiteralExp se;
int i;
// We can't use getField, because it makes a copy
if (ex.op == TOKclassreference)
{
se = (cast(ClassReferenceExp)ex).value;
i = (cast(ClassReferenceExp)ex).findFieldIndexByName(v);
}
else
{
se = cast(StructLiteralExp)ex;
i = findFieldIndexByName(se.sd, v);
}
if (i == -1)
{
e.error("couldn't find field %s of type %s in %s", v.toChars(), e.type.toChars(), se.toChars());
result = CTFEExp.cantexp;
return;
}
if (goal == ctfeNeedLvalue)
{
Expression ev = (*se.elements)[i];
if (!ev || ev.op == TOKvoid)
(*se.elements)[i] = voidInitLiteral(e.type, v).copy();
// just return the (simplified) dotvar expression as a CTFE reference
if (e.e1 == ex)
result = e;
else
{
result = new DotVarExp(e.loc, ex, v);
result.type = e.type;
}
return;
}
result = (*se.elements)[i];
if (!result)
{
e.error("Internal Compiler Error: null field %s", v.toChars());
result = CTFEExp.cantexp;
return;
}
if (result.op == TOKvoid)
{
VoidInitExp ve = cast(VoidInitExp)result;
const(char)* s = ve.var.toChars();
if (v.overlapped)
{
e.error("reinterpretation through overlapped field %s is not allowed in CTFE", s);
result = CTFEExp.cantexp;
return;
}
e.error("cannot read uninitialized variable %s in CTFE", s);
result = CTFEExp.cantexp;
return;
}
if (v.type.ty != result.type.ty && v.type.ty == Tsarray)
{
// Block assignment from inside struct literals
auto tsa = cast(TypeSArray)v.type;
auto len = cast(size_t)tsa.dim.toInteger();
result = createBlockDuplicatedArrayLiteral(ex.loc, v.type, ex, len);
(*se.elements)[i] = result;
}
debug (LOG)
{
if (CTFEExp.isCantExp(result))
printf("DotVarExp::interpret() %s = CTFEExp::cantexp\n", e.toChars());
}
}
override void visit(RemoveExp e)
{
debug (LOG)
{
printf("%s RemoveExp::interpret() %s\n", e.loc.toChars(), e.toChars());
}
Expression agg = interpret(e.e1, istate);
if (exceptionOrCant(agg))
return;
Expression index = interpret(e.e2, istate);
if (exceptionOrCant(index))
return;
if (agg.op == TOKnull)
{
result = CTFEExp.voidexp;
return;
}
assert(agg.op == TOKassocarrayliteral);
AssocArrayLiteralExp aae = cast(AssocArrayLiteralExp)agg;
Expressions* keysx = aae.keys;
Expressions* valuesx = aae.values;
size_t removed = 0;
for (size_t j = 0; j < valuesx.dim; ++j)
{
Expression ekey = (*keysx)[j];
int eq = ctfeEqual(e.loc, TOKequal, ekey, index);
if (eq)
++removed;
else if (removed != 0)
{
(*keysx)[j - removed] = ekey;
(*valuesx)[j - removed] = (*valuesx)[j];
}
}
valuesx.dim = valuesx.dim - removed;
keysx.dim = keysx.dim - removed;
result = new IntegerExp(e.loc, removed ? 1 : 0, Type.tbool);
}
override void visit(ClassReferenceExp e)
{
//printf("ClassReferenceExp::interpret() %s\n", e->value->toChars());
result = e;
}
override void visit(VoidInitExp e)
{
e.error("CTFE internal error: trying to read uninitialized variable");
assert(0);
}
override void visit(ThrownExceptionExp e)
{
assert(0); // This should never be interpreted
}
}
extern (C++) Expression interpret(Expression e, InterState* istate, CtfeGoal goal = ctfeNeedRvalue)
{
if (!e)
return null;
scope Interpreter v = new Interpreter(istate, goal);
e.accept(v);
Expression ex = v.result;
assert(goal == ctfeNeedNothing || ex !is null);
return ex;
}
/***********************************
* Interpret the statement.
* Returns:
* NULL continue to next statement
* TOKcantexp cannot interpret statement at compile time
* !NULL expression from return statement, or thrown exception
*/
extern (C++) Expression interpret(Statement s, InterState* istate)
{
if (!s)
return null;
scope Interpreter v = new Interpreter(istate, ctfeNeedNothing);
s.accept(v);
return v.result;
}
/* All results destined for use outside of CTFE need to have their CTFE-specific
* features removed.
* In particular, all slices must be resolved.
*/
extern (C++) Expression scrubReturnValue(Loc loc, Expression e)
{
if (e.op == TOKclassreference)
{
StructLiteralExp se = (cast(ClassReferenceExp)e).value;
se.ownedByCtfe = OWNEDcode;
if (!(se.stageflags & stageScrub))
{
int old = se.stageflags;
se.stageflags |= stageScrub;
if (Expression ex = scrubArray(loc, se.elements, true))
return ex;
se.stageflags = old;
}
}
if (e.op == TOKvoid)
{
error(loc, "uninitialized variable '%s' cannot be returned from CTFE", (cast(VoidInitExp)e).var.toChars());
return new ErrorExp();
}
e = resolveSlice(e);
if (e.op == TOKstructliteral)
{
StructLiteralExp se = cast(StructLiteralExp)e;
se.ownedByCtfe = OWNEDcode;
if (!(se.stageflags & stageScrub))
{
int old = se.stageflags;
se.stageflags |= stageScrub;
if (Expression ex = scrubArray(loc, se.elements, true))
return ex;
se.stageflags = old;
}
}
if (e.op == TOKstring)
{
(cast(StringExp)e).ownedByCtfe = OWNEDcode;
}
if (e.op == TOKarrayliteral)
{
(cast(ArrayLiteralExp)e).ownedByCtfe = OWNEDcode;
if (Expression ex = scrubArray(loc, (cast(ArrayLiteralExp)e).elements))
return ex;
}
if (e.op == TOKassocarrayliteral)
{
AssocArrayLiteralExp aae = cast(AssocArrayLiteralExp)e;
aae.ownedByCtfe = OWNEDcode;
if (Expression ex = scrubArray(loc, aae.keys))
return ex;
if (Expression ex = scrubArray(loc, aae.values))
return ex;
aae.type = toBuiltinAAType(aae.type);
}
return e;
}
// Return true if every element is either void,
// or is an array literal or struct literal of void elements.
extern (C++) bool isEntirelyVoid(Expressions* elems)
{
for (size_t i = 0; i < elems.dim; i++)
{
Expression m = (*elems)[i];
// It can be NULL for performance reasons,
// see StructLiteralExp::interpret().
if (!m)
continue;
if (!(m.op == TOKvoid) && !(m.op == TOKarrayliteral && isEntirelyVoid((cast(ArrayLiteralExp)m).elements)) && !(m.op == TOKstructliteral && isEntirelyVoid((cast(StructLiteralExp)m).elements)))
{
return false;
}
}
return true;
}
// Scrub all members of an array. Return false if error
extern (C++) Expression scrubArray(Loc loc, Expressions* elems, bool structlit = false)
{
for (size_t i = 0; i < elems.dim; i++)
{
Expression m = (*elems)[i];
// It can be NULL for performance reasons,
// see StructLiteralExp::interpret().
if (!m)
continue;
// A struct .init may contain void members.
// Static array members are a weird special case (bug 10994).
if (structlit && ((m.op == TOKvoid) || (m.op == TOKarrayliteral && m.type.ty == Tsarray && isEntirelyVoid((cast(ArrayLiteralExp)m).elements)) || (m.op == TOKstructliteral && isEntirelyVoid((cast(StructLiteralExp)m).elements))))
{
m = null;
}
else
{
m = scrubReturnValue(loc, m);
if (CTFEExp.isCantExp(m) || m.op == TOKerror)
return m;
}
(*elems)[i] = m;
}
return null;
}
extern (C++) Expression scrubCacheValue(Loc loc, Expression e)
{
if (e.op == TOKclassreference)
{
StructLiteralExp sle = (cast(ClassReferenceExp)e).value;
sle.ownedByCtfe = OWNEDcache;
if (!(sle.stageflags & stageScrub))
{
int old = sle.stageflags;
sle.stageflags |= stageScrub;
if (Expression ex = scrubArrayCache(loc, sle.elements))
return ex;
sle.stageflags = old;
}
}
if (e.op == TOKstructliteral)
{
StructLiteralExp sle = cast(StructLiteralExp)e;
sle.ownedByCtfe = OWNEDcache;
if (!(sle.stageflags & stageScrub))
{
int old = sle.stageflags;
sle.stageflags |= stageScrub;
if (Expression ex = scrubArrayCache(loc, sle.elements))
return ex;
sle.stageflags = old;
}
}
if (e.op == TOKstring)
{
(cast(StringExp)e).ownedByCtfe = OWNEDcache;
}
if (e.op == TOKarrayliteral)
{
(cast(ArrayLiteralExp)e).ownedByCtfe = OWNEDcache;
if (Expression ex = scrubArrayCache(loc, (cast(ArrayLiteralExp)e).elements))
return ex;
}
if (e.op == TOKassocarrayliteral)
{
AssocArrayLiteralExp aae = cast(AssocArrayLiteralExp)e;
aae.ownedByCtfe = OWNEDcache;
if (Expression ex = scrubArrayCache(loc, aae.keys))
return ex;
if (Expression ex = scrubArrayCache(loc, aae.values))
return ex;
}
return e;
}
extern (C++) Expression scrubArrayCache(Loc loc, Expressions* elems)
{
for (size_t i = 0; i < elems.dim; i++)
{
Expression m = (*elems)[i];
if (!m)
continue;
(*elems)[i] = scrubCacheValue(loc, m);
}
return null;
}
/******************************* Special Functions ***************************/
extern (C++) Expression interpret_length(InterState* istate, Expression earg)
{
//printf("interpret_length()\n");
earg = interpret(earg, istate);
if (exceptionOrCantInterpret(earg))
return earg;
dinteger_t len = 0;
if (earg.op == TOKassocarrayliteral)
len = (cast(AssocArrayLiteralExp)earg).keys.dim;
else
assert(earg.op == TOKnull);
Expression e = new IntegerExp(earg.loc, len, Type.tsize_t);
return e;
}
extern (C++) Expression interpret_keys(InterState* istate, Expression earg, Type returnType)
{
debug (LOG)
{
printf("interpret_keys()\n");
}
earg = interpret(earg, istate);
if (exceptionOrCantInterpret(earg))
return earg;
if (earg.op == TOKnull)
return new NullExp(earg.loc, returnType);
if (earg.op != TOKassocarrayliteral && earg.type.toBasetype().ty != Taarray)
return null;
assert(earg.op == TOKassocarrayliteral);
AssocArrayLiteralExp aae = cast(AssocArrayLiteralExp)earg;
auto ae = new ArrayLiteralExp(aae.loc, aae.keys);
ae.ownedByCtfe = aae.ownedByCtfe;
ae.type = returnType;
return copyLiteral(ae).copy();
}
extern (C++) Expression interpret_values(InterState* istate, Expression earg, Type returnType)
{
debug (LOG)
{
printf("interpret_values()\n");
}
earg = interpret(earg, istate);
if (exceptionOrCantInterpret(earg))
return earg;
if (earg.op == TOKnull)
return new NullExp(earg.loc, returnType);
if (earg.op != TOKassocarrayliteral && earg.type.toBasetype().ty != Taarray)
return null;
assert(earg.op == TOKassocarrayliteral);
AssocArrayLiteralExp aae = cast(AssocArrayLiteralExp)earg;
auto ae = new ArrayLiteralExp(aae.loc, aae.values);
ae.ownedByCtfe = aae.ownedByCtfe;
ae.type = returnType;
//printf("result is %s\n", e->toChars());
return copyLiteral(ae).copy();
}
extern (C++) Expression interpret_dup(InterState* istate, Expression earg)
{
debug (LOG)
{
printf("interpret_dup()\n");
}
earg = interpret(earg, istate);
if (exceptionOrCantInterpret(earg))
return earg;
if (earg.op == TOKnull)
return new NullExp(earg.loc, earg.type);
if (earg.op != TOKassocarrayliteral && earg.type.toBasetype().ty != Taarray)
return null;
assert(earg.op == TOKassocarrayliteral);
AssocArrayLiteralExp aae = cast(AssocArrayLiteralExp)copyLiteral(earg).copy();
for (size_t i = 0; i < aae.keys.dim; i++)
{
if (Expression e = evaluatePostblit(istate, (*aae.keys)[i]))
return e;
if (Expression e = evaluatePostblit(istate, (*aae.values)[i]))
return e;
}
aae.type = earg.type.mutableOf(); // repaint type from const(int[int]) to const(int)[int]
//printf("result is %s\n", aae->toChars());
return aae;
}
// signature is int delegate(ref Value) OR int delegate(ref Key, ref Value)
extern (C++) Expression interpret_aaApply(InterState* istate, Expression aa, Expression deleg)
{
aa = interpret(aa, istate);
if (exceptionOrCantInterpret(aa))
return aa;
if (aa.op != TOKassocarrayliteral)
return new IntegerExp(deleg.loc, 0, Type.tsize_t);
FuncDeclaration fd = null;
Expression pthis = null;
if (deleg.op == TOKdelegate)
{
fd = (cast(DelegateExp)deleg).func;
pthis = (cast(DelegateExp)deleg).e1;
}
else if (deleg.op == TOKfunction)
fd = (cast(FuncExp)deleg).fd;
assert(fd && fd.fbody);
assert(fd.parameters);
size_t numParams = fd.parameters.dim;
assert(numParams == 1 || numParams == 2);
Parameter fparam = Parameter.getNth((cast(TypeFunction)fd.type).parameters, numParams - 1);
bool wantRefValue = 0 != (fparam.storageClass & (STCout | STCref));
Expressions args;
args.setDim(numParams);
AssocArrayLiteralExp ae = cast(AssocArrayLiteralExp)aa;
if (!ae.keys || ae.keys.dim == 0)
return new IntegerExp(deleg.loc, 0, Type.tsize_t);
Expression eresult;
for (size_t i = 0; i < ae.keys.dim; ++i)
{
Expression ekey = (*ae.keys)[i];
Expression evalue = (*ae.values)[i];
if (wantRefValue)
{
Type t = evalue.type;
evalue = new IndexExp(deleg.loc, ae, ekey);
evalue.type = t;
}
args[numParams - 1] = evalue;
if (numParams == 2)
args[0] = ekey;
eresult = interpret(fd, istate, &args, pthis);
if (exceptionOrCantInterpret(eresult))
return eresult;
assert(eresult.op == TOKint64);
if ((cast(IntegerExp)eresult).getInteger() != 0)
return eresult;
}
return eresult;
}
// Helper function: given a function of type A[] f(...),
// return A[].
extern (C++) Type returnedArrayType(FuncDeclaration fd)
{
assert(fd.type.ty == Tfunction);
assert(fd.type.nextOf().ty == Tarray);
return (cast(TypeFunction)fd.type).nextOf();
}
/* Decoding UTF strings for foreach loops. Duplicates the functionality of
* the twelve _aApplyXXn functions in aApply.d in the runtime.
*/
extern (C++) Expression foreachApplyUtf(InterState* istate, Expression str, Expression deleg, bool rvs)
{
debug (LOG)
{
printf("foreachApplyUtf(%s, %s)\n", str.toChars(), deleg.toChars());
}
FuncDeclaration fd = null;
Expression pthis = null;
if (deleg.op == TOKdelegate)
{
fd = (cast(DelegateExp)deleg).func;
pthis = (cast(DelegateExp)deleg).e1;
}
else if (deleg.op == TOKfunction)
fd = (cast(FuncExp)deleg).fd;
assert(fd && fd.fbody);
assert(fd.parameters);
size_t numParams = fd.parameters.dim;
assert(numParams == 1 || numParams == 2);
Type charType = (*fd.parameters)[numParams - 1].type;
Type indexType = numParams == 2 ? (*fd.parameters)[0].type : Type.tsize_t;
size_t len = cast(size_t)resolveArrayLength(str);
if (len == 0)
return new IntegerExp(deleg.loc, 0, indexType);
str = resolveSlice(str);
StringExp se = null;
ArrayLiteralExp ale = null;
if (str.op == TOKstring)
se = cast(StringExp)str;
else if (str.op == TOKarrayliteral)
ale = cast(ArrayLiteralExp)str;
else
{
str.error("CTFE internal error: cannot foreach %s", str.toChars());
return CTFEExp.cantexp;
}
Expressions args;
args.setDim(numParams);
Expression eresult = null; // ded-store to prevent spurious warning
// Buffers for encoding; also used for decoding array literals
char[4] utf8buf;
wchar[2] utf16buf;
size_t start = rvs ? len : 0;
size_t end = rvs ? 0 : len;
for (size_t indx = start; indx != end;)
{
// Step 1: Decode the next dchar from the string.
const(char)* errmsg = null; // Used for reporting decoding errors
dchar rawvalue; // Holds the decoded dchar
size_t currentIndex = indx; // The index of the decoded character
if (ale)
{
// If it is an array literal, copy the code points into the buffer
size_t buflen = 1; // #code points in the buffer
size_t n = 1; // #code points in this char
size_t sz = cast(size_t)ale.type.nextOf().size();
switch (sz)
{
case 1:
if (rvs)
{
// find the start of the string
--indx;
buflen = 1;
while (indx > 0 && buflen < 4)
{
Expression r = (*ale.elements)[indx];
assert(r.op == TOKint64);
char x = cast(char)(cast(IntegerExp)r).getInteger();
if ((x & 0xC0) != 0x80)
break;
++buflen;
}
}
else
buflen = (indx + 4 > len) ? len - indx : 4;
for (size_t i = 0; i < buflen; ++i)
{
Expression r = (*ale.elements)[indx + i];
assert(r.op == TOKint64);
utf8buf[i] = cast(char)(cast(IntegerExp)r).getInteger();
}
n = 0;
errmsg = utf_decodeChar(&utf8buf[0], buflen, n, rawvalue);
break;
case 2:
if (rvs)
{
// find the start of the string
--indx;
buflen = 1;
Expression r = (*ale.elements)[indx];
assert(r.op == TOKint64);
ushort x = cast(ushort)(cast(IntegerExp)r).getInteger();
if (indx > 0 && x >= 0xDC00 && x <= 0xDFFF)
{
--indx;
++buflen;
}
}
else
buflen = (indx + 2 > len) ? len - indx : 2;
for (size_t i = 0; i < buflen; ++i)
{
Expression r = (*ale.elements)[indx + i];
assert(r.op == TOKint64);
utf16buf[i] = cast(ushort)(cast(IntegerExp)r).getInteger();
}
n = 0;
errmsg = utf_decodeWchar(&utf16buf[0], buflen, n, rawvalue);
break;
case 4:
{
if (rvs)
--indx;
Expression r = (*ale.elements)[indx];
assert(r.op == TOKint64);
rawvalue = cast(dchar)(cast(IntegerExp)r).getInteger();
n = 1;
}
break;
default:
assert(0);
}
if (!rvs)
indx += n;
}
else
{
// String literals
size_t saveindx; // used for reverse iteration
switch (se.sz)
{
case 1:
if (rvs)
{
// find the start of the string
--indx;
while (indx > 0 && ((se.getCodeUnit(indx) & 0xC0) == 0x80))
--indx;
saveindx = indx;
}
errmsg = utf_decodeChar(se.string, se.len, indx, rawvalue);
if (rvs)
indx = saveindx;
break;
case 2:
if (rvs)
{
// find the start
--indx;
auto wc = se.getCodeUnit(indx);
if (wc >= 0xDC00 && wc <= 0xDFFF)
--indx;
saveindx = indx;
}
errmsg = utf_decodeWchar(se.wstring, se.len, indx, rawvalue);
if (rvs)
indx = saveindx;
break;
case 4:
if (rvs)
--indx;
rawvalue = se.getCodeUnit(indx);
if (!rvs)
++indx;
break;
default:
assert(0);
}
}
if (errmsg)
{
deleg.error("%s", errmsg);
return CTFEExp.cantexp;
}
// Step 2: encode the dchar in the target encoding
int charlen = 1; // How many codepoints are involved?
switch (charType.size())
{
case 1:
charlen = utf_codeLengthChar(rawvalue);
utf_encodeChar(&utf8buf[0], rawvalue);
break;
case 2:
charlen = utf_codeLengthWchar(rawvalue);
utf_encodeWchar(&utf16buf[0], rawvalue);
break;
case 4:
break;
default:
assert(0);
}
if (rvs)
currentIndex = indx;
// Step 3: call the delegate once for each code point
// The index only needs to be set once
if (numParams == 2)
args[0] = new IntegerExp(deleg.loc, currentIndex, indexType);
Expression val = null;
for (int k = 0; k < charlen; ++k)
{
dchar codepoint;
switch (charType.size())
{
case 1:
codepoint = utf8buf[k];
break;
case 2:
codepoint = utf16buf[k];
break;
case 4:
codepoint = rawvalue;
break;
default:
assert(0);
}
val = new IntegerExp(str.loc, codepoint, charType);
args[numParams - 1] = val;
eresult = interpret(fd, istate, &args, pthis);
if (exceptionOrCantInterpret(eresult))
return eresult;
assert(eresult.op == TOKint64);
if ((cast(IntegerExp)eresult).getInteger() != 0)
return eresult;
}
}
return eresult;
}
/* If this is a built-in function, return the interpreted result,
* Otherwise, return NULL.
*/
extern (C++) Expression evaluateIfBuiltin(InterState* istate, Loc loc, FuncDeclaration fd, Expressions* arguments, Expression pthis)
{
Expression e = null;
size_t nargs = arguments ? arguments.dim : 0;
if (!pthis)
{
if (isBuiltin(fd) == BUILTINyes)
{
Expressions args;
args.setDim(nargs);
for (size_t i = 0; i < args.dim; i++)
{
Expression earg = (*arguments)[i];
earg = interpret(earg, istate);
if (exceptionOrCantInterpret(earg))
return earg;
args[i] = earg;
}
e = eval_builtin(loc, fd, &args);
if (!e)
{
error(loc, "cannot evaluate unimplemented builtin %s at compile time", fd.toChars());
e = CTFEExp.cantexp;
}
}
}
if (!pthis)
{
Expression firstarg = nargs > 0 ? (*arguments)[0] : null;
if (firstarg && firstarg.type.toBasetype().ty == Taarray)
{
TypeAArray firstAAtype = cast(TypeAArray)firstarg.type;
const id = fd.ident.toChars();
if (nargs == 1 && fd.ident == Id.aaLen)
return interpret_length(istate, firstarg);
if (nargs == 3 && !strcmp(id, "_aaApply"))
return interpret_aaApply(istate, firstarg, arguments.data[2]);
if (nargs == 3 && !strcmp(id, "_aaApply2"))
return interpret_aaApply(istate, firstarg, arguments.data[2]);
if (nargs == 1 && !strcmp(id, "keys") && !strcmp(fd.toParent2().ident.toChars(), "object"))
return interpret_keys(istate, firstarg, firstAAtype.index.arrayOf());
if (nargs == 1 && !strcmp(id, "values") && !strcmp(fd.toParent2().ident.toChars(), "object"))
return interpret_values(istate, firstarg, firstAAtype.nextOf().arrayOf());
if (nargs == 1 && !strcmp(id, "rehash") && !strcmp(fd.toParent2().ident.toChars(), "object"))
return interpret(firstarg, istate);
if (nargs == 1 && !strcmp(id, "dup") && !strcmp(fd.toParent2().ident.toChars(), "object"))
return interpret_dup(istate, firstarg);
}
}
if (pthis && !fd.fbody && fd.isCtorDeclaration() && fd.parent && fd.parent.parent && fd.parent.parent.ident == Id.object)
{
if (pthis.op == TOKclassreference && fd.parent.ident == Id.Throwable)
{
// At present, the constructors just copy their arguments into the struct.
// But we might need some magic if stack tracing gets added to druntime.
StructLiteralExp se = (cast(ClassReferenceExp)pthis).value;
assert(arguments.dim <= se.elements.dim);
for (size_t i = 0; i < arguments.dim; ++i)
{
e = interpret((*arguments)[i], istate);
if (exceptionOrCantInterpret(e))
return e;
(*se.elements)[i] = e;
}
return CTFEExp.voidexp;
}
}
if (nargs == 1 && !pthis && (fd.ident == Id.criticalenter || fd.ident == Id.criticalexit))
{
// Support synchronized{} as a no-op
return CTFEExp.voidexp;
}
if (!pthis)
{
const idlen = fd.ident.toString().length;
const id = fd.ident.toChars();
if (nargs == 2 && (idlen == 10 || idlen == 11) && !strncmp(id, "_aApply", 7))
{
// Functions from aApply.d and aApplyR.d in the runtime
bool rvs = (idlen == 11); // true if foreach_reverse
char c = id[idlen - 3]; // char width: 'c', 'w', or 'd'
char s = id[idlen - 2]; // string width: 'c', 'w', or 'd'
char n = id[idlen - 1]; // numParams: 1 or 2.
// There are 12 combinations
if ((n == '1' || n == '2') && (c == 'c' || c == 'w' || c == 'd') && (s == 'c' || s == 'w' || s == 'd') && c != s)
{
Expression str = (*arguments)[0];
str = interpret(str, istate);
if (exceptionOrCantInterpret(str))
return str;
return foreachApplyUtf(istate, str, (*arguments)[1], rvs);
}
}
}
return e;
}
extern (C++) Expression evaluatePostblit(InterState* istate, Expression e)
{
Type tb = e.type.baseElemOf();
if (tb.ty != Tstruct)
return null;
StructDeclaration sd = (cast(TypeStruct)tb).sym;
if (!sd.postblit)
return null;
if (e.op == TOKarrayliteral)
{
ArrayLiteralExp ale = cast(ArrayLiteralExp)e;
for (size_t i = 0; i < ale.elements.dim; i++)
{
e = evaluatePostblit(istate, (*ale.elements)[i]);
if (e)
return e;
}
return null;
}
if (e.op == TOKstructliteral)
{
// e.__postblit()
e = interpret(sd.postblit, istate, null, e);
if (exceptionOrCantInterpret(e))
return e;
return null;
}
assert(0);
}
extern (C++) Expression evaluateDtor(InterState* istate, Expression e)
{
Type tb = e.type.baseElemOf();
if (tb.ty != Tstruct)
return null;
StructDeclaration sd = (cast(TypeStruct)tb).sym;
if (!sd.dtor)
return null;
if (e.op == TOKarrayliteral)
{
ArrayLiteralExp alex = cast(ArrayLiteralExp)e;
for (size_t i = alex.elements.dim; 0 < i--;)
e = evaluateDtor(istate, (*alex.elements)[i]);
}
else if (e.op == TOKstructliteral)
{
// e.__dtor()
e = interpret(sd.dtor, istate, null, e);
}
else
assert(0);
if (exceptionOrCantInterpret(e))
return e;
return null;
}
/*************************** CTFE Sanity Checks ***************************/
/* Setter functions for CTFE variable values.
* These functions exist to check for compiler CTFE bugs.
*/
extern (C++) bool hasValue(VarDeclaration vd)
{
if (vd.ctfeAdrOnStack == cast(size_t)-1)
return false;
return null !is getValue(vd);
}
extern (C++) Expression getValue(VarDeclaration vd)
{
return ctfeStack.getValue(vd);
}
extern (C++) void setValueNull(VarDeclaration vd)
{
ctfeStack.setValue(vd, null);
}
// Don't check for validity
extern (C++) void setValueWithoutChecking(VarDeclaration vd, Expression newval)
{
ctfeStack.setValue(vd, newval);
}
extern (C++) void setValue(VarDeclaration vd, Expression newval)
{
version (none)
{
if (!((vd.storage_class & (STCout | STCref)) ? isCtfeReferenceValid(newval) : isCtfeValueValid(newval)))
{
printf("[%s] vd = %s %s, newval = %s\n", vd.loc.toChars(), vd.type.toChars(), vd.toChars(), newval.toChars());
}
}
assert((vd.storage_class & (STCout | STCref)) ? isCtfeReferenceValid(newval) : isCtfeValueValid(newval));
ctfeStack.setValue(vd, newval);
}
|
D
|
/**
*
*/
module hunt.wechat.bean.card.update.AbstractUpdate;
//import com.alibaba.fastjson.annotation.JSONField;
/**
* 微信卡券-卡券管理-更改卡券信息接口-请求参数-抽象类
*
*
*/
abstract class AbstractUpdate {
/**
* 卡券ID,必填
*/
@JSONField(name = "card_id")
private string cardId;
/**
* @return 卡券ID
*/
public string getCardId() {
return cardId;
}
/**
* @param 卡券ID
*/
public void setCardId(string cardId) {
this.cardId = cardId;
}
}
|
D
|
int INF = 1 << 30;
int N, H;
int[] w, h;
int[][] dp;
void main() {
auto ip = readAs!(int[]);
N = ip[0], H = ip[1];
foreach(_; 1..N) {
auto ip2 = readAs!(int[]), a = ip2[0], b = ip2[1];
w ~= a; h ~= b;
}
if(h.sum < H) {
writeln(-1);
return;
}
dp = new int[][](N+1, H+1001);
foreach(ref i; dp) i[] = INF;
dp[0][0] = 0;
//calc(N-2, H).writeln;
foreach(i; 0..N-1) {
foreach(j; 0..H+1001) {
debug writefln("%d %d", i, j);
if(j < h[i]) dp[i+1][j] = dp[i][j];
else dp[i+1][j] = min(dp[i][j], dp[i][j-h[i]] + (i+1) * w[i]);
}
}
dp[N-1][H..$].reduce!min.writeln;
}
int calc(int i, int j) {
debug writefln("%d %d", i, j);
if(i < 0) return INF;
if(dp[i][j] != INF) return dp[i][j];
if(j < h[i]) return dp[i][j] = calc(i - 1, j);
return dp[i][j] = min(calc(i - 1, j), calc(i - 1, j - h[i]) + (i + 1) * w[i]);
}
// ===================================
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
|
/** DGui project file.
Copyright: Trogu Antonio Davide 2011-2013
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Trogu Antonio Davide
*/
module picture;
import dgui.all;
class MainForm: Form
{
private PictureBox _pict;
public this()
{
this.text = "DGui Picture Box Text";
this.size = Size(300, 250);
this.startPosition = FormStartPosition.CENTER_SCREEN; // Set Form Position
this._pict = new PictureBox();
this._pict.dock = DockStyle.FILL;
this._pict.sizeMode = SizeMode.AUTO_SIZE; // Stretch the image
this._pict.image = Bitmap.fromFile("image.bmp"); //Load image from file
this._pict.parent = this;
}
}
int main(string[] args)
{
return Application.run(new MainForm()); // Start the application
}
|
D
|
/**
The context the translation happens in, to avoid global variables
*/
module dpp.runtime.context;
alias LineNumber = size_t;
// A function or global variable
struct Linkable {
LineNumber lineNumber;
string mangling;
}
/**
Context for the current translation, to avoid global variables
*/
struct Context {
import dpp.runtime.options: Options;
import dpp.runtime.namespace: Namespace;
import clang: Cursor;
alias CursorHash = uint;
alias SeenCursors = bool[CursorId];
/**
The lines of output so far. This is needed in order to fix
any name collisions between functions or variables with aggregates
such as structs, unions and enums.
*/
private string[] lines;
/**
Structs can be anonymous in C, and it's even common
to typedef them to a name. We come up with new names
that we track here so as to be able to properly transate
those typedefs.
*/
private string[CursorHash] cursorNickNames;
// FIXME - there must be a better way
/// Used to find the last nickname we coined (e.g. "_Anonymous_1")
private string[] nickNames;
/**
Remembers the seen struct pointers so that if any are undeclared in C,
we do so in D at the end.
*/
private bool[string] fieldStructSpellings;
/**
Remembers the field spellings in aggregates in case we need to change any
of them.
*/
private LineNumber[string] fieldDeclarations;
/**
All the aggregates that have been declared
*/
private bool[string] _aggregateDeclarations;
/**
A linkable is a function or a global variable. We remember all
the ones we saw here so that if there's a name clash we can
come back and fix the declarations after the fact with
pragma(mangle).
*/
private Linkable[string] linkableDeclarations;
/**
All the function-like macros that have been declared
*/
private bool[string] functionMacroDeclarations;
/**
Remember all the macros already defined
*/
private bool[string] macros;
/**
All previously seen cursors
*/
private SeenCursors seenCursors;
/**
Deals with C++ namespaces
*/
/*private*/ Namespace _namespace;
/// Command-line options
Options options;
/*
Remember all declared types so that C-style casts can be recognised
*/
private string[] _types = [
`void ?\*`,
`char`, `unsigned char`, `signed char`, `short`, `unsigned short`,
`int`, `unsigned`, `unsigned int`, `long`, `unsigned long`, `long long`,
`unsigned long long`, `float`, `double`, `long double`,
];
/// to generate unique names
private int _anonymousIndex;
this(Options options) @safe pure {
this.options = options;
}
ref Context indent() @safe pure return {
options = options.indent;
return this;
}
string indentation() @safe @nogc pure const {
return options.indentation;
}
void setIndentation(in string indentation) @safe pure {
options.indentation = indentation;
}
void log(A...)(auto ref A args) const {
import std.functional: forward;
options.log(forward!args);
}
void indentLog(A...)(auto ref A args) const {
import std.functional: forward;
options.indent.log(forward!args);
}
bool debugOutput() @safe @nogc pure nothrow const {
return options.debugOutput;
}
bool hasSeen(in Cursor cursor) @safe pure nothrow const {
return cast(bool)(CursorId(cursor) in seenCursors);
}
void rememberCursor(in Cursor cursor) @safe pure nothrow {
// EnumDecl can have no spelling but end up defining an enum anyway
// See "it.compile.projects.double enum typedef"
if(cursor.spelling != "" || cursor.kind == Cursor.Kind.EnumDecl)
seenCursors[CursorId(cursor)] = true;
}
string translation() @safe pure nothrow const {
import std.array: join;
return lines.join("\n");
}
void writeln(in string line) @safe pure nothrow {
lines ~= line.dup;
}
void writeln(in string[] lines) @safe pure nothrow {
this.lines ~= lines;
}
// remember a function or variable declaration
string rememberLinkable(in Cursor cursor) @safe pure nothrow {
import dpp.translation.dlang: maybeRename;
const spelling = maybeRename(cursor, this);
// since linkables produce one-line translations, the next
// will be the linkable
linkableDeclarations[spelling] = Linkable(lines.length, cursor.mangling);
return spelling;
}
void fixNames() @safe pure {
declareUnknownStructs;
fixLinkables;
fixFields;
}
void fixLinkables() @safe pure {
foreach(declarations; [_aggregateDeclarations, functionMacroDeclarations]) {
foreach(name, _; declarations) {
// if there's a name clash, fix it
auto clashingLinkable = name in linkableDeclarations;
if(clashingLinkable) {
resolveClash(lines[clashingLinkable.lineNumber], name, clashingLinkable.mangling);
}
}
}
}
void fixFields() @safe pure {
import dpp.translation.dlang: pragmaMangle, rename;
import std.string: replace;
foreach(spelling, lineNumber; fieldDeclarations) {
if(spelling in _aggregateDeclarations) {
lines[lineNumber] = lines[lineNumber]
.replace(spelling ~ `;`, rename(spelling, this) ~ `;`);
}
}
}
/**
Tells the context to remember a struct type encountered in an aggregate field.
Typically this will be a pointer to a structure but it could also be the return
type or parameter types of a function pointer field.
*/
void rememberFieldStruct(in string typeSpelling) @safe pure {
fieldStructSpellings[typeSpelling] = true;
}
/**
In C it's possible for a struct field name to have the same name as a struct
because of elaborated names. We remember them here in case we need to fix them.
*/
void rememberField(in string spelling) @safe pure {
fieldDeclarations[spelling] = lines.length;
}
/**
Remember this aggregate cursor
*/
void rememberAggregate(in Cursor cursor) @safe pure {
const spelling = spellingOrNickname(cursor);
_aggregateDeclarations[spelling] = true;
rememberType(spelling);
}
// find the last one we named, pop it off, and return it
string popLastNickName() @safe pure {
if(nickNames.length == 0) {
// this might happen with `enum { one, two } var;`
// We need the typename to declare `var` with but the translation only comes
auto ret = newAnonymousTypeName;
--_anonymousIndex; // make sure we return the same name next time
return ret;
}
auto ret = nickNames[$-1];
nickNames = nickNames[0 .. $-1];
return ret;
}
/**
If unknown structs show up in functions or fields (as a pointer),
define them now so the D file can compile
See `it.c.compile.delayed`.
*/
void declareUnknownStructs() @safe pure {
foreach(name, _; fieldStructSpellings) {
if(name !in _aggregateDeclarations) {
log("Could not find '", name, "' in aggregate declarations, defining it");
writeln("struct " ~ name ~ ";");
_aggregateDeclarations[name] = true;
}
}
}
const(typeof(_aggregateDeclarations)) aggregateDeclarations() @safe pure nothrow const {
return _aggregateDeclarations;
}
/// return the spelling if it exists, or our made-up nickname for it if not
string spellingOrNickname(in Cursor cursor) @safe pure {
import dpp.translation.dlang: rename, isKeyword;
if(cursor.spelling == "") return nickName(cursor);
return cursor.spelling.isKeyword ? rename(cursor.spelling, this) : cursor.spelling;
}
private string nickName(in Cursor cursor) @safe pure {
if(cursor.hash !in cursorNickNames) {
auto nick = newAnonymousTypeName;
nickNames ~= nick;
cursorNickNames[cursor.hash] = nick;
}
return cursorNickNames[cursor.hash];
}
private string newAnonymousTypeName() @safe pure {
import std.conv: text;
return text("_Anonymous_", _anonymousIndex++);
}
string newAnonymousMemberName() @safe pure {
import std.string: replace;
return newAnonymousTypeName.replace("_A", "_a");
}
private void resolveClash(ref string line, in string spelling, in string mangling) @safe pure const {
import dpp.translation.dlang: pragmaMangle;
line = ` ` ~ pragmaMangle(mangling) ~ replaceSpelling(line, spelling);
}
private string replaceSpelling(in string line, in string spelling) @safe pure const {
import dpp.translation.dlang: rename;
import std.array: replace;
return line
.replace(spelling ~ `;`, rename(spelling, this) ~ `;`)
.replace(spelling ~ `(`, rename(spelling, this) ~ `(`)
;
}
void rememberType(in string type) @safe pure nothrow {
_types ~= type;
}
/// Matches a C-type cast
auto castRegex() @safe const {
import std.array: join, array;
import std.regex: regex;
import std.algorithm: map;
import std.range: chain;
// const and non const versions of each type
const typesConstOpt = _types.map!(a => `(?:const )?` ~ a).array;
const typeSelectionStr =
chain(typesConstOpt,
// pointers thereof
typesConstOpt.map!(a => a ~ ` ?\*`))
.join("|");
// parens and a type inside, where "a type" is any we know about
const regexStr = `\(( *?(?:` ~ typeSelectionStr ~ `) *?)\)`;
return regex(regexStr);
}
void rememberMacro(in Cursor cursor) @safe pure {
macros[cursor.spelling] = true;
if(cursor.isMacroFunction)
functionMacroDeclarations[cursor.spelling] = true;
}
bool macroAlreadyDefined(in Cursor cursor) @safe pure const {
return cast(bool) (cursor.spelling in macros);
}
string[] pushNamespace(in string name) @safe pure {
return _namespace.push(name);
}
string[] popNamespace() @safe pure {
return _namespace.pop;
}
void addNamespaceSymbol(in string symbol) @safe pure {
_namespace.addSymbol(symbol);
}
}
// to identify a cursor
private struct CursorId {
import clang: Cursor, Type;
string cursorSpelling;
Cursor.Kind cursorKind;
string typeSpelling;
Type.Kind typeKind;
this(in Cursor cursor) @safe pure nothrow {
cursorSpelling = cursor.spelling;
cursorKind = cursor.kind;
typeSpelling = cursor.type.spelling;
typeKind = cursor.type.kind;
}
}
|
D
|
// htslib-1.7 hts.h as D module
// Changes include:
// In D, const on either LHS or RHS of function declaration applies to the function, not return value, unless parents included:
// changed ^const <type> <fnname> to ^const(<type>) <fnname>
module hts;
import std.bitmanip;
import bgzf;
extern (C):
/// @file htslib/hts.h
/// Format-neutral I/O, indexing, and iterator API functions.
/*
Copyright (C) 2012-2016 Genome Research Ltd.
Copyright (C) 2010, 2012 Broad Institute.
Portions copyright (C) 2003-2006, 2008-2010 by Heng Li <lh3@live.co.uk>
Author: Heng Li <lh3@sanger.ac.uk>
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. */
/+
#ifndef HTSLIB_HTS_H
#define HTSLIB_HTS_H
#include <stddef.h>
#include <stdint.h>
#include "hts_defs.h"
#include "hts_log.h"
#ifndef HTS_BGZF_TYPEDEF
typedef struct BGZF BGZF;
#define HTS_BGZF_TYPEDEF
#endif
+/
struct cram_fd;
struct hFILE;
struct hts_tpool;
struct __kstring_t {
size_t l, m;
char *s;
};
alias __kstring_t kstring_t;
/+
#ifndef kroundup32
#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x))
#endif
/**
* @hideinitializer
* Macro to expand a dynamic array of a given type
*
* @param type_t The type of the array elements
* @param[in] n Requested number of elements of type type_t
* @param[in,out] m Size of memory allocated
* @param[in,out] ptr Pointer to the array
*
* @discussion
* The array *ptr will be expanded if necessary so that it can hold @p n
* or more elements. If the array is expanded then the new size will be
* written to @p m and the value in @ptr may change.
*
* It must be possible to take the address of @p ptr and @p m must be usable
* as an lvalue.
*
* @bug
* If the memory allocation fails, this will call exit(1). This is
* not ideal behaviour in a library.
*/
#define hts_expand(type_t, n, m, ptr) do { \
if ((n) > (m)) { \
size_t hts_realloc_or_die(size_t, size_t, size_t, size_t, \
int, void **, const char *); \
(m) = hts_realloc_or_die((n) >= 1 ? (n) : 1, (m), sizeof(m), \
sizeof(type_t), 0, \
(void **)&(ptr), __func__); \
} \
} while (0)
/**
* @hideinitializer
* Macro to expand a dynamic array, zeroing any newly-allocated memory
*
* @param type_t The type of the array elements
* @param[in] n Requested number of elements of type type_t
* @param[in,out] m Size of memory allocated
* @param[in,out] ptr Pointer to the array
*
* @discussion
* As for hts_expand(), except the bytes that make up the array elements
* between the old and new values of @p m are set to zero using memset().
*
* @bug
* If the memory allocation fails, this will call exit(1). This is
* not ideal behaviour in a library.
*/
#define hts_expand0(type_t, n, m, ptr) do { \
if ((n) > (m)) { \
size_t hts_realloc_or_die(size_t, size_t, size_t, size_t, \
int, void **, const char *); \
(m) = hts_realloc_or_die((n) >= 1 ? (n) : 1, (m), sizeof(m), \
sizeof(type_t), 1, \
(void **)&(ptr), __func__); \
} \
} while (0)
+/
/************
* File I/O *
************/
// Add new entries only at the end (but before the *_maximum entry)
// of these enums, as their numbering is part of the htslib ABI.
enum htsFormatCategory {
unknown_category,
sequence_data, // Sequence data -- SAM, BAM, CRAM, etc
variant_data, // Variant calling data -- VCF, BCF, etc
index_file, // Index file associated with some data file
region_list, // Coordinate intervals or regions -- BED, etc
category_maximum = 32767
};
enum htsExactFormat {
unknown_format,
binary_format, text_format,
sam, bam, bai, cram, crai, vcf, bcf, csi, gzi, tbi, bed,
htsget,
//deprecated("Use htsExactFormat 'htsget' instead") json = htsget,
format_maximum = 32767
};
enum htsCompression {
no_compression, gzip, bgzf, custom,
compression_maximum = 32767
};
// version is a reserved keyword in D -- changed to "vers" -- not sure how affects linkage
struct htsFormat {
htsFormatCategory category;
htsExactFormat format;
struct vers { short major, minor; };
htsCompression compression;
short compression_level; // currently unused
void *specific; // format specific options; see struct hts_opt.
};
// Maintainers note htsFile cannot be an opaque structure because some of its
// fields are part of libhts.so's ABI (hence these fields must not be moved):
// - fp is used in the public sam_itr_next()/etc macros
// - is_bin is used directly in samtools <= 1.1 and bcftools <= 1.1
// - is_write and is_cram are used directly in samtools <= 1.1
// - fp is used directly in samtools (up to and including current develop)
// - line is used directly in bcftools (up to and including current develop)
struct htsFile {
align(1):
//uint32_t is_bin:1, is_write:1, is_be:1, is_cram:1, is_bgzf:1, dummy:27;
mixin(bitfields!(
bool, "is_bin", 1,
bool, "is_write", 1,
bool, "is_be", 1,
bool, "is_cram", 1,
bool, "is_bgzf", 1,
uint, "padding27", 27 ));
long lineno;
kstring_t line;
char *fn;
char *fn_aux;
union fp {
BGZF *bgzf;
cram_fd *cram;
hFILE *hfile;
};
htsFormat format;
};
/+
// A combined thread pool and queue allocation size.
// The pool should already be defined, but qsize may be zero to
// indicate an appropriate queue size is taken from the pool.
//
// Reasons for explicitly setting it could be where many more file
// descriptors are in use than threads, so keeping memory low is
// important.
typedef struct {
struct hts_tpool *pool; // The shared thread pool itself
int qsize; // Size of I/O queue to use for this fp
} htsThreadPool;
+/
// REQUIRED_FIELDS
enum sam_fields {
SAM_QNAME = 0x00000001,
SAM_FLAG = 0x00000002,
SAM_RNAME = 0x00000004,
SAM_POS = 0x00000008,
SAM_MAPQ = 0x00000010,
SAM_CIGAR = 0x00000020,
SAM_RNEXT = 0x00000040,
SAM_PNEXT = 0x00000080,
SAM_TLEN = 0x00000100,
SAM_SEQ = 0x00000200,
SAM_QUAL = 0x00000400,
SAM_AUX = 0x00000800,
SAM_RGAUX = 0x00001000,
};
// Mostly CRAM only, but this could also include other format options
enum hts_fmt_option {
// CRAM specific
CRAM_OPT_DECODE_MD,
CRAM_OPT_PREFIX,
CRAM_OPT_VERBOSITY, // obsolete, use hts_set_log_level() instead
CRAM_OPT_SEQS_PER_SLICE,
CRAM_OPT_SLICES_PER_CONTAINER,
CRAM_OPT_RANGE,
CRAM_OPT_VERSION, // rename to cram_version?
CRAM_OPT_EMBED_REF,
CRAM_OPT_IGNORE_MD5,
CRAM_OPT_REFERENCE, // make general
CRAM_OPT_MULTI_SEQ_PER_SLICE,
CRAM_OPT_NO_REF,
CRAM_OPT_USE_BZIP2,
CRAM_OPT_SHARED_REF,
CRAM_OPT_NTHREADS, // deprecated, use HTS_OPT_NTHREADS
CRAM_OPT_THREAD_POOL,// make general
CRAM_OPT_USE_LZMA,
CRAM_OPT_USE_RANS,
CRAM_OPT_REQUIRED_FIELDS,
CRAM_OPT_LOSSY_NAMES,
CRAM_OPT_BASES_PER_SLICE,
// General purpose
HTS_OPT_COMPRESSION_LEVEL = 100,
HTS_OPT_NTHREADS,
HTS_OPT_THREAD_POOL,
HTS_OPT_CACHE_SIZE,
HTS_OPT_BLOCK_SIZE,
};
// For backwards compatibility
alias cram_option = hts_fmt_option;
struct hts_opt {
char *arg; // string form, strdup()ed
hts_fmt_option opt; // tokenised key
union val { // ... and value
int i;
char *s;
};
hts_opt *next;
};
//#define HTS_FILE_OPTS_INIT {{0},0}
// Not apparently used in htslib-1.7
/**********************
* Exported functions *
**********************/
/*
* Parses arg and appends it to the option list.
*
* Returns 0 on success;
* -1 on failure.
*/
int hts_opt_add(hts_opt **opts, const char *c_arg);
/*
* Applies an hts_opt option list to a given htsFile.
*
* Returns 0 on success
* -1 on failure
*/
int hts_opt_apply(htsFile *fp, hts_opt *opts);
/*
* Frees an hts_opt list.
*/
void hts_opt_free(hts_opt *opts);
/*
* Accepts a string file format (sam, bam, cram, vcf, bam) optionally
* followed by a comma separated list of key=value options and splits
* these up into the fields of htsFormat struct.
*
* Returns 0 on success
* -1 on failure.
*/
int hts_parse_format(htsFormat *opt, const char *str);
/*
* Tokenise options as (key(=value)?,)*(key(=value)?)?
* NB: No provision for ',' appearing in the value!
* Add backslashing rules?
*
* This could be used as part of a general command line option parser or
* as a string concatenated onto the file open mode.
*
* Returns 0 on success
* -1 on failure.
*/
int hts_parse_opt_list(htsFormat *opt, const char *str);
/*! @abstract Table for converting a nucleotide character to 4-bit encoding.
The input character may be either an IUPAC ambiguity code, '=' for 0, or
'0'/'1'/'2'/'3' for a result of 1/2/4/8. The result is encoded as 1/2/4/8
for A/C/G/T or combinations of these bits for ambiguous bases.
*/
extern const char seq_nt16_table[256];
/*! @abstract Table for converting a 4-bit encoded nucleotide to an IUPAC
ambiguity code letter (or '=' when given 0).
*/
extern const char seq_nt16_str[];
/*! @abstract Table for converting a 4-bit encoded nucleotide to about 2 bits.
Returns 0/1/2/3 for 1/2/4/8 (i.e., A/C/G/T), or 4 otherwise (0 or ambiguous).
*/
extern const int seq_nt16_int[];
/*!
@abstract Get the htslib version number
@return For released versions, a string like "N.N[.N]"; or git describe
output if using a library built within a Git repository.
*/
const(char *) hts_version();
/*!
@abstract Determine format by peeking at the start of a file
@param fp File opened for reading, positioned at the beginning
@param fmt Format structure that will be filled out on return
@return 0 for success, or negative if an error occurred.
*/
int hts_detect_format(hFILE *fp, htsFormat *fmt);
/*!
@abstract Get a human-readable description of the file format
@param fmt Format structure holding type, version, compression, etc.
@return Description string, to be freed by the caller after use.
*/
char *hts_format_description(const htsFormat *format);
/*!
@abstract Open a SAM/BAM/CRAM/VCF/BCF/etc file
@param fn The file name or "-" for stdin/stdout
@param mode Mode matching / [rwa][bceguxz0-9]* /
@discussion
With 'r' opens for reading; any further format mode letters are ignored
as the format is detected by checking the first few bytes or BGZF blocks
of the file. With 'w' or 'a' opens for writing or appending, with format
specifier letters:
b binary format (BAM, BCF, etc) rather than text (SAM, VCF, etc)
c CRAM format
g gzip compressed
u uncompressed
z bgzf compressed
[0-9] zlib compression level
and with non-format option letters (for any of 'r'/'w'/'a'):
e close the file on exec(2) (opens with O_CLOEXEC, where supported)
x create the file exclusively (opens with O_EXCL, where supported)
Note that there is a distinction between 'u' and '0': the first yields
plain uncompressed output whereas the latter outputs uncompressed data
wrapped in the zlib format.
@example
[rw]b .. compressed BCF, BAM, FAI
[rw]bu .. uncompressed BCF
[rw]z .. compressed VCF
[rw] .. uncompressed VCF
*/
htsFile *hts_open(const char *fn, const char *mode);
/*!
@abstract Open a SAM/BAM/CRAM/VCF/BCF/etc file
@param fn The file name or "-" for stdin/stdout
@param mode Open mode, as per hts_open()
@param fmt Optional format specific parameters
@discussion
See hts_open() for description of fn and mode.
// TODO Update documentation for s/opts/fmt/
Opts contains a format string (sam, bam, cram, vcf, bcf) which will,
if defined, override mode. Opts also contains a linked list of hts_opt
structures to apply to the open file handle. These can contain things
like pointers to the reference or information on compression levels,
block sizes, etc.
*/
htsFile *hts_open_format(const char *fn, const char *mode, const htsFormat *fmt);
/*!
@abstract Open an existing stream as a SAM/BAM/CRAM/VCF/BCF/etc file
@param fn The already-open file handle
@param mode Open mode, as per hts_open()
*/
htsFile *hts_hopen(hFILE *fp, const char *fn, const char *mode);
/*!
@abstract Close a file handle, flushing buffered data for output streams
@param fp The file handle to be closed
@return 0 for success, or negative if an error occurred.
*/
int hts_close(htsFile *fp);
/*!
@abstract Returns the file's format information
@param fp The file handle
@return Read-only pointer to the file's htsFormat.
*/
const(htsFormat *) hts_get_format(htsFile *fp);
/*!
@ abstract Returns a string containing the file format extension.
@ param format Format structure containing the file type.
@ return A string ("sam", "bam", etc) or "?" for unknown formats.
*/
const(char *) hts_format_file_extension(const htsFormat *format);
/*!
@abstract Sets a specified CRAM option on the open file handle.
@param fp The file handle open the open file.
@param opt The CRAM_OPT_* option.
@param ... Optional arguments, dependent on the option used.
@return 0 for success, or negative if an error occurred.
*/
int hts_set_opt(htsFile *fp, hts_fmt_option opt, ...);
int hts_getline(htsFile *fp, int delimiter, kstring_t *str);
char **hts_readlines(const char *fn, int *_n);
/*!
@abstract Parse comma-separated list or read list from a file
@param list File name or comma-separated list
@param is_file
@param _n Size of the output array (number of items read)
@return NULL on failure or pointer to newly allocated array of
strings
*/
char **hts_readlist(const char *fn, int is_file, int *_n);
/+
/*!
@abstract Create extra threads to aid compress/decompression for this file
@param fp The file handle
@param n The number of worker threads to create
@return 0 for success, or negative if an error occurred.
@notes This function creates non-shared threads for use solely by fp.
The hts_set_thread_pool function is the recommended alternative.
*/
int hts_set_threads(htsFile *fp, int n);
/*!
@abstract Create extra threads to aid compress/decompression for this file
@param fp The file handle
@param p A pool of worker threads, previously allocated by hts_create_threads().
@return 0 for success, or negative if an error occurred.
*/
int hts_set_thread_pool(htsFile *fp, htsThreadPool *p);
/*!
@abstract Adds a cache of decompressed blocks, potentially speeding up seeks.
This may not work for all file types (currently it is bgzf only).
@param fp The file handle
@param n The size of cache, in bytes
*/
void hts_set_cache_size(htsFile *fp, int n);
/*!
@abstract Set .fai filename for a file opened for reading
@return 0 for success, negative on failure
@discussion
Called before *_hdr_read(), this provides the name of a .fai file
used to provide a reference list if the htsFile contains no @SQ headers.
*/
int hts_set_fai_filename(htsFile *fp, const char *fn_aux);
/*!
@abstract Determine whether a given htsFile contains a valid EOF block
@return 3 for a non-EOF checkable filetype;
2 for an unseekable file type where EOF cannot be checked;
1 for a valid EOF block;
0 for if the EOF marker is absent when it should be present;
-1 (with errno set) on failure
@discussion
Check if the BGZF end-of-file (EOF) marker is present
*/
int hts_check_EOF(htsFile *fp);
/************
* Indexing *
************/
/*!
These HTS_IDX_* macros are used as special tid values for hts_itr_query()/etc,
producing iterators operating as follows:
- HTS_IDX_NOCOOR iterates over unmapped reads sorted at the end of the file
- HTS_IDX_START iterates over the entire file
- HTS_IDX_REST iterates from the current position to the end of the file
- HTS_IDX_NONE always returns "no more alignment records"
When one of these special tid values is used, beg and end are ignored.
When REST or NONE is used, idx is also ignored and may be NULL.
*/
#define HTS_IDX_NOCOOR (-2)
#define HTS_IDX_START (-3)
#define HTS_IDX_REST (-4)
#define HTS_IDX_NONE (-5)
#define HTS_FMT_CSI 0
#define HTS_FMT_BAI 1
#define HTS_FMT_TBI 2
#define HTS_FMT_CRAI 3
+/
struct __hts_idx_t;
alias __hts_idx_t hts_idx_t;
struct hts_pair32_t {
uint beg, end;
};
struct hts_pair64_t {
ulong u, v;
};
struct hts_pair64_max_t {
ulong u, v;
ulong max;
};
struct hts_reglist_t {
const char *reg;
int tid;
hts_pair32_t *intervals;
uint count;
uint min_beg, max_end;
};
//typedef int hts_readrec_func(BGZF *fp, void *data, void *r, int *tid, int *beg, int *end);
alias hts_readrec_func = int function(BGZF *fp, void *data, void *r, int *tid, int *beg, int *end);
//typedef int hts_seek_func(void *fp, int64_t offset, int where);
alias hts_seek_func = int function(void *fp, ulong offset, int where);
//typedef int64_t hts_tell_func(void *fp);
alias hts_tell_func = long function(void *fp);
struct hts_itr_t {
align(1):
// uint32_t read_rest:1, finished:1, is_cram:1, dummy:29;
mixin(bitfields!(
bool, "read_rest", 1,
bool, "finished", 1,
bool, "is_cram", 1,
uint, "padding29", 29));
int tid, beg, end, n_off, i;
int curr_tid, curr_beg, curr_end;
ulong curr_off;
hts_pair64_t *off;
hts_readrec_func *readrec;
struct bins {
int n, m;
int *a;
};
};
struct aux_key_t {
int key;
ulong min_off, max_off;
};
struct hts_itr_multi_t {
//uint32_t read_rest:1, finished:1, is_cram:1, nocoor:1, dummy:28;
mixin(bitfields!(
bool, "read_rest", 1,
bool, "finished", 1,
bool, "is_cram", 1,
bool, "nocoor", 1,
uint, "padding28",28));
hts_reglist_t *reg_list;
int n_reg, i;
int curr_tid, curr_intv, curr_beg, curr_end, curr_reg;
hts_pair64_max_t *off;
int n_off;
ulong curr_off, nocoor_off;
hts_readrec_func *readrec;
hts_seek_func *seek;
hts_tell_func *tell;
};
/+
#define hts_bin_first(l) (((1<<(((l)<<1) + (l))) - 1) / 7)
#define hts_bin_parent(l) (((l) - 1) >> 3)
hts_idx_t *hts_idx_init(int n, int fmt, uint64_t offset0, int min_shift, int n_lvls);
void hts_idx_destroy(hts_idx_t *idx);
int hts_idx_push(hts_idx_t *idx, int tid, int beg, int end, uint64_t offset, int is_mapped);
void hts_idx_finish(hts_idx_t *idx, uint64_t final_offset);
/// Save an index to a file
/** @param idx Index to be written
@param fn Input BAM/BCF/etc filename, to which .bai/.csi/etc will be added
@param fmt One of the HTS_FMT_* index formats
@return 0 if successful, or negative if an error occurred.
*/
int hts_idx_save(const hts_idx_t *idx, const char *fn, int fmt) HTS_RESULT_USED;
/// Save an index to a specific file
/** @param idx Index to be written
@param fn Input BAM/BCF/etc filename
@param fnidx Output filename, or NULL to add .bai/.csi/etc to @a fn
@param fmt One of the HTS_FMT_* index formats
@return 0 if successful, or negative if an error occurred.
*/
int hts_idx_save_as(const hts_idx_t *idx, const char *fn, const char *fnidx, int fmt) HTS_RESULT_USED;
/// Load an index file
/** @param fn BAM/BCF/etc filename, to which .bai/.csi/etc will be added or
the extension substituted, to search for an existing index file
@param fmt One of the HTS_FMT_* index formats
@return The index, or NULL if an error occurred.
*/
hts_idx_t *hts_idx_load(const char *fn, int fmt);
/// Load a specific index file
/** @param fn Input BAM/BCF/etc filename
@param fnidx The input index filename
@return The index, or NULL if an error occurred.
*/
hts_idx_t *hts_idx_load2(const char *fn, const char *fnidx);
/// Get extra index meta-data
/** @param idx The index
@param l_meta Pointer to where the length of the extra data is stored
@return Pointer to the extra data if present; NULL otherwise
Indexes (both .tbi and .csi) made by tabix include extra data about
the indexed file. The returns a pointer to this data. Note that the
data is stored exactly as it is in the index. Callers need to interpret
the results themselves, including knowing what sort of data to expect;
byte swapping etc.
*/
uint8_t *hts_idx_get_meta(hts_idx_t *idx, uint32_t *l_meta);
/// Set extra index meta-data
/** @param idx The index
@param l_meta Length of data
@param meta Pointer to the extra data
@param is_copy If not zero, a copy of the data is taken
@return 0 on success; -1 on failure (out of memory).
Sets the data that is returned by hts_idx_get_meta().
If is_copy != 0, a copy of the input data is taken. If not, ownership of
the data pointed to by *meta passes to the index.
*/
int hts_idx_set_meta(hts_idx_t *idx, uint32_t l_meta, uint8_t *meta, int is_copy);
int hts_idx_get_stat(const hts_idx_t* idx, int tid, uint64_t* mapped, uint64_t* unmapped);
uint64_t hts_idx_get_n_no_coor(const hts_idx_t* idx);
#define HTS_PARSE_THOUSANDS_SEP 1 ///< Ignore ',' separators within numbers
/// Parse a numeric string
/** The number may be expressed in scientific notation, and optionally may
contain commas in the integer part (before any decimal point or E notation).
@param str String to be parsed
@param strend If non-NULL, set on return to point to the first character
in @a str after those forming the parsed number
@param flags Or'ed-together combination of HTS_PARSE_* flags
@return Converted value of the parsed number.
When @a strend is NULL, a warning will be printed (if hts_verbose is HTS_LOG_WARNING
or more) if there are any trailing characters after the number.
*/
long long hts_parse_decimal(const char *str, char **strend, int flags);
/// Parse a "CHR:START-END"-style region string
/** @param str String to be parsed
@param beg Set on return to the 0-based start of the region
@param end Set on return to the 1-based end of the region
@return Pointer to the colon or '\0' after the reference sequence name,
or NULL if @a str could not be parsed.
*/
const char *hts_parse_reg(const char *str, int *beg, int *end);
hts_itr_t *hts_itr_query(const hts_idx_t *idx, int tid, int beg, int end, hts_readrec_func *readrec);
void hts_itr_destroy(hts_itr_t *iter);
typedef int (*hts_name2id_f)(void*, const char*);
typedef const char *(*hts_id2name_f)(void*, int);
typedef hts_itr_t *hts_itr_query_func(const hts_idx_t *idx, int tid, int beg, int end, hts_readrec_func *readrec);
hts_itr_t *hts_itr_querys(const hts_idx_t *idx, const char *reg, hts_name2id_f getid, void *hdr, hts_itr_query_func *itr_query, hts_readrec_func *readrec);
int hts_itr_next(BGZF *fp, hts_itr_t *iter, void *r, void *data) HTS_RESULT_USED;
const char **hts_idx_seqnames(const hts_idx_t *idx, int *n, hts_id2name_f getid, void *hdr); // free only the array, not the values
/**********************************
* Iterator with multiple regions *
**********************************/
typedef hts_itr_multi_t *hts_itr_multi_query_func(const hts_idx_t *idx, hts_itr_multi_t *itr);
hts_itr_multi_t *hts_itr_multi_bam(const hts_idx_t *idx, hts_itr_multi_t *iter);
hts_itr_multi_t *hts_itr_multi_cram(const hts_idx_t *idx, hts_itr_multi_t *iter);
hts_itr_multi_t *hts_itr_regions(const hts_idx_t *idx, hts_reglist_t *reglist, int count, hts_name2id_f getid, void *hdr, hts_itr_multi_query_func *itr_specific, hts_readrec_func *readrec, hts_seek_func *seek, hts_tell_func *tell);
int hts_itr_multi_next(htsFile *fd, hts_itr_multi_t *iter, void *r);
void hts_reglist_free(hts_reglist_t *reglist, int count);
void hts_itr_multi_destroy(hts_itr_multi_t *iter);
/**
* hts_file_type() - Convenience function to determine file type
* DEPRECATED: This function has been replaced by hts_detect_format().
* It and these FT_* macros will be removed in a future HTSlib release.
*/
#define FT_UNKN 0
#define FT_GZ 1
#define FT_VCF 2
#define FT_VCF_GZ (FT_GZ|FT_VCF)
#define FT_BCF (1<<2)
#define FT_BCF_GZ (FT_GZ|FT_BCF)
#define FT_STDIN (1<<3)
int hts_file_type(const char *fname);
/***************************
* Revised MAQ error model *
***************************/
struct errmod_t;
typedef struct errmod_t errmod_t;
errmod_t *errmod_init(double depcorr);
void errmod_destroy(errmod_t *em);
/*
n: number of bases
m: maximum base
bases[i]: qual:6, strand:1, base:4
q[i*m+j]: phred-scaled likelihood of (i,j)
*/
int errmod_cal(const errmod_t *em, int n, int m, uint16_t *bases, float *q);
/*****************************************
* Probabilistic banded glocal alignment *
*****************************************/
typedef struct probaln_par_t {
float d, e;
int bw;
} probaln_par_t;
int probaln_glocal(const uint8_t *ref, int l_ref, const uint8_t *query, int l_query, const uint8_t *iqual, const probaln_par_t *c, int *state, uint8_t *q);
/**********************
* MD5 implementation *
**********************/
struct hts_md5_context;
typedef struct hts_md5_context hts_md5_context;
/*! @abstract Intialises an MD5 context.
* @discussion
* The expected use is to allocate an hts_md5_context using
* hts_md5_init(). This pointer is then passed into one or more calls
* of hts_md5_update() to compute successive internal portions of the
* MD5 sum, which can then be externalised as a full 16-byte MD5sum
* calculation by calling hts_md5_final(). This can then be turned
* into ASCII via hts_md5_hex().
*
* To dealloate any resources created by hts_md5_init() call the
* hts_md5_destroy() function.
*
* @return hts_md5_context pointer on success, NULL otherwise.
*/
hts_md5_context *hts_md5_init(void);
/*! @abstract Updates the context with the MD5 of the data. */
void hts_md5_update(hts_md5_context *ctx, const void *data, unsigned long size);
/*! @abstract Computes the final 128-bit MD5 hash from the given context */
void hts_md5_final(unsigned char *digest, hts_md5_context *ctx);
/*! @abstract Resets an md5_context to the initial state, as returned
* by hts_md5_init().
*/
void hts_md5_reset(hts_md5_context *ctx);
/*! @abstract Converts a 128-bit MD5 hash into a 33-byte nul-termninated
* hex string.
*/
void hts_md5_hex(char *hex, const unsigned char *digest);
/*! @abstract Deallocates any memory allocated by hts_md5_init. */
void hts_md5_destroy(hts_md5_context *ctx);
static inline int hts_reg2bin(int64_t beg, int64_t end, int min_shift, int n_lvls)
{
int l, s = min_shift, t = ((1<<((n_lvls<<1) + n_lvls)) - 1) / 7;
for (--end, l = n_lvls; l > 0; --l, s += 3, t -= 1<<((l<<1)+l))
if (beg>>s == end>>s) return t + (beg>>s);
return 0;
}
static inline int hts_bin_bot(int bin, int n_lvls)
{
int l, b;
for (l = 0, b = bin; b; ++l, b = hts_bin_parent(b)); // compute the level of bin
return (bin - hts_bin_first(l)) << (n_lvls - l) * 3;
}
/**************
* Endianness *
**************/
static inline int ed_is_big(void)
{
long one= 1;
return !(*((char *)(&one)));
}
static inline uint16_t ed_swap_2(uint16_t v)
{
return (uint16_t)(((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8));
}
static inline void *ed_swap_2p(void *x)
{
*(uint16_t*)x = ed_swap_2(*(uint16_t*)x);
return x;
}
static inline uint32_t ed_swap_4(uint32_t v)
{
v = ((v & 0x0000FFFFU) << 16) | (v >> 16);
return ((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8);
}
static inline void *ed_swap_4p(void *x)
{
*(uint32_t*)x = ed_swap_4(*(uint32_t*)x);
return x;
}
static inline uint64_t ed_swap_8(uint64_t v)
{
v = ((v & 0x00000000FFFFFFFFLLU) << 32) | (v >> 32);
v = ((v & 0x0000FFFF0000FFFFLLU) << 16) | ((v & 0xFFFF0000FFFF0000LLU) >> 16);
return ((v & 0x00FF00FF00FF00FFLLU) << 8) | ((v & 0xFF00FF00FF00FF00LLU) >> 8);
}
static inline void *ed_swap_8p(void *x)
{
*(uint64_t*)x = ed_swap_8(*(uint64_t*)x);
return x;
}
+/
|
D
|
/*
Copyright © 2019 Clipsey & Anego Studios
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder 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 HOLDER 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 components.glviewport;
import bindbc.opengl;
import components.editor;
import config;
import core.time;
import gdk.GLContext : GLContext;
import gtk.ApplicationWindow;
import gtk.EventBox;
import gtk.GLArea;
import gtk.Image;
import gtk.Overlay;
import gtk.ToggleButton;
import math;
import std.stdio;
/// Alias to course MonoTime.
alias FastMonoTime = MonoTimeImpl!(ClockType.coarse);
class EditorViewport : Overlay {
private:
void onResize(int width, int height, GLArea area) {
glViewport(0, 0, width, height);
this.width = width;
this.height = height;
}
protected:
GLArea viewport;
EventBox evbox;
EditorProjSwitch projectionSwitch;
// Node Tree
ToggleButton nodeTreeToggle;
EditorNodeTree nodeTree;
ApplicationWindow window;
ContextualPopover contextPopover;
ToggleButton contextToggle;
public:
ref GLArea getViewport() {
return viewport;
}
/// Width of viewport
int width;
/// Height of viewport.
int height;
this(ApplicationWindow root) {
this.window = root;
evbox = new EventBox();
viewport = new GLArea();
viewport.addOnRealize((widget) {
this.width = widget.getAllocatedWidth();
this.height = widget.getAllocatedHeight();
writefln("Allocated %dx%d of space...", this.width, this.height);
// Enable double buffering, depth buffering and stencil buffering (for good measure.)
viewport.setDoubleBuffered(true);
viewport.setHasDepthBuffer(true);
viewport.setHasStencilBuffer(true);
// Initialize OpenGL context, then run user initialization logic.
viewport.makeCurrent();
initGL();
init();
// This sets up the draw routine to draw repeatedly as fast as GTK allows.
viewport.addTickCallback((widget, fclock) {
widget.queueDraw();
return true;
});
});
evbox.add(viewport);
// Set up events.
root.addOnKeyPress((GdkEventKey* key, widget) => onKeyPressEvent(key));
root.addOnKeyRelease((GdkEventKey* key, widget) => onKeyReleaseEvent(key));
evbox.addOnButtonRelease((GdkEventButton* button, widget) => onButtonReleaseEvent(button));
root.addOnScroll((GdkEventScroll* scroll, widget) => onScrollEvent(scroll));
root.addOnMotionNotify((GdkEventMotion* motion, widget) => onMotionNotifyEvent(motion));
this.add(evbox);
/// Add projection switch overlay (top left corner)
projectionSwitch = new EditorProjSwitch(this);
this.addOverlay(projectionSwitch);
/// Add node tree overlay (top right corner)
nodeTreeToggle = new ToggleButton();
nodeTreeToggle.setHalign(Align.END);
nodeTreeToggle.setValign(Align.START);
nodeTreeToggle.setMarginEnd(8);
nodeTreeToggle.setMarginTop(8);
Image nodeTreeToggleImg = new Image("open-menu-symbolic", IconSize.MENU);
nodeTreeToggle.add(nodeTreeToggleImg);
nodeTreeToggle.getStyleContext().addClass("suggested-action");
nodeTree = new EditorNodeTree(nodeTreeToggle);
nodeTreeToggle.addOnClicked((widget) {
if (nodeTreeToggle.getActive()) {
nodeTree.popup();
return;
}
nodeTree.popdown();
});
this.addOverlay(nodeTreeToggle);
/// Add contextual popover for transformation.
contextPopover = new ContextualPopover(viewport);
evbox.addOnButtonPress((GdkEventButton* button, widget) {
if (button.button == 3) {
if (!contextPopover.docked) {
contextPopover.popUp(Vector2(button.x, button.y));
}
}
onButtonPressEvent(button);
return false;
});
/// Add toggle for the contextual popover to stay constant.
contextToggle = new ToggleButton();
contextToggle.setHalign(Align.END);
contextToggle.setValign(Align.END);
contextToggle.setMarginEnd(8);
contextToggle.setMarginBottom(8);
Image contextToggleImg = new Image("go-up-symbolic", IconSize.MENU);
contextToggle.add(contextToggleImg);
contextToggle.getStyleContext().addClass("suggested-action");
contextToggle.addOnClicked((widget) {
if (contextToggle.getActive()) {
contextPopover.dock(contextToggle);
contextPopover.popUp(Vector2(0, 0));
return;
}
contextPopover.popDown();
});
// Apply the overlay and show it.
this.addOverlay(contextToggle);
this.showAll();
}
/++
Initializes OpenGL.
+/
final void initGL() {
/// Load OpenGL
auto support = loadOpenGL();
if (support < GLSupport.gl32) {
throw new Error("Expected AT LEAST OpenGL 3.2 support!");
}
// Enable multi-sampling
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_MULTISAMPLE);
glDisable(GL_CULL_FACE);
// Resize OpenGL viewport if neccesary
viewport.addOnResize(&onResize);
// Present it
viewport.addOnRender((context, area) {
static FastMonoTime lastTime;
auto now = FastMonoTime.currTime();
if (lastTime is FastMonoTime.init)
lastTime = now;
auto delta = (now - lastTime).total!"hnsecs" / 10_000_000.0;
lastTime = now;
glClearColor(CONFIG.backgroundColor[0], CONFIG.backgroundColor[1], CONFIG.backgroundColor[2], 1f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
update(delta);
return draw(context, area);
});
}
/// Custom initialization logic
abstract void init();
/// Custom update logic
abstract void update(double deltaTime);
/// Custom draw logic
abstract bool draw(GLContext context, GLArea area);
}
/// Unload OpenGL on application quit.
static ~this() {
unloadOpenGL();
}
|
D
|
module dgl.ext.EXT_texture_buffer_object;
import dgl.opengl;
import dgl.glext;
version( D_Version2 ) {
import std.string : containsPattern = count;
import std.conv;
} else {
import tango.text.Util : containsPattern;
import tango.stdc.stringz : fromStringz;
alias char[] string;
}
private ushort extensionId__ = 56;
alias extensionId__ EXT_texture_buffer_object;
import dgl.ext.NV_gpu_program4;
version (DglNoExtSupportAsserts) {
} else {
version = DglExtSupportAsserts;
}
static this() {
if (__extSupportCheckingFuncs.length <= extensionId__) {
__extSupportCheckingFuncs.length = extensionId__ + 1;
}
__extSupportCheckingFuncs[extensionId__] = &__supported;
}
version (all) {
public {
const GLenum GL_TEXTURE_BUFFER_EXT = 0x8C2A;
const GLenum GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B;
const GLenum GL_TEXTURE_BINDING_BUFFER_EXT = 0x8C2C;
const GLenum GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D;
const GLenum GL_TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E;
}
private {
extern (System) {
alias void function (GLenum target, GLenum internalformat, GLuint buffer) fp_glTexBufferEXT;
}
}
public {
void TexBuffer(GL gl_, ParameterTypeTuple!(fp_glTexBufferEXT) params__) {
auto gl = _getGL(gl_);
version (DglExtSupportAsserts) assert (gl.extEnabled.length > extensionId__ && gl.extEnabled[extensionId__] > 0, extNotEnabledError);
auto funcPtr = cast(fp_glTexBufferEXT)(gl.extFuncs[extensionId__][0]);
return checkedCall(gl_, "TexBuffer", funcPtr, params__);
}
}
private final bool __supported(GL gl_) {
auto gl = _getGL(gl_);
if (extensionId__ < cast(int)gl.extFuncs.length && gl.extFuncs[extensionId__] !is null) {
return gl.extFuncs[extensionId__][0] !is null;
}
synchronized (gl) {
if (extensionId__ < cast(int)gl.extFuncs.length && gl.extFuncs[extensionId__] !is null) {
return gl.extFuncs[extensionId__][0] !is null;
}
if (gl.extFuncs.length <= extensionId__) {
gl.extFuncs.length = extensionId__ + 1;
version (DglExtSupportAsserts) {
gl.extEnabled.length = extensionId__ + 1;
}
}
gl.extFuncs[extensionId__] = loadFunctions__(gl_);
return gl.extFuncs[extensionId__][0] !is null;
}
}
private void*[] loadFunctions__(GL gl) {
void*[] funcAddr = new void*[1];
{
char* extP = gl.GetString(GL_EXTENSIONS);
version( D_Version2 ) {
string extStr = extP is null ? null : to!(string)(extP);
} else {
string extStr = extP is null ? null : fromStringz(extP);
}
if (!extStr.containsPattern("GL_EXT_texture_buffer_object")) { funcAddr[0] = null; return funcAddr; }
}
if (null is (funcAddr[0] = getExtensionFuncPtr(cast(char*)"glTexBufferEXT"))) { funcAddr[0] = null; return funcAddr; }
return funcAddr;
}
}
else {
private final bool __supported(GL gl_) {
return false;
}
}
|
D
|
instance BDT_1047_Bandit_L(Npc_Default)
{
name[0] = NAME_Bandit;
guild = GIL_BDT;
id = 1047;
voice = 10;
flags = 0;
npcType = NPCTYPE_AMBIENT;
aivar[AIV_EnemyOverride] = TRUE;
B_SetAttributesToChapter(self,1);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1h_Bau_Mace);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Fatbald",Face_N_Cipher_neu,BodyTex_N,ITAR_Leather_L);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = Rtn_Start_1047;
};
func void Rtn_Start_1047()
{
TA_Sit_Campfire(0,0,12,0,"NW_CASTLEMINE_TOWER_CAMPFIRE_01");
TA_Stand_Eating(12,0,0,0,"NW_CASTLEMINE_TOWER_CAMPFIRE_01");
};
|
D
|
/*******************************************************************************
D language bindings for libsodium's crypto_stream_salsa20.h
License: ISC (see LICENSE.txt)
*******************************************************************************/
module libsodium.crypto_stream_salsa20;
@nogc nothrow:
import libsodium.export_;
extern (C):
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
enum crypto_stream_salsa20_KEYBYTES = 32U;
size_t crypto_stream_salsa20_keybytes ();
enum crypto_stream_salsa20_NONCEBYTES = 8U;
size_t crypto_stream_salsa20_noncebytes ();
enum crypto_stream_salsa20_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX;
size_t crypto_stream_salsa20_messagebytes_max ();
int crypto_stream_salsa20 (
ubyte* c,
ulong clen,
const(ubyte)* n,
const(ubyte)* k);
int crypto_stream_salsa20_xor (
ubyte* c,
const(ubyte)* m,
ulong mlen,
const(ubyte)* n,
const(ubyte)* k);
int crypto_stream_salsa20_xor_ic (
ubyte* c,
const(ubyte)* m,
ulong mlen,
const(ubyte)* n,
ulong ic,
const(ubyte)* k);
void crypto_stream_salsa20_keygen (ref ubyte[crypto_stream_salsa20_KEYBYTES] k);
|
D
|
/Users/shawngong/Centa/.build/debug/TurnstileWeb.build/LoginProviders/Facebook.swift.o : /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/URLSession+Turnstile.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/WebMemoryRealm.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Digits.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Facebook.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Google.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthDelegator.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthEcho.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthParameters.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/AuthorizationCode.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Error.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Token.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /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/Dispatch.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/shawngong/Centa/.build/debug/Turnstile.swiftmodule /Users/shawngong/Centa/.build/debug/TurnstileCrypto.swiftmodule
/Users/shawngong/Centa/.build/debug/TurnstileWeb.build/Facebook~partial.swiftmodule : /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/URLSession+Turnstile.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/WebMemoryRealm.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Digits.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Facebook.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Google.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthDelegator.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthEcho.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthParameters.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/AuthorizationCode.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Error.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Token.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /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/Dispatch.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/shawngong/Centa/.build/debug/Turnstile.swiftmodule /Users/shawngong/Centa/.build/debug/TurnstileCrypto.swiftmodule
/Users/shawngong/Centa/.build/debug/TurnstileWeb.build/Facebook~partial.swiftdoc : /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/URLSession+Turnstile.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/WebMemoryRealm.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Digits.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Facebook.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/LoginProviders/Google.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthDelegator.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthEcho.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth/OAuthParameters.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/AuthorizationCode.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Error.swift /Users/shawngong/Centa/Packages/Turnstile-1.0.5/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Token.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /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/Dispatch.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/shawngong/Centa/.build/debug/Turnstile.swiftmodule /Users/shawngong/Centa/.build/debug/TurnstileCrypto.swiftmodule
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (c) 1999-2017 by Digital Mars, 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/ddmd/declaration.d, _declaration.d)
*/
module ddmd.declaration;
// Online documentation: https://dlang.org/phobos/ddmd_declaration.html
import ddmd.aggregate;
import ddmd.arraytypes;
import ddmd.dclass;
import ddmd.delegatize;
import ddmd.dscope;
import ddmd.dstruct;
import ddmd.dsymbol;
import ddmd.dsymbolsem;
import ddmd.dtemplate;
import ddmd.errors;
import ddmd.expression;
import ddmd.func;
import ddmd.globals;
import ddmd.id;
import ddmd.identifier;
import ddmd.init;
import ddmd.initsem;
import ddmd.intrange;
import ddmd.mtype;
import ddmd.root.outbuffer;
import ddmd.root.rootobject;
import ddmd.semantic;
import ddmd.target;
import ddmd.tokens;
import ddmd.typesem;
import ddmd.visitor;
/************************************
* Check to see the aggregate type is nested and its context pointer is
* accessible from the current scope.
* Returns true if error occurs.
*/
extern (C++) bool checkFrameAccess(Loc loc, Scope* sc, AggregateDeclaration ad, size_t iStart = 0)
{
Dsymbol sparent = ad.toParent2();
Dsymbol s = sc.func;
if (ad.isNested() && s)
{
//printf("ad = %p %s [%s], parent:%p\n", ad, ad.toChars(), ad.loc.toChars(), ad.parent);
//printf("sparent = %p %s [%s], parent: %s\n", sparent, sparent.toChars(), sparent.loc.toChars(), sparent.parent,toChars());
if (!ensureStaticLinkTo(s, sparent))
{
error(loc, "cannot access frame pointer of %s", ad.toPrettyChars());
return true;
}
}
bool result = false;
for (size_t i = iStart; i < ad.fields.dim; i++)
{
VarDeclaration vd = ad.fields[i];
Type tb = vd.type.baseElemOf();
if (tb.ty == Tstruct)
{
result |= checkFrameAccess(loc, sc, (cast(TypeStruct)tb).sym);
}
}
return result;
}
/***********************************************
* Mark variable v as modified if it is inside a constructor that var
* is a field in.
*/
private int modifyFieldVar(Loc loc, Scope* sc, VarDeclaration var, Expression e1)
{
//printf("modifyFieldVar(var = %s)\n", var.toChars());
Dsymbol s = sc.func;
while (1)
{
FuncDeclaration fd = null;
if (s)
fd = s.isFuncDeclaration();
if (fd &&
((fd.isCtorDeclaration() && var.isField()) ||
(fd.isStaticCtorDeclaration() && !var.isField())) &&
fd.toParent2() == var.toParent2() &&
(!e1 || e1.op == TOKthis))
{
bool result = true;
var.ctorinit = true;
//printf("setting ctorinit\n");
if (var.isField() && sc.fieldinit && !sc.intypeof)
{
assert(e1);
auto mustInit = ((var.storage_class & STCnodefaultctor) != 0 ||
var.type.needsNested());
auto dim = sc.fieldinit_dim;
auto ad = fd.isMember2();
assert(ad);
size_t i;
for (i = 0; i < dim; i++) // same as findFieldIndexByName in ctfeexp.c ?
{
if (ad.fields[i] == var)
break;
}
assert(i < dim);
uint fi = sc.fieldinit[i];
if (fi & CSXthis_ctor)
{
if (var.type.isMutable() && e1.type.isMutable())
result = false;
else
{
const(char)* modStr = !var.type.isMutable() ? MODtoChars(var.type.mod) : MODtoChars(e1.type.mod);
.error(loc, "%s field '%s' initialized multiple times", modStr, var.toChars());
}
}
else if (sc.noctor || (fi & CSXlabel))
{
if (!mustInit && var.type.isMutable() && e1.type.isMutable())
result = false;
else
{
const(char)* modStr = !var.type.isMutable() ? MODtoChars(var.type.mod) : MODtoChars(e1.type.mod);
.error(loc, "%s field '%s' initialization is not allowed in loops or after labels", modStr, var.toChars());
}
}
sc.fieldinit[i] |= CSXthis_ctor;
if (var.overlapped) // https://issues.dlang.org/show_bug.cgi?id=15258
{
foreach (j, v; ad.fields)
{
if (v is var || !var.isOverlappedWith(v))
continue;
v.ctorinit = true;
sc.fieldinit[j] = CSXthis_ctor;
}
}
}
else if (fd != sc.func)
{
if (var.type.isMutable())
result = false;
else if (sc.func.fes)
{
const(char)* p = var.isField() ? "field" : var.kind();
.error(loc, "%s %s '%s' initialization is not allowed in foreach loop",
MODtoChars(var.type.mod), p, var.toChars());
}
else
{
const(char)* p = var.isField() ? "field" : var.kind();
.error(loc, "%s %s '%s' initialization is not allowed in nested function '%s'",
MODtoChars(var.type.mod), p, var.toChars(), sc.func.toChars());
}
}
return result;
}
else
{
if (s)
{
s = s.toParent2();
continue;
}
}
break;
}
return false;
}
/******************************************
*/
extern (C++) void ObjectNotFound(Identifier id)
{
Type.error(Loc(), "%s not found. object.d may be incorrectly installed or corrupt.", id.toChars());
fatal();
}
enum STCundefined = 0L;
enum STCstatic = (1L << 0);
enum STCextern = (1L << 1);
enum STCconst = (1L << 2);
enum STCfinal = (1L << 3);
enum STCabstract = (1L << 4);
enum STCparameter = (1L << 5);
enum STCfield = (1L << 6);
enum STCoverride = (1L << 7);
enum STCauto = (1L << 8);
enum STCsynchronized = (1L << 9);
enum STCdeprecated = (1L << 10);
enum STCin = (1L << 11); // in parameter
enum STCout = (1L << 12); // out parameter
enum STClazy = (1L << 13); // lazy parameter
enum STCforeach = (1L << 14); // variable for foreach loop
// (1L << 15)
enum STCvariadic = (1L << 16); // the 'variadic' parameter in: T foo(T a, U b, V variadic...)
enum STCctorinit = (1L << 17); // can only be set inside constructor
enum STCtemplateparameter = (1L << 18); // template parameter
enum STCscope = (1L << 19);
enum STCimmutable = (1L << 20);
enum STCref = (1L << 21);
enum STCinit = (1L << 22); // has explicit initializer
enum STCmanifest = (1L << 23); // manifest constant
enum STCnodtor = (1L << 24); // don't run destructor
enum STCnothrow = (1L << 25); // never throws exceptions
enum STCpure = (1L << 26); // pure function
enum STCtls = (1L << 27); // thread local
enum STCalias = (1L << 28); // alias parameter
enum STCshared = (1L << 29); // accessible from multiple threads
enum STCgshared = (1L << 30); // accessible from multiple threads, but not typed as "shared"
enum STCwild = (1L << 31); // for "wild" type constructor
enum STCproperty = (1L << 32);
enum STCsafe = (1L << 33);
enum STCtrusted = (1L << 34);
enum STCsystem = (1L << 35);
enum STCctfe = (1L << 36); // can be used in CTFE, even if it is static
enum STCdisable = (1L << 37); // for functions that are not callable
enum STCresult = (1L << 38); // for result variables passed to out contracts
enum STCnodefaultctor = (1L << 39); // must be set inside constructor
enum STCtemp = (1L << 40); // temporary variable
enum STCrvalue = (1L << 41); // force rvalue for variables
enum STCnogc = (1L << 42); // @nogc
enum STCvolatile = (1L << 43); // destined for volatile in the back end
enum STCreturn = (1L << 44); // 'return ref' or 'return scope' for function parameters
enum STCautoref = (1L << 45); // Mark for the already deduced 'auto ref' parameter
enum STCinference = (1L << 46); // do attribute inference
enum STCexptemp = (1L << 47); // temporary variable that has lifetime restricted to an expression
enum STCmaybescope = (1L << 48); // parameter might be 'scope'
enum STCscopeinferred = (1L << 49); // 'scope' has been inferred and should not be part of mangling
enum STCfuture = (1L << 50); // introducing new base class function
enum STClocal = (1L << 51); // do not forward (see ddmd.dsymbol.ForwardingScopeDsymbol).
enum STC_TYPECTOR = (STCconst | STCimmutable | STCshared | STCwild);
enum STC_FUNCATTR = (STCref | STCnothrow | STCnogc | STCpure | STCproperty | STCsafe | STCtrusted | STCsystem);
extern (C++) __gshared const(StorageClass) STCStorageClass =
(STCauto | STCscope | STCstatic | STCextern | STCconst | STCfinal | STCabstract | STCsynchronized |
STCdeprecated | STCfuture | STCoverride | STClazy | STCalias | STCout | STCin | STCmanifest |
STCimmutable | STCshared | STCwild | STCnothrow | STCnogc | STCpure | STCref | STCreturn | STCtls | STCgshared |
STCproperty | STCsafe | STCtrusted | STCsystem | STCdisable | STClocal);
struct Match
{
int count; // number of matches found
MATCH last; // match level of lastf
FuncDeclaration lastf; // last matching function we found
FuncDeclaration nextf; // current matching function
FuncDeclaration anyf; // pick a func, any func, to use for error recovery
}
/***********************************************************
*/
extern (C++) abstract class Declaration : Dsymbol
{
Type type;
Type originalType; // before semantic analysis
StorageClass storage_class;
Prot protection;
LINK linkage;
int inuse; // used to detect cycles
// overridden symbol with pragma(mangle, "...")
const(char)* mangleOverride;
final extern (D) this(Identifier id)
{
super(id);
storage_class = STCundefined;
protection = Prot(PROTundefined);
linkage = LINKdefault;
}
override const(char)* kind() const
{
return "declaration";
}
override final d_uns64 size(Loc loc)
{
assert(type);
return type.size();
}
/*************************************
* Check to see if declaration can be modified in this context (sc).
* Issue error if not.
*/
final int checkModify(Loc loc, Scope* sc, Type t, Expression e1, int flag)
{
VarDeclaration v = isVarDeclaration();
if (v && v.canassign)
return 2;
if (isParameter() || isResult())
{
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx.func == parent && (scx.flags & SCOPEcontract))
{
const(char)* s = isParameter() && parent.ident != Id.ensure ? "parameter" : "result";
if (!flag)
error(loc, "cannot modify %s '%s' in contract", s, toChars());
return 2; // do not report type related errors
}
}
}
if (v && (isCtorinit() || isField()))
{
// It's only modifiable if inside the right constructor
if ((storage_class & (STCforeach | STCref)) == (STCforeach | STCref))
return 2;
return modifyFieldVar(loc, sc, v, e1) ? 2 : 1;
}
return 1;
}
override final Dsymbol search(Loc loc, Identifier ident, int flags = SearchLocalsOnly)
{
Dsymbol s = Dsymbol.search(loc, ident, flags);
if (!s && type)
{
s = type.toDsymbol(_scope);
if (s)
s = s.search(loc, ident, flags);
}
return s;
}
final bool isStatic()
{
return (storage_class & STCstatic) != 0;
}
bool isDelete()
{
return false;
}
bool isDataseg()
{
return false;
}
bool isThreadlocal()
{
return false;
}
bool isCodeseg()
{
return false;
}
final bool isCtorinit()
{
return (storage_class & STCctorinit) != 0;
}
final bool isFinal()
{
return (storage_class & STCfinal) != 0;
}
bool isAbstract()
{
return (storage_class & STCabstract) != 0;
}
final bool isConst()
{
return (storage_class & STCconst) != 0;
}
final bool isImmutable()
{
return (storage_class & STCimmutable) != 0;
}
final bool isWild()
{
return (storage_class & STCwild) != 0;
}
final bool isAuto()
{
return (storage_class & STCauto) != 0;
}
final bool isScope()
{
return (storage_class & STCscope) != 0;
}
final bool isSynchronized()
{
return (storage_class & STCsynchronized) != 0;
}
final bool isParameter()
{
return (storage_class & STCparameter) != 0;
}
override final bool isDeprecated()
{
return (storage_class & STCdeprecated) != 0;
}
final bool isOverride()
{
return (storage_class & STCoverride) != 0;
}
final bool isResult()
{
return (storage_class & STCresult) != 0;
}
final bool isField()
{
return (storage_class & STCfield) != 0;
}
final bool isIn()
{
return (storage_class & STCin) != 0;
}
final bool isOut()
{
return (storage_class & STCout) != 0;
}
final bool isRef()
{
return (storage_class & STCref) != 0;
}
final bool isFuture()
{
return (storage_class & STCfuture) != 0;
}
override final Prot prot()
{
return protection;
}
override final inout(Declaration) isDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TupleDeclaration : Declaration
{
Objects* objects;
bool isexp; // true: expression tuple
TypeTuple tupletype; // !=null if this is a type tuple
extern (D) this(Loc loc, Identifier id, Objects* objects)
{
super(id);
this.loc = loc;
this.objects = objects;
}
override Dsymbol syntaxCopy(Dsymbol s)
{
assert(0);
}
override const(char)* kind() const
{
return "tuple";
}
override Type getType()
{
/* If this tuple represents a type, return that type
*/
//printf("TupleDeclaration::getType() %s\n", toChars());
if (isexp)
return null;
if (!tupletype)
{
/* It's only a type tuple if all the Object's are types
*/
for (size_t i = 0; i < objects.dim; i++)
{
RootObject o = (*objects)[i];
if (o.dyncast() != DYNCAST.type)
{
//printf("\tnot[%d], %p, %d\n", i, o, o.dyncast());
return null;
}
}
/* We know it's a type tuple, so build the TypeTuple
*/
Types* types = cast(Types*)objects;
auto args = new Parameters();
args.setDim(objects.dim);
OutBuffer buf;
int hasdeco = 1;
for (size_t i = 0; i < types.dim; i++)
{
Type t = (*types)[i];
//printf("type = %s\n", t.toChars());
version (none)
{
buf.printf("_%s_%d", ident.toChars(), i);
const len = buf.offset;
const name = cast(const(char)*)buf.extractData();
auto id = Identifier.idPool(name, len);
auto arg = new Parameter(STCin, t, id, null);
}
else
{
auto arg = new Parameter(0, t, null, null);
}
(*args)[i] = arg;
if (!t.deco)
hasdeco = 0;
}
tupletype = new TypeTuple(args);
if (hasdeco)
return tupletype.typeSemantic(Loc(), null);
}
return tupletype;
}
override Dsymbol toAlias2()
{
//printf("TupleDeclaration::toAlias2() '%s' objects = %s\n", toChars(), objects.toChars());
for (size_t i = 0; i < objects.dim; i++)
{
RootObject o = (*objects)[i];
if (Dsymbol s = isDsymbol(o))
{
s = s.toAlias2();
(*objects)[i] = s;
}
}
return this;
}
override bool needThis()
{
//printf("TupleDeclaration::needThis(%s)\n", toChars());
for (size_t i = 0; i < objects.dim; i++)
{
RootObject o = (*objects)[i];
if (o.dyncast() == DYNCAST.expression)
{
Expression e = cast(Expression)o;
if (e.op == TOKdsymbol)
{
DsymbolExp ve = cast(DsymbolExp)e;
Declaration d = ve.s.isDeclaration();
if (d && d.needThis())
{
return true;
}
}
}
}
return false;
}
override inout(TupleDeclaration) isTupleDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class AliasDeclaration : Declaration
{
Dsymbol aliassym;
Dsymbol overnext; // next in overload list
Dsymbol _import; // !=null if unresolved internal alias for selective import
extern (D) this(Loc loc, Identifier id, Type type)
{
super(id);
//printf("AliasDeclaration(id = '%s', type = %p)\n", id.toChars(), type);
//printf("type = '%s'\n", type.toChars());
this.loc = loc;
this.type = type;
assert(type);
}
extern (D) this(Loc loc, Identifier id, Dsymbol s)
{
super(id);
//printf("AliasDeclaration(id = '%s', s = %p)\n", id.toChars(), s);
assert(s != this);
this.loc = loc;
this.aliassym = s;
assert(s);
}
static AliasDeclaration create(Loc loc, Identifier id, Type type)
{
return new AliasDeclaration(loc, id, type);
}
override Dsymbol syntaxCopy(Dsymbol s)
{
//printf("AliasDeclaration::syntaxCopy()\n");
assert(!s);
AliasDeclaration sa = type ? new AliasDeclaration(loc, ident, type.syntaxCopy()) : new AliasDeclaration(loc, ident, aliassym.syntaxCopy(null));
sa.storage_class = storage_class;
return sa;
}
override bool overloadInsert(Dsymbol s)
{
//printf("[%s] AliasDeclaration::overloadInsert('%s') s = %s %s @ [%s]\n",
// loc.toChars(), toChars(), s.kind(), s.toChars(), s.loc.toChars());
/** Aliases aren't overloadable themselves, but if their Aliasee is
* overloadable they are converted to an overloadable Alias (either
* FuncAliasDeclaration or OverDeclaration).
*
* This is done by moving the Aliasee into such an overloadable alias
* which is then used to replace the existing Aliasee. The original
* Alias (_this_) remains a useless shell.
*
* This is a horrible mess. It was probably done to avoid replacing
* existing AST nodes and references, but it needs a major
* simplification b/c it's too complex to maintain.
*
* A simpler approach might be to merge any colliding symbols into a
* simple Overload class (an array) and then later have that resolve
* all collisions.
*/
if (semanticRun >= PASSsemanticdone)
{
/* Semantic analysis is already finished, and the aliased entity
* is not overloadable.
*/
if (type)
return false;
/* When s is added in member scope by static if, mixin("code") or others,
* aliassym is determined already. See the case in: test/compilable/test61.d
*/
auto sa = aliassym.toAlias();
if (auto fd = sa.isFuncDeclaration())
{
auto fa = new FuncAliasDeclaration(ident, fd);
fa.protection = protection;
fa.parent = parent;
aliassym = fa;
return aliassym.overloadInsert(s);
}
if (auto td = sa.isTemplateDeclaration())
{
auto od = new OverDeclaration(ident, td);
od.protection = protection;
od.parent = parent;
aliassym = od;
return aliassym.overloadInsert(s);
}
if (auto od = sa.isOverDeclaration())
{
if (sa.ident != ident || sa.parent != parent)
{
od = new OverDeclaration(ident, od);
od.protection = protection;
od.parent = parent;
aliassym = od;
}
return od.overloadInsert(s);
}
if (auto os = sa.isOverloadSet())
{
if (sa.ident != ident || sa.parent != parent)
{
os = new OverloadSet(ident, os);
// TODO: protection is lost here b/c OverloadSets have no protection attribute
// Might no be a practical issue, b/c the code below fails to resolve the overload anyhow.
// ----
// module os1;
// import a, b;
// private alias merged = foo; // private alias to overload set of a.foo and b.foo
// ----
// module os2;
// import a, b;
// public alias merged = bar; // public alias to overload set of a.bar and b.bar
// ----
// module bug;
// import os1, os2;
// void test() { merged(123); } // should only look at os2.merged
//
// os.protection = protection;
os.parent = parent;
aliassym = os;
}
os.push(s);
return true;
}
return false;
}
/* Don't know yet what the aliased symbol is, so assume it can
* be overloaded and check later for correctness.
*/
if (overnext)
return overnext.overloadInsert(s);
if (s is this)
return true;
overnext = s;
return true;
}
override const(char)* kind() const
{
return "alias";
}
override Type getType()
{
if (type)
return type;
return toAlias().getType();
}
override Dsymbol toAlias()
{
//printf("[%s] AliasDeclaration::toAlias('%s', this = %p, aliassym = %p, kind = '%s', inuse = %d)\n",
// loc.toChars(), toChars(), this, aliassym, aliassym ? aliassym.kind() : "", inuse);
assert(this != aliassym);
//static int count; if (++count == 10) *(char*)0=0;
if (inuse == 1 && type && _scope)
{
inuse = 2;
uint olderrors = global.errors;
Dsymbol s = type.toDsymbol(_scope);
//printf("[%s] type = %s, s = %p, this = %p\n", loc.toChars(), type.toChars(), s, this);
if (global.errors != olderrors)
goto Lerr;
if (s)
{
s = s.toAlias();
if (global.errors != olderrors)
goto Lerr;
aliassym = s;
inuse = 0;
}
else
{
Type t = type.typeSemantic(loc, _scope);
if (t.ty == Terror)
goto Lerr;
if (global.errors != olderrors)
goto Lerr;
//printf("t = %s\n", t.toChars());
inuse = 0;
}
}
if (inuse)
{
error("recursive alias declaration");
Lerr:
// Avoid breaking "recursive alias" state during errors gagged
if (global.gag)
return this;
aliassym = new AliasDeclaration(loc, ident, Type.terror);
type = Type.terror;
return aliassym;
}
if (semanticRun >= PASSsemanticdone)
{
// semantic is already done.
// Do not see aliassym !is null, because of lambda aliases.
// Do not see type.deco !is null, even so "alias T = const int;` needs
// semantic analysis to take the storage class `const` as type qualifier.
}
else
{
if (_import && _import._scope)
{
/* If this is an internal alias for selective/renamed import,
* load the module first.
*/
_import.dsymbolSemantic(null);
}
if (_scope)
{
aliasSemantic(this, _scope);
}
}
inuse = 1;
Dsymbol s = aliassym ? aliassym.toAlias() : this;
inuse = 0;
return s;
}
override Dsymbol toAlias2()
{
if (inuse)
{
error("recursive alias declaration");
return this;
}
inuse = 1;
Dsymbol s = aliassym ? aliassym.toAlias2() : this;
inuse = 0;
return s;
}
override bool isOverloadable()
{
// assume overloadable until alias is resolved
return semanticRun < PASSsemanticdone ||
aliassym && aliassym.isOverloadable();
}
override inout(AliasDeclaration) isAliasDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class OverDeclaration : Declaration
{
Dsymbol overnext; // next in overload list
Dsymbol aliassym;
bool hasOverloads;
extern (D) this(Identifier ident, Dsymbol s, bool hasOverloads = true)
{
super(ident);
this.aliassym = s;
this.hasOverloads = hasOverloads;
if (hasOverloads)
{
if (OverDeclaration od = aliassym.isOverDeclaration())
this.hasOverloads = od.hasOverloads;
}
else
{
// for internal use
assert(!aliassym.isOverDeclaration());
}
}
override const(char)* kind() const
{
return "overload alias"; // todo
}
override bool equals(RootObject o)
{
if (this == o)
return true;
Dsymbol s = isDsymbol(o);
if (!s)
return false;
OverDeclaration od1 = this;
if (OverDeclaration od2 = s.isOverDeclaration())
{
return od1.aliassym.equals(od2.aliassym) && od1.hasOverloads == od2.hasOverloads;
}
if (aliassym == s)
{
if (hasOverloads)
return true;
if (FuncDeclaration fd = s.isFuncDeclaration())
{
return fd.isUnique() !is null;
}
if (TemplateDeclaration td = s.isTemplateDeclaration())
{
return td.overnext is null;
}
}
return false;
}
override bool overloadInsert(Dsymbol s)
{
//printf("OverDeclaration::overloadInsert('%s') aliassym = %p, overnext = %p\n", s.toChars(), aliassym, overnext);
if (overnext)
return overnext.overloadInsert(s);
if (s == this)
return true;
overnext = s;
return true;
}
override bool isOverloadable()
{
return true;
}
Dsymbol isUnique()
{
if (!hasOverloads)
{
if (aliassym.isFuncDeclaration() ||
aliassym.isTemplateDeclaration())
{
return aliassym;
}
}
Dsymbol result = null;
overloadApply(aliassym, (Dsymbol s)
{
if (result)
{
result = null;
return 1; // ambiguous, done
}
else
{
result = s;
return 0;
}
});
return result;
}
override inout(OverDeclaration) isOverDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) class VarDeclaration : Declaration
{
Initializer _init;
uint offset;
uint sequenceNumber; // order the variables are declared
__gshared uint nextSequenceNumber; // the counter for sequenceNumber
FuncDeclarations nestedrefs; // referenced by these lexically nested functions
bool isargptr; // if parameter that _argptr points to
structalign_t alignment;
bool ctorinit; // it has been initialized in a ctor
// Both these mean the var is not rebindable once assigned,
// and the destructor gets run when it goes out of scope
bool onstack; // it is a class that was allocated on the stack
bool mynew; // it is a class new'd with custom operator new
int canassign; // it can be assigned to
bool overlapped; // if it is a field and has overlapping
bool overlapUnsafe; // if it is an overlapping field and the overlaps are unsafe
bool doNotInferScope; // do not infer 'scope' for this variable
ubyte isdataseg; // private data for isDataseg 0 unset, 1 true, 2 false
Dsymbol aliassym; // if redone as alias to another symbol
VarDeclaration lastVar; // Linked list of variables for goto-skips-init detection
uint endlinnum; // line number of end of scope that this var lives in
// When interpreting, these point to the value (NULL if value not determinable)
// The index of this variable on the CTFE stack, -1 if not allocated
int ctfeAdrOnStack;
Expression edtor; // if !=null, does the destruction of the variable
IntRange* range; // if !=null, the variable is known to be within the range
final extern (D) this(Loc loc, Type type, Identifier id, Initializer _init, StorageClass storage_class = STCundefined)
{
super(id);
//printf("VarDeclaration('%s')\n", id.toChars());
assert(id);
debug
{
if (!type && !_init)
{
//printf("VarDeclaration('%s')\n", id.toChars());
//*(char*)0=0;
}
}
assert(type || _init);
this.type = type;
this._init = _init;
this.loc = loc;
ctfeAdrOnStack = -1;
this.storage_class = storage_class;
sequenceNumber = ++nextSequenceNumber;
}
override Dsymbol syntaxCopy(Dsymbol s)
{
//printf("VarDeclaration::syntaxCopy(%s)\n", toChars());
assert(!s);
auto v = new VarDeclaration(loc, type ? type.syntaxCopy() : null, ident, _init ? _init.syntaxCopy() : null, storage_class);
return v;
}
override final void setFieldOffset(AggregateDeclaration ad, uint* poffset, bool isunion)
{
//printf("VarDeclaration::setFieldOffset(ad = %s) %s\n", ad.toChars(), toChars());
if (aliassym)
{
// If this variable was really a tuple, set the offsets for the tuple fields
TupleDeclaration v2 = aliassym.isTupleDeclaration();
assert(v2);
for (size_t i = 0; i < v2.objects.dim; i++)
{
RootObject o = (*v2.objects)[i];
assert(o.dyncast() == DYNCAST.expression);
Expression e = cast(Expression)o;
assert(e.op == TOKdsymbol);
DsymbolExp se = cast(DsymbolExp)e;
se.s.setFieldOffset(ad, poffset, isunion);
}
return;
}
if (!isField())
return;
assert(!(storage_class & (STCstatic | STCextern | STCparameter | STCtls)));
//printf("+VarDeclaration::setFieldOffset(ad = %s) %s\n", ad.toChars(), toChars());
/* Fields that are tuples appear both as part of TupleDeclarations and
* as members. That means ignore them if they are already a field.
*/
if (offset)
{
// already a field
*poffset = ad.structsize; // https://issues.dlang.org/show_bug.cgi?id=13613
return;
}
for (size_t i = 0; i < ad.fields.dim; i++)
{
if (ad.fields[i] == this)
{
// already a field
*poffset = ad.structsize; // https://issues.dlang.org/show_bug.cgi?id=13613
return;
}
}
// Check for forward referenced types which will fail the size() call
Type t = type.toBasetype();
if (storage_class & STCref)
{
// References are the size of a pointer
t = Type.tvoidptr;
}
Type tv = t.baseElemOf();
if (tv.ty == Tstruct)
{
auto ts = cast(TypeStruct)tv;
assert(ts.sym != ad); // already checked in ad.determineFields()
if (!ts.sym.determineSize(loc))
{
type = Type.terror;
errors = true;
return;
}
}
// List in ad.fields. Even if the type is error, it's necessary to avoid
// pointless error diagnostic "more initializers than fields" on struct literal.
ad.fields.push(this);
if (t.ty == Terror)
return;
const sz = t.size(loc);
assert(sz != SIZE_INVALID && sz < uint.max);
uint memsize = cast(uint)sz; // size of member
uint memalignsize = Target.fieldalign(t); // size of member for alignment purposes
offset = AggregateDeclaration.placeField(
poffset,
memsize, memalignsize, alignment,
&ad.structsize, &ad.alignsize,
isunion);
//printf("\t%s: memalignsize = %d\n", toChars(), memalignsize);
//printf(" addField '%s' to '%s' at offset %d, size = %d\n", toChars(), ad.toChars(), offset, memsize);
}
override const(char)* kind() const
{
return "variable";
}
override final AggregateDeclaration isThis()
{
AggregateDeclaration ad = null;
if (!(storage_class & (STCstatic | STCextern | STCmanifest | STCtemplateparameter | STCtls | STCgshared | STCctfe)))
{
for (Dsymbol s = this; s; s = s.parent)
{
ad = s.isMember();
if (ad)
break;
if (!s.parent || !s.parent.isTemplateMixin())
break;
}
}
return ad;
}
override final bool needThis()
{
//printf("VarDeclaration::needThis(%s, x%x)\n", toChars(), storage_class);
return isField();
}
override final bool isExport()
{
return protection.kind == PROTexport;
}
override final bool isImportedSymbol()
{
if (protection.kind == PROTexport && !_init && (storage_class & STCstatic || parent.isModule()))
return true;
return false;
}
/*******************************
* Does symbol go into data segment?
* Includes extern variables.
*/
override final bool isDataseg()
{
version (none)
{
printf("VarDeclaration::isDataseg(%p, '%s')\n", this, toChars());
printf("%llx, isModule: %p, isTemplateInstance: %p, isNspace: %p\n",
storage_class & (STCstatic | STCconst), parent.isModule(), parent.isTemplateInstance(), parent.isNspace());
printf("parent = '%s'\n", parent.toChars());
}
if (isdataseg == 0) // the value is not cached
{
isdataseg = 2; // The Variables does not go into the datasegment
if (!canTakeAddressOf())
{
return false;
}
Dsymbol parent = toParent();
if (!parent && !(storage_class & STCstatic))
{
error("forward referenced");
type = Type.terror;
}
else if (storage_class & (STCstatic | STCextern | STCtls | STCgshared) ||
parent.isModule() || parent.isTemplateInstance() || parent.isNspace())
{
isdataseg = 1; // It is in the DataSegment
}
}
return (isdataseg == 1);
}
/************************************
* Does symbol go into thread local storage?
*/
override final bool isThreadlocal()
{
//printf("VarDeclaration::isThreadlocal(%p, '%s')\n", this, toChars());
/* Data defaults to being thread-local. It is not thread-local
* if it is immutable, const or shared.
*/
bool i = isDataseg() && !(storage_class & (STCimmutable | STCconst | STCshared | STCgshared));
//printf("\treturn %d\n", i);
return i;
}
/********************************************
* Can variable be read and written by CTFE?
*/
final bool isCTFE()
{
return (storage_class & STCctfe) != 0; // || !isDataseg();
}
final bool isOverlappedWith(VarDeclaration v)
{
const vsz = v.type.size();
const tsz = type.size();
assert(vsz != SIZE_INVALID && tsz != SIZE_INVALID);
return offset < v.offset + vsz &&
v.offset < offset + tsz;
}
override final bool hasPointers()
{
//printf("VarDeclaration::hasPointers() %s, ty = %d\n", toChars(), type.ty);
return (!isDataseg() && type.hasPointers());
}
/*************************************
* Return true if we can take the address of this variable.
*/
final bool canTakeAddressOf()
{
return !(storage_class & STCmanifest);
}
/******************************************
* Return true if variable needs to call the destructor.
*/
final bool needsScopeDtor()
{
//printf("VarDeclaration::needsScopeDtor() %s\n", toChars());
return edtor && !(storage_class & STCnodtor);
}
/******************************************
* If a variable has a scope destructor call, return call for it.
* Otherwise, return NULL.
*/
final Expression callScopeDtor(Scope* sc)
{
//printf("VarDeclaration::callScopeDtor() %s\n", toChars());
// Destruction of STCfield's is handled by buildDtor()
if (storage_class & (STCnodtor | STCref | STCout | STCfield))
{
return null;
}
Expression e = null;
// Destructors for structs and arrays of structs
Type tv = type.baseElemOf();
if (tv.ty == Tstruct)
{
StructDeclaration sd = (cast(TypeStruct)tv).sym;
if (!sd.dtor || sd.errors)
return null;
const sz = type.size();
assert(sz != SIZE_INVALID);
if (!sz)
return null;
if (type.toBasetype().ty == Tstruct)
{
// v.__xdtor()
e = new VarExp(loc, this);
/* This is a hack so we can call destructors on const/immutable objects.
* Need to add things like "const ~this()" and "immutable ~this()" to
* fix properly.
*/
e.type = e.type.mutableOf();
// Enable calling destructors on shared objects.
// The destructor is always a single, non-overloaded function,
// and must serve both shared and non-shared objects.
e.type = e.type.unSharedOf;
e = new DotVarExp(loc, e, sd.dtor, false);
e = new CallExp(loc, e);
}
else
{
// _ArrayDtor(v[0 .. n])
e = new VarExp(loc, this);
const sdsz = sd.type.size();
assert(sdsz != SIZE_INVALID && sdsz != 0);
const n = sz / sdsz;
e = new SliceExp(loc, e, new IntegerExp(loc, 0, Type.tsize_t), new IntegerExp(loc, n, Type.tsize_t));
// Prevent redundant bounds check
(cast(SliceExp)e).upperIsInBounds = true;
(cast(SliceExp)e).lowerIsLessThanUpper = true;
// This is a hack so we can call destructors on const/immutable objects.
e.type = sd.type.arrayOf();
e = new CallExp(loc, new IdentifierExp(loc, Id._ArrayDtor), e);
}
return e;
}
// Destructors for classes
if (storage_class & (STCauto | STCscope) && !(storage_class & STCparameter))
{
for (ClassDeclaration cd = type.isClassHandle(); cd; cd = cd.baseClass)
{
/* We can do better if there's a way with onstack
* classes to determine if there's no way the monitor
* could be set.
*/
//if (cd.isInterfaceDeclaration())
// error("interface %s cannot be scope", cd.toChars());
// Destroying C++ scope classes crashes currently. Since C++ class dtors are not currently supported, simply do not run dtors for them.
// See https://issues.dlang.org/show_bug.cgi?id=13182
if (cd.cpp)
{
break;
}
if (mynew || onstack) // if any destructors
{
// delete this;
Expression ec;
ec = new VarExp(loc, this);
e = new DeleteExp(loc, ec, true);
e.type = Type.tvoid;
break;
}
}
}
return e;
}
/*******************************************
* If variable has a constant expression initializer, get it.
* Otherwise, return null.
*/
final Expression getConstInitializer(bool needFullType = true)
{
assert(type && _init);
// Ungag errors when not speculative
uint oldgag = global.gag;
if (global.gag)
{
Dsymbol sym = toParent().isAggregateDeclaration();
if (sym && !sym.isSpeculative())
global.gag = 0;
}
if (_scope)
{
inuse++;
_init = _init.initializerSemantic(_scope, type, INITinterpret);
_scope = null;
inuse--;
}
Expression e = _init.initializerToExpression(needFullType ? type : null);
global.gag = oldgag;
return e;
}
/*******************************************
* Helper function for the expansion of manifest constant.
*/
final Expression expandInitializer(Loc loc)
{
assert((storage_class & STCmanifest) && _init);
auto e = getConstInitializer();
if (!e)
{
.error(loc, "cannot make expression out of initializer for %s", toChars());
return new ErrorExp();
}
e = e.copy();
e.loc = loc; // for better error message
return e;
}
override final void checkCtorConstInit()
{
version (none)
{
/* doesn't work if more than one static ctor */
if (ctorinit == 0 && isCtorinit() && !isField())
error("missing initializer in static constructor for const variable");
}
}
/************************************
* Check to see if this variable is actually in an enclosing function
* rather than the current one.
* Returns true if error occurs.
*/
final bool checkNestedReference(Scope* sc, Loc loc)
{
//printf("VarDeclaration::checkNestedReference() %s\n", toChars());
if (sc.intypeof == 1 || (sc.flags & SCOPEctfe))
return false;
if (!parent || parent == sc.parent)
return false;
if (isDataseg() || (storage_class & STCmanifest))
return false;
// The current function
FuncDeclaration fdthis = sc.parent.isFuncDeclaration();
if (!fdthis)
return false; // out of function scope
Dsymbol p = toParent2();
// Function literals from fdthis to p must be delegates
ensureStaticLinkTo(fdthis, p);
// The function that this variable is in
FuncDeclaration fdv = p.isFuncDeclaration();
if (!fdv || fdv == fdthis)
return false;
// Add fdthis to nestedrefs[] if not already there
for (size_t i = 0; 1; i++)
{
if (i == nestedrefs.dim)
{
nestedrefs.push(fdthis);
break;
}
if (nestedrefs[i] == fdthis)
break;
}
/* __require and __ensure will always get called directly,
* so they never make outer functions closure.
*/
if (fdthis.ident == Id.require || fdthis.ident == Id.ensure)
return false;
//printf("\tfdv = %s\n", fdv.toChars());
//printf("\tfdthis = %s\n", fdthis.toChars());
if (loc.filename)
{
int lv = fdthis.getLevel(loc, sc, fdv);
if (lv == -2) // error
return true;
}
// Add this to fdv.closureVars[] if not already there
for (size_t i = 0; 1; i++)
{
if (i == fdv.closureVars.dim)
{
if (!sc.intypeof && !(sc.flags & SCOPEcompile))
fdv.closureVars.push(this);
break;
}
if (fdv.closureVars[i] == this)
break;
}
//printf("fdthis is %s\n", fdthis.toChars());
//printf("var %s in function %s is nested ref\n", toChars(), fdv.toChars());
// __dollar creates problems because it isn't a real variable
// https://issues.dlang.org/show_bug.cgi?id=3326
if (ident == Id.dollar)
{
.error(loc, "cannnot use $ inside a function literal");
return true;
}
if (ident == Id.withSym) // https://issues.dlang.org/show_bug.cgi?id=1759
{
ExpInitializer ez = _init.isExpInitializer();
assert(ez);
Expression e = ez.exp;
if (e.op == TOKconstruct || e.op == TOKblit)
e = (cast(AssignExp)e).e2;
return lambdaCheckForNestedRef(e, sc);
}
return false;
}
override final Dsymbol toAlias()
{
//printf("VarDeclaration::toAlias('%s', this = %p, aliassym = %p)\n", toChars(), this, aliassym);
if ((!type || !type.deco) && _scope)
dsymbolSemantic(this, _scope);
assert(this != aliassym);
Dsymbol s = aliassym ? aliassym.toAlias() : this;
return s;
}
// Eliminate need for dynamic_cast
override final inout(VarDeclaration) isVarDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
/**********************************
* Determine if `this` has a lifetime that lasts past
* the destruction of `v`
* Params:
* v = variable to test against
* Returns:
* true if it does
*/
final bool enclosesLifetimeOf(VarDeclaration v) const pure
{
return sequenceNumber < v.sequenceNumber;
}
}
/***********************************************************
* This is a shell around a back end symbol
*/
extern (C++) final class SymbolDeclaration : Declaration
{
StructDeclaration dsym;
extern (D) this(Loc loc, StructDeclaration dsym)
{
super(dsym.ident);
this.loc = loc;
this.dsym = dsym;
storage_class |= STCconst;
}
// Eliminate need for dynamic_cast
override inout(SymbolDeclaration) isSymbolDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) class TypeInfoDeclaration : VarDeclaration
{
Type tinfo;
final extern (D) this(Type tinfo)
{
super(Loc(), Type.dtypeinfo.type, tinfo.getTypeInfoIdent(), null);
this.tinfo = tinfo;
storage_class = STCstatic | STCgshared;
protection = Prot(PROTpublic);
linkage = LINKc;
alignment = Target.ptrsize;
}
static TypeInfoDeclaration create(Type tinfo)
{
return new TypeInfoDeclaration(tinfo);
}
override final Dsymbol syntaxCopy(Dsymbol s)
{
assert(0); // should never be produced by syntax
}
override final const(char)* toChars()
{
//printf("TypeInfoDeclaration::toChars() tinfo = %s\n", tinfo.toChars());
OutBuffer buf;
buf.writestring("typeid(");
buf.writestring(tinfo.toChars());
buf.writeByte(')');
return buf.extractString();
}
override final inout(TypeInfoDeclaration) isTypeInfoDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoStructDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfostruct)
{
ObjectNotFound(Id.TypeInfo_Struct);
}
type = Type.typeinfostruct.type;
}
static TypeInfoStructDeclaration create(Type tinfo)
{
return new TypeInfoStructDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoClassDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoclass)
{
ObjectNotFound(Id.TypeInfo_Class);
}
type = Type.typeinfoclass.type;
}
static TypeInfoClassDeclaration create(Type tinfo)
{
return new TypeInfoClassDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoInterfaceDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfointerface)
{
ObjectNotFound(Id.TypeInfo_Interface);
}
type = Type.typeinfointerface.type;
}
static TypeInfoInterfaceDeclaration create(Type tinfo)
{
return new TypeInfoInterfaceDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoPointerDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfopointer)
{
ObjectNotFound(Id.TypeInfo_Pointer);
}
type = Type.typeinfopointer.type;
}
static TypeInfoPointerDeclaration create(Type tinfo)
{
return new TypeInfoPointerDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoArrayDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoarray)
{
ObjectNotFound(Id.TypeInfo_Array);
}
type = Type.typeinfoarray.type;
}
static TypeInfoArrayDeclaration create(Type tinfo)
{
return new TypeInfoArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfostaticarray)
{
ObjectNotFound(Id.TypeInfo_StaticArray);
}
type = Type.typeinfostaticarray.type;
}
static TypeInfoStaticArrayDeclaration create(Type tinfo)
{
return new TypeInfoStaticArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoassociativearray)
{
ObjectNotFound(Id.TypeInfo_AssociativeArray);
}
type = Type.typeinfoassociativearray.type;
}
static TypeInfoAssociativeArrayDeclaration create(Type tinfo)
{
return new TypeInfoAssociativeArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoEnumDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoenum)
{
ObjectNotFound(Id.TypeInfo_Enum);
}
type = Type.typeinfoenum.type;
}
static TypeInfoEnumDeclaration create(Type tinfo)
{
return new TypeInfoEnumDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoFunctionDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfofunction)
{
ObjectNotFound(Id.TypeInfo_Function);
}
type = Type.typeinfofunction.type;
}
static TypeInfoFunctionDeclaration create(Type tinfo)
{
return new TypeInfoFunctionDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoDelegateDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfodelegate)
{
ObjectNotFound(Id.TypeInfo_Delegate);
}
type = Type.typeinfodelegate.type;
}
static TypeInfoDelegateDeclaration create(Type tinfo)
{
return new TypeInfoDelegateDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoTupleDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfotypelist)
{
ObjectNotFound(Id.TypeInfo_Tuple);
}
type = Type.typeinfotypelist.type;
}
static TypeInfoTupleDeclaration create(Type tinfo)
{
return new TypeInfoTupleDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoConstDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoconst)
{
ObjectNotFound(Id.TypeInfo_Const);
}
type = Type.typeinfoconst.type;
}
static TypeInfoConstDeclaration create(Type tinfo)
{
return new TypeInfoConstDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoInvariantDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoinvariant)
{
ObjectNotFound(Id.TypeInfo_Invariant);
}
type = Type.typeinfoinvariant.type;
}
static TypeInfoInvariantDeclaration create(Type tinfo)
{
return new TypeInfoInvariantDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoSharedDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoshared)
{
ObjectNotFound(Id.TypeInfo_Shared);
}
type = Type.typeinfoshared.type;
}
static TypeInfoSharedDeclaration create(Type tinfo)
{
return new TypeInfoSharedDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoWildDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfowild)
{
ObjectNotFound(Id.TypeInfo_Wild);
}
type = Type.typeinfowild.type;
}
static TypeInfoWildDeclaration create(Type tinfo)
{
return new TypeInfoWildDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoVectorDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfovector)
{
ObjectNotFound(Id.TypeInfo_Vector);
}
type = Type.typeinfovector.type;
}
static TypeInfoVectorDeclaration create(Type tinfo)
{
return new TypeInfoVectorDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* For the "this" parameter to member functions
*/
extern (C++) final class ThisDeclaration : VarDeclaration
{
extern (D) this(Loc loc, Type t)
{
super(loc, t, Id.This, null);
storage_class |= STCnodtor;
}
override Dsymbol syntaxCopy(Dsymbol s)
{
assert(0); // should never be produced by syntax
}
override inout(ThisDeclaration) isThisDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
|
D
|
/Users/ins/Documents/Code/rust-study/todo-cli/target/rls/debug/deps/serde_json-0e2f921f2afed9f3.rmeta: /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/lib.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/macros.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/de.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/error.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/map.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/ser.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/mod.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/de.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/from.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/index.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/partial_eq.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/ser.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/features_check/mod.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/io/mod.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/iter.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/number.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/read.rs
/Users/ins/Documents/Code/rust-study/todo-cli/target/rls/debug/deps/serde_json-0e2f921f2afed9f3.d: /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/lib.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/macros.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/de.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/error.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/map.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/ser.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/mod.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/de.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/from.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/index.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/partial_eq.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/ser.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/features_check/mod.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/io/mod.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/iter.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/number.rs /Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/read.rs
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/lib.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/macros.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/de.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/error.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/map.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/ser.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/mod.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/de.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/from.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/index.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/partial_eq.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/value/ser.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/features_check/mod.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/io/mod.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/iter.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/number.rs:
/Users/ins/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.64/src/read.rs:
|
D
|
/**
* Provides a visitor for statements that allows rewriting the currently visited node.
*
* 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/statement_rewrite_walker.d, _statement_rewrite_walker.d)
* Documentation: https://dlang.org/phobos/dmd_statement_rewrite_walker.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/statement_rewrite_walker.d
*/
module dmd.statement_rewrite_walker;
import core.stdc.stdio;
import dmd.statement;
import dmd.visitor;
/** A visitor to walk entire statements and provides ability to replace any sub-statements.
*/
extern (C++) class StatementRewriteWalker : SemanticTimePermissiveVisitor
{
alias visit = SemanticTimePermissiveVisitor.visit;
/* Point the currently visited statement.
* By using replaceCurrent() method, you can replace AST during walking.
*/
Statement* ps;
public:
final void visitStmt(ref Statement s)
{
ps = &s;
s.accept(this);
}
final void replaceCurrent(Statement s)
{
*ps = s;
}
override void visit(PeelStatement s)
{
if (s.s)
visitStmt(s.s);
}
override void visit(CompoundStatement s)
{
if (s.statements && s.statements.length)
{
for (size_t i = 0; i < s.statements.length; i++)
{
if ((*s.statements)[i])
visitStmt((*s.statements)[i]);
}
}
}
override void visit(CompoundDeclarationStatement s)
{
visit(cast(CompoundStatement)s);
}
override void visit(UnrolledLoopStatement s)
{
if (s.statements && s.statements.length)
{
for (size_t i = 0; i < s.statements.length; i++)
{
if ((*s.statements)[i])
visitStmt((*s.statements)[i]);
}
}
}
override void visit(ScopeStatement s)
{
if (s.statement)
visitStmt(s.statement);
}
override void visit(WhileStatement s)
{
if (s._body)
visitStmt(s._body);
}
override void visit(DoStatement s)
{
if (s._body)
visitStmt(s._body);
}
override void visit(ForStatement s)
{
if (s._init)
visitStmt(s._init);
if (s._body)
visitStmt(s._body);
}
override void visit(ForeachStatement s)
{
if (s._body)
visitStmt(s._body);
}
override void visit(ForeachRangeStatement s)
{
if (s._body)
visitStmt(s._body);
}
override void visit(IfStatement s)
{
if (s.ifbody)
visitStmt(s.ifbody);
if (s.elsebody)
visitStmt(s.elsebody);
}
override void visit(SwitchStatement s)
{
if (s._body)
visitStmt(s._body);
}
override void visit(CaseStatement s)
{
if (s.statement)
visitStmt(s.statement);
}
override void visit(CaseRangeStatement s)
{
if (s.statement)
visitStmt(s.statement);
}
override void visit(DefaultStatement s)
{
if (s.statement)
visitStmt(s.statement);
}
override void visit(SynchronizedStatement s)
{
if (s._body)
visitStmt(s._body);
}
override void visit(WithStatement s)
{
if (s._body)
visitStmt(s._body);
}
override void visit(TryCatchStatement s)
{
if (s._body)
visitStmt(s._body);
if (s.catches && s.catches.length)
{
for (size_t i = 0; i < s.catches.length; i++)
{
Catch c = (*s.catches)[i];
if (c && c.handler)
visitStmt(c.handler);
}
}
}
override void visit(TryFinallyStatement s)
{
if (s._body)
visitStmt(s._body);
if (s.finalbody)
visitStmt(s.finalbody);
}
override void visit(DebugStatement s)
{
if (s.statement)
visitStmt(s.statement);
}
override void visit(LabelStatement s)
{
if (s.statement)
visitStmt(s.statement);
}
}
|
D
|
// SPDX-License-Identifier: MIT
import std.stdio;
/**
* 这是一段非 ascii 字符
*/
void main()
{
writeln("\"Hello, World//\""); /* hello world */
}
|
D
|
/Users/Arifeen/Documents/WebView/DerivedData/webView/Build/Intermediates.noindex/webView.build/Debug-iphonesimulator/webView.build/Objects-normal/x86_64/ViewController.o : /Users/Arifeen/Documents/WebView/webView/AppDelegate.swift /Users/Arifeen/Documents/WebView/webView/ViewController.swift /Applications/Xcode\ 11.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule
/Users/Arifeen/Documents/WebView/DerivedData/webView/Build/Intermediates.noindex/webView.build/Debug-iphonesimulator/webView.build/Objects-normal/x86_64/ViewController~partial.swiftmodule : /Users/Arifeen/Documents/WebView/webView/AppDelegate.swift /Users/Arifeen/Documents/WebView/webView/ViewController.swift /Applications/Xcode\ 11.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule
/Users/Arifeen/Documents/WebView/DerivedData/webView/Build/Intermediates.noindex/webView.build/Debug-iphonesimulator/webView.build/Objects-normal/x86_64/ViewController~partial.swiftdoc : /Users/Arifeen/Documents/WebView/webView/AppDelegate.swift /Users/Arifeen/Documents/WebView/webView/ViewController.swift /Applications/Xcode\ 11.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule
/Users/Arifeen/Documents/WebView/DerivedData/webView/Build/Intermediates.noindex/webView.build/Debug-iphonesimulator/webView.build/Objects-normal/x86_64/ViewController~partial.swiftsourceinfo : /Users/Arifeen/Documents/WebView/webView/AppDelegate.swift /Users/Arifeen/Documents/WebView/webView/ViewController.swift /Applications/Xcode\ 11.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule
|
D
|
/Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxNavigation.build/Objects-normal/x86_64/Error.o : /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageDownload.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/GenericRouteShield.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/Sequence.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLVectorTileSource.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ErrorCode.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIImage.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Cache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DataCache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageCache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Bundle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Style.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLStyle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DayStyle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleType.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/Date.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/CGSize.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Transitioning.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/String.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NSAttributedString.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionLabel.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackCollectionViewCell.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RatingControl.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackItem.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuverDirection.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/VisualInstruction.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageDownloader.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleManager.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLAccountManager.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleKitMarker.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RouteVoiceController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MapboxVoiceController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/EndOfRouteViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DialogViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RouteMapViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StepsViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionPresenter.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIGestureRecognizer.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Error.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIEdgeInsets.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Constants.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LanesStyleKit.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuversStyleKit.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/VisualInstructionComponent.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/CGPoint.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Waypoint.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIFont.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/BottomBannerViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionsBannerViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LaneView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DashedLineView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UserCourseView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIStackView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UICollectionView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLMapView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationMapView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/BottomBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionsBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NextBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuverView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LanesView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StatusView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ExitView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Dictionary.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageRepository.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Polyline/Polyline.framework/Modules/Polyline.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Turf/Turf.framework/Modules/Turf.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxSpeech/MapboxSpeech.framework/Modules/MapboxSpeech.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxCoreNavigation/MapboxCoreNavigation.framework/Modules/MapboxCoreNavigation.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Solar/Solar.framework/Modules/Solar.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxDirections.swift/MapboxDirections.framework/Modules/MapboxDirections.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/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/AVFoundation.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/CoreAudio.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/MapKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/NSData+MMEGZIP.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Polyline/Polyline-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Turf/Turf-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxSpeech/MapboxSpeech-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxCoreNavigation/MapboxCoreNavigation-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxNavigation/MapboxNavigation-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Solar/Solar-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxMobileEvents/MapboxMobileEvents-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxDirections.swift/MapboxDirections.swift-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapCamera.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMECommonEventData.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsService.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterDEMSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLImageSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLVectorTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShapeSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLComputedShapeSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotationImage.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflineStorage.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/TSKSPKIHashCache.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyle.h /Users/Lorenzo/Desktop/EO18_2/Pods/Polyline/Polyline/Polyline.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPolyline.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShape.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFeature.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapViewDelegate.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidator_Private.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBAttribute.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyleValue.h /Users/Lorenzo/Desktop/EO18_2/Pods/Turf/Sources/Turf/Turf.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKTrustKitConfig.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKLog.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxSpeech/MapboxSpeech/MapboxSpeech.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflinePack.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidatorCallback.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/TSKPublicKeyAlgorithm.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPolygon.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflineRegion.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTilePyramidOfflineRegion.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKTrustDecision.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBLaneIndication.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLUserLocation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFoundation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUINavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MapboxCoreNavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MapboxNavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsConfiguration.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/parse_configuration.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPointAnnotation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShapeCollection.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPointCollection.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCameraChangeReason.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAttributionInfo.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMECategoryLoader.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMELocationManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETimerManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAccountManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEDependencyManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventLogger.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/ssl_pin_verifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUniqueIdentifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/vendor_identifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MBRouteVoiceController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MBRouteController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventLogReportViewController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMENSDateWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMENSURLSessionWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUIApplicationWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETrustKitWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKReportsRateLimiter.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKBackgroundReporter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLDistanceFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCoordinateFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLClockDirectionFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCompassDirectionFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapSnapshotter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOpenGLStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLForegroundStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLBackgroundStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLHillshadeStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCircleStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLLineStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFillStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLSymbolStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFillExtrusionStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLHeatmapStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLVectorStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidator.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETypes.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTypes.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBRoadClasses.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MBNavigationSettings.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/reporting_utils.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/configuration_utils.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MapboxDirections.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapView+IBAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSPredicate+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSValue+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSExpression+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLMapView+MGLNavigationAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBRouteOptions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEConstants.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/CLLocation+MMEMobileEvents.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MapboxMobileEvents.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Polyline/Polyline.framework/Headers/Polyline-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Turf/Turf.framework/Headers/Turf-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxSpeech/MapboxSpeech.framework/Headers/MapboxSpeech-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxCoreNavigation/MapboxCoreNavigation.framework/Headers/MapboxCoreNavigation-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Solar/Solar.framework/Headers/Solar-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxDirections.swift/MapboxDirections.framework/Headers/MapboxDirections-Swift.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLLight.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TrustKit.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidatorResult.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEAPIClient.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEvent.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMultiPoint.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKPinFailureReport.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotationView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLUserLocationAnnotationView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCalloutView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/Mapbox.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOverlay.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLGeometry.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/Reachability/MMEReachability.h /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxNavigation.build/unextended-module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Polyline.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Turf.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxSpeech.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxCoreNavigation.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Solar.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxMobileEvents.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxDirections.swift.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Modules/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/CoreLocation.framework/Headers/CoreLocation.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/AVFoundation.framework/Headers/AVFoundation.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/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
/Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxNavigation.build/Objects-normal/x86_64/Error~partial.swiftmodule : /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageDownload.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/GenericRouteShield.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/Sequence.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLVectorTileSource.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ErrorCode.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIImage.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Cache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DataCache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageCache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Bundle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Style.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLStyle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DayStyle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleType.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/Date.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/CGSize.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Transitioning.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/String.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NSAttributedString.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionLabel.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackCollectionViewCell.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RatingControl.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackItem.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuverDirection.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/VisualInstruction.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageDownloader.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleManager.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLAccountManager.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleKitMarker.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RouteVoiceController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MapboxVoiceController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/EndOfRouteViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DialogViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RouteMapViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StepsViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionPresenter.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIGestureRecognizer.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Error.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIEdgeInsets.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Constants.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LanesStyleKit.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuversStyleKit.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/VisualInstructionComponent.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/CGPoint.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Waypoint.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIFont.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/BottomBannerViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionsBannerViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LaneView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DashedLineView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UserCourseView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIStackView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UICollectionView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLMapView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationMapView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/BottomBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionsBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NextBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuverView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LanesView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StatusView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ExitView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Dictionary.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageRepository.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Polyline/Polyline.framework/Modules/Polyline.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Turf/Turf.framework/Modules/Turf.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxSpeech/MapboxSpeech.framework/Modules/MapboxSpeech.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxCoreNavigation/MapboxCoreNavigation.framework/Modules/MapboxCoreNavigation.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Solar/Solar.framework/Modules/Solar.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxDirections.swift/MapboxDirections.framework/Modules/MapboxDirections.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/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/AVFoundation.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/CoreAudio.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/MapKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/NSData+MMEGZIP.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Polyline/Polyline-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Turf/Turf-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxSpeech/MapboxSpeech-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxCoreNavigation/MapboxCoreNavigation-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxNavigation/MapboxNavigation-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Solar/Solar-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxMobileEvents/MapboxMobileEvents-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxDirections.swift/MapboxDirections.swift-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapCamera.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMECommonEventData.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsService.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterDEMSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLImageSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLVectorTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShapeSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLComputedShapeSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotationImage.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflineStorage.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/TSKSPKIHashCache.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyle.h /Users/Lorenzo/Desktop/EO18_2/Pods/Polyline/Polyline/Polyline.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPolyline.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShape.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFeature.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapViewDelegate.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidator_Private.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBAttribute.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyleValue.h /Users/Lorenzo/Desktop/EO18_2/Pods/Turf/Sources/Turf/Turf.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKTrustKitConfig.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKLog.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxSpeech/MapboxSpeech/MapboxSpeech.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflinePack.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidatorCallback.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/TSKPublicKeyAlgorithm.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPolygon.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflineRegion.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTilePyramidOfflineRegion.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKTrustDecision.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBLaneIndication.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLUserLocation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFoundation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUINavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MapboxCoreNavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MapboxNavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsConfiguration.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/parse_configuration.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPointAnnotation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShapeCollection.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPointCollection.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCameraChangeReason.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAttributionInfo.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMECategoryLoader.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMELocationManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETimerManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAccountManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEDependencyManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventLogger.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/ssl_pin_verifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUniqueIdentifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/vendor_identifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MBRouteVoiceController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MBRouteController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventLogReportViewController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMENSDateWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMENSURLSessionWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUIApplicationWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETrustKitWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKReportsRateLimiter.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKBackgroundReporter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLDistanceFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCoordinateFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLClockDirectionFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCompassDirectionFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapSnapshotter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOpenGLStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLForegroundStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLBackgroundStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLHillshadeStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCircleStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLLineStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFillStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLSymbolStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFillExtrusionStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLHeatmapStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLVectorStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidator.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETypes.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTypes.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBRoadClasses.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MBNavigationSettings.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/reporting_utils.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/configuration_utils.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MapboxDirections.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapView+IBAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSPredicate+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSValue+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSExpression+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLMapView+MGLNavigationAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBRouteOptions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEConstants.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/CLLocation+MMEMobileEvents.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MapboxMobileEvents.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Polyline/Polyline.framework/Headers/Polyline-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Turf/Turf.framework/Headers/Turf-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxSpeech/MapboxSpeech.framework/Headers/MapboxSpeech-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxCoreNavigation/MapboxCoreNavigation.framework/Headers/MapboxCoreNavigation-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Solar/Solar.framework/Headers/Solar-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxDirections.swift/MapboxDirections.framework/Headers/MapboxDirections-Swift.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLLight.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TrustKit.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidatorResult.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEAPIClient.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEvent.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMultiPoint.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKPinFailureReport.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotationView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLUserLocationAnnotationView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCalloutView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/Mapbox.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOverlay.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLGeometry.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/Reachability/MMEReachability.h /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxNavigation.build/unextended-module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Polyline.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Turf.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxSpeech.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxCoreNavigation.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Solar.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxMobileEvents.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxDirections.swift.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Modules/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/CoreLocation.framework/Headers/CoreLocation.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/AVFoundation.framework/Headers/AVFoundation.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/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
/Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxNavigation.build/Objects-normal/x86_64/Error~partial.swiftdoc : /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageDownload.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/GenericRouteShield.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/Sequence.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLVectorTileSource.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ErrorCode.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIImage.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Cache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DataCache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageCache.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Bundle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Style.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLStyle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DayStyle.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleType.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/Date.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/CGSize.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Transitioning.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxCoreNavigation/String.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NSAttributedString.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionLabel.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackCollectionViewCell.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RatingControl.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackItem.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuverDirection.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/VisualInstruction.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageDownloader.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleManager.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLAccountManager.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StyleKitMarker.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RouteVoiceController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MapboxVoiceController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/EndOfRouteViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DialogViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/FeedbackViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/RouteMapViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StepsViewController.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionPresenter.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIGestureRecognizer.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Error.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIEdgeInsets.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Constants.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LanesStyleKit.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuversStyleKit.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/VisualInstructionComponent.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/CGPoint.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Waypoint.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIFont.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/BottomBannerViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionsBannerViewLayout.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LaneView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/DashedLineView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UserCourseView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UIStackView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/UICollectionView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLMapView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NavigationMapView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/BottomBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/InstructionsBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/NextBannerView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ManeuverView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/LanesView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/StatusView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ExitView.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/Dictionary.swift /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/ImageRepository.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Polyline/Polyline.framework/Modules/Polyline.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Turf/Turf.framework/Modules/Turf.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxSpeech/MapboxSpeech.framework/Modules/MapboxSpeech.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxCoreNavigation/MapboxCoreNavigation.framework/Modules/MapboxCoreNavigation.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Solar/Solar.framework/Modules/Solar.swiftmodule/x86_64.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxDirections.swift/MapboxDirections.framework/Modules/MapboxDirections.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/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/AVFoundation.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/CoreAudio.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/MapKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/NSData+MMEGZIP.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Polyline/Polyline-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Turf/Turf-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxSpeech/MapboxSpeech-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxCoreNavigation/MapboxCoreNavigation-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxNavigation/MapboxNavigation-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/Solar/Solar-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxMobileEvents/MapboxMobileEvents-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Target\ Support\ Files/MapboxDirections.swift/MapboxDirections.swift-umbrella.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapCamera.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMECommonEventData.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsService.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterDEMSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLImageSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLVectorTileSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShapeSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLComputedShapeSource.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotationImage.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflineStorage.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/TSKSPKIHashCache.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyle.h /Users/Lorenzo/Desktop/EO18_2/Pods/Polyline/Polyline/Polyline.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPolyline.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShape.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFeature.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapViewDelegate.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidator_Private.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBAttribute.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyleValue.h /Users/Lorenzo/Desktop/EO18_2/Pods/Turf/Sources/Turf/Turf.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKTrustKitConfig.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKLog.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxSpeech/MapboxSpeech/MapboxSpeech.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflinePack.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidatorCallback.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/TSKPublicKeyAlgorithm.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPolygon.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOfflineRegion.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTilePyramidOfflineRegion.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKTrustDecision.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBLaneIndication.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLUserLocation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFoundation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUINavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MapboxCoreNavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MapboxNavigation.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsConfiguration.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/parse_configuration.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPointAnnotation.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLShapeCollection.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLPointCollection.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCameraChangeReason.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAttributionInfo.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMECategoryLoader.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMELocationManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETimerManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventsManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAccountManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEDependencyManager.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventLogger.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Pinning/ssl_pin_verifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUniqueIdentifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/vendor_identifier.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MBRouteVoiceController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MBRouteController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEventLogReportViewController.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMENSDateWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMENSURLSessionWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEUIApplicationWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETrustKitWrapper.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKReportsRateLimiter.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKBackgroundReporter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLDistanceFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCoordinateFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLClockDirectionFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCompassDirectionFormatter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapSnapshotter.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOpenGLStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLForegroundStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLBackgroundStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLHillshadeStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCircleStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLLineStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFillStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLSymbolStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLFillExtrusionStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLHeatmapStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLRasterStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLVectorStyleLayer.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidator.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMETypes.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLTypes.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBRoadClasses.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxCoreNavigation/MapboxCoreNavigation/MBNavigationSettings.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/reporting_utils.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/configuration_utils.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MapboxDirections.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapView+IBAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSPredicate+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSValue+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/NSExpression+MGLAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxNavigation/MapboxNavigation/MGLMapView+MGLNavigationAdditions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxDirections.swift/MapboxDirections/MBRouteOptions.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEConstants.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/CLLocation+MMEMobileEvents.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MapboxMobileEvents.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Polyline/Polyline.framework/Headers/Polyline-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Turf/Turf.framework/Headers/Turf-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxSpeech/MapboxSpeech.framework/Headers/MapboxSpeech-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxCoreNavigation/MapboxCoreNavigation.framework/Headers/MapboxCoreNavigation-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/Solar/Solar.framework/Headers/Solar-Swift.h /Users/Lorenzo/Desktop/EO18_2/Build/Products/Debug-iphonesimulator/MapboxDirections.swift/MapboxDirections.framework/Headers/MapboxDirections-Swift.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLLight.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TrustKit.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/TSKPinningValidatorResult.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEAPIClient.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/MMEEvent.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMultiPoint.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/vendor/TrustKit/Reporting/TSKPinFailureReport.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLAnnotationView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLUserLocationAnnotationView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLMapView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLCalloutView.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/Mapbox.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLOverlay.h /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Headers/MGLGeometry.h /Users/Lorenzo/Desktop/EO18_2/Pods/MapboxMobileEvents/MapboxMobileEvents/Reachability/MMEReachability.h /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxNavigation.build/unextended-module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Polyline.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Turf.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxSpeech.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxCoreNavigation.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/Solar.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxMobileEvents.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Build/Intermediates/Pods.build/Debug-iphonesimulator/MapboxDirections.swift.build/module.modulemap /Users/Lorenzo/Desktop/EO18_2/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Modules/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/CoreLocation.framework/Headers/CoreLocation.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/AVFoundation.framework/Headers/AVFoundation.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/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
|
D
|
const string Topic_Addon_Logan = "Swamp shark hunt";
const string Topic_Addon_Stoneplate = "The stone tablet in the swamp";
const string Topic_Addon_Franco = "Forward (into the bandit camp)";
const string Topic_Addon_Senyan = "A fatal situation";
const string Topic_Addon_Esteban = "Attempted murder";
const string Topic_Addon_Huno = "Huno's steel";
const string Topic_Addon_Fisk = "A package of lock picks";
const string Topic_Addon_Buddler = "Three stones - three diggers";
const string Topic_Addon_Tempel = "Access to the temple";
const string Topic_Addon_Fortuno = "Mental meanders";
const string Topic_Addon_Hammer = "Hammer booze";
const string Topic_Addon_BDT_Trader = "Trading with the bandits";
const string Topic_Addon_BDT_Teacher = "Learning from the bandits";
const string Topic_Bandits = "Wanted Notes and Bandits";
const string TOPIC_Kleidung = "Lobart's Work clothes";
const string TOPIC_Rueben = "Harvest the Turnip Field";
const string TOPIC_Ruebenbringen = "Bring the turnips to Hilda";
const string TOPIC_Vino = "For a bottle of wine";
const string TOPIC_Maleth = "The Bandits at Lobart's Farm";
const string TOPIC_Hilda = "A Pan for Hilda";
const string TOPIC_City = "How to get into the City of Khorinis";
const string TOPIC_BecomeMIL = "Member of the city guard";
const string TOPIC_Lehrling = "Apprentice in Khorinis";
const string TOPIC_OV = "Get into the Upper Quarter";
const string TOPIC_Matteo = "Matteo and Gritta.";
const string TOPIC_Thorben = "The Blessing of the Gods";
const string TOPIC_HaradOrk = "A Great Challenge";
const string TOPIC_BosperBogen = "Bosper's Bow";
const string TOPIC_BosperWolf = "Furs for Bosper";
const string TOPIC_ConstantinoPlants = "Herbs for Constantino";
const string TOPIC_Canthar = "Canthar's Favor";
const string TOPIC_HakonBanditen = "Bandit Raids";
const string TOPIC_Jora = "The Gold of a Merchant";
const string TOPIC_JoraDieb = "A Brazen Thief";
const string TOPIC_Nagur = "The False Messenger";
const string TOPIC_Baltram = "Baltram's Delivery";
const string Topic_CassiaRing = "Constantino's Ring";
const string Topic_CassiaKelche = "The Blood Chalices";
const string Topic_RamirezSextant = "A Sextant";
const string TOPIC_Alwin = "Mad Fellan";
const string TOPIC_Ignaz = "The Experiment";
const string TOPIC_AlrikSchwert = "Alrik's Sword";
const string TOPIC_Garvell = "Information for Garvell";
const string TOPIC_Peck = "Where is Peck?";
const string TOPIC_Warehouse = "A Package full of Weed";
const string TOPIC_Redlight = "The Weed Deal";
const string TOPIC_Feldraeuber = "Problems at Lobart's Farm";
const string TOPIC_BecomeKdF = "Magician of Fire";
const string Topic_Kloster = "How to Get into the Monastery.";
const string Topic_Gemeinschaft = "Serve the Community";
const string Topic_Neorasrezept = "The Lost Recipe";
const string Topic_NeorasPflanzen = "Seven Herbs";
const string Topic_IsgarothWolf = "Isgaroth's Problem";
const string Topic_ParlanFegen = "The Chambers of the Novices";
const string Topic_GoraxEssen = "The Mutton Sausages";
const string Topic_GoraxWein = "The Wine Delivery";
const string Topic_MardukBeten = "Prayer for the Paladins";
const string Topic_OpolosRezept = "Opolos and the Recipe";
const string Topic_BaboTrain = "Fight Training for Babo";
const string Topic_KarrasCharm = "A Short Trip to the City";
const string TOPIC_FireContest = "The Test of Fire";
const string TOPIC_Golem = "The Living Rock";
const string TOPIC_Rune = "Create a Rune";
const string TOPIC_Schnitzeljagd = "The Path of Believers";
const string Topic_BaboGaertner = "Babo and the Garden";
const string Topic_DyrianDrin = "Dyrian's Crime";
const string Topic_OpolosStudy = "Opolos and the Library";
const string Topic_KlosterTrader = "Trade in the Monastery";
const string Topic_KlosterTeacher = "Learning in the Monastery";
const string TOPIC_BecomeSLD = "Member of the Mercenaries";
const string TOPIC_TorlofPacht = "Collect the Rent";
const string TOPIC_TorlofMiliz = "Drive away the Militia";
const string TOPIC_SLDRespekt = "Respect";
const string TOPIC_JarvisSLDKo = "Jarvis' Challenge";
const string TOPIC_CordProve = "A Good Fighter";
const string Topic_CipherHerb = "For a Fistful of Herb";
const string Topic_CipherPaket = "The Weed Package";
const string Topic_RodWette = "Rod's Sword";
const string TOPIC_FesterRauber = "The Field Raiders";
const string TOPIC_TheklaEintopf = "Stew";
const string TOPIC_SagittaHerb = "The Sun Aloe";
const string TOPIC_PepeWolves = "Four Wolves for Pepe";
const string TOPIC_KickBullco = "Kick Bullco's Butt";
const string TOPIC_Frieden = "An Offer of Peace";
const string Topic_MISOLDWORLD = "Evidence";
const string TOPIC_ScoutMine = "Diggers and Ore";
const string Topic_MarcosJungs = "Help for Marcos";
const string TOPIC_RescueGorn = "Rescue Gorn";
const string TOPIC_FajethKillSnapper = "Snapper Hunt";
const string TOPIC_BringMeat = "Meat";
const string TopicBrutusKasse = "Gold for Brutus";
const string Topic_TengronRing = "Tengron's Ring";
const string Topic_OricBruder = "Bad News";
const string TOPIC_BilgotEscort = "Bilgotīs Curse";
const string TOPIC_Botschaft = "The Message";
const string TOPIC_Lutero = "Snappers' Claws";
const string TOPIC_Fernando = "Fernando's Business";
const string TOPIC_PyrokarClearDemonTower = "Return to the Tower";
const string TOPIC_HyglasBringBook = "The Power of the Stars";
const string Topic_BabosDocs = "Documents";
const string TOPIC_Wolf_BringCrawlerPlates = "The Crawler Armor";
const string TOPIC_HelpDiegoNW = "Diego's Gold";
const string TOPIC_DiegosResidence = "Diego's Business";
const string Topic_CassiaGold = "The Sunken Gold";
const string Topic_CassiaSilver = "Larius's Silver";
const string Topic_CassiaPearls = "Farmer's Pearls";
const string Topic_CassiaWater = "Hanging Water";
|
D
|
// URL: https://atcoder.jp/contests/abc138/tasks/abc138_a
import std;
version(unittest) {} else
void main()
{
int a; io.getV(a);
string s; io.getV(s);
io.putB(a >= 3200, s, "red");
}
auto io = IO!()();
import lib.io;
|
D
|
import std.stdio;
import rethinkdb;
import std.json;
void main()
{
auto sess = new Session("localhost", 28015);
// sess.protocol = Protocol.PROTOBUF;
sess.open();
if(sess.handshake()) {
writeln("Handshake sucessful");
auto res = R.db("blog").table("users").filter(["name": "Michel"]).run(sess);
res = R.db("blog").table("users").filter(["name": "Michel"]).run(sess);
foreach(JSONValue v; res.result.array) {
writeln("id: ", v["id"].str, " name: ", v["name"].str);
}
} else {
writeln("Handeshake failed");
}
sess.close();
writeln("Edit source/app.d to start your project.");
}
|
D
|
/Users/kirstenrichard/Desktop/substrate-moloch-dao/target/release/deps/kvdb-a6ad7b1d2b02f5dd.rmeta: /Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/lib.rs /Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/io_stats.rs
/Users/kirstenrichard/Desktop/substrate-moloch-dao/target/release/deps/libkvdb-a6ad7b1d2b02f5dd.rlib: /Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/lib.rs /Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/io_stats.rs
/Users/kirstenrichard/Desktop/substrate-moloch-dao/target/release/deps/kvdb-a6ad7b1d2b02f5dd.d: /Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/lib.rs /Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/io_stats.rs
/Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/lib.rs:
/Users/kirstenrichard/.cargo/registry/src/github.com-1ecc6299db9ec823/kvdb-0.6.0/src/io_stats.rs:
|
D
|
module gfm.math.rational;
import std.traits,
std.string;
/**
A rational number, always in reduced form. Supports basic arithmetic.
Bugs: Remove this module once std.rational is here.
*/
align(1) struct Rational
{
align(1):
public
{
long num; /// Numerator.
long denom; /// Denominator.
/// Construct a Rational from an integer.
this(long n) pure nothrow
{
opAssign!long(n);
}
/// Construct a Rational from another Rational.
this(Rational f) pure nothrow
{
opAssign!Rational(f);
}
/// Construct a Rational from numerator and denominator.
this(long numerator, long denominator) pure nothrow
{
num = numerator;
denom = denominator;
reduce();
}
/// Converts to pretty string.
string toString() const
{
return format("%s/%s", num, denom);
}
/// Cast to floating point.
T opCast(T)() pure const nothrow if (isFloatingPoint!T)
{
return cast(T)num / cast(T)denom;
}
/// Assign with another Rational.
ref Rational opAssign(T)(T other) pure nothrow if (is(Unqual!T == Rational))
{
num = other.num;
denom = other.denom;
return this;
}
/// Assign with an integer.
ref Rational opAssign(T)(T n) pure nothrow if (isIntegral!T)
{
num = n;
denom = 1;
return this;
}
Rational opBinary(string op, T)(T o) pure const nothrow
{
Rational r = this;
Rational y = o;
return r.opOpAssign!(op)(y);
}
ref Rational opOpAssign(string op, T)(T o) pure nothrow if (!is(Unqual!T == Rational))
{
const(self) o = y;
return opOpAssign!(op)(o);
}
ref Rational opOpAssign(string op, T)(T o) pure nothrow if (is(Unqual!T == Rational))
{
static if (op == "+")
{
num = num * o.denom + o.num * denom;
denom = denom * o.denom;
reduce();
}
else static if (op == "-")
{
opOpAssign!"+"(-o);
}
else static if (op == "*")
{
denom = denom * o.denom;
num = num * o.num;
reduce();
}
else static if (op == "/")
{
opOpAssign!"*"(o.inverse());
}
else
{
static assert(false, "unsupported operation '" ~ op ~ "'");
}
return this;
}
// const unary operations
Rational opUnary(string op)() pure const nothrow if (op == "+" || op == "-")
{
static if (op == "-")
{
Rational f = this;
f.num = -f.num;
return f;
}
else static if (op == "+")
return this;
}
// non-const unary operations
Rational opUnary(string op)() pure nothrow if (op=="++" || op=="--")
{
static if (op=="++")
{
num += denom;
debug checkInvariant(); // should still be reduced
}
else static if (op=="--")
{
num -= denom;
debug checkInvariant(); // should still be reduced
}
return this;
}
bool opEquals(T)(T y) pure const if (!is(Unqual!T == Rational))
{
return this == Rational(y);
}
bool opEquals(T)(T o) pure const if (is(Unqual!T == Rational))
{
// invariants ensures two equal Rationals have equal representations
return num == o.num && denom == o.denom;
}
int opCmp(T)(T o) pure const if (!is(Unqual!T == Rational))
{
return opCmp(Rational(o));
}
int opCmp(T)(T o) pure const if (is(Unqual!T == Rational))
{
assert(denom > 0);
assert(o.denom > 0);
long det = num * o.denom - denom * o.num;
if (det > 0)
return 1;
else if (det < 0)
return -1;
else
return 0;
}
/// Returns: Inverse of this rational number.
Rational inverse() pure const nothrow
{
return Rational(denom, num);
}
}
private
{
// FIXME: be consistent with regards to sign
static long GCD(long a, long b) pure nothrow
{
if (b == 0)
return a;
else
return GCD(b, a % b);
}
void reduce() pure nothrow
{
const(long) gcd = GCD(num, denom);
num /= gcd;
denom /= gcd;
if (denom < 0)
{
num = -num;
denom = -denom;
}
debug checkInvariant();
}
void checkInvariant() pure nothrow // can't do this in invariant() because of opAssign
{
assert(denom > 0);
auto gcd = GCD(num, denom);
assert(gcd == 1 || gcd == -1);
}
}
}
unittest
{
Rational x = Rational(9, 3);
assert(x.num == 3);
assert(x.denom == 1);
assert(x < 4);
assert(x > 2);
assert(x > Rational(8,3));
assert(x > Rational(-8,3));
assert(x == Rational(-27, -9));
assert(Rational(-4, 7) + 2 == Rational(10, 7));
assert(Rational(-4, 7) == Rational(10, 7) - 2);
assert(++Rational(3,7) == Rational(10,7));
assert(--Rational(3,7) == Rational(-4,7));
assert(+x == 3);
assert(-x == -3);
Rational y = -4;
assert(y.num == -4);
assert(y.denom == 1);
assert(Rational(2, 3) * Rational(15, 7) == Rational(10, 7));
assert(Rational(2, 3) == Rational(10, 7) / Rational(15, 7));
}
|
D
|
module amazon.ion.logger;
import std.datetime;
import core.thread;
enum Verbosity {
Debug = 0,
Info = 1,
Error = 2
};
import std.array, std.format;
static shared Logger _ionLogger;
void INFO(string format, string file = __MODULE__, int line = __LINE__, A...)(lazy A args) @trusted {
if (_ionLogger.__minVerbosity <= Verbosity.Info) {
auto msg = appender!string;
formattedWrite(msg, format, args);
_ionLogger.log(Verbosity.Info, msg.data, file, line);
}
}
void DEBUG(string format, string file = __MODULE__, int line = __LINE__, A...)(lazy A args) @trusted {
if (_ionLogger.__minVerbosity <= Verbosity.Debug) {
auto msg = appender!string;
formattedWrite(msg, format, args);
_ionLogger.log(Verbosity.Debug, msg.data, file, line);
}
}
void ERROR(string format, string file = __MODULE__, int line = __LINE__, A...)(lazy A args) @trusted {
if (_ionLogger.__minVerbosity <= Verbosity.Error) {
auto msg = appender!string;
formattedWrite(msg, format, args);
_ionLogger.log(Verbosity.Error, msg.data, file, line);
}
}
class Logger {
private {
string _infoPath;
string _warningPath;
string _errorPath;
string _debugPath;
Verbosity __minVerbosity;
}
@property Verbosity minVerbosity() shared {
return __minVerbosity;
}
@property Verbosity minVerbosity(Verbosity _min) shared {
__minVerbosity = _min;
return _min;
}
void info(string message, string file = __MODULE__, int line = __LINE__) shared {
log(Verbosity.Info, message, file, line);
}
void debug_(string message, string file = __MODULE__, int line = __LINE__) shared{
log(Verbosity.Debug, message, file, line);
}
void error(string message, string file = __MODULE__, int line = __LINE__) shared {
log(Verbosity.Error, message, file, line);
}
void log(Verbosity v, string message, string file = __MODULE__, int line = __LINE__) shared {
import std.stdio;
import std.conv : to;
import std.string;
import std.datetime;
if (minVerbosity <= v) {
writefln("%s [%s][%s:%d]: %s", to!string(v).toUpper(), Clock.currTime().toISOExtString(), file, line, message);
}
}
this(Verbosity _minVerbosity = Verbosity.Info, string info = "", string warning = "", string error = "", string debug_ = "") shared {
minVerbosity = _minVerbosity;
_infoPath = info;
_warningPath = warning;
_errorPath = error;
_debugPath = debug_;
}
shared static this() {
_ionLogger = new shared(Logger)();
import core.exception;
core.exception.assertHandler = &assertHandler;
}
shared static ~this() {
destroy(_ionLogger);
}
}
import core.stdc.stdlib : abort;
import core.thread;
import core.time;
void assertHandler(string file, ulong line, string message) nothrow {
try {
ERROR!"ASSERT: %s at %s:%d"(message, file, line);
abort();
} catch(Exception e) {
}
}
|
D
|
informal terms for insanity
the quality of being rash and foolish
foolish or senseless behavior
|
D
|
/**
* Copyright © Novelate 2020
* License: MIT (https://github.com/Novelate/NovelateEngine/blob/master/LICENSE)
* Author: Jacob Jensen (bausshf)
* Website: https://novelate.com/
* ------
* Novelate is a free and open-source visual novel engine and framework written in the D programming language.
* It can be used freely for both personal and commercial projects.
* ------
* Module Description:
* The core module for Novelate exposes misc. core functionality of the engine.
*/
module novelate.core;
import std.file : readText, write, exists;
import std.array : replace, split, array;
import std.string : strip, stripLeft, stripRight, format;
import std.algorithm : filter;
import std.conv : to;
import dsfml.graphics : RenderWindow, Color;
import dsfml.window : VideoMode, ContextSettings, Window, Event, Keyboard, Mouse;
import novelate.layer;
import novelate.config;
import novelate.mainmenu;
import novelate.play;
import novelate.state;
import novelate.fonts;
import novelate.parser;
import novelate.events;
/// Enumeration of layer types. There are 10 available layers ranging from 0 - 9 as indexes. 7 is the largest named frame.
enum LayerType : size_t
{
/// The background layer.
background = 0,
/// The object background.
objectBackground = 1,
/// The object foreground.
objectForeground = 2,
/// The character layer.
character = 3,
/// The front character layer.
characterFront = 4,
/// The dialogue box layer.
dialogueBox = 5,
/// The dialogue box interaction layer. Generally used for text, options etc.
dialogueBoxInteraction = 6,
/// The front layer.
front = 7
}
/// Clears the temp layers.
void clearTempLayers()
{
_isTempScreen = false;
selectedLayers = _layers;
foreach (tempLayer; _tempLayers)
{
tempLayer.clear();
}
fireEvent!(EventType.onTempScreenClear);
}
/// Sets the temp layers.
void setTempLayers()
{
_isTempScreen = true;
selectedLayers = _tempLayers;
fireEvent!(EventType.onTempScreenShow);
}
/**
* Gets a layer by its index. It retrieves it from the current selected layers whether it's the main layers or the temp layers.
* Params:
* index = The index of the layer to get.
* Returns:
* The layer within the current selected layers.
*/
Layer getLayer(size_t index)
{
if (!selectedLayers || index >= selectedLayers.length)
{
return null;
}
return selectedLayers[index];
}
/**
* Changes the resolution of the game. This should preferebly only be of the following resolutions: 800x600, 1024x768 or 1280x720. However any resolutions are acceptable but may have side-effects attached such as invalid rendering etc. All set resolutions are saved to a res.ini file in the data folder allowing for resolutions to be kept across instances of the game.
* Params:
* width = The width of the resolution.
* height = The height of the resolution.
* fullScreen = A boolean determining whether the game is full-screen or not.
*/
void changeResolution(size_t width, size_t height, bool fullScreen)
{
_width = width;
_height = height;
if (_window && _window.isOpen())
{
_window.close();
_window = null;
}
write(config.dataFolder ~ "/res.ini", format("Width=%s\r\nHeight=%s\r\nFullScreen=%s", width, height, fullScreen));
_videoMode = VideoMode(cast(int)width, cast(int)height);
if (fullScreen)
{
_window = new RenderWindow(_videoMode, _title, (Window.Style.Fullscreen), _context);
}
else
{
_window = new RenderWindow(_videoMode, _title, (Window.Style.Titlebar | Window.Style.Close), _context);
}
_window.setFramerateLimit(_fps);
if (_layers)
{
foreach (layer; _layers)
{
layer.refresh(_width, _height);
}
}
fireEvent!(EventType.onResolutionChange);
}
/// Loads the credits video. Currently does nothing.
void loadCreditsVideo()
{
fireEvent!(EventType.onLoadingCreditsVideo);
// ...
}
/// Clears all layers for their components except for the background layer as that should usually be cleared by fading-in and fading-out when adding a new background. This adds smoothness to the game.
void clearAllLayersButBackground()
{
if (!selectedLayers || !selectedLayers.length)
{
return;
}
foreach (i; 1 .. selectedLayers.length)
{
selectedLayers[i].clear();
}
fireEvent!(EventType.onClearingAllLayersButBackground);
}
/// Enumeration of screens.
enum Screen : string
{
/// No screen.
none = "none",
/// The main menu.
mainMenu = "mainMenu",
/// The load screen.
load = "load",
/// The save screen.
save = "save",
/// The about screen.
about = "about",
/// The characters screen.
characters = "characters",
/// The game play screen (scene)
scene = "scene"
}
/**
* Changes the screen.
* Params:
* screen = The screen to change to. You should use the "Screen" enum for accuracy of the screen name.
* data = The data passed onto the screen.
*/
void changeScreen(string screen, string[] data = null)
{
clearAllLayersButBackground();
switch (screen)
{
case Screen.mainMenu: showMainMenu(); break;
case Screen.scene: if (data && data.length) changeScene(data[0]); break;
default: break; // TODO: Custom screen handling through events.
}
fireEvent!(EventType.onScreenChange);
}
/// Initializes the game.
void initialize()
{
parseFile("main.txt");
loadFonts(config.dataFolder ~ "/fonts");
_context.antialiasingLevel = 100;
_title = config.gameTitle;
if (config.gameSlogan && config.gameSlogan.length)
{
_title ~= " - " ~ config.gameSlogan;
}
fullScreen = false;
if (exists(config.dataFolder ~ "/res.ini"))
{
auto lines = readText(config.dataFolder ~ "/res.ini").replace("\r", "").split("\n");
foreach (line; lines)
{
if (!line || !line.strip.length)
{
continue;
}
auto data = line.split("=");
if (data.length != 2)
{
continue;
}
switch (data[0])
{
case "Width": _width = to!size_t(data[1]); break;
case "Height": _height = to!size_t(data[1]); break;
case "FullScreen": fullScreen = to!bool(data[1]); break;
default: break;
}
}
}
foreach (_; 0 .. 10)
{
_layers ~= new Layer(_width, _height);
_tempLayers ~= new Layer(_width, _height);
}
selectedLayers = _layers;
playScene = config.startScene;
}
/// Runs the game/event/UI loop.
void run()
{
auto backgroundColor = Color(0,0,0,0xff);
changeResolution(_width, _height, fullScreen);
changeScreen(Screen.mainMenu);
while (running && _window && _window.isOpen())
{
if (exitGame)
{
exitGame = false;
running = false;
_window.close();
goto exit;
}
if (endGame)
{
if (config.creditsVideo)
{
// Should be a component ...
loadCreditsVideo();
}
else
{
changeScreen(Screen.mainMenu);
}
endGame = false;
playScene = config.startScene;
}
if (changeTempScreen != Screen.none)
{
changeScreen(changeTempScreen);
changeTempScreen = Screen.none;
}
if (nextScene)
{
changeScene(nextScene);
nextScene = null;
}
Event event;
while(_window.pollEvent(event))
{
switch (event.type)
{
case Event.EventType.Closed:
{
running = false;
_window.close();
goto exit;
}
case Event.EventType.MouseMoved:
{
if (selectedLayers && selectedLayers.length)
{
foreach_reverse (layer; selectedLayers)
{
bool stopEvent = false;
layer.mouseMove(event.mouseMove.x, event.mouseMove.y, stopEvent);
if (stopEvent)
{
break;
}
}
}
break;
}
case Event.EventType.MouseButtonPressed:
{
if (selectedLayers && selectedLayers.length)
{
foreach_reverse (layer; selectedLayers)
{
bool stopEvent = false;
layer.mousePress(event.mouseButton.button, stopEvent);
if (stopEvent)
{
break;
}
}
}
break;
}
case Event.EventType.MouseButtonReleased:
{
if (selectedLayers && selectedLayers.length)
{
foreach_reverse (layer; selectedLayers)
{
bool stopEvent = false;
layer.mouseRelease(event.mouseButton.button, stopEvent);
if (stopEvent)
{
break;
}
}
}
break;
}
case Event.EventType.KeyPressed:
{
if (selectedLayers && selectedLayers.length)
{
foreach_reverse (layer; selectedLayers)
{
bool stopEvent = false;
layer.keyPress(event.key.code, stopEvent);
if (stopEvent)
{
break;
}
}
}
break;
}
case Event.EventType.KeyReleased:
{
if (selectedLayers && selectedLayers.length)
{
foreach_reverse (layer; selectedLayers)
{
bool stopEvent = false;
layer.keyRelease(event.key.code, stopEvent);
if (stopEvent)
{
break;
}
}
}
break;
}
default: break;
}
}
_window.clear(backgroundColor);
if (_layers && _layers.length)
{
foreach (layer; _layers)
{
layer.render(_window);
}
}
if (_tempLayers && _tempLayers.length)
{
foreach (layer; _tempLayers)
{
layer.render(_window);
}
}
fireEvent!(EventType.onRender);
_window.display();
}
exit:
}
|
D
|
/Users/apple/DailySchedule/step2/os/target/debug/deps/lazy_static-26b45abc920ebf2f.rmeta: /Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/lib.rs /Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/core_lazy.rs
/Users/apple/DailySchedule/step2/os/target/debug/deps/liblazy_static-26b45abc920ebf2f.rlib: /Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/lib.rs /Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/core_lazy.rs
/Users/apple/DailySchedule/step2/os/target/debug/deps/lazy_static-26b45abc920ebf2f.d: /Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/lib.rs /Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/core_lazy.rs
/Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/lib.rs:
/Users/apple/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/lazy_static-1.4.0/src/core_lazy.rs:
|
D
|
capable of existing or taking place or proving true
|
D
|
instance DIA_PAL_7518_RITTER_EXIT(C_Info)
{
npc = pal_7518_ritter;
nr = 999;
condition = dia_pal_7518_ritter_exit_condition;
information = dia_pal_7518_ritter_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int dia_pal_7518_ritter_exit_condition()
{
return TRUE;
};
func void dia_pal_7518_ritter_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_PAL_7518_RITTER_PEOPLE(C_Info)
{
npc = pal_7518_ritter;
nr = 3;
condition = dia_pal_7518_ritter_people_condition;
information = dia_pal_7518_ritter_people_info;
permanent = TRUE;
description = "Кто у вас командир?";
};
func int dia_pal_7518_ritter_people_condition()
{
if(KAPITELORCATC == FALSE)
{
return TRUE;
};
};
func void dia_pal_7518_ritter_people_info()
{
AI_Output(other,self,"DIA_PAL_7518_RITTER_People_01_00"); //Кто командует здесь?
AI_Output(self,other,"DIA_PAL_7518_RITTER_People_01_01"); //Нашим отрядом сейчас командует паладин Альберт.
AI_Output(self,other,"DIA_PAL_7518_RITTER_PEOPLE_01_02"); //Ты найдешь его в глубине пещеры, что недалеко отсюда.
};
instance DIA_PAL_7518_RITTER_LOCATION(C_Info)
{
npc = pal_7518_ritter;
nr = 2;
condition = dia_pal_7518_ritter_location_condition;
information = dia_pal_7518_ritter_location_info;
permanent = TRUE;
description = "Что ты можешь рассказать о местности?";
};
func int dia_pal_7518_ritter_location_condition()
{
if(KAPITELORCATC == FALSE)
{
return TRUE;
};
};
func void dia_pal_7518_ritter_location_info()
{
AI_Output(other,self,"DIA_PAL_7518_RITTER_LOCATION_01_00"); //Что ты можешь рассказать интересного об этой местности?
AI_Output(self,other,"DIA_PAL_7518_RITTER_LOCATION_01_01"); //Наверху, над нами находится лагерь бывших каторжников.
AI_Output(self,other,"DIA_PAL_7518_RITTER_LOCATION_01_02"); //Хотя они и не почитают Инноса, но однако с ними все же можно иметь дело.
AI_Output(self,other,"DIA_PAL_7518_RITTER_LOCATION_01_03"); //За рекой достаточно опасный лес, но орков в нем нет!
AI_Output(self,other,"DIA_PAL_7518_RITTER_LOCATION_01_04"); //Все они внизу, на побережье - у них там вроде лагеря.
};
instance DIA_PAL_7518_RITTER_STANDARD(C_Info)
{
npc = pal_7518_ritter;
nr = 1;
condition = dia_pal_7518_ritter_standard_condition;
information = dia_pal_7518_ritter_standard_info;
permanent = TRUE;
description = "Как обстановка?";
};
func int dia_pal_7518_ritter_standard_condition()
{
return TRUE;
};
func void dia_pal_7518_ritter_standard_info()
{
AI_Output(other,self,"DIA_PAL_7518_RITTER_Standard_01_00"); //Как обстановка?
AI_Output(self,other,"DIA_PAL_7518_RITTER_Standard_01_01"); //Пока все тихо.
};
instance DIA_PAL_7518_RITTER_GOTOKILLORCSLAVES(C_Info)
{
npc = pal_7518_ritter;
nr = 1;
condition = dia_pal_7518_ritter_gotokillorcslaves_condition;
information = dia_pal_7518_ritter_gotokillorcslaves_info;
permanent = FALSE;
important = TRUE;
};
func int dia_pal_7518_ritter_gotokillorcslaves_condition()
{
if((MIS_ORCORDER == LOG_Running) && (GOTOKILLORCSLAVES == TRUE) && (GOTOKILLORCSLAVESDONE == FALSE))
{
return TRUE;
};
};
func void dia_pal_7518_ritter_gotokillorcslaves_info()
{
AI_Output(self,other,"DIA_PAL_7518_RITTER_GoToKillOrcSlaves_01_00"); //Я получил приказ от Альберта, помочь тебе с отрядом орков.
AI_Output(other,self,"DIA_PAL_7518_RITTER_GoToKillOrcSlaves_01_01"); //Конечно! Следуй за мной.
AI_Output(self,other,"DIA_PAL_7518_RITTER_GoToKillOrcSlaves_01_02"); //Хорошо.
AI_StopProcessInfos(self);
self.aivar[AIV_PARTYMEMBER] = TRUE;
Npc_ExchangeRoutine(self,"FOLLOW");
PALONEORCSLAVE = TRUE;
};
instance DIA_PAL_7518_RITTER_GOTOKILLORCSLAVESDONE(C_Info)
{
npc = pal_7518_ritter;
nr = 1;
condition = dia_pal_7518_ritter_gotokillorcslavesdone_condition;
information = dia_pal_7518_ritter_gotokillorcslavesdone_info;
permanent = FALSE;
important = TRUE;
};
func int dia_pal_7518_ritter_gotokillorcslavesdone_condition()
{
if((MIS_ORCORDER == LOG_Running) && (GOTOKILLORCSLAVES == TRUE) && (PALONEORCSLAVE == TRUE) && (GOTOKILLORCSLAVESDONE == TRUE))
{
return TRUE;
};
};
func void dia_pal_7518_ritter_gotokillorcslavesdone_info()
{
AI_Output(self,other,"DIA_PAL_7518_RITTER_GoToKillOrcSlavesDone_01_00"); //Поганые орки! (злобно) Мы их всех прикончили!
AI_Output(self,other,"DIA_PAL_7518_RITTER_GoToKillOrcSlavesDone_01_01"); //Теперь ты должен вернуться в наш лагерь и рассказать обо всем Альберту.
AI_StopProcessInfos(self);
self.aivar[AIV_PARTYMEMBER] = FALSE;
Npc_ExchangeRoutine(self,"AfterBattle");
};
|
D
|
/*
* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
module engine.thirdparty.dbox.dynamics.b2body;
import core.stdc.float_;
import core.stdc.stdlib;
import core.stdc.string;
import engine.thirdparty.dbox.collision;
import engine.thirdparty.dbox.collision.shapes;
import engine.thirdparty.dbox.common;
import engine.thirdparty.dbox.dynamics;
import engine.thirdparty.dbox.dynamics.contacts;
import engine.thirdparty.dbox.dynamics.joints;
/// The body type.
/// static: zero mass, zero velocity, may be manually moved
/// kinematic: zero mass, non-zero velocity set by user, moved by solver
/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver
enum b2BodyType
{
b2_staticBody = 0,
b2_kinematicBody,
b2_dynamicBody
// TODO_ERIN
// b2_bulletBody,
}
alias b2_staticBody = b2BodyType.b2_staticBody;
alias b2_kinematicBody = b2BodyType.b2_kinematicBody;
alias b2_dynamicBody = b2BodyType.b2_dynamicBody;
/// A body definition holds all the data needed to construct a rigid body_.
/// You can safely re-use body definitions. Shapes are added to a body after construction.
struct b2BodyDef
{
/// The body type: static, kinematic, or dynamic.
/// Note: if a dynamic body would have zero mass, the mass is set to one.
b2BodyType type = b2BodyType.b2_staticBody;
/// The world position of the body_. Avoid creating bodies at the origin
/// since this can lead to many overlapping shapes.
b2Vec2 position = b2Vec2(0, 0);
/// The world angle of the body in radians.
float32 angle = 0;
/// The linear velocity of the body's origin in world co-ordinates.
b2Vec2 linearVelocity = b2Vec2(0, 0);
/// The angular velocity of the body_.
float32 angularVelocity = 0;
/// Linear damping is use to reduce the linear velocity. The damping parameter
/// can be larger than 1.0f but the damping effect becomes sensitive to the
/// time step when the damping parameter is large.
float32 linearDamping = 0;
/// Angular damping is use to reduce the angular velocity. The damping parameter
/// can be larger than 1.0f but the damping effect becomes sensitive to the
/// time step when the damping parameter is large.
float32 angularDamping = 0;
/// Set this flag to false if this body should never fall asleep. Note that
/// this increases CPU usage.
bool allowSleep = true;
/// Is this body initially awake or sleeping?
bool awake = true;
/// Should this body be prevented from rotating? Useful for characters.
bool fixedRotation;
/// Is this a fast moving body that should be prevented from tunneling through
/// other moving bodies? Note that all bodies are prevented from tunneling through
/// kinematic and static bodies. This setting is only considered on dynamic bodies.
/// @warning You should use this flag sparingly since it increases processing time.
bool bullet;
/// Does this body start out active?
bool active = true;
/// Use this to store application specific body data.
void* userData;
/// Scale the gravity applied to this body_.
float32 gravityScale = 1.0;
}
/// A rigid body_. These are created via b2World*.CreateBody.
struct b2Body
{
/// Creates a fixture and attach it to this body. Use this function if you need
/// to set some fixture parameters, like friction. Otherwise you can create the
/// fixture directly from a shape.
/// If the density is non-zero, this function automatically updates the mass of the body.
/// Contacts are not created until the next time step.
/// @param def the fixture definition.
/// @warning This function is locked during callbacks.
b2Fixture* CreateFixture(const(b2FixtureDef)* def)
{
assert(m_world);
assert(m_world.IsLocked() == false);
if (m_world.IsLocked() == true)
{
return null;
}
b2BlockAllocator* allocator = &m_world.m_blockAllocator;
void* mem = allocator.Allocate(b2memSizeOf!b2Fixture);
b2Fixture* fixture = b2emplace!b2Fixture(mem);
fixture.Create(allocator, &this, def);
if (m_flags & e_activeFlag)
{
b2BroadPhase* broadPhase = &m_world.m_contactManager.m_broadPhase;
fixture.CreateProxies(broadPhase, m_xf);
}
fixture.m_next = m_fixtureList;
m_fixtureList = fixture;
++m_fixtureCount;
fixture.m_body = &this;
// Adjust mass properties if needed.
if (fixture.m_density > 0.0f)
{
ResetMassData();
}
// Let the world know we have a new fixture. This will cause new contacts
// to be created at the beginning of the next time step.
m_world.m_flags |= b2World.e_newFixture;
return fixture;
}
/// Creates a fixture from a shape and attach it to this body.
/// This is a convenience function. Use b2FixtureDef if you need to set parameters
/// like friction, restitution, user data, or filtering.
/// If the density is non-zero, this function automatically updates the mass of the body.
/// @param shape the shape to be cloned.
/// @param density the shape density (set to zero for static bodies).
/// @warning This function is locked during callbacks.
b2Fixture* CreateFixture(const(b2Shape) shape, float32 density)
{
b2FixtureDef def;
def.shape = cast(b2Shape)shape;
def.density = density;
return CreateFixture(&def);
}
/// Destroy a fixture. This removes the fixture from the broad-phase and
/// destroys all contacts associated with this fixture. This will
/// automatically adjust the mass of the body if the body is dynamic and the
/// fixture has positive density.
/// All fixtures attached to a body are implicitly destroyed when the body is destroyed.
/// @param fixture the fixture to be removed.
/// @warning This function is locked during callbacks.
void DestroyFixture(b2Fixture* fixture)
{
assert(m_world.IsLocked() == false);
if (m_world.IsLocked() == true)
{
return;
}
assert(fixture.m_body == &this);
// Remove the fixture from this body's singly linked list.
assert(m_fixtureCount > 0);
b2Fixture** node = &m_fixtureList;
bool found = false;
while (*node !is null)
{
if (*node == fixture)
{
*node = fixture.m_next;
found = true;
break;
}
node = &(*node).m_next;
}
// You tried to remove a shape that is not attached to this body_.
assert(found);
// Destroy any contacts associated with the fixture.
b2ContactEdge* edge = m_contactList;
while (edge)
{
b2Contact c = edge.contact;
edge = edge.next;
b2Fixture* fixtureA = c.GetFixtureA();
b2Fixture* fixtureB = c.GetFixtureB();
if (fixture == fixtureA || fixture == fixtureB)
{
// This destroys the contact and removes it from
// this body's contact list.
m_world.m_contactManager.Destroy(c);
}
}
b2BlockAllocator* allocator = &m_world.m_blockAllocator;
if (m_flags & e_activeFlag)
{
b2BroadPhase* broadPhase = &m_world.m_contactManager.m_broadPhase;
fixture.DestroyProxies(broadPhase);
}
fixture.Destroy(allocator);
fixture.m_body = null;
fixture.m_next = null;
destroy(*fixture);
allocator.Free(cast(void*)fixture, b2memSizeOf!b2Fixture);
--m_fixtureCount;
// Reset the mass data.
ResetMassData();
}
/// Get the body transform for the body's origin.
/// @return the world transform of the body's origin.
b2Transform GetTransform() const
{
return m_xf;
}
/// Set the position of the body's origin and rotation.
/// Manipulating a body's transform may cause non-physical behavior.
/// Note: contacts are updated on the next call to b2World.Step.
/// @param position the world position of the body's local origin.
/// @param angle the world rotation in radians.
void SetTransform(b2Vec2 position, float32 angle)
{
assert(m_world.IsLocked() == false);
if (m_world.IsLocked() == true)
{
return;
}
m_xf.q.Set(angle);
m_xf.p = position;
m_sweep.c = b2Mul(m_xf, m_sweep.localCenter);
m_sweep.a = angle;
m_sweep.c0 = m_sweep.c;
m_sweep.a0 = angle;
b2BroadPhase* broadPhase = &m_world.m_contactManager.m_broadPhase;
for (b2Fixture* f = m_fixtureList; f; f = f.m_next)
{
f.Synchronize(broadPhase, m_xf, m_xf);
}
}
/// Get the world body origin position.
/// @return the world position of the body's origin.
b2Vec2 GetPosition() const
{
return m_xf.p;
}
/// Get the angle in radians.
/// @return the current world rotation angle in radians.
float32 GetAngle() const
{
return m_sweep.a;
}
/// Get the world position of the center of mass.
b2Vec2 GetWorldCenter() const
{
return m_sweep.c;
}
/// Get the local position of the center of mass.
b2Vec2 GetLocalCenter() const
{
return m_sweep.localCenter;
}
/// Get the linear velocity of the center of mass.
/// @return the linear velocity of the center of mass.
b2Vec2 GetLinearVelocity() const
{
return m_linearVelocity;
}
/// Set the linear velocity of the center of mass.
/// @param v the new linear velocity of the center of mass.
void SetLinearVelocity(b2Vec2 v)
{
if (m_type == b2_staticBody)
{
return;
}
if (b2Dot(v, v) > 0.0f)
{
SetAwake(true);
}
m_linearVelocity = v;
}
/// Get the angular velocity.
/// @return the angular velocity in radians/second.
float32 GetAngularVelocity() const
{
return m_angularVelocity;
}
/// Set the angular velocity.
/// @param omega the new angular velocity in radians/second.
void SetAngularVelocity(float32 w)
{
if (m_type == b2_staticBody)
{
return;
}
if (w * w > 0.0f)
{
SetAwake(true);
}
m_angularVelocity = w;
}
/// Apply a force at a world point. If the force is not
/// applied at the center of mass, it will generate a torque and
/// affect the angular velocity. This wakes up the body.
/// @param force the world force vector, usually in Newtons (N).
/// @param point the world position of the point of application.
/// @param wake also wake up the body
void ApplyForce(b2Vec2 force, b2Vec2 point, bool wake)
{
/*if (m_type != b2_dynamicBody)
{
return;
}*/
if (wake && (m_flags & e_awakeFlag) == 0)
{
SetAwake(true);
}
// Don't accumulate a force if the body is sleeping.
if (m_flags & e_awakeFlag)
{
m_force += force;
m_torque += b2Cross(point - m_sweep.c, force);
}
}
/// Apply a force to the center of mass. This wakes up the body.
/// @param force the world force vector, usually in Newtons (N).
/// @param wake also wake up the body
void ApplyForceToCenter(b2Vec2 force, bool wake)
{
if (m_type != b2_dynamicBody)
{
return;
}
if (wake && (m_flags & e_awakeFlag) == 0)
{
SetAwake(true);
}
// Don't accumulate a force if the body is sleeping
if (m_flags & e_awakeFlag)
{
m_force += force;
}
}
/// Apply a torque. This affects the angular velocity
/// without affecting the linear velocity of the center of mass.
/// This wakes up the body.
/// @param torque about the z-axis (out of the screen), usually in N-m.
/// @param wake also wake up the body
void ApplyTorque(float32 torque, bool wake)
{
if (m_type != b2_dynamicBody)
{
return;
}
if (wake && (m_flags & e_awakeFlag) == 0)
{
SetAwake(true);
}
// Don't accumulate a force if the body is sleeping
if (m_flags & e_awakeFlag)
{
m_torque += torque;
}
}
/// Apply an impulse at a point. This immediately modifies the velocity.
/// It also modifies the angular velocity if the point of application
/// is not at the center of mass. This wakes up the body.
/// @param impulse the world impulse vector, usually in N-seconds or kg-m/s.
/// @param point the world position of the point of application.
/// @param wake also wake up the body
void ApplyLinearImpulse(b2Vec2 impulse, b2Vec2 point, bool wake)
{
if (m_type != b2_dynamicBody)
{
return;
}
if (wake && (m_flags & e_awakeFlag) == 0)
{
SetAwake(true);
}
// Don't accumulate velocity if the body is sleeping
if (m_flags & e_awakeFlag)
{
m_linearVelocity += m_invMass * impulse;
m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse);
}
}
/// Apply an angular impulse.
/// @param impulse the angular impulse in units of kg*m*m/s
/// @param wake also wake up the body
void ApplyAngularImpulse(float32 impulse, bool wake)
{
if (m_type != b2_dynamicBody)
{
return;
}
if (wake && (m_flags & e_awakeFlag) == 0)
{
SetAwake(true);
}
// Don't accumulate velocity if the body is sleeping
if (m_flags & e_awakeFlag)
{
m_angularVelocity += m_invI * impulse;
}
}
/// Get the total mass of the body.
/// @return the mass, usually in kilograms (kg).
float32 GetMass() const
{
return m_mass;
}
/// Get the rotational inertia of the body about the local origin.
/// @return the rotational inertia, usually in kg-m^2.
float32 GetInertia() const
{
return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);
}
/// Get the mass data of the body.
/// @return a struct containing the mass, inertia and center of the body.
void GetMassData(b2MassData* data) const
{
data.mass = m_mass;
data.I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);
data.center = m_sweep.localCenter;
}
/// Set the mass properties to override the mass properties of the fixtures.
/// Note that this changes the center of mass position.
/// Note that creating or destroying fixtures can also alter the mass.
/// This function has no effect if the body isn't dynamic.
/// @param massData the mass properties.
void SetMassData(const(b2MassData)* massData)
{
assert(m_world.IsLocked() == false);
if (m_world.IsLocked() == true)
{
return;
}
if (m_type != b2_dynamicBody)
{
return;
}
m_invMass = 0.0f;
m_I = 0.0f;
m_invI = 0.0f;
m_mass = massData.mass;
if (m_mass <= 0.0f)
{
m_mass = 1.0f;
}
m_invMass = 1.0f / m_mass;
if (massData.I > 0.0f && (m_flags & b2Body.e_fixedRotationFlag) == 0)
{
m_I = massData.I - m_mass * b2Dot(massData.center, massData.center);
assert(m_I > 0.0f);
m_invI = 1.0f / m_I;
}
// Move center of mass.
b2Vec2 oldCenter = m_sweep.c;
m_sweep.localCenter = massData.center;
m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter);
// Update center of mass velocity.
m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter);
}
/// This resets the mass properties to the sum of the mass properties of the fixtures.
/// This normally does not need to be called unless you called SetMassData to override
/// the mass and you later want to reset the mass.
void ResetMassData()
{
// Compute mass data from shapes. Each shape has its own density.
m_mass = 0.0f;
m_invMass = 0.0f;
m_I = 0.0f;
m_invI = 0.0f;
m_sweep.localCenter.SetZero();
// Static and kinematic bodies have zero mass.
if (m_type == b2_staticBody || m_type == b2_kinematicBody)
{
m_sweep.c0 = m_xf.p;
m_sweep.c = m_xf.p;
m_sweep.a0 = m_sweep.a;
return;
}
assert(m_type == b2_dynamicBody);
// Accumulate mass over all fixtures.
b2Vec2 localCenter = b2Vec2_zero;
for (b2Fixture* f = m_fixtureList; f; f = f.m_next)
{
if (f.m_density == 0.0f)
{
continue;
}
b2MassData massData;
f.GetMassData(&massData);
m_mass += massData.mass;
localCenter += massData.mass * massData.center;
m_I += massData.I;
}
// Compute center of mass.
if (m_mass > 0.0f)
{
m_invMass = 1.0f / m_mass;
localCenter *= m_invMass;
}
else
{
// Force all dynamic bodies to have a positive mass.
m_mass = 1.0f;
m_invMass = 1.0f;
}
if (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0)
{
// Center the inertia about the center of mass.
m_I -= m_mass * b2Dot(localCenter, localCenter);
assert(m_I > 0.0f);
m_invI = 1.0f / m_I;
}
else
{
m_I = 0.0f;
m_invI = 0.0f;
}
// Move center of mass.
b2Vec2 oldCenter = m_sweep.c;
m_sweep.localCenter = localCenter;
m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter);
// Update center of mass velocity.
m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter);
}
/// Get the world coordinates of a point given the local coordinates.
/// @param localPoint a point on the body measured relative the the body's origin.
/// @return the same point expressed in world coordinates.
b2Vec2 GetWorldPoint(b2Vec2 localPoint) const
{
return b2Mul(m_xf, localPoint);
}
/// Get the world coordinates of a vector given the local coordinates.
/// @param localVector a vector fixed in the body.
/// @return the same vector expressed in world coordinates.
b2Vec2 GetWorldVector(b2Vec2 localVector) const
{
return b2Mul(m_xf.q, localVector);
}
/// Gets a local point relative to the body's origin given a world point.
/// @param a point in world coordinates.
/// @return the corresponding local point relative to the body's origin.
b2Vec2 GetLocalPoint(b2Vec2 worldPoint) const
{
return b2MulT(m_xf, worldPoint);
}
/// Gets a local vector given a world vector.
/// @param a vector in world coordinates.
/// @return the corresponding local vector.
b2Vec2 GetLocalVector(b2Vec2 worldVector) const
{
return b2MulT(m_xf.q, worldVector);
}
/// Get the world linear velocity of a world point attached to this body.
/// @param a point in world coordinates.
/// @return the world velocity of a point.
b2Vec2 GetLinearVelocityFromWorldPoint(b2Vec2 worldPoint) const
{
return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c);
}
/// Get the world velocity of a local point.
/// @param a point in local coordinates.
/// @return the world velocity of a point.
b2Vec2 GetLinearVelocityFromLocalPoint(b2Vec2 localPoint) const
{
return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint));
}
/// Get the linear damping of the body.
float32 GetLinearDamping() const
{
return m_linearDamping;
}
/// Set the linear damping of the body.
void SetLinearDamping(float32 linearDamping)
{
m_linearDamping = linearDamping;
}
/// Get the linear damping of the body.
float32 GetAngularDamping() const
{
return m_angularDamping;
}
/// Set the linear damping of the body.
void SetAngularDamping(float32 angularDamping)
{
m_angularDamping = angularDamping;
}
/// Get the gravity scale of the body.
float32 GetGravityScale() const
{
return m_gravityScale;
}
/// Set the gravity scale of the body.
void SetGravityScale(float32 scale)
{
m_gravityScale = scale;
}
/// Get the type of this body.
b2BodyType GetType() const
{
return m_type;
}
/// Set the type of this body. This may alter the mass and velocity.
void SetType(b2BodyType type)
{
assert(m_world);
assert(m_world.IsLocked() == false);
if (m_world.IsLocked() == true)
{
return;
}
if (m_type == type)
{
return;
}
m_type = type;
ResetMassData();
if (m_type == b2BodyType.b2_staticBody)
{
m_linearVelocity.SetZero();
m_angularVelocity = 0.0f;
m_sweep.a0 = m_sweep.a;
m_sweep.c0 = m_sweep.c;
SynchronizeFixtures();
}
SetAwake(true);
m_force.SetZero();
m_torque = 0.0f;
// Delete the attached contacts.
b2ContactEdge* ce = m_contactList;
while (ce)
{
b2ContactEdge* ce0 = ce;
ce = ce.next;
m_world.m_contactManager.Destroy(ce0.contact);
}
m_contactList = null;
// Touch the proxies so that new contacts will be created (when appropriate)
b2BroadPhase* broadPhase = &m_world.m_contactManager.m_broadPhase;
for (b2Fixture* f = m_fixtureList; f; f = f.m_next)
{
int32 proxyCount = f.m_proxyCount;
for (int32 i = 0; i < proxyCount; ++i)
{
broadPhase.TouchProxy(f.m_proxies[i].proxyId);
}
}
}
/// Is this body treated like a bullet for continuous collision detection?
bool IsBullet() const
{
return (m_flags & e_bulletFlag) == e_bulletFlag;
}
/// Should this body be treated like a bullet for continuous collision detection?
void SetBullet(bool flag)
{
if (flag)
{
m_flags |= e_bulletFlag;
}
else
{
m_flags &= ~e_bulletFlag;
}
}
/// Is this body allowed to sleep
bool IsSleepingAllowed() const
{
return (m_flags & e_autoSleepFlag) == e_autoSleepFlag;
}
/// You can disable sleeping on this body. If you disable sleeping, the
/// body will be woken.
void SetSleepingAllowed(bool flag)
{
if (flag)
{
m_flags |= e_autoSleepFlag;
}
else
{
m_flags &= ~e_autoSleepFlag;
SetAwake(true);
}
}
/// Get the sleeping state of this body.
/// @return true if the body is awake.
bool IsAwake() const
{
return (m_flags & e_awakeFlag) == e_awakeFlag;
}
/// Set the sleep state of the body. A sleeping body has very
/// low CPU cost.
/// @param flag set to true to wake the body, false to put it to sleep.
void SetAwake(bool flag)
{
if (flag)
{
if ((m_flags & e_awakeFlag) == 0)
{
m_flags |= e_awakeFlag;
m_sleepTime = 0.0f;
}
}
else
{
m_flags &= ~e_awakeFlag;
m_sleepTime = 0.0f;
m_linearVelocity.SetZero();
m_angularVelocity = 0.0f;
m_force.SetZero();
m_torque = 0.0f;
}
}
/// Get the active state of the body.
bool IsActive() const
{
return (m_flags & e_activeFlag) == e_activeFlag;
}
/// Set the active state of the body. An inactive body is not
/// simulated and cannot be collided with or woken up.
/// If you pass a flag of true, all fixtures will be added to the
/// broad-phase.
/// If you pass a flag of false, all fixtures will be removed from
/// the broad-phase and all contacts will be destroyed.
/// Fixtures and joints are otherwise unaffected. You may continue
/// to create/destroy fixtures and joints on inactive bodies.
/// Fixtures on an inactive body are implicitly inactive and will
/// not participate in collisions, ray-casts, or queries.
/// Joints connected to an inactive body are implicitly inactive.
/// An inactive body is still owned by a b2World object and remains
/// in the body list.
void SetActive(bool flag)
{
assert(m_world.IsLocked() == false);
if (flag == IsActive())
{
return;
}
if (flag)
{
m_flags |= e_activeFlag;
// Create all proxies.
b2BroadPhase* broadPhase = &m_world.m_contactManager.m_broadPhase;
for (b2Fixture* f = m_fixtureList; f; f = f.m_next)
{
f.CreateProxies(broadPhase, m_xf);
}
// Contacts are created the next time step.
}
else
{
m_flags &= ~e_activeFlag;
// Destroy all proxies.
b2BroadPhase* broadPhase = &m_world.m_contactManager.m_broadPhase;
for (b2Fixture* f = m_fixtureList; f; f = f.m_next)
{
f.DestroyProxies(broadPhase);
}
// Destroy the attached contacts.
b2ContactEdge* ce = m_contactList;
while (ce)
{
b2ContactEdge* ce0 = ce;
ce = ce.next;
m_world.m_contactManager.Destroy(ce0.contact);
}
m_contactList = null;
}
}
/// Does this body have fixed rotation?
bool IsFixedRotation() const
{
return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag;
}
/// Set this body to have fixed rotation. This causes the mass
/// to be reset.
void SetFixedRotation(bool flag)
{
bool status = (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag;
if (status == flag)
{
return;
}
if (flag)
{
m_flags |= e_fixedRotationFlag;
}
else
{
m_flags &= ~e_fixedRotationFlag;
}
m_angularVelocity = 0.0f;
ResetMassData();
}
/// Get the list of all fixtures attached to this body.
inout(b2Fixture)* GetFixtureList() inout
{
return m_fixtureList;
}
/// Get the list of all joints attached to this body.
inout(b2JointEdge)* GetJointList() inout
{
return m_jointList;
}
/// Get the list of all contacts attached to this body.
/// @warning this list changes during the time step and you may
/// miss some collisions if you don't use b2ContactListener.
inout(b2ContactEdge)* GetContactList() inout
{
return m_contactList;
}
/// Get the next body in the world's body list.
inout(b2Body*) GetNext() inout
{
return m_next;
}
/// Get the user data pointer that was provided in the body definition.
void* GetUserData() const
{
return cast(void*)m_userData;
}
/// Set the user data. Use this to store your application specific data.
void SetUserData(void* data)
{
m_userData = data;
}
/// Get the parent world of this body.
inout(b2World*) GetWorld() inout
{
return m_world;
}
/// Dump this body to a log file
void Dump()
{
int32 bodyIndex = m_islandIndex;
b2Log("{\n");
b2Log(" b2BodyDef bd;\n");
b2Log(" bd.type = b2BodyType(%d);\n", m_type);
b2Log(" bd.position.Set(%.15lef, %.15lef);\n", m_xf.p.x, m_xf.p.y);
b2Log(" bd.angle = %.15lef;\n", m_sweep.a);
b2Log(" bd.linearVelocity.Set(%.15lef, %.15lef);\n", m_linearVelocity.x, m_linearVelocity.y);
b2Log(" bd.angularVelocity = %.15lef;\n", m_angularVelocity);
b2Log(" bd.linearDamping = %.15lef;\n", m_linearDamping);
b2Log(" bd.angularDamping = %.15lef;\n", m_angularDamping);
b2Log(" bd.allowSleep = bool(%d);\n", m_flags & e_autoSleepFlag);
b2Log(" bd.awake = bool(%d);\n", m_flags & e_awakeFlag);
b2Log(" bd.fixedRotation = bool(%d);\n", m_flags & e_fixedRotationFlag);
b2Log(" bd.bullet = bool(%d);\n", m_flags & e_bulletFlag);
b2Log(" bd.active = bool(%d);\n", m_flags & e_activeFlag);
b2Log(" bd.gravityScale = %.15lef;\n", m_gravityScale);
b2Log(" bodies[%d] = m_world.CreateBody(&bd);\n", m_islandIndex);
b2Log("\n");
for (b2Fixture* f = m_fixtureList; f; f = f.m_next)
{
b2Log(" {\n");
f.Dump(bodyIndex);
b2Log(" }\n");
}
b2Log("}\n");
}
// note: this should be package but D's access implementation is lacking.
// do not use in user code.
/* package: */
public:
///
this(const(b2BodyDef)* bd, b2World* world)
{
assert(bd.position.IsValid());
assert(bd.linearVelocity.IsValid());
assert(b2IsValid(bd.angle));
assert(b2IsValid(bd.angularVelocity));
assert(b2IsValid(bd.angularDamping) && bd.angularDamping >= 0.0f);
assert(b2IsValid(bd.linearDamping) && bd.linearDamping >= 0.0f);
m_flags = 0;
if (bd.bullet)
{
m_flags |= e_bulletFlag;
}
if (bd.fixedRotation)
{
m_flags |= e_fixedRotationFlag;
}
if (bd.allowSleep)
{
m_flags |= e_autoSleepFlag;
}
if (bd.awake)
{
m_flags |= e_awakeFlag;
}
if (bd.active)
{
m_flags |= e_activeFlag;
}
m_world = world;
m_xf.p = bd.position;
m_xf.q.Set(bd.angle);
m_sweep.localCenter.SetZero();
m_sweep.c0 = m_xf.p;
m_sweep.c = m_xf.p;
m_sweep.a0 = bd.angle;
m_sweep.a = bd.angle;
m_sweep.alpha0 = 0.0f;
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearVelocity = bd.linearVelocity;
m_angularVelocity = bd.angularVelocity;
m_linearDamping = bd.linearDamping;
m_angularDamping = bd.angularDamping;
m_gravityScale = bd.gravityScale;
m_force.SetZero();
m_torque = 0.0f;
m_sleepTime = 0.0f;
m_type = bd.type;
if (m_type == b2_dynamicBody)
{
m_mass = 1.0f;
m_invMass = 1.0f;
}
else
{
m_mass = 0.0f;
m_invMass = 0.0f;
}
m_I = 0.0f;
m_invI = 0.0f;
m_userData = cast(void*)bd.userData;
m_fixtureList = null;
m_fixtureCount = 0;
}
// m_flags
enum
{
e_islandFlag = 0x0001,
e_awakeFlag = 0x0002,
e_autoSleepFlag = 0x0004,
e_bulletFlag = 0x0008,
e_fixedRotationFlag = 0x0010,
e_activeFlag = 0x0020,
e_toiFlag = 0x0040
}
void SynchronizeFixtures()
{
b2Transform xf1;
xf1.q.Set(m_sweep.a0);
xf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter);
b2BroadPhase* broadPhase = &m_world.m_contactManager.m_broadPhase;
for (b2Fixture* f = m_fixtureList; f; f = f.m_next)
{
f.Synchronize(broadPhase, xf1, m_xf);
}
}
void SynchronizeTransform()
{
m_xf.q.Set(m_sweep.a);
m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter);
}
bool ShouldCollide(const(b2Body*) other) const
{
// At least one body should be dynamic.
if (m_type != b2_dynamicBody && other.m_type != b2_dynamicBody)
{
return false;
}
// Does a joint prevent collision?
for (b2JointEdge* jn = cast(b2JointEdge*)m_jointList; jn; jn = jn.next)
{
if (jn.other == other)
{
if (jn.joint.m_collideConnected == false)
{
return false;
}
}
}
return true;
}
void Advance(float32 alpha)
{
// Advance to the new safe time. This doesn't sync the broad-phase.
m_sweep.Advance(alpha);
m_sweep.c = m_sweep.c0;
m_sweep.a = m_sweep.a0;
m_xf.q.Set(m_sweep.a);
m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter);
}
b2BodyType m_type;
uint16 m_flags;
int32 m_islandIndex;
b2Transform m_xf; // the body origin transform
b2Sweep m_sweep; // the swept motion for CCD
b2Vec2 m_linearVelocity;
float32 m_angularVelocity = 0;
b2Vec2 m_force;
float32 m_torque = 0;
b2World* m_world;
b2Body* m_prev;
b2Body* m_next;
b2Fixture* m_fixtureList;
int32 m_fixtureCount;
b2JointEdge* m_jointList;
b2ContactEdge* m_contactList;
float32 m_mass = 0, m_invMass = 0;
// Rotational inertia about the center of mass.
float32 m_I = 0, m_invI = 0;
float32 m_linearDamping = 0;
float32 m_angularDamping = 0;
float32 m_gravityScale = 0;
float32 m_sleepTime = 0;
void* m_userData;
}
|
D
|
module ecs.entities.entity;
@safe
struct EntityID
{
import std.typecons;
private ulong id;
mixin Proxy!id;
this(ulong id)
{
this.id = id;
}
bool opEquals()(auto ref const EntityID other) const { return id == other.id; }
}
|
D
|
/Users/mac/Desktop/Young心理/DerivedData/Young心理/Build/Intermediates/Young心理.build/Debug-iphonesimulator/Young心理.build/Objects-normal/x86_64/AppDelegate.o : /Users/mac/Desktop/Young心理/Young心理/AppDelegate.swift /Users/mac/Desktop/Young心理/Young心理/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/mac/Desktop/Young心理/DerivedData/Young心理/Build/Intermediates/Young心理.build/Debug-iphonesimulator/Young心理.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/mac/Desktop/Young心理/Young心理/AppDelegate.swift /Users/mac/Desktop/Young心理/Young心理/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/mac/Desktop/Young心理/DerivedData/Young心理/Build/Intermediates/Young心理.build/Debug-iphonesimulator/Young心理.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/mac/Desktop/Young心理/Young心理/AppDelegate.swift /Users/mac/Desktop/Young心理/Young心理/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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
|
D
|
/+
+ Copyright (c) Charles Petzold, 1998.
+ Ported to the D Programming Language by Andrej Mitrovic, 2011.
+/
module Metafile;
import core.memory;
import core.runtime;
import core.thread;
import std.conv;
import std.math;
import std.range;
import std.string;
import std.utf;
pragma(lib, "gdi32.lib");
pragma(lib, "comdlg32.lib");
import core.sys.windows.windef;
import core.sys.windows.winuser;
import core.sys.windows.wingdi;
import core.sys.windows.winbase;
import core.sys.windows.commdlg;
string appName = "Metafile";
string description = "Metafile Demonstration";
HINSTANCE hinst;
extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
{
int result;
try
{
Runtime.initialize();
result = myWinMain(hInstance, hPrevInstance, lpCmdLine, iCmdShow);
Runtime.terminate();
}
catch (Throwable o)
{
MessageBox(null, o.toString().toUTF16z, "Error", MB_OK | MB_ICONEXCLAMATION);
result = 0;
}
return result;
}
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
{
hinst = hInstance;
HACCEL hAccel;
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = &WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = cast(HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = appName.toUTF16z;
wndclass.lpszClassName = appName.toUTF16z;
if (!RegisterClass(&wndclass))
{
MessageBox(NULL, "This program requires Windows NT!", appName.toUTF16z, MB_ICONERROR);
return 0;
}
hwnd = CreateWindow(appName.toUTF16z, // window class name
description.toUTF16z, // window caption
WS_OVERLAPPEDWINDOW, // window style
CW_USEDEFAULT, // initial x position
CW_USEDEFAULT, // initial y position
CW_USEDEFAULT, // initial x size
CW_USEDEFAULT, // initial y size
NULL, // parent window handle
NULL, // window menu handle
hInstance, // program instance handle
NULL); // creation parameters
ShowWindow(hwnd, iCmdShow);
UpdateWindow(hwnd);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
extern (Windows)
LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) nothrow
{
scope (failure) assert(0);
static HMETAFILE hmf;
static int cxClient, cyClient;
HBRUSH hBrush;
HDC hdc, hdcMeta;
int x, y;
PAINTSTRUCT ps;
switch (message)
{
case WM_CREATE:
hdcMeta = CreateMetaFile(NULL);
hBrush = CreateSolidBrush(RGB(0, 0, 255));
Rectangle(hdcMeta, 0, 0, 100, 100);
MoveToEx(hdcMeta, 0, 0, NULL);
LineTo(hdcMeta, 100, 100);
MoveToEx(hdcMeta, 0, 100, NULL);
LineTo(hdcMeta, 100, 0);
SelectObject(hdcMeta, hBrush);
Ellipse(hdcMeta, 20, 20, 80, 80);
hmf = CloseMetaFile(hdcMeta);
DeleteObject(hBrush);
return 0;
case WM_SIZE:
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);
return 0;
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
SetMapMode(hdc, MM_ANISOTROPIC);
SetWindowExtEx(hdc, 1000, 1000, NULL);
SetViewportExtEx(hdc, cxClient, cyClient, NULL);
for (x = 0; x < 10; x++)
for (y = 0; y < 10; y++)
{
SetWindowOrgEx(hdc, -100 * x, -100 * y, NULL);
PlayMetaFile(hdc, hmf);
}
EndPaint(hwnd, &ps);
return 0;
case WM_DESTROY:
DeleteMetaFile(hmf);
PostQuitMessage(0);
return 0;
default:
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
|
D
|
// Written in the D programming language.
/**
* Encode and decode UTF-8, UTF-16 and UTF-32 strings.
*
* For Win32 systems, the C wchar_t type is UTF-16 and corresponds to the D
* wchar type.
* For linux systems, the C wchar_t type is UTF-32 and corresponds to
* the D utf.dchar type.
*
* UTF character support is restricted to (\u0000 <= character <= \U0010FFFF).
*
* See_Also:
* $(LINK2 http://en.wikipedia.org/wiki/Unicode, Wikipedia)<br>
* $(LINK http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8)<br>
* $(LINK http://anubis.dkuug.dk/JTC1/SC2/WG2/docs/n1335)
* Macros:
* WIKI = Phobos/StdUtf
*
* Copyright: Copyright Digital Mars 2000 - 2010.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: $(WEB digitalmars.com, Walter Bright)
* Source: $(PHOBOSSRC std/_utf.d)
*/
/* Copyright Digital Mars 2000 - 2010.
* 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 std.utf;
import std.conv; // to, assumeUnique
import std.exception; // enforce, assumeUnique
import std.range; // walkLength
import std.traits; // isSomeChar, isSomeString
//debug=utf; // uncomment to turn on debugging printf's
debug (utf) import core.stdc.stdio : printf;
/**********************************
* Exception class that is thrown upon any errors.
*/
class UtfException : Exception
{
//size_t idx; /// index in string of where error occurred
uint[4] sequence;
size_t len;
this(string s, dchar[] data...)
{
len = data.length;
foreach (i, e; data) sequence[i] = e;
super(s);
}
override string toString()
{
string result;
if (len > 0)
{
result = "Invalid UTF sequence:";
foreach (i; 0 .. len)
result ~= " " ~ to!string(sequence[i], 16);
}
if (super.msg.length > 0)
{
if (result.length > 0)
result ~= " - ";
result ~= super.msg;
}
return result;
}
}
// For unittests
version (unittest) private
{
@trusted
bool expectError_(lazy void expr)
{
try
{
expr();
}
catch (UtfException e)
{
return true;
}
return false;
}
}
/*******************************
* Test if c is a valid UTF-32 character.
*
* \uFFFE and \uFFFF are considered valid by this function,
* as they are permitted for internal use by an application,
* but they are not allowed for interchange by the Unicode standard.
*
* Returns: true if it is, false if not.
*/
@safe
pure nothrow bool isValidDchar(dchar c)
{
/* Note: FFFE and FFFF are specifically permitted by the
* Unicode standard for application internal use, but are not
* allowed for interchange.
* (thanks to Arcane Jill)
*/
return c < 0xD800 ||
(c > 0xDFFF && c <= 0x10FFFF /*&& c != 0xFFFE && c != 0xFFFF*/);
}
unittest
{
debug(utf) printf("utf.isValidDchar.unittest\n");
assert(isValidDchar(cast(dchar)'a') == true);
assert(isValidDchar(cast(dchar)0x1FFFFF) == false);
assert(!isValidDchar(cast(dchar)0x00D800));
assert(!isValidDchar(cast(dchar)0x00DBFF));
assert(!isValidDchar(cast(dchar)0x00DC00));
assert(!isValidDchar(cast(dchar)0x00DFFF));
assert(isValidDchar(cast(dchar)0x00FFFE));
assert(isValidDchar(cast(dchar)0x00FFFF));
assert(isValidDchar(cast(dchar)0x01FFFF));
assert(isValidDchar(cast(dchar)0x10FFFF));
assert(!isValidDchar(cast(dchar)0x110000));
}
@safe pure
{
private immutable ubyte[256] UTF8stride =
[
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,5,5,5,5,6,6,0xFF,0xFF,
];
/**
* stride() returns the length of a UTF-8 sequence starting at index $(D_PARAM i)
* in string $(D_PARAM s).
* Returns:
* The number of bytes in the UTF-8 sequence.
* Throws:
* UtfException if s[i] is not the start of the UTF-8 sequence.
*/
uint stride(in char[] s, size_t i)
{
immutable result = UTF8stride[s[i]];
if (result == 0xFF)
throw new UtfException("Not the start of the UTF-8 sequence");
return result;
}
/**
* stride() returns the length of a UTF-16 sequence starting at index $(D_PARAM i)
* in string $(D_PARAM s).
*/
nothrow uint stride(in wchar[] s, size_t i)
{
immutable uint u = s[i];
return 1 + (u >= 0xD800 && u <= 0xDBFF);
}
/**
* stride() returns the length of a UTF-32 sequence starting at index $(D_PARAM i)
* in string $(D_PARAM s).
* Returns: The return value will always be 1.
*/
nothrow uint stride(in dchar[] s, size_t i)
{
return 1;
}
} // stride functions are @safe and pure
@safe pure
{
/*******************************************
* Given an index $(D_PARAM i) into an array of characters $(D_PARAM s[]),
* and assuming that index $(D_PARAM i) is at the start of a UTF character,
* determine the number of UCS characters up to that index $(D_PARAM i).
*/
size_t toUCSindex(in char[] s, size_t i)
{
size_t n;
size_t j;
for (j = 0; j < i; )
{
j += stride(s, j);
n++;
}
if (j > i)
{
throw new UtfException("1invalid UTF-8 sequence");
}
return n;
}
/// ditto
size_t toUCSindex(in wchar[] s, size_t i)
{
size_t n;
size_t j;
for (j = 0; j < i; )
{
j += stride(s, j);
n++;
}
if (j > i)
{
throw new UtfException("2invalid UTF-16 sequence");
}
return n;
}
/// ditto
nothrow size_t toUCSindex(in dchar[] s, size_t i)
{
return i;
}
/******************************************
* Given a UCS index $(D_PARAM n) into an array of characters $(D_PARAM s[]),
* return the UTF index.
*/
size_t toUTFindex(in char[] s, size_t n)
{
size_t i;
while (n--)
{
uint j = UTF8stride[s[i]];
if (j == 0xFF)
throw new UtfException("3invalid UTF-8 sequence ", s[i]);
i += j;
}
return i;
}
/// ditto
nothrow size_t toUTFindex(in wchar[] s, size_t n)
{
size_t i;
while (n--)
{
wchar u = s[i];
i += 1 + (u >= 0xD800 && u <= 0xDBFF);
}
return i;
}
/// ditto
nothrow size_t toUTFindex(in dchar[] s, size_t n)
{
return n;
}
} // toUTF and toUCS index functions are @safe and pure
/* =================== Decode ======================= */
@trusted // I think those functions should be @safe and pure.
{
/***************
* Decodes and returns character starting at s[idx]. $(D_PARAM idx) is
* advanced past the decoded character. If the character is not well formed,
* a $(D UtfException) is thrown and $(D_PARAM idx) remains unchanged.
*/
dchar decode(in char[] s, ref size_t idx)
out (result)
{
assert(isValidDchar(result));
}
body
{
enforce(idx < s.length, "Attempted to decode past the end of a string");
size_t len = s.length;
dchar V;
size_t i = idx;
char u = s[i];
if (u & 0x80)
{
/* The following encodings are valid, except for the 5 and 6 byte
* combinations:
* 0xxxxxxx
* 110xxxxx 10xxxxxx
* 1110xxxx 10xxxxxx 10xxxxxx
* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
* 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
*/
uint n = 1;
for (; ; n++)
{
if (n > 4)
goto Lerr; // only do the first 4 of 6 encodings
if (((u << n) & 0x80) == 0)
{
if (n == 1)
goto Lerr;
break;
}
}
// Pick off (7 - n) significant bits of B from first byte of octet
V = cast(dchar)(u & ((1 << (7 - n)) - 1));
if (i + n > len)
goto Lerr; // off end of string
/* The following combinations are overlong, and illegal:
* 1100000x (10xxxxxx)
* 11100000 100xxxxx (10xxxxxx)
* 11110000 1000xxxx (10xxxxxx 10xxxxxx)
* 11111000 10000xxx (10xxxxxx 10xxxxxx 10xxxxxx)
* 11111100 100000xx (10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx)
*/
auto u2 = s[i + 1];
if ((u & 0xFE) == 0xC0 ||
(u == 0xE0 && (u2 & 0xE0) == 0x80) ||
(u == 0xF0 && (u2 & 0xF0) == 0x80) ||
(u == 0xF8 && (u2 & 0xF8) == 0x80) ||
(u == 0xFC && (u2 & 0xFC) == 0x80))
goto Lerr; // overlong combination
foreach (j; 1 .. n)
{
u = s[i + j];
if ((u & 0xC0) != 0x80)
goto Lerr; // trailing bytes are 10xxxxxx
V = (V << 6) | (u & 0x3F);
}
if (!isValidDchar(V))
goto Lerr;
i += n;
}
else
{
V = cast(dchar)u;
i++;
}
idx = i;
return V;
Lerr:
//printf("\ndecode: idx = %d, i = %d, length = %d s = \n'%.*s'\n%x\n"
//"'%.*s'\n", idx, i, s.length, s, s[i], s[i .. $]);
throw new UtfException(text("dchar decode(in char[], ref size_t): "
"Invalid UTF-8 sequence ", cast(const ubyte[])s,
" around index ", i));
}
unittest
{
size_t i;
dchar c;
debug(utf) printf("utf.decode.unittest\n");
static string s1 = "abcd";
i = 0;
c = decode(s1, i);
assert(c == cast(dchar)'a');
assert(i == 1);
c = decode(s1, i);
assert(c == cast(dchar)'b');
assert(i == 2);
static string s2 = "\xC2\xA9";
i = 0;
c = decode(s2, i);
assert(c == cast(dchar)'\u00A9');
assert(i == 2);
static string s3 = "\xE2\x89\xA0";
i = 0;
c = decode(s3, i);
assert(c == cast(dchar)'\u2260');
assert(i == 3);
static string[] s4 = [
"\xE2\x89", // too short
"\xC0\x8A",
"\xE0\x80\x8A",
"\xF0\x80\x80\x8A",
"\xF8\x80\x80\x80\x8A",
"\xFC\x80\x80\x80\x80\x8A",
];
for (int j = 0; j < s4.length; j++)
{
try
{
i = 0;
c = decode(s4[j], i);
assert(0);
}
catch (UtfException u)
{
i = 23;
delete u;
}
assert(i == 23);
}
}
unittest
{
size_t i;
i = 0; assert(decode("\xEF\xBF\xBE"c, i) == cast(dchar)0xFFFE);
i = 0; assert(decode("\xEF\xBF\xBF"c, i) == cast(dchar)0xFFFF);
i = 0;
assert(expectError_( decode("\xED\xA0\x80"c, i) ));
assert(expectError_( decode("\xED\xAD\xBF"c, i) ));
assert(expectError_( decode("\xED\xAE\x80"c, i) ));
assert(expectError_( decode("\xED\xAF\xBF"c, i) ));
assert(expectError_( decode("\xED\xB0\x80"c, i) ));
assert(expectError_( decode("\xED\xBE\x80"c, i) ));
assert(expectError_( decode("\xED\xBF\xBF"c, i) ));
}
/// ditto
dchar decode(in wchar[] s, ref size_t idx)
out (result)
{
assert(isValidDchar(result));
}
body
{
enforce(idx < s.length, "Attempted to decode past the end of a string");
string msg;
dchar V;
size_t i = idx;
uint u = s[i];
if (u & ~0x7F)
{
if (u >= 0xD800 && u <= 0xDBFF)
{
uint u2;
if (i + 1 == s.length)
{
msg = "surrogate UTF-16 high value past end of string";
goto Lerr;
}
u2 = s[i + 1];
if (u2 < 0xDC00 || u2 > 0xDFFF)
{
msg = "surrogate UTF-16 low value out of range";
goto Lerr;
}
u = ((u - 0xD7C0) << 10) + (u2 - 0xDC00);
i += 2;
}
else if (u >= 0xDC00 && u <= 0xDFFF)
{
msg = "unpaired surrogate UTF-16 value";
goto Lerr;
}
else
i++;
// Note: u+FFFE and u+FFFF are specifically permitted by the
// Unicode standard for application internal use (see isValidDchar)
}
else
{
i++;
}
idx = i;
return cast(dchar)u;
Lerr:
throw new UtfException(msg, s[i]);
}
unittest
{
size_t i;
i = 0; assert(decode([ cast(wchar)0xFFFE ], i) == cast(dchar)0xFFFE && i == 1);
i = 0; assert(decode([ cast(wchar)0xFFFF ], i) == cast(dchar)0xFFFF && i == 1);
}
/// ditto
dchar decode(in dchar[] s, ref size_t idx)
{
enforce(idx < s.length, "Attempted to decode past the end of a string");
size_t i = idx;
dchar c = s[i];
if (!isValidDchar(c))
goto Lerr;
idx = i + 1;
return c;
Lerr:
throw new UtfException("5invalid UTF-32 value", c);
}
} // Decode functions are @trusted
/* =================== Encode ======================= */
@safe // pure @@@NOTE@@@ unittest is a function. Currently, unittest is affected by applying attributes.
{
/*******************************
* Encodes character $(D_PARAM c) into fixed-size array $(D_PARAM s).
* Returns the actual length of the encoded character (a number between 1 and
* 4 for $(D char[4]) buffers, and between 1 and 2 for $(D wchar[2]) buffers).
*/
pure size_t encode(ref char[4] buf, dchar c)
{
if (c <= 0x7F)
{
assert(isValidDchar(c));
buf[0] = cast(char)c;
return 1;
}
if (c <= 0x7FF)
{
assert(isValidDchar(c));
buf[0] = cast(char)(0xC0 | (c >> 6));
buf[1] = cast(char)(0x80 | (c & 0x3F));
return 2;
}
if (c <= 0xFFFF)
{
if (0xD800 <= c && c <= 0xDFFF)
throw new UtfException("encoding a surrogate code point in UTF-8", c);
assert(isValidDchar(c));
buf[0] = cast(char)(0xE0 | (c >> 12));
buf[1] = cast(char)(0x80 | ((c >> 6) & 0x3F));
buf[2] = cast(char)(0x80 | (c & 0x3F));
return 3;
}
if (c <= 0x10FFFF)
{
assert(isValidDchar(c));
buf[0] = cast(char)(0xF0 | (c >> 18));
buf[1] = cast(char)(0x80 | ((c >> 12) & 0x3F));
buf[2] = cast(char)(0x80 | ((c >> 6) & 0x3F));
buf[3] = cast(char)(0x80 | (c & 0x3F));
return 4;
}
assert(!isValidDchar(c));
throw new UtfException("encoding an invalid code point in UTF-8", c);
}
unittest
{
char[4] buf;
assert(encode(buf, '\u0000') == 1 && buf[0 .. 1] == "\u0000");
assert(encode(buf, '\u007F') == 1 && buf[0 .. 1] == "\u007F");
assert(encode(buf, '\u0080') == 2 && buf[0 .. 2] == "\u0080");
assert(encode(buf, '\u07FF') == 2 && buf[0 .. 2] == "\u07FF");
assert(encode(buf, '\u0800') == 3 && buf[0 .. 3] == "\u0800");
assert(encode(buf, '\uD7FF') == 3 && buf[0 .. 3] == "\uD7FF");
assert(encode(buf, '\uE000') == 3 && buf[0 .. 3] == "\uE000");
assert(encode(buf, 0xFFFE) == 3 && buf[0 .. 3] == "\xEF\xBF\xBE");
assert(encode(buf, 0xFFFF) == 3 && buf[0 .. 3] == "\xEF\xBF\xBF");
assert(encode(buf, '\U00010000') == 4 && buf[0 .. 4] == "\U00010000");
assert(encode(buf, '\U0010FFFF') == 4 && buf[0 .. 4] == "\U0010FFFF");
assert(expectError_( encode(buf, cast(dchar)0xD800) ));
assert(expectError_( encode(buf, cast(dchar)0xDBFF) ));
assert(expectError_( encode(buf, cast(dchar)0xDC00) ));
assert(expectError_( encode(buf, cast(dchar)0xDFFF) ));
assert(expectError_( encode(buf, cast(dchar)0x110000) ));
}
/// Ditto
pure size_t encode(ref wchar[2] buf, dchar c)
{
if (c <= 0xFFFF)
{
if (0xD800 <= c && c <= 0xDFFF)
throw new UtfException("encoding an isolated surrogate code point in UTF-16", c);
assert(isValidDchar(c));
buf[0] = cast(wchar)c;
return 1;
}
if (c <= 0x10FFFF)
{
assert(isValidDchar(c));
buf[0] = cast(wchar)((((c - 0x10000) >> 10) & 0x3FF) + 0xD800);
buf[1] = cast(wchar)(((c - 0x10000) & 0x3FF) + 0xDC00);
return 2;
}
assert(!isValidDchar(c));
throw new UtfException("encoding an invalid code point in UTF-16", c);
}
unittest
{
wchar[2] buf;
assert(encode(buf, '\u0000') == 1 && buf[0 .. 1] == "\u0000");
assert(encode(buf, '\uD7FF') == 1 && buf[0 .. 1] == "\uD7FF");
assert(encode(buf, '\uE000') == 1 && buf[0 .. 1] == "\uE000");
assert(encode(buf, 0xFFFE) == 1 && buf[0] == 0xFFFE);
assert(encode(buf, 0xFFFF) == 1 && buf[0] == 0xFFFF);
assert(encode(buf, '\U00010000') == 2 && buf[0 .. 2] == "\U00010000");
assert(encode(buf, '\U0010FFFF') == 2 && buf[0 .. 2] == "\U0010FFFF");
assert(expectError_( encode(buf, cast(dchar)0xD800) ));
assert(expectError_( encode(buf, cast(dchar)0xDBFF) ));
assert(expectError_( encode(buf, cast(dchar)0xDC00) ));
assert(expectError_( encode(buf, cast(dchar)0xDFFF) ));
assert(expectError_( encode(buf, cast(dchar)0x110000) ));
}
/*******************************
* Encodes character $(D_PARAM c) and appends it to array $(D_PARAM s[]).
*/
pure void encode(ref char[] s, dchar c)
{
char[] r = s;
if (c <= 0x7F)
{
assert(isValidDchar(c));
r ~= cast(char)c;
}
else
{
char[4] buf;
uint L;
if (c <= 0x7FF)
{
assert(isValidDchar(c));
buf[0] = cast(char)(0xC0 | (c >> 6));
buf[1] = cast(char)(0x80 | (c & 0x3F));
L = 2;
}
else if (c <= 0xFFFF)
{
if (0xD800 <= c && c <= 0xDFFF)
throw new UtfException("encoding a surrogate code point in UTF-8", c);
assert(isValidDchar(c));
buf[0] = cast(char)(0xE0 | (c >> 12));
buf[1] = cast(char)(0x80 | ((c >> 6) & 0x3F));
buf[2] = cast(char)(0x80 | (c & 0x3F));
L = 3;
}
else if (c <= 0x10FFFF)
{
assert(isValidDchar(c));
buf[0] = cast(char)(0xF0 | (c >> 18));
buf[1] = cast(char)(0x80 | ((c >> 12) & 0x3F));
buf[2] = cast(char)(0x80 | ((c >> 6) & 0x3F));
buf[3] = cast(char)(0x80 | (c & 0x3F));
L = 4;
}
else
{
assert(!isValidDchar(c));
throw new UtfException("encoding an invalid code point in UTF-8", c);
}
r ~= buf[0 .. L];
}
s = r;
}
unittest
{
debug(utf) printf("utf.encode.unittest\n");
char[] s = "abcd".dup;
encode(s, cast(dchar)'a');
assert(s.length == 5);
assert(s == "abcda");
encode(s, cast(dchar)'\u00A9');
assert(s.length == 7);
assert(s == "abcda\xC2\xA9");
//assert(s == "abcda\u00A9"); // BUG: fix compiler
encode(s, cast(dchar)'\u2260');
assert(s.length == 10);
assert(s == "abcda\xC2\xA9\xE2\x89\xA0");
}
unittest
{
char[] buf;
encode(buf, '\u0000'); assert(buf[0 .. $] == "\u0000");
encode(buf, '\u007F'); assert(buf[1 .. $] == "\u007F");
encode(buf, '\u0080'); assert(buf[2 .. $] == "\u0080");
encode(buf, '\u07FF'); assert(buf[4 .. $] == "\u07FF");
encode(buf, '\u0800'); assert(buf[6 .. $] == "\u0800");
encode(buf, '\uD7FF'); assert(buf[9 .. $] == "\uD7FF");
encode(buf, '\uE000'); assert(buf[12 .. $] == "\uE000");
encode(buf, 0xFFFE); assert(buf[15 .. $] == "\xEF\xBF\xBE");
encode(buf, 0xFFFF); assert(buf[18 .. $] == "\xEF\xBF\xBF");
encode(buf, '\U00010000'); assert(buf[21 .. $] == "\U00010000");
encode(buf, '\U0010FFFF'); assert(buf[25 .. $] == "\U0010FFFF");
assert(expectError_( encode(buf, cast(dchar)0xD800) ));
assert(expectError_( encode(buf, cast(dchar)0xDBFF) ));
assert(expectError_( encode(buf, cast(dchar)0xDC00) ));
assert(expectError_( encode(buf, cast(dchar)0xDFFF) ));
assert(expectError_( encode(buf, cast(dchar)0x110000) ));
}
/// ditto
pure void encode(ref wchar[] s, dchar c)
{
wchar[] r = s;
if (c <= 0xFFFF)
{
if (0xD800 <= c && c <= 0xDFFF)
throw new UtfException("encoding an isolated surrogate code point in UTF-16", c);
assert(isValidDchar(c));
r ~= cast(wchar)c;
}
else if (c <= 0x10FFFF)
{
wchar[2] buf;
assert(isValidDchar(c));
buf[0] = cast(wchar)((((c - 0x10000) >> 10) & 0x3FF) + 0xD800);
buf[1] = cast(wchar)(((c - 0x10000) & 0x3FF) + 0xDC00);
r ~= buf;
}
else
{
assert(!isValidDchar(c));
throw new UtfException("encoding an invalid code point in UTF-16", c);
}
s = r;
}
unittest
{
wchar[] buf;
encode(buf, '\u0000'); assert(buf[0] == '\u0000');
encode(buf, '\uD7FF'); assert(buf[1] == '\uD7FF');
encode(buf, '\uE000'); assert(buf[2] == '\uE000');
encode(buf, 0xFFFE); assert(buf[3] == 0xFFFE);
encode(buf, 0xFFFF); assert(buf[4] == 0xFFFF);
encode(buf, '\U00010000'); assert(buf[5 .. $] == "\U00010000");
encode(buf, '\U0010FFFF'); assert(buf[7 .. $] == "\U0010FFFF");
assert(expectError_( encode(buf, cast(dchar)0xD800) ));
assert(expectError_( encode(buf, cast(dchar)0xDBFF) ));
assert(expectError_( encode(buf, cast(dchar)0xDC00) ));
assert(expectError_( encode(buf, cast(dchar)0xDFFF) ));
assert(expectError_( encode(buf, cast(dchar)0x110000) ));
}
/// ditto
pure void encode(ref dchar[] s, dchar c)
{
if ((0xD800 <= c && c <= 0xDFFF) || 0x10FFFF < c)
throw new UtfException("encoding an invalid code point in UTF-32", c);
assert(isValidDchar(c));
s ~= c;
}
unittest
{
dchar[] buf;
encode(buf, '\u0000'); assert(buf[0] == '\u0000');
encode(buf, '\uD7FF'); assert(buf[1] == '\uD7FF');
encode(buf, '\uE000'); assert(buf[2] == '\uE000');
encode(buf, 0xFFFE ); assert(buf[3] == 0xFFFE);
encode(buf, 0xFFFF ); assert(buf[4] == 0xFFFF);
encode(buf, '\U0010FFFF'); assert(buf[5] == '\U0010FFFF');
assert(expectError_( encode(buf, cast(dchar)0xD800) ));
assert(expectError_( encode(buf, cast(dchar)0xDBFF) ));
assert(expectError_( encode(buf, cast(dchar)0xDC00) ));
assert(expectError_( encode(buf, cast(dchar)0xDFFF) ));
assert(expectError_( encode(buf, cast(dchar)0x110000) ));
}
} // Encode functions are @safe and pure
/**
* Returns the code length of $(D_PARAM c) in the encoding using $(D_PARAM C)
* as a code point. The code is returned in character count, not in bytes.
*/
@safe
pure nothrow ubyte codeLength(C)(dchar c)
{
static if (C.sizeof == 1)
{
return
c <= 0x7F ? 1
: c <= 0x7FF ? 2
: c <= 0xFFFF ? 3
: c <= 0x10FFFF ? 4
: (assert(false), 6);
}
else static if (C.sizeof == 2)
{
return c <= 0xFFFF ? 1 : 2;
}
else
{
static assert(C.sizeof == 4);
return 1;
}
}
/* =================== Validation ======================= */
/***********************************
* Checks to see if string is well formed or not. $(D S) can be an array
* of $(D char), $(D wchar), or $(D dchar). Throws a $(D UtfException)
* if it is not. Use to check all untrusted input for correctness.
*/
@safe
void validate(S)(in S s) if (isSomeString!S)
{
immutable len = s.length;
for (size_t i = 0; i < len; )
{
decode(s, i);
}
}
/* =================== Conversion to UTF8 ======================= */
@trusted
{
char[] toUTF8(out char[4] buf, dchar c)
in
{
assert(isValidDchar(c));
}
body
{
if (c <= 0x7F)
{
buf[0] = cast(char)c;
return buf[0 .. 1];
}
else if (c <= 0x7FF)
{
buf[0] = cast(char)(0xC0 | (c >> 6));
buf[1] = cast(char)(0x80 | (c & 0x3F));
return buf[0 .. 2];
}
else if (c <= 0xFFFF)
{
buf[0] = cast(char)(0xE0 | (c >> 12));
buf[1] = cast(char)(0x80 | ((c >> 6) & 0x3F));
buf[2] = cast(char)(0x80 | (c & 0x3F));
return buf[0 .. 3];
}
else if (c <= 0x10FFFF)
{
buf[0] = cast(char)(0xF0 | (c >> 18));
buf[1] = cast(char)(0x80 | ((c >> 12) & 0x3F));
buf[2] = cast(char)(0x80 | ((c >> 6) & 0x3F));
buf[3] = cast(char)(0x80 | (c & 0x3F));
return buf[0 .. 4];
}
assert(0);
}
/*******************
* Encodes string $(D_PARAM s) into UTF-8 and returns the encoded string.
*/
string toUTF8(in char[] s)
{
validate(s);
return s.idup;
}
/// ditto
string toUTF8(in wchar[] s)
{
char[] r;
size_t i;
size_t slen = s.length;
r.length = slen;
for (i = 0; i < slen; i++)
{
wchar c = s[i];
if (c <= 0x7F)
r[i] = cast(char)c; // fast path for ascii
else
{
r.length = i;
while (i < slen)
encode(r, decode(s, i));
break;
}
}
return r.assumeUnique();
}
/// ditto
pure string toUTF8(in dchar[] s)
{
char[] r;
size_t i;
size_t slen = s.length;
r.length = slen;
for (i = 0; i < slen; i++)
{
dchar c = s[i];
if (c <= 0x7F)
r[i] = cast(char)c; // fast path for ascii
else
{
r.length = i;
foreach (dchar d; s[i .. slen])
{
encode(r, d);
}
break;
}
}
return r.assumeUnique();
}
/* =================== Conversion to UTF16 ======================= */
pure wchar[] toUTF16(ref wchar[2] buf, dchar c)
in
{
assert(isValidDchar(c));
}
body
{
if (c <= 0xFFFF)
{
buf[0] = cast(wchar)c;
return buf[0 .. 1];
}
else
{
buf[0] = cast(wchar)((((c - 0x10000) >> 10) & 0x3FF) + 0xD800);
buf[1] = cast(wchar)(((c - 0x10000) & 0x3FF) + 0xDC00);
return buf[0 .. 2];
}
}
/****************
* Encodes string $(D_PARAM s) into UTF-16 and returns the encoded string.
* toUTF16z() is suitable for calling the 'W' functions in the Win32 API that take
* an LPWSTR or LPCWSTR argument.
*/
wstring toUTF16(in char[] s)
{
wchar[] r;
size_t slen = s.length;
r.length = slen;
r.length = 0;
for (size_t i = 0; i < slen; )
{
dchar c = s[i];
if (c <= 0x7F)
{
i++;
r ~= cast(wchar)c;
}
else
{
c = decode(s, i);
encode(r, c);
}
}
return r.assumeUnique(); // ok because r is unique
}
/// ditto
const(wchar)* toUTF16z(in char[] s)
{
wchar[] r;
size_t slen = s.length;
r.length = slen + 1;
r.length = 0;
for (size_t i = 0; i < slen; )
{
dchar c = s[i];
if (c <= 0x7F)
{
i++;
r ~= cast(wchar)c;
}
else
{
c = decode(s, i);
encode(r, c);
}
}
r ~= "\000";
return r.ptr;
}
/// ditto
wstring toUTF16(in wchar[] s)
{
validate(s);
return s.idup;
}
/// ditto
pure wstring toUTF16(in dchar[] s)
{
wchar[] r;
size_t slen = s.length;
r.length = slen;
r.length = 0;
for (size_t i = 0; i < slen; i++)
{
encode(r, s[i]);
}
return r.assumeUnique(); // ok because r is unique
}
/* =================== Conversion to UTF32 ======================= */
/*****
* Encodes string $(D_PARAM s) into UTF-32 and returns the encoded string.
*/
dstring toUTF32(in char[] s)
{
dchar[] r;
size_t slen = s.length;
size_t j = 0;
r.length = slen; // r[] will never be longer than s[]
for (size_t i = 0; i < slen; )
{
dchar c = s[i];
if (c >= 0x80)
c = decode(s, i);
else
i++; // c is ascii, no need for decode
r[j++] = c;
}
return r[0 .. j].assumeUnique(); // legit because it's unique
}
/// ditto
dstring toUTF32(in wchar[] s)
{
dchar[] r;
size_t slen = s.length;
size_t j = 0;
r.length = slen; // r[] will never be longer than s[]
for (size_t i = 0; i < slen; )
{
dchar c = s[i];
if (c >= 0x80)
c = decode(s, i);
else
i++; // c is ascii, no need for decode
r[j++] = c;
}
return r[0 .. j].assumeUnique(); // legit because it's unique
}
/// ditto
dstring toUTF32(in dchar[] s)
{
validate(s);
return s.idup;
}
} // Convert functions are @safe
/* ================================ tests ================================== */
unittest
{
debug(utf) printf("utf.toUTF.unittest\n");
string c;
wstring w;
dstring d;
c = "hello";
w = toUTF16(c);
assert(w == "hello");
d = toUTF32(c);
assert(d == "hello");
c = toUTF8(w);
assert(c == "hello");
d = toUTF32(w);
assert(d == "hello");
c = toUTF8(d);
assert(c == "hello");
w = toUTF16(d);
assert(w == "hello");
c = "hel\u1234o";
w = toUTF16(c);
assert(w == "hel\u1234o");
d = toUTF32(c);
assert(d == "hel\u1234o");
c = toUTF8(w);
assert(c == "hel\u1234o");
d = toUTF32(w);
assert(d == "hel\u1234o");
c = toUTF8(d);
assert(c == "hel\u1234o");
w = toUTF16(d);
assert(w == "hel\u1234o");
c = "he\U0010AAAAllo";
w = toUTF16(c);
//foreach (wchar c; w) printf("c = x%x\n", c);
//foreach (wchar c; cast(wstring)"he\U0010AAAAllo") printf("c = x%x\n", c);
assert(w == "he\U0010AAAAllo");
d = toUTF32(c);
assert(d == "he\U0010AAAAllo");
c = toUTF8(w);
assert(c == "he\U0010AAAAllo");
d = toUTF32(w);
assert(d == "he\U0010AAAAllo");
c = toUTF8(d);
assert(c == "he\U0010AAAAllo");
w = toUTF16(d);
assert(w == "he\U0010AAAAllo");
}
/**
* Returns the total number of code points encoded in a string.
*
* The input to this function MUST be validly encoded.
*
* Supercedes: This function supercedes $(D std.utf.toUCSindex()).
*
* Standards: Unicode 5.0, ASCII, ISO-8859-1, WINDOWS-1252
*
* Params:
* s = the string to be counted
*/
@trusted
size_t count(E)(const(E)[] s) if (isSomeChar!E)
{
static if (E.sizeof < 4)
{
return walkLength(s);
//size_t result = 0;
//while (!s.empty)
//{
// ++result;
// s.popFront();
//}
//return result;
}
else
{
return s.length;
}
}
unittest
{
assert(count("") == 0);
assert(count("a") == 1);
assert(count("abc") == 3);
assert(count("\u20AC100") == 4);
}
|
D
|
// ************************************************************************************************
// Wirkung und Kosten von Tränken
// ************************************************************************************************
// Heilung
const int Value_hpEssenz = 50; const int hp_Essenz = 50;
const int Value_hpExtrakt = 75; const int hp_Extrakt = 70;
const int Value_hpElixier = 100; const int hp_Elixier = 100;
const int Value_hpMAX = 200;
// Mana (Magier)
const int Value_ManaEssenz = 25; const int Mana_Essenz = 30;
const int Value_ManaExtrakt = 45; const int Mana_Extrakt = 50;
const int Value_ManaElixier = 65; const int Mana_Elixier = 70;
// Mana (Bruderschaft)
const int Value_Elixier1 = 95; const int Mana_Elixier1 = 100;
// Permanente Attribut-Steigerungen
// FIXME: sind die zu kaufen (müüsen dann teuer sein) oder zu fnden (dann evtl. billiger)
// FIXME: Textanzeige der Attribut-Änderung bei Benutzung möglich?
const int Value_ElixierEgg = 1; const int ManaMax_ElixierEgg = 10; // FIXME: was wenn der SC das selbst benutzt??
const int Value_StrExtrakt = 700; const int STR_Extrakt = 5;
const int Value_StrElixier = 1000; const int STR_Elixier = 8;
const int Value_DexExtrakt = 700; const int DEX_Extrakt = 5;
const int Value_DexElixier = 1000; const int DEX_Elixier = 8;
// Trank der Macht
const int Value_StrDex_Macht = 1300; const int StrDex_Macht = 3;
// Trank der Herrschaft
const int Value_StrDex_Herrschaft = 2000; const int StrDex_Herrschaft = 5;
const int Value_hpMaxExtrakt = 700; const int hpMax_Extrakt = 5;
const int Value_hpMaxElixier = 1000; const int hpMax_Elixier = 10;
const int Value_ManaMaxExtrakt = 700; const int ManaMax_Extrakt = 5;
const int Value_ManaMaxElixier = 1000; const int ManaMax_Elixier = 10;
// Speed-Potions
const int Value_Haste2 = 150; const int Time_Haste2 = 120000; // 2 min.
const int Value_Haste3 = 200; const int Time_Haste3 = 300000; // 5 min.
/******************************************************************************************/
// MANATRÄNKE //
/******************************************************************************************/
INSTANCE ItFo_Potion_Mana_01(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_ManaEssenz;
visual = "ItFo_Potion_Mana_01.3ds";
material = MAT_GLAS;
on_state[0] = UseManaPotion;
scemeName = "POTIONFAST";
description = "Esencja magicznej energii";
TEXT[1] = NAME_Bonus_Mana; COUNT[1] = Mana_Essenz;
TEXT[5] = NAME_Value; COUNT[5] = Value_ManaEssenz;
};
FUNC VOID UseManaPotion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseManaPotion");
B_ChangeAttribute (self, ATR_MANA, Mana_Essenz);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Mana_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_ManaExtrakt;
visual = "ItFo_Potion_Mana_02.3ds";
material = MAT_GLAS;
on_state[0] = UseMana2Potion;
scemeName = "POTIONFAST";
description = "Wyciąg magicznej energii";
TEXT[1] = NAME_Bonus_Mana; COUNT[1] = Mana_Extrakt;
TEXT[5] = NAME_Value; COUNT[5] = Value_ManaExtrakt;
};
FUNC VOID UseMana2Potion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseMana2Potion");
B_ChangeAttribute (self, ATR_MANA, Mana_Extrakt);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Mana_03(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_ManaElixier;
visual = "ItFo_Potion_Mana_03.3ds";
material = MAT_GLAS;
on_state[0] = UseMana3Potion;
scemeName = "POTIONFAST";
description = "Eliksir magicznej energii";
TEXT[1] = NAME_Bonus_Mana; COUNT[1] = Mana_Elixier;
TEXT[5] = NAME_Value; COUNT[5] = Value_ManaElixier;
};
FUNC VOID UseMana3Potion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseMana3Potion");
B_ChangeAttribute (self, ATR_MANA, Mana_Elixier);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Mana_04(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_ManaElixier;
visual = "ItFo_Potion_Mana_03.3ds";
material = MAT_GLAS;
on_state[0] = UseMana3Potion;
scemeName = "POTIONFAST";
description = "Pełnia magicznej energii";
TEXT[5] = NAME_Value; COUNT[5] = Value_ManaElixier;
};
FUNC VOID UseMana4Potion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseMana4Potion");
self.attribute[ATR_MANA]=self.attribute[ATR_MANA_MAX];
};
/******************************************************************************************/
// MANA ELIXIERE BRUDERSCHAFT//
INSTANCE ItFo_Potion_Elixier(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_Elixier1;
visual = "ItFo_Potion_Elixier.3ds";
material = MAT_GLAS;
on_state[0] = UseElixier;
scemeName = "POTIONFAST";
description = "Eliksir";
TEXT[1] = NAME_Bonus_Mana; COUNT[1] = Mana_Elixier1;
TEXT[5] = NAME_Value; COUNT[5] = Value_Elixier1;
};
func void UseElixier ()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseElixier");
B_ChangeAttribute (self, ATR_MANA, Mana_Elixier1);
};
/******************************************************************************************/
// HEILTRÄNKE //
/******************************************************************************************/
INSTANCE ItFo_Potion_Health_01(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_hpEssenz;
visual = "ItFo_Potion_Health_01.3ds";
material = MAT_GLAS;
on_state[0] = UseHealthpotion;
scemeName = "POTIONFAST";
description = "Esencja uzdrawiająca ";
TEXT[1] = NAME_Bonus_hp; COUNT[1] = hp_Essenz;
TEXT[5] = NAME_Value; COUNT[5] = Value_hpEssenz;
};
FUNC VOID UseHealthpotion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseHealthpotion");
B_ChangeAttribute (self, ATR_HITPOINTS, hp_Essenz);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Health_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_hpExtrakt;
visual = "ItFo_Potion_Health_02.3ds";
material = MAT_GLAS;
on_state[0] = UseHealth2Potion;
scemeName = "POTIONFAST";
description = "Wyciąg uzdrawiający ";
TEXT[1] = NAME_Bonus_hp; COUNT[1] = hp_Extrakt;
TEXT[5] = NAME_Value; COUNT[5] = Value_hpExtrakt;
};
FUNC VOID UseHealth2Potion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseHealthpotion");
B_ChangeAttribute (self, ATR_HITPOINTS, hp_Extrakt);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Health_03(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_hpElixier;
visual = "ItFo_Potion_Health_01.3ds";
material = MAT_GLAS;
on_state[0] = UseHealth3Potion;
scemeName = "POTIONFAST";
description = "Eliksir uzdrawiający ";
TEXT[1] = NAME_Bonus_hp; COUNT[1] = hp_Elixier;
TEXT[5] = NAME_Value; COUNT[5] = Value_hpElixier;
};
FUNC VOID UseHealth3Potion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseHealthpotion");
B_ChangeAttribute (self, ATR_HITPOINTS, hp_Elixier);
};
////////////////////////////////////////////////////////////////
//MEGA ELIXIR
//////////////////////////////////////////////////////////////
INSTANCE ItFo_Potion_Health_04(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_hpMAX;
visual = "ItFo_Potion_Health_01.3ds";
material = MAT_GLAS;
on_state[0] = UseHealth4Potion;
scemeName = "POTIONFAST";
description = "Pełnia życia ";
// TEXT[1] = NAME_Bonus_hp; COUNT[1] = hp_Elixier;
TEXT[5] = NAME_Value; COUNT[5] = Value_hpElixier;
};
FUNC VOID UseHealth4Potion()
{
//PrintDebugNpc (PD_ITEM_MOBSI, "UseHealthpotion");
self.attribute[ATR_HITPOINTS]=self.attribute[ATR_HITPOINTS_MAX];
};
/******************************************************************************************/
// TRÄNKE FÜR PERMANENTE ATTRIBUT-ÄNDERUNGEN!
/******************************************************************************************/
/******************************************************************************************/
INSTANCE ItFo_Potion_Elixier_Egg(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_ElixierEgg;
visual = "ItFo_Potion_Elixier_Egg.3ds";
material = MAT_GLAS;
on_state[0] = UseEggElixier;
scemeName = "POTIONFAST";
description = "Napój z pełzaczy";
TEXT[0] = "Pozwala nawiązać kontakt ze Śniącym.";
TEXT[1] = NAME_Bonus_ManaMax; COUNT[1] = ManaMax_ElixierEgg;
TEXT[5] = NAME_Value; COUNT[5] = Value_ElixierEgg;
};
func void UseEggElixier ()
{
B_RaiseAttribute (ATR_MANA_MAX, ManaMax_ElixierEgg);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Strength_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_StrExtrakt;
visual = "ItFo_Potion_Strength_02.3ds";
material = MAT_GLAS;
on_state[0] = UseStrength2Potion;
scemeName = "POTIONFAST";
description = "Wyciąg siły";
TEXT[1] = NAME_Bonus_Str; COUNT[1] = STR_Extrakt;
TEXT[5] = NAME_Value; COUNT[5] = Value_StrExtrakt;
};
FUNC VOID UseStrength2Potion()
{
B_RaiseAttribute (ATR_STRENGTH, STR_Extrakt);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Strength_03(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_StrElixier;
visual = "ItFo_Potion_Strength_03.3ds";
material = MAT_GLAS;
on_state[0] = UseStrength3Potion;
scemeName = "POTIONFAST";
description = "Eliksir siły";
TEXT[1] = NAME_Bonus_Str; COUNT[1] = STR_Elixier;
TEXT[5] = NAME_Value; COUNT[5] = Value_StrElixier;
};
FUNC VOID UseStrength3Potion()
{
B_RaiseAttribute (ATR_STRENGTH, STR_Elixier);
};
/******************************************************************************************/
// DEXTERITY
/******************************************************************************************/
INSTANCE ItFo_Potion_Dex_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_DexExtrakt;
visual = "ItFo_Potion_Dex_02.3ds";
material = MAT_GLAS;
on_state[0] = UseDex2Potion;
scemeName = "POTIONFAST";
description = "Wyciąg zwinności";
TEXT[1] = NAME_Bonus_Dex; COUNT[1] = DEX_Extrakt;
TEXT[5] = NAME_Value; COUNT[5] = Value_DexExtrakt;
};
FUNC VOID UseDex2Potion()
{
B_RaiseAttribute (ATR_DEXTERITY, DEX_Extrakt);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Dex_03(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_DexElixier;
visual = "ItFo_Potion_Dex_03.3ds";
material = MAT_GLAS;
on_state[0] = UseDex3Potion;
scemeName = "POTIONFAST";
description = "Eliksir zwinności";
TEXT[1] = NAME_Bonus_Dex; COUNT[1] = DEX_Elixier;
TEXT[5] = NAME_Value; COUNT[5] = Value_DexElixier;
};
FUNC VOID UseDex3Potion()
{
B_RaiseAttribute (ATR_DEXTERITY, DEX_Elixier);
};
/******************************************************************************************/
// STRENGTH & DEX
INSTANCE ItFo_Potion_Master_01(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_StrDex_Macht;
visual = "ItFo_Potion_Master_01.3ds";
material = MAT_GLAS;
on_state[0] = UseMasterPotion;
scemeName = "POTIONFAST";
description = "Napój potęgi";
TEXT[1] = NAME_Bonus_Dex; COUNT[1] = StrDex_Macht;
TEXT[2] = NAME_Bonus_Str; COUNT[2] = StrDex_Macht;
TEXT[5] = NAME_Value; COUNT[5] = Value_StrDex_Macht;
};
FUNC VOID UseMasterPotion()
{
B_ChangeAttribute (self, ATR_STRENGTH, StrDex_Macht);
B_ChangeAttribute (self, ATR_DEXTERITY, StrDex_Macht);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Master_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_StrDex_Herrschaft;
visual = "ItFo_Potion_Master_02.3ds";
material = MAT_GLAS;
on_state[0] = UseMaster2Potion;
scemeName = "POTIONFAST";
description = "Napój władzy";
TEXT[1] = NAME_Bonus_Dex; COUNT[1] = StrDex_Herrschaft;
TEXT[2] = NAME_Bonus_Str; COUNT[2] = StrDex_Herrschaft;
TEXT[5] = NAME_Value; COUNT[5] = Value_StrDex_Herrschaft;
};
FUNC VOID UseMaster2Potion()
{
B_ChangeAttribute (self, ATR_STRENGTH, StrDex_Herrschaft);
B_ChangeAttribute (self, ATR_DEXTERITY, StrDex_Herrschaft);
};
/******************************************************************************************/
// Hitpoints
/******************************************************************************************/
INSTANCE ItFo_Potion_Health_Perma_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_hpMaxExtrakt;
visual = "ItFo_Potion_Health_Perma_02.3ds";
material = MAT_GLAS;
on_state[0] = UseLife2Potion;
scemeName = "POTIONFAST";
description = "Wyciąg życia";
TEXT[1] = NAME_Bonus_hpMax; COUNT[1] = hpMax_Extrakt;
TEXT[5] = NAME_Value; COUNT[5] = Value_hpMaxExtrakt;
};
FUNC VOID UseLife2Potion()
{
B_RaiseAttribute (ATR_HITPOINTS_MAX, hpMax_Extrakt);
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Health_Perma_03(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_hpMaxElixier;
visual = "ItFo_Potion_Health_Perma_03.3ds";
material = MAT_GLAS;
on_state[0] = UseLife3Potion;
scemeName = "POTIONFAST";
description = "Eliksir życia";
TEXT[1] = NAME_Bonus_hpMax; COUNT[1] = hpMax_Elixier;
TEXT[5] = NAME_Value; COUNT[5] = Value_hpMaxElixier;
};
FUNC VOID UseLife3Potion()
{
B_RaiseAttribute (ATR_HITPOINTS_MAX, hpMax_Elixier);
};
/******************************************************************************************/
// MANA
/******************************************************************************************/
INSTANCE ItFo_Potion_Mana_Perma_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_ManaMaxExtrakt;
visual = "ItFo_Potion_Mana_Perma_02.3ds";
material = MAT_GLAS;
on_state[0] = UseNectar2Potion;
scemeName = "POTIONFAST";
description = "Wyciąg ducha";
TEXT[1] = NAME_Bonus_ManaMax; COUNT[1] = ManaMax_Extrakt;
TEXT[5] = NAME_Value; COUNT[5] = Value_ManaMaxExtrakt;
};
FUNC VOID UseNectar2Potion()
{
B_RaiseAttribute (ATR_MANA_MAX, ManaMax_Extrakt);
//PrintDebugNpc (PD_ITEM_MOBSI, "Ich trinke Magie");
};
/******************************************************************************************/
INSTANCE ItFo_Potion_Mana_Perma_03(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_ManaMaxElixier;
visual = "ItFo_Potion_Mana_Perma_03.3ds";
material = MAT_GLAS;
on_state[0] = UseNectar3Potion;
scemeName = "POTIONFAST";
description = "Eliksir ducha";
TEXT[1] = NAME_Bonus_ManaMax; COUNT[1] = ManaMax_Elixier;
TEXT[5] = NAME_Value; COUNT[5] = Value_ManaMaxElixier;
};
FUNC VOID UseNectar3Potion()
{
B_RaiseAttribute (ATR_MANA_MAX, ManaMax_Elixier);
//PrintDebugNpc (PD_ITEM_MOBSI, "Ich trinke Magie");
};
/******************************************************************************************/
// SPEED-POTIONS //
/******************************************************************************************/
/******************************************************************************************/
INSTANCE ItFo_Potion_Haste_02(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_Haste2;
visual = "ItFo_Potion_Haste_01.3ds";
material = MAT_GLAS;
on_state[0] = UseHastePotion2;
scemeName = "POTIONFAST";
description = "Napój szybkości";
TEXT[1] = "Pozwala szybciej biegać. ";
TEXT[3] = NAME_Duration; COUNT[3] = Time_Haste2/60000;
TEXT[5] = NAME_Value; COUNT[5] = value;
};
FUNC VOID UseHastePotion2()
{
Mdl_ApplyOverlayMDSTimed (self, "HUMANS_SPRINT.MDS", Time_Haste2);
//PrintDebugNpc (PD_ITEM_MOBSI, "jetzt bin ich schnell");
};
INSTANCE ItFo_Potion_Haste_03(C_Item)
{
name = NAME_Trank;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = Value_Haste3;
visual = "ItFo_Potion_Haste_01.3ds";
material = MAT_GLAS;
on_state[0] = UseHastePotion3;
scemeName = "POTIONFAST";
description = "Napój przyspieszenia";
TEXT[1] = "Pozwala na dłuższe sprinty. ";
TEXT[3] = NAME_Duration; COUNT[3] = Time_Haste3/60000;
TEXT[5] = NAME_Value; COUNT[5] = value;
};
FUNC VOID UseHastePotion3()
{
Mdl_ApplyOverlayMDSTimed (self, "HUMANS_SPRINT.MDS", Time_Haste3);
};
|
D
|
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/HTTPCompression.swift.o : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPCompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPDecompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.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/Swift.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/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/CNIOExtrasZlib/include/CNIOExtrasZlib.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOWindows/include/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/CRuntime/Sources/CRuntime/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX11.1.sdk/usr/include/Darwin.apinotes
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/HTTPCompression~partial.swiftmodule : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPCompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPDecompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.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/Swift.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/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/CNIOExtrasZlib/include/CNIOExtrasZlib.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOWindows/include/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/CRuntime/Sources/CRuntime/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX11.1.sdk/usr/include/Darwin.apinotes
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/HTTPCompression~partial.swiftdoc : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPCompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPDecompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.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/Swift.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/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/CNIOExtrasZlib/include/CNIOExtrasZlib.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOWindows/include/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/CRuntime/Sources/CRuntime/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX11.1.sdk/usr/include/Darwin.apinotes
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/HTTPCompression~partial.swiftsourceinfo : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPCompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPDecompression.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestCompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPResponseDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/NIOHTTPCompression/HTTPRequestDecompressor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.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/Swift.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/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio-extras/Sources/CNIOExtrasZlib/include/CNIOExtrasZlib.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/swift-nio/Sources/CNIOWindows/include/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/CRuntime/Sources/CRuntime/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX11.1.sdk/usr/include/Darwin.apinotes
|
D
|
/**
* Implementation of support routines for synchronized blocks.
*
* Copyright: Copyright Digital Mars 2000 - 2011.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Walter Bright, Sean Kelly
*/
/* Copyright Digital Mars 2000 - 2011.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module rt.critical_;
private
{
debug(PRINTF) import core.stdc.stdio;
import core.stdc.stdlib;
version( linux )
{
version = USE_PTHREADS;
}
else version( FreeBSD )
{
version = USE_PTHREADS;
}
else version( OSX )
{
version = USE_PTHREADS;
}
else version( Solaris )
{
version = USE_PTHREADS;
}
else version( Android )
{
version = USE_PTHREADS;
}
version( Windows )
{
import core.sys.windows.windows;
/* We don't initialize critical sections unless we actually need them.
* So keep a linked list of the ones we do use, and in the static destructor
* code, walk the list and release them.
*/
struct D_CRITICAL_SECTION
{
D_CRITICAL_SECTION *next;
CRITICAL_SECTION cs;
}
}
else version( USE_PTHREADS )
{
import core.sys.posix.pthread;
/* We don't initialize critical sections unless we actually need them.
* So keep a linked list of the ones we do use, and in the static destructor
* code, walk the list and release them.
*/
struct D_CRITICAL_SECTION
{
D_CRITICAL_SECTION *next;
pthread_mutex_t cs;
}
}
else
{
static assert(0, "Unsupported platform");
}
}
/* ================================= Win32 ============================ */
version( Windows )
{
version (Win32)
pragma(lib, "snn.lib");
/******************************************
* Enter/exit critical section.
*/
static __gshared D_CRITICAL_SECTION *dcs_list;
static __gshared D_CRITICAL_SECTION critical_section;
static __gshared int inited;
extern (C) void _d_criticalenter(D_CRITICAL_SECTION *dcs)
{
if (!dcs_list)
{
_STI_critical_init();
atexit(&_STD_critical_term);
}
debug(PRINTF) printf("_d_criticalenter(dcs = x%x)\n", dcs);
if (!dcs.next)
{
EnterCriticalSection(&critical_section.cs);
if (!dcs.next) // if, in the meantime, another thread didn't set it
{
dcs.next = dcs_list;
dcs_list = dcs;
InitializeCriticalSection(&dcs.cs);
}
LeaveCriticalSection(&critical_section.cs);
}
EnterCriticalSection(&dcs.cs);
}
extern (C) void _d_criticalexit(D_CRITICAL_SECTION *dcs)
{
debug(PRINTF) printf("_d_criticalexit(dcs = x%x)\n", dcs);
LeaveCriticalSection(&dcs.cs);
}
extern (C) void _STI_critical_init()
{
if (!inited)
{
debug(PRINTF) printf("_STI_critical_init()\n");
InitializeCriticalSection(&critical_section.cs);
dcs_list = &critical_section;
inited = 1;
}
}
extern (C) void _STD_critical_term()
{
if (inited)
{
debug(PRINTF) printf("_STI_critical_term()\n");
while (dcs_list)
{
debug(PRINTF) printf("\tlooping... %x\n", dcs_list);
DeleteCriticalSection(&dcs_list.cs);
dcs_list = dcs_list.next;
}
inited = 0;
}
}
}
/* ================================= linux ============================ */
version( USE_PTHREADS )
{
/******************************************
* Enter/exit critical section.
*/
static __gshared D_CRITICAL_SECTION *dcs_list;
static __gshared D_CRITICAL_SECTION critical_section;
static __gshared pthread_mutexattr_t _criticals_attr;
extern (C) void _d_criticalenter(D_CRITICAL_SECTION *dcs)
{
if (!dcs_list)
{
_STI_critical_init();
atexit(&_STD_critical_term);
}
debug(PRINTF) printf("_d_criticalenter(dcs = x%x)\n", dcs);
if (!dcs.next)
{
pthread_mutex_lock(&critical_section.cs);
if (!dcs.next) // if, in the meantime, another thread didn't set it
{
dcs.next = dcs_list;
dcs_list = dcs;
pthread_mutex_init(&dcs.cs, &_criticals_attr);
}
pthread_mutex_unlock(&critical_section.cs);
}
pthread_mutex_lock(&dcs.cs);
}
extern (C) void _d_criticalexit(D_CRITICAL_SECTION *dcs)
{
debug(PRINTF) printf("_d_criticalexit(dcs = x%x)\n", dcs);
pthread_mutex_unlock(&dcs.cs);
}
extern (C) void _STI_critical_init()
{
if (!dcs_list)
{
debug(PRINTF) printf("_STI_critical_init()\n");
pthread_mutexattr_init(&_criticals_attr);
pthread_mutexattr_settype(&_criticals_attr, PTHREAD_MUTEX_RECURSIVE);
// The global critical section doesn't need to be recursive
pthread_mutex_init(&critical_section.cs, null);
dcs_list = &critical_section;
}
}
extern (C) void _STD_critical_term()
{
if (dcs_list)
{
debug(PRINTF) printf("_STI_critical_term()\n");
while (dcs_list)
{
debug(PRINTF) printf("\tlooping... %x\n", dcs_list);
pthread_mutex_destroy(&dcs_list.cs);
dcs_list = dcs_list.next;
}
}
}
}
|
D
|
/Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/atomics.swift.o : /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/lock.swift /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/c-atomics.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOSHA1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOHTTP1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CCryptoOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIO.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/HTTP.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOTLS.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOZlib.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Async.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Command.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Service.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Console.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Core.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOPriorityQueue.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Leaf.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Logging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Debugging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Routing.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/COperatingSystem.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Random.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/URLEncodedForm.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIODarwin.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Validation.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Crypto.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/App.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOHTTPParser.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Vapor.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOAtomics.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Bits.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOFoundationCompat.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/WebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOWebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/DatabaseKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/TemplateKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Multipart.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOLinux.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/lock.swift.o : /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/lock.swift /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/c-atomics.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOSHA1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOHTTP1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CCryptoOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIO.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/HTTP.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOTLS.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOZlib.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Async.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Command.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Service.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Console.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Core.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOPriorityQueue.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Leaf.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Logging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Debugging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Routing.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/COperatingSystem.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Random.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/URLEncodedForm.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIODarwin.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Validation.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Crypto.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/App.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOHTTPParser.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Vapor.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOAtomics.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Bits.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOFoundationCompat.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/WebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOWebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/DatabaseKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/TemplateKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Multipart.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOLinux.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.swiftmodule : /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/lock.swift /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/c-atomics.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOSHA1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOHTTP1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CCryptoOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIO.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/HTTP.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOTLS.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOZlib.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Async.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Command.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Service.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Console.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Core.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOPriorityQueue.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Leaf.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Logging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Debugging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Routing.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/COperatingSystem.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Random.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/URLEncodedForm.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIODarwin.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Validation.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Crypto.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/App.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOHTTPParser.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Vapor.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOAtomics.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Bits.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOFoundationCompat.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/WebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOWebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/DatabaseKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/TemplateKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Multipart.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOLinux.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.swiftdoc : /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/lock.swift /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/c-atomics.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOSHA1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOHTTP1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CCryptoOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIO.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/HTTP.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOTLS.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOZlib.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Async.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Command.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Service.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Console.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Core.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOPriorityQueue.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Leaf.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Logging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Debugging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Routing.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/COperatingSystem.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Random.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/URLEncodedForm.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIODarwin.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Validation.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Crypto.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/App.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOHTTPParser.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Vapor.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOAtomics.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Bits.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOFoundationCompat.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/WebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOWebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/DatabaseKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/TemplateKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Multipart.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOLinux.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/NIOConcurrencyHelpers-Swift.h : /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/lock.swift /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/c-atomics.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOSHA1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOHTTP1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CCryptoOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIO.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/HTTP.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOTLS.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOZlib.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Async.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Command.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Service.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Console.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Core.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOPriorityQueue.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Leaf.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Logging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Debugging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Routing.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/COperatingSystem.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Random.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/URLEncodedForm.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIODarwin.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Validation.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Crypto.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/App.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOHTTPParser.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Vapor.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOAtomics.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Bits.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOFoundationCompat.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/WebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOWebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/DatabaseKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/TemplateKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Multipart.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOLinux.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.swiftsourceinfo : /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/lock.swift /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/c-atomics.h /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOSHA1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOHTTP1.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CCryptoOpenSSL.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIO.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/HTTP.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOTLS.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOZlib.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Async.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Command.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Service.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Console.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Core.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOPriorityQueue.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Leaf.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Logging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Debugging.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Routing.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/COperatingSystem.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Random.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/URLEncodedForm.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIODarwin.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Validation.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Crypto.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/App.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOHTTPParser.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Vapor.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOAtomics.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOConcurrencyHelpers.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Bits.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOFoundationCompat.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/WebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/NIOWebSocket.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/DatabaseKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/TemplateKit.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/Multipart.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/x86_64-apple-macosx/release/CNIOLinux.build/module.modulemap /Users/victorbaleeiro/git/github/victor/site/victor-baleeiro-site/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
|
D
|
module org.serviio.upnp.protocol.ssdp.SSDPConstants;
import java.lang.String;
import java.lang.System;
import org.serviio.MediaServer;
public class SSDPConstants
{
public static immutable String SERVER;
public static immutable String DEFAULT_MULTICAST_HOST = "239.255.255.250";
public static immutable int DEFAULT_MULTICAST_PORT = 1900;
public static immutable int DEFAULT_TTL = 4;
public static immutable int DEFAULT_TIMEOUT = 250;
public static immutable int ADVERTISEMENT_DURATION = 1800;
public static immutable int ADVERTISEMENT_SEND_COUNT = 3;
public static immutable int EVENT_SUBSCRIPTION_DURATION = 300;
public static immutable String EVENT_SUBSCRIPTION_DURATION_INFINITE = "infinite";
public static immutable String NTS_ALIVE = "ssdp:alive";
public static immutable String NTS_BYEBYE = "ssdp:byebye";
public static immutable String HTTP_METHOD_NOTIFY = "NOTIFY";
public static immutable String HTTP_METHOD_SEARCH = "M-SEARCH";
public static immutable String HTTP_METHOD_SUBSCRIBE = "SUBSCRIBE";
public static immutable String HTTP_METHOD_UNSUBSCRIBE = "UNSUBSCRIBE";
public static immutable String SEARCH_TARGET_ALL = "ssdp:all";
public static immutable String SEARCH_TARGET_ROOT_DEVICE = "upnp:rootdevice";
public static immutable String NOTIFICATION_TYPE_EVENT = "upnp:event";
public static immutable String NOTIFICATION_SUBTYPE_EVENT = "upnp:propchange";
static this()
{
SERVER = System.getProperty("os.name") ~ ", UPnP/1.0 DLNADOC/1.50, Serviio/" ~ MediaServer.VERSION;
}
}
/* Location: C:\Users\Main\Downloads\serviio.jar
* Qualified Name: org.serviio.upnp.protocol.ssdp.SSDPConstants
* JD-Core Version: 0.7.0.1
*/
|
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/dmd/libomf.d, _libomf.d)
* Documentation: https://dlang.org/phobos/dmd_libomf.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/libomf.d
*/
module dmd.libomf;
version(Windows):
import core.stdc.stdio;
import core.stdc.string;
import core.stdc.stdlib;
import dmd.globals;
import dmd.utils;
import dmd.lib;
import dmd.root.array;
import dmd.root.file;
import dmd.root.filename;
import dmd.root.outbuffer;
import dmd.root.stringtable;
import dmd.scanomf;
enum LOG = false;
struct OmfObjSymbol
{
char* name;
OmfObjModule* om;
}
alias OmfObjModules = Array!(OmfObjModule*);
alias OmfObjSymbols = Array!(OmfObjSymbol*);
extern (C) uint _rotl(uint value, int shift);
extern (C) uint _rotr(uint value, int shift);
final class LibOMF : Library
{
OmfObjModules objmodules; // OmfObjModule[]
OmfObjSymbols objsymbols; // OmfObjSymbol[]
StringTable tab;
extern (D) this()
{
tab._init(14000);
}
/***************************************
* Add object module or library to the library.
* Examine the buffer to see which it is.
* If the buffer is NULL, use module_name as the file name
* and load the file.
*/
override void addObject(const(char)* module_name, const ubyte[] buffer)
{
static if (LOG)
{
printf("LibOMF::addObject(%s)\n", module_name ? module_name : "");
}
void corrupt(int reason)
{
error("corrupt OMF object module %s %d", module_name, reason);
}
auto buf = buffer.ptr;
auto buflen = buffer.length;
if (!buf)
{
assert(module_name);
File* file = File.create(cast(char*)module_name);
readFile(Loc(), file);
buf = file.buffer;
buflen = file.len;
file._ref = 1;
}
uint g_page_size;
ubyte* pstart = cast(ubyte*)buf;
bool islibrary = false;
/* See if it's an OMF library.
* Don't go by file extension.
*/
struct LibHeader
{
align(1):
ubyte recTyp; // 0xF0
ushort pagesize;
uint lSymSeek;
ushort ndicpages;
}
/* Determine if it is an OMF library, an OMF object module,
* or something else.
*/
if (buflen < (LibHeader).sizeof)
return corrupt(__LINE__);
const lh = cast(const(LibHeader)*)buf;
if (lh.recTyp == 0xF0)
{
/* OMF library
* The modules are all at buf[g_page_size .. lh.lSymSeek]
*/
islibrary = 1;
g_page_size = lh.pagesize + 3;
buf = cast(ubyte*)(pstart + g_page_size);
if (lh.lSymSeek > buflen || g_page_size > buflen)
return corrupt(__LINE__);
buflen = lh.lSymSeek - g_page_size;
}
else if (lh.recTyp == '!' && memcmp(lh, cast(char*)"!<arch>\n", 8) == 0)
{
error("COFF libraries not supported");
return;
}
else
{
// Not a library, assume OMF object module
g_page_size = 16;
}
bool firstmodule = true;
void addOmfObjModule(char* name, void* base, size_t length)
{
auto om = new OmfObjModule();
om.base = cast(ubyte*)base;
om.page = om.page = cast(ushort)((om.base - pstart) / g_page_size);
om.length = cast(uint)length;
/* Determine the name of the module
*/
if (firstmodule && module_name && !islibrary)
{
// Remove path and extension
auto n = strdup(FileName.name(module_name));
om.name = n[0 .. strlen(n)];
char* ext = cast(char*)FileName.ext(n);
if (ext)
ext[-1] = 0;
}
else
{
/* Use THEADR name as module name,
* removing path and extension.
*/
auto n = strdup(FileName.name(name));
om.name = n[0 .. strlen(n)];
char* ext = cast(char*)FileName.ext(n);
if (ext)
ext[-1] = 0;
}
firstmodule = false;
this.objmodules.push(om);
}
if (scanOmfLib(&addOmfObjModule, cast(void*)buf, buflen, g_page_size))
return corrupt(__LINE__);
}
/*****************************************************************************/
void addSymbol(OmfObjModule* om, const(char)* name, int pickAny = 0)
{
static if (LOG)
{
printf("LibOMF::addSymbol(%s, %s, %d)\n", om.name.ptr, name, pickAny);
}
const namelen = strlen(name);
StringValue* s = tab.insert(name, namelen, null);
if (!s)
{
// already in table
if (!pickAny)
{
const s2 = tab.lookup(name, namelen);
assert(s2);
const os = cast(const(OmfObjSymbol)*)s2.ptrvalue;
error("multiple definition of %s: %s and %s: %s", om.name.ptr, name, os.om.name.ptr, os.name);
}
}
else
{
auto os = new OmfObjSymbol();
os.name = strdup(name);
os.om = om;
s.ptrvalue = cast(void*)os;
objsymbols.push(os);
}
}
private:
/************************************
* Scan single object module for dictionary symbols.
* Send those symbols to LibOMF::addSymbol().
*/
void scanObjModule(OmfObjModule* om)
{
static if (LOG)
{
printf("LibMSCoff::scanObjModule(%s)\n", om.name.ptr);
}
extern (D) void addSymbol(const(char)[] name, int pickAny)
{
this.addSymbol(om, name.ptr, pickAny);
}
scanOmfObjModule(&addSymbol, om.base[0 .. om.length], om.name.ptr, loc);
}
/***********************************
* Calculates number of pages needed for dictionary
* Returns:
* number of pages
*/
ushort numDictPages(uint padding)
{
ushort ndicpages;
ushort bucksForHash;
ushort bucksForSize;
uint symSize = 0;
for (size_t i = 0; i < objsymbols.dim; i++)
{
OmfObjSymbol* s = objsymbols[i];
symSize += (strlen(s.name) + 4) & ~1;
}
for (size_t i = 0; i < objmodules.dim; i++)
{
OmfObjModule* om = objmodules[i];
size_t len = om.name.length;
if (len > 0xFF)
len += 2; // Digital Mars long name extension
symSize += (len + 4 + 1) & ~1;
}
bucksForHash = cast(ushort)((objsymbols.dim + objmodules.dim + HASHMOD - 3) / (HASHMOD - 2));
bucksForSize = cast(ushort)((symSize + BUCKETSIZE - padding - padding - 1) / (BUCKETSIZE - padding));
ndicpages = (bucksForHash > bucksForSize) ? bucksForHash : bucksForSize;
//printf("ndicpages = %u\n",ndicpages);
// Find prime number greater than ndicpages
static __gshared uint* primes =
[
1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103,
107, 109, 113, 127, 131, 137, 139, 149, 151, 157,
163, 167, 173, 179, 181, 191, 193, 197, 199, 211,
223, 227, 229, 233, 239, 241, 251, 257, 263, 269,
271, 277, 281, 283, 293, 307, 311, 313, 317, 331,
337, 347, 349, 353, 359, 367, 373, 379, 383, 389,
397, 401, 409, 419, 421, 431, 433, 439, 443, 449,
457, 461, 463, 467, 479, 487, 491, 499, 503, 509,
//521,523,541,547,
0
];
for (size_t i = 0; 1; i++)
{
if (primes[i] == 0)
{
// Quick and easy way is out.
// Now try and find first prime number > ndicpages
uint prime;
for (prime = (ndicpages + 1) | 1; 1; prime += 2)
{
// Determine if prime is prime
for (uint u = 3; u < prime / 2; u += 2)
{
if ((prime / u) * u == prime)
goto L1;
}
break;
L1:
}
ndicpages = cast(ushort)prime;
break;
}
if (primes[i] > ndicpages)
{
ndicpages = cast(ushort)primes[i];
break;
}
}
return ndicpages;
}
/*******************************************
* Write the module and symbol names to the dictionary.
* Returns:
* false failure
*/
bool FillDict(ubyte* bucketsP, ushort ndicpages)
{
// max size that will fit in dictionary
enum LIBIDMAX = (512 - 0x25 - 3 - 4);
ubyte[4 + LIBIDMAX + 2 + 1] entry;
//printf("FillDict()\n");
// Add each of the module names
for (size_t i = 0; i < objmodules.dim; i++)
{
OmfObjModule* om = objmodules[i];
ushort n = cast(ushort)om.name.length;
if (n > 255)
{
entry[0] = 0xFF;
entry[1] = 0;
*cast(ushort*)(entry.ptr + 2) = cast(ushort)(n + 1);
memcpy(entry.ptr + 4, om.name.ptr, n);
n += 3;
}
else
{
entry[0] = cast(ubyte)(1 + n);
memcpy(entry.ptr + 1, om.name.ptr, n);
}
entry[n + 1] = '!';
*(cast(ushort*)(n + 2 + entry.ptr)) = om.page;
if (n & 1)
entry[n + 2 + 2] = 0;
if (!EnterDict(bucketsP, ndicpages, entry.ptr, n + 1))
return false;
}
// Sort the symbols
qsort(objsymbols.tdata(), objsymbols.dim, (objsymbols[0]).sizeof, cast(_compare_fp_t)&NameCompare);
// Add each of the symbols
for (size_t i = 0; i < objsymbols.dim; i++)
{
OmfObjSymbol* os = objsymbols[i];
ushort n = cast(ushort)strlen(os.name);
if (n > 255)
{
entry[0] = 0xFF;
entry[1] = 0;
*cast(ushort*)(entry.ptr + 2) = n;
memcpy(entry.ptr + 4, os.name, n);
n += 3;
}
else
{
entry[0] = cast(ubyte)n;
memcpy(entry.ptr + 1, os.name, n);
}
*(cast(ushort*)(n + 1 + entry.ptr)) = os.om.page;
if ((n & 1) == 0)
entry[n + 3] = 0;
if (!EnterDict(bucketsP, ndicpages, entry.ptr, n))
{
return false;
}
}
return true;
}
/**********************************************
* Create and write library to libbuf.
* The library consists of:
* library header
* object modules...
* dictionary header
* dictionary pages...
*/
protected override void WriteLibToBuffer(OutBuffer* libbuf)
{
/* Scan each of the object modules for symbols
* to go into the dictionary
*/
for (size_t i = 0; i < objmodules.dim; i++)
{
OmfObjModule* om = objmodules[i];
scanObjModule(om);
}
uint g_page_size = 16;
/* Calculate page size so that the number of pages
* fits in 16 bits. This is because object modules
* are indexed by page number, stored as an unsigned short.
*/
while (1)
{
Lagain:
static if (LOG)
{
printf("g_page_size = %d\n", g_page_size);
}
uint offset = g_page_size;
for (size_t i = 0; i < objmodules.dim; i++)
{
OmfObjModule* om = objmodules[i];
uint page = offset / g_page_size;
if (page > 0xFFFF)
{
// Page size is too small, double it and try again
g_page_size *= 2;
goto Lagain;
}
offset += OMFObjSize(om.base, om.length, om.name.ptr);
// Round the size of the file up to the next page size
// by filling with 0s
uint n = (g_page_size - 1) & offset;
if (n)
offset += g_page_size - n;
}
break;
}
/* Leave one page of 0s at start as a dummy library header.
* Fill it in later with the real data.
*/
libbuf.fill0(g_page_size);
/* Write each object module into the library
*/
for (size_t i = 0; i < objmodules.dim; i++)
{
OmfObjModule* om = objmodules[i];
uint page = cast(uint)(libbuf.offset / g_page_size);
assert(page <= 0xFFFF);
om.page = cast(ushort)page;
// Write out the object module om
writeOMFObj(libbuf, om.base, om.length, om.name.ptr);
// Round the size of the file up to the next page size
// by filling with 0s
uint n = (g_page_size - 1) & libbuf.offset;
if (n)
libbuf.fill0(g_page_size - n);
}
// File offset of start of dictionary
uint offset = cast(uint)libbuf.offset;
// Write dictionary header, then round it to a BUCKETPAGE boundary
ushort size = (BUCKETPAGE - (cast(short)offset + 3)) & (BUCKETPAGE - 1);
libbuf.writeByte(0xF1);
libbuf.writeword(size);
libbuf.fill0(size);
// Create dictionary
ubyte* bucketsP = null;
ushort ndicpages;
ushort padding = 32;
for (;;)
{
ndicpages = numDictPages(padding);
static if (LOG)
{
printf("ndicpages = %d\n", ndicpages);
}
// Allocate dictionary
if (bucketsP)
bucketsP = cast(ubyte*)realloc(bucketsP, ndicpages * BUCKETPAGE);
else
bucketsP = cast(ubyte*)malloc(ndicpages * BUCKETPAGE);
assert(bucketsP);
memset(bucketsP, 0, ndicpages * BUCKETPAGE);
for (uint u = 0; u < ndicpages; u++)
{
// 'next available' slot
bucketsP[u * BUCKETPAGE + HASHMOD] = (HASHMOD + 1) >> 1;
}
if (FillDict(bucketsP, ndicpages))
break;
padding += 16; // try again with more margins
}
// Write dictionary
libbuf.write(bucketsP, ndicpages * BUCKETPAGE);
if (bucketsP)
free(bucketsP);
// Create library header
struct Libheader
{
align(1):
ubyte recTyp;
ushort recLen;
uint trailerPosn;
ushort ndicpages;
ubyte flags;
uint filler;
}
Libheader libHeader;
memset(&libHeader, 0, (Libheader).sizeof);
libHeader.recTyp = 0xF0;
libHeader.recLen = 0x0D;
libHeader.trailerPosn = offset + (3 + size);
libHeader.recLen = cast(ushort)(g_page_size - 3);
libHeader.ndicpages = ndicpages;
libHeader.flags = 1; // always case sensitive
// Write library header at start of buffer
memcpy(libbuf.data, &libHeader, (libHeader).sizeof);
}
}
extern (C++) Library LibOMF_factory()
{
return new LibOMF();
}
/*****************************************************************************/
/*****************************************************************************/
struct OmfObjModule
{
ubyte* base; // where are we holding it in memory
uint length; // in bytes
ushort page; // page module starts in output file
const(char)[] name; // module name, with terminating 0
}
/*****************************************************************************/
/*****************************************************************************/
extern (C)
{
int NameCompare(const(void*) p1, const(void*) p2)
{
return strcmp((*cast(OmfObjSymbol**)p1).name, (*cast(OmfObjSymbol**)p2).name);
}
}
enum HASHMOD = 0x25;
enum BUCKETPAGE = 512;
enum BUCKETSIZE = (BUCKETPAGE - HASHMOD - 1);
/*******************************************
* Write a single entry into dictionary.
* Returns:
* false failure
*/
private bool EnterDict(ubyte* bucketsP, ushort ndicpages, ubyte* entry, uint entrylen)
{
ushort uStartIndex;
ushort uStep;
ushort uStartPage;
ushort uPageStep;
ushort uIndex;
ushort uPage;
ushort n;
uint u;
uint nbytes;
ubyte* aP;
ubyte* zP;
aP = entry;
zP = aP + entrylen; // point at last char in identifier
uStartPage = 0;
uPageStep = 0;
uStartIndex = 0;
uStep = 0;
u = entrylen;
while (u--)
{
uStartPage = cast(ushort)_rotl(uStartPage, 2) ^ (*aP | 0x20);
uStep = cast(ushort)_rotr(uStep, 2) ^ (*aP++ | 0x20);
uStartIndex = cast(ushort)_rotr(uStartIndex, 2) ^ (*zP | 0x20);
uPageStep = cast(ushort)_rotl(uPageStep, 2) ^ (*zP-- | 0x20);
}
uStartPage %= ndicpages;
uPageStep %= ndicpages;
if (uPageStep == 0)
uPageStep++;
uStartIndex %= HASHMOD;
uStep %= HASHMOD;
if (uStep == 0)
uStep++;
uPage = uStartPage;
uIndex = uStartIndex;
// number of bytes in entry
nbytes = 1 + entrylen + 2;
if (entrylen > 255)
nbytes += 2;
while (1)
{
aP = &bucketsP[uPage * BUCKETPAGE];
uStartIndex = uIndex;
while (1)
{
if (0 == aP[uIndex])
{
// n = next available position in this page
n = aP[HASHMOD] << 1;
assert(n > HASHMOD);
// if off end of this page
if (n + nbytes > BUCKETPAGE)
{
aP[HASHMOD] = 0xFF;
break;
// next page
}
else
{
aP[uIndex] = cast(ubyte)(n >> 1);
memcpy((aP + n), entry, nbytes);
aP[HASHMOD] += (nbytes + 1) >> 1;
if (aP[HASHMOD] == 0)
aP[HASHMOD] = 0xFF;
return true;
}
}
uIndex += uStep;
uIndex %= 0x25;
/*if (uIndex > 0x25)
uIndex -= 0x25;*/
if (uIndex == uStartIndex)
break;
}
uPage += uPageStep;
if (uPage >= ndicpages)
uPage -= ndicpages;
if (uPage == uStartPage)
break;
}
return false;
}
|
D
|
D :
+-D.Module :
+-D.DeclDefs : void
+-D.DeclDef : void
+-D.Declaration : void
+-D.Decl : void
+-D.basicFunction : void
+-D.BasicType : void
| +-D.BasicTypeX : void
+-D.Declarator : void
| +-D.Identifier : void
+-D.FunctionBody : void
+-D.BlockStatement : void
+-D.StatementList : void
+-D.Statement : void
+-D.NonEmptyStatement : void
+-D.NonEmptyStatementNoCaseNoDefault : void
+-D.DeclarationStatement : void
+-D.Declaration : void
+-D.Decl : void
+-D.BasicType : int
| +-D.BasicTypeX : int
+-D.Declarators : void
+-D.DeclaratorInitializer : void
+-D.Declarator : void
| +-D.Identifier : void
+-D.Initializer : ulong
+-D.NonVoidInitializer : ulong
+-D.AssignExpression : ulong
+-D.ConditionalExpression : ulong
+-D.OrOrExpression : ulong
+-D.AndAndExpression : ulong
+-D.OrExpression : ulong
+-D.XorExpression : ulong
+-D.AndExpression : ulong
+-D.ShiftExpression : ulong
+-D.AddExpression : ulong
+-D.MulExpression : ulong
+-D.UnaryExpression : ulong
+-D.PowExpression : ulong
+-D.PostfixExpression : ulong
+-D.PrimaryExpression : ulong
+-D.IntegerLiteral : ulong
+-D.integerWithSuffix : ulong
+-D.Integer : int
| +-D.HexadecimalInteger : int
+-D.IntegerSuffix : void
|
D
|
/**
Horizontal list
Copyright: (c) Enalye 2017
License: Zlib
Authors: Enalye
*/
module atelier.ui.list.hlist;
import std.conv : to;
import atelier.core, atelier.render, atelier.common;
import atelier.ui.gui_element, atelier.ui.container, atelier.ui.slider;
private final class ListContainer : GuiElement {
public {
HContainer container;
}
this(Vec2f sz) {
isLocked = true;
container = new HContainer;
size(sz);
appendChild(container);
hasCanvas(true);
}
}
/// Horizontal list of elements with a slider.
class HList : GuiElement {
protected {
ListContainer _container;
Slider _slider;
Vec2f _lastMousePos = Vec2f.zero;
float _layoutLength = 25f;
int _nbElements;
int _idElementSelected;
}
@property {
/// The ID of the child that has been selected.
int selected() const {
return _idElementSelected;
}
/// Ditto
int selected(int id) {
if (id >= _nbElements)
id = _nbElements - 1;
if (id < 0)
id = 0;
_idElementSelected = id;
//Update children
auto widgets = _container.container.children;
foreach (GuiElement gui; _container.container.children)
gui.isSelected = false;
if (_idElementSelected < widgets.length)
widgets[_idElementSelected].isSelected = true;
return _idElementSelected;
}
/// Width of a single child.
float layoutLength() const {
return _layoutLength;
}
/// Ditto
float layoutLength(float length) {
_layoutLength = length;
_container.container.size = Vec2f(_layoutLength * _nbElements, _container.size.y);
return _layoutLength;
}
/// The list of all its children.
override const(GuiElement[]) children() const {
return _container.container.children;
}
/// Ditto
override GuiElement[] children() {
return _container.container.children;
}
/// Return the first child gui.
override GuiElement firstChild() {
return _container.container.firstChild;
}
/// Return the last child gui.
override GuiElement lastChild() {
return _container.container.lastChild;
}
/// The number of children it currently has.
override size_t childCount() const {
return _container.container.childCount;
}
}
/// Ctor.
this(Vec2f sz) {
isLocked = true;
_slider = new HScrollbar;
_slider.setAlign(GuiAlignX.left, GuiAlignY.bottom);
_container = new ListContainer(sz);
_container.setAlign(GuiAlignX.right, GuiAlignY.top);
_container.container.setAlign(GuiAlignX.left, GuiAlignY.center);
super.appendChild(_slider);
super.appendChild(_container);
size(sz);
position(Vec2f.zero);
setEventHook(true);
_container.container.size = Vec2f(0f, _container.size.y);
}
override void onCallback(string id) {
if (id != "list")
return;
auto widgets = _container.container.children;
foreach (size_t elementId, ref GuiElement gui; _container.container.children) {
gui.isSelected = false;
if (gui.isHovered)
_idElementSelected = cast(uint) elementId;
}
if (_idElementSelected < widgets.length)
widgets[_idElementSelected].isSelected = true;
}
override void onEvent(Event event) {
if (event.type == Event.Type.mouseWheel)
_slider.onEvent(event);
}
override void onSize() {
_slider.size = Vec2f(size.x, 10f);
_container.container.size = Vec2f(_layoutLength * _nbElements, _container.size.y);
_container.size = Vec2f(size.x, size.y - _slider.size.y);
_container.canvas.renderSize = _container.size.to!Vec2i;
}
override void update(float deltaTime) {
super.update(deltaTime);
const float min = 0f;
const float max = _container.container.size.x - _container.size.x;
const float exceedingWidth = _container.container.size.x - _container.canvas.size.x;
if (exceedingWidth < 0f) {
_slider.maxValue = 0;
_slider.steps = 0;
}
else {
_slider.maxValue = exceedingWidth / _layoutLength;
_slider.steps = to!uint(_slider.maxValue);
}
_container.canvas.position = _container.canvas.size / 2f + Vec2f(lerp(min,
max, _slider.offset), 0f);
}
override void prependChild(GuiElement gui) {
gui.position = Vec2f.zero;
gui.size = Vec2f(gui.size.x, _container.size.y);
gui.setAlign(GuiAlignX.right, GuiAlignY.top);
gui.isSelected = (_nbElements == 0u);
gui.setCallback(this, "list");
_nbElements++;
_container.container.size = Vec2f(_layoutLength * _nbElements, _container.size.y);
_container.container.position = Vec2f.zero;
_container.container.prependChild(gui);
}
override void appendChild(GuiElement gui) {
gui.position = Vec2f.zero;
gui.size = Vec2f(gui.size.x, _container.size.y);
gui.setAlign(GuiAlignX.right, GuiAlignY.top);
gui.isSelected = (_nbElements == 0u);
gui.setCallback(this, "list");
_nbElements++;
_container.container.size = Vec2f(_layoutLength * _nbElements, _container.size.y);
_container.container.position = Vec2f.zero;
_container.container.appendChild(gui);
}
override void removeChildren() {
_nbElements = 0u;
_idElementSelected = 0u;
_container.container.size = Vec2f(0f, _container.size.y);
_container.container.position = Vec2f.zero;
_container.container.removeChildren();
}
override void removeChild(size_t id) {
_container.container.removeChild(id);
_nbElements = cast(int) _container.container.childCount;
_idElementSelected = 0u;
_container.container.size = Vec2f(_container.size.x, _layoutLength * _nbElements);
_container.container.position = Vec2f(0f, _container.container.size.y / 2f);
}
override void removeChild(GuiElement gui) {
_container.container.removeChild(gui);
_nbElements = cast(int) _container.container.childCount;
_idElementSelected = 0u;
_container.container.size = Vec2f(_container.size.x, _layoutLength * _nbElements);
_container.container.position = Vec2f(0f, _container.container.size.y / 2f);
}
}
|
D
|
INSTANCE Info_Mod_Xardas_NW_Hallo (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Hallo_Condition;
information = Info_Mod_Xardas_NW_Hallo_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Hallo_Condition()
{
if (HeroIstKeinZombie == TRUE)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Hallo_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_00"); //Was?! Bei Beliar! Du hier?! Wie ist das möglich? Es ist jetzt drei Wochen her, seitdem du den Schläfer verbannt hast.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_01"); //Ich war mir sicher, du seiest tot ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Hallo_15_02"); //So war es auch.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_03"); //Was sagst du? Das musst du mir erklären ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Hallo_15_04"); //Nachdem deine Diener das Geröll zur Seite geschafft hatten, erwachte ich zu neuem Bewusstsein.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Hallo_15_05"); //Ich vermochte zwar meinen Körper zu lenken, musste jedoch schnell feststellen, dass er im Begriff war zu verwesen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_06"); //Das ist höchst ungewöhnlich. Wobei ... mir fällt da eine antike Überlieferung ein, nach welcher der Träger einer magischen Rüstung in einer Schlacht selbst dann den Kampf fortführte, ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_07"); //... als sein Körper von unzähligen Waffen durchbohrt und von Flammen verbrannt worden war.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_08"); //Sein Geist wurde scheinbar durch die magische Rüstung im toten Leib zurückgehalten, wie in einem Käfig. Das Gleiche muss auch bei dir geschehen sein.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_09"); //Die magische Explosion nach dem Fall der Barriere mag auch ihren Anteil daran gehabt haben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_10"); //Hmm ... aber wie ist es dann möglich, dass du wieder lebendig vor mir stehst? Was ist geschehen?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Hallo_15_11"); //In den Trümmern fand ich ein Buch, das eine Formel preisgab, mit welcher Rüstung und Heilrune gekoppelt werden konnten.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Hallo_15_12"); //Mit der magischen Energie der Rüstung kann auf diesem Weg eine völlige Heilung des Trägers erwirkt werden.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_13"); //(erstaunt) Du hattest großes Glück, dass dir solch ein Buch in die Hände fiel. Bücher, die solch altes Wissen enthalten, sind höchst selten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Hallo_14_14"); //Wie dem auch sei, so stehst du jetzt wieder lebend vor mir.
B_GivePlayerXP (100);
Mod_RealStrength = 10;
Mod_RealDexterity = 10;
Mod_RealMana = 10;
Mod_KenntBodo = 0;
FokiEingesetzt = 0;
Monster_Max = 2307;
Erzhackchance = 10;
Mod_Gottstatus = 8;
Mod_Verhandlungsgeschick = 10;
Npc_RemoveInvItems (hero, ItWr_XardasLetterForHeroOT, 1);
Npc_SetTalentSkill (hero, NPC_TALENT_GOTTSTATUS, 8);
B_LogEntry (TOPIC_MOD_ANFANG, "Ich habe Xardas gefunden und ihm meine Geschichte erzählt. Jetzt werde ich hoffentlich erfahren, wie es weitergeht.");
B_SetTopicStatus (TOPIC_MOD_ANFANG, LOG_SUCCESS);
if (Mod_OT_Geheimkammer == 1) {
B_SetTopicStatus (TOPIC_MOD_OT_GEHEIMKAMMER, LOG_FAILED);
};
};
INSTANCE Info_Mod_Xardas_NW_WasJetzt (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WasJetzt_Condition;
information = Info_Mod_Xardas_NW_WasJetzt_Info;
permanent = 0;
important = 0;
description = "Was soll ich jetzt machen?";
};
FUNC INT Info_Mod_Xardas_NW_WasJetzt_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Hallo))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WasJetzt_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WasJetzt_15_00"); //Was soll ich jetzt machen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasJetzt_14_01"); //Du hast den Schläfer verbannt und die Barriere vernichtet. Ein unbedarfter Beobachter würde nun vielleicht meinen, alles sei friedlich.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasJetzt_14_02"); //Aber der Friede ist trügerisch.
};
INSTANCE Info_Mod_Xardas_NW_Vorahnung (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Vorahnung_Condition;
information = Info_Mod_Xardas_NW_Vorahnung_Info;
permanent = 0;
important = 0;
description = "Woher willst du das wissen?";
};
FUNC INT Info_Mod_Xardas_NW_Vorahnung_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasJetzt))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Vorahnung_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Vorahnung_15_00"); //Woher willst du das wissen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Vorahnung_14_01"); //In den letzten Tagen wurde ich öfters von Visionen geplagt. Eine dunkle Gestalt streifte über Khorinis und verbreitete Unheil.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Vorahnung_15_02"); //Das klingt nicht gut. Weißt du denn nichts Genaueres?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Vorahnung_14_03"); //Nein, bisher habe ich nur diese Visionen. Jedoch forsche ich in meinen Büchern nach Informationen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Vorahnung_15_04"); //Kann ich dir dabei helfen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Vorahnung_14_05"); //In deinem geschwächten Zustand kannst du mir kaum eine Hilfe sein. Du solltest erst wieder Kräfte sammeln.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Vorahnung_14_06"); //Sicherlich wäre es von Vorteil, wenn du dich dazu einer der Gilden hier anschließt. Die haben immer noch die besten Lehrer.
Log_CreateTopic (TOPIC_MOD_DIEBEDROHUNG, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_DIEBEDROHUNG, LOG_RUNNING);
Log_CreateTopic (TOPIC_MOD_GILDENAUFNAHME, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_GILDENAUFNAHME, LOG_RUNNING);
B_LogEntry_More (TOPIC_MOD_GILDENAUFNAHME, TOPIC_MOD_DIEBEDROHUNG, "Xardas hat gesagt ich solle zuerst Kräfte sammeln und mich dazu einer Gilde anschließen.", "Xardas hat in letzter Zeit einige Visionen gehabt. Eine dunkle Gestalt wird Unheil über Khorinis verbreiten. Xardas forscht derzeit in seinen Büchern noch Informationen. Bis er etwas neues herausgefunden hat soll ich mich einer Gilde anschließen.");
};
INSTANCE Info_Mod_Xardas_NW_WasFuerGilden (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WasFuerGilden_Condition;
information = Info_Mod_Xardas_NW_WasFuerGilden_Info;
permanent = 0;
important = 0;
description = "Was für Gilden gibt es?";
};
FUNC INT Info_Mod_Xardas_NW_WasFuerGilden_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Vorahnung))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WasFuerGilden_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WasFuerGilden_15_00"); //Was für Gilden gibt es?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasFuerGilden_14_01"); //Es gibt in der Stadt die Miliz, welche sich gut aufs Kämpfen versteht.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasFuerGilden_14_02"); //Ich habe gehört, dass auf einem Bauernhof ein paar Söldner sind. Ich glaube, dass du sie kennst.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasFuerGilden_14_03"); //In einem Kloster leben Feuermagier. Auch ihnen kannst du dich anschließen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasFuerGilden_14_04"); //Außerdem gibt es noch die Wassermagier, die sich momentan an einer alten Ruine zu schaffen machen. Einer von ihnen soll sich jedoch in der Stadt aufhalten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasFuerGilden_14_05"); //Oder aber du entscheidest dich für den Weg Beliars.
Mod_Gilde = 0;
B_LogEntry (TOPIC_MOD_GILDENAUFNAHME, "Ich kann entweder ein Mitglied der Miliz, ein Söldner, ein Feuer Novize, ein Wasser Novize oder ein Schwarzer Novize werden.");
Mil_310_schonmalreingelassen = TRUE;
Log_CreateTopic (TOPIC_MOD_MILIZ, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_MILIZ, LOG_RUNNING);
Log_CreateTopic (TOPIC_MOD_SÖLDNER, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_SÖLDNER, LOG_RUNNING);
Log_CreateTopic (TOPIC_MOD_DAEMONENBESCHWOERER, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_DAEMONENBESCHWOERER, LOG_RUNNING);
Log_CreateTopic (TOPIC_MOD_FEUERMAGIER, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_FEUERMAGIER, LOG_RUNNING);
Log_CreateTopic (TOPIC_MOD_WASSERMAGIER, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_WASSERMAGIER, LOG_RUNNING);
B_LogEntry_NS (TOPIC_MOD_MILIZ, "Ich kann mich der Miliz in der Stadt anschließen.");
B_LogEntry_NS (TOPIC_MOD_SÖLDNER, "Die Söldner finde ich auf einem Bauernhof. Xardas meint, dass ich sie kenne.");
B_LogEntry_NS (TOPIC_MOD_DAEMONENBESCHWOERER, "Bei Xardas kann ich mich den schwarzen Novizen anschließen.");
B_LogEntry_NS (TOPIC_MOD_FEUERMAGIER, "In einem Kloster auf der Insel leben die Feuermagier, denen ich mich anschließen kann.");
B_LogEntry_NS (TOPIC_MOD_WASSERMAGIER, "Die Wassermagier sind in einer alten Ruine im Norden der Insel. Jedoch soll einer in der Stadt Khorinis zu finden sein.");
B_Kapitelwechsel (1, NEWWORLD_ZEN);
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "START");
};
INSTANCE Info_Mod_Xardas_NW_Urnol (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Urnol_Condition;
information = Info_Mod_Xardas_NW_Urnol_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Urnol_Condition()
{
if (!Npc_KnowsInfo(hero, Info_Mod_Urnol_WerBistDu))
&& (Mod_Gilde > 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Urnol_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol_14_00"); //Ahh. Da bist du ja. Bist du einer Gilde beigetreten?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Urnol_15_01"); //Ja. Aber es war nicht ganz einfach.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol_14_02"); //Sehr schön. Und hast du auch den dunklen Pilger gesprochen?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Urnol_15_03"); //Bis jetzt noch nicht. Er ist mir immer einen Schritt voraus.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol_14_04"); //(zornig) Papperlapapp! Wir müssen unbedingt wissen, was ihn umtreibt. Mir schwant Schlimmes.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol_14_05"); //Geh und finde diesen Pilger. Und dann berichte mir.
B_LogEntry (TOPIC_MOD_DIEBEDROHUNG, "Es scheint, als wäre der Pilger wichtig. Xardas will, dass ich ihn unbedingt aufsuche.");
};
INSTANCE Info_Mod_Xardas_NW_Urnol1 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Urnol1_Condition;
information = Info_Mod_Xardas_NW_Urnol1_Info;
permanent = 0;
important = 0;
description = "Ich habe einen Schattenlord getroffen.";
};
FUNC INT Info_Mod_Xardas_NW_Urnol1_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Urnol_WerBistDu))
&& (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasFuerGilden))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Urnol1_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Urnol1_15_00"); //Ich habe einen Schattenlord getroffen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_01"); //Dann scheint die Bedrohung schon näher zu sein, als ich erwartet hatte. Was hat er dir erzählt?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Urnol1_15_02"); //Er hat gesagt, dass sein Meister zurückkehren würde, um mich zu töten, weil ich einen seiner Diener getötet hätte.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_03"); //Und der Diener war wahrscheinlich der Schläfer.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Urnol1_15_04"); //Ja, das hat der Schattenlord gesagt. Aber der Schläfer war doch der Gott der Orks und wurde auch von ihnen erschaffen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_05"); //Das dachte ich auch, doch scheinbar war ich nicht richtig informiert. Ich werde versuchen, mehr über die Sache rauszufinden.
if (Mod_Gilde == 0)
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_06"); //Schließ du dich erstmal einer Gilde an.
}
else
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_07"); //Komm morgen wieder, dann habe ich sicher Neuigkeiten für dich.
Mod_HS_UrnolXardas_NextDay = Wld_GetDay();
};
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_08"); //Übrigens: Diese dunkle Kreatur ist nicht das Einzige, was mich beschäftigt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_09"); //Auf einem Streifzug durch Khorinis bin ich einem weiteren Wanderer begegnet.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_10"); //Er nannte sich Argez, konnte mir aber nicht sagen, woher er kam.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_11"); //Das Gespräch hätte nicht meine Aufmerksamkeit erregt, wenn ich nicht das dumpfe Gefühl hätte, den Namen schon einmal gehört zu haben. Vor einer langen Zeit ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_12"); //Es kann gut sein, dass er in nebligen Spiel, das momentan mit uns gespielt wird, eine wichtige Figur ist.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Urnol1_14_13"); //Vielleicht triffst du ihn ja; er wollte nach Khorinis.
B_GivePlayerXP (250);
if (!Npc_KnowsInfo(hero, Info_Mod_Argez_NW_Hi))
{
Log_CreateTopic (TOPIC_MOD_ARGEZ, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_ARGEZ, LOG_RUNNING);
};
B_LogEntry_More (TOPIC_MOD_DIEBEDROHUNG, TOPIC_MOD_ARGEZ, "Nachdem ich Xardas von dem Treffen mit Urnol berichtet hatte, war dieser sehr überrascht, doch sein verdacht schien sich bestätigt zu haben. Besonders erstaunt hat ihn die Tatsache mit dem Schläfer.", "Xardas sprach von einer möglichen Schlüsselfigur bei seiner Vorahnung, die sich Argez nennt. Als Xardas ihn traf, war er gerade auf dem Weg nach Khorinis.");
};
INSTANCE Info_Mod_Xardas_NW_InGilde (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_InGilde_Condition;
information = Info_Mod_Xardas_NW_InGilde_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_InGilde_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Urnol1))
&& (Mod_Gilde > 0)
&& (Mod_HS_UrnolXardas_NextDay < Wld_GetDay())
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_InGilde_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_InGilde_14_00"); //Ah, gut, dass du kommst. Ich hab ein paar Sachen rausgefunden.
AI_Output(hero, self, "Info_Mod_Xardas_NW_InGilde_15_01"); //Das hatte ich gehofft.
AI_Output(self, hero, "Info_Mod_Xardas_NW_InGilde_14_02"); //Nun, ich fürchte beinahe, die Bedrohung ist größer als erwartet.
AI_Output(hero, self, "Info_Mod_Xardas_NW_InGilde_15_03"); //Geht's auch etwas konkreter?
AI_Output(self, hero, "Info_Mod_Xardas_NW_InGilde_14_04"); //Fürs Erste: nein. Ich bin zwar auf eine Spur gestoßen, aber ich möchte dich nicht mit Dingen belasten, bei denen ich mir nicht sicher bin, ob sie überhaupt existieren.
AI_Output(self, hero, "Info_Mod_Xardas_NW_InGilde_14_05"); //Du kannst mir allerdings einen großen Gefallen tun und den Wassermagiern an ihrer Ausgrabungsstätte helfen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_InGilde_14_06"); //Wenn ich richtig liege, wird uns das Portal, das sie entdeckt haben, einige wichtige Fragen beantworten.
AI_Output(hero, self, "Info_Mod_Xardas_NW_InGilde_15_07"); //(klagt) Aber meine wichtigen Fragen willst du nicht beantworten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_InGilde_14_08"); //Dafür lasse ich dich an einem historischen Moment teilhaben. Nicht jeder darf in seinem Leben ein Jahrtausende altes Portal durchqueren.
AI_Output(hero, self, "Info_Mod_Xardas_NW_InGilde_15_09"); //Es gehörte auch bisher nicht zu meinen Lebenszielen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_InGilde_14_10"); //(streng) Aber jetzt!
B_LogEntry (TOPIC_MOD_DIEBEDROHUNG, "Xardas hat mich damit beauftragt, mit den Wassermagiern das Portal, welches sie entdeckt haben, zu durchschreiten.");
};
INSTANCE Info_Mod_Xardas_NW_Saturas (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Saturas_Condition;
information = Info_Mod_Xardas_NW_Saturas_Info;
permanent = 0;
important = 0;
description = "Die Wassermagier werden mich sicher nicht mitnehmen wollen.";
};
FUNC INT Info_Mod_Xardas_NW_Saturas_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_InGilde))
&& ((Mod_Gilde == 1)
|| (Mod_Gilde == 6)
|| (Mod_Gilde == 12))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Saturas_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Saturas_15_00"); //Die Wassermagier werden mich sicher nicht mitnehmen wollen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Saturas_14_01"); //Dann übergib Saturas diese Botschaft von mir.
B_GiveInvItems (self, hero, XardasLetterForSaturas, 1);
};
INSTANCE Info_Mod_Xardas_NW_XeresLebt (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_XeresLebt_Condition;
information = Info_Mod_Xardas_NW_XeresLebt_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_XeresLebt_Condition()
{
if (Kapitel == 4)
&& (Npc_KnowsInfo(hero, Info_Mod_Xeres_Beliar))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_XeresLebt_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_00"); //Hast du Xeres vernichten können?
AI_Output(hero, self, "Info_Mod_Xardas_NW_XeresLebt_15_01"); //Nein, er hat mich wieder besiegt. Ich lebe nur dank deinem Amulett noch.
Log_CreateTopic (TOPIC_MOD_MAGIERRAT, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_MAGIERRAT, LOG_RUNNING);
if (hero.guild == GIL_VLK)
&& (!Npc_KnowsInfo(hero, Info_Mod_Aaron_BarriereWeg))
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_02"); //Ich muss den Rat wieder einberufen. Jedoch werden meine Untergebenen, die zur Zeit in Patherion sind, dem nicht zustimmen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_03"); //Du musst dafür sorgen, dass das Problem dort beseitigt wird, ehe ich den Rat einberufen kann.
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Xardas will den Rat wieder einberufen, doch vorher muss ich die Probleme in Patherion lösen.");
}
else if (hero.guild == GIL_KDF)
&& (!Npc_KnowsInfo(hero, Info_Mod_Xardas_AW_Bshydal))
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_04"); //Ich muss den Rat wieder einberufen. Jedoch gibt es derzeit Dringlicheres.
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_05"); //Du musst aber vorher noch etwas für Myxir erledigen. Komm wieder, wenn du es erledigt hast.
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Xardas will den Rat wieder einberufen, doch vorher muss ich noch etwas für Myxir erledigen.");
B_StartOtherRoutine (self, "BUMMEL");
}
else
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_06"); //Ich werde den Magierrat wieder einberufen. Ich mache mich sofort auf den Weg.
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_07"); //Er wird im Klosterkeller stattfinden. Wir treffen uns dann dort. Nimm diesen Ring, er wird dich dorthin bringen.
B_GiveInvItems (self, hero, Mod_XardasBeamRing, 1);
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Xardas hat sich auf den Weg zur Einberufung des Magierrates gemacht. Dieser findet im Klosterkeller statt. Er hat mir einen Ring gegeben, welcher mich dorthin bringen wird.");
if (Mod_Gilde != 2)
&& (Mod_Gilde != 19)
&& (Mod_Gilde != 7)
&& (Mod_Gilde != 10)
&& (Mod_Gilde != 13)
&& (Mod_Gilde != 15)
&& (Mod_Gilde != 17)
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_XeresLebt_14_08"); //Allerdings solltest du erst den nächsthöheren Rang deiner Gilde erlangen.
};
Mod_HS_XardasRat = 1;
AI_StopProcessInfos (self);
AI_Teleport (self, "WP_KLOSTER_KELLER_RAT_VERTEILER");
B_StartOtherRoutine (self, "RAT");
if (hero.guild == GIL_MIL)
&& (!Npc_KnowsInfo(hero, Info_Mod_Dragon_KlosterErfolg))
&& (!Npc_IsDead(Dragon_11009_NW))
{
Mod_HSNL_RatProblem = 1;
}
else if (hero.guild == GIL_NOV)
&& (!Npc_KnowsInfo(hero, Info_Mod_Saturas_AW_Member_26))
{
Mod_HSWM_RatProblem = 1;
// ToDo
Wld_InsertNpc(Mod_510_DMR_Raven_NW, "BIGFARM");
//B_StartOtherRoutine (Mod_517_DMR_Gomez_NW, "RAT");
B_StartOtherRoutine (Mod_551_KDF_Pyrokar_NW, "RAT");
B_StartOtherRoutine (Mod_592_PAL_Hagen_NW, "RAT");
B_StartOtherRoutine (Mod_925_KDF_Talamon_NW, "RAT");
}
else
{
Wld_InsertNpc(Mod_510_DMR_Raven_NW, "BIGFARM");
//B_StartOtherRoutine (Mod_517_DMR_Gomez_NW, "RAT");
B_StartOtherRoutine (Mod_551_KDF_Pyrokar_NW, "RAT");
B_StartOtherRoutine (Mod_774_KDW_Saturas_NW, "RAT");
B_StartOtherRoutine (Mod_527_SLD_Torlof_NW, "RAT");
B_StartOtherRoutine (Mod_925_KDF_Talamon_NW, "RAT");
if (hero.guild != GIL_PAL)
{
B_StartOtherRoutine (Mod_592_PAL_Hagen_NW, "RAT");
};
};
};
};
INSTANCE Info_Mod_Xardas_NW_PatherionOk (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_PatherionOk_Condition;
information = Info_Mod_Xardas_NW_PatherionOk_Info;
permanent = 0;
important = 0;
description = "Patherion ist sicher.";
};
FUNC INT Info_Mod_Xardas_NW_PatherionOk_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_XeresLebt))
&& (Mod_HS_XardasRat == 0)
&& (Npc_KnowsInfo(hero, Info_Mod_Aaron_BarriereWeg))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_PatherionOk_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_PatherionOk_15_00"); //Patherion ist sicher und die Schwarzmagier geschlagen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_PatherionOk_14_01"); //Das ist gut. Nun kann ich den Magierrat wieder einberufen. Ich werde sofort aufbrechen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_PatherionOk_14_02"); //Wir werden uns im Klosterkeller treffen. Mit diesem Ring kommst du dort hin.
B_GiveInvItems (self, hero, Mod_XardasBeamRing, 1);
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Xardas hat sich auf den Weg zur Einberufung des Magierrates gemacht. Dieser findet im Klosterkeller statt. Er hat mir einen Ring gegeben, welcher mich dorthin bringen wird.");
Mod_HS_XardasRat = 1;
AI_StopProcessInfos (self);
AI_Teleport (self, "WP_KLOSTER_KELLER_RAT_VERTEILER");
// ToDo
B_StartOtherRoutine (self, "RAT");
Wld_InsertNpc(Mod_510_DMR_Raven_NW, "BIGFARM");
//B_StartOtherRoutine (Mod_517_DMR_Gomez_NW, "RAT");
B_StartOtherRoutine (Mod_551_KDF_Pyrokar_NW, "RAT");
B_StartOtherRoutine (Mod_592_PAL_Hagen_NW, "RAT");
B_StartOtherRoutine (Mod_774_KDW_Saturas_NW, "RAT");
B_StartOtherRoutine (Mod_527_SLD_Torlof_NW, "RAT");
B_StartOtherRoutine (Mod_925_KDF_Talamon_NW, "RAT");
};
INSTANCE Info_Mod_Xardas_NW_BshydalOk (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_BshydalOk_Condition;
information = Info_Mod_Xardas_NW_BshydalOk_Info;
permanent = 0;
important = 0;
description = "Kannst du jetzt den Rat einberufen?";
};
FUNC INT Info_Mod_Xardas_NW_BshydalOk_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_XeresLebt))
&& (Mod_HS_XardasRat == 0)
&& (Npc_KnowsInfo(hero, Info_Mod_Xardas_AW_Bshydal))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_BshydalOk_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_BshydalOk_15_00"); //Kannst du jetzt den Rat einberufen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_BshydalOk_14_01"); //Ja, ich werde sofort aufbrechen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_BshydalOk_14_02"); //Wir werden uns im Klosterkeller treffen. Mit diesem Ring kommst du dort hin.
B_GiveInvItems (self, hero, Mod_XardasBeamRing, 1);
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Xardas hat sich auf den Weg zur Einberufung des Magierrates gemacht. Dieser findet im Klosterkeller statt. Er hat mir einen Ring gegeben, welcher mich dorthin bringen wird.");
Mod_HS_XardasRat = 1;
AI_StopProcessInfos (self);
AI_Teleport (self, "WP_KLOSTER_KELLER_RAT_VERTEILER");
// ToDo
B_StartOtherRoutine (self, "RAT");
//B_StartOtherRoutine (Mod_520_DMR_Raven_NW, "RAT");
//B_StartOtherRoutine (Mod_517_DMR_Gomez_NW, "RAT");
B_StartOtherRoutine (Mod_551_KDF_Pyrokar_NW, "RAT");
B_StartOtherRoutine (Mod_592_PAL_Hagen_NW, "RAT");
B_StartOtherRoutine (Mod_774_KDW_Saturas_NW, "RAT");
B_StartOtherRoutine (Mod_527_SLD_Torlof_NW, "RAT");
B_StartOtherRoutine (Mod_925_KDF_Talamon_NW, "RAT");
};
INSTANCE Info_Mod_Xardas_NW_Rat_Dragon (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Rat_Dragon_Condition;
information = Info_Mod_Xardas_NW_Rat_Dragon_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Rat_Dragon_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_XeresLebt))
&& (Mod_HS_XardasRat == 1)
&& (Mod_HSNL_RatProblem == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Rat_Dragon_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Dragon_14_00"); //(aufgebracht) Diese engstirnigen Ignoranten ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rat_Dragon_15_01"); //Was ist los?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Dragon_14_02"); //Ach, die Feuermagier haben Zweifel daran, ob die Bedrohung wirklich so groß ist, dass sie ihr Schicksal in die Hände eine "gottlosen Söldners und Delinquenten aus der Strafkolonie" legen müssten, wie sie es nannten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Dragon_14_03"); //Es muss wohl erst etwas Fatales geschehen, was sie von der Unmittelbarkeit der Gefahr überzeugt ...
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Xardas ist zwar beim Rat, der Rest will jedoch nicht teilnehmen, weil er die Bedrohung nicht wahrhaben will.");
};
INSTANCE Info_Mod_Xardas_NW_Rat_Dragon2 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Rat_Dragon2_Condition;
information = Info_Mod_Xardas_NW_Rat_Dragon2_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Rat_Dragon2_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_XeresLebt))
&& (Mod_HS_XardasRat == 1)
&& (Mod_HSNL_RatProblem == 2)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Rat_Dragon2_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Dragon2_14_00"); //(süffisant) So, der Überfall dämonischer Kreaturen auf das Kloster hat die Feuermagier doch noch von der Dringlichkeit unseres Anliegens überzeugen können.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Dragon2_14_01"); //Bevor sie jedoch die weiterführenden Schritte im Kampf gegen Xeres erörtern werden, möchten sie die Gefahr gebannt sehen, die ihr Kloster heimgesucht hat.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Dragon2_14_02"); //Du weißt vermutlich, was zu tun ist.
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Bevor die Feuermagier zum Treffen kommen, muss die Sache mit Drachen geklärt werden.");
Mod_HSNL_RatProblem = 0;
};
INSTANCE Info_Mod_Xardas_NW_Rat_Unheil (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Rat_Unheil_Condition;
information = Info_Mod_Xardas_NW_Rat_Unheil_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Rat_Unheil_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_XeresLebt))
&& (Mod_HS_XardasRat == 1)
&& (Mod_HSWM_RatProblem == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Rat_Unheil_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Unheil_14_00"); //Leider sind wir noch nicht vollständig und können somit auch die weiteren Schritte im Kampf gegen Xeres nicht erörtern.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Unheil_14_01"); //Saturas sieht sich bei den Geschehnissen auf dem Weidenplateau mit nicht minder Bedrohlichem konfrontiert und wird erst zu uns stoßen, wenn diese Gefahr gebannt ist.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Unheil_14_02"); //Du solltest ihn dabei nach deinen Möglichkeiten unterstützen.
B_LogEntry (TOPIC_MOD_MAGIERRAT, "Saturas wird erst zum Rat stoßen, wenn die Probleme auf dem Weidenplateau beseitigt sind.");
};
INSTANCE Info_Mod_Xardas_NW_Rat_Ende (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Rat_Ende_Condition;
information = Info_Mod_Xardas_NW_Rat_Ende_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Rat_Ende_Condition()
{
var int dialog;
dialog = FALSE;
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_XeresLebt))
&& (Mod_HS_XardasRat == 1)
&& (Mod_HSNL_RatProblem == 0)
&& (Mod_HSWM_RatProblem == 0)
{
if (Hlp_IsValidNpc(Dragon_11009_NW))
{
if (Npc_IsDead(Dragon_11009_NW))
{
dialog = TRUE;
}
else
{
dialog = FALSE;
return FALSE;
};
}
else
{
dialog = TRUE;
};
if (Hlp_IsValidNpc(Knucker_11001_NW))
{
if (Npc_IsDead(Knucker_11001_NW))
{
dialog = TRUE;
}
else
{
dialog = FALSE;
return FALSE;
};
}
else
{
dialog = TRUE;
};
if (Hlp_IsValidNpc(Feuerdrache_11002_NW))
{
if (Npc_IsDead(Feuerdrache_11002_NW))
{
dialog = TRUE;
}
else
{
dialog = FALSE;
return FALSE;
};
}
else
{
dialog = TRUE;
};
};
return dialog;
};
FUNC VOID Info_Mod_Xardas_NW_Rat_Ende_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Ende_14_00"); //Wir haben nur noch eine Möglichkeit. Wir brauchen Uriziel. Du wirst in den Schläfertempel gehen und es holen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rat_Ende_14_01"); //Nur damit haben wir jetzt noch eine Chance. Nimm diese Teleportrune, damit kommst du hier raus und vor das Kloster.
B_GiveInvItems (self, hero, ItRu_TeleportMonastery, 1);
Log_CreateTopic (TOPIC_MOD_URIZIEL, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_URIZIEL, LOG_RUNNING);
B_SetTopicStatus (TOPIC_MOD_MAGIERRAT, LOG_SUCCESS);
B_LogEntry (TOPIC_MOD_URIZIEL, "Xardas sagt, dass ich Uriziel aus dem Schläfertempel holen muss. Es ist unsere einzige Chance.");
};
INSTANCE Info_Mod_Xardas_NW_WoTempel (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WoTempel_Condition;
information = Info_Mod_Xardas_NW_WoTempel_Info;
permanent = 0;
important = 0;
description = "Wo war doch gleich der Eingang zum Tempel?";
};
FUNC INT Info_Mod_Xardas_NW_WoTempel_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Rat_Ende))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WoTempel_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WoTempel_15_00"); //Wo war doch gleich der Eingang zum Tempel?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WoTempel_14_01"); //In der Stadt der Orks. Dort wirst du einen Platz mit einer Säule finden. Von dort aus bist du in Xeres' Kammer gelangt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WoTempel_14_02"); //Dort ist jedenfalls ein Gitter, hinter welchem sich der Schläfertempel erstreckt.
};
INSTANCE Info_Mod_Xardas_NW_WieInTempel (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WieInTempel_Condition;
information = Info_Mod_Xardas_NW_WieInTempel_Info;
permanent = 0;
important = 0;
description = "Wie soll ich in den Tempel kommen?";
};
FUNC INT Info_Mod_Xardas_NW_WieInTempel_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Rat_Ende))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WieInTempel_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WieInTempel_15_00"); //Wie soll ich in den Tempel kommen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WieInTempel_14_01"); //Du musst vorsichtig sein, die Orks wurden stark von Xeres beeinflusst. Sie werden dein Ulu-Mulu nicht mehr anerkennen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WieInTempel_14_02"); //Ich weiß auch nicht, wie es im Tempel aussieht, also sei auf der Hut.
};
INSTANCE Info_Mod_Xardas_NW_UrizielKaputt (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_UrizielKaputt_Condition;
information = Info_Mod_Xardas_NW_UrizielKaputt_Info;
permanent = 0;
important = 0;
description = "Uriziel ist zerstört.";
};
FUNC INT Info_Mod_Xardas_NW_UrizielKaputt_Condition()
{
if (Mod_HasUrizielKaputt == 1)
&& (Npc_HasItems(hero, ItMi_UrizielKaputt) == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_UrizielKaputt_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrizielKaputt_15_00"); //Uriziel ist zerstört.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_01"); //Das ist nicht gut. Uriziel war meine letzte und größte Hoffnung. Wir sind Xeres nun schutzlos ausgeliefert.
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrizielKaputt_15_02"); //Nicht unbedingt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_03"); //Was meinst du?
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrizielKaputt_15_04"); //Ich habe im Tempel einen Schamanen getroffen und er hat mir gesagt, dass Uriziel zerbrochen wurde.
B_GiveInvItems (hero, self, ItMi_UrizielKaputt, 1);
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrizielKaputt_15_05"); //Er meinte auch, dass nun die Macht der drei Götter gebrochen sei. Was bedeutet das?
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_06"); //Das bedeutet, dass wir noch eine Chance haben. Wie ich dir erzählt habe, gibt es den Göttern geweihte Waffen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_07"); //Wenn wir nun von jedem Gott eine Waffe haben und diese vereinen ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrizielKaputt_15_08"); //... dann können wir Uriziel wieder herstellen. Was ist also zu tun?
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_09"); //Wir brauchen die restlichen zwei Götterwaffen. Du musst sie suchen. Wir werde versuchen, eine Methode zu finden, um sie zu vereinen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_10"); //Geh zu Saturas, er hat sich mit der Geschichte der Götterwaffen beschäftigt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_11"); //Hier habe ich noch einige Beschwörungsspruchrollen, die dir vielleicht bei deiner Suche behilflich sein könnten.
B_ShowGivenThings ("7 Spruchrollen erhalten");
CreateInvItems (hero, ItSc_SumSkel, 5);
CreateInvItems (hero, ItSc_SumRabbit, 2);
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrizielKaputt_14_12"); //Und dann gibt es noch etwas, was ich unter vier Augen mit dir besprechen möchte.
B_LogEntry (TOPIC_MOD_URIZIEL, "Xardas hat eine Idee, wie wir Uriziel wiederherstellen können. Dazu brauchen wir allerdings noch die restlichen zwei Götterwaffen. Saturas weiß mehr darüber.");
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "PRIVAT");
};
INSTANCE Info_Mod_Xardas_NW_UrnolKap4 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_UrnolKap4_Condition;
information = Info_Mod_Xardas_NW_UrnolKap4_Info;
permanent = 0;
important = 0;
description = "Ja, ich bin ganz Ohr.";
};
FUNC INT Info_Mod_Xardas_NW_UrnolKap4_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_UrizielKaputt))
&& (Npc_GetDistToWP(self, "NW_KDF_LIBRARY_15") < 500)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_UrnolKap4_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrnolKap4_15_00"); //Ja, ich bin ganz Ohr.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrnolKap4_14_01"); //Ich kann spüren, dass Urnol sich auf Khorinis befindet ... und erscheint sich frei umherzubewegen, auch in bewohnten Gebieten.
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrnolKap4_15_02"); //Was?! Und es ist keinem etwas aufgefallen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrnolKap4_14_03"); //Das ist ja eben das Beunruhigende. Er muss einen Weg gefunden zu haben, sich zu tarnen, zu verbergen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrnolKap4_14_04"); //Und dann kann ich noch zahlreiche andere diffuse dämonische Energien spüren, die ebenfalls zu Tag, als auch bei Nacht ihren Standort wechseln ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrnolKap4_14_05"); //Es scheinen merkwürdige Dinge im Verborgenen abzulaufen. Du musst versuchen zu ergründen, was vor sich geht. Nur so kannst du Urnol finden.
AI_Output(hero, self, "Info_Mod_Xardas_NW_UrnolKap4_15_06"); //Gut, ich verstehe ... hmm, wo sollte ich am besten meine Suche beginnen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrnolKap4_14_07"); //Benutze deinen Verstand. Dort, wo viele Menschen aufeinander treffen, ist auch die Chance am größten, dass jemandem etwas auffällt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrnolKap4_14_08"); //Tavernen sind immer eine gute Anlaufstelle. Höre und schaue dich aber auch in der Stadt und den Bauernhöfen um.
AI_Output(self, hero, "Info_Mod_Xardas_NW_UrnolKap4_14_09"); //Aber sei vorsichtig ... das Böse könnte in nächster Nähe lauern, ohne, dass es sich als solches zu erkennen gibt.
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "RAT");
AI_Teleport (Mod_534_KDF_Milten_NW, "NW_KDF_LIBRARY_21");
B_StartOtherRoutine (Mod_534_KDF_Milten_NW, "PRIVAT");
AI_Teleport (Mod_534_KDF_Milten_NW, "NW_KDF_LIBRARY_21");
Log_CreateTopic (TOPIC_MOD_DAEMONISCH, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_DAEMONISCH, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_DAEMONISCH, "Xardas spürt Urnols Anwesenheit auf bewohntem Terrain um Khorinis, wie auch andere diffuse dämonische Energien. Ich soll mich umhören und umsehen, ob mir ungewöhnliche Dinge auffallen, und ihm dann Bericht erstatten. Ich sollte mich bei Tavernen, aber auch auf den Bauernhöfen und in der Stadt umhören.");
};
INSTANCE Info_Mod_Xardas_NW_Daemonisch (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Daemonisch_Condition;
information = Info_Mod_Xardas_NW_Daemonisch_Info;
permanent = 1;
important = 0;
description = "Ich habe Neues zu berichten.";
};
FUNC INT Info_Mod_Xardas_NW_Daemonisch_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_UrnolKap4))
&& (Mod_HQ_Daemonisch == 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Daemonisch_Info()
{
var int news; news = FALSE;
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_00"); //Ich habe Neues zu berichten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_01"); //Ja, was hast du herausgefunden?
if (Npc_KnowsInfo(hero, Info_Mod_Rosi_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_02"); //Leute verändern sich schlagartig, wenn sie in der Dunkelheit unterwegs waren.
news = TRUE;
};
if (Npc_KnowsInfo(hero, Info_Mod_Babo_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Orlan_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Opolos_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_03"); //In Zusammenhang mit dem Klosterwein gibt es Seltsames zu erzählen.
if (Npc_KnowsInfo(hero, Info_Mod_Babo_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_04"); //Der Novize Dyrian starb plötzlich, nachdem er in der Messe Klosterwein genossen hatte.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_05"); //Ein anderer Novize hat dabei gesehen, wie schwarzer Rauch aus ihm ausgetreten ist.
};
if (Npc_KnowsInfo(hero, Info_Mod_Orlan_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_06"); //Rukhar trank viel Klosterwein, bevor er einige Leute abends nach draußen begleitete.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_07"); //Er kam alleine in die Taverne zurückgelaufen und war völlig verstört.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_08"); //Seine Begleiter kamen nach ihm unversehrt zurück.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_09"); //Am nächsten Morgen war Rukhar tot.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_10"); //In Orlans Taverne trinkt kaum noch jemand den Wein des Klosters.
};
if (Npc_KnowsInfo(hero, Info_Mod_Opolos_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_11"); //Im Kloster sollen viele Novizen an Magenerkrankungen leiden und können keinen Klosterwein mehr genießen.
};
news = TRUE;
};
if (Npc_KnowsInfo(hero, Info_Mod_Thekla_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Orlan_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Coragon_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_12"); //Es gibt zahlreiche Menschen, die ungewöhnlich viel essen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_13"); //Und dennoch erscheinen sie alle ausgezehrt, verfallen körperlich zusehends.
news = TRUE;
};
if (Npc_KnowsInfo(hero, Info_Mod_Tengron_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Brian_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Orlan_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Pepe_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_14"); //Einige Menschen wollen schwarze Schatten im Dunkeln erblickt haben.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_15"); //Doch diesen Augenzeugen ergeht es zumeist nicht gut.
if (Npc_KnowsInfo(hero, Info_Mod_Tengron_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_16"); //Tengron sitzt im Kerker.
};
if (Npc_KnowsInfo(hero, Info_Mod_Brian_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_17"); //Brian wurde von Paladinen getötet.
if (Mod_HQ_BrianDaemonisch == 2)
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_18"); //Mich versuchten sie auch zu töten, als sie erfuhren, was Brian mir berichtet hatte.
};
};
if (Npc_KnowsInfo(hero, Info_Mod_Orlan_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_19"); //Rukhar ist tot.
};
if (Npc_KnowsInfo(hero, Info_Mod_Pepe_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_20"); //Pepe hält sich versteckt und fürchtet um sein Leben.
};
news = TRUE;
};
if (Mod_HQ_PaladineDaemonisch == TRUE)
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_21"); //Ich sah untote Paladine nahe der Stadt, die nicht lange zuvor noch lebendig waren.
news = TRUE;
};
if (Npc_KnowsInfo(hero, Info_Mod_Tengron_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Pepe_Daemonisch))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_22"); //Manche sahen sogar, wie Menschen unter dem Einfluss der Schatten zu Boden sanken, zunächst wie leblos schienen und sich dann zuckend erhoben.
news = TRUE;
};
if (Mod_HQ_SPGesehen == TRUE)
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_23"); //Ich begegnete selbst schwarzen Schatten in der Nacht, die mich attackierten.
if (Npc_KnowsInfo(hero, Info_Mod_Rupert_Daemonisch3))
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_24"); //Der Bürger Rupert war es sogar, der mich zu ihnen lockte und davon sprach, ich würde ihnen beitreten, oder sterben.
};
news = TRUE;
};
if (Npc_KnowsInfo(hero, Info_Mod_Tengron_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Pepe_Daemonisch))
|| (Mod_HQ_SPGesehen == TRUE)
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_25"); //Bei Beliar, wir schweben alle in größter Gefahr.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_26"); //Selbst ich hätte den Wald vor lauter Bäumen nicht gesehen ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_27"); //Wovon sprichst du?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_28"); //Während wir unsere Augen auf die orkischen Horden im Minental richten und uns auf eine kriegerische Auseinandersetzung vorbereiten, infiltriert Xeres unbemerkt mit seinen Schattenwesen ganz Khorinis.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_29"); //Sie ergreifen Besitz von jedem Menschen, der ihnen begegnet, kontrollieren ihn und zehren ihn allmählich aus.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_30"); //Was zum Schluss bleibt, ist die leblose Hülle, die zum Untoten wird.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_31"); //Wenn wir uns nicht beeilen, wird bald jede Siedlung unter Xeres' Einfluss stehen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_32"); //Was können wir tun, um die Schattenwesen aufzuhalten?
if (Npc_KnowsInfo(hero, Info_Mod_Babo_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Orlan_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Opolos_Daemonisch))
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_33"); //Nun, deine Ausführungen in Zusammenhang mit dem Klosterwein lassen gesegnete Getränke als Möglichkeit erkennen, die Besessenen von ihrem Parasiten zu befreien.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_34"); //Soll ich jetzt etwa zu jedem hinrennen und ihn zu einem Schluck Klosterwein oder "Heilung der Besessenheit" überreden?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_35"); //Um Beliars Willen, nein, natürlich nicht. Jetzt ist auch nicht der rechte Zeitpunkt für Possen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_36"); //Die Verbundenheit der Schattenwesen mit der Lebenskraft ihrer Wirte ist zu stark.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_37"); //Ein so starker Trank würde zwar schlagartig den Dämonen bannen, aber auch das Leben der Betroffenen erlöschen lassen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_38"); //Versuche es ihnen unbemerkt in einer der Gaststätten beizumischen, oder die Nahrung an einem Alchemietisch damit zu tränken.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_39"); //(unwillig) In Ordnung, dann darf ich jetzt also einige Tränke zur Heilung von Besessenheit auftreiben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_40"); //Das wird glaube ich nicht notwendig sein. Hier.
B_GiveInvItems (self, hero, ItMi_HolyWater, 3);
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_41"); //Und was soll ich jetzt damit?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_42"); //An einem Alchemietisch einen Feldknöterich zu den geweihten Wässerchen mischen und damit drei Tränke zur Heilung der Besessenheit erhalten ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_43"); //Woher ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_44"); //Ich war einst selbst Feuermagier - vergiss das nicht - und weiß somit Bescheid, woraus sich die überteuerten Tränke des Klosters zusammensetzen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_45"); //Ach so, stimmt, vergesse ich bisweilen, da ich dich bisher immer nur in der dunklen Robe zu Gesicht bekam ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_46"); //Und vergiss nicht, sowohl bei der Stadt als auch bei Orlan und Großbauernhof vorbeizuschauen ... und vergewissere dich jeweils, ob du auch Erfolg hattest.
Mod_HQ_Daemonisch = 1;
B_GivePlayerXP (800);
B_LogEntry (TOPIC_MOD_DAEMONISCH, "Aha, also übernehmen die Schattenwesen die Kontrolle über Menschen. Ich soll bei der Gaststätte in der Stadt, bei Orlan und dem Großbauernhof vorbeischauen, um geheiligte Tränke ins Essen und Trinken zu mischen. Das sollte die Parasiten aus ihren Wirten bannen ... wovon ich mich aber jedes Mal selbst überzeugen sollte.");
if (Npc_KnowsInfo(hero, Info_Mod_Babo_Daemonisch))
{
B_StartOtherRoutine (Mod_914_NOV_Babo_NW, "DAEMONISCH3");
};
}
else
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_47"); //Nun, das weiß ich selbst leider noch nicht so genau.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_48"); //Du musst unbedingt versuchen, noch mehr bei Gaststätten und Siedlungen in der Umgebung herauszufinden.
B_LogEntry (TOPIC_MOD_DAEMONISCH, "Ich muss versuchen, noch mehr bei Siedlungen und Gaststätten der Umgebung in Erfahrung zu bringen.");
};
}
else if (Npc_KnowsInfo(hero, Info_Mod_Tengron_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Brian_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Orlan_Daemonisch))
|| (Npc_KnowsInfo(hero, Info_Mod_Pepe_Daemonisch))
|| (Mod_HQ_PaladineDaemonisch == TRUE)
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_49"); //Was du mir berichtest, ist äußert beunruhigend. Versuch unbedingt mehr zu erfahren. Mir schwant Böses ...
}
else
{
if (news) {
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_50"); //Sehr mysteriös. Das könnten wichtige Anhaltspunkte sein. Versuch mehr herauszufinden.
} else {
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch_15_51"); //Noch nichts.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch_14_52"); //Dann mach dich wieder auf den Weg.
};
};
};
INSTANCE Info_Mod_Xardas_NW_Daemonisch2 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Daemonisch2_Condition;
information = Info_Mod_Xardas_NW_Daemonisch2_Info;
permanent = 0;
important = 0;
description = "Ich habe die Tränke an die Befallenen gebracht.";
};
FUNC INT Info_Mod_Xardas_NW_Daemonisch2_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_UrnolKap4))
&& (Mod_HQ_Daemonisch == 2)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Daemonisch2_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch2_15_00"); //Ich habe die Tränke an die Befallenen gebracht. Die Gefahr sollte somit erkannt und gebannt sein.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch2_14_01"); //Wirklich, gebannt? Sehr nachlässig, während doch noch die Horden dieser Seelenpeiniger durch die Nacht streifen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch2_15_02"); //Ich soll doch nicht etwa ...?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch2_14_03"); //Doch, du sollst ... und bei der Gelegenheit kannst du dich gleich noch nach Hinweisen umblicken.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch2_14_04"); //Urnol treibt sich noch immer hier irgendwo umher, vergiss das nicht ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch2_14_05"); //Und denk daran, die Schatten meiden das Licht. Nutze dieses Wissen, wenn du ihnen gegenübertrittst.
B_GivePlayerXP (400);
B_LogEntry (TOPIC_MOD_DAEMONISCH, "Xardas will, dass ich die Seelenpeiniger besiege und dabei gleich nach weiteren Hinweisen Ausschau halte. Schließlich treibt sich Urnol noch immer irgendwo hier herum. Er gab mir den Hinweis, dass die Seelenpeiniger das Licht meiden. Das wird helfen.");
Mod_HQ_Daemonisch = 3;
Wld_InsertNpc (Mod_13021_SP_Seelenpeiniger_NW, "TAVERNE");
Wld_InsertNpc (Mod_13022_SP_Seelenpeiniger_NW, "TAVERNE");
Wld_InsertNpc (Mod_13023_SP_Seelenpeiniger_NW, "TAVERNE");
Wld_InsertNpc (Mod_13024_SP_Seelenpeiniger_NW, "TAVERNE");
Wld_InsertNpc (Mod_13025_SP_Seelenpeiniger_NW, "TAVERNE");
Wld_InsertNpc (Mod_13026_SP_Seelenpeiniger_NW, "TAVERNE");
};
INSTANCE Info_Mod_Xardas_NW_Daemonisch3 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Daemonisch3_Condition;
information = Info_Mod_Xardas_NW_Daemonisch3_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Daemonisch3_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Urnol_Daemonisch))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Daemonisch3_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch3_14_00"); //Ich spüre Urnols Präsenz nicht mehr in der Umgebung. Folglich warst du erfolgreich?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Daemonisch3_15_01"); //Ja, seine Maskerade hat ein Ende. Er sprach davon, Xeres’ Armeen zu befehligen und dürfte sich zurück ins Minental begeben haben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch3_14_02"); //Ausgezeichnet. Sobald du alle Götterwaffen bei dir hast, sollte dem Ende von Xeres' Lakaien nichts mehr im Wege stehen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch3_14_03"); //Hmm, Urnol sprach also von der orkischen Armee.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch3_14_04"); //Wie ich gehört habe, machten sie das alte Lager nieder und richteten dort ihren neuen Stützpunkt ein. Vielleicht wirst du ihn dort vorfinden.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch3_14_05"); //Hier hast du eine Teleportspruchrolle in das Alte Lager und Spruchrollen, welche dafür sorgen werden, dass du unerkannt bleibst.
CreateInvItems (hero, ItSc_TeleportOldcamp, 1);
CreateInvItems (hero, ItSc_TrfSkeleton, 2);
B_ShowGivenThings ("3 Spruchrollen erhalten");
AI_Output(self, hero, "Info_Mod_Xardas_NW_Daemonisch3_14_06"); //Viel Erfolg.
B_GivePlayerXP (400);
B_SetTopicStatus (TOPIC_MOD_DAEMONISCH, LOG_SUCCESS);
B_StartOtherRoutine (Mod_981_RIT_Tengron_NW, "START");
Mod_SenyanTom_Kraut_Tag = Wld_GetDay();
Mod_SP_Killed_Day = Wld_GetDay();
};
INSTANCE Info_Mod_Xardas_NW_HolyHammer (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_HolyHammer_Condition;
information = Info_Mod_Xardas_NW_HolyHammer_Info;
permanent = 0;
important = 0;
description = "Hast du den Heiligen Hammer noch?";
};
FUNC INT Info_Mod_Xardas_NW_HolyHammer_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Andokai_Hammer))
&& (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_UrizielKaputt))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_HolyHammer_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_HolyHammer_15_00"); //Hast du den Heiligen Hammer noch?
AI_Output(self, hero, "Info_Mod_Xardas_NW_HolyHammer_14_01"); //Natürlich habe ich den Hammer noch. Du denkst doch nicht etwa, dass ich nicht weiß, was es mit ihm auf sich hat.
AI_Output(self, hero, "Info_Mod_Xardas_NW_HolyHammer_14_02"); //Schließlich war ich vor der Erschaffung der Barriere Oberhaupt der Feuermagier. Hier ist er.
B_GiveInvItems (self, hero, Holy_Hammer_MIS, 1);
B_LogEntry (TOPIC_MOD_URIZIEL, "Xardas hat mit den heiligen Hammer gegeben.");
};
INSTANCE Info_Mod_Xardas_NW_Goetterschwerter (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Goetterschwerter_Condition;
information = Info_Mod_Xardas_NW_Goetterschwerter_Info;
permanent = 0;
important = 0;
description = "Ich hab die drei Waffen.";
};
FUNC INT Info_Mod_Xardas_NW_Goetterschwerter_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_UrizielKaputt))
&& ((Npc_HasItems(hero, ItMw_Adanos_Stab_Magieteil) == 1)
|| (Npc_HasItems(hero, ItMw_Adanos_Stab_Kampfteil) == 1))
&& (Npc_HasItems(hero, Holy_Hammer_MIS) == 1)
&& ((Npc_HasItems(hero, ItMw_BeliarWeapon_1H_01) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_02) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_03) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_04) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_05) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_06) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_07) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_08) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_09) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_10) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_11) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_12) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_13) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_14) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_15) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_16) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_17) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_18) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_19) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_1H_20) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_01) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_02) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_03) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_04) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_05) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_06) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_07) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_08) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_09) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_10) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_11) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_12) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_13) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_14) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_15) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_16) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_17) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_18) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_19) == 1)
|| (Npc_HasItems(hero, ItMw_BeliarWeapon_2H_20) == 1))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Goetterschwerter_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_00"); //Ich hab die drei Waffen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_01"); //Ausgezeichnet! Mit der Macht der drei Götter sollten wir prinzipiell dazu in der Lage sein, Uriziel wiederherzustellen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_02"); //Gut. Wann werdet ihr das Ritual vollziehen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_03"); //Nun ... die Frage sollte viel eher lauten, "wo".
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_04"); //Wir haben intensiv nach einem geeigneten Ritualplatz gesucht ... sind jedoch nicht fündig geworden auf Khorinis.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_05"); //Was? Wie kann das sein? Jharkendar ist doch der Ursprung der alten Kultur.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_06"); //Ja, zweifelsohne gab es hier auch einst solche Ritualstätten ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_07"); //Während der Schreckensherrschaft von Xeres müssen diese jedoch zerstört worden sein ... oder von den Gezeiten abgetragen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_08"); //Und wie wollen wir dann Uriziel wiederherstellen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_09"); //Darauf wollte ich gerade zu sprechen kommen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_10"); //Quellen geben preis, dass viele Erbauer sich der Verfolgung durch Xeres entzogen, indem sie Portale zu anderen Regionen der Welt öffneten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_11"); //Unter ihnen waren auch einige Priester und Gelehrte, welche dem Morden entkommen waren.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_12"); //Ohne sie wären die Teleportationsvorgänge über große Distanz so vieler Menschen auch nicht möglich gewesen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_13"); //Wir konnten die Zielkoordinaten eines ihrer Portale entschlüsseln und glauben, dass es sich um eine Insel handeln muss, weitab vom Festland.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_14"); //Und ihr erhofft euch nun, dort die benötigte Ritualstätte zu finden?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_15"); //Ja, so unsere Erwartung.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_16"); //Wir haben nun unter großem Aufwand Foki aus magischem Erz so justiert, dass sie den Teleport nachvollziehen sollten.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_17"); //Dann muss man also nur noch die Teleportflamme durchschreiten und sich dort umsehen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_18"); //Genau. Vorerst kann jedoch nur eine Person hindurchgehen. Das magische Gefüge ist noch sehr instabil.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_19"); //Dieser Pionier müsste dann eine der Teleportplattformen aktivieren, die sich zweifelsohne auf der Insel befinden.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_20"); //Dann bestünde nämlich eine stabile magische Verbindung zwischen hier und dort.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_21"); //Ach so. Ich vermute mal, dass die Wahl auf mich gefallen ist?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_22"); //Genau. Wir wissen nämlich nicht genau, was uns dort erwartet.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_23"); //Die Insel ist aller Voraussicht nach seit langem wieder verlassen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_24"); //Es könnten dort viele Gefahren lauern, Kreaturen längst vergangener Zeit, magische Geschöpfe und Wächter.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_25"); //Auch heißt es, die Insel sei aus Feuer geboren, welches den Tiefen des Ozeans entsprang.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_26"); //Es könnte sich also als Umgebung herausstellen, der nicht jeder gewachsen ist.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_27"); //Da wir jedoch möglicherweise nur einen einzigen Versuch haben, fiel unsere Wahl auf den Mann, der sich schon oft durch seine Taten hervorgehoben hat, denjenigen, der dem Tode viele Male entrann und dem die Götter stets gewogen waren. Auf dich.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_28"); //Verstehe.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_29"); //Wir haben bereits einen magischen Fokus aus Erz durch die Teleportflamme geschickt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_30"); //Sobald du dort bist, musst du nur noch eine Teleportplattform finden und sie mit dem Fokus aktivieren ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Goetterschwerter_15_31"); //In Ordnung. Wann soll ich losgehen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_32"); //Die Teleportflamme steht für dich bereit und du kannst jederzeit durchgehen, wenn du dich so weit fühlst.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_33"); //Hier hast du den Schlüssel zur Tür, damit du den Teleporter erreichen kannst.
B_GiveInvItems (self, hero, ItKe_RitualsinselDoor, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Goetterschwerter_14_34"); //Der Segen der Götter möge dich begleiten.
B_LogEntry (TOPIC_MOD_URIZIEL, "Na schön, das Ritual soll auf einer fernen Insel erfolgen. Dazu muss ich jedoch durch die Teleportflamme im Klosterkeller und eine Teleportplattform auf der Insel aktivieren. Der magische Fokus dafür befindet sich bereits vor Ort.");
B_GivePlayerXP (1000);
B_Kapitelwechsel (5, NEWWORLD_ZEN);
if (Mod_Gilde == 2)
{
B_StartOtherRoutine (Mod_579_RIT_Girion_NW, "SLD");
AI_UnequipArmor (Mod_579_RIT_Girion_NW);
CreateInvItems (Mod_579_RIT_Girion_NW, ItAr_Sld_M, 1);
AI_EquipArmor (Mod_579_RIT_Girion_NW, ItAr_Sld_M);
Wld_InsertNpc (Demon, "FP_ROAM_NW_TROLLAREA_RIVERSIDECAVE_07_02");
Wld_InsertItem (Pala_Feuer_Amulett, "FP_ROAM_NW_TROLLAREA_RIVERSIDECAVE_07_03");
};
};
INSTANCE Info_Mod_Xardas_NW_Trimedron (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Trimedron_Condition;
information = Info_Mod_Xardas_NW_Trimedron_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Trimedron_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Trimedron_Formel))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Trimedron_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_00"); //Du bist zurück! Ich darf also annehmen, dass du erfolgreich warst?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trimedron_15_01"); //Ja, der Teleporter ist aktiviert. Und ich konnte Neues in Erfahrung bringen ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_02"); //Berichte ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trimedron_15_03"); //Auf der Insel befindet sich tatsächlich eine Zeremoniestätte.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trimedron_15_04"); //Diese wird von einem Geist der alten Kultur bewacht.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_05"); //Ein potentieller Zeuge vorangegangener Jahrhunderte? Vortrefflich! Erzähl weiter ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trimedron_15_06"); //Er berichtete mir, dass die Kultur auf der Insel durch eine Naturkatastrophe ausgelöscht wurde. Ihre Siedlung ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_07"); //(unterbricht) Das ist tragisch ... aber von größerer Wichtigkeit als diese Einzelheiten ist der Zugang zur Ritualstätte. Wie steht es darum?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trimedron_15_08"); //Er hat Bedingungen gestellt, ehe er uns Einlass gewährt.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trimedron_15_09"); //Ich soll ihm als Zeugnis der drohenden Gefahr die Seelensteine der Machtträger bringen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_10"); //Die fünf Machtträger?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_11"); //Nun, da wir uns ihrer früher oder später hätten entledigen müssen, wird es nur bedeuten, diese Aufgabe vorzuziehen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_12"); //Den Seelenstein des Schläfers werden wir jedoch schwerlich bergen können.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_13"); //Er wird der Zwischenwelt nicht mehr so schnell entrinnen können.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trimedron_15_14"); //Was ist mit den anderen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_15"); //Nun, ein weiterer Machtträger, war, wie schon erwähnt, schwächlicher Art.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_16"); //Dies geben die lückenhaften Quellen von Xeres' Gefolgsleuten aus der Zeit seiner Schreckensherrschaft preis.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_17"); //Jedoch können wir nichts Näheres zu diesem Geschöpf sagen ... weder, wo es sich zur Zeit befindet, noch, ob es überhaupt erwacht ist.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_18"); //Geh zu Pyrokar, er hat sich mehr mit den Machtträgern befasst.
B_LogEntry (TOPIC_MOD_URIZIEL, "Pyrokar kann mir hoffentlich mehr über die Aufenthaltsorte der Machtträger sagen.");
if (Mod_Gilde == 2)
{
B_StartOtherRoutine (Mod_579_RIT_Girion_NW, "SLD");
AI_UnequipArmor (Mod_579_RIT_Girion_NW);
CreateInvItems (Mod_579_RIT_Girion_NW, ItAr_Sld_M, 1);
AI_EquipArmor (Mod_579_RIT_Girion_NW, ItAr_Sld_M);
Wld_InsertNpc (Demon, "FP_ROAM_NW_TROLLAREA_RIVERSIDECAVE_07_02");
Wld_InsertItem (Pala_Feuer_Amulett, "FP_ROAM_NW_TROLLAREA_RIVERSIDECAVE_07_03");
};
if (hero.guild == GIL_VLK)
&& (!Npc_KnowsInfo(hero, Info_Mod_Aaron_Party))
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_19"); //Pyrokar will Khorinis übrigens erst verlassen, wenn er Patherion in Sicherheit weiß.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_20"); //Du solltest dich also noch darum kümmern, bevor wir Khorinis verlassen werden.
}
else
{
AUFSUCHENACHSEELENSTEINE = 1;
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trimedron_14_21"); //Wir werden uns dann schon auf den Weg zur Insel machen. Triff mich dort, wenn du den Aufenthaltsort der Ritualstätte gefunden hast.
};
};
INSTANCE Info_Mod_Xardas_NW_Irdorath (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Irdorath_Condition;
information = Info_Mod_Xardas_NW_Irdorath_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Irdorath_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Pyrokar_Machttraeger))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Irdorath_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_00"); //Für den Seelenstein auf der Insel wirst du ein Schiff und eine Mannschaft brauchen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Irdorath_15_01"); //Schiff und Mannschaft?! Wo soll ich das auf die Schnelle herbekommen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_02"); //Nun, im Hafen der Stadt Khorinis liegt ein Schiff vor Anker.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_03"); //Die Feuermagier des Klosters könnten versuchen positiv auf die Paladine einzuwirken, sodass sie es dir zur Verfügung stellen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_04"); //Und eine Mannschaft ... nun, der Besuch der Insel wird wohl kein leichtes Unterfangen werden.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_05"); //Neben Männern, die im Kampf mit dem Schwert geschult sind, solltest du unter allen Umständen auch Magier mit an Bord haben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_06"); //Deine Weggefährten aus der Strafkolonie sollten dir auf jeden Fall bei der Suche nach geeigneten Leuten helfen können.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Irdorath_15_07"); //Gut, dann kann ich also daran gehen, Leute anzuheuern.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_08"); //Ja, mach das ... von meiner Seite kann ich dich noch auf Myxir und Raven hinweisen, als mögliche Begleiter ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Irdorath_14_09"); //Nun gut. Beliar möge dich bei deiner Suche unterstützen.
Pal_213_Schiffswache.aivar[AIV_PASSGATE] = TRUE;
if (Mod_VelayaFrei == 1)
{
Mod_VelayaFrei = 2;
Wld_InsertNpc (Mod_7416_BAU_Velaya_NW, "BIGFARM");
};
B_RemoveNpc (Pal_212_Schiffswache);
B_RemoveNpc (Pal_213_Schiffswache);
Log_CreateTopic (TOPIC_MOD_HQ_CREW, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_HQ_CREW, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_HQ_CREW, "Ok, dann darf ich mir also eine Mannschaft zusammensuchen, mit welcher ich zur Insel aufbreche, um den Seelenstein zu bergen. Xardas riet mir, auch Magier mitzunehmen und bei der Suche nach fähigen Leuten meine Freunde Milten, Gorn, Diego und Lester zu konsultieren. Er selbst schlug mir noch Myxir und Raven als mögliche Kandidaten vor.");
};
INSTANCE Info_Mod_Xardas_NW_Kap6 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Kap6_Condition;
information = Info_Mod_Xardas_NW_Kap6_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Kap6_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Diego_Kap6))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Kap6_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Kap6_14_00"); //Freust du dich über meine kleine Überraschung?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Kap6_15_01"); //Es ist schon beruhigend, nicht allein zu sein.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Kap6_14_02"); //Ich habe da aber noch etwas für dich.
B_GiveInvItems (self, hero, ItRu_TeleportUW, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Kap6_14_03"); //Das ist das Produkt langer schweißtreibender Nächte. Ich habe einen Weg gefunden, wie ich euch direkt in Xeres' Welt bringen kann.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Kap6_14_04"); //Wenn meine Berechnungen stimmen, solltet ihr ganz in der Nähe von Xeres' Tempel materialisieren. Der Rest liegt dann an euch.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Kap6_15_05"); //Solange wir nicht direkt in seiner Arena auftauchen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Kap6_14_06"); //Das wird schon nicht.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Kap6_14_07"); //(holt tief Luft) Damit ist nun alles gesagt. Mögen die Götter mit euch sein.
B_LogEntry (TOPIC_MOD_XERES, "Diego, Lester, Milten und Gorn sind zu meiner Unterstützung herangeeilt. Xardas hat uns alle mit Teleportern in die Nähe von Xeres' Tempel ausgestattet. Nun kann es losgehen!");
};
INSTANCE Info_Mod_Xardas_NW_Argez (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Argez_Condition;
information = Info_Mod_Xardas_NW_Argez_Info;
permanent = 0;
important = 0;
description = "Ich habe Argez getroffen.";
};
FUNC INT Info_Mod_Xardas_NW_Argez_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Urnol1))
&& (Npc_KnowsInfo(hero, Info_Mod_Argez_NW_Hi))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Argez_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argez_15_00"); //Ich habe Argez getroffen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argez_14_01"); //Sehr gut! Behalte ihn, wenn möglich, im Auge.
B_GivePlayerXP (50);
};
INSTANCE Info_Mod_Xardas_NW_NachAufnahmeQuest (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_NachAufnahmeQuest_Condition;
information = Info_Mod_Xardas_NW_NachAufnahmeQuest_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_NachAufnahmeQuest_Condition()
{
if (hero.guild == GIL_KDF)
&& (Wld_GetDay() > BeliarAufnahme)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_NachAufnahmeQuest_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_14_00"); //Du kommst mir genau richtig. Ich habe etwas entdeckt, was mit diesem Buch, welches du Ryan abgenommen hast, zu tun hat.
AI_Output(hero, self, "Info_Mod_Xardas_NW_NachAufnahmeQuest_15_01"); //Um was geht es?
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_14_02"); //Auf dem Buch scheint ein Schutzzauber zu liegen, welcher verhindern soll, dass man es lesen kann. Dieser Zauber macht den Inhalt nur noch interessanter.
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_14_03"); //Deshalb brauche ich deine Hilfe.
AI_Output(hero, self, "Info_Mod_Xardas_NW_NachAufnahmeQuest_15_04"); //Was soll ich tun?
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_14_05"); //Das Buch kann nur durch einen passenden Bannbrecher geöffnet werden. Dazu fehlt mir aber hier das nötige Wissen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_14_06"); //Ironischerweise befindet sich die Lösung, wie der Schutzzauber zu brechen ist, in einem weiteren Buch, einem Almanach.
AI_StopProcessInfos (self);
Wld_InsertNpc (OrcScout, "FP_ROAM_FARM1_GOBBO_04");
Wld_InsertNpc (OrcScout, "FP_ROAM_FARM1_GOBBO_06");
Wld_InsertNpc (OrcWarrior_Almanach, "FP_ROAM_FARM1_GOBBO_02");
Log_CreateTopic (TOPIC_MOD_BEL_ALMANACH, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_BEL_ALMANACH, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_BEL_ALMANACH, "Das Buch, welches ich bei meiner Aufnahmeprüfung Ryan abgenommen habe, ist magisch versiegelt. Um es zu öffnen, braucht Xardas einen Almanach, in dem der passende Bannbrecher steht. Dieses Buch wurde jedoch von Orks bei einem Überfall gestohlen. Die Orks sollen sich im Wald bei Lobarts Hof aufhalten.");
Info_ClearChoices (Info_Mod_Xardas_NW_NachAufnahmeQuest);
Info_AddChoice (Info_Mod_Xardas_NW_NachAufnahmeQuest, "Wo finde ich den Schinken?", Info_Mod_Xardas_NW_NachAufnahmeQuest_B);
Info_AddChoice (Info_Mod_Xardas_NW_NachAufnahmeQuest, "Woher weißt du, was in dem Almanach steht?", Info_Mod_Xardas_NW_NachAufnahmeQuest_A);
};
FUNC VOID Info_Mod_Xardas_NW_NachAufnahmeQuest_B()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_15_00"); //Wo finde ich den Schinken?
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_14_01"); //Jetzt wird es spannend. Der fahrende Händler, der die Bücher verliehen hat, wurde - sicher rein zufällig - gestern ganz in der Nähe von Orks überfallen, und sein ganzer Bestand geraubt.
AI_Output(hero, self, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_15_02"); //Orks? Hier? Und Bücher gestohlen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_14_03"); //Merkwürdig, nicht wahr?
AI_Output(hero, self, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_15_04"); //Dann muss ich die Orks finden.
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_14_05"); //Du hast es verstanden. Die Bauern auf Lobarts Hof berichteten mir, dass die Orks im Wald vor den Stadtmauern verschwunden sind.
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_14_06"); //Und ich fürchte, sie haben dort Ärgeres vor, als einen Lesewettbewerb zu veranstalten. Vielleicht treffen sie sich dort mit einem Auftraggeber.
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_14_07"); //Du musst sie sofort verfolgen und ihnen das Buch abnehmen!
AI_Output(hero, self, "Info_Mod_Xardas_NW_NachAufnahmeQuest_B_15_08"); //Dann werde ich sofort aufbrechen.
Info_ClearChoices (Info_Mod_Xardas_NW_NachAufnahmeQuest);
AI_StopProcessInfos (self);
Wld_InsertNpc (OrcScout, "FP_ROAM_FARM1_GOBBO_04");
Wld_InsertNpc (OrcScout, "FP_ROAM_FARM1_GOBBO_06");
Wld_InsertNpc (OrcWarrior_Almanach, "FP_ROAM_FARM1_GOBBO_02");
Log_CreateTopic (TOPIC_MOD_BEL_ALMANACH, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_BEL_ALMANACH, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_BEL_ALMANACH, "Das Buch, welches ich bei meiner Aufnahmeprüfung Ryan abgenommen habe, ist magisch versiegelt. Um es zu öffnen, braucht Xardas einen Almanach, in dem der passende Bannbrecher steht. Dieses Buch wurde jedoch von Orks bei einem Überfall gestohlen. Die Orks sollen sich im Wald bei Lobarts Hof aufhalten.");
};
FUNC VOID Info_Mod_Xardas_NW_NachAufnahmeQuest_A()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_NachAufnahmeQuest_A_15_00"); //Woher weißt du, was in dem Almanach steht?
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_A_14_01"); //Weil ich ihn früher selbst besessen habe. Ich habe ihn dann irgendwann einmal, als ich ausgemistet habe, einer Wanderbibliothek vermacht.
AI_Output(self, hero, "Info_Mod_Xardas_NW_NachAufnahmeQuest_A_14_02"); //Wer konnte schon ahnen, dass ich ihn später mal brauchen würde?
};
INSTANCE Info_Mod_Xardas_NW_HabAlmanach (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_HabAlmanach_Condition;
information = Info_Mod_Xardas_NW_HabAlmanach_Info;
permanent = 0;
important = 0;
description = "Da bin ich wieder.";
};
FUNC INT Info_Mod_Xardas_NW_HabAlmanach_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_NachAufnahmeQuest))
&& (Npc_HasItems(hero, ItWr_XardasAlmanach) == 1)
&& (Npc_KnowsInfo(hero, Info_Mod_Drach_Besiegt))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_HabAlmanach_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAlmanach_15_00"); //Da bin ich wieder.
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAlmanach_14_01"); //Und hast du den Almanach?
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAlmanach_15_02"); //Ja, hier ist er.
B_GiveInvItems (hero, self, ItWr_XardasAlmanach, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAlmanach_14_03"); //Gut, dann werde ich gleich mit der Öffnung beginnen!
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAlmanach_15_04"); //Da ist noch etwas.
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAlmanach_14_05"); //Um was geht es?
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAlmanach_15_06"); //Als ich das Buch geborgen hatte und an deinem Turm angekommen bin, wurde ich von einem Schattenkrieger aufgehalten, der behauptet hat, dass er zu einer Gruppe von sechs Kriegern gehört.
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAlmanach_15_07"); //Danach wollte er die Bücher und hat mich angegriffen. Nachdem ich ihn besiegt hatte, verschwand er und erklärte, dass die Krieger nun kommen werden.
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAlmanach_14_08"); //Bei Beliar! Die alten Krieger sind zurück!
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAlmanach_15_09"); //Was meinst du damit?
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAlmanach_14_10"); //Die sechs Krieger sind die Leibgarde eines Abtrünnigen. Sie kommen nur zum Vorschein, wenn etwas Wichtiges zu erledigen ist. Anscheinend sind sie es, die hinter dem Buch her sind.
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAlmanach_14_11"); //Gib mir einen Tag Zeit und ich habe das Buch geöffnet und herausgefunden, weshalb es so wichtig für die Krieger ist.
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAlmanach_15_12"); //Gut, dann bis morgen.
B_LogEntry (TOPIC_MOD_BEL_ALMANACH, "Ich hab Xardas den Almanach gegeben und auch von Drach berichtet. Ich soll morgen wieder kommen.");
B_SetTopicStatus (TOPIC_MOD_BEL_ALMANACH, LOG_SUCCESS);
OpenRyanBook = Wld_GetDay();
B_GivePlayerXP (600);
B_Göttergefallen(3, 1);
};
INSTANCE Info_Mod_Xardas_NW_AlmanachOffen (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_AlmanachOffen_Condition;
information = Info_Mod_Xardas_NW_AlmanachOffen_Info;
permanent = 0;
important = 0;
description = "Bist du fertig?";
};
FUNC INT Info_Mod_Xardas_NW_AlmanachOffen_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_HabAlmanach))
&& (Wld_GetDay() > OpenRyanBook)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_AlmanachOffen_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlmanachOffen_15_00"); //Bist du fertig?
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_01"); //Gut, dass du kommst. Es ist schrecklich, was ich entdeckt habe!
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlmanachOffen_15_02"); //Was hast du herausgefunden?
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_03"); //In dem Buch steht eine genaue Beschreibung, wie man es schaffen kann, an die Axt des Untergangs zu kommen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlmanachOffen_15_04"); //Die was?
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_05"); //Die Axt des Untergangs! Diese Waffe ist ein uraltes Stück Macht Beliars. Sie wurde damals von einem mächtigen Schwarzmagier geschaffen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_06"); //Er erkannte aber den dämonischen Eigenwillen der Waffe und verbarg sie vor dem Rest der Welt mit einem Rätsel. Nur, wer dieses Rätsel lösen kann, ist bereit die Waffe zu tragen!
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_07"); //Deshalb sind die Krieger hinter ihr her.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlmanachOffen_15_08"); //Was für ein Rätsel ist das?
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_09"); //Der Schwarzmagier hat die Axt an einem sicheren Ort verwahrt und sechs Almanache hinterlassen, in denen steht, wo sich der nächste Almanach befindet. Allerdings in einem Rätsel, das nur durch logisches Denken gelöst werden kann.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_10"); //Im letzten Almanach steht, wo sich die Axt des Untergangs befindet. In dem Buch, das ich geöffnet habe, steht der Standort des ersten Almanachs.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_11"); //Dein Auftrag wird es sein das Rätsel zu lösen, die sechs Krieger zu töten, die ebenfalls hinter der Axt her sind, und die Axt schließlich zu sichern.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlmanachOffen_15_12"); //(zynisch) Das mach ich doch mit Links!
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_13"); //(ärgerlich) Ich weiß, die Aufgabe ist schwer, aber somit können wir ihnen eine mächtige Waffe entreißen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlmanachOffen_15_14"); //(seufzt) Dann werde ich schnell aufbrechen!
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlmanachOffen_14_15"); //Gut, und sei vorsichtig! Sie sind hinterhältig! Hier ist das Buch mit dem ersten Rätsel!
B_GiveInvItems (self, hero, ItWr_AxtAlmanach_Pre, 1);
GardeBeliars_1989_Drach.attribute[ATR_HITPOINTS] = GardeBeliars_1989_Drach.attribute[ATR_HITPOINTS_MAX];
Log_CreateTopic (TOPIC_MOD_BEL_RAETSEL, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_BEL_RAETSEL, LOG_RUNNING);
Log_CreateTopic (TOPIC_MOD_BEL_AXT, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_BEL_AXT, LOG_RUNNING);
B_LogEntry_NMore (TOPIC_MOD_BEL_RAETSEL, TOPIC_MOD_BEL_AXT, TOPIC_MOD_BEL_FIVEKNIGHTS, "Xardas hat den Almanach geöffnet. Darin ist ein Rätsel, welches mir den Weg zur Axt des Untergangs eröffnet. Ich sollte das Buch lesen und das Rätsel lösen.", "In dem Almanach stand etwas über die Axt des Untergangs. Diese Waffe scheint sehr mächtig zu sein. Xardas will, dass ich sie finde.", "Wie es scheint sind die sechs Krieger hinter der Axt des Untergangs her. Ich muss ihnen zuvorkommen.");
};
INSTANCE Info_Mod_Xardas_NW_HabAxt (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_HabAxt_Condition;
information = Info_Mod_Xardas_NW_HabAxt_Info;
permanent = 0;
important = 0;
description = "Ich bin wieder da!";
};
FUNC INT Info_Mod_Xardas_NW_HabAxt_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Frowin_HatAxt))
&& (Npc_HasItems(hero, ItMw_AxtDesUntergangs) == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_HabAxt_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAxt_15_00"); //Ich bin wieder da!
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAxt_14_01"); //Und was ist passiert?
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAxt_15_02"); //Ich habe alles gemacht, was du gesagt hast. Die dunkle Garde ist vernichtet, das Rätsel gelöst und die Axt gesichert.
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAxt_14_03"); //Zeig die Axt her!
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAxt_15_04"); //Hier.
B_GiveInvItems (hero, self, ItMw_AxtDesUntergangs, 1);
AI_UnequipWeapons (self);
EquipWeapon (self, ItMw_AxtDesUntergangs);
AI_ReadyMeleeWeapon (self);
AI_PlayAni (self, "T_1HSINSPECT");
AI_Output(self, hero, "Info_Mod_Xardas_NW_HabAxt_14_05"); //Was für eine Macht. Ich habe nachgedacht, als du weg warst, und habe entschieden, dass du die Axt behalten sollst.
AI_RemoveWeapon (self);
AI_UnequipWeapons (self);
B_GiveInvItems (self, hero, ItMw_AxtDesUntergangs, 1);
AI_EquipBestMeleeWeapon (self);
AI_Output(hero, self, "Info_Mod_Xardas_NW_HabAxt_15_06"); //Danke, ich werde gut auf sie achten.
B_LogEntry_More (TOPIC_MOD_BEL_AXT, TOPIC_MOD_BEL_FIVEKNIGHTS, "Ich hab die Axt des Untergangs geborgen und Xardas will, dass ich sie bewahre.", "Die sechs Krieger sind Geschichte. Wieder ein Problem weniger.");
B_SetTopicStatus (TOPIC_MOD_BEL_RAETSEL, LOG_SUCCESS);
B_SetTopicStatus (TOPIC_MOD_BEL_AXT, LOG_SUCCESS);
B_SetTopicStatus (TOPIC_MOD_BEL_FIVEKNIGHTS, LOG_SUCCESS);
B_GivePlayerXP (1000);
B_Göttergefallen(3, 1);
};
INSTANCE Info_Mod_Xardas_NW_Argibast (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Argibast_Condition;
information = Info_Mod_Xardas_NW_Argibast_Info;
permanent = 0;
important = 0;
description = "Ich bin zurück.";
};
FUNC INT Info_Mod_Xardas_NW_Argibast_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Raven_ArgibastDead))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Argibast_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_00"); //Ich bin zurück.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_01"); //Und?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_02"); //Die Belagerung ist beendet und einer der sechs Gardisten Innos' hat das Zeitliche gesegnet!
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_03"); //Sehr gut. Was hat der Gardist gesagt?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_04"); //Nicht viel. Er sprach wie immer über die unentwegte Macht seines Meisters und etwas von einer mächtigen Waffe, die die anderen Gardisten suchen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_05"); //(scharf) Was für eine Waffe soll das sein?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_06"); //Er nannte sie das Schwert Innos'.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_07"); //Bei Beliar. Schlimmer konnte es nicht kommen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_08"); //Was hat es damit auf sich?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_09"); //Vor 1000 Jahren, zu der Zeit, als die Garde Beliars und die Garde Innos' entstanden und dann verbannt wurden, entstanden auch zwei göttliche Waffen mit ihnen, die das Gleichgewicht der Welt bedrohten.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_10"); //Ich nehme an du sprichst von der Axt des Untergangs und dem Schwert Innos'?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_11"); //Ja, das tue ich. Adanos versiegelte die beiden Waffen, um die Welt vor dem Chaos zu bewahren. Die Axt hast du bereits geborgen, doch das Schwert Innos' ist wohl ebenfalls auf Khorinis und die Garde Innos' sucht danach.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_12"); //Was soll ich tun?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_13"); //Du must das Schwert Innos' erbeuten, um es vor den Händen des Bösen zu schützen. Desweiteren musst du die Garde Innos' aufhalten, um somit Khorinis vor einer weiteren Bedrohung zu bewahren.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Argibast_15_14"); //Wo soll ich anfangen zu suchen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Argibast_14_15"); //Das ist das Rätsel, welches du lösen musst. Wir wissen es nicht genau. Jedoch hat sich die Aktivität magischer Energie im Tal der Wassermagier drastisch verstärkt, was beunruhigend ist. Beginne dort mit deiner Suche.
B_GivePlayerXP (250);
Wld_SendTrigger ("EVT_PORTAL_EINGANG_TOR_01");
Log_CreateTopic (TOPIC_MOD_BEL_INNOSSCHWERT, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_BEL_INNOSSCHWERT, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_BEL_INNOSSCHWERT, "Es scheint so, als würde die Garde Innos' nach dem mächtigen Schwert Innos' suchen. Ich muss das Schwert vor ihnen finden. Wo es zu finden ist, weiß jedoch nicht mal Xardas, allerdings gibt es Andeutungen auf Jharkendar. Ich sollte einen Abstecher in die Ausgrabungsstätte machen. Dort muss die Garde vorbei, um nach Jharkendar zu gelangen.");
Wld_InsertNpc (Mod_4085_HoherUntoterMagier_NW, "TAVERNE");
Wld_InsertNpc (Mod_4084_UntoterEliteNovize_NW, "TAVERNE");
Wld_InsertNpc (Mod_4083_UntoterKrieger_NW, "TAVERNE");
Wld_InsertNpc (Mod_4088_HoherUntoterMagier_NW, "TAVERNE");
Wld_InsertNpc (Mod_4087_UntoterEliteNovize_NW, "TAVERNE");
Wld_InsertNpc (Mod_4086_UntoterKrieger_NW, "TAVERNE");
Wld_InsertNpc (Mod_4091_HoherUntoterMagier_NW, "TAVERNE");
Wld_InsertNpc (Mod_4090_UntoterEliteNovize_NW, "TAVERNE");
Wld_InsertNpc (Mod_4089_UntoterKrieger_NW, "TAVERNE");
B_StartOtherRoutine (Mod_512_RDW_Cavalorn_NW, "START");
B_StartOtherRoutine (Mod_771_KDW_Riordian_NW, "VORTEMPEL");
B_StartOtherRoutine (Mod_1538_WKR_Wasserkrieger_NW, "GEFANGEN");
B_StartOtherRoutine (Mod_1537_WKR_Vanas_NW, "GEFANGEN");
B_StartOtherRoutine (Mod_1536_WKR_Roka_NW, "GEFANGEN");
B_StartOtherRoutine (Mod_1532_HTR_Ethan_NW, "GEFANGEN");
B_KillNpc (Mod_1539_WKR_Wasserkrieger_NW);
};
INSTANCE Info_Mod_Xardas_NW_Uriela (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Uriela_Condition;
information = Info_Mod_Xardas_NW_Uriela_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Uriela_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Uriela_TeachingFinished))
&& (Npc_KnowsInfo(hero, Info_Mod_Uriela_TeachMage))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Uriela_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Uriela_14_00"); //Zwei in der Runenmagie begabte Hexen hatten das Gesuch gestellt, in die Reihen der Schwarzmagier einzutreten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Uriela_14_01"); //Ich habe sie gewähren lassen, da wir in der gegenwärtigen Situation auf Unterstützung jedweder Art angewiesen sind und das Wissen um die Hexenmagie uns im Kampf gegen Xeres sicher bereichern kann.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Uriela_14_02"); //Aber irgendwie habe ich den starken Verdacht, dass du deine Finger mit im Spiel hattest.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Uriela_15_03"); //Nun ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Uriela_14_04"); //(drohend) Ich warne dich. Die Kunst Runen zu wirken wird nicht leichtfertig an Dritte weitergegeben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Uriela_14_05"); //Im dem Umgang mit Magie sollte man etwas mehr Ernsthaftigkeit walten lassen.
};
INSTANCE Info_Mod_Xardas_NW_Randolph (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Randolph_Condition;
information = Info_Mod_Xardas_NW_Randolph_Info;
permanent = 0;
important = 0;
description = "Ich brauche deinen Rat.";
};
FUNC INT Info_Mod_Xardas_NW_Randolph_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_HalbinfernalischerRandolph_GoodOne))
&& (Mod_Randolph_Started == 11)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Randolph_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Randolph_15_00"); //Ich brauche deinen Rat. Der Bauer Randolph scheint nicht nur unter dämonischer Kontrolle zu stehen, nein, er scheint selbst zu einem zu werden.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Randolph_15_01"); //Horden von Dämonen hat er um sich geschart und bedroht die Stadt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Randolph_14_02"); //Nun, dann wirst du einen Weg finden müssen ihn zu vernichten, um dieser Bedrohung Herr zu werden.
Info_ClearChoices (Info_Mod_Xardas_NW_Randolph);
Info_AddChoice (Info_Mod_Xardas_NW_Randolph, "Aber kann man ihm denn nicht helfen?", Info_Mod_Xardas_NW_Randolph_B);
Info_AddChoice (Info_Mod_Xardas_NW_Randolph, "Ok, das werde ich tun.", Info_Mod_Xardas_NW_Randolph_A);
};
FUNC VOID Info_Mod_Xardas_NW_Randolph_B()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Randolph_B_15_00"); //Aber kann man ihm denn nicht helfen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Randolph_B_14_01"); //Nun, in dem Stadion der Verbundenheit mit dem Dämonischen kommt wohl jede Hilfe zu spät.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Randolph_B_14_02"); //Und selbst wenn noch ein Funken seines ursprünglichen Wesens in ihm existieren sollte, so würdest du ihn doch kaum dazu bewegen können Pyrokars Trank einzunehmen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Randolph_B_14_03"); //Folglich wirst du dieses Wesen - auch wenn noch ein Rest Menschlichkeit ihn ihm sein sollte - vernichten müssen, da du nicht über die Mittel verfügst, selektiv das Dämonische aus ihm zu bannen.
B_LogEntry (TOPIC_MOD_AKIL_RANDOLPH, "Xardas meint, ich solle Randolph, oder das, wozu er geworden ist, vernichten. Wenn es denn keine andere Möglichkeit gibt ...");
Info_ClearChoices (Info_Mod_Xardas_NW_Randolph);
};
FUNC VOID Info_Mod_Xardas_NW_Randolph_A()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Randolph_A_15_00"); //Ok, das werde ich tun.
B_LogEntry (TOPIC_MOD_AKIL_RANDOLPH, "Xardas meint, ich solle Randolph, oder das, wozu er geworden ist, vernichten. Wenn es denn keine andere Möglichkeit gibt ...");
Info_ClearChoices (Info_Mod_Xardas_NW_Randolph);
};
INSTANCE Info_Mod_Xardas_NW_RandolphGeheilt (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_RandolphGeheilt_Condition;
information = Info_Mod_Xardas_NW_RandolphGeheilt_Info;
permanent = 0;
important = 0;
description = "Ich konnte Randolph doch retten.";
};
FUNC INT Info_Mod_Xardas_NW_RandolphGeheilt_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Randolph))
&& (Mod_Randolph_Started == 16)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_RandolphGeheilt_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_RandolphGeheilt_15_00"); //Ich konnte Randolph doch retten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_RandolphGeheilt_14_01"); //Hmm, dann hast du dich also der Magie der Paladine bedient.
AI_Output(hero, self, "Info_Mod_Xardas_NW_RandolphGeheilt_15_02"); //Was?! Du wusstest von der Möglichkeit?! Aber warum ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_RandolphGeheilt_14_03"); //Du musst verstehen. Die Aussicht auf Erfolg war gering.
AI_Output(self, hero, "Info_Mod_Xardas_NW_RandolphGeheilt_14_04"); //Ich wollte dich davon abhalten weiter Zeit, Mühen und Risiken für ein Menschenleben aufzuwenden und damit ganz Khorinis in Gefahr zu bringen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_RandolphGeheilt_14_05"); //Wenn es denn fehlgeschlagen wäre ...
};
INSTANCE Info_Mod_Xardas_NW_Gidan1 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Gidan1_Condition;
information = Info_Mod_Xardas_NW_Gidan1_Info;
permanent = 0;
important = 0;
description = "Kannst du diese Pergamenthälften zusammensetzen?";
};
FUNC INT Info_Mod_Xardas_NW_Gidan1_Condition()
{
if (Npc_HasItems(hero, ItWr_SektisTeleport2) == 1)
&& (Npc_HasItems(hero, ItWr_SektisTeleport1) == 1)
&& (Npc_KnowsInfo(hero, Info_Mod_Andre_Erfahrung))
&& (Mod_PalaKapitel3)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Gidan1_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Gidan1_15_00"); //Kannst du diese Pergamenthälften zusammensetzen?
AI_PrintScreen ("Pergamenthälften gegeben!", -1, YPOS_GoldGiven, FONT_ScreenSmall, 2);
Npc_RemoveInvItems (hero, ItWr_SektisTeleport2, 1);
Npc_RemoveInvItems (hero, ItWr_SektisTeleport1, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gidan1_14_01"); //Das sollte kein Problem sein. Komm später wieder.
B_LogEntry (TOPIC_MOD_MILIZ_GIDAN, "Xardas wird die zwei Pergamenthälften zusammen setzen.");
};
INSTANCE Info_Mod_Xardas_NW_Gidan2 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Gidan2_Condition;
information = Info_Mod_Xardas_NW_Gidan2_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Gidan2_Condition()
{
if (Mod_PalaKapitel3 == 4)
&& (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Gidan1))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Gidan2_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gidan2_14_00"); //Hier hast du deine Spruchrolle.
B_GiveInvItems (self, hero, ItWr_SektisTeleport3, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gidan2_14_01"); //Es scheint allerdings so, als hätte sie eine lokale Abghängigkeit.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gidan2_14_02"); //Also muss sie an einem bestimmten Ort gesprochen werden, damit sie funktioniert.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Gidan2_15_03"); //Ich hab auch schon eine Vermutung, wo.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gidan2_14_04"); //Dann mach dich auf den Weg, ich hab zu tun.
Mod_PalaKapitel3 = 5;
B_LogEntry (TOPIC_MOD_MILIZ_GIDAN, "Es handelt sich um eine Spruchrolle, die aber nur an einem bestimmten Ort benutzt werden kann. Ich sollte es mal am Leuchtturm versuchen.");
};
INSTANCE Info_Mod_Xardas_NW_Namib (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Namib_Condition;
information = Info_Mod_Xardas_NW_Namib_Info;
permanent = 0;
important = 0;
description = "Ich habe hier einen Brief, den ich euch von Baal Namib überstellen soll.";
};
FUNC INT Info_Mod_Xardas_NW_Namib_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Namib_DuengerVerteilt))
&& (Npc_HasItems(hero, ItWr_NamibForBeliar) == 1)
&& (Npc_HasItems(hero, ItMi_HerbPaket) > 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Namib_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Namib_15_00"); //Ich habe hier einen Brief, den ich dir von Baal Namib überstellen soll.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Namib_14_01"); //Gib den Brief Karras in unserer Festung. Er ist für so was zuständig.
};
INSTANCE Info_Mod_Xardas_NW_Drachen (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Drachen_Condition;
information = Info_Mod_Xardas_NW_Drachen_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_Drachen_Condition()
{
if (Mod_NL_Siegelbuch == 5)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Drachen_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_00"); //Ahh, gut, dass ich dich noch rechtzeitig erreiche. Du solltest das Buch nämlich unter keinen Umständen öffnen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Drachen_15_01"); //Ähh, Xardas ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_02"); //Wie ich im Rahmen meiner Nachforschungen herausgefunden habe, besteht auch gar nicht die Notwendigkeit.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_03"); //Indem wir nämlich einen Spalt im Raum Zeitgefüge des Buches erzeugen ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Drachen_15_04"); //(energischer) Xardas, das Buch ist bereits geöffnet!
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_05"); //Ohh ... nun in dem Fall sollte das Chromaninbuch seine Botschaft wiedererlangt haben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_06"); //Und mit den anderen Folgen durch das Öffnen des Buches – nun – müssen wir uns wohl irgendwie arrangieren.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Drachen_15_07"); //Was zum Teufel ist da geschehen? Ich hatte den Eindruck, als würde mir der Himmel gleich auf den Kopf fallen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_08"); //Nun, das werde ich dir erklären.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_09"); //Wie ich inzwischen herausgefunden habe, war Pondaros ein mächtiger Magier, der vor Äonen gelebt hat, kurz nach dem Zeitpunkt, als die Gottheit Radanos auf der Erde zu wirken begann.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_10"); //Er erschuf dieses Buch, welches im Stande ist magische Energien zu absorbieren und verbannte darin zahlreiche Kreaturen, die magischen Ursprungs waren.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Drachen_15_11"); //Magische Kreaturen? Welcher Art?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_12"); //Nun, alles vom Bodensatz magischer Geschöpfe, über Kobolde und Magier bis hin zu mächtigen Wesen wie ... Drachen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Drachen_15_13"); //(ungläubig) Drachen?!
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_14"); //Ja, Drachen, Feuer speiende Wesen von uralter Macht, die jetzt mit ihrer Präsenz alle menschlichen Siedlungen und Städte auf Khorinis gefährden könnten ... und Xeres bei der Umsetzung seiner Ziele somit von nicht unerheblichem Nutzen sein würden.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Drachen_15_15"); //Xeres ... Und das Buch in den Händen seines Lakaien. Was hat das alles zu bedeuten?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Drachen_15_16"); //Hätte der Schamane nicht schon viel früher die Siegel brechen und diesen Ungeheuern ihre Freiheit schenken können?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_17"); //Das hätte er mit Bestimmtheit, wenn es in seiner Macht gelegen hätte.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_18"); //Aber zweifelsfrei hatte Pondaros die Steinkreise mit Schutzmechanismen versehen, die im Besondern Geschöpfen der Finsternis – wie diesem untoten Ork – das Vorhaben vereitelt hätten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_19"); //Diesem Schamanen, Herrscher über Geister, Elemente und belebte Natur und ein Scherge der Finsternis, wäre es nicht vergönnt gewesen, auch nur das Erste der drei Siegel zu brechen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_20"); //So, nun aber genug der Worte. Ganz gleich, was du aus dem Buch entfesselt haben magst, versuche deine Aufmerksamkeit weiterhin vor allem auf das eine Ziel zu richten: Xeres' Vernichtung.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_21"); //Hier etwas Gold für deine Ausrüstung.
B_GiveInvItems (self, hero, ItMi_Gold, 400);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_22"); //Nun solltest du aber machen, dass du hier wegkommst, bevor dir üble Geschöpfe begegnen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Drachen_14_23"); //Ich teleportiere dich sicher zu Orlans Taverne.
Log_CreateTopic (TOPIC_MOD_NL_DRACHEN, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_NL_DRACHEN, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_NL_DRACHEN, "Na toll. Wenn Xardas es sich angewöhnen würde nur eine Minute früher zu erscheinen ... Dass Drachen und andere Ungetüme dem Buch entkommen sind, scheint ihn ja nicht sonderlich zu berühren. Einfach weiter Xeres jagen, als ob nichts wäre. Na ja, zumindest bin ich Chromanin einen entscheidenden Schritt näher gekommen.");
B_LogEntry (TOPIC_MOD_NL_DRACHEN, "Dann werde ich mal Xardas Rat befolgen und mich aus der akuten Gefahrenzone herausteleportieren, bevor ich noch über einen dieser Drachen stolpere ... Orlans Taverne, da bin ich. Aber verdammt, was ist das? Ich ... mir ... schwinden die Sinne ...");
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "TOT");
Mdl_RemoveOverlayMDS (hero, "HUMANS_REGEN.MDS");
AI_StopProcessInfos (self);
};
INSTANCE Info_Mod_Xardas_NW_Lich (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Lich_Condition;
information = Info_Mod_Xardas_NW_Lich_Info;
permanent = 0;
important = 0;
description = "Ein untoter Magier treibt sein Unwesen auf Khorinis.";
};
FUNC INT Info_Mod_Xardas_NW_Lich_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Lich_Unbesiegbar))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Lich_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Lich_15_00"); //Ein untoter Magier treibt sein Unwesen auf Khorinis.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Lich_15_01"); //Im Kampf vermochte ich ihm nichts anzuhaben und hätte fast mein Leben dabei gelassen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Lich_15_02"); //Er sprach davon, man bräuchte viel und doch wenig, ihn zu vernichten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Lich_14_03"); //(ungeduldig) Nun, ich darf annehmen, dass du nicht von Xeres sprichst, sondern von einem der Geschöpf aus dem Buch.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Lich_14_04"); //Wenn du ihn nicht bezwingen kannst, dann gehe ihm aus dem Weg ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Lich_14_05"); //Da ich aber auch weiß, dass du dich nicht durch meine Worte von weiteren Narreteien abhalten lässt: Begib dich in unsere Festung.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Lich_14_06"); //Dort wirst du in der Bibliothek ein Buch finden, das dir die Antworten geben sollte, nach denen du suchst.
};
INSTANCE Info_Mod_Xardas_NW_Gormgniez (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Gormgniez_Condition;
information = Info_Mod_Xardas_NW_Gormgniez_Info;
permanent = 0;
important = 0;
description = "Es gibt da etwas, das mir keine Ruhe lässt ...";
};
FUNC INT Info_Mod_Xardas_NW_Gormgniez_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Gormgniez_Hi))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Gormgniez_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Gormgniez_15_00"); //Es gibt da etwas, das mir keine Ruhe lässt ... Was haben Drachen, Schlaf und Sprechen miteinander gemeinsam?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_01"); //Mit sonderbaren Fragen beschäftigst du dich, wo du doch eigentlich Xeres bezwingen solltest.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Gormgniez_15_02"); //Nun, ein kleiner Dämon hat mir so ein Geheimnis verraten ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_03"); //Geheimnis eines Dämonen, Drachen, sprechen und Schlaf?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_04"); //Hmm, ich beginne zu begreifen und werde auf deine Frage eingehen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_05"); //Wie jedes Lebewesen benötigen auch Drachen hin und wieder Schlaf.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_06"); //Jedoch ist ihr Schlaf immer dann besonders fest und beständig, wenn sie auf Raubzug waren, erschöpft durch die Anstrengungen, zufrieden über reiche Beute.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Gormgniez_15_07"); //Reiche Beute?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_08"); //Gold, Silber und Edelsteine. Güter, die beispielsweise Gläubige in Massen den Stellvertretern ihres Gottes Innos übereignen ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Gormgniez_15_09"); //... die sich in nicht unerheblicher Menge in ihrer Residenz angehäuft haben. Ich verstehe.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_10"); //(nachdenklicher) Hmm, und nicht unweit, westlich vom Kloster spüre ich auch eine starke magische Präsenz.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_11"); //Was wohl wäre, wenn jemand dem Informationsfluss unter den Dämonen etwas, nun ja, helfen würde ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Gormgniez_14_12"); //(wieder zum Helden) Ich hoffe, ich konnte alle Fragen damit zu deiner Zufriedenheit beantworten.
Log_CreateTopic (TOPIC_MOD_NL_DRAGON, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_NL_DRAGON, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_NL_DRAGON, "Von Xardas erfuhr ich, dass Drachen immer nach erfolgreichen Raubzügen besonders fest schlafen. Das Innoskloster mit seinen Schätzen wäre dabei prädestiniert für einen solchen Raubzug, hatte Xardas zu verstehen gegeben.");
B_LogEntry (TOPIC_MOD_NL_DRAGON, "Der im Schlaf sprechende Drache würde sich das bestimmt nicht entgehen lassen, wenn er davon wüsste ...");
};
INSTANCE Info_Mod_Xardas_NW_Moorhexe (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Moorhexe_Condition;
information = Info_Mod_Xardas_NW_Moorhexe_Info;
permanent = 0;
important = 0;
description = "Es hat geklappt, der Drache gab einiges preis.";
};
FUNC INT Info_Mod_Xardas_NW_Moorhexe_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Dragon_KlosterErfolg))
&& (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Lich))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Moorhexe_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Moorhexe_15_00"); //Es hat geklappt, der Drache gab einiges preis.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_01"); //(leicht höhnisch) Ja, ich hörte, was sich im Kloster ereignet hat.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Moorhexe_15_02"); //Nur war ich eben nicht in der Lage alles in Erfahrung zu bringen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Moorhexe_15_03"); //Er sprach von "dem Land des Korns der Mutter" und von einem Moor und seiner Bewohnerin.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_04"); //Hmm, Land des Korns der Mutter ... es dürfte sich um eine Umschreibung für ein Gebiet im Norden von Khorinis gehandelt haben: Relendel.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_05"); //Und ein Moor ... ja, tatsächlich, ich hörte mal von einem, auf dem ein Fluch lasten soll.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Moorhexe_15_06"); //Was für ein Fluch, und wo liegt dieses Moor genau?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_07"); //Beim besten Willen, über alles bin ich nun auch nicht in der Lage Auskunft zu erteilen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_08"); //Frag jemanden, der mit der Region im Norden bestens vertraut ist, zum Beispiel einen Waldläufer. Beim schwarzen Troll soll ja einer ansässig sein.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Moorhexe_15_09"); //Gut, dann sprach der Drache aber noch von einer Bewohnerin, welche sich dem Mächtigen verbergen soll.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_10"); //(uninteressiert) Sehr rätselhaft, aber die Bibliothek unserer Festung ist umfangreich. Dort kannst du Rat finden.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_11"); //Ich muss nun Andokai mit einigen Nachforschungen unterstützen, Wissen erschließen, das in den Büchern dieser Festung verborgen liegt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_12"); //Er erwarb einige Spruchrollen und Runen der Verwandlungsmagier.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe_14_13"); //Wir wollen versuchen zu ergründen, ob sich daraus Plagen-Zauber generieren lassen.
if (!Npc_KnowsInfo(hero, Info_Mod_Lich_Hi))
{
B_RemoveNpc (Mod_7290_PAL_Athos_NW);
B_RemoveNpc (Mod_7291_PAL_Aramis_NW);
B_RemoveNpc (Mod_7292_PAL_Porthos_NW);
Wld_InsertNpc (Lich_11008_NW, "NW_TROLLAREA_TROLLROCKCAVE_02");
if (!Npc_KnowsInfo(hero, Info_Mod_Porthos_Hi))
{
Wld_SendTrigger ("LICHDUNGEON");
};
};
B_SetTopicStatus (TOPIC_MOD_NL_DRAGON, LOG_SUCCESS);
Log_CreateTopic (TOPIC_MOD_NL_MOORHEXE, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_NL_MOORHEXE, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_NL_MOORHEXE, "Xardas sprach von dem Gebiet Relendel im Norden von Khorinis, wo ein Moor zu finden sei. Den Weg dorthin könnte mir vermutlich ein Waldläufer beim schwarzen Troll zeigen.");
B_LogEntry (TOPIC_MOD_NL_MOORHEXE, "Xardas versucht mit Andokai einige Zauber der Verwandlungsmagier zu Plagen-Zaubern umsetzen. Er verwies mich daher wegen meiner restlichen Fragen an die Bibliothek der Schwarzmagier.");
};
INSTANCE Info_Mod_Xardas_NW_Moorhexe2 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Moorhexe2_Condition;
information = Info_Mod_Xardas_NW_Moorhexe2_Info;
permanent = 0;
important = 0;
description = "Der Drache hat noch etwas erwähnt...";
};
FUNC INT Info_Mod_Xardas_NW_Moorhexe2_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Moorhexe))
&& (Mod_Moorhexe == 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Moorhexe2_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Moorhexe2_15_00"); //Der Drache hat noch etwas erwähnt...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe2_14_01"); //Ja?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Moorhexe2_15_02"); //Er sprach davon, dass sich das, was immer sich im Moor aufhält, vor den Mächtigen verbirgt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe2_14_03"); //Hm, das könnte dein Unterfangen erschweren.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe2_14_04"); //Vielleicht offenbart sich des Rätsels Lösung nur, wenn du eine schwache Gestalt annimmst.
if (Npc_KnowsInfo(hero, Info_Mod_Andokai_Moorhexe)) {
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe2_14_05"); //Wie ich hörte, warst du bereits bei Andokai.
if (Npc_KnowsInfo(hero, Info_Mod_Andokai_PyrmansStab)) {
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe2_14_06"); //Er wird dir sicherlich einen nützlichen Zauber gegeben haben.
B_LogEntry (TOPIC_MOD_NL_MOORHEXE, "Möglicherweise wird sich mir das Geheimnis des Moors nicht offenbaren, wenn ich dort in meiner Gestalt herumlaufe. Xardas empfahl mir eine schwache Gestalt. Ich sollte den Verwandlungszauber von Andokai verwenden.");
} else {
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe2_14_07"); //Er wird sicherlich etwas nützliches für dich haben, wenn du ihm gebracht hast, wonach er verlangt.
B_LogEntry (TOPIC_MOD_NL_MOORHEXE, "Möglicherweise wird sich mir das Geheimnis des Moors nicht offenbaren, wenn ich dort in meiner Gestalt herumlaufe. Xardas empfahl mir eine schwache Gestalt. Andokai wird etwas für mich haben, wenn ich seinen Auftrag erfüllt habe.");
};
} else {
AI_Output(self, hero, "Info_Mod_Xardas_NW_Moorhexe2_14_08"); //Andokai wird dir dabei behilflich sein können.
B_LogEntry (TOPIC_MOD_NL_MOORHEXE, "Möglicherweise wird sich mir das Geheimnis des Moors nicht offenbaren, wenn ich dort in meiner Gestalt herumlaufe. Xardas empfahl mir eine schwache Gestalt. Andokai sollte mir weiterhelfen können.");
};
};
INSTANCE Info_Mod_Xardas_NW_WasMussIchTun (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WasMussIchTun_Condition;
information = Info_Mod_Xardas_NW_WasMussIchTun_Info;
permanent = 0;
important = 0;
description = "Der Weg Beliars? Wie kann ich den einschlagen?";
};
FUNC INT Info_Mod_Xardas_NW_WasMussIchTun_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasFuerGilden))
&& (Mod_Gilde == 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WasMussIchTun_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WasMussIchTun_15_00"); //Der Weg Beliars? Wie kann ich den einschlagen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasMussIchTun_14_01"); //Ich fürchte, dazu muss ich zuerst ein Geheimnis lüften.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasMussIchTun_14_02"); //Du erinnerst dich sicher an die drei Lager im Minental, also das Alte Lager, das Neue Lager und das Sumpflager.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasMussIchTun_14_03"); //Tatsache ist, dass es ein viertes Lager gab.
AI_Output(hero, self, "Info_Mod_Xardas_NW_WasMussIchTun_15_04"); //(skeptisch) Und wo soll das gelegen haben?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasMussIchTun_14_05"); //Hoch oben in den Bergen, in der Nähe des Neuen Lagers.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasMussIchTun_14_06"); //In der Zeit des ersten Orkkrieges wurde in dieser unwirtlichen Gegend eine Festung errichtet.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasMussIchTun_14_07"); //Nach der Erschaffung der Barriere siedelten dort die Menschen an, die gute Gründe dafür hatten, nicht mit den anderen Lagern in Kontakt zu kommen - Anhänger Beliars.
};
INSTANCE Info_Mod_Xardas_NW_WasDuMitGruppe (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WasDuMitGruppe_Condition;
information = Info_Mod_Xardas_NW_WasDuMitGruppe_Info;
permanent = 0;
important = 0;
description = "Was hast du mit der Gruppe zu tun?";
};
FUNC INT Info_Mod_Xardas_NW_WasDuMitGruppe_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasMussIchTun))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WasDuMitGruppe_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WasDuMitGruppe_15_00"); //Was hast du mit der Gruppe zu tun?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasDuMitGruppe_14_01"); //Sie existierte schon, bevor ich mich von den Feuermagiern abwandte, aber ich kann nicht leugnen, dass ich dort großen Einfluss gewonnen habe.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasDuMitGruppe_14_02"); //Du kannst dir meine Überraschung vorstellen, als ich zufällig auf diese Gruppierung stieß.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasDuMitGruppe_14_03"); //Nach dem Fall der Barriere hat sie größere Bekanntheit erlangt, und einige namhafte Magier und Krieger der Kolonie sind zu ihr gestoßen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WasDuMitGruppe_14_04"); //Den einen oder anderen dürftest auch du noch gut im Gedächtnis haben, auch wenn es andersrum nicht der Fall sein wird.
};
INSTANCE Info_Mod_Xardas_NW_WarumNovize (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WarumNovize_Condition;
information = Info_Mod_Xardas_NW_WarumNovize_Info;
permanent = 0;
important = 0;
description = "Angenommen, ich wollte diesem Verein beitreten ...";
};
FUNC INT Info_Mod_Xardas_NW_WarumNovize_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasDuMitGruppe))
&& (Mod_Gilde == 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WarumNovize_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WarumNovize_15_00"); //Angenommen, ich wollte diesem Verein beitreten ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_WarumNovize_14_01"); //Wende dich an Andokai. Er ist der oberste Schwarzmagier der Festung und zuständig für die Rekrutierung.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WarumNovize_14_02"); //Wenn du ihm sagst, dass ich dir vertraue, wird er dich gut behandeln.
B_LogEntry (TOPIC_MOD_DAEMONENBESCHWOERER, "Wenn ich mich den Beliaranhängern anschließen will, soll ich mich an Andokai wenden, den obersten Schwarzmagier der alten Festung.");
};
INSTANCE Info_Mod_Xardas_NW_WelcherVorteil (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WelcherVorteil_Condition;
information = Info_Mod_Xardas_NW_WelcherVorteil_Info;
permanent = 0;
important = 0;
description = "Was hätte ich davon, ein Beliaranhänger zu sein?";
};
FUNC INT Info_Mod_Xardas_NW_WelcherVorteil_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasDuMitGruppe))
&& (Mod_Gilde == 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WelcherVorteil_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WelcherVorteil_15_00"); //Was hätte ich davon, ein Beliaranhänger zu sein?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WelcherVorteil_14_01"); //(belehrend) Du wendest deine Gebete nicht an Beliar, weil du dir davon etwas versprichst, sondern weil du von seiner Lehre überzeugt bist.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WelcherVorteil_14_02"); //Abgesehen davon... Auch unsere Krieger sind in der Magieanwendung geschult.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WelcherVorteil_14_03"); //Die Grundausbildung besteht aus den ersten beiden Kreisen der Magie.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WelcherVorteil_14_04"); //Erst danach musst du dich für eine Spezialisierung entscheiden. Die mächtigen Kampfzauber kannst du aber nur als Magier erlernen.
B_LogEntry (TOPIC_MOD_DAEMONENBESCHWOERER, "Bei den Beliaranhängern erlernt jeder Novize die zwei ersten Magiekreise, bevor er sich zu einem Krieger oder Magier spezialisiert.");
};
INSTANCE Info_Mod_Xardas_NW_WoSindAndere (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WoSindAndere_Condition;
information = Info_Mod_Xardas_NW_WoSindAndere_Info;
permanent = 0;
important = 0;
description = "Wie komme ich zu dieser Bergfestung?";
};
FUNC INT Info_Mod_Xardas_NW_WoSindAndere_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasMussIchTun))
&& (Mod_Gilde == 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WoSindAndere_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WoSindAndere_15_00"); //Wie komme ich zu dieser Bergfestung?
if (Npc_GetDistToWP(self, "NW_XARDAS_TOWER_IN1_22") < 500 || Npc_GetDistToWP(self, "WP_XARDAS_PREACH_02") < 500) {
AI_Output(self, hero, "Info_Mod_Xardas_NW_WoSindAndere_14_01"); //Die Frage lässt sich ganz einfach beantworten. Schau mal hier oben. Dort steht mein eigener Schrein.
} else {
AI_Output(self, hero, "Info_Mod_Xardas_NW_WoSindAndere_14_02"); //Die Frage lässt sich ganz einfach beantworten. Schau mal ein Stockwerk höher. Dort steht mein eigener Schrein.
};
AI_Output(hero, self, "Info_Mod_Xardas_NW_WoSindAndere_15_03"); //Und weiter? Ich wollte nicht beten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WoSindAndere_14_04"); //(spöttisch) Dir sei deine freche Unwissenheit noch einmal verziehen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WoSindAndere_14_05"); //Wir benutzen die Beliarschreine als Teleporter. Du musst jeden Schrein aktivieren, um damit reisen zu können, aber dann kannst du zwischen ihnen wechseln, wie du willst.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WoSindAndere_14_06"); //Mein Schrein ist bisher nur mit dem der Festung verbunden. Du kannst sie also gar nicht verfehlen.
B_LogEntry (TOPIC_MOD_DAEMONENBESCHWOERER, "Die Festung der Beliaranhänger erreiche ich über den Beliarschrein in Xardas' Turm, der gleichzeitig als Teleporter funktioniert.");
Mod_BeliarStatue_Krieger_Dabei = 1;
};
INSTANCE Info_Mod_Xardas_NW_VonWemKannIchLernen (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_VonWemKannIchLernen_Condition;
information = Info_Mod_Xardas_NW_VonWemKannIchLernen_Info;
permanent = 0;
important = 0;
description = "Bei wem kann ich was lernen?";
};
FUNC INT Info_Mod_Xardas_NW_VonWemKannIchLernen_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasMussIchTun))
&& (Mod_Schwierigkeit != 4)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_VonWemKannIchLernen_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_VonWemKannIchLernen_15_00"); //Bei wem kann ich was lernen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_VonWemKannIchLernen_14_01"); //Ich kann dir etwas über die Magie beibringen.
Log_CreateTopic (TOPIC_MOD_LEHRER_BELIARFESTUNG, LOG_NOTE);
B_LogEntry (TOPIC_MOD_LEHRER_BELIARFESTUNG, "Xardas kann mir helfen mein Mana zu steigern.");
};
INSTANCE Info_Mod_Xardas_NW_GomezHier (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_GomezHier_Condition;
information = Info_Mod_Xardas_NW_GomezHier_Info;
permanent = 0;
important = 0;
description = "Warum lebt Gomez noch?";
};
FUNC INT Info_Mod_Xardas_NW_GomezHier_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Gomez_Hi))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_GomezHier_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_GomezHier_15_00"); //Warum lebt Gomez noch?
AI_Output(self, hero, "Info_Mod_Xardas_NW_GomezHier_14_01"); //Er ist einer unserer Krieger.
AI_Output(hero, self, "Info_Mod_Xardas_NW_GomezHier_15_02"); //Aber ich habe ihn und die anderen im Alten Lager damals umgebracht.
AI_Output(self, hero, "Info_Mod_Xardas_NW_GomezHier_14_03"); //Auf eine gewisse Weise schon. Aber vom endgültigen Tod war er noch weit entfernt.
AI_Output(hero, self, "Info_Mod_Xardas_NW_GomezHier_15_04"); //Und warum erinnert er sich nicht an mich?
AI_Output(self, hero, "Info_Mod_Xardas_NW_GomezHier_14_05"); //Ich habe über ihn und seine Handlanger einen starken Vergessenszauber gelegt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_GomezHier_14_06"); //Sie haben alles vergessen, was im Minental passiert ist.
};
INSTANCE Info_Mod_Xardas_NW_WannNovize (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_WannNovize_Condition;
information = Info_Mod_Xardas_NW_WannNovize_Info;
permanent = 0;
important = 0;
description = "Andokai ist von mir überzeugt und würde mich aufnehmen.";
};
FUNC INT Info_Mod_Xardas_NW_wannNovize_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Andokai_WarInBib))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_WannNovize_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_WannNovize_15_00"); //Andokai ist von mir überzeugt und würde mich aufnehmen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_WannNovize_15_01"); //Er meint aber, er brauche noch deine Zustimmung.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WannNovize_14_02"); //Du weißt, dass ich viel von dir halte, und dass ich dich nicht erst auf die Probe stellen muss, um das herauszufinden.
AI_Output(hero, self, "Info_Mod_Xardas_NW_WannNovize_15_03"); //Danke. Aber?
AI_Output(self, hero, "Info_Mod_Xardas_NW_WannNovize_14_04"); //Es wäre anderen Bewerbern gegenüber unfair, dich bevorzugt zu behandeln. Deshalb werde ich dir noch eine Prüfung auftragen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_WannNovize_14_05"); //Daran, dass sie anspruchsvoll ist, siehst du, dass ich dir vertraue.
};
INSTANCE Info_Mod_Xardas_NW_LetzterTest (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_LetzterTest_Condition;
information = Info_Mod_Xardas_NW_LetzterTest_Info;
permanent = 0;
important = 0;
description = "Schön, was soll das für eine Prüfung sein?";
};
FUNC INT Info_Mod_Xardas_NW_LetzterTest_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WannNovize))
&& (Mod_Gilde == 0)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_LetzterTest_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_LetzterTest_15_00"); //Schön, was soll das für eine Prüfung sein?
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_01"); //Es geht um eine Splittergruppe von Gläubigen, die sich unter der Führung eines gewissen Ryan zusammengefunden hat.
AI_Output(hero, self, "Info_Mod_Xardas_NW_LetzterTest_15_02"); //Wo denn?
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_03"); //Im Allerheiligsten der Feuermagier, der Höhle der Feuerprüfung, ganz im Norden von Khorinis gelegen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_04"); //Eigentlich sollte uns das nicht stören, sondern viel eher belustigen - würden Ryan und seine Gruppe nicht einen verderblichen Einfluss ausüben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_05"); //Mit seinen sadistischen Ritualen, die er im Namen Beliars ausführt, lästert er unserem Gott.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_06"); //Wie ich hören musste, sind sogar zwei unserer Novizen zu ihm übergelaufen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_07"); //Es wird also Zeit, Ryan Einhalt zu gebieten. Allerdings hat Ryan auch gemerkt, dass er zu weit gegangen ist, und schützt sich mit starken Zaubern.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_08"); //Wie mir unser Spion mitteilte, gibt es nur eine Waffe, die imstande ist, ihm signifikant Schaden zuzufügen - und die besitzt ausgerechnet der Priester der Sekte.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_09"); //Es handelt sich um den Drei-Götter-Stab.
AI_Output(hero, self, "Info_Mod_Xardas_NW_LetzterTest_15_10"); //Oho.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_11"); //Eine schreckliche Götterlästerung, nicht wahr? Mit diesem Stecken verhauen sich die notgeilen Spinner ihre Ärsche und rufen dabei Beliar an!
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_14_12"); //Du musst dir also diesen Stab besorgen und Ryan damit beseitigen.
B_LogEntry (TOPIC_MOD_DAEMONENBESCHWOERER, "Xardas hat mir einem abtrünnigen Magier namens Ryan erzählt, der in der Höhle der Feuerprüfung der Feuermagier dunkle Rituale abhält. Ich soll ihn aufhalten. Um ihn zu töten, benötige ich jedoch den sogenannten Drei-Götter-Stab. Diesen trägt laut Xardas der Priester der Gruppe bei sich.");
Info_ClearChoices (Info_Mod_Xardas_NW_LetzterTest);
Info_AddChoice (Info_Mod_Xardas_NW_LetzterTest, "Ich werde sehen, was ich tun kann.", Info_Mod_Xardas_NW_LetzterTest_B);
Info_AddChoice (Info_Mod_Xardas_NW_LetzterTest, "Kann ich Ryan nicht anders überzeugen als mit dem Schwert?", Info_Mod_Xardas_NW_LetzterTest_A);
};
FUNC VOID Info_Mod_Xardas_NW_LetzterTest_B()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_LetzterTest_B_15_00"); //Ich werde sehen, was ich tun kann.
Wld_InsertNpc (Mod_1942_Ryan_NW, "TAVERNE");
Wld_InsertNpc (Mod_1943_Waechter_01_NW, "TAVERNE");
Wld_InsertNpc (Mod_1944_Waechter_02_NW, "TAVERNE");
Wld_InsertNpc (Mod_1945_Waechter_03_NW, "TAVERNE");
Wld_InsertNpc (Mod_1946_Waechter_04_NW, "TAVERNE");
Wld_InsertNpc (Mod_1947_Waechter_05_NW, "TAVERNE");
Wld_InsertNpc (Mod_1948_Waechter_06_NW, "TAVERNE");
Wld_InsertNpc (Mod_1949_Waechter_07_NW, "TAVERNE");
Wld_InsertNpc (Mod_1952_Waechter_08_NW, "TAVERNE");
Wld_InsertNpc (Mod_1951_Priester_NW, "TAVERNE");
Info_ClearChoices (Info_Mod_Xardas_NW_LetzterTest);
};
FUNC VOID Info_Mod_Xardas_NW_LetzterTest_A()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_LetzterTest_A_15_00"); //Kann ich Ryan nicht anders überzeugen als mit dem Schwert?
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_A_14_01"); //Nein. Ryan hat sein Ende selbst gewählt. Er hat gewusst, worauf er sich einlässt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_A_14_02"); //Du musst als Anhänger Beliars lernen, dass der Tod nur ein Bestandteil der Natur ist.
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_A_14_03"); //Dies ist nicht die schrecklichste Bestrafung, die wir uns für Ryan einfallen lassen könnten.
};
INSTANCE Info_Mod_Xardas_NW_LetzterTest_Success (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_LetzterTest_Success_Condition;
information = Info_Mod_Xardas_NW_LetzterTest_Success_Info;
permanent = 0;
important = 0;
description = "Ryan ist tot und seine Sekte zerschlagen.";
};
FUNC INT Info_Mod_Xardas_NW_LetzterTest_Success_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_LetzterTest))
&& (Npc_IsDead(Mod_1942_Ryan_NW))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_LetzterTest_Success_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_LetzterTest_Success_15_00"); //Ryan ist tot und seine Sekte zerschlagen.
if (Npc_HasItems(hero, Ryans_Almanach) == 1)
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_LetzterTest_Success_15_01"); //Das habe ich dort gefunden. Es enthält sicher einige lasterhafte Praktiken.
B_GiveInvItems (hero, self, Ryans_Almanach, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_Success_14_02"); //Ein wertvolles Überbleibsel eines falschen Glaubens. Du tatest richtig daran, es mitzubringen.
B_GivePlayerXP (400);
}
else
{
B_GivePlayerXP (300);
};
AI_Output(self, hero, "Info_Mod_Xardas_NW_LetzterTest_Success_14_03"); //Wie ich erwartet habe, hast du diese Prüfung mit Bravour bestanden. Deiner Aufnahme als Schwarzer Novize steht damit nichts mehr im Weg.
B_LogEntry_More (TOPIC_MOD_GILDENAUFNAHME, TOPIC_MOD_DAEMONENBESCHWOERER, "Ich kann jetzt Schwarzer Novize werden.", "Ich kann jetzt Schwarzer Novize werden.");
B_GiveInvItems (self, hero, ItMi_Gold, 200);
B_Göttergefallen(3, 1);
};
INSTANCE Info_Mod_Xardas_NW_Rasend (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Rasend_Condition;
information = Info_Mod_Xardas_NW_Rasend_Info;
permanent = 0;
important = 0;
description = "Ein gigantischer Dämon hat auf Khorinis gewütet.";
};
FUNC INT Info_Mod_Xardas_NW_Rasend_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Saturas_NW_Rasend))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Rasend_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_00"); //Ein gigantischer Dämon hat auf Khorinis gewütet und verheerende Blutbäder unter den Paladinen in der Stadt, dem Kloster und der Ausgrabungsstätte der Wassermagier angerichtet.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_01"); //Was hat das zu bedeuten? Warum gezielt die Diener Innos' und Adanos'?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_02"); //Mir ist nicht zu Ohren gekommen, dass er auch die Magier und Krieger Beliars heimgesucht hätte ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_03"); //Was, ein mächtiges dämonisches Wesen, sagst du? Dann hat mich also meine Wahrnehmung nicht getäuscht ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_04"); //Wovon sprichst du?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_05"); //Ich spürte die Präsenz eben dieses gewaltigen Dämons in der Umgebung und kann sie immer noch wahrnehmen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_06"); //Wenn ich mich nicht täusche, ist es ein mächtiger Diener Beliars, genannt Shivar.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_07"); //Und du berichtest, er hätte persönlich das alles zu verantworten?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_08"); //Keine Dienerkreaturen oder dergleichen, die ihn unterstützt hätten?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_09"); //Ja, so wie ich es berichte.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_10"); //Das ist mehr als ungewöhnlich.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_11"); //Er ist ein Fürst unter den Dämonen und verfügt über einen riesigen Stab an niederen Dienerkreaturen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_12"); //Dass er selbst in Erscheinung tritt und solches Übel verbreitet, wirft viele Fragen auf ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_13"); //Lass mich nachdenken. (überlegt) Ich hörte von seltsamen Vorkommnissen auf dem Weidenplateau und der Umgebung.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_14"); //Böden wurden gesegnet und verflucht und dann traten Ungetüme in Erscheinung ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_15"); //Du kannst mir doch bestimmt mehr darüber berichten.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_16"); //Ja, ich hatte tatsächlich einen unmittelbaren Einfluss auf diese Geschehnisse.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_17"); //Im Auftrag der Wassermagier reinigte ich die Böden von den Einflüssen der beiden Gottheiten wieder.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_18"); //Und dann bemächtigte sich eine finstere Macht der freigesetzten Kräfte und rief damit die Kreaturen auf dem Weidenplateau herbei.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_19"); //Die Magie der beiden Gottheiten absorbiert und damit die Geschöpfe beschworen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_20"); //Das ist höchst interessant und könnte wichtige Rückschlüsse auf die jetzigen Ereignisse geben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_21"); //Ich hatte nämlich davon gelesen, dass die Diener des Xeres die Macht dazu besessen hätten, Kontrolle über Magie anderer Gottheiten und damit auch über ihre magischen Geschöpfe an sich zu reißen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_22"); //(erschüttert) Willst du damit sagen, dass dieser grauenvolle Dämon jetzt unter dem Einfluss von Xeres steht?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_23"); //Dann wäre es in der tat schlecht um uns alle bestellt ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_24"); //Ich weiß es nicht. Hat Xeres' Einfluss so zugenommen, dass er sogar Kontrolle über die ergebensten Geschöpfe Beliars erlangen kann?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_25"); //Ich wage es mir kaum vorzustellen. Es würde auch immer noch einige Widersprüche und Fragen aufwerfen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_26"); //Warum kam er ohne Dienerkreaturen und weshalb ließ er bislang die Anhänger Beliars gänzlich verschont ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_27"); //Die Hauptsache ist, dass ich eine Möglichkeit finden kann, seinem Treiben ein Ende zu setzen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_28"); //Wenn es nicht anders geht, werde ich wohl mit Schwert und Magie gegen ihn vorrücken müssen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_29"); //Shivar im Kampf bezwingen? Dies zu versuchen wäre glatter Wahnsinn.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_30"); //Er ist weit mächtiger, als jeder Gegner, dem du bislang im direkten Kampf gegenüberstandest.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_31"); //Du würdest vermutlich nicht mal nahe genug an ihn herankommen können, um eine einzige Attacke gegen ihn führen zu können ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_32"); //Aber irgendetwas muss ich doch tun können. Nur tatenlos zusehen, wie er auf Khorinis mordet?!
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend_15_33"); //Gibt es wirklich nichts, was mir bei dem Aufeinandertreffen mit ihm helfen könnte?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_34"); //Nun, er ist ein Dämon voll Hybris und toleriert nur seinesgleichen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_35"); //Selbst ich als hoher Würdenträger der Dämonenmagier könnte mir nicht sicher sein, ob er sich nicht auch gegen mich wendet ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_36"); //Du müsstest folglich einen Teil dämonischer Macht in dich selbst aufnehmen. Die Diener des Xeres sollen dazu in der Lage gewesen sein.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_37"); //Schaue dich also in der Nähe des Weidenplateaus um, ob du nicht irgendwelche wichtigen Anhaltspunkte dazu findest.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend_14_38"); //Wenn du etwas gefunden hast, komm wieder zu mir.
B_LogEntry (TOPIC_MOD_ADANOS_RASEND, "Xardas forderte mich dazu auf, in der Nähe des Weidenplateaus nach einem Mittel zu suchen, dass dämonische Kräfte in mir wecken könnte. Die Schöpfer der Ungetüme auf dem Plateau könnten so etwas besitzen.");
Wld_InsertNpc (Mod_7497_BlutkultMagier_NW, "TAVERNE");
B_KillNpc (Mod_7497_BlutkultMagier_NW);
Mod_WM_BlutkultAttack = 1;
};
INSTANCE Info_Mod_Xardas_NW_Rasend02 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Rasend02_Condition;
information = Info_Mod_Xardas_NW_Rasend02_Info;
permanent = 0;
important = 0;
description = "Ich war bereits im 'Genuss' eines solchen Mittels.";
};
FUNC INT Info_Mod_Xardas_NW_Rasend02_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Rasend))
&& (Mod_WM_HeroHatDaemonInSich == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Rasend02_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend02_15_00"); //Ich war bereits im 'Genuss' eines solchen Mittels, mit welchem ich einige Zeit selbst zum teildämonischen Wesen wurde.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend02_15_01"); //Die Schergen des Xeres hatten es bei sich.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend02_14_02"); //Tatsächlich? Ja, du sprichst wahr, ich kann immer noch einen kleinen, aber deutlichen dämonischen Funken in dir wahrnehmen. Es scheint von Bestand zu sein ...
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend02_15_03"); //Und wie kann ich das jetzt für mich nutzen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend02_14_04"); //Hmm, Dämonen solcher Macht, wie Shivar, sind immer von einer starken Aura umgeben.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend02_14_05"); //Wenn du in seine Nähe gelangst und dich fest auf das Dämonische in dir fokussierst, könntest du zumindest für eine Weile das Dämonische in seiner ganzen Blüte zum Vorschein kommen lassen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend02_15_06"); //Blüte des Dämonischen?
AI_TurnAway (hero, self);
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend02_15_07"); //(zu sich selbst) So eine Umschreibung kann auch nur einem Dämonenmagier in den Sinn kommen.
AI_TurnToNpc (hero, self);
AI_Output(hero, self, "Info_Mod_Xardas_NW_Rasend02_15_08"); //(wieder zu Xardas) Zum Dämonen zu werden empfinde ich zwar nicht als besonders erstrebenswert, aber wenn es meine einzige Möglichkeit ist ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend02_14_09"); //Es würde dir auf jeden Fall neue Möglichkeiten eröffnen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend02_14_10"); //Wenn du so weit bist, versuche mit Shivar in den Dialog zu treten und zu erfahren, was vor sich geht.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Rasend02_14_11"); //Beliar möge dich behüten.
B_LogEntry (TOPIC_MOD_ADANOS_RASEND, "Na schön. Da das Dämonische nach dem Eintopf der Blutkultfritzen immer noch in mir weilt, soll ich mich in der Nähe des Dämonen Shivar voll darauf konzentrieren, um zum vollwertigen Dämonen zu werden. Anschließend könnte ich so manches von ihm erfahren ...");
};
INSTANCE Info_Mod_Xardas_NW_Trent (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Trent_Condition;
information = Info_Mod_Xardas_NW_Trent_Info;
permanent = 0;
important = 0;
description = "In der verlassenen Mine hab ich das hier gefunden. Es hat einen Paladin verzaubert, sodass er mich töten wollte.";
};
FUNC INT Info_Mod_Xardas_NW_Trent_Condition()
{
if (Mod_KG_SchwarzesErz == 1)
&& (Npc_HasItems(hero, ItMi_SchwarzesErz_Trent) == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Trent_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trent_15_00"); //In der verlassenen Mine hab ich das hier gefunden. Es hat einen Paladin verzaubert, sodass er mich töten wollte.
B_GiveInvItems (hero, self, ItMi_SchwarzesErz_Trent, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent_14_01"); //Das ist wirklich interessant ... dieses Erz scheint verflucht zu sein.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent_14_02"); //Wenn ich die genauen Eigenschaften herausfinden kann, könnten es eine starke Waffe gegen deine Feinde sein.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent_14_03"); //Komm in ein paar Tagen wieder, dann werde ich mehr wissen.
AI_TurnAway (hero, self);
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trent_15_04"); //(zu sich selbst) Hm, dann solle ich jetzt wohl zu Lord Andre gehen ...
B_LogEntry (TOPIC_MOD_KG_RITUAL, "Xardas wird das schwarze Erz untersuchen. Ich sollte derweil zu Lord André gehen.");
};
INSTANCE Info_Mod_Xardas_NW_Trent2 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Trent2_Condition;
information = Info_Mod_Xardas_NW_Trent2_Info;
permanent = 0;
important = 0;
description = "Hast du etwas über das Erz erfahren?";
};
FUNC INT Info_Mod_Xardas_NW_Trent2_Condition()
{
if (Mod_KG_NachOrkZauber == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Trent2_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trent2_15_00"); //Hast du etwas über das Erz erfahren? Ich bin gerade an einem Punkt, wo ich eine Wunderwaffe gebrauchen könnte.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent2_14_01"); //Leider ist es nicht so mächtig, wie ich gedacht habe. Gegen Xeres wird es uns nichts bringen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent2_14_02"); //Allerdings kannst du damit gegen gewisse Wesen Unsterblichkeit erlangen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trent2_15_03"); //Und wenn ich bereits eine Waffe habe, die das Gleiche kann? Könnte das Erz die Wirkung dann nicht auflösen?
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent2_14_04"); //Ja ... an sich schon, aber was wäre das denn für ein Zufall ... Hast du noch so ein Erz gefunden?
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trent2_15_05"); //Ja und nein. Ein unsterblicher Orkschamane hat mir etwas von einer schwarzen Lunge mit Menschenblut erzählt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent2_14_06"); //Nun, so würde es wohl ein Ork nennen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent2_14_07"); //Nun gut, auch wenn wir das hier auch anders einsetzen könnten, haben wir wohl keine andere Wahl. Ein unbesiegbarer Schamane ist zu gefährlich.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Trent2_14_08"); //Nimm diesen Ring, ich habe ihn aus dem Erz machen lassen. Damit sollte deine Waffe ihm schaden können.
B_GiveInvItems (self, hero, ItRi_SchwarzesErz, 1);
AI_Output(hero, self, "Info_Mod_Xardas_NW_Trent2_15_09"); //Hoffentlich klappt es!
B_LogEntry (TOPIC_MOD_KG_RITUAL, "Um den Schamanen töten zu können, muss ich den Ring, den Xardas aus dem schwarzen Erz hergestellt hat, anlegen und ihm dann gegenüber treten.");
};
INSTANCE Info_Mod_Xardas_NW_Aufnahme (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Aufnahme_Condition;
information = Info_Mod_Xardas_NW_Aufnahme_Info;
permanent = 1;
important = 0;
description = "Ich möchte Schwarzer Novize werden.";
};
FUNC INT Info_Mod_Xardas_NW_Aufnahme_Condition()
{
if (Mod_Gilde == 0)
&& (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_LetzterTest_Success))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Aufnahme_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Aufnahme_15_00"); //Ich möchte Schwarzer Novize werden.
if (hero.level >= 5)
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_14_01"); //Du weißt, dass es kein Zurück gibt? Dass deine Entscheidung endgültig ist?
if (Mod_HatPlayerNeutraleKlamotten())
{
if (Mod_Gottstatus > 4)
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_14_02"); //Du solltest allerdings vorher noch ein paar Taten zu Gunsten von Beliar vollbringen.
}
else
{
Info_ClearChoices (Info_Mod_Xardas_NW_Aufnahme);
Info_AddChoice (Info_Mod_Xardas_NW_Aufnahme, "Gib mir doch noch etwas Zeit.", Info_Mod_Xardas_NW_Aufnahme_Nein);
Info_AddChoice (Info_Mod_Xardas_NW_Aufnahme, "Ja.", Info_Mod_Xardas_NW_Aufnahme_Ja);
};
}
else
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_14_03"); //Du solltest dir vorher aber noch eine neutrale Rüstung besorgen.
};
}
else
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_14_04"); //Sammle noch etwas Erfahrung, dann werde ich dich mit Freuden aufnehmen.
};
};
FUNC VOID Info_Mod_Xardas_NW_Aufnahme_Nein()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Aufnahme_Nein_15_00"); //Gib mir doch noch etwas Zeit.
Info_ClearChoices (Info_Mod_Xardas_NW_Aufnahme);
};
FUNC VOID Info_Mod_Xardas_NW_Aufnahme_Ja()
{
Spine_UnlockAchievement(SPINE_ACHIEVEMENT_53);
Spine_UnlockAchievement(SPINE_ACHIEVEMENT_55);
Spine_UnlockAchievement(SPINE_ACHIEVEMENT_60);
AI_Output(hero, self, "Info_Mod_Xardas_NW_Aufnahme_Ja_15_00"); //Ja.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_Ja_14_01"); //Dann darf ich dich hiermit stellvertretend für Andokai willkommen heißen!
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_Ja_14_02"); //Er wird es mir schon nicht übelnehmen, wenn ich dir deine Rüstung und die traditionelle Waffe übergebe.
CreateInvItems (hero, ITAR_NOV_DMB_01, 1);
CreateInvItems (hero, ItMw_1h_SNov_Mace, 1);
B_ShowGivenThings ("Schwarze Novizenrobe und Kampfstab erhalten");
AI_UnequipArmor (hero);
AI_EquipArmor (hero, ItAr_Nov_DMB_01);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_Ja_14_03"); //Du solltest dich damit besser nicht in der Nähe dieser Innosanbeter in der Stadt und im Innoskloster zeigen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_Ja_14_04"); //Wenn du eine bessere Waffe brauchst, dann solltest du zu Scar gehen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_Ja_14_05"); //Zu deinen Rechten und Pflichten sprich aber wirklich besser mit Andokai.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Aufnahme_Ja_14_06"); //Ich werde dich nun in Magie unterweisen, wenn du wünschst.
B_LogEntry_More (TOPIC_MOD_GILDENAUFNAHME, TOPIC_MOD_DAEMONENBESCHWOERER, "Ich bin jetzt ein Schwarzer Novize.", "Ich bin jetzt ein Schwarzer Novize.");
B_SetTopicStatus (TOPIC_MOD_GILDENAUFNAHME, LOG_SUCCESS);
B_SetTopicStatus (TOPIC_MOD_DAEMONENBESCHWOERER, LOG_SUCCESS);
B_SetTopicStatus (TOPIC_MOD_FEUERMAGIER, LOG_FAILED);
B_SetTopicStatus (TOPIC_MOD_MILIZ, LOG_FAILED);
B_SetTopicStatus (TOPIC_MOD_WASSERMAGIER, LOG_FAILED);
B_SetTopicStatus (TOPIC_MOD_SÖLDNER, LOG_FAILED);
Mod_Gilde = 12;
Info_ClearChoices (Info_Mod_Xardas_NW_Aufnahme);
Monster_Max += 6;
hero.guild = GIL_KDF;
Npc_SetTrueGuild (hero, GIL_KDF);
BeliarAufnahme = Wld_GetDay();
Snd_Play ("LEVELUP");
B_GivePlayerXP (400);
B_Göttergefallen(3, 5);
};
INSTANCE Info_Mod_Xardas_NW_AxtDesUntergangs (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_AxtDesUntergangs_Condition;
information = Info_Mod_Xardas_NW_AxtDesUntergangs_Info;
permanent = 0;
important = 0;
description = "Was genau bewirkt die Axt denn?";
};
FUNC INT Info_Mod_Xardas_NW_AxtDesUntergangs_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_HabAxt))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_AxtDesUntergangs_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_AxtDesUntergangs_15_00"); //Was genau bewirkt die Axt denn? Besonders stark sieht sie nicht aus ...
AI_Output(self, hero, "Info_Mod_Xardas_NW_AxtDesUntergangs_14_01"); //Momentan ist sie ihrer Stärke beraubt. Du wirst sie häufig benutzen müssen, um ihre ehemalige Stärke wiederzuerlangen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AxtDesUntergangs_14_02"); //Sie entzieht jedem getöteten Feind einen Teil seiner Kraft und wird immer stärker.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AxtDesUntergangs_15_03"); //Klingt interessant.
};
INSTANCE Info_Mod_Xardas_NW_MilizVorTurm (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_MilizVorTurm_Condition;
information = Info_Mod_Xardas_NW_MilizVorTurm_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_MilizVorTurm_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Diego_VermissteFertig))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_MilizVorTurm_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_MilizVorTurm_14_00"); //Sofern du dich über die Kreaturen vor meinem Turm wunderst ... ein kleiner Mob aus der Stadt war unterwegs zu meinem Turm.
AI_Output(self, hero, "Info_Mod_Xardas_NW_MilizVorTurm_14_01"); //Meine Delegation hat sie gebührend begrüßt.
};
INSTANCE Info_Mod_Xardas_NW_AlteMineQuest (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_AlteMineQuest_Condition;
information = Info_Mod_Xardas_NW_AlteMineQuest_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Xardas_NW_AlteMineQuest_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Daemonisch3))
&& (Wld_GetDay()-6 >= Mod_SP_Killed_Day)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_AlteMineQuest_Info()
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest_14_00"); //In der alten Mine haben sich beunruhigende Dinge ergeben, wie ich gerade erfuhr.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest_14_01"); //Mord und Totschlag ohne erkennbare Motive ... Näheres weiß ich noch nicht.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest_14_02"); //Ich denke jedoch, dass deine Fertigkeiten und Kenntnisse in der Situation dort von Nutzen sein könnten.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlteMineQuest_15_03"); //Gut, ich werde beizeiten dort vorbeischauen.
Log_CreateTopic (TOPIC_MOD_XARDAS_ALTEMINE, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_XARDAS_ALTEMINE, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_XARDAS_ALTEMINE, "Xardas bat mich darum in der Alten Mine vorbeizuschauen. Scheinbar hat es dort einige ungewöhnliche Gewalttaten gegeben.");
};
INSTANCE Info_Mod_Xardas_NW_AlteMineQuest2 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_AlteMineQuest2_Condition;
information = Info_Mod_Xardas_NW_AlteMineQuest2_Info;
permanent = 0;
important = 0;
description = "Xeres hatte wieder einmal seine Finger im Spiel.";
};
FUNC INT Info_Mod_Xardas_NW_AlteMineQuest2_Condition()
{
if (Mod_AMQ_Viper == 2)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_AlteMineQuest2_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlteMineQuest2_15_00"); //Xeres hatte wieder einmal seine Finger im Spiel.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlteMineQuest2_15_01"); //Ich habe jedoch seine dunklen Machenschaften in der Alten Mine vereitelt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest2_14_02"); //Ja, ich habe gerade von den Ereignissen gehört.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest2_14_03"); //Den Weg über die Alte Mine wollte er sich erschließen, um seine Streitkräfte nach Khorinis zu bringen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest2_14_04"); //Sehr gerissen ... immer dort, wo es niemand erwartet.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlteMineQuest2_15_05"); //Stimmt ... alle Augen waren auf den Pass gerichtet.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest2_14_06"); //Nun, es ist müßig zu erwähnen, dass du nicht nur unsere Gemeinschaft, sondern ganz Khorinis wieder einmal vor einer Bedrohung bewahrt hast.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest2_14_07"); //Die Hinterlassenschaften des Feindes bei dieser Geschichte waren zudem nicht ganz wertlos.
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest2_14_08"); //Ich habe unseren Schmied daher dazu angewiesen, dir etwas Schönes daraus anzufertigen.
AI_Output(hero, self, "Info_Mod_Xardas_NW_AlteMineQuest2_15_09"); //Wie meinst du das?
AI_Output(self, hero, "Info_Mod_Xardas_NW_AlteMineQuest2_14_10"); //Unwichtig. Wenn du dich in unsere Festung begibst, wirst du es erfahren.
B_SetTopicStatus (TOPIC_MOD_XARDAS_ALTEMINE, LOG_SUCCESS);
B_GivePlayerXP (500);
CurrentNQ += 1;
};
INSTANCE Info_Mod_Xardas_NW_Schreine (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Schreine_Condition;
information = Info_Mod_Xardas_NW_Schreine_Info;
permanent = 0;
important = 0;
description = "Der Teleport vom Beliarschrein aus hat funktioniert.";
};
FUNC INT Info_Mod_Xardas_NW_Schreine_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Andokai_Hi))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Schreine_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Schreine_15_00"); //Der Teleport vom Beliarschrein aus hat funktioniert.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine_14_01"); //Ich habe nichts anderes erwartet.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine_14_02"); //Da das System recht jung ist, sind noch nicht viele Beliarschreine untereinander vernetzt.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine_14_03"); //Deshalb bitte ich dich, auf deinen Reisen nach bisher nicht angeschlossenen Schreinen Ausschau zu halten.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine_14_04"); //Sollte es dir gelingen, alle Schreine zu aktivieren, werde ich mir eine kleine Belohnung für dich ausdenken.
Log_CreateTopic (TOPIC_MOD_BELIAR_SCHREINE, LOG_MISSION);
B_SetTopicStatus (TOPIC_MOD_BELIAR_SCHREINE, LOG_RUNNING);
B_LogEntry (TOPIC_MOD_BELIAR_SCHREINE, "Xardas hat mir aufgetragen, alle Beliarschreine zu aktivieren, die ich auf meinem Weg finde. Sobald ich alle verfügbaren Schreine angeschlossen habe, will er sich eine Belohnung für mich ausdenken.");
};
INSTANCE Info_Mod_Xardas_NW_Schreine2 (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Schreine2_Condition;
information = Info_Mod_Xardas_NW_Schreine2_Info;
permanent = 0;
important = 0;
description = "Ich glaube, ich habe alle Beliarschreine untereinander angeschlossen.";
};
FUNC INT Info_Mod_Xardas_NW_Schreine2_Condition()
{
if (Mod_Beliarschreine == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Schreine2_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Schreine2_15_00"); //Ich glaube, ich habe alle Beliarschreine untereinander angeschlossen.
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine2_14_01"); //Das nenne ich eine respektable Leistung. Ich bin dir zu großem Dank verpflichtet.
AI_Output(hero, self, "Info_Mod_Xardas_NW_Schreine2_15_02"); //Du erwähntest eine Belohnung...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine2_14_03"); //Richtig. (sucht) Ich hatte ihn doch letztens noch hier irgendwo...
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine2_14_04"); //Ah, genau. Hier ist er.
B_GiveInvItems (self, hero, ItPo_Perm_Mana, 1);
AI_Output(self, hero, "Info_Mod_Xardas_NW_Schreine2_14_06"); //Den Trank habe ich schon seit Ewigkeiten. Ich hoffe, er wirkt noch.
B_SetTopicStatus (TOPIC_MOD_BELIAR_SCHREINE, LOG_SUCCESS);
};
var int Xardas_LastPetzCounter;
var int Xardas_LastPetzCrime;
INSTANCE Info_Mod_Xardas_PMSchulden (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_PMSchulden_Condition;
information = Info_Mod_Xardas_PMSchulden_Info;
permanent = 1;
important = 1;
};
FUNC INT Info_Mod_Xardas_PMSchulden_Condition()
{
if (Npc_IsInState(self, ZS_Talk))
&& (Xardas_Schulden > 0)
&& (B_GetGreatestPetzCrime(self) <= Xardas_LastPetzCrime)
{
return TRUE;
};
};
FUNC VOID Info_Mod_Xardas_PMSchulden_Info()
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_00"); //Bist du gekommen, um deine Strafe zu zahlen?
if (B_GetTotalPetzCounter(self) > Xardas_LastPetzCounter)
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_01"); //Ich hatte mich schon gefragt, ob du es überhaupt noch wagst, hierher zu kommen!
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_02"); //Anscheinend ist es nicht bei den letzten Anschuldigungen geblieben!
if (Xardas_Schulden < 1000)
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_03"); //Ich hatte dich gewarnt! Die Strafe, die du jetzt zahlen musst, ist höher!
AI_Output (hero, self, "Info_Mod_Xardas_PMAdd_15_00"); //Wieviel?
var int diff; diff = (B_GetTotalPetzCounter(self) - Xardas_LastPetzCounter);
if (diff > 0)
{
Xardas_Schulden = Xardas_Schulden + (diff * 50);
};
if (Xardas_Schulden > 1000) { Xardas_Schulden = 1000; };
B_Say_Gold (self, hero, Xardas_Schulden);
}
else
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_04"); //Du hast mich schwer enttäuscht!
};
}
else if (B_GetGreatestPetzCrime(self) < Xardas_LastPetzCrime)
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_05"); //Es haben sich einige neue Dinge ergeben.
if (Xardas_LastPetzCrime == CRIME_MURDER)
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_06"); //Plötzlich gibt es niemanden mehr, der dich des Mordes bezichtigt.
};
if (Xardas_LastPetzCrime == CRIME_THEFT)
|| ( (Xardas_LastPetzCrime > CRIME_THEFT) && (B_GetGreatestPetzCrime(self) < CRIME_THEFT) )
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_07"); //Niemand erinnert sich mehr, dich bei einem Diebstahl gesehen zu haben.
};
if (Xardas_LastPetzCrime == CRIME_ATTACK)
|| ( (Xardas_LastPetzCrime > CRIME_ATTACK) && (B_GetGreatestPetzCrime(self) < CRIME_ATTACK) )
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_08"); //Es gibt keine Zeugen mehr dafür, dass du jemals in eine Schlägerei verwickelt warst.
};
if (B_GetGreatestPetzCrime(self) == CRIME_NONE)
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_09"); //Anscheinend haben sich alle Anklagen gegen dich in Wohlgefallen aufgelöst.
};
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_10"); //Ich weiß nicht, was da gelaufen ist, aber ich warne dich: Spiel keine Spielchen mit mir.
// ------- Schulden erlassen oder trotzdem zahlen ------
if (B_GetGreatestPetzCrime(self) == CRIME_NONE)
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_11"); //Ich habe mich jedenfalls entschieden, dir deine Schulden zu erlassen.
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_12"); //Sieh zu, dass du nicht wieder in Schwierigkeiten kommst.
Xardas_Schulden = 0;
Xardas_LastPetzCounter = 0;
Xardas_LastPetzCrime = CRIME_NONE;
}
else
{
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_13"); //Damit eins klar ist: Deine Strafe musst du trotzdem in voller Höhe zahlen.
B_Say_Gold (self, hero, Xardas_Schulden);
AI_Output (self, hero, "Info_Mod_Xardas_PMSchulden_14_14"); //Also, was ist?
};
};
// ------ Choices NUR, wenn noch Crime vorliegt ------
if (B_GetGreatestPetzCrime(self) != CRIME_NONE)
{
Info_ClearChoices (Info_Mod_Xardas_PMSchulden);
Info_ClearChoices (Info_Mod_Xardas_PETZMASTER);
Info_AddChoice (Info_Mod_Xardas_PMSchulden,"Ich habe nicht genug Gold!",Info_Mod_Xardas_PETZMASTER_PayLater);
Info_AddChoice (Info_Mod_Xardas_PMSchulden,"Wieviel war es nochmal?",Info_Mod_Xardas_PMSchulden_HowMuchAgain);
if (Npc_HasItems(hero, itmi_gold) >= Xardas_Schulden)
{
Info_AddChoice (Info_Mod_Xardas_PMSchulden,"Ich will die Strafe zahlen.",Info_Mod_Xardas_PETZMASTER_PayNow);
};
};
};
func void Info_Mod_Xardas_PMSchulden_HowMuchAgain()
{
AI_Output (hero, self, "Info_Mod_Xardas_PMSchulden_HowMuchAgain_15_00"); //Wie viel war es noch mal?
B_Say_Gold (self, hero, Xardas_Schulden);
Info_ClearChoices (Info_Mod_Xardas_PMSchulden);
Info_ClearChoices (Info_Mod_Xardas_PETZMASTER);
Info_AddChoice (Info_Mod_Xardas_PMSchulden,"Ich habe nicht genug Gold!",Info_Mod_Xardas_PETZMASTER_PayLater);
Info_AddChoice (Info_Mod_Xardas_PMSchulden,"Wieviel war es nochmal?",Info_Mod_Xardas_PMSchulden_HowMuchAgain);
if (Npc_HasItems(hero, itmi_gold) >= Xardas_Schulden)
{
Info_AddChoice (Info_Mod_Xardas_PMSchulden,"Ich will die Strafe zahlen.",Info_Mod_Xardas_PETZMASTER_PayNow);
};
};
INSTANCE Info_Mod_Xardas_PETZMASTER (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_PETZMASTER_Condition;
information = Info_Mod_Xardas_PETZMASTER_Info;
permanent = 1;
important = 1;
};
FUNC INT Info_Mod_Xardas_PETZMASTER_Condition()
{
if (B_GetGreatestPetzCrime(self) > Xardas_LastPetzCrime)
{
return TRUE;
};
};
FUNC VOID Info_Mod_Xardas_PETZMASTER_Info()
{
Xardas_Schulden = 0; //weil Funktion nochmal durchlaufen wird, wenn Crime höher ist...
if (B_GetGreatestPetzCrime(self) == CRIME_MURDER)
{
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_01"); //Gut, dass du zu mir kommst, bevor alles noch schlimmer für dich wird.
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_02"); //Mord ist ein schweres Vergehen!
Xardas_Schulden = (B_GetTotalPetzCounter(self) * 50); //Anzahl der Zeugen * 50
Xardas_Schulden = Xardas_Schulden + 500; //PLUS Mörder-Malus
if ((PETZCOUNTER_City_Theft + PETZCOUNTER_City_Attack + PETZCOUNTER_City_Sheepkiller) > 0)
{
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_03"); //Ganz zu schweigen von den anderen Sachen, die du angerichtet hast.
};
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_06"); //Ich habe kein Interesse daran, dich an den Galgen zu bringen.
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_07"); //Aber es wird nicht leicht sein, die Leute wieder gnädig zu stimmen.
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_08"); //Du könntest deine Reue zeigen, indem du eine Strafe zahlst - natürlich muss die Strafe angemessen hoch sein.
};
if (B_GetGreatestPetzCrime(self) == CRIME_THEFT)
{
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_09"); //Gut, dass du kommst! Du wirst des Diebstahls bezichtigt! Es gibt Zeugen!
if ((PETZCOUNTER_City_Attack + PETZCOUNTER_City_Sheepkiller) > 0)
{
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_10"); //Von den anderen Dingen, die mir zu Ohren gekommen sind, will ich gar nicht erst reden.
};
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_11"); //Ich werde so ein Verhalten hier nicht dulden!
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_12"); //Du wirst eine Strafe zahlen müssen, um dein Verbrechen wieder gutzumachen!
Xardas_Schulden = (B_GetTotalPetzCounter(self) * 50); //Anzahl der Zeugen * 50
};
if (B_GetGreatestPetzCrime(self) == CRIME_ATTACK)
{
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_13"); //Wenn du dich mit der Miliz oder den Feuermagiern herumprügelst, ist das eine Sache ...
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_14"); //Aber wenn du unsere Leute angreifst, muss ich dich zur Rechenschaft ziehen.
if (PETZCOUNTER_City_Sheepkiller > 0)
{
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_15"); //Und die Sache mit den Schafen musste wohl auch nicht sein.
};
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_16"); //Wenn ich dir das durchgehen lasse, macht hier bald jeder, was er will.
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_17"); //Also wirst du eine angemessene Strafe zahlen - und die Sache ist vergessen.
Xardas_Schulden = (B_GetTotalPetzCounter(self) * 50); //Anzahl der Zeugen * 50
};
// ------ Schaf getötet (nahezu uninteressant - in der City gibt es keine Schafe) ------
if (B_GetGreatestPetzCrime(self) == CRIME_SHEEPKILLER)
{
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_18"); //Mir ist zu Ohren gekommen, du hättest dich an unseren Schafen vergriffen.
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_19"); //Dir ist klar, dass ich das nicht durchgehen lassen kann.
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_14_20"); //Du wirst eine Entschädigung zahlen müssen!
Xardas_Schulden = 100;
};
AI_Output (hero, self, "Info_Mod_Xardas_PETZMASTER_15_21"); //Wie viel?
if (Xardas_Schulden > 1000) { Xardas_Schulden = 1000; };
B_Say_Gold (self, hero, Xardas_Schulden);
Info_ClearChoices (Info_Mod_Xardas_PMSchulden);
Info_ClearChoices (Info_Mod_Xardas_PETZMASTER);
Info_AddChoice (Info_Mod_Xardas_PETZMASTER,"Ich habe nicht genug Gold!",Info_Mod_Xardas_PETZMASTER_PayLater);
if (Npc_HasItems(hero, itmi_gold) >= Xardas_Schulden)
{
Info_AddChoice (Info_Mod_Xardas_PETZMASTER,"Ich will die Strafe zahlen.",Info_Mod_Xardas_PETZMASTER_PayNow);
};
};
func void Info_Mod_Xardas_PETZMASTER_PayNow()
{
AI_Output (hero, self, "Info_Mod_Xardas_PETZMASTER_PayNow_15_00"); //Ich will die Strafe zahlen!
B_GiveInvItems (hero, self, itmi_gold, Xardas_Schulden);
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_PayNow_14_01"); //Gut! Ich werde dafür sorgen, dass es jeder von uns erfährt - damit wäre dein Ruf einigermaßen wiederhergestellt.
B_GrantAbsolution (LOC_SMCAMP);
Xardas_Schulden = 0;
Xardas_LastPetzCounter = 0;
Xardas_LastPetzCrime = CRIME_NONE;
Info_ClearChoices (Info_Mod_Xardas_PETZMASTER);
Info_ClearChoices (Info_Mod_Xardas_PMSchulden); //!!! Info-Choice wird noch von anderem Dialog angesteuert!
};
func void Info_Mod_Xardas_PETZMASTER_PayLater()
{
AI_Output (hero, self, "Info_Mod_Xardas_PETZMASTER_PayLater_15_00"); //Ich habe nicht genug Gold!
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_PayLater_14_01"); //Dann sieh zu, dass du das Gold so schnell wie möglich beschaffst.
AI_Output (self, hero, "Info_Mod_Xardas_PETZMASTER_PayLater_14_02"); //Und ich warne dich: Wenn du dir noch was zu schulden kommen lässt, wird die Sache noch schlimmer für dich!
Xardas_LastPetzCounter = B_GetTotalPetzCounter(self);
Xardas_LastPetzCrime = B_GetGreatestPetzCrime(self);
AI_StopProcessInfos (self);
};
INSTANCE Info_Mod_Xardas_NW_Lernen_MANA (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Lernen_MANA_Condition;
information = Info_Mod_Xardas_NW_Lernen_MANA_Info;
permanent = 1;
important = 0;
description = "Ich will meine magischen Kräfte steigern.";
};
FUNC INT Info_Mod_Xardas_NW_Lernen_MANA_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_VonWemKannIchLernen))
&& (hero.attribute[ATR_MANA_MAX] <= 300)
&& (Mod_Schwierigkeit != 4)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Lernen_MANA_Info()
{
AI_Output(hero, self, "Info_Mod_Xardas_NW_Lernen_MANA_15_00"); //Ich will meine magischen Kräfte steigern.
Info_ClearChoices (Info_Mod_Xardas_NW_Lernen_MANA);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, DIALOG_BACK, Info_Mod_Xardas_NW_Lernen_MANA_BACK);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, B_BuildLearnString_New(PRINT_LearnMANA5 , B_GetLearnCostAttribute_New(hero, ATR_MANA_MAX), ATR_MANA_MAX) ,Info_Mod_Xardas_NW_Lernen_MANA_5);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, B_BuildLearnString_New(PRINT_LearnMANA1 , B_GetLearnCostAttribute(hero, ATR_MANA_MAX), ATR_MANA_MAX) ,Info_Mod_Xardas_NW_Lernen_MANA_1);
};
FUNC VOID Info_Mod_Xardas_NW_Lernen_MANA_BACK()
{
if (hero.attribute[ATR_MANA_MAX] >= 300)
{
AI_Output(self, hero, "Info_Mod_Xardas_NW_Lernen_MANA_BACK_14_01"); //Deine magischen Kenntnisse sind jetzt so gut, dass ich dir nichts mehr beibringen kann.
};
Info_ClearChoices (Info_Mod_Xardas_NW_Lernen_MANA);
};
FUNC VOID Info_Mod_Xardas_NW_Lernen_MANA_5()
{
B_TeachAttributePoints_New (self, hero, ATR_MANA_MAX, 5, 300);
Info_ClearChoices (Info_Mod_Xardas_NW_Lernen_MANA);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, DIALOG_BACK, Info_Mod_Xardas_NW_Lernen_MANA_BACK);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, B_BuildLearnString_New(PRINT_LearnMANA5 , B_GetLearnCostAttribute_New(hero, ATR_MANA_MAX), ATR_MANA_MAX) ,Info_Mod_Xardas_NW_Lernen_MANA_5);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, B_BuildLearnString_New(PRINT_LearnMANA1 , B_GetLearnCostAttribute(hero, ATR_MANA_MAX), ATR_MANA_MAX) ,Info_Mod_Xardas_NW_Lernen_MANA_1);
};
FUNC VOID Info_Mod_Xardas_NW_Lernen_MANA_1()
{
B_TeachAttributePoints (self, hero, ATR_MANA_MAX, 1, 300);
Info_ClearChoices (Info_Mod_Xardas_NW_Lernen_MANA);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, DIALOG_BACK, Info_Mod_Xardas_NW_Lernen_MANA_BACK);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, B_BuildLearnString_New(PRINT_LearnMANA5 , B_GetLearnCostAttribute_New(hero, ATR_MANA_MAX), ATR_MANA_MAX) ,Info_Mod_Xardas_NW_Lernen_MANA_5);
Info_AddChoice (Info_Mod_Xardas_NW_Lernen_MANA, B_BuildLearnString_New(PRINT_LearnMANA1 , B_GetLearnCostAttribute(hero, ATR_MANA_MAX), ATR_MANA_MAX) ,Info_Mod_Xardas_NW_Lernen_MANA_1);
};
INSTANCE Info_Mod_Xardas_NW_Lehrer (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Lehrer_Condition;
information = Info_Mod_Xardas_NW_Lehrer_Info;
permanent = 1;
important = 0;
description = "Kann ich bei dir lernen?";
};
FUNC INT Info_Mod_Xardas_NW_Lehrer_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_Hallo))
&& ((Mod_Gilde == 12)
|| (Mod_Gilde == 13)
|| (Mod_Gilde == 14)
|| (Mod_Gilde == 15)
|| (Mod_Gilde == 16))
&& (Mod_IstLehrling == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_Info()
{
AI_Output (hero, self, "Info_Mod_Xardas_NW_Lehrer_15_00"); //Kann ich bei dir lernen?
if (Mod_Gilde == 12)
|| (Mod_Gilde == 13)
|| (Mod_Gilde == 14)
|| (Mod_Gilde == 15)
|| (Mod_Gilde == 16)
{
AI_Output (self, hero, "Info_Mod_Xardas_NW_Lehrer_14_01"); //Ich werde dich in die Geheimnisse der Alchemie einweihen.
if (Mod_XardasAlchemie == FALSE)
{
Mod_XardasAlchemie = TRUE;
Log_CreateTopic (TOPIC_MOD_LEHRER_BELIARFESTUNG, LOG_NOTE);
B_LogEntry (TOPIC_MOD_LEHRER_BELIARFESTUNG, "Xardas kann mir etwas über die Alchemie beibringen.");
};
Info_ClearChoices (Info_Mod_Xardas_NW_Lehrer);
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer,DIALOG_BACK,Info_Mod_Xardas_NW_Lehrer_BACK);
if ( PLAYER_TALENT_ALCHEMY[POTION_Health_01] == FALSE)
&& (Mod_LehrlingBei != 1)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer,B_BuildLearnString ("Essenz der Heilung", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Health_01)),Info_Mod_Xardas_NW_Lehrer_HEALTH_01);
};
if ( PLAYER_TALENT_ALCHEMY[POTION_Health_02] == FALSE)
&& ( PLAYER_TALENT_ALCHEMY[POTION_Health_01] == TRUE)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Extrakt der Heilung", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Health_02)), Info_Mod_Xardas_NW_Lehrer_Health_02);
};
if ( PLAYER_TALENT_ALCHEMY[POTION_Health_03] == FALSE)
&& ( PLAYER_TALENT_ALCHEMY[POTION_Health_02] == TRUE)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Elixier der Heilung", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Health_03)), Info_Mod_Xardas_NW_Lehrer_Health_03);
};
if ( PLAYER_TALENT_ALCHEMY[POTION_Perm_Health] == FALSE)
&& ( PLAYER_TALENT_ALCHEMY[POTION_Health_03] == TRUE)
&& (Mod_LehrlingBei != 1)
&& (Kapitel >= 4)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Elixier des Lebens", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Perm_Health)), Info_Mod_Xardas_NW_Lehrer_Perm_Health);
};
if ( PLAYER_TALENT_ALCHEMY[POTION_Mana_01] == FALSE)
&& (Mod_LehrlingBei != 1)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Mana Essenz", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Mana_01)), Info_Mod_Xardas_NW_Lehrer_Mana_01);
};
if ( PLAYER_TALENT_ALCHEMY[POTION_Mana_02] == FALSE)
&& ( PLAYER_TALENT_ALCHEMY[POTION_Mana_01] == TRUE)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Mana Extrakt", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Mana_02)), Info_Mod_Xardas_NW_Lehrer_Mana_02);
};
if ( PLAYER_TALENT_ALCHEMY[POTION_Mana_03] == FALSE)
&& ( PLAYER_TALENT_ALCHEMY[POTION_Mana_02] == TRUE)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Mana Elixier", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Mana_03)), Info_Mod_Xardas_NW_Lehrer_Mana_03);
};
if ( PLAYER_TALENT_ALCHEMY[POTION_Perm_Mana] == FALSE)
&& ( PLAYER_TALENT_ALCHEMY[POTION_Mana_03] == TRUE)
&& (Kapitel >= 4)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Elixier des Geistes", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Perm_Mana)), Info_Mod_Xardas_NW_Lehrer_Perm_Mana);
};
if (PLAYER_TALENT_ALCHEMY[POTION_Perm_STR] == FALSE)
&& (Kapitel >= 4)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer, B_BuildLearnString ("Elixier der Stärke", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Perm_STR)), Info_Mod_Xardas_NW_Lehrer_PermSTR);
};
if (PLAYER_TALENT_ALCHEMY[POTION_Perm_DEX] == FALSE)
&& (Kapitel >= 4)
{
Info_AddChoice (Info_Mod_Xardas_NW_Lehrer,B_BuildLearnString ("Elixier der Geschicklichkeit", B_GetLearnCostTalent (hero, NPC_TALENT_ALCHEMY, POTION_Perm_DEX)), Info_Mod_Xardas_NW_Lehrer_Perm_DEX);
};
};
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_BACK()
{
Info_ClearChoices (Info_Mod_Xardas_NW_Lehrer);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_HEALTH_01()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Health_01);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_PermStr()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Perm_STR);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_Perm_DEX()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Perm_DEX);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_HEALTH_02()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Health_02);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_Health_03()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Health_03);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_Perm_Health()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Perm_Health);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_MANA_01()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Mana_01);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_MANA_02()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Mana_02);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_MANA_03()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Mana_03);
};
FUNC VOID Info_Mod_Xardas_NW_Lehrer_Perm_Mana()
{
B_TeachPlayerTalentAlchemy (self, hero, POTION_Perm_Mana);
};
INSTANCE Info_Mod_Xardas_NW_Pickpocket (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_Pickpocket_Condition;
information = Info_Mod_Xardas_NW_Pickpocket_Info;
permanent = 1;
important = 0;
description = Pickpocket_210;
};
FUNC INT Info_Mod_Xardas_NW_Pickpocket_Condition()
{
C_Beklauen (210, ItPo_MegaDrink, 1);
};
FUNC VOID Info_Mod_Xardas_NW_Pickpocket_Info()
{
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
Info_AddChoice (Info_Mod_Xardas_NW_Pickpocket, DIALOG_BACK, Info_Mod_Xardas_NW_Pickpocket_BACK);
Info_AddChoice (Info_Mod_Xardas_NW_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_Xardas_NW_Pickpocket_DoIt);
};
FUNC VOID Info_Mod_Xardas_NW_Pickpocket_BACK()
{
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
};
FUNC VOID Info_Mod_Xardas_NW_Pickpocket_DoIt()
{
if (B_Beklauen() == TRUE)
{
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
}
else
{
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
Info_AddChoice (Info_Mod_Xardas_NW_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_Xardas_NW_Pickpocket_Beschimpfen);
Info_AddChoice (Info_Mod_Xardas_NW_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_Xardas_NW_Pickpocket_Bestechung);
Info_AddChoice (Info_Mod_Xardas_NW_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_Xardas_NW_Pickpocket_Herausreden);
};
};
FUNC VOID Info_Mod_Xardas_NW_Pickpocket_Beschimpfen()
{
B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN");
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
};
FUNC VOID Info_Mod_Xardas_NW_Pickpocket_Bestechung()
{
B_Say (hero, self, "$PICKPOCKET_BESTECHUNG");
var int rnd; rnd = r_max(99);
if (rnd < 25)
|| ((rnd >= 25) && (rnd < 50) && (Npc_HasItems(hero, ItMi_Gold) < 50))
|| ((rnd >= 50) && (rnd < 75) && (Npc_HasItems(hero, ItMi_Gold) < 100))
|| ((rnd >= 75) && (rnd < 100) && (Npc_HasItems(hero, ItMi_Gold) < 200))
{
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
}
else
{
if (rnd >= 75)
{
B_GiveInvItems (hero, self, ItMi_Gold, 200);
}
else if (rnd >= 50)
{
B_GiveInvItems (hero, self, ItMi_Gold, 100);
}
else if (rnd >= 25)
{
B_GiveInvItems (hero, self, ItMi_Gold, 50);
};
B_Say (self, hero, "$PICKPOCKET_BESTECHUNG_01");
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
AI_StopProcessInfos (self);
};
};
FUNC VOID Info_Mod_Xardas_NW_Pickpocket_Herausreden()
{
B_Say (hero, self, "$PICKPOCKET_HERAUSREDEN");
if (r_max(99) < Mod_Verhandlungsgeschick)
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_01");
Info_ClearChoices (Info_Mod_Xardas_NW_Pickpocket);
}
else
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02");
};
};
INSTANCE Info_Mod_Xardas_NW_EXIT (C_INFO)
{
npc = Mod_513_DMB_Xardas_NW;
nr = 1;
condition = Info_Mod_Xardas_NW_EXIT_Condition;
information = Info_Mod_Xardas_NW_EXIT_Info;
permanent = 1;
important = 0;
description = DIALOG_ENDE;
};
FUNC INT Info_Mod_Xardas_NW_EXIT_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Xardas_NW_WasFuerGilden))
{
return 1;
};
};
FUNC VOID Info_Mod_Xardas_NW_EXIT_Info()
{
AI_StopProcessInfos (self);
};
|
D
|
/**
* D header file for POSIX.
*
* Copyright: Copyright David Nadlinger 2011.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: David Nadlinger, Sean Kelly, Alex Rønne Petersen
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
*/
/* Copyright David Nadlinger 2011.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module core.sys.posix.netdb;
import core.sys.posix.config;
public import core.stdc.inttypes; // for uint32_t
public import core.sys.posix.netinet.in_; // for in_port_t, in_addr_t
public import core.sys.posix.sys.types; // for ino_t
public import core.sys.posix.sys.socket; // for socklen_t
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
version (Posix):
extern (C):
nothrow:
@nogc:
@system:
//
// Required
//
/*
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
}
struct netent
{
char* n_name;
char** n_aliase;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
IPPORT_RESERVED
h_errno
HOST_NOT_FOUND
NO_DATA
NO_RECOVERY
TRY_AGAIN
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
sockaddr* ai_addr;
char* ai_canonname;
addrinfo* ai_next;
}
AI_PASSIVE
AI_CANONNAME
AI_NUMERICHOST
AI_NUMERICSERV
AI_V4MAPPED
AI_ALL
AI_ADDRCONFIG
NI_NOFQDN
NI_NUMERICHOST
NI_NAMEREQD
NI_NUMERICSERV
NI_NUMERICSCOPE
NI_DGRAM
EAI_AGAIN
EAI_BADFLAGS
EAI_FAIL
EAI_FAMILY
EAI_MEMORY
EAI_NONAME
EAI_SERVICE
EAI_SOCKTYPE
EAI_SYSTEM
EAI_OVERFLOW
void endhostent();
void endnetent();
void endprotoent();
void endservent();
void freeaddrinfo(addrinfo*);
const(char)* gai_strerror(int);
int getaddrinfo(const(char)*, const(char)*, const(addrinfo)*, addrinfo**);
hostent* gethostbyaddr(const(void)*, socklen_t, int);
hostent* gethostbyname(const(char)*);
hostent* gethostent();
int getnameinfo(const(sockaddr)*, socklen_t, char*, socklen_t, char*, socklen_t, int);
netent* getnetbyaddr(uint32_t, int);
netent* getnetbyname(const(char)*);
netent* getnetent();
protoent* getprotobyname(const(char)*);
protoent* getprotobynumber(int);
protoent* getprotoent();
servent* getservbyname(const(char)*, const(char)*);
servent* getservbyport(int, const(char)*);
servent* getservent();
void sethostent(int);
void setnetent(int);
void setprotoent(int);
void setservent(int);
*/
version (CRuntime_Glibc)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum IPPORT_RESERVED = 1024;
//h_errno
enum HOST_NOT_FOUND = 1;
enum NO_DATA = 4;
enum NO_RECOVERY = 3;
enum TRY_AGAIN = 2;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
sockaddr* ai_addr;
char* ai_canonname;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x1;
enum AI_CANONNAME = 0x2;
enum AI_NUMERICHOST = 0x4;
enum AI_NUMERICSERV = 0x400;
enum AI_V4MAPPED = 0x8;
enum AI_ALL = 0x10;
enum AI_ADDRCONFIG = 0x20;
enum NI_NOFQDN = 4;
enum NI_NUMERICHOST = 1;
enum NI_NAMEREQD = 8;
enum NI_NUMERICSERV = 2;
//enum NI_NUMERICSCOPE = ?;
enum NI_DGRAM = 16;
enum NI_MAXHOST = 1025; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum EAI_AGAIN = -3;
enum EAI_BADFLAGS = -1;
enum EAI_FAIL = -4;
enum EAI_FAMILY = -6;
enum EAI_MEMORY = -10;
enum EAI_NONAME = -2;
enum EAI_SERVICE = -8;
enum EAI_SOCKTYPE = -7;
enum EAI_SYSTEM = -11;
enum EAI_OVERFLOW = -12;
}
else version (Darwin)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum IPPORT_RESERVED = 1024;
//h_errno
enum HOST_NOT_FOUND = 1;
enum NO_DATA = 4;
enum NO_RECOVERY = 3;
enum TRY_AGAIN = 2;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x1;
enum AI_CANONNAME = 0x2;
enum AI_NUMERICHOST = 0x4;
enum AI_NUMERICSERV = 0x1000;
enum AI_V4MAPPED = 0x800;
enum AI_ALL = 0x100;
enum AI_ADDRCONFIG = 0x400;
enum NI_NOFQDN = 0x1;
enum NI_NUMERICHOST = 0x2;
enum NI_NAMEREQD = 0x4;
enum NI_NUMERICSERV = 0x8;
//enum NI_NUMERICSCOPE = ?;
enum NI_DGRAM = 0x10;
enum NI_MAXHOST = 1025; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum EAI_AGAIN = 2;
enum EAI_BADFLAGS = 3;
enum EAI_FAIL = 4;
enum EAI_FAMILY = 5;
enum EAI_MEMORY = 6;
enum EAI_NONAME = 8;
enum EAI_SERVICE = 9;
enum EAI_SOCKTYPE = 10;
enum EAI_SYSTEM = 11;
enum EAI_OVERFLOW = 14;
}
else version (FreeBSD)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
extern (D) char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum IPPORT_RESERVED = 1024;
//h_errno
enum HOST_NOT_FOUND = 1;
enum NO_DATA = 4;
enum NO_RECOVERY = 3;
enum TRY_AGAIN = 2;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x1;
enum AI_CANONNAME = 0x2;
enum AI_NUMERICHOST = 0x4;
enum AI_NUMERICSERV = 0x8;
enum AI_V4MAPPED = 0x800;
enum AI_ALL = 0x100;
enum AI_ADDRCONFIG = 0x400;
enum NI_NOFQDN = 0x1;
enum NI_NUMERICHOST = 0x2;
enum NI_NAMEREQD = 0x4;
enum NI_NUMERICSERV = 0x8;
//enum NI_NUMERICSCOPE = ?;
enum NI_DGRAM = 0x10;
enum NI_MAXHOST = 1025; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum EAI_AGAIN = 2;
enum EAI_BADFLAGS = 3;
enum EAI_FAIL = 4;
enum EAI_FAMILY = 5;
enum EAI_MEMORY = 6;
enum EAI_NONAME = 8;
enum EAI_SERVICE = 9;
enum EAI_SOCKTYPE = 10;
enum EAI_SYSTEM = 11;
enum EAI_OVERFLOW = 14;
}
else version (NetBSD)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
extern (D) char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
/+ todo
#if (defined(__sparc__) && defined(_LP64)) || \
(defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _BIG_ENDIAN))
int __n_pad0; /* ABI compatibility */
#endif
uint32_t n_net; /*%< network # */
#if defined(__alpha__) || (defined(__i386__) && defined(_LP64)) || \
(defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _LITTLE_ENDIAN))
int __n_pad0; /* ABI compatibility */
#endif
+/
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum IPPORT_RESERVED = 1024;
//h_errno
enum HOST_NOT_FOUND = 1;
enum NO_DATA = 4;
enum NO_RECOVERY = 3;
enum TRY_AGAIN = 2;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
/+todo
#if defined(__sparc__) && defined(_LP64)
int __ai_pad0; /* ABI compatibility */
#endif
+/
socklen_t ai_addrlen;
/+todo
#if defined(__alpha__) || (defined(__i386__) && defined(_LP64))
int __ai_pad0; /* ABI compatibility */
#endif
+/
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x1;
enum AI_CANONNAME = 0x2;
enum AI_NUMERICHOST = 0x4;
enum AI_NUMERICSERV = 0x8;
enum AI_V4MAPPED = 0x800;
enum AI_ALL = 0x100;
enum AI_ADDRCONFIG = 0x400;
enum NI_NOFQDN = 0x1;
enum NI_NUMERICHOST = 0x2;
enum NI_NAMEREQD = 0x4;
enum NI_NUMERICSERV = 0x8;
enum NI_DGRAM = 0x10;
enum NI_WITHSCOPEID = 0x00000020;
enum NI_NUMERICSCOPE = 0x00000040;
enum NI_MAXHOST = 1025; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum EAI_AGAIN = 2;
enum EAI_BADFLAGS = 3;
enum EAI_FAIL = 4;
enum EAI_FAMILY = 5;
enum EAI_MEMORY = 6;
enum EAI_NONAME = 8;
enum EAI_SERVICE = 9;
enum EAI_SOCKTYPE = 10;
enum EAI_SYSTEM = 11;
enum EAI_OVERFLOW = 14;
}
else version (OpenBSD)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
extern (D) char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
in_addr_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum IPPORT_RESERVED = 1024;
//h_errno
enum NETDB_INTERNAL = -1;
enum NETDB_SUCCESS = 0;
enum HOST_NOT_FOUND = 1;
enum NO_DATA = 4;
enum NO_RECOVERY = 3;
enum TRY_AGAIN = 2;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x1;
enum AI_CANONNAME = 0x2;
enum AI_NUMERICHOST = 0x4;
enum AI_EXT = 0x8;
enum AI_NUMERICSERV = 0x10;
enum AI_V4MAPPED = 0; // Not supported
enum AI_FQDN = 0x20;
enum AI_ADDRCONFIG = 0x40;
enum AI_MASK = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_FQDN | AI_ADDRCONFIG;
enum NI_NUMERICHOST = 1;
enum NI_NUMERICSERV = 2;
enum NI_NOFQDN = 4;
enum NI_NAMEREQD = 8;
enum NI_DGRAM = 16;
//enum NI_NUMERICSCOPE = 32;
enum NI_MAXHOST = 256; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum EAI_NONAME = -1;
enum EAI_BADFLAGS = -2;
enum EAI_AGAIN = -3;
enum EAI_FAIL = -4;
enum EAI_NODATA = -5;
enum EAI_FAMILY = -6;
enum EAI_SOCKTYPE = -7;
enum EAI_SERVICE = -8;
enum EAI_ADDRFAMILY = -9;
enum EAI_MEMORY = -10;
enum EAI_SYSTEM = -11;
enum EAI_BADHINTS = -12;
enum EAI_PROTOCOL = -13;
enum EAI_OVERFLOW = -14;
}
else version (DragonFlyBSD)
{
/*
* Error return codes from gethostbyname() and gethostbyaddr()
* (left in h_errno).
*/
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
extern (D) char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype = SOCK_STREAM; /* socktype default value required to be able to perform getAddrInfo on DragonFlyBSD
* without socktype set, you get 'servname not supported for ai_socktype'
*/
int ai_protocol;
socklen_t ai_addrlen;
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
enum IPPORT_RESERVED = 1024;
enum NETDB_INTERNAL = -1;
enum NETDB_SUCCESS = 0;
enum HOST_NOT_FOUND = 1;
enum TRY_AGAIN = 2;
enum NO_RECOVERY = 3;
enum NO_DATA = 4;
enum NO_ADDRESS = NO_DATA;
//enum EAI_ADDRFAMILY = 1; // deprecated
enum EAI_AGAIN = 2;
enum EAI_BADFLAGS = 3;
enum EAI_FAIL = 4;
enum EAI_FAMILY = 5;
enum EAI_MEMORY = 6;
//enum EAI_NODATA = 7; // deprecated
enum EAI_NONAME = 8;
enum EAI_SERVICE = 9;
enum EAI_SOCKTYPE = 10;
enum EAI_SYSTEM = 11;
enum EAI_BADHINTS = 12;
enum EAI_PROTOCOL = 13;
enum EAI_OVERFLOW = 14;
enum AI_PASSIVE = 0x001;
enum AI_CANONNAME = 0x002;
enum AI_NUMERICHOST = 0x004;
enum AI_NUMERICSERV = 0x008;
enum AI_MASK = (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG); // valid flags for addrinfo (not a standard def, apps should not use it)
enum AI_ALL = 0x100;
enum AI_V4MAPPED_CFG = 0x200;
enum AI_ADDRCONFIG = 0x400;
enum AI_V4MAPPED = 0x800;
enum AI_DEFAULT = (AI_V4MAPPED_CFG | AI_ADDRCONFIG);
enum NI_MAXHOST = 1025; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum NI_NOFQDN = 0x01;
enum NI_NUMERICHOST = 0x02;
enum NI_NAMEREQD = 0x04;
enum NI_NUMERICSERV = 0x08;
enum NI_DGRAM = 0x10;
//enum NI_WITHSCOPEID = 0x20; // deprecated
enum NI_NUMERICSCOPE = 0x40;
}
else version (Solaris)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
extern (D) char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum HOST_NOT_FOUND = 1;
enum TRY_AGAIN = 2;
enum NO_RECOVERY = 3;
enum NO_DATA = 4;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
version (SPARC64)
int _ai_pad;
socklen_t ai_addrlen;
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x0008;
enum AI_CANONNAME = 0x0010;
enum AI_NUMERICHOST = 0x0020;
enum AI_NUMERICSERV = 0x0040;
enum AI_V4MAPPED = 0x0001;
enum AI_ALL = 0x0002;
enum AI_ADDRCONFIG = 0x0004;
enum NI_NOFQDN = 0x0001;
enum NI_NUMERICHOST = 0x0002;
enum NI_NAMEREQD = 0x0004;
enum NI_NUMERICSERV = 0x0008;
enum NI_DGRAM = 0x0010;
enum NI_WITHSCOPEID = 0x0020;
enum NI_NUMERICSCOPE = 0x0040;
enum NI_MAXHOST = 1025;
enum NI_MAXSERV = 32;
enum EAI_AGAIN = 2;
enum EAI_BADFLAGS = 3;
enum EAI_FAIL = 4;
enum EAI_FAMILY = 5;
enum EAI_MEMORY = 6;
enum EAI_NONAME = 8;
enum EAI_SERVICE = 9;
enum EAI_SOCKTYPE = 10;
enum EAI_SYSTEM = 11;
enum EAI_OVERFLOW = 14;
enum EAI_PROTOCOL = 13;
enum EAI_MAX = 14;
}
else version (CRuntime_Bionic)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
extern (D) char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum IPPORT_RESERVED = 1024;
enum HOST_NOT_FOUND = 1;
enum NO_DATA = 4;
enum NO_RECOVERY = 3;
enum TRY_AGAIN = 2;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x1;
enum AI_CANONNAME = 0x2;
enum AI_NUMERICHOST = 0x4;
enum AI_NUMERICSERV = 0x8;
enum AI_V4MAPPED = 0x800;
enum AI_ALL = 0x100;
enum AI_ADDRCONFIG = 0x400;
enum NI_NOFQDN = 0x1;
enum NI_NUMERICHOST = 0x2;
enum NI_NAMEREQD = 0x4;
enum NI_NUMERICSERV = 0x8;
enum NI_DGRAM = 0x10;
enum NI_MAXHOST = 1025; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum EAI_AGAIN = 2;
enum EAI_BADFLAGS = 3;
enum EAI_FAIL = 4;
enum EAI_FAMILY = 5;
enum EAI_MEMORY = 6;
enum EAI_NONAME = 8;
enum EAI_SERVICE = 9;
enum EAI_SOCKTYPE = 10;
enum EAI_SYSTEM = 11;
enum EAI_OVERFLOW = 14;
}
else version (CRuntime_Musl)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
sockaddr* ai_addr;
char* ai_canonname;
addrinfo* ai_next;
}
enum {
AI_PASSIVE = 0x1,
AI_CANONNAME = 0x2,
AI_NUMERICHOST = 0x4,
AI_NUMERICSERV = 0x400,
AI_V4MAPPED = 0x8,
AI_ALL = 0x10,
AI_ADDRCONFIG = 0x20,
}
enum {
NI_NUMERICHOST = 1,
NI_NUMERICSERV = 2,
NI_NOFQDN = 4,
NI_NAMEREQD = 8,
NI_DGRAM = 16,
NI_MAXSERV = 32,
NI_MAXHOST = 255,
}
enum {
EAI_BADFLAGS = -1,
EAI_NONAME = -2,
EAI_AGAIN = -3,
EAI_FAIL = -4,
EAI_FAMILY = -6,
EAI_SOCKTYPE = -7,
EAI_SERVICE = -8,
EAI_MEMORY = -10,
EAI_SYSTEM = -11,
EAI_OVERFLOW = -12,
}
}
else version (CRuntime_UClibc)
{
struct hostent
{
char* h_name;
char** h_aliases;
int h_addrtype;
int h_length;
char** h_addr_list;
extern (D) char* h_addr() @property { return h_addr_list[0]; } // non-standard
}
struct netent
{
char* n_name;
char** n_aliases;
int n_addrtype;
uint32_t n_net;
}
struct protoent
{
char* p_name;
char** p_aliases;
int p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
int s_port;
char* s_proto;
}
enum IPPORT_RESERVED = 1024;
enum HOST_NOT_FOUND = 1;
enum NO_DATA = 4;
enum NO_RECOVERY = 3;
enum TRY_AGAIN = 2;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
sockaddr* ai_addr;
char* ai_canonname;
addrinfo* ai_next;
}
enum AI_PASSIVE = 0x1;
enum AI_CANONNAME = 0x2;
enum AI_NUMERICHOST = 0x4;
enum AI_NUMERICSERV = 0x400;
enum AI_V4MAPPED = 0x8;
enum AI_ALL = 0x10;
enum AI_ADDRCONFIG = 0x20;
enum NI_NOFQDN = 4;
enum NI_NUMERICHOST = 1;
enum NI_NAMEREQD = 8;
enum NI_NUMERICSERV = 2;
enum NI_DGRAM = 16;
enum NI_MAXHOST = 1025; // non-standard
enum NI_MAXSERV = 32; // non-standard
enum EAI_AGAIN = -3;
enum EAI_BADFLAGS = -1;
enum EAI_FAIL = -4;
enum EAI_FAMILY = -6;
enum EAI_MEMORY = -10;
enum EAI_NONAME = -2;
enum EAI_SERVICE = -8;
enum EAI_SOCKTYPE = -7;
enum EAI_SYSTEM = -11;
enum EAI_OVERFLOW = -12;
enum EAI_NODATA = -5;
enum EAI_ADDRFAMILY = -9;
enum EAI_INPROGRESS = -100;
enum EAI_CANCELED = -101;
enum EAI_NOTCANCELED = -102;
enum EAI_ALLDONE = -103;
enum EAI_INTR = -104;
enum EAI_IDN_ENCODE = -105;
}
else
{
static assert(false, "Unsupported platform");
}
void endhostent();
void endnetent();
void endprotoent();
void endservent();
void freeaddrinfo(addrinfo*);
const(char)* gai_strerror(int);
int getaddrinfo(const(char)*, const(char)*, const(addrinfo)*, addrinfo**);
hostent* gethostbyaddr(const(void)*, socklen_t, int);
hostent* gethostbyname(const(char)*);
hostent* gethostent();
int getnameinfo(const(sockaddr)*, socklen_t, char*, socklen_t, char*, socklen_t, int);
netent* getnetbyaddr(uint32_t, int);
netent* getnetbyname(const(char)*);
netent* getnetent();
protoent* getprotobyname(const(char)*);
protoent* getprotobynumber(int);
protoent* getprotoent();
servent* getservbyname(const(char)*, const(char)*);
servent* getservbyport(int, const(char)*);
servent* getservent();
void sethostent(int);
void setnetent(int);
void setprotoent(int);
void setservent(int);
|
D
|
module deimos.surfi.callback;
private import deimos.surfi.surfi;
extern(C) {
void surfi_client_set_callback_close_web_view(SurfiClient* client,
bool function(SurfiClient* client) callback);
void surfi_client_set_callback_console_message(SurfiClient* client,
bool function(SurfiClient* client, char* message, int line, char* source_id) callback);
void surfi_client_set_callback_context_menu(SurfiClient* client,
bool function(SurfiClient* client, GtkWidget* default_menu,
WebKitHitTestResult* hit_test_result, bool triggered_with_keyboard) callback);
void surfi_client_set_callback_copy_clipboard(SurfiClient* client,
void function(SurfiClient* client) callback);
void surfi_client_set_callback_create_plugin_widget(SurfiClient* client,
void function(SurfiClient* client, char* mime_type, char* uri, GHashTable* param) callback);
void surfi_client_set_callback_create_webview(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_cut_clipboard(SurfiClient* client,
void function(SurfiClient* client) callback);
void surfi_client_set_callback_database_quota_exceeded(SurfiClient* client,
void function(SurfiClient* client, GObject* frame, GObject* database) callback);
void surfi_client_set_callback_document_load_finished(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_download_requested(SurfiClient* client,
void function(SurfiClient* client,GObject* download) callback);
void surfi_client_set_callback_editing_began(SurfiClient* client,
void function(SurfiClient* client) callback);
void surfi_client_set_callback_editing_ended(SurfiClient* client,
void function(SurfiClient* client) callback);
void surfi_client_set_callback_entering_fullscreen(SurfiClient* client,
bool function(SurfiClient* client, WebKitDOMHTMLElement* element) callback);
void surfi_client_set_callback_frame_created(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_geolocation_policy_decision_cancelled(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_geolocation_policy_decision_requested(SurfiClient* client,
bool function(SurfiClient* client, WebKitWebFrame* frame, WebKitGeolocationPolicyDecision* policy_decision) callback);
void surfi_client_set_callback_hovering_over_link(SurfiClient* client,
void function(SurfiClient* client, char* title, char* uri) callback);
void surfi_client_set_callback_icon_loaded(SurfiClient* client,
void function(SurfiClient* client, char* icon_uri) callback);
void surfi_client_set_callback_leaving_fullscreen(SurfiClient* client,
bool function(SurfiClient* client, WebKitDOMHTMLElement* element) callback);
void surfi_client_set_callback_load_commited(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_load_error(SurfiClient* client,
bool function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_load_finished(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_load_progress_changed(SurfiClient* client,
void function(SurfiClient* client, int progress) callback);
void surfi_client_set_callback_load_started(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_mime_type_policy_decision_requested(SurfiClient* client,
bool function(SurfiClient* client, WebKitWebFrame* frame, WebKitNetworkRequest* request,
char* mimetype, WebKitWebPolicyDecision* policy_decision) callback);
void surfi_client_set_callback_move_cursor(SurfiClient* client,
bool function(SurfiClient* client, GtkMovementStep step, int count) callback);
void surfi_client_set_callback_navigation_policy_decision_requested(SurfiClient* client,
bool function(SurfiClient* client, WebKitWebFrame* frame, WebKitNetworkRequest* request,
WebKitWebNavigationAction* navigation_action, WebKitWebPolicyDecision* policy_decision) callback);
void surfi_client_set_callback_navigation_requested(SurfiClient* client,
WebKitNavigationResponse function(SurfiClient* client, WebKitWebFrame* frame, WebKitNetworkRequest* request) callback);
void surfi_client_set_callback_new_window_policy_decision_requested(SurfiClient* client,
bool function(SurfiClient* client, WebKitWebFrame* frame, WebKitNetworkRequest* request,
WebKitWebNavigationAction* navigation_action, WebKitWebPolicyDecision* policy_decision) callback);
void surfi_client_set_callback_onload_event(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_paste_clipboard(SurfiClient* client,
void function(SurfiClient* client) callback);
void surfi_client_set_callback_populate_popup(SurfiClient* client,
void function(SurfiClient* client, GtkMenu* menu) callback);
void surfi_client_set_callback_print_requested(SurfiClient* client,
bool function(SurfiClient* client, WebKitWebFrame* frame) callback);
void surfi_client_set_callback_redo(SurfiClient* client,
void function(SurfiClient* client) callback);
void surfi_client_set_callback_resource_content_length_received(SurfiClient* client,
void function(SurfiClient* client, WebKitWebFrame* frame, WebKitWebResource* resource, int length) callback);
}
|
D
|
/**
* Authors: The D DBI project
* Copyright: BSD license
*/
module dbi.mysql.Mysql;
version (dbi_mysql) {
import tango.stdc.stringz : toDString = fromStringz, toCString = toStringz;
import TextUtil = tango.text.Util;
import Ascii = tango.text.Ascii;
import Integer = tango.text.convert.Integer;
import Float = tango.text.convert.Float;
import tango.time.Time;
import tango.time.chrono.Gregorian;
import tango.core.Thread;
import dbi.model.Database;
import dbi.util.DateTime, dbi.util.VirtualPrepare,
dbi.util.Registry, dbi.util.StringWriter;
import dbi.Exception;
import dbi.mysql.c.mysql;
import dbi.mysql.MysqlError, dbi.mysql.MysqlStatement,
dbi.mysql.MysqlMetadata, dbi.mysql.MysqlConvert;
debug import tango.util.log.Log;
debug(DBITest) import tango.io.Stdout;
static this() {
uint ver = mysql_get_client_version();
if(ver < 50000) {
throw new Exception("Unsupported MySQL client version. Please compile using at least version 5.0 of the MySQL client libray.");
}
else if(ver < 50100) {
if(MYSQL_VERSION != 50000) {
throw new Exception("You are linking against version 5.0 of the MySQL client library but you have a build switch turned on for a different version (such as MySQL_51).");
}
}
else {
if(MYSQL_VERSION != 50100) {
throw new Exception("You are linking against version 5.1 (or higher) of the MySQL client library so you need to use the build switch '-version=MySQL_51'.");
}
}
}
/**
* An implementation of Database for use with MySQL databases.
*
* Bugs:
* Column types aren't retrieved.
*
* See_Also:
* Database is the interface that this provides an implementation of.
*/
class Mysql : Database {
/**
* Create a new instance of MysqlDatabase, but don't connect.
*/
this () {
mysql = mysql_init(null);
writer_ = new SqlStringWriter(short.max);
}
/**
* Create a new instance of MysqlDatabase and connect to a server.
*
* See_Also:
* connect
*/
this (char[] host, char[] port, char[] dbname, char[] params) {
this();
connect(host, port, dbname, params);
}
/**
* Connect to a database on a MySQL server.
*
* Params:
* host = The host name of the database to _connect to.
* port = The port number to _connect to or null to use the default host.
* dbname = The name of the database to use.
* params = A string in the form "keyword1=value1&keyword2=value2;etc."
*
*
* Keywords:
* username = The _username to _connect with.
* password = The _password to _connect with.
* sock = The socket to _connect to.
*
* Throws:
* DBIException if there was an error connecting.
*
* DBIException if port is provided but is not an integer.
*
* Examples:
* ---
* MysqlDatabase db = new MysqlDatabase();
* db.connect("localhost", null, "test", "username=bob&password=12345");
* ---
*/
void connect(char[] host, char[] port, char[] dbname, char[] params)
{
char[] sock = null;
char[] username = null;
char[] password = null;
uint portNo = 0;
if(port.length) portNo = cast(uint)Integer.parse(port);
bool useSSL = false;
char[] sslKey, sslCert, sslCa, sslCaPath, sslCipher;
uint client_flag = CLIENT_MULTI_STATEMENTS;
void parseKeywords () {
char[][char[]] keywords = getKeywords(params, "&");
if ("username" in keywords) {
username = keywords["username"];
}
if ("password" in keywords) {
password = keywords["password"];
}
if ("sock" in keywords) {
sock = keywords["sock"];
}
if("allowMultiQueries" in keywords) {
if(keywords["allowMultiQueries"] == "false") {
client_flag &= ~CLIENT_MULTI_STATEMENTS;
allowMultiQueries = false;
}
else {
client_flag |= CLIENT_MULTI_STATEMENTS;
allowMultiQueries = true;
}
}
if("allowLoadLocalInfile" in keywords) {
if(keywords["allowLoadLocalInfile"] == "true")
client_flag |= CLIENT_LOCAL_FILES;
}
if("useCompression" in keywords) {
if(keywords["useCompression"] == "true")
client_flag |= CLIENT_COMPRESS;
}
if("useSSL" in keywords) {
if(keywords["useSSL"] == "true")
useSSL = true;
}
if ("sslKey" in keywords) {
sslKey = keywords["sslKey"];
}
if ("sslCert" in keywords) {
sslCert = keywords["sslCert"];
}
if ("sslCa" in keywords) {
sslCa = keywords["sslCa"];
}
if ("sslCaPath" in keywords) {
sslCaPath = keywords["sslCaPath"];
}
if ("sslCipher" in keywords) {
sslCipher = keywords["sslCipher"];
}
}
parseKeywords;
if(useSSL) {
mysql_ssl_set(mysql, toCString(sslKey), toCString(sslCert), toCString(sslCa),
toCString(sslCaPath), toCString(sslCipher));
}
mysql_real_connect(mysql, toCString(host), toCString(username), toCString(password), toCString(dbname), portNo, toCString(sock), client_flag);
if (uint error = mysql_errno(mysql)) {
debug log.error("connect(): {}", toDString(mysql_error(mysql)));
throw new DBIException("Unable to connect to the MySQL database.", error, specificToGeneral(error));
}
}
bool enabled(DbiFeature feature)
{
switch(feature)
{
case DbiFeature.MultiStatements: return allowMultiQueries;
default: return false;
}
}
private bool allowMultiQueries = true;
/**
* Close the current connection to the database.
*
* Throws:
* DBIException if there was an error disconnecting.
*/
override void close () {
debug log.trace("Closing: checking for null handle");
if (mysql !is null) {
debug log.trace("Closing database: handle isn't null");
// closeResult;
mysql_close(mysql);
if (uint error = mysql_errno(mysql)) {
debug log.error("close(): {}", toDString(mysql_error(mysql)));
throw new DBIException("Unable to close the MySQL database.", error, specificToGeneral(error));
}
scope(exit) mysql = null;
}
mysqlSqlGen = null;
}
MysqlStatement doPrepare(char[] sql)
{
MYSQL_STMT* stmt = mysql_stmt_init(mysql);
auto res = mysql_stmt_prepare(stmt, sql.ptr, sql.length);
if(res != 0) {
debug {
auto err = mysql_stmt_error(stmt);
log.error("Unable to create prepared statement: \"" ~ sql ~"\", errmsg: " ~ toDString(err));
}
auto errno = mysql_stmt_errno(stmt);
auto dErr = toDString(mysql_stmt_error(stmt));
throw new DBIException("Unable to prepare statement: " ~ dErr, sql, errno, specificToGeneral(errno));
}
return new MysqlStatement(stmt,sql);
}
void initQuery(in char[] sql, bool haveParams)
{
sql_ = sql;
if(haveParams) {
writeFiber_ = new Fiber(&virtualPrepare);
writeFiber_.call;
}
}
void initInsert(char[] tablename, char[][] fields)
{
sql_ = "Generating INSERT sql for " ~ tablename;
tablename_ = tablename;
fieldnames_ = fields;
writeFiber_ = new Fiber(&writeInsert);
writeFiber_.call;
}
void initUpdate(char[] tablename, char[][] fields, char[] where)
{
sql_ = "Generating UPDATE sql for " ~ tablename;
tablename_ = tablename;
fieldnames_ = fields;
where_ = where;
writeFiber_ = new Fiber(&writeUpdate);
writeFiber_.call;
}
void initSelect(char[] tablename, char[][] fields, char[] where, bool haveParams)
{
prepWriterForNewStatement;
writer_ ~= "SELECT ";
foreach(fieldname; fields)
{
writer_ ~= "`";
writer_ ~= fieldname;
writer_ ~= "`,";
}
writer_.backup;
writer_ ~= " FROM `";
writer_ ~= tablename;
writer_ ~= "` ";
if(haveParams) {
where_ = where;
sql_ = writer_.get;
writeFiber_ = new Fiber(&writeWhereClause);
writeFiber_.call;
}
else {
writer_ ~= where;
sql_ = writer_.get;
}
}
void initRemove(char[] tablename, char[] where, bool haveParams)
{
prepWriterForNewStatement;
writer_ ~= "DELETE FROM `";
writer_ ~= tablename;
writer_ ~= "` ";
if(haveParams) {
where_ = where;
sql_ = writer_.get;
writeFiber_ = new Fiber(&writeWhereClause);
writeFiber_.call;
}
else {
writer_ ~= where;
sql_ = writer_.get;
}
}
void doQuery()
{
scope(exit) multiWriteState_ = MultiWriteState.Off;
if(writeFiber_) if(writeFiber_) finishWriteFiber;
debug log.trace("Querying with sql: {}", sql_);
int error = mysql_real_query(mysql, sql_.ptr, sql_.length);
if (error) {
throw new DBIException("mysql_real_query error: " ~ toDString(mysql_error(mysql)), sql_, error, specificToGeneral(error));
}
result_ = mysql_store_result(mysql);
getMysqlFieldInfo;
}
private Fiber writeFiber_;
private char[] sql_;
private char[] tablename_;
private char[] where_;
private char[][] fieldnames_;
private SqlStringWriter writer_;
private void virtualPrepare()
{
assert(sql_.length);
prepWriterForNewStatement;
auto paramIndices = getParamIndices(sql_);
size_t writerIdx = 0;
Fiber.yield;
foreach(idx; paramIndices)
{
writer_ ~= sql_[writerIdx .. idx];
writerIdx = idx + 1;
Fiber.yield;
}
writer_ ~= sql_[writerIdx .. $];
sql_ = writer_.get;
}
private void writeInsert()
{
prepWriterForNewStatement;
assert(tablename_.length && fieldnames_.length);
writer_ ~= "INSERT INTO `" ~ tablename_ ~ "` (";
foreach(fieldname; fieldnames_)
{
writer_ ~= "`" ~ fieldname ~ "`,";
}
writer_.backup;
writer_ ~= ") VALUES(";
Fiber.yield;
auto n = fieldnames_.length;
for(uint i = 0; i < n - 1; ++i)
{
Fiber.yield;
writer_ ~= ",";
}
Fiber.yield;
writer_ ~= ")";
sql_ = writer_.get;
tablename_ = null;
fieldnames_ = null;
}
private void finishWriteFiber() {
assert(writeFiber_ !is null);
assert(writeFiber_.state == Fiber.State.HOLD, "Param index out of bounds, sql: " ~ sql_);
writeFiber_.call;
assert(writeFiber_.state == Fiber.State.TERM, "Param index out of bounds, sql: " ~ sql_);
writeFiber_ = null;
}
private void prepWriterForNewStatement()
{
if(multiWriteState_ == MultiWriteState.Off) writer_.reset;
else if(multiWriteState_ == MultiWriteState.On) {
if(writeFiber_) finishWriteFiber;
writer_ ~= ";";
}
else {
assert(multiWriteState_ == MultiWriteState.First);
writer_.reset;
multiWriteState_ = MultiWriteState.On;
}
}
private void writeUpdate()
{
prepWriterForNewStatement;
assert(tablename_.length && fieldnames_.length && where_.length);
writer_ ~= "UPDATE `" ~ tablename_ ~ "` SET ";
Fiber.yield;
foreach(fieldname; fieldnames_)
{
writer_ ~= "`" ~ fieldname ~ "` = ";
Fiber.yield;
writer_ ~= ",";
}
writer_.backup;
writer_ ~= " ";
auto paramIndices = getParamIndices(where_);
size_t writerIdx = 0;
foreach(idx; paramIndices)
{
writer_ ~= where_[writerIdx .. idx];
writerIdx = idx + 1;
Fiber.yield;
}
writer_ ~= where_[writerIdx .. $];
sql_ = writer_.get;
tablename_ = null;
fieldnames_ = null;
where_ = null;
}
private void writeWhereClause()
{
assert(where_.length);
auto paramIndices = getParamIndices(where_);
size_t writerIdx = 0;
foreach(idx; paramIndices)
{
writer_ ~= where_[writerIdx .. idx];
writerIdx = idx + 1;
Fiber.yield;
}
writer_ ~= where_[writerIdx .. $];
Fiber.yield;
sql_ = writer_.get;
where_ = null;
}
private void stepWrite_()
{
assert(writeFiber_ !is null && writeFiber_.state == Fiber.State.HOLD,
"Param index out of bounds, sql: " ~ sql_);
writeFiber_.call;
}
void setParam(bool val) { stepWrite_; if(val) writer_ ~= "1"; else writer_ ~= "0"; }
void setParam(ubyte val)
{ stepWrite_; char[3] buf; writer_ ~= Integer.format(buf,val); }
void setParam(byte val)
{ stepWrite_; char[4] buf; writer_ ~= Integer.format(buf,val); }
void setParam(ushort val)
{ stepWrite_; char[5] buf; writer_ ~= Integer.format(buf,val); }
void setParam(short val)
{ stepWrite_; char[6] buf; writer_ ~= Integer.format(buf,val); }
void setParam(uint val)
{ stepWrite_; char[10] buf; writer_ ~= Integer.format(buf,val); }
void setParam(int val)
{ stepWrite_; char[11] buf; writer_ ~= Integer.format(buf,val); }
void setParam(ulong val)
{ stepWrite_; char[20] buf; writer_ ~= Integer.format(buf,val); }
void setParam(long val)
{ stepWrite_; char[21] buf; writer_ ~= Integer.format(buf,val); }
void setParam(float val)
{ stepWrite_; char[100] buf; writer_ ~= Float.format(buf,val,10,0); }
void setParam(double val)
{ stepWrite_; char[150] buf; writer_ ~= Float.format(buf,val,20,0); }
void setParam(char[] val)
{
stepWrite_;
writer_ ~= "\'";
writer_.write(val.length * 2 + 1, (void[] buf) {
debug assert(buf.length >= val.length * 2 + 1);
return mysql_real_escape_string(mysql, cast(char*)buf.ptr, val.ptr, val.length);
});
//writer_.forwardAdvance(resLen);
writer_ ~= "\'";
}
void setParam(ubyte[] val) { setParam(cast(char[])val); }
void setParam(Time val)
{
DateTime dateTime;
Gregorian.generic.split(val, dateTime.date.year, dateTime.date.month,
dateTime.date.day, dateTime.date.doy, dateTime.date.dow, dateTime.date.era);
dateTime.time = val.time;
setParam(dateTime);
}
void setParam(DateTime val)
{
stepWrite_;
writer_ ~= "\'";
auto res = writer_.getWriteBuffer(19);
printDateTime(val, res);
writer_ ~= "\'";
}
void setParamNull() { writer_ ~= "NULL"; }
bool startWritingMultipleStatements()
{
if(multiWriteState_ != MultiWriteState.Off) throw new DBIException("Cannot call "
"startWritingMultipleStatements for database Mysql at this time - "
"command out of order - looks like you already called this before committing "
"the last query. startWritingMultipleStatements is on until the query is executed.",
sql_);
multiWriteState_ = MultiWriteState.First;
return true;
}
bool isWritingMultipleStatements()
{
return multiWriteState_ != MultiWriteState.Off ? true : false;
}
ulong lastInsertID()
{
return mysql_insert_id(mysql);
}
alias MysqlStatement StatementT;
void startTransaction()
{
const char[] sql = "START TRANSACTION";
mysql_real_query(mysql, sql.ptr, sql.length);
}
void rollback()
{
mysql_rollback(mysql);
}
void commit()
{
mysql_commit(mysql);
}
char[] escapeString(char[] str, char[] dst = null)
{
/+assert(dst.length >= 2 * str.length + 1, "Destination string length "
"must be at least 2 * source string length + 1");+/
if(dst.length < str.length * 2 + 1)
dst.length = str.length *2 + 1;
auto len = mysql_real_escape_string(mysql, dst.ptr, str.ptr, str.length);
return dst[0..len];
}
bool hasTable(char[] tablename)
{
MYSQL_RES* res = mysql_list_tables(mysql, toCString(tablename));
scope(exit) mysql_free_result(res);
if(!res) {
debug(Log) {
log.warn("mysql_list_tables returned null in method tableExists()");
logError;
}
return false;
}
bool exists = mysql_fetch_row(res) ? true : false;
return exists;
}
ColumnInfo[] getTableInfo(char[] tablename)
{
query("SHOW COLUMNS FROM `" ~ tablename ~ "`");
ColumnInfo[] info;
while(this.nextRow) {
ColumnInfo col;
char[] buf;
getField(col.name, 0);
getField(buf,3);
if(buf == "PRI") col.primaryKey = true;
getField(buf, 1);
col.type = typeToBindType(buf);
info ~= col;
}
closeResult;
return info;
}
private BindType typeToBindType(char[] type)
{
if(Ascii.isearch(type, "varchar") != type.length)
{
return BindType.String;
}
else if(Ascii.isearch(type, "int") != type.length)
{
return Ascii.isearch(type, "unsigned") == type.length ? BindType.Int : BindType.UInt;
}
else if(Ascii.isearch(type, "blob") != type.length)
{
return BindType.Binary;
}
else
return BindType.Null;
}
char[] type() { return "Mysql"; }
debug
{
static Logger log;
static this()
{
log = Log.lookup("dbi.mysql.MysqlDatabase");
}
private void logError()
{
char* err = mysql_error(mysql);
log.error(toDString(err));
}
}
override SqlGenerator getSqlGenerator()
{
if(mysqlSqlGen is null)
mysqlSqlGen = new MysqlSqlGenerator(mysql);
return mysqlSqlGen;
}
MYSQL* handle() { return mysql; }
bool moreResults()
{
return cast(bool)mysql_more_results(mysql);
}
bool nextResult()
{
if (result_ !is null) {
mysql_free_result(result_);
}
rowMetadata_ = null;
auto res = mysql_next_result(mysql);
if (res == 0) {
result_ = mysql_store_result(mysql);
getMysqlFieldInfo;
return true;
}
else if(res < 0) return false;
else {
throw new DBIException("Failed to retrieve next result set.");
}
}
bool validResult() { return result_ !is null; }
void closeResult()
{
int res = 0;
while(res == 0) {
if (result_ !is null) {
mysql_free_result(result_);
result_ = null;
}
res = mysql_next_result(mysql);
}
}
MYSQL_FIELD[] getMysqlFieldInfo()
{
if(result_ is null) return null;
auto len = mysql_num_fields(result_);
fields_ = mysql_fetch_fields(result_)[0..len];
return fields_;
}
FieldInfo[] rowMetadata()
{
if(result_ is null) return null;
if(!fields_.length) getMysqlFieldInfo;
rowMetadata_ = getFieldMetadata(fields_);
return rowMetadata_;
}
FieldInfo rowMetadata(size_t idx)
{
if(rowMetadata_ is null) rowMetadata;
assert(idx < rowMetadata_.length);
return rowMetadata_[idx];
}
ulong rowCount() { return mysql_num_rows(result_); }
ulong fieldCount() { return mysql_num_fields(result_); }
ulong affectedRows() { return mysql_affected_rows(mysql); }
bool nextRow()
{
if(result_ is null) return false;
curRow_ = mysql_fetch_row(result_);
if(curRow_ is null) return false;
curLengths_ = mysql_fetch_lengths(result_);
return true;
}
bool getField(inout bool val, size_t idx) { return bindField(val, idx); }
bool getField(inout ubyte val, size_t idx) { return bindField(val, idx); }
bool getField(inout byte val, size_t idx) { return bindField(val, idx); }
bool getField(inout ushort val, size_t idx) { return bindField(val, idx); }
bool getField(inout short val, size_t idx) { return bindField(val, idx); }
bool getField(inout uint val, size_t idx) { return bindField(val, idx); }
bool getField(inout int val, size_t idx) { return bindField(val, idx); }
bool getField(inout ulong val, size_t idx) { return bindField(val, idx); }
bool getField(inout long val, size_t idx) { return bindField(val, idx); }
bool getField(inout float val, size_t idx) { return bindField(val, idx); }
bool getField(inout double val, size_t idx) { return bindField(val, idx); }
bool getField(inout char[] val, size_t idx) { return bindField(val, idx); }
bool getField(inout ubyte[] val, size_t idx) { return bindField(val, idx); }
bool getField(inout Time val, size_t idx) { return bindField(val, idx); }
bool getField(inout DateTime val, size_t idx) { return bindField(val, idx); }
bool bindField(Type)(inout Type val, size_t idx)
{
if(curRow_ is null) return false;
if(fields_.length <= idx || curRow_[idx] is null) return false;
/+debug log.trace("Binding Mysql res field #{}, type {}, length {}, val {}",
idx, fields_[idx].type, curLengths_[idx], curRow_[idx][0..curLengths_[idx]]);+/
bindMysqlResField(curRow_[idx][0..curLengths_[idx]],fields_[idx].type, val);
return true;
}
SqlStringWriter buffer() { return writer_; }
void buffer(SqlStringWriter writer) { writer_ = writer; }
debug(DBITest) {
override void doTests()
{
Stdout.formatln("Beginning Mysql Tests");
Stdout.formatln("Testing Mysql");
auto test = new DBTest(this);
test.run;
}
}
package:
MYSQL* mysql;
private:
MYSQL_RES* result_ = null;
MYSQL_ROW curRow_ = null;
MYSQL_FIELD[] fields_;
uint* curLengths_ = null;
FieldInfo[] rowMetadata_;
enum MultiWriteState { Off, First, On };
MultiWriteState multiWriteState_ = MultiWriteState.Off;
MysqlSqlGenerator mysqlSqlGen;
}
class MysqlSqlGenerator : SqlGenerator
{
this(MYSQL* mysql)
{
this.mysql = mysql;
}
private MYSQL* mysql;
override char identifierQuoteChar()
{
return '`';
}
char[] toNativeType(ColumnInfo info)
{
char[] getTextBlobPrefix(uint limit)
{
if(limit <= ubyte.max) return "TINY";
else if(limit <= ushort.max) return "";
else if(limit <= 0x1000000) return "MEDIUM";
else if(limit <= uint.max) return "LONG";
}
with(BindType)
{
switch(info.type)
{
case Bool: return "TINYINT(1)";
case Byte: return "TINYINT";
case UByte: return "TINYINT UNSIGNED";
case Short: return "SMALLINT";
case UShort: return "SMALLINT UNSIGNED";
case Int: return "INT";
case UInt: return "INT UNSIGNED";
case Long: return "BIGINT";
case ULong: return "BIGINT UNSIGNED";
case Float: return "FLOAT";
case Double: return "DOUBLE";
case String:
if(info.limit == 0) return "TINYTEXT";
else if(info.limit <= 255) return "VARCHAR(" ~ Integer.toString(info.limit) ~ ")";
else return getTextBlobPrefix(info.limit) ~ "TEXT";
case Binary:
if(info.limit == 0) return "TINYBLOB";
if(info.limit <= 255) return "VARBINARY(" ~ Integer.toString(info.limit) ~ ")";
else return getTextBlobPrefix(info.limit) ~ "BLOB";
break;
case Time:
case DateTime:
return "DATETIME";
break;
case Null:
debug assert(false, "Unhandled column type"); //TODO more detailed information;
break;
default:
debug assert(false, "Unhandled column type"); //TODO more detailed information;
break;
}
}
}
}
private class MysqlRegister : IRegisterable {
static this() {
debug(DBITest) Stdout("Attempting to register MysqlDatabase in Registry").newline;
registerDatabase(new MysqlRegister());
}
public char[] getPrefix() {
return "mysql";
}
/**
* Supports urls of the form mysql://[hostname][:port]/[dbname][?param1][=value1][¶m2][=value2]...
*
* Note: Does not support failoverhost's as in the MySQL JDBC spec. Not all parameters
* are supported - see the connect method for supported parameters.
*
*/
public Database getInstance(char[] url) {
char[] host = "127.0.0.1";
char[] port, dbname, params;
auto fields = TextUtil.delimit(url, "/");
if(fields.length) {
auto fields1 = TextUtil.delimit(fields[0], ":");
if(fields1.length) {
if(fields1[0].length) host = fields1[0];
if(fields1.length > 1 && fields1[1].length) port = fields1[1];
}
if(fields.length > 1) {
auto fields2 = TextUtil.delimit(fields[1], "?");
if(fields2.length) {
dbname = fields2[0];
if(fields2.length > 1) params = fields2[1];
}
}
}
return new Mysql(host, port, dbname, params);
}
}
debug(DBITest) {
import tango.util.log.Config;
//import tango.time.Clock;
import dbi.util.DateTime;
import dbi.ErrorCode;
unittest
{
try
{
auto db = new Mysql("localhost", null, "test", "username=test&password=test");
db.test();
db.close;
}
catch(DBIException ex)
{
Stdout.formatln("Caught DBIException: {}, DBI Code:{}, DB Code:{}, Sql: {}", ex.toString, toString(ex.getErrorCode), ex.getSpecificCode, ex.getSql);
throw ex;
}
}
}
}
|
D
|
module raft.Storage;
import protocol.Msg;
import zhang2018.common.Log;
import raft.Util;
enum ErrCompacted = "requested index is unavailable due to compaction";
enum ErrSnapOutOfDate = "requested index is older than the existing snapshot";
enum ErrUnavailable = "requested entry at index is unavailable";
enum ErrSnapshotTemporarilyUnavailable = "snapshot is temporarily unavailable";
enum ErrNil = string.init;
alias ErrString = string;
interface Storage
{
ErrString InitalState(out HardState hs , out ConfState cs);
ErrString Entries(ulong lo , ulong hi , ulong maxSize ,out Entry []entries);
ErrString Term(ulong i , out ulong term);
ErrString LastIndex(out ulong index);
ErrString FirstIndex(out ulong index);
ErrString GetSnap(out Snapshot ss);
}
class MemoryStorage : Storage
{
HardState _hs;
Snapshot _ss;
Entry[] _ents;
this()
{
_ents.length = 1;
}
ErrString InitalState(out HardState hs , out ConfState cs)
{
hs = _hs;
cs = _ss.Metadata.CS;
return ErrNil;
}
ErrString setHadrdState(in ref HardState hs)
{
_hs = hs;
return ErrNil;
}
ErrString Entries(ulong lo , ulong hi , ulong maxSize , out Entry []entries)
{
ulong offset = _ents[0].Index;
if( lo <= offset)
return ErrCompacted;
if( hi > lastIndex() + 1 )
log_error("entries' hi(" , hi , ") is out of bound lastindex(" , lastIndex() , ")");
if (_ents.length == 1)
return ErrUnavailable;
entries = _ents[ cast(uint)(lo - offset) .. cast(uint)(hi - offset) ];
entries = limitSize(entries ,maxSize);
return ErrNil;
}
ErrString Term(ulong i , out ulong term)
{
ulong offset = _ents[0].Index;
term = 0;
if ( i < offset)
return ErrCompacted;
if (i - offset >= _ents.length)
return ErrUnavailable;
term = _ents[ cast(uint)(i - offset)].Term;
return ErrNil;
}
ErrString LastIndex(out ulong last)
{
last = lastIndex();
return ErrNil;
}
ulong lastIndex()
{
return _ents[0].Index + _ents.length - 1;
}
ErrString FirstIndex(out ulong first)
{
first = firstIndex();
return ErrNil;
}
ulong firstIndex()
{
return _ents[0].Index + 1;
}
ErrString GetSnap(out Snapshot ss)
{
ss = _ss;
return ErrNil;
}
ErrString ApplySnapshot( Snapshot snap)
{
auto Index = _ss.Metadata.Index;
auto snapIndex = snap.Metadata.Index;
if (Index >= snapIndex)
return ErrSnapOutOfDate;
_ss = snap;
Entry ent = { Term: snap.Metadata.Term ,Index:snap.Metadata.Index};
_ents.length = 0;
_ents ~= ent;
return ErrNil;
}
ErrString CreateSnapshot(ulong i , ConfState *cs , string data ,out Snapshot snap)
{
if( i <= _ss.Metadata.Index)
return ErrSnapOutOfDate;
auto offset = _ents[0].Index;
if ( i > lastIndex())
log_error("snapshot " , i , "is out of bound lastindex(" , lastIndex() , ")");
_ss.Metadata.Index = i;
_ss.Metadata.Term = _ents[cast(uint)(i - offset)].Term;
if( cs != null)
_ss.Metadata.CS = *cs;
_ss.Data = data;
snap = _ss;
return ErrNil;
}
ErrString Compact(ulong compactIndex)
{
auto offset = _ents[0].Index;
if(compactIndex <= offset)
return ErrCompacted;
if(compactIndex > lastIndex())
log_error("compact ", compactIndex ," is out of bound lastindex(" , lastIndex() , ")");
uint i = cast(uint)(compactIndex - offset);
Entry[] ents;
ents.length = 1;
ents[0].Index = _ents[i].Index;
ents[0].Term = _ents[i].Term;
ents ~= _ents[i+1 .. $];
_ents = ents;
return ErrNil;
}
ErrString Append(Entry[] entries)
{
if (entries.length == 0)
return ErrNil;
auto first = firstIndex();
auto last = entries[0].Index + entries.length -1;
if( last < first)
return ErrNil;
if(first > entries[0].Index)
entries = entries[cast(uint)(first - entries[0].Index) .. $];
auto offset = entries[0].Index - _ents[0].Index;
if(_ents.length > offset)
{
_ents = _ents[0 .. cast(uint)offset];
_ents ~= entries;
}
else if(_ents.length == offset)
{
_ents ~= entries;
}
else{
log_error("missing log entry [last:" ,lastIndex() ,
", append at: " , entries[0].Index , "]");
}
return ErrNil;
}
}
|
D
|
/**
* Copyright: Copyright (c) 2011 Jacob Carlborg. All rights reserved.
* Authors: Jacob Carlborg
* Version: Initial created: Jan 16, 2011
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
*/
module dvm.dvm.Wrapper;
import std.format : format;
import dvm.dvm.ShellScript;
import dvm.io.Path;
struct Wrapper
{
string path;
string target;
private ShellScript sh;
static Wrapper opCall (string path = "", string target = "")
{
Wrapper wrapper;
wrapper.path = path;
wrapper.target = target;
return wrapper;
}
void write ()
{
createContent;
sh.path = path;
sh.write;
}
private void createContent ()
{
native(path.toMutable);
native(target.toMutable);
sh = new ShellScript(path);
auto dmd = "dmd";
auto dmdPath = Sh.quote(target);
sh.shebang;
sh.echoOff;
sh.nl;
sh.ifFileIsNotEmpty(dmdPath, {
sh.exec(dmdPath, Sh.allArgs);
}, {
sh.printError(format(`Missing target: "%s"`, target), true);
});
}
}
private:
T[] toMutable (T) (const(T)[] array)
{
return cast(T[]) array;
}
|
D
|
module srl.MainForm;
private import std.stdio;
private import dfl.all;
private import srl.IView;
private import srl.Model;
private import srl.OutputType;
public class MainForm : Form, IView {
private Model model;
private Panel titlePanel;
private Panel mainPanel;
private Panel paddingUpperPanel;
private Panel paddingLowerPanel;
private Label notationLabel;
private TextBox outputTextBox;
private Button runButton;
private Button stopButton;
private Timer stdOutTimer;
private Timer stdErrTimer;
public this(Model model) {
this.model = model;
model.view = this;
Font createFont(float size) {
return new Font("Georgia", size,
FontStyle.REGULAR, GraphicsUnit.POINT, FontSmoothing.ON);
}
this.suspendLayout();
with (this) {
allowDrop = true;
clientSize = Size(640, 480);
startPosition = FormStartPosition.CENTER_SCREEN;
text = "Star Ruby Launcher";
}
with (this.titlePanel = new Panel()) {
backColor = Color(0xff, 0x99, 0x33, 0x33);
parent = this;
}
Label titleLabel;
with (titleLabel = new Label()) {
autoSize = true;
font = createFont(30f);
foreColor = Color(0xff, 0xff, 0xff, 0xff);
location = Point(30, 15);
parent = this.titlePanel;
text = "Star Ruby Launcher";
}
with (this.paddingUpperPanel = new Panel()) {
backColor = Color(0xff, 0xdd, 0xcc, 0xcc);
parent = this;
}
with (this.mainPanel = new Panel()) {
backColor = Color(0xff, 0xff, 0xff, 0xff);
parent = this;
}
with (this.notationLabel = new Label()) {
autoSize = true;
font = createFont(20f);
foreColor = Color(0xff, 0x33, 0x22, 0x22);
location = Point(30, 15);
parent = this.mainPanel;
}
with (this.outputTextBox = new TextBox()) {
multiline = true;
parent = this.mainPanel;
readOnly = true;
scrollBars = ScrollBars.VERTICAL;
}
with (this.runButton = new Button()) {
text = "Run";
parent = this.mainPanel;
click ~= &this.runButton_click;
}
with (this.stopButton = new Button()) {
text = "Stop";
parent = this.mainPanel;
click ~= &this.stopButton_click;
}
with (this.paddingLowerPanel = new Panel()) {
backColor = Color(0xff, 0xdd, 0xcc, 0xcc);
parent = this;
}
with (this.stdOutTimer = new Timer()) {
enabled = false;
interval = 20;
tick ~= &this.outputTimer_tick!(OutputType.STD_OUT);
}
with (this.stdErrTimer = new Timer()) {
enabled = false;
interval = 20;
tick ~= &this.outputTimer_tick!(OutputType.STD_ERR);
}
this.updateView();
this.resumeLayout(false);
}
public void updateView() {
assert(this.notationLabel);
assert(this.runButton);
assert(this.stopButton);
assert(this.stdOutTimer);
assert(this.stdErrTimer);
string newText;
if (this.model.fileName) {
newText = std.path.getBaseName(this.model.fileName);
} else {
newText = "Drag and Drop your Ruby script here!";
}
if (this.notationLabel.text != newText) {
this.notationLabel.text = newText;
}
if (this.model.fileName) {
this.runButton.enabled = !this.model.isGameRunning;
this.stopButton.enabled = this.model.isGameRunning;
} else {
this.runButton.enabled = false;
this.stopButton.enabled = false;
}
this.stdOutTimer.enabled = this.model.isGameRunning;
this.stdErrTimer.enabled = this.model.isGameRunning;
}
protected override void onDragEnter(DragEventArgs e) {
super.onDragEnter(e);
this.doDragEvent(e);
}
protected override void onDragOver(DragEventArgs e) {
super.onDragEnter(e);
this.doDragEvent(e);
}
private void doDragEvent(DragEventArgs e) {
assert(e.data);
if (e.data.getDataPresent(DataFormats.fileDrop)) {
Data data = e.data.getData(DataFormats.fileDrop, false);
string[] fileNames = data.getStrings();
if (0 < fileNames.length) {
string fileName = fileNames[0];
if (this.model.isAcceptableFileName(fileName)) {
e.effect = e.allowedEffect & DragDropEffects.MOVE;
}
}
}
}
protected override void onDragDrop(DragEventArgs e) {
super.onDragDrop(e);
assert(e.data);
assert(e.data.getDataPresent(DataFormats.fileDrop));
Data data = e.data.getData(DataFormats.fileDrop, false);
string[] fileNames = data.getStrings();
assert(0 < fileNames.length);
string fileName = fileNames[0];
assert(this.model.isAcceptableFileName(fileName));
this.model.fileName = fileName;
}
protected override void onLayout(LayoutEventArgs e) {
super.onLayout(e);
Rect rect;
with (rect) {
x = 0;
y = 0;
width = this.clientSize.width;
height = 80;
}
this.titlePanel.bounds = rect;
with (rect) {
y += height;
height = 30;
}
this.paddingUpperPanel.bounds = rect;
with (rect) {
y += height;
height = this.clientSize.height - y - 30;
}
this.mainPanel.bounds = rect;
with (rect) {
y += height;
height = this.clientSize.height - y;
}
this.paddingLowerPanel.bounds = rect;
with (rect) {
Size parentSize = this.outputTextBox.parent.clientSize;
x = 20;
y = this.notationLabel.bounds.bottom + 20;
width = parentSize.width - 40;
height = parentSize.height - y - 80;
}
this.outputTextBox.bounds = rect;
with (rect) {
Size parentSize = this.runButton.parent.clientSize;
x = 20;
width = parentSize.width / 2 - cast(int)(x * 1.5);
height = 40;
y = parentSize.height - height - 20;
}
this.runButton.bounds = rect;
with (rect) {
x += width + 20;
}
this.stopButton.bounds = rect;
}
private void runButton_click(Control control, EventArgs e) {
assert(this.model.fileName);
assert(!this.model.isGameRunning);
this.outputTextBox.clear();
this.model.runGame();
}
private void stopButton_click(Control control, EventArgs e) {
assert(this.model.fileName);
assert(this.model.isGameRunning);
this.model.stopGame();
}
private string[OutputType] previousTexts;
private void outputTimer_tick(OutputType ot)(Timer serder, EventArgs e) {
assert(this.model.isGameRunning);
if (!(ot in this.previousTexts)) {
this.previousTexts[ot] = "";
}
byte[4096] buffer;
size_t size;
for(int i = 0;
0 < (size = this.model.readAsyncGame!(ot)(buffer)) && i < 5;
i++) {
string text = this.previousTexts[ot] ~ cast(char[])buffer[0 .. size];
this.previousTexts[ot] = this.outputLine(text);
}
if (!this.model.isGameRunning) {
this.outputLine(this.previousTexts[ot], false);
}
}
private char[] outputLine(string text, bool cutTail = true) {
if (this.outputTextBox.maxLength < text.length) {
text = text[($ - this.outputTextBox.maxLength) .. $];
}
string restText = "";
string outputText = text.dup;
for (int i = 0; i < text.length; i++) {
byte b = cast(byte)text[i];
if ((b & 0b_1111_1000) == 0b_1111_0000) {
if (i + 3 < text.length) {
if ((cast(byte)text[i + 1] & 0b_1100_0000) == 0b_1000_0000 &&
(cast(byte)text[i + 2] & 0b_1100_0000) == 0b_1000_0000 &&
(cast(byte)text[i + 3] & 0b_1100_0000) == 0b_1000_0000) {
i += 3;
} else {
outputText[i] = '?';
}
} else {
if (cutTail) {
outputText.length = i;
restText = text[i .. $].dup;
} else {
int l = text.length - i;
outputText[i .. (i + l)] = '?';
}
break;
}
} else if ((b & 0b_1111_0000) == 0b_1110_0000) {
if (i + 2 < text.length) {
if ((cast(byte)text[i + 1] & 0b_1100_0000) == 0b_1000_0000 &&
(cast(byte)text[i + 2] & 0b_1100_0000) == 0b_1000_0000) {
i += 2;
} else {
outputText[i] = '?';
}
} else {
if (cutTail) {
outputText.length = i;
restText = text[i .. $].dup;
} else {
int l = text.length - i;
outputText[i .. (i + l)] = '?';
}
break;
}
} else if ((b & 0b_1110_0000) == 0b_1100_0000) {
if (i + 1 < text.length) {
if ((cast(byte)text[i + 1] & 0b_1100_0000) == 0b_1000_0000) {
i += 1;
} else {
outputText[i] = '?';
}
} else {
if (cutTail) {
outputText.length = i;
restText = text[i .. $].dup;
} else {
int l = text.length - i;
outputText[i .. (i + l)] = '?';
}
break;
}
} else if ((b & 0b_1000_0000) == 0b_0000_0000) {
// do nothing
} else {
outputText[i] = '?';
}
}
this.outputTextBox.appendText(outputText);
this.outputTextBox.scrollToCaret();
return restText;
}
}
|
D
|
instance MENU_LOG(C_MENU_DEF)
{
items[0] = "MENU_ITEM_SEL_MISSIONS_ACT";
items[1] = "MENU_ITEM_SEL_MISSIONS_OLD";
items[2] = "MENU_ITEM_SEL_MISSIONS_FAILED";
items[3] = "MENU_ITEM_SEL_LOG";
items[4] = "MENU_ITEM_DAY_TITLE";
items[5] = "MENU_ITEM_TIME_TITLE";
items[6] = "MENU_ITEM_DAY";
items[7] = "MENU_ITEM_TIME";
items[8] = "MENU_ITEM_LIST_MISSIONS_ACT";
items[9] = "MENU_ITEM_LIST_MISSIONS_FAILED";
items[10] = "MENU_ITEM_LIST_MISSIONS_OLD";
items[11] = "MENU_ITEM_LIST_LOG";
items[12] = "MENU_ITEM_CONTENT_VIEWER";
alpha = 255;
posx = 0;
posy = 0;
dimx = 8191;
dimy = 8191;
backPic = LOG_BACK_PIC;
flags = flags | MENU_OVERTOP | MENU_NOANI;
};
const int LOG_ITEM_X1 = 1200;
const int LOG_ITEM_DX1 = 1800;
const int LOG_ITEM_LIST_X = 3000;
const int LOG_ITEM_LIST_Y = 1000;
const int LOG_ITEM_LIST_HEIGHT = 6100;
const int LOG_ITEM_LIST_WIDTH = 4500;
instance MENU_ITEM_SEL_MISSIONS_ACT(C_MENU_ITEM_DEF)
{
text[0] = "Stávající\núkoly";
posx = LOG_ITEM_X1;
posy = 1500;
dimx = LOG_ITEM_DX1;
dimy = 1000;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_SELECTABLE | IT_MULTILINE | IT_TXT_CENTER;
onselaction[0] = SEL_ACTION_EXECCOMMANDS;
onselaction_s[0] = "EFFECTS MENU_ITEM_LIST_MISSIONS_ACT";
};
instance MENU_ITEM_SEL_MISSIONS_OLD(C_MENU_ITEM_DEF)
{
text[0] = "Splněné\núkoly";
posx = LOG_ITEM_X1;
posy = 2500;
dimx = LOG_ITEM_DX1;
dimy = 1000;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_SELECTABLE | IT_MULTILINE | IT_TXT_CENTER;
onselaction[0] = SEL_ACTION_EXECCOMMANDS;
onselaction_s[0] = "EFFECTS MENU_ITEM_LIST_MISSIONS_OLD";
};
instance MENU_ITEM_SEL_MISSIONS_FAILED(C_MENU_ITEM_DEF)
{
text[0] = "Nesplněné\núkoly";
posx = LOG_ITEM_X1;
posy = 3500;
dimx = LOG_ITEM_DX1;
dimy = 1000;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_SELECTABLE | IT_MULTILINE | IT_TXT_CENTER;
onselaction[0] = SEL_ACTION_EXECCOMMANDS;
onselaction_s[0] = "EFFECTS MENU_ITEM_LIST_MISSIONS_FAILED";
};
instance MENU_ITEM_SEL_LOG(C_MENU_ITEM_DEF)
{
text[0] = "Všeobecné\ninformace";
posx = LOG_ITEM_X1;
posy = 4500;
dimx = LOG_ITEM_DX1;
dimy = 1000;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_SELECTABLE | IT_MULTILINE | IT_TXT_CENTER;
onselaction[0] = SEL_ACTION_EXECCOMMANDS;
onselaction_s[0] = "EFFECTS MENU_ITEM_LIST_LOG";
};
instance MENU_ITEM_LIST_MISSIONS_ACT(C_MENU_ITEM_DEF)
{
type = MENU_ITEM_LISTBOX;
text[0] = "Aktivní mise";
posx = LOG_ITEM_LIST_X;
posy = LOG_ITEM_LIST_Y;
dimx = LOG_ITEM_LIST_WIDTH;
dimy = LOG_ITEM_LIST_HEIGHT;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_EFFECTS_NEXT;
flags = flags & ~IT_SELECTABLE;
flags = flags & ~IT_TXT_CENTER;
userstring[0] = "CURRENTMISSIONS";
framesizex = 250;
framesizey = 0;
};
instance MENU_ITEM_LIST_MISSIONS_FAILED(C_MENU_ITEM_DEF)
{
type = MENU_ITEM_LISTBOX;
text[0] = "Nesplněné mise";
posx = LOG_ITEM_LIST_X;
posy = LOG_ITEM_LIST_Y;
dimx = LOG_ITEM_LIST_WIDTH;
dimy = LOG_ITEM_LIST_HEIGHT;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_EFFECTS_NEXT;
flags = flags & ~IT_SELECTABLE;
flags = flags & ~IT_TXT_CENTER;
userstring[0] = "OLDMISSIONS";
framesizex = 250;
framesizey = 0;
};
instance MENU_ITEM_LIST_MISSIONS_OLD(C_MENU_ITEM_DEF)
{
type = MENU_ITEM_LISTBOX;
text[0] = "Staré mise";
posx = LOG_ITEM_LIST_X;
posy = LOG_ITEM_LIST_Y;
dimx = LOG_ITEM_LIST_WIDTH;
dimy = LOG_ITEM_LIST_HEIGHT;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_EFFECTS_NEXT;
flags = flags & ~IT_SELECTABLE;
flags = flags & ~IT_TXT_CENTER;
userstring[0] = "FAILEDMISSIONS";
framesizex = 250;
framesizey = 0;
};
instance MENU_ITEM_LIST_LOG(C_MENU_ITEM_DEF)
{
type = MENU_ITEM_LISTBOX;
text[0] = "Záznam";
posx = LOG_ITEM_LIST_X;
posy = LOG_ITEM_LIST_Y;
dimx = LOG_ITEM_LIST_WIDTH;
dimy = LOG_ITEM_LIST_HEIGHT;
fontname = LOG_FONT_DEFAULT;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_EFFECTS_NEXT;
flags = flags & ~IT_SELECTABLE;
flags = flags & ~IT_TXT_CENTER;
userstring[0] = "LOG";
framesizex = 250;
framesizey = 0;
};
instance MENU_ITEM_CONTENT_VIEWER(C_MENU_ITEM_DEF)
{
text[0] = "bez obsahu";
posx = 0;
posy = 0;
dimx = 8192;
dimy = 8192;
fontname = LOG_FONT_VIEWER;
flags = flags | IT_CHROMAKEYED | IT_TRANSPARENT | IT_MULTILINE;
flags = flags & ~IT_SELECTABLE;
framesizex = 800;
framesizey = 1000;
backPic = LOG_VIEWER_BACK_PIC;
};
instance MENU_ITEM_DAY_TITLE(C_MENU_ITEM_DEF)
{
text[0] = "Den:";
posx = 1800;
posy = 6000;
fontname = LOG_FONT_DATETIME;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TIME_TITLE(C_MENU_ITEM_DEF)
{
text[0] = "Čas:";
posx = 1500;
posy = 6300;
fontname = LOG_FONT_DATETIME;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_DAY(C_MENU_ITEM_DEF)
{
text[0] = "XX.";
posx = 1500;
posy = 6000;
dimx = 300;
fontname = LOG_FONT_DATETIME;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TIME(C_MENU_ITEM_DEF)
{
text[0] = "XX:XX";
posx = 2200;
posy = 6300;
fontname = LOG_FONT_DATETIME;
flags = flags & ~IT_SELECTABLE;
};
|
D
|
/**
Utilities used by tsv-utils applications. InputFieldReordering, BufferedOututRange,
and a several others.
Utilities in this file:
$(LIST
* [InputFieldReordering] - A class that creates a reordered subset of fields from
an input line. Fields in the subset are accessed by array indicies. This is
especially useful when processing the subset in a specific order, such as the
order listed on the command-line at run-time.
* [BufferedOutputRange] - An OutputRange with an internal buffer used to buffer
output. Intended for use with stdout, it is a significant performance benefit.
* [bufferedByLine] - An input range that reads from a File handle line by line.
It is similar to the standard library method std.stdio.File.byLine, but quite a
bit faster. This is achieved by reading in larger blocks and buffering.
* [joinAppend] - A function that performs a join, but appending the join output to
an output stream. It is a performance improvement over using join or joiner with
writeln.
* [getTsvFieldValue] - A convenience function when only a single value is needed from
an input line.
* Field-lists: [parseFieldList], [makeFieldListOptionHandler] - Helper functions for
parsing field-lists entered on the command line.
* [throwIfWindowsNewlineOnUnix] - A utility for Unix platform builds to detecting
Windows newlines in input.
)
Copyright (c) 2015-2020, eBay Inc.
Initially written by Jon Degenhardt
License: Boost Licence 1.0 (http://boost.org/LICENSE_1_0.txt)
*/
module tsv_utils.common.utils;
import std.range;
import std.traits : isIntegral, isSomeChar, isSomeString, isUnsigned;
import std.typecons : Flag, No, Yes;
// InputFieldReording class.
/** Flag used by the InputFieldReordering template. */
alias EnablePartialLines = Flag!"enablePartialLines";
/**
InputFieldReordering - Move select fields from an input line to an output array,
reordering along the way.
The InputFieldReordering class is used to reorder a subset of fields from an input line.
The caller instantiates an InputFieldReordering object at the start of input processing.
The instance contains a mapping from input index to output index, plus a buffer holding
the reordered fields. The caller processes each input line by calling initNewLine,
splitting the line into fields, and calling processNextField on each field. The output
buffer is ready when the allFieldsFilled method returns true.
Fields are not copied, instead the output buffer points to the fields passed by the caller.
The caller needs to use or copy the output buffer while the fields are still valid, which
is normally until reading the next input line. The program below illustrates the basic use
case. It reads stdin and outputs fields [3, 0, 2], in that order. (See also joinAppend,
below, which has a performance improvement over join used here.)
---
int main(string[] args)
{
import tsv_utils.common.utils;
import std.algorithm, std.array, std.range, std.stdio;
size_t[] fieldIndicies = [3, 0, 2];
auto fieldReordering = new InputFieldReordering!char(fieldIndicies);
foreach (line; stdin.byLine)
{
fieldReordering.initNewLine;
foreach(fieldIndex, fieldValue; line.splitter('\t').enumerate)
{
fieldReordering.processNextField(fieldIndex, fieldValue);
if (fieldReordering.allFieldsFilled) break;
}
if (fieldReordering.allFieldsFilled)
{
writeln(fieldReordering.outputFields.join('\t'));
}
else
{
writeln("Error: Insufficient number of field on the line.");
}
}
return 0;
}
---
Field indicies are zero-based. An individual field can be listed multiple times. The
outputFields array is not valid until all the specified fields have been processed. The
allFieldsFilled method tests this. If a line does not have enough fields the outputFields
buffer cannot be used. For most TSV applications this is okay, as it means the line is
invalid and cannot be used. However, if partial lines are okay, the template can be
instantiated with EnablePartialLines.yes. This will ensure that any fields not filled-in
are empty strings in the outputFields return.
*/
final class InputFieldReordering(C, EnablePartialLines partialLinesOk = EnablePartialLines.no)
if (isSomeChar!C)
{
/* Implementation: The class works by creating an array of tuples mapping the input
* field index to the location in the outputFields array. The 'fromToMap' array is
* sorted in input field order, enabling placement in the outputFields buffer during a
* pass over the input fields. The map is created by the constructor. An example:
*
* inputFieldIndicies: [3, 0, 7, 7, 1, 0, 9]
* fromToMap: [<0,1>, <0,5>, <1,4>, <3,0>, <7,2>, <7,3>, <9,6>]
*
* During processing of an a line, an array slice, mapStack, is used to track how
* much of the fromToMap remains to be processed.
*/
import std.range;
import std.typecons : Tuple;
alias TupleFromTo = Tuple!(size_t, "from", size_t, "to");
private C[][] outputFieldsBuf;
private TupleFromTo[] fromToMap;
private TupleFromTo[] mapStack;
final this(const ref size_t[] inputFieldIndicies, size_t start = 0) pure nothrow @safe
{
import std.algorithm : sort;
outputFieldsBuf = new C[][](inputFieldIndicies.length);
fromToMap.reserve(inputFieldIndicies.length);
foreach (to, from; inputFieldIndicies.enumerate(start))
{
fromToMap ~= TupleFromTo(from, to);
}
sort(fromToMap);
initNewLine;
}
/** initNewLine initializes the object for a new line. */
final void initNewLine() pure nothrow @safe
{
mapStack = fromToMap;
static if (partialLinesOk)
{
import std.algorithm : each;
outputFieldsBuf.each!((ref s) => s.length = 0);
}
}
/** processNextField maps an input field to the correct locations in the outputFields
* array. It should be called once for each field on the line, in the order found.
*/
final size_t processNextField(size_t fieldIndex, C[] fieldValue) pure nothrow @safe @nogc
{
size_t numFilled = 0;
while (!mapStack.empty && fieldIndex == mapStack.front.from)
{
outputFieldsBuf[mapStack.front.to] = fieldValue;
mapStack.popFront;
numFilled++;
}
return numFilled;
}
/** allFieldsFilled returned true if all fields expected have been processed. */
final bool allFieldsFilled() const pure nothrow @safe @nogc
{
return mapStack.empty;
}
/** outputFields is the assembled output fields. Unless partial lines are enabled,
* it is only valid after allFieldsFilled is true.
*/
final C[][] outputFields() pure nothrow @safe @nogc
{
return outputFieldsBuf[];
}
}
/* Tests using different character types. */
@safe unittest
{
import std.conv : to;
auto inputLines = [["r1f0", "r1f1", "r1f2", "r1f3"],
["r2f0", "abc", "ÀBCßßZ", "ghi"],
["r3f0", "123", "456", "789"]];
size_t[] fields_2_0 = [2, 0];
auto expected_2_0 = [["r1f2", "r1f0"],
["ÀBCßßZ", "r2f0"],
["456", "r3f0"]];
char[][][] charExpected_2_0 = to!(char[][][])(expected_2_0);
wchar[][][] wcharExpected_2_0 = to!(wchar[][][])(expected_2_0);
dchar[][][] dcharExpected_2_0 = to!(dchar[][][])(expected_2_0);
dstring[][] dstringExpected_2_0 = to!(dstring[][])(expected_2_0);
auto charIFR = new InputFieldReordering!char(fields_2_0);
auto wcharIFR = new InputFieldReordering!wchar(fields_2_0);
auto dcharIFR = new InputFieldReordering!dchar(fields_2_0);
foreach (lineIndex, line; inputLines)
{
charIFR.initNewLine;
wcharIFR.initNewLine;
dcharIFR.initNewLine;
foreach (fieldIndex, fieldValue; line)
{
charIFR.processNextField(fieldIndex, to!(char[])(fieldValue));
wcharIFR.processNextField(fieldIndex, to!(wchar[])(fieldValue));
dcharIFR.processNextField(fieldIndex, to!(dchar[])(fieldValue));
assert ((fieldIndex >= 2) == charIFR.allFieldsFilled);
assert ((fieldIndex >= 2) == wcharIFR.allFieldsFilled);
assert ((fieldIndex >= 2) == dcharIFR.allFieldsFilled);
}
assert(charIFR.allFieldsFilled);
assert(wcharIFR.allFieldsFilled);
assert(dcharIFR.allFieldsFilled);
assert(charIFR.outputFields == charExpected_2_0[lineIndex]);
assert(wcharIFR.outputFields == wcharExpected_2_0[lineIndex]);
assert(dcharIFR.outputFields == dcharExpected_2_0[lineIndex]);
}
}
/* Test of partial line support. */
@safe unittest
{
import std.conv : to;
auto inputLines = [["r1f0", "r1f1", "r1f2", "r1f3"],
["r2f0", "abc", "ÀBCßßZ", "ghi"],
["r3f0", "123", "456", "789"]];
size_t[] fields_2_0 = [2, 0];
// The expected states of the output field while each line and field are processed.
auto expectedBylineByfield_2_0 =
[
[["", "r1f0"], ["", "r1f0"], ["r1f2", "r1f0"], ["r1f2", "r1f0"]],
[["", "r2f0"], ["", "r2f0"], ["ÀBCßßZ", "r2f0"], ["ÀBCßßZ", "r2f0"]],
[["", "r3f0"], ["", "r3f0"], ["456", "r3f0"], ["456", "r3f0"]],
];
char[][][][] charExpectedBylineByfield_2_0 = to!(char[][][][])(expectedBylineByfield_2_0);
auto charIFR = new InputFieldReordering!(char, EnablePartialLines.yes)(fields_2_0);
foreach (lineIndex, line; inputLines)
{
charIFR.initNewLine;
foreach (fieldIndex, fieldValue; line)
{
charIFR.processNextField(fieldIndex, to!(char[])(fieldValue));
assert(charIFR.outputFields == charExpectedBylineByfield_2_0[lineIndex][fieldIndex]);
}
}
}
/* Field combination tests. */
@safe unittest
{
import std.conv : to;
import std.stdio;
auto inputLines = [["00", "01", "02", "03"],
["10", "11", "12", "13"],
["20", "21", "22", "23"]];
size_t[] fields_0 = [0];
size_t[] fields_3 = [3];
size_t[] fields_01 = [0, 1];
size_t[] fields_10 = [1, 0];
size_t[] fields_03 = [0, 3];
size_t[] fields_30 = [3, 0];
size_t[] fields_0123 = [0, 1, 2, 3];
size_t[] fields_3210 = [3, 2, 1, 0];
size_t[] fields_03001 = [0, 3, 0, 0, 1];
auto expected_0 = to!(char[][][])([["00"],
["10"],
["20"]]);
auto expected_3 = to!(char[][][])([["03"],
["13"],
["23"]]);
auto expected_01 = to!(char[][][])([["00", "01"],
["10", "11"],
["20", "21"]]);
auto expected_10 = to!(char[][][])([["01", "00"],
["11", "10"],
["21", "20"]]);
auto expected_03 = to!(char[][][])([["00", "03"],
["10", "13"],
["20", "23"]]);
auto expected_30 = to!(char[][][])([["03", "00"],
["13", "10"],
["23", "20"]]);
auto expected_0123 = to!(char[][][])([["00", "01", "02", "03"],
["10", "11", "12", "13"],
["20", "21", "22", "23"]]);
auto expected_3210 = to!(char[][][])([["03", "02", "01", "00"],
["13", "12", "11", "10"],
["23", "22", "21", "20"]]);
auto expected_03001 = to!(char[][][])([["00", "03", "00", "00", "01"],
["10", "13", "10", "10", "11"],
["20", "23", "20", "20", "21"]]);
auto ifr_0 = new InputFieldReordering!char(fields_0);
auto ifr_3 = new InputFieldReordering!char(fields_3);
auto ifr_01 = new InputFieldReordering!char(fields_01);
auto ifr_10 = new InputFieldReordering!char(fields_10);
auto ifr_03 = new InputFieldReordering!char(fields_03);
auto ifr_30 = new InputFieldReordering!char(fields_30);
auto ifr_0123 = new InputFieldReordering!char(fields_0123);
auto ifr_3210 = new InputFieldReordering!char(fields_3210);
auto ifr_03001 = new InputFieldReordering!char(fields_03001);
foreach (lineIndex, line; inputLines)
{
ifr_0.initNewLine;
ifr_3.initNewLine;
ifr_01.initNewLine;
ifr_10.initNewLine;
ifr_03.initNewLine;
ifr_30.initNewLine;
ifr_0123.initNewLine;
ifr_3210.initNewLine;
ifr_03001.initNewLine;
foreach (fieldIndex, fieldValue; line)
{
ifr_0.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_3.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_01.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_10.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_03.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_30.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_0123.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_3210.processNextField(fieldIndex, to!(char[])(fieldValue));
ifr_03001.processNextField(fieldIndex, to!(char[])(fieldValue));
}
assert(ifr_0.outputFields == expected_0[lineIndex]);
assert(ifr_3.outputFields == expected_3[lineIndex]);
assert(ifr_01.outputFields == expected_01[lineIndex]);
assert(ifr_10.outputFields == expected_10[lineIndex]);
assert(ifr_03.outputFields == expected_03[lineIndex]);
assert(ifr_30.outputFields == expected_30[lineIndex]);
assert(ifr_0123.outputFields == expected_0123[lineIndex]);
assert(ifr_3210.outputFields == expected_3210[lineIndex]);
assert(ifr_03001.outputFields == expected_03001[lineIndex]);
}
}
import std.stdio : File, isFileHandle, KeepTerminator;
import std.range : isOutputRange;
import std.traits : Unqual;
/**
BufferedOutputRange is a performance enhancement over writing directly to an output
stream. It holds a File open for write or an OutputRange. Ouput is accumulated in an
internal buffer and written to the output stream as a block.
Writing to stdout is a key use case. BufferedOutputRange is often dramatically faster
than writing to stdout directly. This is especially noticable for outputs with short
lines, as it blocks many writes together in a single write.
The internal buffer is written to the output stream after flushSize has been reached.
This is checked at newline boundaries, when appendln is called or when put is called
with a single newline character. Other writes check maxSize, which is used to avoid
runaway buffers.
BufferedOutputRange has a put method allowing it to be used a range. It has a number
of other methods providing additional control.
$(LIST
* `this(outputStream [, flushSize, reserveSize, maxSize])` - Constructor. Takes the
output stream, e.g. stdout. Other arguments are optional, defaults normally suffice.
* `append(stuff)` - Append to the internal buffer.
* `appendln(stuff)` - Append to the internal buffer, followed by a newline. The buffer
is flushed to the output stream if is has reached flushSize.
* `appendln()` - Append a newline to the internal buffer. The buffer is flushed to the
output stream if is has reached flushSize.
* `joinAppend(inputRange, delim)` - An optimization of `append(inputRange.joiner(delim))`.
For reasons that are not clear, joiner is quite slow.
* `flushIfFull()` - Flush the internal buffer to the output stream if flushSize has been
reached.
* `flush()` - Write the internal buffer to the output stream.
* `put(stuff)` - Appends to the internal buffer. Acts as `appendln()` if passed a single
newline character, '\n' or "\n".
)
The internal buffer is automatically flushed when the BufferedOutputRange goes out of
scope.
*/
struct BufferedOutputRange(OutputTarget)
if (isFileHandle!(Unqual!OutputTarget) || isOutputRange!(Unqual!OutputTarget, char))
{
import std.range : isOutputRange;
import std.array : appender;
import std.format : format;
/* Identify the output element type. Only supporting char and ubyte for now. */
static if (isFileHandle!OutputTarget || isOutputRange!(OutputTarget, char))
{
alias C = char;
}
else static if (isOutputRange!(OutputTarget, ubyte))
{
alias C = ubyte;
}
else static assert(false);
private enum defaultReserveSize = 11264;
private enum defaultFlushSize = 10240;
private enum defaultMaxSize = 4194304;
private OutputTarget _outputTarget;
private auto _outputBuffer = appender!(C[]);
private immutable size_t _flushSize;
private immutable size_t _maxSize;
this(OutputTarget outputTarget,
size_t flushSize = defaultFlushSize,
size_t reserveSize = defaultReserveSize,
size_t maxSize = defaultMaxSize)
@safe
{
assert(flushSize <= maxSize);
_outputTarget = outputTarget;
_flushSize = flushSize;
_maxSize = (flushSize <= maxSize) ? maxSize : flushSize;
_outputBuffer.reserve(reserveSize);
}
~this() @safe
{
flush();
}
void flush() @safe
{
static if (isFileHandle!OutputTarget) _outputTarget.write(_outputBuffer.data);
else _outputTarget.put(_outputBuffer.data);
_outputBuffer.clear;
}
bool flushIfFull() @safe
{
bool isFull = _outputBuffer.data.length >= _flushSize;
if (isFull) flush();
return isFull;
}
/* flushIfMaxSize is a safety check to avoid runaway buffer growth. */
void flushIfMaxSize() @safe
{
if (_outputBuffer.data.length >= _maxSize) flush();
}
/* maybeFlush is intended for the case where put is called with a trailing newline.
*
* Flushing occurs if the buffer has a trailing newline and has reached flush size.
* Flushing also occurs if the buffer has reached max size.
*/
private bool maybeFlush() @safe
{
immutable bool doFlush =
_outputBuffer.data.length >= _flushSize &&
(_outputBuffer.data[$-1] == '\n' || _outputBuffer.data.length >= _maxSize);
if (doFlush) flush();
return doFlush;
}
private void appendRaw(T)(T stuff) pure @safe
{
import std.range : rangePut = put;
rangePut(_outputBuffer, stuff);
}
void append(T)(T stuff) @safe
{
appendRaw(stuff);
maybeFlush();
}
bool appendln() @safe
{
appendRaw('\n');
return flushIfFull();
}
bool appendln(T)(T stuff)
{
appendRaw(stuff);
return appendln();
}
/* joinAppend is an optimization of append(inputRange.joiner(delimiter).
* This form is quite a bit faster, 40%+ on some benchmarks.
*/
void joinAppend(InputRange, E)(InputRange inputRange, E delimiter)
if (isInputRange!InputRange &&
is(ElementType!InputRange : const C[]) &&
(is(E : const C[]) || is(E : const C)))
{
if (!inputRange.empty)
{
appendRaw(inputRange.front);
inputRange.popFront;
}
foreach (x; inputRange)
{
appendRaw(delimiter);
appendRaw(x);
}
flushIfMaxSize();
}
/* Make this an output range. */
void put(T)(T stuff)
{
import std.traits;
import std.stdio;
static if (isSomeChar!T)
{
if (stuff == '\n') appendln();
else appendRaw(stuff);
}
else static if (isSomeString!T)
{
if (stuff == "\n") appendln();
else append(stuff);
}
else append(stuff);
}
}
unittest
{
import tsv_utils.common.unittest_utils;
import std.file : rmdirRecurse, readText;
import std.path : buildPath;
auto testDir = makeUnittestTempDir("tsv_utils_buffered_output");
scope(exit) testDir.rmdirRecurse;
import std.algorithm : map, joiner;
import std.range : iota;
import std.conv : to;
/* Basic test. Note that exiting the scope triggers flush. */
string filepath1 = buildPath(testDir, "file1.txt");
{
import std.stdio : File;
auto ostream = BufferedOutputRange!File(filepath1.File("w"));
ostream.append("file1: ");
ostream.append("abc");
ostream.append(["def", "ghi", "jkl"]);
ostream.appendln(100.to!string);
ostream.append(iota(0, 10).map!(x => x.to!string).joiner(" "));
ostream.appendln();
}
assert(filepath1.readText == "file1: abcdefghijkl100\n0 1 2 3 4 5 6 7 8 9\n");
/* Test with no reserve and no flush at every line. */
string filepath2 = buildPath(testDir, "file2.txt");
{
import std.stdio : File;
auto ostream = BufferedOutputRange!File(filepath2.File("w"), 0, 0);
ostream.append("file2: ");
ostream.append("abc");
ostream.append(["def", "ghi", "jkl"]);
ostream.appendln("100");
ostream.append(iota(0, 10).map!(x => x.to!string).joiner(" "));
ostream.appendln();
}
assert(filepath2.readText == "file2: abcdefghijkl100\n0 1 2 3 4 5 6 7 8 9\n");
/* With a locking text writer. Requires version 2.078.0
See: https://issues.dlang.org/show_bug.cgi?id=9661
*/
static if (__VERSION__ >= 2078)
{
string filepath3 = buildPath(testDir, "file3.txt");
{
import std.stdio : File;
auto ltw = filepath3.File("w").lockingTextWriter;
{
auto ostream = BufferedOutputRange!(typeof(ltw))(ltw);
ostream.append("file3: ");
ostream.append("abc");
ostream.append(["def", "ghi", "jkl"]);
ostream.appendln("100");
ostream.append(iota(0, 10).map!(x => x.to!string).joiner(" "));
ostream.appendln();
}
}
assert(filepath3.readText == "file3: abcdefghijkl100\n0 1 2 3 4 5 6 7 8 9\n");
}
/* With an Appender. */
import std.array : appender;
auto app1 = appender!(char[]);
{
auto ostream = BufferedOutputRange!(typeof(app1))(app1);
ostream.append("appender1: ");
ostream.append("abc");
ostream.append(["def", "ghi", "jkl"]);
ostream.appendln("100");
ostream.append(iota(0, 10).map!(x => x.to!string).joiner(" "));
ostream.appendln();
}
assert(app1.data == "appender1: abcdefghijkl100\n0 1 2 3 4 5 6 7 8 9\n");
/* With an Appender, but checking flush boundaries. */
auto app2 = appender!(char[]);
{
auto ostream = BufferedOutputRange!(typeof(app2))(app2, 10, 0); // Flush if 10+
bool wasFlushed = false;
assert(app2.data == "");
ostream.append("12345678"); // Not flushed yet.
assert(app2.data == "");
wasFlushed = ostream.appendln; // Nineth char, not flushed yet.
assert(!wasFlushed);
assert(app2.data == "");
wasFlushed = ostream.appendln; // Tenth char, now flushed.
assert(wasFlushed);
assert(app2.data == "12345678\n\n");
app2.clear;
assert(app2.data == "");
ostream.append("12345678");
wasFlushed = ostream.flushIfFull;
assert(!wasFlushed);
assert(app2.data == "");
ostream.flush;
assert(app2.data == "12345678");
app2.clear;
assert(app2.data == "");
ostream.append("123456789012345");
assert(app2.data == "");
}
assert(app2.data == "123456789012345");
/* Using joinAppend. */
auto app1b = appender!(char[]);
{
auto ostream = BufferedOutputRange!(typeof(app1b))(app1b);
ostream.append("appenderB: ");
ostream.joinAppend(["a", "bc", "def"], '-');
ostream.append(':');
ostream.joinAppend(["g", "hi", "jkl"], '-');
ostream.appendln("*100*");
ostream.joinAppend(iota(0, 6).map!(x => x.to!string), ' ');
ostream.append(' ');
ostream.joinAppend(iota(6, 10).map!(x => x.to!string), " ");
ostream.appendln();
}
assert(app1b.data == "appenderB: a-bc-def:g-hi-jkl*100*\n0 1 2 3 4 5 6 7 8 9\n",
"app1b.data: |" ~app1b.data ~ "|");
/* Operating as an output range. When passed to a function as a ref, exiting
* the function does not flush. When passed as a value, it get flushed when
* the function returns. Also test both UCFS and non-UFCS styles.
*/
void outputStuffAsRef(T)(ref T range)
if (isOutputRange!(T, char))
{
range.put('1');
put(range, "23");
range.put('\n');
range.put(["5", "67"]);
put(range, iota(8, 10).map!(x => x.to!string));
put(range, "\n");
}
void outputStuffAsVal(T)(T range)
if (isOutputRange!(T, char))
{
put(range, '1');
range.put("23");
put(range, '\n');
put(range, ["5", "67"]);
range.put(iota(8, 10).map!(x => x.to!string));
range.put("\n");
}
auto app3 = appender!(char[]);
{
auto ostream = BufferedOutputRange!(typeof(app3))(app3, 12, 0);
outputStuffAsRef(ostream);
assert(app3.data == "", "app3.data: |" ~app3.data ~ "|");
outputStuffAsRef(ostream);
assert(app3.data == "123\n56789\n123\n", "app3.data: |" ~app3.data ~ "|");
}
assert(app3.data == "123\n56789\n123\n56789\n", "app3.data: |" ~app3.data ~ "|");
auto app4 = appender!(char[]);
{
auto ostream = BufferedOutputRange!(typeof(app4))(app4, 12, 0);
outputStuffAsVal(ostream);
assert(app4.data == "123\n56789\n", "app4.data: |" ~app4.data ~ "|");
outputStuffAsVal(ostream);
assert(app4.data == "123\n56789\n123\n56789\n", "app4.data: |" ~app4.data ~ "|");
}
assert(app4.data == "123\n56789\n123\n56789\n", "app4.data: |" ~app4.data ~ "|");
/* Test maxSize. */
auto app5 = appender!(char[]);
{
auto ostream = BufferedOutputRange!(typeof(app5))(app5, 5, 0, 10); // maxSize 10
assert(app5.data == "");
ostream.append("1234567"); // Not flushed yet (no newline).
assert(app5.data == "");
ostream.append("89012"); // Flushed by maxSize
assert(app5.data == "123456789012");
ostream.put("1234567"); // Not flushed yet (no newline).
assert(app5.data == "123456789012");
ostream.put("89012"); // Flushed by maxSize
assert(app5.data == "123456789012123456789012");
ostream.joinAppend(["ab", "cd"], '-'); // Not flushed yet
ostream.joinAppend(["de", "gh", "ij"], '-'); // Flushed by maxSize
assert(app5.data == "123456789012123456789012ab-cdde-gh-ij");
}
assert(app5.data == "123456789012123456789012ab-cdde-gh-ij");
}
/**
bufferedByLine is a performance enhancement over std.stdio.File.byLine. It works by
reading a large buffer from the input stream rather than just a single line.
The file argument needs to be a File object open for reading, typically a filesystem
file or standard input. Use the Yes.keepTerminator template parameter to keep the
newline. This is similar to stdio.File.byLine, except specified as a template paramter
rather than a runtime parameter.
Reading in blocks does mean that input is not read until a full buffer is available or
end-of-file is reached. For this reason, bufferedByLine is not appropriate for
interactive input.
*/
auto bufferedByLine(KeepTerminator keepTerminator = No.keepTerminator, Char = char,
ubyte terminator = '\n', size_t readSize = 1024 * 128, size_t growSize = 1024 * 16)
(File file)
if (is(Char == char) || is(Char == ubyte))
{
static assert(0 < growSize && growSize <= readSize);
static final class BufferedByLineImpl
{
/* Buffer state variables
* - _buffer.length - Full length of allocated buffer.
* - _dataEnd - End of currently valid data (end of last read).
* - _lineStart - Start of current line.
* - _lineEnd - End of current line.
*/
private File _file;
private ubyte[] _buffer;
private size_t _lineStart = 0;
private size_t _lineEnd = 0;
private size_t _dataEnd = 0;
this (File f) @safe
{
_file = f;
_buffer = new ubyte[readSize + growSize];
}
bool empty() const pure @safe
{
return _file.eof && _lineStart == _dataEnd;
}
Char[] front() pure @safe
{
assert(!empty, "Attempt to take the front of an empty bufferedByLine.");
static if (keepTerminator == Yes.keepTerminator)
{
return cast(Char[]) _buffer[_lineStart .. _lineEnd];
}
else
{
assert(_lineStart < _lineEnd);
immutable end = (_buffer[_lineEnd - 1] == terminator) ? _lineEnd - 1 : _lineEnd;
return cast(Char[]) _buffer[_lineStart .. end];
}
}
/* Note: Call popFront at initialization to do the initial read. */
void popFront() @safe
{
import std.algorithm: copy, find;
assert(!empty, "Attempt to popFront an empty bufferedByLine.");
/* Pop the current line. */
_lineStart = _lineEnd;
/* Set up the next line if more data is available, either in the buffer or
* the file. The next line ends at the next newline, if there is one.
*
* Notes:
* - 'find' returns the slice starting with the character searched for, or
* an empty range if not found.
* - _lineEnd is set to _dataEnd both when the current buffer does not have
* a newline and when it ends with one.
*/
auto found = _buffer[_lineStart .. _dataEnd].find(terminator);
_lineEnd = found.empty ? _dataEnd : _dataEnd - found.length + 1;
if (found.empty && !_file.eof)
{
/* No newline in current buffer. Read from the file until the next
* newline is found.
*/
assert(_lineEnd == _dataEnd);
if (_lineStart > 0)
{
/* Move remaining data to the start of the buffer. */
immutable remainingLength = _dataEnd - _lineStart;
copy(_buffer[_lineStart .. _dataEnd], _buffer[0 .. remainingLength]);
_lineStart = 0;
_lineEnd = _dataEnd = remainingLength;
}
do
{
/* Grow the buffer if necessary. */
immutable availableSize = _buffer.length - _dataEnd;
if (availableSize < readSize)
{
size_t growBy = growSize;
while (availableSize + growBy < readSize) growBy += growSize;
_buffer.length += growBy;
}
/* Read the next block. */
_dataEnd +=
_file.rawRead(_buffer[_dataEnd .. _dataEnd + readSize])
.length;
found = _buffer[_lineEnd .. _dataEnd].find(terminator);
_lineEnd = found.empty ? _dataEnd : _dataEnd - found.length + 1;
} while (found.empty && !_file.eof);
}
}
}
assert(file.isOpen, "bufferedByLine passed a closed file.");
auto r = new BufferedByLineImpl(file);
r.popFront;
return r;
}
unittest
{
import std.array : appender;
import std.conv : to;
import std.file : rmdirRecurse, readText;
import std.path : buildPath;
import std.range : lockstep;
import std.stdio;
import tsv_utils.common.unittest_utils;
auto testDir = makeUnittestTempDir("tsv_utils_buffered_byline");
scope(exit) testDir.rmdirRecurse;
/* Create two data files with the same data. Read both in parallel with byLine and
* bufferedByLine and compare each line.
*/
auto data1 = appender!(char[])();
foreach (i; 1 .. 1001) data1.put('\n');
foreach (i; 1 .. 1001) data1.put("a\n");
foreach (i; 1 .. 1001) { data1.put(i.to!string); data1.put('\n'); }
foreach (i; 1 .. 1001)
{
foreach (j; 1 .. i+1) data1.put('x');
data1.put('\n');
}
string file1a = buildPath(testDir, "file1a.txt");
string file1b = buildPath(testDir, "file1b.txt");
{
file1a.File("w").write(data1.data);
file1b.File("w").write(data1.data);
}
/* Default parameters. */
{
auto f1aIn = file1a.File().bufferedByLine!(No.keepTerminator);
auto f1bIn = file1b.File().byLine(No.keepTerminator);
foreach (a, b; lockstep(f1aIn, f1bIn, StoppingPolicy.requireSameLength)) assert(a == b);
}
{
auto f1aIn = file1a.File().bufferedByLine!(Yes.keepTerminator);
auto f1bIn = file1b.File().byLine(Yes.keepTerminator);
foreach (a, b; lockstep(f1aIn, f1bIn, StoppingPolicy.requireSameLength)) assert(a == b);
}
/* Smaller read size. This will trigger buffer growth. */
{
auto f1aIn = file1a.File().bufferedByLine!(No.keepTerminator, char, '\n', 512, 256);
auto f1bIn = file1b.File().byLine(No.keepTerminator);
foreach (a, b; lockstep(f1aIn, f1bIn, StoppingPolicy.requireSameLength)) assert(a == b);
}
/* Exercise boundary cases in buffer growth.
* Note: static-foreach requires DMD 2.076 / LDC 1.6
*/
static foreach (readSize; [1, 2, 4])
{
static foreach (growSize; 1 .. readSize + 1)
{{
auto f1aIn = file1a.File().bufferedByLine!(No.keepTerminator, char, '\n', readSize, growSize);
auto f1bIn = file1b.File().byLine(No.keepTerminator);
foreach (a, b; lockstep(f1aIn, f1bIn, StoppingPolicy.requireSameLength)) assert(a == b);
}}
static foreach (growSize; 1 .. readSize + 1)
{{
auto f1aIn = file1a.File().bufferedByLine!(Yes.keepTerminator, char, '\n', readSize, growSize);
auto f1bIn = file1b.File().byLine(Yes.keepTerminator);
foreach (a, b; lockstep(f1aIn, f1bIn, StoppingPolicy.requireSameLength)) assert(a == b);
}}
}
/* Files that do not end in a newline. */
string file2a = buildPath(testDir, "file2a.txt");
string file2b = buildPath(testDir, "file2b.txt");
string file3a = buildPath(testDir, "file3a.txt");
string file3b = buildPath(testDir, "file3b.txt");
string file4a = buildPath(testDir, "file4a.txt");
string file4b = buildPath(testDir, "file4b.txt");
{
file1a.File("w").write("a");
file1b.File("w").write("a");
file2a.File("w").write("ab");
file2b.File("w").write("ab");
file3a.File("w").write("abc");
file3b.File("w").write("abc");
}
static foreach (readSize; [1, 2, 4])
{
static foreach (growSize; 1 .. readSize + 1)
{{
auto f1aIn = file1a.File().bufferedByLine!(No.keepTerminator, char, '\n', readSize, growSize);
auto f1bIn = file1b.File().byLine(No.keepTerminator);
foreach (a, b; lockstep(f1aIn, f1bIn, StoppingPolicy.requireSameLength)) assert(a == b);
auto f2aIn = file2a.File().bufferedByLine!(No.keepTerminator, char, '\n', readSize, growSize);
auto f2bIn = file2b.File().byLine(No.keepTerminator);
foreach (a, b; lockstep(f2aIn, f2bIn, StoppingPolicy.requireSameLength)) assert(a == b);
auto f3aIn = file3a.File().bufferedByLine!(No.keepTerminator, char, '\n', readSize, growSize);
auto f3bIn = file3b.File().byLine(No.keepTerminator);
foreach (a, b; lockstep(f3aIn, f3bIn, StoppingPolicy.requireSameLength)) assert(a == b);
}}
static foreach (growSize; 1 .. readSize + 1)
{{
auto f1aIn = file1a.File().bufferedByLine!(Yes.keepTerminator, char, '\n', readSize, growSize);
auto f1bIn = file1b.File().byLine(Yes.keepTerminator);
foreach (a, b; lockstep(f1aIn, f1bIn, StoppingPolicy.requireSameLength)) assert(a == b);
auto f2aIn = file2a.File().bufferedByLine!(Yes.keepTerminator, char, '\n', readSize, growSize);
auto f2bIn = file2b.File().byLine(Yes.keepTerminator);
foreach (a, b; lockstep(f2aIn, f2bIn, StoppingPolicy.requireSameLength)) assert(a == b);
auto f3aIn = file3a.File().bufferedByLine!(Yes.keepTerminator, char, '\n', readSize, growSize);
auto f3bIn = file3b.File().byLine(Yes.keepTerminator);
foreach (a, b; lockstep(f3aIn, f3bIn, StoppingPolicy.requireSameLength)) assert(a == b);
}}
}
}
/**
joinAppend performs a join operation on an input range, appending the results to
an output range.
joinAppend was written as a performance enhancement over using std.algorithm.joiner
or std.array.join with writeln. Using joiner with writeln is quite slow, 3-4x slower
than std.array.join with writeln. The joiner performance may be due to interaction
with writeln, this was not investigated. Using joiner with stdout.lockingTextWriter
is better, but still substantially slower than join. Using join works reasonably well,
but is allocating memory unnecessarily.
Using joinAppend with Appender is a bit faster than join, and allocates less memory.
The Appender re-uses the underlying data buffer, saving memory. The example below
illustrates. It is a modification of the InputFieldReordering example. The role
Appender plus joinAppend are playing is to buffer the output. BufferedOutputRange
uses a similar technique to buffer multiple lines.
Note: The original uses joinAppend have been replaced by BufferedOutputRange, which has
its own joinAppend method. However, joinAppend remains useful when constructing internal
buffers where BufferedOutputRange is not appropriate.
---
int main(string[] args)
{
import tsvutil;
import std.algorithm, std.array, std.range, std.stdio;
size_t[] fieldIndicies = [3, 0, 2];
auto fieldReordering = new InputFieldReordering!char(fieldIndicies);
auto outputBuffer = appender!(char[]);
foreach (line; stdin.byLine)
{
fieldReordering.initNewLine;
foreach(fieldIndex, fieldValue; line.splitter('\t').enumerate)
{
fieldReordering.processNextField(fieldIndex, fieldValue);
if (fieldReordering.allFieldsFilled) break;
}
if (fieldReordering.allFieldsFilled)
{
outputBuffer.clear;
writeln(fieldReordering.outputFields.joinAppend(outputBuffer, ('\t')));
}
else
{
writeln("Error: Insufficient number of field on the line.");
}
}
return 0;
}
---
*/
OutputRange joinAppend(InputRange, OutputRange, E)
(InputRange inputRange, ref OutputRange outputRange, E delimiter)
if (isInputRange!InputRange &&
(is(ElementType!InputRange : const E[]) &&
isOutputRange!(OutputRange, E[]))
||
(is(ElementType!InputRange : const E) &&
isOutputRange!(OutputRange, E))
)
{
if (!inputRange.empty)
{
outputRange.put(inputRange.front);
inputRange.popFront;
}
foreach (x; inputRange)
{
outputRange.put(delimiter);
outputRange.put(x);
}
return outputRange;
}
@safe unittest
{
import std.array : appender;
import std.algorithm : equal;
char[] c1 = ['a', 'b', 'c'];
char[] c2 = ['d', 'e', 'f'];
char[] c3 = ['g', 'h', 'i'];
auto cvec = [c1, c2, c3];
auto s1 = "abc";
auto s2 = "def";
auto s3 = "ghi";
auto svec = [s1, s2, s3];
auto charAppender = appender!(char[])();
assert(cvec.joinAppend(charAppender, '_').data == "abc_def_ghi");
assert(equal(cvec, [c1, c2, c3]));
charAppender.put('$');
assert(svec.joinAppend(charAppender, '|').data == "abc_def_ghi$abc|def|ghi");
assert(equal(cvec, [s1, s2, s3]));
charAppender.clear;
assert(svec.joinAppend(charAppender, '|').data == "abc|def|ghi");
auto intAppender = appender!(int[])();
auto i1 = [100, 101, 102];
auto i2 = [200, 201, 202];
auto i3 = [300, 301, 302];
auto ivec = [i1, i2, i3];
assert(ivec.joinAppend(intAppender, 0).data ==
[100, 101, 102, 0, 200, 201, 202, 0, 300, 301, 302]);
intAppender.clear;
assert(i1.joinAppend(intAppender, 0).data ==
[100, 0, 101, 0, 102]);
assert(i2.joinAppend(intAppender, 1).data ==
[100, 0, 101, 0, 102,
200, 1, 201, 1, 202]);
assert(i3.joinAppend(intAppender, 2).data ==
[100, 0, 101, 0, 102,
200, 1, 201, 1, 202,
300, 2, 301, 2, 302]);
}
/**
getTsvFieldValue extracts the value of a single field from a delimited text string.
This is a convenience function intended for cases when only a single field from an
input line is needed. If multiple values are needed, it will be more efficient to
work directly with std.algorithm.splitter or the InputFieldReordering class.
The input text is split by a delimiter character. The specified field is converted
to the desired type and the value returned.
An exception is thrown if there are not enough fields on the line or if conversion
fails. Conversion is done with std.conv.to, it throws a std.conv.ConvException on
failure. If not enough fields, the exception text is generated referencing 1-upped
field numbers as would be provided by command line users.
*/
T getTsvFieldValue(T, C)(const C[] line, size_t fieldIndex, C delim)
if (isSomeChar!C)
{
import std.algorithm : splitter;
import std.conv : to;
import std.format : format;
import std.range;
auto splitLine = line.splitter(delim);
size_t atField = 0;
while (atField < fieldIndex && !splitLine.empty)
{
splitLine.popFront;
atField++;
}
T val;
if (splitLine.empty)
{
if (fieldIndex == 0)
{
/* This is a workaround to a splitter special case - If the input is empty,
* the returned split range is empty. This doesn't properly represent a single
* column file. More correct mathematically, and for this case, would be a
* single value representing an empty string. The input line is a convenient
* source of an empty line. Info:
* Bug: https://issues.dlang.org/show_bug.cgi?id=15735
* Pull Request: https://github.com/D-Programming-Language/phobos/pull/4030
*/
assert(line.empty);
val = line.to!T;
}
else
{
throw new Exception(
format("Not enough fields on line. Number required: %d; Number found: %d",
fieldIndex + 1, atField));
}
}
else
{
val = splitLine.front.to!T;
}
return val;
}
@safe unittest
{
import std.conv : ConvException, to;
import std.exception;
/* Common cases. */
assert(getTsvFieldValue!double("123", 0, '\t') == 123.0);
assert(getTsvFieldValue!double("-10.5", 0, '\t') == -10.5);
assert(getTsvFieldValue!size_t("abc|123", 1, '|') == 123);
assert(getTsvFieldValue!int("紅\t红\t99", 2, '\t') == 99);
assert(getTsvFieldValue!int("紅\t红\t99", 2, '\t') == 99);
assert(getTsvFieldValue!string("紅\t红\t99", 2, '\t') == "99");
assert(getTsvFieldValue!string("紅\t红\t99", 1, '\t') == "红");
assert(getTsvFieldValue!string("紅\t红\t99", 0, '\t') == "紅");
assert(getTsvFieldValue!string("红色和绿色\tred and green\t赤と緑\t10.5", 2, '\t') == "赤と緑");
assert(getTsvFieldValue!double("红色和绿色\tred and green\t赤と緑\t10.5", 3, '\t') == 10.5);
/* The empty field cases. */
assert(getTsvFieldValue!string("", 0, '\t') == "");
assert(getTsvFieldValue!string("\t", 0, '\t') == "");
assert(getTsvFieldValue!string("\t", 1, '\t') == "");
assert(getTsvFieldValue!string("", 0, ':') == "");
assert(getTsvFieldValue!string(":", 0, ':') == "");
assert(getTsvFieldValue!string(":", 1, ':') == "");
/* Tests with different data types. */
string stringLine = "orange and black\tნარინჯისფერი და შავი\t88.5";
char[] charLine = "orange and black\tნარინჯისფერი და შავი\t88.5".to!(char[]);
dchar[] dcharLine = stringLine.to!(dchar[]);
wchar[] wcharLine = stringLine.to!(wchar[]);
assert(getTsvFieldValue!string(stringLine, 0, '\t') == "orange and black");
assert(getTsvFieldValue!string(stringLine, 1, '\t') == "ნარინჯისფერი და შავი");
assert(getTsvFieldValue!wstring(stringLine, 1, '\t') == "ნარინჯისფერი და შავი".to!wstring);
assert(getTsvFieldValue!double(stringLine, 2, '\t') == 88.5);
assert(getTsvFieldValue!string(charLine, 0, '\t') == "orange and black");
assert(getTsvFieldValue!string(charLine, 1, '\t') == "ნარინჯისფერი და შავი");
assert(getTsvFieldValue!wstring(charLine, 1, '\t') == "ნარინჯისფერი და შავი".to!wstring);
assert(getTsvFieldValue!double(charLine, 2, '\t') == 88.5);
assert(getTsvFieldValue!string(dcharLine, 0, '\t') == "orange and black");
assert(getTsvFieldValue!string(dcharLine, 1, '\t') == "ნარინჯისფერი და შავი");
assert(getTsvFieldValue!wstring(dcharLine, 1, '\t') == "ნარინჯისფერი და შავი".to!wstring);
assert(getTsvFieldValue!double(dcharLine, 2, '\t') == 88.5);
assert(getTsvFieldValue!string(wcharLine, 0, '\t') == "orange and black");
assert(getTsvFieldValue!string(wcharLine, 1, '\t') == "ნარინჯისფერი და შავი");
assert(getTsvFieldValue!wstring(wcharLine, 1, '\t') == "ნარინჯისფერი და შავი".to!wstring);
assert(getTsvFieldValue!double(wcharLine, 2, '\t') == 88.5);
/* Conversion errors. */
assertThrown!ConvException(getTsvFieldValue!double("", 0, '\t'));
assertThrown!ConvException(getTsvFieldValue!double("abc", 0, '|'));
assertThrown!ConvException(getTsvFieldValue!size_t("-1", 0, '|'));
assertThrown!ConvException(getTsvFieldValue!size_t("a23|23.4", 1, '|'));
assertThrown!ConvException(getTsvFieldValue!double("23.5|def", 1, '|'));
/* Not enough field errors. These should throw, but not a ConvException.*/
assertThrown(assertNotThrown!ConvException(getTsvFieldValue!double("", 1, '\t')));
assertThrown(assertNotThrown!ConvException(getTsvFieldValue!double("abc", 1, '\t')));
assertThrown(assertNotThrown!ConvException(getTsvFieldValue!double("abc\tdef", 2, '\t')));
}
/**
Field-lists - A field-list is a string entered on the command line identifying one or more
field numbers. They are used by the majority of the tsv utility applications. There are
two helper functions, makeFieldListOptionHandler and parseFieldList. Most applications
will use makeFieldListOptionHandler, it creates a delegate that can be passed to
std.getopt to process the command option. Actual processing of the option text is done by
parseFieldList. It can be called directly when the text of the option value contains more
than just the field number.
Syntax and behavior:
A 'field-list' is a list of numeric field numbers entered on the command line. Fields are
1-upped integers representing locations in an input line, in the traditional meaning of
Unix command line tools. Fields can be entered as single numbers or a range. Multiple
entries are separated by commas. Some examples (with 'fields' as the command line option):
--fields 3 // Single field
--fields 4,1 // Two fields
--fields 3-9 // A range, fields 3 to 9 inclusive
--fields 1,2,7-34,11 // A mix of ranges and fields
--fields 15-5,3-1 // Two ranges in reverse order.
Incomplete ranges are not supported, for example, '6-'. Zero is disallowed as a field
value by default, but can be enabled to support the notion of zero as representing the
entire line. However, zero cannot be part of a range. Field numbers are one-based by
default, but can be converted to zero-based. If conversion to zero-based is enabled, field
number zero must be disallowed or a signed integer type specified for the returned range.
An error is thrown if an invalid field specification is encountered. Error text is
intended for display. Error conditions include:
- Empty fields list
- Empty value, e.g. Two consequtive commas, a trailing comma, or a leading comma
- String that does not parse as a valid integer
- Negative integers, or zero if zero is disallowed.
- An incomplete range
- Zero used as part of a range.
No other behaviors are enforced. Repeated values are accepted. If zero is allowed, other
field numbers can be entered as well. Additional restrictions need to be applied by the
caller.
Notes:
- The data type determines the max field number that can be entered. Enabling conversion
to zero restricts to the signed version of the data type.
- Use 'import std.typecons : Yes, No' to use the convertToZeroBasedIndex and
allowFieldNumZero template parameters.
*/
/** [Yes|No].convertToZeroBasedIndex parameter controls whether field numbers are
* converted to zero-based indices by makeFieldListOptionHander and parseFieldList.
*/
alias ConvertToZeroBasedIndex = Flag!"convertToZeroBasedIndex";
/** [Yes|No].allowFieldNumZero parameter controls whether zero is a valid field. This is
* used by makeFieldListOptionHander and parseFieldList.
*/
alias AllowFieldNumZero = Flag!"allowFieldNumZero";
alias OptionHandlerDelegate = void delegate(string option, string value);
/**
makeFieldListOptionHandler creates a std.getopt option hander for processing field lists
entered on the command line. A field list is as defined by parseFieldList.
*/
OptionHandlerDelegate makeFieldListOptionHandler(
T,
ConvertToZeroBasedIndex convertToZero = No.convertToZeroBasedIndex,
AllowFieldNumZero allowZero = No.allowFieldNumZero)
(ref T[] fieldsArray)
if (isIntegral!T && (!allowZero || !convertToZero || !isUnsigned!T))
{
void fieldListOptionHandler(ref T[] fieldArray, string option, string value) pure @safe
{
import std.algorithm : each;
try value.parseFieldList!(T, convertToZero, allowZero).each!(x => fieldArray ~= x);
catch (Exception exc)
{
import std.format : format;
exc.msg = format("[--%s] %s", option, exc.msg);
throw exc;
}
}
return (option, value) => fieldListOptionHandler(fieldsArray, option, value);
}
unittest
{
import std.exception : assertThrown, assertNotThrown;
import std.getopt;
{
size_t[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args, "f|fields", fields.makeFieldListOptionHandler);
assert(fields == [1, 2, 4, 7, 8, 9, 23, 22, 21]);
}
{
size_t[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(size_t, Yes.convertToZeroBasedIndex));
assert(fields == [0, 1, 3, 6, 7, 8, 22, 21, 20]);
}
{
size_t[] fields;
auto args = ["program", "-f", "0"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assert(fields == [0]);
}
{
size_t[] fields;
auto args = ["program", "-f", "0", "-f", "1,0", "-f", "0,1"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assert(fields == [0, 1, 0, 0, 1]);
}
{
size_t[] ints;
size_t[] fields;
auto args = ["program", "--ints", "1,2,3", "--fields", "1", "--ints", "4,5,6", "--fields", "2,4,7-9,23-21"];
std.getopt.arraySep = ",";
getopt(args,
"i|ints", "Built-in list of integers.", &ints,
"f|fields", "Field-list style integers.", fields.makeFieldListOptionHandler);
assert(ints == [1, 2, 3, 4, 5, 6]);
assert(fields == [1, 2, 4, 7, 8, 9, 23, 22, 21]);
}
/* Basic cases involved unsinged types smaller than size_t. */
{
uint[] fields;
auto args = ["program", "-f", "0", "-f", "1,0", "-f", "0,1", "-f", "55-58"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(uint, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assert(fields == [0, 1, 0, 0, 1, 55, 56, 57, 58]);
}
{
ushort[] fields;
auto args = ["program", "-f", "0", "-f", "1,0", "-f", "0,1", "-f", "55-58"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(ushort, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assert(fields == [0, 1, 0, 0, 1, 55, 56, 57, 58]);
}
/* Basic cases involving unsigned types. */
{
long[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args, "f|fields", fields.makeFieldListOptionHandler);
assert(fields == [1, 2, 4, 7, 8, 9, 23, 22, 21]);
}
{
long[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(long, Yes.convertToZeroBasedIndex));
assert(fields == [0, 1, 3, 6, 7, 8, 22, 21, 20]);
}
{
long[] fields;
auto args = ["program", "-f", "0"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assert(fields == [-1]);
}
{
int[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args, "f|fields", fields.makeFieldListOptionHandler);
assert(fields == [1, 2, 4, 7, 8, 9, 23, 22, 21]);
}
{
int[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(int, Yes.convertToZeroBasedIndex));
assert(fields == [0, 1, 3, 6, 7, 8, 22, 21, 20]);
}
{
int[] fields;
auto args = ["program", "-f", "0"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(int, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assert(fields == [-1]);
}
{
short[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args, "f|fields", fields.makeFieldListOptionHandler);
assert(fields == [1, 2, 4, 7, 8, 9, 23, 22, 21]);
}
{
short[] fields;
auto args = ["program", "--fields", "1", "--fields", "2,4,7-9,23-21"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(short, Yes.convertToZeroBasedIndex));
assert(fields == [0, 1, 3, 6, 7, 8, 22, 21, 20]);
}
{
short[] fields;
auto args = ["program", "-f", "0"];
getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(short, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assert(fields == [-1]);
}
{
/* Error cases. */
size_t[] fields;
auto args = ["program", "-f", "0"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "-1"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "--fields", "1"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "a"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "1.5"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "2-"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "3,5,-7"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "3,5,"];
assertThrown(getopt(args, "f|fields", fields.makeFieldListOptionHandler));
args = ["program", "-f", "-1"];
assertThrown(getopt(args,
"f|fields", fields.makeFieldListOptionHandler!(
size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero)));
}
}
/**
parseFieldList lazily generates a range of fields numbers from a 'field-list' string.
*/
auto parseFieldList(T = size_t,
ConvertToZeroBasedIndex convertToZero = No.convertToZeroBasedIndex,
AllowFieldNumZero allowZero = No.allowFieldNumZero)
(string fieldList, char delim = ',')
if (isIntegral!T && (!allowZero || !convertToZero || !isUnsigned!T))
{
import std.algorithm : splitter;
auto _splitFieldList = fieldList.splitter(delim);
auto _currFieldParse =
(_splitFieldList.empty ? "" : _splitFieldList.front)
.parseFieldRange!(T, convertToZero, allowZero);
if (!_splitFieldList.empty) _splitFieldList.popFront;
struct Result
{
@property bool empty() pure nothrow @safe @nogc
{
return _currFieldParse.empty;
}
@property T front() pure @safe
{
import std.conv : to;
assert(!empty, "Attempting to fetch the front of an empty field-list.");
assert(!_currFieldParse.empty, "Internal error. Call to front with an empty _currFieldParse.");
return _currFieldParse.front.to!T;
}
void popFront() pure @safe
{
assert(!empty, "Attempting to popFront an empty field-list.");
_currFieldParse.popFront;
if (_currFieldParse.empty && !_splitFieldList.empty)
{
_currFieldParse = _splitFieldList.front.parseFieldRange!(T, convertToZero, allowZero);
_splitFieldList.popFront;
}
}
}
return Result();
}
@safe unittest
{
import std.algorithm : each, equal;
import std.exception : assertThrown, assertNotThrown;
/* Basic tests. */
assert("1".parseFieldList.equal([1]));
assert("1,2".parseFieldList.equal([1, 2]));
assert("1,2,3".parseFieldList.equal([1, 2, 3]));
assert("1-2".parseFieldList.equal([1, 2]));
assert("1-2,6-4".parseFieldList.equal([1, 2, 6, 5, 4]));
assert("1-2,1,1-2,2,2-1".parseFieldList.equal([1, 2, 1, 1, 2, 2, 2, 1]));
assert("1-2,5".parseFieldList!size_t.equal([1, 2, 5]));
/* Signed Int tests */
assert("1".parseFieldList!int.equal([1]));
assert("1,2,3".parseFieldList!int.equal([1, 2, 3]));
assert("1-2".parseFieldList!int.equal([1, 2]));
assert("1-2,6-4".parseFieldList!int.equal([1, 2, 6, 5, 4]));
assert("1-2,5".parseFieldList!int.equal([1, 2, 5]));
/* Convert to zero tests */
assert("1".parseFieldList!(size_t, Yes.convertToZeroBasedIndex).equal([0]));
assert("1,2,3".parseFieldList!(size_t, Yes.convertToZeroBasedIndex).equal([0, 1, 2]));
assert("1-2".parseFieldList!(size_t, Yes.convertToZeroBasedIndex).equal([0, 1]));
assert("1-2,6-4".parseFieldList!(size_t, Yes.convertToZeroBasedIndex).equal([0, 1, 5, 4, 3]));
assert("1-2,5".parseFieldList!(size_t, Yes.convertToZeroBasedIndex).equal([0, 1, 4]));
assert("1".parseFieldList!(long, Yes.convertToZeroBasedIndex).equal([0]));
assert("1,2,3".parseFieldList!(long, Yes.convertToZeroBasedIndex).equal([0, 1, 2]));
assert("1-2".parseFieldList!(long, Yes.convertToZeroBasedIndex).equal([0, 1]));
assert("1-2,6-4".parseFieldList!(long, Yes.convertToZeroBasedIndex).equal([0, 1, 5, 4, 3]));
assert("1-2,5".parseFieldList!(long, Yes.convertToZeroBasedIndex).equal([0, 1, 4]));
/* Allow zero tests. */
assert("0".parseFieldList!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert("1,0,3".parseFieldList!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([1, 0, 3]));
assert("1-2,5".parseFieldList!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([1, 2, 5]));
assert("0".parseFieldList!(int, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert("1,0,3".parseFieldList!(int, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([1, 0, 3]));
assert("1-2,5".parseFieldList!(int, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([1, 2, 5]));
assert("0".parseFieldList!(int, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([-1]));
assert("1,0,3".parseFieldList!(int, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0, -1, 2]));
assert("1-2,5".parseFieldList!(int, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0, 1, 4]));
/* Error cases. */
assertThrown("".parseFieldList.each);
assertThrown(" ".parseFieldList.each);
assertThrown(",".parseFieldList.each);
assertThrown("5 6".parseFieldList.each);
assertThrown(",7".parseFieldList.each);
assertThrown("8,".parseFieldList.each);
assertThrown("8,9,".parseFieldList.each);
assertThrown("10,,11".parseFieldList.each);
assertThrown("".parseFieldList!(long, Yes.convertToZeroBasedIndex).each);
assertThrown("1,2-3,".parseFieldList!(long, Yes.convertToZeroBasedIndex).each);
assertThrown("2-,4".parseFieldList!(long, Yes.convertToZeroBasedIndex).each);
assertThrown("1,2,3,,4".parseFieldList!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
assertThrown(",7".parseFieldList!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
assertThrown("8,".parseFieldList!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
assertThrown("10,0,,11".parseFieldList!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
assertThrown("8,9,".parseFieldList!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
assertThrown("0".parseFieldList.each);
assertThrown("1,0,3".parseFieldList.each);
assertThrown("0".parseFieldList!(int, Yes.convertToZeroBasedIndex, No.allowFieldNumZero).each);
assertThrown("1,0,3".parseFieldList!(int, Yes.convertToZeroBasedIndex, No.allowFieldNumZero).each);
assertThrown("0-2,6-0".parseFieldList!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
assertThrown("0-2,6-0".parseFieldList!(int, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
assertThrown("0-2,6-0".parseFieldList!(int, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).each);
}
/* parseFieldRange parses a single number or number range. E.g. '5' or '5-8'. These are
* the values in a field-list separated by a comma or other delimiter. It returns a range
* that iterates over all the values in the range.
*/
private auto parseFieldRange(T = size_t,
ConvertToZeroBasedIndex convertToZero = No.convertToZeroBasedIndex,
AllowFieldNumZero allowZero = No.allowFieldNumZero)
(string fieldRange)
if (isIntegral!T && (!allowZero || !convertToZero || !isUnsigned!T))
{
import std.algorithm : findSplit;
import std.conv : to;
import std.format : format;
import std.range : iota;
import std.traits : Signed;
/* Pick the largest compatible integral type for the IOTA range. This must be the
* signed type if convertToZero is true, as a reverse order range may end at -1.
*/
static if (convertToZero) alias S = Signed!T;
else alias S = T;
if (fieldRange.length == 0) throw new Exception("Empty field number.");
auto rangeSplit = findSplit(fieldRange, "-");
if (!rangeSplit[1].empty && (rangeSplit[0].empty || rangeSplit[2].empty))
{
// Range starts or ends with a dash.
throw new Exception(format("Incomplete ranges are not supported: '%s'", fieldRange));
}
S start = rangeSplit[0].to!S;
S last = rangeSplit[1].empty ? start : rangeSplit[2].to!S;
Signed!T increment = (start <= last) ? 1 : -1;
static if (allowZero)
{
if (start == 0 && !rangeSplit[1].empty)
{
throw new Exception(format("Zero cannot be used as part of a range: '%s'", fieldRange));
}
}
static if (allowZero)
{
if (start < 0 || last < 0)
{
throw new Exception(format("Field numbers must be non-negative integers: '%d'",
(start < 0) ? start : last));
}
}
else
{
if (start < 1 || last < 1)
{
throw new Exception(format("Field numbers must be greater than zero: '%d'",
(start < 1) ? start : last));
}
}
static if (convertToZero)
{
start--;
last--;
}
return iota(start, last + increment, increment);
}
@safe unittest // parseFieldRange
{
import std.algorithm : equal;
import std.exception : assertThrown, assertNotThrown;
/* Basic cases */
assert(parseFieldRange("1").equal([1]));
assert("2".parseFieldRange.equal([2]));
assert("3-4".parseFieldRange.equal([3, 4]));
assert("3-5".parseFieldRange.equal([3, 4, 5]));
assert("4-3".parseFieldRange.equal([4, 3]));
assert("10-1".parseFieldRange.equal([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]));
/* Convert to zero-based indices */
assert(parseFieldRange!(size_t, Yes.convertToZeroBasedIndex)("1").equal([0]));
assert("2".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex).equal([1]));
assert("3-4".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex).equal([2, 3]));
assert("3-5".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex).equal([2, 3, 4]));
assert("4-3".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex).equal([3, 2]));
assert("10-1".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex).equal([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]));
/* Allow zero. */
assert("0".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert(parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero)("1").equal([1]));
assert("3-4".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([3, 4]));
assert("10-1".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]));
/* Allow zero, convert to zero-based index. */
assert("0".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([-1]));
assert(parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero)("1").equal([0]));
assert("3-4".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([2, 3]));
assert("10-1".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]));
/* Alternate integer types. */
assert("2".parseFieldRange!uint.equal([2]));
assert("3-5".parseFieldRange!uint.equal([3, 4, 5]));
assert("10-1".parseFieldRange!uint.equal([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]));
assert("2".parseFieldRange!int.equal([2]));
assert("3-5".parseFieldRange!int.equal([3, 4, 5]));
assert("10-1".parseFieldRange!int.equal([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]));
assert("2".parseFieldRange!ushort.equal([2]));
assert("3-5".parseFieldRange!ushort.equal([3, 4, 5]));
assert("10-1".parseFieldRange!ushort.equal([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]));
assert("2".parseFieldRange!short.equal([2]));
assert("3-5".parseFieldRange!short.equal([3, 4, 5]));
assert("10-1".parseFieldRange!short.equal([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]));
assert("0".parseFieldRange!(long, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert("0".parseFieldRange!(uint, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert("0".parseFieldRange!(int, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert("0".parseFieldRange!(ushort, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert("0".parseFieldRange!(short, No.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([0]));
assert("0".parseFieldRange!(int, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([-1]));
assert("0".parseFieldRange!(short, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero).equal([-1]));
/* Max field value cases. */
assert("65535".parseFieldRange!ushort.equal([65535])); // ushort max
assert("65533-65535".parseFieldRange!ushort.equal([65533, 65534, 65535]));
assert("32767".parseFieldRange!short.equal([32767])); // short max
assert("32765-32767".parseFieldRange!short.equal([32765, 32766, 32767]));
assert("32767".parseFieldRange!(short, Yes.convertToZeroBasedIndex).equal([32766]));
/* Error cases. */
assertThrown("".parseFieldRange);
assertThrown(" ".parseFieldRange);
assertThrown("-".parseFieldRange);
assertThrown(" -".parseFieldRange);
assertThrown("- ".parseFieldRange);
assertThrown("1-".parseFieldRange);
assertThrown("-2".parseFieldRange);
assertThrown("-1".parseFieldRange);
assertThrown("1.0".parseFieldRange);
assertThrown("0".parseFieldRange);
assertThrown("0-3".parseFieldRange);
assertThrown("-2-4".parseFieldRange);
assertThrown("2--4".parseFieldRange);
assertThrown("2-".parseFieldRange);
assertThrown("a".parseFieldRange);
assertThrown("0x3".parseFieldRange);
assertThrown("3U".parseFieldRange);
assertThrown("1_000".parseFieldRange);
assertThrown(".".parseFieldRange);
assertThrown("".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown(" ".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("-".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("1-".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("-2".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("-1".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("0".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("0-3".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("-2-4".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("2--4".parseFieldRange!(size_t, Yes.convertToZeroBasedIndex));
assertThrown("".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown(" ".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("1-".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-2".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-1".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("0-3".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-2-4".parseFieldRange!(size_t, No.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown(" ".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("1-".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-2".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-1".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("0-3".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
assertThrown("-2-4".parseFieldRange!(long, Yes.convertToZeroBasedIndex, Yes.allowFieldNumZero));
/* Value out of range cases. */
assertThrown("65536".parseFieldRange!ushort); // One more than ushort max.
assertThrown("65535-65536".parseFieldRange!ushort);
assertThrown("32768".parseFieldRange!short); // One more than short max.
assertThrown("32765-32768".parseFieldRange!short);
// Convert to zero limits signed range.
assertThrown("32768".parseFieldRange!(ushort, Yes.convertToZeroBasedIndex));
assert("32767".parseFieldRange!(ushort, Yes.convertToZeroBasedIndex).equal([32766]));
}
/** [Yes|No.newlineWasRemoved] is a template parameter to throwIfWindowsNewlineOnUnix.
* A Yes value indicates the Unix newline was already removed, as might be done via
* std.File.byLine or similar mechanism.
*/
alias NewlineWasRemoved = Flag!"newlineWasRemoved";
/**
throwIfWindowsLineNewlineOnUnix is used to throw an exception if a Windows/DOS
line ending is found on a build compiled for a Unix platform. This is used by
the TSV Utilities to detect Window/DOS line endings and terminate processing
with an error message to the user.
*/
void throwIfWindowsNewlineOnUnix
(NewlineWasRemoved nlWasRemoved = Yes.newlineWasRemoved)
(const char[] line, const char[] filename, size_t lineNum)
{
version(Posix)
{
static if (nlWasRemoved)
{
immutable bool hasWindowsLineEnding = line.length != 0 && line[$ - 1] == '\r';
}
else
{
immutable bool hasWindowsLineEnding =
line.length > 1 &&
line[$ - 2] == '\r' &&
line[$ - 1] == '\n';
}
if (hasWindowsLineEnding)
{
import std.format;
throw new Exception(
format("Windows/DOS line ending found. Convert file to Unix newlines before processing (e.g. 'dos2unix').\n File: %s, Line: %s",
(filename == "-") ? "Standard Input" : filename, lineNum));
}
}
}
@safe unittest
{
/* Note: Currently only building on Posix. Need to add non-Posix test cases
* if Windows builds are ever done.
*/
version(Posix)
{
import std.exception;
assertNotThrown(throwIfWindowsNewlineOnUnix("", "afile.tsv", 1));
assertNotThrown(throwIfWindowsNewlineOnUnix("a", "afile.tsv", 2));
assertNotThrown(throwIfWindowsNewlineOnUnix("ab", "afile.tsv", 3));
assertNotThrown(throwIfWindowsNewlineOnUnix("abc", "afile.tsv", 4));
assertThrown(throwIfWindowsNewlineOnUnix("\r", "afile.tsv", 1));
assertThrown(throwIfWindowsNewlineOnUnix("a\r", "afile.tsv", 2));
assertThrown(throwIfWindowsNewlineOnUnix("ab\r", "afile.tsv", 3));
assertThrown(throwIfWindowsNewlineOnUnix("abc\r", "afile.tsv", 4));
assertNotThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("\n", "afile.tsv", 1));
assertNotThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("a\n", "afile.tsv", 2));
assertNotThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("ab\n", "afile.tsv", 3));
assertNotThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("abc\n", "afile.tsv", 4));
assertThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("\r\n", "afile.tsv", 5));
assertThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("a\r\n", "afile.tsv", 6));
assertThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("ab\r\n", "afile.tsv", 7));
assertThrown(throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("abc\r\n", "afile.tsv", 8));
/* Standard Input formatting. */
import std.algorithm : endsWith;
bool exceptionCaught = false;
try (throwIfWindowsNewlineOnUnix("\r", "-", 99));
catch (Exception e)
{
assert(e.msg.endsWith("File: Standard Input, Line: 99"));
exceptionCaught = true;
}
finally
{
assert(exceptionCaught);
exceptionCaught = false;
}
try (throwIfWindowsNewlineOnUnix!(No.newlineWasRemoved)("\r\n", "-", 99));
catch (Exception e)
{
assert(e.msg.endsWith("File: Standard Input, Line: 99"));
exceptionCaught = true;
}
finally
{
assert(exceptionCaught);
exceptionCaught = false;
}
}
}
|
D
|
// Copyright (c) 1999-2012 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
// License for redistribution is by either the Artistic License
// in artistic.txt, or the GNU General Public License in gnu.txt.
// See the included readme.txt for details.
module entity;
import core.stdc.ctype;
/*********************************************
* Convert from named entity to its encoding.
* For reference:
* http://www.htmlhelp.com/reference/html40/entities/
* http://www.w3.org/2003/entities/2007/w3centities-f.ent
*/
struct NameId
{
string name;
uint value;
}
immutable NameId[] namesA =
[
{"Aacgr", 0x00386}, // GREEK CAPITAL LETTER ALPHA WITH TONOS
{"aacgr", 0x003AC}, // GREEK SMALL LETTER ALPHA WITH TONOS
{"Aacute", 0x000C1}, // LATIN CAPITAL LETTER A WITH ACUTE
{"aacute", 0x000E1}, // LATIN SMALL LETTER A WITH ACUTE
{"Abreve", 0x00102}, // LATIN CAPITAL LETTER A WITH BREVE
{"abreve", 0x00103}, // LATIN SMALL LETTER A WITH BREVE
{"ac", 0x0223E}, // INVERTED LAZY S
{"acd", 0x0223F}, // SINE WAVE
// {"acE", 0x0223E;0x00333}, // INVERTED LAZY S with double underline
{"Acirc", 0x000C2}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX
{"acirc", 0x000E2}, // LATIN SMALL LETTER A WITH CIRCUMFLEX
{"acute", 0x000B4}, // ACUTE ACCENT
{"Acy", 0x00410}, // CYRILLIC CAPITAL LETTER A
{"acy", 0x00430}, // CYRILLIC SMALL LETTER A
{"AElig", 0x000C6}, // LATIN CAPITAL LETTER AE
{"aelig", 0x000E6}, // LATIN SMALL LETTER AE
{"af", 0x02061}, // FUNCTION APPLICATION
{"Afr", 0x1D504}, // MATHEMATICAL FRAKTUR CAPITAL A
{"afr", 0x1D51E}, // MATHEMATICAL FRAKTUR SMALL A
{"Agr", 0x00391}, // GREEK CAPITAL LETTER ALPHA
{"agr", 0x003B1}, // GREEK SMALL LETTER ALPHA
{"Agrave", 0x000C0}, // LATIN CAPITAL LETTER A WITH GRAVE
{"agrave", 0x000E0}, // LATIN SMALL LETTER A WITH GRAVE
{"alefsym", 0x02135}, // ALEF SYMBOL
{"aleph", 0x02135}, // ALEF SYMBOL
{"Alpha", 0x00391}, // GREEK CAPITAL LETTER ALPHA
{"alpha", 0x003B1}, // GREEK SMALL LETTER ALPHA
{"Amacr", 0x00100}, // LATIN CAPITAL LETTER A WITH MACRON
{"amacr", 0x00101}, // LATIN SMALL LETTER A WITH MACRON
{"amalg", 0x02A3F}, // AMALGAMATION OR COPRODUCT
{"amp", 0x00026}, // AMPERSAND
{"AMP", 0x00026}, // AMPERSAND
{"and", 0x02227}, // LOGICAL AND
{"And", 0x02A53}, // DOUBLE LOGICAL AND
{"andand", 0x02A55}, // TWO INTERSECTING LOGICAL AND
{"andd", 0x02A5C}, // LOGICAL AND WITH HORIZONTAL DASH
{"andslope", 0x02A58}, // SLOPING LARGE AND
{"andv", 0x02A5A}, // LOGICAL AND WITH MIDDLE STEM
{"ang", 0x02220}, // ANGLE
{"ange", 0x029A4}, // ANGLE WITH UNDERBAR
{"angle", 0x02220}, // ANGLE
{"angmsd", 0x02221}, // MEASURED ANGLE
{"angmsdaa", 0x029A8}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT
{"angmsdab", 0x029A9}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND LEFT
{"angmsdac", 0x029AA}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT
{"angmsdad", 0x029AB}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND LEFT
{"angmsdae", 0x029AC}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP
{"angmsdaf", 0x029AD}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND UP
{"angmsdag", 0x029AE}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND DOWN
{"angmsdah", 0x029AF}, // MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND DOWN
{"angrt", 0x0221F}, // RIGHT ANGLE
{"angrtvb", 0x022BE}, // RIGHT ANGLE WITH ARC
{"angrtvbd", 0x0299D}, // MEASURED RIGHT ANGLE WITH DOT
{"angsph", 0x02222}, // SPHERICAL ANGLE
{"angst", 0x000C5}, // LATIN CAPITAL LETTER A WITH RING ABOVE
{"angzarr", 0x0237C}, // RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW
{"Aogon", 0x00104}, // LATIN CAPITAL LETTER A WITH OGONEK
{"aogon", 0x00105}, // LATIN SMALL LETTER A WITH OGONEK
{"Aopf", 0x1D538}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL A
{"aopf", 0x1D552}, // MATHEMATICAL DOUBLE-STRUCK SMALL A
{"ap", 0x02248}, // ALMOST EQUAL TO
{"apacir", 0x02A6F}, // ALMOST EQUAL TO WITH CIRCUMFLEX ACCENT
{"ape", 0x0224A}, // ALMOST EQUAL OR EQUAL TO
{"apE", 0x02A70}, // APPROXIMATELY EQUAL OR EQUAL TO
{"apid", 0x0224B}, // TRIPLE TILDE
{"apos", 0x00027}, // APOSTROPHE
{"ApplyFunction", 0x02061}, // FUNCTION APPLICATION
{"approx", 0x02248}, // ALMOST EQUAL TO
{"approxeq", 0x0224A}, // ALMOST EQUAL OR EQUAL TO
{"Aring", 0x000C5}, // LATIN CAPITAL LETTER A WITH RING ABOVE
{"aring", 0x000E5}, // LATIN SMALL LETTER A WITH RING ABOVE
{"Ascr", 0x1D49C}, // MATHEMATICAL SCRIPT CAPITAL A
{"ascr", 0x1D4B6}, // MATHEMATICAL SCRIPT SMALL A
{"Assign", 0x02254}, // COLON EQUALS
{"ast", 0x0002A}, // ASTERISK
{"asymp", 0x02248}, // ALMOST EQUAL TO
{"asympeq", 0x0224D}, // EQUIVALENT TO
{"Atilde", 0x000C3}, // LATIN CAPITAL LETTER A WITH TILDE
{"atilde", 0x000E3}, // LATIN SMALL LETTER A WITH TILDE
{"Auml", 0x000C4}, // LATIN CAPITAL LETTER A WITH DIAERESIS
{"auml", 0x000E4}, // LATIN SMALL LETTER A WITH DIAERESIS
{"awconint", 0x02233}, // ANTICLOCKWISE CONTOUR INTEGRAL
{"awint", 0x02A11}, // ANTICLOCKWISE INTEGRATION
];
immutable NameId[] namesB =
[
{"backcong", 0x0224C}, // ALL EQUAL TO
{"backepsilon", 0x003F6}, // GREEK REVERSED LUNATE EPSILON SYMBOL
{"backprime", 0x02035}, // REVERSED PRIME
{"backsim", 0x0223D}, // REVERSED TILDE
{"backsimeq", 0x022CD}, // REVERSED TILDE EQUALS
{"Backslash", 0x02216}, // SET MINUS
// "b.alpha", 0x1D6C2}, // MATHEMATICAL BOLD SMALL ALPHA
{"Barv", 0x02AE7}, // SHORT DOWN TACK WITH OVERBAR
{"barvee", 0x022BD}, // NOR
{"barwed", 0x02305}, // PROJECTIVE
{"Barwed", 0x02306}, // PERSPECTIVE
{"barwedge", 0x02305}, // PROJECTIVE
// "b.beta", 0x1D6C3}, // MATHEMATICAL BOLD SMALL BETA
{"bbrk", 0x023B5}, // BOTTOM SQUARE BRACKET
{"bbrktbrk", 0x023B6}, // BOTTOM SQUARE BRACKET OVER TOP SQUARE BRACKET
// "b.chi", 0x1D6D8}, // MATHEMATICAL BOLD SMALL CHI
{"bcong", 0x0224C}, // ALL EQUAL TO
{"Bcy", 0x00411}, // CYRILLIC CAPITAL LETTER BE
{"bcy", 0x00431}, // CYRILLIC SMALL LETTER BE
// "b.Delta", 0x1D6AB}, // MATHEMATICAL BOLD CAPITAL DELTA
// "b.delta", 0x1D6C5}, // MATHEMATICAL BOLD SMALL DELTA
{"bdquo", 0x0201E}, // DOUBLE LOW-9 QUOTATION MARK
{"becaus", 0x02235}, // BECAUSE
{"because", 0x02235}, // BECAUSE
{"Because", 0x02235}, // BECAUSE
{"bemptyv", 0x029B0}, // REVERSED EMPTY SET
{"bepsi", 0x003F6}, // GREEK REVERSED LUNATE EPSILON SYMBOL
// "b.epsi", 0x1D6C6}, // MATHEMATICAL BOLD SMALL EPSILON
// "b.epsiv", 0x1D6DC}, // MATHEMATICAL BOLD EPSILON SYMBOL
{"bernou", 0x0212C}, // SCRIPT CAPITAL B
{"Bernoullis", 0x0212C}, // SCRIPT CAPITAL B
{"Beta", 0x00392}, // GREEK CAPITAL LETTER BETA
{"beta", 0x003B2}, // GREEK SMALL LETTER BETA
// "b.eta", 0x1D6C8}, // MATHEMATICAL BOLD SMALL ETA
{"beth", 0x02136}, // BET SYMBOL
{"between", 0x0226C}, // BETWEEN
{"Bfr", 0x1D505}, // MATHEMATICAL FRAKTUR CAPITAL B
{"bfr", 0x1D51F}, // MATHEMATICAL FRAKTUR SMALL B
// "b.Gamma", 0x1D6AA}, // MATHEMATICAL BOLD CAPITAL GAMMA
// "b.gamma", 0x1D6C4}, // MATHEMATICAL BOLD SMALL GAMMA
// "b.Gammad", 0x1D7CA}, // MATHEMATICAL BOLD CAPITAL DIGAMMA
// "b.gammad", 0x1D7CB}, // MATHEMATICAL BOLD SMALL DIGAMMA
{"Bgr", 0x00392}, // GREEK CAPITAL LETTER BETA
{"bgr", 0x003B2}, // GREEK SMALL LETTER BETA
{"bigcap", 0x022C2}, // N-ARY INTERSECTION
{"bigcirc", 0x025EF}, // LARGE CIRCLE
{"bigcup", 0x022C3}, // N-ARY UNION
{"bigodot", 0x02A00}, // N-ARY CIRCLED DOT OPERATOR
{"bigoplus", 0x02A01}, // N-ARY CIRCLED PLUS OPERATOR
{"bigotimes", 0x02A02}, // N-ARY CIRCLED TIMES OPERATOR
{"bigsqcup", 0x02A06}, // N-ARY SQUARE UNION OPERATOR
{"bigstar", 0x02605}, // BLACK STAR
{"bigtriangledown", 0x025BD}, // WHITE DOWN-POINTING TRIANGLE
{"bigtriangleup", 0x025B3}, // WHITE UP-POINTING TRIANGLE
{"biguplus", 0x02A04}, // N-ARY UNION OPERATOR WITH PLUS
{"bigvee", 0x022C1}, // N-ARY LOGICAL OR
{"bigwedge", 0x022C0}, // N-ARY LOGICAL AND
// "b.iota", 0x1D6CA}, // MATHEMATICAL BOLD SMALL IOTA
// "b.kappa", 0x1D6CB}, // MATHEMATICAL BOLD SMALL KAPPA
// "b.kappav", 0x1D6DE}, // MATHEMATICAL BOLD KAPPA SYMBOL
{"bkarow", 0x0290D}, // RIGHTWARDS DOUBLE DASH ARROW
{"blacklozenge", 0x029EB}, // BLACK LOZENGE
{"blacksquare", 0x025AA}, // BLACK SMALL SQUARE
{"blacktriangle", 0x025B4}, // BLACK UP-POINTING SMALL TRIANGLE
{"blacktriangledown", 0x025BE}, // BLACK DOWN-POINTING SMALL TRIANGLE
{"blacktriangleleft", 0x025C2}, // BLACK LEFT-POINTING SMALL TRIANGLE
{"blacktriangleright", 0x025B8}, // BLACK RIGHT-POINTING SMALL TRIANGLE
// "b.Lambda", 0x1D6B2}, // MATHEMATICAL BOLD CAPITAL LAMDA
// "b.lambda", 0x1D6CC}, // MATHEMATICAL BOLD SMALL LAMDA
{"blank", 0x02423}, // OPEN BOX
{"blk12", 0x02592}, // MEDIUM SHADE
{"blk14", 0x02591}, // LIGHT SHADE
{"blk34", 0x02593}, // DARK SHADE
{"block", 0x02588}, // FULL BLOCK
// "b.mu", 0x1D6CD}, // MATHEMATICAL BOLD SMALL MU
// "bne", 0x0003D;0x020E5}, // EQUALS SIGN with reverse slash
// "bnequiv", 0x02261;0x020E5}, // IDENTICAL TO with reverse slash
{"bnot", 0x02310}, // REVERSED NOT SIGN
{"bNot", 0x02AED}, // REVERSED DOUBLE STROKE NOT SIGN
// "b.nu", 0x1D6CE}, // MATHEMATICAL BOLD SMALL NU
// "b.Omega", 0x1D6C0}, // MATHEMATICAL BOLD CAPITAL OMEGA
// "b.omega", 0x1D6DA}, // MATHEMATICAL BOLD SMALL OMEGA
{"Bopf", 0x1D539}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL B
{"bopf", 0x1D553}, // MATHEMATICAL DOUBLE-STRUCK SMALL B
{"bot", 0x022A5}, // UP TACK
{"bottom", 0x022A5}, // UP TACK
{"bowtie", 0x022C8}, // BOWTIE
{"boxbox", 0x029C9}, // TWO JOINED SQUARES
{"boxdl", 0x02510}, // BOX DRAWINGS LIGHT DOWN AND LEFT
{"boxdL", 0x02555}, // BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
{"boxDl", 0x02556}, // BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
{"boxDL", 0x02557}, // BOX DRAWINGS DOUBLE DOWN AND LEFT
{"boxdr", 0x0250C}, // BOX DRAWINGS LIGHT DOWN AND RIGHT
{"boxdR", 0x02552}, // BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
{"boxDr", 0x02553}, // BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
{"boxDR", 0x02554}, // BOX DRAWINGS DOUBLE DOWN AND RIGHT
{"boxh", 0x02500}, // BOX DRAWINGS LIGHT HORIZONTAL
{"boxH", 0x02550}, // BOX DRAWINGS DOUBLE HORIZONTAL
{"boxhd", 0x0252C}, // BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
{"boxHd", 0x02564}, // BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
{"boxhD", 0x02565}, // BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
{"boxHD", 0x02566}, // BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
{"boxhu", 0x02534}, // BOX DRAWINGS LIGHT UP AND HORIZONTAL
{"boxHu", 0x02567}, // BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
{"boxhU", 0x02568}, // BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
{"boxHU", 0x02569}, // BOX DRAWINGS DOUBLE UP AND HORIZONTAL
{"boxminus", 0x0229F}, // SQUARED MINUS
{"boxplus", 0x0229E}, // SQUARED PLUS
{"boxtimes", 0x022A0}, // SQUARED TIMES
{"boxul", 0x02518}, // BOX DRAWINGS LIGHT UP AND LEFT
{"boxuL", 0x0255B}, // BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
{"boxUl", 0x0255C}, // BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
{"boxUL", 0x0255D}, // BOX DRAWINGS DOUBLE UP AND LEFT
{"boxur", 0x02514}, // BOX DRAWINGS LIGHT UP AND RIGHT
{"boxuR", 0x02558}, // BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
{"boxUr", 0x02559}, // BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
{"boxUR", 0x0255A}, // BOX DRAWINGS DOUBLE UP AND RIGHT
{"boxv", 0x02502}, // BOX DRAWINGS LIGHT VERTICAL
{"boxV", 0x02551}, // BOX DRAWINGS DOUBLE VERTICAL
{"boxvh", 0x0253C}, // BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
{"boxvH", 0x0256A}, // BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
{"boxVh", 0x0256B}, // BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
{"boxVH", 0x0256C}, // BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
{"boxvl", 0x02524}, // BOX DRAWINGS LIGHT VERTICAL AND LEFT
{"boxvL", 0x02561}, // BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
{"boxVl", 0x02562}, // BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
{"boxVL", 0x02563}, // BOX DRAWINGS DOUBLE VERTICAL AND LEFT
{"boxvr", 0x0251C}, // BOX DRAWINGS LIGHT VERTICAL AND RIGHT
{"boxvR", 0x0255E}, // BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
{"boxVr", 0x0255F}, // BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
{"boxVR", 0x02560}, // BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
// "b.Phi", 0x1D6BD}, // MATHEMATICAL BOLD CAPITAL PHI
// "b.phi", 0x1D6D7}, // MATHEMATICAL BOLD SMALL PHI
// "b.phiv", 0x1D6DF}, // MATHEMATICAL BOLD PHI SYMBOL
// "b.Pi", 0x1D6B7}, // MATHEMATICAL BOLD CAPITAL PI
// "b.pi", 0x1D6D1}, // MATHEMATICAL BOLD SMALL PI
// "b.piv", 0x1D6E1}, // MATHEMATICAL BOLD PI SYMBOL
{"bprime", 0x02035}, // REVERSED PRIME
// "b.Psi", 0x1D6BF}, // MATHEMATICAL BOLD CAPITAL PSI
// "b.psi", 0x1D6D9}, // MATHEMATICAL BOLD SMALL PSI
{"breve", 0x002D8}, // BREVE
{"Breve", 0x002D8}, // BREVE
// "b.rho", 0x1D6D2}, // MATHEMATICAL BOLD SMALL RHO
// "b.rhov", 0x1D6E0}, // MATHEMATICAL BOLD RHO SYMBOL
{"brvbar", 0x000A6}, // BROKEN BAR
{"Bscr", 0x0212C}, // SCRIPT CAPITAL B
{"bscr", 0x1D4B7}, // MATHEMATICAL SCRIPT SMALL B
{"bsemi", 0x0204F}, // REVERSED SEMICOLON
// "b.Sigma", 0x1D6BA}, // MATHEMATICAL BOLD CAPITAL SIGMA
// "b.sigma", 0x1D6D4}, // MATHEMATICAL BOLD SMALL SIGMA
// "b.sigmav", 0x1D6D3}, // MATHEMATICAL BOLD SMALL FINAL SIGMA
{"bsim", 0x0223D}, // REVERSED TILDE
{"bsime", 0x022CD}, // REVERSED TILDE EQUALS
{"bsol", 0x0005C}, // REVERSE SOLIDUS
{"bsolb", 0x029C5}, // SQUARED FALLING DIAGONAL SLASH
{"bsolhsub", 0x027C8}, // REVERSE SOLIDUS PRECEDING SUBSET
// "b.tau", 0x1D6D5}, // MATHEMATICAL BOLD SMALL TAU
// "b.Theta", 0x1D6AF}, // MATHEMATICAL BOLD CAPITAL THETA
// "b.thetas", 0x1D6C9}, // MATHEMATICAL BOLD SMALL THETA
// "b.thetav", 0x1D6DD}, // MATHEMATICAL BOLD THETA SYMBOL
{"bull", 0x02022}, // BULLET
{"bullet", 0x02022}, // BULLET
{"bump", 0x0224E}, // GEOMETRICALLY EQUIVALENT TO
{"bumpe", 0x0224F}, // DIFFERENCE BETWEEN
{"bumpE", 0x02AAE}, // EQUALS SIGN WITH BUMPY ABOVE
{"Bumpeq", 0x0224E}, // GEOMETRICALLY EQUIVALENT TO
{"bumpeq", 0x0224F}, // DIFFERENCE BETWEEN
// "b.Upsi", 0x1D6BC}, // MATHEMATICAL BOLD CAPITAL UPSILON
// "b.upsi", 0x1D6D6}, // MATHEMATICAL BOLD SMALL UPSILON
// "b.Xi", 0x1D6B5}, // MATHEMATICAL BOLD CAPITAL XI
// "b.xi", 0x1D6CF}, // MATHEMATICAL BOLD SMALL XI
// "b.zeta", 0x1D6C7}, // MATHEMATICAL BOLD SMALL ZETA
];
immutable NameId[] namesC =
[
{"Cacute", 0x00106}, // LATIN CAPITAL LETTER C WITH ACUTE
{"cacute", 0x00107}, // LATIN SMALL LETTER C WITH ACUTE
{"cap", 0x02229}, // INTERSECTION
{"Cap", 0x022D2}, // DOUBLE INTERSECTION
{"capand", 0x02A44}, // INTERSECTION WITH LOGICAL AND
{"capbrcup", 0x02A49}, // INTERSECTION ABOVE BAR ABOVE UNION
{"capcap", 0x02A4B}, // INTERSECTION BESIDE AND JOINED WITH INTERSECTION
{"capcup", 0x02A47}, // INTERSECTION ABOVE UNION
{"capdot", 0x02A40}, // INTERSECTION WITH DOT
{"CapitalDifferentialD", 0x02145}, // DOUBLE-STRUCK ITALIC CAPITAL D
// "caps", 0x02229;0x0FE00}, // INTERSECTION with serifs
{"caret", 0x02041}, // CARET INSERTION POINT
{"caron", 0x002C7}, // CARON
{"Cayleys", 0x0212D}, // BLACK-LETTER CAPITAL C
{"ccaps", 0x02A4D}, // CLOSED INTERSECTION WITH SERIFS
{"Ccaron", 0x0010C}, // LATIN CAPITAL LETTER C WITH CARON
{"ccaron", 0x0010D}, // LATIN SMALL LETTER C WITH CARON
{"Ccedil", 0x000C7}, // LATIN CAPITAL LETTER C WITH CEDILLA
{"ccedil", 0x000E7}, // LATIN SMALL LETTER C WITH CEDILLA
{"Ccirc", 0x00108}, // LATIN CAPITAL LETTER C WITH CIRCUMFLEX
{"ccirc", 0x00109}, // LATIN SMALL LETTER C WITH CIRCUMFLEX
{"Cconint", 0x02230}, // VOLUME INTEGRAL
{"ccups", 0x02A4C}, // CLOSED UNION WITH SERIFS
{"ccupssm", 0x02A50}, // CLOSED UNION WITH SERIFS AND SMASH PRODUCT
{"Cdot", 0x0010A}, // LATIN CAPITAL LETTER C WITH DOT ABOVE
{"cdot", 0x0010B}, // LATIN SMALL LETTER C WITH DOT ABOVE
{"cedil", 0x000B8}, // CEDILLA
{"Cedilla", 0x000B8}, // CEDILLA
{"cemptyv", 0x029B2}, // EMPTY SET WITH SMALL CIRCLE ABOVE
{"cent", 0x000A2}, // CENT SIGN
{"centerdot", 0x000B7}, // MIDDLE DOT
{"CenterDot", 0x000B7}, // MIDDLE DOT
{"Cfr", 0x0212D}, // BLACK-LETTER CAPITAL C
{"cfr", 0x1D520}, // MATHEMATICAL FRAKTUR SMALL C
{"CHcy", 0x00427}, // CYRILLIC CAPITAL LETTER CHE
{"chcy", 0x00447}, // CYRILLIC SMALL LETTER CHE
{"check", 0x02713}, // CHECK MARK
{"checkmark", 0x02713}, // CHECK MARK
{"Chi", 0x003A7}, // GREEK CAPITAL LETTER CHI
{"chi", 0x003C7}, // GREEK SMALL LETTER CHI
{"cir", 0x025CB}, // WHITE CIRCLE
{"circ", 0x002C6}, // MODIFIER LETTER CIRCUMFLEX ACCENT
{"circeq", 0x02257}, // RING EQUAL TO
{"circlearrowleft", 0x021BA}, // ANTICLOCKWISE OPEN CIRCLE ARROW
{"circlearrowright", 0x021BB}, // CLOCKWISE OPEN CIRCLE ARROW
{"circledast", 0x0229B}, // CIRCLED ASTERISK OPERATOR
{"circledcirc", 0x0229A}, // CIRCLED RING OPERATOR
{"circleddash", 0x0229D}, // CIRCLED DASH
{"CircleDot", 0x02299}, // CIRCLED DOT OPERATOR
{"circledR", 0x000AE}, // REGISTERED SIGN
{"circledS", 0x024C8}, // CIRCLED LATIN CAPITAL LETTER S
{"CircleMinus", 0x02296}, // CIRCLED MINUS
{"CirclePlus", 0x02295}, // CIRCLED PLUS
{"CircleTimes", 0x02297}, // CIRCLED TIMES
{"cire", 0x02257}, // RING EQUAL TO
{"cirE", 0x029C3}, // CIRCLE WITH TWO HORIZONTAL STROKES TO THE RIGHT
{"cirfnint", 0x02A10}, // CIRCULATION FUNCTION
{"cirmid", 0x02AEF}, // VERTICAL LINE WITH CIRCLE ABOVE
{"cirscir", 0x029C2}, // CIRCLE WITH SMALL CIRCLE TO THE RIGHT
{"ClockwiseContourIntegral", 0x02232}, // CLOCKWISE CONTOUR INTEGRAL
{"CloseCurlyDoubleQuote", 0x0201D}, // RIGHT DOUBLE QUOTATION MARK
{"CloseCurlyQuote", 0x02019}, // RIGHT SINGLE QUOTATION MARK
{"clubs", 0x02663}, // BLACK CLUB SUIT
{"clubsuit", 0x02663}, // BLACK CLUB SUIT
{"colon", 0x0003A}, // COLON
{"Colon", 0x02237}, // PROPORTION
{"colone", 0x02254}, // COLON EQUALS
{"Colone", 0x02A74}, // DOUBLE COLON EQUAL
{"coloneq", 0x02254}, // COLON EQUALS
{"comma", 0x0002C}, // COMMA
{"commat", 0x00040}, // COMMERCIAL AT
{"comp", 0x02201}, // COMPLEMENT
{"compfn", 0x02218}, // RING OPERATOR
{"complement", 0x02201}, // COMPLEMENT
{"complexes", 0x02102}, // DOUBLE-STRUCK CAPITAL C
{"cong", 0x02245}, // APPROXIMATELY EQUAL TO
{"congdot", 0x02A6D}, // CONGRUENT WITH DOT ABOVE
{"Congruent", 0x02261}, // IDENTICAL TO
{"conint", 0x0222E}, // CONTOUR INTEGRAL
{"Conint", 0x0222F}, // SURFACE INTEGRAL
{"ContourIntegral", 0x0222E}, // CONTOUR INTEGRAL
{"Copf", 0x02102}, // DOUBLE-STRUCK CAPITAL C
{"copf", 0x1D554}, // MATHEMATICAL DOUBLE-STRUCK SMALL C
{"coprod", 0x02210}, // N-ARY COPRODUCT
{"Coproduct", 0x02210}, // N-ARY COPRODUCT
{"copy", 0x000A9}, // COPYRIGHT SIGN
{"COPY", 0x000A9}, // COPYRIGHT SIGN
{"copysr", 0x02117}, // SOUND RECORDING COPYRIGHT
{"CounterClockwiseContourIntegral", 0x02233}, // ANTICLOCKWISE CONTOUR INTEGRAL
{"crarr", 0x021B5}, // DOWNWARDS ARROW WITH CORNER LEFTWARDS
{"cross", 0x02717}, // BALLOT X
{"Cross", 0x02A2F}, // VECTOR OR CROSS PRODUCT
{"Cscr", 0x1D49E}, // MATHEMATICAL SCRIPT CAPITAL C
{"cscr", 0x1D4B8}, // MATHEMATICAL SCRIPT SMALL C
{"csub", 0x02ACF}, // CLOSED SUBSET
{"csube", 0x02AD1}, // CLOSED SUBSET OR EQUAL TO
{"csup", 0x02AD0}, // CLOSED SUPERSET
{"csupe", 0x02AD2}, // CLOSED SUPERSET OR EQUAL TO
{"ctdot", 0x022EF}, // MIDLINE HORIZONTAL ELLIPSIS
{"cudarrl", 0x02938}, // RIGHT-SIDE ARC CLOCKWISE ARROW
{"cudarrr", 0x02935}, // ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS
{"cuepr", 0x022DE}, // EQUAL TO OR PRECEDES
{"cuesc", 0x022DF}, // EQUAL TO OR SUCCEEDS
{"cularr", 0x021B6}, // ANTICLOCKWISE TOP SEMICIRCLE ARROW
{"cularrp", 0x0293D}, // TOP ARC ANTICLOCKWISE ARROW WITH PLUS
{"cup", 0x0222A}, // UNION
{"Cup", 0x022D3}, // DOUBLE UNION
{"cupbrcap", 0x02A48}, // UNION ABOVE BAR ABOVE INTERSECTION
{"CupCap", 0x0224D}, // EQUIVALENT TO
{"cupcap", 0x02A46}, // UNION ABOVE INTERSECTION
{"cupcup", 0x02A4A}, // UNION BESIDE AND JOINED WITH UNION
{"cupdot", 0x0228D}, // MULTISET MULTIPLICATION
{"cupor", 0x02A45}, // UNION WITH LOGICAL OR
// "cups", 0x0222A;0x0FE00}, // UNION with serifs
{"curarr", 0x021B7}, // CLOCKWISE TOP SEMICIRCLE ARROW
{"curarrm", 0x0293C}, // TOP ARC CLOCKWISE ARROW WITH MINUS
{"curlyeqprec", 0x022DE}, // EQUAL TO OR PRECEDES
{"curlyeqsucc", 0x022DF}, // EQUAL TO OR SUCCEEDS
{"curlyvee", 0x022CE}, // CURLY LOGICAL OR
{"curlywedge", 0x022CF}, // CURLY LOGICAL AND
{"curren", 0x000A4}, // CURRENCY SIGN
{"curvearrowleft", 0x021B6}, // ANTICLOCKWISE TOP SEMICIRCLE ARROW
{"curvearrowright", 0x021B7}, // CLOCKWISE TOP SEMICIRCLE ARROW
{"cuvee", 0x022CE}, // CURLY LOGICAL OR
{"cuwed", 0x022CF}, // CURLY LOGICAL AND
{"cwconint", 0x02232}, // CLOCKWISE CONTOUR INTEGRAL
{"cwint", 0x02231}, // CLOCKWISE INTEGRAL
{"cylcty", 0x0232D}, // CYLINDRICITY
];
immutable NameId[] namesD =
[
{"dagger", 0x02020}, // DAGGER
{"Dagger", 0x02021}, // DOUBLE DAGGER
{"daleth", 0x02138}, // DALET SYMBOL
{"darr", 0x02193}, // DOWNWARDS ARROW
{"Darr", 0x021A1}, // DOWNWARDS TWO HEADED ARROW
{"dArr", 0x021D3}, // DOWNWARDS DOUBLE ARROW
{"dash", 0x02010}, // HYPHEN
{"dashv", 0x022A3}, // LEFT TACK
{"Dashv", 0x02AE4}, // VERTICAL BAR DOUBLE LEFT TURNSTILE
{"dbkarow", 0x0290F}, // RIGHTWARDS TRIPLE DASH ARROW
{"dblac", 0x002DD}, // DOUBLE ACUTE ACCENT
{"Dcaron", 0x0010E}, // LATIN CAPITAL LETTER D WITH CARON
{"dcaron", 0x0010F}, // LATIN SMALL LETTER D WITH CARON
{"Dcy", 0x00414}, // CYRILLIC CAPITAL LETTER DE
{"dcy", 0x00434}, // CYRILLIC SMALL LETTER DE
{"DD", 0x02145}, // DOUBLE-STRUCK ITALIC CAPITAL D
{"dd", 0x02146}, // DOUBLE-STRUCK ITALIC SMALL D
{"ddagger", 0x02021}, // DOUBLE DAGGER
{"ddarr", 0x021CA}, // DOWNWARDS PAIRED ARROWS
{"DDotrahd", 0x02911}, // RIGHTWARDS ARROW WITH DOTTED STEM
{"ddotseq", 0x02A77}, // EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
{"deg", 0x000B0}, // DEGREE SIGN
{"Del", 0x02207}, // NABLA
{"Delta", 0x00394}, // GREEK CAPITAL LETTER DELTA
{"delta", 0x003B4}, // GREEK SMALL LETTER DELTA
{"demptyv", 0x029B1}, // EMPTY SET WITH OVERBAR
{"dfisht", 0x0297F}, // DOWN FISH TAIL
{"Dfr", 0x1D507}, // MATHEMATICAL FRAKTUR CAPITAL D
{"dfr", 0x1D521}, // MATHEMATICAL FRAKTUR SMALL D
{"Dgr", 0x00394}, // GREEK CAPITAL LETTER DELTA
{"dgr", 0x003B4}, // GREEK SMALL LETTER DELTA
{"dHar", 0x02965}, // DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
{"dharl", 0x021C3}, // DOWNWARDS HARPOON WITH BARB LEFTWARDS
{"dharr", 0x021C2}, // DOWNWARDS HARPOON WITH BARB RIGHTWARDS
{"DiacriticalAcute", 0x000B4}, // ACUTE ACCENT
{"DiacriticalDot", 0x002D9}, // DOT ABOVE
{"DiacriticalDoubleAcute", 0x002DD}, // DOUBLE ACUTE ACCENT
{"DiacriticalGrave", 0x00060}, // GRAVE ACCENT
{"DiacriticalTilde", 0x002DC}, // SMALL TILDE
{"diam", 0x022C4}, // DIAMOND OPERATOR
{"diamond", 0x022C4}, // DIAMOND OPERATOR
{"Diamond", 0x022C4}, // DIAMOND OPERATOR
{"diamondsuit", 0x02666}, // BLACK DIAMOND SUIT
{"diams", 0x02666}, // BLACK DIAMOND SUIT
{"die", 0x000A8}, // DIAERESIS
{"DifferentialD", 0x02146}, // DOUBLE-STRUCK ITALIC SMALL D
{"digamma", 0x003DD}, // GREEK SMALL LETTER DIGAMMA
{"disin", 0x022F2}, // ELEMENT OF WITH LONG HORIZONTAL STROKE
{"div", 0x000F7}, // DIVISION SIGN
{"divide", 0x000F7}, // DIVISION SIGN
{"divideontimes", 0x022C7}, // DIVISION TIMES
{"divonx", 0x022C7}, // DIVISION TIMES
{"DJcy", 0x00402}, // CYRILLIC CAPITAL LETTER DJE
{"djcy", 0x00452}, // CYRILLIC SMALL LETTER DJE
{"dlcorn", 0x0231E}, // BOTTOM LEFT CORNER
{"dlcrop", 0x0230D}, // BOTTOM LEFT CROP
{"dollar", 0x00024}, // DOLLAR SIGN
{"Dopf", 0x1D53B}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL D
{"dopf", 0x1D555}, // MATHEMATICAL DOUBLE-STRUCK SMALL D
{"Dot", 0x000A8}, // DIAERESIS
{"dot", 0x002D9}, // DOT ABOVE
{"DotDot", 0x020DC}, // COMBINING FOUR DOTS ABOVE
{"doteq", 0x02250}, // APPROACHES THE LIMIT
{"doteqdot", 0x02251}, // GEOMETRICALLY EQUAL TO
{"DotEqual", 0x02250}, // APPROACHES THE LIMIT
{"dotminus", 0x02238}, // DOT MINUS
{"dotplus", 0x02214}, // DOT PLUS
{"dotsquare", 0x022A1}, // SQUARED DOT OPERATOR
{"doublebarwedge", 0x02306}, // PERSPECTIVE
{"DoubleContourIntegral", 0x0222F}, // SURFACE INTEGRAL
{"DoubleDot", 0x000A8}, // DIAERESIS
{"DoubleDownArrow", 0x021D3}, // DOWNWARDS DOUBLE ARROW
{"DoubleLeftArrow", 0x021D0}, // LEFTWARDS DOUBLE ARROW
{"DoubleLeftRightArrow", 0x021D4}, // LEFT RIGHT DOUBLE ARROW
{"DoubleLeftTee", 0x02AE4}, // VERTICAL BAR DOUBLE LEFT TURNSTILE
{"DoubleLongLeftArrow", 0x027F8}, // LONG LEFTWARDS DOUBLE ARROW
{"DoubleLongLeftRightArrow", 0x027FA}, // LONG LEFT RIGHT DOUBLE ARROW
{"DoubleLongRightArrow", 0x027F9}, // LONG RIGHTWARDS DOUBLE ARROW
{"DoubleRightArrow", 0x021D2}, // RIGHTWARDS DOUBLE ARROW
{"DoubleRightTee", 0x022A8}, // TRUE
{"DoubleUpArrow", 0x021D1}, // UPWARDS DOUBLE ARROW
{"DoubleUpDownArrow", 0x021D5}, // UP DOWN DOUBLE ARROW
{"DoubleVerticalBar", 0x02225}, // PARALLEL TO
{"downarrow", 0x02193}, // DOWNWARDS ARROW
{"DownArrow", 0x02193}, // DOWNWARDS ARROW
{"Downarrow", 0x021D3}, // DOWNWARDS DOUBLE ARROW
{"DownArrowBar", 0x02913}, // DOWNWARDS ARROW TO BAR
{"DownArrowUpArrow", 0x021F5}, // DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
{"DownBreve", 0x00311}, // COMBINING INVERTED BREVE
{"downdownarrows", 0x021CA}, // DOWNWARDS PAIRED ARROWS
{"downharpoonleft", 0x021C3}, // DOWNWARDS HARPOON WITH BARB LEFTWARDS
{"downharpoonright", 0x021C2}, // DOWNWARDS HARPOON WITH BARB RIGHTWARDS
{"DownLeftRightVector", 0x02950}, // LEFT BARB DOWN RIGHT BARB DOWN HARPOON
{"DownLeftTeeVector", 0x0295E}, // LEFTWARDS HARPOON WITH BARB DOWN FROM BAR
{"DownLeftVector", 0x021BD}, // LEFTWARDS HARPOON WITH BARB DOWNWARDS
{"DownLeftVectorBar", 0x02956}, // LEFTWARDS HARPOON WITH BARB DOWN TO BAR
{"DownRightTeeVector", 0x0295F}, // RIGHTWARDS HARPOON WITH BARB DOWN FROM BAR
{"DownRightVector", 0x021C1}, // RIGHTWARDS HARPOON WITH BARB DOWNWARDS
{"DownRightVectorBar", 0x02957}, // RIGHTWARDS HARPOON WITH BARB DOWN TO BAR
{"DownTee", 0x022A4}, // DOWN TACK
{"DownTeeArrow", 0x021A7}, // DOWNWARDS ARROW FROM BAR
{"drbkarow", 0x02910}, // RIGHTWARDS TWO-HEADED TRIPLE DASH ARROW
{"drcorn", 0x0231F}, // BOTTOM RIGHT CORNER
{"drcrop", 0x0230C}, // BOTTOM RIGHT CROP
{"Dscr", 0x1D49F}, // MATHEMATICAL SCRIPT CAPITAL D
{"dscr", 0x1D4B9}, // MATHEMATICAL SCRIPT SMALL D
{"DScy", 0x00405}, // CYRILLIC CAPITAL LETTER DZE
{"dscy", 0x00455}, // CYRILLIC SMALL LETTER DZE
{"dsol", 0x029F6}, // SOLIDUS WITH OVERBAR
{"Dstrok", 0x00110}, // LATIN CAPITAL LETTER D WITH STROKE
{"dstrok", 0x00111}, // LATIN SMALL LETTER D WITH STROKE
{"dtdot", 0x022F1}, // DOWN RIGHT DIAGONAL ELLIPSIS
{"dtri", 0x025BF}, // WHITE DOWN-POINTING SMALL TRIANGLE
{"dtrif", 0x025BE}, // BLACK DOWN-POINTING SMALL TRIANGLE
{"duarr", 0x021F5}, // DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
{"duhar", 0x0296F}, // DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
{"dwangle", 0x029A6}, // OBLIQUE ANGLE OPENING UP
{"DZcy", 0x0040F}, // CYRILLIC CAPITAL LETTER DZHE
{"dzcy", 0x0045F}, // CYRILLIC SMALL LETTER DZHE
{"dzigrarr", 0x027FF}, // LONG RIGHTWARDS SQUIGGLE ARROW
];
immutable NameId[] namesE =
[
{"Eacgr", 0x00388}, // GREEK CAPITAL LETTER EPSILON WITH TONOS
{"eacgr", 0x003AD}, // GREEK SMALL LETTER EPSILON WITH TONOS
{"Eacute", 0x000C9}, // LATIN CAPITAL LETTER E WITH ACUTE
{"eacute", 0x000E9}, // LATIN SMALL LETTER E WITH ACUTE
{"easter", 0x02A6E}, // EQUALS WITH ASTERISK
{"Ecaron", 0x0011A}, // LATIN CAPITAL LETTER E WITH CARON
{"ecaron", 0x0011B}, // LATIN SMALL LETTER E WITH CARON
{"ecir", 0x02256}, // RING IN EQUAL TO
{"Ecirc", 0x000CA}, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX
{"ecirc", 0x000EA}, // LATIN SMALL LETTER E WITH CIRCUMFLEX
{"ecolon", 0x02255}, // EQUALS COLON
{"Ecy", 0x0042D}, // CYRILLIC CAPITAL LETTER E
{"ecy", 0x0044D}, // CYRILLIC SMALL LETTER E
{"eDDot", 0x02A77}, // EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
{"Edot", 0x00116}, // LATIN CAPITAL LETTER E WITH DOT ABOVE
{"edot", 0x00117}, // LATIN SMALL LETTER E WITH DOT ABOVE
{"eDot", 0x02251}, // GEOMETRICALLY EQUAL TO
{"ee", 0x02147}, // DOUBLE-STRUCK ITALIC SMALL E
{"EEacgr", 0x00389}, // GREEK CAPITAL LETTER ETA WITH TONOS
{"eeacgr", 0x003AE}, // GREEK SMALL LETTER ETA WITH TONOS
{"EEgr", 0x00397}, // GREEK CAPITAL LETTER ETA
{"eegr", 0x003B7}, // GREEK SMALL LETTER ETA
{"efDot", 0x02252}, // APPROXIMATELY EQUAL TO OR THE IMAGE OF
{"Efr", 0x1D508}, // MATHEMATICAL FRAKTUR CAPITAL E
{"efr", 0x1D522}, // MATHEMATICAL FRAKTUR SMALL E
{"eg", 0x02A9A}, // DOUBLE-LINE EQUAL TO OR GREATER-THAN
{"Egr", 0x00395}, // GREEK CAPITAL LETTER EPSILON
{"egr", 0x003B5}, // GREEK SMALL LETTER EPSILON
{"Egrave", 0x000C8}, // LATIN CAPITAL LETTER E WITH GRAVE
{"egrave", 0x000E8}, // LATIN SMALL LETTER E WITH GRAVE
{"egs", 0x02A96}, // SLANTED EQUAL TO OR GREATER-THAN
{"egsdot", 0x02A98}, // SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE
{"el", 0x02A99}, // DOUBLE-LINE EQUAL TO OR LESS-THAN
{"Element", 0x02208}, // ELEMENT OF
{"elinters", 0x023E7}, // ELECTRICAL INTERSECTION
{"ell", 0x02113}, // SCRIPT SMALL L
{"els", 0x02A95}, // SLANTED EQUAL TO OR LESS-THAN
{"elsdot", 0x02A97}, // SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE
{"Emacr", 0x00112}, // LATIN CAPITAL LETTER E WITH MACRON
{"emacr", 0x00113}, // LATIN SMALL LETTER E WITH MACRON
{"empty", 0x02205}, // EMPTY SET
{"emptyset", 0x02205}, // EMPTY SET
{"EmptySmallSquare", 0x025FB}, // WHITE MEDIUM SQUARE
{"emptyv", 0x02205}, // EMPTY SET
{"EmptyVerySmallSquare", 0x025AB}, // WHITE SMALL SQUARE
{"emsp", 0x02003}, // EM SPACE
{"emsp13", 0x02004}, // THREE-PER-EM SPACE
{"emsp14", 0x02005}, // FOUR-PER-EM SPACE
{"ENG", 0x0014A}, // LATIN CAPITAL LETTER ENG
{"eng", 0x0014B}, // LATIN SMALL LETTER ENG
{"ensp", 0x02002}, // EN SPACE
{"Eogon", 0x00118}, // LATIN CAPITAL LETTER E WITH OGONEK
{"eogon", 0x00119}, // LATIN SMALL LETTER E WITH OGONEK
{"Eopf", 0x1D53C}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL E
{"eopf", 0x1D556}, // MATHEMATICAL DOUBLE-STRUCK SMALL E
{"epar", 0x022D5}, // EQUAL AND PARALLEL TO
{"eparsl", 0x029E3}, // EQUALS SIGN AND SLANTED PARALLEL
{"eplus", 0x02A71}, // EQUALS SIGN ABOVE PLUS SIGN
{"epsi", 0x003B5}, // GREEK SMALL LETTER EPSILON
{"Epsilon", 0x00395}, // GREEK CAPITAL LETTER EPSILON
{"epsilon", 0x003B5}, // GREEK SMALL LETTER EPSILON
{"epsiv", 0x003F5}, // GREEK LUNATE EPSILON SYMBOL
{"eqcirc", 0x02256}, // RING IN EQUAL TO
{"eqcolon", 0x02255}, // EQUALS COLON
{"eqsim", 0x02242}, // MINUS TILDE
{"eqslantgtr", 0x02A96}, // SLANTED EQUAL TO OR GREATER-THAN
{"eqslantless", 0x02A95}, // SLANTED EQUAL TO OR LESS-THAN
{"Equal", 0x02A75}, // TWO CONSECUTIVE EQUALS SIGNS
{"equals", 0x0003D}, // EQUALS SIGN
{"EqualTilde", 0x02242}, // MINUS TILDE
{"equest", 0x0225F}, // QUESTIONED EQUAL TO
{"Equilibrium", 0x021CC}, // RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
{"equiv", 0x02261}, // IDENTICAL TO
{"equivDD", 0x02A78}, // EQUIVALENT WITH FOUR DOTS ABOVE
{"eqvparsl", 0x029E5}, // IDENTICAL TO AND SLANTED PARALLEL
{"erarr", 0x02971}, // EQUALS SIGN ABOVE RIGHTWARDS ARROW
{"erDot", 0x02253}, // IMAGE OF OR APPROXIMATELY EQUAL TO
{"escr", 0x0212F}, // SCRIPT SMALL E
{"Escr", 0x02130}, // SCRIPT CAPITAL E
{"esdot", 0x02250}, // APPROACHES THE LIMIT
{"esim", 0x02242}, // MINUS TILDE
{"Esim", 0x02A73}, // EQUALS SIGN ABOVE TILDE OPERATOR
{"Eta", 0x00397}, // GREEK CAPITAL LETTER ETA
{"eta", 0x003B7}, // GREEK SMALL LETTER ETA
{"ETH", 0x000D0}, // LATIN CAPITAL LETTER ETH
{"eth", 0x000F0}, // LATIN SMALL LETTER ETH
{"Euml", 0x000CB}, // LATIN CAPITAL LETTER E WITH DIAERESIS
{"euml", 0x000EB}, // LATIN SMALL LETTER E WITH DIAERESIS
{"euro", 0x020AC}, // EURO SIGN
{"excl", 0x00021}, // EXCLAMATION MARK
{"exist", 0x02203}, // THERE EXISTS
{"Exists", 0x02203}, // THERE EXISTS
{"expectation", 0x02130}, // SCRIPT CAPITAL E
{"exponentiale", 0x02147}, // DOUBLE-STRUCK ITALIC SMALL E
{"ExponentialE", 0x02147}, // DOUBLE-STRUCK ITALIC SMALL E
];
immutable NameId[] namesF =
[
{"fallingdotseq", 0x02252}, // APPROXIMATELY EQUAL TO OR THE IMAGE OF
{"Fcy", 0x00424}, // CYRILLIC CAPITAL LETTER EF
{"fcy", 0x00444}, // CYRILLIC SMALL LETTER EF
{"female", 0x02640}, // FEMALE SIGN
{"ffilig", 0x0FB03}, // LATIN SMALL LIGATURE FFI
{"fflig", 0x0FB00}, // LATIN SMALL LIGATURE FF
{"ffllig", 0x0FB04}, // LATIN SMALL LIGATURE FFL
{"Ffr", 0x1D509}, // MATHEMATICAL FRAKTUR CAPITAL F
{"ffr", 0x1D523}, // MATHEMATICAL FRAKTUR SMALL F
{"filig", 0x0FB01}, // LATIN SMALL LIGATURE FI
{"FilledSmallSquare", 0x025FC}, // BLACK MEDIUM SQUARE
{"FilledVerySmallSquare", 0x025AA}, // BLACK SMALL SQUARE
// "fjlig", 0x00066;0x0006A}, // fj ligature
{"flat", 0x0266D}, // MUSIC FLAT SIGN
{"fllig", 0x0FB02}, // LATIN SMALL LIGATURE FL
{"fltns", 0x025B1}, // WHITE PARALLELOGRAM
{"fnof", 0x00192}, // LATIN SMALL LETTER F WITH HOOK
{"Fopf", 0x1D53D}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL F
{"fopf", 0x1D557}, // MATHEMATICAL DOUBLE-STRUCK SMALL F
{"forall", 0x02200}, // FOR ALL
{"ForAll", 0x02200}, // FOR ALL
{"fork", 0x022D4}, // PITCHFORK
{"forkv", 0x02AD9}, // ELEMENT OF OPENING DOWNWARDS
{"Fouriertrf", 0x02131}, // SCRIPT CAPITAL F
{"fpartint", 0x02A0D}, // FINITE PART INTEGRAL
{"frac12", 0x000BD}, // VULGAR FRACTION ONE HALF
{"frac13", 0x02153}, // VULGAR FRACTION ONE THIRD
{"frac14", 0x000BC}, // VULGAR FRACTION ONE QUARTER
{"frac15", 0x02155}, // VULGAR FRACTION ONE FIFTH
{"frac16", 0x02159}, // VULGAR FRACTION ONE SIXTH
{"frac18", 0x0215B}, // VULGAR FRACTION ONE EIGHTH
{"frac23", 0x02154}, // VULGAR FRACTION TWO THIRDS
{"frac25", 0x02156}, // VULGAR FRACTION TWO FIFTHS
{"frac34", 0x000BE}, // VULGAR FRACTION THREE QUARTERS
{"frac35", 0x02157}, // VULGAR FRACTION THREE FIFTHS
{"frac38", 0x0215C}, // VULGAR FRACTION THREE EIGHTHS
{"frac45", 0x02158}, // VULGAR FRACTION FOUR FIFTHS
{"frac56", 0x0215A}, // VULGAR FRACTION FIVE SIXTHS
{"frac58", 0x0215D}, // VULGAR FRACTION FIVE EIGHTHS
{"frac78", 0x0215E}, // VULGAR FRACTION SEVEN EIGHTHS
{"frasl", 0x02044}, // FRACTION SLASH
{"frown", 0x02322}, // FROWN
{"Fscr", 0x02131}, // SCRIPT CAPITAL F
{"fscr", 0x1D4BB}, // MATHEMATICAL SCRIPT SMALL F
];
immutable NameId[] namesG =
[
{"gacute", 0x001F5}, // LATIN SMALL LETTER G WITH ACUTE
{"Gamma", 0x00393}, // GREEK CAPITAL LETTER GAMMA
{"gamma", 0x003B3}, // GREEK SMALL LETTER GAMMA
{"Gammad", 0x003DC}, // GREEK LETTER DIGAMMA
{"gammad", 0x003DD}, // GREEK SMALL LETTER DIGAMMA
{"gap", 0x02A86}, // GREATER-THAN OR APPROXIMATE
{"Gbreve", 0x0011E}, // LATIN CAPITAL LETTER G WITH BREVE
{"gbreve", 0x0011F}, // LATIN SMALL LETTER G WITH BREVE
{"Gcedil", 0x00122}, // LATIN CAPITAL LETTER G WITH CEDILLA
{"Gcirc", 0x0011C}, // LATIN CAPITAL LETTER G WITH CIRCUMFLEX
{"gcirc", 0x0011D}, // LATIN SMALL LETTER G WITH CIRCUMFLEX
{"Gcy", 0x00413}, // CYRILLIC CAPITAL LETTER GHE
{"gcy", 0x00433}, // CYRILLIC SMALL LETTER GHE
{"Gdot", 0x00120}, // LATIN CAPITAL LETTER G WITH DOT ABOVE
{"gdot", 0x00121}, // LATIN SMALL LETTER G WITH DOT ABOVE
{"ge", 0x02265}, // GREATER-THAN OR EQUAL TO
{"gE", 0x02267}, // GREATER-THAN OVER EQUAL TO
{"gel", 0x022DB}, // GREATER-THAN EQUAL TO OR LESS-THAN
{"gEl", 0x02A8C}, // GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
{"geq", 0x02265}, // GREATER-THAN OR EQUAL TO
{"geqq", 0x02267}, // GREATER-THAN OVER EQUAL TO
{"geqslant", 0x02A7E}, // GREATER-THAN OR SLANTED EQUAL TO
{"ges", 0x02A7E}, // GREATER-THAN OR SLANTED EQUAL TO
{"gescc", 0x02AA9}, // GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
{"gesdot", 0x02A80}, // GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
{"gesdoto", 0x02A82}, // GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
{"gesdotol", 0x02A84}, // GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT
// "gesl", 0x022DB;0x0FE00}, // GREATER-THAN slanted EQUAL TO OR LESS-THAN
{"gesles", 0x02A94}, // GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL
{"Gfr", 0x1D50A}, // MATHEMATICAL FRAKTUR CAPITAL G
{"gfr", 0x1D524}, // MATHEMATICAL FRAKTUR SMALL G
{"gg", 0x0226B}, // MUCH GREATER-THAN
{"Gg", 0x022D9}, // VERY MUCH GREATER-THAN
{"ggg", 0x022D9}, // VERY MUCH GREATER-THAN
{"Ggr", 0x00393}, // GREEK CAPITAL LETTER GAMMA
{"ggr", 0x003B3}, // GREEK SMALL LETTER GAMMA
{"gimel", 0x02137}, // GIMEL SYMBOL
{"GJcy", 0x00403}, // CYRILLIC CAPITAL LETTER GJE
{"gjcy", 0x00453}, // CYRILLIC SMALL LETTER GJE
{"gl", 0x02277}, // GREATER-THAN OR LESS-THAN
{"gla", 0x02AA5}, // GREATER-THAN BESIDE LESS-THAN
{"glE", 0x02A92}, // GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL
{"glj", 0x02AA4}, // GREATER-THAN OVERLAPPING LESS-THAN
{"gnap", 0x02A8A}, // GREATER-THAN AND NOT APPROXIMATE
{"gnapprox", 0x02A8A}, // GREATER-THAN AND NOT APPROXIMATE
{"gnE", 0x02269}, // GREATER-THAN BUT NOT EQUAL TO
{"gne", 0x02A88}, // GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
{"gneq", 0x02A88}, // GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
{"gneqq", 0x02269}, // GREATER-THAN BUT NOT EQUAL TO
{"gnsim", 0x022E7}, // GREATER-THAN BUT NOT EQUIVALENT TO
{"Gopf", 0x1D53E}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL G
{"gopf", 0x1D558}, // MATHEMATICAL DOUBLE-STRUCK SMALL G
{"grave", 0x00060}, // GRAVE ACCENT
{"GreaterEqual", 0x02265}, // GREATER-THAN OR EQUAL TO
{"GreaterEqualLess", 0x022DB}, // GREATER-THAN EQUAL TO OR LESS-THAN
{"GreaterFullEqual", 0x02267}, // GREATER-THAN OVER EQUAL TO
{"GreaterGreater", 0x02AA2}, // DOUBLE NESTED GREATER-THAN
{"GreaterLess", 0x02277}, // GREATER-THAN OR LESS-THAN
{"GreaterSlantEqual", 0x02A7E}, // GREATER-THAN OR SLANTED EQUAL TO
{"GreaterTilde", 0x02273}, // GREATER-THAN OR EQUIVALENT TO
{"gscr", 0x0210A}, // SCRIPT SMALL G
{"Gscr", 0x1D4A2}, // MATHEMATICAL SCRIPT CAPITAL G
{"gsim", 0x02273}, // GREATER-THAN OR EQUIVALENT TO
{"gsime", 0x02A8E}, // GREATER-THAN ABOVE SIMILAR OR EQUAL
{"gsiml", 0x02A90}, // GREATER-THAN ABOVE SIMILAR ABOVE LESS-THAN
{"gt", 0x0003E}, // GREATER-THAN SIGN
{"GT", 0x0003E}, // GREATER-THAN SIGN
{"Gt", 0x0226B}, // MUCH GREATER-THAN
{"gtcc", 0x02AA7}, // GREATER-THAN CLOSED BY CURVE
{"gtcir", 0x02A7A}, // GREATER-THAN WITH CIRCLE INSIDE
{"gtdot", 0x022D7}, // GREATER-THAN WITH DOT
{"gtlPar", 0x02995}, // DOUBLE LEFT ARC GREATER-THAN BRACKET
{"gtquest", 0x02A7C}, // GREATER-THAN WITH QUESTION MARK ABOVE
{"gtrapprox", 0x02A86}, // GREATER-THAN OR APPROXIMATE
{"gtrarr", 0x02978}, // GREATER-THAN ABOVE RIGHTWARDS ARROW
{"gtrdot", 0x022D7}, // GREATER-THAN WITH DOT
{"gtreqless", 0x022DB}, // GREATER-THAN EQUAL TO OR LESS-THAN
{"gtreqqless", 0x02A8C}, // GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
{"gtrless", 0x02277}, // GREATER-THAN OR LESS-THAN
{"gtrsim", 0x02273}, // GREATER-THAN OR EQUIVALENT TO
// "gvertneqq", 0x02269;0x0FE00}, // GREATER-THAN BUT NOT EQUAL TO - with vertical stroke
// "gvnE", 0x02269;0x0FE00}, // GREATER-THAN BUT NOT EQUAL TO - with vertical stroke
];
immutable NameId[] namesH =
[
{"Hacek", 0x002C7}, // CARON
{"hairsp", 0x0200A}, // HAIR SPACE
{"half", 0x000BD}, // VULGAR FRACTION ONE HALF
{"hamilt", 0x0210B}, // SCRIPT CAPITAL H
{"HARDcy", 0x0042A}, // CYRILLIC CAPITAL LETTER HARD SIGN
{"hardcy", 0x0044A}, // CYRILLIC SMALL LETTER HARD SIGN
{"harr", 0x02194}, // LEFT RIGHT ARROW
{"hArr", 0x021D4}, // LEFT RIGHT DOUBLE ARROW
{"harrcir", 0x02948}, // LEFT RIGHT ARROW THROUGH SMALL CIRCLE
{"harrw", 0x021AD}, // LEFT RIGHT WAVE ARROW
{"Hat", 0x0005E}, // CIRCUMFLEX ACCENT
{"hbar", 0x0210F}, // PLANCK CONSTANT OVER TWO PI
{"Hcirc", 0x00124}, // LATIN CAPITAL LETTER H WITH CIRCUMFLEX
{"hcirc", 0x00125}, // LATIN SMALL LETTER H WITH CIRCUMFLEX
{"hearts", 0x02665}, // BLACK HEART SUIT
{"heartsuit", 0x02665}, // BLACK HEART SUIT
{"hellip", 0x02026}, // HORIZONTAL ELLIPSIS
{"hercon", 0x022B9}, // HERMITIAN CONJUGATE MATRIX
{"Hfr", 0x0210C}, // BLACK-LETTER CAPITAL H
{"hfr", 0x1D525}, // MATHEMATICAL FRAKTUR SMALL H
{"HilbertSpace", 0x0210B}, // SCRIPT CAPITAL H
{"hksearow", 0x02925}, // SOUTH EAST ARROW WITH HOOK
{"hkswarow", 0x02926}, // SOUTH WEST ARROW WITH HOOK
{"hoarr", 0x021FF}, // LEFT RIGHT OPEN-HEADED ARROW
{"homtht", 0x0223B}, // HOMOTHETIC
{"hookleftarrow", 0x021A9}, // LEFTWARDS ARROW WITH HOOK
{"hookrightarrow", 0x021AA}, // RIGHTWARDS ARROW WITH HOOK
{"Hopf", 0x0210D}, // DOUBLE-STRUCK CAPITAL H
{"hopf", 0x1D559}, // MATHEMATICAL DOUBLE-STRUCK SMALL H
{"horbar", 0x02015}, // HORIZONTAL BAR
{"HorizontalLine", 0x02500}, // BOX DRAWINGS LIGHT HORIZONTAL
{"Hscr", 0x0210B}, // SCRIPT CAPITAL H
{"hscr", 0x1D4BD}, // MATHEMATICAL SCRIPT SMALL H
{"hslash", 0x0210F}, // PLANCK CONSTANT OVER TWO PI
{"Hstrok", 0x00126}, // LATIN CAPITAL LETTER H WITH STROKE
{"hstrok", 0x00127}, // LATIN SMALL LETTER H WITH STROKE
{"HumpDownHump", 0x0224E}, // GEOMETRICALLY EQUIVALENT TO
{"HumpEqual", 0x0224F}, // DIFFERENCE BETWEEN
{"hybull", 0x02043}, // HYPHEN BULLET
{"hyphen", 0x02010}, // HYPHEN
];
immutable NameId[] namesI =
[
{"Iacgr", 0x0038A}, // GREEK CAPITAL LETTER IOTA WITH TONOS
{"iacgr", 0x003AF}, // GREEK SMALL LETTER IOTA WITH TONOS
{"Iacute", 0x000CD}, // LATIN CAPITAL LETTER I WITH ACUTE
{"iacute", 0x000ED}, // LATIN SMALL LETTER I WITH ACUTE
{"ic", 0x02063}, // INVISIBLE SEPARATOR
{"Icirc", 0x000CE}, // LATIN CAPITAL LETTER I WITH CIRCUMFLEX
{"icirc", 0x000EE}, // LATIN SMALL LETTER I WITH CIRCUMFLEX
{"Icy", 0x00418}, // CYRILLIC CAPITAL LETTER I
{"icy", 0x00438}, // CYRILLIC SMALL LETTER I
{"idiagr", 0x00390}, // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
{"Idigr", 0x003AA}, // GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
{"idigr", 0x003CA}, // GREEK SMALL LETTER IOTA WITH DIALYTIKA
{"Idot", 0x00130}, // LATIN CAPITAL LETTER I WITH DOT ABOVE
{"IEcy", 0x00415}, // CYRILLIC CAPITAL LETTER IE
{"iecy", 0x00435}, // CYRILLIC SMALL LETTER IE
{"iexcl", 0x000A1}, // INVERTED EXCLAMATION MARK
{"iff", 0x021D4}, // LEFT RIGHT DOUBLE ARROW
{"Ifr", 0x02111}, // BLACK-LETTER CAPITAL I
{"ifr", 0x1D526}, // MATHEMATICAL FRAKTUR SMALL I
{"Igr", 0x00399}, // GREEK CAPITAL LETTER IOTA
{"igr", 0x003B9}, // GREEK SMALL LETTER IOTA
{"Igrave", 0x000CC}, // LATIN CAPITAL LETTER I WITH GRAVE
{"igrave", 0x000EC}, // LATIN SMALL LETTER I WITH GRAVE
{"ii", 0x02148}, // DOUBLE-STRUCK ITALIC SMALL I
{"iiiint", 0x02A0C}, // QUADRUPLE INTEGRAL OPERATOR
{"iiint", 0x0222D}, // TRIPLE INTEGRAL
{"iinfin", 0x029DC}, // INCOMPLETE INFINITY
{"iiota", 0x02129}, // TURNED GREEK SMALL LETTER IOTA
{"IJlig", 0x00132}, // LATIN CAPITAL LIGATURE IJ
{"ijlig", 0x00133}, // LATIN SMALL LIGATURE IJ
{"Im", 0x02111}, // BLACK-LETTER CAPITAL I
{"Imacr", 0x0012A}, // LATIN CAPITAL LETTER I WITH MACRON
{"imacr", 0x0012B}, // LATIN SMALL LETTER I WITH MACRON
{"image", 0x02111}, // BLACK-LETTER CAPITAL I
{"ImaginaryI", 0x02148}, // DOUBLE-STRUCK ITALIC SMALL I
{"imagline", 0x02110}, // SCRIPT CAPITAL I
{"imagpart", 0x02111}, // BLACK-LETTER CAPITAL I
{"imath", 0x00131}, // LATIN SMALL LETTER DOTLESS I
{"imof", 0x022B7}, // IMAGE OF
{"imped", 0x001B5}, // LATIN CAPITAL LETTER Z WITH STROKE
{"Implies", 0x021D2}, // RIGHTWARDS DOUBLE ARROW
{"in", 0x02208}, // ELEMENT OF
{"incare", 0x02105}, // CARE OF
{"infin", 0x0221E}, // INFINITY
{"infintie", 0x029DD}, // TIE OVER INFINITY
{"inodot", 0x00131}, // LATIN SMALL LETTER DOTLESS I
{"int", 0x0222B}, // INTEGRAL
{"Int", 0x0222C}, // DOUBLE INTEGRAL
{"intcal", 0x022BA}, // INTERCALATE
{"integers", 0x02124}, // DOUBLE-STRUCK CAPITAL Z
{"Integral", 0x0222B}, // INTEGRAL
{"intercal", 0x022BA}, // INTERCALATE
{"Intersection", 0x022C2}, // N-ARY INTERSECTION
{"intlarhk", 0x02A17}, // INTEGRAL WITH LEFTWARDS ARROW WITH HOOK
{"intprod", 0x02A3C}, // INTERIOR PRODUCT
{"InvisibleComma", 0x02063}, // INVISIBLE SEPARATOR
{"InvisibleTimes", 0x02062}, // INVISIBLE TIMES
{"IOcy", 0x00401}, // CYRILLIC CAPITAL LETTER IO
{"iocy", 0x00451}, // CYRILLIC SMALL LETTER IO
{"Iogon", 0x0012E}, // LATIN CAPITAL LETTER I WITH OGONEK
{"iogon", 0x0012F}, // LATIN SMALL LETTER I WITH OGONEK
{"Iopf", 0x1D540}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL I
{"iopf", 0x1D55A}, // MATHEMATICAL DOUBLE-STRUCK SMALL I
{"Iota", 0x00399}, // GREEK CAPITAL LETTER IOTA
{"iota", 0x003B9}, // GREEK SMALL LETTER IOTA
{"iprod", 0x02A3C}, // INTERIOR PRODUCT
{"iquest", 0x000BF}, // INVERTED QUESTION MARK
{"Iscr", 0x02110}, // SCRIPT CAPITAL I
{"iscr", 0x1D4BE}, // MATHEMATICAL SCRIPT SMALL I
{"isin", 0x02208}, // ELEMENT OF
{"isindot", 0x022F5}, // ELEMENT OF WITH DOT ABOVE
{"isinE", 0x022F9}, // ELEMENT OF WITH TWO HORIZONTAL STROKES
{"isins", 0x022F4}, // SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
{"isinsv", 0x022F3}, // ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
{"isinv", 0x02208}, // ELEMENT OF
{"it", 0x02062}, // INVISIBLE TIMES
{"Itilde", 0x00128}, // LATIN CAPITAL LETTER I WITH TILDE
{"itilde", 0x00129}, // LATIN SMALL LETTER I WITH TILDE
{"Iukcy", 0x00406}, // CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
{"iukcy", 0x00456}, // CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
{"Iuml", 0x000CF}, // LATIN CAPITAL LETTER I WITH DIAERESIS
{"iuml", 0x000EF}, // LATIN SMALL LETTER I WITH DIAERESIS
];
immutable NameId[] namesJ =
[
{"Jcirc", 0x00134}, // LATIN CAPITAL LETTER J WITH CIRCUMFLEX
{"jcirc", 0x00135}, // LATIN SMALL LETTER J WITH CIRCUMFLEX
{"Jcy", 0x00419}, // CYRILLIC CAPITAL LETTER SHORT I
{"jcy", 0x00439}, // CYRILLIC SMALL LETTER SHORT I
{"Jfr", 0x1D50D}, // MATHEMATICAL FRAKTUR CAPITAL J
{"jfr", 0x1D527}, // MATHEMATICAL FRAKTUR SMALL J
{"jmath", 0x00237}, // LATIN SMALL LETTER DOTLESS J
{"Jopf", 0x1D541}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL J
{"jopf", 0x1D55B}, // MATHEMATICAL DOUBLE-STRUCK SMALL J
{"Jscr", 0x1D4A5}, // MATHEMATICAL SCRIPT CAPITAL J
{"jscr", 0x1D4BF}, // MATHEMATICAL SCRIPT SMALL J
{"Jsercy", 0x00408}, // CYRILLIC CAPITAL LETTER JE
{"jsercy", 0x00458}, // CYRILLIC SMALL LETTER JE
{"Jukcy", 0x00404}, // CYRILLIC CAPITAL LETTER UKRAINIAN IE
{"jukcy", 0x00454}, // CYRILLIC SMALL LETTER UKRAINIAN IE
];
immutable NameId[] namesK =
[
{"Kappa", 0x0039A}, // GREEK CAPITAL LETTER KAPPA
{"kappa", 0x003BA}, // GREEK SMALL LETTER KAPPA
{"kappav", 0x003F0}, // GREEK KAPPA SYMBOL
{"Kcedil", 0x00136}, // LATIN CAPITAL LETTER K WITH CEDILLA
{"kcedil", 0x00137}, // LATIN SMALL LETTER K WITH CEDILLA
{"Kcy", 0x0041A}, // CYRILLIC CAPITAL LETTER KA
{"kcy", 0x0043A}, // CYRILLIC SMALL LETTER KA
{"Kfr", 0x1D50E}, // MATHEMATICAL FRAKTUR CAPITAL K
{"kfr", 0x1D528}, // MATHEMATICAL FRAKTUR SMALL K
{"Kgr", 0x0039A}, // GREEK CAPITAL LETTER KAPPA
{"kgr", 0x003BA}, // GREEK SMALL LETTER KAPPA
{"kgreen", 0x00138}, // LATIN SMALL LETTER KRA
{"KHcy", 0x00425}, // CYRILLIC CAPITAL LETTER HA
{"khcy", 0x00445}, // CYRILLIC SMALL LETTER HA
{"KHgr", 0x003A7}, // GREEK CAPITAL LETTER CHI
{"khgr", 0x003C7}, // GREEK SMALL LETTER CHI
{"KJcy", 0x0040C}, // CYRILLIC CAPITAL LETTER KJE
{"kjcy", 0x0045C}, // CYRILLIC SMALL LETTER KJE
{"Kopf", 0x1D542}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL K
{"kopf", 0x1D55C}, // MATHEMATICAL DOUBLE-STRUCK SMALL K
{"Kscr", 0x1D4A6}, // MATHEMATICAL SCRIPT CAPITAL K
{"kscr", 0x1D4C0}, // MATHEMATICAL SCRIPT SMALL K
];
immutable NameId[] namesL =
[
{"lAarr", 0x021DA}, // LEFTWARDS TRIPLE ARROW
{"Lacute", 0x00139}, // LATIN CAPITAL LETTER L WITH ACUTE
{"lacute", 0x0013A}, // LATIN SMALL LETTER L WITH ACUTE
{"laemptyv", 0x029B4}, // EMPTY SET WITH LEFT ARROW ABOVE
{"lagran", 0x02112}, // SCRIPT CAPITAL L
{"Lambda", 0x0039B}, // GREEK CAPITAL LETTER LAMDA
{"lambda", 0x003BB}, // GREEK SMALL LETTER LAMDA
{"lang", 0x027E8}, // MATHEMATICAL LEFT ANGLE BRACKET
{"Lang", 0x027EA}, // MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
{"langd", 0x02991}, // LEFT ANGLE BRACKET WITH DOT
{"langle", 0x027E8}, // MATHEMATICAL LEFT ANGLE BRACKET
{"lap", 0x02A85}, // LESS-THAN OR APPROXIMATE
{"Laplacetrf", 0x02112}, // SCRIPT CAPITAL L
{"laquo", 0x000AB}, // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
{"larr", 0x02190}, // LEFTWARDS ARROW
{"Larr", 0x0219E}, // LEFTWARDS TWO HEADED ARROW
{"lArr", 0x021D0}, // LEFTWARDS DOUBLE ARROW
{"larrb", 0x021E4}, // LEFTWARDS ARROW TO BAR
{"larrbfs", 0x0291F}, // LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND
{"larrfs", 0x0291D}, // LEFTWARDS ARROW TO BLACK DIAMOND
{"larrhk", 0x021A9}, // LEFTWARDS ARROW WITH HOOK
{"larrlp", 0x021AB}, // LEFTWARDS ARROW WITH LOOP
{"larrpl", 0x02939}, // LEFT-SIDE ARC ANTICLOCKWISE ARROW
{"larrsim", 0x02973}, // LEFTWARDS ARROW ABOVE TILDE OPERATOR
{"larrtl", 0x021A2}, // LEFTWARDS ARROW WITH TAIL
{"lat", 0x02AAB}, // LARGER THAN
{"latail", 0x02919}, // LEFTWARDS ARROW-TAIL
{"lAtail", 0x0291B}, // LEFTWARDS DOUBLE ARROW-TAIL
{"late", 0x02AAD}, // LARGER THAN OR EQUAL TO
// "lates", 0x02AAD;0x0FE00}, // LARGER THAN OR slanted EQUAL
{"lbarr", 0x0290C}, // LEFTWARDS DOUBLE DASH ARROW
{"lBarr", 0x0290E}, // LEFTWARDS TRIPLE DASH ARROW
{"lbbrk", 0x02772}, // LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
{"lbrace", 0x0007B}, // LEFT CURLY BRACKET
{"lbrack", 0x0005B}, // LEFT SQUARE BRACKET
{"lbrke", 0x0298B}, // LEFT SQUARE BRACKET WITH UNDERBAR
{"lbrksld", 0x0298F}, // LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
{"lbrkslu", 0x0298D}, // LEFT SQUARE BRACKET WITH TICK IN TOP CORNER
{"Lcaron", 0x0013D}, // LATIN CAPITAL LETTER L WITH CARON
{"lcaron", 0x0013E}, // LATIN SMALL LETTER L WITH CARON
{"Lcedil", 0x0013B}, // LATIN CAPITAL LETTER L WITH CEDILLA
{"lcedil", 0x0013C}, // LATIN SMALL LETTER L WITH CEDILLA
{"lceil", 0x02308}, // LEFT CEILING
{"lcub", 0x0007B}, // LEFT CURLY BRACKET
{"Lcy", 0x0041B}, // CYRILLIC CAPITAL LETTER EL
{"lcy", 0x0043B}, // CYRILLIC SMALL LETTER EL
{"ldca", 0x02936}, // ARROW POINTING DOWNWARDS THEN CURVING LEFTWARDS
{"ldquo", 0x0201C}, // LEFT DOUBLE QUOTATION MARK
{"ldquor", 0x0201E}, // DOUBLE LOW-9 QUOTATION MARK
{"ldrdhar", 0x02967}, // LEFTWARDS HARPOON WITH BARB DOWN ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
{"ldrushar", 0x0294B}, // LEFT BARB DOWN RIGHT BARB UP HARPOON
{"ldsh", 0x021B2}, // DOWNWARDS ARROW WITH TIP LEFTWARDS
{"le", 0x02264}, // LESS-THAN OR EQUAL TO
{"lE", 0x02266}, // LESS-THAN OVER EQUAL TO
{"LeftAngleBracket", 0x027E8}, // MATHEMATICAL LEFT ANGLE BRACKET
{"leftarrow", 0x02190}, // LEFTWARDS ARROW
{"LeftArrow", 0x02190}, // LEFTWARDS ARROW
{"Leftarrow", 0x021D0}, // LEFTWARDS DOUBLE ARROW
{"LeftArrowBar", 0x021E4}, // LEFTWARDS ARROW TO BAR
{"LeftArrowRightArrow", 0x021C6}, // LEFTWARDS ARROW OVER RIGHTWARDS ARROW
{"leftarrowtail", 0x021A2}, // LEFTWARDS ARROW WITH TAIL
{"LeftCeiling", 0x02308}, // LEFT CEILING
{"LeftDoubleBracket", 0x027E6}, // MATHEMATICAL LEFT WHITE SQUARE BRACKET
{"LeftDownTeeVector", 0x02961}, // DOWNWARDS HARPOON WITH BARB LEFT FROM BAR
{"LeftDownVector", 0x021C3}, // DOWNWARDS HARPOON WITH BARB LEFTWARDS
{"LeftDownVectorBar", 0x02959}, // DOWNWARDS HARPOON WITH BARB LEFT TO BAR
{"LeftFloor", 0x0230A}, // LEFT FLOOR
{"leftharpoondown", 0x021BD}, // LEFTWARDS HARPOON WITH BARB DOWNWARDS
{"leftharpoonup", 0x021BC}, // LEFTWARDS HARPOON WITH BARB UPWARDS
{"leftleftarrows", 0x021C7}, // LEFTWARDS PAIRED ARROWS
{"leftrightarrow", 0x02194}, // LEFT RIGHT ARROW
{"LeftRightArrow", 0x02194}, // LEFT RIGHT ARROW
{"Leftrightarrow", 0x021D4}, // LEFT RIGHT DOUBLE ARROW
{"leftrightarrows", 0x021C6}, // LEFTWARDS ARROW OVER RIGHTWARDS ARROW
{"leftrightharpoons", 0x021CB}, // LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
{"leftrightsquigarrow", 0x021AD}, // LEFT RIGHT WAVE ARROW
{"LeftRightVector", 0x0294E}, // LEFT BARB UP RIGHT BARB UP HARPOON
{"LeftTee", 0x022A3}, // LEFT TACK
{"LeftTeeArrow", 0x021A4}, // LEFTWARDS ARROW FROM BAR
{"LeftTeeVector", 0x0295A}, // LEFTWARDS HARPOON WITH BARB UP FROM BAR
{"leftthreetimes", 0x022CB}, // LEFT SEMIDIRECT PRODUCT
{"LeftTriangle", 0x022B2}, // NORMAL SUBGROUP OF
{"LeftTriangleBar", 0x029CF}, // LEFT TRIANGLE BESIDE VERTICAL BAR
{"LeftTriangleEqual", 0x022B4}, // NORMAL SUBGROUP OF OR EQUAL TO
{"LeftUpDownVector", 0x02951}, // UP BARB LEFT DOWN BARB LEFT HARPOON
{"LeftUpTeeVector", 0x02960}, // UPWARDS HARPOON WITH BARB LEFT FROM BAR
{"LeftUpVector", 0x021BF}, // UPWARDS HARPOON WITH BARB LEFTWARDS
{"LeftUpVectorBar", 0x02958}, // UPWARDS HARPOON WITH BARB LEFT TO BAR
{"LeftVector", 0x021BC}, // LEFTWARDS HARPOON WITH BARB UPWARDS
{"LeftVectorBar", 0x02952}, // LEFTWARDS HARPOON WITH BARB UP TO BAR
{"leg", 0x022DA}, // LESS-THAN EQUAL TO OR GREATER-THAN
{"lEg", 0x02A8B}, // LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
{"leq", 0x02264}, // LESS-THAN OR EQUAL TO
{"leqq", 0x02266}, // LESS-THAN OVER EQUAL TO
{"leqslant", 0x02A7D}, // LESS-THAN OR SLANTED EQUAL TO
{"les", 0x02A7D}, // LESS-THAN OR SLANTED EQUAL TO
{"lescc", 0x02AA8}, // LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
{"lesdot", 0x02A7F}, // LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
{"lesdoto", 0x02A81}, // LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
{"lesdotor", 0x02A83}, // LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT
// "lesg", 0x022DA;0x0FE00}, // LESS-THAN slanted EQUAL TO OR GREATER-THAN
{"lesges", 0x02A93}, // LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL
{"lessapprox", 0x02A85}, // LESS-THAN OR APPROXIMATE
{"lessdot", 0x022D6}, // LESS-THAN WITH DOT
{"lesseqgtr", 0x022DA}, // LESS-THAN EQUAL TO OR GREATER-THAN
{"lesseqqgtr", 0x02A8B}, // LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
{"LessEqualGreater", 0x022DA}, // LESS-THAN EQUAL TO OR GREATER-THAN
{"LessFullEqual", 0x02266}, // LESS-THAN OVER EQUAL TO
{"LessGreater", 0x02276}, // LESS-THAN OR GREATER-THAN
{"lessgtr", 0x02276}, // LESS-THAN OR GREATER-THAN
{"LessLess", 0x02AA1}, // DOUBLE NESTED LESS-THAN
{"lesssim", 0x02272}, // LESS-THAN OR EQUIVALENT TO
{"LessSlantEqual", 0x02A7D}, // LESS-THAN OR SLANTED EQUAL TO
{"LessTilde", 0x02272}, // LESS-THAN OR EQUIVALENT TO
{"lfisht", 0x0297C}, // LEFT FISH TAIL
{"lfloor", 0x0230A}, // LEFT FLOOR
{"Lfr", 0x1D50F}, // MATHEMATICAL FRAKTUR CAPITAL L
{"lfr", 0x1D529}, // MATHEMATICAL FRAKTUR SMALL L
{"lg", 0x02276}, // LESS-THAN OR GREATER-THAN
{"lgE", 0x02A91}, // LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL
{"Lgr", 0x0039B}, // GREEK CAPITAL LETTER LAMDA
{"lgr", 0x003BB}, // GREEK SMALL LETTER LAMDA
{"lHar", 0x02962}, // LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN
{"lhard", 0x021BD}, // LEFTWARDS HARPOON WITH BARB DOWNWARDS
{"lharu", 0x021BC}, // LEFTWARDS HARPOON WITH BARB UPWARDS
{"lharul", 0x0296A}, // LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
{"lhblk", 0x02584}, // LOWER HALF BLOCK
{"LJcy", 0x00409}, // CYRILLIC CAPITAL LETTER LJE
{"ljcy", 0x00459}, // CYRILLIC SMALL LETTER LJE
{"ll", 0x0226A}, // MUCH LESS-THAN
{"Ll", 0x022D8}, // VERY MUCH LESS-THAN
{"llarr", 0x021C7}, // LEFTWARDS PAIRED ARROWS
{"llcorner", 0x0231E}, // BOTTOM LEFT CORNER
{"Lleftarrow", 0x021DA}, // LEFTWARDS TRIPLE ARROW
{"llhard", 0x0296B}, // LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
{"lltri", 0x025FA}, // LOWER LEFT TRIANGLE
{"Lmidot", 0x0013F}, // LATIN CAPITAL LETTER L WITH MIDDLE DOT
{"lmidot", 0x00140}, // LATIN SMALL LETTER L WITH MIDDLE DOT
{"lmoust", 0x023B0}, // UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION
{"lmoustache", 0x023B0}, // UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION
{"lnap", 0x02A89}, // LESS-THAN AND NOT APPROXIMATE
{"lnapprox", 0x02A89}, // LESS-THAN AND NOT APPROXIMATE
{"lnE", 0x02268}, // LESS-THAN BUT NOT EQUAL TO
{"lne", 0x02A87}, // LESS-THAN AND SINGLE-LINE NOT EQUAL TO
{"lneq", 0x02A87}, // LESS-THAN AND SINGLE-LINE NOT EQUAL TO
{"lneqq", 0x02268}, // LESS-THAN BUT NOT EQUAL TO
{"lnsim", 0x022E6}, // LESS-THAN BUT NOT EQUIVALENT TO
{"loang", 0x027EC}, // MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET
{"loarr", 0x021FD}, // LEFTWARDS OPEN-HEADED ARROW
{"lobrk", 0x027E6}, // MATHEMATICAL LEFT WHITE SQUARE BRACKET
{"longleftarrow", 0x027F5}, // LONG LEFTWARDS ARROW
{"LongLeftArrow", 0x027F5}, // LONG LEFTWARDS ARROW
{"Longleftarrow", 0x027F8}, // LONG LEFTWARDS DOUBLE ARROW
{"longleftrightarrow", 0x027F7}, // LONG LEFT RIGHT ARROW
{"LongLeftRightArrow", 0x027F7}, // LONG LEFT RIGHT ARROW
{"Longleftrightarrow", 0x027FA}, // LONG LEFT RIGHT DOUBLE ARROW
{"longmapsto", 0x027FC}, // LONG RIGHTWARDS ARROW FROM BAR
{"longrightarrow", 0x027F6}, // LONG RIGHTWARDS ARROW
{"LongRightArrow", 0x027F6}, // LONG RIGHTWARDS ARROW
{"Longrightarrow", 0x027F9}, // LONG RIGHTWARDS DOUBLE ARROW
{"looparrowleft", 0x021AB}, // LEFTWARDS ARROW WITH LOOP
{"looparrowright", 0x021AC}, // RIGHTWARDS ARROW WITH LOOP
{"lopar", 0x02985}, // LEFT WHITE PARENTHESIS
{"Lopf", 0x1D543}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL L
{"lopf", 0x1D55D}, // MATHEMATICAL DOUBLE-STRUCK SMALL L
{"loplus", 0x02A2D}, // PLUS SIGN IN LEFT HALF CIRCLE
{"lotimes", 0x02A34}, // MULTIPLICATION SIGN IN LEFT HALF CIRCLE
{"lowast", 0x02217}, // ASTERISK OPERATOR
{"lowbar", 0x0005F}, // LOW LINE
{"LowerLeftArrow", 0x02199}, // SOUTH WEST ARROW
{"LowerRightArrow", 0x02198}, // SOUTH EAST ARROW
{"loz", 0x025CA}, // LOZENGE
{"lozenge", 0x025CA}, // LOZENGE
{"lozf", 0x029EB}, // BLACK LOZENGE
{"lpar", 0x00028}, // LEFT PARENTHESIS
{"lparlt", 0x02993}, // LEFT ARC LESS-THAN BRACKET
{"lrarr", 0x021C6}, // LEFTWARDS ARROW OVER RIGHTWARDS ARROW
{"lrcorner", 0x0231F}, // BOTTOM RIGHT CORNER
{"lrhar", 0x021CB}, // LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
{"lrhard", 0x0296D}, // RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
{"lrm", 0x0200E}, // LEFT-TO-RIGHT MARK
{"lrtri", 0x022BF}, // RIGHT TRIANGLE
{"lsaquo", 0x02039}, // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
{"Lscr", 0x02112}, // SCRIPT CAPITAL L
{"lscr", 0x1D4C1}, // MATHEMATICAL SCRIPT SMALL L
{"lsh", 0x021B0}, // UPWARDS ARROW WITH TIP LEFTWARDS
{"Lsh", 0x021B0}, // UPWARDS ARROW WITH TIP LEFTWARDS
{"lsim", 0x02272}, // LESS-THAN OR EQUIVALENT TO
{"lsime", 0x02A8D}, // LESS-THAN ABOVE SIMILAR OR EQUAL
{"lsimg", 0x02A8F}, // LESS-THAN ABOVE SIMILAR ABOVE GREATER-THAN
{"lsqb", 0x0005B}, // LEFT SQUARE BRACKET
{"lsquo", 0x02018}, // LEFT SINGLE QUOTATION MARK
{"lsquor", 0x0201A}, // SINGLE LOW-9 QUOTATION MARK
{"Lstrok", 0x00141}, // LATIN CAPITAL LETTER L WITH STROKE
{"lstrok", 0x00142}, // LATIN SMALL LETTER L WITH STROKE
{"lt", 0x0003C}, // LESS-THAN SIGN
{"LT", 0x0003C}, // LESS-THAN SIGN
{"Lt", 0x0226A}, // MUCH LESS-THAN
{"ltcc", 0x02AA6}, // LESS-THAN CLOSED BY CURVE
{"ltcir", 0x02A79}, // LESS-THAN WITH CIRCLE INSIDE
{"ltdot", 0x022D6}, // LESS-THAN WITH DOT
{"lthree", 0x022CB}, // LEFT SEMIDIRECT PRODUCT
{"ltimes", 0x022C9}, // LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
{"ltlarr", 0x02976}, // LESS-THAN ABOVE LEFTWARDS ARROW
{"ltquest", 0x02A7B}, // LESS-THAN WITH QUESTION MARK ABOVE
{"ltri", 0x025C3}, // WHITE LEFT-POINTING SMALL TRIANGLE
{"ltrie", 0x022B4}, // NORMAL SUBGROUP OF OR EQUAL TO
{"ltrif", 0x025C2}, // BLACK LEFT-POINTING SMALL TRIANGLE
{"ltrPar", 0x02996}, // DOUBLE RIGHT ARC LESS-THAN BRACKET
{"lurdshar", 0x0294A}, // LEFT BARB UP RIGHT BARB DOWN HARPOON
{"luruhar", 0x02966}, // LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB UP
// "lvertneqq", 0x02268;0x0FE00}, // LESS-THAN BUT NOT EQUAL TO - with vertical stroke
// "lvnE", 0x02268;0x0FE00}, // LESS-THAN BUT NOT EQUAL TO - with vertical stroke
];
immutable NameId[] namesM =
[
{"macr", 0x000AF}, // MACRON
{"male", 0x02642}, // MALE SIGN
{"malt", 0x02720}, // MALTESE CROSS
{"maltese", 0x02720}, // MALTESE CROSS
{"map", 0x021A6}, // RIGHTWARDS ARROW FROM BAR
{"Map", 0x02905}, // RIGHTWARDS TWO-HEADED ARROW FROM BAR
{"mapsto", 0x021A6}, // RIGHTWARDS ARROW FROM BAR
{"mapstodown", 0x021A7}, // DOWNWARDS ARROW FROM BAR
{"mapstoleft", 0x021A4}, // LEFTWARDS ARROW FROM BAR
{"mapstoup", 0x021A5}, // UPWARDS ARROW FROM BAR
{"marker", 0x025AE}, // BLACK VERTICAL RECTANGLE
{"mcomma", 0x02A29}, // MINUS SIGN WITH COMMA ABOVE
{"Mcy", 0x0041C}, // CYRILLIC CAPITAL LETTER EM
{"mcy", 0x0043C}, // CYRILLIC SMALL LETTER EM
{"mdash", 0x02014}, // EM DASH
{"mDDot", 0x0223A}, // GEOMETRIC PROPORTION
{"measuredangle", 0x02221}, // MEASURED ANGLE
{"MediumSpace", 0x0205F}, // MEDIUM MATHEMATICAL SPACE
{"Mellintrf", 0x02133}, // SCRIPT CAPITAL M
{"Mfr", 0x1D510}, // MATHEMATICAL FRAKTUR CAPITAL M
{"mfr", 0x1D52A}, // MATHEMATICAL FRAKTUR SMALL M
{"Mgr", 0x0039C}, // GREEK CAPITAL LETTER MU
{"mgr", 0x003BC}, // GREEK SMALL LETTER MU
{"mho", 0x02127}, // INVERTED OHM SIGN
{"micro", 0x000B5}, // MICRO SIGN
{"mid", 0x02223}, // DIVIDES
{"midast", 0x0002A}, // ASTERISK
{"midcir", 0x02AF0}, // VERTICAL LINE WITH CIRCLE BELOW
{"middot", 0x000B7}, // MIDDLE DOT
{"minus", 0x02212}, // MINUS SIGN
{"minusb", 0x0229F}, // SQUARED MINUS
{"minusd", 0x02238}, // DOT MINUS
{"minusdu", 0x02A2A}, // MINUS SIGN WITH DOT BELOW
{"MinusPlus", 0x02213}, // MINUS-OR-PLUS SIGN
{"mlcp", 0x02ADB}, // TRANSVERSAL INTERSECTION
{"mldr", 0x02026}, // HORIZONTAL ELLIPSIS
{"mnplus", 0x02213}, // MINUS-OR-PLUS SIGN
{"models", 0x022A7}, // MODELS
{"Mopf", 0x1D544}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL M
{"mopf", 0x1D55E}, // MATHEMATICAL DOUBLE-STRUCK SMALL M
{"mp", 0x02213}, // MINUS-OR-PLUS SIGN
{"Mscr", 0x02133}, // SCRIPT CAPITAL M
{"mscr", 0x1D4C2}, // MATHEMATICAL SCRIPT SMALL M
{"mstpos", 0x0223E}, // INVERTED LAZY S
{"Mu", 0x0039C}, // GREEK CAPITAL LETTER MU
{"mu", 0x003BC}, // GREEK SMALL LETTER MU
{"multimap", 0x022B8}, // MULTIMAP
{"mumap", 0x022B8}, // MULTIMAP
];
immutable NameId[] namesN =
[
{"nabla", 0x02207}, // NABLA
{"Nacute", 0x00143}, // LATIN CAPITAL LETTER N WITH ACUTE
{"nacute", 0x00144}, // LATIN SMALL LETTER N WITH ACUTE
// "nang", 0x02220;0x020D2}, // ANGLE with vertical line
{"nap", 0x02249}, // NOT ALMOST EQUAL TO
// "napE", 0x02A70;0x00338}, // APPROXIMATELY EQUAL OR EQUAL TO with slash
// "napid", 0x0224B;0x00338}, // TRIPLE TILDE with slash
{"napos", 0x00149}, // LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
{"napprox", 0x02249}, // NOT ALMOST EQUAL TO
{"natur", 0x0266E}, // MUSIC NATURAL SIGN
{"natural", 0x0266E}, // MUSIC NATURAL SIGN
{"naturals", 0x02115}, // DOUBLE-STRUCK CAPITAL N
{"nbsp", 0x000A0}, // NO-BREAK SPACE
// "nbump", 0x0224E;0x00338}, // GEOMETRICALLY EQUIVALENT TO with slash
// "nbumpe", 0x0224F;0x00338}, // DIFFERENCE BETWEEN with slash
{"ncap", 0x02A43}, // INTERSECTION WITH OVERBAR
{"Ncaron", 0x00147}, // LATIN CAPITAL LETTER N WITH CARON
{"ncaron", 0x00148}, // LATIN SMALL LETTER N WITH CARON
{"Ncedil", 0x00145}, // LATIN CAPITAL LETTER N WITH CEDILLA
{"ncedil", 0x00146}, // LATIN SMALL LETTER N WITH CEDILLA
{"ncong", 0x02247}, // NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
// "ncongdot", 0x02A6D;0x00338}, // CONGRUENT WITH DOT ABOVE with slash
{"ncup", 0x02A42}, // UNION WITH OVERBAR
{"Ncy", 0x0041D}, // CYRILLIC CAPITAL LETTER EN
{"ncy", 0x0043D}, // CYRILLIC SMALL LETTER EN
{"ndash", 0x02013}, // EN DASH
{"ne", 0x02260}, // NOT EQUAL TO
{"nearhk", 0x02924}, // NORTH EAST ARROW WITH HOOK
{"nearr", 0x02197}, // NORTH EAST ARROW
{"neArr", 0x021D7}, // NORTH EAST DOUBLE ARROW
{"nearrow", 0x02197}, // NORTH EAST ARROW
// "nedot", 0x02250;0x00338}, // APPROACHES THE LIMIT with slash
{"NegativeMediumSpace", 0x0200B}, // ZERO WIDTH SPACE
{"NegativeThickSpace", 0x0200B}, // ZERO WIDTH SPACE
{"NegativeThinSpace", 0x0200B}, // ZERO WIDTH SPACE
{"NegativeVeryThinSpace", 0x0200B}, // ZERO WIDTH SPACE
{"nequiv", 0x02262}, // NOT IDENTICAL TO
{"nesear", 0x02928}, // NORTH EAST ARROW AND SOUTH EAST ARROW
// "nesim", 0x02242;0x00338}, // MINUS TILDE with slash
{"NestedGreaterGreater", 0x0226B}, // MUCH GREATER-THAN
{"NestedLessLess", 0x0226A}, // MUCH LESS-THAN
{"NewLine", 0x0000A}, // LINE FEED (LF)
{"nexist", 0x02204}, // THERE DOES NOT EXIST
{"nexists", 0x02204}, // THERE DOES NOT EXIST
{"Nfr", 0x1D511}, // MATHEMATICAL FRAKTUR CAPITAL N
{"nfr", 0x1D52B}, // MATHEMATICAL FRAKTUR SMALL N
// "ngE", 0x02267;0x00338}, // GREATER-THAN OVER EQUAL TO with slash
{"nge", 0x02271}, // NEITHER GREATER-THAN NOR EQUAL TO
{"ngeq", 0x02271}, // NEITHER GREATER-THAN NOR EQUAL TO
// "ngeqq", 0x02267;0x00338}, // GREATER-THAN OVER EQUAL TO with slash
// "ngeqslant", 0x02A7E;0x00338}, // GREATER-THAN OR SLANTED EQUAL TO with slash
// "nges", 0x02A7E;0x00338}, // GREATER-THAN OR SLANTED EQUAL TO with slash
// "nGg", 0x022D9;0x00338}, // VERY MUCH GREATER-THAN with slash
{"Ngr", 0x0039D}, // GREEK CAPITAL LETTER NU
{"ngr", 0x003BD}, // GREEK SMALL LETTER NU
{"ngsim", 0x02275}, // NEITHER GREATER-THAN NOR EQUIVALENT TO
// "nGt", 0x0226B;0x020D2}, // MUCH GREATER THAN with vertical line
{"ngt", 0x0226F}, // NOT GREATER-THAN
{"ngtr", 0x0226F}, // NOT GREATER-THAN
// "nGtv", 0x0226B;0x00338}, // MUCH GREATER THAN with slash
{"nharr", 0x021AE}, // LEFT RIGHT ARROW WITH STROKE
{"nhArr", 0x021CE}, // LEFT RIGHT DOUBLE ARROW WITH STROKE
{"nhpar", 0x02AF2}, // PARALLEL WITH HORIZONTAL STROKE
{"ni", 0x0220B}, // CONTAINS AS MEMBER
{"nis", 0x022FC}, // SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
{"nisd", 0x022FA}, // CONTAINS WITH LONG HORIZONTAL STROKE
{"niv", 0x0220B}, // CONTAINS AS MEMBER
{"NJcy", 0x0040A}, // CYRILLIC CAPITAL LETTER NJE
{"njcy", 0x0045A}, // CYRILLIC SMALL LETTER NJE
{"nlarr", 0x0219A}, // LEFTWARDS ARROW WITH STROKE
{"nlArr", 0x021CD}, // LEFTWARDS DOUBLE ARROW WITH STROKE
{"nldr", 0x02025}, // TWO DOT LEADER
// "nlE", 0x02266;0x00338}, // LESS-THAN OVER EQUAL TO with slash
{"nle", 0x02270}, // NEITHER LESS-THAN NOR EQUAL TO
{"nleftarrow", 0x0219A}, // LEFTWARDS ARROW WITH STROKE
{"nLeftarrow", 0x021CD}, // LEFTWARDS DOUBLE ARROW WITH STROKE
{"nleftrightarrow", 0x021AE}, // LEFT RIGHT ARROW WITH STROKE
{"nLeftrightarrow", 0x021CE}, // LEFT RIGHT DOUBLE ARROW WITH STROKE
{"nleq", 0x02270}, // NEITHER LESS-THAN NOR EQUAL TO
// "nleqq", 0x02266;0x00338}, // LESS-THAN OVER EQUAL TO with slash
// "nleqslant", 0x02A7D;0x00338}, // LESS-THAN OR SLANTED EQUAL TO with slash
// "nles", 0x02A7D;0x00338}, // LESS-THAN OR SLANTED EQUAL TO with slash
{"nless", 0x0226E}, // NOT LESS-THAN
// "nLl", 0x022D8;0x00338}, // VERY MUCH LESS-THAN with slash
{"nlsim", 0x02274}, // NEITHER LESS-THAN NOR EQUIVALENT TO
// "nLt", 0x0226A;0x020D2}, // MUCH LESS THAN with vertical line
{"nlt", 0x0226E}, // NOT LESS-THAN
{"nltri", 0x022EA}, // NOT NORMAL SUBGROUP OF
{"nltrie", 0x022EC}, // NOT NORMAL SUBGROUP OF OR EQUAL TO
// "nLtv", 0x0226A;0x00338}, // MUCH LESS THAN with slash
{"nmid", 0x02224}, // DOES NOT DIVIDE
{"NoBreak", 0x02060}, // WORD JOINER
{"NonBreakingSpace", 0x000A0}, // NO-BREAK SPACE
{"Nopf", 0x02115}, // DOUBLE-STRUCK CAPITAL N
{"nopf", 0x1D55F}, // MATHEMATICAL DOUBLE-STRUCK SMALL N
{"not", 0x000AC}, // NOT SIGN
{"Not", 0x02AEC}, // DOUBLE STROKE NOT SIGN
{"NotCongruent", 0x02262}, // NOT IDENTICAL TO
{"NotCupCap", 0x0226D}, // NOT EQUIVALENT TO
{"NotDoubleVerticalBar", 0x02226}, // NOT PARALLEL TO
{"NotElement", 0x02209}, // NOT AN ELEMENT OF
{"NotEqual", 0x02260}, // NOT EQUAL TO
// "NotEqualTilde", 0x02242;0x00338}, // MINUS TILDE with slash
{"NotExists", 0x02204}, // THERE DOES NOT EXIST
{"NotGreater", 0x0226F}, // NOT GREATER-THAN
{"NotGreaterEqual", 0x02271}, // NEITHER GREATER-THAN NOR EQUAL TO
// "NotGreaterFullEqual", 0x02267;0x00338}, // GREATER-THAN OVER EQUAL TO with slash
// "NotGreaterGreater", 0x0226B;0x00338}, // MUCH GREATER THAN with slash
{"NotGreaterLess", 0x02279}, // NEITHER GREATER-THAN NOR LESS-THAN
// "NotGreaterSlantEqual", 0x02A7E;0x00338}, // GREATER-THAN OR SLANTED EQUAL TO with slash
{"NotGreaterTilde", 0x02275}, // NEITHER GREATER-THAN NOR EQUIVALENT TO
// "NotHumpDownHump", 0x0224E;0x00338}, // GEOMETRICALLY EQUIVALENT TO with slash
// "NotHumpEqual", 0x0224F;0x00338}, // DIFFERENCE BETWEEN with slash
{"notin", 0x02209}, // NOT AN ELEMENT OF
// "notindot", 0x022F5;0x00338}, // ELEMENT OF WITH DOT ABOVE with slash
// "notinE", 0x022F9;0x00338}, // ELEMENT OF WITH TWO HORIZONTAL STROKES with slash
{"notinva", 0x02209}, // NOT AN ELEMENT OF
{"notinvb", 0x022F7}, // SMALL ELEMENT OF WITH OVERBAR
{"notinvc", 0x022F6}, // ELEMENT OF WITH OVERBAR
{"NotLeftTriangle", 0x022EA}, // NOT NORMAL SUBGROUP OF
// "NotLeftTriangleBar", 0x029CF;0x00338}, // LEFT TRIANGLE BESIDE VERTICAL BAR with slash
{"NotLeftTriangleEqual", 0x022EC}, // NOT NORMAL SUBGROUP OF OR EQUAL TO
{"NotLess", 0x0226E}, // NOT LESS-THAN
{"NotLessEqual", 0x02270}, // NEITHER LESS-THAN NOR EQUAL TO
{"NotLessGreater", 0x02278}, // NEITHER LESS-THAN NOR GREATER-THAN
// "NotLessLess", 0x0226A;0x00338}, // MUCH LESS THAN with slash
// "NotLessSlantEqual", 0x02A7D;0x00338}, // LESS-THAN OR SLANTED EQUAL TO with slash
{"NotLessTilde", 0x02274}, // NEITHER LESS-THAN NOR EQUIVALENT TO
// "NotNestedGreaterGreater", 0x02AA2;0x00338}, // DOUBLE NESTED GREATER-THAN with slash
// "NotNestedLessLess", 0x02AA1;0x00338}, // DOUBLE NESTED LESS-THAN with slash
{"notni", 0x0220C}, // DOES NOT CONTAIN AS MEMBER
{"notniva", 0x0220C}, // DOES NOT CONTAIN AS MEMBER
{"notnivb", 0x022FE}, // SMALL CONTAINS WITH OVERBAR
{"notnivc", 0x022FD}, // CONTAINS WITH OVERBAR
{"NotPrecedes", 0x02280}, // DOES NOT PRECEDE
// "NotPrecedesEqual", 0x02AAF;0x00338}, // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN with slash
{"NotPrecedesSlantEqual", 0x022E0}, // DOES NOT PRECEDE OR EQUAL
{"NotReverseElement", 0x0220C}, // DOES NOT CONTAIN AS MEMBER
{"NotRightTriangle", 0x022EB}, // DOES NOT CONTAIN AS NORMAL SUBGROUP
// "NotRightTriangleBar", 0x029D0;0x00338}, // VERTICAL BAR BESIDE RIGHT TRIANGLE with slash
{"NotRightTriangleEqual", 0x022ED}, // DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
// "NotSquareSubset", 0x0228F;0x00338}, // SQUARE IMAGE OF with slash
{"NotSquareSubsetEqual", 0x022E2}, // NOT SQUARE IMAGE OF OR EQUAL TO
// "NotSquareSuperset", 0x02290;0x00338}, // SQUARE ORIGINAL OF with slash
{"NotSquareSupersetEqual", 0x022E3}, // NOT SQUARE ORIGINAL OF OR EQUAL TO
// "NotSubset", 0x02282;0x020D2}, // SUBSET OF with vertical line
{"NotSubsetEqual", 0x02288}, // NEITHER A SUBSET OF NOR EQUAL TO
{"NotSucceeds", 0x02281}, // DOES NOT SUCCEED
// "NotSucceedsEqual", 0x02AB0;0x00338}, // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN with slash
{"NotSucceedsSlantEqual", 0x022E1}, // DOES NOT SUCCEED OR EQUAL
// "NotSucceedsTilde", 0x0227F;0x00338}, // SUCCEEDS OR EQUIVALENT TO with slash
// "NotSuperset", 0x02283;0x020D2}, // SUPERSET OF with vertical line
{"NotSupersetEqual", 0x02289}, // NEITHER A SUPERSET OF NOR EQUAL TO
{"NotTilde", 0x02241}, // NOT TILDE
{"NotTildeEqual", 0x02244}, // NOT ASYMPTOTICALLY EQUAL TO
{"NotTildeFullEqual", 0x02247}, // NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
{"NotTildeTilde", 0x02249}, // NOT ALMOST EQUAL TO
{"NotVerticalBar", 0x02224}, // DOES NOT DIVIDE
{"npar", 0x02226}, // NOT PARALLEL TO
{"nparallel", 0x02226}, // NOT PARALLEL TO
// "nparsl", 0x02AFD;0x020E5}, // DOUBLE SOLIDUS OPERATOR with reverse slash
// "npart", 0x02202;0x00338}, // PARTIAL DIFFERENTIAL with slash
{"npolint", 0x02A14}, // LINE INTEGRATION NOT INCLUDING THE POLE
{"npr", 0x02280}, // DOES NOT PRECEDE
{"nprcue", 0x022E0}, // DOES NOT PRECEDE OR EQUAL
// "npre", 0x02AAF;0x00338}, // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN with slash
{"nprec", 0x02280}, // DOES NOT PRECEDE
// "npreceq", 0x02AAF;0x00338}, // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN with slash
{"nrarr", 0x0219B}, // RIGHTWARDS ARROW WITH STROKE
{"nrArr", 0x021CF}, // RIGHTWARDS DOUBLE ARROW WITH STROKE
// "nrarrc", 0x02933;0x00338}, // WAVE ARROW POINTING DIRECTLY RIGHT with slash
// "nrarrw", 0x0219D;0x00338}, // RIGHTWARDS WAVE ARROW with slash
{"nrightarrow", 0x0219B}, // RIGHTWARDS ARROW WITH STROKE
{"nRightarrow", 0x021CF}, // RIGHTWARDS DOUBLE ARROW WITH STROKE
{"nrtri", 0x022EB}, // DOES NOT CONTAIN AS NORMAL SUBGROUP
{"nrtrie", 0x022ED}, // DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
{"nsc", 0x02281}, // DOES NOT SUCCEED
{"nsccue", 0x022E1}, // DOES NOT SUCCEED OR EQUAL
// "nsce", 0x02AB0;0x00338}, // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN with slash
{"Nscr", 0x1D4A9}, // MATHEMATICAL SCRIPT CAPITAL N
{"nscr", 0x1D4C3}, // MATHEMATICAL SCRIPT SMALL N
{"nshortmid", 0x02224}, // DOES NOT DIVIDE
{"nshortparallel", 0x02226}, // NOT PARALLEL TO
{"nsim", 0x02241}, // NOT TILDE
{"nsime", 0x02244}, // NOT ASYMPTOTICALLY EQUAL TO
{"nsimeq", 0x02244}, // NOT ASYMPTOTICALLY EQUAL TO
{"nsmid", 0x02224}, // DOES NOT DIVIDE
{"nspar", 0x02226}, // NOT PARALLEL TO
{"nsqsube", 0x022E2}, // NOT SQUARE IMAGE OF OR EQUAL TO
{"nsqsupe", 0x022E3}, // NOT SQUARE ORIGINAL OF OR EQUAL TO
{"nsub", 0x02284}, // NOT A SUBSET OF
{"nsube", 0x02288}, // NEITHER A SUBSET OF NOR EQUAL TO
// "nsubE", 0x02AC5;0x00338}, // SUBSET OF ABOVE EQUALS SIGN with slash
// "nsubset", 0x02282;0x020D2}, // SUBSET OF with vertical line
{"nsubseteq", 0x02288}, // NEITHER A SUBSET OF NOR EQUAL TO
// "nsubseteqq", 0x02AC5;0x00338}, // SUBSET OF ABOVE EQUALS SIGN with slash
{"nsucc", 0x02281}, // DOES NOT SUCCEED
// "nsucceq", 0x02AB0;0x00338}, // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN with slash
{"nsup", 0x02285}, // NOT A SUPERSET OF
{"nsupe", 0x02289}, // NEITHER A SUPERSET OF NOR EQUAL TO
// "nsupE", 0x02AC6;0x00338}, // SUPERSET OF ABOVE EQUALS SIGN with slash
// "nsupset", 0x02283;0x020D2}, // SUPERSET OF with vertical line
{"nsupseteq", 0x02289}, // NEITHER A SUPERSET OF NOR EQUAL TO
// "nsupseteqq", 0x02AC6;0x00338}, // SUPERSET OF ABOVE EQUALS SIGN with slash
{"ntgl", 0x02279}, // NEITHER GREATER-THAN NOR LESS-THAN
{"Ntilde", 0x000D1}, // LATIN CAPITAL LETTER N WITH TILDE
{"ntilde", 0x000F1}, // LATIN SMALL LETTER N WITH TILDE
{"ntlg", 0x02278}, // NEITHER LESS-THAN NOR GREATER-THAN
{"ntriangleleft", 0x022EA}, // NOT NORMAL SUBGROUP OF
{"ntrianglelefteq", 0x022EC}, // NOT NORMAL SUBGROUP OF OR EQUAL TO
{"ntriangleright", 0x022EB}, // DOES NOT CONTAIN AS NORMAL SUBGROUP
{"ntrianglerighteq", 0x022ED}, // DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
{"Nu", 0x0039D}, // GREEK CAPITAL LETTER NU
{"nu", 0x003BD}, // GREEK SMALL LETTER NU
{"num", 0x00023}, // NUMBER SIGN
{"numero", 0x02116}, // NUMERO SIGN
{"numsp", 0x02007}, // FIGURE SPACE
// "nvap", 0x0224D;0x020D2}, // EQUIVALENT TO with vertical line
{"nvdash", 0x022AC}, // DOES NOT PROVE
{"nvDash", 0x022AD}, // NOT TRUE
{"nVdash", 0x022AE}, // DOES NOT FORCE
{"nVDash", 0x022AF}, // NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
// "nvge", 0x02265;0x020D2}, // GREATER-THAN OR EQUAL TO with vertical line
// "nvgt", 0x0003E;0x020D2}, // GREATER-THAN SIGN with vertical line
{"nvHarr", 0x02904}, // LEFT RIGHT DOUBLE ARROW WITH VERTICAL STROKE
{"nvinfin", 0x029DE}, // INFINITY NEGATED WITH VERTICAL BAR
{"nvlArr", 0x02902}, // LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE
// "nvle", 0x02264;0x020D2}, // LESS-THAN OR EQUAL TO with vertical line
// "nvlt", 0x0003C;0x020D2}, // LESS-THAN SIGN with vertical line
// "nvltrie", 0x022B4;0x020D2}, // NORMAL SUBGROUP OF OR EQUAL TO with vertical line
{"nvrArr", 0x02903}, // RIGHTWARDS DOUBLE ARROW WITH VERTICAL STROKE
// "nvrtrie", 0x022B5;0x020D2}, // CONTAINS AS NORMAL SUBGROUP OR EQUAL TO with vertical line
// "nvsim", 0x0223C;0x020D2}, // TILDE OPERATOR with vertical line
{"nwarhk", 0x02923}, // NORTH WEST ARROW WITH HOOK
{"nwarr", 0x02196}, // NORTH WEST ARROW
{"nwArr", 0x021D6}, // NORTH WEST DOUBLE ARROW
{"nwarrow", 0x02196}, // NORTH WEST ARROW
{"nwnear", 0x02927}, // NORTH WEST ARROW AND NORTH EAST ARROW
];
immutable NameId[] namesO =
[
{"Oacgr", 0x0038C}, // GREEK CAPITAL LETTER OMICRON WITH TONOS
{"oacgr", 0x003CC}, // GREEK SMALL LETTER OMICRON WITH TONOS
{"Oacute", 0x000D3}, // LATIN CAPITAL LETTER O WITH ACUTE
{"oacute", 0x000F3}, // LATIN SMALL LETTER O WITH ACUTE
{"oast", 0x0229B}, // CIRCLED ASTERISK OPERATOR
{"ocir", 0x0229A}, // CIRCLED RING OPERATOR
{"Ocirc", 0x000D4}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX
{"ocirc", 0x000F4}, // LATIN SMALL LETTER O WITH CIRCUMFLEX
{"Ocy", 0x0041E}, // CYRILLIC CAPITAL LETTER O
{"ocy", 0x0043E}, // CYRILLIC SMALL LETTER O
{"odash", 0x0229D}, // CIRCLED DASH
{"Odblac", 0x00150}, // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
{"odblac", 0x00151}, // LATIN SMALL LETTER O WITH DOUBLE ACUTE
{"odiv", 0x02A38}, // CIRCLED DIVISION SIGN
{"odot", 0x02299}, // CIRCLED DOT OPERATOR
{"odsold", 0x029BC}, // CIRCLED ANTICLOCKWISE-ROTATED DIVISION SIGN
{"OElig", 0x00152}, // LATIN CAPITAL LIGATURE OE
{"oelig", 0x00153}, // LATIN SMALL LIGATURE OE
{"ofcir", 0x029BF}, // CIRCLED BULLET
{"Ofr", 0x1D512}, // MATHEMATICAL FRAKTUR CAPITAL O
{"ofr", 0x1D52C}, // MATHEMATICAL FRAKTUR SMALL O
{"ogon", 0x002DB}, // OGONEK
{"Ogr", 0x0039F}, // GREEK CAPITAL LETTER OMICRON
{"ogr", 0x003BF}, // GREEK SMALL LETTER OMICRON
{"Ograve", 0x000D2}, // LATIN CAPITAL LETTER O WITH GRAVE
{"ograve", 0x000F2}, // LATIN SMALL LETTER O WITH GRAVE
{"ogt", 0x029C1}, // CIRCLED GREATER-THAN
{"OHacgr", 0x0038F}, // GREEK CAPITAL LETTER OMEGA WITH TONOS
{"ohacgr", 0x003CE}, // GREEK SMALL LETTER OMEGA WITH TONOS
{"ohbar", 0x029B5}, // CIRCLE WITH HORIZONTAL BAR
{"OHgr", 0x003A9}, // GREEK CAPITAL LETTER OMEGA
{"ohgr", 0x003C9}, // GREEK SMALL LETTER OMEGA
{"ohm", 0x003A9}, // GREEK CAPITAL LETTER OMEGA
{"oint", 0x0222E}, // CONTOUR INTEGRAL
{"olarr", 0x021BA}, // ANTICLOCKWISE OPEN CIRCLE ARROW
{"olcir", 0x029BE}, // CIRCLED WHITE BULLET
{"olcross", 0x029BB}, // CIRCLE WITH SUPERIMPOSED X
{"oline", 0x0203E}, // OVERLINE
{"olt", 0x029C0}, // CIRCLED LESS-THAN
{"Omacr", 0x0014C}, // LATIN CAPITAL LETTER O WITH MACRON
{"omacr", 0x0014D}, // LATIN SMALL LETTER O WITH MACRON
{"Omega", 0x003A9}, // GREEK CAPITAL LETTER OMEGA
{"omega", 0x003C9}, // GREEK SMALL LETTER OMEGA
{"Omicron", 0x0039F}, // GREEK CAPITAL LETTER OMICRON
{"omicron", 0x003BF}, // GREEK SMALL LETTER OMICRON
{"omid", 0x029B6}, // CIRCLED VERTICAL BAR
{"ominus", 0x02296}, // CIRCLED MINUS
{"Oopf", 0x1D546}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL O
{"oopf", 0x1D560}, // MATHEMATICAL DOUBLE-STRUCK SMALL O
{"opar", 0x029B7}, // CIRCLED PARALLEL
{"OpenCurlyDoubleQuote", 0x0201C}, // LEFT DOUBLE QUOTATION MARK
{"OpenCurlyQuote", 0x02018}, // LEFT SINGLE QUOTATION MARK
{"operp", 0x029B9}, // CIRCLED PERPENDICULAR
{"oplus", 0x02295}, // CIRCLED PLUS
{"or", 0x02228}, // LOGICAL OR
{"Or", 0x02A54}, // DOUBLE LOGICAL OR
{"orarr", 0x021BB}, // CLOCKWISE OPEN CIRCLE ARROW
{"ord", 0x02A5D}, // LOGICAL OR WITH HORIZONTAL DASH
{"order", 0x02134}, // SCRIPT SMALL O
{"orderof", 0x02134}, // SCRIPT SMALL O
{"ordf", 0x000AA}, // FEMININE ORDINAL INDICATOR
{"ordm", 0x000BA}, // MASCULINE ORDINAL INDICATOR
{"origof", 0x022B6}, // ORIGINAL OF
{"oror", 0x02A56}, // TWO INTERSECTING LOGICAL OR
{"orslope", 0x02A57}, // SLOPING LARGE OR
{"orv", 0x02A5B}, // LOGICAL OR WITH MIDDLE STEM
{"oS", 0x024C8}, // CIRCLED LATIN CAPITAL LETTER S
{"oscr", 0x02134}, // SCRIPT SMALL O
{"Oscr", 0x1D4AA}, // MATHEMATICAL SCRIPT CAPITAL O
{"Oslash", 0x000D8}, // LATIN CAPITAL LETTER O WITH STROKE
{"oslash", 0x000F8}, // LATIN SMALL LETTER O WITH STROKE
{"osol", 0x02298}, // CIRCLED DIVISION SLASH
{"Otilde", 0x000D5}, // LATIN CAPITAL LETTER O WITH TILDE
{"otilde", 0x000F5}, // LATIN SMALL LETTER O WITH TILDE
{"otimes", 0x02297}, // CIRCLED TIMES
{"Otimes", 0x02A37}, // MULTIPLICATION SIGN IN DOUBLE CIRCLE
{"otimesas", 0x02A36}, // CIRCLED MULTIPLICATION SIGN WITH CIRCUMFLEX ACCENT
{"Ouml", 0x000D6}, // LATIN CAPITAL LETTER O WITH DIAERESIS
{"ouml", 0x000F6}, // LATIN SMALL LETTER O WITH DIAERESIS
{"ovbar", 0x0233D}, // APL FUNCTIONAL SYMBOL CIRCLE STILE
{"OverBar", 0x0203E}, // OVERLINE
{"OverBrace", 0x023DE}, // TOP CURLY BRACKET
{"OverBracket", 0x023B4}, // TOP SQUARE BRACKET
{"OverParenthesis", 0x023DC}, // TOP PARENTHESIS
];
immutable NameId[] namesP =
[
{"par", 0x02225}, // PARALLEL TO
{"para", 0x000B6}, // PILCROW SIGN
{"parallel", 0x02225}, // PARALLEL TO
{"parsim", 0x02AF3}, // PARALLEL WITH TILDE OPERATOR
{"parsl", 0x02AFD}, // DOUBLE SOLIDUS OPERATOR
{"part", 0x02202}, // PARTIAL DIFFERENTIAL
{"PartialD", 0x02202}, // PARTIAL DIFFERENTIAL
{"Pcy", 0x0041F}, // CYRILLIC CAPITAL LETTER PE
{"pcy", 0x0043F}, // CYRILLIC SMALL LETTER PE
{"percnt", 0x00025}, // PERCENT SIGN
{"period", 0x0002E}, // FULL STOP
{"permil", 0x02030}, // PER MILLE SIGN
{"perp", 0x022A5}, // UP TACK
{"pertenk", 0x02031}, // PER TEN THOUSAND SIGN
{"Pfr", 0x1D513}, // MATHEMATICAL FRAKTUR CAPITAL P
{"pfr", 0x1D52D}, // MATHEMATICAL FRAKTUR SMALL P
{"Pgr", 0x003A0}, // GREEK CAPITAL LETTER PI
{"pgr", 0x003C0}, // GREEK SMALL LETTER PI
{"PHgr", 0x003A6}, // GREEK CAPITAL LETTER PHI
{"phgr", 0x003C6}, // GREEK SMALL LETTER PHI
{"Phi", 0x003A6}, // GREEK CAPITAL LETTER PHI
{"phi", 0x003C6}, // GREEK SMALL LETTER PHI
{"phiv", 0x003D5}, // GREEK PHI SYMBOL
{"phmmat", 0x02133}, // SCRIPT CAPITAL M
{"phone", 0x0260E}, // BLACK TELEPHONE
{"Pi", 0x003A0}, // GREEK CAPITAL LETTER PI
{"pi", 0x003C0}, // GREEK SMALL LETTER PI
{"pitchfork", 0x022D4}, // PITCHFORK
{"piv", 0x003D6}, // GREEK PI SYMBOL
{"planck", 0x0210F}, // PLANCK CONSTANT OVER TWO PI
{"planckh", 0x0210E}, // PLANCK CONSTANT
{"plankv", 0x0210F}, // PLANCK CONSTANT OVER TWO PI
{"plus", 0x0002B}, // PLUS SIGN
{"plusacir", 0x02A23}, // PLUS SIGN WITH CIRCUMFLEX ACCENT ABOVE
{"plusb", 0x0229E}, // SQUARED PLUS
{"pluscir", 0x02A22}, // PLUS SIGN WITH SMALL CIRCLE ABOVE
{"plusdo", 0x02214}, // DOT PLUS
{"plusdu", 0x02A25}, // PLUS SIGN WITH DOT BELOW
{"pluse", 0x02A72}, // PLUS SIGN ABOVE EQUALS SIGN
{"PlusMinus", 0x000B1}, // PLUS-MINUS SIGN
{"plusmn", 0x000B1}, // PLUS-MINUS SIGN
{"plussim", 0x02A26}, // PLUS SIGN WITH TILDE BELOW
{"plustwo", 0x02A27}, // PLUS SIGN WITH SUBSCRIPT TWO
{"pm", 0x000B1}, // PLUS-MINUS SIGN
{"Poincareplane", 0x0210C}, // BLACK-LETTER CAPITAL H
{"pointint", 0x02A15}, // INTEGRAL AROUND A POINT OPERATOR
{"Popf", 0x02119}, // DOUBLE-STRUCK CAPITAL P
{"popf", 0x1D561}, // MATHEMATICAL DOUBLE-STRUCK SMALL P
{"pound", 0x000A3}, // POUND SIGN
{"pr", 0x0227A}, // PRECEDES
{"Pr", 0x02ABB}, // DOUBLE PRECEDES
{"prap", 0x02AB7}, // PRECEDES ABOVE ALMOST EQUAL TO
{"prcue", 0x0227C}, // PRECEDES OR EQUAL TO
{"pre", 0x02AAF}, // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
{"prE", 0x02AB3}, // PRECEDES ABOVE EQUALS SIGN
{"prec", 0x0227A}, // PRECEDES
{"precapprox", 0x02AB7}, // PRECEDES ABOVE ALMOST EQUAL TO
{"preccurlyeq", 0x0227C}, // PRECEDES OR EQUAL TO
{"Precedes", 0x0227A}, // PRECEDES
{"PrecedesEqual", 0x02AAF}, // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
{"PrecedesSlantEqual", 0x0227C}, // PRECEDES OR EQUAL TO
{"PrecedesTilde", 0x0227E}, // PRECEDES OR EQUIVALENT TO
{"preceq", 0x02AAF}, // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
{"precnapprox", 0x02AB9}, // PRECEDES ABOVE NOT ALMOST EQUAL TO
{"precneqq", 0x02AB5}, // PRECEDES ABOVE NOT EQUAL TO
{"precnsim", 0x022E8}, // PRECEDES BUT NOT EQUIVALENT TO
{"precsim", 0x0227E}, // PRECEDES OR EQUIVALENT TO
{"prime", 0x02032}, // PRIME
{"Prime", 0x02033}, // DOUBLE PRIME
{"primes", 0x02119}, // DOUBLE-STRUCK CAPITAL P
{"prnap", 0x02AB9}, // PRECEDES ABOVE NOT ALMOST EQUAL TO
{"prnE", 0x02AB5}, // PRECEDES ABOVE NOT EQUAL TO
{"prnsim", 0x022E8}, // PRECEDES BUT NOT EQUIVALENT TO
{"prod", 0x0220F}, // N-ARY PRODUCT
{"Product", 0x0220F}, // N-ARY PRODUCT
{"profalar", 0x0232E}, // ALL AROUND-PROFILE
{"profline", 0x02312}, // ARC
{"profsurf", 0x02313}, // SEGMENT
{"prop", 0x0221D}, // PROPORTIONAL TO
{"Proportion", 0x02237}, // PROPORTION
{"Proportional", 0x0221D}, // PROPORTIONAL TO
{"propto", 0x0221D}, // PROPORTIONAL TO
{"prsim", 0x0227E}, // PRECEDES OR EQUIVALENT TO
{"prurel", 0x022B0}, // PRECEDES UNDER RELATION
{"Pscr", 0x1D4AB}, // MATHEMATICAL SCRIPT CAPITAL P
{"pscr", 0x1D4C5}, // MATHEMATICAL SCRIPT SMALL P
{"PSgr", 0x003A8}, // GREEK CAPITAL LETTER PSI
{"psgr", 0x003C8}, // GREEK SMALL LETTER PSI
{"Psi", 0x003A8}, // GREEK CAPITAL LETTER PSI
{"psi", 0x003C8}, // GREEK SMALL LETTER PSI
{"puncsp", 0x02008}, // PUNCTUATION SPACE
];
immutable NameId[] namesQ =
[
{"Qfr", 0x1D514}, // MATHEMATICAL FRAKTUR CAPITAL Q
{"qfr", 0x1D52E}, // MATHEMATICAL FRAKTUR SMALL Q
{"qint", 0x02A0C}, // QUADRUPLE INTEGRAL OPERATOR
{"Qopf", 0x0211A}, // DOUBLE-STRUCK CAPITAL Q
{"qopf", 0x1D562}, // MATHEMATICAL DOUBLE-STRUCK SMALL Q
{"qprime", 0x02057}, // QUADRUPLE PRIME
{"Qscr", 0x1D4AC}, // MATHEMATICAL SCRIPT CAPITAL Q
{"qscr", 0x1D4C6}, // MATHEMATICAL SCRIPT SMALL Q
{"quaternions", 0x0210D}, // DOUBLE-STRUCK CAPITAL H
{"quatint", 0x02A16}, // QUATERNION INTEGRAL OPERATOR
{"quest", 0x0003F}, // QUESTION MARK
{"questeq", 0x0225F}, // QUESTIONED EQUAL TO
{"quot", 0x00022}, // QUOTATION MARK
{"QUOT", 0x00022}, // QUOTATION MARK
];
immutable NameId[] namesR =
[
{"rAarr", 0x021DB}, // RIGHTWARDS TRIPLE ARROW
// "race", 0x0223D;0x00331}, // REVERSED TILDE with underline
{"Racute", 0x00154}, // LATIN CAPITAL LETTER R WITH ACUTE
{"racute", 0x00155}, // LATIN SMALL LETTER R WITH ACUTE
{"radic", 0x0221A}, // SQUARE ROOT
{"raemptyv", 0x029B3}, // EMPTY SET WITH RIGHT ARROW ABOVE
{"rang", 0x027E9}, // MATHEMATICAL RIGHT ANGLE BRACKET
{"Rang", 0x027EB}, // MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET
{"rangd", 0x02992}, // RIGHT ANGLE BRACKET WITH DOT
{"range", 0x029A5}, // REVERSED ANGLE WITH UNDERBAR
{"rangle", 0x027E9}, // MATHEMATICAL RIGHT ANGLE BRACKET
{"raquo", 0x000BB}, // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
{"rarr", 0x02192}, // RIGHTWARDS ARROW
{"Rarr", 0x021A0}, // RIGHTWARDS TWO HEADED ARROW
{"rArr", 0x021D2}, // RIGHTWARDS DOUBLE ARROW
{"rarrap", 0x02975}, // RIGHTWARDS ARROW ABOVE ALMOST EQUAL TO
{"rarrb", 0x021E5}, // RIGHTWARDS ARROW TO BAR
{"rarrbfs", 0x02920}, // RIGHTWARDS ARROW FROM BAR TO BLACK DIAMOND
{"rarrc", 0x02933}, // WAVE ARROW POINTING DIRECTLY RIGHT
{"rarrfs", 0x0291E}, // RIGHTWARDS ARROW TO BLACK DIAMOND
{"rarrhk", 0x021AA}, // RIGHTWARDS ARROW WITH HOOK
{"rarrlp", 0x021AC}, // RIGHTWARDS ARROW WITH LOOP
{"rarrpl", 0x02945}, // RIGHTWARDS ARROW WITH PLUS BELOW
{"rarrsim", 0x02974}, // RIGHTWARDS ARROW ABOVE TILDE OPERATOR
{"rarrtl", 0x021A3}, // RIGHTWARDS ARROW WITH TAIL
{"Rarrtl", 0x02916}, // RIGHTWARDS TWO-HEADED ARROW WITH TAIL
{"rarrw", 0x0219D}, // RIGHTWARDS WAVE ARROW
{"ratail", 0x0291A}, // RIGHTWARDS ARROW-TAIL
{"rAtail", 0x0291C}, // RIGHTWARDS DOUBLE ARROW-TAIL
{"ratio", 0x02236}, // RATIO
{"rationals", 0x0211A}, // DOUBLE-STRUCK CAPITAL Q
{"rbarr", 0x0290D}, // RIGHTWARDS DOUBLE DASH ARROW
{"rBarr", 0x0290F}, // RIGHTWARDS TRIPLE DASH ARROW
{"RBarr", 0x02910}, // RIGHTWARDS TWO-HEADED TRIPLE DASH ARROW
{"rbbrk", 0x02773}, // LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
{"rbrace", 0x0007D}, // RIGHT CURLY BRACKET
{"rbrack", 0x0005D}, // RIGHT SQUARE BRACKET
{"rbrke", 0x0298C}, // RIGHT SQUARE BRACKET WITH UNDERBAR
{"rbrksld", 0x0298E}, // RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
{"rbrkslu", 0x02990}, // RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
{"Rcaron", 0x00158}, // LATIN CAPITAL LETTER R WITH CARON
{"rcaron", 0x00159}, // LATIN SMALL LETTER R WITH CARON
{"Rcedil", 0x00156}, // LATIN CAPITAL LETTER R WITH CEDILLA
{"rcedil", 0x00157}, // LATIN SMALL LETTER R WITH CEDILLA
{"rceil", 0x02309}, // RIGHT CEILING
{"rcub", 0x0007D}, // RIGHT CURLY BRACKET
{"Rcy", 0x00420}, // CYRILLIC CAPITAL LETTER ER
{"rcy", 0x00440}, // CYRILLIC SMALL LETTER ER
{"rdca", 0x02937}, // ARROW POINTING DOWNWARDS THEN CURVING RIGHTWARDS
{"rdldhar", 0x02969}, // RIGHTWARDS HARPOON WITH BARB DOWN ABOVE LEFTWARDS HARPOON WITH BARB DOWN
{"rdquo", 0x0201D}, // RIGHT DOUBLE QUOTATION MARK
{"rdquor", 0x0201D}, // RIGHT DOUBLE QUOTATION MARK
{"rdsh", 0x021B3}, // DOWNWARDS ARROW WITH TIP RIGHTWARDS
{"Re", 0x0211C}, // BLACK-LETTER CAPITAL R
{"real", 0x0211C}, // BLACK-LETTER CAPITAL R
{"realine", 0x0211B}, // SCRIPT CAPITAL R
{"realpart", 0x0211C}, // BLACK-LETTER CAPITAL R
{"reals", 0x0211D}, // DOUBLE-STRUCK CAPITAL R
{"rect", 0x025AD}, // WHITE RECTANGLE
{"reg", 0x000AE}, // REGISTERED SIGN
{"REG", 0x000AE}, // REGISTERED SIGN
{"ReverseElement", 0x0220B}, // CONTAINS AS MEMBER
{"ReverseEquilibrium", 0x021CB}, // LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
{"ReverseUpEquilibrium", 0x0296F}, // DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
{"rfisht", 0x0297D}, // RIGHT FISH TAIL
{"rfloor", 0x0230B}, // RIGHT FLOOR
{"Rfr", 0x0211C}, // BLACK-LETTER CAPITAL R
{"rfr", 0x1D52F}, // MATHEMATICAL FRAKTUR SMALL R
{"Rgr", 0x003A1}, // GREEK CAPITAL LETTER RHO
{"rgr", 0x003C1}, // GREEK SMALL LETTER RHO
{"rHar", 0x02964}, // RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
{"rhard", 0x021C1}, // RIGHTWARDS HARPOON WITH BARB DOWNWARDS
{"rharu", 0x021C0}, // RIGHTWARDS HARPOON WITH BARB UPWARDS
{"rharul", 0x0296C}, // RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
{"Rho", 0x003A1}, // GREEK CAPITAL LETTER RHO
{"rho", 0x003C1}, // GREEK SMALL LETTER RHO
{"rhov", 0x003F1}, // GREEK RHO SYMBOL
{"RightAngleBracket", 0x027E9}, // MATHEMATICAL RIGHT ANGLE BRACKET
{"rightarrow", 0x02192}, // RIGHTWARDS ARROW
{"RightArrow", 0x02192}, // RIGHTWARDS ARROW
{"Rightarrow", 0x021D2}, // RIGHTWARDS DOUBLE ARROW
{"RightArrowBar", 0x021E5}, // RIGHTWARDS ARROW TO BAR
{"RightArrowLeftArrow", 0x021C4}, // RIGHTWARDS ARROW OVER LEFTWARDS ARROW
{"rightarrowtail", 0x021A3}, // RIGHTWARDS ARROW WITH TAIL
{"RightCeiling", 0x02309}, // RIGHT CEILING
{"RightDoubleBracket", 0x027E7}, // MATHEMATICAL RIGHT WHITE SQUARE BRACKET
{"RightDownTeeVector", 0x0295D}, // DOWNWARDS HARPOON WITH BARB RIGHT FROM BAR
{"RightDownVector", 0x021C2}, // DOWNWARDS HARPOON WITH BARB RIGHTWARDS
{"RightDownVectorBar", 0x02955}, // DOWNWARDS HARPOON WITH BARB RIGHT TO BAR
{"RightFloor", 0x0230B}, // RIGHT FLOOR
{"rightharpoondown", 0x021C1}, // RIGHTWARDS HARPOON WITH BARB DOWNWARDS
{"rightharpoonup", 0x021C0}, // RIGHTWARDS HARPOON WITH BARB UPWARDS
{"rightleftarrows", 0x021C4}, // RIGHTWARDS ARROW OVER LEFTWARDS ARROW
{"rightleftharpoons", 0x021CC}, // RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
{"rightrightarrows", 0x021C9}, // RIGHTWARDS PAIRED ARROWS
{"rightsquigarrow", 0x0219D}, // RIGHTWARDS WAVE ARROW
{"RightTee", 0x022A2}, // RIGHT TACK
{"RightTeeArrow", 0x021A6}, // RIGHTWARDS ARROW FROM BAR
{"RightTeeVector", 0x0295B}, // RIGHTWARDS HARPOON WITH BARB UP FROM BAR
{"rightthreetimes", 0x022CC}, // RIGHT SEMIDIRECT PRODUCT
{"RightTriangle", 0x022B3}, // CONTAINS AS NORMAL SUBGROUP
{"RightTriangleBar", 0x029D0}, // VERTICAL BAR BESIDE RIGHT TRIANGLE
{"RightTriangleEqual", 0x022B5}, // CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
{"RightUpDownVector", 0x0294F}, // UP BARB RIGHT DOWN BARB RIGHT HARPOON
{"RightUpTeeVector", 0x0295C}, // UPWARDS HARPOON WITH BARB RIGHT FROM BAR
{"RightUpVector", 0x021BE}, // UPWARDS HARPOON WITH BARB RIGHTWARDS
{"RightUpVectorBar", 0x02954}, // UPWARDS HARPOON WITH BARB RIGHT TO BAR
{"RightVector", 0x021C0}, // RIGHTWARDS HARPOON WITH BARB UPWARDS
{"RightVectorBar", 0x02953}, // RIGHTWARDS HARPOON WITH BARB UP TO BAR
{"ring", 0x002DA}, // RING ABOVE
{"risingdotseq", 0x02253}, // IMAGE OF OR APPROXIMATELY EQUAL TO
{"rlarr", 0x021C4}, // RIGHTWARDS ARROW OVER LEFTWARDS ARROW
{"rlhar", 0x021CC}, // RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
{"rlm", 0x0200F}, // RIGHT-TO-LEFT MARK
{"rmoust", 0x023B1}, // UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION
{"rmoustache", 0x023B1}, // UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION
{"rnmid", 0x02AEE}, // DOES NOT DIVIDE WITH REVERSED NEGATION SLASH
{"roang", 0x027ED}, // MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET
{"roarr", 0x021FE}, // RIGHTWARDS OPEN-HEADED ARROW
{"robrk", 0x027E7}, // MATHEMATICAL RIGHT WHITE SQUARE BRACKET
{"ropar", 0x02986}, // RIGHT WHITE PARENTHESIS
{"Ropf", 0x0211D}, // DOUBLE-STRUCK CAPITAL R
{"ropf", 0x1D563}, // MATHEMATICAL DOUBLE-STRUCK SMALL R
{"roplus", 0x02A2E}, // PLUS SIGN IN RIGHT HALF CIRCLE
{"rotimes", 0x02A35}, // MULTIPLICATION SIGN IN RIGHT HALF CIRCLE
{"RoundImplies", 0x02970}, // RIGHT DOUBLE ARROW WITH ROUNDED HEAD
{"rpar", 0x00029}, // RIGHT PARENTHESIS
{"rpargt", 0x02994}, // RIGHT ARC GREATER-THAN BRACKET
{"rppolint", 0x02A12}, // LINE INTEGRATION WITH RECTANGULAR PATH AROUND POLE
{"rrarr", 0x021C9}, // RIGHTWARDS PAIRED ARROWS
{"Rrightarrow", 0x021DB}, // RIGHTWARDS TRIPLE ARROW
{"rsaquo", 0x0203A}, // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
{"Rscr", 0x0211B}, // SCRIPT CAPITAL R
{"rscr", 0x1D4C7}, // MATHEMATICAL SCRIPT SMALL R
{"rsh", 0x021B1}, // UPWARDS ARROW WITH TIP RIGHTWARDS
{"Rsh", 0x021B1}, // UPWARDS ARROW WITH TIP RIGHTWARDS
{"rsqb", 0x0005D}, // RIGHT SQUARE BRACKET
{"rsquo", 0x02019}, // RIGHT SINGLE QUOTATION MARK
{"rsquor", 0x02019}, // RIGHT SINGLE QUOTATION MARK
{"rthree", 0x022CC}, // RIGHT SEMIDIRECT PRODUCT
{"rtimes", 0x022CA}, // RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
{"rtri", 0x025B9}, // WHITE RIGHT-POINTING SMALL TRIANGLE
{"rtrie", 0x022B5}, // CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
{"rtrif", 0x025B8}, // BLACK RIGHT-POINTING SMALL TRIANGLE
{"rtriltri", 0x029CE}, // RIGHT TRIANGLE ABOVE LEFT TRIANGLE
{"RuleDelayed", 0x029F4}, // RULE-DELAYED
{"ruluhar", 0x02968}, // RIGHTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB UP
{"rx", 0x0211E}, // PRESCRIPTION TAKE
];
immutable NameId[] namesS =
[
{"Sacute", 0x0015A}, // LATIN CAPITAL LETTER S WITH ACUTE
{"sacute", 0x0015B}, // LATIN SMALL LETTER S WITH ACUTE
{"sbquo", 0x0201A}, // SINGLE LOW-9 QUOTATION MARK
{"sc", 0x0227B}, // SUCCEEDS
{"Sc", 0x02ABC}, // DOUBLE SUCCEEDS
{"scap", 0x02AB8}, // SUCCEEDS ABOVE ALMOST EQUAL TO
{"Scaron", 0x00160}, // LATIN CAPITAL LETTER S WITH CARON
{"scaron", 0x00161}, // LATIN SMALL LETTER S WITH CARON
{"sccue", 0x0227D}, // SUCCEEDS OR EQUAL TO
{"sce", 0x02AB0}, // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
{"scE", 0x02AB4}, // SUCCEEDS ABOVE EQUALS SIGN
{"Scedil", 0x0015E}, // LATIN CAPITAL LETTER S WITH CEDILLA
{"scedil", 0x0015F}, // LATIN SMALL LETTER S WITH CEDILLA
{"Scirc", 0x0015C}, // LATIN CAPITAL LETTER S WITH CIRCUMFLEX
{"scirc", 0x0015D}, // LATIN SMALL LETTER S WITH CIRCUMFLEX
{"scnap", 0x02ABA}, // SUCCEEDS ABOVE NOT ALMOST EQUAL TO
{"scnE", 0x02AB6}, // SUCCEEDS ABOVE NOT EQUAL TO
{"scnsim", 0x022E9}, // SUCCEEDS BUT NOT EQUIVALENT TO
{"scpolint", 0x02A13}, // LINE INTEGRATION WITH SEMICIRCULAR PATH AROUND POLE
{"scsim", 0x0227F}, // SUCCEEDS OR EQUIVALENT TO
{"Scy", 0x00421}, // CYRILLIC CAPITAL LETTER ES
{"scy", 0x00441}, // CYRILLIC SMALL LETTER ES
{"sdot", 0x022C5}, // DOT OPERATOR
{"sdotb", 0x022A1}, // SQUARED DOT OPERATOR
{"sdote", 0x02A66}, // EQUALS SIGN WITH DOT BELOW
{"searhk", 0x02925}, // SOUTH EAST ARROW WITH HOOK
{"searr", 0x02198}, // SOUTH EAST ARROW
{"seArr", 0x021D8}, // SOUTH EAST DOUBLE ARROW
{"searrow", 0x02198}, // SOUTH EAST ARROW
{"sect", 0x000A7}, // SECTION SIGN
{"semi", 0x0003B}, // SEMICOLON
{"seswar", 0x02929}, // SOUTH EAST ARROW AND SOUTH WEST ARROW
{"setminus", 0x02216}, // SET MINUS
{"setmn", 0x02216}, // SET MINUS
{"sext", 0x02736}, // SIX POINTED BLACK STAR
{"sfgr", 0x003C2}, // GREEK SMALL LETTER FINAL SIGMA
{"Sfr", 0x1D516}, // MATHEMATICAL FRAKTUR CAPITAL S
{"sfr", 0x1D530}, // MATHEMATICAL FRAKTUR SMALL S
{"sfrown", 0x02322}, // FROWN
{"Sgr", 0x003A3}, // GREEK CAPITAL LETTER SIGMA
{"sgr", 0x003C3}, // GREEK SMALL LETTER SIGMA
{"sharp", 0x0266F}, // MUSIC SHARP SIGN
{"SHCHcy", 0x00429}, // CYRILLIC CAPITAL LETTER SHCHA
{"shchcy", 0x00449}, // CYRILLIC SMALL LETTER SHCHA
{"SHcy", 0x00428}, // CYRILLIC CAPITAL LETTER SHA
{"shcy", 0x00448}, // CYRILLIC SMALL LETTER SHA
{"ShortDownArrow", 0x02193}, // DOWNWARDS ARROW
{"ShortLeftArrow", 0x02190}, // LEFTWARDS ARROW
{"shortmid", 0x02223}, // DIVIDES
{"shortparallel", 0x02225}, // PARALLEL TO
{"ShortRightArrow", 0x02192}, // RIGHTWARDS ARROW
{"ShortUpArrow", 0x02191}, // UPWARDS ARROW
{"shy", 0x000AD}, // SOFT HYPHEN
{"Sigma", 0x003A3}, // GREEK CAPITAL LETTER SIGMA
{"sigma", 0x003C3}, // GREEK SMALL LETTER SIGMA
{"sigmaf", 0x003C2}, // GREEK SMALL LETTER FINAL SIGMA
{"sigmav", 0x003C2}, // GREEK SMALL LETTER FINAL SIGMA
{"sim", 0x0223C}, // TILDE OPERATOR
{"simdot", 0x02A6A}, // TILDE OPERATOR WITH DOT ABOVE
{"sime", 0x02243}, // ASYMPTOTICALLY EQUAL TO
{"simeq", 0x02243}, // ASYMPTOTICALLY EQUAL TO
{"simg", 0x02A9E}, // SIMILAR OR GREATER-THAN
{"simgE", 0x02AA0}, // SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN
{"siml", 0x02A9D}, // SIMILAR OR LESS-THAN
{"simlE", 0x02A9F}, // SIMILAR ABOVE LESS-THAN ABOVE EQUALS SIGN
{"simne", 0x02246}, // APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
{"simplus", 0x02A24}, // PLUS SIGN WITH TILDE ABOVE
{"simrarr", 0x02972}, // TILDE OPERATOR ABOVE RIGHTWARDS ARROW
{"slarr", 0x02190}, // LEFTWARDS ARROW
{"SmallCircle", 0x02218}, // RING OPERATOR
{"smallsetminus", 0x02216}, // SET MINUS
{"smashp", 0x02A33}, // SMASH PRODUCT
{"smeparsl", 0x029E4}, // EQUALS SIGN AND SLANTED PARALLEL WITH TILDE ABOVE
{"smid", 0x02223}, // DIVIDES
{"smile", 0x02323}, // SMILE
{"smt", 0x02AAA}, // SMALLER THAN
{"smte", 0x02AAC}, // SMALLER THAN OR EQUAL TO
// "smtes", 0x02AAC;0x0FE00}, // SMALLER THAN OR slanted EQUAL
{"SOFTcy", 0x0042C}, // CYRILLIC CAPITAL LETTER SOFT SIGN
{"softcy", 0x0044C}, // CYRILLIC SMALL LETTER SOFT SIGN
{"sol", 0x0002F}, // SOLIDUS
{"solb", 0x029C4}, // SQUARED RISING DIAGONAL SLASH
{"solbar", 0x0233F}, // APL FUNCTIONAL SYMBOL SLASH BAR
{"Sopf", 0x1D54A}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL S
{"sopf", 0x1D564}, // MATHEMATICAL DOUBLE-STRUCK SMALL S
{"spades", 0x02660}, // BLACK SPADE SUIT
{"spadesuit", 0x02660}, // BLACK SPADE SUIT
{"spar", 0x02225}, // PARALLEL TO
{"sqcap", 0x02293}, // SQUARE CAP
// "sqcaps", 0x02293;0x0FE00}, // SQUARE CAP with serifs
{"sqcup", 0x02294}, // SQUARE CUP
// "sqcups", 0x02294;0x0FE00}, // SQUARE CUP with serifs
{"Sqrt", 0x0221A}, // SQUARE ROOT
{"sqsub", 0x0228F}, // SQUARE IMAGE OF
{"sqsube", 0x02291}, // SQUARE IMAGE OF OR EQUAL TO
{"sqsubset", 0x0228F}, // SQUARE IMAGE OF
{"sqsubseteq", 0x02291}, // SQUARE IMAGE OF OR EQUAL TO
{"sqsup", 0x02290}, // SQUARE ORIGINAL OF
{"sqsupe", 0x02292}, // SQUARE ORIGINAL OF OR EQUAL TO
{"sqsupset", 0x02290}, // SQUARE ORIGINAL OF
{"sqsupseteq", 0x02292}, // SQUARE ORIGINAL OF OR EQUAL TO
{"squ", 0x025A1}, // WHITE SQUARE
{"square", 0x025A1}, // WHITE SQUARE
{"Square", 0x025A1}, // WHITE SQUARE
{"SquareIntersection", 0x02293}, // SQUARE CAP
{"SquareSubset", 0x0228F}, // SQUARE IMAGE OF
{"SquareSubsetEqual", 0x02291}, // SQUARE IMAGE OF OR EQUAL TO
{"SquareSuperset", 0x02290}, // SQUARE ORIGINAL OF
{"SquareSupersetEqual", 0x02292}, // SQUARE ORIGINAL OF OR EQUAL TO
{"SquareUnion", 0x02294}, // SQUARE CUP
{"squarf", 0x025AA}, // BLACK SMALL SQUARE
{"squf", 0x025AA}, // BLACK SMALL SQUARE
{"srarr", 0x02192}, // RIGHTWARDS ARROW
{"Sscr", 0x1D4AE}, // MATHEMATICAL SCRIPT CAPITAL S
{"sscr", 0x1D4C8}, // MATHEMATICAL SCRIPT SMALL S
{"ssetmn", 0x02216}, // SET MINUS
{"ssmile", 0x02323}, // SMILE
{"sstarf", 0x022C6}, // STAR OPERATOR
{"Star", 0x022C6}, // STAR OPERATOR
{"star", 0x02606}, // WHITE STAR
{"starf", 0x02605}, // BLACK STAR
{"straightepsilon", 0x003F5}, // GREEK LUNATE EPSILON SYMBOL
{"straightphi", 0x003D5}, // GREEK PHI SYMBOL
{"strns", 0x000AF}, // MACRON
{"sub", 0x02282}, // SUBSET OF
{"Sub", 0x022D0}, // DOUBLE SUBSET
{"subdot", 0x02ABD}, // SUBSET WITH DOT
{"sube", 0x02286}, // SUBSET OF OR EQUAL TO
{"subE", 0x02AC5}, // SUBSET OF ABOVE EQUALS SIGN
{"subedot", 0x02AC3}, // SUBSET OF OR EQUAL TO WITH DOT ABOVE
{"submult", 0x02AC1}, // SUBSET WITH MULTIPLICATION SIGN BELOW
{"subne", 0x0228A}, // SUBSET OF WITH NOT EQUAL TO
{"subnE", 0x02ACB}, // SUBSET OF ABOVE NOT EQUAL TO
{"subplus", 0x02ABF}, // SUBSET WITH PLUS SIGN BELOW
{"subrarr", 0x02979}, // SUBSET ABOVE RIGHTWARDS ARROW
{"subset", 0x02282}, // SUBSET OF
{"Subset", 0x022D0}, // DOUBLE SUBSET
{"subseteq", 0x02286}, // SUBSET OF OR EQUAL TO
{"subseteqq", 0x02AC5}, // SUBSET OF ABOVE EQUALS SIGN
{"SubsetEqual", 0x02286}, // SUBSET OF OR EQUAL TO
{"subsetneq", 0x0228A}, // SUBSET OF WITH NOT EQUAL TO
{"subsetneqq", 0x02ACB}, // SUBSET OF ABOVE NOT EQUAL TO
{"subsim", 0x02AC7}, // SUBSET OF ABOVE TILDE OPERATOR
{"subsub", 0x02AD5}, // SUBSET ABOVE SUBSET
{"subsup", 0x02AD3}, // SUBSET ABOVE SUPERSET
{"succ", 0x0227B}, // SUCCEEDS
{"succapprox", 0x02AB8}, // SUCCEEDS ABOVE ALMOST EQUAL TO
{"succcurlyeq", 0x0227D}, // SUCCEEDS OR EQUAL TO
{"Succeeds", 0x0227B}, // SUCCEEDS
{"SucceedsEqual", 0x02AB0}, // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
{"SucceedsSlantEqual", 0x0227D}, // SUCCEEDS OR EQUAL TO
{"SucceedsTilde", 0x0227F}, // SUCCEEDS OR EQUIVALENT TO
{"succeq", 0x02AB0}, // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
{"succnapprox", 0x02ABA}, // SUCCEEDS ABOVE NOT ALMOST EQUAL TO
{"succneqq", 0x02AB6}, // SUCCEEDS ABOVE NOT EQUAL TO
{"succnsim", 0x022E9}, // SUCCEEDS BUT NOT EQUIVALENT TO
{"succsim", 0x0227F}, // SUCCEEDS OR EQUIVALENT TO
{"SuchThat", 0x0220B}, // CONTAINS AS MEMBER
{"sum", 0x02211}, // N-ARY SUMMATION
{"Sum", 0x02211}, // N-ARY SUMMATION
{"sung", 0x0266A}, // EIGHTH NOTE
{"sup", 0x02283}, // SUPERSET OF
{"Sup", 0x022D1}, // DOUBLE SUPERSET
{"sup1", 0x000B9}, // SUPERSCRIPT ONE
{"sup2", 0x000B2}, // SUPERSCRIPT TWO
{"sup3", 0x000B3}, // SUPERSCRIPT THREE
{"supdot", 0x02ABE}, // SUPERSET WITH DOT
{"supdsub", 0x02AD8}, // SUPERSET BESIDE AND JOINED BY DASH WITH SUBSET
{"supe", 0x02287}, // SUPERSET OF OR EQUAL TO
{"supE", 0x02AC6}, // SUPERSET OF ABOVE EQUALS SIGN
{"supedot", 0x02AC4}, // SUPERSET OF OR EQUAL TO WITH DOT ABOVE
{"Superset", 0x02283}, // SUPERSET OF
{"SupersetEqual", 0x02287}, // SUPERSET OF OR EQUAL TO
{"suphsol", 0x027C9}, // SUPERSET PRECEDING SOLIDUS
{"suphsub", 0x02AD7}, // SUPERSET BESIDE SUBSET
{"suplarr", 0x0297B}, // SUPERSET ABOVE LEFTWARDS ARROW
{"supmult", 0x02AC2}, // SUPERSET WITH MULTIPLICATION SIGN BELOW
{"supne", 0x0228B}, // SUPERSET OF WITH NOT EQUAL TO
{"supnE", 0x02ACC}, // SUPERSET OF ABOVE NOT EQUAL TO
{"supplus", 0x02AC0}, // SUPERSET WITH PLUS SIGN BELOW
{"supset", 0x02283}, // SUPERSET OF
{"Supset", 0x022D1}, // DOUBLE SUPERSET
{"supseteq", 0x02287}, // SUPERSET OF OR EQUAL TO
{"supseteqq", 0x02AC6}, // SUPERSET OF ABOVE EQUALS SIGN
{"supsetneq", 0x0228B}, // SUPERSET OF WITH NOT EQUAL TO
{"supsetneqq", 0x02ACC}, // SUPERSET OF ABOVE NOT EQUAL TO
{"supsim", 0x02AC8}, // SUPERSET OF ABOVE TILDE OPERATOR
{"supsub", 0x02AD4}, // SUPERSET ABOVE SUBSET
{"supsup", 0x02AD6}, // SUPERSET ABOVE SUPERSET
{"swarhk", 0x02926}, // SOUTH WEST ARROW WITH HOOK
{"swarr", 0x02199}, // SOUTH WEST ARROW
{"swArr", 0x021D9}, // SOUTH WEST DOUBLE ARROW
{"swarrow", 0x02199}, // SOUTH WEST ARROW
{"swnwar", 0x0292A}, // SOUTH WEST ARROW AND NORTH WEST ARROW
{"szlig", 0x000DF}, // LATIN SMALL LETTER SHARP S
];
immutable NameId[] namesT =
[
{"Tab", 0x00009}, // CHARACTER TABULATION
{"target", 0x02316}, // POSITION INDICATOR
{"Tau", 0x003A4}, // GREEK CAPITAL LETTER TAU
{"tau", 0x003C4}, // GREEK SMALL LETTER TAU
{"tbrk", 0x023B4}, // TOP SQUARE BRACKET
{"Tcaron", 0x00164}, // LATIN CAPITAL LETTER T WITH CARON
{"tcaron", 0x00165}, // LATIN SMALL LETTER T WITH CARON
{"Tcedil", 0x00162}, // LATIN CAPITAL LETTER T WITH CEDILLA
{"tcedil", 0x00163}, // LATIN SMALL LETTER T WITH CEDILLA
{"Tcy", 0x00422}, // CYRILLIC CAPITAL LETTER TE
{"tcy", 0x00442}, // CYRILLIC SMALL LETTER TE
{"tdot", 0x020DB}, // COMBINING THREE DOTS ABOVE
{"telrec", 0x02315}, // TELEPHONE RECORDER
{"Tfr", 0x1D517}, // MATHEMATICAL FRAKTUR CAPITAL T
{"tfr", 0x1D531}, // MATHEMATICAL FRAKTUR SMALL T
{"Tgr", 0x003A4}, // GREEK CAPITAL LETTER TAU
{"tgr", 0x003C4}, // GREEK SMALL LETTER TAU
{"there4", 0x02234}, // THEREFORE
{"therefore", 0x02234}, // THEREFORE
{"Therefore", 0x02234}, // THEREFORE
{"Theta", 0x00398}, // GREEK CAPITAL LETTER THETA
{"theta", 0x003B8}, // GREEK SMALL LETTER THETA
{"thetasym", 0x003D1}, // GREEK THETA SYMBOL
{"thetav", 0x003D1}, // GREEK THETA SYMBOL
{"THgr", 0x00398}, // GREEK CAPITAL LETTER THETA
{"thgr", 0x003B8}, // GREEK SMALL LETTER THETA
{"thickapprox", 0x02248}, // ALMOST EQUAL TO
{"thicksim", 0x0223C}, // TILDE OPERATOR
// "ThickSpace", 0x0205F;0x0200A}, // space of width 5/18 em
{"thinsp", 0x02009}, // THIN SPACE
{"ThinSpace", 0x02009}, // THIN SPACE
{"thkap", 0x02248}, // ALMOST EQUAL TO
{"thksim", 0x0223C}, // TILDE OPERATOR
{"THORN", 0x000DE}, // LATIN CAPITAL LETTER THORN
{"thorn", 0x000FE}, // LATIN SMALL LETTER THORN
{"tilde", 0x002DC}, // SMALL TILDE
{"Tilde", 0x0223C}, // TILDE OPERATOR
{"TildeEqual", 0x02243}, // ASYMPTOTICALLY EQUAL TO
{"TildeFullEqual", 0x02245}, // APPROXIMATELY EQUAL TO
{"TildeTilde", 0x02248}, // ALMOST EQUAL TO
{"times", 0x000D7}, // MULTIPLICATION SIGN
{"timesb", 0x022A0}, // SQUARED TIMES
{"timesbar", 0x02A31}, // MULTIPLICATION SIGN WITH UNDERBAR
{"timesd", 0x02A30}, // MULTIPLICATION SIGN WITH DOT ABOVE
{"tint", 0x0222D}, // TRIPLE INTEGRAL
{"toea", 0x02928}, // NORTH EAST ARROW AND SOUTH EAST ARROW
{"top", 0x022A4}, // DOWN TACK
{"topbot", 0x02336}, // APL FUNCTIONAL SYMBOL I-BEAM
{"topcir", 0x02AF1}, // DOWN TACK WITH CIRCLE BELOW
{"Topf", 0x1D54B}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL T
{"topf", 0x1D565}, // MATHEMATICAL DOUBLE-STRUCK SMALL T
{"topfork", 0x02ADA}, // PITCHFORK WITH TEE TOP
{"tosa", 0x02929}, // SOUTH EAST ARROW AND SOUTH WEST ARROW
{"tprime", 0x02034}, // TRIPLE PRIME
{"trade", 0x02122}, // TRADE MARK SIGN
{"TRADE", 0x02122}, // TRADE MARK SIGN
{"triangle", 0x025B5}, // WHITE UP-POINTING SMALL TRIANGLE
{"triangledown", 0x025BF}, // WHITE DOWN-POINTING SMALL TRIANGLE
{"triangleleft", 0x025C3}, // WHITE LEFT-POINTING SMALL TRIANGLE
{"trianglelefteq", 0x022B4}, // NORMAL SUBGROUP OF OR EQUAL TO
{"triangleq", 0x0225C}, // DELTA EQUAL TO
{"triangleright", 0x025B9}, // WHITE RIGHT-POINTING SMALL TRIANGLE
{"trianglerighteq", 0x022B5}, // CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
{"tridot", 0x025EC}, // WHITE UP-POINTING TRIANGLE WITH DOT
{"trie", 0x0225C}, // DELTA EQUAL TO
{"triminus", 0x02A3A}, // MINUS SIGN IN TRIANGLE
{"TripleDot", 0x020DB}, // COMBINING THREE DOTS ABOVE
{"triplus", 0x02A39}, // PLUS SIGN IN TRIANGLE
{"trisb", 0x029CD}, // TRIANGLE WITH SERIFS AT BOTTOM
{"tritime", 0x02A3B}, // MULTIPLICATION SIGN IN TRIANGLE
{"trpezium", 0x023E2}, // WHITE TRAPEZIUM
{"Tscr", 0x1D4AF}, // MATHEMATICAL SCRIPT CAPITAL T
{"tscr", 0x1D4C9}, // MATHEMATICAL SCRIPT SMALL T
{"TScy", 0x00426}, // CYRILLIC CAPITAL LETTER TSE
{"tscy", 0x00446}, // CYRILLIC SMALL LETTER TSE
{"TSHcy", 0x0040B}, // CYRILLIC CAPITAL LETTER TSHE
{"tshcy", 0x0045B}, // CYRILLIC SMALL LETTER TSHE
{"Tstrok", 0x00166}, // LATIN CAPITAL LETTER T WITH STROKE
{"tstrok", 0x00167}, // LATIN SMALL LETTER T WITH STROKE
{"twixt", 0x0226C}, // BETWEEN
{"twoheadleftarrow", 0x0219E}, // LEFTWARDS TWO HEADED ARROW
{"twoheadrightarrow", 0x021A0}, // RIGHTWARDS TWO HEADED ARROW
];
immutable NameId[] namesU =
[
{"Uacgr", 0x0038E}, // GREEK CAPITAL LETTER UPSILON WITH TONOS
{"uacgr", 0x003CD}, // GREEK SMALL LETTER UPSILON WITH TONOS
{"Uacute", 0x000DA}, // LATIN CAPITAL LETTER U WITH ACUTE
{"uacute", 0x000FA}, // LATIN SMALL LETTER U WITH ACUTE
{"uarr", 0x02191}, // UPWARDS ARROW
{"Uarr", 0x0219F}, // UPWARDS TWO HEADED ARROW
{"uArr", 0x021D1}, // UPWARDS DOUBLE ARROW
{"Uarrocir", 0x02949}, // UPWARDS TWO-HEADED ARROW FROM SMALL CIRCLE
{"Ubrcy", 0x0040E}, // CYRILLIC CAPITAL LETTER SHORT U
{"ubrcy", 0x0045E}, // CYRILLIC SMALL LETTER SHORT U
{"Ubreve", 0x0016C}, // LATIN CAPITAL LETTER U WITH BREVE
{"ubreve", 0x0016D}, // LATIN SMALL LETTER U WITH BREVE
{"Ucirc", 0x000DB}, // LATIN CAPITAL LETTER U WITH CIRCUMFLEX
{"ucirc", 0x000FB}, // LATIN SMALL LETTER U WITH CIRCUMFLEX
{"Ucy", 0x00423}, // CYRILLIC CAPITAL LETTER U
{"ucy", 0x00443}, // CYRILLIC SMALL LETTER U
{"udarr", 0x021C5}, // UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW
{"Udblac", 0x00170}, // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
{"udblac", 0x00171}, // LATIN SMALL LETTER U WITH DOUBLE ACUTE
{"udhar", 0x0296E}, // UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
{"udiagr", 0x003B0}, // GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
{"Udigr", 0x003AB}, // GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
{"udigr", 0x003CB}, // GREEK SMALL LETTER UPSILON WITH DIALYTIKA
{"ufisht", 0x0297E}, // UP FISH TAIL
{"Ufr", 0x1D518}, // MATHEMATICAL FRAKTUR CAPITAL U
{"ufr", 0x1D532}, // MATHEMATICAL FRAKTUR SMALL U
{"Ugr", 0x003A5}, // GREEK CAPITAL LETTER UPSILON
{"ugr", 0x003C5}, // GREEK SMALL LETTER UPSILON
{"Ugrave", 0x000D9}, // LATIN CAPITAL LETTER U WITH GRAVE
{"ugrave", 0x000F9}, // LATIN SMALL LETTER U WITH GRAVE
{"uHar", 0x02963}, // UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
{"uharl", 0x021BF}, // UPWARDS HARPOON WITH BARB LEFTWARDS
{"uharr", 0x021BE}, // UPWARDS HARPOON WITH BARB RIGHTWARDS
{"uhblk", 0x02580}, // UPPER HALF BLOCK
{"ulcorn", 0x0231C}, // TOP LEFT CORNER
{"ulcorner", 0x0231C}, // TOP LEFT CORNER
{"ulcrop", 0x0230F}, // TOP LEFT CROP
{"ultri", 0x025F8}, // UPPER LEFT TRIANGLE
{"Umacr", 0x0016A}, // LATIN CAPITAL LETTER U WITH MACRON
{"umacr", 0x0016B}, // LATIN SMALL LETTER U WITH MACRON
{"uml", 0x000A8}, // DIAERESIS
{"UnderBar", 0x0005F}, // LOW LINE
{"UnderBrace", 0x023DF}, // BOTTOM CURLY BRACKET
{"UnderBracket", 0x023B5}, // BOTTOM SQUARE BRACKET
{"UnderParenthesis", 0x023DD}, // BOTTOM PARENTHESIS
{"Union", 0x022C3}, // N-ARY UNION
{"UnionPlus", 0x0228E}, // MULTISET UNION
{"Uogon", 0x00172}, // LATIN CAPITAL LETTER U WITH OGONEK
{"uogon", 0x00173}, // LATIN SMALL LETTER U WITH OGONEK
{"Uopf", 0x1D54C}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL U
{"uopf", 0x1D566}, // MATHEMATICAL DOUBLE-STRUCK SMALL U
{"uparrow", 0x02191}, // UPWARDS ARROW
{"UpArrow", 0x02191}, // UPWARDS ARROW
{"Uparrow", 0x021D1}, // UPWARDS DOUBLE ARROW
{"UpArrowBar", 0x02912}, // UPWARDS ARROW TO BAR
{"UpArrowDownArrow", 0x021C5}, // UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW
{"updownarrow", 0x02195}, // UP DOWN ARROW
{"UpDownArrow", 0x02195}, // UP DOWN ARROW
{"Updownarrow", 0x021D5}, // UP DOWN DOUBLE ARROW
{"UpEquilibrium", 0x0296E}, // UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
{"upharpoonleft", 0x021BF}, // UPWARDS HARPOON WITH BARB LEFTWARDS
{"upharpoonright", 0x021BE}, // UPWARDS HARPOON WITH BARB RIGHTWARDS
{"uplus", 0x0228E}, // MULTISET UNION
{"UpperLeftArrow", 0x02196}, // NORTH WEST ARROW
{"UpperRightArrow", 0x02197}, // NORTH EAST ARROW
{"upsi", 0x003C5}, // GREEK SMALL LETTER UPSILON
{"Upsi", 0x003D2}, // GREEK UPSILON WITH HOOK SYMBOL
{"upsih", 0x003D2}, // GREEK UPSILON WITH HOOK SYMBOL
{"Upsilon", 0x003A5}, // GREEK CAPITAL LETTER UPSILON
{"upsilon", 0x003C5}, // GREEK SMALL LETTER UPSILON
{"UpTee", 0x022A5}, // UP TACK
{"UpTeeArrow", 0x021A5}, // UPWARDS ARROW FROM BAR
{"upuparrows", 0x021C8}, // UPWARDS PAIRED ARROWS
{"urcorn", 0x0231D}, // TOP RIGHT CORNER
{"urcorner", 0x0231D}, // TOP RIGHT CORNER
{"urcrop", 0x0230E}, // TOP RIGHT CROP
{"Uring", 0x0016E}, // LATIN CAPITAL LETTER U WITH RING ABOVE
{"uring", 0x0016F}, // LATIN SMALL LETTER U WITH RING ABOVE
{"urtri", 0x025F9}, // UPPER RIGHT TRIANGLE
{"Uscr", 0x1D4B0}, // MATHEMATICAL SCRIPT CAPITAL U
{"uscr", 0x1D4CA}, // MATHEMATICAL SCRIPT SMALL U
{"utdot", 0x022F0}, // UP RIGHT DIAGONAL ELLIPSIS
{"Utilde", 0x00168}, // LATIN CAPITAL LETTER U WITH TILDE
{"utilde", 0x00169}, // LATIN SMALL LETTER U WITH TILDE
{"utri", 0x025B5}, // WHITE UP-POINTING SMALL TRIANGLE
{"utrif", 0x025B4}, // BLACK UP-POINTING SMALL TRIANGLE
{"uuarr", 0x021C8}, // UPWARDS PAIRED ARROWS
{"Uuml", 0x000DC}, // LATIN CAPITAL LETTER U WITH DIAERESIS
{"uuml", 0x000FC}, // LATIN SMALL LETTER U WITH DIAERESIS
{"uwangle", 0x029A7}, // OBLIQUE ANGLE OPENING DOWN
];
immutable NameId[] namesV =
[
{"vangrt", 0x0299C}, // RIGHT ANGLE VARIANT WITH SQUARE
{"varepsilon", 0x003F5}, // GREEK LUNATE EPSILON SYMBOL
{"varkappa", 0x003F0}, // GREEK KAPPA SYMBOL
{"varnothing", 0x02205}, // EMPTY SET
{"varphi", 0x003D5}, // GREEK PHI SYMBOL
{"varpi", 0x003D6}, // GREEK PI SYMBOL
{"varpropto", 0x0221D}, // PROPORTIONAL TO
{"varr", 0x02195}, // UP DOWN ARROW
{"vArr", 0x021D5}, // UP DOWN DOUBLE ARROW
{"varrho", 0x003F1}, // GREEK RHO SYMBOL
{"varsigma", 0x003C2}, // GREEK SMALL LETTER FINAL SIGMA
// "varsubsetneq", 0x0228A;0x0FE00}, // SUBSET OF WITH NOT EQUAL TO - variant with stroke through bottom members
// "varsubsetneqq", 0x02ACB;0x0FE00}, // SUBSET OF ABOVE NOT EQUAL TO - variant with stroke through bottom members
// "varsupsetneq", 0x0228B;0x0FE00}, // SUPERSET OF WITH NOT EQUAL TO - variant with stroke through bottom members
// "varsupsetneqq", 0x02ACC;0x0FE00}, // SUPERSET OF ABOVE NOT EQUAL TO - variant with stroke through bottom members
{"vartheta", 0x003D1}, // GREEK THETA SYMBOL
{"vartriangleleft", 0x022B2}, // NORMAL SUBGROUP OF
{"vartriangleright", 0x022B3}, // CONTAINS AS NORMAL SUBGROUP
{"vBar", 0x02AE8}, // SHORT UP TACK WITH UNDERBAR
{"Vbar", 0x02AEB}, // DOUBLE UP TACK
{"vBarv", 0x02AE9}, // SHORT UP TACK ABOVE SHORT DOWN TACK
{"Vcy", 0x00412}, // CYRILLIC CAPITAL LETTER VE
{"vcy", 0x00432}, // CYRILLIC SMALL LETTER VE
{"vdash", 0x022A2}, // RIGHT TACK
{"vDash", 0x022A8}, // TRUE
{"Vdash", 0x022A9}, // FORCES
{"VDash", 0x022AB}, // DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
{"Vdashl", 0x02AE6}, // LONG DASH FROM LEFT MEMBER OF DOUBLE VERTICAL
{"vee", 0x02228}, // LOGICAL OR
{"Vee", 0x022C1}, // N-ARY LOGICAL OR
{"veebar", 0x022BB}, // XOR
{"veeeq", 0x0225A}, // EQUIANGULAR TO
{"vellip", 0x022EE}, // VERTICAL ELLIPSIS
{"verbar", 0x0007C}, // VERTICAL LINE
{"Verbar", 0x02016}, // DOUBLE VERTICAL LINE
{"vert", 0x0007C}, // VERTICAL LINE
{"Vert", 0x02016}, // DOUBLE VERTICAL LINE
{"VerticalBar", 0x02223}, // DIVIDES
{"VerticalLine", 0x0007C}, // VERTICAL LINE
{"VerticalSeparator", 0x02758}, // LIGHT VERTICAL BAR
{"VerticalTilde", 0x02240}, // WREATH PRODUCT
{"VeryThinSpace", 0x0200A}, // HAIR SPACE
{"Vfr", 0x1D519}, // MATHEMATICAL FRAKTUR CAPITAL V
{"vfr", 0x1D533}, // MATHEMATICAL FRAKTUR SMALL V
{"vltri", 0x022B2}, // NORMAL SUBGROUP OF
// "vnsub", 0x02282;0x020D2}, // SUBSET OF with vertical line
// "vnsup", 0x02283;0x020D2}, // SUPERSET OF with vertical line
{"Vopf", 0x1D54D}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL V
{"vopf", 0x1D567}, // MATHEMATICAL DOUBLE-STRUCK SMALL V
{"vprop", 0x0221D}, // PROPORTIONAL TO
{"vrtri", 0x022B3}, // CONTAINS AS NORMAL SUBGROUP
{"Vscr", 0x1D4B1}, // MATHEMATICAL SCRIPT CAPITAL V
{"vscr", 0x1D4CB}, // MATHEMATICAL SCRIPT SMALL V
// "vsubne", 0x0228A;0x0FE00}, // SUBSET OF WITH NOT EQUAL TO - variant with stroke through bottom members
// "vsubnE", 0x02ACB;0x0FE00}, // SUBSET OF ABOVE NOT EQUAL TO - variant with stroke through bottom members
// "vsupne", 0x0228B;0x0FE00}, // SUPERSET OF WITH NOT EQUAL TO - variant with stroke through bottom members
// "vsupnE", 0x02ACC;0x0FE00}, // SUPERSET OF ABOVE NOT EQUAL TO - variant with stroke through bottom members
{"Vvdash", 0x022AA}, // TRIPLE VERTICAL BAR RIGHT TURNSTILE
{"vzigzag", 0x0299A}, // VERTICAL ZIGZAG LINE
];
immutable NameId[] namesW =
[
{"Wcirc", 0x00174}, // LATIN CAPITAL LETTER W WITH CIRCUMFLEX
{"wcirc", 0x00175}, // LATIN SMALL LETTER W WITH CIRCUMFLEX
{"wedbar", 0x02A5F}, // LOGICAL AND WITH UNDERBAR
{"wedge", 0x02227}, // LOGICAL AND
{"Wedge", 0x022C0}, // N-ARY LOGICAL AND
{"wedgeq", 0x02259}, // ESTIMATES
{"weierp", 0x02118}, // SCRIPT CAPITAL P
{"Wfr", 0x1D51A}, // MATHEMATICAL FRAKTUR CAPITAL W
{"wfr", 0x1D534}, // MATHEMATICAL FRAKTUR SMALL W
{"Wopf", 0x1D54E}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL W
{"wopf", 0x1D568}, // MATHEMATICAL DOUBLE-STRUCK SMALL W
{"wp", 0x02118}, // SCRIPT CAPITAL P
{"wr", 0x02240}, // WREATH PRODUCT
{"wreath", 0x02240}, // WREATH PRODUCT
{"Wscr", 0x1D4B2}, // MATHEMATICAL SCRIPT CAPITAL W
{"wscr", 0x1D4CC}, // MATHEMATICAL SCRIPT SMALL W
];
immutable NameId[] namesX =
[
{"xcap", 0x022C2}, // N-ARY INTERSECTION
{"xcirc", 0x025EF}, // LARGE CIRCLE
{"xcup", 0x022C3}, // N-ARY UNION
{"xdtri", 0x025BD}, // WHITE DOWN-POINTING TRIANGLE
{"Xfr", 0x1D51B}, // MATHEMATICAL FRAKTUR CAPITAL X
{"xfr", 0x1D535}, // MATHEMATICAL FRAKTUR SMALL X
{"Xgr", 0x0039E}, // GREEK CAPITAL LETTER XI
{"xgr", 0x003BE}, // GREEK SMALL LETTER XI
{"xharr", 0x027F7}, // LONG LEFT RIGHT ARROW
{"xhArr", 0x027FA}, // LONG LEFT RIGHT DOUBLE ARROW
{"Xi", 0x0039E}, // GREEK CAPITAL LETTER XI
{"xi", 0x003BE}, // GREEK SMALL LETTER XI
{"xlarr", 0x027F5}, // LONG LEFTWARDS ARROW
{"xlArr", 0x027F8}, // LONG LEFTWARDS DOUBLE ARROW
{"xmap", 0x027FC}, // LONG RIGHTWARDS ARROW FROM BAR
{"xnis", 0x022FB}, // CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
{"xodot", 0x02A00}, // N-ARY CIRCLED DOT OPERATOR
{"Xopf", 0x1D54F}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL X
{"xopf", 0x1D569}, // MATHEMATICAL DOUBLE-STRUCK SMALL X
{"xoplus", 0x02A01}, // N-ARY CIRCLED PLUS OPERATOR
{"xotime", 0x02A02}, // N-ARY CIRCLED TIMES OPERATOR
{"xrarr", 0x027F6}, // LONG RIGHTWARDS ARROW
{"xrArr", 0x027F9}, // LONG RIGHTWARDS DOUBLE ARROW
{"Xscr", 0x1D4B3}, // MATHEMATICAL SCRIPT CAPITAL X
{"xscr", 0x1D4CD}, // MATHEMATICAL SCRIPT SMALL X
{"xsqcup", 0x02A06}, // N-ARY SQUARE UNION OPERATOR
{"xuplus", 0x02A04}, // N-ARY UNION OPERATOR WITH PLUS
{"xutri", 0x025B3}, // WHITE UP-POINTING TRIANGLE
{"xvee", 0x022C1}, // N-ARY LOGICAL OR
{"xwedge", 0x022C0}, // N-ARY LOGICAL AND
];
immutable NameId[] namesY =
[
{"Yacute", 0x000DD}, // LATIN CAPITAL LETTER Y WITH ACUTE
{"yacute", 0x000FD}, // LATIN SMALL LETTER Y WITH ACUTE
{"YAcy", 0x0042F}, // CYRILLIC CAPITAL LETTER YA
{"yacy", 0x0044F}, // CYRILLIC SMALL LETTER YA
{"Ycirc", 0x00176}, // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
{"ycirc", 0x00177}, // LATIN SMALL LETTER Y WITH CIRCUMFLEX
{"Ycy", 0x0042B}, // CYRILLIC CAPITAL LETTER YERU
{"ycy", 0x0044B}, // CYRILLIC SMALL LETTER YERU
{"yen", 0x000A5}, // YEN SIGN
{"Yfr", 0x1D51C}, // MATHEMATICAL FRAKTUR CAPITAL Y
{"yfr", 0x1D536}, // MATHEMATICAL FRAKTUR SMALL Y
{"YIcy", 0x00407}, // CYRILLIC CAPITAL LETTER YI
{"yicy", 0x00457}, // CYRILLIC SMALL LETTER YI
{"Yopf", 0x1D550}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
{"yopf", 0x1D56A}, // MATHEMATICAL DOUBLE-STRUCK SMALL Y
{"Yscr", 0x1D4B4}, // MATHEMATICAL SCRIPT CAPITAL Y
{"yscr", 0x1D4CE}, // MATHEMATICAL SCRIPT SMALL Y
{"YUcy", 0x0042E}, // CYRILLIC CAPITAL LETTER YU
{"yucy", 0x0044E}, // CYRILLIC SMALL LETTER YU
{"yuml", 0x000FF}, // LATIN SMALL LETTER Y WITH DIAERESIS
{"Yuml", 0x00178}, // LATIN CAPITAL LETTER Y WITH DIAERESIS
];
immutable NameId[] namesZ =
[
{"Zacute", 0x00179}, // LATIN CAPITAL LETTER Z WITH ACUTE
{"zacute", 0x0017A}, // LATIN SMALL LETTER Z WITH ACUTE
{"Zcaron", 0x0017D}, // LATIN CAPITAL LETTER Z WITH CARON
{"zcaron", 0x0017E}, // LATIN SMALL LETTER Z WITH CARON
{"Zcy", 0x00417}, // CYRILLIC CAPITAL LETTER ZE
{"zcy", 0x00437}, // CYRILLIC SMALL LETTER ZE
{"Zdot", 0x0017B}, // LATIN CAPITAL LETTER Z WITH DOT ABOVE
{"zdot", 0x0017C}, // LATIN SMALL LETTER Z WITH DOT ABOVE
{"zeetrf", 0x02128}, // BLACK-LETTER CAPITAL Z
{"ZeroWidthSpace", 0x0200B}, // ZERO WIDTH SPACE
{"Zeta", 0x00396}, // GREEK CAPITAL LETTER ZETA
{"zeta", 0x003B6}, // GREEK SMALL LETTER ZETA
{"Zfr", 0x02128}, // BLACK-LETTER CAPITAL Z
{"zfr", 0x1D537}, // MATHEMATICAL FRAKTUR SMALL Z
{"Zgr", 0x00396}, // GREEK CAPITAL LETTER ZETA
{"zgr", 0x003B6}, // GREEK SMALL LETTER ZETA
{"ZHcy", 0x00416}, // CYRILLIC CAPITAL LETTER ZHE
{"zhcy", 0x00436}, // CYRILLIC SMALL LETTER ZHE
{"zigrarr", 0x021DD}, // RIGHTWARDS SQUIGGLE ARROW
{"Zopf", 0x02124}, // DOUBLE-STRUCK CAPITAL Z
{"zopf", 0x1D56B}, // MATHEMATICAL DOUBLE-STRUCK SMALL Z
{"Zscr", 0x1D4B5}, // MATHEMATICAL SCRIPT CAPITAL Z
{"zscr", 0x1D4CF}, // MATHEMATICAL SCRIPT SMALL Z
{"zwj", 0x0200D}, // ZERO WIDTH JOINER
{"zwnj", 0x0200C}, // ZERO WIDTH NON-JOINER
];
// @todo@ order namesTable and names? by frequency
immutable NameId[][] namesTable =
[
namesA, namesB, namesC, namesD, namesE, namesF, namesG, namesH, namesI,
namesJ, namesK, namesL, namesM, namesN, namesO, namesP, namesQ, namesR,
namesS, namesT, namesU, namesV, namesW, namesX, namesY, namesZ
];
extern(C++) int HtmlNamedEntity(const(char)* p, size_t length)
{
int tableIndex = tolower(*p) - 'a';
if (tableIndex >= 0 && tableIndex < 26)
{
foreach(entity; namesTable[tableIndex])
{
if (entity.name == p[0..length])
return entity.value;
}
}
return -1;
}
|
D
|
/Users/wox/Desktop/ios11/Weapons/DerivedData/Weapons/Build/Intermediates.noindex/SwiftMigration/Weapons/Intermediates.noindex/Weapons.build/Debug-iphonesimulator/Weapons.build/Objects-normal/x86_64/NaviExt.o : /Users/wox/Desktop/ios11/Weapons/Weapons/AppDelegate.swift /Users/wox/Desktop/ios11/Weapons/Weapons/CardCell.swift /Users/wox/Desktop/ios11/Weapons/Weapons/DetailCell.swift /Users/wox/Desktop/ios11/Weapons/Weapons/pickerViewFill.swift /Users/wox/Desktop/ios11/Weapons/Weapons/Weapon.swift /Users/wox/Desktop/ios11/Weapons/Weapons/RateController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/DetailController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/NewWeaponController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/WeaponsTableViewController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/UIViewHelper.swift /Users/wox/Desktop/ios11/Weapons/Weapons/MediaSelect.swift /Users/wox/Desktop/ios11/Weapons/Weapons/NaviExt.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/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/AVFoundation.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/CoreAudio.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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/wox/Desktop/ios11/Weapons/DerivedData/Weapons/Build/Intermediates.noindex/SwiftMigration/Weapons/Intermediates.noindex/Weapons.build/Debug-iphonesimulator/Weapons.build/Objects-normal/x86_64/NaviExt~partial.swiftmodule : /Users/wox/Desktop/ios11/Weapons/Weapons/AppDelegate.swift /Users/wox/Desktop/ios11/Weapons/Weapons/CardCell.swift /Users/wox/Desktop/ios11/Weapons/Weapons/DetailCell.swift /Users/wox/Desktop/ios11/Weapons/Weapons/pickerViewFill.swift /Users/wox/Desktop/ios11/Weapons/Weapons/Weapon.swift /Users/wox/Desktop/ios11/Weapons/Weapons/RateController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/DetailController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/NewWeaponController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/WeaponsTableViewController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/UIViewHelper.swift /Users/wox/Desktop/ios11/Weapons/Weapons/MediaSelect.swift /Users/wox/Desktop/ios11/Weapons/Weapons/NaviExt.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/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/AVFoundation.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/CoreAudio.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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/wox/Desktop/ios11/Weapons/DerivedData/Weapons/Build/Intermediates.noindex/SwiftMigration/Weapons/Intermediates.noindex/Weapons.build/Debug-iphonesimulator/Weapons.build/Objects-normal/x86_64/NaviExt~partial.swiftdoc : /Users/wox/Desktop/ios11/Weapons/Weapons/AppDelegate.swift /Users/wox/Desktop/ios11/Weapons/Weapons/CardCell.swift /Users/wox/Desktop/ios11/Weapons/Weapons/DetailCell.swift /Users/wox/Desktop/ios11/Weapons/Weapons/pickerViewFill.swift /Users/wox/Desktop/ios11/Weapons/Weapons/Weapon.swift /Users/wox/Desktop/ios11/Weapons/Weapons/RateController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/DetailController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/NewWeaponController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/WeaponsTableViewController.swift /Users/wox/Desktop/ios11/Weapons/Weapons/UIViewHelper.swift /Users/wox/Desktop/ios11/Weapons/Weapons/MediaSelect.swift /Users/wox/Desktop/ios11/Weapons/Weapons/NaviExt.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/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.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/AVFoundation.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/CoreAudio.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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/*
* hunt-amqp: AMQP library for D programming language, based on hunt-net.
*
* Copyright (C) 2018-2019 HuntLabs
*
* Website: https://www.huntlabs.net
*
* Licensed under the Apache-2.0 License.
*
*/
module hunt.amqp.impl.ProtonConnectionImpl;
import hunt.Exceptions;
import hunt.amqp.ProtonConnection;
import hunt.amqp.ProtonHelper;
import hunt.amqp.ProtonLinkOptions;
import hunt.amqp.ProtonReceiver;
import hunt.amqp.ProtonSender;
import hunt.amqp.ProtonSession;
import hunt.amqp.ProtonTransportOptions;
import hunt.amqp.sasl.ProtonSaslAuthenticator;
import hunt.logging;
import hunt.proton.Proton;
import hunt.proton.amqp.Symbol;
import hunt.proton.amqp.transport.ErrorCondition;
import hunt.proton.engine.Connection;
import hunt.proton.engine.EndpointState;
import hunt.proton.engine.Link;
import hunt.proton.engine.Receiver;
import hunt.proton.engine.Record;
import hunt.proton.engine.Sender;
import hunt.proton.engine.Session;
import hunt.amqp.impl.ProtonSenderImpl;
import hunt.amqp.impl.ProtonReceiverImpl;
import hunt.collection.ArrayList;
import hunt.collection.LinkedHashMap;
import hunt.collection.List;
import hunt.collection.Map;
import hunt.net.NetClient;
import hunt.amqp.impl.ProtonTransport;
import hunt.amqp.Handler;
import std.concurrency : initOnce;
import std.uuid;
import std.random;
import hunt.amqp.impl.ProtonMetaDataSupportImpl;
import hunt.amqp.impl.ProtonSessionImpl;
import hunt.net.Connection;
import hunt.amqp.impl.ProtonSaslClientAuthenticatorImpl;
import hunt.Object;
import hunt.String;
/**
* @author <a href="http://tfox.org">Tim Fox</a>
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
class ProtonConnectionImpl : ProtonConnection {
// static Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY");
static Symbol ANONYMOUS_RELAY() {
__gshared Symbol inst;
return initOnce!inst(Symbol.valueOf("ANONYMOUS-RELAY"));
}
private hunt.proton.engine.Connection.Connection connection; //= Proton.connection();
private ProtonTransport transport;
private Handler!(Void)[] endHandlers;
private Handler!ProtonConnection _openHandler; //= (result) -> {
// LOG.trace("Connection open completed");
//};
private AsyncResultHandler!ProtonConnection _closeHandler;
private AmqpEventHandler!ProtonConnection _disconnectHandler;
//
private AmqpEventHandler!ProtonSession _sessionOpenHandler;
private Handler!ProtonSender _senderOpenHandler; //= (sender) -> {
// sender.setCondition(new ErrorCondition(Symbol.getSymbol("Not Supported"), ""));
//};
private Handler!ProtonReceiver _receiverOpenHandler; //= (receiver) -> {
// receiver.setCondition(new ErrorCondition(Symbol.getSymbol("Not Supported"), ""));
//};
private bool anonymousRelaySupported;
private ProtonSession defaultSession;
private hunt.net.Connection.Connection _conn;
this(string hostname, hunt.net.Connection.Connection conn) {
_closeHandler = (result) {
if (result.succeeded()) {
trace("Connection closed");
} else {
warning("Connection closed with error", result.cause());
}
};
_disconnectHandler = (connection) {
trace("Connection disconnected");
};
_sessionOpenHandler = (session) {
session.setCondition(new ErrorCondition(Symbol.getSymbol("Not Supported"), new String("")));
};
this.connection = Proton.connection();
this.connection.setContext(this);
string tmp = "vert.x-";
tmp ~= randomUUID().toString();
this.connection.setContainer(tmp);
this.connection.setHostname(hostname);
this._conn = conn;
Map!(Symbol, Object) props = createInitialPropertiesMap();
connection.setProperties(props);
}
private Map!(Symbol, Object) createInitialPropertiesMap() {
Map!(Symbol, Object) props = new LinkedHashMap!(Symbol, Object)();
props.put(ProtonMetaDataSupportImpl.PRODUCT_KEY, new String("vertx-proton"));
props.put(ProtonMetaDataSupportImpl.VERSION_KEY, new String("version"));
return props;
}
/////////////////////////////////////////////////////////////////////////////
//
// Delegated state tracking
//
/////////////////////////////////////////////////////////////////////////////
ProtonConnectionImpl setProperties(Map!(Symbol, Object) properties) {
Map!(Symbol, Object) newProps = null;
if (properties !is null) {
newProps = createInitialPropertiesMap();
newProps.putAll(properties);
}
connection.setProperties(newProps);
return this;
}
ProtonConnectionImpl setOfferedCapabilities(Symbol[] capabilities) {
connection.setOfferedCapabilities(capabilities);
return this;
}
ProtonConnectionImpl setHostname(string hostname) {
connection.setHostname(hostname);
return this;
}
ProtonConnectionImpl setDesiredCapabilities(Symbol[] capabilities) {
connection.setDesiredCapabilities(capabilities);
return this;
}
ProtonConnectionImpl setContainer(string container) {
connection.setContainer(container);
return this;
}
ProtonConnectionImpl setCondition(ErrorCondition condition) {
connection.setCondition(condition);
return this;
}
ErrorCondition getCondition() {
return connection.getCondition();
}
string getContainer() {
return connection.getContainer();
}
string getHostname() {
return connection.getHostname();
}
EndpointState getLocalState() {
return connection.getLocalState();
}
ErrorCondition getRemoteCondition() {
return connection.getRemoteCondition();
}
string getRemoteContainer() {
return connection.getRemoteContainer();
}
Symbol[] getRemoteDesiredCapabilities() {
return connection.getRemoteDesiredCapabilities();
}
string getRemoteHostname() {
return connection.getRemoteHostname();
}
Symbol[] getRemoteOfferedCapabilities() {
return connection.getRemoteOfferedCapabilities();
}
Map!(Symbol, Object) getRemoteProperties() {
return connection.getRemoteProperties();
}
EndpointState getRemoteState() {
return connection.getRemoteState();
}
bool isAnonymousRelaySupported() {
return anonymousRelaySupported;
}
Record attachments() {
return connection.attachments();
}
/////////////////////////////////////////////////////////////////////////////
//
// Handle/Trigger connection level state changes
//
/////////////////////////////////////////////////////////////////////////////
ProtonConnection open() {
version (HUNT_AMQP_DEBUG)
logInfo("open-------");
connection.open();
flush();
return this;
}
ProtonConnection close() {
connection.close();
flush();
return this;
}
ProtonSessionImpl createSession() {
return new ProtonSessionImpl(connection.session());
}
private ProtonSession getDefaultSession() {
if (defaultSession is null) {
defaultSession = createSession();
//defaultSession.closeHandler(result -> {
// string msg = "The connections default session closed unexpectedly";
// if (!result.succeeded()) {
// msg += ": ";
// msg += ": " + string.valueOf(result.cause());
// }
// Future<ProtonConnection> failure = Future.failedFuture(msg);
// Handler<AsyncResult<ProtonConnection>> connCloseHandler = closeHandler;
// if (connCloseHandler !is null) {
// connCloseHandler.handle(failure);
// }
//});
//defaultSession.closeHandler ( new class Handler!ProtonSession {
// void handle(ProtonSession var1)
// {
// string msg = "The connections default session closed unexpectedly";
// if (closeHandler !is null) {
// closeHandler.handle();
// }
// }
// } );
defaultSession.open();
// Deliberately not flushing, the sender/receiver open
// call will do that (if it doesn't happen otherwise).
}
return defaultSession;
}
ProtonSender createSender(string address) {
return getDefaultSession().createSender((address));
}
ProtonSender createSender(string address, ProtonLinkOptions senderOptions) {
return getDefaultSession().createSender((address), senderOptions);
}
ProtonReceiver createReceiver(string address) {
return getDefaultSession().createReceiver((address));
}
ProtonReceiver createReceiver(string address, ProtonLinkOptions receiverOptions) {
return getDefaultSession().createReceiver((address), receiverOptions);
}
void flush() {
if (transport !is null) {
version (HUNT_AMQP_DEBUG)
logInfo("transport flush");
transport.flush();
}
}
void disconnect() {
if (transport !is null) {
transport.disconnect();
}
}
bool isDisconnected() {
return transport is null;
}
ProtonConnection openHandler(Handler!ProtonConnection openHandler) {
//implementationMissing(false);
this._openHandler = openHandler;
return this;
}
ProtonConnection closeHandler(AsyncResultHandler!ProtonConnection closeHandler) {
this._closeHandler = closeHandler;
return this;
}
ProtonConnection disconnectHandler(AmqpEventHandler!ProtonConnection disconnectHandler) {
this._disconnectHandler = disconnectHandler;
return this;
}
ProtonConnection sessionOpenHandler(AmqpEventHandler!ProtonSession remoteSessionOpenHandler) {
this._sessionOpenHandler = remoteSessionOpenHandler;
return this;
}
ProtonConnection senderOpenHandler(Handler!ProtonSender remoteSenderOpenHandler) {
//implementationMissing(false);
this._senderOpenHandler = remoteSenderOpenHandler;
return this;
}
ProtonConnection receiverOpenHandler(Handler!ProtonReceiver remoteReceiverOpenHandler) {
//implementationMissing(false);
this._receiverOpenHandler = remoteReceiverOpenHandler;
return this;
}
/////////////////////////////////////////////////////////////////////////////
//
// Implementation details hidden from api.
//
/////////////////////////////////////////////////////////////////////////////
private void processCapabilities() {
Symbol[] capabilities = getRemoteOfferedCapabilities();
anonymousRelaySupported = true;
if (capabilities.length != 0) {
List!Symbol list = new ArrayList!Symbol(capabilities);
if (list.contains(ANONYMOUS_RELAY)) {
anonymousRelaySupported = true;
}
}
}
void fireRemoteOpen() {
processCapabilities();
if (_openHandler !is null) {
_openHandler.handle(this);
}
}
void fireRemoteClose() {
version(HUNT_DEBUG) info("Remote closed");
if (_closeHandler !is null) {
_closeHandler(ProtonHelper.future!(ProtonConnection)(this, getRemoteCondition()));
}
}
void fireDisconnect() {
version(HUNT_DEBUG) info("Disconnecting...");
transport = null;
if (_disconnectHandler !is null) {
_disconnectHandler(this);
}
foreach(Handler!Void handler; endHandlers) {
handler.handle(null);
}
endHandlers = null;
}
void bindClient(NetClient client, ProtonSaslClientAuthenticatorImpl authenticator,
ProtonTransportOptions transportOptions) {
transport = new ProtonTransport(connection, client, _conn,
authenticator, transportOptions);
}
//void bindServer(NetSocket socket, ProtonSaslAuthenticator authenticator, ProtonTransportOptions transportOptions) {
// transport = new ProtonTransport(connection, vertx, null, socket, authenticator, transportOptions);
//}
void fireRemoteSessionOpen(hunt.proton.engine.Session.Session session) {
implementationMissing(false);
//if (sessionOpenHandler !is null) {
// sessionOpenHandler.handle(new ProtonSessionImpl(session));
//}
}
void fireRemoteLinkOpen(Link link) {
if (cast(Sender) link !is null) {
if (_senderOpenHandler !is null) {
_senderOpenHandler.handle(new ProtonSenderImpl(cast(Sender) link));
}
} else {
if (_receiverOpenHandler !is null) {
_receiverOpenHandler.handle(new ProtonReceiverImpl(cast(Receiver) link));
}
}
}
void addEndHandler(Handler!Void handler) {
endHandlers ~= handler;
}
hunt.net.Connection.Connection getContext() {
return _conn;
}
}
|
D
|
module android.java.android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest;
public import android.java.android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!WifiP2pUpnpServiceRequest;
import import1 = android.java.android.net.wifi.p2p.nsd.WifiP2pServiceRequest;
import import3 = android.java.java.lang.Class;
import import0 = android.java.android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest;
|
D
|
/*
* This file is part of gtkD.
*
* gtkD 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.
*
* gtkD 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 gtkD; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
/*
* Conversion parameters:
* inFile = GFileIOStream.html
* outPack = gio
* outFile = FileIOStream
* strct = GFileIOStream
* realStrct=
* ctorStrct=
* clss = FileIOStream
* interf =
* class Code: Yes
* interface Code: No
* template for:
* extend =
* implements:
* - SeekableIF
* prefixes:
* - g_file_io_stream_
* omit structs:
* omit prefixes:
* omit code:
* omit signals:
* imports:
* - gtkD.glib.Str
* - gtkD.glib.ErrorG
* - gtkD.glib.GException
* - gtkD.gio.AsyncResultIF
* - gtkD.gio.Cancellable
* - gtkD.gio.FileInfo
* - gtkD.gio.SeekableT
* - gtkD.gio.SeekableIF
* structWrap:
* - GAsyncResult* -> AsyncResultIF
* - GCancellable* -> Cancellable
* - GFileInfo* -> FileInfo
* module aliases:
* local aliases:
* overrides:
*/
module gtkD.gio.FileIOStream;
public import gtkD.gtkc.giotypes;
private import gtkD.gtkc.gio;
private import gtkD.glib.ConstructionException;
private import gtkD.glib.Str;
private import gtkD.glib.ErrorG;
private import gtkD.glib.GException;
private import gtkD.gio.AsyncResultIF;
private import gtkD.gio.Cancellable;
private import gtkD.gio.FileInfo;
private import gtkD.gio.SeekableT;
private import gtkD.gio.SeekableIF;
private import gtkD.gio.IOStream;
/**
* Description
* GFileIOStream provides io streams that both read and write to the same
* file handle.
* GFileIOStream implements GSeekable, which allows the io
* stream to jump to arbitrary positions in the file and to truncate
* the file, provided the filesystem of the file supports these
* operations.
* To find the position of a file io stream, use
* g_seekable_tell().
* To find out if a file io stream supports seeking, use g_seekable_can_seek().
* To position a file io stream, use g_seekable_seek().
* To find out if a file io stream supports truncating, use
* g_seekable_can_truncate(). To truncate a file io
* stream, use g_seekable_truncate().
* The default implementation of all the GFileIOStream operations
* and the implementation of GSeekable just call into the same operations
* on the output stream.
*/
public class FileIOStream : IOStream, SeekableIF
{
/** the main Gtk struct */
protected GFileIOStream* gFileIOStream;
public GFileIOStream* getFileIOStreamStruct()
{
return gFileIOStream;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gFileIOStream;
}
/**
* Sets our main struct and passes it to the parent class
*/
public this (GFileIOStream* gFileIOStream)
{
if(gFileIOStream is null)
{
this = null;
return;
}
//Check if there already is a D object for this gtk struct
void* ptr = getDObject(cast(GObject*)gFileIOStream);
if( ptr !is null )
{
this = cast(FileIOStream)ptr;
return;
}
super(cast(GIOStream*)gFileIOStream);
this.gFileIOStream = gFileIOStream;
}
// add the Seekable capabilities
mixin SeekableT!(GFileIOStream);
/**
*/
/**
* Gets the entity tag for the file when it has been written.
* This must be called after the stream has been written
* and closed, as the etag can change while writing.
* Since 2.22
* Returns: the entity tag for the stream.
*/
public string getEtag()
{
// char * g_file_io_stream_get_etag (GFileIOStream *stream);
return Str.toString(g_file_io_stream_get_etag(gFileIOStream));
}
/**
* Queries a file io stream for the given attributes.
* This function blocks while querying the stream. For the asynchronous
* version of this function, see g_file_io_stream_query_info_async().
* While the stream is blocked, the stream will set the pending flag
* internally, and any other operations on the stream will fail with
* G_IO_ERROR_PENDING.
* Can fail if the stream was already closed (with error being set to
* G_IO_ERROR_CLOSED), the stream has pending operations (with error being
* set to G_IO_ERROR_PENDING), or if querying info is not supported for
* the stream's interface (with error being set to G_IO_ERROR_NOT_SUPPORTED). I
* all cases of failure, NULL will be returned.
* If cancellable is not NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error G_IO_ERROR_CANCELLED will be set, and NULL will
* be returned.
* Since 2.22
* Params:
* attributes = a file attribute query string.
* cancellable = optional GCancellable object, NULL to ignore.
* Returns: a GFileInfo for the stream, or NULL on error.
* Throws: GException on failure.
*/
public FileInfo queryInfo(string attributes, Cancellable cancellable)
{
// GFileInfo * g_file_io_stream_query_info (GFileIOStream *stream, const char *attributes, GCancellable *cancellable, GError **error);
GError* err = null;
auto p = g_file_io_stream_query_info(gFileIOStream, Str.toStringz(attributes), (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return new FileInfo(cast(GFileInfo*) p);
}
/**
* Asynchronously queries the stream for a GFileInfo. When completed,
* callback will be called with a GAsyncResult which can be used to
* finish the operation with g_file_io_stream_query_info_finish().
* For the synchronous version of this function, see
* g_file_io_stream_query_info().
* Since 2.22
* Params:
* attributes = a file attribute query string.
* ioPriority = the I/O priority
* of the request.
* cancellable = optional GCancellable object, NULL to ignore.
* callback = callback to call when the request is satisfied
* userData = the data to pass to callback function
*/
public void queryInfoAsync(string attributes, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
// void g_file_io_stream_query_info_async (GFileIOStream *stream, const char *attributes, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
g_file_io_stream_query_info_async(gFileIOStream, Str.toStringz(attributes), ioPriority, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finalizes the asynchronous query started
* by g_file_io_stream_query_info_async().
* Since 2.22
* Params:
* result = a GAsyncResult.
* Returns: A GFileInfo for the finished query.
* Throws: GException on failure.
*/
public FileInfo queryInfoFinish(AsyncResultIF result)
{
// GFileInfo * g_file_io_stream_query_info_finish (GFileIOStream *stream, GAsyncResult *result, GError **error);
GError* err = null;
auto p = g_file_io_stream_query_info_finish(gFileIOStream, (result is null) ? null : result.getAsyncResultTStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return new FileInfo(cast(GFileInfo*) p);
}
}
|
D
|
/Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sockets.build/TCP/TCPReadableSocket.swift.o : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address+C.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Pipe.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Buffer.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Error.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Descriptor.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Types.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Conversions.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/SocketOptions.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Select.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/FDSet.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Socket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/UDP/UDPSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPEstablishedSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPReadableSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPWriteableSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/InternetSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPInternetSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sockets.build/TCPReadableSocket~partial.swiftmodule : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address+C.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Pipe.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Buffer.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Error.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Descriptor.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Types.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Conversions.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/SocketOptions.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Select.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/FDSet.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Socket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/UDP/UDPSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPEstablishedSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPReadableSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPWriteableSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/InternetSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPInternetSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Sockets.build/TCPReadableSocket~partial.swiftdoc : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address+C.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Pipe.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Buffer.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Error.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Descriptor.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Types.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/Conversions.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/SocketOptions.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Address/Address.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Select.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Core/FDSet.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/Socket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/UDP/UDPSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPEstablishedSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPReadableSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPWriteableSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/Socket/InternetSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/sockets.git-972942978533733666/Sources/Sockets/TCP/TCPInternetSocket.swift /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.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
|
import vibe.d;
import std.string: format;
import std.traits: ReturnType;
import std.algorithm: countUntil;
import contentprovider;
/++
Main entry point for user visible content
+/
class WebInterface
{
private {
ContentProvider contentProvider_;
alias Toc = ReturnType!(ContentProvider.getTOC);
Toc[string] toc_;
alias DeltaSection = ReturnType!deltaSection;
alias LinkCache = Tuple!(DeltaSection, "previousSection",
DeltaSection, "nextSection");
LinkCache[string][string][string] sectionLinkCache_;
///< language, chapter and section indexing
string googleAnalyticsId_; ///< ID for google analytics
}
this(ContentProvider contentProvider,
string googleAnalyticsId)
{
this.contentProvider_ = contentProvider;
this.googleAnalyticsId_ = googleAnalyticsId;
// Fetch all table-of-contents for all supported
// languages (just 'en' for now) and generate
// the previous/next link cache for each tour page.
foreach(lang; contentProvider.getLanguages()) {
auto toc = toc_[lang] = contentProvider_.getTOC(lang);
foreach(ref chapter; toc) {
foreach(ref section; chapter.sections) {
sectionLinkCache_[lang][chapter.chapterId][section.sectionId] =
LinkCache(
previousSection(toc, lang, chapter.chapterId, section.sectionId),
nextSection(toc, lang, chapter.chapterId, section.sectionId));
}
}
}
}
private {
/++
Returns the information about the next or previous section (depending on
$(D move)) of the current position. Handles overflow to next or
previous chapter acccordingly. An empty string mean "dead-end".
Parameters:
$(D move) either +1 or -1.
$(D chapter) and $(D section) specify current positon.
Returns: struct witht the following information:
{
string link; // empty if none
string title;
}
+/
static auto deltaSection(ref Toc toc, string language, string chapter,
string section, int move) pure
{
alias R = Tuple!(string, "link", string, "title");
auto chapterIdx = toc.countUntil!"a.chapterId == b"(chapter);
if (chapterIdx == -1)
return R("", "");
auto sectionIdx = toc[chapterIdx].sections.countUntil!"a.sectionId == b"(section);
if (sectionIdx == -1)
return R("", "");
sectionIdx += move;
if (sectionIdx < 0) {
if (--chapterIdx >= 0)
sectionIdx = toc[chapterIdx].sections.length - 1;
else
return R("", "");
} else if (sectionIdx >= toc[chapterIdx].sections.length) {
if (++chapterIdx < toc.length)
sectionIdx = 0;
else
return R("", "");
}
auto sec = toc[chapterIdx].sections[sectionIdx];
return R("/tour/%s/%s/%s".format(
language,
toc[chapterIdx].chapterId,
sec.sectionId),
sec.title);
}
auto previousSection(ref Toc toc, string language, string chapter, string section) pure {
return deltaSection(toc, language, chapter, section, -1);
}
auto nextSection(ref Toc toc, string language, string chapter, string section) pure {
return deltaSection(toc, language, chapter, section, +1);
}
}
void index(HTTPServerRequest req, HTTPServerResponse res)
{
getStart(req, res, "en");
}
@path("/tour/:language")
void getStart(HTTPServerRequest req, HTTPServerResponse res, string _language)
{
auto startPoint = contentProvider_.getMeta(_language).start;
getTour(req, res, _language, startPoint.chapter, startPoint.section);
}
/+
Returns: tuple containing .tourData and .linkCache
for specified chapter and section.
+/
private auto getTourDataAndValidate(string language, string chapter, string section)
{
auto _tourData = contentProvider_.getContent(language, chapter, section);
if (_tourData.content == null) {
throw new HTTPStatusException(404,
"Couldn't find tour data for chapter '%s', section %s".format(chapter, section));
}
enforce(language in sectionLinkCache_, "Language not found");
auto _linkCache = §ionLinkCache_[language][chapter][section];
struct Ret {
typeof(_tourData) tourData;
typeof(_linkCache) linkCache;
}
return Ret(_tourData, _linkCache);
}
// for compatibility with old urls
// @@@@DEPRECATED_2016-12@@@ - will be removed in December 2016
@path("/tour/:chapter/:section")
void getTour(HTTPServerRequest req, HTTPServerResponse res, string _chapter, string _section)
{
res.redirect("/tour/en/" ~ _chapter ~ "/" ~ _section);
}
@path("/tour/:language/:chapter/:section")
void getTour(HTTPServerRequest req, HTTPServerResponse res, string _language, string _chapter, string _section)
{
// for compatibility with integer-based ids
// @@@@DEPRECATED_2016-12@@@ - will be removed in December 2016
import std.string : isNumeric;
if (_section.isNumeric)
{
auto nr = _section.to!int;
auto chapters = contentProvider_.getTOC(_language);
foreach (chapter; chapters)
{
if (chapter.chapterId == _chapter)
_section = chapter.sections[nr].sectionId;
}
}
auto language = _language;
auto sec = getTourDataAndValidate(_language, _chapter, _section);
auto htmlContent = sec.tourData.content.html;
auto chapterId = _chapter;
auto hasSourceCode = !sec.tourData.content.sourceCode.empty;
auto sourceCodeEnabled = sec.tourData.content.sourceCodeEnabled;
auto section = _section;
auto sectionId = sec.tourData.content._id;
auto sectionCount = sec.tourData.sectionCount;
auto toc = &toc_[_language];
auto previousSection = sec.linkCache.previousSection;
auto nextSection = sec.linkCache.nextSection;
auto googleAnalyticsId = googleAnalyticsId_;
auto title = sec.tourData.content.title ~ " - " ~ contentProvider_.getMeta(_language).title;
render!("tour.dt", htmlContent, language, section, sectionId,
sectionCount, chapterId, hasSourceCode, sourceCodeEnabled,
nextSection, previousSection, googleAnalyticsId,
toc, title)();
}
}
|
D
|
module vpe.raw;
public {
import vpe.raw.shader;
import vpe.raw.program;
import vpe.raw.polygon;
import vpe.raw.texture;
import vpe.raw.ttf;
import vpe.internal;
}
synchronized class SynQueue(T) {
void push(T val) shared {
buf[t] = cast(shared T) val;
t = (t + 1) % buf.length;
}
bool pop(ref T val) shared {
if (h == t) return false;
val = cast(T) buf[h];
h = (h + 1) % buf.length;
return true;
}
private:
size_t h = 0, t = 0;
T buf[10500];
}
void freeResources() {
freeShaders();
freePrograms();
freeTextures();
freePolygons();
freeTTFs();
}
|
D
|
instance DIA_Addon_Sancho_EXIT(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 999;
condition = DIA_Addon_Sancho_EXIT_Condition;
information = DIA_Addon_Sancho_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Addon_Sancho_EXIT_Condition()
{
return TRUE;
};
func void DIA_Addon_Sancho_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Addon_Sancho_PICKPOCKET(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 900;
condition = DIA_Addon_Sancho_PICKPOCKET_Condition;
information = DIA_Addon_Sancho_PICKPOCKET_Info;
permanent = TRUE;
description = Pickpocket_40;
};
func int DIA_Addon_Sancho_PICKPOCKET_Condition()
{
return C_Beklauen(50,40);
};
func void DIA_Addon_Sancho_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Addon_Sancho_PICKPOCKET);
Info_AddChoice(DIA_Addon_Sancho_PICKPOCKET,Dialog_Back,DIA_Addon_Sancho_PICKPOCKET_BACK);
Info_AddChoice(DIA_Addon_Sancho_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Addon_Sancho_PICKPOCKET_DoIt);
};
func void DIA_Addon_Sancho_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Addon_Sancho_PICKPOCKET);
};
func void DIA_Addon_Sancho_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Addon_Sancho_PICKPOCKET);
};
instance DIA_Addon_Sancho_HI(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 2;
condition = DIA_Addon_Sancho_HI_Condition;
information = DIA_Addon_Sancho_HI_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Addon_Sancho_HI_Condition()
{
return TRUE;
};
func void DIA_Addon_Sancho_HI_Info()
{
AI_Output(self,other,"DIA_Addon_Sancho_HI_06_00"); //Shit, another new boy. (laughs) Here for the gold, too, aren't you?
AI_Output(other,self,"DIA_Addon_Sancho_HI_15_01"); //Gold?
AI_Output(self,other,"DIA_Addon_Sancho_HI_06_02"); //(laughing) Quit trying to kid me!
AI_Output(self,other,"DIA_Addon_Sancho_HI_06_03"); //All the new boys who come here want into the mine.
AI_Output(self,other,"DIA_Addon_Sancho_HI_06_04"); //But don't think it's that easy!
if(SC_KnowsRavensGoldmine == FALSE)
{
B_LogEntry(TOPIC_Addon_RavenKDW,LogText_Addon_RavensGoldmine);
Log_AddEntry(TOPIC_Addon_Sklaven,LogText_Addon_RavensGoldmine);
B_LogEntry(TOPIC_Addon_ScoutBandits,Log_Text_Addon_ScoutBandits);
};
SC_KnowsRavensGoldmine = TRUE;
};
instance DIA_Addon_Sancho_Lager(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 2;
condition = DIA_Addon_Sancho_Lager_Condition;
information = DIA_Addon_Sancho_Lager_Info;
permanent = FALSE;
description = "How do I get to the camp?";
};
func int DIA_Addon_Sancho_Lager_Condition()
{
return TRUE;
};
func void DIA_Addon_Sancho_Lager_Info()
{
AI_Output(other,self,"DIA_Addon_Sancho_Lager_15_00"); //How do I get to the camp?
AI_Output(self,other,"DIA_Addon_Sancho_Lager_06_01"); //Just follow the boardwalk!
if(!Npc_IsDead(Franco))
{
AI_Output(self,other,"DIA_Addon_Sancho_Lager_06_02"); //But if you want to get into the mine, you'll have to get past Franco.
AI_Output(self,other,"DIA_Addon_Sancho_Lager_06_03"); //He expects all the new boys to slave away out here for a while first!
};
Log_CreateTopic(Topic_Addon_Franco,LOG_MISSION);
Log_SetTopicStatus(Topic_Addon_Franco,LOG_Running);
B_LogEntry(Topic_Addon_Franco,"All the new people have to work in the swamp before they gain access to the mine.");
};
instance DIA_Addon_Sancho_Mine(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 3;
condition = DIA_Addon_Sancho_Mine_Condition;
information = DIA_Addon_Sancho_Mine_Info;
permanent = FALSE;
description = "Tell me more about the mine...";
};
func int DIA_Addon_Sancho_Mine_Condition()
{
if(!Npc_IsDead(Franco))
{
return TRUE;
};
};
func void DIA_Addon_Sancho_Mine_Info()
{
AI_Output(other,self,"DIA_Addon_Sancho_Mine_15_00"); //Tell me more about the mine...
AI_Output(self,other,"DIA_Addon_Sancho_Mine_06_01"); //I'll give you some good advice: if you want to get in there, get in good with Franco. He's the boss out here.
AI_Output(self,other,"DIA_Addon_Sancho_Mine_06_02"); //He decides who's the next to go in.
AI_Output(self,other,"DIA_Addon_Sancho_Mine_06_03"); //But he'll only let you in if you don't goldbrick out here.
AI_Output(self,other,"DIA_Addon_Sancho_Mine_06_04"); //So go to him and let him give you a job!
B_LogEntry(Topic_Addon_Franco,"FRANCO decides who gets into the camp. He also hands out the assignments.");
};
instance DIA_Addon_Sancho_Franco(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 4;
condition = DIA_Addon_Sancho_Franco_Condition;
information = DIA_Addon_Sancho_Franco_Info;
permanent = FALSE;
description = "Where do I find this Franco?";
};
func int DIA_Addon_Sancho_Franco_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Sancho_Mine) && !Npc_IsDead(Franco))
{
return TRUE;
};
};
func void DIA_Addon_Sancho_Franco_Info()
{
AI_Output(other,self,"DIA_Addon_Sancho_Franco_15_00"); //Where do I find this Franco?
AI_Output(self,other,"DIA_Addon_Sancho_Franco_06_01"); //He mostly hangs out in the court in front of the camp.
AI_Output(self,other,"DIA_Addon_Sancho_Franco_06_02"); //Get in good with him or you'll wind up with a crappy job like me!
B_LogEntry(Topic_Addon_Franco,"Franco hangs out in the yard in front of the camp.");
};
instance DIA_Addon_Sancho_Spitzel(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 5;
condition = DIA_Addon_Sancho_Spitzel_Condition;
information = DIA_Addon_Sancho_Spitzel_Info;
permanent = FALSE;
description = "Do you have to hang around here all the time?";
};
func int DIA_Addon_Sancho_Spitzel_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Sancho_Franco) || Npc_IsDead(Franco))
{
return TRUE;
};
};
func void DIA_Addon_Sancho_Spitzel_Info()
{
AI_Output(other,self,"DIA_Addon_Sancho_Spitzel_15_00"); //Do you have to hang around here all the time?
AI_Output(self,other,"DIA_Addon_Sancho_Spitzel_06_01"); //I'm supposed to check out all the new boys, to make sure that none of them are spies.
AI_Output(self,other,"DIA_Addon_Sancho_Spitzel_06_02"); //But you can forget it. I mean, we're at the end of the world here - in the middle of a swamp.
AI_Output(self,other,"DIA_Addon_Sancho_Spitzel_06_03"); //No one can find us, no one will find us - and why should someone go to the trouble of sending us a spy?
};
instance DIA_Addon_Sancho_Perm(C_Info)
{
npc = BDT_1073_Addon_Sancho;
nr = 99;
condition = DIA_Addon_Sancho_Perm_Condition;
information = DIA_Addon_Sancho_Perm_Info;
permanent = TRUE;
description = "What's new?";
};
func int DIA_Addon_Sancho_Perm_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Sancho_Spitzel))
{
return TRUE;
};
};
var int Comment_Franco;
var int Comment_Esteban;
func void DIA_Addon_Sancho_Perm_Info()
{
AI_Output(other,self,"DIA_Addon_Sancho_Perm_15_00"); //What's new?
if(Npc_IsDead(Franco) && (Comment_Franco == FALSE))
{
AI_Output(self,other,"DIA_Addon_Sancho_Perm_06_01"); //I heard you killed Franco. Nice work...
if(!Npc_IsDead(Carlos))
{
AI_Output(self,other,"DIA_Addon_Sancho_Perm_06_02"); //... but now we've got that Carlos on our backs. He doesn't take any nonsense...
}
else
{
AI_Output(self,other,"DIA_Addon_Sancho_Perm_06_03"); //And you did in Carlos, too? Pal, you're a real nasty killer, aren't you? Just leave me alone.
};
Comment_Franco = TRUE;
}
else if(Npc_IsDead(Esteban) && (Comment_Esteban == FALSE))
{
AI_Output(self,other,"DIA_Addon_Sancho_Perm_06_04"); //I heard you killed Esteban. Hey, man, you're planning something, aren't you?
Comment_Esteban = TRUE;
}
else
{
AI_Output(self,other,"DIA_Addon_Sancho_Perm_06_05"); //Nah, there's nothing new right now.
};
};
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/ice14844.d(20): Error: template opDispatch(string name) has no members
---
*/
struct Typedef
{
template opDispatch(string name)
{
static if (true)
{
}
}
}
void runUnitTestsImpl()
{
auto x = [__traits(allMembers, Typedef.opDispatch)];
}
|
D
|
// This file is hand mangled of a ODE header file.
// See copyright in src/ode/ode.d (BSD).
module lib.ode.collision_trimesh;
import lib.ode.common;
enum { TRIMESH_FACE_NORMALS };
alias void* dTriMeshDataID;
extern(C) {
alias int dTriCallback(dGeomID TriMesh, dGeomID RefObject, int TriangleIndex);
alias void dTriArrayCallback(dGeomID TriMesh, dGeomID RefObject, int* TriIndices, int TriCount);
alias int dTriRayCallback(dGeomID TriMesh, dGeomID Ray, int TriangleIndex, dReal u, dReal v);
}
version(DynamicODE)
{
extern(C):
dTriMeshDataID function() dGeomTriMeshDataCreate;
void function(dTriMeshDataID g) dGeomTriMeshDataDestroy;
void function(dTriMeshDataID g, int data_id, void* in_data) dGeomTriMeshDataSet;
void* function(dTriMeshDataID g, int data_id) dGeomTriMeshDataGet;
void function( dGeomID g, dMatrix4 last_trans ) dGeomTriMeshSetLastTransform;
dReal* function( dGeomID g ) dGeomTriMeshGetLastTransform;
void function(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride) dGeomTriMeshDataBuildSingle;
void function(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride, void* Normals) dGeomTriMeshDataBuildSingle1;
void function(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride) dGeomTriMeshDataBuildDouble;
void function(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride, void* Normals) dGeomTriMeshDataBuildDouble1;
void function(dTriMeshDataID g, dReal* Vertices, int VertexCount, int* Indices, int IndexCount) dGeomTriMeshDataBuildSimple;
void function(dTriMeshDataID g, dReal* Vertices, int VertexCount, int* Indices, int IndexCount, int* Normals) dGeomTriMeshDataBuildSimple1;
void function(dTriMeshDataID g) dGeomTriMeshDataPreprocess;
void function(dTriMeshDataID g, ubyte** buf, int* bufLen) dGeomTriMeshDataGetBuffer;
void function(dTriMeshDataID g, ubyte* buf) dGeomTriMeshDataSetBuffer;
void function(dGeomID g, dTriCallback* Callback) dGeomTriMeshSetCallback;
dTriCallback* function(dGeomID g) dGeomTriMeshGetCallback;
void function(dGeomID g, dTriArrayCallback* ArrayCallback) dGeomTriMeshSetArrayCallback;
dTriArrayCallback* function(dGeomID g) dGeomTriMeshGetArrayCallback;
void function(dGeomID g, dTriRayCallback* Callback) dGeomTriMeshSetRayCallback;
dTriRayCallback* function(dGeomID g) dGeomTriMeshGetRayCallback;
dGeomID function(dSpaceID space, dTriMeshDataID Data, dTriCallback* Callback, dTriArrayCallback* ArrayCallback, dTriRayCallback* RayCallback) dCreateTriMesh;
void function(dGeomID g, dTriMeshDataID Data) dGeomTriMeshSetData;
dTriMeshDataID function(dGeomID g) dGeomTriMeshGetData;
void function(dGeomID g, int geomClass, int enable) dGeomTriMeshEnableTC;
int function(dGeomID g, int geomClass) dGeomTriMeshIsTCEnabled;
void function(dGeomID g) dGeomTriMeshClearTCCache;
dTriMeshDataID function(dGeomID g) dGeomTriMeshGetTriMeshDataID;
void function(dGeomID g, int Index, dVector3* v0, dVector3* v1, dVector3* v2) dGeomTriMeshGetTriangle;
void function(dGeomID g, int Index, dReal u, dReal v, dVector3 Out) dGeomTriMeshGetPoint;
int function(dGeomID g) dGeomTriMeshGetTriangleCount;
void function(dTriMeshDataID g) dGeomTriMeshDataUpdate;
}
else
{
extern(C):
dTriMeshDataID dGeomTriMeshDataCreate();
void dGeomTriMeshDataDestroy(dTriMeshDataID g);
void dGeomTriMeshDataSet(dTriMeshDataID g, int data_id, void* in_data);
void* dGeomTriMeshDataGet(dTriMeshDataID g, int data_id);
void dGeomTriMeshSetLastTransform( dGeomID g, dMatrix4 last_trans );
dReal* dGeomTriMeshGetLastTransform( dGeomID g );
void dGeomTriMeshDataBuildSingle(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride);
void dGeomTriMeshDataBuildSingle1(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride, void* Normals);
void dGeomTriMeshDataBuildDouble(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride);
void dGeomTriMeshDataBuildDouble1(dTriMeshDataID g, void* Vertices, int VertexStride, int VertexCount, void* Indices, int IndexCount, int TriStride, void* Normals);
void dGeomTriMeshDataBuildSimple(dTriMeshDataID g, dReal* Vertices, int VertexCount, int* Indices, int IndexCount);
void dGeomTriMeshDataBuildSimple1(dTriMeshDataID g, dReal* Vertices, int VertexCount, int* Indices, int IndexCount, int* Normals);
void dGeomTriMeshDataPreprocess(dTriMeshDataID g);
void dGeomTriMeshDataGetBuffer(dTriMeshDataID g, ubyte** buf, int* bufLen);
void dGeomTriMeshDataSetBuffer(dTriMeshDataID g, ubyte* buf);
void dGeomTriMeshSetCallback(dGeomID g, dTriCallback* Callback);
dTriCallback* dGeomTriMeshGetCallback(dGeomID g);
void dGeomTriMeshSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback);
dTriArrayCallback* dGeomTriMeshGetArrayCallback(dGeomID g);
void dGeomTriMeshSetRayCallback(dGeomID g, dTriRayCallback* Callback);
dTriRayCallback* dGeomTriMeshGetRayCallback(dGeomID g);
dGeomID dCreateTriMesh(dSpaceID space, dTriMeshDataID Data, dTriCallback* Callback, dTriArrayCallback* ArrayCallback, dTriRayCallback* RayCallback);
void dGeomTriMeshSetData(dGeomID g, dTriMeshDataID Data);
dTriMeshDataID dGeomTriMeshGetData(dGeomID g);
void dGeomTriMeshEnableTC(dGeomID g, int geomClass, int enable);
int dGeomTriMeshIsTCEnabled(dGeomID g, int geomClass);
void dGeomTriMeshClearTCCache(dGeomID g);
dTriMeshDataID dGeomTriMeshGetTriMeshDataID(dGeomID g);
void dGeomTriMeshGetTriangle(dGeomID g, int Index, dVector3* v0, dVector3* v1, dVector3* v2);
void dGeomTriMeshGetPoint(dGeomID g, int Index, dReal u, dReal v, dVector3 Out);
int dGeomTriMeshGetTriangleCount(dGeomID g);
void dGeomTriMeshDataUpdate(dTriMeshDataID g);
}
|
D
|
// Written in the D programming language.
/**
This module defines the notion of a range. Ranges generalize the concept of
arrays, lists, or anything that involves sequential access. This abstraction
enables the same set of algorithms (see $(LINK2 std_algorithm.html,
std.algorithm)) to be used with a vast variety of different concrete types. For
example, a linear search algorithm such as $(LINK2 std_algorithm.html#find,
std.algorithm.find) works not just for arrays, but for linked-lists, input
files, incoming network data, etc.
For more detailed information about the conceptual aspect of ranges and the
motivation behind them, see Andrei Alexandrescu's article
$(LINK2 http://www.informit.com/articles/printerfriendly.aspx?p=1407357&rll=1,
$(I On Iteration)).
This module defines several templates for testing whether a given object is a
_range, and what kind of _range it is:
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF isInputRange)))
$(TD Tests if something is an $(I input _range), defined to be something from
which one can sequentially read data using the primitives $(D front), $(D
popFront), and $(D empty).
))
$(TR $(TD $(D $(LREF isOutputRange)))
$(TD Tests if something is an $(I output _range), defined to be something to
which one can sequentially write data using the $(D $(LREF put)) primitive.
))
$(TR $(TD $(D $(LREF isForwardRange)))
$(TD Tests if something is a $(I forward _range), defined to be an input _range
with the additional capability that one can save one's current position with
the $(D save) primitive, thus allowing one to iterate over the same _range
multiple times.
))
$(TR $(TD $(D $(LREF isBidirectionalRange)))
$(TD Tests if something is a $(I bidirectional _range), that is, a forward
_range that allows reverse traversal using the primitives $(D back) and $(D
popBack).
))
$(TR $(TD $(D $(LREF isRandomAccessRange)))
$(TD Tests if something is a $(I random access _range), which is a
bidirectional _range that also supports the array subscripting operation via
the primitive $(D opIndex).
))
)
A number of templates are provided that test for various _range capabilities:
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF hasMobileElements)))
$(TD Tests if a given _range's elements can be moved around using the
primitives $(D moveFront), $(D moveBack), or $(D moveAt).
))
$(TR $(TD $(D $(LREF ElementType)))
$(TD Returns the element type of a given _range.
))
$(TR $(TD $(D $(LREF ElementEncodingType)))
$(TD Returns the encoding element type of a given _range.
))
$(TR $(TD $(D $(LREF hasSwappableElements)))
$(TD Tests if a _range is a forward _range with swappable elements.
))
$(TR $(TD $(D $(LREF hasAssignableElements)))
$(TD Tests if a _range is a forward _range with mutable elements.
))
$(TR $(TD $(D $(LREF hasLvalueElements)))
$(TD Tests if a _range is a forward _range with elements that can be passed by
reference and have their address taken.
))
$(TR $(TD $(D $(LREF hasLength)))
$(TD Tests if a given _range has the $(D length) attribute.
))
$(TR $(TD $(D $(LREF isInfinite)))
$(TD Tests if a given _range is an $(I infinite _range).
))
$(TR $(TD $(D $(LREF hasSlicing)))
$(TD Tests if a given _range supports the array slicing operation $(D R[x..y]).
))
$(TR $(TD $(D $(LREF walkLength)))
$(TD Computes the length of any _range in O(n) time.
))
)
A rich set of _range creation and composition templates are provided that let
you construct new ranges out of existing ranges:
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF retro)))
$(TD Iterates a bidirectional _range backwards.
))
$(TR $(TD $(D $(LREF stride)))
$(TD Iterates a _range with stride $(I n).
))
$(TR $(TD $(D $(LREF chain)))
$(TD Concatenates several ranges into a single _range.
))
$(TR $(TD $(D $(LREF roundRobin)))
$(TD Given $(I n) ranges, creates a new _range that return the $(I n) first
elements of each _range, in turn, then the second element of each _range, and
so on, in a round-robin fashion.
))
$(TR $(TD $(D $(LREF radial)))
$(TD Given a random-access _range and a starting point, creates a _range that
alternately returns the next left and next right element to the starting point.
))
$(TR $(TD $(D $(LREF take)))
$(TD Creates a sub-_range consisting of only up to the first $(I n) elements of
the given _range.
))
$(TR $(TD $(D $(LREF takeExactly)))
$(TD Like $(D take), but assumes the given _range actually has $(I n) elements,
and therefore also defines the $(D length) property.
))
$(TR $(TD $(D $(LREF takeOne)))
$(TD Creates a random-access _range consisting of exactly the first element of
the given _range.
))
$(TR $(TD $(D $(LREF takeNone)))
$(TD Creates a random-access _range consisting of zero elements of the given
_range.
))
$(TR $(TD $(D $(LREF drop)))
$(TD Creates the _range that results from discarding the first $(I n) elements
from the given _range.
))
$(TR $(TD $(D $(LREF repeat)))
$(TD Creates a _range that consists of a single element repeated $(I n) times,
or an infinite _range repeating that element indefinitely.
))
$(TR $(TD $(D $(LREF cycle)))
$(TD Creates an infinite _range that repeats the given forward _range
indefinitely. Good for implementing circular buffers.
))
$(TR $(TD $(D $(LREF zip)))
$(TD Given $(I n) _ranges, creates a _range that successively returns a tuple
of all the first elements, a tuple of all the second elements, etc.
))
$(TR $(TD $(D $(LREF lockstep)))
$(TD Iterates $(I n) _ranges in lockstep, for use in a $(D foreach) loop.
Similar to $(D zip), except that $(D lockstep) is designed especially for $(D
foreach) loops.
))
$(TR $(TD $(D $(LREF recurrence)))
$(TD Creates a forward _range whose values are defined by a mathematical
recurrence relation.
))
$(TR $(TD $(D $(LREF sequence)))
$(TD Similar to $(D recurrence), except that a random-access _range is created.
))
$(TR $(TD $(D $(LREF iota)))
$(TD Creates a _range consisting of numbers between a starting point and ending
point, spaced apart by a given interval.
))
$(TR $(TD $(D $(LREF frontTransversal)))
$(TD Creates a _range that iterates over the first elements of the given
ranges.
))
$(TR $(TD $(D $(LREF transversal)))
$(TD Creates a _range that iterates over the $(I n)'th elements of the given
random-access ranges.
))
$(TR $(TD $(D $(LREF indexed)))
$(TD Creates a _range that offers a view of a given _range as though its
elements were reordered according to a given _range of indices.
))
$(TR $(TD $(D $(LREF chunks)))
$(TD Creates a _range that returns fixed-size chunks of the original _range.
))
)
These _range-construction tools are implemented using templates; but sometimes
an object-based interface for ranges is needed. For this purpose, this module
provides a number of object and $(D interface) definitions that can be used to
wrap around _range objects created by the above templates:
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF InputRange)))
$(TD Wrapper for input ranges.
))
$(TR $(TD $(D $(LREF InputAssignable)))
$(TD Wrapper for input ranges with assignable elements.
))
$(TR $(TD $(D $(LREF ForwardRange)))
$(TD Wrapper for forward ranges.
))
$(TR $(TD $(D $(LREF ForwardAssignable)))
$(TD Wrapper for forward ranges with assignable elements.
))
$(TR $(TD $(D $(LREF BidirectionalRange)))
$(TD Wrapper for bidirectional ranges.
))
$(TR $(TD $(D $(LREF BidirectionalAssignable)))
$(TD Wrapper for bidirectional ranges with assignable elements.
))
$(TR $(TD $(D $(LREF RandomAccessFinite)))
$(TD Wrapper for finite random-access ranges.
))
$(TR $(TD $(D $(LREF RandomAccessAssignable)))
$(TD Wrapper for finite random-access ranges with assignable elements.
))
$(TR $(TD $(D $(LREF RandomAccessInfinite)))
$(TD Wrapper for infinite random-access ranges.
))
$(TR $(TD $(D $(LREF OutputRange)))
$(TD Wrapper for output ranges.
))
$(TR $(TD $(D $(LREF OutputRangeObject)))
$(TD Class that implements the $(D OutputRange) interface and wraps the
$(D put) methods in virtual functions.
))
$(TR $(TD $(D $(LREF InputRangeObject)))
$(TD Class that implements the $(D InputRange) interface and wraps the input
_range methods in virtual functions.
))
)
Ranges whose elements are sorted afford better efficiency with certain
operations. For this, the $(D $(LREF assumeSorted)) function can be used to
construct a $(D $(LREF SortedRange)) from a pre-sorted _range. The $(D $(LINK2
std_algorithm.html#sort, std.algorithm.sort)) function also conveniently
returns a $(D SortedRange). $(D SortedRange) objects provide some additional
_range operations that take advantage of the fact that the _range is sorted.
Finally, this module also defines some convenience functions for
manipulating ranges:
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF popFrontN)))
$(TD Advances a given _range by $(I n) elements.
))
$(TR $(TD $(D $(LREF popBackN)))
$(TD Advances a given bidirectional _range from the right by $(I n) elements.
))
$(TR $(TD $(D $(LREF moveFront)))
$(TD Removes the front element of a _range.
))
$(TR $(TD $(D $(LREF moveBack)))
$(TD Removes the back element of a bidirectional _range.
))
$(TR $(TD $(D $(LREF moveAt)))
$(TD Removes the $(I i)'th element of a random-access _range.
))
)
Source: $(PHOBOSSRC std/_range.d)
Macros:
WIKI = Phobos/StdRange
Copyright: Copyright by authors 2008-.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB erdani.com, Andrei Alexandrescu), David Simcha,
and Jonathan M Davis. Credit for some of the ideas in building this module goes
to $(WEB fantascienza.net/leonardo/so/, Leonardo Maffi).
*/
module std.range;
public import std.array;
import core.bitop;
import std.algorithm, std.conv, std.exception, std.functional,
std.traits, std.typecons, std.typetuple;
// For testing only. This code is included in a string literal to be included
// in whatever module it's needed in, so that each module that uses it can be
// tested individually, without needing to link to std.range.
enum dummyRanges = q{
// Used with the dummy ranges for testing higher order ranges.
enum RangeType
{
Input,
Forward,
Bidirectional,
Random
}
enum Length
{
Yes,
No
}
enum ReturnBy
{
Reference,
Value
}
// Range that's useful for testing other higher order ranges,
// can be parametrized with attributes. It just dumbs down an array of
// numbers 1..10.
struct DummyRange(ReturnBy _r, Length _l, RangeType _rt)
{
// These enums are so that the template params are visible outside
// this instantiation.
enum r = _r;
enum l = _l;
enum rt = _rt;
uint[] arr = [1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U];
void reinit()
{
// Workaround for DMD bug 4378
arr = [1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U];
}
void popFront()
{
arr = arr[1..$];
}
@property bool empty() const
{
return arr.length == 0;
}
static if(r == ReturnBy.Reference)
{
@property ref inout(uint) front() inout
{
return arr[0];
}
@property void front(uint val)
{
arr[0] = val;
}
}
else
{
@property uint front() const
{
return arr[0];
}
}
static if(rt >= RangeType.Forward)
{
@property typeof(this) save()
{
return this;
}
}
static if(rt >= RangeType.Bidirectional)
{
void popBack()
{
arr = arr[0..$ - 1];
}
static if(r == ReturnBy.Reference)
{
@property ref inout(uint) back() inout
{
return arr[$ - 1];
}
@property void back(uint val)
{
arr[$ - 1] = val;
}
}
else
{
@property uint back() const
{
return arr[$ - 1];
}
}
}
static if(rt >= RangeType.Random)
{
static if(r == ReturnBy.Reference)
{
ref inout(uint) opIndex(size_t index) inout
{
return arr[index];
}
void opIndexAssign(uint val, size_t index)
{
arr[index] = val;
}
}
else
{
@property uint opIndex(size_t index) const
{
return arr[index];
}
}
typeof(this) opSlice(size_t lower, size_t upper)
{
auto ret = this;
ret.arr = arr[lower..upper];
return ret;
}
}
static if(l == Length.Yes)
{
@property size_t length() const
{
return arr.length;
}
alias length opDollar;
}
}
enum dummyLength = 10;
alias TypeTuple!(
DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Forward),
DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Bidirectional),
DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Random),
DummyRange!(ReturnBy.Reference, Length.No, RangeType.Forward),
DummyRange!(ReturnBy.Reference, Length.No, RangeType.Bidirectional),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Input),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Forward),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Bidirectional),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random),
DummyRange!(ReturnBy.Value, Length.No, RangeType.Input),
DummyRange!(ReturnBy.Value, Length.No, RangeType.Forward),
DummyRange!(ReturnBy.Value, Length.No, RangeType.Bidirectional)
) AllDummyRanges;
};
version(unittest)
{
import std.container, std.conv, std.math, std.stdio;
mixin(dummyRanges);
// Tests whether forward, bidirectional and random access properties are
// propagated properly from the base range(s) R to the higher order range
// H. Useful in combination with DummyRange for testing several higher
// order ranges.
template propagatesRangeType(H, R...) {
static if(allSatisfy!(isRandomAccessRange, R)) {
enum bool propagatesRangeType = isRandomAccessRange!H;
} else static if(allSatisfy!(isBidirectionalRange, R)) {
enum bool propagatesRangeType = isBidirectionalRange!H;
} else static if(allSatisfy!(isForwardRange, R)) {
enum bool propagatesRangeType = isForwardRange!H;
} else {
enum bool propagatesRangeType = isInputRange!H;
}
}
template propagatesLength(H, R...) {
static if(allSatisfy!(hasLength, R)) {
enum bool propagatesLength = hasLength!H;
} else {
enum bool propagatesLength = !hasLength!H;
}
}
}
/**
Returns $(D true) if $(D R) is an input range. An input range must
define the primitives $(D empty), $(D popFront), and $(D front). The
following code should compile for any input range.
----
R r; // can define a range object
if (r.empty) {} // can test for empty
r.popFront(); // can invoke popFront()
auto h = r.front; // can get the front of the range of non-void type
----
The semantics of an input range (not checkable during compilation) are
assumed to be the following ($(D r) is an object of type $(D R)):
$(UL $(LI $(D r.empty) returns $(D false) iff there is more data
available in the range.) $(LI $(D r.front) returns the current
element in the range. It may return by value or by reference. Calling
$(D r.front) is allowed only if calling $(D r.empty) has, or would
have, returned $(D false).) $(LI $(D r.popFront) advances to the next
element in the range. Calling $(D r.popFront) is allowed only if
calling $(D r.empty) has, or would have, returned $(D false).))
*/
template isInputRange(R)
{
enum bool isInputRange = is(typeof(
(inout int _dummy=0)
{
R r = void; // can define a range object
if (r.empty) {} // can test for empty
r.popFront(); // can invoke popFront()
auto h = r.front; // can get the front of the range
}));
}
unittest
{
struct A {}
struct B
{
void popFront();
@property bool empty();
@property int front();
}
static assert(!isInputRange!(A));
static assert( isInputRange!(B));
static assert( isInputRange!(int[]));
static assert( isInputRange!(char[]));
static assert(!isInputRange!(char[4]));
static assert( isInputRange!(inout(int)[])); // bug 7824
}
/**
Outputs $(D e) to $(D r). The exact effect is dependent upon the two
types. Several cases are accepted, as described below. The code snippets
are attempted in order, and the first to compile "wins" and gets
evaluated.
$(BOOKTABLE ,
$(TR $(TH Code Snippet) $(TH Scenario))
$(TR $(TD $(D r.put(e);)) $(TD $(D R) specifically defines a method
$(D put) accepting an $(D E).))
$(TR $(TD $(D r.put([ e ]);)) $(TD $(D R) specifically defines a
method $(D put) accepting an $(D E[]).))
$(TR $(TD $(D r.front = e; r.popFront();)) $(TD $(D R) is an input
range and $(D e) is assignable to $(D r.front).))
$(TR $(TD $(D for (; !e.empty; e.popFront()) put(r, e.front);)) $(TD
Copying range $(D E) to range $(D R).))
$(TR $(TD $(D r(e);)) $(TD $(D R) is e.g. a delegate accepting an $(D
E).))
$(TR $(TD $(D r([ e ]);)) $(TD $(D R) is e.g. a $(D delegate)
accepting an $(D E[]).))
)
*/
void put(R, E)(ref R r, E e)
{
static if (hasMember!(R, "put") ||
(isPointer!R && is(PointerTarget!R == struct) &&
hasMember!(PointerTarget!R, "put")))
{
// commit to using the "put" method
static if (!isArray!R && is(typeof(r.put(e))))
{
r.put(e);
}
else static if (!isArray!R && is(typeof(r.put((&e)[0..1]))))
{
r.put((&e)[0..1]);
}
else static if (isInputRange!E && is(typeof(put(r, e.front))))
{
for (; !e.empty; e.popFront()) put(r, e.front);
}
else
{
static assert(false,
"Cannot put a "~E.stringof~" into a "~R.stringof);
}
}
else
{
static if (isInputRange!R)
{
// Commit to using assignment to front
static if (is(typeof(r.front = e, r.popFront())))
{
r.front = e;
r.popFront();
}
else static if (isInputRange!E && is(typeof(put(r, e.front))))
{
for (; !e.empty; e.popFront()) put(r, e.front);
}
else
{
static assert(false,
"Cannot put a "~E.stringof~" into a "~R.stringof);
}
}
else
{
// Commit to using opCall
static if (is(typeof(r(e))))
{
r(e);
}
else static if (is(typeof(r((&e)[0..1]))))
{
r((&e)[0..1]);
}
else
{
static assert(false,
"Cannot put a "~E.stringof~" into a "~R.stringof);
}
}
}
}
unittest
{
struct A {}
static assert(!isInputRange!(A));
struct B
{
void put(int) {}
}
B b;
put(b, 5);
}
unittest
{
int[] a = [1, 2, 3], b = [10, 20];
auto c = a;
put(a, b);
assert(c == [10, 20, 3]);
assert(a == [3]);
}
unittest
{
int[] a = new int[10];
int b;
static assert(isInputRange!(typeof(a)));
put(a, b);
}
unittest
{
void myprint(in char[] s) { }
auto r = &myprint;
put(r, 'a');
}
unittest
{
int[] a = new int[10];
static assert(!__traits(compiles, put(a, 1.0L)));
static assert( __traits(compiles, put(a, 1)));
/*
* a[0] = 65; // OK
* a[0] = 'A'; // OK
* a[0] = "ABC"[0]; // OK
* put(a, "ABC"); // OK
*/
static assert( __traits(compiles, put(a, "ABC")));
}
unittest
{
char[] a = new char[10];
static assert(!__traits(compiles, put(a, 1.0L)));
static assert(!__traits(compiles, put(a, 1)));
// char[] is NOT output range.
static assert(!__traits(compiles, put(a, 'a')));
static assert(!__traits(compiles, put(a, "ABC")));
}
unittest
{
// Test fix for bug 7476.
struct LockingTextWriter
{
void put(dchar c){}
}
struct RetroResult
{
bool end = false;
@property bool empty() const { return end; }
@property dchar front(){ return 'a'; }
void popFront(){ end = true; }
}
LockingTextWriter w;
RetroResult r;
put(w, r);
}
/**
Returns $(D true) if $(D R) is an output range for elements of type
$(D E). An output range is defined functionally as a range that
supports the operation $(D put(r, e)) as defined above.
*/
template isOutputRange(R, E)
{
enum bool isOutputRange = is(typeof(
(inout int _dummy=0)
{
R r = void;
E e;
put(r, e);
}));
}
unittest
{
void myprint(in char[] s) { writeln('[', s, ']'); }
static assert(isOutputRange!(typeof(&myprint), char));
auto app = appender!string();
string s;
static assert( isOutputRange!(Appender!string, string));
static assert( isOutputRange!(Appender!string*, string));
static assert(!isOutputRange!(Appender!string, int));
static assert(!isOutputRange!(char[], char));
static assert(!isOutputRange!(wchar[], wchar));
static assert( isOutputRange!(dchar[], char));
static assert( isOutputRange!(dchar[], wchar));
static assert( isOutputRange!(dchar[], dchar));
static assert(!isOutputRange!(const(int)[], int));
static assert(!isOutputRange!(inout(int)[], int));
}
/**
Returns $(D true) if $(D R) is a forward range. A forward range is an
input range $(D r) that can save "checkpoints" by saving $(D r.save)
to another value of type $(D R). Notable examples of input ranges that
are $(I not) forward ranges are file/socket ranges; copying such a
range will not save the position in the stream, and they most likely
reuse an internal buffer as the entire stream does not sit in
memory. Subsequently, advancing either the original or the copy will
advance the stream, so the copies are not independent.
The following code should compile for any forward range.
----
static assert(isInputRange!R);
R r1;
R r2 = r1.save; // can save the current position into another range
----
Saving a range is not duplicating it; in the example above, $(D r1)
and $(D r2) still refer to the same underlying data. They just
navigate that data independently.
The semantics of a forward range (not checkable during compilation)
are the same as for an input range, with the additional requirement
that backtracking must be possible by saving a copy of the range
object with $(D save) and using it later.
*/
template isForwardRange(R)
{
enum bool isForwardRange = isInputRange!R && is(typeof(
(inout int _dummy=0)
{
R r1 = void;
R r2 = r1.save; // can call "save" against a range object
}));
}
unittest
{
static assert(!isForwardRange!(int));
static assert( isForwardRange!(int[]));
static assert( isForwardRange!(inout(int)[]));
}
/**
Returns $(D true) if $(D R) is a bidirectional range. A bidirectional
range is a forward range that also offers the primitives $(D back) and
$(D popBack). The following code should compile for any bidirectional
range.
----
R r;
static assert(isForwardRange!R); // is forward range
r.popBack(); // can invoke popBack
auto t = r.back; // can get the back of the range
auto w = r.front;
static assert(is(typeof(t) == typeof(w))); // same type for front and back
----
The semantics of a bidirectional range (not checkable during
compilation) are assumed to be the following ($(D r) is an object of
type $(D R)):
$(UL $(LI $(D r.back) returns (possibly a reference to) the last
element in the range. Calling $(D r.back) is allowed only if calling
$(D r.empty) has, or would have, returned $(D false).))
*/
template isBidirectionalRange(R)
{
enum bool isBidirectionalRange = isForwardRange!R && is(typeof(
(inout int _dummy=0)
{
R r = void;
r.popBack();
auto t = r.back;
auto w = r.front;
static assert(is(typeof(t) == typeof(w)));
}));
}
unittest
{
struct A {}
struct B
{
void popFront();
@property bool empty();
@property int front();
}
struct C
{
@property bool empty();
@property C save();
void popFront();
@property int front();
void popBack();
@property int back();
}
static assert(!isBidirectionalRange!(A));
static assert(!isBidirectionalRange!(B));
static assert( isBidirectionalRange!(C));
static assert( isBidirectionalRange!(int[]));
static assert( isBidirectionalRange!(char[]));
static assert( isBidirectionalRange!(inout(int)[]));
}
/**
Returns $(D true) if $(D R) is a random-access range. A random-access
range is a bidirectional range that also offers the primitive $(D
opIndex), OR an infinite forward range that offers $(D opIndex). In
either case, the range must either offer $(D length) or be
infinite. The following code should compile for any random-access
range.
----
R r;
static assert(isForwardRange!R); // range is forward
static assert(isBidirectionalRange!R || isInfinite!R);
// range is bidirectional or infinite
auto e = r[1]; // can index
----
The semantics of a random-access range (not checkable during
compilation) are assumed to be the following ($(D r) is an object of
type $(D R)): $(UL $(LI $(D r.opIndex(n)) returns a reference to the
$(D n)th element in the range.))
Although $(D char[]) and $(D wchar[]) (as well as their qualified
versions including $(D string) and $(D wstring)) are arrays, $(D
isRandomAccessRange) yields $(D false) for them because they use
variable-length encodings (UTF-8 and UTF-16 respectively). These types
are bidirectional ranges only.
*/
template isRandomAccessRange(R)
{
enum bool isRandomAccessRange = is(typeof(
(inout int _dummy=0)
{
static assert(isBidirectionalRange!R ||
isForwardRange!R && isInfinite!R);
R r = void;
auto e = r[1];
static assert(!isNarrowString!R);
static assert(hasLength!R || isInfinite!R);
}));
}
unittest
{
struct A {}
struct B
{
void popFront();
@property bool empty();
@property int front();
}
struct C
{
void popFront();
@property bool empty();
@property int front();
void popBack();
@property int back();
}
struct D
{
@property bool empty();
@property D save();
@property int front();
void popFront();
@property int back();
void popBack();
ref int opIndex(uint);
@property size_t length();
alias length opDollar;
//int opSlice(uint, uint);
}
static assert(!isRandomAccessRange!(A));
static assert(!isRandomAccessRange!(B));
static assert(!isRandomAccessRange!(C));
static assert( isRandomAccessRange!(D));
static assert( isRandomAccessRange!(int[]));
static assert( isRandomAccessRange!(inout(int)[]));
}
unittest
{
// Test fix for bug 6935.
struct R
{
@disable this();
@disable static @property R init();
@property bool empty() const { return false; }
@property int front() const { return 0; }
void popFront() {}
@property R save() { return this; }
@property int back() const { return 0; }
void popBack(){}
int opIndex(size_t n) const { return 0; }
@property size_t length() const { return 0; }
alias length opDollar;
void put(int e){ }
}
static assert(isInputRange!R);
static assert(isForwardRange!R);
static assert(isBidirectionalRange!R);
static assert(isRandomAccessRange!R);
static assert(isOutputRange!(R, int));
}
/**
Returns $(D true) iff the range supports the $(D moveFront) primitive,
as well as $(D moveBack) and $(D moveAt) if it's a bidirectional or
random access range. These may be explicitly implemented, or may work
via the default behavior of the module level functions $(D moveFront)
and friends.
*/
template hasMobileElements(R)
{
enum bool hasMobileElements = is(typeof(
{
R r = void;
return moveFront(r);
}))
&& (!isBidirectionalRange!R || is(typeof(
{
R r = void;
return moveBack(r);
})))
&& (!isRandomAccessRange!R || is(typeof(
{
R r = void;
return moveAt(r, 0);
})));
}
unittest
{
static struct HasPostblit
{
this(this) {}
}
auto nonMobile = map!"a"(repeat(HasPostblit.init));
static assert(!hasMobileElements!(typeof(nonMobile)));
static assert( hasMobileElements!(int[]));
static assert( hasMobileElements!(typeof(iota(1000))));
}
/**
The element type of $(D R). $(D R) does not have to be a range. The
element type is determined as the type yielded by $(D r.front) for an
object $(D r) or type $(D R). For example, $(D ElementType!(T[])) is
$(D T). If $(D R) is not a range, $(D ElementType!R) is $(D void).
*/
template ElementType(R)
{
static if (is(typeof((inout int _dummy=0){ R r = void; return r.front; }()) T))
alias T ElementType;
else
alias void ElementType;
}
unittest
{
enum XYZ : string { a = "foo" }
auto x = front(XYZ.a);
immutable char[3] a = "abc";
int[] i;
void[] buf;
static assert(is(ElementType!(XYZ) : dchar));
static assert(is(ElementType!(typeof(a)) : dchar));
static assert(is(ElementType!(typeof(i)) : int));
static assert(is(ElementType!(typeof(buf)) : void));
static assert(is(ElementType!(inout(int)[]) : inout(int)));
}
/**
The encoding element type of $(D R). For narrow strings ($(D char[]),
$(D wchar[]) and their qualified variants including $(D string) and
$(D wstring)), $(D ElementEncodingType) is the character type of the
string. For all other ranges, $(D ElementEncodingType) is the same as
$(D ElementType).
*/
template ElementEncodingType(R)
{
static if (isNarrowString!R)
alias typeof((inout int _dummy=0){ R r = void; return r[0]; }()) ElementEncodingType;
else
alias ElementType!R ElementEncodingType;
}
unittest
{
enum XYZ : string { a = "foo" }
auto x = front(XYZ.a);
immutable char[3] a = "abc";
int[] i;
void[] buf;
static assert(is(ElementType!(XYZ) : dchar));
static assert(is(ElementEncodingType!(char[]) == char));
static assert(is(ElementEncodingType!(string) == immutable char));
static assert(is(ElementType!(typeof(a)) : dchar));
static assert(is(ElementType!(typeof(i)) == int));
static assert(is(ElementEncodingType!(typeof(i)) == int));
static assert(is(ElementType!(typeof(buf)) : void));
static assert(is(ElementEncodingType!(inout char[]) : inout(char)));
}
/**
Returns $(D true) if $(D R) is a forward range and has swappable
elements. The following code should compile for any random-access
range.
----
R r;
static assert(isForwardRange!(R)); // range is forward
swap(r.front, r.front); // can swap elements of the range
----
*/
template hasSwappableElements(R)
{
enum bool hasSwappableElements = isForwardRange!R && is(typeof(
(inout int _dummy=0)
{
R r = void;
swap(r.front, r.front); // can swap elements of the range
}));
}
unittest
{
static assert(!hasSwappableElements!(const int[]));
static assert(!hasSwappableElements!(const(int)[]));
static assert(!hasSwappableElements!(inout(int)[]));
static assert( hasSwappableElements!(int[]));
//static assert( hasSwappableElements!(char[]));
}
/**
Returns $(D true) if $(D R) is a forward range and has mutable
elements. The following code should compile for any random-access
range.
----
R r;
static assert(isForwardRange!R); // range is forward
auto e = r.front;
r.front = e; // can assign elements of the range
----
*/
template hasAssignableElements(R)
{
enum bool hasAssignableElements = isForwardRange!R && is(typeof(
(inout int _dummy=0)
{
R r = void;
static assert(isForwardRange!(R)); // range is forward
auto e = r.front;
r.front = e; // can assign elements of the range
}));
}
unittest
{
static assert(!hasAssignableElements!(const int[]));
static assert(!hasAssignableElements!(const(int)[]));
static assert( hasAssignableElements!(int[]));
static assert(!hasAssignableElements!(inout(int)[]));
}
/**
Tests whether $(D R) has lvalue elements. These are defined as elements that
can be passed by reference and have their address taken.
*/
template hasLvalueElements(R)
{
enum bool hasLvalueElements = is(typeof(
(inout int _dummy=0)
{
void checkRef(ref ElementType!R stuff) {}
R r = void;
static assert(is(typeof(checkRef(r.front))));
}));
}
unittest
{
static assert( hasLvalueElements!(int[]));
static assert( hasLvalueElements!(const(int)[]));
static assert( hasLvalueElements!(inout(int)[]));
static assert( hasLvalueElements!(immutable(int)[]));
static assert(!hasLvalueElements!(typeof(iota(3))));
auto c = chain([1, 2, 3], [4, 5, 6]);
static assert( hasLvalueElements!(typeof(c)));
// Disabled test by bug 6336
// struct S { immutable int value; }
// static assert( hasLvalueElements!(S[]));
}
/**
Returns $(D true) if $(D R) has a $(D length) member that returns an
integral type. $(D R) does not have to be a range. Note that $(D
length) is an optional primitive as no range must implement it. Some
ranges do not store their length explicitly, some cannot compute it
without actually exhausting the range (e.g. socket streams), and some
other ranges may be infinite.
Although narrow string types ($(D char[]), $(D wchar[]), and their
qualified derivatives) do define a $(D length) property, $(D
hasLength) yields $(D false) for them. This is because a narrow
string's length does not reflect the number of characters, but instead
the number of encoding units, and as such is not useful with
range-oriented algorithms.
*/
template hasLength(R)
{
enum bool hasLength = !isNarrowString!R && is(typeof(
(inout int _dummy=0)
{
R r = void;
static assert(is(typeof(r.length) : ulong));
}));
}
unittest
{
static assert(!hasLength!(char[]));
static assert( hasLength!(int[]));
static assert( hasLength!(inout(int)[]));
struct A { ulong length; }
struct B { size_t length() { return 0; } }
struct C { @property size_t length() { return 0; } }
static assert( hasLength!(A));
static assert(!hasLength!(B));
static assert( hasLength!(C));
}
/**
Returns $(D true) if $(D R) is an infinite input range. An
infinite input range is an input range that has a statically-defined
enumerated member called $(D empty) that is always $(D false),
for example:
----
struct MyInfiniteRange
{
enum bool empty = false;
...
}
----
*/
template isInfinite(R)
{
static if (isInputRange!R && __traits(compiles, { enum e = R.empty; }))
enum bool isInfinite = !R.empty;
else
enum bool isInfinite = false;
}
unittest
{
static assert(!isInfinite!(int[]));
static assert( isInfinite!(Repeat!(int)));
}
/**
Returns $(D true) if $(D R) offers a slicing operator with
integral boundaries, that in turn returns an input range type. The
following code should compile for $(D hasSlicing) to be $(D true):
----
R r;
auto s = r[1 .. 2];
static assert(isInputRange!(typeof(s)));
----
*/
template hasSlicing(R)
{
enum bool hasSlicing = !isNarrowString!R && is(typeof(
(inout int _dummy=0)
{
R r = void;
auto s = r[1 .. 2];
static assert(isInputRange!(typeof(s)));
}));
}
unittest
{
static assert( hasSlicing!(int[]));
static assert( hasSlicing!(inout(int)[]));
static assert(!hasSlicing!string);
struct A { int opSlice(uint, uint); }
struct B { int[] opSlice(uint, uint); }
struct C { @disable this(); int[] opSlice(size_t, size_t); }
static assert(!hasSlicing!(A));
static assert( hasSlicing!(B));
static assert( hasSlicing!(C));
}
/**
This is a best-effort implementation of $(D length) for any kind of
range.
If $(D hasLength!(Range)), simply returns $(D range.length) without
checking $(D upTo).
Otherwise, walks the range through its length and returns the number
of elements seen. Performes $(BIGOH n) evaluations of $(D range.empty)
and $(D range.popFront()), where $(D n) is the effective length of $(D
range). The $(D upTo) parameter is useful to "cut the losses" in case
the interest is in seeing whether the range has at least some number
of elements. If the parameter $(D upTo) is specified, stops if $(D
upTo) steps have been taken and returns $(D upTo).
*/
auto walkLength(Range)(Range range, const size_t upTo = size_t.max)
if (isInputRange!Range)
{
static if (hasLength!Range)
{
return range.length;
}
else
{
size_t result;
// Optimize this tight loop by specializing for the common
// case upTo == default parameter
if (upTo == size_t.max)
for (; !range.empty; range.popFront()) ++result;
else
for (; result < upTo && !range.empty; range.popFront()) ++result;
return result;
}
}
unittest
{
int[] a = [ 1, 2, 3 ];
assert(walkLength(a) == 3);
assert(walkLength(a, 0) == 3);
}
/**
Iterates a bidirectional range backwards. The original range can be
accessed by using the $(D source) property. Applying retro twice to
the same range yields the original range.
Example:
----
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(retro(a), [ 5, 4, 3, 2, 1 ][]));
assert(retro(a).source is a);
assert(retro(retro(a)) is a);
----
*/
auto retro(Range)(Range r)
if (isBidirectionalRange!(Unqual!Range))
{
// Check for retro(retro(r)) and just return r in that case
static if (is(typeof(retro(r.source)) == Range))
{
return r.source;
}
else
{
static struct Result
{
private alias Unqual!Range R;
// User code can get and set source, too
R source;
static if (hasLength!R)
{
private alias CommonType!(size_t, typeof(source.length)) IndexType;
IndexType retroIndex(IndexType n)
{
return source.length - n - 1;
}
}
public:
alias R Source;
@property bool empty() { return source.empty; }
@property auto save()
{
return Result(source.save);
}
@property auto ref front() { return source.back; }
void popFront() { source.popBack(); }
@property auto ref back() { return source.front; }
void popBack() { source.popFront(); }
static if(is(typeof(.moveBack(source))))
{
ElementType!R moveFront()
{
return .moveBack(source);
}
}
static if(is(typeof(.moveFront(source))))
{
ElementType!R moveBack()
{
return .moveFront(source);
}
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
source.back = val;
}
@property auto back(ElementType!R val)
{
source.front = val;
}
}
static if (isRandomAccessRange!(R) && hasLength!(R))
{
auto ref opIndex(IndexType n) { return source[retroIndex(n)]; }
static if (hasAssignableElements!R)
{
void opIndexAssign(ElementType!R val, IndexType n)
{
source[retroIndex(n)] = val;
}
}
static if (is(typeof(.moveAt(source, 0))))
{
ElementType!R moveAt(IndexType index)
{
return .moveAt(source, retroIndex(index));
}
}
static if (hasSlicing!R)
typeof(this) opSlice(IndexType a, IndexType b)
{
return typeof(this)(source[source.length - b .. source.length - a]);
}
}
static if (hasLength!R)
{
@property auto length()
{
return source.length;
}
alias length opDollar;
}
}
return Result(r);
}
}
unittest
{
static assert(isBidirectionalRange!(typeof(retro("hello"))));
int[] a;
static assert(is(typeof(a) == typeof(retro(retro(a)))));
assert(retro(retro(a)) is a);
static assert(isRandomAccessRange!(typeof(retro([1, 2, 3]))));
void test(int[] input, int[] witness)
{
auto r = retro(input);
assert(r.front == witness.front);
assert(r.back == witness.back);
assert(equal(r, witness));
}
test([ 1 ], [ 1 ]);
test([ 1, 2 ], [ 2, 1 ]);
test([ 1, 2, 3 ], [ 3, 2, 1 ]);
test([ 1, 2, 3, 4 ], [ 4, 3, 2, 1 ]);
test([ 1, 2, 3, 4, 5 ], [ 5, 4, 3, 2, 1 ]);
test([ 1, 2, 3, 4, 5, 6 ], [ 6, 5, 4, 3, 2, 1 ]);
// static assert(is(Retro!(immutable int[])));
immutable foo = [1,2,3].idup;
retro(foo);
foreach(DummyType; AllDummyRanges) {
static if (!isBidirectionalRange!DummyType) {
static assert(!__traits(compiles, Retro!DummyType));
} else {
DummyType dummyRange;
dummyRange.reinit();
auto myRetro = retro(dummyRange);
static assert(propagatesRangeType!(typeof(myRetro), DummyType));
assert(myRetro.front == 10);
assert(myRetro.back == 1);
assert(myRetro.moveFront() == 10);
assert(myRetro.moveBack() == 1);
static if (isRandomAccessRange!DummyType && hasLength!DummyType) {
assert(myRetro[0] == myRetro.front);
assert(myRetro.moveAt(2) == 8);
static if (DummyType.r == ReturnBy.Reference) {
{
myRetro[9]++;
scope(exit) myRetro[9]--;
assert(dummyRange[0] == 2);
myRetro.front++;
scope(exit) myRetro.front--;
assert(myRetro.front == 11);
myRetro.back++;
scope(exit) myRetro.back--;
assert(myRetro.back == 3);
}
{
myRetro.front = 0xFF;
scope(exit) myRetro.front = 10;
assert(dummyRange.back == 0xFF);
myRetro.back = 0xBB;
scope(exit) myRetro.back = 1;
assert(dummyRange.front == 0xBB);
myRetro[1] = 11;
scope(exit) myRetro[1] = 8;
assert(dummyRange[8] == 11);
}
}
}
}
}
}
unittest
{
auto LL = iota(1L, 4L);
auto r = retro(LL);
assert(equal(r, [3L, 2L, 1L]));
}
/**
Iterates range $(D r) with stride $(D n). If the range is a
random-access range, moves by indexing into the range; otehrwise,
moves by successive calls to $(D popFront). Applying stride twice to
the same range results in a stride that with a step that is the
product of the two applications.
Throws: $(D Exception) if $(D n == 0).
Example:
----
int[] a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ];
assert(equal(stride(a, 3), [ 1, 4, 7, 10 ][]));
assert(stride(stride(a, 2), 3) == stride(a, 6));
----
*/
auto stride(Range)(Range r, size_t n)
if (isInputRange!(Unqual!Range))
{
enforce(n > 0, "Stride cannot have step zero.");
static if (is(typeof(stride(r.source, n)) == Range))
{
// stride(stride(r, n1), n2) is stride(r, n1 * n2)
return stride(r.source, r._n * n);
}
else
{
static struct Result
{
private alias Unqual!Range R;
public R source;
private size_t _n;
// Chop off the slack elements at the end
static if (hasLength!R &&
(isRandomAccessRange!R && hasSlicing!R
|| isBidirectionalRange!R))
private void eliminateSlackElements()
{
auto slack = source.length % _n;
if (slack)
{
slack--;
}
else if (!source.empty)
{
slack = min(_n, source.length) - 1;
}
else
{
slack = 0;
}
if (!slack) return;
static if (isRandomAccessRange!R && hasSlicing!R)
{
source = source[0 .. source.length - slack];
}
else static if (isBidirectionalRange!R)
{
foreach (i; 0 .. slack)
{
source.popBack();
}
}
}
static if (isForwardRange!R)
{
@property auto save()
{
return Result(source.save, _n);
}
}
static if (isInfinite!R)
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return source.empty;
}
}
@property auto ref front()
{
return source.front;
}
static if (is(typeof(.moveFront(source))))
{
ElementType!R moveFront()
{
return .moveFront(source);
}
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
source.front = val;
}
}
void popFront()
{
static if (isRandomAccessRange!R && hasLength!R && hasSlicing!R)
{
source = source[min(_n, source.length) .. source.length];
}
else
{
static if (hasLength!R)
{
foreach (i; 0 .. min(source.length, _n))
{
source.popFront();
}
}
else
{
foreach (i; 0 .. _n)
{
source.popFront();
if (source.empty) break;
}
}
}
}
static if (isBidirectionalRange!R && hasLength!R)
{
void popBack()
{
popBackN(source, _n);
}
@property auto ref back()
{
eliminateSlackElements();
return source.back;
}
static if (is(typeof(.moveBack(source))))
{
ElementType!R moveBack()
{
eliminateSlackElements();
return .moveBack(source);
}
}
static if (hasAssignableElements!R)
{
@property auto back(ElementType!R val)
{
eliminateSlackElements();
source.back = val;
}
}
}
static if (isRandomAccessRange!R && hasLength!R)
{
auto ref opIndex(size_t n)
{
return source[_n * n];
}
/**
Forwards to $(D moveAt(source, n)).
*/
static if (is(typeof(.moveAt(source, 0))))
{
ElementType!R moveAt(size_t n)
{
return .moveAt(source, _n * n);
}
}
static if (hasAssignableElements!R)
{
void opIndexAssign(ElementType!R val, size_t n)
{
source[_n * n] = val;
}
}
}
static if (hasSlicing!R && hasLength!R)
typeof(this) opSlice(size_t lower, size_t upper)
{
assert(upper >= lower && upper <= length);
immutable translatedUpper = (upper == 0) ? 0 :
(upper * _n - (_n - 1));
immutable translatedLower = min(lower * _n, translatedUpper);
assert(translatedLower <= translatedUpper);
return typeof(this)(source[translatedLower..translatedUpper], _n);
}
static if (hasLength!R)
{
@property auto length()
{
return (source.length + _n - 1) / _n;
}
alias length opDollar;
}
}
return Result(r, n);
}
}
unittest
{
static assert(isRandomAccessRange!(typeof(stride([1, 2, 3], 2))));
void test(size_t n, int[] input, int[] witness)
{
assert(equal(stride(input, n), witness));
}
test(1, [], []);
int[] arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
assert(stride(stride(arr, 2), 3) is stride(arr, 6));
test(1, arr, arr);
test(2, arr, [1, 3, 5, 7, 9]);
test(3, arr, [1, 4, 7, 10]);
test(4, arr, [1, 5, 9]);
// Test slicing.
auto s1 = stride(arr, 1);
assert(equal(s1[1..4], [2, 3, 4]));
assert(s1[1..4].length == 3);
assert(equal(s1[1..5], [2, 3, 4, 5]));
assert(s1[1..5].length == 4);
assert(s1[0..0].empty);
assert(s1[3..3].empty);
// assert(s1[$ .. $].empty);
assert(s1[s1.opDollar() .. s1.opDollar()].empty);
auto s2 = stride(arr, 2);
assert(equal(s2[0..2], [1,3]));
assert(s2[0..2].length == 2);
assert(equal(s2[1..5], [3, 5, 7, 9]));
assert(s2[1..5].length == 4);
assert(s2[0..0].empty);
assert(s2[3..3].empty);
// assert(s2[$ .. $].empty);
assert(s2[s2.opDollar() .. s2.opDollar()].empty);
// Test fix for Bug 5035
auto m = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]; // 3 rows, 4 columns
auto col = stride(m, 4);
assert(equal(col, [1, 1, 1]));
assert(equal(retro(col), [1, 1, 1]));
immutable int[] immi = [ 1, 2, 3 ];
static assert(isRandomAccessRange!(typeof(stride(immi, 1))));
// Check for infiniteness propagation.
static assert(isInfinite!(typeof(stride(repeat(1), 3))));
foreach(DummyType; AllDummyRanges) {
DummyType dummyRange;
dummyRange.reinit();
auto myStride = stride(dummyRange, 4);
// Should fail if no length and bidirectional b/c there's no way
// to know how much slack we have.
static if (hasLength!DummyType || !isBidirectionalRange!DummyType) {
static assert(propagatesRangeType!(typeof(myStride), DummyType));
}
assert(myStride.front == 1);
assert(myStride.moveFront() == 1);
assert(equal(myStride, [1, 5, 9]));
static if (hasLength!DummyType) {
assert(myStride.length == 3);
}
static if (isBidirectionalRange!DummyType && hasLength!DummyType) {
assert(myStride.back == 9);
assert(myStride.moveBack() == 9);
}
static if (isRandomAccessRange!DummyType && hasLength!DummyType) {
assert(myStride[0] == 1);
assert(myStride[1] == 5);
assert(myStride.moveAt(1) == 5);
assert(myStride[2] == 9);
static assert(hasSlicing!(typeof(myStride)));
}
static if (DummyType.r == ReturnBy.Reference) {
// Make sure reference is propagated.
{
myStride.front++;
scope(exit) myStride.front--;
assert(dummyRange.front == 2);
}
{
myStride.front = 4;
scope(exit) myStride.front = 1;
assert(dummyRange.front == 4);
}
static if (isBidirectionalRange!DummyType && hasLength!DummyType) {
{
myStride.back++;
scope(exit) myStride.back--;
assert(myStride.back == 10);
}
{
myStride.back = 111;
scope(exit) myStride.back = 9;
assert(myStride.back == 111);
}
static if (isRandomAccessRange!DummyType) {
{
myStride[1]++;
scope(exit) myStride[1]--;
assert(dummyRange[4] == 6);
}
{
myStride[1] = 55;
scope(exit) myStride[1] = 5;
assert(dummyRange[4] == 55);
}
}
}
}
}
}
unittest
{
auto LL = iota(1L, 10L);
auto s = stride(LL, 3);
assert(equal(s, [1L, 4L, 7L]));
}
/**
Spans multiple ranges in sequence. The function $(D chain) takes any
number of ranges and returns a $(D Chain!(R1, R2,...)) object. The
ranges may be different, but they must have the same element type. The
result is a range that offers the $(D front), $(D popFront), and $(D
empty) primitives. If all input ranges offer random access and $(D
length), $(D Chain) offers them as well.
If only one range is offered to $(D Chain) or $(D chain), the $(D
Chain) type exits the picture by aliasing itself directly to that
range's type.
Example:
----
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
int[] arr3 = [ 7 ];
auto s = chain(arr1, arr2, arr3);
assert(s.length == 7);
assert(s[5] == 6);
assert(equal(s, [1, 2, 3, 4, 5, 6, 7][]));
----
*/
auto chain(Ranges...)(Ranges rs)
if (Ranges.length > 0 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)))
{
static if (Ranges.length == 1)
{
return rs[0];
}
else
{
static struct Result
{
private:
alias staticMap!(Unqual, Ranges) R;
alias CommonType!(staticMap!(.ElementType, R)) RvalueElementType;
private template sameET(A)
{
enum sameET = is(.ElementType!A == RvalueElementType);
}
enum bool allSameType = allSatisfy!(sameET, R);
// This doesn't work yet
static if (allSameType)
{
alias ref RvalueElementType ElementType;
}
else
{
alias RvalueElementType ElementType;
}
static if (allSameType && allSatisfy!(hasLvalueElements, R))
{
static ref RvalueElementType fixRef(ref RvalueElementType val)
{
return val;
}
}
else
{
static RvalueElementType fixRef(RvalueElementType val)
{
return val;
}
}
// This is the entire state
Tuple!R source;
// TODO: use a vtable (or more) instead of linear iteration
public:
this(R input)
{
foreach (i, v; input)
{
source[i] = v;
}
}
static if (anySatisfy!(isInfinite, R))
{
// Propagate infiniteness.
enum bool empty = false;
}
else
{
@property bool empty()
{
foreach (i, Unused; R)
{
if (!source[i].empty) return false;
}
return true;
}
}
static if (allSatisfy!(isForwardRange, R))
@property auto save()
{
typeof(this) result;
foreach (i, Unused; R)
{
result.source[i] = source[i].save;
}
return result;
}
void popFront()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
source[i].popFront();
return;
}
}
@property auto ref front()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
return fixRef(source[i].front);
}
assert(false);
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
{
// @@@BUG@@@
//@property void front(T)(T v) if (is(T : RvalueElementType))
// Return type must be auto due to Bug 4706.
@property auto front(RvalueElementType v)
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
source[i].front = v;
return;
}
assert(false);
}
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveFront()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
return .moveFront(source[i]);
}
assert(false);
}
}
static if (allSatisfy!(isBidirectionalRange, R))
{
@property auto ref back()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
return fixRef(source[i].back);
}
assert(false);
}
void popBack()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
source[i].popBack();
return;
}
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveBack()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
return .moveBack(source[i]);
}
assert(false);
}
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
{
// Return type must be auto due to extremely strange bug in DMD's
// function overloading.
@property auto back(RvalueElementType v)
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
source[i].back = v;
return;
}
assert(false);
}
}
}
static if (allSatisfy!(hasLength, R))
{
@property size_t length()
{
size_t result;
foreach (i, Unused; R)
{
result += source[i].length;
}
return result;
}
alias length opDollar;
}
static if (allSatisfy!(isRandomAccessRange, R))
{
auto ref opIndex(size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
return source[i][index];
}
else
{
immutable length = source[i].length;
if (index < length) return fixRef(source[i][index]);
index -= length;
}
}
assert(false);
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveAt(size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
return .moveAt(source[i], index);
}
else
{
immutable length = source[i].length;
if (index < length) return .moveAt(source[i], index);
index -= length;
}
}
assert(false);
}
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
void opIndexAssign(ElementType v, size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
source[i][index] = v;
}
else
{
immutable length = source[i].length;
if (index < length)
{
source[i][index] = v;
return;
}
index -= length;
}
}
assert(false);
}
}
static if (allSatisfy!(hasLength, R) && allSatisfy!(hasSlicing, R))
auto opSlice(size_t begin, size_t end)
{
auto result = this;
foreach (i, Unused; R)
{
immutable len = result.source[i].length;
if (len < begin)
{
result.source[i] = result.source[i]
[len .. len];
begin -= len;
}
else
{
result.source[i] = result.source[i]
[begin .. len];
break;
}
}
auto cut = length;
cut = cut <= end ? 0 : cut - end;
foreach_reverse (i, Unused; R)
{
immutable len = result.source[i].length;
if (cut > len)
{
result.source[i] = result.source[i]
[0 .. 0];
cut -= len;
}
else
{
result.source[i] = result.source[i]
[0 .. len - cut];
break;
}
}
return result;
}
}
return Result(rs);
}
}
unittest
{
{
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
int[] arr3 = [ 7 ];
int[] witness = [ 1, 2, 3, 4, 5, 6, 7 ];
auto s1 = chain(arr1);
static assert(isRandomAccessRange!(typeof(s1)));
auto s2 = chain(arr1, arr2);
static assert(isBidirectionalRange!(typeof(s2)));
static assert(isRandomAccessRange!(typeof(s2)));
s2.front = 1;
auto s = chain(arr1, arr2, arr3);
assert(s[5] == 6);
assert(equal(s, witness));
assert(s[5] == 6);
}
{
int[] arr1 = [ 1, 2, 3, 4 ];
int[] witness = [ 1, 2, 3, 4 ];
assert(equal(chain(arr1), witness));
}
{
uint[] foo = [1,2,3,4,5];
uint[] bar = [1,2,3,4,5];
auto c = chain(foo, bar);
c[3] = 42;
assert(c[3] == 42);
assert(c.moveFront() == 1);
assert(c.moveBack() == 5);
assert(c.moveAt(4) == 5);
assert(c.moveAt(5) == 1);
}
// Make sure bug 3311 is fixed. ChainImpl should compile even if not all
// elements are mutable.
auto c = chain( iota(0, 10), iota(0, 10) );
// Test the case where infinite ranges are present.
auto inf = chain([0,1,2][], cycle([4,5,6][]), [7,8,9][]); // infinite range
assert(inf[0] == 0);
assert(inf[3] == 4);
assert(inf[6] == 4);
assert(inf[7] == 5);
static assert(isInfinite!(typeof(inf)));
immutable int[] immi = [ 1, 2, 3 ];
immutable float[] immf = [ 1, 2, 3 ];
static assert(is(typeof(chain(immi, immf))));
// Check that chain at least instantiates and compiles with every possible
// pair of DummyRange types, in either order.
foreach(DummyType1; AllDummyRanges) {
DummyType1 dummy1;
foreach(DummyType2; AllDummyRanges) {
DummyType2 dummy2;
auto myChain = chain(dummy1, dummy2);
static assert(
propagatesRangeType!(typeof(myChain), DummyType1, DummyType2)
);
assert(myChain.front == 1);
foreach(i; 0..dummyLength) {
myChain.popFront();
}
assert(myChain.front == 1);
static if (isBidirectionalRange!DummyType1 &&
isBidirectionalRange!DummyType2) {
assert(myChain.back == 10);
}
static if (isRandomAccessRange!DummyType1 &&
isRandomAccessRange!DummyType2) {
assert(myChain[0] == 1);
}
static if (hasLvalueElements!DummyType1 && hasLvalueElements!DummyType2)
{
static assert(hasLvalueElements!(typeof(myChain)));
}
else
{
static assert(!hasLvalueElements!(typeof(myChain)));
}
}
}
}
/**
$(D roundRobin(r1, r2, r3)) yields $(D r1.front), then $(D r2.front),
then $(D r3.front), after which it pops off one element from each and
continues again from $(D r1). For example, if two ranges are involved,
it alternately yields elements off the two ranges. $(D roundRobin)
stops after it has consumed all ranges (skipping over the ones that
finish early).
Example:
----
int[] a = [ 1, 2, 3, 4];
int[] b = [ 10, 20 ];
assert(equal(roundRobin(a, b), [1, 10, 2, 20, 3, 4]));
----
*/
auto roundRobin(Rs...)(Rs rs)
if (Rs.length > 1 && allSatisfy!(isInputRange, staticMap!(Unqual, Rs)))
{
struct Result
{
public Rs source;
private size_t _current = size_t.max;
@property bool empty()
{
foreach (i, Unused; Rs)
{
if (!source[i].empty) return false;
}
return true;
}
@property auto ref front()
{
static string makeSwitch()
{
string result = "switch (_current) {\n";
foreach (i, R; Rs)
{
auto si = to!string(i);
result ~= "case "~si~": "~
"assert(!source["~si~"].empty); return source["~si~"].front;\n";
}
return result ~ "default: assert(0); }";
}
mixin(makeSwitch());
}
void popFront()
{
static string makeSwitchPopFront()
{
string result = "switch (_current) {\n";
foreach (i, R; Rs)
{
auto si = to!string(i);
result ~= "case "~si~": source["~si~"].popFront(); break;\n";
}
return result ~ "default: assert(0); }";
}
static string makeSwitchIncrementCounter()
{
string result =
"auto next = _current == Rs.length - 1 ? 0 : _current + 1;\n"
"switch (next) {\n";
foreach (i, R; Rs)
{
auto si = to!string(i);
auto si_1 = to!string(i ? i - 1 : Rs.length - 1);
result ~= "case "~si~": "
"if (!source["~si~"].empty) { _current = "~si~"; return; }\n"
"if ("~si~" == _current) { _current = _current.max; return; }\n"
"goto case "~to!string((i + 1) % Rs.length)~";\n";
}
return result ~ "default: assert(0); }";
}
mixin(makeSwitchPopFront());
mixin(makeSwitchIncrementCounter());
}
static if (allSatisfy!(isForwardRange, staticMap!(Unqual, Rs)))
@property auto save()
{
Result result;
result._current = _current;
foreach (i, Unused; Rs)
{
result.source[i] = source[i].save;
}
return result;
}
static if (allSatisfy!(hasLength, Rs))
{
@property size_t length()
{
size_t result;
foreach (i, R; Rs)
{
result += source[i].length;
}
return result;
}
alias length opDollar;
}
}
return Result(rs, 0);
}
unittest
{
int[] a = [ 1, 2, 3 ];
int[] b = [ 10, 20, 30, 40 ];
auto r = roundRobin(a, b);
assert(equal(r, [ 1, 10, 2, 20, 3, 30, 40 ]));
}
/**
Iterates a random-access range starting from a given point and
progressively extending left and right from that point. If no initial
point is given, iteration starts from the middle of the
range. Iteration spans the entire range.
Example:
----
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(radial(a), [ 3, 4, 2, 5, 1 ]));
a = [ 1, 2, 3, 4 ];
assert(equal(radial(a), [ 2, 3, 1, 4 ]));
----
*/
auto radial(Range, I)(Range r, I startingIndex)
if (isRandomAccessRange!(Unqual!Range) && hasLength!(Unqual!Range) && isIntegral!I)
{
if (!r.empty) ++startingIndex;
return roundRobin(retro(r[0 .. startingIndex]), r[startingIndex .. r.length]);
}
/// Ditto
auto radial(R)(R r)
if (isRandomAccessRange!(Unqual!R) && hasLength!(Unqual!R))
{
return .radial(r, (r.length - !r.empty) / 2);
}
unittest
{
void test(int[] input, int[] witness)
{
enforce(equal(radial(input), witness),
text(radial(input), " vs. ", witness));
}
test([], []);
test([ 1 ], [ 1 ]);
test([ 1, 2 ], [ 1, 2 ]);
test([ 1, 2, 3 ], [ 2, 3, 1 ]);
test([ 1, 2, 3, 4 ], [ 2, 3, 1, 4 ]);
test([ 1, 2, 3, 4, 5 ], [ 3, 4, 2, 5, 1 ]);
test([ 1, 2, 3, 4, 5, 6 ], [ 3, 4, 2, 5, 1, 6 ]);
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(radial(a, 1), [ 2, 3, 1, 4, 5 ][]));
static assert(isForwardRange!(typeof(radial(a, 1))));
auto r = radial([1,2,3,4,5]);
for(auto rr = r.save; !rr.empty; rr.popFront())
{
assert(rr.front == moveFront(rr));
}
r.front() = 5;
assert(r.front == 5);
// Test instantiation without lvalue elements.
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random) dummy;
assert(equal(radial(dummy, 4), [5, 6, 4, 7, 3, 8, 2, 9, 1, 10]));
// immutable int[] immi = [ 1, 2 ];
// static assert(is(typeof(radial(immi))));
}
unittest
{
auto LL = iota(1L, 6L);
auto r = radial(LL);
assert(equal(r, [3L, 4L, 2L, 5L, 1L]));
}
/**
Lazily takes only up to $(D n) elements of a range. This is
particularly useful when using with infinite ranges. If the range
offers random access and $(D length), $(D Take) offers them as well.
Example:
----
int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
auto s = take(arr1, 5);
assert(s.length == 5);
assert(s[4] == 5);
assert(equal(s, [ 1, 2, 3, 4, 5 ][]));
----
*/
struct Take(Range)
if (isInputRange!(Unqual!Range)
&& !(hasSlicing!(Unqual!Range) || is(Range T == Take!T)))
{
private alias Unqual!Range R;
// User accessible in read and write
public R source;
private size_t _maxAvailable;
private enum bool byRef = is(typeof(&_input.front) == ElementType!(R)*);
alias R Source;
@property bool empty()
{
return _maxAvailable == 0 || source.empty;
}
@property auto ref front()
{
assert(!empty,
"Attempting to fetch the front of an empty "
~ Take.stringof);
return source.front;
}
void popFront()
{
assert(!empty,
"Attempting to popFront() past the end of a "
~ Take.stringof);
source.popFront();
--_maxAvailable;
}
static if (isForwardRange!R)
@property Take save()
{
return Take(source.save, _maxAvailable);
}
static if (hasAssignableElements!R)
@property auto front(ElementType!R v)
{
assert(!empty,
"Attempting to assign to the front of an empty "
~ Take.stringof);
// This has to return auto instead of void because of Bug 4706.
source.front = v;
}
static if (hasMobileElements!R)
{
auto moveFront()
{
assert(!empty,
"Attempting to move the front of an empty "
~ Take.stringof);
return .moveFront(source);
}
}
static if (isInfinite!R)
{
@property size_t length() const
{
return _maxAvailable;
}
alias length opDollar;
}
else static if (hasLength!R)
{
@property size_t length()
{
return min(_maxAvailable, source.length);
}
alias length opDollar;
}
static if (isRandomAccessRange!R)
{
void popBack()
{
assert(!empty,
"Attempting to popBack() past the beginning of a "
~ Take.stringof);
--_maxAvailable;
}
@property auto ref back()
{
assert(!empty,
"Attempting to fetch the back of an empty "
~ Take.stringof);
return source[this.length - 1];
}
auto ref opIndex(size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
return source[index];
}
static if (hasAssignableElements!R)
{
auto back(ElementType!R v)
{
// This has to return auto instead of void because of Bug 4706.
assert(!empty,
"Attempting to assign to the back of an empty "
~ Take.stringof);
source[this.length - 1] = v;
}
void opIndexAssign(ElementType!R v, size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
source[index] = v;
}
}
static if (hasMobileElements!R)
{
auto moveBack()
{
assert(!empty,
"Attempting to move the back of an empty "
~ Take.stringof);
return .moveAt(source, this.length - 1);
}
auto moveAt(size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
return .moveAt(source, index);
}
}
}
// Nonstandard
@property size_t maxLength() const
{
return _maxAvailable;
}
}
// This template simply aliases itself to R and is useful for consistency in
// generic code.
template Take(R)
if (isInputRange!(Unqual!R) && (hasSlicing!(Unqual!R) || is(R T == Take!T)))
{
alias R Take;
}
// take for ranges with slicing (finite or infinite)
/// ditto
Take!R take(R)(R input, size_t n)
if (isInputRange!(Unqual!R) && hasSlicing!(Unqual!R))
{
static if (hasLength!R)
{
// @@@BUG@@@
//return input[0 .. min(n, $)];
return input[0 .. min(n, input.length)];
}
else
{
static assert(isInfinite!R,
"Nonsensical finite range with slicing but no length");
return input[0 .. n];
}
}
// take(take(r, n1), n2)
Take!(R) take(R)(R input, size_t n)
if (is(R T == Take!T))
{
return R(input.source, min(n, input._maxAvailable));
}
// Regular take for input ranges
Take!(R) take(R)(R input, size_t n)
if (isInputRange!(Unqual!R) && !hasSlicing!(Unqual!R) && !is(R T == Take!T))
{
return Take!R(input, n);
}
unittest
{
int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
auto s = take(arr1, 5);
assert(s.length == 5);
assert(s[4] == 5);
assert(equal(s, [ 1, 2, 3, 4, 5 ][]));
assert(equal(retro(s), [ 5, 4, 3, 2, 1 ][]));
// Test fix for bug 4464.
static assert(is(typeof(s) == Take!(int[])));
static assert(is(typeof(s) == int[]));
// Test using narrow strings.
auto myStr = "This is a string.";
auto takeMyStr = take(myStr, 7);
assert(equal(takeMyStr, "This is"));
// Test fix for bug 5052.
auto takeMyStrAgain = take(takeMyStr, 4);
assert(equal(takeMyStrAgain, "This"));
static assert (is (typeof(takeMyStrAgain) == typeof(takeMyStr)));
takeMyStrAgain = take(takeMyStr, 10);
assert(equal(takeMyStrAgain, "This is"));
foreach(DummyType; AllDummyRanges) {
DummyType dummy;
auto t = take(dummy, 5);
alias typeof(t) T;
static if (isRandomAccessRange!DummyType) {
static assert(isRandomAccessRange!T);
assert(t[4] == 5);
assert(moveAt(t, 1) == t[1]);
assert(t.back == moveBack(t));
} else static if (isForwardRange!DummyType) {
static assert(isForwardRange!T);
}
for(auto tt = t; !tt.empty; tt.popFront())
{
assert(tt.front == moveFront(tt));
}
// Bidirectional ranges can't be propagated properly if they don't
// also have random access.
assert(equal(t, [1,2,3,4,5]));
}
immutable myRepeat = repeat(1);
static assert(is(Take!(typeof(myRepeat))));
}
unittest
{
// Check that one can declare variables of all Take types,
// and that they match the return type of the corresponding
// take(). (See issue 4464.)
int[] r1;
Take!(int[]) t1;
t1 = take(r1, 1);
string r2;
Take!string t2;
t2 = take(r2, 1);
Take!(Take!string) t3;
t3 = take(t2, 1);
}
/**
Similar to $(LREF take), but assumes that $(D range) has at least $(D
n) elements. Consequently, the result of $(D takeExactly(range, n))
always defines the $(D length) property (and initializes it to $(D n))
even when $(D range) itself does not define $(D length).
If $(D R) has slicing, $(D takeExactly) simply returns a slice of $(D
range). Otherwise if $(D R) is an input range, the type of the result
is an input range with length. Finally, if $(D R) is a forward range
(including bidirectional), the type of the result is a forward range
with length.
*/
auto takeExactly(R)(R range, size_t n)
if (isInputRange!R && !hasSlicing!R)
{
static if (is(typeof(takeExactly(range._input, n)) == R))
{
// takeExactly(takeExactly(r, n1), n2) has the same type as
// takeExactly(r, n1) and simply returns takeExactly(r, n2)
range._n = n;
return range;
}
else
{
static struct Result
{
R _input;
private size_t _n;
@property bool empty() const { return !_n; }
@property auto ref front()
{
assert(_n > 0, "front() on an empty " ~ Result.stringof);
return _input.front();
}
void popFront() { _input.popFront(); --_n; }
@property size_t length() const { return _n; }
alias length opDollar;
static if (isForwardRange!R)
@property auto save() { return this; }
}
return Result(range, n);
}
}
auto takeExactly(R)(R range, size_t n)
if (hasSlicing!R)
{
return range[0 .. n];
}
unittest
{
auto a = [ 1, 2, 3, 4, 5 ];
auto b = takeExactly(a, 3);
assert(equal(b, [1, 2, 3]));
static assert(is(typeof(b.length) == size_t));
assert(b.length == 3);
assert(b.front == 1);
assert(b.back == 3);
auto c = takeExactly(b, 2);
auto d = filter!"a > 0"(a);
auto e = takeExactly(d, 3);
assert(equal(e, [1, 2, 3]));
static assert(is(typeof(e.length) == size_t));
assert(e.length == 3);
assert(e.front == 1);
assert(equal(takeExactly(e, 4), [1, 2, 3, 4]));
// b[1]++;
}
/**
Returns a range with at most one element; for example, $(D
takeOne([42, 43, 44])) returns a range consisting of the integer $(D
42). Calling $(D popFront()) off that range renders it empty.
----
auto s = takeOne([42, 43, 44]);
static assert(isRandomAccessRange!(typeof(s)));
assert(s.length == 1);
assert(!s.empty);
assert(s.front == 42);
s.front() = 43;
assert(s.front == 43);
assert(s.back == 43);
assert(s[0] == 43);
s.popFront();
assert(s.length == 0);
assert(s.empty);
----
In effect $(D takeOne(r)) is somewhat equivalent to $(D take(r, 1)) but in
certain interfaces it is important to know statically that the range may only
have at most one element.
The type returned by $(D takeOne) is a random-access range with length
regardless of $(D R)'s capabilities (another feature that distinguishes
$(D takeOne) from $(D take)).
*/
auto takeOne(R)(R source) if (isInputRange!R)
{
static if (hasSlicing!R)
{
return source[0 .. !source.empty];
}
else
{
static struct Result
{
private R _source;
private bool _empty = true;
@property bool empty() const { return _empty; }
@property auto ref front() { assert(!empty); return _source.front; }
void popFront() { assert(!empty); _empty = true; }
void popBack() { assert(!empty); _empty = true; }
@property auto save() { return Result(_source.save, empty); }
@property auto ref back() { assert(!empty); return _source.front; }
@property size_t length() const { return !empty; }
alias length opDollar;
auto ref opIndex(size_t n) { assert(n < length); return _source.front; }
auto opSlice(size_t m, size_t n)
{
assert(m <= n && n < length);
return n > m ? this : Result(_source, false);
}
// Non-standard property
@property R source() { return _source; }
}
return Result(source, source.empty);
}
}
unittest
{
auto s = takeOne([42, 43, 44]);
static assert(isRandomAccessRange!(typeof(s)));
assert(s.length == 1);
assert(!s.empty);
assert(s.front == 42);
s.front = 43;
assert(s.front == 43);
assert(s.back == 43);
assert(s[0] == 43);
s.popFront();
assert(s.length == 0);
assert(s.empty);
}
/++
Returns an empty range which is statically known to be empty and is
guaranteed to have $(D length) and be random access regardless of $(D R)'s
capabilities.
Examples:
--------------------
auto range = takeNone!(int[])();
assert(range.length == 0);
assert(range.empty);
--------------------
+/
auto takeNone(R)()
if(isInputRange!R)
{
return typeof(takeOne(R.init)).init;
}
unittest
{
auto range = takeNone!(int[])();
assert(range.length == 0);
assert(range.empty);
enum ctfe = takeNone!(int[])();
static assert(ctfe.length == 0);
static assert(ctfe.empty);
}
/++
Creates an empty range from the given range in $(BIGOH 1). If it can, it
will return the same range type. If not, it will return
$(D takeExactly(range, 0)).
Examples:
--------------------
assert(takeNone([42, 27, 19]).empty);
assert(takeNone("dlang.org").empty);
assert(takeNone(filter!"true"([42, 27, 19])).empty);
--------------------
+/
auto takeNone(R)(R range)
if(isInputRange!R)
{
//Makes it so that calls to takeNone which don't use UFCS still work with a
//member version if it's defined.
static if(is(typeof(R.takeNone)))
auto retval = range.takeNone();
//@@@BUG@@@ 8339
else static if(isDynamicArray!R)/+ ||
(is(R == struct) && __traits(compiles, {auto r = R.init;}) && R.init.empty))+/
{
auto retval = R.init;
}
//An infinite range sliced at [0 .. 0] would likely still not be empty...
else static if(hasSlicing!R && !isInfinite!R)
auto retval = range[0 .. 0];
else
auto retval = takeExactly(range, 0);
//@@@BUG@@@ 7892 prevents this from being done in an out block.
assert(retval.empty);
return retval;
}
//Verify Examples.
unittest
{
assert(takeNone([42, 27, 19]).empty);
assert(takeNone("dlang.org").empty);
assert(takeNone(filter!"true"([42, 27, 19])).empty);
}
unittest
{
import std.metastrings;
string genInput()
{
return "@property bool empty() { return _arr.empty; }" ~
"@property auto front() { return _arr.front; }" ~
"void popFront() { _arr.popFront(); }" ~
"static assert(isInputRange!(typeof(this)));";
}
static struct NormalStruct
{
//Disabled to make sure that the takeExactly version is used.
@disable this();
this(int[] arr) { _arr = arr; }
mixin(genInput());
int[] _arr;
}
static struct SliceStruct
{
@disable this();
this(int[] arr) { _arr = arr; }
mixin(genInput());
auto opSlice(size_t i, size_t j) { return typeof(this)(_arr[i .. j]); }
int[] _arr;
}
static struct InitStruct
{
mixin(genInput());
int[] _arr;
}
static struct TakeNoneStruct
{
this(int[] arr) { _arr = arr; }
@disable this();
mixin(genInput());
auto takeNone() { return typeof(this)(null); }
int[] _arr;
}
static class NormalClass
{
this(int[] arr) {_arr = arr;}
mixin(genInput());
int[] _arr;
}
static class SliceClass
{
this(int[] arr) { _arr = arr; }
mixin(genInput());
auto opSlice(size_t i, size_t j) { return new typeof(this)(_arr[i .. j]); }
int[] _arr;
}
static class TakeNoneClass
{
this(int[] arr) { _arr = arr; }
mixin(genInput());
auto takeNone() { return new typeof(this)(null); }
int[] _arr;
}
foreach(range; TypeTuple!(`[1, 2, 3, 4, 5]`,
`"hello world"`,
`"hello world"w`,
`"hello world"d`,
`SliceStruct([1, 2, 3])`,
//@@@BUG@@@ 8339 forces this to be takeExactly
//`InitStruct([1, 2, 3])`,
`TakeNoneStruct([1, 2, 3])`))
{
mixin(Format!("enum a = takeNone(%s).empty;", range));
assert(a, typeof(range).stringof);
mixin(Format!("assert(takeNone(%s).empty);", range));
mixin(Format!("static assert(is(typeof(%s) == typeof(takeNone(%s))), typeof(%s).stringof);",
range, range, range));
}
foreach(range; TypeTuple!(`NormalStruct([1, 2, 3])`,
`InitStruct([1, 2, 3])`))
{
mixin(Format!("enum a = takeNone(%s).empty;", range));
assert(a, typeof(range).stringof);
mixin(Format!("assert(takeNone(%s).empty);", range));
mixin(Format!("static assert(is(typeof(takeExactly(%s, 0)) == typeof(takeNone(%s))), typeof(%s).stringof);",
range, range, range));
}
//Don't work in CTFE.
auto normal = new NormalClass([1, 2, 3]);
assert(takeNone(normal).empty);
static assert(is(typeof(takeExactly(normal, 0)) == typeof(takeNone(normal))), typeof(normal).stringof);
auto slice = new SliceClass([1, 2, 3]);
assert(takeNone(slice).empty);
static assert(is(SliceClass == typeof(takeNone(slice))), typeof(slice).stringof);
auto taken = new TakeNoneClass([1, 2, 3]);
assert(takeNone(taken).empty);
static assert(is(TakeNoneClass == typeof(takeNone(taken))), typeof(taken).stringof);
auto filtered = filter!"true"([1, 2, 3, 4, 5]);
assert(takeNone(filtered).empty);
//@@@BUG@@@ 8339 and 5941 force this to be takeExactly
//static assert(is(typeof(filtered) == typeof(takeNone(filtered))), typeof(filtered).stringof);
}
/++
Convenience function which calls $(D $(LREF popFrontN)(range, n)) and
returns $(D range).
Examples:
--------------------
assert(drop([0, 2, 1, 5, 0, 3], 3) == [5, 0, 3]);
assert(drop("hello world", 6) == "world");
assert(drop("hello world", 50).empty);
assert(equal(drop(take("hello world", 6), 3), "lo "));
--------------------
+/
R drop(R)(R range, size_t n)
if(isInputRange!R)
{
popFrontN(range, n);
return range;
}
//Verify Examples
unittest
{
assert(drop([0, 2, 1, 5, 0, 3], 3) == [5, 0, 3]);
assert(drop("hello world", 6) == "world");
assert(drop("hello world", 50).empty);
assert(equal(drop(take("hello world", 6), 3), "lo "));
}
unittest
{
assert(drop("", 5).empty);
assert(equal(drop(filter!"true"([0, 2, 1, 5, 0, 3]), 3), [5, 0, 3]));
}
/**
Eagerly advances $(D r) itself (not a copy) up to $(D n) times (by calling
$(D r.popFront) at most $(D n) times). The pass of $(D r) into $(D
popFrontN) is by reference, so the original range is
affected. Completes in $(BIGOH 1) steps for ranges that have both length
and support slicing, and in $(BIGOH n) time for all other ranges.
Returns:
How much $(D r) was actually advanced, which may be less than $(D n) if $(D r) did not have $(D n) element.
Example:
----
int[] a = [ 1, 2, 3, 4, 5 ];
a.popFrontN(2);
assert(a == [ 3, 4, 5 ]);
----
*/
size_t popFrontN(Range)(ref Range r, size_t n) if (isInputRange!(Range))
{
static if (hasSlicing!Range && hasLength!Range)
{
n = min(n, r.length);
r = r[n .. r.length];
}
else
{
static if (hasLength!Range)
{
n = min(n, r.length);
foreach (i; 0 .. n)
{
r.popFront();
}
}
else
{
foreach (i; 0 .. n)
{
if (r.empty) return i;
r.popFront();
}
}
}
return n;
}
unittest
{
int[] a = [ 1, 2, 3, 4, 5 ];
a.popFrontN(2);
assert(a == [ 3, 4, 5 ]);
}
/**
Eagerly reduces $(D r) itself (not a copy) up to $(D n) times from its right
side (by calling $(D r.popBack) $(D n) times). The pass of $(D r) into
$(D popBackN) is by reference, so the original range is
affected. Completes in $(BIGOH 1) steps for ranges that have both length
and support slicing, and in $(BIGOH n) time for all other ranges.
Returns:
The actual number of elements popped, which may be less than $(D n) if $(D r) did not have $(D n) element.
Example:
----
int[] a = [ 1, 2, 3, 4, 5 ];
a.popBackN(2);
assert(a == [ 1, 2, 3 ]);
----
*/
size_t popBackN(Range)(ref Range r, size_t n) if (isInputRange!(Range))
{
static if (hasSlicing!(Range) && hasLength!(Range))
{
n = cast(size_t) min(n, r.length);
auto newLen = r.length - n;
r = r[0 .. newLen];
}
else
{
foreach (i; 0 .. n)
{
if (r.empty) return i;
r.popBack();
}
}
return n;
}
unittest
{
int[] a = [ 1, 2, 3, 4, 5 ];
a.popBackN(2);
assert(a == [ 1, 2, 3 ]);
}
unittest
{
auto LL = iota(1L, 7L);
auto r = popBackN(LL, 2);
assert(equal(LL, [1L, 2L, 3L, 4L]));
assert(r == 2);
}
/**
Repeats one value forever.
Example:
----
enforce(equal(take(repeat(5), 4), [ 5, 5, 5, 5 ][]));
----
*/
struct Repeat(T)
{
private T _value;
/// Range primitive implementations.
@property T front() { return _value; }
/// Ditto
@property T back() { return _value; }
/// Ditto
enum bool empty = false;
/// Ditto
void popFront() {}
/// Ditto
void popBack() {}
/// Ditto
@property Repeat!T save() { return this; }
/// Ditto
T opIndex(size_t) { return _value; }
}
/// Ditto
Repeat!(T) repeat(T)(T value) { return Repeat!(T)(value); }
unittest
{
enforce(equal(take(repeat(5), 4), [ 5, 5, 5, 5 ][]));
static assert(isForwardRange!(Repeat!(uint)));
}
/**
Repeats $(D value) exactly $(D n) times. Equivalent to $(D
take(repeat(value), n)).
*/
Take!(Repeat!T) repeat(T)(T value, size_t n)
{
return take(repeat(value), n);
}
/++
$(RED Deprecated. It will be removed in January 2013.
Please use $(LREF repeat) instead.)
+/
deprecated Take!(Repeat!T) replicate(T)(T value, size_t n)
{
return repeat(value, n);
}
unittest
{
enforce(equal(repeat(5, 4), [ 5, 5, 5, 5 ][]));
}
/**
Repeats the given forward range ad infinitum. If the original range is
infinite (fact that would make $(D Cycle) the identity application),
$(D Cycle) detects that and aliases itself to the range type
itself. If the original range has random access, $(D Cycle) offers
random access and also offers a constructor taking an initial position
$(D index). $(D Cycle) is specialized for statically-sized arrays,
mostly for performance reasons.
Example:
----
assert(equal(take(cycle([1, 2][]), 5), [ 1, 2, 1, 2, 1 ][]));
----
Tip: This is a great way to implement simple circular buffers.
*/
struct Cycle(Range)
if (isForwardRange!(Unqual!Range) && !isInfinite!(Unqual!Range))
{
alias Unqual!Range R;
static if (isRandomAccessRange!R && hasLength!R)
{
R _original;
size_t _index;
this(R input, size_t index = 0) { _original = input; _index = index; }
@property auto ref front()
{
return _original[_index % _original.length];
}
static if (is(typeof((cast(const R)_original)[0])) &&
is(typeof((cast(const R)_original).length)))
{
@property auto const ref front() const
{
return _original[_index % _original.length];
}
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
_original[_index % _original.length] = val;
}
}
enum bool empty = false;
void popFront() { ++_index; }
auto ref opIndex(size_t n)
{
return _original[(n + _index) % _original.length];
}
static if (is(typeof((cast(const R)_original)[0])) &&
is(typeof((cast(const R)_original).length)))
{
const ref opIndex(size_t n) const
{
return _original[(n + _index) % _original.length];
}
}
static if (hasAssignableElements!R)
{
auto opIndexAssign(ElementType!R val, size_t n)
{
_original[(n + _index) % _original.length] = val;
}
}
@property Cycle!R save()
{
return Cycle!R(this._original.save, this._index);
}
}
else
{
R _original;
R _current;
this(R input) { _original = input; _current = input.save; }
@property auto ref front() { return _current.front; }
static if (is(typeof((cast(const R)_current).front)))
@property auto const ref front() const
{
return _current.front;
}
static if (hasAssignableElements!R)
{
@property auto front(ElementType!R val)
{
return _current.front = val;
}
}
enum bool empty = false;
void popFront()
{
_current.popFront();
if (_current.empty) _current = _original;
}
@property Cycle!R save()
{
Cycle!R ret;
ret._original = this._original.save;
ret._current = this._current.save;
return ret;
}
}
}
template Cycle(R)
if (isInfinite!R)
{
alias R Cycle;
}
struct Cycle(R)
if (isStaticArray!R)
{
private alias typeof(R[0]) ElementType;
private ElementType* _ptr;
private size_t _index;
this(ref R input, size_t index = 0)
{
_ptr = input.ptr;
_index = index;
}
@property auto ref inout(ElementType) front() inout
{
return _ptr[_index % R.length];
}
enum bool empty = false;
void popFront() { ++_index; }
ref inout(ElementType) opIndex(size_t n) inout
{
return _ptr[(n + _index) % R.length];
}
@property Cycle!R save()
{
return this;
}
}
/// Ditto
Cycle!R cycle(R)(R input)
if (isForwardRange!(Unqual!R) && !isInfinite!(Unqual!R))
{
return Cycle!R(input);
}
/// Ditto
Cycle!R cycle(R)(R input, size_t index = 0)
if (isRandomAccessRange!(Unqual!R) && !isInfinite!(Unqual!R))
{
return Cycle!R(input, index);
}
Cycle!R cycle(R)(R input)
if (isInfinite!R)
{
return input;
}
Cycle!R cycle(R)(ref R input, size_t index = 0)
if (isStaticArray!R)
{
return Cycle!R(input, index);
}
unittest
{
assert(equal(take(cycle([1, 2][]), 5), [ 1, 2, 1, 2, 1 ][]));
static assert(isForwardRange!(Cycle!(uint[])));
int[3] a = [ 1, 2, 3 ];
static assert(isStaticArray!(typeof(a)));
auto c = cycle(a);
assert(a.ptr == c._ptr);
assert(equal(take(cycle(a), 5), [ 1, 2, 3, 1, 2 ][]));
static assert(isForwardRange!(typeof(c)));
// Make sure ref is getting propagated properly.
int[] nums = [1,2,3];
auto c2 = cycle(nums);
c2[3]++;
assert(nums[0] == 2);
static assert(is(Cycle!(immutable int[])));
foreach(DummyType; AllDummyRanges)
{
static if (isForwardRange!DummyType)
{
DummyType dummy;
auto cy = cycle(dummy);
static assert(isForwardRange!(typeof(cy)));
auto t = take(cy, 20);
assert(equal(t, [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10]));
const cRange = cy;
assert(cRange.front == 1);
static if (hasAssignableElements!DummyType)
{
{
cy.front = 66;
scope(exit) cy.front = 1;
assert(dummy.front == 66);
}
static if (isRandomAccessRange!DummyType)
{
{
cy[10] = 66;
scope(exit) cy[10] = 1;
assert(dummy.front == 66);
}
assert(cRange[10] == 1);
}
}
}
}
}
unittest // For infinite ranges
{
struct InfRange
{
void popFront() { }
@property int front() { return 0; }
enum empty = false;
}
InfRange i;
auto c = cycle(i);
assert (c == i);
}
private template lengthType(R) { alias typeof({ R r = void; return r.length; }()) lengthType; }
/**
Iterate several ranges in lockstep. The element type is a proxy tuple
that allows accessing the current element in the $(D n)th range by
using $(D e[n]).
Example:
----
int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "b", "c" ];
// prints 1:a 2:b 3:c
foreach (e; zip(a, b))
{
write(e[0], ':', e[1], ' ');
}
----
$(D Zip) offers the lowest range facilities of all components, e.g. it
offers random access iff all ranges offer random access, and also
offers mutation and swapping if all ranges offer it. Due to this, $(D
Zip) is extremely powerful because it allows manipulating several
ranges in lockstep. For example, the following code sorts two arrays
in parallel:
----
int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "b", "c" ];
sort!("a[0] > b[0]")(zip(a, b));
assert(a == [ 3, 2, 1 ]);
assert(b == [ "c", "b", "a" ]);
----
*/
struct Zip(Ranges...)
if(Ranges.length && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)))
{
alias staticMap!(Unqual, Ranges) R;
Tuple!R ranges;
alias Tuple!(staticMap!(.ElementType, R)) ElementType;
StoppingPolicy stoppingPolicy = StoppingPolicy.shortest;
/**
Builds an object. Usually this is invoked indirectly by using the
$(LREF zip) function.
*/
this(R rs, StoppingPolicy s = StoppingPolicy.shortest)
{
stoppingPolicy = s;
foreach (i, Unused; R)
{
ranges[i] = rs[i];
}
}
/**
Returns $(D true) if the range is at end. The test depends on the
stopping policy.
*/
static if (allSatisfy!(isInfinite, R))
{
// BUG: Doesn't propagate infiniteness if only some ranges are infinite
// and s == StoppingPolicy.longest. This isn't fixable in the
// current design since StoppingPolicy is known only at runtime.
enum bool empty = false;
}
else
{
@property bool empty()
{
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
if (ranges[i].empty) return true;
}
return false;
case StoppingPolicy.longest:
foreach (i, Unused; R)
{
if (!ranges[i].empty) return false;
}
return true;
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R[1 .. $])
{
enforce(ranges[0].empty ==
ranges.field[i + 1].empty,
"Inequal-length ranges passed to Zip");
}
return ranges[0].empty;
}
assert(false);
}
}
static if (allSatisfy!(isForwardRange, R))
@property Zip save()
{
Zip result;
result.stoppingPolicy = stoppingPolicy;
foreach (i, Unused; R)
{
result.ranges[i] = ranges[i].save;
}
return result;
}
/**
Returns the current iterated element.
*/
@property ElementType front()
{
ElementType result = void;
foreach (i, Unused; R)
{
auto addr = cast(Unqual!(typeof(result[i]))*) &result[i];
if (ranges[i].empty)
{
emplace(addr);
}
else
{
emplace(addr, ranges[i].front);
}
}
return result;
}
static if (allSatisfy!(hasAssignableElements, R))
{
/**
Sets the front of all iterated ranges.
*/
@property void front(ElementType v)
{
foreach (i, Unused; R)
{
if (!ranges[i].empty)
{
ranges[i].front = v[i];
}
}
}
}
/**
Moves out the front.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveFront()
{
ElementType result = void;
foreach (i, Unused; R)
{
auto addr = cast(Unqual!(typeof(result[i]))*) &result[i];
if (!ranges[i].empty)
{
emplace(addr, .moveFront(ranges[i]));
}
else
{
emplace(addr);
}
}
return result;
}
}
/**
Returns the rightmost element.
*/
static if (allSatisfy!(isBidirectionalRange, R))
{
@property ElementType back()
{
ElementType result = void;
foreach (i, Unused; R)
{
auto addr = cast(Unqual!(typeof(result[i]))*) &result[i];
if (!ranges[i].empty)
{
emplace(addr, ranges[i].back);
}
else
{
emplace(addr);
}
}
return result;
}
/**
Moves out the back.
*/
static if (allSatisfy!(hasMobileElements, R))
{
@property ElementType moveBack()
{
ElementType result = void;
foreach (i, Unused; R)
{
auto addr = cast(Unqual!(typeof(result[i]))*) &result[i];
if (!ranges[i].empty)
{
emplace(addr, .moveBack(ranges[i]));
}
else
{
emplace(addr);
}
}
return result;
}
}
/**
Returns the current iterated element.
*/
static if (allSatisfy!(hasAssignableElements, R))
{
@property void back(ElementType v)
{
foreach (i, Unused; R)
{
if (!ranges[i].empty)
{
ranges[i].back = v[i];
}
}
}
}
}
/**
Advances to the next element in all controlled ranges.
*/
void popFront()
{
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
assert(!ranges[i].empty);
ranges[i].popFront();
}
break;
case StoppingPolicy.longest:
foreach (i, Unused; R)
{
if (!ranges[i].empty) ranges[i].popFront();
}
break;
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R)
{
enforce(!ranges[i].empty, "Invalid Zip object");
ranges[i].popFront();
}
break;
}
}
static if (allSatisfy!(isBidirectionalRange, R))
/**
Calls $(D popBack) for all controlled ranges.
*/
void popBack()
{
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
assert(!ranges[i].empty);
ranges[i].popBack();
}
break;
case StoppingPolicy.longest:
foreach (i, Unused; R)
{
if (!ranges[i].empty) ranges[i].popBack();
}
break;
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R)
{
enforce(!ranges[i].empty, "Invalid Zip object");
ranges[i].popBack();
}
break;
}
}
/**
Returns the length of this range. Defined only if all ranges define
$(D length).
*/
static if (allSatisfy!(hasLength, R))
{
@property auto length()
{
CommonType!(staticMap!(lengthType, R)) result = ranges[0].length;
if (stoppingPolicy == StoppingPolicy.requireSameLength)
return result;
foreach (i, Unused; R[1 .. $])
{
if (stoppingPolicy == StoppingPolicy.shortest)
{
result = min(ranges.field[i + 1].length, result);
}
else
{
assert(stoppingPolicy == StoppingPolicy.longest);
result = max(ranges.field[i + 1].length, result);
}
}
return result;
}
alias length opDollar;
}
/**
Returns a slice of the range. Defined only if all range define
slicing.
*/
static if (allSatisfy!(hasSlicing, R))
Zip opSlice(size_t from, size_t to)
{
Zip result = void;
emplace(&result.stoppingPolicy, stoppingPolicy);
foreach (i, Unused; R)
{
emplace(&result.ranges[i], ranges[i][from .. to]);
}
return result;
}
static if (allSatisfy!(isRandomAccessRange, R))
{
/**
Returns the $(D n)th element in the composite range. Defined if all
ranges offer random access.
*/
ElementType opIndex(size_t n)
{
ElementType result = void;
foreach (i, Range; R)
{
auto addr = cast(Unqual!(typeof(result[i]))*) &result[i];
emplace(addr, ranges[i][n]);
}
return result;
}
static if (allSatisfy!(hasAssignableElements, R))
{
/**
Assigns to the $(D n)th element in the composite range. Defined if
all ranges offer random access.
*/
void opIndexAssign(ElementType v, size_t n)
{
foreach (i, Range; R)
{
ranges[i][n] = v[i];
}
}
}
/**
Destructively reads the $(D n)th element in the composite
range. Defined if all ranges offer random access.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveAt(size_t n)
{
ElementType result = void;
foreach (i, Range; R)
{
auto addr = cast(Unqual!(typeof(result[i]))*) &result[i];
emplace(addr, .moveAt(ranges[i], n));
}
return result;
}
}
}
}
/// Ditto
auto zip(R...)(R ranges)
if (allSatisfy!(isInputRange, staticMap!(Unqual, R)))
{
return Zip!R(ranges);
}
/// Ditto
auto zip(R...)(StoppingPolicy sp, R ranges)
if (allSatisfy!(isInputRange, staticMap!(Unqual, R)))
{
return Zip!R(ranges, sp);
}
/**
Dictates how iteration in a $(D Zip) should stop. By default stop at
the end of the shortest of all ranges.
*/
enum StoppingPolicy
{
/// Stop when the shortest range is exhausted
shortest,
/// Stop when the longest range is exhausted
longest,
/// Require that all ranges are equal
requireSameLength,
}
unittest
{
int[] a = [ 1, 2, 3 ];
float[] b = [ 1.0, 2.0, 3.0 ];
foreach (e; zip(a, b))
{
assert(e[0] == e[1]);
}
swap(a[0], a[1]);
auto z = zip(a, b);
//swap(z.front(), z.back());
sort!("a[0] < b[0]")(zip(a, b));
assert(a == [1, 2, 3]);
assert(b == [2.0, 1.0, 3.0]);
z = zip(StoppingPolicy.requireSameLength, a, b);
assertNotThrown((z.popBack(), z.popBack(), z.popBack()));
assert(z.empty);
assertThrown(z.popBack());
a = [ 1, 2, 3 ];
b = [ 1.0, 2.0, 3.0 ];
sort!("a[0] > b[0]")(zip(StoppingPolicy.requireSameLength, a, b));
assert(a == [3, 2, 1]);
assert(b == [3.0, 2.0, 1.0]);
a = [];
b = [];
assert(zip(StoppingPolicy.requireSameLength, a, b).empty);
// Test infiniteness propagation.
static assert(isInfinite!(typeof(zip(repeat(1), repeat(1)))));
// Test stopping policies with both value and reference.
auto a1 = [1, 2];
auto a2 = [1, 2, 3];
auto stuff = tuple(tuple(a1, a2),
tuple(filter!"a"(a1), filter!"a"(a2)));
alias Zip!(immutable int[], immutable float[]) FOO;
foreach(t; stuff.expand) {
auto arr1 = t[0];
auto arr2 = t[1];
auto zShortest = zip(arr1, arr2);
assert(equal(map!"a[0]"(zShortest), [1, 2]));
assert(equal(map!"a[1]"(zShortest), [1, 2]));
try {
auto zSame = zip(StoppingPolicy.requireSameLength, arr1, arr2);
foreach(elem; zSame) {}
assert(0);
} catch { /* It's supposed to throw.*/ }
auto zLongest = zip(StoppingPolicy.longest, arr1, arr2);
assert(!zLongest.ranges[0].empty);
assert(!zLongest.ranges[1].empty);
zLongest.popFront();
zLongest.popFront();
assert(!zLongest.empty);
assert(zLongest.ranges[0].empty);
assert(!zLongest.ranges[1].empty);
zLongest.popFront();
assert(zLongest.empty);
}
// Doesn't work yet. Issues w/ emplace.
// static assert(is(Zip!(immutable int[], immutable float[])));
// These unittests pass, but make the compiler consume an absurd amount
// of RAM and time. Therefore, they should only be run if explicitly
// uncommented when making changes to Zip. Also, running them using
// make -fwin32.mak unittest makes the compiler completely run out of RAM.
// You need to test just this module.
/+
foreach(DummyType1; AllDummyRanges) {
DummyType1 d1;
foreach(DummyType2; AllDummyRanges) {
DummyType2 d2;
auto r = zip(d1, d2);
assert(equal(map!"a[0]"(r), [1,2,3,4,5,6,7,8,9,10]));
assert(equal(map!"a[1]"(r), [1,2,3,4,5,6,7,8,9,10]));
static if (isForwardRange!DummyType1 && isForwardRange!DummyType2) {
static assert(isForwardRange!(typeof(r)));
}
static if (isBidirectionalRange!DummyType1 &&
isBidirectionalRange!DummyType2) {
static assert(isBidirectionalRange!(typeof(r)));
}
static if (isRandomAccessRange!DummyType1 &&
isRandomAccessRange!DummyType2) {
static assert(isRandomAccessRange!(typeof(r)));
}
}
}
+/
}
unittest
{
auto a = [5,4,3,2,1];
auto b = [3,1,2,5,6];
auto z = zip(a, b);
sort!"a[0] < b[0]"(z);
assert(a == [1, 2, 3, 4, 5]);
assert(b == [6, 5, 2, 1, 3]);
}
unittest
{
auto LL = iota(1L, 1000L);
auto z = zip(LL, [4]);
assert(equal(z, [tuple(1L,4)]));
auto LL2 = iota(0L, 500L);
auto z2 = zip([7], LL2);
assert(equal(z2, [tuple(7, 0L)]));
}
/* CTFE function to generate opApply loop for Lockstep.*/
private string lockstepApply(Ranges...)(bool withIndex) if (Ranges.length > 0)
{
// Since there's basically no way to make this code readable as-is, I've
// included formatting to make the generated code look "normal" when
// printed out via pragma(msg).
string ret = "int opApply(scope int delegate(";
if (withIndex)
{
ret ~= "size_t, ";
}
foreach (ti, Type; Ranges)
{
static if(hasLvalueElements!Type)
{
ret ~= "ref ";
}
ret ~= "ElementType!(Ranges[" ~ to!string(ti) ~ "]), ";
}
// Remove trailing ,
ret = ret[0..$ - 2];
ret ~= ") dg) {\n";
// Shallow copy _ranges to be consistent w/ regular foreach.
ret ~= "\tauto ranges = _ranges;\n";
ret ~= "\tint res;\n";
if (withIndex)
{
ret ~= "\tsize_t index = 0;\n";
}
// Check for emptiness.
ret ~= "\twhile("; //someEmpty) {\n";
foreach(ti, Unused; Ranges)
{
ret ~= "!ranges[" ~ to!string(ti) ~ "].empty && ";
}
// Strip trailing &&
ret = ret[0..$ - 4];
ret ~= ") {\n";
// Create code to call the delegate.
ret ~= "\t\tres = dg(";
if (withIndex)
{
ret ~= "index, ";
}
foreach(ti, Range; Ranges)
{
ret ~= "ranges[" ~ to!string(ti) ~ "].front, ";
}
// Remove trailing ,
ret = ret[0..$ - 2];
ret ~= ");\n";
ret ~= "\t\tif(res) break;\n";
foreach(ti, Range; Ranges)
{
ret ~= "\t\tranges[" ~ to!(string)(ti) ~ "].popFront();\n";
}
if (withIndex)
{
ret ~= "\t\tindex++;\n";
}
ret ~= "\t}\n";
ret ~= "\tif(_s == StoppingPolicy.requireSameLength) {\n";
ret ~= "\t\tforeach(range; ranges)\n";
ret ~= "\t\t\tenforce(range.empty);\n";
ret ~= "\t}\n";
ret ~= "\treturn res;\n}";
return ret;
}
/**
Iterate multiple ranges in lockstep using a $(D foreach) loop. If only a single
range is passed in, the $(D Lockstep) aliases itself away. If the
ranges are of different lengths and $(D s) == $(D StoppingPolicy.shortest)
stop after the shortest range is empty. If the ranges are of different
lengths and $(D s) == $(D StoppingPolicy.requireSameLength), throw an
exception. $(D s) may not be $(D StoppingPolicy.longest), and passing this
will throw an exception.
BUGS: If a range does not offer lvalue access, but $(D ref) is used in the
$(D foreach) loop, it will be silently accepted but any modifications
to the variable will not be propagated to the underlying range.
Examples:
---
auto arr1 = [1,2,3,4,5];
auto arr2 = [6,7,8,9,10];
foreach(ref a, ref b; lockstep(arr1, arr2))
{
a += b;
}
assert(arr1 == [7,9,11,13,15]);
// Lockstep also supports iterating with an index variable:
foreach(index, a, b; lockstep(arr1, arr2)) {
writefln("Index %s: a = %s, b = %s", index, a, b);
}
---
*/
struct Lockstep(Ranges...)
if(Ranges.length > 1 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)))
{
private:
alias staticMap!(Unqual, Ranges) R;
R _ranges;
StoppingPolicy _s;
public:
this(R ranges, StoppingPolicy s = StoppingPolicy.shortest)
{
_ranges = ranges;
enforce(s != StoppingPolicy.longest,
"Can't use StoppingPolicy.Longest on Lockstep.");
this._s = s;
}
mixin(lockstepApply!(Ranges)(false));
mixin(lockstepApply!(Ranges)(true));
}
// For generic programming, make sure Lockstep!(Range) is well defined for a
// single range.
template Lockstep(Range)
{
alias Range Lockstep;
}
version(StdDdoc)
{
/// Ditto
Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges) { assert(0); }
/// Ditto
Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges, StoppingPolicy s)
{
assert(0);
}
}
else
{
// Work around DMD bugs 4676, 4652.
auto lockstep(Args...)(Args args)
if (allSatisfy!(isInputRange, staticMap!(Unqual, Args)) || (
allSatisfy!(isInputRange, staticMap!(Unqual, Args[0..$ - 1])) &&
is(Args[$ - 1] == StoppingPolicy))
)
{
static if (is(Args[$ - 1] == StoppingPolicy))
{
alias args[0..$ - 1] ranges;
alias Args[0..$ - 1] Ranges;
alias args[$ - 1] stoppingPolicy;
}
else
{
alias Args Ranges;
alias args ranges;
auto stoppingPolicy = StoppingPolicy.shortest;
}
static if (Ranges.length > 1)
{
return Lockstep!(Ranges)(ranges, stoppingPolicy);
}
else
{
return ranges[0];
}
}
}
unittest {
// The filters are to make these the lowest common forward denominator ranges,
// i.e. w/o ref return, random access, length, etc.
auto foo = filter!"a"([1,2,3,4,5]);
immutable bar = [6f,7f,8f,9f,10f].idup;
auto l = lockstep(foo, bar);
// Should work twice. These are forward ranges with implicit save.
foreach(i; 0..2)
{
uint[] res1;
float[] res2;
foreach(a, ref b; l) {
res1 ~= a;
res2 ~= b;
}
assert(res1 == [1,2,3,4,5]);
assert(res2 == [6,7,8,9,10]);
assert(bar == [6f,7f,8f,9f,10f]);
}
// Doc example.
auto arr1 = [1,2,3,4,5];
auto arr2 = [6,7,8,9,10];
foreach(ref a, ref b; lockstep(arr1, arr2))
{
a += b;
}
assert(arr1 == [7,9,11,13,15]);
// Make sure StoppingPolicy.requireSameLength doesn't throw.
auto ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
foreach(a, b; ls) {}
// Make sure StoppingPolicy.requireSameLength throws.
arr2.popBack();
ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
try {
foreach(a, b; ls) {}
assert(0);
} catch {}
// Just make sure 1-range case instantiates. This hangs the compiler
// when no explicit stopping policy is specified due to Bug 4652.
auto stuff = lockstep([1,2,3,4,5], StoppingPolicy.shortest);
// Test with indexing.
uint[] res1;
float[] res2;
size_t[] indices;
foreach(i, a, b; lockstep(foo, bar))
{
indices ~= i;
res1 ~= a;
res2 ~= b;
}
assert(indices == to!(size_t[])([0, 1, 2, 3, 4]));
assert(res1 == [1,2,3,4,5]);
assert(res2 == [6f,7f,8f,9f,10f]);
// Make sure we've worked around the relevant compiler bugs and this at least
// compiles w/ >2 ranges.
lockstep(foo, foo, foo);
// Make sure it works with const.
const(int[])[] foo2 = [[1, 2, 3]];
const(int[])[] bar2 = [[4, 5, 6]];
auto c = chain(foo2, bar2);
foreach(f, b; lockstep(c, c)) {}
}
/**
Creates a mathematical sequence given the initial values and a
recurrence function that computes the next value from the existing
values. The sequence comes in the form of an infinite forward
range. The type $(D Recurrence) itself is seldom used directly; most
often, recurrences are obtained by calling the function $(D
recurrence).
When calling $(D recurrence), the function that computes the next
value is specified as a template argument, and the initial values in
the recurrence are passed as regular arguments. For example, in a
Fibonacci sequence, there are two initial values (and therefore a
state size of 2) because computing the next Fibonacci value needs the
past two values.
If the function is passed in string form, the state has name $(D "a")
and the zero-based index in the recurrence has name $(D "n"). The
given string must return the desired value for $(D a[n]) given $(D a[n
- 1]), $(D a[n - 2]), $(D a[n - 3]),..., $(D a[n - stateSize]). The
state size is dictated by the number of arguments passed to the call
to $(D recurrence). The $(D Recurrence) struct itself takes care of
managing the recurrence's state and shifting it appropriately.
Example:
----
// a[0] = 1, a[1] = 1, and compute a[n+1] = a[n-1] + a[n]
auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1);
// print the first 10 Fibonacci numbers
foreach (e; take(fib, 10)) { writeln(e); }
// print the first 10 factorials
foreach (e; take(recurrence!("a[n-1] * n")(1), 10)) { writeln(e); }
----
*/
struct Recurrence(alias fun, StateType, size_t stateSize)
{
StateType[stateSize] _state;
size_t _n;
this(StateType[stateSize] initial) { _state = initial; }
void popFront()
{
// The cast here is reasonable because fun may cause integer
// promotion, but needs to return a StateType to make its operation
// closed. Therefore, we have no other choice.
_state[_n % stateSize] = cast(StateType) binaryFun!(fun, "a", "n")(
cycle(_state), _n + stateSize);
++_n;
}
@property StateType front()
{
return _state[_n % stateSize];
}
@property typeof(this) save()
{
return this;
}
enum bool empty = false;
}
/// Ditto
Recurrence!(fun, CommonType!(State), State.length)
recurrence(alias fun, State...)(State initial)
{
CommonType!(State)[State.length] state;
foreach (i, Unused; State)
{
state[i] = initial[i];
}
return typeof(return)(state);
}
unittest
{
auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1);
static assert(isForwardRange!(typeof(fib)));
int[] witness = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ];
assert(equal(take(fib, 10), witness));
foreach (e; take(fib, 10)) {}
auto fact = recurrence!("n * a[n-1]")(1);
assert( equal(take(fact, 10), [1, 1, 2, 2*3, 2*3*4, 2*3*4*5, 2*3*4*5*6,
2*3*4*5*6*7, 2*3*4*5*6*7*8, 2*3*4*5*6*7*8*9][]) );
auto piapprox = recurrence!("a[n] + (n & 1 ? 4.0 : -4.0) / (2 * n + 3)")(4.0);
foreach (e; take(piapprox, 20)) {}
// Thanks to yebblies for this test and the associated fix
auto r = recurrence!"a[n-2]"(1, 2);
witness = [1, 2, 1, 2, 1];
assert(equal(take(r, 5), witness));
}
/**
$(D Sequence) is similar to $(D Recurrence) except that iteration is
presented in the so-called $(WEB en.wikipedia.org/wiki/Closed_form,
closed form). This means that the $(D n)th element in the series is
computable directly from the initial values and $(D n) itself. This
implies that the interface offered by $(D Sequence) is a random-access
range, as opposed to the regular $(D Recurrence), which only offers
forward iteration.
The state of the sequence is stored as a $(D Tuple) so it can be
heterogeneous.
Example:
----
// a[0] = 1, a[1] = 2, a[n] = a[0] + n * a[1]
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
----
*/
struct Sequence(alias fun, State)
{
private:
alias binaryFun!(fun, "a", "n") compute;
alias typeof(compute(State.init, cast(size_t) 1)) ElementType;
State _state;
size_t _n;
ElementType _cache;
public:
this(State initial, size_t n = 0)
{
this._state = initial;
this._n = n;
this._cache = compute(this._state, this._n);
}
@property ElementType front()
{
//return ElementType.init;
return this._cache;
}
ElementType moveFront()
{
return move(this._cache);
}
void popFront()
{
this._cache = compute(this._state, ++this._n);
}
auto opSlice(size_t lower, size_t upper)
in
{
assert(upper >= lower);
}
body
{
auto s = typeof(this)(this._state, this._n + lower);
return takeExactly(s, upper - lower);
}
ElementType opIndex(size_t n)
{
//return ElementType.init;
return compute(this._state, n + this._n);
}
enum bool empty = false;
@property Sequence save() { return this; }
}
/// Ditto
Sequence!(fun, Tuple!(State)) sequence(alias fun, State...)(State args)
{
return typeof(return)(tuple(args));
}
unittest
{
auto y = Sequence!("a[0] + n * a[1]", Tuple!(int, int))
(tuple(0, 4));
static assert(isForwardRange!(typeof(y)));
//@@BUG
//auto y = sequence!("a[0] + n * a[1]")(0, 4);
//foreach (e; take(y, 15))
{} //writeln(e);
auto odds = Sequence!("a[0] + n * a[1]", Tuple!(int, int))(
tuple(1, 2));
for(int currentOdd = 1; currentOdd <= 21; currentOdd += 2) {
assert(odds.front == odds[0]);
assert(odds[0] == currentOdd);
odds.popFront();
}
}
unittest
{
// documentation example
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
assert(odds.front == 1);
odds.popFront();
assert(odds.front == 3);
odds.popFront();
assert(odds.front == 5);
}
unittest
{
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
// static slicing tests
assert(equal(odds[0 .. 5], take(odds, 5)));
assert(equal(odds[3 .. 7], take(drop(odds, 3), 4)));
// relative slicing test, testing slicing is NOT agnostic of state
auto odds_less5 = drop(odds, 5);
assert(equal(odds_less5[0 .. 10], odds[5 .. 15]));
}
/**
Returns a range that goes through the numbers $(D begin), $(D begin +
step), $(D begin + 2 * step), $(D ...), up to and excluding $(D
end). The range offered is a random access range. The two-arguments
version has $(D step = 1). If $(D begin < end && step < 0) or $(D
begin > end && step > 0) or $(D begin == end), then an empty range is
returned.
Throws:
$(D Exception) if $(D begin != end && step == 0), an exception is
thrown.
Example:
----
auto r = iota(0, 10, 1);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
r = iota(0, 11, 3);
assert(equal(r, [0, 3, 6, 9][]));
assert(r[2] == 6);
auto rf = iota(0.0, 0.5, 0.1);
assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4]));
----
*/
auto iota(B, E, S)(B begin, E end, S step)
if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))
&& isIntegral!S)
{
alias CommonType!(Unqual!B, Unqual!E) Value;
alias typeof(unsigned((end - begin) / step)) IndexType;
static struct Result
{
private Value current, pastLast;
private S step;
this(Value current, Value pastLast, S step)
{
if ((current < pastLast && step >= 0) ||
(current > pastLast && step <= 0))
{
enforce(step != 0);
this.step = step;
this.current = current;
if (step > 0)
{
this.pastLast = pastLast - 1;
this.pastLast -= (this.pastLast - current) % step;
}
else
{
this.pastLast = pastLast + 1;
this.pastLast += (current - this.pastLast) % -step;
}
this.pastLast += step;
}
else
{
// Initialize an empty range
this.current = this.pastLast = current;
this.step = 1;
}
}
@property bool empty() const { return current == pastLast; }
@property inout(Value) front() inout { assert(!empty); return current; }
alias front moveFront;
void popFront() { assert(!empty); current += step; }
@property inout(Value) back() inout { assert(!empty); return pastLast - step; }
alias back moveBack;
void popBack() { assert(!empty); pastLast -= step; }
@property auto save() { return this; }
inout(Value) opIndex(ulong n) inout
{
assert(n < this.length);
// Just cast to Value here because doing so gives overflow behavior
// consistent with calling popFront() n times.
return cast(inout Value) (current + step * n);
}
inout(Result) opSlice() inout { return this; }
inout(Result) opSlice(ulong lower, ulong upper) inout
{
assert(upper >= lower && upper <= this.length);
return cast(inout Result)Result(cast(Value)(current + lower * step),
cast(Value)(pastLast - (length - upper) * step),
step);
}
@property IndexType length() const
{
if (step > 0)
{
return unsigned((pastLast - current) / step);
}
else
{
return unsigned((current - pastLast) / -step);
}
}
alias length opDollar;
}
return Result(begin, end, step);
}
/// Ditto
auto iota(B, E)(B begin, E end)
if (isFloatingPoint!(CommonType!(B, E)))
{
return iota(begin, end, 1.0);
}
/// Ditto
auto iota(B, E)(B begin, E end)
if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))
{
alias CommonType!(Unqual!B, Unqual!E) Value;
alias typeof(unsigned(end - begin)) IndexType;
static struct Result
{
private Value current, pastLast;
this(Value current, Value pastLast)
{
if (current < pastLast)
{
this.current = current;
this.pastLast = pastLast;
}
else
{
// Initialize an empty range
this.current = this.pastLast = current;
}
}
@property bool empty() const { return current == pastLast; }
@property inout(Value) front() inout { assert(!empty); return current; }
alias front moveFront;
void popFront() { assert(!empty); ++current; }
@property inout(Value) back() inout { assert(!empty); return pastLast - 1; }
alias back moveBack;
void popBack() { assert(!empty); --pastLast; }
@property auto save() { return this; }
inout(Value) opIndex(ulong n) inout
{
assert(n < this.length);
// Just cast to Value here because doing so gives overflow behavior
// consistent with calling popFront() n times.
return cast(inout Value) (current + n);
}
inout(Result) opSlice() inout { return this; }
inout(Result) opSlice(ulong lower, ulong upper) inout
{
assert(upper >= lower && upper <= this.length);
return cast(inout Result)Result(cast(Value)(current + lower),
cast(Value)(pastLast - (length - upper)));
}
@property IndexType length() const
{
return unsigned(pastLast - current);
}
alias length opDollar;
}
return Result(begin, end);
}
/// Ditto
auto iota(E)(E end)
{
E begin = 0;
return iota(begin, end);
}
// Specialization for floating-point types
auto iota(B, E, S)(B begin, E end, S step)
if (isFloatingPoint!(CommonType!(B, E, S)))
{
alias CommonType!(B, E, S) Value;
static struct Result
{
private Value start, step;
private size_t index, count;
this(Value start, Value end, Value step)
{
this.start = start;
this.step = step;
enforce(step != 0);
immutable fcount = (end - start) / step;
enforce(fcount >= 0, "iota: incorrect startup parameters");
count = to!size_t(fcount);
auto pastEnd = start + count * step;
if (step > 0)
{
if (pastEnd < end) ++count;
assert(start + count * step >= end);
}
else
{
if (pastEnd > end) ++count;
assert(start + count * step <= end);
}
}
@property bool empty() const { return index == count; }
@property Value front() const { assert(!empty); return start + step * index; }
alias front moveFront;
void popFront()
{
assert(!empty);
++index;
}
@property Value back() const
{
assert(!empty);
return start + step * (count - 1);
}
alias back moveBack;
void popBack()
{
assert(!empty);
--count;
}
@property auto save() { return this; }
Value opIndex(size_t n) const
{
assert(n < count);
return start + step * (n + index);
}
inout(Result) opSlice() inout
{
return this;
}
inout(Result) opSlice(size_t lower, size_t upper) inout
{
assert(upper >= lower && upper <= count);
Result ret = this;
ret.index += lower;
ret.count = upper - lower + ret.index;
return cast(inout Result)ret;
}
@property size_t length() const
{
return count - index;
}
alias length opDollar;
}
return Result(begin, end, step);
}
unittest
{
static assert(hasLength!(typeof(iota(0, 2))));
auto r = iota(0, 10, 1);
assert(r[$ - 1] == 9);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
auto rSlice = r[2..8];
assert(equal(rSlice, [2, 3, 4, 5, 6, 7]));
rSlice.popFront();
assert(rSlice[0] == rSlice.front);
assert(rSlice.front == 3);
rSlice.popBack();
assert(rSlice[rSlice.length - 1] == rSlice.back);
assert(rSlice.back == 6);
rSlice = r[0..4];
assert(equal(rSlice, [0, 1, 2, 3]));
auto rr = iota(10);
assert(equal(rr, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
r = iota(0, -10, -1);
assert(equal(r, [0, -1, -2, -3, -4, -5, -6, -7, -8, -9][]));
rSlice = r[3..9];
assert(equal(rSlice, [-3, -4, -5, -6, -7, -8]));
r = iota(0, -6, -3);
assert(equal(r, [0, -3][]));
rSlice = r[1..2];
assert(equal(rSlice, [-3]));
r = iota(0, -7, -3);
assert(equal(r, [0, -3, -6][]));
rSlice = r[1..3];
assert(equal(rSlice, [-3, -6]));
r = iota(0, 11, 3);
assert(equal(r, [0, 3, 6, 9][]));
assert(r[2] == 6);
rSlice = r[1..3];
assert(equal(rSlice, [3, 6]));
int[] a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
auto r1 = iota(a.ptr, a.ptr + a.length, 1);
assert(r1.front == a.ptr);
assert(r1.back == a.ptr + a.length - 1);
auto rf = iota(0.0, 0.5, 0.1);
assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4][]));
assert(rf.length == 5);
rf.popFront();
assert(rf.length == 4);
auto rfSlice = rf[1..4];
assert(rfSlice.length == 3);
assert(approxEqual(rfSlice, [0.2, 0.3, 0.4]));
rfSlice.popFront();
assert(approxEqual(rfSlice[0], 0.3));
rf.popFront();
assert(rf.length == 3);
rfSlice = rf[1..3];
assert(rfSlice.length == 2);
assert(approxEqual(rfSlice, [0.3, 0.4]));
assert(approxEqual(rfSlice[0], 0.3));
// With something just above 0.5
rf = iota(0.0, nextUp(0.5), 0.1);
assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4, 0.5][]));
rf.popBack();
assert(rf[rf.length - 1] == rf.back);
assert(approxEqual(rf.back, 0.4));
assert(rf.length == 5);
// going down
rf = iota(0.0, -0.5, -0.1);
assert(approxEqual(rf, [0.0, -0.1, -0.2, -0.3, -0.4][]));
rfSlice = rf[2..5];
assert(approxEqual(rfSlice, [-0.2, -0.3, -0.4]));
rf = iota(0.0, nextDown(-0.5), -0.1);
assert(approxEqual(rf, [0.0, -0.1, -0.2, -0.3, -0.4, -0.5][]));
// iota of longs
auto rl = iota(5_000_000L);
assert(rl.length == 5_000_000L);
// iota of longs with steps
auto iota_of_longs_with_steps = iota(50L, 101L, 10);
assert(iota_of_longs_with_steps.length == 6);
assert(equal(iota_of_longs_with_steps, [50L, 60L, 70L, 80L, 90L, 100L]));
// iota of unsigned zero length (issue 6222, actually trying to consume it
// is the only way to find something is wrong because the public
// properties are all correct)
auto iota_zero_unsigned = iota(0, 0u, 3);
assert(count(iota_zero_unsigned) == 0);
// unsigned reverse iota can be buggy if .length doesn't take them into
// account (issue 7982).
assert(iota(10u, 0u, -1).length() == 10);
assert(iota(10u, 0u, -2).length() == 5);
assert(iota(uint.max, uint.max-10, -1).length() == 10);
assert(iota(uint.max, uint.max-10, -2).length() == 5);
assert(iota(uint.max, 0u, -1).length() == uint.max);
}
unittest
{
auto idx = new size_t[100];
copy(iota(0, idx.length), idx);
}
unittest
{
foreach(range; TypeTuple!(iota(2, 27, 4),
iota(3, 9),
iota(2.7, 12.3, .1),
iota(3.2, 9.7)))
{
const cRange = range;
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
//The ptr stuff can't be done at compile time, so we unfortunately end
//up with some code duplication here.
auto arr = [0, 5, 3, 5, 5, 7, 9, 2, 0, 42, 7, 6];
{
const cRange = iota(arr.ptr, arr.ptr + arr.length, 3);
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
{
const cRange = iota(arr.ptr, arr.ptr + arr.length);
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
}
/**
Options for the $(LREF FrontTransversal) and $(LREF Transversal) ranges
(below).
*/
enum TransverseOptions
{
/**
When transversed, the elements of a range of ranges are assumed to
have different lengths (e.g. a jagged array).
*/
assumeJagged, //default
/**
The transversal enforces that the elements of a range of ranges have
all the same length (e.g. an array of arrays, all having the same
length). Checking is done once upon construction of the transversal
range.
*/
enforceNotJagged,
/**
The transversal assumes, without verifying, that the elements of a
range of ranges have all the same length. This option is useful if
checking was already done from the outside of the range.
*/
assumeNotJagged,
}
/**
Given a range of ranges, iterate transversally through the first
elements of each of the enclosed ranges.
Example:
----
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto ror = frontTransversal(x);
assert(equal(ror, [ 1, 3 ][]));
---
*/
struct FrontTransversal(Ror,
TransverseOptions opt = TransverseOptions.assumeJagged)
{
alias Unqual!(Ror) RangeOfRanges;
alias typeof(RangeOfRanges.init.front.front) ElementType;
private void prime()
{
static if (opt == TransverseOptions.assumeJagged)
{
while (!_input.empty && _input.front.empty)
{
_input.popFront();
}
static if (isBidirectionalRange!RangeOfRanges)
{
while (!_input.empty && _input.back.empty)
{
_input.popBack();
}
}
}
}
/**
Construction from an input.
*/
this(RangeOfRanges input)
{
_input = input;
prime();
static if (opt == TransverseOptions.enforceNotJagged)
// (isRandomAccessRange!RangeOfRanges
// && hasLength!(.ElementType!RangeOfRanges))
{
if (empty) return;
immutable commonLength = _input.front.length;
foreach (e; _input)
{
enforce(e.length == commonLength);
}
}
}
/**
Forward range primitives.
*/
static if (isInfinite!RangeOfRanges)
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return _input.empty;
}
}
/// Ditto
@property auto ref front()
{
assert(!empty);
return _input.front.front;
}
/// Ditto
static if (hasMobileElements!(.ElementType!RangeOfRanges))
{
ElementType moveFront()
{
return .moveFront(_input.front);
}
}
static if (hasAssignableElements!(.ElementType!RangeOfRanges))
{
@property auto front(ElementType val)
{
_input.front.front = val;
}
}
/// Ditto
void popFront()
{
assert(!empty);
_input.popFront();
prime();
}
/// Ditto
static if (isForwardRange!RangeOfRanges)
{
@property typeof(this) save()
{
auto ret = this;
ret._input = _input.save;
return ret;
}
}
static if (isBidirectionalRange!RangeOfRanges)
{
/**
Bidirectional primitives. They are offered if $(D
isBidirectionalRange!RangeOfRanges).
*/
@property auto ref back()
{
assert(!empty);
return _input.back.front;
}
/// Ditto
void popBack()
{
assert(!empty);
_input.popBack();
prime();
}
/// Ditto
static if (hasMobileElements!(.ElementType!RangeOfRanges))
{
ElementType moveBack()
{
return .moveFront(_input.back);
}
}
static if (hasAssignableElements!(.ElementType!RangeOfRanges))
{
@property auto back(ElementType val)
{
_input.back.front = val;
}
}
}
static if (isRandomAccessRange!RangeOfRanges &&
(opt == TransverseOptions.assumeNotJagged ||
opt == TransverseOptions.enforceNotJagged))
{
/**
Random-access primitive. It is offered if $(D
isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions.assumeNotJagged || opt ==
TransverseOptions.enforceNotJagged)).
*/
auto ref opIndex(size_t n)
{
return _input[n].front;
}
/// Ditto
static if (hasMobileElements!(.ElementType!RangeOfRanges))
{
ElementType moveAt(size_t n)
{
return .moveFront(_input[n]);
}
}
/// Ditto
static if (hasAssignableElements!(.ElementType!RangeOfRanges))
{
void opIndexAssign(ElementType val, size_t n)
{
_input[n].front = val;
}
}
/**
Slicing if offered if $(D RangeOfRanges) supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
{
typeof(this) opSlice(size_t lower, size_t upper)
{
return typeof(this)(_input[lower..upper]);
}
}
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
}
/// Ditto
FrontTransversal!(RangeOfRanges, opt) frontTransversal(
TransverseOptions opt = TransverseOptions.assumeJagged,
RangeOfRanges)
(RangeOfRanges rr)
{
return typeof(return)(rr);
}
unittest {
static assert(is(FrontTransversal!(immutable int[][])));
foreach(DummyType; AllDummyRanges) {
auto dummies =
[DummyType.init, DummyType.init, DummyType.init, DummyType.init];
foreach(i, ref elem; dummies) {
// Just violate the DummyRange abstraction to get what I want.
elem.arr = elem.arr[i..$ - (3 - i)];
}
auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(dummies);
static if (isForwardRange!DummyType) {
static assert(isForwardRange!(typeof(ft)));
}
assert(equal(ft, [1, 2, 3, 4]));
// Test slicing.
assert(equal(ft[0..2], [1, 2]));
assert(equal(ft[1..3], [2, 3]));
assert(ft.front == ft.moveFront());
assert(ft.back == ft.moveBack());
assert(ft.moveAt(1) == ft[1]);
// Test infiniteness propagation.
static assert(isInfinite!(typeof(frontTransversal(repeat("foo")))));
static if (DummyType.r == ReturnBy.Reference) {
{
ft.front++;
scope(exit) ft.front--;
assert(dummies.front.front == 2);
}
{
ft.front = 5;
scope(exit) ft.front = 1;
assert(dummies[0].front == 5);
}
{
ft.back = 88;
scope(exit) ft.back = 4;
assert(dummies.back.front == 88);
}
{
ft[1] = 99;
scope(exit) ft[1] = 2;
assert(dummies[1].front == 99);
}
}
}
}
/**
Given a range of ranges, iterate transversally through the the $(D
n)th element of each of the enclosed ranges. All elements of the
enclosing range must offer random access.
Example:
----
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto ror = transversal(x, 1);
assert(equal(ror, [ 2, 4 ][]));
---
*/
struct Transversal(Ror,
TransverseOptions opt = TransverseOptions.assumeJagged)
{
private alias Unqual!Ror RangeOfRanges;
private alias ElementType!RangeOfRanges InnerRange;
private alias ElementType!InnerRange E;
private void prime()
{
static if (opt == TransverseOptions.assumeJagged)
{
while (!_input.empty && _input.front.length <= _n)
{
_input.popFront();
}
static if (isBidirectionalRange!RangeOfRanges)
{
while (!_input.empty && _input.back.length <= _n)
{
_input.popBack();
}
}
}
}
/**
Construction from an input and an index.
*/
this(RangeOfRanges input, size_t n)
{
_input = input;
_n = n;
prime();
static if (opt == TransverseOptions.enforceNotJagged)
{
if (empty) return;
immutable commonLength = _input.front.length;
foreach (e; _input)
{
enforce(e.length == commonLength);
}
}
}
/**
Forward range primitives.
*/
static if (isInfinite!(RangeOfRanges))
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return _input.empty;
}
}
/// Ditto
@property auto ref front()
{
assert(!empty);
return _input.front[_n];
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveFront()
{
return .moveAt(_input.front, _n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
@property auto front(E val)
{
_input.front[_n] = val;
}
}
/// Ditto
void popFront()
{
assert(!empty);
_input.popFront();
prime();
}
/// Ditto
static if (isForwardRange!RangeOfRanges)
{
@property typeof(this) save()
{
auto ret = this;
ret._input = _input.save;
return ret;
}
}
static if (isBidirectionalRange!RangeOfRanges)
{
/**
Bidirectional primitives. They are offered if $(D
isBidirectionalRange!RangeOfRanges).
*/
@property auto ref back()
{
return _input.back[_n];
}
/// Ditto
void popBack()
{
assert(!empty);
_input.popBack();
prime();
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveBack()
{
return .moveAt(_input.back, _n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
@property auto back(E val)
{
_input.back[_n] = val;
}
}
}
static if (isRandomAccessRange!RangeOfRanges &&
(opt == TransverseOptions.assumeNotJagged ||
opt == TransverseOptions.enforceNotJagged))
{
/**
Random-access primitive. It is offered if $(D
isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions.assumeNotJagged || opt ==
TransverseOptions.enforceNotJagged)).
*/
auto ref opIndex(size_t n)
{
return _input[n][_n];
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveAt(size_t n)
{
return .moveAt(_input[n], _n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
void opIndexAssign(E val, size_t n)
{
_input[n][_n] = val;
}
}
/// Ditto
static if(hasLength!RangeOfRanges)
{
@property size_t length()
{
return _input.length;
}
alias length opDollar;
}
/**
Slicing if offered if $(D RangeOfRanges) supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
{
typeof(this) opSlice(size_t lower, size_t upper)
{
return typeof(this)(_input[lower..upper], _n);
}
}
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
size_t _n;
}
/// Ditto
Transversal!(RangeOfRanges, opt) transversal
(TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges)
(RangeOfRanges rr, size_t n)
{
return typeof(return)(rr, n);
}
unittest
{
int[][] x = new int[][2];
x[0] = [ 1, 2 ];
x[1] = [3, 4];
auto ror = transversal!(TransverseOptions.assumeNotJagged)(x, 1);
auto witness = [ 2, 4 ];
uint i;
foreach (e; ror) assert(e == witness[i++]);
assert(i == 2);
assert(ror.length == 2);
static assert(is(Transversal!(immutable int[][])));
// Make sure ref, assign is being propagated.
{
ror.front++;
scope(exit) ror.front--;
assert(x[0][1] == 3);
}
{
ror.front = 5;
scope(exit) ror.front = 2;
assert(x[0][1] == 5);
assert(ror.moveFront() == 5);
}
{
ror.back = 999;
scope(exit) ror.back = 4;
assert(x[1][1] == 999);
assert(ror.moveBack() == 999);
}
{
ror[0] = 999;
scope(exit) ror[0] = 2;
assert(x[0][1] == 999);
assert(ror.moveAt(0) == 999);
}
// Test w/o ref return.
alias DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random) D;
auto drs = [D.init, D.init];
foreach(num; 0..10) {
auto t = transversal!(TransverseOptions.enforceNotJagged)(drs, num);
assert(t[0] == t[1]);
assert(t[1] == num + 1);
}
static assert(isInfinite!(typeof(transversal(repeat([1,2,3]), 1))));
// Test slicing.
auto mat = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]];
auto mat1 = transversal!(TransverseOptions.assumeNotJagged)(mat, 1)[1..3];
assert(mat1[0] == 6);
assert(mat1[1] == 10);
}
struct Transposed(RangeOfRanges)
{
//alias typeof(map!"a.front"(RangeOfRanges.init)) ElementType;
this(RangeOfRanges input)
{
this._input = input;
}
@property auto front()
{
return map!"a.front"(_input);
}
void popFront()
{
foreach (ref e; _input)
{
if (e.empty) continue;
e.popFront();
}
}
// ElementType opIndex(size_t n)
// {
// return _input[n].front;
// }
@property bool empty()
{
foreach (e; _input)
if (!e.empty) return false;
return true;
}
@property Transposed save()
{
return Transposed(_input.save);
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
}
auto transposed(RangeOfRanges)(RangeOfRanges rr)
{
return Transposed!RangeOfRanges(rr);
}
unittest
{
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto tr = transposed(x);
int[][] witness = [ [ 1, 3 ], [ 2, 4 ] ];
uint i;
foreach (e; tr)
{
assert(array(e) == witness[i++]);
}
}
/**
This struct takes two ranges, $(D source) and $(D indices), and creates a view
of $(D source) as if its elements were reordered according to $(D indices).
$(D indices) may include only a subset of the elements of $(D source) and
may also repeat elements.
$(D Source) must be a random access range. The returned range will be
bidirectional or random-access if $(D Indices) is bidirectional or
random-access, respectively.
Examples:
---
auto source = [1, 2, 3, 4, 5];
auto indices = [4, 3, 1, 2, 0, 4];
auto ind = indexed(source, indices);
assert(equal(ind, [5, 4, 2, 3, 1, 5]));
// When elements of indices are duplicated and Source has lvalue elements,
// these are aliased in ind.
ind[0]++;
assert(ind[0] == 6);
assert(ind[5] == 6);
---
*/
struct Indexed(Source, Indices)
if(isRandomAccessRange!Source && isInputRange!Indices &&
is(typeof(Source.init[ElementType!(Indices).init])))
{
this(Source source, Indices indices)
{
this._source = source;
this._indices = indices;
}
/// Range primitives
@property auto ref front()
{
assert(!empty);
return _source[_indices.front];
}
/// Ditto
void popFront()
{
assert(!empty);
_indices.popFront();
}
static if(isInfinite!Indices)
{
enum bool empty = false;
}
else
{
/// Ditto
@property bool empty()
{
return _indices.empty;
}
}
static if(isForwardRange!Indices)
{
/// Ditto
@property typeof(this) save()
{
// Don't need to save _source because it's never consumed.
return typeof(this)(_source, _indices.save);
}
}
/// Ditto
static if(hasAssignableElements!Source)
{
@property auto ref front(ElementType!Source newVal)
{
assert(!empty);
return _source[_indices.front] = newVal;
}
}
static if(hasMobileElements!Source)
{
/// Ditto
auto moveFront()
{
assert(!empty);
return .moveAt(_source, _indices.front);
}
}
static if(isBidirectionalRange!Indices)
{
/// Ditto
@property auto ref back()
{
assert(!empty);
return _source[_indices.back];
}
/// Ditto
void popBack()
{
assert(!empty);
_indices.popBack();
}
/// Ditto
static if(hasAssignableElements!Source)
{
@property auto ref back(ElementType!Source newVal)
{
assert(!empty);
return _source[_indices.back] = newVal;
}
}
static if(hasMobileElements!Source)
{
/// Ditto
auto moveBack()
{
assert(!empty);
return .moveAt(_source, _indices.back);
}
}
}
static if(hasLength!Indices)
{
/// Ditto
@property size_t length()
{
return _indices.length;
}
alias length opDollar;
}
static if(isRandomAccessRange!Indices)
{
/// Ditto
auto ref opIndex(size_t index)
{
return _source[_indices[index]];
}
/// Ditto
typeof(this) opSlice(size_t a, size_t b)
{
return typeof(this)(_source, _indices[a..b]);
}
static if(hasAssignableElements!Source)
{
/// Ditto
auto opIndexAssign(ElementType!Source newVal, size_t index)
{
return _source[_indices[index]] = newVal;
}
}
static if(hasMobileElements!Source)
{
/// Ditto
auto moveAt(size_t index)
{
return .moveAt(_source, _indices[index]);
}
}
}
// All this stuff is useful if someone wants to index an Indexed
// without adding a layer of indirection.
/**
Returns the source range.
*/
@property Source source()
{
return _source;
}
/**
Returns the indices range.
*/
@property Indices indices()
{
return _indices;
}
static if(isRandomAccessRange!Indices)
{
/**
Returns the physical index into the source range corresponding to a
given logical index. This is useful, for example, when indexing
an $(D Indexed) without adding another layer of indirection.
Examples:
---
auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]);
assert(ind.physicalIndex(0) == 1);
---
*/
size_t physicalIndex(size_t logicalIndex)
{
return _indices[logicalIndex];
}
}
private:
Source _source;
Indices _indices;
}
/// Ditto
Indexed!(Source, Indices) indexed(Source, Indices)
(Source source, Indices indices)
{
return typeof(return)(source, indices);
}
unittest
{
{
// Test examples.
auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]);
assert(ind.physicalIndex(0) == 1);
}
auto source = [1, 2, 3, 4, 5];
auto indices = [4, 3, 1, 2, 0, 4];
auto ind = indexed(source, indices);
assert(equal(ind, [5, 4, 2, 3, 1, 5]));
assert(equal(retro(ind), [5, 1, 3, 2, 4, 5]));
// When elements of indices are duplicated and Source has lvalue elements,
// these are aliased in ind.
ind[0]++;
assert(ind[0] == 6);
assert(ind[5] == 6);
foreach(DummyType; AllDummyRanges)
{
auto d = DummyType.init;
auto r = indexed([1, 2, 3, 4, 5], d);
static assert(propagatesRangeType!(DummyType, typeof(r)));
static assert(propagatesLength!(DummyType, typeof(r)));
}
}
/**
This range iterates over fixed-sized chunks of size $(D chunkSize) of a
$(D source) range. $(D Source) must be an input range with slicing and length.
If $(D source.length) is not evenly divisible by $(D chunkSize), the back
element of this range will contain fewer than $(D chunkSize) elements.
Examples:
---
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = chunks(source, 4);
assert(chunks[0] == [1, 2, 3, 4]);
assert(chunks[1] == [5, 6, 7, 8]);
assert(chunks[2] == [9, 10]);
assert(chunks.back == chunks[2]);
assert(chunks.front == chunks[0]);
assert(chunks.length == 3);
---
*/
struct Chunks(Source) if(hasSlicing!Source && hasLength!Source)
{
///
this(Source source, size_t chunkSize)
{
this._source = source;
this._chunkSize = chunkSize;
}
/// Range primitives.
@property auto front()
{
assert(!empty);
return _source[0..min(_chunkSize, _source.length)];
}
/// Ditto
void popFront()
{
assert(!empty);
popFrontN(_source, _chunkSize);
}
/// Ditto
@property bool empty()
{
return _source.empty;
}
static if(isForwardRange!Source)
{
/// Ditto
@property typeof(this) save()
{
return typeof(this)(_source.save, _chunkSize);
}
}
/// Ditto
auto opIndex(size_t index)
{
immutable end = min(_source.length, (index + 1) * _chunkSize);
return _source[index * _chunkSize..end];
}
/// Ditto
typeof(this) opSlice(size_t lower, size_t upper)
{
immutable start = lower * _chunkSize;
immutable end = min(_source.length, upper * _chunkSize);
return typeof(this)(_source[start..end], _chunkSize);
}
/// Ditto
@property size_t length()
{
return (_source.length / _chunkSize) +
(_source.length % _chunkSize > 0);
}
alias length opDollar;
/// Ditto
@property auto back()
{
assert(!empty);
immutable remainder = _source.length % _chunkSize;
immutable len = _source.length;
if(remainder == 0)
{
// Return a full chunk.
return _source[len - _chunkSize..len];
}
else
{
return _source[len - remainder..len];
}
}
/// Ditto
void popBack()
{
assert(!empty);
immutable remainder = _source.length % _chunkSize;
immutable len = _source.length;
if(remainder == 0)
{
_source = _source[0..len - _chunkSize];
}
else
{
_source = _source[0..len - remainder];
}
}
private:
Source _source;
size_t _chunkSize;
}
/// Ditto
Chunks!(Source) chunks(Source)(Source source, size_t chunkSize)
{
return typeof(return)(source, chunkSize);
}
unittest
{
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = chunks(source, 4);
assert(chunks[0] == [1, 2, 3, 4]);
assert(chunks[1] == [5, 6, 7, 8]);
assert(chunks[2] == [9, 10]);
assert(chunks.back == chunks[2]);
assert(chunks.front == chunks[0]);
assert(chunks.length == 3);
assert(equal(retro(array(chunks)), array(retro(chunks))));
auto chunks2 = chunks.save;
chunks.popFront();
assert(chunks[0] == [5, 6, 7, 8]);
assert(chunks[1] == [9, 10]);
chunks2.popBack();
assert(chunks2[1] == [5, 6, 7, 8]);
assert(chunks2.length == 2);
static assert(isRandomAccessRange!(typeof(chunks)));
}
/**
Moves the front of $(D r) out and returns it. Leaves $(D r.front) in a
destroyable state that does not allocate any resources (usually equal
to its $(D .init) value).
*/
ElementType!R moveFront(R)(R r)
{
static if (is(typeof(&r.moveFront))) {
return r.moveFront();
} else static if (!hasElaborateCopyConstructor!(ElementType!(R))) {
return r.front;
} else static if (is(typeof(&r.front()) == ElementType!R*)) {
return move(r.front);
} else {
static assert(0,
"Cannot move front of a range with a postblit and an rvalue front.");
}
}
unittest
{
struct R
{
@property ref int front() { static int x = 42; return x; }
this(this){}
}
R r;
assert(moveFront(r) == 42);
}
/**
Moves the back of $(D r) out and returns it. Leaves $(D r.back) in a
destroyable state that does not allocate any resources (usually equal
to its $(D .init) value).
*/
ElementType!R moveBack(R)(R r)
{
static if (is(typeof(&r.moveBack))) {
return r.moveBack();
} else static if (!hasElaborateCopyConstructor!(ElementType!(R))) {
return r.back;
} else static if (is(typeof(&r.back()) == ElementType!R*)) {
return move(r.back);
} else {
static assert(0,
"Cannot move back of a range with a postblit and an rvalue back.");
}
}
unittest
{
struct TestRange
{
int payload;
@property bool empty() { return false; }
@property TestRange save() { return this; }
@property ref int front() { return payload; }
@property ref int back() { return payload; }
void popFront() { }
void popBack() { }
}
static assert(isBidirectionalRange!TestRange);
TestRange r;
auto x = moveBack(r);
}
/**
Moves element at index $(D i) of $(D r) out and returns it. Leaves $(D
r.front) in a destroyable state that does not allocate any resources
(usually equal to its $(D .init) value).
*/
ElementType!R moveAt(R, I)(R r, I i) if (isIntegral!I)
{
static if (is(typeof(&r.moveAt))) {
return r.moveAt(i);
} else static if (!hasElaborateCopyConstructor!(ElementType!(R))) {
return r[i];
} else static if (is(typeof(&r[i]) == ElementType!R*)) {
return move(r[i]);
} else {
static assert(0,
"Cannot move element of a range with a postblit and rvalue elements.");
}
}
unittest
{
auto a = [ 1, 2, 3 ];
assert(moveFront(a) == 1);
// define a perfunctory input range
struct InputRange
{
@property bool empty() { return false; }
@property int front() { return 42; }
void popFront() {}
int moveFront() { return 43; }
}
InputRange r;
assert(moveFront(r) == 43);
foreach(DummyType; AllDummyRanges) {
auto d = DummyType.init;
assert(moveFront(d) == 1);
static if (isBidirectionalRange!DummyType) {
assert(moveBack(d) == 10);
}
static if (isRandomAccessRange!DummyType) {
assert(moveAt(d, 2) == 3);
}
}
}
/**These interfaces are intended to provide virtual function-based wrappers
* around input ranges with element type E. This is useful where a well-defined
* binary interface is required, such as when a DLL function or virtual function
* needs to accept a generic range as a parameter. Note that
* $(LREF isInputRange) and friends check for conformance to structural
* interfaces, not for implementation of these $(D interface) types.
*
* Examples:
* ---
* void useRange(InputRange!int range) {
* // Function body.
* }
*
* // Create a range type.
* auto squares = map!"a * a"(iota(10));
*
* // Wrap it in an interface.
* auto squaresWrapped = inputRangeObject(squares);
*
* // Use it.
* useRange(squaresWrapped);
* ---
*
* Limitations:
*
* These interfaces are not capable of forwarding $(D ref) access to elements.
*
* Infiniteness of the wrapped range is not propagated.
*
* Length is not propagated in the case of non-random access ranges.
*
* See_Also:
* $(LREF inputRangeObject)
*/
interface InputRange(E) {
///
@property E front();
///
E moveFront();
///
void popFront();
///
@property bool empty();
/* Measurements of the benefits of using opApply instead of range primitives
* for foreach, using timings for iterating over an iota(100_000_000) range
* with an empty loop body, using the same hardware in each case:
*
* Bare Iota struct, range primitives: 278 milliseconds
* InputRangeObject, opApply: 436 milliseconds (1.57x penalty)
* InputRangeObject, range primitives: 877 milliseconds (3.15x penalty)
*/
/**$(D foreach) iteration uses opApply, since one delegate call per loop
* iteration is faster than three virtual function calls.
*/
int opApply(int delegate(E));
/// Ditto
int opApply(int delegate(size_t, E));
}
/**Interface for a forward range of type $(D E).*/
interface ForwardRange(E) : InputRange!E {
///
@property ForwardRange!E save();
}
/**Interface for a bidirectional range of type $(D E).*/
interface BidirectionalRange(E) : ForwardRange!(E) {
///
@property BidirectionalRange!E save();
///
@property E back();
///
E moveBack();
///
void popBack();
}
/**Interface for a finite random access range of type $(D E).*/
interface RandomAccessFinite(E) : BidirectionalRange!(E) {
///
@property RandomAccessFinite!E save();
///
E opIndex(size_t);
///
E moveAt(size_t);
///
@property size_t length();
///
alias length opDollar;
// Can't support slicing until issues with requiring slicing for all
// finite random access ranges are fully resolved.
version(none) {
///
RandomAccessFinite!E opSlice(size_t, size_t);
}
}
/**Interface for an infinite random access range of type $(D E).*/
interface RandomAccessInfinite(E) : ForwardRange!E {
///
E moveAt(size_t);
///
@property RandomAccessInfinite!E save();
///
E opIndex(size_t);
}
/**Adds assignable elements to InputRange.*/
interface InputAssignable(E) : InputRange!E {
///
@property void front(E newVal);
}
/**Adds assignable elements to ForwardRange.*/
interface ForwardAssignable(E) : InputAssignable!E, ForwardRange!E {
///
@property ForwardAssignable!E save();
}
/**Adds assignable elements to BidirectionalRange.*/
interface BidirectionalAssignable(E) : ForwardAssignable!E, BidirectionalRange!E {
///
@property BidirectionalAssignable!E save();
///
@property void back(E newVal);
}
/**Adds assignable elements to RandomAccessFinite.*/
interface RandomFiniteAssignable(E) : RandomAccessFinite!E, BidirectionalAssignable!E {
///
@property RandomFiniteAssignable!E save();
///
void opIndexAssign(E val, size_t index);
}
/**Interface for an output range of type $(D E). Usage is similar to the
* $(D InputRange) interface and descendants.*/
interface OutputRange(E) {
///
void put(E);
}
// CTFE function that generates mixin code for one put() method for each
// type E.
private string putMethods(E...)() {
string ret;
foreach(ti, Unused; E) {
ret ~= "void put(E[" ~ to!string(ti) ~ "] e) { .put(_range, e); }";
}
return ret;
}
/**Implements the $(D OutputRange) interface for all types E and wraps the
* $(D put) method for each type $(D E) in a virtual function.
*/
class OutputRangeObject(R, E...) : staticMap!(OutputRange, E) {
// @BUG 4689: There should be constraints on this template class, but
// DMD won't let me put them in.
private R _range;
this(R range) {
this._range = range;
}
mixin(putMethods!E());
}
/**Returns the interface type that best matches $(D R).*/
template MostDerivedInputRange(R) if (isInputRange!(Unqual!R)) {
private alias ElementType!R E;
static if (isRandomAccessRange!R) {
static if (isInfinite!R) {
alias RandomAccessInfinite!E MostDerivedInputRange;
} else static if (hasAssignableElements!R) {
alias RandomFiniteAssignable!E MostDerivedInputRange;
} else {
alias RandomAccessFinite!E MostDerivedInputRange;
}
} else static if (isBidirectionalRange!R) {
static if (hasAssignableElements!R) {
alias BidirectionalAssignable!E MostDerivedInputRange;
} else {
alias BidirectionalRange!E MostDerivedInputRange;
}
} else static if (isForwardRange!R) {
static if (hasAssignableElements!R) {
alias ForwardAssignable!E MostDerivedInputRange;
} else {
alias ForwardRange!E MostDerivedInputRange;
}
} else {
static if (hasAssignableElements!R) {
alias InputAssignable!E MostDerivedInputRange;
} else {
alias InputRange!E MostDerivedInputRange;
}
}
}
/**Implements the most derived interface that $(D R) works with and wraps
* all relevant range primitives in virtual functions. If $(D R) is already
* derived from the $(D InputRange) interface, aliases itself away.
*/
template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
static if (is(R : InputRange!(ElementType!R))) {
alias R InputRangeObject;
} else static if (!is(Unqual!R == R)) {
alias InputRangeObject!(Unqual!R) InputRangeObject;
} else {
///
class InputRangeObject : MostDerivedInputRange!(R) {
private R _range;
private alias ElementType!R E;
this(R range) {
this._range = range;
}
@property E front() { return _range.front; }
E moveFront() {
return .moveFront(_range);
}
void popFront() { _range.popFront(); }
@property bool empty() { return _range.empty; }
static if (isForwardRange!R) {
@property typeof(this) save() {
return new typeof(this)(_range.save);
}
}
static if (hasAssignableElements!R) {
@property void front(E newVal) {
_range.front = newVal;
}
}
static if (isBidirectionalRange!R) {
@property E back() { return _range.back; }
@property E moveBack() {
return .moveBack(_range);
}
@property void popBack() { return _range.popBack(); }
static if (hasAssignableElements!R) {
@property void back(E newVal) {
_range.back = newVal;
}
}
}
static if (isRandomAccessRange!R) {
E opIndex(size_t index) {
return _range[index];
}
E moveAt(size_t index) {
return .moveAt(_range, index);
}
static if (hasAssignableElements!R) {
void opIndexAssign(E val, size_t index) {
_range[index] = val;
}
}
static if (!isInfinite!R) {
@property size_t length() {
return _range.length;
}
alias length opDollar;
// Can't support slicing until all the issues with
// requiring slicing support for finite random access
// ranges are resolved.
version(none) {
typeof(this) opSlice(size_t lower, size_t upper) {
return new typeof(this)(_range[lower..upper]);
}
}
}
}
// Optimization: One delegate call is faster than three virtual
// function calls. Use opApply for foreach syntax.
int opApply(int delegate(E) dg) {
int res;
for(auto r = _range; !r.empty; r.popFront()) {
res = dg(r.front);
if (res) break;
}
return res;
}
int opApply(int delegate(size_t, E) dg) {
int res;
size_t i = 0;
for(auto r = _range; !r.empty; r.popFront()) {
res = dg(i, r.front);
if (res) break;
i++;
}
return res;
}
}
}
}
/**Convenience function for creating an $(D InputRangeObject) of the proper type.
* See $(LREF InputRange) for an example.
*/
InputRangeObject!R inputRangeObject(R)(R range) if (isInputRange!R) {
static if (is(R : InputRange!(ElementType!R))) {
return range;
} else {
return new InputRangeObject!R(range);
}
}
/**Convenience function for creating an $(D OutputRangeObject) with a base range
* of type $(D R) that accepts types $(D E).
Examples:
---
uint[] outputArray;
auto app = appender(&outputArray);
auto appWrapped = outputRangeObject!(uint, uint[])(app);
static assert(is(typeof(appWrapped) : OutputRange!(uint[])));
static assert(is(typeof(appWrapped) : OutputRange!(uint)));
---
*/
template outputRangeObject(E...) {
///
OutputRangeObject!(R, E) outputRangeObject(R)(R range) {
return new OutputRangeObject!(R, E)(range);
}
}
unittest {
static void testEquality(R)(iInputRange r1, R r2) {
assert(equal(r1, r2));
}
auto arr = [1,2,3,4];
RandomFiniteAssignable!int arrWrapped = inputRangeObject(arr);
static assert(isRandomAccessRange!(typeof(arrWrapped)));
// static assert(hasSlicing!(typeof(arrWrapped)));
static assert(hasLength!(typeof(arrWrapped)));
arrWrapped[0] = 0;
assert(arr[0] == 0);
assert(arr.moveFront() == 0);
assert(arr.moveBack() == 4);
assert(arr.moveAt(1) == 2);
foreach(elem; arrWrapped) {}
foreach(i, elem; arrWrapped) {}
assert(inputRangeObject(arrWrapped) is arrWrapped);
foreach(DummyType; AllDummyRanges) {
auto d = DummyType.init;
static assert(propagatesRangeType!(DummyType,
typeof(inputRangeObject(d))));
static assert(propagatesRangeType!(DummyType,
MostDerivedInputRange!DummyType));
InputRange!uint wrapped = inputRangeObject(d);
assert(equal(wrapped, d));
}
// Test output range stuff.
auto app = appender!(uint[])();
auto appWrapped = outputRangeObject!(uint, uint[])(app);
static assert(is(typeof(appWrapped) : OutputRange!(uint[])));
static assert(is(typeof(appWrapped) : OutputRange!(uint)));
appWrapped.put(1);
appWrapped.put([2, 3]);
assert(app.data.length == 3);
assert(equal(app.data, [1,2,3]));
}
/**
Returns true if $(D fn) accepts variables of type T1 and T2 in any order.
The following code should compile:
---
T1 foo();
T2 bar();
fn(foo(), bar());
fn(bar(), foo());
---
*/
template isTwoWayCompatible(alias fn, T1, T2)
{
enum isTwoWayCompatible = is(typeof( (){
T1 foo();
T2 bar();
fn(foo(), bar());
fn(bar(), foo());
}
));
}
/**
Policy used with the searching primitives $(D lowerBound), $(D
upperBound), and $(D equalRange) of $(LREF SortedRange) below.
*/
enum SearchPolicy
{
/**
Searches with a step that is grows linearly (1, 2, 3,...)
leading to a quadratic search schedule (indexes tried are 0, 1,
3, 6, 10, 15, 21, 28,...) Once the search overshoots its target,
the remaining interval is searched using binary search. The
search is completed in $(BIGOH sqrt(n)) time. Use it when you
are reasonably confident that the value is around the beginning
of the range.
*/
trot,
/**
Performs a $(LUCKY galloping search algorithm), i.e. searches
with a step that doubles every time, (1, 2, 4, 8, ...) leading
to an exponential search schedule (indexes tried are 0, 1, 3,
7, 15, 31, 63,...) Once the search overshoots its target, the
remaining interval is searched using binary search. A value is
found in $(BIGOH log(n)) time.
*/
gallop,
/**
Searches using a classic interval halving policy. The search
starts in the middle of the range, and each search step cuts
the range in half. This policy finds a value in $(BIGOH log(n))
time but is less cache friendly than $(D gallop) for large
ranges. The $(D binarySearch) policy is used as the last step
of $(D trot), $(D gallop), $(D trotBackwards), and $(D
gallopBackwards) strategies.
*/
binarySearch,
/**
Similar to $(D trot) but starts backwards. Use it when
confident that the value is around the end of the range.
*/
trotBackwards,
/**
Similar to $(D gallop) but starts backwards. Use it when
confident that the value is around the end of the range.
*/
gallopBackwards
}
/**
Represents a sorted random-access range. In addition to the regular
range primitives, supports fast operations using binary search. To
obtain a $(D SortedRange) from an unsorted range $(D r), use
$(XREF algorithm, sort) which sorts $(D r) in place and returns the
corresponding $(D SortedRange). To construct a $(D SortedRange)
from a range $(D r) that is known to be already sorted, use
$(LREF assumeSorted) described below.
Example:
----
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(3));
assert(!r.contains(32));
auto r1 = sort!"a > b"(a);
assert(r1.contains(3));
assert(!r1.contains(32));
assert(r1.release() == [ 64, 52, 42, 3, 2, 1 ]);
----
$(D SortedRange) could accept ranges weaker than random-access, but it
is unable to provide interesting functionality for them. Therefore,
$(D SortedRange) is currently restricted to random-access ranges.
No copy of the original range is ever made. If the underlying range is
changed concurrently with its corresponding $(D SortedRange) in ways
that break its sortedness, $(D SortedRange) will work erratically.
Example:
----
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(42));
swap(a[3], a[5]); // illegal to break sortedness of original range
assert(!r.contains(42)); // passes although it shouldn't
----
*/
struct SortedRange(Range, alias pred = "a < b")
if (isRandomAccessRange!Range)
{
private alias binaryFun!pred predFun;
private bool geq(L, R)(L lhs, R rhs)
{
return !predFun(lhs, rhs);
}
private bool gt(L, R)(L lhs, R rhs)
{
return predFun(rhs, lhs);
}
private Range _input;
// Undocummented because a clearer way to invoke is by calling
// assumeSorted.
this(Range input)
{
this._input = input;
if(!__ctfe)
debug
{
import std.random;
// Check the sortedness of the input
if (this._input.length < 2) return;
immutable size_t msb = bsr(this._input.length) + 1;
assert(msb > 0 && msb <= this._input.length);
immutable step = this._input.length / msb;
static MinstdRand gen;
immutable start = uniform(0, step, gen);
auto st = stride(this._input, step);
assert(isSorted!pred(st), text(st));
}
}
/// Range primitives.
@property bool empty() //const
{
return this._input.empty;
}
/// Ditto
@property auto save()
{
// Avoid the constructor
typeof(this) result;
result._input = _input.save;
return result;
}
/// Ditto
@property auto front()
{
return _input.front;
}
/// Ditto
void popFront()
{
_input.popFront();
}
/// Ditto
@property auto back()
{
return _input.back;
}
/// Ditto
void popBack()
{
_input.popBack();
}
/// Ditto
auto opIndex(size_t i)
{
return _input[i];
}
/// Ditto
auto opSlice(size_t a, size_t b)
{
assert(a <= b);
typeof(this) result;
result._input = _input[a .. b];// skip checking
return result;
}
/// Ditto
@property size_t length() //const
{
return _input.length;
}
alias length opDollar;
/**
Releases the controlled range and returns it.
*/
auto release()
{
return move(_input);
}
// Assuming a predicate "test" that returns 0 for a left portion
// of the range and then 1 for the rest, returns the index at
// which the first 1 appears. Used internally by the search routines.
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if (sp == SearchPolicy.binarySearch)
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2, it = first + step;
if (!test(_input[it], v))
{
first = it + 1;
count -= step + 1;
}
else
{
count = step;
}
}
return first;
}
// Specialization for trot and gallop
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if (sp == SearchPolicy.trot || sp == SearchPolicy.gallop)
{
if (empty || test(front, v)) return 0;
immutable count = length;
if (count == 1) return 1;
size_t below = 0, above = 1, step = 2;
while (!test(_input[above], v))
{
// Still too small, update below and increase gait
below = above;
immutable next = above + step;
if (next >= count)
{
// Overshot - the next step took us beyond the end. So
// now adjust next and simply exit the loop to do the
// binary search thingie.
above = count;
break;
}
// Still in business, increase step and continue
above = next;
static if (sp == SearchPolicy.trot)
++step;
else
step <<= 1;
}
return below + this[below .. above].getTransitionIndex!(
SearchPolicy.binarySearch, test, V)(v);
}
// Specialization for trotBackwards and gallopBackwards
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if (sp == SearchPolicy.trotBackwards || sp == SearchPolicy.gallopBackwards)
{
immutable count = length;
if (empty || !test(back, v)) return count;
if (count == 1) return 0;
size_t below = count - 2, above = count - 1, step = 2;
while (test(_input[below], v))
{
// Still too large, update above and increase gait
above = below;
if (below < step)
{
// Overshot - the next step took us beyond the end. So
// now adjust next and simply fall through to do the
// binary search thingie.
below = 0;
break;
}
// Still in business, increase step and continue
below -= step;
static if (sp == SearchPolicy.trot)
++step;
else
step <<= 1;
}
return below + this[below .. above].getTransitionIndex!(
SearchPolicy.binarySearch, test, V)(v);
}
// lowerBound
/**
This function uses binary search with policy $(D sp) to find the
largest left subrange on which $(D pred(x, value)) is $(D true) for
all $(D x) (e.g., if $(D pred) is "less than", returns the portion of
the range with elements strictly smaller than $(D value)). The search
schedule and its complexity are documented in
$(LREF SearchPolicy). See also STL's
$(WEB sgi.com/tech/stl/lower_bound.html, lower_bound).
Example:
----
auto a = assumeSorted([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]);
auto p = a.lowerBound(4);
assert(equal(p, [ 0, 1, 2, 3 ]));
----
*/
auto lowerBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V))
{
return this[0 .. getTransitionIndex!(sp, geq)(value)];
}
// upperBound
/**
This function uses binary search with policy $(D sp) to find the
largest right subrange on which $(D pred(value, x)) is $(D true)
for all $(D x) (e.g., if $(D pred) is "less than", returns the
portion of the range with elements strictly greater than $(D
value)). The search schedule and its complexity are documented in
$(LREF SearchPolicy). See also STL's
$(WEB sgi.com/tech/stl/lower_bound.html,upper_bound).
Example:
----
auto a = assumeSorted([ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]);
auto p = a.upperBound(3);
assert(equal(p, [4, 4, 5, 6]));
----
*/
auto upperBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V))
{
return this[getTransitionIndex!(sp, gt)(value) .. length];
}
// equalRange
/**
Returns the subrange containing all elements $(D e) for which both $(D
pred(e, value)) and $(D pred(value, e)) evaluate to $(D false) (e.g.,
if $(D pred) is "less than", returns the portion of the range with
elements equal to $(D value)). Uses a classic binary search with
interval halving until it finds a value that satisfies the condition,
then uses $(D SearchPolicy.gallopBackwards) to find the left boundary
and $(D SearchPolicy.gallop) to find the right boundary. These
policies are justified by the fact that the two boundaries are likely
to be near the first found value (i.e., equal ranges are relatively
small). Completes the entire search in $(BIGOH log(n)) time. See also
STL's $(WEB sgi.com/tech/stl/equal_range.html, equal_range).
Example:
----
auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto r = equalRange(a, 3);
assert(equal(r, [ 3, 3, 3 ]));
----
*/
auto equalRange(V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V))
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2;
auto it = first + step;
if (predFun(_input[it], value))
{
// Less than value, bump left bound up
first = it + 1;
count -= step + 1;
}
else if (predFun(value, _input[it]))
{
// Greater than value, chop count
count = step;
}
else
{
// Equal to value, do binary searches in the
// leftover portions
// Gallop towards the left end as it's likely nearby
immutable left = first
+ this[first .. it]
.lowerBound!(SearchPolicy.gallopBackwards)(value).length;
first += count;
// Gallop towards the right end as it's likely nearby
immutable right = first
- this[it + 1 .. first]
.upperBound!(SearchPolicy.gallop)(value).length;
return this[left .. right];
}
}
return this.init;
}
// trisect
/**
Returns a tuple $(D r) such that $(D r[0]) is the same as the result
of $(D lowerBound(value)), $(D r[1]) is the same as the result of $(D
equalRange(value)), and $(D r[2]) is the same as the result of $(D
upperBound(value)). The call is faster than computing all three
separately. Uses a search schedule similar to $(D
equalRange). Completes the entire search in $(BIGOH log(n)) time.
Example:
----
auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto r = assumeSorted(a).trisect(3);
assert(equal(r[0], [ 1, 2 ]));
assert(equal(r[1], [ 3, 3, 3 ]));
assert(equal(r[2], [ 4, 4, 5, 6 ]));
----
*/
auto trisect(V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V))
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2;
auto it = first + step;
if (predFun(_input[it], value))
{
// Less than value, bump left bound up
first = it + 1;
count -= step + 1;
}
else if (predFun(value, _input[it]))
{
// Greater than value, chop count
count = step;
}
else
{
// Equal to value, do binary searches in the
// leftover portions
// Gallop towards the left end as it's likely nearby
immutable left = first
+ this[first .. it]
.lowerBound!(SearchPolicy.gallopBackwards)(value).length;
first += count;
// Gallop towards the right end as it's likely nearby
immutable right = first
- this[it + 1 .. first]
.upperBound!(SearchPolicy.gallop)(value).length;
return tuple(this[0 .. left], this[left .. right],
this[right .. length]);
}
}
// No equal element was found
return tuple(this[0 .. first], this.init, this[first .. length]);
}
// contains
/**
Returns $(D true) if and only if $(D value) can be found in $(D
range), which is assumed to be sorted. Performs $(BIGOH log(r.length))
evaluations of $(D pred). See also STL's $(WEB
sgi.com/tech/stl/binary_search.html, binary_search).
*/
bool contains(V)(V value)
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2, it = first + step;
if (predFun(_input[it], value))
{
// Less than value, bump left bound up
first = it + 1;
count -= step + 1;
}
else if (predFun(value, _input[it]))
{
// Greater than value, chop count
count = step;
}
else
{
// Found!!!
return true;
}
}
return false;
}
/++
$(RED Deprecated. It will be removed in January 2013.
Please use $(LREF contains) instead.)
+/
deprecated alias contains canFind;
}
// Doc examples
unittest
{
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(3));
assert(!r.contains(32));
auto r1 = sort!"a > b"(a);
assert(r1.contains(3));
assert(!r1.contains(32));
assert(r1.release() == [ 64, 52, 42, 3, 2, 1 ]);
}
unittest
{
auto a = [ 10, 20, 30, 30, 30, 40, 40, 50, 60 ];
auto r = assumeSorted(a).trisect(30);
assert(equal(r[0], [ 10, 20 ]));
assert(equal(r[1], [ 30, 30, 30 ]));
assert(equal(r[2], [ 40, 40, 50, 60 ]));
r = assumeSorted(a).trisect(35);
assert(equal(r[0], [ 10, 20, 30, 30, 30 ]));
assert(r[1].empty);
assert(equal(r[2], [ 40, 40, 50, 60 ]));
}
unittest
{
auto a = [ "A", "AG", "B", "E", "F" ];
auto r = assumeSorted!"cmp(a,b) < 0"(a).trisect("B"w);
assert(equal(r[0], [ "A", "AG" ]));
assert(equal(r[1], [ "B" ]));
assert(equal(r[2], [ "E", "F" ]));
r = assumeSorted!"cmp(a,b) < 0"(a).trisect("A"d);
assert(r[0].empty);
assert(equal(r[1], [ "A" ]));
assert(equal(r[2], [ "AG", "B", "E", "F" ]));
}
unittest
{
static void test(SearchPolicy pol)()
{
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(equal(r.lowerBound(42), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(42), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(41), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(43), [1, 2, 3, 42]));
assert(equal(r.lowerBound!(pol)(51), [1, 2, 3, 42]));
assert(equal(r.lowerBound!(pol)(3), [1, 2]));
assert(equal(r.lowerBound!(pol)(55), [1, 2, 3, 42, 52]));
assert(equal(r.lowerBound!(pol)(420), a));
assert(equal(r.lowerBound!(pol)(0), a[0 .. 0]));
assert(equal(r.upperBound!(pol)(42), [52, 64]));
assert(equal(r.upperBound!(pol)(41), [42, 52, 64]));
assert(equal(r.upperBound!(pol)(43), [52, 64]));
assert(equal(r.upperBound!(pol)(51), [52, 64]));
assert(equal(r.upperBound!(pol)(53), [64]));
assert(equal(r.upperBound!(pol)(55), [64]));
assert(equal(r.upperBound!(pol)(420), a[0 .. 0]));
assert(equal(r.upperBound!(pol)(0), a));
}
test!(SearchPolicy.trot)();
test!(SearchPolicy.gallop)();
test!(SearchPolicy.trotBackwards)();
test!(SearchPolicy.gallopBackwards)();
test!(SearchPolicy.binarySearch)();
}
unittest
{
// Check for small arrays
int[] a;
auto r = assumeSorted(a);
a = [ 1 ];
r = assumeSorted(a);
a = [ 1, 2 ];
r = assumeSorted(a);
a = [ 1, 2, 3 ];
r = assumeSorted(a);
}
unittest
{
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(42));
swap(a[3], a[5]); // illegal to break sortedness of original range
assert(!r.contains(42)); // passes although it shouldn't
}
unittest
{
immutable(int)[] arr = [ 1, 2, 3 ];
auto s = assumeSorted(arr);
}
/**
Assumes $(D r) is sorted by predicate $(D pred) and returns the
corresponding $(D SortedRange!(pred, R)) having $(D r) as support. To
keep the checking costs low, the cost is $(BIGOH 1) in release mode
(no checks for sortedness are performed). In debug mode, a few random
elements of $(D r) are checked for sortedness. The size of the sample
is proportional $(BIGOH log(r.length)). That way, checking has no
effect on the complexity of subsequent operations specific to sorted
ranges (such as binary search). The probability of an arbitrary
unsorted range failing the test is very high (however, an
almost-sorted range is likely to pass it). To check for sortedness at
cost $(BIGOH n), use $(XREF algorithm,isSorted).
*/
auto assumeSorted(alias pred = "a < b", R)(R r)
if (isRandomAccessRange!(Unqual!R))
{
return SortedRange!(Unqual!R, pred)(r);
}
unittest
{
static assert(isRandomAccessRange!(SortedRange!(int[])));
int[] a = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ];
auto p = assumeSorted(a).lowerBound(4);
assert(equal(p, [0, 1, 2, 3]));
p = assumeSorted(a).lowerBound(5);
assert(equal(p, [0, 1, 2, 3, 4]));
p = assumeSorted(a).lowerBound(6);
assert(equal(p, [ 0, 1, 2, 3, 4, 5]));
p = assumeSorted(a).lowerBound(6.9);
assert(equal(p, [ 0, 1, 2, 3, 4, 5, 6]));
}
unittest
{
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto p = assumeSorted(a).upperBound(3);
assert(equal(p, [4, 4, 5, 6 ]));
p = assumeSorted(a).upperBound(4.2);
assert(equal(p, [ 5, 6 ]));
}
unittest
{
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto p = assumeSorted(a).equalRange(3);
assert(equal(p, [ 3, 3, 3 ]), text(p));
p = assumeSorted(a).equalRange(4);
assert(equal(p, [ 4, 4 ]), text(p));
p = assumeSorted(a).equalRange(2);
assert(equal(p, [ 2 ]));
p = assumeSorted(a).equalRange(0);
assert(p.empty);
p = assumeSorted(a).equalRange(7);
assert(p.empty);
p = assumeSorted(a).equalRange(3.0);
assert(equal(p, [ 3, 3, 3]));
}
unittest
{
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
if (a.length)
{
auto b = a[a.length / 2];
//auto r = sort(a);
//assert(r.contains(b));
}
}
unittest
{
auto a = [ 5, 7, 34, 345, 677 ];
auto r = assumeSorted(a);
a = null;
r = assumeSorted(a);
a = [ 1 ];
r = assumeSorted(a);
bool ok = true;
try
{
auto r2 = assumeSorted([ 677, 345, 34, 7, 5 ]);
debug ok = false;
}
catch (Throwable)
{
}
assert(ok);
}
/++
Wrapper which effectively makes it possible to pass a range by reference.
Both the original range and the RefRange will always have the exact same
elements. Any operation done on one will affect the other. So, for instance,
if it's passed to a function which would implicitly copy the original range
if it were passed to it, the original range is $(I not) copied but is
consumed as if it were a reference type.
Note that $(D save) works as normal and operates on a new range, so if
$(D save) is ever called on the RefRange, then no operations on the saved
range will affect the original.
Examples:
--------------------
import std.algorithm;
ubyte[] buffer = [1, 9, 45, 12, 22];
auto found1 = find(buffer, 45);
assert(found1 == [45, 12, 22]);
assert(buffer == [1, 9, 45, 12, 22]);
auto wrapped1 = refRange(&buffer);
auto found2 = find(wrapped1, 45);
assert(*found2.ptr == [45, 12, 22]);
assert(buffer == [45, 12, 22]);
auto found3 = find(wrapped2.save, 22);
assert(*found3.ptr == [22]);
assert(buffer == [45, 12, 22]);
string str = "hello world";
auto wrappedStr = refRange(&str);
assert(str.front == 'h');
str.popFrontN(5);
assert(str == " world");
assert(wrappedStr.front == ' ');
assert(*wrappedStr.ptr == " world");
--------------------
+/
struct RefRange(R)
if(isForwardRange!R)
{
public:
/++ +/
this(R* range) @safe pure nothrow
{
_range = range;
}
/++
This does not assign the pointer of $(D rhs) to this $(D RefRange).
Rather it assigns the range pointed to by $(D rhs) to the range pointed
to by this $(D RefRange). This is because $(I any) operation on a
$(D RefRange) is the same is if it occurred to the original range. The
one exception is when a $(D RefRange) is assigned $(D null) either
directly or because $(D rhs) is $(D null). In that case, $(D RefRange)
no longer refers to the original range but is $(D null).
Examples:
--------------------
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
auto wrapped1 = refRange(&buffer1);
auto wrapped2 = refRange(&buffer2);
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
assert(buffer1 != buffer2);
wrapped1 = wrapped2;
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer1 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [6, 7, 8, 9, 10]);
buffer2 = [11, 12, 13, 14, 15];
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer2 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
wrapped2 = null;
//The pointer changed for wrapped2 but not wrapped1.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is null);
assert(wrapped1.ptr !is wrapped2.ptr);
//buffer2 is not affected by the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
--------------------
+/
auto opAssign(RefRange rhs)
{
if(_range && rhs._range)
*_range = *rhs._range;
else
_range = rhs._range;
return this;
}
/++ +/
auto opAssign(typeof(null) rhs)
{
_range = null;
}
/++
A pointer to the wrapped range.
+/
@property inout(R*) ptr() @safe inout pure nothrow
{
return _range;
}
version(StdDdoc)
{
/++ +/
@property auto front() {assert(0);}
/++ Ditto +/
@property auto front() const {assert(0);}
/++ Ditto +/
@property auto front(ElementType!R value) {assert(0);}
}
else
{
@property auto front()
{
return (*_range).front;
}
static if(is(typeof((*(cast(const R*)_range)).front))) @property ElementType!R front() const
{
return (*_range).front;
}
static if(is(typeof((*_range).front = (*_range).front))) @property auto front(ElementType!R value)
{
return (*_range).front = value;
}
}
version(StdDdoc)
{
@property bool empty(); ///
@property bool empty() const; ///Ditto
}
else static if(isInfinite!R)
enum empty = false;
else
{
@property bool empty()
{
return (*_range).empty;
}
static if(is(typeof((*cast(const R*)_range).empty))) @property bool empty() const
{
return (*_range).empty;
}
}
/++ +/
@property void popFront()
{
return (*_range).popFront();
}
version(StdDdoc)
{
/++ +/
@property auto save() {assert(0);}
/++ Ditto +/
@property auto save() const {assert(0);}
/++ Ditto +/
auto opSlice() {assert(0);}
/++ Ditto +/
auto opSlice() const {assert(0);}
}
else
{
private static void _testSave(R)(R* range)
{
(*range).save;
}
static if(isSafe!(_testSave!R))
{
@property auto save() @trusted
{
mixin(_genSave());
}
static if(is(typeof((*cast(const R*)_range).save))) @property auto save() @trusted const
{
mixin(_genSave());
}
}
else
{
@property auto save()
{
mixin(_genSave());
}
static if(is(typeof((*cast(const R*)_range).save))) @property auto save() const
{
mixin(_genSave());
}
}
auto opSlice()()
{
return save;
}
auto opSlice()() const
{
return save;
}
private static string _genSave() @safe pure nothrow
{
return `import std.conv;` ~
`alias typeof((*_range).save) S;` ~
`static assert(isForwardRange!S, S.stringof ~ " is not a forward range.");` ~
`auto mem = new void[S.sizeof];` ~
`emplace!S(mem, cast(S)(*_range).save);` ~
`return RefRange!S(cast(S*)mem.ptr);`;
}
static assert(isForwardRange!RefRange);
}
version(StdDdoc)
{
/++
Only defined if $(D isBidirectionalRange!R) is $(D true).
+/
@property auto back() {assert(0);}
/++ Ditto +/
@property auto back() const {assert(0);}
/++ Ditto +/
@property auto back(ElementType!R value) {assert(0);}
}
else static if(isBidirectionalRange!R)
{
@property auto back()
{
return (*_range).back;
}
static if(is(typeof((*(cast(const R*)_range)).back))) @property ElementType!R back() const
{
return (*_range).back;
}
static if(is(typeof((*_range).back = (*_range).back))) @property auto back(ElementType!R value)
{
return (*_range).back = value;
}
}
/++ Ditto +/
static if(isBidirectionalRange!R) @property void popBack()
{
return (*_range).popBack();
}
version(StdDdoc)
{
/++
Only defined if $(D isRandomAccesRange!R) is $(D true).
+/
@property auto ref opIndex(IndexType)(IndexType index) {assert(0);}
/++ Ditto +/
@property auto ref opIndex(IndexType)(IndexType index) const {assert(0);}
}
else static if(isRandomAccessRange!R)
{
@property auto ref opIndex(IndexType)(IndexType index)
if(is(typeof((*_range)[index])))
{
return (*_range)[index];
}
@property auto ref opIndex(IndexType)(IndexType index) const
if(is(typeof((*cast(const R*)_range)[index])))
{
return (*_range)[index];
}
}
/++
Only defined if $(D hasMobileElements!R) and $(D isForwardRange!R) are
$(D true).
+/
static if(hasMobileElements!R && isForwardRange!R) @property auto moveFront()
{
return (*_range).moveFront();
}
/++
Only defined if $(D hasMobileElements!R) and $(D isBidirectionalRange!R)
are $(D true).
+/
static if(hasMobileElements!R && isBidirectionalRange!R) @property auto moveBack()
{
return (*_range).moveBack();
}
/++
Only defined if $(D hasMobileElements!R) and $(D isRandomAccessRange!R)
are $(D true).
+/
static if(hasMobileElements!R && isRandomAccessRange!R) @property auto moveAt(IndexType)(IndexType index)
if(is(typeof((*_range).moveAt(index))))
{
return (*_range).moveAt(index);
}
version(StdDdoc)
{
/++
Only defined if $(D hasLength!R) is $(D true).
+/
@property auto length() {assert(0);}
/++ Ditto +/
@property auto length() const {assert(0);}
}
else static if(hasLength!R)
{
@property auto length()
{
return (*_range).length;
}
static if(is(typeof((*cast(const R*)_range).length))) @property auto length() const
{
return (*_range).length;
}
}
version(StdDdoc)
{
/++
Only defined if $(D hasSlicing!R) is $(D true).
+/
@property auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) {assert(0);}
/++ Ditto +/
@property auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const {assert(0);}
}
else static if(hasSlicing!R)
{
@property auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end)
if(is(typeof((*_range)[begin .. end])))
{
mixin(_genOpSlice());
}
@property auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const
if(is(typeof((*cast(const R*)_range)[begin .. end])))
{
mixin(_genOpSlice());
}
private static string _genOpSlice() @safe pure nothrow
{
return `import std.conv;` ~
`alias typeof((*_range)[begin .. end]) S;` ~
`static assert(hasSlicing!S, S.stringof ~ " is not sliceable.");` ~
`auto mem = new void[S.sizeof];` ~
`emplace!S(mem, cast(S)(*_range)[begin .. end]);` ~
`return RefRange!S(cast(S*)mem.ptr);`;
}
}
private:
R* _range;
}
//Verify Example.
unittest
{
import std.algorithm;
ubyte[] buffer = [1, 9, 45, 12, 22];
auto found1 = find(buffer, 45);
assert(found1 == [45, 12, 22]);
assert(buffer == [1, 9, 45, 12, 22]);
auto wrapped1 = refRange(&buffer);
auto found2 = find(wrapped1, 45);
assert(*found2.ptr == [45, 12, 22]);
assert(buffer == [45, 12, 22]);
auto found3 = find(wrapped1.save, 22);
assert(*found3.ptr == [22]);
assert(buffer == [45, 12, 22]);
string str = "hello world";
auto wrappedStr = refRange(&str);
assert(str.front == 'h');
str.popFrontN(5);
assert(str == " world");
assert(wrappedStr.front == ' ');
assert(*wrappedStr.ptr == " world");
}
//Verify opAssign Example.
unittest
{
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
auto wrapped1 = refRange(&buffer1);
auto wrapped2 = refRange(&buffer2);
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
assert(buffer1 != buffer2);
wrapped1 = wrapped2;
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer1 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [6, 7, 8, 9, 10]);
buffer2 = [11, 12, 13, 14, 15];
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer2 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
wrapped2 = null;
//The pointer changed for wrapped2 but not wrapped1.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is null);
assert(wrapped1.ptr !is wrapped2.ptr);
//buffer2 is not affected by the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
}
unittest
{
import std.algorithm;
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto wrapper = refRange(&buffer);
auto p = wrapper.ptr;
auto f = wrapper.front;
wrapper.front = f;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
auto b = wrapper.back;
wrapper.back = b;
wrapper.popBack();
auto i = wrapper[0];
wrapper.moveFront();
wrapper.moveBack();
wrapper.moveAt(0);
auto l = wrapper.length;
auto sl = wrapper[0 .. 1];
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
const wrapper = refRange(&buffer);
const p = wrapper.ptr;
const f = wrapper.front;
const e = wrapper.empty;
const s = wrapper.save;
const b = wrapper.back;
const i = wrapper[0];
const l = wrapper.length;
const sl = wrapper[0 .. 1];
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto filtered = filter!"true"(buffer);
auto wrapper = refRange(&filtered);
auto p = wrapper.ptr;
auto f = wrapper.front;
wrapper.front = f;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
wrapper.moveFront();
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto filtered = filter!"true"(buffer);
const wrapper = refRange(&filtered);
const p = wrapper.ptr;
//Cannot currently be const. filter needs to be updated to handle const.
/+
const f = wrapper.front;
const e = wrapper.empty;
const s = wrapper.save;
+/
}
{
string str = "hello world";
auto wrapper = refRange(&str);
auto p = wrapper.ptr;
auto f = wrapper.front;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
auto b = wrapper.back;
wrapper.popBack();
}
}
//Test assignment.
unittest
{
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
RefRange!(ubyte[]) wrapper1;
RefRange!(ubyte[]) wrapper2 = refRange(&buffer2);
assert(wrapper1.ptr is null);
assert(wrapper2.ptr is &buffer2);
wrapper1 = refRange(&buffer1);
assert(wrapper1.ptr is &buffer1);
wrapper1 = wrapper2;
assert(wrapper1.ptr is &buffer1);
assert(buffer1 == buffer2);
wrapper1 = RefRange!(ubyte[]).init;
assert(wrapper1.ptr is null);
assert(wrapper2.ptr is &buffer2);
assert(buffer1 == buffer2);
assert(buffer1 == [6, 7, 8, 9, 10]);
wrapper2 = null;
assert(wrapper2.ptr is null);
assert(buffer2 == [6, 7, 8, 9, 10]);
}
unittest
{
import std.algorithm;
//Test that ranges are properly consumed.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(*find(wrapper, 41).ptr == [41, 3, 40, 4, 42, 9]);
assert(arr == [41, 3, 40, 4, 42, 9]);
assert(*drop(wrapper, 2).ptr == [40, 4, 42, 9]);
assert(arr == [40, 4, 42, 9]);
assert(equal(until(wrapper, 42), [40, 4]));
assert(arr == [42, 9]);
assert(find(wrapper, 12).empty);
assert(arr.empty);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
assert(*find(wrapper, "l").ptr == "llo, world-like object.");
assert(str == "llo, world-like object.");
assert(equal(take(wrapper, 5), "llo, "));
assert(str == "world-like object.");
}
//Test that operating on saved ranges does not consume the original.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
auto saved = wrapper.save;
saved.popFrontN(3);
assert(*saved.ptr == [41, 3, 40, 4, 42, 9]);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
auto saved = wrapper.save;
saved.popFrontN(13);
assert(*saved.ptr == "like object.");
assert(str == "Hello, world-like object.");
}
//Test that functions which use save work properly.
{
int[] arr = [1, 42];
auto wrapper = refRange(&arr);
assert(equal(commonPrefix(wrapper, [1, 27]), [1]));
}
{
int[] arr = [4, 5, 6, 7, 1, 2, 3];
auto wrapper = refRange(&arr);
assert(bringToFront(wrapper[0 .. 4], wrapper[4 .. arr.length]) == 3);
assert(arr == [1, 2, 3, 4, 5, 6, 7]);
}
//Test bidirectional functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(wrapper.back == 9);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
wrapper.popBack();
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42]);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
assert(wrapper.back == '.');
assert(str == "Hello, world-like object.");
wrapper.popBack();
assert(str == "Hello, world-like object");
}
//Test random access functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(wrapper[2] == 2);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
assert(*wrapper[3 .. 6].ptr, [41, 3, 40]);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
}
//Test move functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
auto t1 = wrapper.moveFront();
auto t2 = wrapper.moveBack();
wrapper.front = t2;
wrapper.back = t1;
assert(arr == [9, 42, 2, 41, 3, 40, 4, 42, 1]);
sort(wrapper.save);
assert(arr == [1, 2, 3, 4, 9, 40, 41, 42, 42]);
}
}
unittest
{
struct S
{
@property int front() @safe const pure nothrow { return 0; }
enum bool empty = false;
void popFront() @safe pure nothrow { }
@property auto save() @safe pure nothrow { return this; }
}
S s;
auto wrapper = refRange(&s);
static assert(isInfinite!(typeof(wrapper)));
}
unittest
{
class C
{
@property int front() @safe const pure nothrow { return 0; }
@property bool empty() @safe const pure nothrow { return false; }
void popFront() @safe pure nothrow { }
@property auto save() @safe pure nothrow { return this; }
}
static assert(isForwardRange!C);
auto c = new C;
auto cWrapper = refRange(&c);
static assert(is(typeof(cWrapper) == C));
assert(cWrapper is c);
struct S
{
@property int front() @safe const pure nothrow { return 0; }
@property bool empty() @safe const pure nothrow { return false; }
void popFront() @safe pure nothrow { }
int i = 27;
}
static assert(isInputRange!S);
static assert(!isForwardRange!S);
auto s = S(42);
auto sWrapper = refRange(&s);
static assert(is(typeof(sWrapper) == S));
assert(sWrapper == s);
}
/++
Helper function for constructing a $(LREF RefRange).
If the given range is not a forward range or it is a class type (and thus is
already a reference type), then the original range is returned rather than
a $(LREF RefRange).
+/
auto refRange(R)(R* range)
if(isForwardRange!R && !is(R == class))
{
return RefRange!R(range);
}
auto refRange(R)(R* range)
if((!isForwardRange!R && isInputRange!R) ||
is(R == class))
{
return *range;
}
|
D
|
/Users/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatik.build/Objects-normal/x86_64/UserDataService.o : /Users/Natalia/FunChatik/FunChatik/Controller/ProfileVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AddChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/LoginVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AvatarPickerVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChatVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/CreateAccountVC.swift /Users/Natalia/FunChatik/FunChatik/Services/UserDataService.swift /Users/Natalia/FunChatik/FunChatik/Services/MessegeService.swift /Users/Natalia/FunChatik/FunChatik/Services/AuthService.swift /Users/Natalia/FunChatik/FunChatik/Services/SocketService.swift /Users/Natalia/FunChatik/FunChatik/View/CircleImage.swift /Users/Natalia/FunChatik/FunChatik/Model/Message.swift /Users/Natalia/FunChatik/FunChatik/AppDelegate.swift /Users/Natalia/FunChatik/FunChatik/Model/Channel.swift /Users/Natalia/FunChatik/FunChatik/View/MessageCell.swift /Users/Natalia/FunChatik/FunChatik/View/ChannelCell.swift /Users/Natalia/FunChatik/FunChatik/View/AvatarCell.swift /Users/Natalia/FunChatik/FunChatik/View/RoundedButton.swift /Users/Natalia/FunChatik/FunChatik/Utilities/Constants.swift /Users/Natalia/FunChatik/Smack\ Assets/KeyboardBind\ View/KeyboardBoundView.swift /Users/Natalia/FunChatik/FunChatik/View/GradientView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/SocketIO.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.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/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/Socket.IO-Client-Swift-umbrella.h /Users/Natalia/FunChatik/FunChatik/Supporting\ Files/FunChatik-Bridging-Header.h /Users/Natalia/FunChatik/Smack\ Assets/SWReveal/SWRevealViewController.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/SocketIO-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-Swift.h /Users/Natalia/FunChatik/Pods/Starscream/zlib/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/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/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatik.build/Objects-normal/x86_64/UserDataService~partial.swiftmodule : /Users/Natalia/FunChatik/FunChatik/Controller/ProfileVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AddChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/LoginVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AvatarPickerVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChatVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/CreateAccountVC.swift /Users/Natalia/FunChatik/FunChatik/Services/UserDataService.swift /Users/Natalia/FunChatik/FunChatik/Services/MessegeService.swift /Users/Natalia/FunChatik/FunChatik/Services/AuthService.swift /Users/Natalia/FunChatik/FunChatik/Services/SocketService.swift /Users/Natalia/FunChatik/FunChatik/View/CircleImage.swift /Users/Natalia/FunChatik/FunChatik/Model/Message.swift /Users/Natalia/FunChatik/FunChatik/AppDelegate.swift /Users/Natalia/FunChatik/FunChatik/Model/Channel.swift /Users/Natalia/FunChatik/FunChatik/View/MessageCell.swift /Users/Natalia/FunChatik/FunChatik/View/ChannelCell.swift /Users/Natalia/FunChatik/FunChatik/View/AvatarCell.swift /Users/Natalia/FunChatik/FunChatik/View/RoundedButton.swift /Users/Natalia/FunChatik/FunChatik/Utilities/Constants.swift /Users/Natalia/FunChatik/Smack\ Assets/KeyboardBind\ View/KeyboardBoundView.swift /Users/Natalia/FunChatik/FunChatik/View/GradientView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/SocketIO.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.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/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/Socket.IO-Client-Swift-umbrella.h /Users/Natalia/FunChatik/FunChatik/Supporting\ Files/FunChatik-Bridging-Header.h /Users/Natalia/FunChatik/Smack\ Assets/SWReveal/SWRevealViewController.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/SocketIO-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-Swift.h /Users/Natalia/FunChatik/Pods/Starscream/zlib/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/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/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatik.build/Objects-normal/x86_64/UserDataService~partial.swiftdoc : /Users/Natalia/FunChatik/FunChatik/Controller/ProfileVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AddChannelVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/LoginVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/AvatarPickerVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/ChatVC.swift /Users/Natalia/FunChatik/FunChatik/Controller/CreateAccountVC.swift /Users/Natalia/FunChatik/FunChatik/Services/UserDataService.swift /Users/Natalia/FunChatik/FunChatik/Services/MessegeService.swift /Users/Natalia/FunChatik/FunChatik/Services/AuthService.swift /Users/Natalia/FunChatik/FunChatik/Services/SocketService.swift /Users/Natalia/FunChatik/FunChatik/View/CircleImage.swift /Users/Natalia/FunChatik/FunChatik/Model/Message.swift /Users/Natalia/FunChatik/FunChatik/AppDelegate.swift /Users/Natalia/FunChatik/FunChatik/Model/Channel.swift /Users/Natalia/FunChatik/FunChatik/View/MessageCell.swift /Users/Natalia/FunChatik/FunChatik/View/ChannelCell.swift /Users/Natalia/FunChatik/FunChatik/View/AvatarCell.swift /Users/Natalia/FunChatik/FunChatik/View/RoundedButton.swift /Users/Natalia/FunChatik/FunChatik/Utilities/Constants.swift /Users/Natalia/FunChatik/Smack\ Assets/KeyboardBind\ View/KeyboardBoundView.swift /Users/Natalia/FunChatik/FunChatik/View/GradientView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/SocketIO.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.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/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-umbrella.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/Socket.IO-Client-Swift-umbrella.h /Users/Natalia/FunChatik/FunChatik/Supporting\ Files/FunChatik-Bridging-Header.h /Users/Natalia/FunChatik/Smack\ Assets/SWReveal/SWRevealViewController.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Headers/SocketIO-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Headers/Starscream-Swift.h /Users/Natalia/FunChatik/Pods/Starscream/zlib/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Socket.IO-Client-Swift/SocketIO.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Natalia/FunChatik/Jenkins/build/Build/Products/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/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
|
// @@@DEPRECATED_2022-02@@@
/**
$(RED Deprecated. Use `core.sys.windows.sqlext` instead. This module will be
removed in February 2022.)
Declarations for interfacing with the ODBC library.
See_Also: $(LINK2 https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/odbc-api-reference,
ODBC API Reference on MSN Online)
*/
deprecated("Import core.sys.windows.sqlext instead")
module etc.c.odbc.sqlext;
public import core.sys.windows.sqlext;
|
D
|
import reggae;
import std.typecons;
enum commonUtFlags = "-g -debug -cov";
alias ut = dubTestTarget!(CompilerFlags(commonUtFlags),
LinkerFlags(),
CompilationMode.package_);
mixin build!(ut);
|
D
|
module gfm.math;
public import gfm.math.funcs,
gfm.math.half,
gfm.math.vector,
gfm.math.box,
gfm.math.matrix,
gfm.math.wideint,
gfm.math.rational,
gfm.math.quaternion,
gfm.math.shapes,
gfm.math.fixedpoint,
gfm.math.simplerng;
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.