code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
/Applications/XAMPP/xamppfiles/htdocs/testcode/build/happ.build/Release-iphoneos/happ.build/Objects-normal/armv7/ChangePassViewController.o : /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/RegisterController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/AccountViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/SignupViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/ChangePassViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/ViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule
/Applications/XAMPP/xamppfiles/htdocs/testcode/build/happ.build/Release-iphoneos/happ.build/Objects-normal/armv7/ChangePassViewController~partial.swiftmodule : /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/RegisterController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/AccountViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/SignupViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/ChangePassViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/ViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule
/Applications/XAMPP/xamppfiles/htdocs/testcode/build/happ.build/Release-iphoneos/happ.build/Objects-normal/armv7/ChangePassViewController~partial.swiftdoc : /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/RegisterController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/AccountViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/SignupViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/ChangePassViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/ViewController.swift /Applications/XAMPP/xamppfiles/htdocs/testcode/happ/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule
|
D
|
/*
Copyright (c) 2014-2021 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/**
* Copyright: Timur Gafarov 2014-2021.
* License: $(LINK2 boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Timur Gafarov, Andrey Penechko, Roman Vlasov
*/
module dlib.geometry.frustum;
import std.math;
import dlib.math.vector;
import dlib.math.matrix;
import dlib.geometry.plane;
import dlib.geometry.aabb;
import dlib.geometry.sphere;
/// Frustum object
struct Frustum
{
union
{
Plane[6] planes;
struct
{
Plane leftPlane;
Plane rightPlane;
Plane bottomPlane;
Plane topPlane;
Plane farPlane;
Plane nearPlane;
}
}
this(Matrix4x4f mvp)
{
fromMVP(mvp);
}
void fromMVP(Matrix4x4f mvp)
{
leftPlane.a = mvp[3] + mvp[0];
leftPlane.b = mvp[7] + mvp[4];
leftPlane.c = mvp[11] + mvp[8];
leftPlane.d = mvp[15] + mvp[12];
leftPlane.normalize();
leftPlane.vectorof = -leftPlane.vectorof;
rightPlane.a = mvp[3] - mvp[0];
rightPlane.b = mvp[7] - mvp[4];
rightPlane.c = mvp[11] - mvp[8];
rightPlane.d = mvp[15] - mvp[12];
rightPlane.normalize();
rightPlane.vectorof = -rightPlane.vectorof;
bottomPlane.a = mvp[3] + mvp[1];
bottomPlane.b = mvp[7] + mvp[5];
bottomPlane.c = mvp[11] + mvp[9];
bottomPlane.d = mvp[15] + mvp[13];
bottomPlane.normalize();
bottomPlane.vectorof = -bottomPlane.vectorof;
topPlane.a = mvp[3] - mvp[1];
topPlane.b = mvp[7] - mvp[5];
topPlane.c = mvp[11] - mvp[9];
topPlane.d = mvp[15] - mvp[13];
topPlane.normalize();
topPlane.vectorof = -topPlane.vectorof;
farPlane.a = mvp[3] - mvp[2];
farPlane.b = mvp[7] - mvp[6];
farPlane.c = mvp[11] - mvp[10];
farPlane.d = mvp[15] - mvp[14];
farPlane.normalize();
farPlane.vectorof = -farPlane.vectorof;
nearPlane.a = mvp[3] + mvp[2];
nearPlane.b = mvp[7] + mvp[6];
nearPlane.c = mvp[11] + mvp[10];
nearPlane.d = mvp[15] + mvp[14];
nearPlane.normalize();
nearPlane.vectorof = -nearPlane.vectorof;
}
bool containsPoint(Vector3f point, bool checkNearPlane = false)
{
int res = 0;
foreach(i, ref p; planes)
{
if (i == 5 && !checkNearPlane)
break;
if (p.distance(point) <= 0.0f)
res++;
}
return (res == (checkNearPlane? 6 : 5));
}
bool intersectsSphere(Sphere sphere)
{
float d;
foreach(i, ref p; planes)
{
d = p.distance(sphere.center);
if (d > sphere.radius)
return false;
}
return true;
}
bool intersectsAABB(
AABB aabb,
bool checkBoundariesOnly = false,
bool checkNearPlane = true)
{
bool result = !checkBoundariesOnly; // Inside
foreach (i, ref plane; planes)
{
if (i == 5 && !checkNearPlane)
break;
float d = dot(aabb.center, -plane.normal);
float r = aabb.size.x * abs(plane.normal.x) +
aabb.size.y * abs(plane.normal.y) +
aabb.size.z * abs(plane.normal.z);
float d_p_r = d + r;
float d_m_r = d - r;
if (d_p_r < plane.d)
{
result = false; // Outside
break;
}
else if(d_m_r < plane.d)
result = true; // Intersect
}
return result;
}
}
///
unittest
{
import dlib.math.transformation;
Matrix4x4f mvp = perspectiveMatrix(60.0f, 16.0f/9.0f, 0.1f, 1000.0f);
Frustum f = Frustum(mvp);
assert(f.containsPoint(Vector3f(0, 0, -10)));
Sphere s = Sphere(Vector3f(0, 0, 10), 1);
assert(!f.intersectsSphere(s));
AABB aabb = AABB(Vector3f(0, 0, 0), Vector3f(1, 1, 1));
assert(f.intersectsAABB(aabb));
}
|
D
|
/*
Copyright (c) 2019 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module dlib.concurrency;
public
{
import dlib.concurrency.threadpool;
import dlib.concurrency.workerthread;
import dlib.concurrency.taskqueue;
}
|
D
|
module user.views.layouts.index;
import user;
class IndexLayout : LayoutElement{
UserIndexDatastructure _datastructure;
this(UserIndexDatastructure datastructure){
super();
this._datastructure = datastructure;
this.init();
}
override void init(){
/+
this ~= new DashboardWidget(this._datastructure.dashboards);
this ~= new WhiterElement();
this ~= new QuickstatsWidget(this._datastructure.quickstats);
this ~= new WhiterElement();
this ~= new BlockArea(this._datastructure);
this ~= new WhiterElement();
+/
}
/+
class BlockArea : BlockAreaElement{
this(HomeIndexDatastructure datastructure){
super();
this ~= new Row(datastructure);
}
class Row : RowElement{
this(HomeIndexDatastructure datastructure){
super();
this ~= new Col1(datastructure, 8);
this ~= new Col2(datastructure, 4);
this ~= new ClearFixElement();
}
class Col1 : ColumnElement{
this(HomeIndexDatastructure datastructure, int grid = 12){
super(grid);
this ~= new Row(datastructure);
this ~= new ClearFixElement();
}
class Row : RowElement{
this(HomeIndexDatastructure datastructure){
super();
this ~= new PieChartWidget(datastructure.charts);
this ~= new RecentPostingsWidget(datastructure.recent_posting);
this ~= new TasksWidget(datastructure.tasks);
}
/+
class Tasks : DivElement{
this(){
super();
this ~= new Sass("col-md-6");
this ~= new TasksWidget();
}
}
+/
}
}
class Col2 : ColumnElement{
this(HomeIndexDatastructure datastructure, int grid = 12){
super(grid);
this ~= new UsaMapWidget(datastructure.live_visits);
//this ~= new DynamicChartWidget();
//this ~= new ActivityWidget();
this ~= new ClearFixElement();
}
}
}
}
+/
}
|
D
|
a small carved or molded figure
|
D
|
// Generated from RuleParser.g4 by ANTLR 4.7.2
import antlr.v4.runtime.ParserRuleContext;
import antlr.v4.runtime.tree.ErrorNode;
import antlr.v4.runtime.tree.TerminalNode;
import RuleParserListener;
import RuleParser: RuleParser;
/**
* This class provides an empty implementation of {@link RuleParserListener},
* which can be extended to create a listener which only needs to handle a subset
* of the available methods.
*/
public class RuleParserBaseListener : RuleParserListener {
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFile_input(RuleParser.File_inputContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFile_input(RuleParser.File_inputContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterRuledef(RuleParser.RuledefContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitRuledef(RuleParser.RuledefContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterImport_stmts(RuleParser.Import_stmtsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitImport_stmts(RuleParser.Import_stmtsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterRule_setting(RuleParser.Rule_settingContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitRule_setting(RuleParser.Rule_settingContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterClass_name(RuleParser.Class_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitClass_name(RuleParser.Class_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterRule_name(RuleParser.Rule_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitRule_name(RuleParser.Rule_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterLanguage(RuleParser.LanguageContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitLanguage(RuleParser.LanguageContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterImport_stmt(RuleParser.Import_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitImport_stmt(RuleParser.Import_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterBase_rules(RuleParser.Base_rulesContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitBase_rules(RuleParser.Base_rulesContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFuncdef(RuleParser.FuncdefContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFuncdef(RuleParser.FuncdefContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFunctionName(RuleParser.FunctionNameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFunctionName(RuleParser.FunctionNameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterParameters(RuleParser.ParametersContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitParameters(RuleParser.ParametersContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTypedargslist(RuleParser.TypedargslistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTypedargslist(RuleParser.TypedargslistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTfpdef_name(RuleParser.Tfpdef_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTfpdef_name(RuleParser.Tfpdef_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTfpdef_number(RuleParser.Tfpdef_numberContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTfpdef_number(RuleParser.Tfpdef_numberContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTfpdef_string(RuleParser.Tfpdef_stringContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTfpdef_string(RuleParser.Tfpdef_stringContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTfpdef_funct_stm(RuleParser.Tfpdef_funct_stmContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTfpdef_funct_stm(RuleParser.Tfpdef_funct_stmContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterSuite(RuleParser.SuiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitSuite(RuleParser.SuiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterStmt(RuleParser.StmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitStmt(RuleParser.StmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterSimple_stmt(RuleParser.Simple_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitSimple_stmt(RuleParser.Simple_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterSmall_stmt(RuleParser.Small_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitSmall_stmt(RuleParser.Small_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterString_stmt(RuleParser.String_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitString_stmt(RuleParser.String_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFunct_stmt(RuleParser.Funct_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFunct_stmt(RuleParser.Funct_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFunct_name(RuleParser.Funct_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFunct_name(RuleParser.Funct_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterDot_e(RuleParser.Dot_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitDot_e(RuleParser.Dot_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFunct_parameters(RuleParser.Funct_parametersContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFunct_parameters(RuleParser.Funct_parametersContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterVar_stmt(RuleParser.Var_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitVar_stmt(RuleParser.Var_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFlow_stmt(RuleParser.Flow_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFlow_stmt(RuleParser.Flow_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterBreak_stmt(RuleParser.Break_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitBreak_stmt(RuleParser.Break_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterContinue_stmt(RuleParser.Continue_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitContinue_stmt(RuleParser.Continue_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterDotted_as_name(RuleParser.Dotted_as_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitDotted_as_name(RuleParser.Dotted_as_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterDotted_as_names(RuleParser.Dotted_as_namesContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitDotted_as_names(RuleParser.Dotted_as_namesContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterDotted_name(RuleParser.Dotted_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitDotted_name(RuleParser.Dotted_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterDotted_name_first_part(RuleParser.Dotted_name_first_partContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitDotted_name_first_part(RuleParser.Dotted_name_first_partContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterDotted_name_part(RuleParser.Dotted_name_partContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitDotted_name_part(RuleParser.Dotted_name_partContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFirst_part_of_dotted_name(RuleParser.First_part_of_dotted_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFirst_part_of_dotted_name(RuleParser.First_part_of_dotted_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterCompound_stmt(RuleParser.Compound_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitCompound_stmt(RuleParser.Compound_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterIf_stmt(RuleParser.If_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitIf_stmt(RuleParser.If_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterIf_condition_and_suite(RuleParser.If_condition_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitIf_condition_and_suite(RuleParser.If_condition_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterElif_condition_and_suite(RuleParser.Elif_condition_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitElif_condition_and_suite(RuleParser.Elif_condition_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterElse_and_suite(RuleParser.Else_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitElse_and_suite(RuleParser.Else_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterCondition_and_suite(RuleParser.Condition_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitCondition_and_suite(RuleParser.Condition_and_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterCondition_with_value(RuleParser.Condition_with_valueContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitCondition_with_value(RuleParser.Condition_with_valueContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterCondition_without_value(RuleParser.Condition_without_valueContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitCondition_without_value(RuleParser.Condition_without_valueContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterCondition_only(RuleParser.Condition_onlyContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitCondition_only(RuleParser.Condition_onlyContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterOpen_paren(RuleParser.Open_parenContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitOpen_paren(RuleParser.Open_parenContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterClose_paren(RuleParser.Close_parenContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitClose_paren(RuleParser.Close_parenContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterR_equals(RuleParser.R_equalsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitR_equals(RuleParser.R_equalsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterR_not_equal(RuleParser.R_not_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitR_not_equal(RuleParser.R_not_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterElif_e(RuleParser.Elif_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitElif_e(RuleParser.Elif_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterElse_e(RuleParser.Else_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitElse_e(RuleParser.Else_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFor_stmt(RuleParser.For_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFor_stmt(RuleParser.For_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFor_testlist(RuleParser.For_testlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFor_testlist(RuleParser.For_testlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFor_exprlist(RuleParser.For_exprlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFor_exprlist(RuleParser.For_exprlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterBlock_stmt(RuleParser.Block_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitBlock_stmt(RuleParser.Block_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterBlock_suite(RuleParser.Block_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitBlock_suite(RuleParser.Block_suiteContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTest(RuleParser.TestContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTest(RuleParser.TestContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterOr_e(RuleParser.Or_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitOr_e(RuleParser.Or_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterAnd_test(RuleParser.And_testContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitAnd_test(RuleParser.And_testContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterAnd_e(RuleParser.And_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitAnd_e(RuleParser.And_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterNot_test(RuleParser.Not_testContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitNot_test(RuleParser.Not_testContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterNot(RuleParser.NotContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitNot(RuleParser.NotContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterComparison(RuleParser.ComparisonContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitComparison(RuleParser.ComparisonContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterLess_than(RuleParser.Less_thanContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitLess_than(RuleParser.Less_thanContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterGreater_than(RuleParser.Greater_thanContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitGreater_than(RuleParser.Greater_thanContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterEquals(RuleParser.EqualsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitEquals(RuleParser.EqualsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterGreater_equal(RuleParser.Greater_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitGreater_equal(RuleParser.Greater_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterLess_equal(RuleParser.Less_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitLess_equal(RuleParser.Less_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterNot_equal(RuleParser.Not_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitNot_equal(RuleParser.Not_equalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterExpr(RuleParser.ExprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitExpr(RuleParser.ExprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterXor_expr(RuleParser.Xor_exprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitXor_expr(RuleParser.Xor_exprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterAnd_expr(RuleParser.And_exprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitAnd_expr(RuleParser.And_exprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterArith_expr(RuleParser.Arith_exprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitArith_expr(RuleParser.Arith_exprContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFactor(RuleParser.FactorContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFactor(RuleParser.FactorContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterAtom_dotted_name(RuleParser.Atom_dotted_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitAtom_dotted_name(RuleParser.Atom_dotted_nameContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterAtom_funct_stmt(RuleParser.Atom_funct_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitAtom_funct_stmt(RuleParser.Atom_funct_stmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterNumber_e(RuleParser.Number_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitNumber_e(RuleParser.Number_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterString_e(RuleParser.String_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitString_e(RuleParser.String_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTrue_e(RuleParser.True_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTrue_e(RuleParser.True_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFalse_e(RuleParser.False_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFalse_e(RuleParser.False_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterLast_e(RuleParser.Last_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitLast_e(RuleParser.Last_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterFirst_e(RuleParser.First_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitFirst_e(RuleParser.First_eContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterAdd(RuleParser.AddContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitAdd(RuleParser.AddContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterMinus(RuleParser.MinusContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitMinus(RuleParser.MinusContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTestlist_comp(RuleParser.Testlist_compContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTestlist_comp(RuleParser.Testlist_compContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTrailer(RuleParser.TrailerContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTrailer(RuleParser.TrailerContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterSubscriptlist(RuleParser.SubscriptlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitSubscriptlist(RuleParser.SubscriptlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterSubscript(RuleParser.SubscriptContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitSubscript(RuleParser.SubscriptContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterSliceop(RuleParser.SliceopContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitSliceop(RuleParser.SliceopContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterExprlist(RuleParser.ExprlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitExprlist(RuleParser.ExprlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTestlist(RuleParser.TestlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTestlist(RuleParser.TestlistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterDictorsetmaker(RuleParser.DictorsetmakerContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitDictorsetmaker(RuleParser.DictorsetmakerContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterArglist(RuleParser.ArglistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitArglist(RuleParser.ArglistContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterArgument(RuleParser.ArgumentContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitArgument(RuleParser.ArgumentContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterElement(RuleParser.ElementContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitElement(RuleParser.ElementContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterContent(RuleParser.ContentContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitContent(RuleParser.ContentContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterXml_attribute(RuleParser.Xml_attributeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitXml_attribute(RuleParser.Xml_attributeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterTemplatesBegin(RuleParser.TemplatesBeginContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitTemplatesBegin(RuleParser.TemplatesBeginContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void enterEveryRule(ParserRuleContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void exitEveryRule(ParserRuleContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void visitTerminal(TerminalNode node) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
override public void visitErrorNode(ErrorNode node) { }
}
|
D
|
/Users/angelo/Developer/DroppedBits/DangerTest/.build/x86_64-apple-macosx/debug/Require.build/Require.swift.o : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/Require/Sources/Require.swift /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/Require.build/Require~partial.swiftmodule : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/Require/Sources/Require.swift /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/Require.build/Require~partial.swiftdoc : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/Require/Sources/Require.swift /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/Require.build/Require~partial.swiftsourceinfo : /Users/angelo/Developer/DroppedBits/DangerTest/.build/checkouts/Require/Sources/Require.swift /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
|
/*
# What Is This: programming samples
# Author: Makoto Takeshita <[email protected]>
# URL: http://simplesandsamples.com
# Version: UNBORN
#
# Usage:
# 1. git clone https://github.com/takeshitamakoto/sss.git
# 2. change the directory name to easy-to-use name. (e.g. sss -> sample)
# 3. open sss/src/filename when you need any help.
#
*/
import std.stdio;
void main()
{
writef("%d\n", 10 / 3);
writef("%d\n", 10 % 3);
}
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* 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/aggregate.d, _aggregate.d)
* Documentation: https://dlang.org/phobos/dmd_aggregate.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/aggregate.d
*/
module dmd.aggregate;
import cidrus;
import core.checkedint;
import dmd.aliasthis;
import dmd.arraytypes;
import dmd.gluelayer : Symbol;
import dmd.declaration;
import dmd.dscope;
import dmd.dstruct;
import dmd.дсимвол;
import dmd.dsymbolsem;
import dmd.dtemplate;
import dmd.errors;
import drc.ast.Expression;
import dmd.func;
import dmd.globals;
import drc.lexer.Id;
import drc.lexer.Identifier;
import dmd.mtype;
import drc.lexer.Tokens;
import dmd.typesem : defaultInit;
import drc.ast.Visitor;
enum Sizeok : цел
{
none, // size of aggregate is not yet able to compute
fwd, // size of aggregate is ready to compute
inProcess, // in the midst of computing the size
done, // size of aggregate is set correctly
}
enum Baseok : цел
{
none, // base classes not computed yet
start, // in process of resolving base classes
done, // all base classes are resolved
semanticdone, // all base classes semantic done
}
/**
* Перечень ClassKind используется в узлах AggregateDeclaration AST для
* определения типа компоновки структуры/класс/интерфейса или того,
* является ли этот класс анонимным. Если класс анонимен, то также полагается,
* что это класс D.
*/
enum ClassKind : цел
{
/// the aggregate is a d(efault) class
d,
/// the aggregate is a C++ struct/class/interface
cpp,
/// the aggregate is an Objective-C class/interface
objc,
}
/***********************************************************
*/
abstract class AggregateDeclaration : ScopeDsymbol
{
Тип тип;
КлассХранения класс_хранения;
Prot защита;
бцел structsize; // size of struct
бцел alignsize; // size of struct for alignment purposes
VarDeclarations fields; // VarDeclaration fields
Sizeok sizeok = Sizeok.none; // set when structsize содержит valid данные
ДСимвол deferred; // any deferred semantic2() or semantic3() symbol
/// specifies whether this is a D, C++, Objective-C or анонимный struct/class/interface
ClassKind classKind;
/* !=null if is nested
* pointing to the дсимвол that directly enclosing it.
* 1. The function that enclosing it (nested struct and class)
* 2. The class that enclosing it (nested class only)
* 3. If enclosing aggregate is template, its enclosing дсимвол.
* See AggregateDeclaraton::makeNested for the details.
*/
ДСимвол enclosing;
VarDeclaration vthis; // 'this' параметр if this aggregate is nested
VarDeclaration vthis2; // 'this' параметр if this aggregate is a template and is nested
// Special member functions
FuncDeclarations invs; // МассивДРК of invariants
FuncDeclaration inv; // invariant
NewDeclaration aggNew; // allocator
// CtorDeclaration or TemplateDeclaration
ДСимвол ctor;
// default constructor - should have no arguments, because
// it would be stored in TypeInfo_Class.defaultConstructor
CtorDeclaration defaultCtor;
AliasThis aliasthis; // forward unresolved lookups to aliasthis
бул noDefaultCtor; // no default construction
DtorDeclarations dtors; // МассивДРК of destructors
DtorDeclaration dtor; // aggregate destructor
DtorDeclaration primaryDtor; // non-deleting C++ destructor, same as dtor for D
DtorDeclaration tidtor; // aggregate destructor используется in TypeInfo (must have extern(D) ABI)
FuncDeclaration fieldDtor; // aggregate destructor for just the fields
Выражение getRTInfo; // pointer to СМ info generated by объект.RTInfo(this)
final this(ref Место место, Идентификатор2 ид)
{
super(место, ид);
защита = Prot(Prot.Kind.public_);
}
/***************************************
* Create a new scope from sc.
* semantic, semantic2 and semantic3 will use this for aggregate члены.
*/
Scope* newScope(Scope* sc)
{
auto sc2 = sc.сунь(this);
sc2.stc &= STCFlowThruAggregate;
sc2.родитель = this;
sc2.inunion = isUnionDeclaration();
sc2.защита = Prot(Prot.Kind.public_);
sc2.explicitProtection = 0;
sc2.aligndecl = null;
sc2.userAttribDecl = null;
sc2.namespace = null;
return sc2;
}
override final проц setScope(Scope* sc)
{
// Might need a scope to resolve forward references. The check for
// semanticRun prevents unnecessary setting of _scope during deferred
// setScope phases for aggregates which already finished semantic().
// See https://issues.dlang.org/show_bug.cgi?ид=16607
if (semanticRun < PASS.semanticdone)
ScopeDsymbol.setScope(sc);
}
/***************************************
* Find all instance fields, then сунь them into `fields`.
*
* Runs semantic() for all instance field variables, but also
* the field types can remain yet not resolved forward references,
* except direct recursive definitions.
* After the process sizeok is set to Sizeok.fwd.
*
* Возвращает:
* нет if any errors occur.
*/
final бул determineFields()
{
if (_scope)
dsymbolSemantic(this, null);
if (sizeok != Sizeok.none)
return да;
//printf("determineFields() %s, fields.dim = %d\n", вТкст0(), fields.dim);
// determineFields can be called recursively from one of the fields's v.semantic
fields.устДим(0);
static цел func(ДСимвол s, ук param)
{
auto v = s.isVarDeclaration();
if (!v)
return 0;
if (v.класс_хранения & STC.manifest)
return 0;
auto ad = cast(AggregateDeclaration)param;
if (v.semanticRun < PASS.semanticdone)
v.dsymbolSemantic(null);
// Return in case a recursive determineFields triggered by v.semantic already finished
if (ad.sizeok != Sizeok.none)
return 1;
if (v.aliassym)
return 0; // If this variable was really a кортеж, skip it.
if (v.класс_хранения & (STC.static_ | STC.extern_ | STC.tls | STC.gshared | STC.manifest | STC.ctfe | STC.шаблонпараметр))
return 0;
if (!v.isField() || v.semanticRun < PASS.semanticdone)
return 1; // unresolvable forward reference
ad.fields.сунь(v);
if (v.класс_хранения & STC.ref_)
return 0;
auto tv = v.тип.baseElemOf();
if (tv.ty != Tstruct)
return 0;
if (ad == (cast(TypeStruct)tv).sym)
{
ткст0 psz = (v.тип.toBasetype().ty == Tsarray) ? "static массив of " : "";
ad.выведиОшибку("cannot have field `%s` with %ssame struct тип", v.вТкст0(), psz);
ad.тип = Тип.terror;
ad.errors = да;
return 1;
}
return 0;
}
if (члены)
{
for (т_мера i = 0; i < члены.dim; i++)
{
auto s = (*члены)[i];
if (s.apply(&func, cast(ук)this))
{
if (sizeok != Sizeok.none)
{
// recursive determineFields already finished
return да;
}
return нет;
}
}
}
if (sizeok != Sizeok.done)
sizeok = Sizeok.fwd;
return да;
}
/***************************************
* Возвращает:
* The total number of fields minus the number of hidden fields.
*/
final т_мера nonHiddenFields()
{
return fields.dim - isNested() - (vthis2 !is null);
}
/***************************************
* Collect all instance fields, then determine instance size.
* Возвращает:
* нет if failed to determine the size.
*/
final бул determineSize(Место место)
{
//printf("AggregateDeclaration::determineSize() %s, sizeok = %d\n", вТкст0(), sizeok);
// The previous instance size finalizing had:
if (тип.ty == Terror)
return нет; // failed already
if (sizeok == Sizeok.done)
return да; // succeeded
if (!члены)
{
выведиОшибку(место, "неизвестен размер");
return нет;
}
if (_scope)
dsymbolSemantic(this, null);
// Determine the instance size of base class first.
if (auto cd = isClassDeclaration())
{
cd = cd.baseClass;
if (cd && !cd.determineSize(место))
goto Lfail;
}
// Determine instance fields when sizeok == Sizeok.none
if (!determineFields())
goto Lfail;
if (sizeok != Sizeok.done)
finalizeSize();
// this aggregate тип has:
if (тип.ty == Terror)
return нет; // marked as invalid during the finalizing.
if (sizeok == Sizeok.done)
return да; // succeeded to calculate instance size.
Lfail:
// There's unresolvable forward reference.
if (тип != Тип.terror)
выведиОшибку(место, "no size because of forward reference");
// Don't cache errors from speculative semantic, might be resolvable later.
// https://issues.dlang.org/show_bug.cgi?ид=16574
if (!глоб2.gag)
{
тип = Тип.terror;
errors = да;
}
return нет;
}
abstract проц finalizeSize();
override final d_uns64 size(ref Место место)
{
//printf("+AggregateDeclaration::size() %s, scope = %p, sizeok = %d\n", вТкст0(), _scope, sizeok);
бул ok = determineSize(место);
//printf("-AggregateDeclaration::size() %s, scope = %p, sizeok = %d\n", вТкст0(), _scope, sizeok);
return ok ? structsize : SIZE_INVALID;
}
/***************************************
* Calculate field[i].overlapped and overlapUnsafe, and check that all of explicit
* field initializers have unique memory space on instance.
* Возвращает:
* да if any errors happen.
*/
final бул checkOverlappedFields()
{
//printf("AggregateDeclaration::checkOverlappedFields() %s\n", вТкст0());
assert(sizeok == Sizeok.done);
т_мера nfields = fields.dim;
if (isNested())
{
auto cd = isClassDeclaration();
if (!cd || !cd.baseClass || !cd.baseClass.isNested())
nfields--;
if (vthis2 && !(cd && cd.baseClass && cd.baseClass.vthis2))
nfields--;
}
бул errors = нет;
// Fill in missing any elements with default initializers
foreach (i; new бцел[0 .. nfields])
{
auto vd = fields[i];
if (vd.errors)
{
errors = да;
continue;
}
const vdIsVoidInit = vd._иниц && vd._иниц.isVoidInitializer();
// Find overlapped fields with the hole [vd.смещение .. vd.смещение.size()].
foreach (j; new бцел[0 .. nfields])
{
if (i == j)
continue;
auto v2 = fields[j];
if (v2.errors)
{
errors = да;
continue;
}
if (!vd.isOverlappedWith(v2))
continue;
// vd and v2 are overlapping.
vd.overlapped = да;
v2.overlapped = да;
if (!MODimplicitConv(vd.тип.mod, v2.тип.mod))
v2.overlapUnsafe = да;
if (!MODimplicitConv(v2.тип.mod, vd.тип.mod))
vd.overlapUnsafe = да;
if (i > j)
continue;
if (!v2._иниц)
continue;
if (v2._иниц.isVoidInitializer())
continue;
if (vd._иниц && !vdIsVoidInit && v2._иниц)
{
.выведиОшибку(место, "overlapping default initialization for field `%s` and `%s`", v2.вТкст0(), vd.вТкст0());
errors = да;
}
else if (v2._иниц && i < j)
{
// @@@DEPRECATED_v2.086@@@.
.deprecation(v2.место, "union field `%s` with default initialization `%s` must be before field `%s`",
v2.вТкст0(), v2._иниц.вТкст0(), vd.вТкст0());
//errors = да;
}
}
}
return errors;
}
/***************************************
* Fill out remainder of elements[] with default initializers for fields[].
* Параметры:
* место = location
* elements = explicit arguments which given to construct объект.
* ctorinit = да if the elements will be используется for default initialization.
* Возвращает:
* нет if any errors occur.
* Otherwise, returns да and the missing arguments will be pushed in elements[].
*/
final бул fill(Место место, Выражения* elements, бул ctorinit)
{
//printf("AggregateDeclaration::fill() %s\n", вТкст0());
assert(sizeok == Sizeok.done);
assert(elements);
const nfields = nonHiddenFields();
бул errors = нет;
т_мера dim = elements.dim;
elements.устДим(nfields);
foreach (т_мера i; new бцел[dim .. nfields])
(*elements)[i] = null;
// Fill in missing any elements with default initializers
foreach (i; new бцел[0 .. nfields])
{
if ((*elements)[i])
continue;
auto vd = fields[i];
auto vx = vd;
if (vd._иниц && vd._иниц.isVoidInitializer())
vx = null;
// Find overlapped fields with the hole [vd.смещение .. vd.смещение.size()].
т_мера fieldi = i;
foreach (j; new бцел[0 .. nfields])
{
if (i == j)
continue;
auto v2 = fields[j];
if (!vd.isOverlappedWith(v2))
continue;
if ((*elements)[j])
{
vx = null;
break;
}
if (v2._иниц && v2._иниц.isVoidInitializer())
continue;
version (all)
{
/* Prefer first found non-проц-initialized field
* union U { цел a; цел b = 2; }
* U u; // Error: overlapping initialization for field a and b
*/
if (!vx)
{
vx = v2;
fieldi = j;
}
else if (v2._иниц)
{
.выведиОшибку(место, "overlapping initialization for field `%s` and `%s`", v2.вТкст0(), vd.вТкст0());
errors = да;
}
}
else
{
// fixes https://issues.dlang.org/show_bug.cgi?ид=1432 by enabling this path always
/* Prefer explicitly initialized field
* union U { цел a; цел b = 2; }
* U u; // OK (u.b == 2)
*/
if (!vx || !vx._иниц && v2._иниц)
{
vx = v2;
fieldi = j;
}
else if (vx != vd && !vx.isOverlappedWith(v2))
{
// Both vx and v2 fills vd, but vx and v2 does not overlap
}
else if (vx._иниц && v2._иниц)
{
.выведиОшибку(место, "overlapping default initialization for field `%s` and `%s`",
v2.вТкст0(), vd.вТкст0());
errors = да;
}
else
assert(vx._иниц || !vx._иниц && !v2._иниц);
}
}
if (vx)
{
Выражение e;
if (vx.тип.size() == 0)
{
e = null;
}
else if (vx._иниц)
{
assert(!vx._иниц.isVoidInitializer());
if (vx.inuse) // https://issues.dlang.org/show_bug.cgi?ид=18057
{
vx.выведиОшибку(место, "recursive initialization of field");
errors = да;
}
else
e = vx.getConstInitializer(нет);
}
else
{
if ((vx.класс_хранения & STC.nodefaultctor) && !ctorinit)
{
.выведиОшибку(место, "field `%s.%s` must be initialized because it has no default constructor",
тип.вТкст0(), vx.вТкст0());
errors = да;
}
/* https://issues.dlang.org/show_bug.cgi?ид=12509
* Get the element of static массив тип.
*/
Тип telem = vx.тип;
if (telem.ty == Tsarray)
{
/* We cannot use Тип::baseElemOf() here.
* If the bottom of the Tsarray is an enum тип, baseElemOf()
* will return the base of the enum, and its default инициализатор
* would be different from the enum's.
*/
while (telem.toBasetype().ty == Tsarray)
telem = (cast(TypeSArray)telem.toBasetype()).следщ;
if (telem.ty == Tvoid)
telem = Тип.tuns8.addMod(telem.mod);
}
if (telem.needsNested() && ctorinit)
e = telem.defaultInit(место);
else
e = telem.defaultInitLiteral(место);
}
(*elements)[fieldi] = e;
}
}
foreach (e; *elements)
{
if (e && e.op == ТОК2.error)
return нет;
}
return !errors;
}
/****************************
* Do byte or word alignment as necessary.
* Align sizes of 0, as we may not know массив sizes yet.
* Параметры:
* alignment = struct alignment that is in effect
* size = alignment requirement of field
* poffset = pointer to смещение to be aligned
*/
extern (D) static проц alignmember(structalign_t alignment, бцел size, бцел* poffset)
{
//printf("alignment = %d, size = %d, смещение = %d\n",alignment,size,смещение);
switch (alignment)
{
case cast(structalign_t)1:
// No alignment
break;
case cast(structalign_t)STRUCTALIGN_DEFAULT:
// Alignment in Target::fieldalignsize must match what the
// corresponding C compiler's default alignment behavior is.
assert(size > 0 && !(size & (size - 1)));
*poffset = (*poffset + size - 1) & ~(size - 1);
break;
default:
// Align on alignment boundary, which must be a positive power of 2
assert(alignment > 0 && !(alignment & (alignment - 1)));
*poffset = (*poffset + alignment - 1) & ~(alignment - 1);
break;
}
}
/****************************************
* Place a member (mem) into an aggregate (agg), which can be a struct, union or class
* Возвращает:
* смещение to place field at
*
* nextoffset: следщ location in aggregate
* memsize: size of member
* memalignsize: natural alignment of member
* alignment: alignment in effect for this member
* paggsize: size of aggregate (updated)
* paggalignsize: alignment of aggregate (updated)
* isunion: the aggregate is a union
*/
extern (D) static бцел placeField(бцел* nextoffset, бцел memsize, бцел memalignsize,
structalign_t alignment, бцел* paggsize, бцел* paggalignsize, бул isunion)
{
бцел ofs = *nextoffset;
const бцел actualAlignment =
alignment == STRUCTALIGN_DEFAULT ? memalignsize : alignment;
// Гарант no overflow
бул overflow;
const sz = addu(memsize, actualAlignment, overflow);
addu(ofs, sz, overflow);
if (overflow) assert(0);
alignmember(alignment, memalignsize, &ofs);
бцел memoffset = ofs;
ofs += memsize;
if (ofs > *paggsize)
*paggsize = ofs;
if (!isunion)
*nextoffset = ofs;
if (*paggalignsize < actualAlignment)
*paggalignsize = actualAlignment;
return memoffset;
}
override final Тип getType()
{
return тип;
}
// is aggregate deprecated?
override final бул isDeprecated()
{
return !!(this.класс_хранения & STC.deprecated_);
}
/// Flag this aggregate as deprecated
final проц setDeprecated()
{
this.класс_хранения |= STC.deprecated_;
}
/****************************************
* Возвращает да if there's an extra member which is the 'this'
* pointer to the enclosing context (enclosing aggregate or function)
*/
final бул isNested()
{
return enclosing !is null;
}
/* Append vthis field (this.tupleof[$-1]) to make this aggregate тип nested.
*/
extern (D) final проц makeNested()
{
if (enclosing) // if already nested
return;
if (sizeok == Sizeok.done)
return;
if (isUnionDeclaration() || isInterfaceDeclaration())
return;
if (класс_хранения & STC.static_)
return;
// If nested struct, add in hidden 'this' pointer to outer scope
auto s = toParentLocal();
if (!s)
s = toParent2();
if (!s)
return;
Тип t = null;
if (auto fd = s.isFuncDeclaration())
{
enclosing = fd;
/* https://issues.dlang.org/show_bug.cgi?ид=14422
* If a nested class родитель is a function, its
* context pointer (== `outer`) should be ук always.
*/
t = Тип.tvoidptr;
}
else if (auto ad = s.isAggregateDeclaration())
{
if (isClassDeclaration() && ad.isClassDeclaration())
{
enclosing = ad;
}
else if (isStructDeclaration())
{
if (auto ti = ad.родитель.isTemplateInstance())
{
enclosing = ti.enclosing;
}
}
t = ad.handleType();
}
if (enclosing)
{
//printf("makeNested %s, enclosing = %s\n", вТкст0(), enclosing.вТкст0());
assert(t);
if (t.ty == Tstruct)
t = Тип.tvoidptr; // t should not be a ref тип
assert(!vthis);
vthis = new ThisDeclaration(место, t);
//vthis.класс_хранения |= STC.ref_;
// Emulate vthis.addMember()
члены.сунь(vthis);
// Emulate vthis.dsymbolSemantic()
vthis.класс_хранения |= STC.field;
vthis.родитель = this;
vthis.защита = Prot(Prot.Kind.public_);
vthis.alignment = t.alignment();
vthis.semanticRun = PASS.semanticdone;
if (sizeok == Sizeok.fwd)
fields.сунь(vthis);
makeNested2();
}
}
/* Append vthis2 field (this.tupleof[$-1]) to add a second context pointer.
*/
extern (D) final проц makeNested2()
{
if (vthis2)
return;
if (!vthis)
makeNested(); // can't add second before first
if (!vthis)
return;
if (sizeok == Sizeok.done)
return;
if (isUnionDeclaration() || isInterfaceDeclaration())
return;
if (класс_хранения & STC.static_)
return;
auto s0 = toParentLocal();
auto s = toParent2();
if (!s || !s0 || s == s0)
return;
auto cd = s.isClassDeclaration();
Тип t = cd ? cd.тип : Тип.tvoidptr;
vthis2 = new ThisDeclaration(место, t);
//vthis2.класс_хранения |= STC.ref_;
// Emulate vthis2.addMember()
члены.сунь(vthis2);
// Emulate vthis2.dsymbolSemantic()
vthis2.класс_хранения |= STC.field;
vthis2.родитель = this;
vthis2.защита = Prot(Prot.Kind.public_);
vthis2.alignment = t.alignment();
vthis2.semanticRun = PASS.semanticdone;
if (sizeok == Sizeok.fwd)
fields.сунь(vthis2);
}
override final бул isExport()
{
return защита.вид == Prot.Kind.export_;
}
/*******************************************
* Look for constructor declaration.
*/
final ДСимвол searchCtor()
{
auto s = search(Место.initial, Id.ctor);
if (s)
{
if (!(s.isCtorDeclaration() ||
s.isTemplateDeclaration() ||
s.isOverloadSet()))
{
s.выведиОшибку("is not a constructor; identifiers starting with `__` are reserved for the implementation");
errors = да;
s = null;
}
}
if (s && s.toParent() != this)
s = null; // search() looks through ancestor classes
if (s)
{
// Finish all constructors semantics to determine this.noDefaultCtor.
struct SearchCtor
{
static цел fp(ДСимвол s, ук ctxt)
{
auto f = s.isCtorDeclaration();
if (f && f.semanticRun == PASS.init)
f.dsymbolSemantic(null);
return 0;
}
}
for (т_мера i = 0; i < члены.dim; i++)
{
auto sm = (*члены)[i];
sm.apply(&SearchCtor.fp, null);
}
}
return s;
}
override final Prot prot()
{
return защита;
}
// 'this' тип
final Тип handleType()
{
return тип;
}
// Back end
Symbol* stag; // tag symbol for debug данные
Symbol* sinit;
override final AggregateDeclaration isAggregateDeclaration()
{
return this;
}
override проц прими(Визитор2 v)
{
v.посети(this);
}
}
|
D
|
/home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectHTTP.build/HTTPHeaders.swift.o : /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPMethod.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/MimeType.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPResponse.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/Routing.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/MimeReader.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/StaticFileHandler.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPFilter.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/TypedRoutes.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPHeaders.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPRequest.swift /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectLib.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectThread.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectCrypto.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectNet.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-LinuxBridge.git--857502363204932241/LinuxBridge/include/LinuxBridge.h /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-COpenSSL-Linux.git--1081412588593993798/COpenSSL/include/openssl.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/LinuxBridge.build/module.modulemap /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-COpenSSL-Linux.git--1081412588593993798/COpenSSL/include/module.modulemap
/home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectHTTP.build/HTTPHeaders~partial.swiftmodule : /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPMethod.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/MimeType.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPResponse.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/Routing.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/MimeReader.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/StaticFileHandler.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPFilter.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/TypedRoutes.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPHeaders.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPRequest.swift /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectLib.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectThread.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectCrypto.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectNet.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-LinuxBridge.git--857502363204932241/LinuxBridge/include/LinuxBridge.h /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-COpenSSL-Linux.git--1081412588593993798/COpenSSL/include/openssl.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/LinuxBridge.build/module.modulemap /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-COpenSSL-Linux.git--1081412588593993798/COpenSSL/include/module.modulemap
/home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectHTTP.build/HTTPHeaders~partial.swiftdoc : /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPMethod.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/MimeType.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPResponse.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/Routing.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/MimeReader.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/StaticFileHandler.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPFilter.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/TypedRoutes.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPHeaders.swift /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-HTTP.git-5256129367415923432/Sources/PerfectHTTP/HTTPRequest.swift /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectLib.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectThread.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectCrypto.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/PerfectNet.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-LinuxBridge.git--857502363204932241/LinuxBridge/include/LinuxBridge.h /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-COpenSSL-Linux.git--1081412588593993798/COpenSSL/include/openssl.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/user/LukaTubic/PerfectTemplate/.build/x86_64-unknown-linux/debug/LinuxBridge.build/module.modulemap /home/user/LukaTubic/PerfectTemplate/.build/checkouts/Perfect-COpenSSL-Linux.git--1081412588593993798/COpenSSL/include/module.modulemap
|
D
|
module clang.c.rewrite;
import clang.c.index;
extern (C):
@trusted:
alias CXRewriter = void*;
/**
* Create CXRewriter.
*/
CXRewriter clang_CXRewriter_create (CXTranslationUnit TU);
/**
* Insert the specified string at the specified location in the original buffer.
*/
void clang_CXRewriter_insertTextBefore (
CXRewriter Rew,
CXSourceLocation Loc,
const(char)* Insert);
/**
* Replace the specified range of characters in the input with the specified
* replacement.
*/
void clang_CXRewriter_replaceText (
CXRewriter Rew,
CXSourceRange ToBeReplaced,
const(char)* Replacement);
/**
* Remove the specified range.
*/
void clang_CXRewriter_removeText (CXRewriter Rew, CXSourceRange ToBeRemoved);
/**
* Save all changed files to disk.
* Returns 1 if any files were not saved successfully, returns 0 otherwise.
*/
int clang_CXRewriter_overwriteChangedFiles (CXRewriter Rew);
/**
* Write out rewritten version of the main file to stdout.
*/
void clang_CXRewriter_writeMainFileToStdOut (CXRewriter Rew);
/**
* Free the given CXRewriter.
*/
void clang_CXRewriter_dispose (CXRewriter Rew);
|
D
|
/**
* Copyright: Enalye
* License: Zlib
* Authors: Enalye
*/
module primidi.script.sprite;
import std.conv : to;
import grimoire, atelier;
package void loadSpriteLibrary(GrLibrary library) {
auto defSprite = library.addForeign("Sprite");
auto defTex = grGetForeignType("Texture");
auto defColor = grGetClassType("Color");
auto defBlend = grGetEnumType("Blend");
library.addPrimitive(&_makeSpriteT, "Sprite", [defTex], [defSprite]);
library.addPrimitive(&_makeSpriteTClip, "Sprite", [
defTex, grInt, grInt, grInt, grInt
], [defSprite]);
library.addPrimitive(&_makeSpriteS, "Sprite", [defSprite], [defSprite]);
library.addPrimitive(&_setSpriteClip, "setClip", [
defSprite, grInt, grInt, grInt, grInt
]);
library.addPrimitive(&_setSpriteAngle, "setAngle", [defSprite, grReal]);
library.addPrimitive(&_setSpriteAnchor, "setAnchor", [
defSprite, grReal, grReal
]);
library.addPrimitive(&_setSpriteColor, "setColor", [defSprite, defColor]);
library.addPrimitive(&_setSpriteAlpha, "setAlpha", [defSprite, grReal]);
library.addPrimitive(&_setSpriteSize, "setSize", [
defSprite, grReal, grReal
]);
library.addPrimitive(&_getSpriteSize, "getSize", [defSprite], [
grReal, grReal
]);
library.addPrimitive(&_getSpriteWidth, "getWidth", [defSprite], [grReal]);
library.addPrimitive(&_getSpriteHeight, "getHeight", [defSprite], [grReal]);
library.addPrimitive(&_setSpriteScale, "setScale", [
defSprite, grReal, grReal
]);
library.addPrimitive(&_getSpriteScale, "getScale", [defSprite], [
grReal, grReal
]);
library.addPrimitive(&_setSpriteFlip, "setFlip", [defSprite, grInt]);
library.addPrimitive(&_getSpriteFlip, "setFlip", [defSprite], [grInt]);
library.addPrimitive(&_setSpriteBlend, "setBlend", [defSprite, defBlend]);
library.addPrimitive(&_getSpriteBlend, "getBlend", [defSprite], [grInt]);
library.addPrimitive(&_spriteFit, "fit", [defSprite, grReal, grReal]);
library.addPrimitive(&_spriteContain, "contain", [
defSprite, grReal, grReal
]);
library.addPrimitive(&_drawSprite, "draw", [defSprite, grReal, grReal]);
//library.addPrimitive(&_createText, "createText", ["font", "text"], [defFont, grString], [defSprite]);
}
private void _makeSpriteT(GrCall call) {
Sprite sprite = new Sprite(call.getForeign!Texture(0));
call.setForeign(sprite);
}
private void _makeSpriteTClip(GrCall call) {
Sprite sprite = new Sprite(call.getForeign!Texture(0),
Vec4i(cast(int) call.getInt(1), cast(int) call.getInt(2),
cast(int) call.getInt(3), cast(int) call.getInt(4)));
call.setForeign(sprite);
}
private void _makeSpriteS(GrCall call) {
Sprite sprite = new Sprite(call.getForeign!Sprite(0));
call.setForeign(sprite);
}
private void _setSpriteClip(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.clip.x = cast(int) call.getInt(1);
sprite.clip.y = cast(int) call.getInt(2);
sprite.clip.z = cast(int) call.getInt(3);
sprite.clip.w = cast(int) call.getInt(4);
}
private void _setSpriteAngle(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.angle = call.getReal(1);
}
private void _setSpriteAnchor(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.anchor = Vec2f(call.getReal(1), call.getReal(2));
}
private void _setSpriteColor(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
GrObject c = call.getObject(1);
if (!sprite || !c) {
call.raise("Null parameter");
return;
}
Color color = Color(c.getReal("r"), c.getReal("g"), c.getReal("b"));
sprite.color = color;
}
private void _setSpriteAlpha(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.alpha = call.getReal(1);
}
private void _setSpriteSize(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.size = Vec2f(call.getReal(1), call.getReal(2));
}
private void _getSpriteSize(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
call.setReal(sprite.size.x);
call.setReal(sprite.size.y);
}
private void _getSpriteWidth(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
call.setReal(sprite.size.x);
}
private void _getSpriteHeight(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
call.setReal(sprite.size.y);
}
private void _setSpriteScale(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.scale = Vec2f(call.getReal(1), call.getReal(2));
}
private void _getSpriteScale(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
call.setReal(sprite.scale.x);
call.setReal(sprite.scale.y);
}
private void _setSpriteFlip(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
GrInt flip = call.getInt(1);
if (flip >= 4 || flip < 0)
flip = 0;
sprite.flip = cast(Flip) flip;
}
private void _getSpriteFlip(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
call.setInt(sprite.flip);
}
private void _setSpriteBlend(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.blend = call.getEnum!Blend(1);
}
private void _getSpriteBlend(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
call.setInt(sprite.blend);
}
private void _spriteFit(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.fit(Vec2f(call.getReal(1), call.getReal(2)));
}
private void _spriteContain(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.contain(Vec2f(call.getReal(1), call.getReal(2)));
}
private void _drawSprite(GrCall call) {
Sprite sprite = call.getForeign!Sprite(0);
if (!sprite) {
call.raise("Null parameter");
return;
}
sprite.draw(Vec2f(call.getReal(1), call.getReal(2)));
}
|
D
|
void main() { runSolver(); }
void problem() {
auto N = scan!long;
auto A = scan!long(N);
auto B = scan!long(N);
auto C = scan!long(N);
auto solve() {
long[][long] bIndicies;
foreach(i, b; B) {
bIndicies[b] ~= i;
}
long[long] aCounts;
foreach(i, a; A) {
aCounts[a]++;
}
long[long] cCounts;
foreach(i, c; C) {
cCounts[c - 1]++;
}
long ans;
foreach(a; aCounts.keys) {
if (!(a in bIndicies)) continue;
const count = aCounts[a];
foreach(bi; bIndicies[a]) {
if (bi in cCounts) ans += count * cCounts[bi];
}
}
return ans;
}
outputForAtCoder(&solve);
}
// ----------------------------------------------
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric, std.traits, std.functional, std.bigint, std.datetime.stopwatch, core.time;
T[][] combinations(T)(T[] s, in long m) { if (!m) return [[]]; if (s.empty) return []; return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(long n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");
Point invert(Point p) { return Point(p.y, p.x); }
long[] divisors(long n) { long[] ret; for (long i = 1; i * i <= n; i++) { if (n % i == 0) { ret ~= i; if (i * i != n) ret ~= n / i; } } return ret.sort.array; }
bool chmin(T)(ref T a, T b) { if (b < a) { a = b; return true; } else return false; }
bool chmax(T)(ref T a, T b) { if (b > a) { a = b; return true; } else return false; }
string charSort(alias S = "a < b")(string s) { return (cast(char[])((cast(byte[])s).sort!S.array)).to!string; }
string toAnswerString(R)(R r) { return r.map!"a.to!string".joiner(" ").array.to!string; }
void outputForAtCoder(T)(T delegate() fn) {
static if (is(T == float) || is(T == double) || is(T == real)) "%.16f".writefln(fn());
else static if (is(T == void)) fn();
else static if (is(T == string)) fn().writeln;
else static if (isInputRange!T) {
static if (!is(string == ElementType!T) && isInputRange!(ElementType!T)) foreach(r; fn()) r.toAnswerString.writeln;
else foreach(r; fn()) r.writeln;
}
else fn().writeln;
}
void runSolver() {
enum BORDER = "==================================";
debug { BORDER.writeln; while(true) { "<<< Process time: %s >>>".writefln(benchmark!problem(1)); BORDER.writeln; } }
else problem();
}
enum YESNO = [true: "Yes", false: "No"];
// -----------------------------------------------
|
D
|
/Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.build/ByteBuffer+binaryFloatingPointOperations.swift.o : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+require.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+string.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+peek.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Control.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/BitsError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Data+Bytes.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Bytes.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Data+Strings.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+binaryFloatingPointOperations.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Alphabet.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Digit.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.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/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.build/ByteBuffer+binaryFloatingPointOperations~partial.swiftmodule : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+require.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+string.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+peek.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Control.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/BitsError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Data+Bytes.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Bytes.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Data+Strings.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+binaryFloatingPointOperations.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Alphabet.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Digit.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.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/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.build/ByteBuffer+binaryFloatingPointOperations~partial.swiftdoc : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+require.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+string.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+peek.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Control.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/BitsError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Data+Bytes.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Bytes.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Data+Strings.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/ByteBuffer+binaryFloatingPointOperations.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Alphabet.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Bits/Byte+Digit.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.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/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.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/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.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
|
/Users/wangqian/Desktop/perfect/PerfectTemplate/.build/x86_64-apple-macosx10.10/debug/PerfectLib.build/File.swift.o : /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/JSONConvertible.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/File.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Log.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/PerfectServer.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Dir.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/PerfectError.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Utilities.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Bytes.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/SysProcess.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/os.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.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/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/os.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/xpc/XPC.apinotes /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/wangqian/Desktop/perfect/PerfectTemplate/.build/x86_64-apple-macosx10.10/debug/PerfectLib.build/File~partial.swiftmodule : /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/JSONConvertible.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/File.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Log.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/PerfectServer.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Dir.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/PerfectError.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Utilities.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Bytes.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/SysProcess.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/os.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.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/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/os.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/xpc/XPC.apinotes /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/wangqian/Desktop/perfect/PerfectTemplate/.build/x86_64-apple-macosx10.10/debug/PerfectLib.build/File~partial.swiftdoc : /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/JSONConvertible.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/File.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Log.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/PerfectServer.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Dir.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/PerfectError.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Utilities.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/Bytes.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/SysProcess.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/os.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.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/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/os.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/xpc/XPC.apinotes /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
|
/Users/baris/contig-connectors/target/release/build/bv-7a2b602d0568241b/build_script_build-7a2b602d0568241b: /Users/baris/.cargo/registry/src/github.com-1ecc6299db9ec823/bv-0.11.1/build.rs
/Users/baris/contig-connectors/target/release/build/bv-7a2b602d0568241b/build_script_build-7a2b602d0568241b.d: /Users/baris/.cargo/registry/src/github.com-1ecc6299db9ec823/bv-0.11.1/build.rs
/Users/baris/.cargo/registry/src/github.com-1ecc6299db9ec823/bv-0.11.1/build.rs:
|
D
|
#!dmd -run
/**
* License: Boost 1.0
* Copyright (c) 2009-2010 Eric Poggel
*
* This is a customized version of CDC for running Yage tests.
* See the main() function for yage-specific customizations
*
* See: <a href="http://dsource.org/projects/cdc/">The CDC Project</a>
*/
module cdc;
/**
* Use to implement your own custom build script, or pass args on to defaultBuild()
* to use this file as a generic build script like bud or rebuild. */
int main(string[] args)
{
// Get platform
version (Win32)
string platform = "win32";
version (Win64)
string platform = "win64";
version (linux)
{ version (X86)
string platform = "linux32";
version (X86_64)
string platform = "linux64";
}
// Parse Options
string[] options1; // options for both derelict and yage
string[] options2; // options for only yage
bool silent, ddoc, verbose, run, debug_, lib;
foreach (string arg; args)
{ switch(String.toLower(arg))
{ case "-ddoc": ddoc = true; options2 ~= ["-D", "-Dd../doc"]; break;
case "-debug": debug_=true; options1 ~= ["-debug", "-g"]; break;
case "-lib": lib=true; break;
case "-profile": options1 ~= ["-profile"]; break;
case "-run": run=true; break;
case "-silent": silent=true; break;
case "-verbose": verbose=true; break;
default: System.trace(arg ~ " is not supported.");
} }
if (debug_)
options1 ~= ["-unittest"];
else
options1 ~= ["-O", "-inline", "-release"];
options2 ~= "-d"; // allow deprecated items
// Show Options
if (!silent)
{ System.trace("Running Yage Tests...");
System.trace("If you're curious, the options are:");
System.trace(" -ddoc Generate documentation in the doc folder");
System.trace(" -debug Include debugging symbols and enable stack tracing on Windows.");
System.trace(" Otherwise optimize, inline functions, and remove unittests/asserts.");
System.trace(" -lib Create a yage lib file in the lib folder.");
System.trace(" -profile Compile in profiling code.");
System.trace(" -run Run when finished.");
System.trace(" -silent Don't print this message.");
System.trace(" -verbose Print all commands as they're being executed.");
System.trace("Example: dmd -run runtests.d ");
}
// Build derelict lib if not built.
string src_path = "../";
string debugstr = debug_ ? "-d" : "";
string derelict_lib = "../lib/derelict-"~compiler~"-"~platform~debugstr~lib_ext;
if (!FS.exists(src_path~derelict_lib))
CDC.compile(["derelict"], ["-of"~derelict_lib, "-lib"] ~ options1, null, src_path, verbose);
// Build Yage into a lib to be re-used with each test, and deleted when finished.
string yage_lib = "../lib/yage-"~compiler~"-"~platform~debugstr~lib_ext;
FS.remove(yage_lib);
CDC.compile(["yage"], ["-of"~yage_lib, "-lib"] ~ options1 ~ options2, null, src_path, verbose);
scope(exit)
FS.remove(yage_lib);
// Run each file as its own test, one at a time.
foreach (test; FS.scan(".", [".d"]))
{ if (String.find(test, __FILE__) != -1)
continue; // skip this file
System.trace("\nRunning test {}", test);
try {
CDC.compile(["tests/"~test, derelict_lib, yage_lib], ["-run"] ~ options1 ~ options2, null, src_path, verbose);
} catch (Exception e)
{ System.trace("Failed to compile!\n", e);
}
}
System.trace("");
FS.remove(yage_lib);
return 0; // success
}
// Yage-specific function for creating yage/resource/embed/embed.d from other files in the same folder.
void createEmbeddedResources()
{
// TODO: Only re-embed files if the date changes?
string path = "../src/yage/resource/embed";
string source =
"module yage.resource.embed.embed;\r\n\r\n"
"/// Yage's build script generates this struct automatically from the other files in the resource/embed folder."
"\r\nstruct Embed {\r\n";
foreach (file; FS.listDir(path))
{
// Skip the output file
if (file=="embed.d")
continue;
string contents = cast(char[])FS.read(path~"/"~file);
string encodedContents = "";
foreach (c; contents)
{ // Encode as a binary-safe D string
if (c =='\t')
encodedContents ~= "\\t";
else if (c =='\r')
encodedContents ~= "\\r";
else if (c =='\n')
encodedContents ~= "\\n";
else if (c=='"' || c=='\\')
encodedContents ~= "\\"~c;
else if (c < 32 || 126 < c) // embed invalid utf-8 characters as hex
{ string encode = "0123456789ABCDEF";
encodedContents ~= "\\x"~encode[c/16]~encode[c%16];
}
else
encodedContents ~= c;
}
// Add to the struct as a static member.p
source ~= "\tstatic string " ~ String.replace(String.replace(file, " ", "_"), ".", "_") ~ " = \"" ~
encodedContents ~ "\"; /// embedded version of "~file~"\r\n";
}
source ~= "}";
FS.write(path ~ "/embed.d", source);
}
/*
* ----------------------------------------------------------------------------
* CDC Code, modify with caution
* ----------------------------------------------------------------------------
*/
// Imports
version(Tango)
{ import tango.core.Array : find;
import tango.core.Exception : ProcessException;
import tango.core.Thread;
import tango.io.device.File;
import tango.io.FilePath;
import tango.io.FileScan;
import tango.io.FileSystem;
import tango.io.Stdout;
import tango.sys.Environment;
import tango.text.convert.Format;
import tango.text.Regex;
import tango.text.Util;
import tango.text.Ascii;
import tango.time.Clock;
import tango.util.Convert;
extern (C) int system(char *); // Tango's process hangs sometimes
//import tango.core.tools.TraceExceptions; // enable to get stack trace in buildyage.d on internal failure
} else
{ import std.date;
version (D_Version2)
import std.string : join, indexOf, replace, tolower;
else
import std.string : join, find, replace, tolower;
import std.stdio : writefln;
import std.path : sep, getDirName, getName, addExt;
import std.file : chdir, copy, isdir, isfile, listdir, mkdir, exists, getcwd, remove, write;
import std.format;
import std.regexp;
import std.traits;
import std.c.process;
import std.c.time;
}
/// This is always set to the name of the default compiler, which is the compiler used to build cdc.
version (DigitalMars)
string compiler = "dmd";
version (GNU)
string compiler = "gdc"; /// ditto
version (LDC)
string compiler = "ldmd"; /// ditto
version (Windows)
{ const string[] obj_ext = [".obj", ".o"]; /// An array of valid object file extensions for the current.
const string lib_ext = ".lib"; /// Library extension for the current platform.
const string bin_ext = ".exe"; /// executable file extension for the current platform.
}
else
{ const string[] obj_ext = [".o"]; /// An array of valid object file extensions for the current.
const string lib_ext = ".a"; /// Library extension for the current platform.
const string bin_ext = ""; /// Executable file extension for the current platform.
}
/**
* Program entry point. Parse args and run the compiler.*/
int defaultBuild(string[] args)
{ args = args[1..$];// remove self-name from args
string root;
string[] options;
string[] paths;
string[] run_args;
bool verbose;
// Populate options, paths, and run_args from args
bool run;
foreach (arg; args)
{ switch (arg)
{ case "-verbose": verbose = true; break;
case "-dmd": compiler = "dmd"; break;
case "-gdc": compiler = "gdc"; break;
case "-ldc": compiler = "ldc"; break;
case "-run": run = true; options~="-run"; break;
default:
if (String.starts(arg, "-root"))
{ root = arg[5..$];
continue;
}
if (arg[0] == '-' && (!run || !paths.length))
options ~= arg;
else if (!run || FS.exists(arg))
paths ~= arg;
else if (run && paths.length)
run_args ~= arg;
} }
// Compile
CDC.compile(paths, options, run_args, root, verbose);
return 0; // success
}
/**
* A library for compiling d code.
* Example:
* --------
* // Compile all source files in src/core along with src/main.d, link with all library files in the libs folder,
* // generate documentation in the docs folder, and then run the resulting executable.
* CDC.compile(["src/core", "src/main.d", "libs"], ["-D", "-Dddocs", "-run"]);
* --------
*/
struct CDC
{
/**
* Compile d code using same compiler that compiled CDC.
* Params:
* paths = Array of source and library files and folders. Folders are recursively searched.
* options = Compiler options.
* run_args = If -run is specified, pass these arguments to the generated executable.
* root = Use this folder as the root of all paths, instead of the current folder. This can be relative or absolute.
* verbose = Print each command before it's executed.
* Returns:
* Array of commands that were executed.
* TODO: Add a dry run option to just return an array of commands to execute. */
static string[] compile(string[] paths, string[] options=null, string[] run_args=null, string root=null, bool verbose=false)
{ Log.operations = null;
Log.verbose = verbose;
// Change to root directory and back again when done.
string cwd = FS.getDir();
if (root.length)
{ if (!FS.exists(root))
throw new Exception(`Directory specified for -root "` ~ root ~ `" doesn't exist.`);
FS.chDir(root);
}
scope(exit)
if (root.length)
FS.chDir(cwd);
// Convert src and lib paths to files
string[] sources;
string[] libs;
string[] ddocs;
foreach (src; paths)
if (src.length)
{ if (!FS.exists(src))
throw new Exception(`Source file/folder "` ~ src ~ `" does not exist.`);
if (FS.isDir(src)) // a directory of source or lib files
{ sources ~= FS.scan(src, [".d"]);
ddocs ~= FS.scan(src, [".ddoc"]);
libs ~= FS.scan(src, [lib_ext]);
} else if (FS.isFile(src)) // a single file
{
scope ext = src[String.rfind(src, ".")..$];
if (".d" == ext)
sources ~= src;
else if (lib_ext == ext)
libs ~= src;
}
}
// Add dl.a for dynamic linking on linux
version (linux)
libs ~= ["-L-ldl"];
// Combine all options, sources, ddocs, and libs
CompileOptions co = CompileOptions(options, sources);
options = co.getOptions(compiler);
if (compiler=="gdc")
foreach (ref d; ddocs)
d = "-fdoc-inc="~d;
else foreach (ref l; libs)
version (GNU) // or should this only be version(!Windows)
l = `-L`~l; // TODO: Check in dmd and gdc
// Create modules.ddoc and add it to array of ddoc's
if (co.D)
{ string modules = "MODULES = \r\n";
sources.sort;
foreach(string src; sources)
{ src = String.split(src, "\\.")[0]; // get filename
src = String.replace(String.replace(src, "/", "."), "\\", ".");
modules ~= "\t$(MODULE "~src~")\r\n";
}
FS.write("modules.ddoc", modules);
ddocs ~= "modules.ddoc";
scope(failure) FS.remove("modules.ddoc");
}
string[] arguments = options ~ sources ~ ddocs ~ libs;
// Compile
if (compiler=="gdc")
{
// Add support for building libraries to gdc.
if (co.lib || co.D || co.c) // GDC must build incrementally if creating documentation or a lib.
{
// Remove options that we don't want to pass to gcd when building files incrementally.
string[] incremental_options;
foreach (option; options)
if (option!="-lib" && !String.starts(option, "-o"))
incremental_options ~= option;
// Compile files individually, outputting full path names
string[] obj_files;
foreach(source; sources)
{ string obj = String.replace(source, "/", ".")[0..$-2]~".o";
string ddoc = obj[0..$-2];
if (co.od)
obj = co.od ~ FS.sep ~ obj;
obj_files ~= obj;
string[] exec = incremental_options ~ ["-o"~obj, "-c"] ~ [source];
if (co.D) // ensure doc files are always fully qualified.
exec ~= ddocs ~ ["-fdoc-file="~ddoc~".html"];
System.execute(compiler, exec); // throws ProcessException on compile failure
}
// use ar to join the .o files into a lib and cleanup obj files (TODO: how to join on GDC windows?)
if (co.lib)
{ FS.remove(co.of); // since ar refuses to overwrite it.
System.execute("ar", "cq "~ co.of ~ obj_files);
}
// Remove obj files if -c or -od not were supplied.
if (!co.od && !co.c)
foreach (o; obj_files)
FS.remove(o);
}
if (!co.lib && !co.c)
{
// Remove documentation arguments since they were handled above
string[] nondoc_args;
foreach (arg; arguments)
if (!String.starts(arg, "-fdoc") && !String.starts(arg, "-od"))
nondoc_args ~= arg;
executeCompiler(compiler, nondoc_args);
}
}
else // (compiler=="dmd" || compiler=="ldc")
{
executeCompiler(compiler, arguments);
// Move all html files in doc_path to the doc output folder and rename with the "package.module" naming convention.
if (co.D)
{ foreach (string src; sources)
{
if (src[$-2..$] != ".d")
continue;
string html = src[0..$-2] ~ ".html";
string dest = String.replace(String.replace(html, "/", "."), "\\", ".");
if (co.Dd.length)
{
dest = co.Dd ~ FS.sep ~ dest;
html = co.Dd ~ FS.sep ~ html;
}
if (html != dest) // TODO: Delete remaining folders where source files were placed.
{ FS.copy(html, dest);
FS.remove(html);
} } }
}
// Remove extra files
string basename = co.of[String.rfind(co.of, "/")+1..$];
FS.remove(String.changeExt(basename, ".map"));
if (co.D)
FS.remove("modules.ddoc");
if (co.of && !(co.c || co.od))
foreach (ext; obj_ext)
FS.remove(String.changeExt(co.of, ext)); // delete object files with same name as output file that dmd sometimes leaves.
// If -run is set.
if (co.run)
{ System.execute("./" ~ co.of, run_args);
version(Windows) // Hack: give dmd windows time to release the lock.
if (compiler=="dmd")
System.sleep(.1);
FS.remove(co.of); // just like dmd
}
return Log.operations;
}
// A wrapper around execute to write compile options to a file, to get around max arg lenghts on Windows.
private static void executeCompiler(string compiler, string[] arguments)
{ try {
version (Windows)
{ FS.write("compile", String.join(arguments, " "));
scope(exit)
FS.remove("compile");
System.execute(compiler~" ", ["@compile"]);
} else
System.execute(compiler, arguments);
} catch (ProcessException e)
{ throw new Exception("Compiler failed.");
}
}
/*
* Store compilation options that must be handled differently between compilers
* This also implicitly enables -of and -op for easier handling. */
private struct CompileOptions
{
bool c; // do not link
bool D; // generate documentation
string Dd; // write documentation file to this directory
string Df; // write documentation file to this filename
bool lib; // generate library rather than object files
bool o; // do not write object file
string od; // write object & library files to this directory
string of; // name of output file.
bool run;
string[] run_args; // run immediately afterward with these arguments.
private string[] options; // stores modified options.
/*
* Constructor */
static CompileOptions opCall(string[] options, string[] sources)
{ CompileOptions result;
foreach (i, option; options)
{
if (option == "-c")
result.c = true;
else if (option == "-D" || option == "-fdoc")
result.D = true;
else if (String.starts(option, "-Dd"))
result.Dd = option[3..$];
else if (String.starts(option, "-fdoc-dir="))
result.Df = option[10..$];
else if (String.starts(option, "-Df"))
result.Df = option[3..$];
else if (String.starts(option, "-fdoc-file="))
result.Df = option[11..$];
else if (option == "-lib")
result.lib = true;
else if (option == "-o-" || option=="-fsyntax-only")
result.o = true;
else if (String.starts(option, "-of"))
result.of = option[3..$];
else if (String.starts(option, "-od"))
result.od = option[3..$];
else if (String.starts(option, "-o") && option != "-op")
result.of = option[2..$];
else if (option == "-run")
result.run = true;
if (option != "-run") // run will be handled specially to allow for it to be used w/ multiple source files.
result.options ~= option;
}
// Set the -o (output filename) flag to the first source file, if not already set.
string ext = result.lib ? lib_ext : bin_ext; // This matches the default behavior of dmd.
if (!result.of.length && !result.c && !result.o && sources.length)
{ result.of = String.split(String.split(sources[0], "/")[$-1], "\\.")[0] ~ ext;
result.options ~= ("-of" ~ result.of);
}
version (Windows)
{ if (String.find(result.of, ".") <= String.rfind(result.of, "/"))
result.of ~= bin_ext;
//Stdout(String.find(result.of, ".")).newline;
}
// Exception for conflicting flags
if (result.run && (result.c || result.o))
throw new Exception("flags '-c', '-o-', and '-fsyntax-only' conflict with -run");
return result;
}
/*
* Translate DMD/LDC compiler options to GDC options.
* This function is incomplete. (what about -L? )*/
string[] getOptions(string compiler)
{ string[] result = options.dup;
if (compiler != "gdc")
{
version(Windows)
foreach (ref option; result)
if (String.starts(option, "-of")) // fix -of with / on Windows
option = String.replace(option, "/", "\\");
if (!String.contains(result, "-op"))
return result ~ ["-op"]; // this ensures ddocs don't overwrite one another.
return result;
}
// is gdc
string[string] translate;
translate["-Dd"] = "-fdoc-dir=";
translate["-Df"] = "-fdoc-file=";
translate["-debug="] = "-fdebug=";
translate["-debug"] = "-fdebug"; // will this still get selected?
translate["-inline"] = "-finline-functions";
translate["-L"] = "-Wl";
translate["-lib"] = "";
translate["-O"] = "-O3";
translate["-o-"] = "-fsyntax-only";
translate["-of"] = "-o ";
translate["-unittest"] = "-funittest";
translate["-version"] = "-fversion=";
translate["-w"] = "-wall";
// Perform option translation
foreach (ref option; result)
{ if (String.starts(option, "-od")) // remove unsupported -od
option = "";
if (option =="-D")
option = "-fdoc";
else
foreach (before, after; translate) // Options with a direct translation
if (option.length >= before.length && option[0..before.length] == before)
{ option = after ~ option[before.length..$];
break;
}
}
return result;
}
unittest {
string[] sources = [cast(string)"foo.d"];
string[] options = [cast(string)"-D", "-inline", "-offoo"];
scope result = CompileOptions(options, sources).getOptions("gdc");
assert(result[0..3] == [cast(string)"-fdoc", "-finline-functions", "-o foo"]);
}
}
}
// Log actions of functions in this module.
private struct Log
{
static bool verbose;
static string[] operations;
static void add(string operation)
{ if (verbose)
System.trace("CDC: " ~ operation);
operations ~= operation;
}
}
/// This is a brief, tango/phobos neutral system library.
struct System
{
/**
* Execute execute an arbitrary command-line program and print its output
* Params:
* command = The command to execute, e.g. "dmd"
* args = Array of string arguments to pass to this command.
* Throws: ProcessException on failure or status code 1.
* TODO: Return output (stdout/stderr) instead of directly printing it. */
static void execute(string command, string[] args=null)
{ Log.add(command~` `~String.join(args, ` `));
version (Windows)
if (String.starts(command, "./"))
command = command[2..$];
version (Tango)
{ /+ // hangs in Tango 0.99.9
scope p = new Process(true);
scope(exit)
p.close();
p.execute(command, args);
Stdout.copy(p.stdout).flush; // adds extra line returns?
Stdout.copy(p.stderr).flush;
scope result = p.wait();
if (result.status != Process.Result.Exit)
throw new ProcessException(result.toString());
+/
string execute = command ~ " " ~ String.join(args, " ") ~ "\0";
int status = system(execute.ptr);
if (status != 0)
throw new ProcessException(String.format("Process '%s' exited with status %s", command, status));
} else
{
command = command ~ " " ~ String.join(args, " ");
bool success = !system((command ~ "\0").ptr);
if (!success)
throw new ProcessException(String.format("Process '%s' exited with status 1", command));
}
}
/// Get the current number of milliseconds since Jan 1 1970.
static long time()
{ version (Tango)
return Clock.now.unix.millis;
else
return getUTCtime();
}
/// Print output to the console. Uses String.format internally and therefor accepts the same arguments.
static void trace(T...)(string message, T args)
{ version (Tango)
Stdout(String.format(message, args)).newline;
else
writefln(String.format(message, args));
}
/// Sleep for the given number of seconds.
static void sleep(double seconds)
{ version (Tango)
Thread.sleep(seconds);
else
{ version (GNU)
sleep(cast(int)seconds);
version (D_Version2)
sleep(cast(int)(seconds/1_000));
else
usleep(cast(int)(seconds/1_000_000));
}
}
}
/// This is a brief, tango/phobos neutral filesystem library.
struct FS
{
/// Path separator character of the current platform
version (Windows)
static const string sep ="\\";
else
static const string sep ="/";
/// Convert a relative path to an absolute path.
static string abs(string rel_path)
{ version (Tango)
return (new FilePath).absolute(rel_path).toString();
else
{ // Remove filename
string filename;
int index = rfind(rel_path, FS.sep);
if (index != -1)
{ filename = rel_path[index..$];
rel_path = replace(rel_path, filename, "");
}
string cur_path = getcwd();
try { // if can't chdir, rel_path is current path.
chdir(rel_path);
} catch {};
string result = getcwd();
chdir(cur_path);
return result~filename;
}
}
/// Set the current working directory.
static void chDir(string path)
{ Log.add(`cd "`~path~`"`);
version (Tango)
Environment.cwd(path);
else .chdir(path);
}
/// Copy a file from source to destination
static void copy(string source, string destination)
{ Log.add(`copy "`~source~`" "`~destination~`"`);
version (Tango)
{ scope from = new File(source);
scope to = new File(destination, File.WriteCreate);
to.output.copy (from);
to.close;
from.close;
}
else
.copy(source, destination);
}
/// Does a file exist?
static bool exists(string path)
{ version (Tango)
return FilePath(path).exists();
else return !!.exists(path);
}
/// Get the current working directory.
static string getDir()
{ version (Tango)
return Environment.cwd();
else return getcwd();
}
/// Is a path a directory?
static bool isDir(string path)
{ version (Tango)
return FilePath(path).isFolder();
else return !!.isdir(path);
}
/// Is a path a file?
static bool isFile(string path)
{ version (Tango)
return FilePath(path).isFile();
else return !!.isfile(path);
}
/// Get an array of all files/folders in a path.
/// TODO: Fix with LDC + Tango
static string[] listDir(string path)
{ version (Tango)
{ string[] result;
foreach (dir; FilePath(path).toList())
result ~= FilePath(dir.toString()).file();
return result;
}
else return .listdir(path);
}
/// Create a directory. Returns false if the directory already exists.
static bool mkDir(string path)
{ if (!FS.exists(path))
{ version(Tango)
FilePath(path).create();
else
mkdir(path);
return true;
}
return false;
}
/// Argument for FS.scan() function.
static enum ScanMode
{ FILES = 1, ///
FOLDERS = 2, ///
BOTH = 3 ///
}
/**
* Recursively get all files in directory and subdirectories that have an extension in exts.
* This may return files in a different order depending on whether Tango or Phobos is used.
* Params:
* directory = Absolute or relative path to the current directory
* exts = Array of extensions to match
* mode = files, folders, or both
* Returns: An array of paths (including filename) relative to directory.
* BUGS: LDC fails to return any results. */
static string[] scan(string folder, string[] exts=null, ScanMode mode=ScanMode.FILES)
{ string[] result;
if (exts is null)
exts = [""];
foreach(string filename; FS.listDir(folder))
{ string name = folder~"/"~filename; // FS.sep breaks gdc windows.
if(FS.isDir(name))
result ~= scan(name, exts, mode);
if (((mode & ScanMode.FILES) && FS.isFile(name)) || ((mode & ScanMode.FOLDERS) && FS.isDir(name)))
{ // if filename is longer than ext and filename's extention is ext.
foreach (string ext; exts)
if (filename.length>=ext.length && filename[($-ext.length)..$]==ext)
result ~= name;
} }
return result;
}
/**
* Remove a file or a folder along with all files/folders in it.
* Params: path = Path to remove, can be a file or folder.
* Return: true on success, or false if the path didn't exist. */
static bool remove(string path)
{
Log.add(`remove "`~path~`"`);
if (!FS.exists(path))
return false;
version (Tango)
FilePath(path).remove();
else
.remove(path);
return true;
}
unittest {
assert (!remove("foo/bar/ding/dong/do.txt")); // a non-existant file
Log.operations = null;
}
static ubyte[] read(string filename)
{ version (Tango)
return cast(ubyte[])File.get(filename);
else
return cast(ubyte[])std.file.read(filename); // wonder if this works
}
/// Write a file to disk
static void write(T)(string filename, T[] data)
{ scope data2 = String.replace(String.replace(String.replace(data, "\n", "\\n"), "\r", "\\r"), "\t", "\\t");
Log.add(`write "` ~ filename ~ `" "` ~ data2 ~ `"`);
version (Tango)
File.set(filename, data);
else .write(filename, data);
}
// test path functions
unittest
{ string path = "_random_path_ZZZZZ";
if (!FS.exists(path))
{ assert(FS.mkDir(path));
assert(FS.exists(path));
assert(String.contains(FS.listDir("./"), path));
assert(String.contains(FS.scan("./", null, ScanMode.FOLDERS), path));
assert(FS.remove(path));
assert(!FS.exists(path));
} }
}
/// This is a brief, tango/phobos neutral string library.
struct String
{
static string changeExt(string filename, string ext)
{ version(Tango)
return FilePath(filename).folder() ~ FilePath(filename).name() ~ ext;
else
return addExt(filename, ext[1..$]);
}
unittest {
assert(changeExt("foo.a", "b") == "foo.b");
assert(changeExt("bar/foo", "b") == "bar/foo.b");
}
/// Does haystack contain needle?
static bool contains(T)(T[] haystack, T needle)
{ version (Tango)
return .contains(haystack, needle);
foreach (straw; haystack)
if (straw == needle)
return true;
return false;
}
/// Find the first or last instance of needle in haystack, or -1 if not found.
static int find(T)(T[] haystack, T[] needle)
{ if (needle.length > haystack.length)
return -1;
for (int i=0; i<haystack.length - needle.length+1; i++)
if (haystack[i..i+needle.length] == needle)
return i;
return -1;
}
static int rfind(T)(T[] haystack, T[] needle) /// ditto
{ if (needle.length > haystack.length)
return -1;
for (int i=haystack.length - needle.length-1; i>0; i--)
if (haystack[i..i+needle.length] == needle)
return i;
return -1;
}
unittest
{ assert(find("hello world world.", "wo") == 6);
assert(find("hello world world.", "world.") == 12);
assert(rfind("hello world world.", "wo") == 12);
assert(rfind("hello world world.", "world.") == 12);
}
/**
* Format variables.
* Params:
* message = String to apply formatting. Use %s for variable replacement.
* args = Variable arguments to insert into message.
* Example:
* --------
* String.format("%s World %s", "Hello", 23); // returns "Hello World 23"
* --------
*/
static string format(T...)(string message, T args)
{ version (Tango)
{ message = substitute(message, "%s", "{}");
return Format.convert(message, args);
} else
{ string swritef(...) // wrapper to convert varargs
{ string res;
void putchar(dchar c)
{ res~= c;
}
doFormat(&putchar, _arguments, cast(char*)_argptr);
return res;
}
return swritef(message, args);
} }
unittest {
assert(String.format("%s World %s", "Hello", 23) == "Hello World 23");
assert(String.format("foo") == "foo");
}
/// Join an array of strings using glue.
static string join(string[] array, string glue)
{ return .join(array, glue);
}
/// In source, repalce all instances of "find" with "repl".
static string replace(string source, string find, string repl)
{ version (Tango)
return substitute(source, find, repl);
else return .replace(source, find, repl);
}
/// Split an array by the regex pattern.
static string[] split(string source, string pattern)
{ version (Tango)
return Regex(pattern).split(source);
else return .split(source, pattern);
}
/// Does "source" begin with "beginning" ?
static bool starts(string source, string beginning)
{ return source.length >= beginning.length && source[0..beginning.length] == beginning;
}
/// Get the ascii lower-case version of a string.
static string toLower(string input)
{ version (Tango)
return .toLower(input);
else return tolower(input);
}
}
// Define ProcessException in Phobos
version(Tango) {}
else
{ class ProcessException : Exception {
this(string message) { super(message); }
};
}
|
D
|
/**
* Takes a token stream from the lexer, and parses it into an abstract syntax tree.
*
* Specification: $(LINK2 https://dlang.org/spec/grammar.html, D Grammar)
*
* 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/parse.d, _parse.d)
* Documentation: https://dlang.org/phobos/dmd_parse.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/parse.d
*/
module dmd.parse;
import core.stdc.stdio;
import core.stdc.string;
import dmd.astenums;
import dmd.errorsink;
import dmd.id;
import dmd.identifier;
import dmd.lexer;
import dmd.location;
import dmd.root.filename;
import dmd.common.outbuffer;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.root.string;
import dmd.tokens;
alias CompileEnv = dmd.lexer.CompileEnv;
/***********************************************************
*/
class Parser(AST, Lexer = dmd.lexer.Lexer) : Lexer
{
AST.ModuleDeclaration* md;
protected
{
AST.Module mod;
LINK linkage;
Loc linkLoc;
CPPMANGLE cppmangle;
Loc endloc; // set to location of last right curly
int inBrackets; // inside [] of array index or slice
Loc lookingForElse; // location of lonely if looking for an else
bool doUnittests; // parse unittest blocks
}
bool transitionIn = false; /// `-transition=in` is active, `in` parameters are listed
/*********************
* Use this constructor for string mixins.
* Input:
* loc = location in source file of mixin
*/
extern (D) this(const ref Loc loc, AST.Module _module, const(char)[] input, bool doDocComment,
ErrorSink errorSink, const CompileEnv* compileEnv, const bool doUnittests) scope
{
//printf("Parser::Parser()1 %d\n", doUnittests);
this(_module, input, doDocComment, errorSink, compileEnv, doUnittests);
scanloc = loc;
}
/**************************************************
* Main Parser constructor.
*/
extern (D) this(AST.Module _module, const(char)[] input, bool doDocComment, ErrorSink errorSink,
const CompileEnv* compileEnv, const bool doUnittests) scope
{
super(_module ? _module.srcfile.toChars() : null, input.ptr, 0, input.length, doDocComment, false,
errorSink,
compileEnv);
//printf("Parser::Parser()2 %d\n", doUnittests);
this.mod = _module;
this.linkage = LINK.d;
this.doUnittests = doUnittests;
}
/++
+ Parse a module, i.e. the optional `module x.y.z` declaration and all declarations
+ found in the current file.
+
+ Returns: the list of declarations or an empty list in case of malformed declarations,
+ the module declaration will be stored as `this.md` if found
+/
AST.Dsymbols* parseModule()
{
if (!parseModuleDeclaration())
return errorReturn();
return parseModuleContent();
}
/++
+ Parse the optional module declaration
+
+ Returns: false if a malformed module declaration was found
+/
final bool parseModuleDeclaration()
{
const comment = token.blockComment;
bool isdeprecated = false;
AST.Expression msg = null;
// Parse optional module attributes
parseModuleAttributes(msg, isdeprecated);
// ModuleDeclaration leads off
if (token.value == TOK.module_)
{
const loc = token.loc;
nextToken();
/* parse ModuleFullyQualifiedName
* https://dlang.org/spec/module.html#ModuleFullyQualifiedName
*/
if (token.value != TOK.identifier)
{
error("identifier expected following `module`");
return false;
}
Identifier[] a;
Identifier id = token.ident;
while (nextToken() == TOK.dot)
{
a ~= id;
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `package`");
return false;
}
id = token.ident;
}
md = new AST.ModuleDeclaration(loc, a, id, msg, isdeprecated);
if (token.value != TOK.semicolon)
error("`;` expected following module declaration instead of `%s`", token.toChars());
nextToken();
addComment(mod, comment);
}
return true;
}
/++
+ Parse the content of a module, i.e. all declarations found until the end of file.
+
+ Returns: the list of declarations or an empty list in case of malformed declarations
+/
final AST.Dsymbols* parseModuleContent()
{
AST.Dsymbol lastDecl = mod;
AST.Dsymbols* decldefs = parseDeclDefs(0, &lastDecl);
if (token.value == TOK.rightCurly)
{
error("unmatched closing brace");
return errorReturn();
}
if (token.value != TOK.endOfFile)
{
error("unrecognized declaration");
return errorReturn();
}
return decldefs;
}
/++
+ Skips to the end of the current declaration - denoted by either `;` or EOF
+
+ Returns: An empty list of Dsymbols
+/
private AST.Dsymbols* errorReturn()
{
while (token.value != TOK.semicolon && token.value != TOK.endOfFile)
nextToken();
nextToken();
return new AST.Dsymbols();
}
/**********************************
* Parse the ModuleAttributes preceding a module declaration.
* ModuleDeclaration:
* ModuleAttributes(opt) module ModuleFullyQualifiedName ;
* https://dlang.org/spec/module.html#ModuleAttributes
* Params:
* msg = set to the AssignExpression from DeprecatedAttribute https://dlang.org/spec/module.html#DeprecatedAttribute
* isdeprecated = set to true if a DeprecatedAttribute is seen
*/
private
void parseModuleAttributes(out AST.Expression msg, out bool isdeprecated)
{
Token* tk;
if (!(skipAttributes(&token, &tk) && tk.value == TOK.module_))
return; // no module attributes
AST.Expressions* udas = null;
while (token.value != TOK.module_)
{
switch (token.value)
{
case TOK.deprecated_:
{
// deprecated (...) module ...
if (isdeprecated)
error("there is only one deprecation attribute allowed for module declaration");
isdeprecated = true;
nextToken();
if (token.value == TOK.leftParenthesis)
{
check(TOK.leftParenthesis);
msg = parseAssignExp();
check(TOK.rightParenthesis);
}
break;
}
case TOK.at:
{
AST.Expressions* exps = null;
const stc = parseAttribute(exps);
if (stc & atAttrGroup)
{
error("`@%s` attribute for module declaration is not supported", token.toChars());
}
else
{
udas = AST.UserAttributeDeclaration.concat(udas, exps);
}
if (stc)
nextToken();
break;
}
default:
{
error("`module` expected instead of `%s`", token.toChars());
nextToken();
break;
}
}
}
if (udas)
{
auto a = new AST.Dsymbols();
auto udad = new AST.UserAttributeDeclaration(udas, a);
mod.userAttribDecl = udad;
}
}
final:
/**
* Parses a `deprecated` declaration
*
* Params:
* msg = Deprecated message, if any.
* Used to support overriding a deprecated storage class with
* a deprecated declaration with a message, but to error
* if both declaration have a message.
*
* Returns:
* Whether the deprecated declaration has a message
*/
private bool parseDeprecatedAttribute(ref AST.Expression msg)
{
if (peekNext() != TOK.leftParenthesis)
return false;
nextToken();
check(TOK.leftParenthesis);
AST.Expression e = parseAssignExp();
check(TOK.rightParenthesis);
if (msg)
{
error(token.loc, "conflicting storage class `deprecated(%s)` and `deprecated(%s)`", msg.toChars(), e.toChars());
}
msg = e;
return true;
}
/************************************
* Parse declarations and definitions
* Params:
* once = !=0 means parse exactly one decl or def
* pLastDecl = set to last decl or def parsed
* pAttrs = keep track of attributes
* Returns:
* array of declared symbols
*/
AST.Dsymbols* parseDeclDefs(int once, AST.Dsymbol* pLastDecl = null, PrefixAttributes!AST* pAttrs = null)
{
AST.Dsymbol lastDecl = null; // used to link unittest to its previous declaration
if (!pLastDecl)
pLastDecl = &lastDecl;
const linksave = linkage; // save global state
//printf("Parser::parseDeclDefs()\n");
auto decldefs = new AST.Dsymbols();
do
{
// parse result
AST.Dsymbol s = null;
AST.Dsymbols* a = null;
PrefixAttributes!AST attrs;
if (!once || !pAttrs)
{
pAttrs = &attrs;
pAttrs.comment = token.blockComment.ptr;
}
AST.Visibility.Kind prot;
StorageClass stc;
AST.Condition condition;
linkage = linksave;
Loc startloc;
Loc scdLoc;
switch (token.value)
{
case TOK.enum_:
{
/* Determine if this is a manifest constant declaration,
* or a conventional enum.
*/
const tv = peekNext();
if (tv == TOK.leftCurly || tv == TOK.colon)
s = parseEnum();
else if (tv != TOK.identifier)
goto Ldeclaration;
else
{
const nextv = peekNext2();
if (nextv == TOK.leftCurly || nextv == TOK.colon || nextv == TOK.semicolon)
s = parseEnum();
else
goto Ldeclaration;
}
break;
}
case TOK.import_:
a = parseImport();
// keep pLastDecl
break;
case TOK.template_:
s = cast(AST.Dsymbol)parseTemplateDeclaration();
break;
case TOK.mixin_:
{
const loc = token.loc;
switch (peekNext())
{
case TOK.leftParenthesis:
{
// MixinType
if (isDeclaration(&token, NeedDeclaratorId.mustIfDstyle, TOK.reserved, null))
goto Ldeclaration;
// mixin(string)
nextToken();
auto exps = parseArguments();
check(TOK.semicolon);
s = new AST.MixinDeclaration(loc, exps);
break;
}
case TOK.template_:
// mixin template
nextToken();
s = cast(AST.Dsymbol)parseTemplateDeclaration(true);
break;
default:
s = parseMixin();
break;
}
break;
}
case TOK.wchar_:
case TOK.dchar_:
case TOK.bool_:
case TOK.char_:
case TOK.int8:
case TOK.uns8:
case TOK.int16:
case TOK.uns16:
case TOK.int32:
case TOK.uns32:
case TOK.int64:
case TOK.uns64:
case TOK.int128:
case TOK.uns128:
case TOK.float32:
case TOK.float64:
case TOK.float80:
case TOK.imaginary32:
case TOK.imaginary64:
case TOK.imaginary80:
case TOK.complex32:
case TOK.complex64:
case TOK.complex80:
case TOK.void_:
case TOK.alias_:
case TOK.identifier:
case TOK.super_:
case TOK.typeof_:
case TOK.dot:
case TOK.vector:
case TOK.struct_:
case TOK.union_:
case TOK.class_:
case TOK.interface_:
case TOK.traits:
Ldeclaration:
a = parseDeclarations(false, pAttrs, pAttrs.comment);
if (a && a.length)
*pLastDecl = (*a)[a.length - 1];
break;
case TOK.this_:
if (peekNext() == TOK.dot)
goto Ldeclaration;
s = parseCtor(pAttrs);
break;
case TOK.tilde:
s = parseDtor(pAttrs);
break;
case TOK.invariant_:
const tv = peekNext();
if (tv == TOK.leftParenthesis || tv == TOK.leftCurly)
{
// invariant { statements... }
// invariant() { statements... }
// invariant (expression);
s = parseInvariant(pAttrs);
break;
}
error("invariant body expected, not `%s`", token.toChars());
goto Lerror;
case TOK.unittest_:
/**
* Ignore unittests in non-root modules.
*
* This mainly means that unittests *inside templates* are only
* ever instantiated if the module lexically declaring the
* template is one of the root modules.
*
* E.g., compiling some project with `-unittest` does NOT
* compile and later run any unittests in instantiations of
* templates declared in other libraries.
*
* Declaring unittests *inside* templates is considered an anti-
* pattern. In almost all cases, the unittests don't depend on
* the template parameters, but instantiate the template with
* fixed arguments (e.g., Nullable!T unittests instantiating
* Nullable!int), so compiling and running identical tests for
* each template instantiation is hardly desirable.
* But adding a unittest right below some function being tested
* is arguably good for locality, so unittests end up inside
* templates.
* To make sure a template's unittests are run, it should be
* instantiated in the same module, e.g., some module-level
* unittest.
*
* Another reason for ignoring unittests in templates from non-
* root modules is for template codegen culling via
* TemplateInstance.needsCodegen(). If the compiler decides not
* to emit some Nullable!bool because there's an existing
* instantiation in some non-root module, it has no idea whether
* that module was compiled with -unittest too, and so whether
* Nullable!int (instantiated in some unittest inside the
* Nullable template) can be culled too. By ignoring unittests
* in non-root modules, the compiler won't consider any
* template instantiations in these unittests as candidates for
* further codegen culling.
*/
// The isRoot check is here because it can change after parsing begins (see dmodule.d)
if (doUnittests && mod.isRoot())
{
linkage = LINK.d; // unittests have D linkage
s = parseUnitTest(pAttrs);
if (*pLastDecl)
(*pLastDecl).ddocUnittest = cast(AST.UnitTestDeclaration)s;
}
else
{
// Skip over unittest block by counting { }
Loc loc = token.loc;
int braces = 0;
while (1)
{
nextToken();
switch (token.value)
{
case TOK.leftCurly:
++braces;
continue;
case TOK.rightCurly:
if (--braces)
continue;
nextToken();
break;
case TOK.endOfFile:
/* { */
error(loc, "closing `}` of unittest not found before end of file");
goto Lerror;
default:
continue;
}
break;
}
// Workaround 14894. Add an empty unittest declaration to keep
// the number of symbols in this scope independent of -unittest.
s = new AST.UnitTestDeclaration(loc, token.loc, STC.undefined_, null);
}
break;
case TOK.new_:
s = parseNew(pAttrs);
break;
case TOK.colon:
case TOK.leftCurly:
error("declaration expected, not `%s`", token.toChars());
goto Lerror;
case TOK.rightCurly:
case TOK.endOfFile:
if (once)
error("declaration expected, not `%s`", token.toChars());
return decldefs;
case TOK.static_:
{
const next = peekNext();
if (next == TOK.this_)
s = parseStaticCtor(pAttrs);
else if (next == TOK.tilde)
s = parseStaticDtor(pAttrs);
else if (next == TOK.assert_)
s = parseStaticAssert();
else if (next == TOK.if_)
{
const Loc loc = token.loc;
condition = parseStaticIfCondition();
AST.Dsymbols* athen;
if (token.value == TOK.colon)
athen = parseBlock(pLastDecl);
else
{
const lookingForElseSave = lookingForElse;
lookingForElse = token.loc;
athen = parseBlock(pLastDecl);
lookingForElse = lookingForElseSave;
}
AST.Dsymbols* aelse = null;
if (token.value == TOK.else_)
{
const elseloc = token.loc;
nextToken();
aelse = parseBlock(pLastDecl);
checkDanglingElse(elseloc);
}
s = new AST.StaticIfDeclaration(loc, condition, athen, aelse);
}
else if (next == TOK.import_)
{
a = parseImport();
// keep pLastDecl
}
else if (next == TOK.foreach_ || next == TOK.foreach_reverse_)
{
s = parseForeach!(AST.StaticForeachDeclaration)(token.loc, pLastDecl);
}
else
{
stc = STC.static_;
goto Lstc;
}
break;
}
case TOK.const_:
if (peekNext() == TOK.leftParenthesis)
goto Ldeclaration;
stc = STC.const_;
goto Lstc;
case TOK.immutable_:
if (peekNext() == TOK.leftParenthesis)
goto Ldeclaration;
stc = STC.immutable_;
goto Lstc;
case TOK.shared_:
{
const next = peekNext();
if (next == TOK.leftParenthesis)
goto Ldeclaration;
if (next == TOK.static_)
{
TOK next2 = peekNext2();
if (next2 == TOK.this_)
{
s = parseSharedStaticCtor(pAttrs);
break;
}
if (next2 == TOK.tilde)
{
s = parseSharedStaticDtor(pAttrs);
break;
}
}
stc = STC.shared_;
goto Lstc;
}
case TOK.inout_:
if (peekNext() == TOK.leftParenthesis)
goto Ldeclaration;
stc = STC.wild;
goto Lstc;
case TOK.final_:
stc = STC.final_;
goto Lstc;
case TOK.auto_:
stc = STC.auto_;
goto Lstc;
case TOK.scope_:
stc = STC.scope_;
goto Lstc;
case TOK.override_:
stc = STC.override_;
goto Lstc;
case TOK.abstract_:
stc = STC.abstract_;
goto Lstc;
case TOK.synchronized_:
stc = STC.synchronized_;
goto Lstc;
case TOK.nothrow_:
stc = STC.nothrow_;
goto Lstc;
case TOK.pure_:
stc = STC.pure_;
goto Lstc;
case TOK.ref_:
stc = STC.ref_;
goto Lstc;
case TOK.gshared:
stc = STC.gshared;
goto Lstc;
case TOK.at:
{
AST.Expressions* exps = null;
stc = parseAttribute(exps);
if (stc)
goto Lstc; // it's a predefined attribute
// no redundant/conflicting check for UDAs
pAttrs.udas = AST.UserAttributeDeclaration.concat(pAttrs.udas, exps);
goto Lautodecl;
}
Lstc:
pAttrs.storageClass = appendStorageClass(pAttrs.storageClass, stc);
scdLoc = token.loc;
nextToken();
Lautodecl:
/* Look for auto initializers:
* storage_class identifier = initializer;
* storage_class identifier(...) = initializer;
*/
if (token.value == TOK.identifier && hasOptionalParensThen(peek(&token), TOK.assign))
{
a = parseAutoDeclarations(getStorageClass!AST(pAttrs), pAttrs.comment);
if (a && a.length)
*pLastDecl = (*a)[a.length - 1];
if (pAttrs.udas)
{
s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
pAttrs.udas = null;
}
break;
}
/* Look for return type inference for template functions.
*/
Token* tk;
if (token.value == TOK.identifier && skipParens(peek(&token), &tk) && skipAttributes(tk, &tk) &&
(tk.value == TOK.leftParenthesis || tk.value == TOK.leftCurly || tk.value == TOK.in_ ||
tk.value == TOK.out_ || tk.value == TOK.do_ || tk.value == TOK.goesTo ||
tk.value == TOK.identifier && tk.ident == Id._body))
{
if (tk.value == TOK.identifier && tk.ident == Id._body)
usageOfBodyKeyword();
a = parseDeclarations(true, pAttrs, pAttrs.comment);
if (a && a.length)
*pLastDecl = (*a)[a.length - 1];
if (pAttrs.udas)
{
s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
pAttrs.udas = null;
}
break;
}
a = parseBlock(pLastDecl, pAttrs);
auto stc2 = getStorageClass!AST(pAttrs);
if (stc2 != STC.undefined_)
{
s = new AST.StorageClassDeclaration(scdLoc, stc2, a);
}
if (pAttrs.udas)
{
if (s)
{
a = new AST.Dsymbols();
a.push(s);
}
s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
pAttrs.udas = null;
}
break;
case TOK.deprecated_:
{
stc |= STC.deprecated_;
if (!parseDeprecatedAttribute(pAttrs.depmsg))
goto Lstc;
a = parseBlock(pLastDecl, pAttrs);
s = new AST.DeprecatedDeclaration(pAttrs.depmsg, a);
pAttrs.depmsg = null;
break;
}
case TOK.leftBracket:
{
if (peekNext() == TOK.rightBracket)
error("empty attribute list is not allowed");
error("use `@(attributes)` instead of `[attributes]`");
AST.Expressions* exps = parseArguments();
// no redundant/conflicting check for UDAs
pAttrs.udas = AST.UserAttributeDeclaration.concat(pAttrs.udas, exps);
a = parseBlock(pLastDecl, pAttrs);
if (pAttrs.udas)
{
s = new AST.UserAttributeDeclaration(pAttrs.udas, a);
pAttrs.udas = null;
}
break;
}
case TOK.extern_:
{
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.extern_;
goto Lstc;
}
const linkLoc = token.loc;
auto res = parseLinkage();
if (pAttrs.link != LINK.default_)
{
if (pAttrs.link != res.link)
{
error(token.loc, "conflicting linkage `extern (%s)` and `extern (%s)`", AST.linkageToChars(pAttrs.link), AST.linkageToChars(res.link));
}
else if (res.idents || res.identExps || res.cppmangle != CPPMANGLE.def)
{
// Allow:
// extern(C++, foo) extern(C++, bar) void foo();
// to be equivalent with:
// extern(C++, foo.bar) void foo();
// Allow also:
// extern(C++, "ns") extern(C++, class) struct test {}
// extern(C++, class) extern(C++, "ns") struct test {}
}
else
error("redundant linkage `extern (%s)`", AST.linkageToChars(pAttrs.link));
}
pAttrs.link = res.link;
this.linkage = res.link;
this.linkLoc = linkLoc;
a = parseBlock(pLastDecl, pAttrs);
if (res.idents)
{
assert(res.link == LINK.cpp);
assert(res.idents.length);
for (size_t i = res.idents.length; i;)
{
Identifier id = (*res.idents)[--i];
if (s)
{
a = new AST.Dsymbols();
a.push(s);
}
s = new AST.Nspace(linkLoc, id, null, a);
}
pAttrs.link = LINK.default_;
}
else if (res.identExps)
{
assert(res.link == LINK.cpp);
assert(res.identExps.length);
for (size_t i = res.identExps.length; i;)
{
AST.Expression exp = (*res.identExps)[--i];
if (s)
{
a = new AST.Dsymbols();
a.push(s);
}
s = new AST.CPPNamespaceDeclaration(linkLoc, exp, a);
}
pAttrs.link = LINK.default_;
}
else if (res.cppmangle != CPPMANGLE.def)
{
assert(res.link == LINK.cpp);
s = new AST.CPPMangleDeclaration(linkLoc, res.cppmangle, a);
}
else if (pAttrs.link != LINK.default_)
{
s = new AST.LinkDeclaration(linkLoc, pAttrs.link, a);
pAttrs.link = LINK.default_;
}
break;
}
case TOK.private_:
prot = AST.Visibility.Kind.private_;
goto Lprot;
case TOK.package_:
prot = AST.Visibility.Kind.package_;
goto Lprot;
case TOK.protected_:
prot = AST.Visibility.Kind.protected_;
goto Lprot;
case TOK.public_:
prot = AST.Visibility.Kind.public_;
goto Lprot;
case TOK.export_:
prot = AST.Visibility.Kind.export_;
goto Lprot;
Lprot:
{
if (pAttrs.visibility.kind != AST.Visibility.Kind.undefined)
{
if (pAttrs.visibility.kind != prot)
error(token.loc, "conflicting visibility attribute `%s` and `%s`", AST.visibilityToChars(pAttrs.visibility.kind), AST.visibilityToChars(prot));
else
error("redundant visibility attribute `%s`", AST.visibilityToChars(prot));
}
pAttrs.visibility.kind = prot;
const attrloc = token.loc;
nextToken();
// optional qualified package identifier to bind
// visibility to
Identifier[] pkg_prot_idents;
if (pAttrs.visibility.kind == AST.Visibility.Kind.package_ && token.value == TOK.leftParenthesis)
{
pkg_prot_idents = parseQualifiedIdentifier("protection package");
if (pkg_prot_idents)
check(TOK.rightParenthesis);
else
{
while (token.value != TOK.semicolon && token.value != TOK.endOfFile)
nextToken();
nextToken();
break;
}
}
a = parseBlock(pLastDecl, pAttrs);
if (pAttrs.visibility.kind != AST.Visibility.Kind.undefined)
{
if (pAttrs.visibility.kind == AST.Visibility.Kind.package_ && pkg_prot_idents)
s = new AST.VisibilityDeclaration(attrloc, pkg_prot_idents, a);
else
s = new AST.VisibilityDeclaration(attrloc, pAttrs.visibility, a);
pAttrs.visibility = AST.Visibility(AST.Visibility.Kind.undefined);
}
break;
}
case TOK.align_:
{
const attrLoc = token.loc;
nextToken();
AST.Expression e = null; // default
if (token.value == TOK.leftParenthesis)
{
nextToken();
e = parseAssignExp();
check(TOK.rightParenthesis);
}
if (pAttrs.setAlignment)
{
if (e)
error("redundant alignment attribute `align(%s)`", e.toChars());
else
error("redundant alignment attribute `align`");
}
pAttrs.setAlignment = true;
pAttrs.ealign = e;
a = parseBlock(pLastDecl, pAttrs);
if (pAttrs.setAlignment)
{
s = new AST.AlignDeclaration(attrLoc, pAttrs.ealign, a);
pAttrs.setAlignment = false;
pAttrs.ealign = null;
}
break;
}
case TOK.pragma_:
{
AST.Expressions* args = null;
const loc = token.loc;
nextToken();
check(TOK.leftParenthesis);
if (token.value != TOK.identifier)
{
error("`pragma(identifier)` expected");
goto Lerror;
}
Identifier ident = token.ident;
nextToken();
if (token.value == TOK.comma && peekNext() != TOK.rightParenthesis)
args = parseArguments(); // pragma(identifier, args...)
else
check(TOK.rightParenthesis); // pragma(identifier)
AST.Dsymbols* a2 = null;
if (token.value == TOK.semicolon)
{
/* https://issues.dlang.org/show_bug.cgi?id=2354
* Accept single semicolon as an empty
* DeclarationBlock following attribute.
*
* Attribute DeclarationBlock
* Pragma DeclDef
* ;
*/
nextToken();
}
else
a2 = parseBlock(pLastDecl);
s = new AST.PragmaDeclaration(loc, ident, args, a2);
break;
}
case TOK.debug_:
startloc = token.loc;
nextToken();
if (token.value == TOK.assign)
{
s = parseDebugSpecification();
break;
}
condition = parseDebugCondition();
goto Lcondition;
case TOK.version_:
startloc = token.loc;
nextToken();
if (token.value == TOK.assign)
{
s = parseVersionSpecification();
break;
}
condition = parseVersionCondition();
goto Lcondition;
Lcondition:
{
AST.Dsymbols* athen;
if (token.value == TOK.colon)
athen = parseBlock(pLastDecl);
else
{
const lookingForElseSave = lookingForElse;
lookingForElse = token.loc;
athen = parseBlock(pLastDecl);
lookingForElse = lookingForElseSave;
}
AST.Dsymbols* aelse = null;
if (token.value == TOK.else_)
{
const elseloc = token.loc;
nextToken();
aelse = parseBlock(pLastDecl);
checkDanglingElse(elseloc);
}
s = new AST.ConditionalDeclaration(startloc, condition, athen, aelse);
break;
}
case TOK.semicolon:
// empty declaration
//error("empty declaration");
nextToken();
continue;
default:
error("declaration expected, not `%s`", token.toChars());
Lerror:
while (token.value != TOK.semicolon && token.value != TOK.endOfFile)
nextToken();
nextToken();
s = null;
continue;
}
if (s)
{
if (!s.isAttribDeclaration())
*pLastDecl = s;
decldefs.push(s);
addComment(s, pAttrs.comment);
}
else if (a && a.length)
{
decldefs.append(a);
}
}
while (!once);
linkage = linksave;
return decldefs;
}
/*****************************************
* Parse auto declarations of the form:
* storageClass ident = init, ident = init, ... ;
* and return the array of them.
* Starts with token on the first ident.
* Ends with scanner past closing ';'
*/
private AST.Dsymbols* parseAutoDeclarations(StorageClass storageClass, const(char)* comment)
{
//printf("parseAutoDeclarations\n");
auto a = new AST.Dsymbols();
while (1)
{
const loc = token.loc;
Identifier ident = token.ident;
nextToken(); // skip over ident
AST.TemplateParameters* tpl = null;
if (token.value == TOK.leftParenthesis)
tpl = parseTemplateParameterList();
check(TOK.assign); // skip over '='
AST.Initializer _init = parseInitializer();
auto v = new AST.VarDeclaration(loc, null, ident, _init, storageClass);
AST.Dsymbol s = v;
if (tpl)
{
auto a2 = new AST.Dsymbols();
a2.push(v);
auto tempdecl = new AST.TemplateDeclaration(loc, ident, tpl, null, a2, 0);
s = tempdecl;
}
a.push(s);
switch (token.value)
{
case TOK.semicolon:
nextToken();
addComment(s, comment);
break;
case TOK.comma:
nextToken();
if (!(token.value == TOK.identifier && hasOptionalParensThen(peek(&token), TOK.assign)))
{
error("identifier expected following comma");
break;
}
addComment(s, comment);
continue;
default:
error("semicolon expected following auto declaration, not `%s`", token.toChars());
break;
}
break;
}
return a;
}
/********************************************
* Parse declarations after an align, visibility, or extern decl.
*/
private AST.Dsymbols* parseBlock(AST.Dsymbol* pLastDecl, PrefixAttributes!AST* pAttrs = null)
{
AST.Dsymbols* a = null;
//printf("parseBlock()\n");
switch (token.value)
{
case TOK.semicolon:
error("declaration expected following attribute, not `;`");
nextToken();
break;
case TOK.endOfFile:
error("declaration expected following attribute, not end of file");
break;
case TOK.leftCurly:
{
const lcLoc = token.loc;
const lookingForElseSave = lookingForElse;
lookingForElse = Loc();
nextToken();
a = parseDeclDefs(0, pLastDecl);
if (token.value != TOK.rightCurly)
{
/* left curly brace */
error("matching `}` expected, not `%s`", token.toChars());
eSink.errorSupplemental(lcLoc, "unmatched `{`");
}
else
nextToken();
lookingForElse = lookingForElseSave;
break;
}
case TOK.colon:
nextToken();
a = parseDeclDefs(0, pLastDecl); // grab declarations up to closing curly bracket
break;
default:
a = parseDeclDefs(1, pLastDecl, pAttrs);
break;
}
return a;
}
/**
* Provide an error message if `added` contains storage classes which are
* redundant with those in `orig`; otherwise, return the combination.
*
* Params:
* orig = The already applied storage class.
* added = The new storage class to add to `orig`.
*
* Returns:
* The combination of both storage classes (`orig | added`).
*/
private StorageClass appendStorageClass(StorageClass orig, StorageClass added)
{
void checkConflictSTCGroup(bool at = false)(StorageClass group)
{
if (added & group && orig & group & ((orig & group) - 1))
error(
at ? "conflicting attribute `@%s`"
: "conflicting attribute `%s`",
token.toChars());
}
if (orig & added)
{
OutBuffer buf;
AST.stcToBuffer(&buf, added);
error("redundant attribute `%s`", buf.peekChars());
return orig | added;
}
const Redundant = (STC.const_ | STC.scope_ | STC.ref_);
orig |= added;
if ((orig & STC.in_) && (added & Redundant))
{
if (added & STC.const_)
error("attribute `const` is redundant with previously-applied `in`");
else if (compileEnv.previewIn)
{
error("attribute `%s` is redundant with previously-applied `in`",
(orig & STC.scope_) ? "scope".ptr : "ref".ptr);
}
else if (added & STC.ref_)
deprecation("using `in ref` is deprecated, use `-preview=in` and `in` instead");
else
error("attribute `scope` cannot be applied with `in`, use `-preview=in` instead");
return orig;
}
if ((added & STC.in_) && (orig & Redundant))
{
if (orig & STC.const_)
error("attribute `in` cannot be added after `const`: remove `const`");
else if (compileEnv.previewIn)
{
// Windows `printf` does not support `%1$s`
const(char*) stc_str = (orig & STC.scope_) ? "scope".ptr : "ref".ptr;
error(token.loc, "attribute `in` cannot be added after `%s`: remove `%s`",
stc_str, stc_str);
}
else if (orig & STC.ref_)
deprecation("using `ref in` is deprecated, use `-preview=in` and `in` instead");
else
error("attribute `in` cannot be added after `scope`: remove `scope` and use `-preview=in`");
return orig;
}
checkConflictSTCGroup(STC.const_ | STC.immutable_ | STC.manifest);
checkConflictSTCGroup(STC.gshared | STC.shared_);
checkConflictSTCGroup!true(STC.safeGroup);
return orig;
}
/***********************************************
* Parse attribute(s), lexer is on '@'.
*
* Attributes can be builtin (e.g. `@safe`, `@nogc`, etc...),
* or be user-defined (UDAs). In the former case, we return the storage
* class via the return value, while in thelater case we return `0`
* and set `pudas`.
*
* Params:
* pudas = An array of UDAs to append to
*
* Returns:
* If the attribute is builtin, the return value will be non-zero.
* Otherwise, 0 is returned, and `pudas` will be appended to.
*/
private StorageClass parseAttribute(ref AST.Expressions* udas)
{
nextToken();
if (token.value == TOK.identifier)
{
// If we find a builtin attribute, we're done, return immediately.
if (StorageClass stc = isBuiltinAtAttribute(token.ident))
return stc;
// Allow identifier, template instantiation, or function call
// for `@Argument` (single UDA) form.
AST.Expression exp = parsePrimaryExp();
if (token.value == TOK.leftParenthesis)
{
const loc = token.loc;
AST.Expressions* args = new AST.Expressions();
AST.Identifiers* names = new AST.Identifiers();
parseNamedArguments(args, names);
exp = new AST.CallExp(loc, exp, args, names);
}
if (udas is null)
udas = new AST.Expressions();
udas.push(exp);
return 0;
}
AST.Expression templateArgToExp(RootObject o, const ref Loc loc)
{
switch (o.dyncast)
{
case DYNCAST.expression:
return cast(AST.Expression) o;
case DYNCAST.type:
return new AST.TypeExp(loc, cast(AST.Type)o);
default:
assert(0);
}
}
if (token.value == TOK.leftParenthesis)
{
// Multi-UDAs ( `@( ArgumentList )`) form, concatenate with existing
if (peekNext() == TOK.rightParenthesis)
error("empty attribute list is not allowed");
if (udas is null)
udas = new AST.Expressions();
auto args = parseTemplateArgumentList();
foreach (arg; *args)
udas.push(templateArgToExp(arg, token.loc));
return 0;
}
if (auto o = parseTemplateSingleArgument())
{
if (udas is null)
udas = new AST.Expressions();
udas.push(templateArgToExp(o, token.loc));
return 0;
}
if (token.isKeyword())
error("`%s` is a keyword, not an `@` attribute", token.toChars());
else
error("`@identifier` or `@(ArgumentList)` expected, not `@%s`", token.toChars());
return 0;
}
/***********************************************
* Parse const/immutable/shared/inout/nothrow/pure postfix
*/
private StorageClass parsePostfix(StorageClass storageClass, AST.Expressions** pudas)
{
while (1)
{
StorageClass stc;
switch (token.value)
{
case TOK.const_:
stc = STC.const_;
break;
case TOK.immutable_:
stc = STC.immutable_;
break;
case TOK.shared_:
stc = STC.shared_;
break;
case TOK.inout_:
stc = STC.wild;
break;
case TOK.nothrow_:
stc = STC.nothrow_;
break;
case TOK.pure_:
stc = STC.pure_;
break;
case TOK.return_:
stc = STC.return_;
if (peekNext() == TOK.scope_)
stc |= STC.returnScope; // recognize `return scope`
break;
case TOK.scope_:
stc = STC.scope_;
break;
case TOK.at:
{
AST.Expressions* udas = null;
stc = parseAttribute(udas);
if (udas)
{
if (pudas)
*pudas = AST.UserAttributeDeclaration.concat(*pudas, udas);
else
{
// Disallow:
// void function() @uda fp;
// () @uda { return 1; }
error("user-defined attributes cannot appear as postfixes");
}
continue;
}
break;
}
default:
Token* tk;
if (skipAttributes(&token, &tk) && tk.ptr != token.ptr ||
token.value == TOK.static_ || token.value == TOK.extern_)
{
error("`%s` token is not allowed in postfix position",
Token.toChars(token.value));
nextToken();
continue;
}
return storageClass;
}
storageClass = appendStorageClass(storageClass, stc);
nextToken();
}
}
private StorageClass parseTypeCtor()
{
StorageClass storageClass = STC.undefined_;
while (1)
{
if (peekNext() == TOK.leftParenthesis)
return storageClass;
StorageClass stc;
switch (token.value)
{
case TOK.const_:
stc = STC.const_;
break;
case TOK.immutable_:
stc = STC.immutable_;
break;
case TOK.shared_:
stc = STC.shared_;
break;
case TOK.inout_:
stc = STC.wild;
break;
default:
return storageClass;
}
storageClass = appendStorageClass(storageClass, stc);
nextToken();
}
}
/**************************************
* Parse constraint.
* Constraint is of the form:
* if ( ConstraintExpression )
*/
private AST.Expression parseConstraint()
{
AST.Expression e = null;
if (token.value == TOK.if_)
{
nextToken(); // skip over 'if'
check(TOK.leftParenthesis);
e = parseExpression();
check(TOK.rightParenthesis);
}
return e;
}
/**************************************
* Parse a TemplateDeclaration.
*/
private AST.TemplateDeclaration parseTemplateDeclaration(bool ismixin = false)
{
AST.TemplateDeclaration tempdecl;
Identifier id;
AST.TemplateParameters* tpl;
AST.Dsymbols* decldefs;
AST.Expression constraint = null;
const loc = token.loc;
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `template`");
goto Lerr;
}
id = token.ident;
nextToken();
tpl = parseTemplateParameterList();
if (!tpl)
goto Lerr;
constraint = parseConstraint();
if (token.value != TOK.leftCurly)
{
error("`{` expected after template parameter list, not `%s`", token.toChars()); /* } */
goto Lerr;
}
decldefs = parseBlock(null);
tempdecl = new AST.TemplateDeclaration(loc, id, tpl, constraint, decldefs, ismixin);
return tempdecl;
Lerr:
return null;
}
/******************************************
* Parse template parameter list.
* Input:
* flag 0: parsing "( list )"
* 1: parsing non-empty "list $(RPAREN)"
*/
private AST.TemplateParameters* parseTemplateParameterList(int flag = 0)
{
auto tpl = new AST.TemplateParameters();
if (!flag && token.value != TOK.leftParenthesis)
{
error("parenthesized template parameter list expected following template identifier");
goto Lerr;
}
nextToken();
// Get array of TemplateParameters
if (flag || token.value != TOK.rightParenthesis)
{
while (token.value != TOK.rightParenthesis)
{
AST.TemplateParameter tp;
Loc loc;
Identifier tp_ident = null;
AST.Type tp_spectype = null;
AST.Type tp_valtype = null;
AST.Type tp_defaulttype = null;
AST.Expression tp_specvalue = null;
AST.Expression tp_defaultvalue = null;
// Get TemplateParameter
// First, look ahead to see if it is a TypeParameter or a ValueParameter
const tv = peekNext();
if (token.value == TOK.alias_)
{
// AliasParameter
nextToken();
loc = token.loc; // todo
AST.Type spectype = null;
if (isDeclaration(&token, NeedDeclaratorId.must, TOK.reserved, null))
{
spectype = parseType(&tp_ident);
}
else
{
if (token.value != TOK.identifier)
{
error("identifier expected for template `alias` parameter");
goto Lerr;
}
tp_ident = token.ident;
nextToken();
}
RootObject spec = null;
if (token.value == TOK.colon) // : Type
{
nextToken();
if (isDeclaration(&token, NeedDeclaratorId.no, TOK.reserved, null))
spec = parseType();
else
spec = parseCondExp();
}
RootObject def = null;
if (token.value == TOK.assign) // = Type
{
nextToken();
if (isDeclaration(&token, NeedDeclaratorId.no, TOK.reserved, null))
def = parseType();
else
def = parseCondExp();
}
tp = new AST.TemplateAliasParameter(loc, tp_ident, spectype, spec, def);
}
else if (tv == TOK.colon || tv == TOK.assign || tv == TOK.comma || tv == TOK.rightParenthesis)
{
// TypeParameter
if (token.value != TOK.identifier)
{
error("identifier expected for template type parameter");
goto Lerr;
}
loc = token.loc;
tp_ident = token.ident;
nextToken();
if (token.value == TOK.colon) // : Type
{
nextToken();
tp_spectype = parseType();
}
if (token.value == TOK.assign) // = Type
{
nextToken();
tp_defaulttype = parseType();
}
tp = new AST.TemplateTypeParameter(loc, tp_ident, tp_spectype, tp_defaulttype);
}
else if (token.value == TOK.identifier && tv == TOK.dotDotDot)
{
// ident...
loc = token.loc;
tp_ident = token.ident;
nextToken();
nextToken();
tp = new AST.TemplateTupleParameter(loc, tp_ident);
}
else if (token.value == TOK.this_)
{
// ThisParameter
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected for template `this` parameter");
goto Lerr;
}
loc = token.loc;
tp_ident = token.ident;
nextToken();
if (token.value == TOK.colon) // : Type
{
nextToken();
tp_spectype = parseType();
}
if (token.value == TOK.assign) // = Type
{
nextToken();
tp_defaulttype = parseType();
}
tp = new AST.TemplateThisParameter(loc, tp_ident, tp_spectype, tp_defaulttype);
}
else
{
// ValueParameter
loc = token.loc; // todo
tp_valtype = parseType(&tp_ident);
if (!tp_ident)
{
error("identifier expected for template value parameter");
tp_ident = Identifier.idPool("error");
}
if (token.value == TOK.colon) // : CondExpression
{
nextToken();
tp_specvalue = parseCondExp();
}
if (token.value == TOK.assign) // = CondExpression
{
nextToken();
tp_defaultvalue = parseDefaultInitExp();
}
tp = new AST.TemplateValueParameter(loc, tp_ident, tp_valtype, tp_specvalue, tp_defaultvalue);
}
tpl.push(tp);
if (token.value != TOK.comma)
break;
nextToken();
}
}
check(TOK.rightParenthesis);
Lerr:
return tpl;
}
/******************************************
* Parse template mixin.
* mixin Foo;
* mixin Foo!(args);
* mixin a.b.c!(args).Foo!(args);
* mixin Foo!(args) identifier;
* mixin typeof(expr).identifier!(args);
*/
private AST.Dsymbol parseMixin()
{
AST.TemplateMixin tm;
Identifier id;
AST.Objects* tiargs;
//printf("parseMixin()\n");
const locMixin = token.loc;
nextToken(); // skip 'mixin'
auto loc = token.loc;
AST.TypeQualified tqual = null;
if (token.value == TOK.dot)
{
id = Id.empty;
}
else
{
if (token.value == TOK.typeof_)
{
tqual = parseTypeof();
check(TOK.dot);
}
if (token.value != TOK.identifier)
{
error("identifier expected, not `%s`", token.toChars());
id = Id.empty;
}
else
id = token.ident;
nextToken();
}
while (1)
{
tiargs = null;
if (token.value == TOK.not)
{
tiargs = parseTemplateArguments();
}
if (tiargs && token.value == TOK.dot)
{
auto tempinst = new AST.TemplateInstance(loc, id, tiargs);
if (!tqual)
tqual = new AST.TypeInstance(loc, tempinst);
else
tqual.addInst(tempinst);
tiargs = null;
}
else
{
if (!tqual)
tqual = new AST.TypeIdentifier(loc, id);
else
tqual.addIdent(id);
}
if (token.value != TOK.dot)
break;
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `.` instead of `%s`", token.toChars());
break;
}
loc = token.loc;
id = token.ident;
nextToken();
}
id = null;
if (token.value == TOK.identifier)
{
id = token.ident;
nextToken();
}
tm = new AST.TemplateMixin(locMixin, id, tqual, tiargs);
if (token.value != TOK.semicolon)
error("`;` expected after `mixin`");
nextToken();
return tm;
}
/******************************************
* Parse template arguments.
* Input:
* current token is opening '!'
* Output:
* current token is one after closing '$(RPAREN)'
*/
private AST.Objects* parseTemplateArguments()
{
AST.Objects* tiargs;
nextToken();
if (token.value == TOK.leftParenthesis)
{
// ident!(template_arguments)
tiargs = parseTemplateArgumentList();
}
else
{
// ident!template_argument
RootObject o = parseTemplateSingleArgument();
if (!o)
{
error("template argument expected following `!`");
}
else
{
tiargs = new AST.Objects();
tiargs.push(o);
}
}
if (token.value == TOK.not)
{
TOK tok = peekNext();
if (tok != TOK.is_ && tok != TOK.in_)
{
error("multiple ! arguments are not allowed");
Lagain:
nextToken();
if (token.value == TOK.leftParenthesis)
parseTemplateArgumentList();
else
parseTemplateSingleArgument();
if (token.value == TOK.not && (tok = peekNext()) != TOK.is_ && tok != TOK.in_)
goto Lagain;
}
}
return tiargs;
}
/******************************************
* Parse template argument list.
* Input:
* current token is opening '$(LPAREN)',
* or ',' for __traits
* Output:
* current token is one after closing '$(RPAREN)'
*/
private AST.Objects* parseTemplateArgumentList()
{
//printf("Parser::parseTemplateArgumentList()\n");
auto tiargs = new AST.Objects();
TOK endtok = TOK.rightParenthesis;
assert(token.value == TOK.leftParenthesis || token.value == TOK.comma);
nextToken();
// Get TemplateArgumentList
while (token.value != endtok)
{
tiargs.push(parseTypeOrAssignExp());
if (token.value != TOK.comma)
break;
nextToken();
}
check(endtok, "template argument list");
return tiargs;
}
/***************************************
* Parse a Type or an Expression
* Returns:
* RootObject representing the AST
*/
RootObject parseTypeOrAssignExp(TOK endtoken = TOK.reserved)
{
return isDeclaration(&token, NeedDeclaratorId.no, endtoken, null)
? parseType() // argument is a type
: parseAssignExp(); // argument is an expression
}
/*****************************
* Parse single template argument, to support the syntax:
* foo!arg
* Input:
* current token is the arg
* Returns: An AST.Type, AST.Expression, or `null` on error
*/
private RootObject parseTemplateSingleArgument()
{
//printf("parseTemplateSingleArgument()\n");
AST.Type ta;
switch (token.value)
{
case TOK.identifier:
ta = new AST.TypeIdentifier(token.loc, token.ident);
goto LabelX;
case TOK.vector:
ta = parseVector();
goto LabelX;
case TOK.void_:
ta = AST.Type.tvoid;
goto LabelX;
case TOK.int8:
ta = AST.Type.tint8;
goto LabelX;
case TOK.uns8:
ta = AST.Type.tuns8;
goto LabelX;
case TOK.int16:
ta = AST.Type.tint16;
goto LabelX;
case TOK.uns16:
ta = AST.Type.tuns16;
goto LabelX;
case TOK.int32:
ta = AST.Type.tint32;
goto LabelX;
case TOK.uns32:
ta = AST.Type.tuns32;
goto LabelX;
case TOK.int64:
ta = AST.Type.tint64;
goto LabelX;
case TOK.uns64:
ta = AST.Type.tuns64;
goto LabelX;
case TOK.int128:
ta = AST.Type.tint128;
goto LabelX;
case TOK.uns128:
ta = AST.Type.tuns128;
goto LabelX;
case TOK.float32:
ta = AST.Type.tfloat32;
goto LabelX;
case TOK.float64:
ta = AST.Type.tfloat64;
goto LabelX;
case TOK.float80:
ta = AST.Type.tfloat80;
goto LabelX;
case TOK.imaginary32:
ta = AST.Type.timaginary32;
goto LabelX;
case TOK.imaginary64:
ta = AST.Type.timaginary64;
goto LabelX;
case TOK.imaginary80:
ta = AST.Type.timaginary80;
goto LabelX;
case TOK.complex32:
ta = AST.Type.tcomplex32;
goto LabelX;
case TOK.complex64:
ta = AST.Type.tcomplex64;
goto LabelX;
case TOK.complex80:
ta = AST.Type.tcomplex80;
goto LabelX;
case TOK.bool_:
ta = AST.Type.tbool;
goto LabelX;
case TOK.char_:
ta = AST.Type.tchar;
goto LabelX;
case TOK.wchar_:
ta = AST.Type.twchar;
goto LabelX;
case TOK.dchar_:
ta = AST.Type.tdchar;
goto LabelX;
LabelX:
nextToken();
return ta;
case TOK.int32Literal:
case TOK.uns32Literal:
case TOK.int64Literal:
case TOK.uns64Literal:
case TOK.int128Literal:
case TOK.uns128Literal:
case TOK.float32Literal:
case TOK.float64Literal:
case TOK.float80Literal:
case TOK.imaginary32Literal:
case TOK.imaginary64Literal:
case TOK.imaginary80Literal:
case TOK.null_:
case TOK.true_:
case TOK.false_:
case TOK.charLiteral:
case TOK.wcharLiteral:
case TOK.dcharLiteral:
case TOK.string_:
case TOK.file:
case TOK.fileFullPath:
case TOK.line:
case TOK.moduleString:
case TOK.functionString:
case TOK.prettyFunction:
case TOK.this_:
{
// Template argument is an expression
return parsePrimaryExp();
}
default:
return null;
}
}
/**********************************
* Parse a static assertion.
* Current token is 'static'.
*/
private AST.StaticAssert parseStaticAssert()
{
const loc = token.loc;
AST.Expression exp;
AST.Expressions* msg = null;
//printf("parseStaticAssert()\n");
nextToken();
nextToken();
check(TOK.leftParenthesis);
exp = parseAssignExp();
if (token.value == TOK.comma)
{
if (peekNext() == TOK.rightParenthesis)
{
nextToken(); // consume `,`
nextToken(); // consume `)`
}
else
msg = parseArguments();
}
else
check(TOK.rightParenthesis);
check(TOK.semicolon, "static assert");
return new AST.StaticAssert(loc, exp, msg);
}
/***********************************
* Parse typeof(expression).
* Current token is on the 'typeof'.
*/
private AST.TypeQualified parseTypeof()
{
AST.TypeQualified t;
const loc = token.loc;
nextToken();
check(TOK.leftParenthesis);
if (token.value == TOK.return_) // typeof(return)
{
nextToken();
t = new AST.TypeReturn(loc);
}
else
{
AST.Expression exp = parseExpression(); // typeof(expression)
t = new AST.TypeTypeof(loc, exp);
}
check(TOK.rightParenthesis);
return t;
}
/***********************************
* Parse __vector(type).
* Current token is on the '__vector'.
*/
private AST.Type parseVector()
{
nextToken();
check(TOK.leftParenthesis);
AST.Type tb = parseType();
check(TOK.rightParenthesis);
return new AST.TypeVector(tb);
}
/***********************************
* Parse:
* extern (linkage)
* extern (C++, namespaces)
* extern (C++, "namespace", "namespaces", ...)
* extern (C++, (StringExp))
* The parser is on the 'extern' token.
*/
private ParsedLinkage!(AST) parseLinkage()
{
ParsedLinkage!(AST) result;
nextToken();
assert(token.value == TOK.leftParenthesis);
nextToken();
ParsedLinkage!(AST) returnLinkage(LINK link)
{
check(TOK.rightParenthesis);
result.link = link;
return result;
}
ParsedLinkage!(AST) invalidLinkage()
{
error("valid linkage identifiers are `D`, `C`, `C++`, `Objective-C`, `Windows`, `System`");
return returnLinkage(LINK.d);
}
if (token.value != TOK.identifier)
return returnLinkage(LINK.d);
Identifier id = token.ident;
nextToken();
if (id == Id.Windows)
return returnLinkage(LINK.windows);
else if (id == Id.D)
return returnLinkage(LINK.d);
else if (id == Id.System)
return returnLinkage(LINK.system);
else if (id == Id.Objective) // Looking for tokens "Objective-C"
{
if (token.value != TOK.min)
return invalidLinkage();
nextToken();
if (token.ident != Id.C)
return invalidLinkage();
nextToken();
return returnLinkage(LINK.objc);
}
else if (id != Id.C)
return invalidLinkage();
if (token.value != TOK.plusPlus)
return returnLinkage(LINK.c);
nextToken();
if (token.value != TOK.comma) // , namespaces or class or struct
return returnLinkage(LINK.cpp);
nextToken();
if (token.value == TOK.rightParenthesis)
return returnLinkage(LINK.cpp); // extern(C++,)
if (token.value == TOK.class_ || token.value == TOK.struct_)
{
result.cppmangle = token.value == TOK.class_ ? CPPMANGLE.asClass : CPPMANGLE.asStruct;
nextToken();
}
else if (token.value == TOK.identifier) // named scope namespace
{
result.idents = new AST.Identifiers();
while (1)
{
Identifier idn = token.ident;
result.idents.push(idn);
nextToken();
if (token.value == TOK.dot)
{
nextToken();
if (token.value == TOK.identifier)
continue;
error("identifier expected for C++ namespace");
result.idents = null; // error occurred, invalidate list of elements.
}
break;
}
}
else // non-scoped StringExp namespace
{
result.identExps = new AST.Expressions();
while (1)
{
result.identExps.push(parseCondExp());
if (token.value != TOK.comma)
break;
nextToken();
// Allow trailing commas as done for argument lists, arrays, ...
if (token.value == TOK.rightParenthesis)
break;
}
}
return returnLinkage(LINK.cpp);
}
/***********************************
* Parse ident1.ident2.ident3
*
* Params:
* entity = what qualified identifier is expected to resolve into.
* Used only for better error message
*
* Returns:
* array of identifiers with actual qualified one stored last
*/
private Identifier[] parseQualifiedIdentifier(const(char)* entity)
{
Identifier[] qualified;
do
{
nextToken();
if (token.value != TOK.identifier)
{
error(token.loc, "`%s` expected as dot-separated identifiers, got `%s`", entity, token.toChars());
return qualified;
}
Identifier id = token.ident;
qualified ~= id;
nextToken();
}
while (token.value == TOK.dot);
return qualified;
}
private AST.DebugSymbol parseDebugSpecification()
{
AST.DebugSymbol s;
nextToken();
if (token.value == TOK.identifier)
s = new AST.DebugSymbol(token.loc, token.ident);
else if (token.value == TOK.int32Literal || token.value == TOK.int64Literal)
{
// @@@DEPRECATED_2.111@@@
// Deprecated in 2.101, remove in 2.111
deprecation("`debug = <integer>` is deprecated, use debug identifiers instead");
s = new AST.DebugSymbol(token.loc, cast(uint)token.unsvalue);
}
else
{
error("identifier or integer expected, not `%s`", token.toChars());
s = null;
}
nextToken();
if (token.value != TOK.semicolon)
error("semicolon expected");
nextToken();
return s;
}
/**************************************
* Parse a debug conditional
*/
private AST.Condition parseDebugCondition()
{
uint level = 1;
Identifier id = null;
Loc loc = token.loc;
if (token.value == TOK.leftParenthesis)
{
nextToken();
if (token.value == TOK.identifier)
id = token.ident;
else if (token.value == TOK.int32Literal || token.value == TOK.int64Literal)
{
// @@@DEPRECATED_2.111@@@
// Deprecated in 2.101, remove in 2.111
deprecation("`debug( <integer> )` is deprecated, use debug identifiers instead");
level = cast(uint)token.unsvalue;
}
else
error("identifier or integer expected inside `debug(...)`, not `%s`", token.toChars());
loc = token.loc;
nextToken();
check(TOK.rightParenthesis);
}
return new AST.DebugCondition(loc, mod, level, id);
}
/**************************************
* Parse a version specification
*/
private AST.VersionSymbol parseVersionSpecification()
{
AST.VersionSymbol s;
nextToken();
if (token.value == TOK.identifier)
s = new AST.VersionSymbol(token.loc, token.ident);
else if (token.value == TOK.int32Literal || token.value == TOK.int64Literal)
{
// @@@DEPRECATED_2.111@@@
// Deprecated in 2.101, remove in 2.111
deprecation("`version = <integer>` is deprecated, use version identifiers instead");
s = new AST.VersionSymbol(token.loc, cast(uint)token.unsvalue);
}
else
{
error("identifier or integer expected, not `%s`", token.toChars());
s = null;
}
nextToken();
if (token.value != TOK.semicolon)
error("semicolon expected");
nextToken();
return s;
}
/**************************************
* Parse a version conditional
*/
private AST.Condition parseVersionCondition()
{
uint level = 1;
Identifier id = null;
Loc loc;
if (token.value == TOK.leftParenthesis)
{
nextToken();
/* Allow:
* version (unittest)
* version (assert)
* even though they are keywords
*/
loc = token.loc;
if (token.value == TOK.identifier)
id = token.ident;
else if (token.value == TOK.int32Literal || token.value == TOK.int64Literal)
{
// @@@DEPRECATED_2.111@@@
// Deprecated in 2.101, remove in 2.111
deprecation("`version( <integer> )` is deprecated, use version identifiers instead");
level = cast(uint)token.unsvalue;
}
else if (token.value == TOK.unittest_)
id = Identifier.idPool(Token.toString(TOK.unittest_));
else if (token.value == TOK.assert_)
id = Identifier.idPool(Token.toString(TOK.assert_));
else
error("identifier or integer expected inside `version(...)`, not `%s`", token.toChars());
nextToken();
check(TOK.rightParenthesis);
}
else
error("(condition) expected following `version`");
return new AST.VersionCondition(loc, mod, level, id);
}
/***********************************************
* static if (expression)
* body
* else
* body
* Current token is 'static'.
*/
private AST.Condition parseStaticIfCondition()
{
AST.Expression exp;
AST.Condition condition;
const loc = token.loc;
nextToken();
nextToken();
if (token.value == TOK.leftParenthesis)
{
nextToken();
exp = parseAssignExp();
check(TOK.rightParenthesis);
}
else
{
error("(expression) expected following `static if`");
exp = null;
}
condition = new AST.StaticIfCondition(loc, exp);
return condition;
}
/*****************************************
* Parse a constructor definition:
* this(parameters) { body }
* or postblit:
* this(this) { body }
* or constructor template:
* this(templateparameters)(parameters) { body }
* Current token is 'this'.
*/
private AST.Dsymbol parseCtor(PrefixAttributes!AST* pAttrs)
{
AST.Expressions* udas = null;
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
if (token.value == TOK.leftParenthesis && peekNext() == TOK.this_ && peekNext2() == TOK.rightParenthesis)
{
// this(this) { ... }
nextToken();
nextToken();
check(TOK.rightParenthesis);
stc = parsePostfix(stc, &udas);
if (stc & STC.immutable_)
deprecation("`immutable` postblit is deprecated. Please use an unqualified postblit.");
if (stc & STC.shared_)
deprecation("`shared` postblit is deprecated. Please use an unqualified postblit.");
if (stc & STC.const_)
deprecation("`const` postblit is deprecated. Please use an unqualified postblit.");
if (stc & STC.static_)
error(loc, "postblit cannot be `static`");
auto f = new AST.PostBlitDeclaration(loc, Loc.initial, stc, Id.postblit);
AST.Dsymbol s = parseContracts(f);
if (udas)
{
auto a = new AST.Dsymbols();
a.push(f);
s = new AST.UserAttributeDeclaration(udas, a);
}
return s;
}
/* Look ahead to see if:
* this(...)(...)
* which is a constructor template
*/
AST.TemplateParameters* tpl = null;
if (token.value == TOK.leftParenthesis && peekPastParen(&token).value == TOK.leftParenthesis)
{
tpl = parseTemplateParameterList();
}
/* Just a regular constructor
*/
auto parameterList = parseParameterList(null);
stc = parsePostfix(stc, &udas);
if (parameterList.varargs != VarArg.none || AST.Parameter.dim(parameterList.parameters) != 0)
{
if (stc & STC.static_)
error(loc, "constructor cannot be static");
}
else if (StorageClass ss = stc & (STC.shared_ | STC.static_)) // this()
{
if (ss == STC.static_)
error(loc, "use `static this()` to declare a static constructor");
else if (ss == (STC.shared_ | STC.static_))
error(loc, "use `shared static this()` to declare a shared static constructor");
}
AST.Expression constraint = tpl ? parseConstraint() : null;
AST.Type tf = new AST.TypeFunction(parameterList, null, linkage, stc); // RetrunType -> auto
tf = tf.addSTC(stc);
auto f = new AST.CtorDeclaration(loc, Loc.initial, stc, tf);
AST.Dsymbol s = parseContracts(f, !!tpl);
if (udas)
{
auto a = new AST.Dsymbols();
a.push(f);
s = new AST.UserAttributeDeclaration(udas, a);
}
if (tpl)
{
// Wrap a template around it
auto decldefs = new AST.Dsymbols();
decldefs.push(s);
s = new AST.TemplateDeclaration(loc, f.ident, tpl, constraint, decldefs);
}
return s;
}
/*****************************************
* Parse a destructor definition:
* ~this() { body }
* Current token is '~'.
*/
private AST.Dsymbol parseDtor(PrefixAttributes!AST* pAttrs)
{
AST.Expressions* udas = null;
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
check(TOK.this_);
check(TOK.leftParenthesis);
check(TOK.rightParenthesis);
stc = parsePostfix(stc, &udas);
if (StorageClass ss = stc & (STC.shared_ | STC.static_))
{
if (ss == STC.static_)
error(loc, "use `static ~this()` to declare a static destructor");
else if (ss == (STC.shared_ | STC.static_))
error(loc, "use `shared static ~this()` to declare a shared static destructor");
}
auto f = new AST.DtorDeclaration(loc, Loc.initial, stc, Id.dtor);
AST.Dsymbol s = parseContracts(f);
if (udas)
{
auto a = new AST.Dsymbols();
a.push(f);
s = new AST.UserAttributeDeclaration(udas, a);
}
return s;
}
/*****************************************
* Parse a static constructor definition:
* static this() { body }
* Current token is 'static'.
*/
private AST.Dsymbol parseStaticCtor(PrefixAttributes!AST* pAttrs)
{
//Expressions *udas = NULL;
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
nextToken();
check(TOK.leftParenthesis);
check(TOK.rightParenthesis);
stc = parsePostfix(stc & ~STC.TYPECTOR, null) | stc;
if (stc & STC.shared_)
error(loc, "use `shared static this()` to declare a shared static constructor");
else if (stc & STC.static_)
appendStorageClass(stc, STC.static_); // complaint for the redundancy
else if (StorageClass modStc = stc & STC.TYPECTOR)
{
OutBuffer buf;
AST.stcToBuffer(&buf, modStc);
error(loc, "static constructor cannot be `%s`", buf.peekChars());
}
stc &= ~(STC.static_ | STC.TYPECTOR);
auto f = new AST.StaticCtorDeclaration(loc, Loc.initial, stc);
AST.Dsymbol s = parseContracts(f);
return s;
}
/*****************************************
* Parse a static destructor definition:
* static ~this() { body }
* Current token is 'static'.
*/
private AST.Dsymbol parseStaticDtor(PrefixAttributes!AST* pAttrs)
{
AST.Expressions* udas = null;
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
nextToken();
check(TOK.this_);
check(TOK.leftParenthesis);
check(TOK.rightParenthesis);
stc = parsePostfix(stc & ~STC.TYPECTOR, &udas) | stc;
if (stc & STC.shared_)
error(loc, "use `shared static ~this()` to declare a shared static destructor");
else if (stc & STC.static_)
appendStorageClass(stc, STC.static_); // complaint for the redundancy
else if (StorageClass modStc = stc & STC.TYPECTOR)
{
OutBuffer buf;
AST.stcToBuffer(&buf, modStc);
error(loc, "static destructor cannot be `%s`", buf.peekChars());
}
stc &= ~(STC.static_ | STC.TYPECTOR);
auto f = new AST.StaticDtorDeclaration(loc, Loc.initial, stc);
AST.Dsymbol s = parseContracts(f);
if (udas)
{
auto a = new AST.Dsymbols();
a.push(f);
s = new AST.UserAttributeDeclaration(udas, a);
}
return s;
}
/*****************************************
* Parse a shared static constructor definition:
* shared static this() { body }
* Current token is 'shared'.
*/
private AST.Dsymbol parseSharedStaticCtor(PrefixAttributes!AST* pAttrs)
{
//Expressions *udas = NULL;
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
nextToken();
nextToken();
check(TOK.leftParenthesis);
check(TOK.rightParenthesis);
stc = parsePostfix(stc & ~STC.TYPECTOR, null) | stc;
if (StorageClass ss = stc & (STC.shared_ | STC.static_))
appendStorageClass(stc, ss); // complaint for the redundancy
else if (StorageClass modStc = stc & STC.TYPECTOR)
{
OutBuffer buf;
AST.stcToBuffer(&buf, modStc);
error(loc, "shared static constructor cannot be `%s`", buf.peekChars());
}
stc &= ~(STC.static_ | STC.TYPECTOR);
auto f = new AST.SharedStaticCtorDeclaration(loc, Loc.initial, stc);
AST.Dsymbol s = parseContracts(f);
return s;
}
/*****************************************
* Parse a shared static destructor definition:
* shared static ~this() { body }
* Current token is 'shared'.
*/
private AST.Dsymbol parseSharedStaticDtor(PrefixAttributes!AST* pAttrs)
{
AST.Expressions* udas = null;
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
nextToken();
nextToken();
check(TOK.this_);
check(TOK.leftParenthesis);
check(TOK.rightParenthesis);
stc = parsePostfix(stc & ~STC.TYPECTOR, &udas) | stc;
if (StorageClass ss = stc & (STC.shared_ | STC.static_))
appendStorageClass(stc, ss); // complaint for the redundancy
else if (StorageClass modStc = stc & STC.TYPECTOR)
{
OutBuffer buf;
AST.stcToBuffer(&buf, modStc);
error(loc, "shared static destructor cannot be `%s`", buf.peekChars());
}
stc &= ~(STC.static_ | STC.TYPECTOR);
auto f = new AST.SharedStaticDtorDeclaration(loc, Loc.initial, stc);
AST.Dsymbol s = parseContracts(f);
if (udas)
{
auto a = new AST.Dsymbols();
a.push(f);
s = new AST.UserAttributeDeclaration(udas, a);
}
return s;
}
/*****************************************
* Parse an invariant definition:
* invariant { statements... }
* invariant() { statements... }
* invariant (expression);
* Current token is 'invariant'.
*/
private AST.Dsymbol parseInvariant(PrefixAttributes!AST* pAttrs)
{
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
if (token.value == TOK.leftParenthesis) // optional () or invariant (expression);
{
nextToken();
if (token.value != TOK.rightParenthesis) // invariant (expression);
{
AST.Expression e = parseAssignExp(), msg = null;
if (token.value == TOK.comma)
{
nextToken();
if (token.value != TOK.rightParenthesis)
{
msg = parseAssignExp();
if (token.value == TOK.comma)
nextToken();
}
}
check(TOK.rightParenthesis);
check(TOK.semicolon, "invariant");
e = new AST.AssertExp(loc, e, msg);
auto fbody = new AST.ExpStatement(loc, e);
auto f = new AST.InvariantDeclaration(loc, token.loc, stc, null, fbody);
return f;
}
nextToken();
}
auto fbody = parseStatement(ParseStatementFlags.curly);
auto f = new AST.InvariantDeclaration(loc, token.loc, stc, null, fbody);
return f;
}
/*****************************************
* Parse a unittest definition:
* unittest { body }
* Current token is 'unittest'.
*/
private AST.Dsymbol parseUnitTest(PrefixAttributes!AST* pAttrs)
{
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
nextToken();
const(char)* begPtr = token.ptr + 1; // skip left curly brace
const(char)* endPtr = null;
AST.Statement sbody = parseStatement(ParseStatementFlags.curly, &endPtr);
/** Extract unittest body as a string. Must be done eagerly since memory
will be released by the lexer before doc gen. */
char* docline = null;
if (compileEnv.ddocOutput && endPtr > begPtr)
{
/* Remove trailing whitespaces */
for (const(char)* p = endPtr - 1; begPtr <= p && (*p == ' ' || *p == '\r' || *p == '\n' || *p == '\t'); --p)
{
endPtr = p;
}
size_t len = endPtr - begPtr;
if (len > 0)
{
docline = cast(char*)mem.xmalloc_noscan(len + 2);
memcpy(docline, begPtr, len);
docline[len] = '\n'; // Terminate all lines by LF
docline[len + 1] = '\0';
}
}
auto f = new AST.UnitTestDeclaration(loc, token.loc, stc, docline);
f.fbody = sbody;
return f;
}
/*****************************************
* Parse a new definition:
* @disable new();
* Current token is 'new'.
*/
private AST.Dsymbol parseNew(PrefixAttributes!AST* pAttrs)
{
const loc = token.loc;
StorageClass stc = getStorageClass!AST(pAttrs);
if (!(stc & STC.disable))
{
error("`new` allocator must be annotated with `@disabled`");
}
nextToken();
/* @@@DEPRECATED_2.108@@@
* After deprecation period (2.108), remove all code in the version(all) block.
*/
version (all)
{
auto parameterList = parseParameterList(null); // parameterList ignored
if (parameterList.parameters.length > 0 || parameterList.varargs != VarArg.none)
deprecation("`new` allocator with non-empty parameter list is deprecated");
auto f = new AST.NewDeclaration(loc, stc);
if (token.value != TOK.semicolon)
{
deprecation("`new` allocator with function definition is deprecated");
parseContracts(f); // body ignored
f.fbody = null;
f.fensures = null;
f.frequires = null;
}
else
nextToken();
return f;
}
else
{
check(TOK.leftParenthesis);
check(TOK.rightParenthesis);
check(TOK.semicolon);
return new AST.NewDeclaration(loc, stc);
}
}
/**********************************************
* Parse parameter list.
*/
private AST.ParameterList parseParameterList(AST.TemplateParameters** tpl)
{
auto parameters = new AST.Parameters();
VarArg varargs = VarArg.none;
StorageClass varargsStc;
// Attributes allowed for ...
enum VarArgsStc = STC.const_ | STC.immutable_ | STC.shared_ | STC.scope_ | STC.return_ | STC.returnScope;
check(TOK.leftParenthesis);
while (1)
{
Identifier ai = null;
AST.Type at;
StorageClass storageClass = 0;
StorageClass stc;
AST.Expression ae;
AST.Expressions* udas = null;
for (; 1; nextToken())
{
L3:
switch (token.value)
{
case TOK.rightParenthesis:
if (storageClass != 0 || udas !is null)
error("basic type expected, not `)`");
break;
case TOK.dotDotDot:
varargs = VarArg.variadic;
varargsStc = storageClass;
if (varargsStc & ~VarArgsStc)
{
OutBuffer buf;
AST.stcToBuffer(&buf, varargsStc & ~VarArgsStc);
error("variadic parameter cannot have attributes `%s`", buf.peekChars());
varargsStc &= VarArgsStc;
}
nextToken();
break;
case TOK.const_:
if (peekNext() == TOK.leftParenthesis)
goto default;
stc = STC.const_;
goto L2;
case TOK.immutable_:
if (peekNext() == TOK.leftParenthesis)
goto default;
stc = STC.immutable_;
goto L2;
case TOK.shared_:
if (peekNext() == TOK.leftParenthesis)
goto default;
stc = STC.shared_;
goto L2;
case TOK.inout_:
if (peekNext() == TOK.leftParenthesis)
goto default;
stc = STC.wild;
goto L2;
case TOK.at:
{
AST.Expressions* exps = null;
StorageClass stc2 = parseAttribute(exps);
if (stc2 & atAttrGroup)
{
error("`@%s` attribute for function parameter is not supported", token.toChars());
}
else
{
udas = AST.UserAttributeDeclaration.concat(udas, exps);
}
if (token.value == TOK.dotDotDot)
error("variadic parameter cannot have user-defined attributes");
if (stc2)
nextToken();
goto L3;
// Don't call nextToken again.
}
case TOK.in_:
if (transitionIn)
eSink.message(scanloc, "Usage of 'in' on parameter");
stc = STC.in_;
goto L2;
case TOK.out_:
stc = STC.out_;
goto L2;
case TOK.ref_:
stc = STC.ref_;
goto L2;
case TOK.lazy_:
stc = STC.lazy_;
goto L2;
case TOK.scope_:
stc = STC.scope_;
goto L2;
case TOK.final_:
stc = STC.final_;
goto L2;
case TOK.auto_:
stc = STC.auto_;
goto L2;
case TOK.return_:
stc = STC.return_;
if (peekNext() == TOK.scope_)
stc |= STC.returnScope;
goto L2;
L2:
storageClass = appendStorageClass(storageClass, stc);
continue;
default:
{
stc = storageClass & (STC.IOR | STC.lazy_);
// if stc is not a power of 2
if (stc & (stc - 1) && !(stc == (STC.in_ | STC.ref_)))
error("incompatible parameter storage classes");
//if ((storageClass & STC.scope_) && (storageClass & (STC.ref_ | STC.out_)))
//error("scope cannot be ref or out");
const tv = peekNext();
if (tpl && token.value == TOK.identifier &&
(tv == TOK.comma || tv == TOK.rightParenthesis || tv == TOK.dotDotDot))
{
Identifier id = Identifier.generateId("__T");
const loc = token.loc;
at = new AST.TypeIdentifier(loc, id);
if (!*tpl)
*tpl = new AST.TemplateParameters();
AST.TemplateParameter tp = new AST.TemplateTypeParameter(loc, id, null, null);
(*tpl).push(tp);
ai = token.ident;
nextToken();
}
else
{
at = parseType(&ai);
}
ae = null;
if (token.value == TOK.assign) // = defaultArg
{
nextToken();
ae = parseDefaultInitExp();
}
auto param = new AST.Parameter(storageClass | STC.parameter, at, ai, ae, null);
if (udas)
{
auto a = new AST.Dsymbols();
auto udad = new AST.UserAttributeDeclaration(udas, a);
param.userAttribDecl = udad;
}
if (token.value == TOK.at)
{
AST.Expressions* exps = null;
StorageClass stc2 = parseAttribute(exps);
if (stc2 & atAttrGroup)
{
error("`@%s` attribute for function parameter is not supported", token.toChars());
}
else
{
error("user-defined attributes cannot appear as postfixes", token.toChars());
}
if (stc2)
nextToken();
}
if (token.value == TOK.dotDotDot)
{
/* This is:
* at ai ...
*/
if (storageClass & (STC.out_ | STC.ref_))
error("variadic argument cannot be `out` or `ref`");
varargs = VarArg.typesafe;
parameters.push(param);
nextToken();
break;
}
parameters.push(param);
if (token.value == TOK.comma)
{
nextToken();
goto L1;
}
break;
}
}
break;
}
break;
L1:
}
check(TOK.rightParenthesis);
return AST.ParameterList(parameters, varargs, varargsStc);
}
/*************************************
*/
private AST.EnumDeclaration parseEnum()
{
AST.EnumDeclaration e;
Identifier id;
AST.Type memtype;
auto loc = token.loc;
// printf("Parser::parseEnum()\n");
nextToken();
id = null;
if (token.value == TOK.identifier)
{
id = token.ident;
nextToken();
}
memtype = null;
if (token.value == TOK.colon)
{
nextToken();
int alt = 0;
const typeLoc = token.loc;
memtype = parseBasicType();
memtype = parseDeclarator(memtype, alt, null);
checkCstyleTypeSyntax(typeLoc, memtype, alt, null);
}
e = new AST.EnumDeclaration(loc, id, memtype);
if (token.value == TOK.semicolon && id)
nextToken();
else if (token.value == TOK.leftCurly)
{
bool isAnonymousEnum = !id;
TOK prevTOK;
//printf("enum definition\n");
e.members = new AST.Dsymbols();
nextToken();
const(char)[] comment = token.blockComment;
while (token.value != TOK.rightCurly)
{
/* Can take the following forms...
* 1. ident
* 2. ident = value
* 3. type ident = value
* ... prefixed by valid attributes
*/
loc = token.loc;
AST.Type type = null;
Identifier ident = null;
AST.Expressions* udas;
StorageClass stc;
AST.Expression deprecationMessage;
enum attributeErrorMessage = "`%s` is not a valid attribute for enum members";
while(token.value != TOK.rightCurly
&& token.value != TOK.comma
&& token.value != TOK.assign)
{
switch(token.value)
{
case TOK.at:
if (StorageClass _stc = parseAttribute(udas))
{
if (_stc == STC.disable)
stc |= _stc;
else
{
OutBuffer buf;
AST.stcToBuffer(&buf, _stc);
error(attributeErrorMessage, buf.peekChars());
}
prevTOK = token.value;
nextToken();
}
break;
case TOK.deprecated_:
stc |= STC.deprecated_;
if (!parseDeprecatedAttribute(deprecationMessage))
{
prevTOK = token.value;
nextToken();
}
break;
case TOK.identifier:
const tv = peekNext();
if (tv == TOK.assign || tv == TOK.comma || tv == TOK.rightCurly)
{
ident = token.ident;
type = null;
prevTOK = token.value;
nextToken();
}
else
{
goto default;
}
break;
default:
if (isAnonymousEnum)
{
type = parseType(&ident, null);
if (type == AST.Type.terror)
{
type = null;
prevTOK = token.value;
nextToken();
}
else
{
prevTOK = TOK.identifier;
}
}
else
{
error(attributeErrorMessage, token.toChars());
prevTOK = token.value;
nextToken();
}
break;
}
if (token.value == TOK.comma)
{
prevTOK = token.value;
}
}
if (type && type != AST.Type.terror)
{
if (!ident)
error("no identifier for declarator `%s`", type.toChars());
if (!isAnonymousEnum)
error("type only allowed if anonymous enum and no enum type");
}
AST.Expression value;
if (token.value == TOK.assign)
{
if (prevTOK == TOK.identifier)
{
nextToken();
value = parseAssignExp();
}
else
{
error("assignment must be preceded by an identifier");
nextToken();
}
}
else
{
value = null;
if (type && type != AST.Type.terror && isAnonymousEnum)
error("if type, there must be an initializer");
}
AST.DeprecatedDeclaration dd;
if (deprecationMessage)
{
dd = new AST.DeprecatedDeclaration(deprecationMessage, null);
stc |= STC.deprecated_;
}
auto em = new AST.EnumMember(loc, ident, value, type, stc, null, dd);
e.members.push(em);
if (udas)
{
auto uad = new AST.UserAttributeDeclaration(udas, new AST.Dsymbols());
em.userAttribDecl = uad;
}
if (token.value == TOK.rightCurly)
{
}
else
{
addComment(em, comment);
comment = null;
check(TOK.comma);
}
addComment(em, comment);
comment = token.blockComment;
if (token.value == TOK.endOfFile)
{
error("premature end of file");
break;
}
}
nextToken();
}
else
error("enum declaration is invalid");
//printf("-parseEnum() %s\n", e.toChars());
return e;
}
/********************************
* Parse struct, union, interface, class.
*/
private AST.Dsymbol parseAggregate()
{
AST.TemplateParameters* tpl = null;
AST.Expression constraint;
const loc = token.loc;
TOK tok = token.value;
//printf("Parser::parseAggregate()\n");
nextToken();
Identifier id;
if (token.value != TOK.identifier)
{
id = null;
}
else
{
id = token.ident;
nextToken();
if (token.value == TOK.leftParenthesis)
{
// struct/class template declaration.
tpl = parseTemplateParameterList();
constraint = parseConstraint();
}
}
// Collect base class(es)
AST.BaseClasses* baseclasses = null;
if (token.value == TOK.colon)
{
if (tok != TOK.interface_ && tok != TOK.class_)
error("base classes are not allowed for `%s`, did you mean `;`?", Token.toChars(tok));
nextToken();
baseclasses = parseBaseClasses();
}
if (token.value == TOK.if_)
{
if (constraint)
error("template constraints appear both before and after BaseClassList, put them before");
constraint = parseConstraint();
}
if (constraint)
{
if (!id)
error("template constraints not allowed for anonymous `%s`", Token.toChars(tok));
if (!tpl)
error("template constraints only allowed for templates");
}
AST.Dsymbols* members = null;
if (token.value == TOK.leftCurly)
{
//printf("aggregate definition\n");
const lookingForElseSave = lookingForElse;
lookingForElse = Loc();
nextToken();
members = parseDeclDefs(0);
lookingForElse = lookingForElseSave;
if (token.value != TOK.rightCurly)
{
/* { */
error(token.loc, "`}` expected following members in `%s` declaration at %s",
Token.toChars(tok), loc.toChars());
}
nextToken();
}
else if (token.value == TOK.semicolon && id)
{
if (baseclasses || constraint)
error("members expected");
nextToken();
}
else
{
error(token.loc, "{ } expected following `%s` declaration", Token.toChars(tok));
}
AST.AggregateDeclaration a;
switch (tok)
{
case TOK.interface_:
if (!id)
error(loc, "anonymous interfaces not allowed");
a = new AST.InterfaceDeclaration(loc, id, baseclasses);
a.members = members;
break;
case TOK.class_:
if (!id)
error(loc, "anonymous classes not allowed");
bool inObject = md && !md.packages && md.id == Id.object;
a = new AST.ClassDeclaration(loc, id, baseclasses, members, inObject);
break;
case TOK.struct_:
if (id)
{
bool inObject = md && !md.packages && md.id == Id.object;
a = new AST.StructDeclaration(loc, id, inObject);
a.members = members;
}
else
{
/* Anonymous structs/unions are more like attributes.
*/
assert(!tpl);
return new AST.AnonDeclaration(loc, false, members);
}
break;
case TOK.union_:
if (id)
{
a = new AST.UnionDeclaration(loc, id);
a.members = members;
}
else
{
/* Anonymous structs/unions are more like attributes.
*/
assert(!tpl);
return new AST.AnonDeclaration(loc, true, members);
}
break;
default:
assert(0);
}
if (tpl)
{
// Wrap a template around the aggregate declaration
auto decldefs = new AST.Dsymbols();
decldefs.push(a);
auto tempdecl = new AST.TemplateDeclaration(loc, id, tpl, constraint, decldefs);
return tempdecl;
}
return a;
}
/*******************************************
*/
private AST.BaseClasses* parseBaseClasses()
{
auto baseclasses = new AST.BaseClasses();
for (; 1; nextToken())
{
auto b = new AST.BaseClass(parseBasicType());
baseclasses.push(b);
if (token.value != TOK.comma)
break;
}
return baseclasses;
}
AST.Dsymbols* parseImport()
{
auto decldefs = new AST.Dsymbols();
Identifier aliasid = null;
int isstatic = token.value == TOK.static_;
if (isstatic)
nextToken();
//printf("Parser::parseImport()\n");
do
{
L1:
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `import`");
break;
}
const loc = token.loc;
Identifier id = token.ident;
Identifier[] a;
nextToken();
if (!aliasid && token.value == TOK.assign)
{
aliasid = id;
goto L1;
}
while (token.value == TOK.dot)
{
a ~= id;
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `package`");
break;
}
id = token.ident;
nextToken();
}
auto s = new AST.Import(loc, a, id, aliasid, isstatic);
decldefs.push(s);
/* Look for
* : alias=name, alias=name;
* syntax.
*/
if (token.value == TOK.colon)
{
do
{
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `:`");
break;
}
Identifier _alias = token.ident;
Identifier name;
nextToken();
if (token.value == TOK.assign)
{
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `%s=`", _alias.toChars());
break;
}
name = token.ident;
nextToken();
}
else
{
name = _alias;
_alias = null;
}
s.addAlias(name, _alias);
}
while (token.value == TOK.comma);
break; // no comma-separated imports of this form
}
aliasid = null;
}
while (token.value == TOK.comma);
if (token.value == TOK.semicolon)
nextToken();
else
{
error("`;` expected");
nextToken();
}
return decldefs;
}
AST.Type parseType(Identifier* pident = null, AST.TemplateParameters** ptpl = null)
{
/* Take care of the storage class prefixes that
* serve as type attributes:
* const type
* immutable type
* shared type
* inout type
* inout const type
* shared const type
* shared inout type
* shared inout const type
*/
StorageClass stc = 0;
while (1)
{
switch (token.value)
{
case TOK.const_:
if (peekNext() == TOK.leftParenthesis)
break; // const as type constructor
stc |= STC.const_; // const as storage class
nextToken();
continue;
case TOK.immutable_:
if (peekNext() == TOK.leftParenthesis)
break;
stc |= STC.immutable_;
nextToken();
continue;
case TOK.shared_:
if (peekNext() == TOK.leftParenthesis)
break;
stc |= STC.shared_;
nextToken();
continue;
case TOK.inout_:
if (peekNext() == TOK.leftParenthesis)
break;
stc |= STC.wild;
nextToken();
continue;
default:
break;
}
break;
}
const typeLoc = token.loc;
AST.Type t;
t = parseBasicType();
int alt = 0;
t = parseDeclarator(t, alt, pident, ptpl);
checkCstyleTypeSyntax(typeLoc, t, alt, pident ? *pident : null);
t = t.addSTC(stc);
return t;
}
private AST.Type parseBasicType(bool dontLookDotIdents = false)
{
AST.Type t;
Loc loc;
Identifier id;
//printf("parseBasicType()\n");
switch (token.value)
{
case TOK.void_:
t = AST.Type.tvoid;
goto LabelX;
case TOK.int8:
t = AST.Type.tint8;
goto LabelX;
case TOK.uns8:
t = AST.Type.tuns8;
goto LabelX;
case TOK.int16:
t = AST.Type.tint16;
goto LabelX;
case TOK.uns16:
t = AST.Type.tuns16;
goto LabelX;
case TOK.int32:
t = AST.Type.tint32;
goto LabelX;
case TOK.uns32:
t = AST.Type.tuns32;
goto LabelX;
case TOK.int64:
t = AST.Type.tint64;
nextToken();
if (token.value == TOK.int64) // if `long long`
{
error("use `long` for a 64 bit integer instead of `long long`");
nextToken();
}
else if (token.value == TOK.float64) // if `long double`
{
error("use `real` instead of `long double`");
t = AST.Type.tfloat80;
nextToken();
}
break;
case TOK.uns64:
t = AST.Type.tuns64;
goto LabelX;
case TOK.int128:
t = AST.Type.tint128;
goto LabelX;
case TOK.uns128:
t = AST.Type.tuns128;
goto LabelX;
case TOK.float32:
t = AST.Type.tfloat32;
goto LabelX;
case TOK.float64:
t = AST.Type.tfloat64;
goto LabelX;
case TOK.float80:
t = AST.Type.tfloat80;
goto LabelX;
case TOK.imaginary32:
t = AST.Type.timaginary32;
goto LabelX;
case TOK.imaginary64:
t = AST.Type.timaginary64;
goto LabelX;
case TOK.imaginary80:
t = AST.Type.timaginary80;
goto LabelX;
case TOK.complex32:
t = AST.Type.tcomplex32;
goto LabelX;
case TOK.complex64:
t = AST.Type.tcomplex64;
goto LabelX;
case TOK.complex80:
t = AST.Type.tcomplex80;
goto LabelX;
case TOK.bool_:
t = AST.Type.tbool;
goto LabelX;
case TOK.char_:
t = AST.Type.tchar;
goto LabelX;
case TOK.wchar_:
t = AST.Type.twchar;
goto LabelX;
case TOK.dchar_:
t = AST.Type.tdchar;
goto LabelX;
LabelX:
nextToken();
break;
case TOK.this_:
case TOK.super_:
case TOK.identifier:
loc = token.loc;
id = token.ident;
nextToken();
if (token.value == TOK.not)
{
// ident!(template_arguments)
auto tempinst = new AST.TemplateInstance(loc, id, parseTemplateArguments());
t = parseBasicTypeStartingAt(new AST.TypeInstance(loc, tempinst), dontLookDotIdents);
}
else
{
t = parseBasicTypeStartingAt(new AST.TypeIdentifier(loc, id), dontLookDotIdents);
}
break;
case TOK.mixin_:
// https://dlang.org/spec/expression.html#mixin_types
loc = token.loc;
nextToken();
if (token.value != TOK.leftParenthesis)
error(token.loc, "found `%s` when expecting `%s` following `mixin`", token.toChars(), Token.toChars(TOK.leftParenthesis));
auto exps = parseArguments();
t = new AST.TypeMixin(loc, exps);
break;
case TOK.dot:
// Leading . as in .foo
t = parseBasicTypeStartingAt(new AST.TypeIdentifier(token.loc, Id.empty), dontLookDotIdents);
break;
case TOK.typeof_:
// typeof(expression)
t = parseBasicTypeStartingAt(parseTypeof(), dontLookDotIdents);
break;
case TOK.vector:
t = parseVector();
break;
case TOK.traits:
if (AST.TraitsExp te = cast(AST.TraitsExp) parsePrimaryExp())
if (te.ident)
{
t = new AST.TypeTraits(token.loc, te);
break;
}
t = new AST.TypeError;
break;
case TOK.const_:
// const(type)
nextToken();
check(TOK.leftParenthesis);
t = parseType().addSTC(STC.const_);
check(TOK.rightParenthesis);
break;
case TOK.immutable_:
// immutable(type)
nextToken();
check(TOK.leftParenthesis);
t = parseType().addSTC(STC.immutable_);
check(TOK.rightParenthesis);
break;
case TOK.shared_:
// shared(type)
nextToken();
check(TOK.leftParenthesis);
t = parseType().addSTC(STC.shared_);
check(TOK.rightParenthesis);
break;
case TOK.inout_:
// wild(type)
nextToken();
check(TOK.leftParenthesis);
t = parseType().addSTC(STC.wild);
check(TOK.rightParenthesis);
break;
default:
error("basic type expected, not `%s`", token.toChars());
if (token.value == TOK.else_)
eSink.errorSupplemental(token.loc, "There's no `static else`, use `else` instead.");
t = AST.Type.terror;
break;
}
return t;
}
private AST.Type parseBasicTypeStartingAt(AST.TypeQualified tid, bool dontLookDotIdents)
{
AST.Type maybeArray = null;
// See https://issues.dlang.org/show_bug.cgi?id=1215
// A basic type can look like MyType (typical case), but also:
// MyType.T -> A type
// MyType[expr] -> Either a static array of MyType or a type (iif MyType is a Ttuple)
// MyType[expr].T -> A type.
// MyType[expr].T[expr] -> Either a static array of MyType[expr].T or a type
// (iif MyType[expr].T is a Ttuple)
while (1)
{
switch (token.value)
{
case TOK.dot:
{
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `.` instead of `%s`", token.toChars());
break;
}
if (maybeArray)
{
// This is actually a TypeTuple index, not an {a/s}array.
// We need to have a while loop to unwind all index taking:
// T[e1][e2].U -> T, addIndex(e1), addIndex(e2)
AST.Objects dimStack;
AST.Type t = maybeArray;
while (true)
{
if (t.ty == Tsarray)
{
// The index expression is an Expression.
AST.TypeSArray a = cast(AST.TypeSArray)t;
dimStack.push(a.dim.syntaxCopy());
t = a.next.syntaxCopy();
}
else if (t.ty == Taarray)
{
// The index expression is a Type. It will be interpreted as an expression at semantic time.
AST.TypeAArray a = cast(AST.TypeAArray)t;
dimStack.push(a.index.syntaxCopy());
t = a.next.syntaxCopy();
}
else
{
break;
}
}
assert(dimStack.length > 0);
// We're good. Replay indices in the reverse order.
tid = cast(AST.TypeQualified)t;
while (dimStack.length)
{
tid.addIndex(dimStack.pop());
}
maybeArray = null;
}
const loc = token.loc;
Identifier id = token.ident;
nextToken();
if (token.value == TOK.not)
{
auto tempinst = new AST.TemplateInstance(loc, id, parseTemplateArguments());
tid.addInst(tempinst);
}
else
tid.addIdent(id);
continue;
}
case TOK.leftBracket:
{
if (dontLookDotIdents) // workaround for https://issues.dlang.org/show_bug.cgi?id=14911
goto Lend;
nextToken();
AST.Type t = maybeArray ? maybeArray : cast(AST.Type)tid;
if (token.value == TOK.rightBracket)
{
// It's a dynamic array, and we're done:
// T[].U does not make sense.
t = new AST.TypeDArray(t);
nextToken();
return t;
}
else if (isDeclaration(&token, NeedDeclaratorId.no, TOK.rightBracket, null))
{
// This can be one of two things:
// 1 - an associative array declaration, T[type]
// 2 - an associative array declaration, T[expr]
// These can only be disambiguated later.
AST.Type index = parseType(); // [ type ]
maybeArray = new AST.TypeAArray(t, index);
check(TOK.rightBracket);
}
else
{
// This can be one of three things:
// 1 - an static array declaration, T[expr]
// 2 - a slice, T[expr .. expr]
// 3 - a template parameter pack index expression, T[expr].U
// 1 and 3 can only be disambiguated later.
//printf("it's type[expression]\n");
inBrackets++;
AST.Expression e = parseAssignExp(); // [ expression ]
if (token.value == TOK.slice)
{
// It's a slice, and we're done.
nextToken();
AST.Expression e2 = parseAssignExp(); // [ exp .. exp ]
t = new AST.TypeSlice(t, e, e2);
inBrackets--;
check(TOK.rightBracket);
return t;
}
else
{
maybeArray = new AST.TypeSArray(t, e);
inBrackets--;
check(TOK.rightBracket);
continue;
}
}
break;
}
default:
goto Lend;
}
}
Lend:
return maybeArray ? maybeArray : cast(AST.Type)tid;
}
/******************************************
* Parse suffixes to type t.
* *
* []
* [AssignExpression]
* [AssignExpression .. AssignExpression]
* [Type]
* delegate Parameters MemberFunctionAttributes(opt)
* function Parameters FunctionAttributes(opt)
* Params:
* t = the already parsed type
* Returns:
* t with the suffixes added
* See_Also:
* https://dlang.org/spec/declaration.html#TypeSuffixes
*/
private AST.Type parseTypeSuffixes(AST.Type t)
{
//printf("parseTypeSuffixes()\n");
while (1)
{
switch (token.value)
{
case TOK.mul:
t = new AST.TypePointer(t);
nextToken();
continue;
case TOK.leftBracket:
// Handle []. Make sure things like
// int[3][1] a;
// is (array[1] of array[3] of int)
nextToken();
if (token.value == TOK.rightBracket)
{
t = new AST.TypeDArray(t); // []
nextToken();
}
else if (isDeclaration(&token, NeedDeclaratorId.no, TOK.rightBracket, null))
{
// It's an associative array declaration
//printf("it's an associative array\n");
AST.Type index = parseType(); // [ type ]
t = new AST.TypeAArray(t, index);
check(TOK.rightBracket);
}
else
{
//printf("it's type[expression]\n");
inBrackets++;
AST.Expression e = parseAssignExp(); // [ expression ]
if (!e)
{
inBrackets--;
check(TOK.rightBracket);
continue;
}
if (token.value == TOK.slice)
{
nextToken();
AST.Expression e2 = parseAssignExp(); // [ exp .. exp ]
t = new AST.TypeSlice(t, e, e2);
}
else
{
t = new AST.TypeSArray(t, e);
}
inBrackets--;
check(TOK.rightBracket);
}
continue;
case TOK.delegate_:
case TOK.function_:
{
// Handle delegate declaration:
// t delegate(parameter list) nothrow pure
// t function(parameter list) nothrow pure
const save = token.value;
nextToken();
auto parameterList = parseParameterList(null);
StorageClass stc = parsePostfix(STC.undefined_, null);
auto tf = new AST.TypeFunction(parameterList, t, linkage, stc);
if (stc & (STC.const_ | STC.immutable_ | STC.shared_ | STC.wild | STC.return_))
{
if (save == TOK.function_)
error("`const`/`immutable`/`shared`/`inout`/`return` attributes are only valid for non-static member functions");
else
tf = cast(AST.TypeFunction)tf.addSTC(stc);
}
t = save == TOK.delegate_ ? new AST.TypeDelegate(tf) : new AST.TypePointer(tf); // pointer to function
continue;
}
default:
return t;
}
assert(0);
}
assert(0);
}
/**********************
* Parse Declarator
* Params:
* t = base type to start with
* palt = OR in 1 for C-style function pointer declaration syntax,
* 2 for C-style array declaration syntax, otherwise don't modify
* pident = set to Identifier if there is one, null if not
* tpl = if !null, then set to TemplateParameterList
* storageClass = any storage classes seen so far
* pdisable = set to true if @disable seen
* pudas = any user defined attributes seen so far. Merged with any more found
* Returns:
* type declared
* Reference: https://dlang.org/spec/declaration.html#Declarator
*/
private AST.Type parseDeclarator(AST.Type t, ref int palt, Identifier* pident,
AST.TemplateParameters** tpl = null, StorageClass storageClass = 0,
bool* pdisable = null, AST.Expressions** pudas = null)
{
//printf("parseDeclarator(tpl = %p)\n", tpl);
t = parseTypeSuffixes(t);
AST.Type ts;
switch (token.value)
{
case TOK.identifier:
if (pident)
*pident = token.ident;
else
error("unexpected identifier `%s` in declarator", token.ident.toChars());
ts = t;
nextToken();
break;
case TOK.leftParenthesis:
{
// like: T (*fp)();
// like: T ((*fp))();
if (peekNext() == TOK.mul || peekNext() == TOK.leftParenthesis)
{
/* Parse things with parentheses around the identifier, like:
* int (*ident[3])[]
* although the D style would be:
* int[]*[3] ident
*/
palt |= 1;
nextToken();
ts = parseDeclarator(t, palt, pident);
check(TOK.rightParenthesis);
break;
}
ts = t;
Token* peekt = &token;
/* Completely disallow C-style things like:
* T (a);
* Improve error messages for the common bug of a missing return type
* by looking to see if (a) looks like a parameter list.
*/
if (isParameters(&peekt))
{
error("function declaration without return type. (Note that constructors are always named `this`)");
}
else
error("unexpected `(` in declarator");
break;
}
default:
ts = t;
break;
}
// parse DeclaratorSuffixes
while (1)
{
switch (token.value)
{
static if (CARRAYDECL)
{
/* Support C style array syntax:
* int ident[]
* as opposed to D-style:
* int[] ident
*/
case TOK.leftBracket:
{
// This is the old C-style post [] syntax.
AST.TypeNext ta;
nextToken();
if (token.value == TOK.rightBracket)
{
// It's a dynamic array
ta = new AST.TypeDArray(t); // []
nextToken();
palt |= 2;
}
else if (isDeclaration(&token, NeedDeclaratorId.no, TOK.rightBracket, null))
{
// It's an associative array
//printf("it's an associative array\n");
AST.Type index = parseType(); // [ type ]
check(TOK.rightBracket);
ta = new AST.TypeAArray(t, index);
palt |= 2;
}
else
{
//printf("It's a static array\n");
AST.Expression e = parseAssignExp(); // [ expression ]
ta = new AST.TypeSArray(t, e);
check(TOK.rightBracket);
palt |= 2;
}
/* Insert ta into
* ts -> ... -> t
* so that
* ts -> ... -> ta -> t
*/
AST.Type* pt;
for (pt = &ts; *pt != t; pt = &(cast(AST.TypeNext)*pt).next)
{
}
*pt = ta;
continue;
}
}
case TOK.leftParenthesis:
{
if (tpl)
{
Token* tk = peekPastParen(&token);
if (tk.value == TOK.leftParenthesis)
{
/* Look ahead to see if this is (...)(...),
* i.e. a function template declaration
*/
//printf("function template declaration\n");
// Gather template parameter list
*tpl = parseTemplateParameterList();
}
else if (tk.value == TOK.assign)
{
/* or (...) =,
* i.e. a variable template declaration
*/
//printf("variable template declaration\n");
*tpl = parseTemplateParameterList();
break;
}
}
auto parameterList = parseParameterList(null);
/* Parse const/immutable/shared/inout/nothrow/pure/return postfix
*/
// merge prefix storage classes
StorageClass stc = parsePostfix(storageClass, pudas);
AST.Type tf = new AST.TypeFunction(parameterList, t, linkage, stc);
tf = tf.addSTC(stc);
if (pdisable)
*pdisable = stc & STC.disable ? true : false;
/* Insert tf into
* ts -> ... -> t
* so that
* ts -> ... -> tf -> t
*/
AST.Type* pt;
for (pt = &ts; *pt != t; pt = &(cast(AST.TypeNext)*pt).next)
{
}
*pt = tf;
break;
}
default:
break;
}
break;
}
return ts;
}
private void parseStorageClasses(ref StorageClass storage_class, ref LINK link,
ref bool setAlignment, ref AST.Expression ealign, ref AST.Expressions* udas,
out Loc linkloc)
{
StorageClass stc;
bool sawLinkage = false; // seen a linkage declaration
linkloc = Loc.initial;
while (1)
{
switch (token.value)
{
case TOK.const_:
if (peekNext() == TOK.leftParenthesis)
break; // const as type constructor
stc = STC.const_; // const as storage class
goto L1;
case TOK.immutable_:
if (peekNext() == TOK.leftParenthesis)
break;
stc = STC.immutable_;
goto L1;
case TOK.shared_:
if (peekNext() == TOK.leftParenthesis)
break;
stc = STC.shared_;
goto L1;
case TOK.inout_:
if (peekNext() == TOK.leftParenthesis)
break;
stc = STC.wild;
goto L1;
case TOK.static_:
stc = STC.static_;
goto L1;
case TOK.final_:
stc = STC.final_;
goto L1;
case TOK.auto_:
stc = STC.auto_;
goto L1;
case TOK.scope_:
stc = STC.scope_;
goto L1;
case TOK.override_:
stc = STC.override_;
goto L1;
case TOK.abstract_:
stc = STC.abstract_;
goto L1;
case TOK.synchronized_:
stc = STC.synchronized_;
goto L1;
case TOK.deprecated_:
stc = STC.deprecated_;
goto L1;
case TOK.nothrow_:
stc = STC.nothrow_;
goto L1;
case TOK.pure_:
stc = STC.pure_;
goto L1;
case TOK.ref_:
stc = STC.ref_;
goto L1;
case TOK.gshared:
stc = STC.gshared;
goto L1;
case TOK.enum_:
{
const tv = peekNext();
if (tv == TOK.leftCurly || tv == TOK.colon)
break;
if (tv == TOK.identifier)
{
const nextv = peekNext2();
if (nextv == TOK.leftCurly || nextv == TOK.colon || nextv == TOK.semicolon)
break;
}
stc = STC.manifest;
goto L1;
}
case TOK.at:
{
stc = parseAttribute(udas);
if (stc)
goto L1;
continue;
}
L1:
storage_class = appendStorageClass(storage_class, stc);
nextToken();
continue;
case TOK.extern_:
{
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.extern_;
goto L1;
}
if (sawLinkage)
error("redundant linkage declaration");
sawLinkage = true;
linkloc = token.loc;
auto res = parseLinkage();
link = res.link;
if (res.idents || res.identExps)
{
error("C++ name spaces not allowed here");
}
if (res.cppmangle != CPPMANGLE.def)
{
error("C++ mangle declaration not allowed here");
}
continue;
}
case TOK.align_:
{
nextToken();
setAlignment = true;
if (token.value == TOK.leftParenthesis)
{
nextToken();
ealign = parseExpression();
check(TOK.rightParenthesis);
}
continue;
}
default:
break;
}
break;
}
}
/**********************************
* Parse Declarations.
* These can be:
* 1. declarations at global/class level
* 2. declarations at statement level
* Returns:
* array of Declarations.
*/
private AST.Dsymbols* parseDeclarations(bool autodecl, PrefixAttributes!AST* pAttrs, const(char)* comment)
{
StorageClass storage_class = STC.undefined_;
LINK link = linkage;
Loc linkloc = this.linkLoc;
bool setAlignment = false;
AST.Expression ealign;
AST.Expressions* udas = null;
//printf("parseDeclarations() %s\n", token.toChars());
if (!comment)
comment = token.blockComment.ptr;
/* Look for AliasReassignment
*/
if (token.value == TOK.identifier && peekNext() == TOK.assign)
return parseAliasReassignment(comment);
/* Declarations that start with `alias`
*/
bool isAliasDeclaration = false;
auto aliasLoc = token.loc;
if (token.value == TOK.alias_)
{
if (auto a = parseAliasDeclarations(comment))
return a;
/* Handle these later:
* alias StorageClasses type ident;
*/
isAliasDeclaration = true;
}
AST.Type ts;
if (!autodecl)
{
parseStorageClasses(storage_class, link, setAlignment, ealign, udas, linkloc);
if (token.value == TOK.enum_)
{
AST.Dsymbol d = parseEnum();
auto a = new AST.Dsymbols();
a.push(d);
if (udas)
{
d = new AST.UserAttributeDeclaration(udas, a);
a = new AST.Dsymbols();
a.push(d);
}
addComment(d, comment);
return a;
}
if (token.value == TOK.struct_ ||
token.value == TOK.union_ ||
token.value == TOK.class_ ||
token.value == TOK.interface_)
{
AST.Dsymbol s = parseAggregate();
auto a = new AST.Dsymbols();
a.push(s);
if (storage_class)
{
s = new AST.StorageClassDeclaration(storage_class, a);
a = new AST.Dsymbols();
a.push(s);
}
if (setAlignment)
{
s = new AST.AlignDeclaration(s.loc, ealign, a);
a = new AST.Dsymbols();
a.push(s);
}
if (link != linkage)
{
s = new AST.LinkDeclaration(linkloc, link, a);
a = new AST.Dsymbols();
a.push(s);
}
if (udas)
{
s = new AST.UserAttributeDeclaration(udas, a);
a = new AST.Dsymbols();
a.push(s);
}
addComment(s, comment);
return a;
}
/* Look for auto initializers:
* storage_class identifier = initializer;
* storage_class identifier(...) = initializer;
*/
if ((storage_class || udas) && token.value == TOK.identifier && hasOptionalParensThen(peek(&token), TOK.assign))
{
AST.Dsymbols* a = parseAutoDeclarations(storage_class, comment);
if (udas)
{
AST.Dsymbol s = new AST.UserAttributeDeclaration(udas, a);
a = new AST.Dsymbols();
a.push(s);
}
return a;
}
/* Look for return type inference for template functions.
*/
{
Token* tk;
if ((storage_class || udas) && token.value == TOK.identifier && skipParens(peek(&token), &tk) &&
skipAttributes(tk, &tk) &&
(tk.value == TOK.leftParenthesis || tk.value == TOK.leftCurly || tk.value == TOK.in_ || tk.value == TOK.out_ || tk.value == TOK.goesTo ||
tk.value == TOK.do_ || tk.value == TOK.identifier && tk.ident == Id._body))
{
if (tk.value == TOK.identifier && tk.ident == Id._body)
usageOfBodyKeyword();
ts = null;
}
else
{
ts = parseBasicType();
ts = parseTypeSuffixes(ts);
}
}
}
if (pAttrs)
{
storage_class |= pAttrs.storageClass;
//pAttrs.storageClass = STC.undefined_;
}
AST.Type tfirst = null;
auto a = new AST.Dsymbols();
while (1)
{
AST.TemplateParameters* tpl = null;
bool disable;
int alt = 0;
const loc = token.loc;
Identifier ident;
auto t = parseDeclarator(ts, alt, &ident, &tpl, storage_class, &disable, &udas);
assert(t);
if (!tfirst)
tfirst = t;
else if (t != tfirst)
error(token.loc, "multiple declarations must have the same type, not `%s` and `%s`", tfirst.toChars(), t.toChars());
if (token.value == TOK.colon && !ident && t.ty != Tfunction)
{
// Unnamed bit field
ident = Identifier.generateAnonymousId("BitField");
}
bool isThis = (t.ty == Tident && (cast(AST.TypeIdentifier)t).ident == Id.This && token.value == TOK.assign);
if (ident)
checkCstyleTypeSyntax(loc, t, alt, ident);
else if (!isThis && (t != AST.Type.terror))
noIdentifierForDeclarator(t);
if (isAliasDeclaration)
{
AST.Declaration v;
AST.Initializer _init = null;
/* Aliases can no longer have multiple declarators, storage classes,
* linkages, or auto declarations.
* These never made any sense, anyway.
* The code below needs to be fixed to reject them.
* The grammar has already been fixed to preclude them.
*/
if (udas)
error("user-defined attributes not allowed for `alias` declarations");
if (token.value == TOK.assign)
{
nextToken();
_init = parseInitializer();
}
if (_init)
{
error("alias cannot have initializer");
}
v = new AST.AliasDeclaration(aliasLoc, ident, t);
v.storage_class = storage_class;
if (pAttrs)
{
/* AliasDeclaration distinguish @safe, @system, @trusted attributes
* on prefix and postfix.
* @safe alias void function() FP1;
* alias @safe void function() FP2; // FP2 is not @safe
* alias void function() @safe FP3;
*/
pAttrs.storageClass &= STC.safeGroup;
}
AST.Dsymbol s = v;
if (link != linkage)
{
auto ax = new AST.Dsymbols();
ax.push(v);
s = new AST.LinkDeclaration(linkloc, link, ax);
}
a.push(s);
switch (token.value)
{
case TOK.semicolon:
nextToken();
addComment(s, comment);
break;
case TOK.comma:
nextToken();
addComment(s, comment);
continue;
default:
error("semicolon expected to close `alias` declaration, not `%s`", token.toChars());
break;
}
}
else if (t.ty == Tfunction)
{
AST.Expression constraint = null;
//printf("%s funcdecl t = %s, storage_class = x%lx\n", loc.toChars(), t.toChars(), storage_class);
auto f = new AST.FuncDeclaration(loc, Loc.initial, ident, storage_class | (disable ? STC.disable : 0), t);
if (pAttrs)
pAttrs.storageClass = STC.undefined_;
if (tpl)
constraint = parseConstraint();
AST.Dsymbol s = parseContracts(f, !!tpl);
auto tplIdent = s.ident;
if (link != linkage)
{
auto ax = new AST.Dsymbols();
ax.push(s);
s = new AST.LinkDeclaration(linkloc, link, ax);
}
if (udas)
{
auto ax = new AST.Dsymbols();
ax.push(s);
s = new AST.UserAttributeDeclaration(udas, ax);
}
/* A template parameter list means it's a function template
*/
if (tpl)
{
// Wrap a template around the function declaration
auto decldefs = new AST.Dsymbols();
decldefs.push(s);
auto tempdecl = new AST.TemplateDeclaration(loc, tplIdent, tpl, constraint, decldefs);
s = tempdecl;
StorageClass stc2 = STC.undefined_;
if (storage_class & STC.static_)
{
assert(f.storage_class & STC.static_);
f.storage_class &= ~STC.static_;
stc2 |= STC.static_;
}
if (storage_class & STC.deprecated_)
{
assert(f.storage_class & STC.deprecated_);
f.storage_class &= ~STC.deprecated_;
stc2 |= STC.deprecated_;
}
if (stc2 != STC.undefined_)
{
auto ax = new AST.Dsymbols();
ax.push(s);
s = new AST.StorageClassDeclaration(stc2, ax);
}
}
a.push(s);
addComment(s, comment);
}
else if (ident)
{
AST.Expression width;
if (token.value == TOK.colon)
{
nextToken();
width = parseCondExp();
}
AST.Initializer _init = null;
if (token.value == TOK.assign)
{
nextToken();
_init = parseInitializer();
}
AST.Dsymbol s;
if (width)
{
if (_init)
error("initializer not allowed for bit-field declaration");
if (storage_class)
error("storage class not allowed for bit-field declaration");
s = new AST.BitFieldDeclaration(width.loc, t, ident, width);
}
else
{
auto v = new AST.VarDeclaration(loc, t, ident, _init);
v.storage_class = storage_class;
if (pAttrs)
pAttrs.storageClass = STC.undefined_;
s = v;
}
if (tpl && _init)
{
auto a2 = new AST.Dsymbols();
a2.push(s);
auto tempdecl = new AST.TemplateDeclaration(loc, ident, tpl, null, a2, 0);
s = tempdecl;
}
if (setAlignment)
{
auto ax = new AST.Dsymbols();
ax.push(s);
s = new AST.AlignDeclaration(s.loc, ealign, ax);
}
if (link != linkage)
{
auto ax = new AST.Dsymbols();
ax.push(s);
s = new AST.LinkDeclaration(linkloc, link, ax);
}
if (udas)
{
auto ax = new AST.Dsymbols();
ax.push(s);
s = new AST.UserAttributeDeclaration(udas, ax);
}
a.push(s);
switch (token.value)
{
case TOK.semicolon:
nextToken();
addComment(s, comment);
break;
case TOK.comma:
nextToken();
addComment(s, comment);
continue;
default:
if (loc.linnum != token.loc.linnum)
{
error(token.loc, "semicolon needed to end declaration of `%s`, instead of `%s`", s.toChars(), token.toChars());
eSink.errorSupplemental(loc, "`%s` declared here", s.toChars());
}
else
{
error(token.loc, "semicolon needed to end declaration of `%s` instead of `%s`", s.toChars(), token.toChars());
}
break;
}
}
break;
}
return a;
}
/// Report an error that a declaration of type `t` is missing an identifier
/// The parser is expected to sit on the next token after the type.
private void noIdentifierForDeclarator(AST.Type t)
{
error("no identifier for declarator `%s`", t.toChars());
// A common mistake is to use a reserved keyword as an identifier, e.g. `in` or `out`
if (token.isKeyword)
{
eSink.errorSupplemental(token.loc, "`%s` is a keyword, perhaps append `_` to make it an identifier", token.toChars());
nextToken();
}
}
/********************************
* Parse AliasReassignment:
* identifier = type;
* Parser is sitting on the identifier.
* https://dlang.org/spec/declaration.html#alias-reassignment
* Params:
* comment = if not null, comment to attach to symbol
* Returns:
* array of symbols
*/
private AST.Dsymbols* parseAliasReassignment(const(char)* comment)
{
const loc = token.loc;
auto ident = token.ident;
nextToken();
nextToken(); // advance past =
auto t = parseType();
AST.Dsymbol s = new AST.AliasAssign(loc, ident, t, null);
check(TOK.semicolon, "alias reassignment");
addComment(s, comment);
auto a = new AST.Dsymbols();
a.push(s);
return a;
}
/********************************
* Parse declarations that start with `alias`
* Parser is sitting on the `alias`.
* https://dlang.org/spec/declaration.html#alias
* Params:
* comment = if not null, comment to attach to symbol
* Returns:
* array of symbols
*/
private AST.Dsymbols* parseAliasDeclarations(const(char)* comment)
{
const loc = token.loc;
nextToken();
Loc linkloc = this.linkLoc;
AST.Expressions* udas;
LINK link = linkage;
StorageClass storage_class = STC.undefined_;
AST.Expression ealign;
bool setAlignment = false;
/* Look for:
* alias Identifier this;
* https://dlang.org/spec/class.html#alias-this
*/
if (token.value == TOK.identifier && peekNext() == TOK.this_)
{
auto s = new AST.AliasThis(loc, token.ident);
nextToken();
check(TOK.this_);
check(TOK.semicolon, "`alias Identifier this`");
auto a = new AST.Dsymbols();
a.push(s);
addComment(s, comment);
return a;
}
/* Look for:
* alias this = identifier;
*/
if (token.value == TOK.this_ && peekNext() == TOK.assign && peekNext2() == TOK.identifier)
{
check(TOK.this_);
check(TOK.assign);
auto s = new AST.AliasThis(loc, token.ident);
nextToken();
check(TOK.semicolon, "`alias this = Identifier`");
auto a = new AST.Dsymbols();
a.push(s);
addComment(s, comment);
return a;
}
/* Look for:
* alias identifier = type;
* alias identifier(...) = type;
* https://dlang.org/spec/declaration.html#alias
*/
if (token.value == TOK.identifier && hasOptionalParensThen(peek(&token), TOK.assign))
{
auto a = new AST.Dsymbols();
while (1)
{
auto ident = token.ident;
nextToken();
AST.TemplateParameters* tpl = null;
if (token.value == TOK.leftParenthesis)
tpl = parseTemplateParameterList();
check(TOK.assign);
bool hasParsedAttributes;
void parseAttributes()
{
if (hasParsedAttributes) // only parse once
return;
hasParsedAttributes = true;
udas = null;
storage_class = STC.undefined_;
link = linkage;
linkloc = this.linkLoc;
setAlignment = false;
ealign = null;
parseStorageClasses(storage_class, link, setAlignment, ealign, udas, linkloc);
}
if (token.value == TOK.at)
parseAttributes;
AST.Declaration v;
AST.Dsymbol s;
// try to parse function type:
// TypeCtors? BasicType ( Parameters ) MemberFunctionAttributes
bool attributesAppended;
const StorageClass funcStc = parseTypeCtor();
Token* tlu = &token;
Token* tk;
if (token.value != TOK.function_ &&
token.value != TOK.delegate_ &&
isBasicType(&tlu) && tlu &&
tlu.value == TOK.leftParenthesis)
{
AST.Type tret = parseBasicType();
auto parameterList = parseParameterList(null);
parseAttributes();
if (udas)
error("user-defined attributes not allowed for `alias` declarations");
attributesAppended = true;
storage_class = appendStorageClass(storage_class, funcStc);
AST.Type tf = new AST.TypeFunction(parameterList, tret, link, storage_class);
v = new AST.AliasDeclaration(loc, ident, tf);
}
else if (token.value == TOK.function_ ||
token.value == TOK.delegate_ ||
token.value == TOK.leftParenthesis &&
skipAttributes(peekPastParen(&token), &tk) &&
(tk.value == TOK.goesTo || tk.value == TOK.leftCurly) ||
token.value == TOK.leftCurly ||
token.value == TOK.identifier && peekNext() == TOK.goesTo ||
token.value == TOK.ref_ && peekNext() == TOK.leftParenthesis &&
skipAttributes(peekPastParen(peek(&token)), &tk) &&
(tk.value == TOK.goesTo || tk.value == TOK.leftCurly) ||
token.value == TOK.auto_ && peekNext() == TOK.ref_ &&
peekNext2() == TOK.leftParenthesis &&
skipAttributes(peekPastParen(peek(peek(&token))), &tk) &&
(tk.value == TOK.goesTo || tk.value == TOK.leftCurly)
)
{
// function (parameters) { statements... }
// delegate (parameters) { statements... }
// (parameters) { statements... }
// (parameters) => expression
// { statements... }
// identifier => expression
// ref (parameters) { statements... }
// ref (parameters) => expression
// auto ref (parameters) { statements... }
// auto ref (parameters) => expression
s = parseFunctionLiteral();
if (udas !is null)
{
if (storage_class != 0)
error("cannot put a storage-class in an `alias` declaration.");
// parseAttributes shouldn't have set these variables
assert(link == linkage && !setAlignment && ealign is null);
auto tpl_ = cast(AST.TemplateDeclaration) s;
if (tpl_ is null || tpl_.members.length != 1)
{
error("user-defined attributes are not allowed on `alias` declarations");
}
else
{
auto fd = cast(AST.FuncLiteralDeclaration) (*tpl_.members)[0];
auto tf = cast(AST.TypeFunction) fd.type;
assert(tf.parameterList.parameters.length > 0);
auto as = new AST.Dsymbols();
(*tf.parameterList.parameters)[0].userAttribDecl = new AST.UserAttributeDeclaration(udas, as);
}
}
v = new AST.AliasDeclaration(loc, ident, s);
}
else
{
parseAttributes();
// type
if (udas)
error("user-defined attributes not allowed for `alias` declarations");
auto t = parseType();
// Disallow meaningless storage classes on type aliases
if (storage_class)
{
// Don't raise errors for STC that are part of a function/delegate type, e.g.
// `alias F = ref pure nothrow @nogc @safe int function();`
auto tp = t.isTypePointer;
const isFuncType = (tp && tp.next.isTypeFunction) || t.isTypeDelegate;
const remStc = isFuncType ? (storage_class & ~STC.FUNCATTR) : storage_class;
if (remStc)
{
OutBuffer buf;
AST.stcToBuffer(&buf, remStc);
// @@@DEPRECATED_2.103@@@
// Deprecated in 2020-07, can be made an error in 2.103
eSink.deprecation(token.loc, "storage class `%s` has no effect in type aliases", buf.peekChars());
}
}
v = new AST.AliasDeclaration(loc, ident, t);
}
if (!attributesAppended)
storage_class = appendStorageClass(storage_class, funcStc);
v.storage_class = storage_class;
s = v;
if (tpl)
{
auto a2 = new AST.Dsymbols();
a2.push(s);
auto tempdecl = new AST.TemplateDeclaration(loc, ident, tpl, null, a2);
s = tempdecl;
}
if (link != linkage)
{
auto a2 = new AST.Dsymbols();
a2.push(s);
s = new AST.LinkDeclaration(linkloc, link, a2);
}
a.push(s);
switch (token.value)
{
case TOK.semicolon:
nextToken();
addComment(s, comment);
break;
case TOK.comma:
nextToken();
addComment(s, comment);
if (token.value != TOK.identifier)
{
error("identifier expected following comma, not `%s`", token.toChars());
break;
}
if (peekNext() != TOK.assign && peekNext() != TOK.leftParenthesis)
{
error("`=` expected following identifier");
nextToken();
break;
}
continue;
default:
error("semicolon expected to close `alias` declaration, not `%s`", token.toChars());
break;
}
break;
}
return a;
}
// alias StorageClasses type ident;
return null;
}
private AST.Dsymbol parseFunctionLiteral()
{
const loc = token.loc;
AST.TemplateParameters* tpl = null;
AST.ParameterList parameterList;
AST.Type tret = null;
StorageClass stc = 0;
TOK save = TOK.reserved;
switch (token.value)
{
case TOK.function_:
case TOK.delegate_:
save = token.value;
nextToken();
if (token.value == TOK.auto_)
{
nextToken();
if (token.value == TOK.ref_)
{
// function auto ref (parameters) { statements... }
// delegate auto ref (parameters) { statements... }
stc = STC.auto_ | STC.ref_;
nextToken();
}
else
error("`auto` can only be used as part of `auto ref` for function literal return values");
}
else if (token.value == TOK.ref_)
{
// function ref (parameters) { statements... }
// delegate ref (parameters) { statements... }
stc = STC.ref_;
nextToken();
}
if (token.value != TOK.leftParenthesis && token.value != TOK.leftCurly &&
token.value != TOK.goesTo)
{
// function type (parameters) { statements... }
// delegate type (parameters) { statements... }
tret = parseBasicType();
tret = parseTypeSuffixes(tret); // function return type
}
if (token.value == TOK.leftParenthesis)
{
// function (parameters) { statements... }
// delegate (parameters) { statements... }
}
else
{
// function { statements... }
// delegate { statements... }
break;
}
goto case TOK.leftParenthesis;
case TOK.auto_:
{
nextToken();
if (token.value == TOK.ref_)
{
// auto ref (parameters) => expression
// auto ref (parameters) { statements... }
stc = STC.auto_ | STC.ref_;
nextToken();
}
else
error("`auto` can only be used as part of `auto ref` for function literal return values");
goto case TOK.leftParenthesis;
}
case TOK.ref_:
{
// ref (parameters) => expression
// ref (parameters) { statements... }
stc = STC.ref_;
nextToken();
goto case TOK.leftParenthesis;
}
case TOK.leftParenthesis:
{
// (parameters) => expression
// (parameters) { statements... }
parameterList = parseParameterList(&tpl);
stc = parsePostfix(stc, null);
if (StorageClass modStc = stc & STC.TYPECTOR)
{
if (save == TOK.function_)
{
OutBuffer buf;
AST.stcToBuffer(&buf, modStc);
error("function literal cannot be `%s`", buf.peekChars());
}
else
save = TOK.delegate_;
}
break;
}
case TOK.leftCurly:
// { statements... }
break;
case TOK.identifier:
{
// identifier => expression
parameterList.parameters = new AST.Parameters();
Identifier id = Identifier.generateId("__T");
AST.Type t = new AST.TypeIdentifier(loc, id);
parameterList.parameters.push(new AST.Parameter(STC.parameter, t, token.ident, null, null));
tpl = new AST.TemplateParameters();
AST.TemplateParameter tp = new AST.TemplateTypeParameter(loc, id, null, null);
tpl.push(tp);
nextToken();
break;
}
default:
assert(0);
}
auto tf = new AST.TypeFunction(parameterList, tret, linkage, stc);
tf = cast(AST.TypeFunction)tf.addSTC(stc);
auto fd = new AST.FuncLiteralDeclaration(loc, Loc.initial, tf, save, null, null, stc & STC.auto_);
if (token.value == TOK.goesTo)
{
check(TOK.goesTo);
if (token.value == TOK.leftCurly)
{
deprecation("using `(args) => { ... }` to create a delegate that returns a delegate is error-prone.");
deprecationSupplemental("Use `(args) { ... }` for a multi-statement function literal or use `(args) => () { }` if you intended for the lambda to return a delegate.");
}
const returnloc = token.loc;
AST.Expression ae = parseAssignExp();
fd.fbody = new AST.ReturnStatement(returnloc, ae);
fd.endloc = token.loc;
}
else
{
parseContracts(fd);
}
if (tpl)
{
// Wrap a template around function fd
auto decldefs = new AST.Dsymbols();
decldefs.push(fd);
return new AST.TemplateDeclaration(fd.loc, fd.ident, tpl, null, decldefs, false, true);
}
return fd;
}
/*****************************************
* Parse contracts following function declaration.
*/
private AST.FuncDeclaration parseContracts(AST.FuncDeclaration f, bool isTemplateFunction = false)
{
LINK linksave = linkage;
bool literal = f.isFuncLiteralDeclaration() !is null;
// The following is irrelevant, as it is overridden by sc.linkage in
// TypeFunction::semantic
linkage = LINK.d; // nested functions have D linkage
bool requireDo = false;
L1:
switch (token.value)
{
case TOK.goesTo:
if (requireDo)
error("missing `do { ... }` after `in` or `out`");
if (!compileEnv.shortenedMethods)
error("=> shortened method not enabled, compile with compiler switch `-preview=shortenedMethods`");
const returnloc = token.loc;
nextToken();
f.fbody = new AST.ReturnStatement(returnloc, parseExpression());
f.endloc = token.loc;
check(TOK.semicolon);
break;
case TOK.leftCurly:
if (requireDo)
error("missing `do { ... }` after `in` or `out`");
f.fbody = parseStatement(0);
f.endloc = endloc;
break;
case TOK.identifier:
if (token.ident == Id._body)
{
usageOfBodyKeyword();
goto case TOK.do_;
}
goto default;
case TOK.do_:
nextToken();
f.fbody = parseStatement(ParseStatementFlags.curly);
f.endloc = endloc;
break;
version (none)
{
// Do we want this for function declarations, so we can do:
// int x, y, foo(), z;
case TOK.comma:
nextToken();
continue;
}
case TOK.in_:
// in { statements... }
// in (expression)
auto loc = token.loc;
nextToken();
if (!f.frequires)
{
f.frequires = new AST.Statements;
}
if (token.value == TOK.leftParenthesis)
{
nextToken();
AST.Expression e = parseAssignExp(), msg = null;
if (token.value == TOK.comma)
{
nextToken();
if (token.value != TOK.rightParenthesis)
{
msg = parseAssignExp();
if (token.value == TOK.comma)
nextToken();
}
}
check(TOK.rightParenthesis);
e = new AST.AssertExp(loc, e, msg);
f.frequires.push(new AST.ExpStatement(loc, e));
requireDo = false;
}
else
{
auto ret = parseStatement(ParseStatementFlags.curly | ParseStatementFlags.scope_);
assert(ret);
f.frequires.push(ret);
requireDo = true;
}
goto L1;
case TOK.out_:
// out { statements... }
// out (; expression)
// out (identifier) { statements... }
// out (identifier; expression)
auto loc = token.loc;
nextToken();
if (!f.fensures)
{
f.fensures = new AST.Ensures;
}
Identifier id = null;
if (token.value != TOK.leftCurly)
{
check(TOK.leftParenthesis);
if (token.value != TOK.identifier && token.value != TOK.semicolon)
error("`(identifier) { ... }` or `(identifier; expression)` following `out` expected, not `%s`", token.toChars());
if (token.value != TOK.semicolon)
{
id = token.ident;
nextToken();
}
if (token.value == TOK.semicolon)
{
nextToken();
AST.Expression e = parseAssignExp(), msg = null;
if (token.value == TOK.comma)
{
nextToken();
if (token.value != TOK.rightParenthesis)
{
msg = parseAssignExp();
if (token.value == TOK.comma)
nextToken();
}
}
check(TOK.rightParenthesis);
e = new AST.AssertExp(loc, e, msg);
f.fensures.push(AST.Ensure(id, new AST.ExpStatement(loc, e)));
requireDo = false;
goto L1;
}
check(TOK.rightParenthesis);
}
f.fensures.push(AST.Ensure(id, parseStatement(ParseStatementFlags.curly | ParseStatementFlags.scope_)));
requireDo = true;
goto L1;
case TOK.semicolon:
if (!literal)
{
// https://issues.dlang.org/show_bug.cgi?id=15799
// Semicolon becomes a part of function declaration
// only when 'do' is not required
if (!requireDo)
nextToken();
break;
}
goto default;
default:
if (literal)
{
const(char)* sbody = requireDo ? "do " : "";
error("missing `%s{ ... }` for function literal", sbody);
}
else if (!requireDo) // allow contracts even with no body
{
TOK t = token.value;
if (t == TOK.const_ || t == TOK.immutable_ || t == TOK.inout_ || t == TOK.return_ ||
t == TOK.shared_ || t == TOK.nothrow_ || t == TOK.pure_)
error("'%s' cannot be placed after a template constraint", token.toChars);
else if (t == TOK.at)
error("attributes cannot be placed after a template constraint");
else if (t == TOK.if_)
{
if (isTemplateFunction)
error("template constraint must follow parameter lists and attributes");
else
error("cannot use function constraints for non-template functions. Use `static if` instead");
}
else
error("semicolon expected following function declaration, not `%s`", token.toChars());
}
break;
}
if (literal && !f.fbody)
{
// Set empty function body for error recovery
f.fbody = new AST.CompoundStatement(Loc.initial, cast(AST.Statement)null);
}
linkage = linksave;
return f;
}
/*****************************************
*/
private void checkDanglingElse(Loc elseloc)
{
if (token.value != TOK.else_ && token.value != TOK.catch_ && token.value != TOK.finally_ && lookingForElse.linnum != 0)
{
eSink.warning(elseloc, "else is dangling, add { } after condition at %s", lookingForElse.toChars());
}
}
/* *************************
* Issue errors if C-style syntax
* Params:
* alt = !=0 for C-style syntax
*/
private void checkCstyleTypeSyntax(Loc loc, AST.Type t, int alt, Identifier ident)
{
if (!alt)
return;
const(char)* sp = !ident ? "" : " ";
const(char)* s = !ident ? "" : ident.toChars();
error(loc, "instead of C-style syntax, use D-style `%s%s%s`", t.toChars(), sp, s);
}
/*****************************
* Ad-hoc error message for missing or extra parens that close a condition.
* Params:
* start = "if", "while", etc. Must be 0 terminated.
* param = if the condition is a declaration, this will be non-null
* condition = if param is null, then this is the conditional Expression. If condition is null,
* then an error in the condition was already reported.
*/
private void closeCondition(string start, AST.Parameter param, AST.Expression condition)
{
string format;
if (token.value != TOK.rightParenthesis && condition)
{
format = "missing closing `)` after `%s (%s`";
}
else
check(TOK.rightParenthesis);
if (token.value == TOK.rightParenthesis)
{
if (condition) // if not an error in condition
format = "extra `)` after `%s (%s)`";
nextToken();
}
if (format)
error(token.loc, format.ptr, start.ptr, param ? "declaration".ptr : condition.toChars());
}
/*****************************************
* Parses `foreach` statements, `static foreach` statements and
* `static foreach` declarations.
* Params:
* Foreach = one of Statement, StaticForeachStatement, StaticForeachDeclaration
* loc = location of foreach
* pLastDecl = non-null for StaticForeachDeclaration
* Returns:
* the Foreach generated
*/
private Foreach parseForeach(alias Foreach)(Loc loc, AST.Dsymbol* pLastDecl)
{
static if (is(Foreach == AST.StaticForeachStatement) || is(Foreach == AST.StaticForeachDeclaration))
{
nextToken();
}
TOK op = token.value;
nextToken();
check(TOK.leftParenthesis);
auto parameters = new AST.Parameters();
Identifier lastai;
while (1)
{
Identifier ai = null;
AST.Type at;
StorageClass storageClass = 0;
StorageClass stc = 0;
Lagain:
if (stc)
{
storageClass = appendStorageClass(storageClass, stc);
nextToken();
}
switch (token.value)
{
case TOK.ref_:
stc = STC.ref_;
goto Lagain;
case TOK.scope_:
stc = STC.scope_;
goto Lagain;
case TOK.out_:
error("cannot declare `out` loop variable, use `ref` instead");
stc = STC.out_;
goto Lagain;
case TOK.auto_:
error("cannot declare `auto` loop variable, omit `auto` to still get type inference");
stc = STC.auto_;
goto Lagain;
case TOK.enum_:
stc = STC.manifest;
goto Lagain;
case TOK.alias_:
storageClass = appendStorageClass(storageClass, STC.alias_);
nextToken();
break;
case TOK.const_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.const_;
goto Lagain;
}
break;
case TOK.immutable_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.immutable_;
goto Lagain;
}
break;
case TOK.shared_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.shared_;
goto Lagain;
}
break;
case TOK.inout_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.wild;
goto Lagain;
}
break;
default:
break;
}
if (token.value == TOK.identifier)
{
const tv = peekNext();
if (tv == TOK.comma || tv == TOK.semicolon || tv == TOK.rightParenthesis)
{
lastai = token.ident;
ai = token.ident;
at = null; // infer argument type
nextToken();
goto Larg;
}
}
at = parseType(&ai);
if (!ai)
noIdentifierForDeclarator(at);
Larg:
auto p = new AST.Parameter(storageClass, at, ai, null, null);
parameters.push(p);
if (token.value == TOK.comma)
{
nextToken();
continue;
}
break;
}
if (token.value != TOK.semicolon)
{
error("missing `; expression` before `)` of `foreach`");
nextToken();
if (lastai && parameters.length >= 2)
{
eSink.errorSupplemental(loc, "perhaps the `;` goes before `%s`", lastai.toChars());
}
return null;
}
nextToken();
AST.Expression aggr = parseExpression();
if (token.value == TOK.slice && parameters.length == 1)
{
AST.Parameter p = (*parameters)[0];
nextToken();
AST.Expression upr = parseExpression();
check(TOK.rightParenthesis);
Loc endloc;
static if (is(Foreach == AST.Statement) || is(Foreach == AST.StaticForeachStatement))
{
AST.Statement _body = parseStatement(0, null, &endloc);
}
else
{
AST.Statement _body = null;
}
auto rangefe = new AST.ForeachRangeStatement(loc, op, p, aggr, upr, _body, endloc);
static if (is(Foreach == AST.Statement))
{
return rangefe;
}
else static if(is(Foreach == AST.StaticForeachDeclaration))
{
return new AST.StaticForeachDeclaration(new AST.StaticForeach(loc, null, rangefe), parseBlock(pLastDecl));
}
else static if (is(Foreach == AST.StaticForeachStatement))
{
return new AST.StaticForeachStatement(loc, new AST.StaticForeach(loc, null, rangefe));
}
}
else
{
check(TOK.rightParenthesis);
Loc endloc;
static if (is(Foreach == AST.Statement) || is(Foreach == AST.StaticForeachStatement))
{
AST.Statement _body = parseStatement(0, null, &endloc);
}
else
{
AST.Statement _body = null;
}
auto aggrfe = new AST.ForeachStatement(loc, op, parameters, aggr, _body, endloc);
static if (is(Foreach == AST.Statement))
{
return aggrfe;
}
else static if(is(Foreach == AST.StaticForeachDeclaration))
{
return new AST.StaticForeachDeclaration(new AST.StaticForeach(loc, aggrfe, null), parseBlock(pLastDecl));
}
else static if (is(Foreach == AST.StaticForeachStatement))
{
return new AST.StaticForeachStatement(loc, new AST.StaticForeach(loc, aggrfe, null));
}
}
}
/***
* Parse an assignment condition for if or while statements.
*
* Returns:
* The variable that is declared inside the condition
*/
AST.Parameter parseAssignCondition()
{
AST.Parameter param = null;
StorageClass storageClass = 0;
StorageClass stc = 0;
LagainStc:
if (stc)
{
storageClass = appendStorageClass(storageClass, stc);
nextToken();
}
switch (token.value)
{
case TOK.ref_:
stc = STC.ref_;
goto LagainStc;
case TOK.scope_:
stc = STC.scope_;
goto LagainStc;
case TOK.auto_:
stc = STC.auto_;
goto LagainStc;
case TOK.const_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.const_;
goto LagainStc;
}
break;
case TOK.immutable_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.immutable_;
goto LagainStc;
}
break;
case TOK.shared_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.shared_;
goto LagainStc;
}
break;
case TOK.inout_:
if (peekNext() != TOK.leftParenthesis)
{
stc = STC.wild;
goto LagainStc;
}
break;
default:
break;
}
auto n = peek(&token);
if (storageClass != 0 && token.value == TOK.identifier && n.value == TOK.assign)
{
Identifier ai = token.ident;
AST.Type at = null; // infer parameter type
nextToken();
check(TOK.assign);
param = new AST.Parameter(storageClass, at, ai, null, null);
}
else if (isDeclaration(&token, NeedDeclaratorId.must, TOK.assign, null))
{
Identifier ai;
AST.Type at = parseType(&ai);
check(TOK.assign);
param = new AST.Parameter(storageClass, at, ai, null, null);
}
else if (storageClass != 0)
error("found `%s` while expecting `=` or identifier", n.toChars());
return param;
}
/*****************************************
* Input:
* flags PSxxxx
* Output:
* pEndloc if { ... statements ... }, store location of closing brace, otherwise loc of last token of statement
*/
AST.Statement parseStatement(int flags, const(char)** endPtr = null, Loc* pEndloc = null)
{
AST.Statement s;
AST.Condition cond;
AST.Statement ifbody;
AST.Statement elsebody;
bool isfinal;
const loc = token.loc;
//printf("parseStatement()\n");
if (flags & ParseStatementFlags.curly && token.value != TOK.leftCurly)
error("statement expected to be `{ }`, not `%s`", token.toChars());
switch (token.value)
{
case TOK.identifier:
{
/* A leading identifier can be a declaration, label, or expression.
* The easiest case to check first is label:
*/
if (peekNext() == TOK.colonColon)
{
// skip ident::
nextToken();
nextToken();
error("use `.` for member lookup, not `::`");
break;
}
if (peekNext() == TOK.colon)
{
// It's a label
Identifier ident = token.ident;
nextToken();
nextToken();
if (token.value == TOK.rightCurly)
s = null;
else if (token.value == TOK.leftCurly)
s = parseStatement(ParseStatementFlags.curly | ParseStatementFlags.scope_);
else if (flags & ParseStatementFlags.curlyScope)
s = parseStatement(ParseStatementFlags.semiOk | ParseStatementFlags.curlyScope);
else
s = parseStatement(ParseStatementFlags.semiOk);
s = new AST.LabelStatement(loc, ident, s);
break;
}
goto case TOK.dot;
}
case TOK.dot:
case TOK.typeof_:
case TOK.vector:
case TOK.traits:
/* https://issues.dlang.org/show_bug.cgi?id=15163
* If tokens can be handled as
* old C-style declaration or D expression, prefer the latter.
*/
if (isDeclaration(&token, NeedDeclaratorId.mustIfDstyle, TOK.reserved, null))
goto Ldeclaration;
goto Lexp;
case TOK.assert_:
case TOK.this_:
case TOK.super_:
case TOK.int32Literal:
case TOK.uns32Literal:
case TOK.int64Literal:
case TOK.uns64Literal:
case TOK.int128Literal:
case TOK.uns128Literal:
case TOK.float32Literal:
case TOK.float64Literal:
case TOK.float80Literal:
case TOK.imaginary32Literal:
case TOK.imaginary64Literal:
case TOK.imaginary80Literal:
case TOK.charLiteral:
case TOK.wcharLiteral:
case TOK.dcharLiteral:
case TOK.null_:
case TOK.true_:
case TOK.false_:
case TOK.string_:
case TOK.leftParenthesis:
case TOK.cast_:
case TOK.mul:
case TOK.min:
case TOK.add:
case TOK.tilde:
case TOK.not:
case TOK.plusPlus:
case TOK.minusMinus:
case TOK.new_:
case TOK.delete_:
case TOK.delegate_:
case TOK.function_:
case TOK.typeid_:
case TOK.is_:
case TOK.leftBracket:
case TOK.file:
case TOK.fileFullPath:
case TOK.line:
case TOK.moduleString:
case TOK.functionString:
case TOK.prettyFunction:
Lexp:
{
AST.Expression exp = parseExpression();
/* https://issues.dlang.org/show_bug.cgi?id=15103
* Improve declaration / initialization syntax error message
* Error: found 'foo' when expecting ';' following statement
* becomes Error: found `(` when expecting `;` or `=`, did you mean `Foo foo = 42`?
*/
if (token.value == TOK.identifier && exp.op == EXP.identifier)
{
error(token.loc, "found `%s` when expecting `;` or `=`, did you mean `%s %s = %s`?", peek(&token).toChars(), exp.toChars(), token.toChars(), peek(peek(&token)).toChars());
nextToken();
}
else
{
/*
* https://issues.dlang.org/show_bug.cgi?id=22529
* Avoid empty declaration error in case of missing semicolon
* followed by another token and another semicolon. E.g.:
*
* foo()
* return;
*
* When the missing `;` error is emitted, token is sitting on return.
* If we simply use `check` to emit the error, the token is advanced
* to `;` and the empty statement error would follow. To avoid that,
* we check if the next token is a semicolon and simply output the error,
* otherwise we fall back on the old path (advancing the token).
*/
if (token.value != TOK.semicolon && peek(&token).value == TOK.semicolon)
error("found `%s` when expecting `;` following statement", token.toChars());
else
{
if (token.value != TOK.semicolon)
error("found `%s` when expecting `;` following statement `%s` on line %s", token.toChars(), exp.toChars(), exp.loc.toChars());
nextToken();
}
}
s = new AST.ExpStatement(loc, exp);
break;
}
case TOK.static_:
{
// Look ahead to see if it's static assert() or static if()
const tv = peekNext();
if (tv == TOK.assert_)
{
s = new AST.StaticAssertStatement(parseStaticAssert());
break;
}
if (tv == TOK.if_)
{
cond = parseStaticIfCondition();
goto Lcondition;
}
if (tv == TOK.foreach_ || tv == TOK.foreach_reverse_)
{
s = parseForeach!(AST.StaticForeachStatement)(loc, null);
if (flags & ParseStatementFlags.scope_)
s = new AST.ScopeStatement(loc, s, token.loc);
break;
}
if (tv == TOK.import_)
{
AST.Dsymbols* imports = parseImport();
s = new AST.ImportStatement(loc, imports);
if (flags & ParseStatementFlags.scope_)
s = new AST.ScopeStatement(loc, s, token.loc);
break;
}
goto Ldeclaration;
}
case TOK.final_:
if (peekNext() == TOK.switch_)
{
nextToken();
isfinal = true;
goto Lswitch;
}
goto Ldeclaration;
case TOK.wchar_:
case TOK.dchar_:
case TOK.bool_:
case TOK.char_:
case TOK.int8:
case TOK.uns8:
case TOK.int16:
case TOK.uns16:
case TOK.int32:
case TOK.uns32:
case TOK.int64:
case TOK.uns64:
case TOK.int128:
case TOK.uns128:
case TOK.float32:
case TOK.float64:
case TOK.float80:
case TOK.imaginary32:
case TOK.imaginary64:
case TOK.imaginary80:
case TOK.complex32:
case TOK.complex64:
case TOK.complex80:
case TOK.void_:
// bug 7773: int.max is always a part of expression
if (peekNext() == TOK.dot)
goto Lexp;
if (peekNext() == TOK.leftParenthesis)
goto Lexp;
goto case;
case TOK.alias_:
case TOK.const_:
case TOK.auto_:
case TOK.abstract_:
case TOK.extern_:
case TOK.align_:
case TOK.immutable_:
case TOK.shared_:
case TOK.inout_:
case TOK.deprecated_:
case TOK.nothrow_:
case TOK.pure_:
case TOK.ref_:
case TOK.gshared:
case TOK.at:
case TOK.struct_:
case TOK.union_:
case TOK.class_:
case TOK.interface_:
Ldeclaration:
{
AST.Dsymbols* a = parseDeclarations(false, null, null);
if (a.length > 1)
{
auto as = new AST.Statements();
as.reserve(a.length);
foreach (i; 0 .. a.length)
{
AST.Dsymbol d = (*a)[i];
s = new AST.ExpStatement(loc, d);
as.push(s);
}
s = new AST.CompoundDeclarationStatement(loc, as);
}
else if (a.length == 1)
{
AST.Dsymbol d = (*a)[0];
s = new AST.ExpStatement(loc, d);
}
else
s = new AST.ExpStatement(loc, cast(AST.Expression)null);
if (flags & ParseStatementFlags.scope_)
s = new AST.ScopeStatement(loc, s, token.loc);
break;
}
case TOK.enum_:
{
/* Determine if this is a manifest constant declaration,
* or a conventional enum.
*/
AST.Dsymbol d;
const tv = peekNext();
if (tv == TOK.leftCurly || tv == TOK.colon)
d = parseEnum();
else if (tv != TOK.identifier)
goto Ldeclaration;
else
{
const nextv = peekNext2();
if (nextv == TOK.leftCurly || nextv == TOK.colon || nextv == TOK.semicolon)
d = parseEnum();
else
goto Ldeclaration;
}
s = new AST.ExpStatement(loc, d);
if (flags & ParseStatementFlags.scope_)
s = new AST.ScopeStatement(loc, s, token.loc);
break;
}
case TOK.mixin_:
{
if (isDeclaration(&token, NeedDeclaratorId.mustIfDstyle, TOK.reserved, null))
goto Ldeclaration;
const tv = peekNext();
if (tv == TOK.leftParenthesis)
{
// mixin(string)
AST.Expression e = parseAssignExp();
check(TOK.semicolon, "mixin");
if (e.op == EXP.mixin_)
{
AST.MixinExp cpe = cast(AST.MixinExp)e;
s = new AST.MixinStatement(loc, cpe.exps);
}
else
{
s = new AST.ExpStatement(loc, e);
}
break;
}
else if (tv == TOK.template_)
{
// mixin template
nextToken();
AST.Dsymbol d = parseTemplateDeclaration(true);
s = new AST.ExpStatement(loc, d);
break;
}
AST.Dsymbol d = parseMixin();
s = new AST.ExpStatement(loc, d);
if (flags & ParseStatementFlags.scope_)
s = new AST.ScopeStatement(loc, s, token.loc);
break;
}
case TOK.leftCurly:
{
const lcLoc = token.loc;
const lookingForElseSave = lookingForElse;
lookingForElse = Loc.initial;
nextToken();
//if (token.value == TOK.semicolon)
// error("use `{ }` for an empty statement, not `;`");
auto statements = new AST.Statements();
while (token.value != TOK.rightCurly && token.value != TOK.endOfFile)
{
statements.push(parseStatement(ParseStatementFlags.curlyScope));
}
if (endPtr)
*endPtr = token.ptr;
endloc = token.loc;
if (pEndloc)
{
*pEndloc = token.loc;
pEndloc = null; // don't set it again
}
s = new AST.CompoundStatement(loc, statements);
if (flags & (ParseStatementFlags.scope_ | ParseStatementFlags.curlyScope))
s = new AST.ScopeStatement(loc, s, token.loc);
if (token.value != TOK.rightCurly)
{
error(token.loc, "matching `}` expected following compound statement, not `%s`",
token.toChars());
eSink.errorSupplemental(lcLoc, "unmatched `{`");
}
else
nextToken();
lookingForElse = lookingForElseSave;
break;
}
case TOK.while_:
{
nextToken();
check(TOK.leftParenthesis);
auto param = parseAssignCondition();
auto condition = parseExpression();
closeCondition("while", param, condition);
Loc endloc;
AST.Statement _body = parseStatement(ParseStatementFlags.scope_, null, &endloc);
s = new AST.WhileStatement(loc, condition, _body, endloc, param);
break;
}
case TOK.semicolon:
if (!(flags & ParseStatementFlags.semiOk))
{
error("use `{ }` for an empty statement, not `;`");
}
nextToken();
s = new AST.ExpStatement(loc, cast(AST.Expression)null);
break;
case TOK.do_:
{
AST.Statement _body;
nextToken();
const lookingForElseSave = lookingForElse;
lookingForElse = Loc.initial;
_body = parseStatement(ParseStatementFlags.scope_);
lookingForElse = lookingForElseSave;
check(TOK.while_);
check(TOK.leftParenthesis);
auto condition = parseExpression();
closeCondition("do .. while", null, condition);
if (token.value == TOK.semicolon)
nextToken();
else
error("terminating `;` required after do-while statement");
s = new AST.DoStatement(loc, _body, condition, token.loc);
break;
}
case TOK.for_:
{
AST.Statement _init;
AST.Expression condition;
AST.Expression increment;
nextToken();
check(TOK.leftParenthesis);
if (token.value == TOK.semicolon)
{
_init = null;
nextToken();
}
else
{
const lookingForElseSave = lookingForElse;
lookingForElse = Loc.initial;
_init = parseStatement(0);
lookingForElse = lookingForElseSave;
}
if (token.value == TOK.semicolon)
{
condition = null;
nextToken();
}
else
{
condition = parseExpression();
check(TOK.semicolon, "`for` condition");
}
if (token.value == TOK.rightParenthesis)
{
increment = null;
nextToken();
}
else
{
increment = parseExpression();
check(TOK.rightParenthesis);
}
Loc endloc;
AST.Statement _body = parseStatement(ParseStatementFlags.scope_, null, &endloc);
s = new AST.ForStatement(loc, _init, condition, increment, _body, endloc);
break;
}
case TOK.foreach_:
case TOK.foreach_reverse_:
{
s = parseForeach!(AST.Statement)(loc, null);
break;
}
case TOK.if_:
{
nextToken();
check(TOK.leftParenthesis);
auto param = parseAssignCondition();
auto condition = parseExpression();
closeCondition("if", param, condition);
{
const lookingForElseSave = lookingForElse;
lookingForElse = loc;
ifbody = parseStatement(ParseStatementFlags.scope_);
lookingForElse = lookingForElseSave;
}
if (token.value == TOK.else_)
{
const elseloc = token.loc;
nextToken();
elsebody = parseStatement(ParseStatementFlags.scope_);
checkDanglingElse(elseloc);
}
else
elsebody = null;
if (condition && ifbody)
s = new AST.IfStatement(loc, param, condition, ifbody, elsebody, token.loc);
else
s = null; // don't propagate parsing errors
break;
}
case TOK.else_:
error("found `else` without a corresponding `if`, `version` or `debug` statement");
goto Lerror;
case TOK.scope_:
if (peekNext() != TOK.leftParenthesis)
goto Ldeclaration; // scope used as storage class
nextToken();
check(TOK.leftParenthesis);
if (token.value != TOK.identifier)
{
error("scope identifier expected");
goto Lerror;
}
else
{
TOK t = TOK.onScopeExit;
Identifier id = token.ident;
if (id == Id.exit)
t = TOK.onScopeExit;
else if (id == Id.failure)
t = TOK.onScopeFailure;
else if (id == Id.success)
t = TOK.onScopeSuccess;
else
error("valid scope identifiers are `exit`, `failure`, or `success`, not `%s`", id.toChars());
nextToken();
check(TOK.rightParenthesis);
AST.Statement st = parseStatement(ParseStatementFlags.scope_);
s = new AST.ScopeGuardStatement(loc, t, st);
break;
}
case TOK.debug_:
nextToken();
if (token.value == TOK.assign)
{
if (auto ds = parseDebugSpecification())
{
if (ds.ident)
ds.error("declaration must be at module level");
else
ds.error("level declaration must be at module level");
}
break;
}
cond = parseDebugCondition();
goto Lcondition;
case TOK.version_:
nextToken();
if (token.value == TOK.assign)
{
if (auto vs = parseVersionSpecification())
{
if (vs.ident)
vs.error("declaration must be at module level");
else
vs.error("level declaration must be at module level");
}
break;
}
cond = parseVersionCondition();
goto Lcondition;
Lcondition:
{
const lookingForElseSave = lookingForElse;
lookingForElse = loc;
ifbody = parseStatement(0);
lookingForElse = lookingForElseSave;
}
elsebody = null;
if (token.value == TOK.else_)
{
const elseloc = token.loc;
nextToken();
elsebody = parseStatement(0);
checkDanglingElse(elseloc);
}
s = new AST.ConditionalStatement(loc, cond, ifbody, elsebody);
if (flags & ParseStatementFlags.scope_)
s = new AST.ScopeStatement(loc, s, token.loc);
break;
case TOK.pragma_:
{
Identifier ident;
AST.Expressions* args = null;
AST.Statement _body;
nextToken();
check(TOK.leftParenthesis);
if (token.value != TOK.identifier)
{
error("`pragma(identifier)` expected");
goto Lerror;
}
ident = token.ident;
nextToken();
if (token.value == TOK.comma && peekNext() != TOK.rightParenthesis)
args = parseArguments(); // pragma(identifier, args...);
else
check(TOK.rightParenthesis); // pragma(identifier);
if (token.value == TOK.semicolon)
{
nextToken();
_body = null;
}
else
_body = parseStatement(0);
s = new AST.PragmaStatement(loc, ident, args, _body);
break;
}
case TOK.switch_:
isfinal = false;
goto Lswitch;
Lswitch:
{
nextToken();
check(TOK.leftParenthesis);
AST.Expression condition = parseExpression();
closeCondition("switch", null, condition);
AST.Statement _body = parseStatement(ParseStatementFlags.scope_);
s = new AST.SwitchStatement(loc, condition, _body, isfinal);
break;
}
case TOK.case_:
{
AST.Expression exp;
AST.Expressions cases; // array of Expression's
AST.Expression last = null;
nextToken();
do
{
exp = parseAssignExp();
cases.push(exp);
if (token.value != TOK.comma)
break;
nextToken(); //comma
}
while (token.value != TOK.colon && token.value != TOK.endOfFile);
check(TOK.colon);
/* case exp: .. case last:
*/
if (token.value == TOK.slice)
{
if (cases.length > 1)
error("only one `case` allowed for start of case range");
nextToken();
check(TOK.case_);
last = parseAssignExp();
check(TOK.colon);
}
if (flags & ParseStatementFlags.curlyScope)
{
auto statements = new AST.Statements();
while (token.value != TOK.case_ && token.value != TOK.default_ && token.value != TOK.endOfFile && token.value != TOK.rightCurly)
{
auto cur = parseStatement(ParseStatementFlags.curlyScope);
statements.push(cur);
// https://issues.dlang.org/show_bug.cgi?id=21739
// Stop at the last break s.t. the following non-case statements are
// not merged into the current case. This can happen for
// case 1: ... break;
// debug { case 2: ... }
if (cur && cur.isBreakStatement())
break;
}
s = new AST.CompoundStatement(loc, statements);
}
else
{
s = parseStatement(0);
}
s = new AST.ScopeStatement(loc, s, token.loc);
if (last)
{
s = new AST.CaseRangeStatement(loc, exp, last, s);
}
else
{
// Keep cases in order by building the case statements backwards
for (size_t i = cases.length; i; i--)
{
exp = cases[i - 1];
s = new AST.CaseStatement(loc, exp, s);
}
}
break;
}
case TOK.default_:
{
nextToken();
check(TOK.colon);
if (flags & ParseStatementFlags.curlyScope)
{
auto statements = new AST.Statements();
while (token.value != TOK.case_ && token.value != TOK.default_ && token.value != TOK.endOfFile && token.value != TOK.rightCurly)
{
statements.push(parseStatement(ParseStatementFlags.curlyScope));
}
s = new AST.CompoundStatement(loc, statements);
}
else
s = parseStatement(0);
s = new AST.ScopeStatement(loc, s, token.loc);
s = new AST.DefaultStatement(loc, s);
break;
}
case TOK.return_:
{
AST.Expression exp;
nextToken();
exp = token.value == TOK.semicolon ? null : parseExpression();
check(TOK.semicolon, "`return` statement");
s = new AST.ReturnStatement(loc, exp);
break;
}
case TOK.break_:
{
Identifier ident;
nextToken();
ident = null;
if (token.value == TOK.identifier)
{
ident = token.ident;
nextToken();
}
check(TOK.semicolon, "`break` statement");
s = new AST.BreakStatement(loc, ident);
break;
}
case TOK.continue_:
{
Identifier ident;
nextToken();
ident = null;
if (token.value == TOK.identifier)
{
ident = token.ident;
nextToken();
}
check(TOK.semicolon, "`continue` statement");
s = new AST.ContinueStatement(loc, ident);
break;
}
case TOK.goto_:
{
Identifier ident;
nextToken();
if (token.value == TOK.default_)
{
nextToken();
s = new AST.GotoDefaultStatement(loc);
}
else if (token.value == TOK.case_)
{
AST.Expression exp = null;
nextToken();
if (token.value != TOK.semicolon)
exp = parseExpression();
s = new AST.GotoCaseStatement(loc, exp);
}
else
{
if (token.value != TOK.identifier)
{
error("identifier expected following `goto`");
ident = null;
}
else
{
ident = token.ident;
nextToken();
}
s = new AST.GotoStatement(loc, ident);
}
check(TOK.semicolon, "`goto` statement");
break;
}
case TOK.synchronized_:
{
AST.Expression exp;
AST.Statement _body;
Token* t = peek(&token);
if (skipAttributes(t, &t) && t.value == TOK.class_)
goto Ldeclaration;
nextToken();
if (token.value == TOK.leftParenthesis)
{
nextToken();
exp = parseExpression();
closeCondition("synchronized", null, exp);
}
else
exp = null;
_body = parseStatement(ParseStatementFlags.scope_);
s = new AST.SynchronizedStatement(loc, exp, _body);
break;
}
case TOK.with_:
{
AST.Expression exp;
AST.Statement _body;
Loc endloc = loc;
nextToken();
check(TOK.leftParenthesis);
exp = parseExpression();
closeCondition("with", null, exp);
_body = parseStatement(ParseStatementFlags.scope_, null, &endloc);
s = new AST.WithStatement(loc, exp, _body, endloc);
break;
}
case TOK.try_:
{
AST.Statement _body;
AST.Catches* catches = null;
AST.Statement finalbody = null;
nextToken();
const lookingForElseSave = lookingForElse;
lookingForElse = Loc.initial;
_body = parseStatement(ParseStatementFlags.scope_);
lookingForElse = lookingForElseSave;
while (token.value == TOK.catch_)
{
AST.Statement handler;
AST.Catch c;
AST.Type t;
Identifier id;
const catchloc = token.loc;
nextToken();
if (token.value != TOK.leftParenthesis)
{
deprecation("`catch` statement without an exception specification is deprecated");
deprecationSupplemental("use `catch(Throwable)` for old behavior");
t = null;
id = null;
}
else
{
check(TOK.leftParenthesis);
id = null;
t = parseType(&id);
check(TOK.rightParenthesis);
}
handler = parseStatement(0);
c = new AST.Catch(catchloc, t, id, handler);
if (!catches)
catches = new AST.Catches();
catches.push(c);
}
if (token.value == TOK.finally_)
{
nextToken();
finalbody = parseStatement(ParseStatementFlags.scope_);
}
s = _body;
if (!catches && !finalbody)
error("`catch` or `finally` expected following `try`");
else
{
if (catches)
s = new AST.TryCatchStatement(loc, _body, catches);
if (finalbody)
s = new AST.TryFinallyStatement(loc, s, finalbody);
}
break;
}
case TOK.throw_:
{
AST.Expression exp;
nextToken();
exp = parseExpression();
check(TOK.semicolon, "`throw` statement");
s = new AST.ThrowStatement(loc, exp);
break;
}
case TOK.asm_:
s = parseAsm();
break;
case TOK.import_:
{
/* https://issues.dlang.org/show_bug.cgi?id=16088
*
* At this point it can either be an
* https://dlang.org/spec/grammar.html#ImportExpression
* or an
* https://dlang.org/spec/grammar.html#ImportDeclaration.
* See if the next token after `import` is a `(`; if so,
* then it is an import expression.
*/
if (peekNext() == TOK.leftParenthesis)
{
AST.Expression e = parseExpression();
check(TOK.semicolon, "`import` Expression");
s = new AST.ExpStatement(loc, e);
}
else
{
AST.Dsymbols* imports = parseImport();
s = new AST.ImportStatement(loc, imports);
if (flags & ParseStatementFlags.scope_)
s = new AST.ScopeStatement(loc, s, token.loc);
}
break;
}
case TOK.template_:
{
AST.Dsymbol d = parseTemplateDeclaration();
s = new AST.ExpStatement(loc, d);
break;
}
default:
error("found `%s` instead of statement", token.toChars());
goto Lerror;
Lerror:
while (token.value != TOK.rightCurly && token.value != TOK.semicolon && token.value != TOK.endOfFile)
nextToken();
if (token.value == TOK.semicolon)
nextToken();
s = new AST.ErrorStatement;
break;
}
if (pEndloc)
*pEndloc = prevloc;
return s;
}
private AST.ExpInitializer parseExpInitializer(Loc loc)
{
auto ae = parseAssignExp();
return new AST.ExpInitializer(loc, ae);
}
private AST.Initializer parseStructInitializer(Loc loc)
{
/* Scan ahead to discern between a struct initializer and
* parameterless function literal.
*
* We'll scan the topmost curly bracket level for statement-related
* tokens, thereby ruling out a struct initializer. (A struct
* initializer which itself contains function literals may have
* statements at nested curly bracket levels.)
*
* It's important that this function literal check not be
* pendantic, otherwise a function having the slightest syntax
* error would emit confusing errors when we proceed to parse it
* as a struct initializer.
*
* The following two ambiguous cases will be treated as a struct
* initializer (best we can do without type info):
* {}
* {{statements...}} - i.e. it could be struct initializer
* with one function literal, or function literal having an
* extra level of curly brackets
* If a function literal is intended in these cases (unlikely),
* source can use a more explicit function literal syntax
* (e.g. prefix with "()" for empty parameter list).
*/
int braces = 1;
int parens = 0;
for (auto t = peek(&token); 1; t = peek(t))
{
switch (t.value)
{
case TOK.leftParenthesis:
parens++;
continue;
case TOK.rightParenthesis:
parens--;
continue;
// https://issues.dlang.org/show_bug.cgi?id=21163
// lambda params can have the `scope` storage class, e.g
// `S s = { (scope Type Id){} }`
case TOK.scope_:
if (!parens) goto case;
continue;
/* Look for a semicolon or keyword of statements which don't
* require a semicolon (typically containing BlockStatement).
* Tokens like "else", "catch", etc. are omitted where the
* leading token of the statement is sufficient.
*/
case TOK.asm_:
case TOK.class_:
case TOK.debug_:
case TOK.enum_:
case TOK.if_:
case TOK.interface_:
case TOK.pragma_:
case TOK.semicolon:
case TOK.struct_:
case TOK.switch_:
case TOK.synchronized_:
case TOK.try_:
case TOK.union_:
case TOK.version_:
case TOK.while_:
case TOK.with_:
if (braces == 1)
return parseExpInitializer(loc);
continue;
case TOK.leftCurly:
braces++;
continue;
case TOK.rightCurly:
if (--braces == 0)
break;
continue;
case TOK.endOfFile:
break;
default:
continue;
}
break;
}
auto _is = new AST.StructInitializer(loc);
bool commaExpected = false;
nextToken();
while (1)
{
switch (token.value)
{
case TOK.identifier:
{
if (commaExpected)
error("comma expected separating field initializers");
const t = peek(&token);
Identifier id;
if (t.value == TOK.colon)
{
id = token.ident;
nextToken();
nextToken(); // skip over ':'
}
auto value = parseInitializer();
_is.addInit(id, value);
commaExpected = true;
continue;
}
case TOK.comma:
if (!commaExpected)
error("expression expected, not `,`");
nextToken();
commaExpected = false;
continue;
case TOK.rightCurly: // allow trailing comma's
nextToken();
break;
case TOK.endOfFile:
error("found end of file instead of initializer");
break;
default:
if (commaExpected)
error("comma expected separating field initializers");
auto value = parseInitializer();
_is.addInit(null, value);
commaExpected = true;
continue;
}
break;
}
return _is;
}
/*****************************************
* Parse initializer for variable declaration.
*/
private AST.Initializer parseInitializer()
{
const loc = token.loc;
switch (token.value)
{
case TOK.leftCurly:
return parseStructInitializer(loc);
case TOK.leftBracket:
/* Scan ahead to see if it is an array initializer or
* an expression.
* If it ends with a ';' ',' or ']', it is an array initializer.
*/
int brackets = 1;
for (auto t = peek(&token); 1; t = peek(t))
{
switch (t.value)
{
case TOK.leftBracket:
brackets++;
continue;
case TOK.rightBracket:
if (--brackets == 0)
{
t = peek(t);
if (t.value != TOK.semicolon && t.value != TOK.comma && t.value != TOK.rightBracket && t.value != TOK.rightCurly)
return parseExpInitializer(loc);
break;
}
continue;
case TOK.endOfFile:
break;
default:
continue;
}
break;
}
auto ia = new AST.ArrayInitializer(loc);
bool commaExpected = false;
nextToken();
while (1)
{
switch (token.value)
{
default:
if (commaExpected)
{
error("comma expected separating array initializers, not `%s`", token.toChars());
nextToken();
break;
}
auto e = parseAssignExp();
if (!e)
break;
AST.Initializer value;
if (token.value == TOK.colon)
{
nextToken();
value = parseInitializer();
}
else
{
value = new AST.ExpInitializer(e.loc, e);
e = null;
}
ia.addInit(e, value);
commaExpected = true;
continue;
case TOK.leftCurly:
case TOK.leftBracket:
if (commaExpected)
error("comma expected separating array initializers, not `%s`", token.toChars());
auto value = parseInitializer();
AST.Expression e;
if (token.value == TOK.colon)
{
nextToken();
if (auto ei = value.isExpInitializer())
{
e = ei.exp;
value = parseInitializer();
}
else
error("initializer expression expected following colon, not `%s`", token.toChars());
}
ia.addInit(e, value);
commaExpected = true;
continue;
case TOK.comma:
if (!commaExpected)
error("expression expected, not `,`");
nextToken();
commaExpected = false;
continue;
case TOK.rightBracket: // allow trailing comma's
nextToken();
break;
case TOK.endOfFile:
error("found `%s` instead of array initializer", token.toChars());
break;
}
break;
}
return ia;
case TOK.void_:
const tv = peekNext();
if (tv == TOK.semicolon || tv == TOK.comma)
{
nextToken();
return new AST.VoidInitializer(loc);
}
return parseExpInitializer(loc);
default:
return parseExpInitializer(loc);
}
}
/*****************************************
* Parses default argument initializer expression that is an assign expression,
* with special handling for __FILE__, __FILE_DIR__, __LINE__, __MODULE__, __FUNCTION__, and __PRETTY_FUNCTION__.
*/
private AST.Expression parseDefaultInitExp()
{
AST.Expression e = null;
const tv = peekNext();
if (tv == TOK.comma || tv == TOK.rightParenthesis)
{
switch (token.value)
{
case TOK.file: e = new AST.FileInitExp(token.loc, EXP.file); break;
case TOK.fileFullPath: e = new AST.FileInitExp(token.loc, EXP.fileFullPath); break;
case TOK.line: e = new AST.LineInitExp(token.loc); break;
case TOK.moduleString: e = new AST.ModuleInitExp(token.loc); break;
case TOK.functionString: e = new AST.FuncInitExp(token.loc); break;
case TOK.prettyFunction: e = new AST.PrettyFuncInitExp(token.loc); break;
default: goto LExp;
}
nextToken();
return e;
}
LExp:
return parseAssignExp();
}
/********************
* Parse inline assembler block.
* Enters with token on the `asm`.
* https://dlang.org/spec/iasm.html
*
* AsmStatement:
* asm FunctionAttributes(opt) { AsmInstructionListopt }
* AsmInstructionList:
* AsmInstruction ;
* AsmInstruction ; AsmInstruction
*
* Returns:
* inline assembler block as a Statement
*/
AST.Statement parseAsm()
{
// Parse the asm block into a sequence of AsmStatements,
// each AsmStatement is one instruction.
// Separate out labels.
// Defer parsing of AsmStatements until semantic processing.
const loc = token.loc;
Loc labelloc;
nextToken();
StorageClass stc = parsePostfix(STC.undefined_, null); // optional FunctionAttributes
if (stc & (STC.const_ | STC.immutable_ | STC.shared_ | STC.wild))
error("`const`/`immutable`/`shared`/`inout` attributes are not allowed on `asm` blocks");
check(TOK.leftCurly);
Token* toklist = null;
Token** ptoklist = &toklist;
Identifier label = null;
auto statements = new AST.Statements();
size_t nestlevel = 0;
while (1)
{
switch (token.value)
{
case TOK.identifier:
if (!toklist)
{
// Look ahead to see if it is a label
if (peekNext() == TOK.colon)
{
// It's a label
label = token.ident;
labelloc = token.loc;
nextToken();
nextToken();
continue;
}
}
goto default;
case TOK.leftCurly:
++nestlevel;
goto default;
case TOK.rightCurly:
if (nestlevel > 0)
{
--nestlevel;
goto default;
}
if (toklist || label)
{
error("`asm` statements must end in `;`");
}
break;
case TOK.semicolon:
if (nestlevel != 0)
error("mismatched number of curly brackets");
if (toklist || label)
{
// Create AsmStatement from list of tokens we've saved
AST.Statement s = new AST.AsmStatement(token.loc, toklist);
toklist = null;
ptoklist = &toklist;
if (label)
{
s = new AST.LabelStatement(labelloc, label, s);
label = null;
}
statements.push(s);
}
nextToken();
continue;
case TOK.endOfFile:
/* { */
error("matching `}` expected, not end of file");
break;
case TOK.colonColon: // treat as two separate : tokens for iasmgcc
*ptoklist = allocateToken();
memcpy(*ptoklist, &token, Token.sizeof);
(*ptoklist).value = TOK.colon;
ptoklist = &(*ptoklist).next;
*ptoklist = allocateToken();
memcpy(*ptoklist, &token, Token.sizeof);
(*ptoklist).value = TOK.colon;
ptoklist = &(*ptoklist).next;
*ptoklist = null;
nextToken();
continue;
default:
*ptoklist = allocateToken();
memcpy(*ptoklist, &token, Token.sizeof);
ptoklist = &(*ptoklist).next;
*ptoklist = null;
nextToken();
continue;
}
break;
}
nextToken();
auto s = new AST.CompoundAsmStatement(loc, statements, stc);
return s;
}
/**********************************
* Issue error if the current token is not `value`,
* advance to next token.
* Params:
* loc = location for error message
* value = token value to compare with
*/
void check(Loc loc, TOK value)
{
if (token.value != value)
error(loc, "found `%s` when expecting `%s`", token.toChars(), Token.toChars(value));
nextToken();
}
/**********************************
* Issue error if the current token is not `value`,
* advance to next token.
* Params:
* value = token value to compare with
*/
void check(TOK value)
{
check(token.loc, value);
}
/**********************************
* Issue error if the current token is not `value`,
* advance to next token.
* Params:
* value = token value to compare with
* string = for error message
*/
void check(TOK value, const(char)* string)
{
if (token.value != value)
error(token.loc, "found `%s` when expecting `%s` following %s", token.toChars(), Token.toChars(value), string);
nextToken();
}
private void checkParens(TOK value, AST.Expression e)
{
if (precedence[e.op] == PREC.rel)
error(e.loc, "`%s` must be surrounded by parentheses when next to operator `%s`", e.toChars(), Token.toChars(value));
}
///
enum NeedDeclaratorId
{
no, // Declarator part must have no identifier
opt, // Declarator part identifier is optional
must, // Declarator part must have identifier
mustIfDstyle, // Declarator part must have identifier, but don't recognize old C-style syntax
}
/************************************
* Determine if the scanner is sitting on the start of a declaration.
* Params:
* t = current token of the scanner
* needId = flag with additional requirements for a declaration
* endtok = ending token
* pt = will be set ending token (if not null)
* Output:
* true if the token `t` is a declaration, false otherwise
*/
private bool isDeclaration(Token* t, NeedDeclaratorId needId, TOK endtok, Token** pt)
{
//printf("isDeclaration(needId = %d)\n", needId);
int haveId = 0;
int haveTpl = 0;
while (1)
{
if ((t.value == TOK.const_ || t.value == TOK.immutable_ || t.value == TOK.inout_ || t.value == TOK.shared_) && peek(t).value != TOK.leftParenthesis)
{
/* const type
* immutable type
* shared type
* wild type
*/
t = peek(t);
continue;
}
break;
}
if (!isBasicType(&t))
{
goto Lisnot;
}
if (!isDeclarator(&t, &haveId, &haveTpl, endtok, needId != NeedDeclaratorId.mustIfDstyle))
goto Lisnot;
if ((needId == NeedDeclaratorId.no && !haveId) ||
(needId == NeedDeclaratorId.opt) ||
(needId == NeedDeclaratorId.must && haveId) ||
(needId == NeedDeclaratorId.mustIfDstyle && haveId))
{
if (pt)
*pt = t;
goto Lis;
}
goto Lisnot;
Lis:
//printf("\tis declaration, t = %s\n", t.toChars());
return true;
Lisnot:
//printf("\tis not declaration\n");
return false;
}
private bool isBasicType(Token** pt)
{
// This code parallels parseBasicType()
Token* t = *pt;
switch (t.value)
{
case TOK.wchar_:
case TOK.dchar_:
case TOK.bool_:
case TOK.char_:
case TOK.int8:
case TOK.uns8:
case TOK.int16:
case TOK.uns16:
case TOK.int32:
case TOK.uns32:
case TOK.int64:
case TOK.uns64:
case TOK.int128:
case TOK.uns128:
case TOK.float32:
case TOK.float64:
case TOK.float80:
case TOK.imaginary32:
case TOK.imaginary64:
case TOK.imaginary80:
case TOK.complex32:
case TOK.complex64:
case TOK.complex80:
case TOK.void_:
t = peek(t);
break;
case TOK.identifier:
L5:
t = peek(t);
if (t.value == TOK.not)
{
goto L4;
}
goto L3;
while (1)
{
L2:
t = peek(t);
L3:
if (t.value == TOK.dot)
{
Ldot:
t = peek(t);
if (t.value != TOK.identifier)
goto Lfalse;
t = peek(t);
if (t.value != TOK.not)
goto L3;
L4:
/* Seen a !
* Look for:
* !( args ), !identifier, etc.
*/
t = peek(t);
switch (t.value)
{
case TOK.identifier:
goto L5;
case TOK.leftParenthesis:
if (!skipParens(t, &t))
goto Lfalse;
goto L3;
case TOK.wchar_:
case TOK.dchar_:
case TOK.bool_:
case TOK.char_:
case TOK.int8:
case TOK.uns8:
case TOK.int16:
case TOK.uns16:
case TOK.int32:
case TOK.uns32:
case TOK.int64:
case TOK.uns64:
case TOK.int128:
case TOK.uns128:
case TOK.float32:
case TOK.float64:
case TOK.float80:
case TOK.imaginary32:
case TOK.imaginary64:
case TOK.imaginary80:
case TOK.complex32:
case TOK.complex64:
case TOK.complex80:
case TOK.void_:
case TOK.int32Literal:
case TOK.uns32Literal:
case TOK.int64Literal:
case TOK.uns64Literal:
case TOK.int128Literal:
case TOK.uns128Literal:
case TOK.float32Literal:
case TOK.float64Literal:
case TOK.float80Literal:
case TOK.imaginary32Literal:
case TOK.imaginary64Literal:
case TOK.imaginary80Literal:
case TOK.null_:
case TOK.true_:
case TOK.false_:
case TOK.charLiteral:
case TOK.wcharLiteral:
case TOK.dcharLiteral:
case TOK.string_:
case TOK.file:
case TOK.fileFullPath:
case TOK.line:
case TOK.moduleString:
case TOK.functionString:
case TOK.prettyFunction:
goto L2;
default:
goto Lfalse;
}
}
break;
}
break;
case TOK.dot:
goto Ldot;
case TOK.typeof_:
case TOK.vector:
case TOK.mixin_:
/* typeof(exp).identifier...
*/
t = peek(t);
if (!skipParens(t, &t))
goto Lfalse;
goto L3;
case TOK.traits:
// __traits(getMember
t = peek(t);
if (t.value != TOK.leftParenthesis)
goto Lfalse;
auto lp = t;
t = peek(t);
if (t.value != TOK.identifier || t.ident != Id.getMember)
goto Lfalse;
if (!skipParens(lp, &lp))
goto Lfalse;
// we are in a lookup for decl VS statement
// so we expect a declarator following __trait if it's a type.
// other usages wont be ambiguous (alias, template instance, type qual, etc.)
if (lp.value != TOK.identifier)
goto Lfalse;
break;
case TOK.const_:
case TOK.immutable_:
case TOK.shared_:
case TOK.inout_:
// const(type) or immutable(type) or shared(type) or wild(type)
t = peek(t);
if (t.value != TOK.leftParenthesis)
goto Lfalse;
t = peek(t);
if (!isDeclaration(t, NeedDeclaratorId.no, TOK.rightParenthesis, &t))
{
goto Lfalse;
}
t = peek(t);
break;
default:
goto Lfalse;
}
*pt = t;
//printf("is\n");
return true;
Lfalse:
//printf("is not\n");
return false;
}
private bool isDeclarator(Token** pt, int* haveId, int* haveTpl, TOK endtok, bool allowAltSyntax = true)
{
// This code parallels parseDeclarator()
Token* t = *pt;
bool parens;
//printf("Parser::isDeclarator() %s\n", t.toChars());
if (t.value == TOK.assign)
return false;
while (1)
{
parens = false;
switch (t.value)
{
case TOK.mul:
//case TOK.and:
t = peek(t);
continue;
case TOK.leftBracket:
t = peek(t);
if (t.value == TOK.rightBracket)
{
t = peek(t);
}
else if (isDeclaration(t, NeedDeclaratorId.no, TOK.rightBracket, &t))
{
// It's an associative array declaration
t = peek(t);
// ...[type].ident
if (t.value == TOK.dot && peek(t).value == TOK.identifier)
{
t = peek(t);
t = peek(t);
}
}
else
{
// [ expression ]
// [ expression .. expression ]
if (!isExpression(&t))
return false;
if (t.value == TOK.slice)
{
t = peek(t);
if (!isExpression(&t))
return false;
if (t.value != TOK.rightBracket)
return false;
t = peek(t);
}
else
{
if (t.value != TOK.rightBracket)
return false;
t = peek(t);
// ...[index].ident
if (t.value == TOK.dot && peek(t).value == TOK.identifier)
{
t = peek(t);
t = peek(t);
}
}
}
continue;
case TOK.identifier:
if (*haveId)
return false;
*haveId = true;
t = peek(t);
break;
case TOK.leftParenthesis:
if (!allowAltSyntax)
return false; // Do not recognize C-style declarations.
t = peek(t);
if (t.value == TOK.rightParenthesis)
return false; // () is not a declarator
/* Regard ( identifier ) as not a declarator
* BUG: what about ( *identifier ) in
* f(*p)(x);
* where f is a class instance with overloaded () ?
* Should we just disallow C-style function pointer declarations?
*/
if (t.value == TOK.identifier)
{
Token* t2 = peek(t);
if (t2.value == TOK.rightParenthesis)
return false;
}
if (!isDeclarator(&t, haveId, null, TOK.rightParenthesis))
return false;
t = peek(t);
parens = true;
break;
case TOK.delegate_:
case TOK.function_:
t = peek(t);
if (!isParameters(&t))
return false;
skipAttributes(t, &t);
continue;
default:
break;
}
break;
}
while (1)
{
switch (t.value)
{
static if (CARRAYDECL)
{
case TOK.leftBracket:
parens = false;
t = peek(t);
if (t.value == TOK.rightBracket)
{
t = peek(t);
}
else if (isDeclaration(t, NeedDeclaratorId.no, TOK.rightBracket, &t))
{
// It's an associative array declaration
t = peek(t);
}
else
{
// [ expression ]
if (!isExpression(&t))
return false;
if (t.value != TOK.rightBracket)
return false;
t = peek(t);
}
continue;
}
case TOK.leftParenthesis:
parens = false;
if (Token* tk = peekPastParen(t))
{
if (tk.value == TOK.leftParenthesis)
{
if (!haveTpl)
return false;
*haveTpl = 1;
t = tk;
}
else if (tk.value == TOK.assign)
{
if (!haveTpl)
return false;
*haveTpl = 1;
*pt = tk;
return true;
}
}
if (!isParameters(&t))
return false;
while (1)
{
switch (t.value)
{
case TOK.const_:
case TOK.immutable_:
case TOK.shared_:
case TOK.inout_:
case TOK.pure_:
case TOK.nothrow_:
case TOK.return_:
case TOK.scope_:
t = peek(t);
continue;
case TOK.at:
t = peek(t); // skip '@'
t = peek(t); // skip identifier
continue;
default:
break;
}
break;
}
continue;
// Valid tokens that follow a declaration
case TOK.rightParenthesis:
case TOK.rightBracket:
case TOK.assign:
case TOK.comma:
case TOK.dotDotDot:
case TOK.semicolon:
case TOK.leftCurly:
case TOK.in_:
case TOK.out_:
case TOK.do_:
// The !parens is to disallow unnecessary parentheses
if (!parens && (endtok == TOK.reserved || endtok == t.value))
{
*pt = t;
return true;
}
return false;
case TOK.identifier:
if (t.ident == Id._body)
{
usageOfBodyKeyword();
goto case TOK.do_;
}
goto default;
case TOK.if_:
return haveTpl ? true : false;
// Used for mixin type parsing
case TOK.endOfFile:
if (endtok == TOK.endOfFile)
goto case TOK.do_;
return false;
default:
return false;
}
}
assert(0);
}
private bool isParameters(Token** pt)
{
// This code parallels parseParameterList()
Token* t = *pt;
//printf("isParameters()\n");
if (t.value != TOK.leftParenthesis)
return false;
t = peek(t);
for (; 1; t = peek(t))
{
L1:
switch (t.value)
{
case TOK.rightParenthesis:
break;
case TOK.at:
Token* pastAttr;
if (skipAttributes(t, &pastAttr))
{
t = pastAttr;
goto default;
}
break;
case TOK.dotDotDot:
t = peek(t);
break;
case TOK.in_:
case TOK.out_:
case TOK.ref_:
case TOK.lazy_:
case TOK.scope_:
case TOK.final_:
case TOK.auto_:
case TOK.return_:
continue;
case TOK.const_:
case TOK.immutable_:
case TOK.shared_:
case TOK.inout_:
t = peek(t);
if (t.value == TOK.leftParenthesis)
{
t = peek(t);
if (!isDeclaration(t, NeedDeclaratorId.no, TOK.rightParenthesis, &t))
return false;
t = peek(t); // skip past closing ')'
goto L2;
}
goto L1;
default:
{
if (!isBasicType(&t))
return false;
L2:
int tmp = false;
if (t.value != TOK.dotDotDot && !isDeclarator(&t, &tmp, null, TOK.reserved))
return false;
if (t.value == TOK.assign)
{
t = peek(t);
if (!isExpression(&t))
return false;
}
if (t.value == TOK.dotDotDot)
{
t = peek(t);
break;
}
}
if (t.value == TOK.comma)
{
continue;
}
break;
}
break;
}
if (t.value != TOK.rightParenthesis)
return false;
t = peek(t);
*pt = t;
return true;
}
private bool isExpression(Token** pt)
{
// This is supposed to determine if something is an expression.
// What it actually does is scan until a closing right bracket
// is found.
Token* t = *pt;
int brnest = 0;
int panest = 0;
int curlynest = 0;
for (;; t = peek(t))
{
switch (t.value)
{
case TOK.leftBracket:
brnest++;
continue;
case TOK.rightBracket:
if (--brnest >= 0)
continue;
break;
case TOK.leftParenthesis:
panest++;
continue;
case TOK.comma:
if (brnest || panest)
continue;
break;
case TOK.rightParenthesis:
if (--panest >= 0)
continue;
break;
case TOK.leftCurly:
curlynest++;
continue;
case TOK.rightCurly:
if (--curlynest >= 0)
continue;
return false;
case TOK.slice:
if (brnest)
continue;
break;
case TOK.semicolon:
if (curlynest)
continue;
return false;
case TOK.endOfFile:
return false;
default:
continue;
}
break;
}
*pt = t;
return true;
}
/*******************************************
* Skip parentheses.
* Params:
* t = on opening $(LPAREN)
* pt = *pt is set to token past '$(RPAREN)' on true
* Returns:
* true successful
* false some parsing error
*/
bool skipParens(Token* t, Token** pt)
{
if (t.value != TOK.leftParenthesis)
return false;
int parens = 0;
while (1)
{
switch (t.value)
{
case TOK.leftParenthesis:
parens++;
break;
case TOK.rightParenthesis:
parens--;
if (parens < 0)
goto Lfalse;
if (parens == 0)
goto Ldone;
break;
case TOK.endOfFile:
goto Lfalse;
default:
break;
}
t = peek(t);
}
Ldone:
if (pt)
*pt = peek(t); // skip found rparen
return true;
Lfalse:
return false;
}
private bool skipParensIf(Token* t, Token** pt)
{
if (t.value != TOK.leftParenthesis)
{
if (pt)
*pt = t;
return true;
}
return skipParens(t, pt);
}
//returns true if the next value (after optional matching parens) is expected
private bool hasOptionalParensThen(Token* t, TOK expected)
{
Token* tk;
if (!skipParensIf(t, &tk))
return false;
return tk.value == expected;
}
/*******************************************
* Skip attributes.
* Input:
* t is on a candidate attribute
* Output:
* *pt is set to first non-attribute token on success
* Returns:
* true successful
* false some parsing error
*/
private bool skipAttributes(Token* t, Token** pt)
{
while (1)
{
switch (t.value)
{
case TOK.const_:
case TOK.immutable_:
case TOK.shared_:
case TOK.inout_:
case TOK.final_:
case TOK.auto_:
case TOK.scope_:
case TOK.override_:
case TOK.abstract_:
case TOK.synchronized_:
break;
case TOK.deprecated_:
if (peek(t).value == TOK.leftParenthesis)
{
t = peek(t);
if (!skipParens(t, &t))
goto Lerror;
// t is on the next of closing parenthesis
continue;
}
break;
case TOK.nothrow_:
case TOK.pure_:
case TOK.ref_:
case TOK.gshared:
case TOK.return_:
break;
case TOK.at:
t = peek(t);
if (t.value == TOK.identifier)
{
/* @identifier
* @identifier!arg
* @identifier!(arglist)
* any of the above followed by (arglist)
* @predefined_attribute
*/
if (isBuiltinAtAttribute(t.ident))
break;
t = peek(t);
if (t.value == TOK.not)
{
t = peek(t);
if (t.value == TOK.leftParenthesis)
{
// @identifier!(arglist)
if (!skipParens(t, &t))
goto Lerror;
// t is on the next of closing parenthesis
}
else
{
// @identifier!arg
// Do low rent skipTemplateArgument
if (t.value == TOK.vector)
{
// identifier!__vector(type)
t = peek(t);
if (!skipParens(t, &t))
goto Lerror;
}
else
t = peek(t);
}
}
if (t.value == TOK.leftParenthesis)
{
if (!skipParens(t, &t))
goto Lerror;
// t is on the next of closing parenthesis
continue;
}
continue;
}
if (t.value == TOK.leftParenthesis)
{
// @( ArgumentList )
if (!skipParens(t, &t))
goto Lerror;
// t is on the next of closing parenthesis
continue;
}
goto Lerror;
default:
goto Ldone;
}
t = peek(t);
}
Ldone:
if (pt)
*pt = t;
return true;
Lerror:
return false;
}
AST.Expression parseExpression()
{
auto loc = token.loc;
//printf("Parser::parseExpression() loc = %d\n", loc.linnum);
auto e = parseAssignExp();
while (token.value == TOK.comma)
{
nextToken();
auto e2 = parseAssignExp();
e = new AST.CommaExp(loc, e, e2, false);
loc = token.loc;
}
return e;
}
/********************************* Expression Parser ***************************/
AST.Expression parsePrimaryExp()
{
AST.Expression e;
AST.Type t;
Identifier id;
const loc = token.loc;
//printf("parsePrimaryExp(): loc = %d\n", loc.linnum);
switch (token.value)
{
case TOK.identifier:
{
if (peekNext() == TOK.arrow)
{
// skip `identifier ->`
nextToken();
nextToken();
error("use `.` for member lookup, not `->`");
goto Lerr;
}
if (peekNext() == TOK.goesTo)
goto case_delegate;
id = token.ident;
nextToken();
TOK save;
if (token.value == TOK.not && (save = peekNext()) != TOK.is_ && save != TOK.in_)
{
// identifier!(template-argument-list)
auto tempinst = new AST.TemplateInstance(loc, id, parseTemplateArguments());
e = new AST.ScopeExp(loc, tempinst);
}
else
e = new AST.IdentifierExp(loc, id);
break;
}
case TOK.dollar:
if (!inBrackets)
error("`$` is valid only inside [] of index or slice");
e = new AST.DollarExp(loc);
nextToken();
break;
case TOK.dot:
// Signal global scope '.' operator with "" identifier
e = new AST.IdentifierExp(loc, Id.empty);
break;
case TOK.this_:
e = new AST.ThisExp(loc);
nextToken();
break;
case TOK.super_:
e = new AST.SuperExp(loc);
nextToken();
break;
case TOK.int32Literal:
e = new AST.IntegerExp(loc, token.intvalue, AST.Type.tint32);
nextToken();
break;
case TOK.uns32Literal:
e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tuns32);
nextToken();
break;
case TOK.int64Literal:
e = new AST.IntegerExp(loc, token.intvalue, AST.Type.tint64);
nextToken();
break;
case TOK.uns64Literal:
e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tuns64);
nextToken();
break;
case TOK.float32Literal:
e = new AST.RealExp(loc, token.floatvalue, AST.Type.tfloat32);
nextToken();
break;
case TOK.float64Literal:
e = new AST.RealExp(loc, token.floatvalue, AST.Type.tfloat64);
nextToken();
break;
case TOK.float80Literal:
e = new AST.RealExp(loc, token.floatvalue, AST.Type.tfloat80);
nextToken();
break;
case TOK.imaginary32Literal:
e = new AST.RealExp(loc, token.floatvalue, AST.Type.timaginary32);
nextToken();
break;
case TOK.imaginary64Literal:
e = new AST.RealExp(loc, token.floatvalue, AST.Type.timaginary64);
nextToken();
break;
case TOK.imaginary80Literal:
e = new AST.RealExp(loc, token.floatvalue, AST.Type.timaginary80);
nextToken();
break;
case TOK.null_:
e = new AST.NullExp(loc);
nextToken();
break;
case TOK.file:
{
const(char)* s = loc.filename ? loc.filename : mod.ident.toChars();
e = new AST.StringExp(loc, s.toDString());
nextToken();
break;
}
case TOK.fileFullPath:
{
assert(loc.isValid(), "__FILE_FULL_PATH__ does not work with an invalid location");
const s = FileName.toAbsolute(loc.filename);
e = new AST.StringExp(loc, s.toDString());
nextToken();
break;
}
case TOK.line:
e = new AST.IntegerExp(loc, loc.linnum, AST.Type.tint32);
nextToken();
break;
case TOK.moduleString:
{
const(char)* s = md ? md.toChars() : mod.toChars();
e = new AST.StringExp(loc, s.toDString());
nextToken();
break;
}
case TOK.functionString:
e = new AST.FuncInitExp(loc);
nextToken();
break;
case TOK.prettyFunction:
e = new AST.PrettyFuncInitExp(loc);
nextToken();
break;
case TOK.true_:
e = new AST.IntegerExp(loc, 1, AST.Type.tbool);
nextToken();
break;
case TOK.false_:
e = new AST.IntegerExp(loc, 0, AST.Type.tbool);
nextToken();
break;
case TOK.charLiteral:
e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tchar);
nextToken();
break;
case TOK.wcharLiteral:
e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.twchar);
nextToken();
break;
case TOK.dcharLiteral:
e = new AST.IntegerExp(loc, token.unsvalue, AST.Type.tdchar);
nextToken();
break;
case TOK.string_:
{
// cat adjacent strings
auto s = token.ustring;
auto len = token.len;
auto postfix = token.postfix;
while (1)
{
const prev = token;
nextToken();
if (token.value == TOK.string_)
{
if (token.postfix)
{
if (token.postfix != postfix)
error(token.loc, "mismatched string literal postfixes `'%c'` and `'%c'`", postfix, token.postfix);
postfix = token.postfix;
}
error("implicit string concatenation is error-prone and disallowed in D");
eSink.errorSupplemental(token.loc, "Use the explicit syntax instead " ~
"(concatenating literals is `@nogc`): %s ~ %s",
prev.toChars(), token.toChars());
const len1 = len;
const len2 = token.len;
len = len1 + len2;
auto s2 = cast(char*)mem.xmalloc_noscan(len * char.sizeof);
memcpy(s2, s, len1 * char.sizeof);
memcpy(s2 + len1, token.ustring, len2 * char.sizeof);
s = s2;
}
else
break;
}
e = new AST.StringExp(loc, s[0 .. len], len, 1, postfix);
break;
}
case TOK.void_:
t = AST.Type.tvoid;
goto LabelX;
case TOK.int8:
t = AST.Type.tint8;
goto LabelX;
case TOK.uns8:
t = AST.Type.tuns8;
goto LabelX;
case TOK.int16:
t = AST.Type.tint16;
goto LabelX;
case TOK.uns16:
t = AST.Type.tuns16;
goto LabelX;
case TOK.int32:
t = AST.Type.tint32;
goto LabelX;
case TOK.uns32:
t = AST.Type.tuns32;
goto LabelX;
case TOK.int64:
t = AST.Type.tint64;
goto LabelX;
case TOK.uns64:
t = AST.Type.tuns64;
goto LabelX;
case TOK.int128:
t = AST.Type.tint128;
goto LabelX;
case TOK.uns128:
t = AST.Type.tuns128;
goto LabelX;
case TOK.float32:
t = AST.Type.tfloat32;
goto LabelX;
case TOK.float64:
t = AST.Type.tfloat64;
goto LabelX;
case TOK.float80:
t = AST.Type.tfloat80;
goto LabelX;
case TOK.imaginary32:
t = AST.Type.timaginary32;
goto LabelX;
case TOK.imaginary64:
t = AST.Type.timaginary64;
goto LabelX;
case TOK.imaginary80:
t = AST.Type.timaginary80;
goto LabelX;
case TOK.complex32:
t = AST.Type.tcomplex32;
goto LabelX;
case TOK.complex64:
t = AST.Type.tcomplex64;
goto LabelX;
case TOK.complex80:
t = AST.Type.tcomplex80;
goto LabelX;
case TOK.bool_:
t = AST.Type.tbool;
goto LabelX;
case TOK.char_:
t = AST.Type.tchar;
goto LabelX;
case TOK.wchar_:
t = AST.Type.twchar;
goto LabelX;
case TOK.dchar_:
t = AST.Type.tdchar;
goto LabelX;
LabelX:
const next = peekNext();
if (next != TOK.leftParenthesis && next != TOK.dot)
{
// defer error for better diagnostics
e = new AST.TypeExp(loc, parseType);
break;
}
nextToken();
if (token.value == TOK.leftParenthesis)
{
e = new AST.TypeExp(loc, t);
e = new AST.CallExp(loc, e, parseArguments());
break;
}
check(TOK.dot);
if (token.value != TOK.identifier)
{
error(token.loc, "found `%s` when expecting identifier following `%s`.", token.toChars(), t.toChars());
goto Lerr;
}
e = new AST.DotIdExp(loc, new AST.TypeExp(loc, t), token.ident);
nextToken();
break;
case TOK.typeof_:
{
t = parseTypeof();
e = new AST.TypeExp(loc, t);
break;
}
case TOK.vector:
{
t = parseVector();
e = new AST.TypeExp(loc, t);
break;
}
case TOK.typeid_:
{
nextToken();
check(TOK.leftParenthesis, "`typeid`");
RootObject o = parseTypeOrAssignExp();
check(TOK.rightParenthesis);
e = new AST.TypeidExp(loc, o);
break;
}
case TOK.traits:
{
/* __traits(identifier, args...)
*/
Identifier ident;
AST.Objects* args = null;
nextToken();
check(TOK.leftParenthesis);
if (token.value != TOK.identifier)
{
error("`__traits(identifier, args...)` expected");
goto Lerr;
}
ident = token.ident;
nextToken();
if (token.value == TOK.comma)
args = parseTemplateArgumentList(); // __traits(identifier, args...)
else
check(TOK.rightParenthesis); // __traits(identifier)
e = new AST.TraitsExp(loc, ident, args);
break;
}
case TOK.is_:
{
AST.Type targ;
Identifier ident = null;
AST.Type tspec = null;
TOK tok = TOK.reserved;
TOK tok2 = TOK.reserved;
AST.TemplateParameters* tpl = null;
nextToken();
if (token.value == TOK.leftParenthesis)
{
nextToken();
if (token.value == TOK.identifier && peekNext() == TOK.leftParenthesis)
{
error(loc, "unexpected `(` after `%s`, inside `is` expression. Try enclosing the contents of `is` with a `typeof` expression", token.toChars());
nextToken();
Token* tempTok = peekPastParen(&token);
memcpy(&token, tempTok, Token.sizeof);
goto Lerr;
}
targ = parseType(&ident);
if (token.value == TOK.colon || token.value == TOK.equal)
{
tok = token.value;
nextToken();
if (tok == TOK.equal && (token.value == TOK.struct_ || token.value == TOK.union_
|| token.value == TOK.class_ || token.value == TOK.super_ || token.value == TOK.enum_
|| token.value == TOK.interface_ || token.value == TOK.package_ || token.value == TOK.module_
|| token.value == TOK.argumentTypes || token.value == TOK.parameters
|| token.value == TOK.const_ && peekNext() == TOK.rightParenthesis
|| token.value == TOK.immutable_ && peekNext() == TOK.rightParenthesis
|| token.value == TOK.shared_ && peekNext() == TOK.rightParenthesis
|| token.value == TOK.inout_ && peekNext() == TOK.rightParenthesis || token.value == TOK.function_
|| token.value == TOK.delegate_ || token.value == TOK.return_
|| (token.value == TOK.vector && peekNext() == TOK.rightParenthesis)))
{
tok2 = token.value;
nextToken();
}
else
{
tspec = parseType();
}
}
if (tspec)
{
if (token.value == TOK.comma)
tpl = parseTemplateParameterList(1);
else
{
tpl = new AST.TemplateParameters();
check(TOK.rightParenthesis);
}
}
else
check(TOK.rightParenthesis);
}
else
{
error("`type identifier : specialization` expected following `is`");
goto Lerr;
}
e = new AST.IsExp(loc, targ, ident, tok, tspec, tok2, tpl);
break;
}
case TOK.assert_:
{
// https://dlang.org/spec/expression.html#assert_expressions
AST.Expression msg = null;
nextToken();
check(TOK.leftParenthesis, "`assert`");
e = parseAssignExp();
if (token.value == TOK.comma)
{
nextToken();
if (token.value != TOK.rightParenthesis)
{
msg = parseAssignExp();
if (token.value == TOK.comma)
nextToken();
}
}
check(TOK.rightParenthesis);
e = new AST.AssertExp(loc, e, msg);
break;
}
case TOK.mixin_:
{
// https://dlang.org/spec/expression.html#mixin_expressions
nextToken();
if (token.value != TOK.leftParenthesis)
error(token.loc, "found `%s` when expecting `%s` following `mixin`", token.toChars(), Token.toChars(TOK.leftParenthesis));
auto exps = parseArguments();
e = new AST.MixinExp(loc, exps);
break;
}
case TOK.import_:
{
nextToken();
check(TOK.leftParenthesis, "`import`");
e = parseAssignExp();
check(TOK.rightParenthesis);
e = new AST.ImportExp(loc, e);
break;
}
case TOK.new_:
e = parseNewExp(null);
break;
case TOK.auto_:
{
if (peekNext() == TOK.ref_ && peekNext2() == TOK.leftParenthesis)
{
Token* tk = peekPastParen(peek(peek(&token)));
if (skipAttributes(tk, &tk) && (tk.value == TOK.goesTo || tk.value == TOK.leftCurly))
{
// auto ref (arguments) => expression
// auto ref (arguments) { statements... }
goto case_delegate;
}
}
nextToken();
error("found `%s` when expecting `ref` and function literal following `auto`", token.toChars());
goto Lerr;
}
case TOK.ref_:
{
if (peekNext() == TOK.leftParenthesis)
{
Token* tk = peekPastParen(peek(&token));
if (skipAttributes(tk, &tk) && (tk.value == TOK.goesTo || tk.value == TOK.leftCurly))
{
// ref (arguments) => expression
// ref (arguments) { statements... }
goto case_delegate;
}
}
nextToken();
error("found `%s` when expecting function literal following `ref`", token.toChars());
goto Lerr;
}
case TOK.leftParenthesis:
{
Token* tk = peekPastParen(&token);
if (skipAttributes(tk, &tk) && (tk.value == TOK.goesTo || tk.value == TOK.leftCurly))
{
// (arguments) => expression
// (arguments) { statements... }
goto case_delegate;
}
// ( expression )
nextToken();
e = parseExpression();
check(loc, TOK.rightParenthesis);
break;
}
case TOK.leftBracket:
{
/* Parse array literals and associative array literals:
* [ value, value, value ... ]
* [ key:value, key:value, key:value ... ]
*/
auto values = new AST.Expressions();
AST.Expressions* keys = null;
nextToken();
while (token.value != TOK.rightBracket && token.value != TOK.endOfFile)
{
e = parseAssignExp();
if (token.value == TOK.colon && (keys || values.length == 0))
{
nextToken();
if (!keys)
keys = new AST.Expressions();
keys.push(e);
e = parseAssignExp();
}
else if (keys)
{
error("`key:value` expected for associative array literal");
keys = null;
}
values.push(e);
if (token.value == TOK.rightBracket)
break;
check(TOK.comma);
}
check(loc, TOK.rightBracket);
if (keys)
e = new AST.AssocArrayLiteralExp(loc, keys, values);
else
e = new AST.ArrayLiteralExp(loc, null, values);
break;
}
case TOK.leftCurly:
case TOK.function_:
case TOK.delegate_:
case_delegate:
{
AST.Dsymbol s = parseFunctionLiteral();
e = new AST.FuncExp(loc, s);
break;
}
default:
error("expression expected, not `%s`", token.toChars());
Lerr:
// Anything for e, as long as it's not NULL
e = new AST.IntegerExp(loc, 0, AST.Type.tint32);
nextToken();
break;
}
return e;
}
private AST.Expression parseUnaryExp()
{
AST.Expression e;
const loc = token.loc;
switch (token.value)
{
case TOK.and:
nextToken();
e = parseUnaryExp();
e = new AST.AddrExp(loc, e);
break;
case TOK.plusPlus:
nextToken();
e = parseUnaryExp();
//e = new AddAssignExp(loc, e, new IntegerExp(loc, 1, Type::tint32));
e = new AST.PreExp(EXP.prePlusPlus, loc, e);
break;
case TOK.minusMinus:
nextToken();
e = parseUnaryExp();
//e = new MinAssignExp(loc, e, new IntegerExp(loc, 1, Type::tint32));
e = new AST.PreExp(EXP.preMinusMinus, loc, e);
break;
case TOK.mul:
nextToken();
e = parseUnaryExp();
e = new AST.PtrExp(loc, e);
break;
case TOK.min:
nextToken();
e = parseUnaryExp();
e = new AST.NegExp(loc, e);
break;
case TOK.add:
nextToken();
e = parseUnaryExp();
e = new AST.UAddExp(loc, e);
break;
case TOK.not:
nextToken();
e = parseUnaryExp();
e = new AST.NotExp(loc, e);
break;
case TOK.tilde:
nextToken();
e = parseUnaryExp();
e = new AST.ComExp(loc, e);
break;
case TOK.delete_:
// @@@DEPRECATED_2.109@@@
// Use of `delete` keyword has been an error since 2.099.
// Remove from the parser after 2.109.
nextToken();
e = parseUnaryExp();
e = new AST.DeleteExp(loc, e, false);
break;
case TOK.cast_: // cast(type) expression
{
nextToken();
check(TOK.leftParenthesis);
/* Look for cast(), cast(const), cast(immutable),
* cast(shared), cast(shared const), cast(wild), cast(shared wild)
*/
ubyte m = 0;
while (1)
{
switch (token.value)
{
case TOK.const_:
if (peekNext() == TOK.leftParenthesis)
break; // const as type constructor
m |= MODFlags.const_; // const as storage class
nextToken();
continue;
case TOK.immutable_:
if (peekNext() == TOK.leftParenthesis)
break;
m |= MODFlags.immutable_;
nextToken();
continue;
case TOK.shared_:
if (peekNext() == TOK.leftParenthesis)
break;
m |= MODFlags.shared_;
nextToken();
continue;
case TOK.inout_:
if (peekNext() == TOK.leftParenthesis)
break;
m |= MODFlags.wild;
nextToken();
continue;
default:
break;
}
break;
}
if (token.value == TOK.rightParenthesis)
{
nextToken();
e = parseUnaryExp();
e = new AST.CastExp(loc, e, m);
}
else
{
AST.Type t = parseType(); // cast( type )
t = t.addMod(m); // cast( const type )
check(TOK.rightParenthesis);
e = parseUnaryExp();
e = new AST.CastExp(loc, e, t);
}
break;
}
case TOK.inout_:
case TOK.shared_:
case TOK.const_:
case TOK.immutable_: // immutable(type)(arguments) / immutable(type).init
{
StorageClass stc = parseTypeCtor();
AST.Type t = parseBasicType();
t = t.addSTC(stc);
if (stc == 0 && token.value == TOK.dot)
{
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `(type)`.");
return AST.ErrorExp.get();
}
e = new AST.DotIdExp(loc, new AST.TypeExp(loc, t), token.ident);
nextToken();
e = parsePostExp(e);
}
else
{
e = new AST.TypeExp(loc, t);
if (token.value != TOK.leftParenthesis)
{
error("`(arguments)` expected following `%s`", t.toChars());
return e;
}
e = new AST.CallExp(loc, e, parseArguments());
}
break;
}
case TOK.leftParenthesis:
{
auto tk = peek(&token);
static if (CCASTSYNTAX)
{
// If cast
if (isDeclaration(tk, NeedDeclaratorId.no, TOK.rightParenthesis, &tk))
{
tk = peek(tk); // skip over right parenthesis
switch (tk.value)
{
case TOK.not:
tk = peek(tk);
if (tk.value == TOK.is_ || tk.value == TOK.in_) // !is or !in
break;
goto case;
case TOK.dot:
case TOK.plusPlus:
case TOK.minusMinus:
case TOK.delete_:
case TOK.new_:
case TOK.leftParenthesis:
case TOK.identifier:
case TOK.this_:
case TOK.super_:
case TOK.int32Literal:
case TOK.uns32Literal:
case TOK.int64Literal:
case TOK.uns64Literal:
case TOK.int128Literal:
case TOK.uns128Literal:
case TOK.float32Literal:
case TOK.float64Literal:
case TOK.float80Literal:
case TOK.imaginary32Literal:
case TOK.imaginary64Literal:
case TOK.imaginary80Literal:
case TOK.null_:
case TOK.true_:
case TOK.false_:
case TOK.charLiteral:
case TOK.wcharLiteral:
case TOK.dcharLiteral:
case TOK.string_:
case TOK.function_:
case TOK.delegate_:
case TOK.typeof_:
case TOK.traits:
case TOK.vector:
case TOK.file:
case TOK.fileFullPath:
case TOK.line:
case TOK.moduleString:
case TOK.functionString:
case TOK.prettyFunction:
case TOK.wchar_:
case TOK.dchar_:
case TOK.bool_:
case TOK.char_:
case TOK.int8:
case TOK.uns8:
case TOK.int16:
case TOK.uns16:
case TOK.int32:
case TOK.uns32:
case TOK.int64:
case TOK.uns64:
case TOK.int128:
case TOK.uns128:
case TOK.float32:
case TOK.float64:
case TOK.float80:
case TOK.imaginary32:
case TOK.imaginary64:
case TOK.imaginary80:
case TOK.complex32:
case TOK.complex64:
case TOK.complex80:
case TOK.void_:
{
// (type) una_exp
nextToken();
auto t = parseType();
check(TOK.rightParenthesis);
// if .identifier
// or .identifier!( ... )
if (token.value == TOK.dot)
{
if (peekNext() != TOK.identifier && peekNext() != TOK.new_)
{
error("identifier or new keyword expected following `(...)`.");
nextToken();
return AST.ErrorExp.get();
}
auto te = new AST.TypeExp(loc, t);
te.parens = true;
e = parsePostExp(te);
}
else if (token.value == TOK.leftParenthesis)
{
auto te = new AST.TypeExp(loc, t);
te.parens = true;
e = parsePostExp(te);
}
else
{
e = parseUnaryExp();
e = new AST.CastExp(loc, e, t);
error("C style cast illegal, use `%s`", e.toChars());
}
return e;
}
default:
break;
}
}
}
e = parsePrimaryExp();
e = parsePostExp(e);
break;
}
case TOK.throw_:
{
nextToken();
// Deviation from the DIP:
// Parse AssignExpression instead of Expression to avoid conflicts for comma
// separated lists, e.g. function arguments
AST.Expression exp = parseAssignExp();
e = new AST.ThrowExp(loc, exp);
break;
}
default:
e = parsePrimaryExp();
e = parsePostExp(e);
break;
}
assert(e);
// ^^ is right associative and has higher precedence than the unary operators
while (token.value == TOK.pow)
{
nextToken();
AST.Expression e2 = parseUnaryExp();
e = new AST.PowExp(loc, e, e2);
}
return e;
}
private AST.Expression parsePostExp(AST.Expression e)
{
while (1)
{
const loc = token.loc;
switch (token.value)
{
case TOK.dot:
nextToken();
if (token.value == TOK.identifier)
{
Identifier id = token.ident;
nextToken();
if (token.value == TOK.not && peekNext() != TOK.is_ && peekNext() != TOK.in_)
{
AST.Objects* tiargs = parseTemplateArguments();
e = new AST.DotTemplateInstanceExp(loc, e, id, tiargs);
}
else
e = new AST.DotIdExp(loc, e, id);
continue;
}
if (token.value == TOK.new_)
{
e = parseNewExp(e);
continue;
}
error("identifier or `new` expected following `.`, not `%s`", token.toChars());
break;
case TOK.plusPlus:
e = new AST.PostExp(EXP.plusPlus, loc, e);
break;
case TOK.minusMinus:
e = new AST.PostExp(EXP.minusMinus, loc, e);
break;
case TOK.leftParenthesis:
AST.Expressions* args = new AST.Expressions();
AST.Identifiers* names = new AST.Identifiers();
parseNamedArguments(args, names);
e = new AST.CallExp(loc, e, args, names);
continue;
case TOK.leftBracket:
{
// array dereferences:
// array[index]
// array[]
// array[lwr .. upr]
AST.Expression index;
AST.Expression upr;
auto arguments = new AST.Expressions();
inBrackets++;
nextToken();
while (token.value != TOK.rightBracket && token.value != TOK.endOfFile)
{
index = parseAssignExp();
if (token.value == TOK.slice)
{
// array[..., lwr..upr, ...]
nextToken();
upr = parseAssignExp();
arguments.push(new AST.IntervalExp(loc, index, upr));
}
else
arguments.push(index);
if (token.value == TOK.rightBracket)
break;
check(TOK.comma);
}
check(TOK.rightBracket);
inBrackets--;
e = new AST.ArrayExp(loc, e, arguments);
continue;
}
default:
return e;
}
nextToken();
}
}
private AST.Expression parseMulExp()
{
const loc = token.loc;
auto e = parseUnaryExp();
while (1)
{
switch (token.value)
{
case TOK.mul:
nextToken();
auto e2 = parseUnaryExp();
e = new AST.MulExp(loc, e, e2);
continue;
case TOK.div:
nextToken();
auto e2 = parseUnaryExp();
e = new AST.DivExp(loc, e, e2);
continue;
case TOK.mod:
nextToken();
auto e2 = parseUnaryExp();
e = new AST.ModExp(loc, e, e2);
continue;
default:
break;
}
break;
}
return e;
}
private AST.Expression parseAddExp()
{
const loc = token.loc;
auto e = parseMulExp();
while (1)
{
switch (token.value)
{
case TOK.add:
nextToken();
auto e2 = parseMulExp();
e = new AST.AddExp(loc, e, e2);
continue;
case TOK.min:
nextToken();
auto e2 = parseMulExp();
e = new AST.MinExp(loc, e, e2);
continue;
case TOK.tilde:
nextToken();
auto e2 = parseMulExp();
e = new AST.CatExp(loc, e, e2);
continue;
default:
break;
}
break;
}
return e;
}
private AST.Expression parseShiftExp()
{
const loc = token.loc;
auto e = parseAddExp();
while (1)
{
switch (token.value)
{
case TOK.leftShift:
nextToken();
auto e2 = parseAddExp();
e = new AST.ShlExp(loc, e, e2);
continue;
case TOK.rightShift:
nextToken();
auto e2 = parseAddExp();
e = new AST.ShrExp(loc, e, e2);
continue;
case TOK.unsignedRightShift:
nextToken();
auto e2 = parseAddExp();
e = new AST.UshrExp(loc, e, e2);
continue;
default:
break;
}
break;
}
return e;
}
private AST.Expression parseCmpExp()
{
const loc = token.loc;
auto e = parseShiftExp();
EXP op = EXP.reserved;
switch (token.value)
{
case TOK.equal: op = EXP.equal; goto Lequal;
case TOK.notEqual: op = EXP.notEqual; goto Lequal;
Lequal:
nextToken();
auto e2 = parseShiftExp();
e = new AST.EqualExp(op, loc, e, e2);
break;
case TOK.not:
{
// Attempt to identify '!is'
const tv = peekNext();
if (tv == TOK.in_)
{
nextToken();
nextToken();
auto e2 = parseShiftExp();
e = new AST.InExp(loc, e, e2);
e = new AST.NotExp(loc, e);
break;
}
if (tv != TOK.is_)
break;
nextToken();
op = EXP.notIdentity;
goto Lidentity;
}
case TOK.is_: op = EXP.identity; goto Lidentity;
Lidentity:
nextToken();
auto e2 = parseShiftExp();
e = new AST.IdentityExp(op, loc, e, e2);
break;
case TOK.lessThan: op = EXP.lessThan; goto Lcmp;
case TOK.lessOrEqual: op = EXP.lessOrEqual; goto Lcmp;
case TOK.greaterThan: op = EXP.greaterThan; goto Lcmp;
case TOK.greaterOrEqual: op = EXP.greaterOrEqual; goto Lcmp;
Lcmp:
nextToken();
auto e2 = parseShiftExp();
e = new AST.CmpExp(op, loc, e, e2);
break;
case TOK.in_:
nextToken();
auto e2 = parseShiftExp();
e = new AST.InExp(loc, e, e2);
break;
default:
break;
}
return e;
}
private AST.Expression parseAndExp()
{
Loc loc = token.loc;
bool parens = token.value == TOK.leftParenthesis;
auto e = parseCmpExp();
while (token.value == TOK.and)
{
if (!parens)
checkParens(TOK.and, e);
parens = nextToken() == TOK.leftParenthesis;
auto e2 = parseCmpExp();
if (!parens)
checkParens(TOK.and, e2);
e = new AST.AndExp(loc, e, e2);
parens = true; // don't call checkParens() for And
loc = token.loc;
}
return e;
}
private AST.Expression parseXorExp()
{
Loc loc = token.loc;
bool parens = token.value == TOK.leftParenthesis;
auto e = parseAndExp();
while (token.value == TOK.xor)
{
if (!parens)
checkParens(TOK.xor, e);
parens = nextToken() == TOK.leftParenthesis;
auto e2 = parseAndExp();
if (!parens)
checkParens(TOK.xor, e2);
e = new AST.XorExp(loc, e, e2);
parens = true;
loc = token.loc;
}
return e;
}
private AST.Expression parseOrExp()
{
Loc loc = token.loc;
bool parens = token.value == TOK.leftParenthesis;
auto e = parseXorExp();
while (token.value == TOK.or)
{
if (!parens)
checkParens(TOK.or, e);
parens = nextToken() == TOK.leftParenthesis;
auto e2 = parseXorExp();
if (!parens)
checkParens(TOK.or, e2);
e = new AST.OrExp(loc, e, e2);
parens = true;
loc = token.loc;
}
return e;
}
private AST.Expression parseAndAndExp()
{
const loc = token.loc;
auto e = parseOrExp();
while (token.value == TOK.andAnd)
{
nextToken();
auto e2 = parseOrExp();
e = new AST.LogicalExp(loc, EXP.andAnd, e, e2);
}
return e;
}
private AST.Expression parseOrOrExp()
{
const loc = token.loc;
auto e = parseAndAndExp();
while (token.value == TOK.orOr)
{
nextToken();
auto e2 = parseAndAndExp();
e = new AST.LogicalExp(loc, EXP.orOr, e, e2);
}
return e;
}
private AST.Expression parseCondExp()
{
const loc = token.loc;
auto e = parseOrOrExp();
if (token.value == TOK.question)
{
nextToken();
auto e1 = parseExpression();
check(TOK.colon);
auto e2 = parseCondExp();
e = new AST.CondExp(loc, e, e1, e2);
}
return e;
}
AST.Expression parseAssignExp()
{
bool parens = token.value == TOK.leftParenthesis;
AST.Expression e;
e = parseCondExp();
if (e is null)
return e;
// require parens for e.g. `t ? a = 1 : b = 2`
void checkRequiredParens()
{
if (e.op == EXP.question && !parens)
eSink.error(e.loc, "`%s` must be surrounded by parentheses when next to operator `%s`",
e.toChars(), Token.toChars(token.value));
}
const loc = token.loc;
switch (token.value)
{
case TOK.assign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.AssignExp(loc, e, e2);
break;
case TOK.addAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.AddAssignExp(loc, e, e2);
break;
case TOK.minAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.MinAssignExp(loc, e, e2);
break;
case TOK.mulAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.MulAssignExp(loc, e, e2);
break;
case TOK.divAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.DivAssignExp(loc, e, e2);
break;
case TOK.modAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.ModAssignExp(loc, e, e2);
break;
case TOK.powAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.PowAssignExp(loc, e, e2);
break;
case TOK.andAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.AndAssignExp(loc, e, e2);
break;
case TOK.orAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.OrAssignExp(loc, e, e2);
break;
case TOK.xorAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.XorAssignExp(loc, e, e2);
break;
case TOK.leftShiftAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.ShlAssignExp(loc, e, e2);
break;
case TOK.rightShiftAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.ShrAssignExp(loc, e, e2);
break;
case TOK.unsignedRightShiftAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.UshrAssignExp(loc, e, e2);
break;
case TOK.concatenateAssign:
checkRequiredParens();
nextToken();
auto e2 = parseAssignExp();
e = new AST.CatAssignExp(loc, e, e2);
break;
default:
break;
}
return e;
}
/*************************
* Collect argument list.
* Assume current token is ',', '$(LPAREN)' or '['.
*/
private AST.Expressions* parseArguments()
{
// function call
AST.Expressions* arguments = new AST.Expressions();
parseNamedArguments(arguments, null);
return arguments;
}
/*************************
* Collect argument list.
* Assume current token is ',', '$(LPAREN)' or '['.
*/
private void parseNamedArguments(AST.Expressions* arguments, AST.Identifiers* names)
{
assert(arguments);
const endtok = token.value == TOK.leftBracket ? TOK.rightBracket : TOK.rightParenthesis;
nextToken();
while (token.value != endtok && token.value != TOK.endOfFile)
{
if (peekNext() == TOK.colon)
{
// Named argument `name: exp`
auto loc = token.loc;
auto ident = token.ident;
check(TOK.identifier);
check(TOK.colon);
if (names)
names.push(ident);
else
error(loc, "named arguments not allowed here");
}
else
{
if (names)
names.push(null);
}
auto arg = parseAssignExp();
arguments.push(arg);
if (token.value != TOK.comma)
break;
nextToken(); //comma
}
check(endtok);
}
/*******************************************
*/
private AST.Expression parseNewExp(AST.Expression thisexp)
{
const loc = token.loc;
nextToken();
AST.Expressions* arguments = null;
AST.Identifiers* names = null;
// An anonymous nested class starts with "class"
if (token.value == TOK.class_)
{
nextToken();
if (token.value == TOK.leftParenthesis)
{
arguments = new AST.Expressions();
names = new AST.Identifiers();
parseNamedArguments(arguments, names);
}
AST.BaseClasses* baseclasses = null;
if (token.value != TOK.leftCurly)
baseclasses = parseBaseClasses();
Identifier id = null;
AST.Dsymbols* members = null;
if (token.value != TOK.leftCurly)
{
error("`{ members }` expected for anonymous class");
}
else
{
nextToken();
members = parseDeclDefs(0);
if (token.value != TOK.rightCurly)
error("class member expected");
nextToken();
}
auto cd = new AST.ClassDeclaration(loc, id, baseclasses, members, false);
auto e = new AST.NewAnonClassExp(loc, thisexp, cd, arguments);
return e;
}
const stc = parseTypeCtor();
auto t = parseBasicType(true);
t = parseTypeSuffixes(t);
t = t.addSTC(stc);
if (t.ty == Taarray)
{
AST.TypeAArray taa = cast(AST.TypeAArray)t;
AST.Type index = taa.index;
// `new Type[expr]` is a static array
auto edim = AST.typeToExpression(index);
if (edim)
t = new AST.TypeSArray(taa.next, edim);
}
else if (token.value == TOK.leftParenthesis && t.ty != Tsarray)
{
arguments = new AST.Expressions();
names = new AST.Identifiers();
parseNamedArguments(arguments, names);
}
auto e = new AST.NewExp(loc, thisexp, t, arguments, names);
return e;
}
/**********************************************
*/
private void addComment(AST.Dsymbol s, const(char)* blockComment)
{
if (s !is null)
this.addComment(s, blockComment.toDString());
}
private void addComment(AST.Dsymbol s, const(char)[] blockComment)
{
if (s !is null)
{
s.addComment(combineComments(blockComment, token.lineComment, true));
token.lineComment = null;
}
}
/**********************************************
* Recognize builtin @ attributes
* Params:
* ident = identifier
* Returns:
* storage class for attribute, 0 if not
*/
static StorageClass isBuiltinAtAttribute(Identifier ident)
{
return (ident == Id.property) ? STC.property :
(ident == Id.nogc) ? STC.nogc :
(ident == Id.safe) ? STC.safe :
(ident == Id.trusted) ? STC.trusted :
(ident == Id.system) ? STC.system :
(ident == Id.live) ? STC.live :
(ident == Id.future) ? STC.future :
(ident == Id.disable) ? STC.disable :
0;
}
enum StorageClass atAttrGroup =
STC.property |
STC.nogc |
STC.safe |
STC.trusted |
STC.system |
STC.live |
/*STC.future |*/ // probably should be included
STC.disable;
void usageOfBodyKeyword()
{
version (none)
{
// @@@DEPRECATED_2.117@@@
// https://github.com/dlang/DIPs/blob/1f5959abe482b1f9094f6484a7d0a3ade77fc2fc/DIPs/accepted/DIP1003.md
// Deprecated in 2.097 - Can be removed from 2.117
// The deprecation period is longer than usual as `body`
// was quite widely used.
deprecation("usage of the `body` keyword is deprecated. Use `do` instead.");
}
}
}
enum PREC : int
{
zero,
expr,
assign,
cond,
oror,
andand,
or,
xor,
and,
equal,
rel,
shift,
add,
mul,
pow,
unary,
primary,
}
/**********************************
* Set operator precedence for each operator.
*
* Used by hdrgen
*/
immutable PREC[EXP.max + 1] precedence =
[
EXP.type : PREC.expr,
EXP.error : PREC.expr,
EXP.objcClassReference : PREC.expr, // Objective-C class reference, same as EXP.type
EXP.mixin_ : PREC.primary,
EXP.import_ : PREC.primary,
EXP.dotVariable : PREC.primary,
EXP.scope_ : PREC.primary,
EXP.identifier : PREC.primary,
EXP.this_ : PREC.primary,
EXP.super_ : PREC.primary,
EXP.int64 : PREC.primary,
EXP.float64 : PREC.primary,
EXP.complex80 : PREC.primary,
EXP.null_ : PREC.primary,
EXP.string_ : PREC.primary,
EXP.arrayLiteral : PREC.primary,
EXP.assocArrayLiteral : PREC.primary,
EXP.classReference : PREC.primary,
EXP.file : PREC.primary,
EXP.fileFullPath : PREC.primary,
EXP.line : PREC.primary,
EXP.moduleString : PREC.primary,
EXP.functionString : PREC.primary,
EXP.prettyFunction : PREC.primary,
EXP.typeid_ : PREC.primary,
EXP.is_ : PREC.primary,
EXP.assert_ : PREC.primary,
EXP.halt : PREC.primary,
EXP.template_ : PREC.primary,
EXP.dSymbol : PREC.primary,
EXP.function_ : PREC.primary,
EXP.variable : PREC.primary,
EXP.symbolOffset : PREC.primary,
EXP.structLiteral : PREC.primary,
EXP.compoundLiteral : PREC.primary,
EXP.arrayLength : PREC.primary,
EXP.delegatePointer : PREC.primary,
EXP.delegateFunctionPointer : PREC.primary,
EXP.remove : PREC.primary,
EXP.tuple : PREC.primary,
EXP.traits : PREC.primary,
EXP.overloadSet : PREC.primary,
EXP.void_ : PREC.primary,
EXP.vectorArray : PREC.primary,
EXP._Generic : PREC.primary,
// post
EXP.dotTemplateInstance : PREC.primary,
EXP.dotIdentifier : PREC.primary,
EXP.dotTemplateDeclaration : PREC.primary,
EXP.dot : PREC.primary,
EXP.dotType : PREC.primary,
EXP.plusPlus : PREC.primary,
EXP.minusMinus : PREC.primary,
EXP.prePlusPlus : PREC.primary,
EXP.preMinusMinus : PREC.primary,
EXP.call : PREC.primary,
EXP.slice : PREC.primary,
EXP.array : PREC.primary,
EXP.index : PREC.primary,
EXP.delegate_ : PREC.unary,
EXP.address : PREC.unary,
EXP.star : PREC.unary,
EXP.negate : PREC.unary,
EXP.uadd : PREC.unary,
EXP.not : PREC.unary,
EXP.tilde : PREC.unary,
EXP.delete_ : PREC.unary,
EXP.new_ : PREC.unary,
EXP.newAnonymousClass : PREC.unary,
EXP.cast_ : PREC.unary,
EXP.throw_ : PREC.unary,
EXP.vector : PREC.unary,
EXP.pow : PREC.pow,
EXP.mul : PREC.mul,
EXP.div : PREC.mul,
EXP.mod : PREC.mul,
EXP.add : PREC.add,
EXP.min : PREC.add,
EXP.concatenate : PREC.add,
EXP.leftShift : PREC.shift,
EXP.rightShift : PREC.shift,
EXP.unsignedRightShift : PREC.shift,
EXP.lessThan : PREC.rel,
EXP.lessOrEqual : PREC.rel,
EXP.greaterThan : PREC.rel,
EXP.greaterOrEqual : PREC.rel,
EXP.in_ : PREC.rel,
/* Note that we changed precedence, so that < and != have the same
* precedence. This change is in the parser, too.
*/
EXP.equal : PREC.rel,
EXP.notEqual : PREC.rel,
EXP.identity : PREC.rel,
EXP.notIdentity : PREC.rel,
EXP.and : PREC.and,
EXP.xor : PREC.xor,
EXP.or : PREC.or,
EXP.andAnd : PREC.andand,
EXP.orOr : PREC.oror,
EXP.question : PREC.cond,
EXP.assign : PREC.assign,
EXP.construct : PREC.assign,
EXP.blit : PREC.assign,
EXP.addAssign : PREC.assign,
EXP.minAssign : PREC.assign,
EXP.concatenateAssign : PREC.assign,
EXP.concatenateElemAssign : PREC.assign,
EXP.concatenateDcharAssign : PREC.assign,
EXP.mulAssign : PREC.assign,
EXP.divAssign : PREC.assign,
EXP.modAssign : PREC.assign,
EXP.powAssign : PREC.assign,
EXP.leftShiftAssign : PREC.assign,
EXP.rightShiftAssign : PREC.assign,
EXP.unsignedRightShiftAssign : PREC.assign,
EXP.andAssign : PREC.assign,
EXP.orAssign : PREC.assign,
EXP.xorAssign : PREC.assign,
EXP.comma : PREC.expr,
EXP.declaration : PREC.expr,
EXP.interval : PREC.assign,
];
enum ParseStatementFlags : int
{
scope_ = 2, // start a new scope
curly = 4, // { } statement is required
curlyScope = 8, // { } starts a new scope
semiOk = 0x10, // empty ';' are really ok
}
struct PrefixAttributes(AST)
{
StorageClass storageClass;
AST.Expression depmsg;
LINK link;
AST.Visibility visibility;
bool setAlignment;
AST.Expression ealign;
AST.Expressions* udas;
const(char)* comment;
}
/// The result of the `ParseLinkage` function
struct ParsedLinkage(AST)
{
/// What linkage was specified
LINK link;
/// If `extern(C++, class|struct)`, contains the `class|struct`
CPPMANGLE cppmangle;
/// If `extern(C++, some.identifier)`, will be the identifiers
AST.Identifiers* idents;
/// If `extern(C++, (some_tuple_expression)|"string"), will be the expressions
AST.Expressions* identExps;
}
/*********************************** Private *************************************/
/***********************
* How multiple declarations are parsed.
* If 1, treat as C.
* If 0, treat:
* int *p, i;
* as:
* int* p;
* int* i;
*/
private enum CDECLSYNTAX = 0;
/*****
* Support C cast syntax:
* (type)(expression)
*/
private enum CCASTSYNTAX = 1;
/*****
* Support postfix C array declarations, such as
* int a[3][4];
*/
private enum CARRAYDECL = 1;
/*****************************
* Destructively extract storage class from pAttrs.
*/
private StorageClass getStorageClass(AST)(PrefixAttributes!(AST)* pAttrs)
{
StorageClass stc = STC.undefined_;
if (pAttrs)
{
stc = pAttrs.storageClass;
pAttrs.storageClass = STC.undefined_;
}
return stc;
}
|
D
|
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
void main()
{
const positions = File("day07.in", "r")
.readln
.split(",")
.map!(to!int)
.array;
positions.calcFuelCost(&constantCost)
.writeln;
positions.calcFuelCost(&exponCost)
.writeln;
}
int calcFuelCost(in int[] positions, int function(int, int) costFunc)
{
return iota(positions.minElement, positions.maxElement).map!(
(pos) => reduce!(
(cost, other) => costFunc(cost, abs(pos - other)))(0, positions)
).minElement;
}
int constantCost(int cost, int distance)
{
return cost + distance;
}
int exponCost(int cost, int distance)
{
return cost + to!int(
distance * (distance + 1) * 0.5);
}
unittest
{
const positions = [16, 1, 2, 0, 4, 2, 7, 1, 2, 14];
const constantCost = positions.calcFuelCost(
&constantCost);
assert(constantCost == 37, format!"Expected %s, received: %s"(37, constantCost));
const exponCost = positions.calcFuelCost(&exponCost);
assert(exponCost == 168, format!"Expected %s, received: %s"(
168, exponCost));
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Red Hat Inc. - Bug 462631
* Port to the D Programming Language:
* alice <[email protected]>
*******************************************************************************/
module tests.RGB;
import std.exception : assertThrown;
import java.lang.exceptions;
import java.lang.String;
import org.eclipse.swt.graphics.RGB;
/*
* Automated Test Suite for class org.eclipse.swt.graphics.RGB
*/
@("test_ConstructorIII")
unittest
{
// Test RGB(int red, int green, int blue)
new RGB(20, 100, 200);
new RGB(0, 0, 0);
assertThrown!IllegalArgumentException(new RGB(-1, 20, 50),
"No exception thrown for red < 0");
assertThrown!IllegalArgumentException(new RGB(256, 20, 50),
"No exception thrown for red > 255");
assertThrown!IllegalArgumentException(new RGB(20, -1, 50),
"No exception thrown for green < 0");
assertThrown!IllegalArgumentException(new RGB(20, 256, 50),
"No exception thrown for green > 255");
assertThrown!IllegalArgumentException(new RGB(20, 50, -1),
"No exception thrown for blue < 0");
assertThrown!IllegalArgumentException(new RGB(20, 50, 256),
"No exception thrown for blue > 255");
}
@("test_ConstructorFFF")
unittest
{
new RGB(0f,0f,0f);
new RGB(0f,1f,0f);
new RGB(0f,0f,1f);
new RGB(0f,0.6f,0.4f);
new RGB(1f,0f,1f);
new RGB(1f,1f,1f);
new RGB(1f,0f,1f);
new RGB(1f,1f,0f);
new RGB(1f,0.6f,0.4f);
new RGB(59f,0f,1f);
new RGB(59f,1f,1f);
new RGB(59f,0f,1f);
new RGB(59f,1f,0f);
new RGB(59f,0.6f,0.4f);
new RGB(60f,0f,1f);
new RGB(60f,1f,1f);
new RGB(60f,0f,1f);
new RGB(60f,1f,0f);
new RGB(60f,0.6f,0.4f);
new RGB(61f,0f,1f);
new RGB(61f,1f,1f);
new RGB(61f,0f,1f);
new RGB(61f,1f,0f);
new RGB(61f,0.6f,0.4f);
new RGB(119f,0f,1f);
new RGB(119f,1f,1f);
new RGB(119f,0f,1f);
new RGB(119f,1f,0f);
new RGB(119f,0.6f,0.4f);
new RGB(120f,0f,1f);
new RGB(120f,1f,1f);
new RGB(120f,0f,1f);
new RGB(120f,1f,0f);
new RGB(120f,0.6f,0.4f);
new RGB(121f,0f,1f);
new RGB(121f,1f,1f);
new RGB(121f,0f,1f);
new RGB(121f,1f,0f);
new RGB(121f,0.6f,0.4f);
new RGB(179f,0f,1f);
new RGB(179f,1f,1f);
new RGB(179f,0f,1f);
new RGB(179f,1f,0f);
new RGB(179f,0.6f,0.4f);
new RGB(180f,0f,1f);
new RGB(180f,1f,1f);
new RGB(180f,0f,1f);
new RGB(180f,1f,0f);
new RGB(180f,0.6f,0.4f);
new RGB(181f,0f,1f);
new RGB(181f,1f,1f);
new RGB(181f,0f,1f);
new RGB(181f,1f,0f);
new RGB(181f,0.6f,0.4f);
new RGB(239f,0f,1f);
new RGB(239f,1f,1f);
new RGB(239f,0f,1f);
new RGB(239f,1f,0f);
new RGB(239f,0.6f,0.4f);
new RGB(240f,0f,1f);
new RGB(240f,1f,1f);
new RGB(240f,0f,1f);
new RGB(240f,1f,0f);
new RGB(240f,0.6f,0.4f);
new RGB(241f,0f,1f);
new RGB(241f,1f,1f);
new RGB(241f,0f,1f);
new RGB(241f,1f,0f);
new RGB(241f,0.6f,0.4f);
new RGB(299f,0f,1f);
new RGB(299f,1f,1f);
new RGB(299f,0f,1f);
new RGB(299f,1f,0f);
new RGB(299f,0.6f,0.4f);
new RGB(300f,0f,1f);
new RGB(300f,1f,1f);
new RGB(300f,0f,1f);
new RGB(300f,1f,0f);
new RGB(300f,0.6f,0.4f);
new RGB(301f,0f,1f);
new RGB(301f,1f,1f);
new RGB(301f,0f,1f);
new RGB(301f,1f,0f);
new RGB(301f,0.6f,0.4f);
new RGB(359f,0f,1f);
new RGB(359f,1f,1f);
new RGB(359f,0f,1f);
new RGB(359f,1f,0f);
new RGB(359f,0.6f,0.4f);
new RGB(360f,0f,1f);
new RGB(360f,1f,1f);
new RGB(360f,0f,1f);
new RGB(360f,1f,0f);
new RGB(360f,0.6f,0.4f);
assertThrown!IllegalArgumentException(new RGB(400f, 0.5f, 0.5f),
"No exception thrown for hue > 360");
assertThrown!IllegalArgumentException(new RGB(-5, 0.5f, 0.5f),
"No exception thrown for hue < 0");
assertThrown!IllegalArgumentException(new RGB(200f, -0.5f, 0.5f),
"No exception thrown for saturation < 0");
assertThrown!IllegalArgumentException(new RGB(200f, 300f, 0.5f),
"No exception thrown for saturation > 1");
assertThrown!IllegalArgumentException(new RGB(200f, 0.5f, -0.5f),
"No exception thrown for brightness < 0");
assertThrown!IllegalArgumentException(new RGB(200, 0.5f, 400f),
"No exception thrown for brightness > 1");
}
@("test_equalsLjava_lang_Object")
unittest
{
int r = 0, g = 127, b = 254;
RGB rgb1 = new RGB(r, g, b);
RGB rgb2;
rgb2 = rgb1;
if (rgb1 != rgb2) {
assert(false, "Two references to the same RGB instance not found equal");
}
rgb2 = new RGB(r, g, b);
if (rgb1 != rgb2) {
assert(false, "References to two different RGB instances with same R G B parameters not found equal");
}
if (rgb1 == (new RGB(r+1, g, b)) ||
rgb1 == (new RGB(r, g+1, b)) ||
rgb1 == (new RGB(r, g, b+1)) ||
rgb1 == (new RGB(r+1, g+1, b+1))) {
assert(false, "Comparing two RGB instances with different combination of R G B parameters found equal");
}
float hue = 220f, sat = 0.6f, bright = 0.7f;
rgb1 = new RGB(hue, sat, bright);
rgb2 = rgb1;
if (rgb1 != rgb2) {
assert(false, "Two references to the same RGB isntance not found equal");
}
rgb2 = new RGB(hue, sat, bright);
if (rgb1 != rgb2) {
assert(false, "References to two different RGB instances with same H S B parameters not found equal");
}
if (rgb1 == (new RGB(hue+1, sat, bright)) ||
rgb1 == (new RGB(hue, sat+0.1f, bright)) ||
rgb1 == (new RGB(hue, sat, bright+0.1f)) ||
rgb1 == (new RGB(hue+1, sat+0.1f, bright+0.1f))) {
assert(false, "Comparing two RGB instances with different combination of H S B parameters found equal");
}
}
@("test_getHSB")
unittest
{
float[] hsb = [
0f,0f,0f,
0f,1f,1f,
0f,1f,0f,
0f,0f,1f,
0f,0.6f,0.4f,
1f,0f,1f,
1f,1f,1f,
1f,0f,1f,
1f,1f,0f,
1f,0.6f,0.4f,
59f,0f,1f,
59f,1f,1f,
59f,0f,1f,
59f,1f,0f,
59f,0.6f,0.4f,
60f,0f,1f,
60f,1f,1f,
60f,0f,1f,
60f,1f,0f,
60f,0.6f,0.4f,
61f,0f,1f,
61f,1f,1f,
61f,0f,1f,
61f,1f,0f,
61f,0.6f,0.4f,
119f,0f,1f,
119f,1f,1f,
119f,0f,1f,
119f,1f,0f,
119f,0.6f,0.4f,
120f,0f,1f,
120f,1f,1f,
120f,0f,1f,
120f,1f,0f,
120f,0.6f,0.4f,
121f,0f,1f,
121f,1f,1f,
121f,0f,1f,
121f,1f,0f,
121f,0.6f,0.4f,
179f,0f,1f,
179f,1f,1f,
179f,0f,1f,
179f,1f,0f,
179f,0.6f,0.4f,
180f,0f,1f,
180f,1f,1f,
180f,0f,1f,
180f,1f,0f,
180f,0.6f,0.4f,
181f,0f,1f,
181f,1f,1f,
181f,0f,1f,
181f,1f,0f,
181f,0.6f,0.4f,
239f,0f,1f,
239f,1f,1f,
239f,0f,1f,
239f,1f,0f,
239f,0.6f,0.4f,
240f,0f,1f,
240f,1f,1f,
240f,0f,1f,
240f,1f,0f,
240f,0.6f,0.4f,
241f,0f,1f,
241f,1f,1f,
241f,0f,1f,
241f,1f,0f,
241f,0.6f,0.4f,
299f,0f,1f,
299f,1f,1f,
299f,0f,1f,
299f,1f,0f,
299f,0.6f,0.4f,
300f,0f,1f,
300f,1f,1f,
300f,0f,1f,
300f,1f,0f,
300f,0.6f,0.4f,
301f,0f,1f,
301f,1f,1f,
301f,0f,1f,
301f,1f,0f,
301f,0.6f,0.4f,
359f,0f,1f,
359f,1f,1f,
359f,0f,1f,
359f,1f,0f,
359f,0.6f,0.4f,
360f,0f,1f,
360f,1f,1f,
360f,0f,1f,
360f,1f,0f,
360f,0.6f,0.4f,
220f,0.6f,0.7f];
for (int i = 0; i < hsb.length; i+=3) {
RGB rgb1 = new RGB(hsb[i], hsb[i+1], hsb[i+2]);
float[] hsb2 = rgb1.getHSB();
RGB rgb2 = new RGB(hsb2[0], hsb2[1], hsb2[2]);
if (rgb1 != rgb2) {
assert(false, "Two references to the same RGB using getHSB() function not found equal");
}
}
}
@("test_hashCode")
unittest
{
int r = 255, g = 100, b = 0;
RGB rgb1 = new RGB(r, g, b);
RGB rgb2 = new RGB(r, g, b);
hash_t hash1 = rgb1.toHash();
hash_t hash2 = rgb2.toHash();
if (hash1 != hash2) {
assert(false, "Two RGB instances with same R G B parameters returned different hash codes");
}
if (rgb1.toHash() == new RGB(g, b, r).toHash() ||
rgb1.toHash() == new RGB(b, r, g).toHash()) {
assert(false, "Two RGB instances with different R G B parameters returned the same hash code");
}
}
@("test_toString")
unittest
{
RGB rgb = new RGB(0, 100, 200);
String s = rgb.toString();
if (s is null || s.length() == 0) {
assert(false, "RGB.toString returns null or empty String");
}
}
|
D
|
/Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/UILayoutSupport+Extensions.o : /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/Constraint.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintConfig.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintDescription.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintInsets.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintItem.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMaker.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintRelation.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintView.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/Debugging.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/LayoutConstraint.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/UILayoutGuide+Extensions.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.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/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/UILayoutSupport+Extensions~partial.swiftmodule : /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/Constraint.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintConfig.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintDescription.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintInsets.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintItem.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMaker.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintRelation.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintView.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/Debugging.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/LayoutConstraint.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/UILayoutGuide+Extensions.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.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/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/UILayoutSupport+Extensions~partial.swiftdoc : /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/Constraint.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintConfig.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintDescription.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintInsets.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintItem.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMaker.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintRelation.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintView.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/Debugging.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/LayoutConstraint.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/UILayoutGuide+Extensions.swift /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Vishnu/QBurst/Internal/Pod/QAHelper/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/Vishnu/QBurst/Internal/Pod/QAHelper/DerivedData/QAHelper/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.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
|
D
|
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/SQLite.build/SQL/SQLiteBoolLiteral.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteGeneric.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteBind.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteCreateTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteAlterTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDataTypeStaticRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteQueryExpressionRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteDataConvertible.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteDataType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteDatabase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/DatabaseIdentifier+SQLite.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteBoolLiteral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDefaultLiteral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteColumn.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteCollation.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteConnection.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteFunction.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteAlterTableBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteDataDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteRowDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/SQLiteError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteStatement.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDropIndex.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLitePrimaryKey.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteQuery.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/SQL.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/SQLite.build/SQLiteBoolLiteral~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteGeneric.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteBind.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteCreateTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteAlterTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDataTypeStaticRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteQueryExpressionRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteDataConvertible.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteDataType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteDatabase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/DatabaseIdentifier+SQLite.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteBoolLiteral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDefaultLiteral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteColumn.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteCollation.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteConnection.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteFunction.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteAlterTableBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteDataDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteRowDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/SQLiteError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteStatement.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDropIndex.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLitePrimaryKey.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteQuery.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/SQL.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/SQLite.build/SQLiteBoolLiteral~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteGeneric.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteBind.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteCreateTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteAlterTable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDataTypeStaticRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteQueryExpressionRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteDataConvertible.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteDataType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteDatabase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/DatabaseIdentifier+SQLite.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteBoolLiteral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDefaultLiteral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Row/SQLiteColumn.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteCollation.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteConnection.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteFunction.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteAlterTableBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteDataDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteRowDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Codable/SQLiteDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/SQLiteError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/Database/SQLiteStatement.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteDropIndex.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLitePrimaryKey.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/sqlite.git--5430702937685936219/Sources/SQLite/SQL/SQLiteQuery.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/SQL.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module logic.demo.GaussianObserver;
import mir.random;
import mir.random.variable;
import logic.data.Timeseries;
import logic.data.Vector;
import logic.demo.ErrorGenerator;
/**
* Generates observation through Gaussian permutation from a point
*/
class GaussianObserver : ErrorGenerator {
this(double xError, double yError, double zError) {
this.error = Vector(xError, yError, zError);
this.points = new Timeseries!double([], []);
}
override Vector observe(Vector base, double time) {
auto gen = Random(unpredictableSeed);
auto normalX = NormalVariable!double(base.x, this.error.x);
auto normalY = NormalVariable!double(base.y, this.error.y);
auto normalZ = NormalVariable!double(base.z, this.error.z);
Vector obs = Vector(normalX(gen), normalY(gen), normalZ(gen));
this.points.add(time, obs.x);
return obs;
}
}
|
D
|
/**
* Extract symbols from an ELF object file.
*
* Copyright: Copyright (C) 1999-2021 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/scanelf.d, _scanelf.d)
* Documentation: https://dlang.org/phobos/dmd_scanelf.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/scanelf.d
*/
module dmd.scanelf;
import core.stdc.string;
import core.stdc.stdint;
import core.checkedint;
import dmd.globals;
import dmd.errors;
enum LOG = false;
/*****************************************
* Reads an object module from base[] and passes the names
* of any exported symbols to (*pAddSymbol)().
* Params:
* pAddSymbol = function to pass the names to
* base = array of contents of object module
* module_name = name of the object module (used for error messages)
* loc = location to use for error printing
*/
void scanElfObjModule(void delegate(const(char)[] name, int pickAny) pAddSymbol,
const(ubyte)[] base, const(char)* module_name, Loc loc)
{
static if (LOG)
{
printf("scanElfObjModule(%s)\n", module_name);
}
void corrupt(int reason)
{
error(loc, "corrupt ELF object module `%s` %d", module_name, reason);
}
if (base.length < Elf32_Ehdr.sizeof)
return corrupt(__LINE__); // must be at least large enough for ELF32
static immutable ubyte[4] elf = [0x7F, 'E', 'L', 'F']; // ELF file signature
if (base[0 .. elf.length] != elf[])
return corrupt(__LINE__);
if (base[EI_VERSION] != EV_CURRENT)
{
return error(loc, "ELF object module `%s` has EI_VERSION = %d, should be %d",
module_name, base[EI_VERSION], EV_CURRENT);
}
if (base[EI_DATA] != ELFDATA2LSB)
{
return error(loc, "ELF object module `%s` is byte swapped and unsupported", module_name);
}
if (base[EI_CLASS] != ELFCLASS32 && base[EI_CLASS] != ELFCLASS64)
{
return error(loc, "ELF object module `%s` is unrecognized class %d", module_name, base[EI_CLASS]);
}
void scanELF(uint model)()
{
static if (model == 32)
{
alias ElfXX_Ehdr = Elf32_Ehdr;
alias ElfXX_Shdr = Elf32_Shdr;
alias ElfXX_Sym = Elf32_Sym;
}
else
{
static assert(model == 64);
alias ElfXX_Ehdr = Elf64_Ehdr;
alias ElfXX_Shdr = Elf64_Shdr;
alias ElfXX_Sym = Elf64_Sym;
}
if (base.length < ElfXX_Ehdr.sizeof)
return corrupt(__LINE__);
const eh = cast(const(ElfXX_Ehdr)*) base.ptr;
if (eh.e_type != ET_REL)
return error(loc, "ELF object module `%s` is not relocatable", module_name);
if (eh.e_version != EV_CURRENT)
return corrupt(__LINE__);
bool overflow;
const end = addu(eh.e_shoff, mulu(eh.e_shentsize, eh.e_shnum, overflow), overflow);
if (overflow || end > base.length)
return corrupt(__LINE__);
/* For each Section
*/
const sections = (cast(const(ElfXX_Shdr)*)(base.ptr + eh.e_shoff))[0 .. eh.e_shnum];
foreach (ref const section; sections)
{
if (section.sh_type != SHT_SYMTAB)
continue;
bool checkShdrXX(const ref ElfXX_Shdr shdr)
{
bool overflow;
return addu(shdr.sh_offset, shdr.sh_size, overflow) > base.length || overflow;
}
if (checkShdrXX(section))
return corrupt(__LINE__);
/* sh_link gives the particular string table section
* used for the symbol names.
*/
if (section.sh_link >= eh.e_shnum)
return corrupt(__LINE__);
const string_section = §ions[section.sh_link];
if (string_section.sh_type != SHT_STRTAB)
return corrupt(__LINE__);
if (checkShdrXX(*string_section))
return corrupt(__LINE__);
const string_tab = (cast(const(char)[])base)
[cast(size_t)string_section.sh_offset ..
cast(size_t)(string_section.sh_offset + string_section.sh_size)];
/* Get the array of symbols this section refers to
*/
const symbols = (cast(ElfXX_Sym*)(base.ptr + cast(size_t)section.sh_offset))
[0 .. cast(size_t)(section.sh_size / ElfXX_Sym.sizeof)];
foreach (ref const sym; symbols)
{
const stb = sym.st_info >> 4;
if (stb != STB_GLOBAL && stb != STB_WEAK || sym.st_shndx == SHN_UNDEF)
continue; // it's extern
if (sym.st_name >= string_tab.length)
return corrupt(__LINE__);
const name = &string_tab[sym.st_name];
//printf("sym st_name = x%x\n", sym.st_name);
const pend = cast(const(char*)) memchr(name, 0, string_tab.length - sym.st_name);
if (!pend) // if didn't find terminating 0 inside the string section
return corrupt(__LINE__);
pAddSymbol(name[0 .. pend - name], 1);
}
}
}
if (base[EI_CLASS] == ELFCLASS32)
{
scanELF!32;
}
else
{
assert(base[EI_CLASS] == ELFCLASS64);
scanELF!64;
}
}
alias Elf32_Half = uint16_t;
alias Elf64_Half = uint16_t;
alias Elf32_Word = uint32_t;
alias Elf32_Sword = int32_t;
alias Elf64_Word = uint32_t;
alias Elf64_Sword = int32_t;
alias Elf32_Xword = uint64_t;
alias Elf32_Sxword = int64_t;
alias Elf64_Xword = uint64_t;
alias Elf64_Sxword = int64_t;
alias Elf32_Addr = uint32_t;
alias Elf64_Addr = uint64_t;
alias Elf32_Off = uint32_t;
alias Elf64_Off = uint64_t;
alias Elf32_Section = uint16_t;
alias Elf64_Section = uint16_t;
alias Elf32_Versym = Elf32_Half;
alias Elf64_Versym = Elf64_Half;
struct Elf32_Ehdr
{
char[EI_NIDENT] e_ident = 0;
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry;
Elf32_Off e_phoff;
Elf32_Off e_shoff;
Elf32_Word e_flags;
Elf32_Half e_ehsize;
Elf32_Half e_phentsize;
Elf32_Half e_phnum;
Elf32_Half e_shentsize;
Elf32_Half e_shnum;
Elf32_Half e_shstrndx;
}
struct Elf64_Ehdr
{
char[EI_NIDENT] e_ident = 0;
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
}
enum EI_NIDENT = 16;
enum EI_VERSION = 6;
enum EI_CLASS = 4;
enum EI_DATA = 5;
enum EV_CURRENT = 1;
enum ELFDATANONE = 0;
enum ELFDATA2LSB = 1;
enum ELFDATA2MSB = 2;
enum ELFDATANUM = 3;
enum ELFCLASSNONE = 0;
enum ELFCLASS32 = 1;
enum ELFCLASS64 = 2;
enum ELFCLASSNUM = 3;
enum ET_REL = 1;
struct Elf32_Shdr
{
Elf32_Word sh_name;
Elf32_Word sh_type;
Elf32_Word sh_flags;
Elf32_Addr sh_addr;
Elf32_Off sh_offset;
Elf32_Word sh_size;
Elf32_Word sh_link;
Elf32_Word sh_info;
Elf32_Word sh_addralign;
Elf32_Word sh_entsize;
}
struct Elf64_Shdr
{
Elf64_Word sh_name;
Elf64_Word sh_type;
Elf64_Xword sh_flags;
Elf64_Addr sh_addr;
Elf64_Off sh_offset;
Elf64_Xword sh_size;
Elf64_Word sh_link;
Elf64_Word sh_info;
Elf64_Xword sh_addralign;
Elf64_Xword sh_entsize;
}
enum SHT_SYMTAB = 2;
enum SHT_STRTAB = 3;
struct Elf32_Sym
{
Elf32_Word st_name;
Elf32_Addr st_value;
Elf32_Word st_size;
ubyte st_info;
ubyte st_other;
Elf32_Section st_shndx;
}
struct Elf64_Sym
{
Elf64_Word st_name;
ubyte st_info;
ubyte st_other;
Elf64_Section st_shndx;
Elf64_Addr st_value;
Elf64_Xword st_size;
}
enum STB_GLOBAL = 1;
enum STB_WEAK = 2;
enum SHN_UNDEF = 0;
|
D
|
// Compiler implementation of the D programming language
// Copyright (c) 1999-2015 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.lexer;
import core.stdc.ctype;
import core.stdc.errno;
import core.stdc.stdarg;
import core.stdc.stdio;
import core.stdc.string;
import core.stdc.time;
import ddmd.entity;
import ddmd.errors;
import ddmd.globals;
import ddmd.id;
import ddmd.identifier;
import ddmd.root.longdouble;
import ddmd.root.outbuffer;
import ddmd.root.port;
import ddmd.root.rmem;
import ddmd.root.stringtable;
import ddmd.tokens;
import ddmd.utf;
enum LS = 0x2028; // UTF line separator
enum PS = 0x2029; // UTF paragraph separator
/********************************************
* Do our own char maps
*/
immutable ubyte[256] cmtable;
enum CMoctal = 0x1;
enum CMhex = 0x2;
enum CMidchar = 0x4;
enum CMzerosecond = 0x8;
enum CMdigitsecond = 0x10;
enum CMsinglechar = 0x20;
bool isoctal(char c)
{
return (cmtable[c] & CMoctal) != 0;
}
bool ishex(char c)
{
return (cmtable[c] & CMhex) != 0;
}
bool isidchar(char c)
{
return (cmtable[c] & CMidchar) != 0;
}
bool isZeroSecond(char c)
{
return (cmtable[c] & CMzerosecond) != 0;
}
bool isDigitSecond(char c)
{
return (cmtable[c] & CMdigitsecond) != 0;
}
bool issinglechar(char c)
{
return (cmtable[c] & CMsinglechar) != 0;
}
static this()
{
foreach (const c; 0 .. cmtable.length)
{
if ('0' <= c && c <= '7')
cmtable[c] |= CMoctal;
if (isxdigit(c))
cmtable[c] |= CMhex;
if (isalnum(c) || c == '_')
cmtable[c] |= CMidchar;
switch (c)
{
case 'x': case 'X':
case 'b': case 'B':
cmtable[c] |= CMzerosecond;
break;
case '0': .. case '9':
case 'e': case 'E':
case 'f': case 'F':
case 'l': case 'L':
case 'p': case 'P':
case 'u': case 'U':
case 'i':
case '.':
case '_':
cmtable[c] |= CMzerosecond | CMdigitsecond;
break;
default:
break;
}
switch (c)
{
case '\\':
case '\n':
case '\r':
case 0:
case 0x1A:
case '\'':
break;
default:
if (!(c & 0x80))
cmtable[c] |= CMsinglechar;
break;
}
}
}
unittest
{
//printf("lexer.unittest\n");
/* Not much here, just trying things out.
*/
string text = "int";
scope Lexer lex1 = new Lexer(null, text.ptr, 0, text.length, 0, 0);
TOK tok;
tok = lex1.nextToken();
//printf("tok == %s, %d, %d\n", Token::toChars(tok), tok, TOKint32);
assert(tok == TOKint32);
tok = lex1.nextToken();
assert(tok == TOKeof);
tok = lex1.nextToken();
assert(tok == TOKeof);
}
/***********************************************************
*/
class Lexer
{
public:
__gshared OutBuffer stringbuffer;
Loc scanloc; // for error messages
const(char)* base; // pointer to start of buffer
const(char)* end; // past end of buffer
const(char)* p; // current character
const(char)* line; // start of current line
Token token;
bool doDocComment; // collect doc comment information
bool anyToken; // seen at least one token
bool commentToken; // comments are TOKcomment's
bool errors; // errors occurred during lexing or parsing
/*********************
* Creates a Lexer.
* Params:
* filename = used for error messages
* base = source code, ending in a 0 byte
* begoffset = starting offset into base[]
* endoffset = last offset into base[]
* doDocComment = handle documentation comments
* commentToken = comments become TOKcomment's
*/
this(const(char)* filename, const(char)* base, size_t begoffset, size_t endoffset, bool doDocComment, bool commentToken)
{
scanloc = Loc(filename, 1, 1);
//printf("Lexer::Lexer(%p,%d)\n",base,length);
//printf("lexer.filename = %s\n", filename);
token = Token.init;
this.base = base;
this.end = base + endoffset;
p = base + begoffset;
line = p;
this.doDocComment = doDocComment;
this.commentToken = commentToken;
//initKeywords();
/* If first line starts with '#!', ignore the line
*/
if (p[0] == '#' && p[1] == '!')
{
p += 2;
while (1)
{
char c = *p;
switch (c)
{
case '\n':
p++;
break;
case '\r':
p++;
if (*p == '\n')
p++;
break;
case 0:
case 0x1A:
break;
default:
if (c & 0x80)
{
uint u = decodeUTF();
if (u == PS || u == LS)
break;
}
p++;
continue;
}
break;
}
endOfLine();
}
}
final TOK nextToken()
{
if (token.next)
{
Token* t = token.next;
memcpy(&token, t, Token.sizeof);
t.free();
}
else
{
scan(&token);
}
//token.print();
return token.value;
}
/***********************
* Look ahead at next token's value.
*/
final TOK peekNext()
{
return peek(&token).value;
}
/***********************
* Look 2 tokens ahead at value.
*/
final TOK peekNext2()
{
Token* t = peek(&token);
return peek(t).value;
}
/****************************
* Turn next token in buffer into a token.
*/
final void scan(Token* t)
{
uint lastLine = scanloc.linnum;
Loc startLoc;
t.blockComment = null;
t.lineComment = null;
while (1)
{
t.ptr = p;
//printf("p = %p, *p = '%c'\n",p,*p);
t.loc = loc();
switch (*p)
{
case 0:
case 0x1A:
t.value = TOKeof; // end of file
return;
case ' ':
case '\t':
case '\v':
case '\f':
p++;
continue;
// skip white space
case '\r':
p++;
if (*p != '\n') // if CR stands by itself
endOfLine();
continue;
// skip white space
case '\n':
p++;
endOfLine();
continue;
// skip white space
case '0':
if (!isZeroSecond(p[1])) // if numeric literal does not continue
{
++p;
t.uns64value = 0;
t.value = TOKint32v;
return;
}
goto Lnumber;
case '1': .. case '9':
if (!isDigitSecond(p[1])) // if numeric literal does not continue
{
t.uns64value = *p - '0';
++p;
t.value = TOKint32v;
return;
}
Lnumber:
t.value = number(t);
return;
case '\'':
if (issinglechar(p[1]) && p[2] == '\'')
{
t.uns64value = p[1]; // simple one character literal
t.value = TOKcharv;
p += 3;
}
else
t.value = charConstant(t);
return;
case 'r':
if (p[1] != '"')
goto case_ident;
p++;
case '`':
t.value = wysiwygStringConstant(t, *p);
return;
case 'x':
if (p[1] != '"')
goto case_ident;
p++;
t.value = hexStringConstant(t);
return;
case 'q':
if (p[1] == '"')
{
p++;
t.value = delimitedStringConstant(t);
return;
}
else if (p[1] == '{')
{
p++;
t.value = tokenStringConstant(t);
return;
}
else
goto case_ident;
case '"':
t.value = escapeStringConstant(t, 0);
return;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
/*case 'q': case 'r':*/
case 's':
case 't':
case 'u':
case 'v':
case 'w':
/*case 'x':*/
case 'y':
case 'z':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case_ident:
{
char c;
while (1)
{
c = *++p;
if (isidchar(c))
continue;
else if (c & 0x80)
{
const(char)* s = p;
uint u = decodeUTF();
if (isUniAlpha(u))
continue;
error("char 0x%04x not allowed in identifier", u);
p = s;
}
break;
}
Identifier id = Identifier.idPool(cast(char*)t.ptr, p - t.ptr);
t.ident = id;
t.value = cast(TOK)id.value;
anyToken = 1;
if (*t.ptr == '_') // if special identifier token
{
__gshared bool initdone = false;
__gshared char[11 + 1] date;
__gshared char[8 + 1] time;
__gshared char[24 + 1] timestamp;
if (!initdone) // lazy evaluation
{
initdone = true;
time_t ct;
.time(&ct);
char* p = ctime(&ct);
assert(p);
sprintf(&date[0], "%.6s %.4s", p + 4, p + 20);
sprintf(&time[0], "%.8s", p + 11);
sprintf(×tamp[0], "%.24s", p);
}
if (id == Id.DATE)
{
t.ustring = cast(char*)date;
goto Lstr;
}
else if (id == Id.TIME)
{
t.ustring = cast(char*)time;
goto Lstr;
}
else if (id == Id.VENDOR)
{
t.ustring = cast(char*)global.compiler.vendor;
goto Lstr;
}
else if (id == Id.TIMESTAMP)
{
t.ustring = cast(char*)timestamp;
Lstr:
t.value = TOKstring;
t.postfix = 0;
t.len = cast(uint)strlen(cast(char*)t.ustring);
}
else if (id == Id.VERSIONX)
{
uint major = 0;
uint minor = 0;
bool point = false;
for (const(char)* p = global._version + 1; 1; p++)
{
c = *p;
if (isdigit(cast(char)c))
minor = minor * 10 + c - '0';
else if (c == '.')
{
if (point)
break;
// ignore everything after second '.'
point = true;
major = minor;
minor = 0;
}
else
break;
}
t.value = TOKint64v;
t.uns64value = major * 1000 + minor;
}
else if (id == Id.EOFX)
{
t.value = TOKeof;
// Advance scanner to end of file
while (!(*p == 0 || *p == 0x1A))
p++;
}
}
//printf("t->value = %d\n",t->value);
return;
}
case '/':
p++;
switch (*p)
{
case '=':
p++;
t.value = TOKdivass;
return;
case '*':
p++;
startLoc = loc();
while (1)
{
while (1)
{
char c = *p;
switch (c)
{
case '/':
break;
case '\n':
endOfLine();
p++;
continue;
case '\r':
p++;
if (*p != '\n')
endOfLine();
continue;
case 0:
case 0x1A:
error("unterminated /* */ comment");
p = end;
t.loc = loc();
t.value = TOKeof;
return;
default:
if (c & 0x80)
{
uint u = decodeUTF();
if (u == PS || u == LS)
endOfLine();
}
p++;
continue;
}
break;
}
p++;
if (p[-2] == '*' && p - 3 != t.ptr)
break;
}
if (commentToken)
{
t.loc = startLoc;
t.value = TOKcomment;
return;
}
else if (doDocComment && t.ptr[2] == '*' && p - 4 != t.ptr)
{
// if /** but not /**/
getDocComment(t, lastLine == startLoc.linnum);
}
continue;
case '/':
// do // style comments
startLoc = loc();
while (1)
{
char c = *++p;
switch (c)
{
case '\n':
break;
case '\r':
if (p[1] == '\n')
p++;
break;
case 0:
case 0x1A:
if (commentToken)
{
p = end;
t.loc = startLoc;
t.value = TOKcomment;
return;
}
if (doDocComment && t.ptr[2] == '/')
getDocComment(t, lastLine == startLoc.linnum);
p = end;
t.loc = loc();
t.value = TOKeof;
return;
default:
if (c & 0x80)
{
uint u = decodeUTF();
if (u == PS || u == LS)
break;
}
continue;
}
break;
}
if (commentToken)
{
p++;
endOfLine();
t.loc = startLoc;
t.value = TOKcomment;
return;
}
if (doDocComment && t.ptr[2] == '/')
getDocComment(t, lastLine == startLoc.linnum);
p++;
endOfLine();
continue;
case '+':
{
int nest;
startLoc = loc();
p++;
nest = 1;
while (1)
{
char c = *p;
switch (c)
{
case '/':
p++;
if (*p == '+')
{
p++;
nest++;
}
continue;
case '+':
p++;
if (*p == '/')
{
p++;
if (--nest == 0)
break;
}
continue;
case '\r':
p++;
if (*p != '\n')
endOfLine();
continue;
case '\n':
endOfLine();
p++;
continue;
case 0:
case 0x1A:
error("unterminated /+ +/ comment");
p = end;
t.loc = loc();
t.value = TOKeof;
return;
default:
if (c & 0x80)
{
uint u = decodeUTF();
if (u == PS || u == LS)
endOfLine();
}
p++;
continue;
}
break;
}
if (commentToken)
{
t.loc = startLoc;
t.value = TOKcomment;
return;
}
if (doDocComment && t.ptr[2] == '+' && p - 4 != t.ptr)
{
// if /++ but not /++/
getDocComment(t, lastLine == startLoc.linnum);
}
continue;
}
default:
break;
}
t.value = TOKdiv;
return;
case '.':
p++;
if (isdigit(*p))
{
/* Note that we don't allow ._1 and ._ as being
* valid floating point numbers.
*/
p--;
t.value = inreal(t);
}
else if (p[0] == '.')
{
if (p[1] == '.')
{
p += 2;
t.value = TOKdotdotdot;
}
else
{
p++;
t.value = TOKslice;
}
}
else
t.value = TOKdot;
return;
case '&':
p++;
if (*p == '=')
{
p++;
t.value = TOKandass;
}
else if (*p == '&')
{
p++;
t.value = TOKandand;
}
else
t.value = TOKand;
return;
case '|':
p++;
if (*p == '=')
{
p++;
t.value = TOKorass;
}
else if (*p == '|')
{
p++;
t.value = TOKoror;
}
else
t.value = TOKor;
return;
case '-':
p++;
if (*p == '=')
{
p++;
t.value = TOKminass;
}
else if (*p == '-')
{
p++;
t.value = TOKminusminus;
}
else
t.value = TOKmin;
return;
case '+':
p++;
if (*p == '=')
{
p++;
t.value = TOKaddass;
}
else if (*p == '+')
{
p++;
t.value = TOKplusplus;
}
else
t.value = TOKadd;
return;
case '<':
p++;
if (*p == '=')
{
p++;
t.value = TOKle; // <=
}
else if (*p == '<')
{
p++;
if (*p == '=')
{
p++;
t.value = TOKshlass; // <<=
}
else
t.value = TOKshl; // <<
}
else if (*p == '>')
{
p++;
if (*p == '=')
{
p++;
t.value = TOKleg; // <>=
}
else
t.value = TOKlg; // <>
}
else
t.value = TOKlt; // <
return;
case '>':
p++;
if (*p == '=')
{
p++;
t.value = TOKge; // >=
}
else if (*p == '>')
{
p++;
if (*p == '=')
{
p++;
t.value = TOKshrass; // >>=
}
else if (*p == '>')
{
p++;
if (*p == '=')
{
p++;
t.value = TOKushrass; // >>>=
}
else
t.value = TOKushr; // >>>
}
else
t.value = TOKshr; // >>
}
else
t.value = TOKgt; // >
return;
case '!':
p++;
if (*p == '=')
{
p++;
t.value = TOKnotequal; // !=
}
else if (*p == '<')
{
p++;
if (*p == '>')
{
p++;
if (*p == '=')
{
p++;
t.value = TOKunord; // !<>=
}
else
t.value = TOKue; // !<>
}
else if (*p == '=')
{
p++;
t.value = TOKug; // !<=
}
else
t.value = TOKuge; // !<
}
else if (*p == '>')
{
p++;
if (*p == '=')
{
p++;
t.value = TOKul; // !>=
}
else
t.value = TOKule; // !>
}
else
t.value = TOKnot; // !
return;
case '=':
p++;
if (*p == '=')
{
p++;
t.value = TOKequal; // ==
}
else if (*p == '>')
{
p++;
t.value = TOKgoesto; // =>
}
else
t.value = TOKassign; // =
return;
case '~':
p++;
if (*p == '=')
{
p++;
t.value = TOKcatass; // ~=
}
else
t.value = TOKtilde; // ~
return;
case '^':
p++;
if (*p == '^')
{
p++;
if (*p == '=')
{
p++;
t.value = TOKpowass; // ^^=
}
else
t.value = TOKpow; // ^^
}
else if (*p == '=')
{
p++;
t.value = TOKxorass; // ^=
}
else
t.value = TOKxor; // ^
return;
case '(':
p++;
t.value = TOKlparen;
return;
case ')':
p++;
t.value = TOKrparen;
return;
case '[':
p++;
t.value = TOKlbracket;
return;
case ']':
p++;
t.value = TOKrbracket;
return;
case '{':
p++;
t.value = TOKlcurly;
return;
case '}':
p++;
t.value = TOKrcurly;
return;
case '?':
p++;
t.value = TOKquestion;
return;
case ',':
p++;
t.value = TOKcomma;
return;
case ';':
p++;
t.value = TOKsemicolon;
return;
case ':':
p++;
t.value = TOKcolon;
return;
case '$':
p++;
t.value = TOKdollar;
return;
case '@':
p++;
t.value = TOKat;
return;
case '*':
p++;
if (*p == '=')
{
p++;
t.value = TOKmulass;
}
else
t.value = TOKmul;
return;
case '%':
p++;
if (*p == '=')
{
p++;
t.value = TOKmodass;
}
else
t.value = TOKmod;
return;
case '#':
{
p++;
Token n;
scan(&n);
if (n.value == TOKidentifier && n.ident == Id.line)
{
poundLine();
continue;
}
else
{
t.value = TOKpound;
return;
}
}
default:
{
uint c = *p;
if (c & 0x80)
{
c = decodeUTF();
// Check for start of unicode identifier
if (isUniAlpha(c))
goto case_ident;
if (c == PS || c == LS)
{
endOfLine();
p++;
continue;
}
}
if (c < 0x80 && isprint(c))
error("character '%c' is not a valid token", c);
else
error("character 0x%02x is not a valid token", c);
p++;
continue;
}
}
}
}
final Token* peek(Token* ct)
{
Token* t;
if (ct.next)
t = ct.next;
else
{
t = Token.alloc();
scan(t);
ct.next = t;
}
return t;
}
/*********************************
* tk is on the opening (.
* Look ahead and return token that is past the closing ).
*/
final Token* peekPastParen(Token* tk)
{
//printf("peekPastParen()\n");
int parens = 1;
int curlynest = 0;
while (1)
{
tk = peek(tk);
//tk->print();
switch (tk.value)
{
case TOKlparen:
parens++;
continue;
case TOKrparen:
--parens;
if (parens)
continue;
tk = peek(tk);
break;
case TOKlcurly:
curlynest++;
continue;
case TOKrcurly:
if (--curlynest >= 0)
continue;
break;
case TOKsemicolon:
if (curlynest)
continue;
break;
case TOKeof:
break;
default:
continue;
}
return tk;
}
}
/*******************************************
* Parse escape sequence.
*/
final uint escapeSequence()
{
uint c = *p;
int n;
int ndigits;
switch (c)
{
case '\'':
case '"':
case '?':
case '\\':
Lconsume:
p++;
break;
case 'a':
c = 7;
goto Lconsume;
case 'b':
c = 8;
goto Lconsume;
case 'f':
c = 12;
goto Lconsume;
case 'n':
c = 10;
goto Lconsume;
case 'r':
c = 13;
goto Lconsume;
case 't':
c = 9;
goto Lconsume;
case 'v':
c = 11;
goto Lconsume;
case 'u':
ndigits = 4;
goto Lhex;
case 'U':
ndigits = 8;
goto Lhex;
case 'x':
ndigits = 2;
Lhex:
p++;
c = *p;
if (ishex(cast(char)c))
{
uint v;
n = 0;
v = 0;
while (1)
{
if (isdigit(cast(char)c))
c -= '0';
else if (islower(c))
c -= 'a' - 10;
else
c -= 'A' - 10;
v = v * 16 + c;
c = *++p;
if (++n == ndigits)
break;
if (!ishex(cast(char)c))
{
error("escape hex sequence has %d hex digits instead of %d", n, ndigits);
break;
}
}
if (ndigits != 2 && !utf_isValidDchar(v))
{
error("invalid UTF character \\U%08x", v);
v = '?'; // recover with valid UTF character
}
c = v;
}
else
error("undefined escape hex sequence \\%c", c);
break;
case '&':
// named character entity
for (const(char)* idstart = ++p; 1; p++)
{
switch (*p)
{
case ';':
c = HtmlNamedEntity(idstart, p - idstart);
if (c == ~0)
{
error("unnamed character entity &%.*s;", cast(int)(p - idstart), idstart);
c = ' ';
}
p++;
break;
default:
if (isalpha(*p) || (p != idstart && isdigit(*p)))
continue;
error("unterminated named entity &%.*s;", cast(int)(p - idstart + 1), idstart);
break;
}
break;
}
break;
case 0:
case 0x1A:
// end of file
c = '\\';
break;
default:
if (isoctal(cast(char)c))
{
uint v;
n = 0;
v = 0;
do
{
v = v * 8 + (c - '0');
c = *++p;
}
while (++n < 3 && isoctal(cast(char)c));
c = v;
if (c > 0xFF)
error("escape octal sequence \\%03o is larger than \\377", c);
}
else
error("undefined escape sequence \\%c", c);
break;
}
return c;
}
/**************************************
*/
final TOK wysiwygStringConstant(Token* t, int tc)
{
uint c;
Loc start = loc();
p++;
stringbuffer.reset();
while (1)
{
c = *p++;
switch (c)
{
case '\n':
endOfLine();
break;
case '\r':
if (*p == '\n')
continue;
// ignore
c = '\n'; // treat EndOfLine as \n character
endOfLine();
break;
case 0:
case 0x1A:
error("unterminated string constant starting at %s", start.toChars());
t.ustring = cast(char*)"";
t.len = 0;
t.postfix = 0;
return TOKstring;
case '"':
case '`':
if (c == tc)
{
t.len = cast(uint)stringbuffer.offset;
stringbuffer.writeByte(0);
t.ustring = cast(char*)mem.xmalloc(stringbuffer.offset);
memcpy(t.ustring, stringbuffer.data, stringbuffer.offset);
stringPostfix(t);
return TOKstring;
}
break;
default:
if (c & 0x80)
{
p--;
uint u = decodeUTF();
p++;
if (u == PS || u == LS)
endOfLine();
stringbuffer.writeUTF8(u);
continue;
}
break;
}
stringbuffer.writeByte(c);
}
}
/**************************************
* Lex hex strings:
* x"0A ae 34FE BD"
*/
final TOK hexStringConstant(Token* t)
{
uint c;
Loc start = loc();
uint n = 0;
uint v = ~0; // dead assignment, needed to suppress warning
p++;
stringbuffer.reset();
while (1)
{
c = *p++;
switch (c)
{
case ' ':
case '\t':
case '\v':
case '\f':
continue;
// skip white space
case '\r':
if (*p == '\n')
continue;
// ignore
// Treat isolated '\r' as if it were a '\n'
case '\n':
endOfLine();
continue;
case 0:
case 0x1A:
error("unterminated string constant starting at %s", start.toChars());
t.ustring = cast(char*)"";
t.len = 0;
t.postfix = 0;
return TOKxstring;
case '"':
if (n & 1)
{
error("odd number (%d) of hex characters in hex string", n);
stringbuffer.writeByte(v);
}
t.len = cast(uint)stringbuffer.offset;
stringbuffer.writeByte(0);
t.ustring = cast(char*)mem.xmalloc(stringbuffer.offset);
memcpy(t.ustring, stringbuffer.data, stringbuffer.offset);
stringPostfix(t);
return TOKxstring;
default:
if (c >= '0' && c <= '9')
c -= '0';
else if (c >= 'a' && c <= 'f')
c -= 'a' - 10;
else if (c >= 'A' && c <= 'F')
c -= 'A' - 10;
else if (c & 0x80)
{
p--;
uint u = decodeUTF();
p++;
if (u == PS || u == LS)
endOfLine();
else
error("non-hex character \\u%04x in hex string", u);
}
else
error("non-hex character '%c' in hex string", c);
if (n & 1)
{
v = (v << 4) | c;
stringbuffer.writeByte(v);
}
else
v = c;
n++;
break;
}
}
}
/**************************************
* Lex delimited strings:
* q"(foo(xxx))" // "foo(xxx)"
* q"[foo(]" // "foo("
* q"/foo]/" // "foo]"
* q"HERE
* foo
* HERE" // "foo\n"
* Input:
* p is on the "
*/
final TOK delimitedStringConstant(Token* t)
{
uint c;
Loc start = loc();
uint delimleft = 0;
uint delimright = 0;
uint nest = 1;
uint nestcount = ~0; // dead assignment, needed to suppress warning
Identifier hereid = null;
uint blankrol = 0;
uint startline = 0;
p++;
stringbuffer.reset();
while (1)
{
c = *p++;
//printf("c = '%c'\n", c);
switch (c)
{
case '\n':
Lnextline:
endOfLine();
startline = 1;
if (blankrol)
{
blankrol = 0;
continue;
}
if (hereid)
{
stringbuffer.writeUTF8(c);
continue;
}
break;
case '\r':
if (*p == '\n')
continue;
// ignore
c = '\n'; // treat EndOfLine as \n character
goto Lnextline;
case 0:
case 0x1A:
error("unterminated delimited string constant starting at %s", start.toChars());
t.ustring = cast(char*)"";
t.len = 0;
t.postfix = 0;
return TOKstring;
default:
if (c & 0x80)
{
p--;
c = decodeUTF();
p++;
if (c == PS || c == LS)
goto Lnextline;
}
break;
}
if (delimleft == 0)
{
delimleft = c;
nest = 1;
nestcount = 1;
if (c == '(')
delimright = ')';
else if (c == '{')
delimright = '}';
else if (c == '[')
delimright = ']';
else if (c == '<')
delimright = '>';
else if (isalpha(c) || c == '_' || (c >= 0x80 && isUniAlpha(c)))
{
// Start of identifier; must be a heredoc
Token tok;
p--;
scan(&tok); // read in heredoc identifier
if (tok.value != TOKidentifier)
{
error("identifier expected for heredoc, not %s", tok.toChars());
delimright = c;
}
else
{
hereid = tok.ident;
//printf("hereid = '%s'\n", hereid->toChars());
blankrol = 1;
}
nest = 0;
}
else
{
delimright = c;
nest = 0;
if (isspace(c))
error("delimiter cannot be whitespace");
}
}
else
{
if (blankrol)
{
error("heredoc rest of line should be blank");
blankrol = 0;
continue;
}
if (nest == 1)
{
if (c == delimleft)
nestcount++;
else if (c == delimright)
{
nestcount--;
if (nestcount == 0)
goto Ldone;
}
}
else if (c == delimright)
goto Ldone;
if (startline && isalpha(c) && hereid)
{
Token tok;
auto psave = p;
p--;
scan(&tok); // read in possible heredoc identifier
//printf("endid = '%s'\n", tok.ident->toChars());
if (tok.value == TOKidentifier && tok.ident.equals(hereid))
{
/* should check that rest of line is blank
*/
goto Ldone;
}
p = psave;
}
stringbuffer.writeUTF8(c);
startline = 0;
}
}
Ldone:
if (*p == '"')
p++;
else if (hereid)
error("delimited string must end in %s\"", hereid.toChars());
else
error("delimited string must end in %c\"", delimright);
t.len = cast(uint)stringbuffer.offset;
stringbuffer.writeByte(0);
t.ustring = cast(char*)mem.xmalloc(stringbuffer.offset);
memcpy(t.ustring, stringbuffer.data, stringbuffer.offset);
stringPostfix(t);
return TOKstring;
}
/**************************************
* Lex delimited strings:
* q{ foo(xxx) } // " foo(xxx) "
* q{foo(} // "foo("
* q{{foo}"}"} // "{foo}"}""
* Input:
* p is on the q
*/
final TOK tokenStringConstant(Token* t)
{
uint nest = 1;
Loc start = loc();
const(char)* pstart = ++p;
while (1)
{
Token tok;
scan(&tok);
switch (tok.value)
{
case TOKlcurly:
nest++;
continue;
case TOKrcurly:
if (--nest == 0)
{
t.len = cast(uint)(p - 1 - pstart);
t.ustring = cast(char*)mem.xmalloc(t.len + 1);
memcpy(t.ustring, pstart, t.len);
t.ustring[t.len] = 0;
stringPostfix(t);
return TOKstring;
}
continue;
case TOKeof:
error("unterminated token string constant starting at %s", start.toChars());
t.ustring = cast(char*)"";
t.len = 0;
t.postfix = 0;
return TOKstring;
default:
continue;
}
}
}
/**************************************
*/
final TOK escapeStringConstant(Token* t, int wide)
{
uint c;
Loc start = loc();
p++;
stringbuffer.reset();
while (1)
{
c = *p++;
switch (c)
{
case '\\':
switch (*p)
{
case 'u':
case 'U':
case '&':
c = escapeSequence();
stringbuffer.writeUTF8(c);
continue;
default:
c = escapeSequence();
break;
}
break;
case '\n':
endOfLine();
break;
case '\r':
if (*p == '\n')
continue;
// ignore
c = '\n'; // treat EndOfLine as \n character
endOfLine();
break;
case '"':
t.len = cast(uint)stringbuffer.offset;
stringbuffer.writeByte(0);
t.ustring = cast(char*)mem.xmalloc(stringbuffer.offset);
memcpy(t.ustring, stringbuffer.data, stringbuffer.offset);
stringPostfix(t);
return TOKstring;
case 0:
case 0x1A:
p--;
error("unterminated string constant starting at %s", start.toChars());
t.ustring = cast(char*)"";
t.len = 0;
t.postfix = 0;
return TOKstring;
default:
if (c & 0x80)
{
p--;
c = decodeUTF();
if (c == LS || c == PS)
{
c = '\n';
endOfLine();
}
p++;
stringbuffer.writeUTF8(c);
continue;
}
break;
}
stringbuffer.writeByte(c);
}
}
/**************************************
*/
final TOK charConstant(Token* t)
{
uint c;
TOK tk = TOKcharv;
//printf("Lexer::charConstant\n");
p++;
c = *p++;
switch (c)
{
case '\\':
switch (*p)
{
case 'u':
t.uns64value = escapeSequence();
tk = TOKwcharv;
break;
case 'U':
case '&':
t.uns64value = escapeSequence();
tk = TOKdcharv;
break;
default:
t.uns64value = escapeSequence();
break;
}
break;
case '\n':
L1:
endOfLine();
case '\r':
case 0:
case 0x1A:
case '\'':
error("unterminated character constant");
t.uns64value = '?';
return tk;
default:
if (c & 0x80)
{
p--;
c = decodeUTF();
p++;
if (c == LS || c == PS)
goto L1;
if (c < 0xD800 || (c >= 0xE000 && c < 0xFFFE))
tk = TOKwcharv;
else
tk = TOKdcharv;
}
t.uns64value = c;
break;
}
if (*p != '\'')
{
error("unterminated character constant");
t.uns64value = '?';
return tk;
}
p++;
return tk;
}
/***************************************
* Get postfix of string literal.
*/
final void stringPostfix(Token* t)
{
switch (*p)
{
case 'c':
case 'w':
case 'd':
t.postfix = *p;
p++;
break;
default:
t.postfix = 0;
break;
}
}
/**************************************
* Read in a number.
* If it's an integer, store it in tok.TKutok.Vlong.
* integers can be decimal, octal or hex
* Handle the suffixes U, UL, LU, L, etc.
* If it's double, store it in tok.TKutok.Vdouble.
* Returns:
* TKnum
* TKdouble,...
*/
final TOK number(Token* t)
{
int base = 10;
const(char)* start = p;
uint c;
uinteger_t n = 0; // unsigned >=64 bit integer type
int d;
bool err = false;
bool overflow = false;
c = *p;
if (c == '0')
{
++p;
c = *p;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
n = c - '0';
++p;
base = 8;
break;
case 'x':
case 'X':
++p;
base = 16;
break;
case 'b':
case 'B':
++p;
base = 2;
break;
case '.':
if (p[1] == '.')
goto Ldone;
// if ".."
if (isalpha(p[1]) || p[1] == '_' || p[1] & 0x80)
goto Ldone;
// if ".identifier" or ".unicode"
goto Lreal;
// '.' is part of current token
case 'i':
case 'f':
case 'F':
goto Lreal;
case '_':
++p;
base = 8;
break;
case 'L':
if (p[1] == 'i')
goto Lreal;
break;
default:
break;
}
}
while (1)
{
c = *p;
switch (c)
{
case '0':
case '1':
++p;
d = c - '0';
break;
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
if (base == 2 && !err)
{
error("binary digit expected");
err = true;
}
++p;
d = c - '0';
break;
case '8':
case '9':
++p;
if (base < 10 && !err)
{
error("radix %d digit expected, not '%c'", base, c);
err = true;
}
d = c - '0';
break;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
++p;
if (base != 16)
{
if (c == 'e' || c == 'E' || c == 'f' || c == 'F')
goto Lreal;
if (!err)
{
error("radix %d digit expected, not '%c'", base, c);
err = true;
}
}
if (c >= 'a')
d = c + 10 - 'a';
else
d = c + 10 - 'A';
break;
case 'L':
if (p[1] == 'i')
goto Lreal;
goto Ldone;
case '.':
if (p[1] == '.')
goto Ldone;
// if ".."
if (base == 10 && (isalpha(p[1]) || p[1] == '_' || p[1] & 0x80))
goto Ldone;
// if ".identifier" or ".unicode"
goto Lreal;
// otherwise as part of a floating point literal
case 'p':
case 'P':
case 'i':
Lreal:
p = start;
return inreal(t);
case '_':
++p;
continue;
default:
goto Ldone;
}
// Avoid expensive overflow check if we aren't at risk of overflow
if (n <= 0x0FFF_FFFF_FFFF_FFFFUL)
n = n * base + d;
else
{
import core.checkedint;
n = mulu(n, base, overflow);
n = addu(n, d, overflow);
}
}
Ldone:
if (overflow && !err)
{
error("integer overflow");
err = true;
}
enum FLAGS : int
{
FLAGS_none = 0,
FLAGS_decimal = 1, // decimal
FLAGS_unsigned = 2, // u or U suffix
FLAGS_long = 4, // L suffix
}
alias FLAGS_none = FLAGS.FLAGS_none;
alias FLAGS_decimal = FLAGS.FLAGS_decimal;
alias FLAGS_unsigned = FLAGS.FLAGS_unsigned;
alias FLAGS_long = FLAGS.FLAGS_long;
FLAGS flags = (base == 10) ? FLAGS_decimal : FLAGS_none;
// Parse trailing 'u', 'U', 'l' or 'L' in any combination
const(char)* psuffix = p;
while (1)
{
char f;
switch (*p)
{
case 'U':
case 'u':
f = FLAGS_unsigned;
goto L1;
case 'l':
f = FLAGS_long;
error("lower case integer suffix 'l' is not allowed. Please use 'L' instead");
goto L1;
case 'L':
f = FLAGS_long;
L1:
p++;
if ((flags & f) && !err)
{
error("unrecognized token");
err = true;
}
flags = cast(FLAGS)(flags | f);
continue;
default:
break;
}
break;
}
if (base == 8 && n >= 8)
error("octal literals 0%llo%.*s are no longer supported, use std.conv.octal!%llo%.*s instead", n, p - psuffix, psuffix, n, p - psuffix, psuffix);
TOK result;
switch (flags)
{
case FLAGS_none:
/* Octal or Hexadecimal constant.
* First that fits: int, uint, long, ulong
*/
if (n & 0x8000000000000000L)
result = TOKuns64v;
else if (n & 0xFFFFFFFF00000000L)
result = TOKint64v;
else if (n & 0x80000000)
result = TOKuns32v;
else
result = TOKint32v;
break;
case FLAGS_decimal:
/* First that fits: int, long, long long
*/
if (n & 0x8000000000000000L)
{
if (!err)
{
error("signed integer overflow");
err = true;
}
result = TOKuns64v;
}
else if (n & 0xFFFFFFFF80000000L)
result = TOKint64v;
else
result = TOKint32v;
break;
case FLAGS_unsigned:
case FLAGS_decimal | FLAGS_unsigned:
/* First that fits: uint, ulong
*/
if (n & 0xFFFFFFFF00000000L)
result = TOKuns64v;
else
result = TOKuns32v;
break;
case FLAGS_decimal | FLAGS_long:
if (n & 0x8000000000000000L)
{
if (!err)
{
error("signed integer overflow");
err = true;
}
result = TOKuns64v;
}
else
result = TOKint64v;
break;
case FLAGS_long:
if (n & 0x8000000000000000L)
result = TOKuns64v;
else
result = TOKint64v;
break;
case FLAGS_unsigned | FLAGS_long:
case FLAGS_decimal | FLAGS_unsigned | FLAGS_long:
result = TOKuns64v;
break;
default:
debug
{
printf("%x\n", flags);
}
assert(0);
}
t.uns64value = n;
return result;
}
/**************************************
* Read in characters, converting them to real.
* Bugs:
* Exponent overflow not detected.
* Too much requested precision is not detected.
*/
final TOK inreal(Token* t)
{
//printf("Lexer::inreal()\n");
debug
{
assert(*p == '.' || isdigit(*p));
}
stringbuffer.reset();
const(char)* pstart = p;
char hex = 0;
uint c = *p++;
// Leading '0x'
if (c == '0')
{
c = *p++;
if (c == 'x' || c == 'X')
{
hex = true;
c = *p++;
}
}
// Digits to left of '.'
while (1)
{
if (c == '.')
{
c = *p++;
break;
}
if (isdigit(c) || (hex && isxdigit(c)) || c == '_')
{
c = *p++;
continue;
}
break;
}
// Digits to right of '.'
while (1)
{
if (isdigit(c) || (hex && isxdigit(c)) || c == '_')
{
c = *p++;
continue;
}
break;
}
if (c == 'e' || c == 'E' || (hex && (c == 'p' || c == 'P')))
{
c = *p++;
if (c == '-' || c == '+')
{
c = *p++;
}
bool anyexp = false;
while (1)
{
if (isdigit(c))
{
anyexp = true;
c = *p++;
continue;
}
if (c == '_')
{
c = *p++;
continue;
}
if (!anyexp)
error("missing exponent");
break;
}
}
else if (hex)
error("exponent required for hex float");
--p;
while (pstart < p)
{
if (*pstart != '_')
stringbuffer.writeByte(*pstart);
++pstart;
}
stringbuffer.writeByte(0);
TOK result;
t.float80value = Port.strtold(cast(char*)stringbuffer.data, null);
errno = 0;
switch (*p)
{
case 'F':
case 'f':
// Only interested in errno return
cast(void)Port.strtof(cast(char*)stringbuffer.data, null);
result = TOKfloat32v;
p++;
break;
default:
/* Should do our own strtod(), since dmc and linux gcc
* accept 2.22507e-308, while apple gcc will only take
* 2.22508e-308. Not sure who is right.
*/
// Only interested in errno return
cast(void)Port.strtod(cast(char*)stringbuffer.data, null);
result = TOKfloat64v;
break;
case 'l':
error("use 'L' suffix instead of 'l'");
case 'L':
result = TOKfloat80v;
p++;
break;
}
if (*p == 'i' || *p == 'I')
{
if (*p == 'I')
error("use 'i' suffix instead of 'I'");
p++;
switch (result)
{
case TOKfloat32v:
result = TOKimaginary32v;
break;
case TOKfloat64v:
result = TOKimaginary64v;
break;
case TOKfloat80v:
result = TOKimaginary80v;
break;
default:
break;
}
}
if (errno == ERANGE)
{
const(char)* suffix = (result == TOKfloat32v || result == TOKimaginary32v) ? "f" : "";
error(scanloc, "number '%s%s' is not representable", cast(char*)stringbuffer.data, suffix);
}
debug
{
switch (result)
{
case TOKfloat32v:
case TOKfloat64v:
case TOKfloat80v:
case TOKimaginary32v:
case TOKimaginary64v:
case TOKimaginary80v:
break;
default:
assert(0);
}
}
return result;
}
final Loc loc()
{
scanloc.charnum = cast(uint)(1 + p - line);
return scanloc;
}
final void error(const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.verror(token.loc, format, ap);
va_end(ap);
errors = true;
}
final void error(Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.verror(loc, format, ap);
va_end(ap);
errors = true;
}
final void deprecation(const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
.vdeprecation(token.loc, format, ap);
va_end(ap);
if (global.params.useDeprecated == 0)
errors = true;
}
/*********************************************
* parse:
* #line linnum [filespec]
* also allow __LINE__ for linnum, and __FILE__ for filespec
*/
final void poundLine()
{
Token tok;
int linnum = this.scanloc.linnum;
char* filespec = null;
Loc loc = this.loc();
scan(&tok);
if (tok.value == TOKint32v || tok.value == TOKint64v)
{
int lin = cast(int)(tok.uns64value - 1);
if (lin != tok.uns64value - 1)
error("line number %lld out of range", cast(ulong)tok.uns64value);
else
linnum = lin;
}
else if (tok.value == TOKline)
{
}
else
goto Lerr;
while (1)
{
switch (*p)
{
case 0:
case 0x1A:
case '\n':
Lnewline:
this.scanloc.linnum = linnum;
if (filespec)
this.scanloc.filename = filespec;
return;
case '\r':
p++;
if (*p != '\n')
{
p--;
goto Lnewline;
}
continue;
case ' ':
case '\t':
case '\v':
case '\f':
p++;
continue;
// skip white space
case '_':
if (memcmp(p, cast(char*)"__FILE__", 8) == 0)
{
p += 8;
filespec = mem.xstrdup(scanloc.filename);
continue;
}
goto Lerr;
case '"':
if (filespec)
goto Lerr;
stringbuffer.reset();
p++;
while (1)
{
uint c;
c = *p;
switch (c)
{
case '\n':
case '\r':
case 0:
case 0x1A:
goto Lerr;
case '"':
stringbuffer.writeByte(0);
filespec = mem.xstrdup(cast(char*)stringbuffer.data);
p++;
break;
default:
if (c & 0x80)
{
uint u = decodeUTF();
if (u == PS || u == LS)
goto Lerr;
}
stringbuffer.writeByte(c);
p++;
continue;
}
break;
}
continue;
default:
if (*p & 0x80)
{
uint u = decodeUTF();
if (u == PS || u == LS)
goto Lnewline;
}
goto Lerr;
}
}
Lerr:
error(loc, "#line integer [\"filespec\"]\\n expected");
}
/********************************************
* Decode UTF character.
* Issue error messages for invalid sequences.
* Return decoded character, advance p to last character in UTF sequence.
*/
final uint decodeUTF()
{
dchar_t u;
char c;
const(char)* s = p;
size_t len;
size_t idx;
const(char)* msg;
c = *s;
assert(c & 0x80);
// Check length of remaining string up to 6 UTF-8 characters
for (len = 1; len < 6 && s[len]; len++)
{
}
idx = 0;
msg = utf_decodeChar(s, len, &idx, &u);
p += idx - 1;
if (msg)
{
error("%s", msg);
}
return u;
}
/***************************************************
* Parse doc comment embedded between t->ptr and p.
* Remove trailing blanks and tabs from lines.
* Replace all newlines with \n.
* Remove leading comment character from each line.
* Decide if it's a lineComment or a blockComment.
* Append to previous one for this token.
*/
final void getDocComment(Token* t, uint lineComment)
{
/* ct tells us which kind of comment it is: '/', '*', or '+'
*/
char ct = t.ptr[2];
/* Start of comment text skips over / * *, / + +, or / / /
*/
const(char)* q = t.ptr + 3; // start of comment text
const(char)* qend = p;
if (ct == '*' || ct == '+')
qend -= 2;
/* Scan over initial row of ****'s or ++++'s or ////'s
*/
for (; q < qend; q++)
{
if (*q != ct)
break;
}
/* Remove leading spaces until start of the comment
*/
int linestart = 0;
if (ct == '/')
{
while (q < qend && (*q == ' ' || *q == '\t'))
++q;
}
else if (q < qend)
{
if (*q == '\r')
{
++q;
if (q < qend && *q == '\n')
++q;
linestart = 1;
}
else if (*q == '\n')
{
++q;
linestart = 1;
}
}
/* Remove trailing row of ****'s or ++++'s
*/
if (ct != '/')
{
for (; q < qend; qend--)
{
if (qend[-1] != ct)
break;
}
}
/* Comment is now [q .. qend].
* Canonicalize it into buf[].
*/
OutBuffer buf;
for (; q < qend; q++)
{
char c = *q;
switch (c)
{
case '*':
case '+':
if (linestart && c == ct)
{
linestart = 0;
/* Trim preceding whitespace up to preceding \n
*/
while (buf.offset && (buf.data[buf.offset - 1] == ' ' || buf.data[buf.offset - 1] == '\t'))
buf.offset--;
continue;
}
break;
case ' ':
case '\t':
break;
case '\r':
if (q[1] == '\n')
continue;
// skip the \r
goto Lnewline;
default:
if (c == 226)
{
// If LS or PS
if (q[1] == 128 && (q[2] == 168 || q[2] == 169))
{
q += 2;
goto Lnewline;
}
}
linestart = 0;
break;
Lnewline:
c = '\n'; // replace all newlines with \n
case '\n':
linestart = 1;
/* Trim trailing whitespace
*/
while (buf.offset && (buf.data[buf.offset - 1] == ' ' || buf.data[buf.offset - 1] == '\t'))
buf.offset--;
break;
}
buf.writeByte(c);
}
/* Trim trailing whitespace (if the last line does not have newline)
*/
if (buf.offset && (buf.data[buf.offset - 1] == ' ' || buf.data[buf.offset - 1] == '\t'))
{
while (buf.offset && (buf.data[buf.offset - 1] == ' ' || buf.data[buf.offset - 1] == '\t'))
buf.offset--;
}
// Always end with a newline
if (!buf.offset || buf.data[buf.offset - 1] != '\n')
buf.writeByte('\n');
buf.writeByte(0);
// It's a line comment if the start of the doc comment comes
// after other non-whitespace on the same line.
const(char)** dc = (lineComment && anyToken) ? &t.lineComment : &t.blockComment;
// Combine with previous doc comment, if any
if (*dc)
*dc = combineComments(*dc, cast(char*)buf.data);
else
*dc = cast(char*)buf.extractData();
}
/********************************************
* Combine two document comments into one,
* separated by a newline.
*/
final static const(char)* combineComments(const(char)* c1, const(char)* c2)
{
//printf("Lexer::combineComments('%s', '%s')\n", c1, c2);
const(char)* c = c2;
if (c1)
{
c = c1;
if (c2)
{
size_t len1 = strlen(cast(char*)c1);
size_t len2 = strlen(cast(char*)c2);
int insertNewLine = 0;
if (len1 && c1[len1 - 1] != '\n')
{
++len1;
insertNewLine = 1;
}
char* p = cast(char*)mem.xmalloc(len1 + 1 + len2 + 1);
memcpy(p, c1, len1 - insertNewLine);
if (insertNewLine)
p[len1 - 1] = '\n';
p[len1] = '\n';
memcpy(p + len1 + 1, c2, len2);
p[len1 + 1 + len2] = 0;
c = p;
}
}
return c;
}
private:
final void endOfLine()
{
scanloc.linnum++;
line = p;
}
}
|
D
|
module game.misc;
import std.algorithm : filter;
import std.file : DirEntry, dirEntries, SpanMode;
import std.array : array, split, join;
import game.player : Player;
DirEntry[] filesInFolder(string folder)
{
return dirEntries(folder, SpanMode.breadth).filter!(a => a.isFile()).array();
}
DirEntry[] foldersInFolder(string folder)
{
return dirEntries(folder, SpanMode.breadth).filter!(a => !a.isFile()).array();
}
string filenameFromFilePath(string fp)
{
return fp.split("\\")[$ - 1];
}
void deleteFile(string path)
{
import std.file : remove;
import std.string : toStringz;
remove(path);
}
string md5(string s)
{
import std.conv : to;
import std.digest.md;
auto md5 = new MD5Digest();
ubyte[] hash = md5.digest(s);
return cast(string)(hash);
}
// removes ".\game" from a file path
string removeGamePath(string path)
{
auto parts = path.split("\\");
if (parts.length == 2)
{
if (parts == [".", "game"])
{
return "";
}
}
else if (parts.length > 2)
{
if (parts[0 .. 2] == [".", "game"])
{
parts = parts[2 .. $];
}
}
return parts.join("\\");
}
string removePlayerNameFromPath(string path)
{
auto parts = path.split("\\");
if (parts[$ - 1] == Player.name)
{
parts.length -= 1;
}
return parts.join("\\");
}
string gameResourcePath()
{
import std.process : environment;
return environment.get("APPDATA") ~ "\\out-of-ctrl";
}
|
D
|
import core.memory;
import std.conv;
import std.string;
import environment;
/**
* The C-interfact to C++ Wt::Application.
*/
extern(C) struct CWApplication;
/**
* The D equivalent of C++ Wt::Application.
*/
class WApplication{
public CWApplication* cpointer;
}
/**
* The D-equivalent of C++ Wt::ApplicationCreator
*/
alias ApplicationCreator = WApplication function(const WEnvironment);
/**
* A C-callback to create the application using an ApplicationCreator.
*
* Params:
* creator = pointer to the ApplicationCreator
* cenvironment = pointer to the C environment
* Returns:
* a pointer to the C Application struct
*/
extern(C) CWApplication* createApplicationFromCUsingApplicationCreator(void* creator, CWEnvironment* cenvironment){
auto dcreator = cast(ApplicationCreator)creator;
WApplication app = dcreator(WEnvironment[cenvironment]);
return app.cpointer;
}
/**
* The C-interfact to C++ Wt::WRun. Should only be called once.
*
* Params:
* argc = amount of cmd arguments
* argv = cmd arguments
* createApplication = pointer to the ApplicationCreator (in D)
* Returns:
* ??? not in Wt documentation
*/
extern(C) int CWT_WRun(int argc, char **argv, void* createApplication);
/**
* The D-eauivalent of C++ Wt::WRun. Should only be called once.
*
* Params:
* args = cmd arguments
* createApplication = the ApplicationCreator to use
* Returns:
* ??? not in Wt documentation
*/
int WRun(char[][] args, ApplicationCreator createApplication){
int argc = to!int(args.length);
// not sure if this is the right way. std.string.toStringz is immutable, so I prefer making an array of immutables,
// but this is not so simple apparently
char** argv = cast(char**) GC.malloc(argc);
for(int i = 0; i < argc; i++){
argv[i] = cast(char*) std.string.toStringz(args[i]);
}
return CWT_WRun(argc, argv, createApplication);
}
|
D
|
/**
* Contains druntime startup and shutdown routines.
*
* Copyright: Copyright Digital Mars 2000 - 2018.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Walter Bright, Sean Kelly
* Source: $(DRUNTIMESRC rt/_dmain2.d)
*/
module rt.dmain2;
private
{
import rt.memory;
import rt.sections;
import core.atomic;
import core.stdc.stddef;
import core.stdc.stdlib;
import core.stdc.string;
import core.stdc.stdio; // for printf()
import core.stdc.errno : errno;
}
version (Windows)
{
private import core.stdc.wchar_;
private import core.sys.windows.basetsd /+: HANDLE+/;
private import core.sys.windows.shellapi /+: CommandLineToArgvW+/;
private import core.sys.windows.winbase /+: FreeLibrary, GetCommandLineW, GetProcAddress,
IsDebuggerPresent, LoadLibraryA, LoadLibraryW, LocalFree, WriteFile+/;
private import core.sys.windows.wincon /+: CONSOLE_SCREEN_BUFFER_INFO, GetConsoleOutputCP, GetConsoleScreenBufferInfo+/;
private import core.sys.windows.winnls /+: CP_UTF8, MultiByteToWideChar, WideCharToMultiByte+/;
private import core.sys.windows.winnt /+: WCHAR+/;
private import core.sys.windows.winuser /+: MB_ICONERROR, MessageBoxW+/;
pragma(lib, "shell32.lib"); // needed for CommandLineToArgvW
}
version (FreeBSD)
{
import core.stdc.fenv;
}
version (NetBSD)
{
import core.stdc.fenv;
}
version (DragonFlyBSD)
{
import core.stdc.fenv;
}
// not sure why we can't define this in one place, but this is to keep this
// module from importing core.runtime.
struct UnitTestResult
{
size_t executed;
size_t passed;
bool runMain;
bool summarize;
}
extern (C) void _d_monitor_staticctor();
extern (C) void _d_monitor_staticdtor();
extern (C) void _d_critical_init();
extern (C) void _d_critical_term();
extern (C) void gc_init();
extern (C) void gc_term();
extern (C) void thread_init() @nogc;
extern (C) void thread_term() @nogc;
extern (C) void lifetime_init();
extern (C) void rt_moduleCtor();
extern (C) void rt_moduleTlsCtor();
extern (C) void rt_moduleDtor();
extern (C) void rt_moduleTlsDtor();
extern (C) void thread_joinAll();
extern (C) UnitTestResult runModuleUnitTests();
extern (C) void _d_initMonoTime();
version (OSX)
{
// The bottom of the stack
extern (C) __gshared void* __osx_stack_end = cast(void*)0xC0000000;
}
version (CRuntime_Microsoft)
{
extern(C) void init_msvc();
}
/***********************************
* These are a temporary means of providing a GC hook for DLL use. They may be
* replaced with some other similar functionality later.
*/
extern (C)
{
void* gc_getProxy();
void gc_setProxy(void* p);
void gc_clrProxy();
alias void* function() gcGetFn;
alias void function(void*) gcSetFn;
alias void function() gcClrFn;
}
version (Windows)
{
/*******************************************
* Loads a DLL written in D with the name 'name'.
* Returns:
* opaque handle to the DLL if successfully loaded
* null if failure
*/
extern (C) void* rt_loadLibrary(const char* name)
{
return initLibrary(.LoadLibraryA(name));
}
extern (C) void* rt_loadLibraryW(const WCHAR* name)
{
return initLibrary(.LoadLibraryW(name));
}
void* initLibrary(void* mod)
{
// BUG: LoadLibrary() call calls rt_init(), which fails if proxy is not set!
// (What? LoadLibrary() is a Windows API call, it shouldn't call rt_init().)
if (mod is null)
return mod;
gcSetFn gcSet = cast(gcSetFn) GetProcAddress(mod, "gc_setProxy");
if (gcSet !is null)
{ // BUG: Set proxy, but too late
gcSet(gc_getProxy());
}
return mod;
}
/*************************************
* Unloads DLL that was previously loaded by rt_loadLibrary().
* Input:
* ptr the handle returned by rt_loadLibrary()
* Returns:
* 1 succeeded
* 0 some failure happened
*/
extern (C) int rt_unloadLibrary(void* ptr)
{
gcClrFn gcClr = cast(gcClrFn) GetProcAddress(ptr, "gc_clrProxy");
if (gcClr !is null)
gcClr();
return FreeLibrary(ptr) != 0;
}
}
/* To get out-of-band access to the args[] passed to main().
*/
__gshared string[] _d_args = null;
extern (C) string[] rt_args()
{
return _d_args;
}
// make arguments passed to main available for being filtered by runtime initializers
extern(C) __gshared char[][] _d_main_args = null;
// This variable is only ever set by a debugger on initialization so it should
// be fine to leave it as __gshared.
extern (C) __gshared bool rt_trapExceptions = true;
alias void delegate(Throwable) ExceptionHandler;
/**
* Keep track of how often rt_init/rt_term were called.
*/
shared size_t _initCount;
/**********************************************
* Initialize druntime.
* If a C program wishes to call D code, and there's no D main(), then it
* must call rt_init() and rt_term().
*/
extern (C) int rt_init()
{
/* @@BUG 11380 @@ Need to synchronize rt_init/rt_term calls for
version (Shared) druntime, because multiple C threads might
initialize different D libraries without knowing about the
shared druntime. Also we need to attach any thread that calls
rt_init. */
if (atomicOp!"+="(_initCount, 1) > 1) return 1;
version (CRuntime_Microsoft)
init_msvc();
_d_monitor_staticctor();
_d_critical_init();
try
{
initSections();
// this initializes mono time before anything else to allow usage
// in other druntime systems.
_d_initMonoTime();
thread_init();
// TODO: fixme - calls GC.addRange -> Initializes GC
initStaticDataGC();
lifetime_init();
rt_moduleCtor();
rt_moduleTlsCtor();
return 1;
}
catch (Throwable t)
{
_initCount = 0;
_d_print_throwable(t);
}
_d_critical_term();
_d_monitor_staticdtor();
return 0;
}
/**********************************************
* Terminate use of druntime.
*/
extern (C) int rt_term()
{
if (!_initCount) return 0; // was never initialized
if (atomicOp!"-="(_initCount, 1)) return 1;
try
{
rt_moduleTlsDtor();
thread_joinAll();
rt_moduleDtor();
gc_term();
thread_term();
return 1;
}
catch (Throwable t)
{
_d_print_throwable(t);
}
finally
{
finiSections();
_d_critical_term();
_d_monitor_staticdtor();
}
return 0;
}
/**********************************************
* Trace handler
*/
alias Throwable.TraceInfo function(void* ptr) TraceHandler;
private __gshared TraceHandler traceHandler = null;
/**
* Overrides the default trace hander with a user-supplied version.
*
* Params:
* h = The new trace handler. Set to null to use the default handler.
*/
extern (C) void rt_setTraceHandler(TraceHandler h)
{
traceHandler = h;
}
/**
* Return the current trace handler
*/
extern (C) TraceHandler rt_getTraceHandler()
{
return traceHandler;
}
/**
* This function will be called when an exception is constructed. The
* user-supplied trace handler will be called if one has been supplied,
* otherwise no trace will be generated.
*
* Params:
* ptr = A pointer to the location from which to generate the trace, or null
* if the trace should be generated from within the trace handler
* itself.
*
* Returns:
* An object describing the current calling context or null if no handler is
* supplied.
*/
extern (C) Throwable.TraceInfo _d_traceContext(void* ptr = null)
{
if (traceHandler is null)
return null;
return traceHandler(ptr);
}
/***********************************
* Provide out-of-band access to the original C argc/argv
* passed to this program via main(argc,argv).
*/
struct CArgs
{
int argc;
char** argv;
}
__gshared CArgs _cArgs;
extern (C) CArgs rt_cArgs() @nogc
{
return _cArgs;
}
/***********************************
* Run the given main function.
* Its purpose is to wrap the D main()
* function and catch any unhandled exceptions.
*/
private alias extern(C) int function(char[][] args) MainFunc;
extern (C) int _d_run_main(int argc, char **argv, MainFunc mainFunc)
{
// Remember the original C argc/argv
_cArgs.argc = argc;
_cArgs.argv = argv;
int result;
version (OSX)
{ /* OSX does not provide a way to get at the top of the
* stack, except for the magic value 0xC0000000.
* But as far as the gc is concerned, argv is at the top
* of the main thread's stack, so save the address of that.
*/
__osx_stack_end = cast(void*)&argv;
}
version (FreeBSD) version (D_InlineAsm_X86)
{
/*
* FreeBSD/i386 sets the FPU precision mode to 53 bit double.
* Make it 64 bit extended.
*/
ushort fpucw;
asm
{
fstsw fpucw;
or fpucw, 0b11_00_111111; // 11: use 64 bit extended-precision
// 111111: mask all FP exceptions
fldcw fpucw;
}
}
version (CRuntime_Microsoft)
{
// enable full precision for reals
version (Win64)
asm
{
push RAX;
fstcw word ptr [RSP];
or [RSP], 0b11_00_111111; // 11: use 64 bit extended-precision
// 111111: mask all FP exceptions
fldcw word ptr [RSP];
pop RAX;
}
else version (Win32)
{
asm
{
push EAX;
fstcw word ptr [ESP];
or [ESP], 0b11_00_111111; // 11: use 64 bit extended-precision
// 111111: mask all FP exceptions
fldcw word ptr [ESP];
pop EAX;
}
}
}
version (Windows)
{
/* Because we want args[] to be UTF-8, and Windows doesn't guarantee that,
* we ignore argc/argv and go get the Windows command line again as UTF-16.
* Then, reparse into wargc/wargs, and then use Windows API to convert
* to UTF-8.
*/
const wCommandLine = GetCommandLineW();
immutable size_t wCommandLineLength = wcslen(wCommandLine);
int wargc;
auto wargs = CommandLineToArgvW(wCommandLine, &wargc);
// assert(wargc == argc); /* argc can be broken by Unicode arguments */
// Allocate args[] on the stack - use wargc
char[][] args = (cast(char[]*) alloca(wargc * (char[]).sizeof))[0 .. wargc];
// This is required because WideCharToMultiByte requires int as input.
assert(wCommandLineLength <= cast(size_t) int.max, "Wide char command line length must not exceed int.max");
immutable size_t totalArgsLength = WideCharToMultiByte(CP_UTF8, 0, wCommandLine, cast(int)wCommandLineLength, null, 0, null, null);
{
char* totalArgsBuff = cast(char*) alloca(totalArgsLength);
size_t j = 0;
foreach (i; 0 .. wargc)
{
immutable size_t wlen = wcslen(wargs[i]);
assert(wlen <= cast(size_t) int.max, "wlen cannot exceed int.max");
immutable int len = WideCharToMultiByte(CP_UTF8, 0, &wargs[i][0], cast(int) wlen, null, 0, null, null);
args[i] = totalArgsBuff[j .. j + len];
if (len == 0)
continue;
j += len;
assert(j <= totalArgsLength);
WideCharToMultiByte(CP_UTF8, 0, &wargs[i][0], cast(int) wlen, &args[i][0], len, null, null);
}
}
LocalFree(wargs);
wargs = null;
wargc = 0;
}
else version (Posix)
{
// Allocate args[] on the stack
char[][] args = (cast(char[]*) alloca(argc * (char[]).sizeof))[0 .. argc];
size_t totalArgsLength = 0;
foreach (i, ref arg; args)
{
arg = argv[i][0 .. strlen(argv[i])];
totalArgsLength += arg.length;
}
}
else
static assert(0);
/* Create a copy of args[] on the stack to be used for main, so that rt_args()
* cannot be modified by the user.
* Note that when this function returns, _d_args will refer to garbage.
*/
{
_d_args = cast(string[]) args;
auto buff = cast(char[]*) alloca(args.length * (char[]).sizeof + totalArgsLength);
char[][] argsCopy = buff[0 .. args.length];
auto argBuff = cast(char*) (buff + args.length);
size_t j = 0;
foreach (arg; args)
{
import rt.config : rt_cmdline_enabled;
if (!rt_cmdline_enabled!() || arg.length < 6 || arg[0..6] != "--DRT-") // skip D runtime options
{
argsCopy[j++] = (argBuff[0 .. arg.length] = arg[]);
argBuff += arg.length;
}
}
args = argsCopy[0..j];
}
auto useExceptionTrap = parseExceptionOptions();
version (Windows)
{
if (IsDebuggerPresent())
useExceptionTrap = false;
}
void tryExec(scope void delegate() dg)
{
if (useExceptionTrap)
{
try
{
dg();
}
catch (Throwable t)
{
_d_print_throwable(t);
result = EXIT_FAILURE;
}
}
else
{
dg();
}
}
// NOTE: The lifetime of a process is much like the lifetime of an object:
// it is initialized, then used, then destroyed. If initialization
// fails, the successive two steps are never reached. However, if
// initialization succeeds, then cleanup will occur even if the use
// step fails in some way. Here, the use phase consists of running
// the user's main function. If main terminates with an exception,
// the exception is handled and then cleanup begins. An exception
// thrown during cleanup, however, will abort the cleanup process.
void runAll()
{
if (rt_init())
{
auto utResult = runModuleUnitTests();
assert(utResult.passed <= utResult.executed);
if (utResult.passed == utResult.executed)
{
if (utResult.summarize)
{
if (utResult.passed == 0)
.fprintf(.stderr, "No unittests run\n");
else
.fprintf(.stderr, "%d unittests passed\n",
cast(int)utResult.passed);
}
if (utResult.runMain)
tryExec({ result = mainFunc(args); });
else
result = EXIT_SUCCESS;
}
else
{
if (utResult.summarize)
.fprintf(.stderr, "%d/%d unittests FAILED\n",
cast(int)(utResult.executed - utResult.passed),
cast(int)utResult.executed);
result = EXIT_FAILURE;
}
}
else
result = EXIT_FAILURE;
if (!rt_term())
result = (result == EXIT_SUCCESS) ? EXIT_FAILURE : result;
}
tryExec(&runAll);
// Issue 10344: flush stdout and return nonzero on failure
if (.fflush(.stdout) != 0)
{
.fprintf(.stderr, "Failed to flush stdout: %s\n", .strerror(.errno));
if (result == 0)
{
result = EXIT_FAILURE;
}
}
return result;
}
private void formatThrowable(Throwable t, scope void delegate(in char[] s) nothrow sink)
{
foreach (u; t)
{
u.toString(sink); sink("\n");
auto e = cast(Error)u;
if (e is null || e.bypassedException is null) continue;
sink("=== Bypassed ===\n");
foreach (t2; e.bypassedException)
{
t2.toString(sink); sink("\n");
}
sink("=== ~Bypassed ===\n");
}
}
private auto parseExceptionOptions()
{
import rt.config : rt_configOption;
import core.internal.parseoptions : rt_parseOption;
const optName = "trapExceptions";
auto option = rt_configOption(optName);
auto trap = rt_trapExceptions;
if (option.length)
rt_parseOption(optName, option, trap, "");
return trap;
}
extern (C) void _d_print_throwable(Throwable t)
{
// On Windows, a console may not be present to print the output to.
// Show a message box instead. If the console is present, convert to
// the correct encoding.
version (Windows)
{
static struct WSink
{
WCHAR* ptr; size_t len;
void sink(in char[] s) scope nothrow
{
if (!s.length) return;
int swlen = MultiByteToWideChar(
CP_UTF8, 0, s.ptr, cast(int)s.length, null, 0);
if (!swlen) return;
auto newPtr = cast(WCHAR*)realloc(ptr,
(this.len + swlen + 1) * WCHAR.sizeof);
if (!newPtr) return;
ptr = newPtr;
auto written = MultiByteToWideChar(
CP_UTF8, 0, s.ptr, cast(int)s.length, ptr+len, swlen);
len += written;
}
typeof(ptr) get() { if (ptr) ptr[len] = 0; return ptr; }
void free() { .free(ptr); }
}
HANDLE windowsHandle(int fd)
{
version (CRuntime_Microsoft)
return cast(HANDLE)_get_osfhandle(fd);
else
return _fdToHandle(fd);
}
auto hStdErr = windowsHandle(fileno(stderr));
CONSOLE_SCREEN_BUFFER_INFO sbi;
bool isConsole = GetConsoleScreenBufferInfo(hStdErr, &sbi) != 0;
// ensure the exception is shown at the beginning of the line, while also
// checking whether stderr is a valid file
int written = fprintf(stderr, "\n");
if (written <= 0)
{
WSink buf;
formatThrowable(t, &buf.sink);
if (buf.ptr)
{
WSink caption;
if (t)
caption.sink(t.classinfo.name);
// Avoid static user32.dll dependency for console applications
// by loading it dynamically as needed
auto user32 = LoadLibraryW("user32.dll");
if (user32)
{
alias typeof(&MessageBoxW) PMessageBoxW;
auto pMessageBoxW = cast(PMessageBoxW)
GetProcAddress(user32, "MessageBoxW");
if (pMessageBoxW)
pMessageBoxW(null, buf.get(), caption.get(), MB_ICONERROR);
}
FreeLibrary(user32);
caption.free();
buf.free();
}
return;
}
else if (isConsole)
{
WSink buf;
formatThrowable(t, &buf.sink);
if (buf.ptr)
{
uint codepage = GetConsoleOutputCP();
int slen = WideCharToMultiByte(codepage, 0,
buf.ptr, cast(int)buf.len, null, 0, null, null);
auto sptr = cast(char*)malloc(slen * char.sizeof);
if (sptr)
{
WideCharToMultiByte(codepage, 0,
buf.ptr, cast(int)buf.len, sptr, slen, null, null);
WriteFile(hStdErr, sptr, slen, null, null);
free(sptr);
}
buf.free();
}
return;
}
}
void sink(in char[] buf) scope nothrow
{
fprintf(stderr, "%.*s", cast(int)buf.length, buf.ptr);
}
formatThrowable(t, &sink);
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <[email protected]>
*******************************************************************************/
module org.eclipse.swt.widgets.Scrollable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.win32.OS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Decorations;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Widget;
import java.lang.all;
/**
* This class is the abstract superclass of all classes which
* represent controls that have standard scroll bars.
* <dl>
* <dt><b>Styles:</b></dt>
* <dd>H_SCROLL, V_SCROLL</dd>
* <dt><b>Events:</b>
* <dd>(none)</dd>
* </dl>
* <p>
* IMPORTANT: This class is intended to be subclassed <em>only</em>
* within the SWT implementation.
* </p>
*
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public abstract class Scrollable : Control {
alias Control.windowProc windowProc;
ScrollBar horizontalBar, verticalBar;
/**
* Prevents uninitialized instances from being created outside the package.
*/
this () {
}
/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
* class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
* Style bits are also inherited from superclasses.
* </p>
*
* @param parent a composite control which will be the parent of the new instance (cannot be null)
* @param style the style of control to construct
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
* <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
* </ul>
*
* @see SWT#H_SCROLL
* @see SWT#V_SCROLL
* @see Widget#checkSubclass
* @see Widget#getStyle
*/
public this (Composite parent, int style) {
super (parent, style);
}
override .LRESULT callWindowProc (HWND hwnd, int msg, WPARAM wParam, LPARAM lParam) {
if (handle is null) return 0;
return OS.DefWindowProc (hwnd, msg, wParam, lParam);
}
/**
* Given a desired <em>client area</em> for the receiver
* (as described by the arguments), returns the bounding
* rectangle which would be required to produce that client
* area.
* <p>
* In other words, it returns a rectangle such that, if the
* receiver's bounds were set to that rectangle, the area
* of the receiver which is capable of displaying data
* (that is, not covered by the "trimmings") would be the
* rectangle described by the arguments (relative to the
* receiver's parent).
* </p>
*
* @param x the desired x coordinate of the client area
* @param y the desired y coordinate of the client area
* @param width the desired width of the client area
* @param height the desired height of the client area
* @return the required bounds to produce the given client area
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see #getClientArea
*/
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
auto scrolledHandle_ = scrolledHandle ();
RECT rect;
OS.SetRect (&rect, x, y, x + width, y + height);
int bits1 = OS.GetWindowLong (scrolledHandle_, OS.GWL_STYLE);
int bits2 = OS.GetWindowLong (scrolledHandle_, OS.GWL_EXSTYLE);
OS.AdjustWindowRectEx (&rect, bits1, false, bits2);
if (horizontalBar !is null) rect.bottom += OS.GetSystemMetrics (OS.SM_CYHSCROLL);
if (verticalBar !is null) rect.right += OS.GetSystemMetrics (OS.SM_CXVSCROLL);
int nWidth = rect.right - rect.left, nHeight = rect.bottom - rect.top;
return new Rectangle (rect.left, rect.top, nWidth, nHeight);
}
ScrollBar createScrollBar (int type) {
ScrollBar bar = new ScrollBar (this, type);
if ((state & CANVAS) !is 0) {
bar.setMaximum (100);
bar.setThumb (10);
}
return bar;
}
override void createWidget () {
super.createWidget ();
if ((style & SWT.H_SCROLL) !is 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
if ((style & SWT.V_SCROLL) !is 0) verticalBar = createScrollBar (SWT.V_SCROLL);
}
void destroyScrollBar (int type) {
auto hwnd = scrolledHandle ();
int bits = OS.GetWindowLong (hwnd, OS.GWL_STYLE);
if ((type & SWT.HORIZONTAL) !is 0) {
style &= ~SWT.H_SCROLL;
bits &= ~OS.WS_HSCROLL;
}
if ((type & SWT.VERTICAL) !is 0) {
style &= ~SWT.V_SCROLL;
bits &= ~OS.WS_VSCROLL;
}
OS.SetWindowLong (hwnd, OS.GWL_STYLE, bits);
}
/**
* Returns a rectangle which describes the area of the
* receiver which is capable of displaying data (that is,
* not covered by the "trimmings").
*
* @return the client area
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see #computeTrim
*/
public Rectangle getClientArea () {
checkWidget ();
forceResize ();
RECT rect;
auto scrolledHandle_ = scrolledHandle ();
OS.GetClientRect (scrolledHandle_, &rect);
int x = rect.left, y = rect.top;
int width = rect.right - rect.left;
int height = rect.bottom - rect.top;
if (scrolledHandle_ !is handle) {
OS.GetClientRect (handle, &rect);
OS.MapWindowPoints(handle, scrolledHandle_, cast(POINT*)&rect, 2);
x = -rect.left;
y = -rect.top;
}
return new Rectangle (x, y, width, height);
}
/**
* Returns the receiver's horizontal scroll bar if it has
* one, and null if it does not.
*
* @return the horizontal scroll bar (or null)
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public ScrollBar getHorizontalBar () {
checkWidget ();
return horizontalBar;
}
/**
* Returns the receiver's vertical scroll bar if it has
* one, and null if it does not.
*
* @return the vertical scroll bar (or null)
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public ScrollBar getVerticalBar () {
checkWidget ();
return verticalBar;
}
override void releaseChildren (bool destroy) {
if (horizontalBar !is null) {
horizontalBar.release (false);
horizontalBar = null;
}
if (verticalBar !is null) {
verticalBar.release (false);
verticalBar = null;
}
super.releaseChildren (destroy);
}
HANDLE scrolledHandle () {
return handle;
}
override int widgetExtStyle () {
return super.widgetExtStyle ();
/*
* This code is intentionally commented. In future,
* we may wish to support different standard Windows
* edge styles. The issue here is that not all of
* these styles are available on the other platforms
* this would need to be a hint.
*/
// if ((style & SWT.BORDER) !is 0) return OS.WS_EX_CLIENTEDGE;
// if ((style & SWT.SHADOW_IN) !is 0) return OS.WS_EX_STATICEDGE;
// return super.widgetExtStyle ();
}
override int widgetStyle () {
int bits = super.widgetStyle () | OS.WS_TABSTOP;
if ((style & SWT.H_SCROLL) !is 0) bits |= OS.WS_HSCROLL;
if ((style & SWT.V_SCROLL) !is 0) bits |= OS.WS_VSCROLL;
return bits;
}
override String windowClass () {
return display.windowClass();
}
override ptrdiff_t windowProc () {
return display.windowProc;
}
override LRESULT WM_HSCROLL (WPARAM wParam, LPARAM lParam) {
LRESULT result = super.WM_HSCROLL (wParam, lParam);
if (result !is null) return result;
/*
* Bug on WinCE. lParam should be NULL when the message is not sent
* by a scroll bar control, but it contains the handle to the window.
* When the message is sent by a scroll bar control, it correctly
* contains the handle to the scroll bar. The fix is to check for
* both.
*/
if (horizontalBar !is null && (lParam is 0 || lParam is cast(size_t)handle)) {
return wmScroll (horizontalBar, (state & CANVAS) !is 0, handle, OS.WM_HSCROLL, wParam, lParam);
}
return result;
}
override LRESULT WM_MOUSEWHEEL (WPARAM wParam, LPARAM lParam) {
int scrollRemainder = display.scrollRemainder;
LRESULT result = super.WM_MOUSEWHEEL (wParam, lParam);
if (result !is null) return result;
/*
* Translate WM_MOUSEWHEEL to WM_VSCROLL or WM_HSCROLL.
*/
if ((state & CANVAS) !is 0) {
if ((wParam & (OS.MK_SHIFT | OS.MK_CONTROL)) !is 0) return result;
bool vertical = verticalBar !is null && verticalBar.getEnabled ();
bool horizontal = horizontalBar !is null && horizontalBar.getEnabled ();
int msg = vertical ? OS.WM_VSCROLL : horizontal ? OS.WM_HSCROLL : 0;
if (msg is 0) return result;
int linesToScroll;
OS.SystemParametersInfo (OS.SPI_GETWHEELSCROLLLINES, 0, &linesToScroll, 0);
int delta = OS.GET_WHEEL_DELTA_WPARAM (wParam);
bool pageScroll = linesToScroll is OS.WHEEL_PAGESCROLL;
if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
ScrollBar bar = vertical ? verticalBar : horizontalBar;
SCROLLINFO info;
info.cbSize = SCROLLINFO.sizeof;
info.fMask = OS.SIF_POS;
OS.GetScrollInfo (handle, bar.scrollBarType (), &info);
if (vertical && !pageScroll) delta *= linesToScroll;
int increment = pageScroll ? bar.getPageIncrement () : bar.getIncrement ();
info.nPos -= increment * delta / OS.WHEEL_DELTA;
OS.SetScrollInfo (handle, bar.scrollBarType (), &info, true);
OS.SendMessage (handle, msg, OS.SB_THUMBPOSITION, 0);
} else {
int code = 0;
if (pageScroll) {
code = delta < 0 ? OS.SB_PAGEDOWN : OS.SB_PAGEUP;
} else {
code = delta < 0 ? OS.SB_LINEDOWN : OS.SB_LINEUP;
if (msg is OS.WM_VSCROLL) delta *= linesToScroll;
}
/* Check if the delta and the remainder have the same direction (sign) */
if ((delta ^ scrollRemainder) >= 0) delta += scrollRemainder;
int count = Math.abs (delta) / OS.WHEEL_DELTA;
for (int i=0; i<count; i++) {
OS.SendMessage (handle, msg, code, 0);
}
}
return LRESULT.ZERO;
}
/*
* When the native widget scrolls inside WM_MOUSEWHEEL, it
* may or may not send a WM_VSCROLL or WM_HSCROLL to do the
* actual scrolling. This depends on the implementation of
* each native widget. In order to ensure that application
* code is notified when the scroll bar moves, compare the
* scroll bar position before and after the WM_MOUSEWHEEL.
* If the native control sends a WM_VSCROLL or WM_HSCROLL,
* then the application has already been notified. If not
* explicitly send the event.
*/
int vPosition = verticalBar is null ? 0 : verticalBar.getSelection ();
int hPosition = horizontalBar is null ? 0 : horizontalBar.getSelection ();
auto code = callWindowProc (handle, OS.WM_MOUSEWHEEL, wParam, lParam);
if (verticalBar !is null) {
int position = verticalBar.getSelection ();
if (position !is vPosition) {
Event event = new Event ();
event.detail = position < vPosition ? SWT.PAGE_UP : SWT.PAGE_DOWN;
verticalBar.sendEvent (SWT.Selection, event);
}
}
if (horizontalBar !is null) {
int position = horizontalBar.getSelection ();
if (position !is hPosition) {
Event event = new Event ();
event.detail = position < hPosition ? SWT.PAGE_UP : SWT.PAGE_DOWN;
horizontalBar.sendEvent (SWT.Selection, event);
}
}
return new LRESULT (code);
}
override LRESULT WM_SIZE (WPARAM wParam, LPARAM lParam) {
auto code = callWindowProc (handle, OS.WM_SIZE, wParam, lParam);
super.WM_SIZE (wParam, lParam);
// widget may be disposed at this point
if (code is 0) return LRESULT.ZERO;
return new LRESULT (code);
}
override LRESULT WM_VSCROLL (WPARAM wParam, LPARAM lParam) {
LRESULT result = super.WM_VSCROLL (wParam, lParam);
if (result !is null) return result;
/*
* Bug on WinCE. lParam should be NULL when the message is not sent
* by a scroll bar control, but it contains the handle to the window.
* When the message is sent by a scroll bar control, it correctly
* contains the handle to the scroll bar. The fix is to check for
* both.
*/
if (verticalBar !is null && (lParam is 0 || lParam is cast(size_t)handle)) {
return wmScroll (verticalBar, (state & CANVAS) !is 0, handle, OS.WM_VSCROLL, wParam, lParam);
}
return result;
}
override LRESULT wmNCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam) {
LRESULT result = super.wmNCPaint (hwnd, wParam, lParam);
if (result !is null) return result;
/*
* Bug in Windows. On XP only (not Vista), Windows sometimes
* does not redraw the bottom right corner of a window that
* has scroll bars, causing pixel corruption. The fix is to
* always draw the corner.
*/
if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
if (!OS.IsWinCE && OS.WIN32_VERSION < OS.VERSION (6, 0)) {
int bits1 = OS.GetWindowLong (hwnd, OS.GWL_STYLE);
if ((bits1 & (OS.WS_HSCROLL | OS.WS_VSCROLL)) !is 0) {
RECT windowRect;
OS.GetWindowRect (hwnd, &windowRect);
RECT trimRect;
int bits2 = OS.GetWindowLong (hwnd, OS.GWL_EXSTYLE);
OS.AdjustWindowRectEx (&trimRect, bits1, false, bits2);
bool hVisible = false, vVisible = false;
SCROLLBARINFO psbi;
psbi.cbSize = SCROLLBARINFO.sizeof;
if (OS.GetScrollBarInfo (hwnd, OS.OBJID_HSCROLL, &psbi)) {
hVisible = (psbi.rgstate [0] & OS.STATE_SYSTEM_INVISIBLE) is 0;
}
if (OS.GetScrollBarInfo (hwnd, OS.OBJID_VSCROLL, &psbi)) {
vVisible = (psbi.rgstate [0] & OS.STATE_SYSTEM_INVISIBLE) is 0;
}
RECT cornerRect;
cornerRect.right = windowRect.right - windowRect.left - trimRect.right;
cornerRect.bottom = windowRect.bottom - windowRect.top - trimRect.bottom;
cornerRect.left = cornerRect.right - (hVisible ? OS.GetSystemMetrics (OS.SM_CXVSCROLL) : 0);
cornerRect.top = cornerRect.bottom - (vVisible ? OS.GetSystemMetrics (OS.SM_CYHSCROLL) : 0);
if (cornerRect.left !is cornerRect.right && cornerRect.top !is cornerRect.bottom) {
auto hDC = OS.GetWindowDC (hwnd);
OS.FillRect (hDC, &cornerRect, cast(HANDLE)( OS.COLOR_BTNFACE + 1));
Decorations shell = menuShell ();
if ((shell.style & SWT.RESIZE) !is 0) {
auto hwndScroll = shell.scrolledHandle ();
bool drawGripper = hwnd is hwndScroll;
if (!drawGripper) {
RECT shellRect;
OS.GetClientRect (hwndScroll, &shellRect);
OS.MapWindowPoints (hwndScroll, null, cast(POINT*)&shellRect, 2);
drawGripper = shellRect.right is windowRect.right && shellRect.bottom is windowRect.bottom;
}
if (drawGripper) {
OS.DrawThemeBackground (display.hScrollBarTheme(), hDC, OS.SBP_SIZEBOX, 0, &cornerRect, null);
}
}
OS.ReleaseDC (hwnd, hDC);
}
}
}
}
return result;
}
LRESULT wmScroll (ScrollBar bar, bool update, HWND hwnd, int msg, WPARAM wParam, LPARAM lParam) {
LRESULT result = null;
if (update) {
int type = msg is OS.WM_HSCROLL ? OS.SB_HORZ : OS.SB_VERT;
SCROLLINFO info;
info.cbSize = SCROLLINFO.sizeof;
info.fMask = OS.SIF_TRACKPOS | OS.SIF_POS | OS.SIF_RANGE;
OS.GetScrollInfo (hwnd, type, &info);
info.fMask = OS.SIF_POS;
int code = OS.LOWORD (wParam);
switch (code) {
case OS.SB_ENDSCROLL: return null;
case OS.SB_THUMBPOSITION:
case OS.SB_THUMBTRACK:
/*
* Note: On WinCE, the value in SB_THUMBPOSITION is relative to nMin.
* Same for SB_THUMBPOSITION 'except' for the very first thumb track
* message which has the actual value of nMin. This is a problem when
* nMin is not zero.
*/
info.nPos = info.nTrackPos;
break;
case OS.SB_TOP:
info.nPos = info.nMin;
break;
case OS.SB_BOTTOM:
info.nPos = info.nMax;
break;
case OS.SB_LINEDOWN:
info.nPos += bar.getIncrement ();
break;
case OS.SB_LINEUP:
int increment = bar.getIncrement ();
info.nPos = Math.max (info.nMin, info.nPos - increment);
break;
case OS.SB_PAGEDOWN:
info.nPos += bar.getPageIncrement ();
break;
case OS.SB_PAGEUP:
int pageIncrement = bar.getPageIncrement ();
info.nPos = Math.max (info.nMin, info.nPos - pageIncrement);
break;
default:
}
OS.SetScrollInfo (hwnd, type, &info, true);
} else {
auto code = callWindowProc (hwnd, msg, wParam, lParam);
result = code is 0 ? LRESULT.ZERO : new LRESULT (code);
}
bar.wmScrollChild (wParam, lParam);
return result;
}
}
|
D
|
/**
Cyclic Redundancy Check (32-bit) implementation.
$(SCRIPT inhibitQuickIndex = 1;)
$(DIVC quickindex,
$(BOOKTABLE ,
$(TR $(TH Category) $(TH Functions)
)
$(TR $(TDNW Template API) $(TD $(MYREF CRC) $(MYREF CRC32) $(MYREF CRC64ECMA) $(MYREF CRC64ISO)
)
)
$(TR $(TDNW OOP API) $(TD $(MYREF CRC32Digest) $(MYREF CRC64ECMADigest) $(MYREF CRC64ISODigest))
)
$(TR $(TDNW Helpers) $(TD $(MYREF crcHexString) $(MYREF crc32Of) $(MYREF crc64ECMAOf) $(MYREF crc64ISOOf))
)
)
)
*
* This module conforms to the APIs defined in $(D std.digest). To understand the
* differences between the template and the OOP API, see $(MREF std, digest).
*
* This module publicly imports $(MREF std, digest) and can be used as a stand-alone
* module.
*
* Note:
* CRCs are usually printed with the MSB first. When using
* $(REF toHexString, std,digest) the result will be in an unexpected
* order. Use $(REF toHexString, std,digest)'s optional order parameter
* to specify decreasing order for the correct result. The $(LREF crcHexString)
* alias can also be used for this purpose.
*
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
*
* Authors: Pavel "EvilOne" Minayev, Alex Rønne Petersen, Johannes Pfau
*
* References:
* $(LINK2 http://en.wikipedia.org/wiki/Cyclic_redundancy_check, Wikipedia on CRC)
*
* Source: $(PHOBOSSRC std/digest/_crc.d)
*
* Standards:
* Implements the 'common' IEEE CRC32 variant
* (LSB-first order, Initial value uint.max, complement result)
*
* CTFE:
* Digests do not work in CTFE
*/
/*
* Copyright (c) 2001 - 2002
* Pavel "EvilOne" Minayev
* Copyright (c) 2012
* Alex Rønne Petersen
* 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.digest.crc;
public import std.digest;
version(unittest) import std.exception;
///
@safe unittest
{
//Template API
import std.digest.crc;
ubyte[4] hash = crc32Of("The quick brown fox jumps over the lazy dog");
assert(crcHexString(hash) == "414FA339");
//Feeding data
ubyte[1024] data;
CRC32 crc;
crc.put(data[]);
crc.start(); //Start again
crc.put(data[]);
hash = crc.finish();
}
///
@safe unittest
{
//OOP API
import std.digest.crc;
auto crc = new CRC32Digest();
ubyte[] hash = crc.digest("The quick brown fox jumps over the lazy dog");
assert(crcHexString(hash) == "414FA339"); //352441c2
//Feeding data
ubyte[1024] data;
crc.put(data[]);
crc.reset(); //Start again
crc.put(data[]);
hash = crc.finish();
}
private T[256][8] genTables(T)(T polynomial)
{
T[256][8] res = void;
foreach (i; 0 .. 0x100)
{
T crc = i;
foreach (_; 0 .. 8)
crc = (crc >> 1) ^ (-int(crc & 1) & polynomial);
res[0][i] = crc;
}
foreach (i; 0 .. 0x100)
{
res[1][i] = (res[0][i] >> 8) ^ res[0][res[0][i] & 0xFF];
res[2][i] = (res[1][i] >> 8) ^ res[0][res[1][i] & 0xFF];
res[3][i] = (res[2][i] >> 8) ^ res[0][res[2][i] & 0xFF];
res[4][i] = (res[3][i] >> 8) ^ res[0][res[3][i] & 0xFF];
res[5][i] = (res[4][i] >> 8) ^ res[0][res[4][i] & 0xFF];
res[6][i] = (res[5][i] >> 8) ^ res[0][res[5][i] & 0xFF];
res[7][i] = (res[6][i] >> 8) ^ res[0][res[6][i] & 0xFF];
}
return res;
}
@system unittest
{
auto tables = genTables(0xEDB88320);
assert(tables[0][0] == 0x00000000 && tables[0][$ - 1] == 0x2d02ef8d && tables[7][$ - 1] == 0x264b06e6);
}
/**
* Template API CRC32 implementation.
* See $(D std.digest) for differences between template and OOP API.
*/
alias CRC32 = CRC!(32, 0xEDB88320);
/**
* Template API CRC64-ECMA implementation.
* See $(D std.digest.digest) for differences between template and OOP API.
*/
alias CRC64ECMA = CRC!(64, 0xC96C5795D7870F42);
/**
* Template API CRC64-ISO implementation.
* See $(D std.digest.digest) for differences between template and OOP API.
*/
alias CRC64ISO = CRC!(64, 0xD800000000000000);
/**
* Generic Template API used for CRC32 and CRC64 implementations.
*
* The N parameter indicate the size of the hash in bits.
* The parameter P specify the polynomial to be used for reduction.
*
* You may want to use the CRC32, CRC65ECMA and CRC64ISO aliases
* for convenience.
*
* See $(D std.digest.digest) for differences between template and OOP API.
*/
struct CRC(uint N, ulong P)
if (N == 32 || N == 64)
{
private:
static if (N == 32)
{
alias T = uint;
}
else
{
alias T = ulong;
}
static immutable T[256][8] tables = genTables!T(P);
/**
* Type of the finished CRC hash.
* ubyte[4] if N is 32, ubyte[8] if N is 64.
*/
alias R = ubyte[T.sizeof];
// magic initialization constants
T _state = T.max;
public:
/**
* Use this to feed the digest with data.
* Also implements the $(REF isOutputRange, std,range,primitives)
* interface for $(D ubyte) and $(D const(ubyte)[]).
*/
void put(scope const(ubyte)[] data...) @trusted pure nothrow @nogc
{
T crc = _state;
// process eight bytes at once
while (data.length >= 8)
{
// Use byte-wise reads to support architectures without HW support
// for unaligned reads. This can be optimized by compilers to a single
// 32-bit read if unaligned reads are supported.
// DMD is not able to do this optimization though, so explicitly
// do unaligned reads for DMD's architectures.
version (X86)
enum hasLittleEndianUnalignedReads = true;
else version (X86_64)
enum hasLittleEndianUnalignedReads = true;
else
enum hasLittleEndianUnalignedReads = false; // leave decision to optimizer
static if (hasLittleEndianUnalignedReads)
{
uint one = (cast(uint*) data.ptr)[0];
uint two = (cast(uint*) data.ptr)[1];
}
else
{
uint one = (data.ptr[3] << 24 | data.ptr[2] << 16 | data.ptr[1] << 8 | data.ptr[0]);
uint two = (data.ptr[7] << 24 | data.ptr[6] << 16 | data.ptr[5] << 8 | data.ptr[4]);
}
static if (N == 32)
{
one ^= crc;
}
else
{
one ^= (crc & 0xffffffff);
two ^= (crc >> 32);
}
crc =
tables[0][two >> 24] ^
tables[1][(two >> 16) & 0xFF] ^
tables[2][(two >> 8) & 0xFF] ^
tables[3][two & 0xFF] ^
tables[4][one >> 24] ^
tables[5][(one >> 16) & 0xFF] ^
tables[6][(one >> 8) & 0xFF] ^
tables[7][one & 0xFF];
data = data[8 .. $];
}
// remaining 1 to 7 bytes
foreach (d; data)
crc = (crc >> 8) ^ tables[0][(crc & 0xFF) ^ d];
_state = crc;
}
/**
* Used to initialize the CRC32 digest.
*
* Note:
* For this CRC32 Digest implementation calling start after default construction
* is not necessary. Calling start is only necessary to reset the Digest.
*
* Generic code which deals with different Digest types should always call start though.
*/
void start() @safe pure nothrow @nogc
{
this = CRC.init;
}
/**
* Returns the finished CRC hash. This also calls $(LREF start) to
* reset the internal state.
*/
R finish() @safe pure nothrow @nogc
{
auto tmp = peek();
start();
return tmp;
}
/**
* Works like $(D finish) but does not reset the internal state, so it's possible
* to continue putting data into this CRC after a call to peek.
*/
R peek() const @safe pure nothrow @nogc
{
import std.bitmanip : nativeToLittleEndian;
//Complement, LSB first / Little Endian, see http://rosettacode.org/wiki/CRC-32
return nativeToLittleEndian(~_state);
}
}
///
@safe unittest
{
//Simple example, hashing a string using crc32Of helper function
ubyte[4] hash32 = crc32Of("abc");
//Let's get a hash string
assert(crcHexString(hash32) == "352441C2");
// Repeat for CRC64
ubyte[8] hash64ecma = crc64ECMAOf("abc");
assert(crcHexString(hash64ecma) == "2CD8094A1A277627");
ubyte[8] hash64iso = crc64ISOOf("abc");
assert(crcHexString(hash64iso) == "3776C42000000000");
}
///
@safe unittest
{
ubyte[1024] data;
//Using the basic API
CRC32 hash32;
CRC64ECMA hash64ecma;
CRC64ISO hash64iso;
//Initialize data here...
hash32.put(data);
ubyte[4] result32 = hash32.finish();
hash64ecma.put(data);
ubyte[8] result64ecma = hash64ecma.finish();
hash64iso.put(data);
ubyte[8] result64iso = hash64iso.finish();
}
///
@safe unittest
{
//Let's use the template features:
//Note: When passing a CRC32 to a function, it must be passed by reference!
void doSomething(T)(ref T hash)
if (isDigest!T)
{
hash.put(cast(ubyte) 0);
}
CRC32 crc32;
crc32.start();
doSomething(crc32);
assert(crcHexString(crc32.finish()) == "D202EF8D");
// repeat for CRC64
CRC64ECMA crc64ecma;
crc64ecma.start();
doSomething(crc64ecma);
assert(crcHexString(crc64ecma.finish()) == "1FADA17364673F59");
CRC64ISO crc64iso;
crc64iso.start();
doSomething(crc64iso);
assert(crcHexString(crc64iso.finish()) == "6F90000000000000");
}
@safe unittest
{
assert(isDigest!CRC32);
assert(isDigest!CRC64ECMA);
assert(isDigest!CRC64ISO);
}
@system unittest
{
import std.conv : hexString;
ubyte[4] digest;
CRC32 crc;
crc.put(cast(ubyte[])"abcdefghijklmnopqrstuvwxyz");
assert(crc.peek() == cast(ubyte[]) hexString!"bd50274c");
crc.start();
crc.put(cast(ubyte[])"");
assert(crc.finish() == cast(ubyte[]) hexString!"00000000");
digest = crc32Of("");
assert(digest == cast(ubyte[]) hexString!"00000000");
//Test vector from http://rosettacode.org/wiki/CRC-32
assert(crcHexString(crc32Of("The quick brown fox jumps over the lazy dog")) == "414FA339");
digest = crc32Of("a");
assert(digest == cast(ubyte[]) hexString!"43beb7e8");
digest = crc32Of("abc");
assert(digest == cast(ubyte[]) hexString!"c2412435");
digest = crc32Of("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");
assert(digest == cast(ubyte[]) hexString!"5f3f1a17");
digest = crc32Of("message digest");
assert(digest == cast(ubyte[]) hexString!"7f9d1520");
digest = crc32Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
assert(digest == cast(ubyte[]) hexString!"d2e6c21f");
digest = crc32Of("1234567890123456789012345678901234567890"~
"1234567890123456789012345678901234567890");
assert(digest == cast(ubyte[]) hexString!"724aa97c");
enum ubyte[4] input = cast(ubyte[4]) hexString!"c3fcd3d7";
assert(crcHexString(input) == "D7D3FCC3");
}
@system unittest
{
import std.conv : hexString;
ubyte[8] digest;
CRC64ECMA crc;
crc.put(cast(ubyte[])"abcdefghijklmnopqrstuvwxyz");
assert(crc.peek() == cast(ubyte[]) hexString!"2f121b7575789626");
crc.start();
crc.put(cast(ubyte[])"");
assert(crc.finish() == cast(ubyte[]) hexString!"0000000000000000");
digest = crc64ECMAOf("");
assert(digest == cast(ubyte[]) hexString!"0000000000000000");
//Test vector from http://rosettacode.org/wiki/CRC-32
assert(crcHexString(crc64ECMAOf("The quick brown fox jumps over the lazy dog")) == "5B5EB8C2E54AA1C4");
digest = crc64ECMAOf("a");
assert(digest == cast(ubyte[]) hexString!"052b652e77840233");
digest = crc64ECMAOf("abc");
assert(digest == cast(ubyte[]) hexString!"2776271a4a09d82c");
digest = crc64ECMAOf("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");
assert(digest == cast(ubyte[]) hexString!"4b7cdce3746c449f");
digest = crc64ECMAOf("message digest");
assert(digest == cast(ubyte[]) hexString!"6f9b8a3156c9bc5d");
digest = crc64ECMAOf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
assert(digest == cast(ubyte[]) hexString!"2656b716e1bf0503");
digest = crc64ECMAOf("1234567890123456789012345678901234567890"~
"1234567890123456789012345678901234567890");
assert(digest == cast(ubyte[]) hexString!"bd3eb7765d0a22ae");
enum ubyte[8] input = cast(ubyte[8]) hexString!"c3fcd3d7efbeadde";
assert(crcHexString(input) == "DEADBEEFD7D3FCC3");
}
@system unittest
{
import std.conv : hexString;
ubyte[8] digest;
CRC64ISO crc;
crc.put(cast(ubyte[])"abcdefghijklmnopqrstuvwxyz");
assert(crc.peek() == cast(ubyte[]) hexString!"f0494ab780989b42");
crc.start();
crc.put(cast(ubyte[])"");
assert(crc.finish() == cast(ubyte[]) hexString!"0000000000000000");
digest = crc64ISOOf("");
assert(digest == cast(ubyte[]) hexString!"0000000000000000");
//Test vector from http://rosettacode.org/wiki/CRC-32
assert(crcHexString(crc64ISOOf("The quick brown fox jumps over the lazy dog")) == "4EF14E19F4C6E28E");
digest = crc64ISOOf("a");
assert(digest == cast(ubyte[]) hexString!"0000000000002034");
digest = crc64ISOOf("abc");
assert(digest == cast(ubyte[]) hexString!"0000000020c47637");
digest = crc64ISOOf("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");
assert(digest == cast(ubyte[]) hexString!"5173f717971365e5");
digest = crc64ISOOf("message digest");
assert(digest == cast(ubyte[]) hexString!"a2c355bbc0b93f86");
digest = crc64ISOOf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
assert(digest == cast(ubyte[]) hexString!"598B258292E40084");
digest = crc64ISOOf("1234567890123456789012345678901234567890"~
"1234567890123456789012345678901234567890");
assert(digest == cast(ubyte[]) hexString!"760cd2d3588bf809");
enum ubyte[8] input = cast(ubyte[8]) hexString!"c3fcd3d7efbeadde";
assert(crcHexString(input) == "DEADBEEFD7D3FCC3");
}
/**
* This is a convenience alias for $(REF digest, std,digest) using the
* CRC32 implementation.
*
* Params:
* data = $(D InputRange) of $(D ElementType) implicitly convertible to
* $(D ubyte), $(D ubyte[]) or $(D ubyte[num]) or one or more arrays
* of any type.
*
* Returns:
* CRC32 of data
*/
//simple alias doesn't work here, hope this gets inlined...
ubyte[4] crc32Of(T...)(T data)
{
return digest!(CRC32, T)(data);
}
///
@system unittest
{
ubyte[] data = [4,5,7,25];
assert(data.crc32Of == [167, 180, 199, 131]);
import std.utf : byChar;
assert("hello"d.byChar.crc32Of == [134, 166, 16, 54]);
ubyte[4] hash = "abc".crc32Of();
assert(hash == digest!CRC32("ab", "c"));
import std.range : iota;
enum ubyte S = 5, F = 66;
assert(iota(S, F).crc32Of == [59, 140, 234, 154]);
}
/**
* This is a convenience alias for $(REF digest, std,digest) using the
* CRC64-ECMA implementation.
*
* Params:
* data = $(D InputRange) of $(D ElementType) implicitly convertible to
* $(D ubyte), $(D ubyte[]) or $(D ubyte[num]) or one or more arrays
* of any type.
*
* Returns:
* CRC64-ECMA of data
*/
//simple alias doesn't work here, hope this gets inlined...
ubyte[8] crc64ECMAOf(T...)(T data)
{
return digest!(CRC64ECMA, T)(data);
}
///
@system unittest
{
ubyte[] data = [4,5,7,25];
assert(data.crc64ECMAOf == [58, 142, 220, 214, 118, 98, 105, 69]);
import std.utf : byChar;
assert("hello"d.byChar.crc64ECMAOf == [177, 55, 185, 219, 229, 218, 30, 155]);
ubyte[8] hash = "abc".crc64ECMAOf();
assert("abc".crc64ECMAOf == [39, 118, 39, 26, 74, 9, 216, 44]);
assert(hash == digest!CRC64ECMA("ab", "c"));
import std.range : iota;
enum ubyte S = 5, F = 66;
assert(iota(S, F).crc64ECMAOf == [6, 184, 91, 238, 46, 213, 127, 188]);
}
/**
* This is a convenience alias for $(REF digest, std,digest,digest) using the
* CRC64-ISO implementation.
*
* Params:
* data = $(D InputRange) of $(D ElementType) implicitly convertible to
* $(D ubyte), $(D ubyte[]) or $(D ubyte[num]) or one or more arrays
* of any type.
*
* Returns:
* CRC64-ISO of data
*/
//simple alias doesn't work here, hope this gets inlined...
ubyte[8] crc64ISOOf(T...)(T data)
{
return digest!(CRC64ISO, T)(data);
}
///
@system unittest
{
ubyte[] data = [4,5,7,25];
assert(data.crc64ISOOf == [0, 0, 0, 80, 137, 232, 203, 120]);
import std.utf : byChar;
assert("hello"d.byChar.crc64ISOOf == [0, 0, 16, 216, 226, 238, 62, 60]);
ubyte[8] hash = "abc".crc64ISOOf();
assert("abc".crc64ISOOf == [0, 0, 0, 0, 32, 196, 118, 55]);
assert(hash == digest!CRC64ISO("ab", "c"));
import std.range : iota;
enum ubyte S = 5, F = 66;
assert(iota(S, F).crc64ISOOf == [21, 185, 116, 95, 219, 11, 54, 7]);
}
/**
* producing the usual CRC32 string output.
*/
public alias crcHexString = toHexString!(Order.decreasing);
///ditto
public alias crcHexString = toHexString!(Order.decreasing, 16);
/**
* OOP API CRC32 implementation.
* See $(D std.digest) for differences between template and OOP API.
*
* This is an alias for $(D $(REF WrapperDigest, std,digest)!CRC32), see
* there for more information.
*/
alias CRC32Digest = WrapperDigest!CRC32;
/**
* OOP API CRC64-ECMA implementation.
* See $(D std.digest.digest) for differences between template and OOP API.
*
* This is an alias for $(D $(REF WrapperDigest, std,digest,digest)!CRC64ECMA),
* see there for more information.
*/
alias CRC64ECMADigest = WrapperDigest!CRC64ECMA;
/**
* OOP API CRC64-ISO implementation.
* See $(D std.digest.digest) for differences between template and OOP API.
*
* This is an alias for $(D $(REF WrapperDigest, std,digest,digest)!CRC64ISO),
* see there for more information.
*/
alias CRC64ISODigest = WrapperDigest!CRC64ISO;
///
@safe unittest
{
//Simple example, hashing a string using Digest.digest helper function
auto crc = new CRC32Digest();
ubyte[] hash = crc.digest("abc");
//Let's get a hash string
assert(crcHexString(hash) == "352441C2");
}
///
@system unittest
{
//Let's use the OOP features:
void test(Digest dig)
{
dig.put(cast(ubyte) 0);
}
auto crc = new CRC32Digest();
test(crc);
//Let's use a custom buffer:
ubyte[4] buf;
ubyte[] result = crc.finish(buf[]);
assert(crcHexString(result) == "D202EF8D");
}
///
@safe unittest
{
//Simple example
auto hash = new CRC32Digest();
hash.put(cast(ubyte) 0);
ubyte[] result = hash.finish();
}
///
@system unittest
{
//using a supplied buffer
ubyte[4] buf;
auto hash = new CRC32Digest();
hash.put(cast(ubyte) 0);
ubyte[] result = hash.finish(buf[]);
//The result is now in result (and in buf. If you pass a buffer which is bigger than
//necessary, result will have the correct length, but buf will still have it's original
//length)
}
@system unittest
{
import std.conv : hexString;
import std.range;
auto crc = new CRC32Digest();
crc.put(cast(ubyte[])"abcdefghijklmnopqrstuvwxyz");
assert(crc.peek() == cast(ubyte[]) hexString!"bd50274c");
crc.reset();
crc.put(cast(ubyte[])"");
assert(crc.finish() == cast(ubyte[]) hexString!"00000000");
crc.put(cast(ubyte[])"abcdefghijklmnopqrstuvwxyz");
ubyte[20] result;
auto result2 = crc.finish(result[]);
assert(result[0 .. 4] == result2 && result2 == cast(ubyte[]) hexString!"bd50274c");
debug
assertThrown!Error(crc.finish(result[0 .. 3]));
assert(crc.length == 4);
assert(crc.digest("") == cast(ubyte[]) hexString!"00000000");
assert(crc.digest("a") == cast(ubyte[]) hexString!"43beb7e8");
assert(crc.digest("abc") == cast(ubyte[]) hexString!"c2412435");
assert(crc.digest("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")
== cast(ubyte[]) hexString!"5f3f1a17");
assert(crc.digest("message digest") == cast(ubyte[]) hexString!"7f9d1520");
assert(crc.digest("abcdefghijklmnopqrstuvwxyz")
== cast(ubyte[]) hexString!"bd50274c");
assert(crc.digest("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
== cast(ubyte[]) hexString!"d2e6c21f");
assert(crc.digest("1234567890123456789012345678901234567890",
"1234567890123456789012345678901234567890")
== cast(ubyte[]) hexString!"724aa97c");
ubyte[] onemilliona = new ubyte[1000000];
onemilliona[] = 'a';
auto digest = crc32Of(onemilliona);
assert(digest == cast(ubyte[]) hexString!"BCBF25DC");
auto oneMillionRange = repeat!ubyte(cast(ubyte)'a', 1000000);
digest = crc32Of(oneMillionRange);
assert(digest == cast(ubyte[]) hexString!"BCBF25DC");
}
|
D
|
module d.gc.run;
struct RunDesc {
import d.gc.rbtree;
Node!RunDesc node;
// TODO: anonymous enum.
union U {
DirtyRunMisc dirty;
SmallRunMisc small;
}
U misc;
@property
auto chunk() {
import d.gc.chunk, d.gc.spec;
return cast(Chunk*) ((cast(size_t) &this) & ~AlignMask);
}
@property
uint index() {
auto offset = (cast(uint) &this) - (cast(uint) &chunk.runs[0]);
return offset / RunDesc.sizeof;
}
}
ptrdiff_t addrRunCmp(RunDesc* lhs, RunDesc* rhs) {
auto l = cast(size_t) lhs;
auto r = cast(size_t) rhs;
// We need to compare that way to avoid integer overflow.
return (l > r) - (l < r);
}
ptrdiff_t sizeAddrRunCmp(RunDesc* lhs, RunDesc* rhs) {
import d.gc.sizeclass;
int rBinID = rhs.chunk.pages[rhs.index].binID;
auto rsize = rhs.chunk.pages[rhs.index].size;
assert(rBinID == getBinID(rsize + 1) - 1);
auto l = cast(size_t) lhs;
int lBinID;
import d.gc.spec;
if (l & ~PageMask) {
lBinID = lhs.chunk.pages[lhs.index].binID;
auto lsize = lhs.chunk.pages[lhs.index].size;
assert(lBinID == getBinID(lsize + 1) - 1);
} else {
lhs = null;
lBinID = cast(int) (l & PageMask);
}
return (lBinID == rBinID)
? addrRunCmp(lhs, rhs)
: lBinID - rBinID;
}
private:
struct DirtyRunMisc {
RunDesc* next;
RunDesc* prev;
}
struct SmallRunMisc {
ubyte binID;
ushort freeSlots;
ushort header;
uint[16] bitmap;
uint allocate() {
// TODO: in contracts.
assert(freeSlots > 0);
// TODO: Use bsr when available.
uint hindex;
for (hindex = 0; hindex < 16; hindex++) {
if (header & 1 << hindex) {
break;
}
}
assert(hindex < 16, "Cannot allocate from that run");
// TODO: Use bsr when available.
for (uint bindex = 0; bindex < 32; bindex++) {
if (bitmap[hindex] & (1 << bindex)) {
// Use xor so we don't need to invert bits.
// It is ok as we assert the bit is unset before.
bitmap[hindex] ^= (1 << bindex);
// If we unset all bits, unset header.
if (bitmap[hindex] == 0) {
header ^= cast(ushort) (1 << hindex);
}
freeSlots--;
return hindex * 32 + bindex;
}
}
assert(0, "Invalid bitmap");
}
bool isFree(uint bit) const {
// TODO: in contract.
assert(bit < 512);
auto hindex = bit / 32;
auto bindex = bit % 32;
// TODO: in contract.
assert(hindex < 16);
return !!(bitmap[hindex] & (1 << bindex));
}
void free(uint bit) {
// TODO: in contract.
assert(bit < 512);
assert(!isFree(bit), "Already freed");
auto hindex = bit / 32;
auto bindex = bit % 32;
// TODO: in contract.
assert(hindex < 16);
freeSlots++;
header |= cast(ushort) (1 << hindex);
bitmap[hindex] |= (1 << bindex);
}
}
|
D
|
/Users/Amna/Downloads/code /target/debug/build/num-rational-4fb5a3a0cba5e9eb/build_script_build-4fb5a3a0cba5e9eb: /Users/Amna/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.3.2/build.rs
/Users/Amna/Downloads/code /target/debug/build/num-rational-4fb5a3a0cba5e9eb/build_script_build-4fb5a3a0cba5e9eb.d: /Users/Amna/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.3.2/build.rs
/Users/Amna/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.3.2/build.rs:
|
D
|
to gain with effort
reach a point in time, or a certain state or level
find unexpectedly
reach a destination, either real or abstract
achieved or reached
|
D
|
INSTANCE Info_Mod_Richter_Hi (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Hi_Condition;
information = Info_Mod_Richter_Hi_Info;
permanent = 0;
important = 0;
description = "Wer bist du?";
};
FUNC INT Info_Mod_Richter_Hi_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Richter_Hi_Info()
{
B_Say (hero, self, "$WHOAREYOU");
AI_Output(self, hero, "Info_Mod_Richter_Hi_10_01"); //Wir sind die oberste Gerichtsinstanz Khoratas.
AI_Output(self, hero, "Info_Mod_Richter_Hi_10_02"); //Wir entscheiden über Wohlstand und Armut, Hass und Rache, Leben und Tod.
AI_Output(self, hero, "Info_Mod_Richter_Hi_10_03"); //Doch gerade jetzt entscheiden Wir nur über den nächsten Gang bei Unserem Mahl.
};
INSTANCE Info_Mod_Richter_UlrichVerpetzen (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_UlrichVerpetzen_Condition;
information = Info_Mod_Richter_UlrichVerpetzen_Info;
permanent = 0;
important = 0;
description = "Ulrich hat vor, den Prozess von Anna zu sabotieren.";
};
FUNC INT Info_Mod_Richter_UlrichVerpetzen_Condition()
{
if (Mod_AnnaQuest == 4)
&& (Npc_KnowsInfo(hero, Info_Mod_Richter_Hi))
{
return 1;
};
};
FUNC VOID Info_Mod_Richter_UlrichVerpetzen_Info()
{
AI_Output(hero, self, "Info_Mod_Richter_UlrichVerpetzen_15_00"); //Ulrich hat vor, den Prozess von Anna zu sabotieren.
AI_Output(self, hero, "Info_Mod_Richter_UlrichVerpetzen_10_01"); //Ja? Ist ihm durchaus zuzutrauen. Was will er tun?
AI_Output(hero, self, "Info_Mod_Richter_UlrichVerpetzen_15_02"); //Er will euch alle töten, solltet ihr Anna verurteilen.
AI_Output(self, hero, "Info_Mod_Richter_UlrichVerpetzen_10_03"); //Hmm ... Dann wirst du ihm Einhalt gebieten.
AI_Output(hero, self, "Info_Mod_Richter_UlrichVerpetzen_15_04"); //Wieso ich?
AI_Output(self, hero, "Info_Mod_Richter_UlrichVerpetzen_10_05"); //Wir sind nicht ausgebildet im Kämpfen ... Wir haben Wichtigeres zu tun.
AI_Output(self, hero, "Info_Mod_Richter_UlrichVerpetzen_10_06"); //Sollte dieser Ulrich also wirklich versuchen, handgreiflich zu werden, wirst du ihn mit Hilfe Unserer Wachen niederschlagen.
AI_Output(self, hero, "Info_Mod_Richter_UlrichVerpetzen_10_07"); //Hast du das gehört?
AI_Output(hero, self, "Info_Mod_Richter_UlrichVerpetzen_15_08"); //Ja. Bis dann.
Mod_AnnaQuestRichter = 1;
B_LogEntry (TOPIC_MOD_KHORATA_HEXENWAHN, "Der Richter trägt mir auf, Ulrichs Aufstand niederzuschlagen. Da muss ich mich wohl für eine Seite entscheiden ...");
AI_StopProcessInfos (self);
};
INSTANCE Info_Mod_Richter_UlrichKO (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_UlrichKO_Condition;
information = Info_Mod_Richter_UlrichKO_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Richter_UlrichKO_Condition()
{
if (Mod_AnnaQuest == 10)
{
return 1;
};
};
FUNC VOID Info_Mod_Richter_UlrichKO_Info()
{
AI_Output(self, hero, "Info_Mod_Richter_UlrichKO_10_00"); //Adanos war uns wohlgesonnen. Hol dir deine Belohnung beim Stadthalter ab.
B_GivePlayerXP (50);
AI_StopProcessInfos (self);
B_StartOtherRoutine (Mod_7370_OUT_Ulrich_REL, "TOT");
B_StartOtherRoutine (Mod_7365_OUT_Margarethe_REL, "START");
B_StartOtherRoutine (Mod_7376_OUT_Anna_REL, "TOT");
B_StartOtherRoutine (Mod_7374_OUT_Gerichtswache_01, "START");
B_StartOtherRoutine (Mod_7375_OUT_Gerichtswache_02, "START");
AI_Teleport (Mod_7370_OUT_Ulrich_REL, "TOT");
CurrentNQ += 1;
Mod_REL_QuestCounter += 1;
};
INSTANCE Info_Mod_Richter_Plagenquest (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Plagenquest_Condition;
information = Info_Mod_Richter_Plagenquest_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Richter_Plagenquest_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Lukas_Plagenquest))
|| (Npc_KnowsInfo(hero, Info_Mod_Wendel_Plagenquest))
|| (Npc_KnowsInfo(hero, Info_Mod_Theodorus_Plagenquest))
{
return 1;
};
};
FUNC VOID Info_Mod_Richter_Plagenquest_Info()
{
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_00"); //Du hast gegen die Gesetze unserer Stadt verstoßen.
AI_Output(hero, self, "Info_Mod_Richter_Plagenquest_15_01"); //Wie bitte?! Was habe ich denn falsches gemacht?
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_02"); //Vor Unseren Augen hast du Insekten gejagt.
AI_Output(hero, self, "Info_Mod_Richter_Plagenquest_15_03"); //Aber wieso habe ich damit gegen geltendes Stadtrecht verstoßen?
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_04"); //In unseren Gesetzesbüchern steht geschrieben, dass das Jagen von Insekten innerhalb der Stadtgrenzen nur mit den eigens dafür vorgesehenen Stadthämmern gestattet ist.
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_05"); //Da du kein Bewohner der Stadt bist, kannst du einen solchen Hammer garnicht besitzen ... andernfalls hättest du dich des Diebstahles schuldig gemacht.
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_06"); //Hast du etwas zu deiner Verteidigung zu sagen?
AI_Output(hero, self, "Info_Mod_Richter_Plagenquest_15_07"); //Ich ...
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_08"); //Die Gesetze werden in aller strenge ausgelegt und das Urteil wird augenblicklich vollstreckt. Du erhälst ...
B_UseFakeScroll ();
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_09"); //... die Todesstrafe. Gerichtsdiener!
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_10"); //Ohh, halt, bin einige Zeilen verrutscht.
B_UseFakeScroll ();
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_11"); //Ähhm, also, das Urteil lautet ... verdammt, das kann ich nicht lesen, zu alt und ausgewaschen ...
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_12"); //Hmm, in dem Fall erlaubt es mir der Willkürparagraph zu entscheiden, dass du ähhh ...
AI_Output(hero, self, "Info_Mod_Richter_Plagenquest_15_13"); //Nun wird es mir aber langsam zu bunt ... Was soll überhaupt dieser Unsinn mit den Hämmern und dem Insektenjagen?
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_14"); //Frevler, spotte nicht unseren Stadtgesetzten. Das Stadthammergesetz existiert schon fast so lange, wie unsere Stadt steht ...
AI_Output(self, hero, "Info_Mod_Richter_Plagenquest_10_15"); //Und nun ... ach verdammt, du hast mich aus dem Konzept gebracht. Geh mir aus den Augen.
if (Mod_REL_Stadthalter == 1)
{
B_LogEntry (TOPIC_MOD_ADANOS_DRECKSVIECHER, "Na das ist mal wieder eine Spinnerei ... Stadthammergesetz ... und die Insekten sind auch wieder da. Ich sollte zu Theodorus gehen und schauen, ob er nicht etwas neues herausgefunden hat.");
}
else if (Mod_REL_Stadthalter == 2)
{
B_LogEntry (TOPIC_MOD_ADANOS_DRECKSVIECHER, "Na das ist mal wieder eine Spinnerei ... Stadthammergesetz ... und die Insekten sind auch wieder da. Ich sollte zu Wendel gehen und schauen, ob er nicht etwas neues herausgefunden hat.");
}
else
{
B_LogEntry (TOPIC_MOD_ADANOS_DRECKSVIECHER, "Na das ist mal wieder eine Spinnerei ... Stadthammergesetz ... und die Insekten sind auch wieder da. Ich sollte zu Lukas gehen und schauen, ob er nicht etwas neues herausgefunden hat.");
};
AI_StopProcessInfos (self);
B_GivePlayerXP (100);
Wld_InsertNpc (Insekt_01, "REL_CITY_340");
Wld_InsertNpc (Insekt_01, "REL_CITY_340");
Wld_InsertNpc (Insekt_01, "REL_CITY_340");
Wld_InsertNpc (Insekt_01, "REL_CITY_340");
Wld_InsertNpc (Insekt_01, "REL_CITY_340");
Wld_InsertNpc (Insekt_02, "REL_CITY_340");
Wld_InsertNpc (Insekt_02, "REL_CITY_340");
Wld_InsertNpc (Insekt_02, "REL_CITY_340");
Wld_InsertNpc (Insekt_02, "REL_CITY_340");
Wld_InsertNpc (Insekt_03, "REL_CITY_340");
Wld_InsertNpc (Insekt_03, "REL_CITY_340");
Wld_InsertNpc (Insekt_03, "REL_CITY_340");
Wld_InsertNpc (Insekt_03, "REL_CITY_340");
};
INSTANCE Info_Mod_Richter_Unfrieden (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Unfrieden_Condition;
information = Info_Mod_Richter_Unfrieden_Info;
permanent = 0;
important = 0;
description = "Ich soll dir das hier aushändigen.";
};
FUNC INT Info_Mod_Richter_Unfrieden_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Leonhard_Aufgabe))
&& (Npc_HasItems(hero, ItWr_LeonhardRichter) == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Richter_Unfrieden_Info()
{
AI_Output(hero, self, "Info_Mod_Richter_Unfrieden_15_00"); //Ich soll dir das hier aushändigen.
B_GiveInvItems (hero, self, ItWr_LeonhardRichter, 1);
AI_Output(self, hero, "DEFAULT"); //
B_UseFakeScroll ();
AI_Output(self, hero, "Info_Mod_Richter_Unfrieden_10_01"); //O Adanos, beschütze Uns! Das kann doch nicht sein Ernst sein!
AI_Output(hero, self, "Info_Mod_Richter_Unfrieden_15_02"); //Wirst du die Männer freilassen?
AI_Output(self, hero, "Info_Mod_Richter_Unfrieden_10_03"); //(nervös) Umgehend! Wir sind sicher, weitere complicaciones lassen sich vermeiden!
B_GivePlayerXP (50);
B_LogEntry (TOPIC_MOD_KHORATA_UNFRIEDEN, "Ich habe dem Richter die Nachricht überbracht. Dann sollte ich jetzt meinen Lohn abholen.");
Wld_InsertNpc (Mod_7420_OUT_Michael_REL, "REL_CITY_001");
Wld_InsertNpc (Mod_7421_OUT_Philipp_REL, "REL_CITY_001");
};
INSTANCE Info_Mod_Richter_Endres (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Endres_Condition;
information = Info_Mod_Richter_Endres_Info;
permanent = 1;
important = 0;
description = "Ich versuche den Mörder von Endres zu ermitteln.";
};
FUNC INT Info_Mod_Richter_Endres_Condition()
{
if (Mod_EndresIndizien == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Richter_Endres_Info()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_15_00"); //Ich versuche den Mörder von Endres zu ermitteln.
AI_Output(self, hero, "Info_Mod_Richter_Endres_10_01"); //Ja? Wir haben von diesem blutrünstigen Ereignis erfahren. Was konntest du herausfinden?
AI_Output(hero, self, "Info_Mod_Richter_Endres_15_02"); //Es gibt drei Verdächtige, die ich allesamt verhört habe.
AI_Output(self, hero, "Info_Mod_Richter_Endres_10_03"); //Zu welchen Schlüssen führen dich die Unterredungen? Lege dich fest und überlege wohl, bevor du antwortest.
AI_Output(self, hero, "Info_Mod_Richter_Endres_10_04"); //Die Gerichtsverhandlungen ersparen Wir Uns heute nämlich, weil Wir eine leichte Müdigkeit verspüren.
Info_ClearChoices (Info_Mod_Richter_Endres);
Info_AddChoice (Info_Mod_Richter_Endres, "Ich weiß es noch nicht.", Info_Mod_Richter_Endres_D);
if (Mod_RichterEndres_Juliana == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Juliana ist unschuldig.", Info_Mod_Richter_Endres_C);
};
if (Mod_RichterEndres_Arzt == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Der Heiler ist unschuldig.", Info_Mod_Richter_Endres_B);
};
if (Mod_RichterEndres_Wendel == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Wendel ist unschuldig.", Info_Mod_Richter_Endres_A);
};
};
FUNC VOID Info_Mod_Richter_Endres_E()
{
AI_Output(self, hero, "Info_Mod_Richter_Endres_E_10_00"); //Woher weißt du das?
};
FUNC VOID Info_Mod_Richter_Endres_H()
{
AI_Output(self, hero, "Info_Mod_Richter_Endres_H_10_00"); //Und wer ist noch unschuldig?
Info_ClearChoices (Info_Mod_Richter_Endres);
Info_AddChoice (Info_Mod_Richter_Endres, "Ich weiß es noch nicht.", Info_Mod_Richter_Endres_D);
if (Mod_RichterEndres_Juliana == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Juliana ist unschuldig.", Info_Mod_Richter_Endres_C);
};
if (Mod_RichterEndres_Arzt == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Der Heiler ist unschuldig.", Info_Mod_Richter_Endres_B);
};
if (Mod_RichterEndres_Wendel == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Wendel ist unschuldig.", Info_Mod_Richter_Endres_A);
};
};
FUNC VOID Info_Mod_Richter_Endres_I()
{
AI_Output(self, hero, "Info_Mod_Richter_Endres_I_10_00"); //Dann könnte der Heiler der Täter sein?
AI_Output(hero, self, "Info_Mod_Richter_Endres_I_15_01"); //So ist es.
AI_Output(self, hero, "Info_Mod_Richter_Endres_I_10_02"); //Dann gehe hin und finde Beweise!
Mod_EndresIndizien = 2;
B_LogEntry (TOPIC_MOD_KHORATA_ENDRES, "Ich soll nun Beweise dafür finden, dass der Heiler der Täter ist.");
Info_ClearChoices (Info_Mod_Richter_Endres);
};
FUNC VOID Info_Mod_Richter_Endres_D()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_D_15_00"); //Ich weiß es noch nicht.
AI_Output(self, hero, "Info_Mod_Richter_Endres_D_10_01"); //Dann bring es in Erfahrung!
Info_ClearChoices (Info_Mod_Richter_Endres);
};
FUNC VOID Info_Mod_Richter_Endres_C()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_C_15_00"); //Juliana ist unschuldig.
Info_Mod_Richter_Endres_E();
Info_ClearChoices (Info_Mod_Richter_Endres);
if (Npc_KnowsInfo(hero, Info_Mod_Roman_REL_Hi))
{
Info_AddChoice (Info_Mod_Richter_Endres, "Der Täter ist männlich.", Info_Mod_Richter_Endres_G);
};
Info_AddChoice (Info_Mod_Richter_Endres, "Das sagt mir mein Gefühl.", Info_Mod_Richter_Endres_F);
};
FUNC VOID Info_Mod_Richter_Endres_B()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_B_15_00"); //Der Heiler ist unschuldig.
Info_Mod_Richter_Endres_E();
Info_ClearChoices (Info_Mod_Richter_Endres);
Info_AddChoice (Info_Mod_Richter_Endres, "Das sagt mir mein Gefühl.", Info_Mod_Richter_Endres_F);
};
FUNC VOID Info_Mod_Richter_Endres_A()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_A_15_00"); //Wendel ist unschuldig.
Info_Mod_Richter_Endres_E();
Info_ClearChoices (Info_Mod_Richter_Endres);
if (Npc_KnowsInfo(hero, Info_Mod_Monteur_Endres))
{
Info_AddChoice (Info_Mod_Richter_Endres, "Er hat ein Alibi.", Info_Mod_Richter_Endres_J);
};
Info_AddChoice (Info_Mod_Richter_Endres, "Das sagt mir mein Gefühl.", Info_Mod_Richter_Endres_F);
};
FUNC VOID Info_Mod_Richter_Endres_G()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_G_15_00"); //Der Täter ist männlich.
Mod_RichterEndres_Juliana = 1;
if (Mod_RichterEndres_Wendel == 0)
{
Info_Mod_Richter_Endres_H();
}
else
{
Info_Mod_Richter_Endres_I();
};
};
FUNC VOID Info_Mod_Richter_Endres_J()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_J_15_00"); //Er hat ein Alibi.
Mod_RichterEndres_Wendel = 1;
if (Mod_RichterEndres_Juliana == 0)
{
Info_Mod_Richter_Endres_H();
}
else
{
Info_Mod_Richter_Endres_I();
};
};
FUNC VOID Info_Mod_Richter_Endres_F()
{
AI_Output(hero, self, "Info_Mod_Richter_Endres_F_15_00"); //Das sagt mir mein Gefühl.
AI_Output(self, hero, "Info_Mod_Richter_Endres_F_10_01"); //Dein Gefühl ist nicht gut genug!
Info_ClearChoices (Info_Mod_Richter_Endres);
Info_AddChoice (Info_Mod_Richter_Endres, "Ich weiß es noch nicht.", Info_Mod_Richter_Endres_D);
if (Mod_RichterEndres_Juliana == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Juliana ist unschuldig.", Info_Mod_Richter_Endres_C);
};
if (Mod_RichterEndres_Arzt == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Der Heiler ist unschuldig.", Info_Mod_Richter_Endres_B);
};
if (Mod_RichterEndres_Wendel == 0)
{
Info_AddChoice (Info_Mod_Richter_Endres, "Wendel ist unschuldig.", Info_Mod_Richter_Endres_A);
};
};
INSTANCE Info_Mod_Richter_Endres02 (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Endres02_Condition;
information = Info_Mod_Richter_Endres02_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Richter_Endres02_Condition()
{
if (Mod_EndresIndizien == 4)
|| (Mod_EndresIndizien == 5)
{
return 1;
};
};
FUNC VOID Info_Mod_Richter_Endres02_Info()
{
if (Mod_EndresIndizien == 4)
{
AI_Output(self, hero, "Info_Mod_Richter_Endres02_10_00"); //(übellaunig) Du hast zwar einen Verbrecher gestellt, aber Fingerspitzengefühl hast du nicht bewiesen.
}
else
{
AI_Output(self, hero, "Info_Mod_Richter_Endres02_10_01"); //(wohlwollend) Wir müssen dir für deine Hilfe in diesem Fall danken. So etwas Entsetzliches darf nicht wieder passieren.
};
AI_Output(hero, self, "Info_Mod_Richter_Endres02_15_02"); //Was geschieht nun mit dem Heiler?
AI_Output(self, hero, "Info_Mod_Richter_Endres02_10_03"); //Wir lassen ihn vierteilen, hängen oder köpfen, je nach Unserer Laune.
AI_Output(hero, self, "Info_Mod_Richter_Endres02_15_04"); //Muss er mit dem Tod gestraft werden?
AI_Output(self, hero, "Info_Mod_Richter_Endres02_10_05"); //Die Leute wollen es so, glaube Uns. Wie unzufrieden wären sie, könnten sie den Schuldigen nicht büßen sehen.
AI_Output(self, hero, "Info_Mod_Richter_Endres02_10_06"); //Nun aber lass uns nicht mehr darüber reden.
if (Mod_EndresIndizien == 4)
{
AI_Output(self, hero, "Info_Mod_Richter_Endres02_10_07"); //Die Klatschweiber werden es noch ausführlich tun.
B_GivePlayerXP (200);
B_LogEntry (TOPIC_MOD_KHORATA_ENDRES, "Ich habe den Heiler selbstständig zur Strecke gebracht.");
}
else
{
AI_Output(self, hero, "Info_Mod_Richter_Endres02_10_08"); //Es gibt denkbar Erfreulicheres. Anselm hat verfügt, dass du diesen Trank als Belohnung für deine Dienste erhalten sollst.
B_GiveInvItems (self, hero, ItPo_Perm_Health, 1);
B_GivePlayerXP (400);
B_LogEntry (TOPIC_MOD_KHORATA_ENDRES, "Ich habe den mörderischen Heiler an die Justiz übergeben.");
};
B_SetTopicStatus (TOPIC_MOD_KHORATA_ENDRES, LOG_SUCCESS);
CurrentNQ += 1;
Mod_REL_QuestCounter += 1;
};
INSTANCE Info_Mod_Richter_Glorie (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Glorie_Condition;
information = Info_Mod_Richter_Glorie_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Richter_Glorie_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Jesper_REL_Glorie2))
{
return TRUE;
};
};
FUNC VOID Info_Mod_Richter_Glorie_Info()
{
AI_Output(self, hero, "Info_Mod_Richter_Glorie_10_00"); //Ahh, schön euch zu treffen, Gelehrter. Ich wollte noch unbedingt etwas mit euch erörtern.
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "CASSIA");
B_StartOtherRoutine (Mod_7705_OUT_Cassia_REL, "RICHTER");
};
INSTANCE Info_Mod_Richter_Freudenspender (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Freudenspender_Condition;
information = Info_Mod_Richter_Freudenspender_Info;
permanent = 0;
important = 0;
description = "Lust auf Freudenspender?";
};
FUNC INT Info_Mod_Richter_Freudenspender_Condition()
{
if (Npc_HasItems(hero, ItMi_Freudenspender) >= 1)
&& (Mod_Freudenspender < 5)
&& (Npc_KnowsInfo(hero, Info_Mod_Sabine_Hi))
{
return TRUE;
};
};
FUNC VOID Info_Mod_Richter_Freudenspender_Info()
{
AI_Output(hero, self, "Info_Mod_Richter_Freudenspender_15_00"); //Lust auf Freudenspender?
AI_Output(self, hero, "Info_Mod_Richter_Freudenspender_10_01"); //Wir hätten lieber ein gutes Essen und eine spannende Verhandlung.
};
var int Richter_LastPetzCounter;
var int Richter_LastPetzCrime;
INSTANCE Info_Mod_Richter_PMSchulden (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_PMSchulden_Condition;
information = Info_Mod_Richter_PMSchulden_Info;
permanent = 1;
important = 1;
};
FUNC INT Info_Mod_Richter_PMSchulden_Condition()
{
if (Npc_IsInState(self, ZS_Talk))
&& (Richter_Schulden > 0)
&& (B_GetGreatestPetzCrime(self) <= Richter_LastPetzCrime)
{
return TRUE;
};
};
FUNC VOID Info_Mod_Richter_PMSchulden_Info()
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_00"); //Bist du gekommen, um deine Strafe zu zahlen?
if (B_GetTotalPetzCounter(self) > Richter_LastPetzCounter)
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_01"); //Ich hatte mich schon gefragt, ob du es überhaupt noch wagst, hierher zu kommen!
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_02"); //Anscheinend ist es nicht bei den letzten Anschuldigungen geblieben!
if (Richter_Schulden < 1000)
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_03"); //Ich hatte dich gewarnt! Die Strafe, die du jetzt zahlen musst, ist höher!
AI_Output (hero, self, "Info_Mod_Richter_PMAdd_15_00"); //Wieviel?
var int diff; diff = (B_GetTotalPetzCounter(self) - Richter_LastPetzCounter);
if (diff > 0)
{
Richter_Schulden = Richter_Schulden + (diff * 50);
};
if (Richter_Schulden > 1000) { Richter_Schulden = 1000; };
B_Say_Gold (self, hero, Richter_Schulden);
}
else
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_04"); //Du hast mich schwer enttäuscht!
};
}
else if (B_GetGreatestPetzCrime(self) < Richter_LastPetzCrime)
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_05"); //Es haben sich einige neue Dinge ergeben.
if (Richter_LastPetzCrime == CRIME_MURDER)
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_06"); //Plötzlich gibt es niemanden mehr, der dich des Mordes bezichtigt.
};
if (Richter_LastPetzCrime == CRIME_THEFT)
|| ( (Richter_LastPetzCrime > CRIME_THEFT) && (B_GetGreatestPetzCrime(self) < CRIME_THEFT) )
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_07"); //Niemand erinnert sich mehr, dich bei einem Diebstahl gesehen zu haben.
};
if (Richter_LastPetzCrime == CRIME_ATTACK)
|| ( (Richter_LastPetzCrime > CRIME_ATTACK) && (B_GetGreatestPetzCrime(self) < CRIME_ATTACK) )
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_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_Richter_PMSchulden_10_09"); //Anscheinend haben sich alle Anklagen gegen dich in Wohlgefallen aufgelöst.
};
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_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_Richter_PMSchulden_10_11"); //Ich habe mich jedenfalls entschieden, dir deine Schulden zu erlassen.
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_12"); //Sieh zu, dass du nicht wieder in Schwierigkeiten kommst.
Richter_Schulden = 0;
Richter_LastPetzCounter = 0;
Richter_LastPetzCrime = CRIME_NONE;
}
else
{
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_13"); //Damit eins klar ist: Deine Strafe musst du trotzdem in voller Höhe zahlen.
B_Say_Gold (self, hero, Richter_Schulden);
AI_Output (self, hero, "Info_Mod_Richter_PMSchulden_10_14"); //Also, was ist?
};
};
// ------ Choices NUR, wenn noch Crime vorliegt ------
if (B_GetGreatestPetzCrime(self) != CRIME_NONE)
{
Info_ClearChoices (Info_Mod_Richter_PMSchulden);
Info_ClearChoices (Info_Mod_Richter_PETZMASTER);
Info_AddChoice (Info_Mod_Richter_PMSchulden,"Ich habe nicht genug Gold!",Info_Mod_Richter_PETZMASTER_PayLater);
Info_AddChoice (Info_Mod_Richter_PMSchulden,"Wieviel war es nochmal?",Info_Mod_Richter_PMSchulden_HowMuchAgain);
if (Npc_HasItems(hero, itmi_gold) >= Richter_Schulden)
{
Info_AddChoice (Info_Mod_Richter_PMSchulden,"Ich will die Strafe zahlen.",Info_Mod_Richter_PETZMASTER_PayNow);
};
};
};
func void Info_Mod_Richter_PMSchulden_HowMuchAgain()
{
AI_Output (hero, self, "Info_Mod_Richter_PMSchulden_HowMuchAgain_15_00"); //Wie viel war es noch mal?
B_Say_Gold (self, hero, Richter_Schulden);
Info_ClearChoices (Info_Mod_Richter_PMSchulden);
Info_ClearChoices (Info_Mod_Richter_PETZMASTER);
Info_AddChoice (Info_Mod_Richter_PMSchulden,"Ich habe nicht genug Gold!",Info_Mod_Richter_PETZMASTER_PayLater);
Info_AddChoice (Info_Mod_Richter_PMSchulden,"Wieviel war es nochmal?",Info_Mod_Richter_PMSchulden_HowMuchAgain);
if (Npc_HasItems(hero, itmi_gold) >= Richter_Schulden)
{
Info_AddChoice (Info_Mod_Richter_PMSchulden,"Ich will die Strafe zahlen.",Info_Mod_Richter_PETZMASTER_PayNow);
};
};
INSTANCE Info_Mod_Richter_PETZMASTER (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_PETZMASTER_Condition;
information = Info_Mod_Richter_PETZMASTER_Info;
permanent = 1;
important = 1;
};
FUNC INT Info_Mod_Richter_PETZMASTER_Condition()
{
if (B_GetGreatestPetzCrime(self) > Richter_LastPetzCrime)
{
return TRUE;
};
};
FUNC VOID Info_Mod_Richter_PETZMASTER_Info()
{
Richter_Schulden = 0; //weil Funktion nochmal durchlaufen wird, wenn Crime höher ist...
if (B_GetGreatestPetzCrime(self) == CRIME_MURDER)
{
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_01"); //Gut, dass du zu mir kommst, bevor alles noch schlimmer für dich wird.
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_02"); //Mord ist ein schweres Vergehen!
Richter_Schulden = (B_GetTotalPetzCounter(self) * 50); //Anzahl der Zeugen * 50
Richter_Schulden = Richter_Schulden + 500; //PLUS Mörder-Malus
if ((PETZCOUNTER_City_Theft + PETZCOUNTER_City_Attack + PETZCOUNTER_City_Sheepkiller) > 0)
{
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_03"); //Ganz zu schweigen von den anderen Sachen, die du angerichtet hast.
};
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_04"); //Die Wachen haben Befehl, jeden Mörder auf der Stelle zu richten.
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_05"); //Und auch die meisten Bürger werden einen Mörder im Lager nicht dulden!
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_06"); //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_Richter_PETZMASTER_10_07"); //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_Richter_PETZMASTER_10_08"); //Von den anderen Dingen, die mir zu Ohren gekommen sind, will ich gar nicht erst reden.
};
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_09"); //Ich werde so ein Verhalten im Lager nicht dulden!
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_10"); //Du wirst eine Strafe zahlen müssen, um dein Verbrechen wieder gutzumachen!
Richter_Schulden = (B_GetTotalPetzCounter(self) * 50); //Anzahl der Zeugen * 50
};
if (B_GetGreatestPetzCrime(self) == CRIME_ATTACK)
{
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_11"); //Du kannst nicht einfach wahllos Leute angreifen. Dafür werde ich dich zur Rechenschaft ziehen.
if (PETZCOUNTER_City_Sheepkiller > 0)
{
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_12"); //Und die Sache mit den Schafen musste wohl auch nicht sein.
};
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_13"); //Wenn ich dir das durchgehen lasse, macht hier bald jeder, was er will.
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_14"); //Also wirst du eine angemessene Strafe zahlen - und die Sache ist vergessen.
Richter_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_Richter_PETZMASTER_10_15"); //Mir ist zu Ohren gekommen, du hättest dich an unseren Schafen vergriffen.
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_16"); //Dir ist klar, dass ich das nicht durchgehen lassen kann.
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_10_17"); //Du wirst eine Entschädigung zahlen müssen!
Richter_Schulden = 100;
};
AI_Output (hero, self, "Info_Mod_Richter_PETZMASTER_15_18"); //Wie viel?
if (Richter_Schulden > 1000) { Richter_Schulden = 1000; };
B_Say_Gold (self, hero, Richter_Schulden);
Info_ClearChoices (Info_Mod_Richter_PMSchulden);
Info_ClearChoices (Info_Mod_Richter_PETZMASTER);
Info_AddChoice (Info_Mod_Richter_PETZMASTER,"Ich habe nicht genug Gold!",Info_Mod_Richter_PETZMASTER_PayLater);
if (Npc_HasItems(hero, itmi_gold) >= Richter_Schulden)
{
Info_AddChoice (Info_Mod_Richter_PETZMASTER,"Ich will die Strafe zahlen.",Info_Mod_Richter_PETZMASTER_PayNow);
};
};
func void Info_Mod_Richter_PETZMASTER_PayNow()
{
AI_Output (hero, self, "Info_Mod_Richter_PETZMASTER_PayNow_15_00"); //Ich will die Strafe zahlen!
B_GiveInvItems (hero, self, itmi_gold, Richter_Schulden);
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_PayNow_10_01"); //Gut! Ich werde dafür sorgen, dass es jeder in der Stadt erfährt - damit wäre dein Ruf einigermaßen wiederhergestellt.
B_GrantAbsolution (LOC_KHORATA);
Richter_Schulden = 0;
Richter_LastPetzCounter = 0;
Richter_LastPetzCrime = CRIME_NONE;
Info_ClearChoices (Info_Mod_Richter_PETZMASTER);
Info_ClearChoices (Info_Mod_Richter_PMSchulden); //!!! Info-Choice wird noch von anderem Dialog angesteuert!
};
func void Info_Mod_Richter_PETZMASTER_PayLater()
{
AI_Output (hero, self, "Info_Mod_Richter_PETZMASTER_PayLater_15_00"); //Ich habe nicht genug Gold!
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_PayLater_10_01"); //Dann sieh zu, dass du das Gold so schnell wie möglich beschaffst.
AI_Output (self, hero, "Info_Mod_Richter_PETZMASTER_PayLater_10_02"); //Und ich warne dich: Wenn du dir noch was zu schulden kommen lässt, wird die Sache noch schlimmer für dich!
Richter_LastPetzCounter = B_GetTotalPetzCounter(self);
Richter_LastPetzCrime = B_GetGreatestPetzCrime(self);
AI_StopProcessInfos (self);
};
INSTANCE Info_Mod_Richter_Pickpocket (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_Pickpocket_Condition;
information = Info_Mod_Richter_Pickpocket_Info;
permanent = 1;
important = 0;
description = Pickpocket_150;
};
FUNC INT Info_Mod_Richter_Pickpocket_Condition()
{
C_Beklauen (145, ItMi_Gold, 62);
};
FUNC VOID Info_Mod_Richter_Pickpocket_Info()
{
Info_ClearChoices (Info_Mod_Richter_Pickpocket);
Info_AddChoice (Info_Mod_Richter_Pickpocket, DIALOG_BACK, Info_Mod_Richter_Pickpocket_BACK);
Info_AddChoice (Info_Mod_Richter_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_Richter_Pickpocket_DoIt);
};
FUNC VOID Info_Mod_Richter_Pickpocket_BACK()
{
Info_ClearChoices (Info_Mod_Richter_Pickpocket);
};
FUNC VOID Info_Mod_Richter_Pickpocket_DoIt()
{
if (B_Beklauen() == TRUE)
{
Info_ClearChoices (Info_Mod_Richter_Pickpocket);
}
else
{
Info_ClearChoices (Info_Mod_Richter_Pickpocket);
Info_AddChoice (Info_Mod_Richter_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_Richter_Pickpocket_Beschimpfen);
Info_AddChoice (Info_Mod_Richter_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_Richter_Pickpocket_Bestechung);
Info_AddChoice (Info_Mod_Richter_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_Richter_Pickpocket_Herausreden);
};
};
FUNC VOID Info_Mod_Richter_Pickpocket_Beschimpfen()
{
B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN");
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Richter_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
};
FUNC VOID Info_Mod_Richter_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_Richter_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_Richter_Pickpocket);
AI_StopProcessInfos (self);
};
};
FUNC VOID Info_Mod_Richter_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_Richter_Pickpocket);
}
else
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02");
};
};
INSTANCE Info_Mod_Richter_EXIT (C_INFO)
{
npc = Mod_7371_OUT_Richter_REL;
nr = 1;
condition = Info_Mod_Richter_EXIT_Condition;
information = Info_Mod_Richter_EXIT_Info;
permanent = 1;
important = 0;
description = DIALOG_ENDE;
};
FUNC INT Info_Mod_Richter_EXIT_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Richter_EXIT_Info()
{
AI_StopProcessInfos (self);
};
|
D
|
module drowbar.lexer;
import drowbar.parser.parser;
import drowbar.ast;
import std.array;
import std.string;
import std.conv;
import std.ascii;
import std.variant;
class Lexer {
private string src;
private uint pos;
this (string source) {
src = source;
pos = 0;
}
enum States {
INITIAL,
SYMBOL,
ZERO,
NUMBER,
FLOAT,
STRING,
STRING_ESC,
COMMENT,
}
LexedValue read(){
auto state = States.INITIAL;
Appender!(string) buf;
char c;
while (pos < src.length) {
c = src[pos++];
final switch (state) {
case States.INITIAL:
if (c == '\n') {
;
} else if (c.isWhite()) {
;
} else if (c.isAlpha()) {
buf.put(c);
state = States.SYMBOL;
} else if (c == '0') {
buf.put(c);
state = States.ZERO;
} else if (c.isDigit()) {
buf.put(c);
state = States.NUMBER;
} else if (c == '"') {
state = States.STRING;
} else if (c == '#') {
state = States.COMMENT;
} else {
switch (c) {
case '(': return LexedValue(Token.token_LP);
case ')': return LexedValue(Token.token_RP);
case '{': return LexedValue(Token.token_LC);
case '}': return LexedValue(Token.token_RC);
case ';': return LexedValue(Token.token_SEMICOLON);
case ',': return LexedValue(Token.token_COMMA);
case '+': return LexedValue(Token.token_ADD);
case '-': return LexedValue(Token.token_SUB);
case '*': return LexedValue(Token.token_MUL);
case '/': return LexedValue(Token.token_DIV);
case '%': return LexedValue(Token.token_MOD);
default:
if (pos < src.length) {
auto lc = c;
c = src[pos++];
switch (lc) {
case '&':
if (c == '&') return LexedValue(Token.token_LOGICAL_AND);
break;
case '|':
if (c == '|') return LexedValue(Token.token_LOGICAL_OR);
break;
case '!':
if (c == '=') return LexedValue(Token.token_NE);
break;
case '=':
if (c == '=') return LexedValue(Token.token_EQ);
pos--;
return LexedValue(Token.token_ASSIGN);
case '>':
if (c == '=') return LexedValue(Token.token_GE);
pos--;
return LexedValue(Token.token_GT);
case '<':
if (c == '=') return LexedValue(Token.token_LE);
pos--;
return LexedValue(Token.token_LT);
default:
break;
}
}
throw new Exception("invalid character - `%c'".format(c));
}
}
break;
case States.SYMBOL:
if (!c.isAlphaNum()) {
pos--;
switch (buf.data) {
case "function": return LexedValue(Token.token_FUNCTION);
case "if": return LexedValue(Token.token_IF);
case "else": return LexedValue(Token.token_ELSE);
case "elsif": return LexedValue(Token.token_ELSIF);
case "while": return LexedValue(Token.token_WHILE);
case "for": return LexedValue(Token.token_FOR);
case "return": return LexedValue(Token.token_RETURN);
case "break": return LexedValue(Token.token_BREAK);
case "continue": return LexedValue(Token.token_CONTINUE);
case "null": return LexedValue(Token.token_NULL);
case "true": return LexedValue(Token.token_TRUE);
case "false": return LexedValue(Token.token_FALSE);
case "global": return LexedValue(Token.token_GLOBAL);
default:
return LexedValue(Token.token_IDENTIFIER, Variant(buf.data));
}
}
buf.put(c);
break;
case States.ZERO:
if (c != '.') {
pos--;
return LexedValue(Token.token_INT_LITERAL, Variant(0));
}
buf.put(c);
state = States.FLOAT;
break;
case States.NUMBER:
if (c == '.') {
buf.put(c);
state = States.FLOAT;
} else if (c.isDigit()) {
buf.put(c);
} else {
pos--;
return LexedValue(Token.token_INT_LITERAL, Variant(buf.data.to!int()));
}
break;
case States.FLOAT:
if (!c.isDigit()) {
pos--;
return LexedValue(Token.token_DOUBLE_LITERAL, Variant(buf.data.to!double()));
}
buf.put(c);
break;
case States.STRING:
switch (c) {
case '"':
return LexedValue(Token.token_STRING_LITERAL, Variant(buf.data));
case '\\':
state = States.STRING_ESC;
break;
default:
buf.put(c);
}
break;
case States.STRING_ESC:
switch (c) {
case '"':
case '\\':
buf.put(c);
break;
case 'n':
buf.put('\n');
break;
case 't':
buf.put('\t');
break;
default:
buf.put('\\');
buf.put(c);
}
state = States.STRING;
break;
case States.COMMENT:
if (c == '\n') state = States.INITIAL;
break;
}
}
return LexedValue(Token.token_eof);
}
}
struct LexedValue {
Token token;
Variant value;
}
|
D
|
module alt.aahash;
/**
A very literal adaption of the D runtime implementation, but as an independent module. Single linked bucket list.
Method getNode operation takes a pointer to memory as its only a read.
Method putNode must be a reference to the key type.
Lookups are a bit slower than druntime. Why?
*/
import alt.blockheap;
import alt.hashutil;
import alt.zstring;
import std.stdint;
import std.traits;
private import core.memory;
version(NoGarbageCollection)
{
private enum DoDeletes = true;
}
else {
private enum DoDeletes = false;
}
package enum NodeOp {op_get, op_getlocal, op_del };
// Round up size of HashVoidImpl to nearest power of 2, using binit.length
private struct HashAAImpl(K,V)
{
static struct AANode(K,V)
{
AANode!(K,V) *next_;
hash_t hash_;
K key_;
V value_;
}
static if (isSomeString!K)
{
static if (is(K==string))
{
alias const(char)[] LK;
}
else static if (is(K==wstring))
{
alias const(wchar)[] LK;
}
else static if (is(K==dstring))
{
alias const(dchar)[] LK;
}
}
else {
alias K LK;
}
alias HashAAImpl!(K,V) SameTypeImpl;
alias AANode!(K,V) bucket;
alias bucket* hbucket;
static Array!BlockHeap gHeaps_; // using these heaps in thread.
static ~this()
{
foreach(ref h ; gHeaps_.toArray())
{
auto dh = h;
h = null;
delete dh;
}
}
/// get an existing heap of reusable nodes in this thread. Will never actually delete any blocks?
/// TODO: Thread cleanup?
static BlockHeap getHeap(uintptr_t nodeSize)
{
auto heaps = gHeaps_.toArray();
if (heaps.length > 0)
{
for(auto ix = 0; ix < heaps.length; ix++)
{
auto heap = heaps[ix];
if (heap.nodeSize == nodeSize)
return heap;
}
}
auto result = new BlockHeap(nodeSize);
gHeaps_.put(result);
return result;
}
hbucket[] b_;
TypeInfo keyti_;
BlockHeap heap_;
bool sharedHeap_;
uintptr_t refcount_;
uintptr_t nodes_; // total number of entries in the hash table.
uintptr_t capacity_; // maximum number before a resize of hbucket, and redistribution.
//ratio of buckets to bucket array size. After about 2.0, performance is getting clogged, with longish chains.
//better hashing allows more even distribution.
double minRatio_ = 0.6; // lower limit, set after rehash.
enum double maxRatio_ = 3.3; // upper limit, sets capacity trigger for rehash
this(uintptr_t preAlloc)
{
keyti_ = typeid(K);
if (preAlloc > 0)
{
heap_ = new BlockHeap(bucket.sizeof,0);
heap_.preAllocate(preAlloc);
sharedHeap_ = false;
}
refcount_ = 1;
}
this(BlockHeap heap)
{
keyti_ = typeid(K);
heap_ = heap;
if (heap_)
sharedHeap_ = true;
refcount_ = 1;
}
~this()
{
clear();
}
void addref()
{
refcount_++;
}
void release(bool del)
{
if ( refcount_ > 0)
{
refcount_--;
if (!refcount_)
{
if (del)
{
this.clear();
version(NoGarbageCollection)
{
GC.free(this);
}
}
}
}
}
private void freeNode(hbucket e)
{
.clear(*e);
if (heap_)
heap_.collect(e);
}
// get pointer to stored key, if it exists, else
package final const(K)* getKeyPtr(ref LK pkey)
{
auto e = getNode(&pkey);
return (e is null) ? null
: &e.key_;
}
static struct NodeReturn {
hbucket node_;
hbucket* pnode_;
hash_t hash_ = 0;
}
static struct NodeRef {
private {
hbucket node_ = null;
}
bool valid() @property const
{
return (node_ !is null);
}
ref V value() @property
{
return node_.value_;
}
}
// find only for lookup.
final hbucket lookupKey(const void* pkey)
{
immutable blen = b_.length;
if (blen == 0)
return null;
auto key_hash = keyti_.getHash(pkey);
auto e = b_[key_hash % blen];
for(;;)
{
if (e is null)
break;
if (key_hash == e.hash_)
{
if (keyti_.compare(&e.key_, pkey)==0)
{
return e;
}
}
e = e.next_;
}
return null;
}
// find for put or delete
final bool findKey(const void* pkey, ref NodeReturn fix)
{
immutable blen = b_.length;
if (blen == 0)
return false;
auto key_hash = keyti_.getHash(pkey);
auto pe = b_.ptr + key_hash % blen;
for(;;)
{
auto e = *pe;
if (e is null)
break;
if (key_hash == e.hash_)
{
if (keyti_.compare(&e.key_, pkey)==0)
{
fix.hash_ = 0;
fix.node_ = e;
fix.pnode_ = pe;
return true;
}
}
pe = &e.next_;
}
fix.node_ = null;
fix.pnode_ = pe;
fix.hash_ = key_hash;
return false;
}
final void delNode(ref NodeReturn ret)
{
(*ret.pnode_) = ret.node_.next_;
nodes_--;
.clear(*ret.node_);
if (heap_)
heap_.collect(ret.node_);
else
GC.free(ret.node_);
}
final hbucket getNode(const void* pkey)
{
NodeReturn ret = void;
return findKey(pkey,ret) ? ret.node_ : null;
}
/// insert, replace
final hbucket putNode(ref K pkey)
{
if (b_.length == 0)
capacity(7);
NodeReturn ret;
if (findKey(&pkey, ret))
{
return ret.node_;
}
hbucket e = void;
if (heap_ is null)
{
e = cast(hbucket) GC.calloc(bucket.sizeof);
//memset(e, 0, bucket.sizeof);
}
else
e = cast(hbucket) heap_.allocate();
e.key_ = pkey;
e.hash_ = ret.hash_;
(*ret.pnode_) = e;
nodes_++;
if (nodes_ > capacity_)
grow_rehash();
return e;
}
private void resizeTable(size_t nlen)
{
auto oldData = b_;
// NO_INTERIOR helps stop pointer aliasing
auto ptr = cast(hbucket*) GC.malloc( nlen * hbucket.sizeof, GC.BlkAttr.NO_INTERIOR);
b_ = ptr[0..nlen];
b_[] = null;
capacity_ = cast(size_t)(nlen * maxRatio_);
auto pnew = b_.ptr;
foreach(e ; oldData)
{
while(e !is null)
{
hbucket aaNext = e.next_;
e.next_ = null;
auto key_hash = e.hash_;
hbucket* pe = &pnew[key_hash % nlen];
while (*pe !is null)
{
pe = &(*pe).next_;
}
*pe = e;
e = aaNext;
}
}
}
// capacity sets the size of the table of node pointers.
void capacity(size_t cap)
{
if (cap < nodes_)
cap = nodes_;
size_t nlen = cast(size_t)(cap / maxRatio_);
nlen = getNextPrime(nlen);
resizeTable(nlen);
}
uint[] statistics()
{
uint result[];
if (b_.length==0)
{
result.length = 2;
result[0] = 0;
result[1] = 0;
return result;
}
uint emptyCt = 0;
result.length = 16;
result[0] = cast(uint) b_.length;
foreach(e ; b_)
{
if(e !is null)
{
uint listct = 0;
while (e !is null)
{
listct++;
e = e.next_;
}
if (listct >= result.length-1)
{
result.length = listct + 2;
}
result[listct+1] += 1;
}
else
{
emptyCt++;
}
}
result[1] = cast(uint)emptyCt;
return result;
}
/// capacity exceeded, grow much bigger, avoid frequent rehash
private void grow_rehash()
{
rehash();
return;
}
void rehash()
{
auto nlen = getNextPrime(cast(uintptr_t)(nodes_/minRatio_));
if (nlen != b_.length)
resizeTable(nlen);
return;
}
void clear()
{
// each individual node needs cleaning
if (nodes_)
{
foreach(e ; b_)
{
while(e !is null)
{
hbucket nxptr = e.next_;
freeNode(e);
e = nxptr;
}
}
}
b_ = null;
if (heap_ && !sharedHeap_)
{
delete heap_;
}
nodes_ = 0;
capacity_ = 0;
}
alias KeyValueBlock!(K,V,true) SortableBlock;
/// return a sortable block of key value pairs
auto sortableBlock()
{
SortableBlock result;
result.capacity = nodes_;
if (nodes_ > 0)
{
foreach(e ; b_)
{
while (e !is null)
{
result.put(SortableBlock.BlockRec(e.key_, e.value_));
e = e.next_;
}
}
}
return result;
}
auto values()
{
Array!V result;
if(nodes_ > 0)
{
result.reserve(nodes_,true);
foreach(e ; b_)
{
while (e !is null)
{
result.put(e.value_);
e = e.next_;
}
}
}
return result;
}
auto keys()
{
Array!K result;
if(nodes_ > 0)
{
result.reserve(nodes_,true);
foreach(e ; b_)
{
while (e !is null)
{
result.put(e.key_);
e = e.next_;
}
}
}
return result;
}
intptr_t applyValues(dg_t dg)
{
intptr_t result;
foreach (e; b_)
{
while (e !is null)
{
hbucket nx = e.next_;
result = dg(&e.value_);
if (result || nodes_ == 0)
break;
e = nx;
}
}
return result;
}
equals_t dataMatch(ref HashAAImpl other)
{
if (other.nodes_ != nodes_)
return false;
auto valueti = typeid(V);
foreach (e; b_)
{
while (e !is null)
{
auto test = other.getNode(&e.key_);
if (test is null)
return false;
if (!valueti.equals(&e.value_, &test.value_))
return false;
e = e.next_;
}
}
return true;
}
intptr_t applyKeyValues(dg2_t dg)
{
intptr_t result;
foreach (e; b_)
{
while (e !is null)
{
hbucket nx = e.next_;
auto tempKey = e.key_;
result = dg(&tempKey, &e.value_);
if (result || nodes_ == 0)
break;
e = nx;
}
}
return result;
}
intptr_t applyKeys(dg_t dg)
{
intptr_t result;
foreach (e; b_)
{
while (e !is null)
{
hbucket nx = e.next_;
auto tempKey = e.key_;
result = dg(&tempKey); /// not getting the original
if (result || nodes_ == 0)
break;
e = nx;
}
}
return result;
}
struct Range {
hbucket[] slots_;
hbucket current_;
SameTypeImpl* paa_;
this(SameTypeImpl* aa)
{
paa_ = aa;
paa_.addref();
slots_ = paa_.b_;
nextSlot();
}
~this()
{
paa_.release(true);
}
void nextSlot()
{
foreach(i , slot ; slots_)
{
if (!slot)
continue;
current_ = slot;
slots_ = slots_.ptr[i..slots_.length]; // is slots_[i..$] different?
break;
}
}
public:
bool empty() const @property
{
return (current_ is null);
}
ref inout(bucket) front() inout @property
{
assert(current_);
return *current_;
}
void popFront()
{
assert(current_);
current_ = current_.next_;
if (!current_)
{
slots_ = slots_[1..$];
nextSlot();
}
}
}
auto byValue() @property
{
static struct Result
{
Range state;
this(SameTypeImpl* paa)
{
state = Range(paa);
}
ref V front() @property
{
return state.front.value_;
}
alias state this;
}
return Result(&this);
}
auto byKey() @property
{
static struct Result
{
Range state;
this(SameTypeImpl* paa)
{
state = Range(paa);
}
ref K front() @property
{
return state.front.key_;
}
alias state this;
}
return Result(&this);
}
}
struct HashTable(K, V)
{
alias HashAAImpl!(K,V) AAImpl;
alias HashTable!(K,V) MyType;
static if (isSomeString!K)
{
static if (is(K==string))
{
alias const(char)[] LK;
}
else static if (is(K==wstring))
{
alias const(wchar)[] LK;
}
else static if (is(K==dstring))
{
alias const(dchar)[] LK;
}
}
else {
alias K LK;
}
private AAImpl* aa_;
/// Post-Blit - Now I really am in trouble.
this(this)
{
if (aa_)
{
if (aa_.refcount_ > 0)
aa_.refcount_++;
}
}
~this()
{
deallocate(DoDeletes);
}
private void deallocate(bool del=false)
{
if (aa_)
{
aa_.release(del);
aa_ = null;
}
}
/** A call to setup always creates a new implementation object, overwriting the
instance created by a previous setup.
Overwriting does not delete pre-existing implementation object, which
may be aliased.
---
DRHashMap!(uint[uint]) aa;
aa.setup; // optional setup, default, do not hash integer/float/char keys
---
OR
---
DRHashMap!(uint[uint]) aa;
aa.setup(true); //optional setup, use normal hashing.
---
If hashSmall is false (default), then key integer bitty values are stored
directly in the hash field, as themselves without doing a hash.
This can be a bit faster for these keys.
The call to setup will be automatic if it is not called first deliberatedly.
*/
void setup(uint preAllocate = 0)
{
aa_ = new AAImpl(preAllocate);
}
/// Return if the implementation is already initialised.
bool isSetup()
{
return ( aa_ !is null);
}
/// support "in" operator
V* opIn_r(ref LK key)
{
if (aa_ is null)
return null;
auto e = aa_.lookupKey(&key);
return e is null ? null : &e.value_;
}
/// Return the value or throw exception
V opIndex(ref LK key)
{
if (aa_ !is null)
{
auto e = aa_.lookupKey(&key);
if (e !is null)
{
return e.value_;
}
}
throw new AAKeyError("no key for opIndex");
}
/// support "in" operator
V* opIn_r(LK key)
{
if (aa_ is null)
return null;
auto e = aa_.lookupKey(&key);
return e is null ? null : &e.value_;
}
/// Return the value or throw exception
V opIndex(LK key)
{
if (aa_ !is null)
{
auto e = aa_.lookupKey(&key);
if (e !is null)
{
return e.value_;
}
}
throw new AAKeyError("no key for opIndex");
}
/// Insert or replace. Will call setup for uninitialised AA.
void opIndexAssign(V value, K key)
{
if (aa_ is null)
setup();
auto e = aa_.putNode(key);
e.value_ = value;
}
/// Insert or replace. Return true if insert occurred.
bool putInsert(K key, ref V value)
{
if (aa_ is null)
setup();
auto before_nodes = aa_.nodes_;
auto e = aa_.putNode(key);
e.value_ = value;
return (aa_.nodes_ > before_nodes);
}
/// Insert or replace.
void put(K key, ref V value)
{
if (aa_ is null)
setup();
auto e = aa_.putNode(key);
e.value_ = value;
}
/// Get the value or throw exception
V get(LK key, lazy V value)
{
if (aa_ is null)
return value;
auto e = aa_.lookupKey(&key);
return (e is null) ? value : e.value_;
}
/// Return if the key exists.
bool contains(LK key)
{
if (aa_ is null)
return false;
return aa_.lookupKey(&key) !is null;
}
/// Get the value if it exists, false if it does not.
bool get(LK key, ref V val)
{
if (aa_ !is null)
{
auto e = aa_.lookupKey(&key);
if (e !is null)
{
val = e.value_;
return true;
}
}
return false;
}
/**
Set the capacity, which cannot be made less than current number of entries.
The actual capacity value achieved will usually larger.
Table length is set to be (next prime number) > (capacity / load_ratio).
Capacity is then set to be (Table length) * load_ratio;
*/
@property void capacity(size_t cap)
{
//version(TEST_DRAA) writefln("capacity %s ",cap);
if (aa_ is null)
setup();
aa_.capacity(cap);
}
/** Return threshold number of entries for automatic rehash after insertion.
*/
@property size_t capacity()
{
if (aa_ is null)
return 0;
return aa_.capacity_;
}
/**
*/
@property void minRatio(double ratio)
{
if (aa_ is null)
setup();
aa_.minRatio_ = ratio;
}
/**
Return the current loadRatio
*/
@property double minRatio()
{
if (aa_ is null)
return 0.0;
else
return aa_.minRatio_;
}
/**
Return the number of entries
*/
@property final size_t length()
{
return (aa_ is null) ? 0 : aa_.nodes_;
}
/**
Call remove for each entry. Start afresh.
*/
@property void clear()
{
if (aa_ !is null)
{
aa_.clear();
}
}
/**
Optimise table size according to current number of nodes and loadRatio.
*/
@property void rehash()
{
if (aa_ !is null)
{
aa_.rehash();
}
}
/// Test if both arrays are empty, the same object, or both have same data
bool equals(ref HashTable other)
{
auto c1 = aa_;
auto c2 = other.aa_;
if (c1 is null)
return (c2 is null);
else if (c2 is null)
return false;
return c1.dataMatch(*c2);
}
/// Non-optimised function to append all the keys from other onto this.
void append(ref HashTable other)
{
if (!other.isSetup())
return;
if (aa_ is null)
setup();
foreach(key, value ; other)
{
this[key] = value;
}
}
/// Delete the key and return true if it existed.
bool remove(LK key)
{
if (aa_ is null)
return false;
AAImpl.NodeReturn ret;
if (aa_.findKey(&key, ret))
aa_.delNode(ret);
return false;
}
/** Return the value and remove the key at the same time.
Return false if no key found.
*/
bool remove(LK key, ref V value)
{
if (aa_ !is null)
{
AAImpl.NodeReturn ret;
if (aa_.findKey(&key,ret))
{
value = ret.node_.value_;
aa_.delNode(ret);
return true;
}
}
return false;
}
public int eachKey(int delegate(ref K key) dg)
{
return (aa_ is null) ? 0 : aa_.applyKeys(cast(dg_t) dg);
}
/**
foreach(value)
*/
public int opApply(int delegate(ref V value) dg)
{
return (aa_ is null) ? 0 : aa_.applyValues(cast(dg_t) dg);
}
/**
foreach(key, value)
*/
public int opApply(int delegate(ref K key, ref V value) dg)
{
return (aa_ is null) ? 0 : aa_.applyKeyValues(cast(dg2_t) dg);
}
/**
Return all keys.
*/
@property
auto keys()
{
Array!K result;
if (aa_ !is null)
result = aa_.keys();
return result;
}
/**
Return all values.
*/
@property
auto values()
{
Array!V result;
if (aa_ !is null)
result = aa_.values();
return result;
}
/**
Return all keys and values.
*/
auto sortableBlock()
{
AAImpl.SortableBlock result;
if (aa_ !is null)
result = aa_.sortableBlock();
return result;
}
/**
Return <hash table length>, <empty buckets>, <buckets of length 1>, [<buckets of length #>]
Result will be of length 2 or more.
*/
@property uint[] list_stats()
{
if (aa_ is null)
{
return new uint[2];
}
else
{
return aa_.statistics();
}
}
alias AAImpl.NodeRef NodeRef;
NodeRef getNode(ref LK key)
{
return (aa_ is null) ? NodeRef(null) : NodeRef(aa_.lookupKey(&key));
}
}
unittest {
alias Array!char arrayChar;
alias HashTable!(arrayChar, arrayChar) StringMap;
// cannot set directly from string, like testAA["key2"] = "value2";
// can assign indirect
arrayChar k1 = "key1";
arrayChar v1 = "value1";
StringMap m1;
m1[k1] = v1;
auto m2 = m1;
assert(m2[k1] == v1);
}
|
D
|
/**
* Support for lexical scope of local variables
*
* Compiler implementation of the
* $(LINK2 https://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 2015-2023 by The D Language Foundation, All Rights Reserved
* Authors: Rainer Schuetze
* 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/backend/dvarstats.d, backend/dvarstats.d)
*/
module dmd.backend.dvarstats;
import core.stdc.string;
import core.stdc.stdlib;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.global;
import dmd.backend.code;
import dmd.backend.symtab;
import dmd.backend.barray;
extern (C++):
nothrow:
alias _compare_fp_t = extern(C) nothrow int function(const void*, const void*);
extern(C) void qsort(void* base, size_t nmemb, size_t size, _compare_fp_t compar);
version (all) // free function version
{
import dmd.backend.dvarstats;
void varStats_writeSymbolTable(ref symtab_t symtab,
void function(Symbol*) nothrow fnWriteVar, void function() nothrow fnEndArgs,
void function(int off,int len) nothrow fnBeginBlock, void function() nothrow fnEndBlock)
{
varStats.writeSymbolTable(symtab, fnWriteVar, fnEndArgs, fnBeginBlock, fnEndBlock);
}
void varStats_startFunction()
{
varStats.startFunction();
}
void varStats_recordLineOffset(Srcpos src, targ_size_t off)
{
varStats.recordLineOffset(src, off);
}
__gshared VarStatistics varStats;
}
// estimate of variable life time
struct LifeTime
{
Symbol* sym;
int offCreate; // variable created before this code offset
int offDestroy; // variable destroyed after this code offset
}
struct LineOffset
{
targ_size_t offset;
uint linnum;
uint diffNextOffset;
}
struct VarStatistics
{
private:
nothrow:
Barray!LifeTime lifeTimes;
// symbol table sorted by offset of variable creation
symtab_t sortedSymtab;
Barray!SYMIDX nextSym; // next symbol with identifier with same hash, same size as sortedSymtab
int uniquecnt; // number of variables that have unique name and don't need lexical scope
// line number records for the current function
Barray!LineOffset lineOffsets;
const(char)* srcfile; // only one file supported, no inline
public void startFunction()
{
lineOffsets.setLength(0);
srcfile = null;
}
// figure if can we can add a lexical scope for the variable
// (this should exclude variables from inlined functions as there is
// no support for gathering stats from different files)
private bool isLexicalScopeVar(Symbol* sa)
{
if (sa.lposscopestart.Slinnum <= 0 || sa.lposscopestart.Slinnum > sa.lnoscopeend)
return false;
// is it inside the function? Unfortunately we cannot verify the source file in case of inlining
if (sa.lposscopestart.Slinnum < funcsym_p.Sfunc.Fstartline.Slinnum)
return false;
if (sa.lnoscopeend > funcsym_p.Sfunc.Fendline.Slinnum)
return false;
return true;
}
// compare function to sort symbols by line offsets of their creation
private extern (C) static int cmpLifeTime(scope const void* p1, scope const void* p2)
{
const LifeTime* lt1 = cast(const(LifeTime)*)p1;
const LifeTime* lt2 = cast(const(LifeTime)*)p2;
return lt1.offCreate - lt2.offCreate;
}
// a parent scope contains the creation offset of the child scope
private static extern(D) SYMIDX isParentScope(ref Barray!LifeTime lifetimes, SYMIDX parent, SYMIDX si)
{
if (parent == SYMIDX.max) // full function
return true;
return lifetimes[parent].offCreate <= lifetimes[si].offCreate &&
lifetimes[parent].offDestroy > lifetimes[si].offCreate;
}
// find a symbol that includes the creation of the given symbol as part of its life time
private static extern(D) SYMIDX findParentScope(ref Barray!LifeTime lifetimes, SYMIDX si)
{
if (si != SYMIDX.max)
{
for(SYMIDX sj = si; sj; --sj)
if(isParentScope(lifetimes, sj - 1, si))
return sj;
}
return SYMIDX.max;
}
private static int getHash(const(char)* s)
{
int hash = 0;
for (; *s; s++)
hash = hash * 11 + *s;
return hash;
}
private bool hashSymbolIdentifiers(ref symtab_t symtab)
{
// build circular-linked lists of symbols with same identifier hash
bool hashCollisions = false;
SYMIDX[256] firstSym = SYMIDX.max;
for (SYMIDX si = 0; si < symtab.length; si++)
{
Symbol* sa = symtab[si];
int hash = getHash(sa.Sident.ptr) & 255;
SYMIDX first = firstSym[hash];
if (first == SYMIDX.max)
{
// connect full circle, so we don't have to recalculate the hash
nextSym[si] = si;
firstSym[hash] = si;
}
else
{
// insert after first entry
nextSym[si] = nextSym[first];
nextSym[first] = si;
hashCollisions = true;
}
}
return hashCollisions;
}
private bool hasUniqueIdentifier(ref symtab_t symtab, SYMIDX si)
{
Symbol* sa = symtab[si];
for (SYMIDX sj = nextSym[si]; sj != si; sj = nextSym[sj])
if (strcmp(sa.Sident.ptr, symtab[sj].Sident.ptr) == 0)
return false;
return true;
}
// gather statistics about creation and destructions of variables that are
// used by the current function
private symtab_t* calcLexicalScope(return ref symtab_t symtab) return
{
// make a copy of the symbol table
// - arguments should be kept at the very beginning
// - variables with unique name come first (will be emitted with full function scope)
// - variables with duplicate names are added with ascending code offset
nextSym.setLength(symtab.length);
if (sortedSymtab.symmax < symtab.length)
{
sortedSymtab.tab = cast(Symbol**) util_realloc(sortedSymtab.tab, symtab.length, (Symbol*).sizeof);
sortedSymtab.symmax = symtab.length;
}
sortedSymtab.length = symtab.length;
if (!hashSymbolIdentifiers(symtab))
{
// without any collisions, there are no duplicate symbol names, so bail out early
uniquecnt = cast(int)symtab.length;
return &symtab;
}
SYMIDX argcnt;
for (argcnt = 0; argcnt < symtab.length; argcnt++)
{
Symbol* sa = symtab[argcnt];
if (sa.Sclass != SC.parameter && sa.Sclass != SC.regpar && sa.Sclass != SC.fastpar && sa.Sclass != SC.shadowreg)
break;
sortedSymtab[argcnt] = sa;
}
// find symbols with identical names, only these need lexical scope
uniquecnt = cast(int)argcnt;
SYMIDX dupcnt = 0;
for (SYMIDX sj, si = argcnt; si < symtab.length; si++)
{
Symbol* sa = symtab[si];
if (!isLexicalScopeVar(sa) || hasUniqueIdentifier(symtab, si))
sortedSymtab[uniquecnt++] = sa;
else
sortedSymtab[symtab.length - 1 - dupcnt++] = sa; // fill from the top
}
sortedSymtab.length = symtab.length;
if(dupcnt == 0)
return &symtab;
sortLineOffsets();
// precalc the lexical blocks to emit so that identically named symbols don't overlap
lifeTimes.setLength(dupcnt);
for (SYMIDX si = 0; si < dupcnt; si++)
{
lifeTimes[si].sym = sortedSymtab[uniquecnt + si];
lifeTimes[si].offCreate = cast(int)getLineOffset(lifeTimes[si].sym.lposscopestart.Slinnum);
lifeTimes[si].offDestroy = cast(int)getLineOffset(lifeTimes[si].sym.lnoscopeend);
}
qsort(lifeTimes[].ptr, dupcnt, (lifeTimes[0]).sizeof, &cmpLifeTime);
// ensure that an inner block does not extend beyond the end of a parent block
for (SYMIDX si = 0; si < dupcnt; si++)
{
SYMIDX sj = findParentScope(lifeTimes, si);
if(sj != SYMIDX.max && lifeTimes[si].offDestroy > lifeTimes[sj].offDestroy)
lifeTimes[si].offDestroy = lifeTimes[sj].offDestroy;
}
// extend life time to the creation of the next symbol that is not contained in the parent scope
// or that has the same name
for (SYMIDX sj, si = 0; si < dupcnt; si++)
{
SYMIDX parent = findParentScope(lifeTimes, si);
for (sj = si + 1; sj < dupcnt; sj++)
if(!isParentScope(lifeTimes, parent, sj))
break;
else if (strcmp(lifeTimes[si].sym.Sident.ptr, lifeTimes[sj].sym.Sident.ptr) == 0)
break;
lifeTimes[si].offDestroy = cast(int)(sj < dupcnt ? lifeTimes[sj].offCreate : retoffset + retsize); // function length
}
// store duplicate symbols back with new ordering
for (SYMIDX si = 0; si < dupcnt; si++)
sortedSymtab[uniquecnt + si] = lifeTimes[si].sym;
return &sortedSymtab;
}
public void writeSymbolTable(ref symtab_t symtab,
void function(Symbol*) nothrow fnWriteVar, void function() nothrow fnEndArgs,
void function(int off,int len) nothrow fnBeginBlock, void function() nothrow fnEndBlock)
{
auto symtab2 = calcLexicalScope(symtab);
int openBlocks = 0;
int lastOffset = 0;
// Write local symbol table
bool endarg = false;
for (SYMIDX si = 0; si < symtab2.length; si++)
{
Symbol *sa = (*symtab2)[si];
if (endarg == false &&
sa.Sclass != SC.parameter &&
sa.Sclass != SC.fastpar &&
sa.Sclass != SC.regpar &&
sa.Sclass != SC.shadowreg)
{
if(fnEndArgs)
(*fnEndArgs)();
endarg = true;
}
if (si >= uniquecnt)
{
int off = lifeTimes[si - uniquecnt].offCreate;
// close scopes that end before the creation of this symbol
for (SYMIDX sj = si; sj > uniquecnt; --sj)
{
if (lastOffset < lifeTimes[sj - 1 - uniquecnt].offDestroy && lifeTimes[sj - 1 - uniquecnt].offDestroy <= off)
{
assert(openBlocks > 0);
if(fnEndBlock)
(*fnEndBlock)();
openBlocks--;
}
}
int len = lifeTimes[si - uniquecnt].offDestroy - off;
// don't emit a block for length 0, it isn't captured by the close condition above
if (len > 0)
{
if(fnBeginBlock)
(*fnBeginBlock)(off, len);
openBlocks++;
}
lastOffset = off;
}
(*fnWriteVar)(sa);
}
while (openBlocks > 0)
{
if(fnEndBlock)
(*fnEndBlock)();
openBlocks--;
}
}
// compare function to sort line offsets ascending by line (and offset on identical line)
private extern (C) static int cmpLineOffsets(scope const void* off1, scope const void* off2)
{
const LineOffset* loff1 = cast(const(LineOffset)*)off1;
const LineOffset* loff2 = cast(const(LineOffset)*)off2;
if (loff1.linnum == loff2.linnum)
return cast(int)(loff1.offset - loff2.offset);
return loff1.linnum - loff2.linnum;
}
private void sortLineOffsets()
{
if (lineOffsets.length == 0)
return;
// remember the offset to the next recorded offset on another line
for (int i = 1; i < lineOffsets.length; i++)
lineOffsets[i-1].diffNextOffset = cast(uint)(lineOffsets[i].offset - lineOffsets[i-1].offset);
lineOffsets[lineOffsets.length - 1].diffNextOffset = cast(uint)(retoffset + retsize - lineOffsets[lineOffsets.length - 1].offset);
// sort line records and remove duplicate lines preferring smaller offsets
qsort(lineOffsets[].ptr, lineOffsets.length, (lineOffsets[0]).sizeof, &cmpLineOffsets);
int j = 0;
for (int i = 1; i < lineOffsets.length; i++)
if (lineOffsets[i].linnum > lineOffsets[j].linnum)
lineOffsets[++j] = lineOffsets[i];
lineOffsets.setLength(j + 1);
}
private targ_size_t getLineOffset(int linnum)
{
int idx = findLineIndex(linnum);
if (idx >= lineOffsets.length || lineOffsets[idx].linnum < linnum)
return retoffset + retsize; // function length
if (idx > 0 && lineOffsets[idx].linnum != linnum)
// for inexact line numbers, use the offset following the previous line
return lineOffsets[idx-1].offset + lineOffsets[idx-1].diffNextOffset;
return lineOffsets[idx].offset;
}
// return the first record index in the lineOffsets array with linnum >= line
private int findLineIndex(uint line)
{
int low = 0;
int high = cast(int)lineOffsets.length;
while (low < high)
{
int mid = low + ((high - low) >> 1);
int ln = lineOffsets[mid].linnum;
if (line < ln)
high = mid;
else if (line > ln)
low = mid + 1;
else
return mid;
}
return low;
}
public void recordLineOffset(Srcpos src, targ_size_t off)
{
const sfilename = src.Sfilename;
// only record line numbers from one file, symbol info does not include source file
if (!sfilename || !src.Slinnum)
return;
if (!srcfile)
srcfile = sfilename;
if (srcfile != sfilename && strcmp(srcfile, sfilename) != 0)
return;
// assume ascending code offsets generated during codegen, ignore any other
// (e.g. there is an additional line number emitted at the end of the function
// or multiple line numbers at the same offset)
if (lineOffsets.length > 0 && lineOffsets[lineOffsets.length-1].offset >= off)
return;
if (lineOffsets.length > 0 && lineOffsets[lineOffsets.length-1].linnum == src.Slinnum)
{
// optimize common case: new offset on same line
return;
}
// don't care for lineOffsets being ordered now, that is taken care of later (calcLexicalScope)
LineOffset* linoff = lineOffsets.push();
linoff.linnum = src.Slinnum;
linoff.offset = off;
linoff.diffNextOffset = 0;
}
}
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/ice12539.d(15): Error: array index [0] is outside array bounds [0 .. 0]
---
*/
alias TypeTuple(E...) = E;
void main ()
{
int[string] map;
alias Foo = TypeTuple!();
auto a = map[Foo[0]];
}
|
D
|
/Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/Objects-normal/x86_64/Item+CoreDataClass.o : /Users/ales/Projects/DreamMachine/DreamMachine/MainVC.swift /Users/ales/Projects/DreamMachine/DreamMachine/AppDelegate.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/DreamMachine+CoreDataModel.swift /Users/ales/Projects/DreamMachine/DreamMachine/View/ItemCell.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Image+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/ItemType+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Store+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Item+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Image+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/ItemType+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Store+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Item+CoreDataClass.swift /Users/ales/Projects/DreamMachine/DreamMachine/View/MaterialView.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/Objects-normal/x86_64/Item+CoreDataClass~partial.swiftmodule : /Users/ales/Projects/DreamMachine/DreamMachine/MainVC.swift /Users/ales/Projects/DreamMachine/DreamMachine/AppDelegate.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/DreamMachine+CoreDataModel.swift /Users/ales/Projects/DreamMachine/DreamMachine/View/ItemCell.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Image+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/ItemType+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Store+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Item+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Image+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/ItemType+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Store+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Item+CoreDataClass.swift /Users/ales/Projects/DreamMachine/DreamMachine/View/MaterialView.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/Objects-normal/x86_64/Item+CoreDataClass~partial.swiftdoc : /Users/ales/Projects/DreamMachine/DreamMachine/MainVC.swift /Users/ales/Projects/DreamMachine/DreamMachine/AppDelegate.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/DreamMachine+CoreDataModel.swift /Users/ales/Projects/DreamMachine/DreamMachine/View/ItemCell.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Image+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/ItemType+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Store+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Item+CoreDataProperties.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Image+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/ItemType+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Store+CoreDataClass.swift /Users/ales/Projects/DreamMachine/Build/Intermediates.noindex/DreamMachine.build/Debug-iphonesimulator/DreamMachine.build/DerivedSources/CoreDataGenerated/DreamMachine/Item+CoreDataClass.swift /Users/ales/Projects/DreamMachine/DreamMachine/View/MaterialView.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/+
+ Copyright Andrej Mitrovic 2011.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+
+ Demonstrates using VisualStyles to draw themed controls.
+ If there is no active theme (i.e. Windows Classic style is active),
+ we use a custom paint routine.
+/
module VisualStyles;
import core.memory;
import core.runtime;
import core.thread;
import std.conv;
import std.math;
import std.range;
import std.string;
import std.utf;
auto toUTF16z(S)(S s)
{
return toUTFz!(const(wchar)*)(s);
}
pragma(lib, "gdi32.lib");
import core.sys.windows.windef;
import core.sys.windows.winuser;
import core.sys.windows.wingdi;
import core.sys.windows.winbase;
import uxSchema;
import uxTheme;
string appName = "VisualStyles";
string description = "VisualStyles Demo";
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.hbrBackground = null; // don't send WM_ERASEBKND messages
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;
}
enum Control
{
Button
}
extern (Windows)
LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) nothrow
{
scope (failure) assert(0);
static int cxClient, cyClient, cxSource, cySource;
int x, y;
HDC hdc;
PAINTSTRUCT ps;
static HDC hdcMem;
static HBITMAP hbmMem;
static HANDLE hOld;
RECT rect;
switch (message)
{
case WM_SIZE:
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);
return 0;
// When you set 'hbrBackground = null' it prevents
// the WM_ERASEBKND message to be sent.
case WM_ERASEBKGND:
return 1;
case WM_PAINT:
{
// Get DC for window
hdc = BeginPaint(hwnd, &ps);
// Create an off-screen DC for double-buffering
hdcMem = CreateCompatibleDC(hdc);
hbmMem = CreateCompatibleBitmap(hdc, cxClient, cyClient);
hOld = SelectObject(hdcMem, hbmMem);
auto buttonRect = RECT(100, 100, 190, 130);
DrawControl(hwnd, hdcMem, buttonRect, Control.Button);
// Transfer the off-screen DC to the screen
BitBlt(hdc, 0, 0, cxClient, cyClient, hdcMem, 0, 0, SRCCOPY);
// Free-up the off-screen DC
SelectObject(hdcMem, hOld);
DeleteObject(hbmMem);
DeleteDC (hdcMem);
EndPaint(hwnd, &ps);
return 0;
}
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
void DrawControl(HWND hwnd, HDC hdcMem, RECT rect, Control control)
{
HTHEME hTheme = OpenThemeData(hwnd, "Button");
scope(exit)
{
if (hTheme !is null)
CloseThemeData(hTheme);
}
final switch (control)
{
case Control.Button:
{
if (hTheme is null)
{
DrawCustomButton(hdcMem, rect);
}
else
{
DrawThemedButton(hTheme, hdcMem, rect);
}
break;
}
}
}
import std.utf : count;
import std.exception;
import std.stdio;
void DrawCustomButton(HDC hDC, RECT rc)
{
SIZE size;
auto text = "My button";
FillRect(hDC, &rc, cast(HBRUSH)GetStockObject(GRAY_BRUSH));
FrameRect(hDC, &rc, cast(HBRUSH)GetStockObject(LTGRAY_BRUSH));
// calculate center
GetTextExtentPoint32(hDC, text.toUTF16z, text.count, &size);
auto rectWidth = (rc.right - rc.left);
auto textWidth = (size.cx);
auto xPos = rc.left + ((rectWidth - textWidth) / 2);
auto rectHeight = (rc.bottom - rc.top);
auto textHeight = (size.cy);
auto yPos = rc.top + ((rectHeight - textHeight) / 2);
TextOut(hDC, xPos, yPos, text.toUTF16z, text.count);
}
void DrawThemedButton(HTHEME hTheme, HDC hDC, RECT rc)
{
RECT rcContent;
HRESULT hr;
auto text = "My button";
bool iState = 0;
hr = DrawThemeBackground(hTheme, hDC, BP_PUSHBUTTON, iState, &rc, null);
hr = GetThemeBackgroundContentRect(hTheme, hDC, BP_PUSHBUTTON, iState, &rc, &rcContent);
hr = DrawThemeText(hTheme, hDC, BP_PUSHBUTTON, iState,
text.toUTF16z, text.count,
DT_CENTER | DT_VCENTER | DT_SINGLELINE,
0, &rcContent);
}
|
D
|
import derelict.glfw3.glfw3;
import derelict.opengl3.gl3;
import glwtf.window;
import glwtf.input;
import std.stdio;
import shit;
enum TIT = "Eggs";
shared static this() {
DerelictGLFW3.load();
DerelictGL3.load();
glfwInit();
}
Shit shite;
void main() {
shite = new Shit(TIT);
shite.loop();
}
|
D
|
/**
* D header file for POSIX.
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Sean Kelly,
Alex Rønne Petersen
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
*/
/* Copyright Sean Kelly 2005 - 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 core.sys.posix.time;
import core.sys.posix.config;
public import core.stdc.time;
public import core.sys.posix.sys.types;
public import core.sys.posix.signal; // for sigevent
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:
//
// Required (defined in core.stdc.time)
//
/*
char* asctime(const scope tm*);
clock_t clock();
char* ctime(const scope time_t*);
double difftime(time_t, time_t);
tm* gmtime(const scope time_t*);
tm* localtime(const scope time_t*);
time_t mktime(tm*);
size_t strftime(char*, size_t, const scope char*, const scope tm*);
time_t time(time_t*);
*/
version (CRuntime_Glibc)
{
time_t timegm(tm*); // non-standard
}
else version (Darwin)
{
time_t timegm(tm*); // non-standard
}
else version (FreeBSD)
{
time_t timegm(tm*); // non-standard
}
else version (NetBSD)
{
time_t timegm(tm*); // non-standard
}
else version (OpenBSD)
{
time_t timegm(tm*); // non-standard
}
else version (DragonFlyBSD)
{
time_t timegm(tm*); // non-standard
}
else version (Solaris)
{
time_t timegm(tm*); // non-standard
}
else version (CRuntime_Bionic)
{
// Not supported.
}
else version (CRuntime_Musl)
{
pragma(mangle, muslRedirTime64Mangle!("timegm", "__timegm_time64"))
time_t timegm(tm*);
}
else version (CRuntime_UClibc)
{
time_t timegm(tm*);
}
else
{
static assert(false, "Unsupported platform");
}
//
// C Extension (CX)
// (defined in core.stdc.time)
//
/*
char* tzname[];
void tzset();
*/
//
// Process CPU-Time Clocks (CPT)
//
/*
int clock_getcpuclockid(pid_t, clockid_t*);
*/
//
// Clock Selection (CS)
//
/*
int clock_nanosleep(clockid_t, int, const scope timespec*, timespec*);
*/
//
// Monotonic Clock (MON)
//
/*
CLOCK_MONOTONIC
*/
version (linux)
{
enum CLOCK_MONOTONIC = 1;
}
else version (FreeBSD)
{ // time.h
enum CLOCK_MONOTONIC = 4;
}
else version (NetBSD)
{
// time.h
enum CLOCK_MONOTONIC = 3;
}
else version (OpenBSD)
{
// time.h
enum CLOCK_MONOTONIC = 3;
}
else version (DragonFlyBSD)
{ // time.h
enum CLOCK_MONOTONIC = 4;
}
else version (Darwin)
{
// No CLOCK_MONOTONIC defined
}
else version (Solaris)
{
enum CLOCK_MONOTONIC = 4;
}
else
{
static assert(0);
}
//
// Timer (TMR)
//
/*
CLOCK_PROCESS_CPUTIME_ID (TMR|CPT)
CLOCK_THREAD_CPUTIME_ID (TMR|TCT)
struct timespec
{
time_t tv_sec;
int tv_nsec;
}
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
CLOCK_REALTIME
TIMER_ABSTIME
clockid_t
timer_t
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
*/
version (linux)
{
struct timespec
{
time_t tv_sec;
c_long tv_nsec;
}
}
else version (Darwin)
{
struct timespec
{
time_t tv_sec;
c_long tv_nsec;
}
}
else version (FreeBSD)
{
struct timespec
{
time_t tv_sec;
c_long tv_nsec;
}
}
else version (NetBSD)
{
struct timespec
{
time_t tv_sec;
c_long tv_nsec;
}
}
else version (OpenBSD)
{
struct timespec
{
time_t tv_sec;
c_long tv_nsec;
}
}
else version (DragonFlyBSD)
{
struct timespec
{
time_t tv_sec;
c_long tv_nsec;
}
}
else version (Solaris)
{
struct timespec
{
time_t tv_sec;
c_long tv_nsec;
}
alias timespec timestruc_t;
}
else
{
static assert(false, "Unsupported platform");
}
version (CRuntime_Glibc)
{
enum CLOCK_PROCESS_CPUTIME_ID = 2;
enum CLOCK_THREAD_CPUTIME_ID = 3;
// NOTE: See above for why this is commented out.
//
//struct timespec
//{
// time_t tv_sec;
// c_long tv_nsec;
//}
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum CLOCK_REALTIME = 0;
enum TIMER_ABSTIME = 0x01;
alias int clockid_t;
alias void* timer_t;
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
}
else version (Darwin)
{
int nanosleep(const scope timespec*, timespec*);
}
else version (FreeBSD)
{
//enum CLOCK_PROCESS_CPUTIME_ID = ??;
enum CLOCK_THREAD_CPUTIME_ID = 15;
// NOTE: See above for why this is commented out.
//
//struct timespec
//{
// time_t tv_sec;
// c_long tv_nsec;
//}
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum CLOCK_REALTIME = 0;
enum TIMER_ABSTIME = 0x01;
alias int clockid_t; // <sys/_types.h>
alias int timer_t;
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
}
else version (DragonFlyBSD)
{
enum CLOCK_THREAD_CPUTIME_ID = 15;
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum CLOCK_REALTIME = 0;
enum TIMER_ABSTIME = 0x01;
alias int clockid_t; // <sys/_types.h>
alias int timer_t;
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
}
else version (NetBSD)
{
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum CLOCK_REALTIME = 0;
enum TIMER_ABSTIME = 0x01;
alias int clockid_t; // <sys/_types.h>
alias int timer_t;
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
}
else version (OpenBSD)
{
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum CLOCK_REALTIME = 0;
enum TIMER_ABSTIME = 0x1;
alias int clockid_t; // <sys/_types.h>
alias int timer_t;
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int nanosleep(const scope timespec*, timespec*);
}
else version (Solaris)
{
enum CLOCK_PROCESS_CPUTIME_ID = 5; // <sys/time_impl.h>
enum CLOCK_THREAD_CPUTIME_ID = 2; // <sys/time_impl.h>
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum CLOCK_REALTIME = 3; // <sys/time_impl.h>
enum TIMER_ABSOLUTE = 0x1;
alias int clockid_t;
alias int timer_t;
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int clock_nanosleep(clockid_t, int, const scope timespec*, timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_getoverrun(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
}
else version (CRuntime_Bionic)
{
enum CLOCK_PROCESS_CPUTIME_ID = 2;
enum CLOCK_THREAD_CPUTIME_ID = 3;
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum CLOCK_REALTIME = 0;
enum CLOCK_REALTIME_HR = 4;
enum TIMER_ABSTIME = 0x01;
alias int clockid_t;
alias void* timer_t; // Updated since Lollipop
int clock_getres(int, timespec*);
int clock_gettime(int, timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(int, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
}
else version (CRuntime_Musl)
{
alias int clockid_t;
alias void* timer_t;
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum TIMER_ABSTIME = 1;
enum CLOCK_REALTIME = 0;
enum CLOCK_PROCESS_CPUTIME_ID = 2;
enum CLOCK_THREAD_CPUTIME_ID = 3;
enum CLOCK_REALTIME_COARSE = 5;
enum CLOCK_BOOTTIME = 7;
enum CLOCK_REALTIME_ALARM = 8;
enum CLOCK_BOOTTIME_ALARM = 9;
enum CLOCK_SGI_CYCLE = 10;
enum CLOCK_TAI = 11;
int nanosleep(const scope timespec*, timespec*);
pragma(mangle, muslRedirTime64Mangle!("clock_getres", "__clock_getres_time64"))
int clock_getres(clockid_t, timespec*);
pragma(mangle, muslRedirTime64Mangle!("clock_gettime", "__clock_gettime64"))
int clock_gettime(clockid_t, timespec*);
pragma(mangle, muslRedirTime64Mangle!("clock_settime", "__clock_settime64"))
int clock_settime(clockid_t, const scope timespec*);
pragma(mangle, muslRedirTime64Mangle!("clock_nanosleep", "__clock_nanosleep_time64"))
int clock_nanosleep(clockid_t, int, const scope timespec*, timespec*);
int clock_getcpuclockid(pid_t, clockid_t *);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
pragma(mangle, muslRedirTime64Mangle!("timer_gettime", "__timer_gettime64"))
int timer_gettime(timer_t, itimerspec*);
pragma(mangle, muslRedirTime64Mangle!("timer_settime", "__timer_settime64"))
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
int timer_getoverrun(timer_t);
}
else version (CRuntime_UClibc)
{
enum CLOCK_REALTIME = 0;
enum CLOCK_PROCESS_CPUTIME_ID = 2;
enum CLOCK_THREAD_CPUTIME_ID = 3;
struct itimerspec
{
timespec it_interval;
timespec it_value;
}
enum TIMER_ABSTIME = 0x01;
alias int clockid_t;
alias void* timer_t;
int clock_getres(clockid_t, timespec*);
int clock_gettime(clockid_t, timespec*);
int clock_settime(clockid_t, const scope timespec*);
int nanosleep(const scope timespec*, timespec*);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_gettime(timer_t, itimerspec*);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
}
else
{
static assert(false, "Unsupported platform");
}
//
// Thread-Safe Functions (TSF)
//
/*
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
*/
version (CRuntime_Glibc)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (Darwin)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (FreeBSD)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (NetBSD)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (OpenBSD)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (DragonFlyBSD)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (Solaris)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (CRuntime_Bionic)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else version (CRuntime_Musl)
{
char* asctime_r(const scope tm*, char*);
pragma(mangle, muslRedirTime64Mangle!("ctime_r", "__ctime64_r"))
char* ctime_r(const scope time_t*, char*);
pragma(mangle, muslRedirTime64Mangle!("gmtime_r", "__gmtime64_r"))
tm* gmtime_r(const scope time_t*, tm*);
pragma(mangle, muslRedirTime64Mangle!("localtime_r", "__localtime64_r"))
tm* localtime_r(const scope time_t*, tm*);
}
else version (CRuntime_UClibc)
{
char* asctime_r(const scope tm*, char*);
char* ctime_r(const scope time_t*, char*);
tm* gmtime_r(const scope time_t*, tm*);
tm* localtime_r(const scope time_t*, tm*);
}
else
{
static assert(false, "Unsupported platform");
}
//
// XOpen (XSI)
//
/*
getdate_err
int daylight;
int timezone;
tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
*/
version (CRuntime_Glibc)
{
extern __gshared int daylight;
extern __gshared c_long timezone;
tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else version (Darwin)
{
extern __gshared c_long timezone;
extern __gshared int daylight;
tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else version (FreeBSD)
{
//tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else version (NetBSD)
{
tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else version (OpenBSD)
{
//tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else version (DragonFlyBSD)
{
//tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else version (Solaris)
{
extern __gshared c_long timezone, altzone;
extern __gshared int daylight;
tm* getdate(const scope char*);
char* __strptime_dontzero(const scope char*, const scope char*, tm*);
alias __strptime_dontzero strptime;
}
else version (CRuntime_Bionic)
{
extern __gshared int daylight;
extern __gshared c_long timezone;
char* strptime(const scope char*, const scope char*, tm*);
}
else version (CRuntime_Musl)
{
extern __gshared int daylight;
extern __gshared c_long timezone;
tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else version (CRuntime_UClibc)
{
extern __gshared int daylight;
extern __gshared c_long timezone;
tm* getdate(const scope char*);
char* strptime(const scope char*, const scope char*, tm*);
}
else
{
static assert(false, "Unsupported platform");
}
|
D
|
/home/molok/projects/rust/simulation/target/rls/debug/deps/simulation-4b3e7bf7aee3ccdb.rmeta: src/main.rs
/home/molok/projects/rust/simulation/target/rls/debug/deps/simulation-4b3e7bf7aee3ccdb.d: src/main.rs
src/main.rs:
|
D
|
/** ANSI escape codes and sequences.
*
* See_Also: https://en.wikipedia.org/wiki/ANSI_escape_code
*/
module nxt.ansi_escape;
public import nxt.color : ColorRGB8;
@safe:
/** Visual attributes.
*/
struct Attrs
{
@safe:
immutable(SGR)[] sgrs; ///< Ordered set of SGR, typically initialized from `static immutable(SGR)[]`.
ColorRGB8 foregroundColor; ///< Foreground color.
ColorRGB8 backgroundColor; ///< Background color.
bool useForegroundColor; ///< Indicate if 'foregroundColor is to be used.
bool useBackgroundColor; ///< Indicate if 'backgroundColor is to be used.
void set(scope void delegate(scope const(char)[]) @safe sink)
{
setSGRs(sink, sgrs);
if (useForegroundColor)
{
setForegroundColorRGB8(sink, foregroundColor);
}
if (useBackgroundColor)
{
setBackgroundColorRGB8(sink, backgroundColor);
}
}
void reset(scope void delegate(scope const(char)[]) @safe sink)
{
resetSGRs(sink);
}
}
/** SGR (Select Graphic Rendition) sets display attributes.
*
* See_Also: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
*/
enum SGR : uint
{
init = 0, ///< Default.
bold = 1, ///< Bold or increased intensity.
faint = 2, ///< Faint (decreased intensity)
italic = 3, ///< Italic. Not widely supported. Sometimes treated as inverse.
underline = 4, ///< Underline.
slowBlink = 5, ///< Slow blink.
rapidBlink = 6, ///< Rapid blink.
reverseVideo = 7, ///< Reversed video (swap). Swap foreground with background color.
hide = 8, ///< Conceal (Hide). Not widely supported.
crossedOut = 9, ///< Crossed-out. Characters legible, but marked for deletion.
primaryDefaultFont = 10, ///< Primary (default) font.
fraktur = 20, ///< Fraktur. Rarely supported
blackForegroundColor = 30, ///< Black foreground color.
redForegroundColor = 31, ///< Red foreground color.
greenForegroundColor = 32, ///< Green foreground color.
yellowForegroundColor = 33, ///< Yellow foreground color.
blueForegroundColor = 34, ///< Blue foreground color.
magentaForegroundColor = 35, ///< Magenta foreground color.
cyanForegroundColor = 36, ///< Cyan foreground color.
whiteForegroundColor = 37, ///< White foreground color.
defaultForegroundColor = 39, ///< Default foreground color.
lightBlackForegroundColor = 90, ///< Light black foreground color.
lightRedForegroundColor = 91, ///< Light red foreground color.
lightGreenForegroundColor = 92, ///< Light green foreground color.
lightYellowForegroundColor = 93, ///< Light yellow foreground color.
lightBlueForegroundColor = 94, ///< Light blue foreground color.
lightMagentaForegroundColor = 95, ///< Light magenta foreground color.
lightCyanForegroundColor = 96, ///< Light cyan foreground color.
lightWhiteForegroundColor = 97, ///< Light white foreground color.
defaultBackgroundColor = 49, ///< Default background color.
framed = 51, ///< Framed.
encircled = 52, ///< Encircled.
overlined = 53, ///< Overlined.
notFramedOrEncircled = 54, ///< Not framed or encircled.
notOverlined = 55, ///< Not overlined.
IdeogramUnderlineOrRightSideLine = 60, ///< Ideogram underline or right side line.
}
private void setSGR(scope void delegate(scope const(char)[]) @safe sink,
const SGR sgr)
{
final switch (sgr)
{
static foreach (member; __traits(allMembers, SGR))
{
case __traits(getMember, SGR, member):
enum _ = cast(int)__traits(getMember, SGR, member); // avoids `std.conv.to`
sink(_.stringof);
return;
}
}
}
void setSGRs(scope void delegate(scope const(char)[]) @safe sink,
scope const SGR[] sgrs...) @safe
{
sink("\033[");
const n = sgrs.length;
foreach (const index, const sgr; sgrs)
{
setSGR(sink, sgr); // needs to be first
if (index != n - 1) // if not last
{
sink(";"); // separator
}
}
sink("m");
}
void resetSGRs(scope void delegate(scope const(char)[]) @safe sink)
{
sink("\033[0m");
}
void putWithSGRs(scope void delegate(scope const(char)[]) @safe sink,
scope const(char)[] text,
scope const SGR[] sgrs...) @safe
{
setSGRs(sink, sgrs); // set
sink(text);
resetSGRs(sink); // reset
}
/** Set foreground color to `rgb`.
*
* See_Also: https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit
*/
void setForegroundColorRGB8(scope void delegate(scope const(char)[]) @safe sink,
const ColorRGB8 rgb) @safe
{
sink("\033[38;2;");
setColorRGB8Component(sink, rgb.redC);
sink(";");
setColorRGB8Component(sink, rgb.greenC);
sink(";");
setColorRGB8Component(sink, rgb.blueC);
sink("m");
}
/** Set background color to `rgb`.
*
* See_Also: https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit
*/
void setBackgroundColorRGB8(scope void delegate(scope const(char)[]) @safe sink,
const ColorRGB8 rgb) @safe
{
sink("\033[48;2;");
setColorRGB8Component(sink, rgb.redC);
sink(";");
setColorRGB8Component(sink, rgb.greenC);
sink(";");
setColorRGB8Component(sink, rgb.blueC);
sink("m");
}
/** Set RGB 24-bit color component `component`.
*
* See_Also: https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit
*/
static private void setColorRGB8Component(scope void delegate(scope const(char)[]) @safe sink,
const ubyte component) @safe
{
final switch (component)
{
static foreach (value; 0 .. 256)
{
case value:
sink(value.stringof); // avoids `std.conv.to`
return;
}
}
}
version(none):
version(unittest)
class C
{
@safe:
@property void toString(scope void delegate(scope const(char)[]) @safe sink) const @trusted
{
putWithSGRs(sink, "XXX", SGR.yellowForegroundColor);
}
this() {}
}
@safe unittest
{
import std.stdio : writeln;
import std.conv : to;
auto c = new C();
writeln(c.to!string);
}
|
D
|
/*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*
* Port to the D programming language:
* Jacob Carlborg <[email protected]>
*******************************************************************************/
module dwt.internal.cocoa.SWTApplicationDelegate;
import dwt.dwthelper.utils;
import dwt.internal.cocoa.NSObject;
import objc = dwt.internal.objc.runtime;
public class SWTApplicationDelegate : NSObject {
public this() {
super(cast(objc.id) null);
}
public this(objc.id id) {
super(id);
}
}
|
D
|
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Vapor.build/WebSocket/WebSocketClient.swift.o : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Crypto.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/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Vapor.build/WebSocket/WebSocketClient~partial.swiftmodule : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Crypto.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/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Vapor.build/WebSocket/WebSocketClient~partial.swiftdoc : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Crypto.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/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
import std.stdio;
import std.datetime: MonoTime;
import std.random;
import std.math;
import core.memory;
import f1 = format_old;
import f2 = format_new;
void main(string[] args)
{
enum format = "%f";
uint seed = uniform(0,uint.max);
stderr.writeln("seed: ",seed);
auto rnd = Random(seed);
ulong count = 0;
ulong[2] sum = 0;
ulong[2048][2] e_sum = 0;
ulong[2048] e_count = 0;
ulong faster = 0;
foreach (i;0..100_000_000)
{
if (i%1_000_000==0) { stderr.write("."); stderr.flush(); }
A a;
a.u[0] = uniform!"[]"(0,uint.max,rnd);
a.u[1] = uniform!"[]"(0,uint.max,rnd);
int exp = (a.l >> 52) & ((1L << 11) - 1);
string r_old;
string r_new;
ulong d1;
ulong d2;
{
GC.minimize();
auto start = MonoTime.currTime;
r_old = f1.format!format(a.f);
auto delta = (MonoTime.currTime-start).total!"nsecs";
d1 = delta;
}
{
GC.minimize();
auto start = MonoTime.currTime;
r_new = f2.format!format(a.f);
auto delta = (MonoTime.currTime-start).total!"nsecs";
d2 = delta;
}
++count;
sum[0] += d1;
sum[1] += d2;
++e_count[exp];
e_sum[0][exp] += d1;
e_sum[1][exp] += d2;
if (d2<d1) ++faster;
}
stderr.writeln();
foreach (i;0..2048)
writeln(e_sum[0][i]/e_count[i], " ", e_sum[1][i]/e_count[i]);
writeln;
writeln(sum[0]/count, " ",sum[1]/count," ",faster," ",count);
}
union A
{
double f;
uint[2] u;
ulong l;
}
|
D
|
module android.java.android.bluetooth.BluetoothHidDeviceAppQosSettings_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.android.os.Parcel_d_interface;
final class BluetoothHidDeviceAppQosSettings : IJavaObject {
static immutable string[] _d_canCastTo = [
"android/os/Parcelable",
];
@Import this(int, int, int, int, int, int);
@Import int getServiceType();
@Import int getTokenRate();
@Import int getTokenBucketSize();
@Import int getPeakBandwidth();
@Import int getLatency();
@Import int getDelayVariation();
@Import int describeContents();
@Import void writeToParcel(import0.Parcel, int);
@Import import1.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@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 = "Landroid/bluetooth/BluetoothHidDeviceAppQosSettings;";
}
|
D
|
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC core/sys/windows/_lmrepl.d)
*/
module core.sys.windows.lmrepl;
version (Windows):
pragma(lib, "netapi32");
import core.sys.windows.lmcons, core.sys.windows.windef;
enum REPL_ROLE_EXPORT=1;
enum REPL_ROLE_IMPORT=2;
enum REPL_ROLE_BOTH=3;
enum REPL_INTERVAL_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+0;
enum REPL_PULSE_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+1;
enum REPL_GUARDTIME_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+2;
enum REPL_RANDOM_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+3;
enum REPL_UNLOCK_NOFORCE=0;
enum REPL_UNLOCK_FORCE=1;
enum REPL_STATE_OK=0;
enum REPL_STATE_NO_MASTER=1;
enum REPL_STATE_NO_SYNC=2;
enum REPL_STATE_NEVER_REPLICATED=3;
enum REPL_INTEGRITY_FILE=1;
enum REPL_INTEGRITY_TREE=2;
enum REPL_EXTENT_FILE=1;
enum REPL_EXTENT_TREE=2;
enum REPL_EXPORT_INTEGRITY_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+0;
enum REPL_EXPORT_EXTENT_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+1;
struct REPL_INFO_0 {
DWORD rp0_role;
LPWSTR rp0_exportpath;
LPWSTR rp0_exportlist;
LPWSTR rp0_importpath;
LPWSTR rp0_importlist;
LPWSTR rp0_logonusername;
DWORD rp0_interval;
DWORD rp0_pulse;
DWORD rp0_guardtime;
DWORD rp0_random;
}
alias REPL_INFO_0* PREPL_INFO_0, LPREPL_INFO_0;
struct REPL_INFO_1000 {
DWORD rp1000_interval;
}
alias REPL_INFO_1000* PREPL_INFO_1000, LPREPL_INFO_1000;
struct REPL_INFO_1001 {
DWORD rp1001_pulse;
}
alias REPL_INFO_1001* PREPL_INFO_1001, LPREPL_INFO_1001;
struct REPL_INFO_1002 {
DWORD rp1002_guardtime;
}
alias REPL_INFO_1002* PREPL_INFO_1002, LPREPL_INFO_1002;
struct REPL_INFO_1003 {
DWORD rp1003_random;
}
alias REPL_INFO_1003* PREPL_INFO_1003, LPREPL_INFO_1003;
struct REPL_EDIR_INFO_0 {
LPWSTR rped0_dirname;
}
alias REPL_EDIR_INFO_0* PREPL_EDIR_INFO_0, LPREPL_EDIR_INFO_0;
struct REPL_EDIR_INFO_1 {
LPWSTR rped1_dirname;
DWORD rped1_integrity;
DWORD rped1_extent;
}
alias REPL_EDIR_INFO_1* PREPL_EDIR_INFO_1, LPREPL_EDIR_INFO_1;
struct REPL_EDIR_INFO_2 {
LPWSTR rped2_dirname;
DWORD rped2_integrity;
DWORD rped2_extent;
DWORD rped2_lockcount;
DWORD rped2_locktime;
}
alias REPL_EDIR_INFO_2* PREPL_EDIR_INFO_2, LPREPL_EDIR_INFO_2;
struct REPL_EDIR_INFO_1000 {
DWORD rped1000_integrity;
}
alias REPL_EDIR_INFO_1000* PREPL_EDIR_INFO_1000, LPREPL_EDIR_INFO_1000;
struct REPL_EDIR_INFO_1001 {
DWORD rped1001_extent;
}
alias REPL_EDIR_INFO_1001* PREPL_EDIR_INFO_1001, LPREPL_EDIR_INFO_1001;
struct REPL_IDIR_INFO_0 {
LPWSTR rpid0_dirname;
}
alias REPL_IDIR_INFO_0* PREPL_IDIR_INFO_0, LPREPL_IDIR_INFO_0;
struct REPL_IDIR_INFO_1 {
LPWSTR rpid1_dirname;
DWORD rpid1_state;
LPWSTR rpid1_mastername;
DWORD rpid1_last_update_time;
DWORD rpid1_lockcount;
DWORD rpid1_locktime;
}
alias REPL_IDIR_INFO_1* PREPL_IDIR_INFO_1, LPREPL_IDIR_INFO_1;
extern (Windows) {
NET_API_STATUS NetReplGetInfo(LPCWSTR,DWORD,PBYTE*);
NET_API_STATUS NetReplSetInfo(LPCWSTR,DWORD,PBYTE,PDWORD);
NET_API_STATUS NetReplExportDirAdd(LPCWSTR,DWORD,PBYTE,PDWORD);
NET_API_STATUS NetReplExportDirDel(LPCWSTR,LPCWSTR);
NET_API_STATUS NetReplExportDirEnum(LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
NET_API_STATUS NetReplExportDirGetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE*);
NET_API_STATUS NetReplExportDirSetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE,PDWORD);
NET_API_STATUS NetReplExportDirLock(LPCWSTR,LPCWSTR);
NET_API_STATUS NetReplExportDirUnlock(LPCWSTR,LPCWSTR,DWORD);
NET_API_STATUS NetReplImportDirAdd(LPCWSTR,DWORD,PBYTE,PDWORD);
NET_API_STATUS NetReplImportDirDel(LPCWSTR,LPCWSTR);
NET_API_STATUS NetReplImportDirEnum(LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
NET_API_STATUS NetReplImportDirGetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE*);
NET_API_STATUS NetReplImportDirLock(LPCWSTR,LPCWSTR);
NET_API_STATUS NetReplImportDirUnlock(LPCWSTR,LPCWSTR,DWORD);
}
|
D
|
/**
* Blowfish
*
* Copyright:
* (C) 1999-2011 Jack Lloyd
* (C) 2014-2015 Etienne Cimon
*
* License:
* Botan is released under the Simplified BSD License (see LICENSE.md)
*/
module botan.block.blowfish;
import botan.constants;
static if (BOTAN_HAS_BLOWFISH):
import std.range : iota;
import std.algorithm : min;
import botan.block.block_cipher;
import botan.utils.loadstor;
import botan.utils.types;
import botan.utils.mem_ops;
/**
* Blowfish
*/
final class Blowfish : BlockCipherFixedParams!(8, 1, 56), BlockCipher, SymmetricAlgorithm
{
public:
/*
* Blowfish Encryption
*/
override void encryptN(const(ubyte)* input, ubyte* output, size_t blocks)
{
import botan.utils.get_byte : get_byte;
const uint* S1 = m_S.ptr;
const uint* S2 = &m_S[256];
const uint* S3 = &m_S[512];
const uint* S4 = &m_S[768];
foreach (size_t i; 0 .. blocks)
{
uint L = loadBigEndian!uint(input, 0);
uint R = loadBigEndian!uint(input, 1);
for (size_t j = 0; j < 16; j += 2)
{
L ^= m_P[j];
R ^= ((S1[get_byte(0, L)] + S2[get_byte(1, L)]) ^
S3[get_byte(2, L)]) + S4[get_byte(3, L)];
R ^= m_P[j+1];
L ^= ((S1[get_byte(0, R)] + S2[get_byte(1, R)]) ^
S3[get_byte(2, R)]) + S4[get_byte(3, R)];
}
L ^= m_P[16]; R ^= m_P[17];
storeBigEndian(output, R, L);
input += BLOCK_SIZE;
output += BLOCK_SIZE;
}
}
/*
* Blowfish Decryption
*/
override void decryptN(const(ubyte)* input, ubyte* output, size_t blocks)
{
import botan.utils.get_byte : get_byte;
const uint* S1 = m_S.ptr;
const uint* S2 = &m_S[256];
const uint* S3 = &m_S[512];
const uint* S4 = &m_S[768];
foreach (size_t i; 0 .. blocks)
{
uint L = loadBigEndian!uint(input, 0);
uint R = loadBigEndian!uint(input, 1);
for (int j = 17; j > 1; j -= 2)
{
L ^= m_P[j];
R ^= ((S1[get_byte(0, L)] + S2[get_byte(1, L)]) ^
S3[get_byte(2, L)]) + S4[get_byte(3, L)];
R ^= m_P[j-1];
L ^= ((S1[get_byte(0, R)] + S2[get_byte(1, R)]) ^
S3[get_byte(2, R)]) + S4[get_byte(3, R)];
}
L ^= m_P[1]; R ^= m_P[0];
storeBigEndian(output, R, L);
input += BLOCK_SIZE;
output += BLOCK_SIZE;
}
}
/**
* Modified EKSBlowfish key schedule, used for bcrypt password hashing
*/
void eksKeySchedule(const(ubyte)* key, size_t length,
in ubyte[16] salt, size_t workfactor)
{
import std.conv : to;
// Truncate longer passwords to the 56 ubyte limit Blowfish enforces
length = min(length, 55);
if (workfactor == 0)
throw new InvalidArgument("Bcrypt work factor must be at least 1");
/*
* On a 2.8 GHz Core-i7, workfactor == 18 takes about 25 seconds to
* hash a password. This seems like a reasonable upper bound for the
* time being.
*/
if (workfactor > 18)
throw new InvalidArgument("Requested Bcrypt work factor " ~ to!string(workfactor) ~ " too large");
m_P.reserve(18);
m_P[] = P_INIT[0 .. 18];
m_S.reserve(1024);
m_S[] = S_INIT[0 .. 1024];
key_expansion(key, length, salt);
const ubyte[16] null_salt;
const size_t rounds = 1 << workfactor;
for (size_t r = 0; r != rounds; ++r)
{
key_expansion(key, length, null_salt);
key_expansion(salt.ptr, 16, null_salt);
}
}
/*
* Clear memory of sensitive data
*/
override void clear()
{
zap(m_P);
zap(m_S);
}
override @property string name() const { return "Blowfish"; }
override @property size_t parallelism() const { return 1; }
override BlockCipher clone() const { return new Blowfish; }
override size_t blockSize() const { return super.blockSize(); }
override KeyLengthSpecification keySpec() const { return super.keySpec(); }
protected:
/*
* Blowfish Key Schedule
*/
override void keySchedule(const(ubyte)* key, size_t length)
{
m_P.reserve(18);
m_P[] = P_INIT[0 .. 18];
m_S.reserve(1024);
m_S[] = S_INIT[0 .. 1024];
immutable ubyte[16] null_salt;
key_expansion(key, length, null_salt);
}
private:
void key_expansion(const(ubyte)* key,
size_t length,
in ubyte[16] salt)
{
for (size_t i = 0, j = 0; i < 18; ++i, j += 4) {
m_P[i] ^= make_uint(key[(j ) % length], key[(j+1) % length], key[(j+2) % length], key[(j+3) % length]);
}
uint L = 0, R = 0;
generate_sbox(m_P, L, R, salt, 0);
generate_sbox(m_S, L, R, salt, 2);
}
/*
* Generate one of the Sboxes
*/
void generate_sbox(ref SecureVector!uint box,
ref uint L, ref uint R,
in ubyte[16] salt,
size_t salt_off) const
{
import botan.utils.get_byte : get_byte;
const uint* S1 = m_S.ptr;
const uint* S2 = &m_S[256];
const uint* S3 = &m_S[512];
const uint* S4 = &m_S[768];
for (size_t i = 0; i < box.length; i += 2)
{
L ^= loadBigEndian!uint(salt.ptr, (i + salt_off) % 4);
R ^= loadBigEndian!uint(salt.ptr, (i + salt_off + 1) % 4);
for (size_t j = 0; j < 16; j += 2)
{
L ^= m_P[j];
R ^= ((S1[get_byte(0, L)] + S2[get_byte(1, L)]) ^
S3[get_byte(2, L)]) + S4[get_byte(3, L)];
R ^= m_P[j+1];
L ^= ((S1[get_byte(0, R)] + S2[get_byte(1, R)]) ^
S3[get_byte(2, R)]) + S4[get_byte(3, R)];
}
uint T = R; R = L ^ m_P[16]; L = T ^ m_P[17];
box[i] = L;
box[i+1] = R;
}
}
__gshared immutable uint[18] P_INIT = [
0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0xA4093822, 0x299F31D0,
0x082EFA98, 0xEC4E6C89, 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C,
0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, 0x9216D5D9, 0x8979FB1B ];
__gshared immutable uint[1024] S_INIT = [
0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED, 0x6A267E96,
0xBA7C9045, 0xF12C7F99, 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16,
0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 0x0D95748F, 0x728EB658,
0x718BCD58, 0x82154AEE, 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013,
0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 0x8E79DCB0, 0x603A180E,
0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,
0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 0x55CA396A, 0x2AAB10B6,
0xB4CC5C34, 0x1141E8CE, 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A,
0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 0xAFD6BA33, 0x6C24CF5C,
0x7A325381, 0x28958677, 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,
0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 0xEF845D5D, 0xE98575B1,
0xDC262302, 0xEB651B88, 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239,
0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 0x21C66842, 0xF6E96C9A,
0x670C9C61, 0xABD388F0, 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3,
0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 0xA1F1651D, 0x39AF0176,
0x66CA593E, 0x82430E88, 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE,
0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 0x4ED3AA62, 0x363F7706,
0x1BFEDF72, 0x429B023D, 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B,
0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 0xE3FE501A, 0xB6794C3B,
0x976CE0BD, 0x04C006BA, 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,
0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 0x6DFC511F, 0x9B30952C,
0xCC814544, 0xAF5EBD09, 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3,
0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 0x5579C0BD, 0x1A60320A,
0xD6A100C6, 0x402C7279, 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8,
0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 0x323DB5FA, 0xFD238760,
0x53317B48, 0x3E00DF82, 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB,
0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 0x695B27B0, 0xBBCA58C8,
0xE1FFA35D, 0xB8F011A0, 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B,
0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 0xE1DDF2DA, 0xA4CB7E33,
0x62FB1341, 0xCEE4C6E8, 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,
0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 0xD08ED1D0, 0xAFC725E0,
0x8E3C5B2F, 0x8E7594B7, 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C,
0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 0x2F2F2218, 0xBE0E1777,
0xEA752DFE, 0x8B021FA1, 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299,
0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 0x165FA266, 0x80957705,
0x93CC7314, 0x211A1477, 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF,
0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 0x00250E2D, 0x2071B35E,
0x226800BB, 0x57B8E0AF, 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA,
0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 0x83260376, 0x6295CFA9,
0x11C81968, 0x4E734A41, 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,
0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 0x08BA6FB5, 0x571BE91F,
0xF296EC6B, 0x2A0DD915, 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664,
0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A, 0x4B7A70E9, 0xB5B32944,
0xDB75092E, 0xC4192623, 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266,
0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, 0x193602A5, 0x75094C29,
0xA0591340, 0xE4183A3E, 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,
0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, 0x4CDD2086, 0x8470EB26,
0x6382E9C6, 0x021ECC5E, 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1,
0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, 0x3E07841C, 0x7FDEAE5C,
0x8E7D44EC, 0x5716F2B8, 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF,
0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, 0xD19113F9, 0x7CA92FF6,
0x94324773, 0x22F54701, 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7,
0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, 0xE238CD99, 0x3BEA0E2F,
0x3280BBA1, 0x183EB331, 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF,
0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, 0xDE9A771F, 0xD9930810,
0xB38BAE12, 0xDCCF3F2E, 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,
0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, 0xEC7AEC3A, 0xDB851DFA,
0x63094366, 0xC464C3D2, 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16,
0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, 0x71DFF89E, 0x10314E55,
0x81AC77D6, 0x5F11199B, 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509,
0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, 0x86E34570, 0xEAE96FB1,
0x860E5E0A, 0x5A3E2AB3, 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F,
0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, 0xC6150EBA, 0x94E2EA78,
0xA5FC3C53, 0x1E0A2DF4, 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960,
0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, 0xE3BC4595, 0xA67BC883,
0xB17F37D1, 0x018CFF28, 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,
0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, 0x1521B628, 0x29076170,
0xECDD4775, 0x619F1510, 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF,
0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, 0xEECC86BC, 0x60622CA7,
0x9CAB5CAB, 0xB2F3846E, 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50,
0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, 0x9B540B19, 0x875FA099,
0x95F7997E, 0x623D7DA8, 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281,
0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, 0x57F584A5, 0x1B227263,
0x9B83C3FF, 0x1AC24696, 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128,
0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, 0x5D4A14D9, 0xE864B7E3,
0x42105D14, 0x203E13E0, 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,
0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, 0xD81E799E, 0x86854DC7,
0xE44B476A, 0x3D816250, 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3,
0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, 0x095BBF00, 0xAD19489D,
0x1462B174, 0x23820E00, 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061,
0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, 0x7CDE3759, 0xCBEE7460,
0x4085F2A7, 0xCE77326E, 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735,
0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, 0x9E447A2E, 0xC3453484,
0xFDD56705, 0x0E1E9EC9, 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340,
0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, 0x153E21E7, 0x8FB03D4A,
0xE6E39F2B, 0xDB83ADF7, 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934,
0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, 0xD4082471, 0x3320F46A,
0x43B7D4B7, 0x500061AF, 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840,
0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, 0xBFBC09EC, 0x03BD9785,
0x7FAC6DD0, 0x31CB8504, 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A,
0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, 0x68DC1462, 0xD7486900,
0x680EC0A4, 0x27A18DEE, 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,
0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, 0x20FE9E35, 0xD9F385B9,
0xEE39D7AB, 0x3B124E8B, 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2,
0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, 0xFB0AF54E, 0xD8FEB397,
0x454056AC, 0xBA489527, 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B,
0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, 0xA62A4A56, 0x3F3125F9,
0x5EF47E1C, 0x9029317C, 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3,
0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, 0x07F9C9EE, 0x41041F0F,
0x404779A4, 0x5D886E17, 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564,
0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, 0x0E12B4C2, 0x02E1329E,
0xAF664FD1, 0xCAD18115, 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,
0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, 0xD0127845, 0x95B794FD,
0x647D0862, 0xE7CCF5F0, 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E,
0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, 0xA812DC60, 0xA1EBDDF8,
0x991BE14C, 0xDB6E6B0D, 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804,
0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, 0x667B9FFB, 0xCEDB7D9C,
0xA091CF0B, 0xD9155EA3, 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB,
0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, 0x6842ADA7, 0xC66A2B3B,
0x12754CCC, 0x782EF11C, 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350,
0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, 0x44421659, 0x0A121386,
0xD90CEC6E, 0xD5ABEA2A, 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,
0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, 0xD1FD8346, 0xF6381FB0,
0x7745AE04, 0xD736FCCC, 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F,
0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, 0x4E58F48F, 0xF2DDFDA2,
0xF474EF38, 0x8789BDC2, 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9,
0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, 0x466E598E, 0x20B45770,
0x8CD55591, 0xC902DE4C, 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E,
0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, 0xE85A1F02, 0x09F0BE8C,
0x4A99A025, 0x1D6EFE10, 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169,
0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, 0x50115E01, 0xA70683FA,
0xA002B5C4, 0x0DE6D027, 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,
0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, 0x11E69ED7, 0x2338EA63,
0x53C2DD94, 0xC2C21634, 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76,
0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, 0x86E3725F, 0x724D9DB9,
0x1AC15BB4, 0xD39EB8FC, 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4,
0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, 0x6FD5C7E7, 0x56E14EC4,
0x362ABFCE, 0xDDC6C837, 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0,
0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 0x5CB0679E, 0x4FA33742,
0xD3822740, 0x99BC9BBE, 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B,
0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, 0x5748AB2F, 0xBC946E79,
0xC6A376D2, 0x6549C2C8, 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6,
0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, 0xA1FAD5F0, 0x6A2D519A,
0x63EF8CE2, 0x9A86EE22, 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,
0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, 0x2826A2F9, 0xA73A3AE1,
0x4BA99586, 0xEF5562E9, 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59,
0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, 0xE990FD5A, 0x9E34D797,
0x2CF0B7D9, 0x022B8B51, 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,
0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, 0xE029AC71, 0xE019A5E6,
0x47B0ACFD, 0xED93FA9B, 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28,
0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, 0x15056DD4, 0x88F46DBA,
0x03A16125, 0x0564F0BD, 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A,
0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, 0x7533D928, 0xB155FDF5,
0x03563482, 0x8ABA3CBB, 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F,
0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, 0xEA7A90C2, 0xFB3E7BCE,
0x5121CE64, 0x774FBE32, 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680,
0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, 0xB39A460A, 0x6445C0DD,
0x586CDECF, 0x1C20C8AE, 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,
0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, 0x72EACEA8, 0xFA6484BB,
0x8D6612AE, 0xBF3C6F47, 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370,
0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, 0x4040CB08, 0x4EB4E2CC,
0x34D2466A, 0x0115AF84, 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048,
0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, 0x611560B1, 0xE7933FDC,
0xBB3A792B, 0x344525BD, 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9,
0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, 0x1A908749, 0xD44FBD9A,
0xD0DADECB, 0xD50ADA38, 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F,
0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, 0xBF97222C, 0x15E6FC2A,
0x0F91FC71, 0x9B941525, 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,
0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, 0xE0EC6E0E, 0x1698DB3B,
0x4C98A0BE, 0x3278E964, 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E,
0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, 0xDF359F8D, 0x9B992F2E,
0xE60B6F47, 0x0FE3F11D, 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F,
0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, 0xF523F357, 0xA6327623,
0x93A83531, 0x56CCCD02, 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC,
0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, 0xE6C6C7BD, 0x327A140A,
0x45E1D006, 0xC3F27B9A, 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6,
0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, 0x53113EC0, 0x1640E3D3,
0x38ABBD60, 0x2547ADF0, 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,
0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, 0x1948C25C, 0x02FB8A8C,
0x01C36AE4, 0xD6EBE1F9, 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,
0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 ];
SecureVector!uint m_S, m_P;
}
|
D
|
/*******************************************************************************
Asynchronous/event-driven DLS client using non-blocking socket I/O (epoll)
Documentation:
For detailed documentation see dlsproto.client.legacy.README.
Basic usage example:
The following steps should be followed to set up and use the DLS client:
1. Create an EpollSelectDispatcher instance (see ocean.io.select).
2. Create a DlsClient instance, pass the epoll select dispatcher and the
maximum number of connections per node as constructor arguments.
3. Add the DLS nodes connection data by calling addNode() for each DLS
node to connect to. (Or simply call addNodes(), passing the path of
a .nodes file describing the list of nodes to connect to.)
4. Initiate the node handshake, and check that no error occurred.
5. Add one or multiple requests by calling one of the client request
methods and passing the resulting object to the client's assign()
method.
Example: Use at most five connections to each DLS node, connect to nodes
running at 192.168.1.234:56789 and 192.168.9.87:65432 and perform a Get
request.
---
import ocean.io.select.EpollSelectDispatcher;
import dlsproto.client.DlsClient;
time_t start = 0xC001D00D; // start of time range to query
time_t end = 0xDEADBEEF; // end of time range to query
// Error flag, set to true when a request error occurs.
bool error;
// Request notification callback. Sets the error flag on failure.
void notify ( DlsClient.RequestNotification info )
{
if ( info.type == info.type.Finished && !info.succeeded )
{
error = true;
}
}
// Handshake callback. Sets the error flag on handshake failure.
void handshake ( DlsClient.RequestContext context, bool ok )
{
error = !ok;
}
// Callback delegate to receive value
void receive_values ( DlsClient.RequestContext context, cstring timestamp,
cstring value )
{
// do something with the received record
}
// Initialise epoll -- Step 1
auto epoll = new EpollSelectDispatcher;
// Initialise DLS client -- Step 2
const NumConnections = 5;
auto dls = new DlsClient(epoll, NumConnections);
// Add nodes -- Step 3
dls.addNode("192.168.1.234", 56789);
dls.addNode("192.168.9.87", 65432);
// Perform node handshake -- Step 4
dls.nodeHandshake(&handshake, ¬ify);
epoll.eventLoop();
if ( error )
{
throw new Exception("Error during node handshake");
}
// Perform a GetRange request -- Step 5
dls.assign(dls.getRange("my_channel", start, end, &receive_values, ¬ify));
epoll.eventLoop();
---
Useful build flags:
============================================================================
-debug=SwarmClient: trace outputs noting when requests begin, end, etc
-debug=ISelectClient: trace outputs noting epoll registrations and events
firing
-debug=Raw: trace outputs noting raw data sent & received via epoll
Copyright:
Copyright (c) 2011-2017 dunnhumby Germany GmbH. All rights reserved.
License:
Boost Software License Version 1.0. See LICENSE.txt for details.
*******************************************************************************/
module dlsproto.client.DlsClient;
/*******************************************************************************
Imports
*******************************************************************************/
import ocean.transition;
import ocean.core.Verify;
import swarm.util.ExtensibleClass;
import swarm.Const;
import swarm.util.Hash : HashRange;
import swarm.client.model.IClient;
import swarm.client.model.ClientSettings;
import swarm.client.ClientExceptions;
import swarm.client.ClientCommandParams;
import swarm.client.request.model.ISuspendableRequest;
import swarm.client.request.model.IStreamInfo;
import swarm.client.request.notifier.IRequestNotification;
import swarm.client.connection.RequestOverflow;
import swarm.client.helper.GroupRequest;
import swarm.client.plugins.RequestQueueDiskOverflow;
import swarm.client.plugins.RequestScheduler;
import swarm.client.plugins.ScopeRequests;
import dlsproto.client.legacy.DlsConst;
import dlsproto.client.legacy.internal.registry.model.IDlsNodeRegistryInfo;
import dlsproto.client.legacy.internal.registry.DlsNodeRegistry;
import dlsproto.client.legacy.internal.DlsClientExceptions;
import dlsproto.client.legacy.internal.request.notifier.RequestNotification;
import dlsproto.client.legacy.internal.request.params.RequestParams;
import RequestSetup = dlsproto.client.legacy.internal.RequestSetup;
import ocean.core.Array : copy, endsWith;
import ocean.io.select.EpollSelectDispatcher;
import ocean.core.Enforce;
debug ( SwarmClient ) import ocean.io.Stdout;
import ocean.transition;
/*******************************************************************************
Extensible DLS Client.
Supported plugin classes can be passed as template parameters, an instance
of each of these classes must be passed to the constructor. For each plugin
class members may be added, depending on the particular plugin class.
Note that the call to setPlugins(), in the class' ctors, *must* occur before
the super ctor is called. This is because plugins may rely on the ctor being
able to access their properly initialised instance, usually via an
overridden method. The RequestQueueDiskOverflow plugin works like this, for
example.
Currently supported plugin classes:
see dlsproto.client.legacy.internal.plugins
and swarm.client.plugins
*******************************************************************************/
public class ExtensibleDlsClient ( Plugins ... ) : DlsClient
{
mixin ExtensibleClass!(Plugins);
/***************************************************************************
Constructor with support for only the legacy protocol. Automatically
calls addNodes() with the node definition file specified in the Config
instance.
Params:
epoll = EpollSelectDispatcher instance to use
plugin_instances = instances of Plugins
config = Config instance (see swarm.client.model.IClient. The
Config class is designed to be read from an application's
config.ini file via ocean.util.config.ConfigFiller)
fiber_stack_size = size of connection fibers' stack (in bytes)
***************************************************************************/
public this ( EpollSelectDispatcher epoll, Plugins plugin_instances,
IClient.Config config,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
this.setPlugins(plugin_instances);
super(epoll, config, fiber_stack_size);
}
/***************************************************************************
Constructor with support for only the legacy protocol. This constructor
that accepts all arguments manually (i.e. not read from a config file)
is mostly of use in tests.
Params:
epoll = EpollSelectDispatcher instance to use
plugin_instances = instances of Plugins
conn_limit = maximum number of connections to each DLS node
queue_size = maximum size of the per-node request queue
fiber_stack_size = size of connection fibers' stack (in bytes)
***************************************************************************/
public this ( EpollSelectDispatcher epoll, Plugins plugin_instances,
size_t conn_limit = IClient.Config.default_connection_limit,
size_t queue_size = IClient.Config.default_queue_size,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
this.setPlugins(plugin_instances);
super(epoll, conn_limit, queue_size, fiber_stack_size);
}
/***************************************************************************
Constructor with support for the neo and legacy protocols. Automatically
calls addNodes() with the node definition files specified in the legacy
and neo Config instances.
Params:
epoll = EpollSelectDispatcher instance to use
plugin_instances = instances of Plugins
config = swarm.client.model.IClient.Config instance. (The Config
class is designed to be read from an application's config.ini
file via ocean.util.config.ConfigFiller.)
neo_config = swarm.neo.client.mixins.ClientCore.Config instance.
(The Config class is designed to be read from an application's
config.ini file via ocean.util.config.ConfigFiller.)
conn_notifier = delegate which is called when a connection attempt
succeeds or fails (including when a connection is
re-established). Of type:
void delegate ( Neo.ConnNotification )
fiber_stack_size = size (in bytes) of stack of individual connection
fibers.
***************************************************************************/
public this ( EpollSelectDispatcher epoll, Plugins plugin_instances,
IClient.Config config, Neo.Config neo_config,
Neo.ConnectionNotifier conn_notifier,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
this.setPlugins(plugin_instances);
super(epoll, config, neo_config, conn_notifier, fiber_stack_size);
}
/***************************************************************************
Constructor with support for the neo and legacy protocols. This
constructor that accepts all arguments manually (i.e. not read from
config files) is mostly of use in tests.
Params:
epoll = select dispatcher to use
auth_name = client name for authorisation
auth_key = client key (password) for authorisation. This should be a
properly generated random number which only the client and the
nodes know. See `swarm/README_client_neo.rst` for suggestions. The key
must be of the length defined in
swarm.neo.authentication.HmacDef (128 bytes)
plugins = plugins instances
conn_notifier = delegate which is called when a connection attempt
succeeds or fails (including when a connection is
re-established). Of type:
void delegate ( Neo.ConnNotification )
conn_limit = maximum number of connections in pool
queue_size = size (in bytes) of per-node queue of pending requests
fiber_stack_size = size (in bytes) of stack of individual connection
fibers
***************************************************************************/
public this ( EpollSelectDispatcher epoll,
cstring auth_name, ubyte[] auth_key, Plugins plugins,
Neo.ConnectionNotifier conn_notifier,
size_t conn_limit = IClient.Config.default_connection_limit,
size_t queue_size = IClient.Config.default_queue_size,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
this.setPlugins(plugin_instances);
super(epoll, auth_name, auth_key, conn_notifier,
conn_limit, queue_size, fiber_stack_size);
}
}
/*******************************************************************************
DlsClient with a scheduler, with simplified constructor.
(This instantiation of the ExtensibleDlsClient template is provided for
convenience, as it is a commonly used case.)
*******************************************************************************/
public class SchedulingDlsClient : ExtensibleDlsClient!(RequestScheduler)
{
static class Config : IClient.Config
{
/***********************************************************************
Limit on the number of events which can be managed by the scheduler
at one time (0 = no limit)
***********************************************************************/
uint scheduler_limit = 0;
}
/***************************************************************************
Constructor with support for only the legacy protocol. Automatically
calls addNodes() with the node definition file specified in the Config
instance.
Params:
epoll = EpollSelectorDispatcher instance to use
config = Config instance (see swarm.client.model.IClient. The
Config class is designed to be read from an application's
config.ini file via ocean.util.config.ConfigFiller)
fiber_stack_size = size of connection fibers' stack (in bytes)
***************************************************************************/
public this ( EpollSelectDispatcher epoll, SchedulingDlsClient.Config config,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
super(epoll, new RequestScheduler(epoll, config.scheduler_limit),
config, fiber_stack_size);
}
/***************************************************************************
Constructor with support for only the legacy protocol. This constructor
that accepts all arguments manually (i.e. not read from a config file)
is mostly of use in tests.
Params:
epoll = EpollSelectorDispatcher instance to use
conn_limit = maximum number of connections to each DLS node
queue_size = maximum size of the per-node request queue
fiber_stack_size = size of connection fibers' stack (in bytes)
max_events = limit on the number of events which can be managed
by the scheduler at one time. (0 = no limit)
***************************************************************************/
public this ( EpollSelectDispatcher epoll,
size_t conn_limit = IClient.Config.default_connection_limit,
size_t queue_size = IClient.Config.default_queue_size,
size_t fiber_stack_size = IClient.default_fiber_stack_size,
uint max_events = 0 )
{
super(epoll, new RequestScheduler(epoll, max_events), conn_limit,
queue_size, fiber_stack_size);
}
/***************************************************************************
Constructor with support for the neo and legacy protocols. Automatically
calls addNodes() with the node definition files specified in the legacy
and neo Config instances.
Params:
epoll = EpollSelectDispatcher instance to use
plugin_instances = instances of Plugins
config = SchedulingDlsClient.Config instance. (The Config
class is designed to be read from an application's config.ini
file via ocean.util.config.ConfigFiller.)
neo_config = swarm.neo.client.mixins.ClientCore.Config instance.
(The Config class is designed to be read from an application's
config.ini file via ocean.util.config.ConfigFiller.)
conn_notifier = delegate which is called when a connection attempt
succeeds or fails (including when a connection is
re-established). Of type:
void delegate ( Neo.ConnNotification )
fiber_stack_size = size (in bytes) of stack of individual connection
fibers.
***************************************************************************/
public this ( EpollSelectDispatcher epoll,
SchedulingDlsClient.Config config, Neo.Config neo_config,
Neo.ConnectionNotifier conn_notifier,
size_t fiber_stack_size = IClient.default_fiber_stack_size)
{
this.setPlugins(plugin_instances);
super(epoll, new RequestScheduler(epoll, config.scheduler_limit),
config, neo_config, conn_notifier, fiber_stack_size);
}
/***************************************************************************
Constructor with support for the neo and legacy protocols. This
constructor that accepts all arguments manually (i.e. not read from
config files) is mostly of use in tests.
Params:
epoll = select dispatcher to use
auth_name = client name for authorisation
auth_key = client key (password) for authorisation. This should be a
properly generated random number which only the client and the
nodes know. See `swarm/README_client_neo.rst` for suggestions. The key
must be of the length defined in
swarm.neo.authentication.HmacDef (128 bytes)
conn_notifier = delegate which is called when a connection attempt
succeeds or fails (including when a connection is
re-established). Of type:
void delegate ( Neo.ConnNotification )
conn_limit = maximum number of connections in pool
queue_size = size (in bytes) of per-node queue of pending requests
fiber_stack_size = size (in bytes) of stack of individual connection
fibers
max_events = limit on the number of events which can be managed
by the scheduler at one time. (0 = no limit)
***************************************************************************/
public this ( EpollSelectDispatcher epoll,
cstring auth_name, ubyte[] auth_key,
Neo.ConnectionNotifier conn_notifier,
size_t conn_limit = IClient.Config.default_connection_limit,
size_t queue_size = IClient.Config.default_queue_size,
size_t fiber_stack_size = IClient.default_fiber_stack_size,
uint max_events = 0 )
{
super(epoll, auth_name, auth_key,
new RequestScheduler(epoll, max_events), conn_notifier,
conn_limit, queue_size, fiber_stack_size);
}
}
/*******************************************************************************
DLS Client
*******************************************************************************/
public class DlsClient : IClient
{
/***************************************************************************
Local alias definitions
***************************************************************************/
public alias .IRequestNotification RequestNotification;
public alias .ISuspendableRequest ISuspendableRequest;
public alias .IStreamInfo IStreamInfo;
public alias .RequestParams RequestParams;
/***************************************************************************
Plugin alias definitions
***************************************************************************/
public alias .RequestScheduler RequestScheduler;
public alias .RequestQueueDiskOverflow RequestQueueDiskOverflow;
public alias .ScopeRequestsPlugin ScopeRequestsPlugin;
public alias .DlsConst.FilterMode FilterMode;
/***************************************************************************
Node handshake class, used by the DlsClient.nodeHandshake() method to
synchronize the initial contacting of the DLS nodes and checking of the
API version and fetching of the nodes' hash ranges.
***************************************************************************/
private class NodeHandshake
{
/***********************************************************************
Delegate to be called when the handshake has finished, indicating
sucecss or failure.
***********************************************************************/
private RequestParams.GetBoolDg output;
/***********************************************************************
Request notification delegate.
***********************************************************************/
private alias RequestNotification.Callback NotifierDg;
private NotifierDg user_notifier;
/***********************************************************************
Counters to track how many out of all registered nodes have returned
for each request.
***********************************************************************/
private uint version_done_count;
/***********************************************************************
opCall -- initialises a node handshake for the specified DLS client.
Params:
output = delegate called when handshake is complete
user_notifier = request notification delegate
***********************************************************************/
public void opCall ( RequestParams.GetBoolDg output,
NotifierDg user_notifier )
{
this.reset(output, user_notifier);
with ( this.outer )
{
assign(getVersion(&this.getVersionIO, &this.handshakeNotifier));
}
}
/***********************************************************************
Resets all members ready to start a new handshake.
Params:
output = delegate called when handshake is complete
user_notifier = request notification delegate
***********************************************************************/
private void reset ( RequestParams.GetBoolDg output,
NotifierDg user_notifier )
{
this.output = output;
this.user_notifier = user_notifier;
this.version_done_count = 0;
}
/***********************************************************************
Notification callback used for all internally assigned DLS requests.
Params:
info = request notification info
TODO: could the bool delegate be replaced with a series of exceptions
which are sent to the notifier to denote different handshake errors?
***********************************************************************/
private void handshakeNotifier ( DlsClient.RequestNotification info )
{
if ( this.user_notifier !is null )
{
this.user_notifier(info);
}
if ( info.type == info.type.Finished )
{
with ( DlsConst.Command.E ) switch ( info.command )
{
case GetVersion: this.version_done_count++; break;
default:
assert(false);
}
auto dls_registry = cast(IDlsNodeRegistryInfo)this.outer.nodes;
verify(dls_registry !is null);
if ( version_done_count == dls_registry.length )
{
this.output(RequestContext(0), dls_registry.all_nodes_ok);
}
}
}
/***********************************************************************
GetVersion request callback.
Params:
context = request context (not used)
api_version = api version received from node
***********************************************************************/
private void getVersionIO ( RequestContext context, in cstring address,
ushort port, in cstring api_version )
{
debug ( SwarmClient ) Stderr.formatln("Received version {}:{} = '{}'",
address, port, api_version);
(cast(DlsNodeRegistry)this.outer.registry).setNodeAPIVersion(
address.dup, port, api_version);
}
}
/***************************************************************************
Node handshake instance.
TODO: using a single struct instance means that only one node handshake
can be active at a time. This is ok, but there's no way of enforcing it.
This could probably be reworked if we implement the request-grouping
feature for multi-node commands, or if the node handshake is moved to an
internal-only process.
***************************************************************************/
private NodeHandshake node_handshake;
/***************************************************************************
Exceptions thrown in error cases.
***************************************************************************/
private BadChannelNameException bad_channel_exception;
private NullFilterException null_filter_exception;
/***************************************************************************
Neo protocol support.
***************************************************************************/
import dlsproto.client.mixins.NeoSupport;
mixin NeoSupport!();
/***************************************************************************
Constructor with support for only the legacy protocol. Automatically
calls addNodes() with the node definition file specified in the Config
instance.
Params:
epoll = EpollSelectorDispatcher instance to use
config = Config instance (see swarm.client.model.IClient. The
Config class is designed to be read from an application's
config.ini file via ocean.util.config.ConfigFiller)
fiber_stack_size = size (in bytes) of stack of individual connection
fibers
***************************************************************************/
public this ( EpollSelectDispatcher epoll, IClient.Config config,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
with ( config )
{
this(epoll, connection_limit(), queue_size(), fiber_stack_size);
this.addNodes(nodes_file);
}
}
/***************************************************************************
Constructor with support for only the legacy protocol. This constructor
that accepts all arguments manually (i.e. not read from a config file)
is mostly of use in tests.
Params:
epoll = EpollSelectorDispatcher instance to use
conn_limit = maximum number of connections to each DLS node
queue_size = maximum size of the per-node request queue
fiber_stack_size = size (in bytes) of stack of individual connection
fibers
***************************************************************************/
public this ( EpollSelectDispatcher epoll,
size_t conn_limit = IClient.Config.default_connection_limit,
size_t queue_size = IClient.Config.default_queue_size,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
ClientSettings settings;
settings.conn_limit = conn_limit;
settings.queue_size = queue_size;
settings.fiber_stack_size = fiber_stack_size;
auto node_registry = this.newDlsNodeRegistry(epoll, settings,
this.requestOverflow, this.errorReporter);
super(epoll, node_registry);
this.bad_channel_exception = new BadChannelNameException;
this.null_filter_exception = new NullFilterException;
this.node_handshake = new NodeHandshake;
}
/***************************************************************************
Constructor with support for neo and legacy protocols. Accepts only
`Neo.Config`, not `IClient.Config`, for applications that use the neo
protocol only.
Params:
epoll = EpollSelectDispatcher instance to use
neo_config = swarm.neo.client.mixins.ClientCore.Config instance.
(The Config class is designed to be read from an application's
config.ini file via ocean.util.config.ConfigFiller.)
conn_notifier = delegate which is called when a connection attempt
succeeds or fails (including when a connection is
re-established). Of type:
void delegate ( Neo.ConnNotification )
***************************************************************************/
public this ( EpollSelectDispatcher epoll, Neo.Config neo_config,
Neo.ConnectionNotifier conn_notifier )
{
this(epoll, IClient.Config.default_connection_limit,
IClient.Config.default_queue_size,
IClient.default_fiber_stack_size);
this.neoInit(neo_config, conn_notifier);
}
/***************************************************************************
Constructor with support for the neo and legacy protocols. Automatically
calls addNodes() with the node definition files specified in the legacy
and neo Config instances.
Params:
epoll = EpollSelectDispatcher instance to use
config = swarm.client.model.IClient.Config instance. (The Config
class is designed to be read from an application's config.ini
file via ocean.util.config.ConfigFiller.)
neo_config = swarm.neo.client.mixins.ClientCore.Config instance.
(The Config class is designed to be read from an application's
config.ini file via ocean.util.config.ConfigFiller.)
conn_notifier = delegate which is called when a connection attempt
succeeds or fails (including when a connection is
re-established). Of type:
void delegate ( Neo.ConnNotification )
fiber_stack_size = size (in bytes) of stack of individual connection
fibers.
***************************************************************************/
public this ( EpollSelectDispatcher epoll,
IClient.Config config, Neo.Config neo_config,
Neo.ConnectionNotifier conn_notifier,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
with ( config )
{
this(epoll, connection_limit(), queue_size(), fiber_stack_size);
this.addNodes(nodes_file);
}
this.neoInit(neo_config, conn_notifier);
}
/***************************************************************************
Constructor with support for the neo protocol.
TODO: the other constructor will be deprecated
Params:
epoll = select dispatcher to use
auth_name = client name for authorisation
auth_key = client key (password) for authorisation. This should be a
properly generated random number which only the client and the
nodes know. See `README_client_neo.rst` for suggestions. The key
must be of the length defined in
swarm.neo.authentication.HmacDef (128 bytes)
conn_notifier = delegate which is called when a connection attempt
succeeds or fails (including when a connection is
re-established). Of type:
void delegate ( Neo.ConnNotification )
conn_limit = maximum number of connections in pool
queue_size = size (in bytes) of per-node queue of pending requests
fiber_stack_size = size (in bytes) of stack of individual connection
fibers
***************************************************************************/
public this ( EpollSelectDispatcher epoll, cstring auth_name, ubyte[] auth_key,
Neo.ConnectionNotifier conn_notifier,
size_t conn_limit = IClient.Config.default_connection_limit,
size_t queue_size = IClient.Config.default_queue_size,
size_t fiber_stack_size = IClient.default_fiber_stack_size )
{
this(epoll, conn_limit, queue_size, fiber_stack_size);
this.neoInit(auth_name, auth_key, conn_notifier);
}
/**************************************************************************
Factory method for creating DLS node registry used in the client. Can
be overriden by the subclass in order to use client with custom registry.
Params:
epoll = selector dispatcher instance to register the socket and I/O
events
settings = client settings instance
request_overflow = overflow handler for requests which don't fit in
the request queue
error_reporter = error reporter instance to notify on error or
timeout
Returns:
DlsNodeRegistry instance to be used with the client.
**************************************************************************/
protected DlsNodeRegistry newDlsNodeRegistry ( EpollSelectDispatcher epoll,
ClientSettings settings, IRequestOverflow request_overflow,
INodeConnectionPoolErrorReporter error_reporter )
{
return new DlsNodeRegistry(epoll, settings, request_overflow,
error_reporter);
}
/***************************************************************************
Initiates the connection with all registered DLS nodes. This involves
the following steps:
1. The API version number is requested from all registered nodes.
These version numbers are cross-checked against each other and
against the client's API version.
The specified user notification delegate is called for each node for
each request performed by the node handshake (i.e. GetVersion).
The specified output delegate is called once when the handshakes with
all nodes have completed, indicating whether the handshakes were
successful or not.
TODO: try restructuring so that the node handshake is done internally
upon assigning the first normal request (so the node handshake needn't
be explicitly called by the user). In this case, the notifier in the
node handshake struct would actually assign the requested method when
the handshake succeeds, and would call the notifier with an error code
if it fails (need to make sure all the appropriate error codes exist...
version mismatch doesn't atm).
Params:
output = output delegate which receives a bool telling whether the
handshake succeeded or not
user_notifier = notification delegate
***************************************************************************/
public void nodeHandshake ( RequestParams.GetBoolDg output,
RequestNotification.Callback user_notifier )
{
(cast(DlsNodeRegistry)this.nodes).handshakeInitiated();
this.node_handshake(output, user_notifier);
}
/***************************************************************************
Assigns a new request to the client. The request is validated, and the
notification callback may be invoked immediately if any errors are
detected. Otherwise the request is sent to the node registry, where it
will be either executed immediately (if a free connection is available)
or queued for later execution.
Template params:
T = request type (should be one of the structs defined in this
module)
Params:
request = request to assign
***************************************************************************/
public void assign ( T ) ( T request )
{
static if ( is(T : IGroupRequest) )
{
request.setClient(this);
}
this.scopeRequestParams(
( IRequestParams params )
{
request.setup(params);
this.assignParams(params);
});
}
/***************************************************************************
Creates a Put request, which will send a single value with the specified
key to the DLS, allowing multiple values to exist for the same key. The
database record value is read from the specified input delegate, which
should be of the form:
cstring delegate ( RequestContext context )
It is illegal to put empty values to the node.
Params:
channel = database channel
key = database record key
input = input delegate which provides record value to send
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct Put
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Channel; // channel(cstring) method
mixin RequestSetup.Key; // key ( K ) (K) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public Put put ( Key ) ( cstring channel, Key key, RequestParams.PutValueDg input,
RequestNotification.Callback notifier )
{
return *Put(DlsConst.Command.E.Put, notifier).channel(channel)
.key(key).io(input).contextFromKey();
}
/***************************************************************************
Creates a GetRange request, which will receive all values within the
specified key range from the DLS. The database record keys & values are
sent to the specified output delegate, which should be of the form:
void delegate ( RequestContext context, cstring key, cstring value )
Note that if there are no records in the specified channel and range,
the output delegate will not be called.
This is a multi-node request which is executed in parallel over all
nodes in the DLS.
Params:
channel = database channel
start_key = minimum database record key
end_key = maximum database record key
output = output delegate to send record keys & values to
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct GetRange
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Channel; // channel(cstring) method
mixin RequestSetup.Filter; // filter(cstring) and pcre(cstring, bool) methods
mixin RequestSetup.Range; // range ( K ) (K, K) method
mixin RequestSetup.Suspendable; // suspendable(RequestParams.RegisterSuspendableDg) method
mixin RequestSetup.StreamInfo; // stream_info(RequestParams.RegisterStreamInfoDg) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public GetRange getRange ( Key ) ( cstring channel, Key start_key, Key end_key,
RequestParams.GetPairDg output, RequestNotification.Callback notifier )
{
return *GetRange(DlsConst.Command.E.GetRange, notifier).channel(channel)
.range(start_key, end_key).io(output);
}
/***************************************************************************
Creates a GetAll request, which will receive all values in the specified
channel from the DLS. The database record keys & values are sent to the
specified output delegate, which should be of the form:
void delegate ( RequestContext context, cstring key, cstring value )
Note that if there are no records in the specified channel, the output
delegate will not be called.
This is a multi-node request which is executed in parallel over all
nodes in the DLS.
Params:
channel = database channel
output = output delegate to send record keys & values to
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct GetAll
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Channel; // channel(cstring) method
mixin RequestSetup.Filter; // filter(cstring) method
mixin RequestSetup.Suspendable; // suspendable(RequestParams.RegisterSuspendableDg) method
mixin RequestSetup.StreamInfo; // stream_info(RequestParams.RegisterStreamInfoDg) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public GetAll getAll ( cstring channel, RequestParams.GetPairDg output,
RequestNotification.Callback notifier )
{
return *GetAll(DlsConst.Command.E.GetAll, notifier).channel(channel)
.io(output);
}
/***************************************************************************
Creates a GetChannels request, which will receive a list of all channels
which exist in the DLS. The channel names are sent to the specified
output delegate, which should be of the form:
void delegate ( RequestContext context, cstring address, ushort port,
cstring channel )
This is a multi-node request which is executed in parallel over all
nodes in the DLS. This means that the name of each channel will most
likely be received once from each node.
Note that if there are no channels in the DLS, the output delegate will
not be called.
Params:
output = output delegate to send channel names to
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct GetChannels
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public GetChannels getChannels ( RequestParams.GetNodeValueDg output,
RequestNotification.Callback notifier )
{
return *GetChannels(DlsConst.Command.E.GetChannels, notifier).io(output);
}
/***************************************************************************
Creates a GetSize request, which will receive the number of records and
bytes which exist in each node in the DLS (a sum of the contents of all
channels stored in the node). The database sizes are sent to the
specified output delegate, which should be of the form:
void delegate ( RequestContext context, cstring address, ushort port, ulong records, ulong bytes )
This is a multi-node request which is executed in parallel over all
nodes in the DLS. The output delegate is called once per node.
Note that if there are no channels in the DLS, the output delegate will
not be called.
Params:
output = output delegate to send size information to
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct GetSize
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public GetSize getSize ( RequestParams.GetSizeInfoDg output, RequestNotification.Callback notifier )
{
return *GetSize(DlsConst.Command.E.GetSize, notifier).io(output);
}
/***************************************************************************
Creates a GetChannelSize request, which will receive the number of
records and bytes which exist in the specified channel in each node of
the DLS. The channel sizes are sent to the specified output delegate,
which should be of the form:
void delegate ( RequestContext context, cstring address, ushort port,
cstring channel, ulong records, ulong bytes )
This is a multi-node request which is executed in parallel over all
nodes in the DLS. The output delegate is called once per node.
Note that if there are no channels in the DLS, the output delegate will
not be called.
Params:
channel = database channel
output = output delegate to send size information to
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct GetChannelSize
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.Channel; // channel(cstring) method
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public GetChannelSize getChannelSize ( cstring channel, RequestParams.GetChannelSizeInfoDg output, RequestNotification.Callback notifier )
{
return *GetChannelSize(DlsConst.Command.E.GetChannelSize, notifier)
.channel(channel).io(output);
}
/***************************************************************************
Creates a RemoveChannel request, which will delete all records from the
specified channel in all nodes of the DLS.
This is a multi-node request which is executed in parallel over all
nodes in the DLS.
Params:
channel = database channel
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct RemoveChannel
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.Channel; // channel(cstring) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public RemoveChannel removeChannel ( cstring channel, RequestNotification.Callback notifier )
{
return *RemoveChannel(DlsConst.Command.E.RemoveChannel, notifier)
.channel(channel);
}
/***************************************************************************
Creates a GetNumConnections request, which will receive the count of
open connections being handled by each node of the DLS. The number of
connections is sent to the specified output delegate, which should be of
the form:
void delegate ( RequestContext context, cstring address, ushort port, size_t connections )
This is a multi-node request which is executed in parallel over all
nodes in the DLS. The output delegate is called once per node.
Note that if there are no channels in the DLS, the output delegate will
not be called.
Params:
output = output delegate to send connection counts to
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct GetNumConnections
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public GetNumConnections getNumConnections ( RequestParams.GetNumConnectionsDg output,
RequestNotification.Callback notifier )
{
return *GetNumConnections(DlsConst.Command.E.GetNumConnections, notifier)
.io(output);
}
/***************************************************************************
Creates a GetVersion request, which will receive the api version used by
each node of the DLS. The api version is sent to the specified output
delegate, which should be of the form:
void delegate ( RequestContext context, cstring address, ushort port,
cstring api_version )
This is a multi-node request which is executed in parallel over all
nodes in the DLS. The output delegate is called once per node.
Note that if there are no channels in the DLS, the output delegate will
not be called.
This request is usually only used internally by the node handshake.
Params:
output = output delegate to send api versions to
notifier = notification callback
Returns:
instance allowing optional settings to be set and then to be passed
to assign()
***************************************************************************/
private struct GetVersion
{
mixin RequestSetup.RequestBase;
mixin RequestSetup.IODelegate; // io(T) method
mixin RequestSetup.Node; // node(NodeItem) method
mixin RequestSetup.RequestParamsSetup; // private setup() method, used by assign()
}
public GetVersion getVersion ( RequestParams.GetNodeValueDg output,
RequestNotification.Callback notifier )
{
return *GetVersion(DlsConst.Command.E.GetVersion, notifier).io(output);
}
/***************************************************************************
Creates a new request params instance (derived from IRequestParams), and
passes it to the provided delegate.
This method is used by the request scheduler plugin, which needs to be
able to construct and use a request params instance without knowing
which derived type is used by the client.
Params:
dg = delegate to receive and use created scope IRequestParams
instance
***************************************************************************/
override protected void scopeRequestParams (
void delegate ( IRequestParams params ) dg )
{
scope params = new RequestParams;
dg(params);
}
/***************************************************************************
Checks whether the given channel name is valid. Channel names can only
contain alphanumeric characters, underscores or dashes.
If the channel name is not valid then the user specified error callback
is invoked with the BadChannelName status code.
Params:
params = request params to check
Throws:
* if the channel name is invalid
* if a filtering request is being assigned but the filter string is
empty
(exceptions will be caught in super.assignParams)
***************************************************************************/
override protected void validateRequestParams_ ( IRequestParams params )
{
auto dls_params = cast(RequestParams)params;
// Validate channel name, for commands which use it
with ( DlsConst.Command.E ) switch ( params.command )
{
case Put:
case GetRange:
case GetAll:
case GetChannelSize:
case RemoveChannel:
case GetAllFilter:
case GetRangeFilter:
enforce(this.bad_channel_exception,
.validateChannelName(dls_params.channel));
break;
default:
}
// Validate filter string, for commands which use it
with ( DlsConst.Command.E ) switch ( params.command )
{
case GetAllFilter:
case GetRangeFilter:
case GetRangeRegex:
enforce(this.null_filter_exception,
dls_params.filter_string.length);
break;
default:
}
}
}
version ( UnitTest )
{
import ocean.io.select.EpollSelectDispatcher;
import swarm.client.request.params.IRequestParams;
}
/*******************************************************************************
Test instantiating clients with various plugins.
*******************************************************************************/
unittest
{
auto epoll = new EpollSelectDispatcher;
{
auto dls = new ExtensibleDlsClient!(DlsClient.RequestScheduler)
(epoll, new RequestScheduler(epoll));
}
{
class DummyStore : RequestQueueDiskOverflow.IRequestStore
{
ubyte[] store ( IRequestParams params ) { return null; }
void restore ( void[] stored ) { }
}
auto dls = new ExtensibleDlsClient!(DlsClient.RequestQueueDiskOverflow)
(epoll, new RequestQueueDiskOverflow(new DummyStore, "dummy"));
}
{
auto dls = new ExtensibleDlsClient!(DlsClient.ScopeRequestsPlugin)
(epoll, new ScopeRequestsPlugin);
}
}
|
D
|
module reggae.range;
import reggae.build;
import reggae.options;
import std.range;
import std.algorithm;
import std.conv;
import std.exception;
@safe:
enum isTargetLike(T) = is(typeof(() {
auto target = T.init;
auto deps = target.dependencyTargets;
static assert(is(Unqual!(typeof(deps[0])) == Unqual!T));
auto imps = target.implicitTargets;
static assert(is(Unqual!(typeof(imps[0])) == Unqual!T));
if(target.isLeaf) {}
string cmd = target.shellCommand(Options());
}));
static assert(isTargetLike!Target);
struct DepthFirst(T) if(isTargetLike!T) {
T[] targets;
this(T target) pure {
this.targets = depthFirstTargets(target);
}
T[] depthFirstTargets(T target) pure {
//if leaf, return
if(target.isLeaf) return target.shellCommand(Options()) is null ? [] : [target];
//if not, add ourselves to the end to get depth-first
return reduce!((a, b) => a ~ depthFirstTargets(b))(typeof(return).init, target.dependencyTargets) ~
reduce!((a, b) => a ~ depthFirstTargets(b))(typeof(return).init, target.implicitTargets) ~
target;
}
T front() pure nothrow {
return targets.front;
}
void popFront() pure nothrow {
targets.popFront;
}
bool empty() pure nothrow {
return targets.empty;
}
static assert(isInputRange!DepthFirst);
}
auto depthFirst(T)(T target) pure {
return DepthFirst!T(target);
}
struct ByDepthLevel {
Target[][] targets;
this(Target target) pure {
this.targets = sortTargets(target);
}
auto front() pure nothrow {
return targets.front;
}
void popFront() pure nothrow {
targets.popFront;
}
bool empty() pure nothrow {
return targets.empty;
}
private Target[][] sortTargets(Target target) pure {
if(target.isLeaf) return [];
Target[][] targets = [[target]];
rec(0, [target], targets);
return targets.
retro.
map!(a =>
a.sort!((x, y) => x.rawOutputs < y.rawOutputs).
uniq!((x, y) => equal(x.rawOutputs, y.rawOutputs)).array).
array;
}
private void rec(int level, Target[] targets, ref Target[][] soFar) @trusted pure nothrow {
Target[] notLeaves = targets.
map!(a => chain(a.dependencyTargets, a.implicitTargets)). //get all dependencies
join. //flatten into a regular range
filter!(a => !a.isLeaf). //don't care about leaves
array;
if(notLeaves.empty) return;
soFar ~= notLeaves;
rec(level + 1, notLeaves, soFar);
}
static assert(isInputRange!ByDepthLevel);
}
struct Leaves {
this(in Target target) pure nothrow {
recurse(target);
}
const(Target) front() pure nothrow {
return targets.front;
}
void popFront() pure nothrow {
targets.popFront;
}
bool empty() pure nothrow {
return targets.empty;
}
private:
const(Target)[] targets;
void recurse(in Target target) pure nothrow {
if(target.isLeaf) {
targets ~= target;
return;
}
foreach(dep; target.dependencyTargets ~ target.implicitTargets) {
if(dep.isLeaf) {
targets ~= dep;
} else {
recurse(dep);
}
}
}
static assert(isInputRange!Leaves);
}
//TODO: a non-allocating version with no arrays
auto noSortUniq(R)(R range) if(isInputRange!R) {
ElementType!R[] ret;
foreach(elt; range) {
if(!ret.canFind(elt)) ret ~= elt;
}
return ret;
}
//removes duplicate targets from the build, presents a depth-first interface
//per top-level target
struct UniqueDepthFirst {
Build build;
private Target[] _targets;
this(Build build) pure @trusted {
_targets = build.targets.
map!depthFirst.
join.
noSortUniq.
array;
}
Target front() pure nothrow {
return _targets.front;
}
void popFront() pure nothrow {
_targets.popFront;
}
bool empty() pure nothrow {
return _targets.empty;
}
static assert(isInputRange!UniqueDepthFirst);
}
|
D
|
/*
*******************************************************************************************
* Dgame (a D game framework) - Copyright (c) Randy Schütt
*
* 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 Dgame.Graphics.Surface;
private {
debug import std.stdio : writefln, writeln;
import std.string : format, toStringz;
import std.file : exists;
import std.conv : to;
import std.algorithm : reverse;
import std.exception : enforce;
import core.stdc.string : memcpy;
import derelict.sdl2.sdl;
import derelict.sdl2.image;
import Dgame.Internal.Shared;
import Dgame.Math.Rect;
import Dgame.Math.Vector2;
import Dgame.Graphics.Color;
}
/**
* Surface is a wrapper for a SDL_Surface.
*
* Author: rschuett
*/
struct Surface {
/**
* Supported BlendModes
*/
enum BlendMode : ubyte {
None = SDL_BLENDMODE_NONE, /** no blending */
Blend = SDL_BLENDMODE_BLEND, /** dst = (src * A) + (dst * (1-A)) */
Add = SDL_BLENDMODE_ADD, /** dst = (src * A) + dst */
Mod = SDL_BLENDMODE_MOD /** dst = src * dst */
}
/**
* Supported Color Masks
*/
enum Mask : ubyte {
Red = 1, /** Red Mask */
Green = 2, /** Green Mask */
Blue = 4, /** Blue Mask */
Alpha = 8 /** Alpha Mask */
}
enum RMask = 0; /** Default Red Mask. */
enum GMask = 0; /** Default Green Mask. */
enum BMask = 0; /** Default Blue Mask. */
version(LittleEndian) {
enum AMask = 0xff000000;
} else {
enum AMask = 0x000000ff;
}
/**
* Flip mode
*/
enum Flip : ubyte {
Vertical = 1, /** Vertical Flip */
Horizontal = 2 /** Horizontal Flip */
}
private:
shared_ptr!(SDL_Surface) _target;
string _filename;
private:
/**
* Create a new SDL_Surface* of the given width, height and depth.
*/
static SDL_Surface* create(ushort width, ushort height, ubyte depth = 32) in {
assert(depth >= 8 && depth <= 32, "Invalid depth.");
} body {
return SDL_CreateRGBSurface(0, width, height, depth, RMask, GMask, BMask, AMask);
}
/**
* Create a new SDL_Surface* of the given memory, width, height and depth.
*/
static SDL_Surface* create(void* memory, ushort width, ushort height, ubyte depth = 32) in {
assert(memory !is null, "Memory is empty.");
assert(depth >= 8 && depth <= 32, "Invalid depth.");
} body {
return SDL_CreateRGBSurfaceFrom(memory, width, height, depth, (depth / 8) * width,
RMask, GMask, BMask, AMask);
}
/**
* CTor
*/
this(SDL_Surface* srfc) in {
assert(srfc !is null, "Invalid SDL_Surface.");
assert(srfc.pixels !is null, "Invalid pixel data.");
} body {
debug writeln("CTor Surface with SDL_Surface: ", srfc);
this._target = make_shared(srfc, (SDL_Surface* ptr) => SDL_FreeSurface(ptr));
}
public:
/**
* CTor
*/
this(string filename) {
debug writeln("CTor Surface : ", filename);
this.loadFromFile(filename);
}
debug(Dgame)
this(this) {
writeln("Postblit Surface: ", this._target.usage, ':', this.filename);
}
debug(Dgame)
~this() {
writeln("DTor Surface", ':', this.filename, "::",this._target.usage);
}
/**
* Destroy the current Surface <b>and all</b>, which are linked to this Surface</b>.
*/
void free() {
debug writeln("Free Surface:", this.filename);
this._target.terminate();
}
/**
* Returns the current use count
*/
int useCount() const pure nothrow {
return this._target.usage;
}
/**
* Make a new Surface of the given width, height and depth.
*/
static Surface make(ushort width, ushort height, ubyte depth = 32) {
SDL_Surface* srfc = Surface.create(width, height, depth);
if (srfc is null) {
const string err = to!string(SDL_GetError());
throw new Exception("Surface konnte nicht erstellt werden: " ~ err);
}
return Surface(srfc);
}
/**
* Make an new Surface of the given memory, width, height and depth.
*/
static Surface make(void* memory, ushort width, ushort height, ubyte depth = 32) {
SDL_Surface* srfc = Surface.create(memory, width, height, depth);
if (srfc is null) {
const string err = to!string(SDL_GetError());
throw new Exception("Surface konnte nicht erstellt werden: " ~ err);
}
return Surface(srfc);
}
/**
* Returns if the Surface is valid. Which means that the Surface has valid data.
*/
bool isValid() const pure nothrow {
return this._target.isValid() && this._target.pixels !is null;
}
/**
* Load from filename. If any data is already stored, the data will be freed.
*/
void loadFromFile(string filename) {
debug writefln("Load Image: %s", filename);
enforce(filename.length >= 4 && exists(filename),
"The file " ~ filename ~ " does not exist.");
SDL_Surface* srfc = IMG_Load(toStringz(filename));
debug writefln("Image %s loaded :: %X", filename, srfc);
if (srfc is null) {
const string err = to!string(SDL_GetError());
throw new Exception(.format("Could not load image %s. Error: %s.", filename, err));
}
this._target = make_shared(srfc, (SDL_Surface* ptr) => SDL_FreeSurface(ptr));
this._filename = filename;
}
/**
* Load from memory.
*/
void loadFromMemory(void* memory, ushort width, ushort height, ubyte depth = 32) in {
assert(memory !is null, "Memory is empty.");
assert(depth >= 8 && depth <= 32, "Invalid depth.");
} body {
SDL_Surface* srfc = SDL_CreateRGBSurfaceFrom(memory, width, height, depth,
(depth / 8) * width,
RMask, GMask, BMask, AMask);
if (srfc is null) {
const string err = to!string(SDL_GetError());
throw new Exception("Could not load image. Error: " ~ err);
}
this._target = make_shared(srfc, (SDL_Surface* ptr) => SDL_FreeSurface(ptr));
}
/**
* Save the current pixel data to the file.
*/
void saveToFile(string filename) {
enforce(filename.length >= 4, "File name is too short.");
if (SDL_SaveBMP(this.ptr, toStringz(filename)) != 0) {
const string err = to!string(SDL_GetError());
throw new Exception(.format("Could not save image %s. Error: %s.", filename, err));
}
}
/**
* Fills a specific area of the surface with the given color.
* The second parameter is a pointer to the area.
* If it's null, the whole Surface is filled.
*/
void fill(ref const Color col, const ShortRect* rect = null) {
SDL_Rect a = void;
const SDL_Rect* ptr = transfer(rect, &a);
const uint key = SDL_MapRGBA(this._target.format, col.red, col.green, col.blue, col.alpha);
SDL_FillRect(this._target, ptr, key);
}
/**
* Rvalue version
*/
void fill(const Color col, const ShortRect* rect = null) {
this.fill(col, rect);
}
/**
* Fills multiple areas of the Surface with the given color.
*/
void fillAreas(ref const Color col, const ShortRect[] rects) {
SDL_Rect a = void;
const SDL_Rect* ptr_start = (rects.length > 0) ? transfer(&rects[0], &a) : null;
const uint key = SDL_MapRGBA(this._target.format, col.red, col.green, col.blue, col.alpha);
SDL_FillRects(this._target, ptr_start, cast(uint) rects.length, key);
}
/**
* Rvalue version
*/
void fillAreas(const Color col, const ShortRect[] rects) {
this.fillAreas(col, rects);
}
/**
* Use this function to set the RLE acceleration hint for a surface.
* RLE (Run-Length-Encoding) is a way of compressing data.
* If RLE is enabled, color key and alpha blending blits are much faster,
* but the surface must be locked before directly accessing the pixels.
*
* Returns: whether the call succeeded or not
*/
bool optimizeRLE(bool enable) {
return SDL_SetSurfaceRLE(this._target, enable) == 0;
}
/**
* Use this function to set up a surface for directly accessing the pixels.
*
* Returns: whether the call succeeded or not
*/
bool lock() {
if (SDL_LockSurface(this._target) == 0)
return true;
return false;
}
/**
* Use this function to release a surface after directly accessing the pixels.
*/
void unlock() {
SDL_UnlockSurface(this._target);
}
/**
* Returns whether this Surface is locked or not.
*/
bool isLocked() const pure nothrow {
return this._target.locked != 0;
}
/**
* Use this function to determine whether a surface must be locked for access.
*/
bool mustLock() {
return SDL_MUSTLOCK(this._target) == SDL_TRUE;
}
/**
* Use this function to adapt the format of another Surface to this surface.
* Works like <code>SDL_DisplayFormat</code>.
*/
void adaptTo(ref Surface srfc) in {
assert(srfc.isValid(), "Could not adapt to invalid surface.");
assert(this.isValid(), "Could not adapt a invalid surface.");
} body {
this.adaptTo(srfc.ptr.format);
}
/**
* Use this function to adapt the format of another Surface to this surface.
* Works like <code>SLD_DisplayFormat</code>.
*/
void adaptTo(SDL_PixelFormat* fmt) in {
assert(fmt !is null, "Null format is invalid.");
} body {
SDL_Surface* adapted = SDL_ConvertSurface(this._target, fmt, 0);
enforce(adapted !is null, "Could not adapt surface.");
this._target = make_shared(adapted, (SDL_Surface* ptr) => SDL_FreeSurface(ptr));
}
/**
* Set the colorkey.
*/
void setColorkey(ref const Color col) {
this.setColorkey(col.red, col.green, col.blue, col.alpha);
}
/**
* Rvalue version
*/
void setColorkey(const Color col) {
this.setColorkey(col);
}
/**
* Set the colorkey.
*/
void setColorkey(ubyte red, ubyte green, ubyte blue) {
const uint key = SDL_MapRGB(this._target.format, red, green, blue);
SDL_SetColorKey(this._target, SDL_TRUE, key);
}
/**
* Set the colorkey.
*/
void setColorkey(ubyte red, ubyte green, ubyte blue, ubyte alpha) {
const uint key = SDL_MapRGBA(this._target.format, red, green, blue, alpha);
SDL_SetColorKey(this._target, SDL_TRUE, key);
}
/**
* Returns the current colorkey.
*/
Color getColorkey() {
uint key = 0;
SDL_GetColorKey(this._target, &key);
ubyte r, g, b, a;
SDL_GetRGBA(key, this._target.format, &r, &g, &b, &a);
return Color(r, g, b, a);
}
/**
* Set the Alpha mod.
*/
void setAlphaMod(ubyte alpha) {
SDL_SetSurfaceAlphaMod(this._target, alpha);
}
/**
* Returns the current Alpha mod.
*/
ubyte getAlphaMod() {
ubyte alpha;
SDL_GetSurfaceAlphaMod(this._target, &alpha);
return alpha;
}
/**
* Set the Blendmode.
*/
void setBlendMode(BlendMode mode) {
SDL_SetSurfaceBlendMode(this._target, mode);
}
/**
* Returns the current Blendmode.
*/
BlendMode getBlendMode() {
SDL_BlendMode mode;
SDL_GetSurfaceBlendMode(this._target, &mode);
return cast(BlendMode) mode;
}
/**
* Returns the clip rect of this surface.
* The clip rect is the area of the surface which is drawn.
*/
ShortRect getClipRect() {
SDL_Rect clip = void;
SDL_GetClipRect(this._target, &clip);
return ShortRect(clip);
}
/**
* Set the clip rect.
*/
void setClipRect(ref const ShortRect clip) {
SDL_Rect a = void;
clip.transferTo(&a);
SDL_SetClipRect(this._target, &a);
}
/**
* Rvalue version
*/
void setClipRect(const ShortRect clip) {
this.setClipRect(clip);
}
@property {
/**
* Returns the current filename, if any
*/
string filename() const pure nothrow {
return this._filename;
}
/**
* Returns the width.
*/
ushort width() const pure nothrow {
return this._target.isValid() ? cast(ushort) this._target.w : 0;
}
/**
* Returns the height.
*/
ushort height() const pure nothrow {
return this._target.isValid() ? cast(ushort) this._target.h : 0;
}
/**
* Returns the pixel data of this surface.
*/
inout(void*) pixels() inout {
return this._target.isValid() ? this._target.pixels : null;
}
/**
* Count the bits of this surface.
* Could be 32, 24, 16, 8, 0.
*/
ubyte bits() const pure nothrow {
return this._target.isValid() ? this._target.format.BitsPerPixel : 0;
}
/**
* Count the bytes of this surface.
* Could be 4, 3, 2, 1, 0. (countBits / 8)
*/
ubyte bytes() const pure nothrow {
return this._target.isValid() ? this._target.format.BytesPerPixel : 0;
}
/**
* Returns the Surface pitch or 0.
*/
int pitch() const pure nothrow {
return this._target.isValid() ? this._target.pitch : 0;
}
/**
* Returns the PixelFormat
*/
const(SDL_PixelFormat*) pixelFormat() const pure nothrow {
return this._target.format;
}
}
/**
* Returns if the given color match the color of the given mask of the surface.
*
* See: Surface.Mask enum.
*/
bool isMask(Mask mask, ref const Color col) const {
const uint map = SDL_MapRGBA(this._target.format, col.red, col.green, col.blue, col.alpha);
return this.isMask(mask, map);
}
/**
* Rvalue version
*/
bool isMask(Mask mask, const Color col) const {
return this.isMask(mask, col);
}
/**
* Returns if the given converted color match the color of the given mask of the surface.
*
* See: Surface.Mask enum.
*/
bool isMask(Mask mask, uint col) const pure nothrow {
bool[4] result = void;
ubyte index = 0;
if (mask & Mask.Red)
result[index++] = this._target.format.Rmask == col;
if (mask & Mask.Green)
result[index++] = this._target.format.Gmask == col;
if (mask & Mask.Blue)
result[index++] = this._target.format.Bmask == col;
if (mask & Mask.Alpha)
result[index++] = this._target.format.Amask == col;
for (ubyte i = 0; i < index; ++i) {
if (!result[i])
return false;
}
return true;
}
/**
* Returns the pixel at the given coordinates.
*/
uint getPixelAt(ref const Vector2s pos) const {
return this.getPixelAt(pos.x, pos.y);
}
/**
* Returns the pixel at the given coordinates.
*/
uint getPixelAt(ushort x, ushort y) const {
uint* pixels = cast(uint*) this.pixels;
enforce(pixels !is null, "No pixel at this point.");
return pixels[(y * this._target.w) + x];
}
/**
* Put a new pixel at the given coordinates.
*/
void putPixelAt(ref const Vector2s pos, uint pixel) {
this.putPixelAt(pos.x, pos.y, pixel);
}
/**
* Put a new pixel at the given coordinates.
*/
void putPixelAt(ushort x, ushort y, uint pixel) {
uint* pixels = cast(uint*) this.pixels;
enforce(pixels !is null, "No pixel at this point.");
pixels[(y * this._target.w) + x] = pixel;
}
/**
* Returns the color on the given position.
*/
Color getColorAt(ref const Vector2s pos) const {
return this.getColorAt(pos.x, pos.y);
}
/**
* Returns the color on the given position.
*/
Color getColorAt(ushort x, ushort y) const {
const uint len = this.width * this.height;
if ((x * y) <= len) {
const uint pixel = this.getPixelAt(x, y);
ubyte r, g, b, a;
SDL_GetRGBA(pixel, this._target.format, &r, &g, &b, &a);
return Color(r, g, b, a);
}
enforce(len != 0, "Invalid Surface for getColorAt.");
throw new Exception("No color at this position.");
}
/**
* Returns a pointer to the SDL_Surface
*/
@property
inout(SDL_Surface)* ptr() inout pure nothrow {
return this._target.ptr;
}
/**
* Use this function to perform a fast, low quality,
* stretch blit between two surfaces of the same pixel format.
* src is the a pointer to a Rect structure which represents the rectangle to be copied,
* or null to copy the entire surface.
* dst is a pointer to a Rect structure which represents the rectangle that is copied into.
* null means, that the whole srfc is copied to (0|0).
*/
bool blitScaled(ref Surface srfc, const ShortRect* src = null, ShortRect* dst = null) {
return this.blitScaled(srfc.ptr, src, dst);
}
/**
* Same as above, but with a SDL_Surface* instead of a Surface.
*/
bool blitScaled(SDL_Surface* srfc, const ShortRect* src = null, ShortRect* dst = null) in {
assert(srfc !is null, "Null surface cannot be blit.");
} body {
SDL_Rect a = void;
SDL_Rect b = void;
const SDL_Rect* src_ptr = transfer(src, &a);
SDL_Rect* dst_ptr = transfer(dst, &b);
return SDL_BlitScaled(srfc, src_ptr, this._target, dst_ptr) == 0;
}
/**
* Use this function to perform low-level surface blitting only.
*/
bool lowerBlit(ref Surface srfc, ShortRect* src = null, ShortRect* dst = null) {
return this.lowerBlit(srfc.ptr, src, dst);
}
/**
* Same as above, but with a SDL_Surface* instead of a Surface.
*/
bool lowerBlit(SDL_Surface* srfc, ShortRect* src = null, ShortRect* dst = null) in {
assert(srfc !is null, "Null surface cannot be blit.");
} body {
SDL_Rect a = void;
SDL_Rect b = void;
SDL_Rect* src_ptr = transfer(src, &a);
SDL_Rect* dst_ptr = transfer(dst, &b);
return SDL_LowerBlit(srfc, src_ptr, this._target, dst_ptr) == 0;
}
/**
* Use this function to perform a fast blit from the source surface to the this surface.
* src is the a pointer to a Rect structure which represents the rectangle to be copied,
* or null to copy the entire surface.
* dst is a pointer to a Rect structure which represents the rectangle that is copied into.
* null means, that the whole srfc is copied to (0|0).
*/
bool blit(ref Surface srfc, const ShortRect* src = null, ShortRect* dst = null) {
return this.blit(srfc.ptr, src, dst);
}
/**
* Same as above, but with a SDL_Surface* instead of a Surface.
*/
bool blit(SDL_Surface* srfc, const ShortRect* src = null, ShortRect* dst = null) in {
assert(srfc !is null, "Null surface cannot be blit.");
} body {
SDL_Rect a = void;
SDL_Rect b = void;
const SDL_Rect* src_ptr = transfer(src, &a);
SDL_Rect* dst_ptr = transfer(dst, &b);
return SDL_BlitSurface(srfc, src_ptr, this._target, dst_ptr) == 0;
}
/**
* Returns a subsurface from this surface. rect represents the viewport.
* The subsurface is a separate Surface object.
*/
Surface subSurface(ref const ShortRect rect) {
SDL_Surface* sub = this.create(rect.width, rect.height);
enforce(sub !is null, "Failed to construct a sub surface.");
SDL_Rect clip = void;
rect.transferTo(&clip);
if (SDL_BlitSurface(this._target, &clip, sub, null) != 0)
throw new Exception("An error occured by blitting the subsurface.");
return Surface(sub);
}
/**
* Rvalue version
*/
Surface subSurface(const ShortRect rect) {
return this.subSurface(rect);
}
/**
* Returns an new flipped Surface
* The current Surface is not modified.
*
* Note: This function may be slow
*/
Surface flip(Flip flip) {
ubyte* pixels = cast(ubyte*) this.pixels;
const ubyte bytes = this.bytes;
const uint memSize = this.width * this.height * bytes;
Surface flipped = Surface.make(this.width, this.height);
ubyte* newPixels = cast(ubyte*) flipped.pixels;
final switch (flip) {
case Flip.Vertical:
const uint rowSize = this.width * bytes;
ubyte* source = &pixels[this.width * (this.height - 1) * bytes];
ubyte* dest = &newPixels[0];
for (ushort y = 0; y < this.height; ++y) {
.memcpy(dest, source, rowSize);
//std.algorithm.reverse(dest[0 .. rowSize]);
source -= rowSize;
dest += rowSize;
}
break;
case Flip.Horizontal:
for (ushort y = 0; y < this.height; ++y) {
ubyte* source = &pixels[y * this.width * bytes];
ubyte* dest = &newPixels[(y + 1) * this.width * bytes - bytes];
for (ushort x = 0; x < this.width; ++x) {
dest[0] = source[0];
dest[1] = source[1];
dest[2] = source[2];
if (bytes == 4)
dest[3] = source[3];
source += bytes;
dest -= bytes;
}
}
break;
case Flip.Vertical | Flip.Horizontal:
newPixels[0 .. memSize] = pixels[0 .. memSize];
.reverse(newPixels[0 .. memSize]);
break;
}
return flipped;
}
} unittest {
writeln("<Surface unittest>");
Surface s1 = Surface.make(64, 64, 32);
assert(s1.useCount() == 1, to!string(s1.useCount()));
{
Surface s2 = s1;
assert(s1.useCount() == 2, to!string(s1.useCount()));
assert(s2.useCount() == 2, to!string(s2.useCount()));
s2 = s1;
assert(s1.useCount() == 2, to!string(s1.useCount()));
assert(s2.useCount() == 2, to!string(s2.useCount()));
{
Surface s3 = s2;
assert(s1.useCount() == 3, to!string(s1.useCount()));
assert(s2.useCount() == 3, to!string(s2.useCount()));
assert(s3.useCount() == 3, to!string(s3.useCount()));
}
assert(s1.useCount() == 2, to!string(s1.useCount()));
assert(s2.useCount() == 2, to!string(s2.useCount()));
}
assert(s1.useCount() == 1, to!string(s1.useCount()));
writeln("</Surface unittest>");
}
|
D
|
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/SQL.build/SQLLiteral.swift.o : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/COperatingSystem.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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.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 /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/SQL.build/SQLLiteral~partial.swiftmodule : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/COperatingSystem.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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.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 /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/SQL.build/SQLLiteral~partial.swiftdoc : /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/COperatingSystem.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/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.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 /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/Jorge/Desktop/Projects/Web/Swift/kisiBootcamp/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module chipmunk.cpVect;
import chipmunk.chipmunk_types;
extern (C):
const cpVect cpvzero = {0.0f,0.0f};
// In the C library these are static inlined functions in the header.
// We reimplement them here rather than binding to them.
/// Convenience constructor for cpVect structs.
static cpVect cpv(const cpFloat x, const cpFloat y)
{
cpVect v = {x, y};
return v;
}
/// Check if two vectors are equal. (Be careful when comparing floating point numbers!)
static cpBool cpveql(const cpVect v1, const cpVect v2)
{
return (v1.x == v2.x && v1.y == v2.y);
}
/// Add two vectors
static cpVect cpvadd(const cpVect v1, const cpVect v2)
{
return cpv(v1.x + v2.x, v1.y + v2.y);
}
/// Subtract two vectors.
static cpVect cpvsub(const cpVect v1, const cpVect v2)
{
return cpv(v1.x - v2.x, v1.y - v2.y);
}
/// Negate a vector.
static cpVect cpvneg(const cpVect v)
{
return cpv(-v.x, -v.y);
}
/// Scalar multiplication.
static cpVect cpvmult(const cpVect v, const cpFloat s)
{
return cpv(v.x*s, v.y*s);
}
/// Vector dot product.
static cpFloat cpvdot(const cpVect v1, const cpVect v2)
{
return v1.x*v2.x + v1.y*v2.y;
}
/// 2D vector cross product analog.
/// The cross product of 2D vectors results in a 3D vector with only a z component.
/// This function returns the magnitude of the z value.
static cpFloat cpvcross(const cpVect v1, const cpVect v2)
{
return v1.x*v2.y - v1.y*v2.x;
}
/// Returns a perpendicular vector. (90 degree rotation)
static cpVect cpvperp(const cpVect v)
{
return cpv(-v.y, v.x);
}
/// Returns a perpendicular vector. (-90 degree rotation)
static cpVect cpvrperp(const cpVect v)
{
return cpv(v.y, -v.x);
}
/// Returns the vector projection of v1 onto v2.
static cpVect cpvproject(const cpVect v1, const cpVect v2)
{
return cpvmult(v2, cpvdot(v1, v2)/cpvdot(v2, v2));
}
/// Returns the unit length vector for the given angle (in radians).
static cpVect cpvforangle(const cpFloat a)
{
return cpv(cpfcos(a), cpfsin(a));
}
/// Returns the angular direction v is pointing in (in radians).
static cpFloat cpvtoangle(const cpVect v)
{
return cpfatan2(v.y, v.x);
}
/// Uses complex number multiplication to rotate v1 by v2. Scaling will occur if v1 is not a unit vector.
static cpVect cpvrotate(const cpVect v1, const cpVect v2)
{
return cpv(v1.x*v2.x - v1.y*v2.y, v1.x*v2.y + v1.y*v2.x);
}
/// Inverse of cpvrotate().
static cpVect cpvunrotate(const cpVect v1, const cpVect v2)
{
return cpv(v1.x*v2.x + v1.y*v2.y, v1.y*v2.x - v1.x*v2.y);
}
/// Returns the squared length of v. Faster than cpvlength() when you only need to compare lengths.
static cpFloat cpvlengthsq(const cpVect v)
{
return cpvdot(v, v);
}
/// Returns the length of v.
static cpFloat cpvlength(const cpVect v)
{
return cpfsqrt(cpvdot(v, v));
}
/// Linearly interpolate between v1 and v2.
static cpVect cpvlerp(const cpVect v1, const cpVect v2, const cpFloat t)
{
return cpvadd(cpvmult(v1, 1.0f - t), cpvmult(v2, t));
}
/// Returns a normalized copy of v.
static cpVect cpvnormalize(const cpVect v)
{
// Neat trick I saw somewhere to avoid div/0.
return cpvmult(v, 1.0f/(cpvlength(v) + CPFLOAT_MIN));
}
/// Spherical linearly interpolate between v1 and v2.
static cpVect
cpvslerp(const cpVect v1, const cpVect v2, const cpFloat t)
{
cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2));
cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f));
if(omega < 1e-3){
// If the angle between two vectors is very small, lerp instead to avoid precision issues.
return cpvlerp(v1, v2, t);
} else {
cpFloat denom = 1.0f/cpfsin(omega);
return cpvadd(cpvmult(v1, cpfsin((1.0f - t)*omega)*denom), cpvmult(v2, cpfsin(t*omega)*denom));
}
}
/// Spherical linearly interpolate between v1 towards v2 by no more than angle a radians
static cpVect
cpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a)
{
cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2));
cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f));
return cpvslerp(v1, v2, cpfmin(a, omega)/omega);
}
/// Clamp v to length len.
static cpVect cpvclamp(const cpVect v, const cpFloat len)
{
return (cpvdot(v,v) > len*len) ? cpvmult(cpvnormalize(v), len) : v;
}
/// Linearly interpolate between v1 towards v2 by distance d.
static cpVect cpvlerpconst(cpVect v1, cpVect v2, cpFloat d)
{
return cpvadd(v1, cpvclamp(cpvsub(v2, v1), d));
}
/// Returns the distance between v1 and v2.
static cpFloat cpvdist(const cpVect v1, const cpVect v2)
{
return cpvlength(cpvsub(v1, v2));
}
/// Returns the squared distance between v1 and v2. Faster than cpvdist() when you only need to compare distances.
static cpFloat cpvdistsq(const cpVect v1, const cpVect v2)
{
return cpvlengthsq(cpvsub(v1, v2));
}
/// Returns true if the distance between v1 and v2 is less than dist.
static cpBool cpvnear(const cpVect v1, const cpVect v2, const cpFloat dist)
{
return cpvdistsq(v1, v2) < dist*dist;
}
/// @}
/// @defgroup cpMat2x2 cpMat2x2
/// 2x2 matrix type used for tensors and such.
/// @{
// NUKE
static cpMat2x2
cpMat2x2New(cpFloat a, cpFloat b, cpFloat c, cpFloat d)
{
cpMat2x2 m = {a, b, c, d};
return m;
}
static cpVect
cpMat2x2Transform(cpMat2x2 m, cpVect v)
{
return cpv(v.x*m.a + v.y*m.b, v.x*m.c + v.y*m.d);
}
|
D
|
have an existence, be extant
support oneself
presently existing
having existence or being or actuality
existing in something specified
|
D
|
//* NS - 18/07/2013
// квестовые события, если ГГ или NPC сбежал, вызывать из ZS_Attack
func void B_DS2P_CheckLog_OnFightCanceled(var C_NPC slf, var C_NPC oth)
{
// Внук рыбака
if (MIS_DS2P_GrandsonOfFisherman == LOG_Running)
{
// TO DO
//ГГ сбежал - Харок и Гарон погибают
//if ((Garon_FightPirates == Garon_FightPirates_Started) && C_NpcIsHero(oth))
//{
// var C_NPC Garon; Garon = Hlp_GetNpc(BAU_117_DS2P_Garon);
// var C_NPC Harok; Harok = Hlp_GetNpc(BAU_101_DS2P_HAROK);
// B_KillNpc(Garon);
// B_KillNpc(Harok);
// Garon_FightPirates = Garon_FightPirates_Canceled;
//};
};
};
|
D
|
/// Generate by tools
module java.util.logging.Handler;
import java.lang.exceptions;
public class Handler
{
public this()
{
implMissing();
}
}
|
D
|
/*
* Copyright (c) 2004-2008 Derelict Developers
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the names 'Derelict', 'DerelictSDL', nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module derelict.sdl.macinit.NSEnumerator;
version (darwin):
import derelict.sdl.macinit.ID;
import derelict.sdl.macinit.NSObject;
import derelict.sdl.macinit.runtime;
import derelict.sdl.macinit.selectors;
import derelict.sdl.macinit.string;
package:
class NSEnumerator : NSObject
{
this ()
{
id_ = null;
}
this (id id_)
{
this.id_ = id_;
}
static NSEnumerator alloc ()
{
id result = objc_msgSend(cast(id)class_, sel_alloc);
return result ? new NSEnumerator(result) : null;
}
static Class class_ ()
{
return cast(Class) objc_getClass!(this.stringof);
}
NSEnumerator init ()
{
id result = objc_msgSend(this.id_, sel_init);
return result ? this : null;
}
ID nextObject ()
{
id result = objc_msgSend(this.id_, sel_nextObject);
return result ? new ID(result) : null;
}
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <[email protected]>
*******************************************************************************/
module dwt.custom.StyledTextContent;
import dwt.dwthelper.utils;
import dwt.custom.TextChangeListener;
/**
* Clients may implement the StyledTextContent interface to provide a
* custom store for the StyledText widget content. The StyledText widget
* interacts with its StyledTextContent in order to access and update
* the text that is being displayed and edited in the widget.
* A custom content implementation can be set in the widget using the
* StyledText.setContent API.
*/
public interface StyledTextContent {
/**
* Called by StyledText to add itself as an Observer to content changes.
* See TextChangeListener for a description of the listener methods that
* are called when text changes occur.
* <p>
*
* @param listener the listener
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT when listener is null</li>
* </ul>
*/
public void addTextChangeListener(TextChangeListener listener);
/**
* Return the number of characters in the content.
* <p>
*
* @return the number of characters in the content.
*/
public int getCharCount();
/**
* Return the line at the given line index without delimiters.
* <p>
*
* @param lineIndex index of the line to return. Does not include
* delimiters of preceding lines. Index 0 is the first line of the
* content.
* @return the line text without delimiters
*/
public String getLine(int lineIndex);
/**
* Return the line index at the given character offset.
* <p>
*
* @param offset offset of the line to return. The first character of the
* document is at offset 0. An offset of getLength() is valid and should
* answer the number of lines.
* @return the line index. The first line is at index 0. If the character
* at offset is a delimiter character, answer the line index of the line
* that is delimited.
* For example, if text = "\r\n\r\n", and delimiter = "\r\n", then:
* <ul>
* <li>getLineAtOffset(0) is 0
* <li>getLineAtOffset(1) is 0
* <li>getLineAtOffset(2) is 1
* <li>getLineAtOffset(3) is 1
* <li>getLineAtOffset(4) is 2
* </ul>
*/
public int getLineAtOffset(int offset);
/**
* Return the number of lines. Should answer 1 when no text is specified.
* The StyledText widget relies on this behavior for drawing the cursor.
* <p>
*
* @return the number of lines. For example:
* <ul>
* <li> text value is> getLineCount
* <li> null is> 1
* <li> "" is> 1
* <li> "a\n" is> 2
* <li> "\n\n" is> 3
* </ul>
*/
public int getLineCount();
/**
* Return the line delimiter that should be used by the StyledText
* widget when inserting new lines. New lines entered using key strokes
* and paste operations use this line delimiter.
* Implementors may use System.getProperty("line.separator") to return
* the platform line delimiter.
* <p>
*
* @return the line delimiter that should be used by the StyledText widget
* when inserting new lines.
*/
public String getLineDelimiter();
/**
* Return the character offset of the first character of the given line.
* <p>
* <b>NOTE:</b> When there is no text (i.e., no lines), getOffsetAtLine(0)
* is a valid call that should return 0.
* </p>
*
* @param lineIndex index of the line. The first line is at index 0.
* @return offset offset of the first character of the line. The first
* character of the document is at offset 0. The return value should
* include line delimiters.
* For example, if text = "\r\ntest\r\n" and delimiter = "\r\n", then:
* <ul>
* <li>getOffsetAtLine(0) is 0
* <li>getOffsetAtLine(1) is 2
* <li>getOffsetAtLine(2) is 8
* </ul>
*/
public int getOffsetAtLine(int lineIndex);
/**
* Returns a string representing the content at the given range.
* <p>
*
* @param start the start offset of the text to return. Offset 0 is the
* first character of the document.
* @param length the length of the text to return
* @return the text at the given range
*/
public String getTextRange(int start, int length);
/**
* Remove the specified text changed listener.
* <p>
*
* @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT when listener is null</li>
* </ul>
*/
public void removeTextChangeListener(TextChangeListener listener);
/**
* Replace the text with "newText" starting at position "start"
* for a length of "replaceLength".
* <p>
* Implementors have to notify the TextChangeListeners that were added
* using <code>addTextChangeListener</code> before and after the content
* is changed. A <code>TextChangingEvent</code> has to be sent to the
* textChanging method before the content is changed and a
* <code>TextChangedEvent</code> has to be sent to the textChanged method
* after the content has changed.
* The text change that occurs after the <code>TextChangingEvent</code>
* has been sent has to be consistent with the data provided in the
* <code>TextChangingEvent</code>.
* This data will be cached by the widget and will be used when the
* <code>TextChangedEvent</code> is received.
* <p>
* The <code>TextChangingEvent</code> should be set as follows:
* <ul>
* <li>event.start = start of the replaced text
* <li>event.newText = text that is going to be inserted or empty String
* if no text will be inserted
* <li>event.replaceCharCount = length of text that is going to be replaced
* <li>event.newCharCount = length of text that is going to be inserted
* <li>event.replaceLineCount = number of lines that are going to be replaced
* <li>event.newLineCount = number of new lines that are going to be inserted
* </ul>
* <b>NOTE:</b> newLineCount is the number of inserted lines and replaceLineCount
* is the number of deleted lines based on the change that occurs visually.
* For example:
* <ul>
* <li>(replaceText, newText) is> (replaceLineCount, newLineCount)
* <li>("", "\n") is> (0, 1)
* <li>("\n\n", "a") is> (2, 0)
* <li>("a", "\n\n") is> (0, 2)
* <li>("\n", "") is> (1, 0)
* </ul>
* </p>
*
* @param start start offset of text to replace, none of the offsets include
* delimiters of preceding lines, offset 0 is the first character of the
* document
* @param replaceLength length of text to replace
* @param text text to replace
* @see TextChangeListener
*/
public void replaceTextRange(int start, int replaceLength, String text);
/**
* Set text to "text".
* Implementors have to send a <code>TextChangedEvent</code> to the
* textSet method of the TextChangeListeners that were added using
* <code>addTextChangeListener</code>.
* <p>
*
* @param text the new text
* @see TextChangeListener
*/
public void setText(String text);
/++
+ DWT Extension
+/
int utf8AdjustOffset( int offset );
}
|
D
|
/home/yneversky/ynwork/SCUOS_LAB/SCUOS_Lab1/os/target/riscv64imac-unknown-none-elf/debug/deps/bit_field-0baa7af713d7574f.rmeta: /home/yneversky/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bit_field-0.10.1/src/lib.rs
/home/yneversky/ynwork/SCUOS_LAB/SCUOS_Lab1/os/target/riscv64imac-unknown-none-elf/debug/deps/libbit_field-0baa7af713d7574f.rlib: /home/yneversky/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bit_field-0.10.1/src/lib.rs
/home/yneversky/ynwork/SCUOS_LAB/SCUOS_Lab1/os/target/riscv64imac-unknown-none-elf/debug/deps/bit_field-0baa7af713d7574f.d: /home/yneversky/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bit_field-0.10.1/src/lib.rs
/home/yneversky/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bit_field-0.10.1/src/lib.rs:
|
D
|
module Serializer;
import std.array;
import std.conv;
import std.stdio;
import std.string;
import std.typecons;
import Common;
import Learner;
void dump_model(const ref Learner model, const ref Options opts,
const string path)
{
auto f = File(path, "w");
f.writeln("bits:", opts.bits);
f.writeln("loss:", opts.loss);
f.writeln("n_classes:", opts.n_classes);
f.writeln("intercept:", model.intercept);
for(int i = 0; i < model.weights.length; ++i)
f.writeln(i, ":", model.weights[i]);
f.close();
}
Learner load_model(const string model_path)
{
auto f = File(model_path, "r");
string token = split(f.readln(), ":")[1];
uint bits = to!uint(stripRight(token));
token = split(f.readln(), ":")[1];
LossType loss = to!LossType(stripRight(token));
token = split(f.readln(), ":")[1];
uint n_classes = to!uint(stripRight(token));
token = split(f.readln(), ":")[1];
float intercept = to!float(stripRight(token));
Learner model = new Learner(bits, loss, n_classes);
model.intercept = intercept;
string line;
while ((line = f.readln()) !is null)
{
auto tokens = split(line, ":");
uint ind = to!uint(tokens[0]);
float w = to!float(stripRight(tokens[1]));
model.weights[ind] = w;
}
f.close();
return model;
}
|
D
|
preoccupation with yourself to the exclusion of everything else
|
D
|
/Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/AlamofireImage.build/Objects-normal/x86_64/UIButton+AlamofireImage.o : /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/Image.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIImage+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIButton+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/Request+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIImageView+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageCache.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageDownloader.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageFilter.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/AFIError.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/sriramprasad/Dev/rough/tableImage/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.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/sriramprasad/Dev/rough/tableImage/Pods/Target\ Support\ Files/AlamofireImage/AlamofireImage-umbrella.h /Users/sriramprasad/Dev/rough/tableImage/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/sriramprasad/Dev/rough/tableImage/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/AlamofireImage.build/unextended-module.modulemap /Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/Alamofire.build/module.modulemap /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/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/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/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/AlamofireImage.build/Objects-normal/x86_64/UIButton+AlamofireImage~partial.swiftmodule : /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/Image.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIImage+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIButton+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/Request+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIImageView+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageCache.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageDownloader.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageFilter.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/AFIError.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/sriramprasad/Dev/rough/tableImage/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.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/sriramprasad/Dev/rough/tableImage/Pods/Target\ Support\ Files/AlamofireImage/AlamofireImage-umbrella.h /Users/sriramprasad/Dev/rough/tableImage/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/sriramprasad/Dev/rough/tableImage/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/AlamofireImage.build/unextended-module.modulemap /Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/Alamofire.build/module.modulemap /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/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/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/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/AlamofireImage.build/Objects-normal/x86_64/UIButton+AlamofireImage~partial.swiftdoc : /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/Image.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIImage+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIButton+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/Request+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/UIImageView+AlamofireImage.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageCache.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageDownloader.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/ImageFilter.swift /Users/sriramprasad/Dev/rough/tableImage/Pods/AlamofireImage/Source/AFIError.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/sriramprasad/Dev/rough/tableImage/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.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/sriramprasad/Dev/rough/tableImage/Pods/Target\ Support\ Files/AlamofireImage/AlamofireImage-umbrella.h /Users/sriramprasad/Dev/rough/tableImage/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/sriramprasad/Dev/rough/tableImage/build/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/AlamofireImage.build/unextended-module.modulemap /Users/sriramprasad/Dev/rough/tableImage/build/Pods.build/Debug-iphonesimulator/Alamofire.build/module.modulemap /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/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/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/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
// This file is part of Visual D
//
// Visual D integrates the D programming language into Visual Studio
// Copyright (c) 2010-2011 by Rainer Schuetze, All Rights Reserved
//
// 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 vdc.parser.decl;
import vdc.util;
import vdc.lexer;
import vdc.parser.engine;
import vdc.parser.expr;
import vdc.parser.misc;
import vdc.parser.tmpl;
import vdc.parser.mod;
import ast = vdc.ast.all;
import stdext.util;
//-- GRAMMAR_BEGIN --
//Declaration:
// alias LinkageAttribute_opt Decl
// typedef Decl /* for legacy code */
// Decl
// alias Identifier this
// alias this = Identifier
class Declaration
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_alias:
p.pushState(&shiftAlias);
return Accept;
case TOK_typedef:
p.pushState(&shiftTypedef);
p.pushState(&Decl!true.enter);
return Accept;
default:
return Decl!true.enter(p);
}
}
static Action shiftAlias(Parser p)
{
switch(p.tok.id)
{
case TOK_extern:
p.pushState(&shiftAliasLinkage);
p.pushState(&Decl!true.enter);
return LinkageAttribute.enter(p);
case TOK_Identifier:
p.pushToken(p.tok);
p.pushState(&shiftAliasIdentifier);
return Accept;
case TOK_this:
p.pushState(&shiftThis);
return Accept;
default:
p.pushState(&shiftTypedef);
return Decl!true.enter(p);
}
}
static Action shiftAliasLinkage(Parser p)
{
auto decl = p.popNode!(ast.Decl)();
auto link = p.popNode!(ast.AttributeSpecifier)();
p.combineAttributes(decl.attr, link.attr);
p.pushNode(decl);
return Forward;
}
// assumes identifier token on the info stack
static Action shiftAliasIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_this:
auto tok = p.popToken();
p.pushNode(new ast.AliasThis(tok));
p.pushState(&shiftAliasThis);
return Accept;
case TOK_assign:
p.pushState(&shiftAliasAssign);
p.pushState(&Type.enter);
return Accept;
default:
p.pushState(&shiftTypedef);
return Decl!true.enterTypeIdentifier(p);
}
}
static Action shiftThis(Parser p)
{
switch(p.tok.id)
{
case TOK_assign:
p.pushState(&shiftThisAssign);
return Accept;
default:
return p.parseError("'=' expected after alias this");
}
}
static Action shiftThisAssign(Parser p)
{
switch(p.tok.id)
{
case TOK_Identifier:
p.pushNode(new ast.AliasThis(p.tok));
p.pushState(&shiftAliasThis);
return Accept;
default:
return p.parseError("identifier expected after alias this =");
}
}
static Action shiftAliasThis(Parser p)
{
switch(p.tok.id)
{
case TOK_semicolon:
return Accept;
default:
return p.parseError("semicolon expected after alias this;");
}
}
// assumes identifier token on the info stack
static Action shiftAliasAssign(Parser p)
{
auto type = static_cast!(ast.Type)(p.popNode());
auto tok = p.popToken();
auto decl = new ast.Decl(type.id, type.span);
auto decls = new ast.Declarators(tok);
decls.addMember(new ast.Declarator(tok));
// insert type before declarator identifier
decl.addMember(type);
decl.addMember(decls);
decl.isAlias = true;
decl.hasSemi = true;
p.pushNode(decl);
switch(p.tok.id)
{
case TOK_semicolon:
return Accept;
case TOK_comma:
default:
return p.parseError("semicolon expected after alias identifier = type");
}
}
static Action shiftTypedef(Parser p)
{
//p.appendReplaceTopNode(new ast.AliasDeclaration(p.tok));
p.topNode!(ast.Decl)().isAlias = true;
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//Decl:
// StorageClasses Decl
// BasicType BasicTypes2_opt Declarators ;
// BasicType BasicTypes2_opt Declarator FunctionBody
// AutoDeclaration
//
//AutoDeclaration:
// StorageClasses Identifier = AssignExpression ;
class Decl(bool checkSemi = true)
{
// storage class stored in Decl.attr, first child is Type (TOK_auto if not present)
static Action enter(Parser p)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// switch here from AttributeSpecifier when detecting a '(' after const,etc
// assumes modifier token on the info stack
static Action enterAttributeSpecifier(Parser p)
{
assert(p.tok.id == TOK_lparen);
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
// disambiguate "const x" and "const(int) x"
// assumes modifier token on the info stack
static Action shiftTypeModifier(Parser p)
{
if(p.tok.id == TOK_lparen)
{
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
auto decl = p.topNode!(ast.Decl)();
Token tok = p.popToken();
p.combineAttributes(decl.attr, tokenToAttribute(tok.id));
return shiftStorageClass(p);
}
static Action enterAfterStorageClass(Parser p, TokenId storage)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
decl.attr = tokenToAttribute(storage);
return shiftStorageClass(p);
}
static Action shiftStorageClass(Parser p)
{
if(p.tok.id == TOK_Identifier)
{
p.pushToken(p.tok);
p.pushState(&shiftIdentifier);
return Accept;
}
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
auto decl = p.topNode!(ast.Decl)();
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// switch here from Statement when detecting a declaration after an identifier
// assumes identifier token on the info stack
static Action enterTypeIdentifier(Parser p)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
// assumes identifier token on the info stack
static Action enterIdentifier(Parser p)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
return shiftIdentifier(p);
}
// assumes identifier token on the info stack
static Action shiftIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_assign:
auto bt = new ast.AutoType(TOK_auto, p.topToken().span);
p.topNode!(ast.Decl)().addMember(bt);
p.pushState(&shiftDeclarators);
return Declarators.enterAfterIdentifier(p);
case TOK_lparen:
// storageclass identifier(... must be function with auto return
auto bt = new ast.AutoType(TOK_auto, p.topToken().span);
p.topNode!(ast.Decl).addMember(bt);
p.pushState(&shiftDeclarators);
return Declarators.enterAfterIdentifier(p);
default:
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
}
// assumes identifier token on the info stack
static Action enterAutoReturn(Parser p)
{
assert(p.tok.id == TOK_lparen);
auto decl = new ast.Decl(p.topToken());
decl.hasSemi = checkSemi;
p.pushNode(decl);
auto bt = new ast.AutoType(TOK_auto, p.topToken().span);
decl.addMember(bt);
p.pushState(&shiftDeclarators);
return Declarators.enterAfterIdentifier(p);
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicTypes2);
return BasicTypes2.enter(p);
default:
return shiftBasicTypes2(p);
}
}
static Action shiftBasicTypes2(Parser p)
{
p.popAppendTopNode!(ast.Decl, ast.Type)();
p.pushState(&shiftDeclarators);
return Declarators.enter(p);
}
static Action shiftDeclarators(Parser p)
{
p.popAppendTopNode!(ast.Decl)();
static if(checkSemi)
{
if(p.tok.id == TOK_RECOVER)
return Forward;
auto decl = p.topNode!(ast.Decl)();
if(decl.members.length == 2 && // BasicType and Declarators
decl.members[1].members.length == 1 && // only one declarator
FunctionBody.isInitTerminal(p.tok))
{
decl.hasSemi = false;
p.pushState(&shiftFunctionBody);
return FunctionBody.enter(p);
}
if(p.tok.id != TOK_semicolon)
return p.parseError("semicolon expected after declaration");
return Accept;
}
else
{
return Forward;
}
}
static Action shiftFunctionBody(Parser p)
{
p.popAppendTopNode!(ast.Decl)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//Declarators:
// DeclaratorInitializer
// DeclaratorInitializer , DeclaratorIdentifierList
class Declarators
{
mixin ListNode!(ast.Declarators, DeclaratorInitializer, TOK_comma);
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
p.pushNode(new ast.Declarators(p.tok));
p.pushState(&shift);
return DeclaratorInitializer.enterAfterIdentifier(p);
}
}
//-- GRAMMAR_BEGIN --
//DeclaratorInitializer:
// Declarator
// Declarator = Initializer
class DeclaratorInitializer
{
mixin OptionalNode!(ast.DeclaratorInitializer, Declarator, TOK_assign, Initializer);
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_assign:
auto tok = p.popToken();
p.pushNode(new ast.Declarator(tok));
return shiftSubType1(p);
default:
p.pushState(&shiftSubType1);
return Declarator.enterAfterIdentifier(p);
}
}
}
//-- GRAMMAR_BEGIN --
//DeclaratorIdentifierList:
// DeclaratorIdentifier
// DeclaratorIdentifier , DeclaratorIdentifierList
class DeclaratorIdentifierList
{
mixin ListNode!(ast.DeclaratorIdentifierList, DeclaratorIdentifier, TOK_comma);
}
//-- GRAMMAR_BEGIN --
//DeclaratorIdentifier:
// Identifier
// Identifier = Initializer
class DeclaratorIdentifier
{
mixin OptionalNode!(ast.DeclaratorIdentifier, Identifier, TOK_assign, Initializer);
}
//-- GRAMMAR_BEGIN --
//Initializer:
// VoidInitializer
// NonVoidInitializer
//
//NonVoidInitializer:
// AssignExpression
// ArrayInitializer /* same as ArrayLiteral? */
// StructInitializer
class Initializer
{
static Action enter(Parser p)
{
if(p.tok.id == TOK_void)
{
p.pushRollback(&rollbackVoid);
p.pushState(&shiftVoid);
return Accept;
}
// StructInitializer not implemented
return AssignExpression.enter(p);
}
static Action shiftVoid(Parser p)
{
switch(p.tok.id)
{
case TOK_dot:
return p.parseError("unexpected '.' in void initializer");
default:
p.popRollback();
p.pushNode(new ast.VoidInitializer(p.tok));
return Forward;
}
}
static Action rollbackVoid(Parser p)
{
return AssignExpression.enter(p);
}
}
//-- GRAMMAR_BEGIN --
//BasicType:
// BasicTypeX
// . IdentifierList
// IdentifierList
// Typeof
// Typeof . IdentifierList
// ModifiedType
// VectorType
//
//ModifiedType:
// const ( Type )
// immutable ( Type )
// shared ( Type )
// inout ( Type )
class BasicType
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_dot:
case TOK_Identifier:
p.pushNode(new ast.IdentifierType(p.tok));
p.pushState(&shiftIdentifierList);
return GlobalIdentifierList.enter(p);
case TOK_typeof:
p.pushState(&shiftTypeof);
return Typeof.enter(p);
mixin(case_TOKs_BasicTypeX);
p.pushNode(new ast.BasicType(p.tok));
return Accept;
mixin(case_TOKs_TypeModifier);
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
case TOK___vector:
return VectorType.enter(p);
default:
return p.parseError("unexpected token in BasicType");
}
}
// assumes modifier token on the info stack
static Action shiftTypeModifier(Parser p)
{
Token tok = p.popToken();
p.pushNode(new ast.ModifiedType(tok));
switch(p.tok.id)
{
case TOK_lparen:
p.pushState(&shiftParenType);
p.pushState(&Type.enter);
return Accept;
default:
p.pushState(&shiftType);
return Type.enter(p);
}
}
static Action shiftParenType(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected");
p.popAppendTopNode();
return Accept;
}
static Action shiftType(Parser p)
{
p.popAppendTopNode();
return Forward;
}
// entry point on token after identifier
// assumes identifier token on the info stack
static Action enterIdentifier(Parser p)
{
p.pushNode(new ast.IdentifierType(p.topToken()));
p.pushState(&shiftIdentifierList);
return IdentifierList.enterAfterIdentifier(p);
}
static Action shiftIdentifierList(Parser p)
{
p.popAppendTopNode!(ast.IdentifierType)();
return Forward;
}
static Action shiftTypeof(Parser p)
{
if(p.tok.id != TOK_dot)
return Forward;
p.pushState(&shiftTypeofIdentifierList);
p.pushState(&IdentifierList.enter);
return Accept;
}
static Action shiftTypeofIdentifierList(Parser p)
{
p.popAppendTopNode!(ast.Typeof, ast.IdentifierList)();
return Forward;
}
}
enum case_TOKs_TypeModifier = q{
case TOK_const:
case TOK_shared:
case TOK_immutable:
case TOK_inout:
};
bool isTypeModifier(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_TypeModifier);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//BasicTypeX:
// bool
// byte
// ubyte
// short
// ushort
// int
// uint
// long
// ulong
// char
// wchar
// dchar
// float
// double
// real
// ifloat
// idouble
// ireal
// cfloat
// cdouble
// creal
// void
bool isBasicTypeX(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_BasicTypeX);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//VectorType:
// __vector ( Type )
class VectorType
{
mixin SequenceNode!(ast.VectorType, TOK___vector, TOK_lparen, Type, TOK_rparen);
}
//-- GRAMMAR_BEGIN --
//Typeof:
// typeof ( Expression )
// typeof ( return )
class Typeof
{
static Action enter(Parser p)
{
if(p.tok.id != TOK_typeof)
return p.parseError("typeof expected");
p.pushNode(new ast.Typeof(p.tok));
p.pushState(&shiftLparen);
return Accept;
}
static Action shiftLparen(Parser p)
{
if(p.tok.id != TOK_lparen)
return p.parseError("opening parenthesis expected");
p.pushState(&shiftArgument);
return Accept;
}
static Action shiftArgument(Parser p)
{
if(p.tok.id == TOK_return)
{
p.topNode!(ast.Typeof).id = TOK_return;
p.pushState(&shiftRparen);
return Accept;
}
p.pushState(&shiftExpression);
return Expression.enter(p);
}
static Action shiftExpression(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected");
p.popAppendTopNode!(ast.Typeof)();
return Accept;
}
static Action shiftRparen(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected");
return Accept;
}
}
//-- GRAMMAR_BEGIN --
//Declarator:
// Identifier DeclaratorSuffixes_opt
class Declarator
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_Identifier:
p.pushNode(new ast.Declarator(p.tok));
p.pushState(&shiftIdentifier);
return Accept;
default:
return p.parseError("unexpected token in Declarator");
}
}
static Action shiftIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
case TOK_lbracket:
return DeclaratorSuffixes.enter(p); // appends to Declarator
default:
return Forward;
}
}
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
auto tok = p.popToken();
p.pushNode(new ast.Declarator(tok));
return shiftIdentifier(p);
}
}
//-- GRAMMAR_BEGIN --
// always optional
//BasicType2:
// *
// [ ]
// [ AssignExpression ]
// [ AssignExpression .. AssignExpression ]
// [ Type ]
// delegate Parameters FunctionAttributes_opt
// function Parameters FunctionAttributes_opt
class BasicType2
{
enum case_TOKs = q{
case TOK_mul:
case TOK_lbracket:
case TOK_delegate:
case TOK_function:
};
static Action enter(Parser p)
{
assert(p.topNode!(ast.Type));
switch(p.tok.id)
{
case TOK_mul:
p.appendReplaceTopNode(new ast.TypePointer(p.tok));
return Accept;
case TOK_lbracket:
p.pushState(&shiftLbracket);
return Accept;
case TOK_delegate:
p.appendReplaceTopNode(new ast.TypeDelegate(p.tok));
p.pushState(&shiftParameters);
p.pushState(&Parameters.enter);
return Accept;
case TOK_function:
p.appendReplaceTopNode(new ast.TypeFunction(p.tok));
p.pushState(&shiftParameters);
p.pushState(&Parameters.enter);
return Accept;
default:
return p.parseError("unexpected token in BasicType2");
}
}
static Action shiftLbracket(Parser p)
{
switch(p.tok.id)
{
case TOK_rbracket:
p.appendReplaceTopNode(new ast.TypeDynamicArray(p.tok));
return Accept;
default:
p.pushState(&shiftTypeOrExpression);
return TypeOrExpression!TOK_rbracket.enter(p);
}
}
static Action shiftTypeOrExpression(Parser p)
{
if(cast(ast.Type) p.topNode())
{
auto keyType = p.popNode!(ast.Type);
p.appendReplaceTopNode(new ast.TypeAssocArray(p.tok));
p.topNode().addMember(keyType);
if(p.tok.id != TOK_rbracket)
return p.parseError("']' expected");
return Accept;
}
switch(p.tok.id)
{
case TOK_rbracket:
auto dim = p.popNode!(ast.Expression);
p.appendReplaceTopNode(new ast.TypeStaticArray(p.tok));
p.topNode().addMember(dim);
return Accept;
case TOK_slice:
auto low = p.popNode!(ast.Expression);
p.appendReplaceTopNode(new ast.TypeArraySlice(p.tok));
p.topNode().addMember(low);
p.pushState(&shiftSliceUpper);
p.pushState(&AssignExpression.enter);
return Accept;
default:
return p.parseError("']' expected");
}
}
static Action shiftSliceUpper(Parser p)
{
p.popAppendTopNode!(ast.TypeArraySlice)();
switch(p.tok.id)
{
case TOK_rbracket:
return Accept;
default:
return p.parseError("']' expected");
}
}
static Action shiftParameters(Parser p)
{
p.popAppendTopNode();
return shiftAttributes(p);
}
static Action shiftAttributes(Parser p)
{
switch(p.tok.id)
{
mixin(case_TOKs_MemberFunctionAttribute); // no member attributes?
auto type = p.topNode!(ast.Type);
p.combineAttributes(type.attr, tokenToAttribute(p.tok.id));
p.pushState(&shiftAttributes);
return Accept;
default:
return Forward;
}
}
}
//-- GRAMMAR_BEGIN --
//BasicTypes2:
// BasicType2
// BasicType2 BasicTypes2
class BasicTypes2
{
static Action enter(Parser p)
{
assert(p.topNode!(ast.Type));
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicType);
return BasicType2.enter(p);
default:
return p.parseError("unexpected token in BasicType2");
}
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicType);
return BasicType2.enter(p);
default:
return Forward;
}
}
}
//-- GRAMMAR_BEGIN --
//DeclaratorSuffixes:
// DeclaratorSuffix
// DeclaratorSuffix DeclaratorSuffixes
//
// obsolete C-style?
//DeclaratorSuffix:
// TemplateParameterList_opt Parameters MemberFunctionAttributes_opt Constraint_opt
// [ ]
// [ AssignExpression ]
// [ Type ]
class DeclaratorSuffixes
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
p.pushRollback(&rollbackParametersFailure);
p.pushState(&shiftParameters);
return Parameters.enter(p);
case TOK_lbracket:
p.pushState(&shiftLbracket);
return Accept;
default:
return p.parseError("opening parenthesis or bracket expected");
}
}
static Action nextSuffix(Parser p)
{
switch(p.tok.id)
{
case TOK_lbracket:
p.pushState(&shiftLbracket);
return Accept;
default:
return Forward;
}
}
static Action shiftLbracket(Parser p)
{
switch(p.tok.id)
{
case TOK_rbracket:
p.topNode().addMember(new ast.SuffixDynamicArray(p.tok));
p.pushState(&nextSuffix);
return Accept;
default:
p.pushState(&shiftTypeOrExpression);
return TypeOrExpression!(TOK_rbracket).enter(p);
}
// return p.notImplementedError("C style declarators");
}
static Action shiftTypeOrExpression(Parser p)
{
switch(p.tok.id)
{
case TOK_rbracket:
auto node = p.popNode();
ast.Node n = new ast.SuffixArray(p.tok);
n.addMember(node);
p.topNode().addMember(n);
p.pushState(&nextSuffix);
return Accept;
default:
return p.parseError("']' expected in C style declarator");
}
}
static Action shiftParameters(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
// somehow made it through the parameters, but another parameters list follow...
return Reject; // so rollback to retry with template parameter list
mixin(case_TOKs_MemberFunctionAttribute);
p.popRollback();
auto param = p.topNode!(ast.ParameterList);
p.combineAttributes(param.attr, tokenToAttribute(p.tok.id));
p.pushState(&shiftMemberFunctionAttribute);
return Accept;
case TOK_if:
p.popRollback();
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
p.pushState(&shiftConstraint);
return Constraint.enter(p);
default:
p.popRollback();
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
return Forward;
}
}
static Action shiftMemberFunctionAttribute(Parser p)
{
switch(p.tok.id)
{
mixin(case_TOKs_MemberFunctionAttribute);
auto param = p.topNode!(ast.ParameterList);
p.combineAttributes(param.attr, tokenToAttribute(p.tok.id));
p.pushState(&shiftMemberFunctionAttribute);
return Accept;
case TOK_if:
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
p.pushState(&shiftConstraint);
return Constraint.enter(p);
default:
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
return Forward;
}
}
static Action shiftConstraint(Parser p)
{
p.popAppendTopNode!(ast.Declarator, ast.Constraint)();
return Forward;
}
static Action rollbackParametersFailure(Parser p)
{
p.pushState(&shiftTemplateParameterList);
return TemplateParameters.enter(p);
}
static Action shiftTemplateParameterList(Parser p)
{
p.popAppendTopNode(); // append to declarator
switch(p.tok.id)
{
case TOK_lparen:
p.pushState(&shiftParametersAfterTempl);
return Parameters.enter(p);
default:
return p.parseError("parameter list expected after template arguments");
}
}
static Action shiftParametersAfterTempl(Parser p)
{
return shiftMemberFunctionAttribute(p);
}
}
//-- GRAMMAR_BEGIN --
//GlobalIdentifierList:
// IdentifierList
// . IdentifierList
class GlobalIdentifierList
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_dot:
return IdentifierList.enterGlobal(p);
default:
return IdentifierList.enter(p);
}
}
}
//-- GRAMMAR_BEGIN --
//IdentifierList:
// Identifier
// Identifier . IdentifierList
// TemplateInstance
// TemplateInstance . IdentifierList
//
// using IdentifierOrTemplateInstance
class IdentifierList
{
mixin ListNode!(ast.IdentifierList, IdentifierOrTemplateInstance, TOK_dot);
// if preceded by '.', enter here fore global scope
static Action enterGlobal(Parser p)
{
assert(p.tok.id == TOK_dot);
auto list = new ast.IdentifierList(p.tok);
list.global = true;
p.pushNode(list);
p.pushState(&shift);
p.pushState(&IdentifierOrTemplateInstance.enter);
return Accept;
}
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
auto list = new ast.IdentifierList(p.topToken());
p.pushNode(list);
p.pushState(&shift);
return IdentifierOrTemplateInstance.enterIdentifier(p);
}
}
class Identifier
{
static Action enter(Parser p)
{
if(p.tok.id != TOK_Identifier)
return p.parseError("identifier expected");
p.pushNode(new ast.Identifier(p.tok));
return Accept;
}
}
//-- GRAMMAR_BEGIN --
//StorageClasses:
// StorageClass
// StorageClass StorageClasses
//
//StorageClass:
// AttributeOrStorageClass
// extern
// nothrow
// pure
// synchronized
bool isStorageClass(TokenId tok)
{
switch(tok)
{
case TOK_extern:
case TOK_synchronized:
mixin(case_TOKs_FunctionAttribute);
mixin(case_TOKs_AttributeOrStorageClass);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//AttributeOrStorageClass:
// deprecated
// static
// final
// override
// abstract
// const
// auto
// scope
// __gshared
// __thread
// shared
// immutable
// inout
// ref
enum case_TOKs_AttributeOrStorageClass = q{
case TOK_deprecated:
case TOK_static:
case TOK_final:
case TOK_override:
case TOK_abstract:
case TOK_const:
case TOK_auto:
case TOK_scope:
case TOK_volatile:
case TOK___gshared:
case TOK___thread:
case TOK_shared:
case TOK_immutable:
case TOK_inout:
case TOK_ref:
};
bool isAttributeOrStorageClass(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_AttributeOrStorageClass);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//Type:
// BasicType
// BasicType Declarator2
//
//Declarator2:
// BasicType2 Declarator2
// ( Declarator2 )
// ( Declarator2 ) DeclaratorSuffixes
//
class Type
{
static Action enter(Parser p)
{
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicType);
return BasicType2.enter(p);
case TOK_lparen:
// not implemented, better forward, it might also be constructor arguments
// p.pushState(&shiftDeclarator2);
// return Accept;
default:
return Forward;
}
}
// entry point from EnumMember: Type Identifier = AssignExpression
// and ForeachType: ref_opt Type_opt Identifier
// assumes identifier pushed onto token stack
static Action enterIdentifier(Parser p)
{
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
// assumes modifier token on the info stack
static Action enterTypeModifier(Parser p)
{
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
static Action shiftDeclarator2(Parser p)
{
return p.notImplementedError();
}
}
//-- GRAMMAR_BEGIN --
//TypeWithModifier:
// Type
// const TypeWithModifier
// immutable TypeWithModifier
// inout TypeWithModifier
// shared TypeWithModifier
class TypeWithModifier
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_const:
case TOK_immutable:
case TOK_inout:
case TOK_shared:
p.pushToken(p.tok);
p.pushState(&shiftModifier);
return Accept;
default:
return Type.enter(p);
}
}
static Action shiftModifier(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
return Type.enterTypeModifier(p);
default:
auto tok = p.popToken();
p.pushNode(new ast.ModifiedType(tok));
p.pushState(&shiftModifiedType);
return enter(p);
}
}
static Action shiftModifiedType(Parser p)
{
p.popAppendTopNode!(ast.ModifiedType)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//Parameters:
// ( ParameterList )
// ( )
class Parameters
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
p.pushState(&shiftLparen);
return Accept;
default:
return p.parseError("opening parenthesis expected in parameter list");
}
}
static Action shiftLparen(Parser p)
{
if(p.tok.id == TOK_rparen)
{
p.pushNode(new ast.ParameterList(p.tok));
return Accept;
}
p.pushState(&shiftParameterList);
return ParameterList.enter(p);
}
static Action shiftParameterList(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected for parameter list");
return Accept;
}
}
//-- GRAMMAR_BEGIN --
//ParameterList:
// Parameter
// Parameter , ParameterList
// Parameter ...
// ...
class ParameterList
{
static Action enter(Parser p)
{
p.pushNode(new ast.ParameterList(p.tok));
return shift(p);
}
static Action shift(Parser p)
{
switch(p.tok.id)
{
case TOK_dotdotdot:
p.topNode!(ast.ParameterList)().anonymous_varargs = true;
return Accept;
default:
p.pushState(&shiftParameter);
return Parameter.enter(p);
}
}
static Action shiftParameter(Parser p)
{
p.popAppendTopNode!(ast.ParameterList)();
switch(p.tok.id)
{
case TOK_dotdotdot:
p.topNode!(ast.ParameterList)().varargs = true;
return Accept;
case TOK_comma:
p.pushState(&shift);
return Accept;
default:
return Forward;
}
}
}
//-- GRAMMAR_BEGIN --
///* Declarator replaced with ParameterDeclarator */
//Parameter:
// InOut_opt ParameterDeclarator DefaultInitializerExpression_opt
//
//DefaultInitializerExpression:
// = AssignExpression
// = __FILE__ // already in primary expression
// = __LINE__ // already in primary expression
class Parameter
{
static Action enter(Parser p)
{
p.pushNode(new ast.Parameter(p.tok));
p.pushState(&shiftParameterDeclarator);
if(isInOut(p.tok.id))
{
p.topNode!(ast.Parameter)().io = p.tok.id;
p.pushState(&ParameterDeclarator.enter);
return Accept;
}
return ParameterDeclarator.enter(p);
}
static Action shiftParameterDeclarator(Parser p)
{
p.popAppendTopNode!(ast.Parameter)();
if(p.tok.id != TOK_assign)
return Forward;
p.pushState(&shiftInitializer);
p.pushState(&AssignExpression.enter);
return Accept;
}
static Action shiftInitializer(Parser p)
{
p.popAppendTopNode!(ast.Parameter)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//ParameterDeclarator:
// StorageClasses_opt BasicType BasicTypes2_opt Declarator_opt
// /*Identifier DeclaratorSuffixes_opt*/
class ParameterDeclarator
{
// very similar to Decl, combine?
// differences: no auto, single Declarator only
static Action enter(Parser p)
{
auto decl = new ast.ParameterDeclarator(p.tok);
p.pushNode(decl);
return shift(p);
}
static Action shift(Parser p)
{
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
auto decl = p.topNode!(ast.ParameterDeclarator)();
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// disambiguate "const x" and "const(int) x"
// assumes modifier token on the info stack
static Action shiftTypeModifier(Parser p)
{
if(p.tok.id == TOK_lparen)
{
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
auto decl = p.topNode!(ast.ParameterDeclarator)();
Token tok = p.popToken();
p.combineAttributes(decl.attr, tokenToAttribute(tok.id));
return shift(p);
}
static Action shiftStorageClass(Parser p)
{
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
auto decl = p.topNode!(ast.ParameterDeclarator)();
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// switch here from TemplateValueParameter when detecting a declaration after an identifier
// assumes identifier token on the info stack
static Action enterTypeIdentifier(Parser p)
{
auto decl = new ast.ParameterDeclarator(p.tok);
p.pushNode(decl);
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicTypes2);
return BasicTypes2.enter(p);
default:
return shiftBasicTypes2(p);
}
}
static Action shiftBasicTypes2(Parser p)
{
p.popAppendTopNode!(ast.ParameterDeclarator, ast.Type)();
if(p.tok.id != TOK_Identifier)
return Forward;
p.pushState(&shiftDeclarator);
return Declarator.enter(p);
}
static Action shiftDeclarator(Parser p)
{
p.popAppendTopNode!(ast.ParameterDeclarator)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//InOut:
// in
// out
// ref
// lazy
// scope /* ? */
enum case_TOKs_InOut = q{
case TOK_in:
case TOK_out:
case TOK_ref:
case TOK_lazy:
case TOK_scope:
};
bool isInOut(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_InOut);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//FunctionAttributes:
// FunctionAttribute
// FunctionAttribute FunctionAttributes
//
//FunctionAttribute:
// nothrow
// pure
enum case_TOKs_FunctionAttribute = q{
case TOK_nothrow:
case TOK_pure:
case TOK_safe:
case TOK_system:
case TOK_trusted:
case TOK_property:
case TOK_disable:
case TOK_nogc:
};
bool isFunctionAttribute(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_FunctionAttribute);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//MemberFunctionAttributes:
// MemberFunctionAttribute
// MemberFunctionAttribute MemberFunctionAttributes
//
//MemberFunctionAttribute:
// const
// immutable
// inout
// shared
// FunctionAttribute
//
enum case_TOKs_MemberFunctionAttribute = q{
case TOK_const:
case TOK_immutable:
case TOK_inout:
case TOK_shared:
} ~ case_TOKs_FunctionAttribute;
bool isMemberFunctionAttribute(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_MemberFunctionAttribute);
return true;
default:
return false;
}
}
|
D
|
module xf.gfx.Texture;
public {
import xf.gfx.TextureInternalFormat;
}
private {
import xf.Common;
import xf.gfx.Resource;
import xf.omg.core.LinearAlgebra;
import xf.img.Image;
import xf.mem.ScratchAllocator;
}
typedef ResourceHandle TextureHandle;
enum TextureType {
Texture1D = 0,
Texture2D,
Texture3D,
TextureCube,
TextureRectangle
}
enum TextureMinFilter {
Linear = 0,
Nearest,
NearestMipmapNearest,
NearestMipmapLinear,
LinearMipmapNearest,
LinearMipmapLinear
}
bool needsMipmap(TextureMinFilter filter) {
return filter != TextureMinFilter.Linear && filter != TextureMinFilter.Nearest;
}
enum TextureMagFilter {
Linear = 0,
Nearest
}
enum TextureWrap {
NoWrap = 0,
Clamp,
ClampToEdge,
ClampToBorder
}
enum CubeMapFace {
PositiveX = 0,
NegativeX,
PositiveY,
NegativeY,
PositiveZ,
NegativeZ
}
struct TextureRequest {
TextureType type = TextureType.Texture2D;
TextureInternalFormat internalFormat = TextureInternalFormat.SRGB8_ALPHA8;
TextureMinFilter minFilter = TextureMinFilter.LinearMipmapLinear;
TextureMagFilter magFilter = TextureMagFilter.Linear;
TextureWrap wrapS = TextureWrap.NoWrap;
TextureWrap wrapT = TextureWrap.NoWrap;
TextureWrap wrapR = TextureWrap.NoWrap;
int border = 0;
vec4 borderColor = {r: 0, g: 0, b: 0, a: 1};
}
struct TextureCacheKey {
// does not duplicate the string from the source
static TextureCacheKey path(cstring s) {
TextureCacheKey key;
key.sourcePath = s;
key.computeHash();
return key;
}
hash_t toHash() {
return hash;
}
bool opEquals(TextureCacheKey other) {
return this.hash == other.hash && this.sourcePath == other.sourcePath;
}
void computeHash() {
hash = typeid(cstring).getHash(&sourcePath);
}
TextureCacheKey dup(DgScratchAllocator mem) {
TextureCacheKey res;
res.hash = this.hash;
res.sourcePath = mem.dupString(this.sourcePath);
return res;
}
cstring sourcePath;
hash_t hash;
}
interface ITextureMngr {
// Texture createTexture(Image img, TextureRequest req = TextureRequest.init);
Texture createTexture(Image img, TextureCacheKey key, TextureRequest req = TextureRequest.init);
Texture createTexture(vec2i size, TextureRequest req, vec4 delegate(vec3) = null);
void updateTexture(Texture, vec2i origin, vec2i size, ubyte* data);
void updateTexture(Texture, vec2i origin, vec2i size, float* data);
vec3i getSize(TextureHandle handle);
size_t getApiHandle(TextureHandle handle);
bool getInfo(TextureHandle handle, TextureRequest*);
}
struct Texture {
alias TextureHandle Handle;
mixin MResource;
vec3i getSize() {
assert (_resHandle !is Handle.init);
assert (_resMngr !is null);
return (cast(ITextureMngr)_resMngr).getSize(_resHandle);
}
size_t getApiHandle() {
assert (_resHandle !is Handle.init);
assert (_resMngr !is null);
return (cast(ITextureMngr)_resMngr).getApiHandle(_resHandle);
}
bool getInfo(TextureRequest* info) {
assert (_resHandle !is Handle.init);
assert (_resMngr !is null);
return (cast(ITextureMngr)_resMngr).getInfo(_resHandle, info);
}
}
|
D
|
module android.java.android.graphics.RectF_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import1 = android.java.android.graphics.Rect_d_interface;
import import3 = android.java.java.lang.Class_d_interface;
import import2 = android.java.android.os.Parcel_d_interface;
import import0 = android.java.android.graphics.RectF_d_interface;
final class RectF : IJavaObject {
static immutable string[] _d_canCastTo = [
"android/os/Parcelable",
];
@Import this(arsd.jni.Default);
@Import this(float, float, float, float);
@Import this(import0.RectF);
@Import this(import1.Rect);
@Import bool equals(IJavaObject);
@Import int hashCode();
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import string toShortString();
@Import bool isEmpty();
@Import float width();
@Import float height();
@Import float centerX();
@Import float centerY();
@Import void setEmpty();
@Import void set(float, float, float, float);
@Import void set(import0.RectF);
@Import void set(import1.Rect);
@Import void offset(float, float);
@Import void offsetTo(float, float);
@Import void inset(float, float);
@Import bool contains(float, float);
@Import bool contains(float, float, float, float);
@Import bool contains(import0.RectF);
@Import bool intersect(float, float, float, float);
@Import bool intersect(import0.RectF);
@Import bool setIntersect(import0.RectF, import0.RectF);
@Import bool intersects(float, float, float, float);
@Import static bool intersects(import0.RectF, import0.RectF);
@Import void round(import1.Rect);
@Import void roundOut(import1.Rect);
@Import @JavaName("union") void union_(float, float, float, float);
@Import @JavaName("union") void union_(import0.RectF);
@Import @JavaName("union") void union_(float, float);
@Import void sort();
@Import int describeContents();
@Import void writeToParcel(import2.Parcel, int);
@Import void readFromParcel(import2.Parcel);
@Import import3.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 = "Landroid/graphics/RectF;";
}
|
D
|
/**
*
* THIS FILE IS AUTO-GENERATED BY ./parse_specs.d FOR MCU atmega165pa WITH ARCHITECTURE avr5
*
*/
module avr.specs.specs_atmega165pa;
enum __AVR_ARCH__ = 5;
enum __AVR_ASM_ONLY__ = false;
enum __AVR_ENHANCED__ = true;
enum __AVR_HAVE_MUL__ = true;
enum __AVR_HAVE_JMP_CALL__ = true;
enum __AVR_MEGA__ = true;
enum __AVR_HAVE_LPMX__ = true;
enum __AVR_HAVE_MOVW__ = true;
enum __AVR_HAVE_ELPM__ = false;
enum __AVR_HAVE_ELPMX__ = false;
enum __AVR_HAVE_EIJMP_EICALL_ = false;
enum __AVR_2_BYTE_PC__ = true;
enum __AVR_3_BYTE_PC__ = false;
enum __AVR_XMEGA__ = false;
enum __AVR_HAVE_RAMPX__ = false;
enum __AVR_HAVE_RAMPY__ = false;
enum __AVR_HAVE_RAMPZ__ = false;
enum __AVR_HAVE_RAMPD__ = false;
enum __AVR_TINY__ = false;
enum __AVR_PM_BASE_ADDRESS__ = 0;
enum __AVR_SFR_OFFSET__ = 32;
enum __AVR_DEVICE_NAME__ = "atmega165pa";
|
D
|
/*
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module engine.thirdparty.derelict.util.loader;
import std.array,
std.string;
import engine.thirdparty.derelict.util.exception,
engine.thirdparty.derelict.util.sharedlib,
engine.thirdparty.derelict.util.system;
struct SharedLibVersion
{
int major;
int minor;
int patch;
}
abstract class SharedLibLoader
{
/++
Constructs a new instance of shared lib loader with a string of one
or more shared library names to use as default.
Params:
libNames = A string containing one or more comma-separated shared
library names.
+/
this(string libNames) { _libNames = libNames; }
/++
Binds a function pointer to a symbol in this loader's shared library.
Params:
ptr = Pointer to a function pointer that will be used as the bind
point.
funcName = The name of the symbol to be bound.
doThrow = If true, a SymbolLoadException will be thrown if the symbol
is missing. If false, no exception will be thrown and the
ptr parameter will be set to null.
Throws: SymbolLoadException if doThrow is true and a the symbol
specified by funcName is missing from the shared library.
+/
final void bindFunc(void** ptr, string funcName, bool doThrow = true)
{
void* func = loadSymbol(funcName, doThrow);
*ptr = func;
}
/++
Binds a function pointer to a stdcall symbol in this loader's shared library.
On builds for anything other than 32-bit Windows, this simply delegates to bindFunc.
Params:
ptr = Pointer to a function pointer that will be used as the bind
point.
funcName = The name of the symbol to be bound.
doThrow = If true, a SymbolLoadException will be thrown if the symbol
is missing. If false, no exception will be thrown and the
ptr parameter will be set to null.
Throws: SymbolLoadException if doThrow is true and a the symbol
specified by funcName is missing from the shared library.
+/
final void bindFunc_stdcall(Func)(ref Func f, string unmangledName)
{
static if(Derelict_OS_Windows && !Derelict_Arch_64) {
import std.format : format;
import std.traits : ParameterTypeTuple;
// get type-tuple of parameters
ParameterTypeTuple!f params;
size_t sizeOfParametersOnStack(A...)(A args)
{
size_t sum = 0;
foreach (arg; args) {
sum += arg.sizeof;
// align on 32-bit stack
if (sum % 4 != 0)
sum += 4 - (sum % 4);
}
return sum;
}
unmangledName = format("_%s@%s", unmangledName, sizeOfParametersOnStack(params));
}
bindFunc(cast(void**)&f, unmangledName);
}
/++
Finds and loads a shared library, using this loader's default shared library
names and default supported shared library version.
If multiple library names are specified as default, a SharedLibLoadException
will only be thrown if all of the libraries fail to load. It will be the head
of an exceptin chain containing one instance of the exception for each library
that failed.
Examples: If this loader supports versions 2.0 and 2.1 of a shared libary,
this method will attempt to load 2.1 and will fail if only 2.0
is present on the system.
Throws: SharedLibLoadException if the shared library or one of its
dependencies cannot be found on the file system.
SymbolLoadException if an expected symbol is missing from the
library.
+/
final void load() { load(_libNames); }
/++
Finds and loads any version of a shared library greater than or equal to
the required mimimum version, using this loader's default shared library
names.
If multiple library names are specified as default, a SharedLibLoadException
will only be thrown if all of the libraries fail to load. It will be the head
of an exceptin chain containing one instance of the exception for each library
that failed.
Examples: If this loader supports versions 2.0 and 2.1 of a shared library,
passing a SharedLibVersion with the major field set to 2 and the
minor field set to 0 will cause the loader to load version 2.0
if version 2.1 is not available on the system.
Params:
minRequiredVersion = the minimum version of the library that is acceptable.
Subclasses are free to ignore this.
Throws: SharedLibLoadException if the shared library or one of its
dependencies cannot be found on the file system.
SymbolLoadException if an expected symbol is missing from the
library.
+/
final void load(SharedLibVersion minRequiredVersion)
{
configureMinimumVersion(minRequiredVersion);
load();
}
/++
Finds and loads a shared library, using libNames to find the library
on the file system.
If multiple library names are specified in libNames, a SharedLibLoadException
will only be thrown if all of the libraries fail to load. It will be the head
of an exceptin chain containing one instance of the exception for each library
that failed.
Examples: If this loader supports versions 2.0 and 2.1 of a shared libary,
this method will attempt to load 2.1 and will fail if only 2.0
is present on the system.
Params:
libNames = A string containing one or more comma-separated shared
library names.
Throws: SharedLibLoadException if the shared library or one of its
dependencies cannot be found on the file system.
SymbolLoadException if an expected symbol is missing from the
library.
+/
final void load(string libNames)
{
if(libNames == null)
libNames = _libNames;
auto lnames = libNames.split(",");
foreach(ref string l; lnames)
l = l.strip();
load(lnames);
}
/++
Finds and loads any version of a shared library greater than or equal to
the required mimimum version, using libNames to find the library
on the file system.
If multiple library names are specified as default, a SharedLibLoadException
will only be thrown if all of the libraries fail to load. It will be the head
of an exceptin chain containing one instance of the exception for each library
that failed.
Examples: If this loader supports versions 2.0 and 2.1 of a shared library,
passing a SharedLibVersion with the major field set to 2 and the
minor field set to 0 will cause the loader to load version 2.0
if version 2.1 is not available on the system.
Params:
libNames = A string containing one or more comma-separated shared
library names.
minRequiredVersion = The minimum version of the library that is acceptable.
Subclasses are free to ignore this.
Throws: SharedLibLoadException if the shared library or one of its
dependencies cannot be found on the file system.
SymbolLoadException if an expected symbol is missing from the
library.
+/
final void load(string libNames, SharedLibVersion minRequiredVersion)
{
configureMinimumVersion(minRequiredVersion);
load(libNames);
}
/++
Finds and loads a shared library, using libNames to find the library
on the file system.
If multiple library names are specified in libNames, a SharedLibLoadException
will only be thrown if all of the libraries fail to load. It will be the head
of an exception chain containing one instance of the exception for each library
that failed.
Params:
libNames = An array containing one or more shared library names,
with one name per index.
Throws: SharedLibLoadException if the shared library or one of its
dependencies cannot be found on the file system.
SymbolLoadException if an expected symbol is missing from the
library.
+/
final void load(string[] libNames)
{
_lib.load(libNames);
loadSymbols();
}
/++
Finds and loads any version of a shared library greater than or equal to
the required mimimum version, , using libNames to find the library
on the file system.
If multiple library names are specified in libNames, a SharedLibLoadException
will only be thrown if all of the libraries fail to load. It will be the head
of an exception chain containing one instance of the exception for each library
that failed.
Examples: If this loader supports versions 2.0 and 2.1 of a shared library,
passing a SharedLibVersion with the major field set to 2 and the
minor field set to 0 will cause the loader to load version 2.0
if version 2.1 is not available on the system.
Params:
libNames = An array containing one or more shared library names,
with one name per index.
minRequiredVersion = The minimum version of the library that is acceptable.
Subclasses are free to ignore this.
Throws: SharedLibLoadException if the shared library or one of its
dependencies cannot be found on the file system.
SymbolLoadException if an expected symbol is missing from the
library.
+/
final void load(string[] libNames, SharedLibVersion minRequiredVersion)
{
configureMinimumVersion(minRequiredVersion);
load(libNames);
}
/++
Unloads the shared library from memory, invalidating all function pointers
which were assigned a symbol by one of the load methods.
+/
final void unload() { _lib.unload(); }
/// Returns: true if the shared library is loaded, false otherwise.
@property @nogc nothrow
final bool isLoaded() { return _lib.isLoaded; }
/++
Sets the callback that will be called when an expected symbol is
missing from the shared library.
Params:
callback = A delegate that returns a value of type
engine.thirdparty.derelict.util.exception.ShouldThrow and accepts
a string as the sole parameter.
+/
@property @nogc nothrow
final void missingSymbolCallback(MissingSymbolCallbackDg callback)
{
_lib.missingSymbolCallback = callback;
}
/++
Sets the callback that will be called when an expected symbol is
missing from the shared library.
Params:
callback = A pointer to a function that returns a value of type
engine.thirdparty.derelict.util.exception.ShouldThrow and accepts
a string as the sole parameter.
+/
@property @nogc nothrow
final void missingSymbolCallback(MissingSymbolCallbackFunc callback)
{
_lib.missingSymbolCallback = callback;
}
/++
Returns the currently active missing symbol callback.
This exists primarily as a means to save the current callback before
setting a new one. It's useful, for example, if the new callback needs
to delegate to the old one.
+/
@property @nogc nothrow
final MissingSymbolCallback missingSymbolCallback()
{
return _lib.missingSymbolCallback;
}
protected:
/++
Must be implemented by subclasses to load all of the symbols from a
shared library.
This method is called by the load methods.
+/
abstract void loadSymbols();
/++
Allows a subclass to install an exception handler for specific versions
of a library before loadSymbols is called.
This method is optional. If the subclass does not implement it, calls to
any of the overloads of the load method that take a SharedLibVersion will
cause a compile time assert to fire.
+/
void configureMinimumVersion(SharedLibVersion minVersion)
{
assert(0, "SharedLibVersion is not supported by this loader.");
}
/++
Subclasses can use this as an alternative to bindFunc, but must bind
the returned symbol manually.
bindFunc calls this internally, so it can be overloaded to get behavior
different from the default.
Params:
name = The name of the symbol to load.doThrow = If true, a SymbolLoadException will be thrown if the symbol
is missing. If false, no exception will be thrown and the
ptr parameter will be set to null.
Throws: SymbolLoadException if doThrow is true and a the symbol
specified by funcName is missing from the shared library.
Returns: The symbol matching the name parameter.
+/
void* loadSymbol(string name, bool doThrow = true)
{
return _lib.loadSymbol(name, doThrow);
}
/// Returns a reference to the shared library wrapped by this loader.
@property @nogc nothrow
final ref SharedLib lib(){ return _lib; }
private:
string _libNames;
SharedLib _lib;
}
|
D
|
# FIXED
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/common/osal_clock.c
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/comdef.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/../_common/cc26xx/_hal_types.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/stdint.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/_stdint40.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/stdint.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/cdefs.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/_types.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/machine/_types.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/machine/_stdint.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/_stdint.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_defs.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_board.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_board_cfg.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_mcu.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_nvic.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_ints.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_types.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/stdbool.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_chip_def.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_gpio.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_memmap.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/systick.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/debug.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/interrupt.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/cpu.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_cpu_scs.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/rom.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/uart.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_uart.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/gpio.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/flash.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_flash.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_aon_sysctl.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_fcfg1.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/ioc.h
OSAL/osal_clock.obj: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_ioc.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc/ICall.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/stdlib.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/_ti_config.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/linkage.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_assert.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx/onboard.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_sleep.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/osal.h
OSAL/osal_clock.obj: D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/limits.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/OSAL_Memory.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/OSAL_Timers.h
OSAL/osal_clock.obj: C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/osal_clock.h
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/common/osal_clock.c:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/comdef.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/../_common/cc26xx/_hal_types.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/stdint.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/_stdint40.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/stdint.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/cdefs.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/_types.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/machine/_types.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/machine/_stdint.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/sys/_stdint.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_defs.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_board.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_board_cfg.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_mcu.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_nvic.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_ints.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_types.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/stdbool.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_chip_def.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_gpio.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_memmap.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/systick.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/debug.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/interrupt.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/cpu.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_cpu_scs.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/rom.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/uart.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_uart.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/gpio.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/flash.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_flash.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_aon_sysctl.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_fcfg1.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/driverlib/ioc.h:
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/inc/hw_ioc.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc/ICall.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/stdlib.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/_ti_config.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/linkage.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_assert.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx/onboard.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/hal_sleep.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/osal.h:
D:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.12.0.LTS/include/limits.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/OSAL_Memory.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/OSAL_Timers.h:
C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/osal_clock.h:
|
D
|
module pack1.mod2;
import des.log;
void func()
{
logger.fatal( "%s:%d", __FILE__, __LINE__ );
logger.error( "%s:%d", __FILE__, __LINE__ );
logger.warn( "%s:%d", __FILE__, __LINE__ );
logger.info( "%s:%d", __FILE__, __LINE__ );
logger.Debug( "%s:%d", __FILE__, __LINE__ );
logger.trace( "%s:%d", __FILE__, __LINE__ );
}
|
D
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkProcess;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import vtkMultiProcessController;
static import vtkObject;
class vtkProcess : vtkObject.vtkObject {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkProcess_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkProcess obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
~this() {
dispose();
}
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
vtkd_im.delete_vtkProcess(cast(void*)swigCPtr);
}
swigCPtr = null;
super.dispose();
}
}
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkProcess_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkProcess SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkProcess_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkProcess ret = (cPtr is null) ? null : new vtkProcess(cPtr, false);
return ret;
}
public vtkProcess NewInstance() const {
void* cPtr = vtkd_im.vtkProcess_NewInstance(cast(void*)swigCPtr);
vtkProcess ret = (cPtr is null) ? null : new vtkProcess(cPtr, false);
return ret;
}
alias vtkObject.vtkObject.NewInstance NewInstance;
public void Execute() {
vtkd_im.vtkProcess_Execute(cast(void*)swigCPtr);
}
public vtkMultiProcessController.vtkMultiProcessController GetController() {
void* cPtr = vtkd_im.vtkProcess_GetController(cast(void*)swigCPtr);
vtkMultiProcessController.vtkMultiProcessController ret = (cPtr is null) ? null : new vtkMultiProcessController.vtkMultiProcessController(cPtr, false);
return ret;
}
public void SetController(vtkMultiProcessController.vtkMultiProcessController aController) {
vtkd_im.vtkProcess_SetController(cast(void*)swigCPtr, vtkMultiProcessController.vtkMultiProcessController.swigGetCPtr(aController));
}
public int GetReturnValue() {
auto ret = vtkd_im.vtkProcess_GetReturnValue(cast(void*)swigCPtr);
return ret;
}
}
|
D
|
/**
Copyright: Copyright (c) 2016-2017 Andrey Penechko.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Andrey Penechko.
*/
module voxelman.blockentity.plugin;
import voxelman.log;
import pluginlib;
import voxelman.container.buffer;
import voxelman.math;
import derelict.imgui.imgui;
import voxelman.utils.textformatter;
import voxelman.world.block;
import voxelman.core.config;
import voxelman.core.events;
import voxelman.core.packets;
import voxelman.world.storage;
import voxelman.block.plugin;
import voxelman.edit.plugin;
import voxelman.dbg.plugin;
import voxelman.graphics.plugin;
import voxelman.net.plugin;
import voxelman.world.clientworld;
import voxelman.world.serverworld;
import voxelman.worldinteraction.plugin;
import voxelman.blockentity.blockentityman;
import voxelman.world.blockentity;
final class BlockEntityClient : IPlugin {
mixin IdAndSemverFrom!"voxelman.blockentity.plugininfo";
mixin BlockEntityCommon;
private ClientWorld clientWorld;
private WorldInteractionPlugin worldInteraction;
private BlockPluginClient blockPlugin;
private GraphicsPlugin graphics;
private NetClientPlugin connection;
bool blockEntityDebug = false;
override void init(IPluginManager pluginman)
{
clientWorld = pluginman.getPlugin!ClientWorld;
worldInteraction = pluginman.getPlugin!WorldInteractionPlugin;
blockPlugin = pluginman.getPlugin!BlockPluginClient;
graphics = pluginman.getPlugin!GraphicsPlugin;
connection = pluginman.getPlugin!NetClientPlugin;
auto debugClient = pluginman.getPlugin!DebugClient;
debugClient.registerDebugGuiHandler(&showBlockInfo, INFO_ORDER - 2, "BlockInfo");
auto entityTool = new class ITool
{
this() { name = "test.blockentity.block_entity"; }
bool placing;
WorldBox selection;
BlockWorldPos startingPos;
override void onUpdate() {
auto cursor = worldInteraction.sideBlockPos;
selection = worldBoxFromCorners(startingPos.xyz,
cursor.xyz, cast(DimensionId)cursor.w);
drawSelection();
}
// remove
override void onMainActionRelease() {
if (placing) return;
auto block = worldInteraction.pickBlock();
if (isBlockEntity(block.id)) {
connection.send(RemoveBlockEntityPacket(worldInteraction.blockPos.vector));
}
}
// place
override void onSecondaryActionPress() {
placing = true;
startingPos = worldInteraction.sideBlockPos;
}
override void onSecondaryActionRelease() {
if (placing) {
ulong sizeData = sizeToEntityData(selection.size);
ulong payload = payloadFromIdAndEntityData(
blockEntityMan.getId("multi"), sizeData);
connection.send(PlaceBlockEntityPacket(selection, payload));
placing = false;
}
}
void drawSelection() {
if (placing) {
graphics.debugBatch.putCube(vec3(selection.position) - cursorOffset,
vec3(selection.size) + cursorOffset, Colors.blue, false);
} else {
if (!worldInteraction.cameraInSolidBlock)
{
worldInteraction.drawCursor(worldInteraction.sideBlockPos, Colors.blue);
}
}
}
};
auto editPlugin = pluginman.getPlugin!EditPlugin;
editPlugin.registerTool(entityTool);
}
void showBlockInfo()
{
auto block = worldInteraction.pickBlock();
auto bwp = worldInteraction.blockPos;
auto cwp = ChunkWorldPos(bwp);
if (isBlockEntity(block.id))
{
ushort blockIndex = blockEntityIndexFromBlockId(block.id);
BlockEntityData entity = clientWorld.entityAccess.getBlockEntity(cwp, blockIndex);
with(BlockEntityType) final switch(entity.type)
{
case localBlockEntity:
BlockEntityInfo eInfo = blockEntityInfos[entity.id];
auto entityBwp = BlockWorldPos(cwp, blockIndex);
WorldBox eVol = eInfo.boxHandler(entityBwp, entity);
igTextf("Entity(main): id %s %s ind %s %s",
entity.id, eInfo.name, blockIndex, eVol);
igCheckbox("Debug entity", &blockEntityDebug);
if (blockEntityDebug && eInfo.debugHandler)
{
auto context = BlockEntityDebugContext(entityBwp, entity, graphics);
eInfo.debugHandler(context);
}
putCube(graphics.debugBatch, eVol, Colors.red, false);
break;
case foreignBlockEntity:
auto mainPtr = entity.mainChunkPointer;
auto mainCwp = ChunkWorldPos(ivec3(cwp.xyz) - mainPtr.mainChunkOffset, cwp.w);
BlockEntityData mainEntity = clientWorld.entityAccess.getBlockEntity(mainCwp, mainPtr.blockIndex);
auto mainBwp = BlockWorldPos(mainCwp, mainPtr.blockIndex);
BlockEntityInfo eInfo = blockEntityInfos[mainPtr.entityId];
WorldBox eVol = eInfo.boxHandler(mainBwp, mainEntity);
igTextf("Entity(other): ind %s mid %s mind %s moff %s",
blockIndex, mainPtr.entityId,
mainPtr.blockIndex, mainPtr.mainChunkOffset);
igTextf(" %s %s", eInfo.name, eVol);
putCube(graphics.debugBatch, eVol, Colors.red, false);
break;
//case componentId:
// igTextf("Entity: @%s: entity id %s", blockIndex, entity.payload); break;
}
}
else
{
auto binfo = blockPlugin.getBlocks()[block.id];
igTextf("Block: %s:%s %s", block.id, block.metadata, binfo.name);
}
}
}
final class BlockEntityServer : IPlugin {
mixin IdAndSemverFrom!"voxelman.blockentity.plugininfo";
mixin BlockEntityCommon;
auto dbKey = IoKey("voxelman.blockentity.plugin");
override void registerResources(IResourceManagerRegistry resmanRegistry) {
auto ioman = resmanRegistry.getResourceManager!IoManager;
ioman.registerWorldLoadSaveHandlers(&read, &write);
}
void read(ref PluginDataLoader loader) {
loader.readMapping(dbKey, blockEntityMan.blockEntityMapping);
}
void write(ref PluginDataSaver saver) {
saver.writeMapping(dbKey, blockEntityMan.blockEntityMapping);
}
}
mixin template BlockEntityCommon()
{
override void registerResourceManagers(void delegate(IResourceManager) reg) {
blockEntityMan = new BlockEntityManager;
blockEntityMan.regBlockEntity("unknown") // 0
.boxHandler(&nullBoxHandler);
blockEntityMan.regBlockEntity("multi")
.boxHandler(&multichunkBoxHandler)
.meshHandler(&multichunkMeshHandler)
.blockShapeHandler(&multichunkBlockShapeHandler);
//.debugHandler(&multichunkDebugHandler);
reg(blockEntityMan);
}
BlockEntityManager blockEntityMan;
BlockEntityInfoTable blockEntityInfos() {
return BlockEntityInfoTable(cast(immutable)blockEntityMan.blockEntityMapping.infoArray);
}
}
void multichunkMeshHandler(BlockEntityMeshingData meshingData)
{
static ubvec3 mainColor = ubvec3(60,0,0);
static ubvec3 otherColor = ubvec3(0,0,60);
ubvec3 col;
if (meshingData.data.type == BlockEntityType.localBlockEntity)
col = mainColor;
else
col = otherColor;
auto blockMeshingData = BlockMeshingData(
&meshingData.output[Solidity.solid],
meshingData.occlusionHandler,
col,
ubvec3(meshingData.chunkPos),
meshingData.sides,
meshingData.blockIndex);
import voxelman.world.mesh.blockmeshers.full : makeColoredFullBlockMesh;
makeColoredFullBlockMesh(blockMeshingData);
}
WorldBox multichunkBoxHandler(BlockWorldPos bwp, BlockEntityData data)
{
ulong sizeData = data.entityData;
ivec3 size = entityDataToSize(sizeData);
return WorldBox(bwp.xyz, size, cast(ushort)bwp.w);
}
void multichunkDebugHandler(ref BlockEntityDebugContext context)
{
ulong sizeData = context.data.entityData;
ivec3 size = entityDataToSize(sizeData);
//auto vol = WorldBox(bwp.xyz, size, cast(ushort)bwp.w);
}
BlockShape multichunkBlockShapeHandler(ivec3, ivec3, BlockEntityData) {
return fullShape;
}
|
D
|
/home/bruno/development/RustDataStructures/ReplaceFile/ReplaceFile/target/debug/deps/ReplaceFile-b9efee7caeee6455.rmeta: src/main.rs
/home/bruno/development/RustDataStructures/ReplaceFile/ReplaceFile/target/debug/deps/ReplaceFile-b9efee7caeee6455.d: src/main.rs
src/main.rs:
|
D
|
// Copyright (C) 2002-2013 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" for the D programming language.
// For conditions of distribution and use, see copyright notice in irrlicht.d module.
module irrlicht.scene.IMetaTriangleSelector;
import irrlicht.scene.ITriangleSelector;
/// Interface for making multiple triangle selectors work as one big selector.
/**
* This is nothing more than a collection of one or more triangle selectors
* providing together the interface of one triangle selector. In this way,
* collision tests can be done with different triangle soups in one pass.
*/
interface IMetaTriangleSelector : ITriangleSelector
{
/// Adds a triangle selector to the collection of triangle selectors.
/**
* Params:
* toAdd= Pointer to an triangle selector to add to the list.
*/
void addTriangleSelector(ITriangleSelector toAdd);
/// Removes a specific triangle selector from the collection.
/**
* Params:
* toRemove= Pointer to an triangle selector which is in the
* list but will be removed.
* Returns: True if successful, false if not.
*/
bool removeTriangleSelector(ITriangleSelector toRemove);
/// Removes all triangle selectors from the collection.
void removeAllTriangleSelectors();
}
|
D
|
module forcecalculator;
import std.math;
import std.stdio;
import inmath.linalg;
import components.collider;
import components.input;
import entity;
import integrator.state;
import playereventhandler;
double calculateTorque(State state, double time) pure nothrow @nogc
out (result)
{
assert(!result.isNaN);
}
do
{
//import std.stdio;
//debug writeln("calculateTorque for ", state.entity.id, " begin");
//auto torque = 0.0;
double torque = state.torque;
//torque += state.rotation * -0.2; // damping torque
//if (state.entity.input)
//state.entity.input.handlePlayerRotateActions(torque);
// torque from collisions
/*if (auto collider = state.entity.collider)
{
if (collider.isColliding)
{
auto position = state.entity.get!vec3("position");
auto relative = collider.contactPoint - position;
//writeln("calc cross from collider force ", collider.force, " and rel pos ", relative);
auto cross = collider.force.x * relative.y - collider.force.y * relative.x;
//writeln("calc torque from contactpoint ", collider.contactPoint, " with torque ", cross);
torque -= cross;
}
}*/
//debug writeln("calculateTorque for ", state.entity.id, " end");
return torque;
}
vec3 calculateForce(State state, double time) pure nothrow @nogc
out (result)
{
assert(result.isFinite);
}
do
{
//import std.stdio;
//debug writeln("calculateForce for ", state.entity.id, " begin");
auto force = state.force; //vec2(0.0, 0.0);
force += state.position * -0.025; // spring force to center
force += state.velocity * -0.05; // damping force
/*
// twisty clockwise force close to center
auto normalPos = vec3(state.position.y, -state.position.x, 0.0);
if (normalPos.length() > 0.0)
force += normalPos.normalized() * ((1.0 / (normalPos.length() + 0.1)) ^^2) * 0.05;
// twisty counterclockwise force further out
force += vec3(-state.position.y, state.position.x, 0.0) * 0.015;
*/
//if (state.entity.input)
//state.entity.input.handlePlayerAccelerateActions(force, state.angle);
// force from collisions
/*if (auto collision = state.entity.collider)
{
if (collision.isColliding)
{
//force -= collision.force;
}
}*/
// clamp force magnitude
if (force.length > 1_000_000)
force = force.normalized * 1_000_000;
return force;
}
|
D
|
/**
* This module provides class for loading and validating icon theme caches.
*
* Icon theme cache may be stored in icon-theme.cache files located in icon theme directory along with index.theme file.
* These files are usually generated by $(LINK2 https://developer.gnome.org/gtk3/stable/gtk-update-icon-cache.html, gtk-update-icon-cache).
* Icon theme cache can be used for faster and cheeper lookup of icons since it contains information about which icons exist in which sub directories.
*
* Authors:
* $(LINK2 https://github.com/FreeSlave, Roman Chistokhodov)
* Copyright:
* Roman Chistokhodov, 2016
* License:
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* See_Also:
* $(LINK2 https://github.com/GNOME/gtk/blob/master/gtk/gtkiconcachevalidator.c, GTK icon cache validator source code)
* Note:
* It seems to be no any specification on icon theme cache, so this module is written using gtk source code as reference to reimplement parsing of icon-theme.cache files.
*/
module icontheme.cache;
package {
import std.algorithm;
import std.bitmanip;
import std.exception;
import std.file;
import std.mmfile;
import std.path;
import std.range;
import std.system;
import std.typecons;
import std.traits;
import std.datetime : SysTime;
}
/**
* Error occured while parsing icon theme cache.
*/
class IconThemeCacheException : Exception
{
this(string msg, string context = null, string file = __FILE__, size_t line = __LINE__, Throwable next = null) pure nothrow @safe {
super(msg, file, line, next);
_context = context;
}
/**
* Context where error occured. Usually it's the name of value that could not be read or is invalid.
*/
@nogc @safe string context() const nothrow {
return _context;
}
private:
string _context;
}
/**
* Class representation of icon-theme.cache file contained icon theme cache.
*/
final class IconThemeCache
{
/**
* Read icon theme cache from memory mapped file and validate it.
* Throws:
* $(B FileException) if could not mmap file.
* $(D IconThemeCacheException) if icon theme file is invalid.
*/
@trusted this(string fileName) {
_mmapped = new MmFile(fileName);
this(_mmapped[], fileName, 0);
}
/**
* Read icon theme cache from data and validate it.
* Throws:
* $(D IconThemeCacheException) if icon theme file is invalid.
*/
@safe this(immutable(void)[] data, string fileName) {
this(data, fileName, 0);
}
private @trusted this(const(void)[] data, string fileName, int /* To avoid ambiguity */) {
_data = data;
_fileName = fileName;
_header.majorVersion = readValue!ushort(0, "major version");
if (_header.majorVersion != 1) {
throw new IconThemeCacheException("Unsupported version or the file is not icon theme cache", "major version");
}
_header.minorVersion = readValue!ushort(2, "minor version");
if (_header.minorVersion != 0) {
throw new IconThemeCacheException("Unsupported version or the file is not icon theme cache", "minor version");
}
_header.hashOffset = readValue!uint(4, "hash offset");
_header.directoryListOffset = readValue!uint(8, "directory list offset");
_bucketCount = iconOffsets().length;
_directoryCount = directories().length;
//Validate other data
foreach(dir; directories()) {
//pass
}
foreach(info; iconInfos) {
foreach(im; imageInfos(info.imageListOffset)) {
}
}
}
/**
* Sub directories of icon theme listed in cache.
* Returns: Range of directory const(char)[] names listed in cache.
*/
@trusted auto directories() const {
auto directoryCount = readValue!uint(_header.directoryListOffset, "directory count");
return iota(directoryCount)
.map!(i => _header.directoryListOffset + uint.sizeof + i*uint.sizeof)
.map!(offset => readValue!uint(offset, "directory offset"))
.map!(offset => readString(offset, "directory name"));
}
/**
* Test if icon is listed in cache.
*/
@trusted bool containsIcon(const(char)[] iconName) const
{
IconInfo info;
return findIconInfo(info, iconName);
}
/**
* Test if icon is listed in cache and belongs to specified subdirectory.
*/
@trusted bool containsIcon(const(char)[] iconName, const(char)[] directory) const {
auto index = iconDirectories(iconName).countUntil(directory);
return index != -1;
}
/**
* Find all sub directories the icon belongs to according to cache.
* Returns: Range of directory const(char)[] names the icon belongs to.
*/
@trusted auto iconDirectories(const(char)[] iconName) const
{
IconInfo info;
auto dirs = directories();
bool found = findIconInfo(info, iconName);
return imageInfos(info.imageListOffset, found).map!(delegate(ImageInfo im) {
if (im.index < dirs.length) {
return dirs[im.index];
} else {
throw new IconThemeCacheException("Invalid directory index", "directory index");
}
});
}
/**
* Path of cache file.
*/
@nogc @safe string fileName() const nothrow {
return _fileName;
}
/**
* Test if icon theme file is outdated, i.e. modification time of cache file is older than modification time of icon theme directory.
* Throws:
* $(B FileException) on error accessing the file.
*/
@trusted bool isOutdated() const {
return isOutdated(fileName());
}
/**
* Test if icon theme file is outdated, i.e. modification time of cache file is older than modification time of icon theme directory.
*
* This function is static and therefore can be used before actual reading and validating cache file.
* Throws:
* $(B FileException) on error accessing the file.
*/
static @trusted bool isOutdated(string fileName)
{
if (fileName.empty) {
throw new FileException("File name is empty, can't check if the cache is outdated");
}
SysTime pathAccessTime, pathModificationTime;
SysTime fileAccessTime, fileModificationTime;
getTimes(fileName, fileAccessTime, fileModificationTime);
getTimes(fileName.dirName, pathAccessTime, pathModificationTime);
return fileModificationTime < pathModificationTime;
}
unittest
{
assertThrown!FileException(isOutdated(""));
}
/**
* All icon names listed in cache.
* Returns: Range of icon const(char)[] names listed in cache.
*/
@trusted auto icons() const {
return iconInfos().map!(info => info.name);
}
private:
alias Tuple!(uint, "chainOffset", const(char)[], "name", uint, "imageListOffset") IconInfo;
alias Tuple!(ushort, "index", ushort, "flags", uint, "dataOffset") ImageInfo;
static struct IconThemeCacheHeader
{
ushort majorVersion;
ushort minorVersion;
uint hashOffset;
uint directoryListOffset;
}
@trusted auto iconInfos() const {
import std.typecons;
static struct IconInfos
{
this(const(IconThemeCache) cache)
{
_cache = rebindable(cache);
_iconInfos = _cache.bucketIconInfos();
_chainOffset = _iconInfos.front().chainOffset;
_fromChain = false;
}
bool empty()
{
return _iconInfos.empty;
}
auto front()
{
if (_fromChain) {
auto info = _cache.iconInfo(_chainOffset);
return info;
} else {
auto info = _iconInfos.front;
return info;
}
}
void popFront()
{
if (_fromChain) {
auto info = _cache.iconInfo(_chainOffset);
if (info.chainOffset != 0xffffffff) {
_chainOffset = info.chainOffset;
} else {
_iconInfos.popFront();
_fromChain = false;
}
} else {
auto info = _iconInfos.front;
if (info.chainOffset != 0xffffffff) {
_chainOffset = info.chainOffset;
_fromChain = true;
} else {
_iconInfos.popFront();
}
}
}
auto save() const {
return this;
}
uint _chainOffset;
bool _fromChain;
typeof(_cache.bucketIconInfos()) _iconInfos;
Rebindable!(const(IconThemeCache)) _cache;
}
return IconInfos(this);
}
@nogc @trusted static uint iconNameHash(const(char)[] iconName) pure nothrow
{
if (iconName.length == 0) {
return 0;
}
uint h = cast(uint)iconName[0];
if (h) {
for (size_t i = 1; i != iconName.length; i++) {
h = (h << 5) - h + cast(uint)iconName[i];
}
}
return h;
}
bool findIconInfo(out IconInfo info, const(char)[] iconName) const {
uint hash = iconNameHash(iconName) % _bucketCount;
uint chainOffset = readValue!uint(_header.hashOffset + uint.sizeof + uint.sizeof * hash, "chain offset");
while(chainOffset != 0xffffffff) {
auto curInfo = iconInfo(chainOffset);
if (curInfo.name == iconName) {
info = curInfo;
return true;
}
chainOffset = curInfo.chainOffset;
}
return false;
}
@trusted auto bucketIconInfos() const {
return iconOffsets().filter!(offset => offset != 0xffffffff).map!(offset => iconInfo(offset));
}
@trusted auto iconOffsets() const {
auto bucketCount = readValue!uint(_header.hashOffset, "bucket count");
return iota(bucketCount)
.map!(i => _header.hashOffset + uint.sizeof + i*uint.sizeof)
.map!(offset => readValue!uint(offset, "icon offset"));
}
@trusted auto iconInfo(size_t iconOffset) const {
return IconInfo(
readValue!uint(iconOffset, "icon chain offset"),
readString(readValue!uint(iconOffset + uint.sizeof, "icon name offset"), "icon name"),
readValue!uint(iconOffset + uint.sizeof*2, "image list offset"));
}
@trusted auto imageInfos(size_t imageListOffset, bool found = true) const {
uint imageCount = found ? readValue!uint(imageListOffset, "image count") : 0;
return iota(imageCount)
.map!(i => imageListOffset + uint.sizeof + i*(uint.sizeof + ushort.sizeof + ushort.sizeof))
.map!(offset => ImageInfo(
readValue!ushort(offset, "image index"),
readValue!ushort(offset + ushort.sizeof, "image flags"),
readValue!uint(offset + ushort.sizeof*2, "image data offset"))
);
}
@trusted T readValue(T)(size_t offset, string context = null) const if (isIntegral!T || isSomeChar!T)
{
if (_data.length >= offset + T.sizeof) {
T value = *(cast(const(T)*)_data[offset..(offset+T.sizeof)].ptr);
static if (endian == Endian.littleEndian) {
value = swapEndian(value);
}
return value;
} else {
throw new IconThemeCacheException("Value is out of bounds", context);
}
}
@trusted auto readString(size_t offset, string context = null) const {
if (offset > _data.length) {
throw new IconThemeCacheException("Beginning of string is out of bounds", context);
}
auto str = cast(const(char[]))_data[offset.._data.length];
size_t len = 0;
while (len<str.length && str[len] != '\0') {
++len;
}
if (len == str.length) {
throw new IconThemeCacheException("String is not zero terminated", context);
}
return str[0..len];
}
IconThemeCacheHeader _header;
size_t _directoryCount;
size_t _bucketCount;
MmFile _mmapped;
string _fileName;
const(void)[] _data;
}
///
version(iconthemeFileTest) unittest
{
string cachePath = "./test/Tango/icon-theme.cache";
assert(cachePath.exists);
const(IconThemeCache) cache = new IconThemeCache(cachePath);
assert(cache.fileName == cachePath);
assert(cache.containsIcon("folder"));
assert(cache.containsIcon("folder", "24x24/places"));
assert(cache.containsIcon("edit-copy", "32x32/actions"));
assert(cache.iconDirectories("text-x-generic").canFind("32x32/mimetypes"));
assert(cache.directories().canFind("32x32/devices"));
auto icons = cache.icons();
assert(icons.canFind("folder"));
assert(icons.canFind("text-x-generic"));
try {
SysTime pathAccessTime, pathModificationTime;
SysTime fileAccessTime, fileModificationTime;
getTimes(cachePath, fileAccessTime, fileModificationTime);
getTimes(cachePath.dirName, pathAccessTime, pathModificationTime);
setTimes(cachePath, pathAccessTime, pathModificationTime);
assert(!IconThemeCache.isOutdated(cachePath));
}
catch(Exception e) {
// some environmental error, just ignore
}
try {
auto fileData = assumeUnique(std.file.read(cachePath));
assertNotThrown(new IconThemeCache(fileData, cachePath));
} catch(FileException e) {
}
immutable(ubyte)[] data = [0,2,0,0];
IconThemeCacheException thrown = collectException!IconThemeCacheException(new IconThemeCache(data, cachePath));
assert(thrown !is null, "Invalid cache must throw");
assert(thrown.context == "major version");
data = [0,1,0,1];
thrown = collectException!IconThemeCacheException(new IconThemeCache(data, cachePath));
assert(thrown !is null, "Invalid cache must throw");
assert(thrown.context == "minor version");
}
|
D
|
# FIXED
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/wolfmqtt-0.13.0/src/mqtt_packet.c
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_packet.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_types.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/wolfmqtt-0.13.0/wolfmqtt/visibility.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdio.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/linkage.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdarg.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/string.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdlib.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/string.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdio.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_socket.h
wolfmqtt-0.13.0/src/mqtt_packet.obj: C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_client.h
C:/ti/wolfmqtt-0.13.0/src/mqtt_packet.c:
C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_packet.h:
C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_types.h:
C:/ti/wolfmqtt-0.13.0/wolfmqtt/visibility.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdio.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/linkage.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdarg.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/string.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdlib.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/string.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdio.h:
C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_socket.h:
C:/ti/wolfmqtt-0.13.0/wolfmqtt/mqtt_client.h:
|
D
|
instance STRF_1132_Addon_Sklave(Npc_Default)
{
name[0] = NAME_Addon_Sklave;
guild = GIL_STRF;
id = 1132;
voice = 3;
flags = 0;
npcType = npctype_main;
aivar[AIV_NoFightParker] = TRUE;
aivar[AIV_IgnoresArmor] = TRUE;
B_SetAttributesToChapter(self,2);
fight_tactic = FAI_HUMAN_COWARD;
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_N_OldBald_Jeremiah,BodyTex_N,ITAR_Prisoner);
Mdl_SetModelFatness(self,-1);
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,10);
daily_routine = Rtn_Start_1132;
};
func void Rtn_Start_1132()
{
TA_Stand_WP(8,0,23,0,"ADW_MINE_SKLAVENTOD_02");
TA_Stand_WP(23,0,8,0,"ADW_MINE_SKLAVENTOD_02");
};
|
D
|
module game.replay.replay;
/* Replay: Holds all history for a game, but not the physical map.
*
* The game relies on the players in the replay to map PlNrs to Styles.
* The game or the game's Nurse uses the Style to look up the Tribe.
* The Tribe is a team, and the game thinks in terms of Tribes, not PlNrs.
*/
import core.stdc.string; // memmove
import std.array;
import std.algorithm; // isSorted
import std.range;
public import net.ac;
public import net.style;
import basics.help; // array.len of type int
import net.repdata;
import net.permu;
import net.versioning;
import game.replay.io;
import file.date;
import file.filename;
import level.level;
import level.metadata;
struct FirstDifference {
bool thisBeginsWithRhs;
bool rhsBeginsWithThis;
Phyu firstDifferenceIfMismatch;
@property bool mismatch() const
{
return ! thisBeginsWithRhs && ! rhsBeginsWithThis;
}
}
class Replay {
static struct Player {
Style style;
string name;
}
package:
Version _gameVersionRequired;
Player[PlNr] _players;
Permu _permu; // contains natural numbers [0 .. #players[, not the plNrs
ReplayData[] _data;
PlNr _plNrLocal;
bool _hasLocal; // if false, all players were observed netplayers
public:
Date levelBuiltRequired;
Filename levelFilename;
static newForLevel(Filename levFn, Date levBuilt)
{
return new this(levFn, levBuilt, null);
}
static loadFromFile(Filename loadFrom)
{
return new this(null, null, loadFrom);
}
auto clone() const { return new Replay(this); }
this(in typeof(this) rhs)
{
_gameVersionRequired = rhs._gameVersionRequired;
levelBuiltRequired = rhs.levelBuiltRequired;
levelFilename = rhs.levelFilename;
_plNrLocal = rhs._plNrLocal;
_hasLocal = rhs._hasLocal;
_permu = rhs._permu.clone();
_data = rhs._data.dup;
assert (! _players.length);
rhs._players.byKeyValue.each!(a => _players[a.key] = a.value);
}
private:
this(Filename levFn, Date levBuilt, Filename loadFrom)
{
touch();
_permu = new Permu("0");
if (loadFrom) {
auto loaded = this.implLoadFromFile(loadFrom);
levelFilename = loaded.levelFilename;
levelBuiltRequired = loaded.levelBuiltRequired;
}
else {
levelFilename = levFn;
levelBuiltRequired = levBuilt;
}
}
public:
@property gameVersionRequired() const { return _gameVersionRequired; }
@property const(Player[PlNr]) players() const { return _players; }
@property int numPlayers() const { return _players.length & 0x7FFF_FFFF; }
@property const(Permu) permu() const { return _permu; }
@property Permu permu(Permu p) { _permu = p; return p; }
@property bool empty() const
{
return _data.length == 0 && _players.length == 0;
}
@property int latestPhyu() const
{
return (_data.length > 0) ? _data[$-1].update : 0;
}
@property bool hasLocal() const { return _hasLocal; }
@property PlNr plNrLocalOrSmallest() const
{
if (_hasLocal) {
assert (_plNrLocal in _players);
return _plNrLocal;
}
return _players.byKey.reduce!min;
}
@property Player playerLocalOrSmallest() const
{
return _players[plNrLocalOrSmallest];
}
@property string styleToNames(in Style st) const
{
auto range = _players.byValue.filter!(p => p.style == st)
.map!(p => p.name);
switch (range.walkLength) {
case 0: return "";
case 1: return range.front;
default: return range.join(", ");
}
}
Style plNrToStyle(in PlNr plNr) const
{
if (auto pl = plNr in _players)
return pl.style;
return Style.garden;
}
Style[] stylesInUse() const
{
Style[] ret;
foreach (style; _players.byValue.map!(pl => pl.style))
if (! ret.canFind(style))
ret ~= style;
ret.sort();
return ret;
}
void touch()
{
_gameVersionRequired = gameVersion();
}
void addPlayer(PlNr nr, Style s, string name, in bool local)
{
if (nr in _players)
return;
_players[nr] = Player(s, name);
if (local && ! _hasLocal) {
_hasLocal = true;
_plNrLocal = nr;
}
}
// This should only be useful while you alter already-existing
// singleplayer replays. When you cut the replay, call this too
void setPlayerLocalName(string aName)
{
auto ptr = _plNrLocal in _players;
if (! ptr)
return;
touch();
ptr.name = aName;
}
// This doesn't check whether the metadata/general data is the same.
// We assume that Game only calls this on replays of the same level.
// Returns the inner struct, check its fields. E.g., to test if (this)
// replay is subset of (rhs): this.firstDifference(rhs).thisIsSubsetOfRhs.
// The subset relation is not proper: this is a subset of this.
auto firstDifference(in Replay rhs) const
{
assert (rhs !is null);
for (size_t i = 0; i < _data.length && i < rhs._data.length; ++i)
if (_data[i] != rhs._data[i])
return FirstDifference(false, false,
min(_data[i].update, rhs._data[i].update));
return FirstDifference(_data.length <= rhs._data.length,
_data.length >= rhs._data.length);
}
// this function is necessary to keep old replays working in new versions
// that skip the first 30 or so updates, to get into the action faster.
// The first spawn is still at update 60.
void increaseEarlyDataToPhyu(in Phyu upd)
{
foreach (ref d; _data) {
if (d.update < upd)
d.update = upd;
else break;
}
// This doesn't call touch().
}
void eraseEarlySingleplayerNukes()
{
// Game updates nukes, then spawns, then lix perform.
enum beforePhyu = 61; // Not 60, only nuke if it kills lix.
if (_players.length > 1)
return;
for (int i = 0; i < _data.length; ++i) {
if (_data[i].update >= beforePhyu)
break;
else if (_data[i].action == RepAc.NUKE) {
_data = _data[0 .. i] ~ _data[i+1 .. $];
--i;
}
}
// doesn't call touch(), because it's housekeeping
}
void deleteAfterPhyu(in Phyu upd)
{
assert (upd >= 0);
_data = _data[0 .. dataSliceBeforePhyu(Phyu(upd + 1)).length];
touch();
}
const(ReplayData)[] getDataForPhyu(in Phyu upd) const
{
auto slice = dataSliceBeforePhyu(Phyu(upd + 1));
int firstGood = slice.len;
while (firstGood > 0 && slice[firstGood - 1].update == upd)
--firstGood;
assert (firstGood >= 0);
assert (firstGood <= slice.length);
return _data[firstGood .. slice.length];
}
bool getOnPhyuLixClicked(in Phyu upd, in int lix_id, in Ac ac) const
{
auto vec = getDataForPhyu(upd);
foreach (const ref d; vec)
if (d.isSomeAssignment && d.toWhichLix == lix_id && d.skill == ac)
return true;
return false;
}
void add(in ReplayData d)
{
touch();
this.addWithoutTouching(d);
}
void saveAsAutoReplay(in Level lev, bool solves) const
{
this.implSaveAsAutoReplay(lev, solves);
}
void saveManually(in Level lev) const
{
this.implSaveManually(lev);
}
package:
inout(ReplayData)[] dataSliceBeforePhyu(in Phyu upd) inout
{
// The binary search algo works also for this case.
// But we add mostly to the end of the data, so check here for speed.
if (_data.length == 0 || _data[$-1].update < upd)
return _data;
int bot = 0; // first too-large is at a higher position
int top = _data.len; // first too-large is here or at a lower position
while (top != bot) {
int bisect = (top + bot) / 2;
assert (bisect >= 0 && bisect < _data.len);
assert (bisect >= bot && bisect < top);
if (_data[bisect].update < upd)
bot = bisect + 1;
if (_data[bisect].update >= upd)
top = bisect;
}
return _data[0 .. bot];
}
void addWithoutTouching(in ReplayData d)
{
// Add after the latest record that's smaller than or equal to d
// Equivalently, add before the earliest record that's greater than d.
// dataSliceBeforePhyu doesn't do exactly that, it ignores players.
// DTODO: I believe the C++ version had a bug in the choice of
// comparison. I have fixed that here. Test to see if it's good now.
auto slice = dataSliceBeforePhyu(Phyu(d.update + 1));
while (slice.length && slice[$-1] > d)
slice = slice[0 .. $-1];
if (slice.length < _data.length) {
_data.length += 1;
memmove(&_data[slice.length + 1], &_data[slice.length],
ReplayData.sizeof * (_data.length - slice.length - 1));
_data[slice.length] = d;
}
else {
_data ~= d;
}
assert (_data.isSorted);
}
}
|
D
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkGhostArray;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import vtkObject;
class vtkGhostArray : vtkObject.vtkObject {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkGhostArray_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkGhostArray obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new object.Exception("C++ destructor does not have public access");
}
swigCPtr = null;
super.dispose();
}
}
}
enum {
INTERNAL = 0,
SHARED = 1,
GHOST = 2,
VOID = 3,
IGNORE = 4,
BOUNDARY = 5,
PERIODIC = 6
}
enum {
DUPLICATE = 0,
EXTERNAL = 1,
BLANK = 2,
INTERIOR = 3
}
public void NodeProperties(int value) @property {
vtkd_im.vtkGhostArray_NodeProperties_set(cast(void*)swigCPtr, value);
}
public int NodeProperties() @property const {
auto ret = vtkd_im.vtkGhostArray_NodeProperties_get(cast(void*)swigCPtr);
return ret;
}
public void CellProperties(int value) @property {
vtkd_im.vtkGhostArray_CellProperties_set(cast(void*)swigCPtr, value);
}
public int CellProperties() @property const {
auto ret = vtkd_im.vtkGhostArray_CellProperties_get(cast(void*)swigCPtr);
return ret;
}
public static vtkGhostArray New() {
void* cPtr = vtkd_im.vtkGhostArray_New();
vtkGhostArray ret = (cPtr is null) ? null : new vtkGhostArray(cPtr, false);
return ret;
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkGhostArray_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkGhostArray SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkGhostArray_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkGhostArray ret = (cPtr is null) ? null : new vtkGhostArray(cPtr, false);
return ret;
}
public vtkGhostArray NewInstance() const {
void* cPtr = vtkd_im.vtkGhostArray_NewInstance(cast(void*)swigCPtr);
vtkGhostArray ret = (cPtr is null) ? null : new vtkGhostArray(cPtr, false);
return ret;
}
alias vtkObject.vtkObject.NewInstance NewInstance;
public static void SetProperty(ubyte* propertyField, int property) {
vtkd_im.vtkGhostArray_SetProperty(cast(void*)propertyField, property);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public static void UnsetProperty(ubyte* propertyField, int property) {
vtkd_im.vtkGhostArray_UnsetProperty(cast(void*)propertyField, property);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public static bool IsPropertySet(ubyte* propertyField, int property) {
bool ret = vtkd_im.vtkGhostArray_IsPropertySet(cast(void*)propertyField, property) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
public static void Reset(ubyte* propertyField) {
vtkd_im.vtkGhostArray_Reset(cast(void*)propertyField);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
}
|
D
|
instance DIA_Igaranz_Kap1_EXIT(C_Info)
{
npc = NOV_601_Igaraz;
nr = 999;
condition = DIA_Igaraz_Kap1_EXIT_Condition;
information = DIA_Igaraz_Kap1_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Igaraz_Kap1_EXIT_Condition()
{
if(Kapitel == 1)
{
return TRUE;
};
};
func void DIA_Igaraz_Kap1_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Igaranz_Hello(C_Info)
{
npc = NOV_601_Igaraz;
nr = 2;
condition = DIA_Igaraz_Hello_Condition;
information = DIA_Igaraz_Hello_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Igaraz_Hello_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (self.aivar[AIV_TalkedToPlayer] == FALSE) && (KNOWS_FIRE_CONTEST == FALSE))
{
return TRUE;
};
};
func void DIA_Igaraz_Hello_Info()
{
if(other.guild == GIL_NOV)
{
AI_Output(self,other,"DIA_Igaranz_Hello_13_00"); //What can I do for you, Brother?
}
else
{
AI_Output(self,other,"DIA_Igaranz_Hello_13_01"); //What can I do for you?
};
};
instance DIA_Igaraz_Wurst(C_Info)
{
npc = NOV_601_Igaraz;
nr = 2;
condition = DIA_Igaraz_Wurst_Condition;
information = DIA_Igaraz_Wurst_Info;
permanent = FALSE;
description = "I'm busy distributing sausages.";
};
func int DIA_Igaraz_Wurst_Condition()
{
if((Kapitel == 1) && (MIS_GoraxEssen == LOG_Running) && (Npc_HasItems(self,ItFo_Schafswurst) == 0) && (Npc_HasItems(other,ItFo_Schafswurst) >= 1))
{
return TRUE;
};
};
func void DIA_Igaraz_Wurst_Info()
{
var string NovizeText;
var string NovizeLeft;
AI_Output(other,self,"DIA_Igaraz_Wurst_15_00"); //I'm busy distributing sausages.
AI_Output(self,other,"DIA_Igaraz_Wurst_13_01"); //So you work for Gorax, huh? All right, pass the sausage, then.
B_GiveInvItems(other,self,ItFo_Schafswurst,1);
Wurst_Gegeben = Wurst_Gegeben + 1;
CreateInvItems(self,ItFo_Sausage,1);
B_UseItem(self,ItFo_Sausage);
NovizeLeft = IntToString(13 - Wurst_Gegeben);
NovizeText = ConcatStrings(NovizeLeft,PRINT_NovizenLeft);
AI_PrintScreen(NovizeText,-1,YPOS_GoldGiven,FONT_ScreenSmall,2);
};
instance DIA_Igaranz_NotWork(C_Info)
{
npc = NOV_601_Igaraz;
nr = 3;
condition = DIA_Igaraz_NotWork_Condition;
information = DIA_Igaraz_NotWork_Info;
permanent = FALSE;
description = "Why aren't you working?";
};
func int DIA_Igaraz_NotWork_Condition()
{
if((Npc_GetDistToWP(self,"NW_MONASTERY_GRASS_01") <= 500) && (KNOWS_FIRE_CONTEST == FALSE) && (other.guild == GIL_NOV))
{
return TRUE;
};
};
func void DIA_Igaraz_NotWork_Info()
{
AI_Output(other,self,"DIA_Igaranz_NotWork_15_00"); //Why aren't you working?
AI_Output(self,other,"DIA_Igaranz_NotWork_13_01"); //I am permitted to study the teachings of Innos. I seek wisdom in his words.
AI_Output(self,other,"DIA_Igaranz_NotWork_13_02"); //One day he will choose me - and then I shall take the test of magic and enter the Circle of Fire.
};
instance DIA_Igaranz_Choosen(C_Info)
{
npc = NOV_601_Igaraz;
nr = 2;
condition = DIA_Igaraz_Choosen_Condition;
information = DIA_Igaraz_Choosen_Info;
permanent = TRUE;
description = "Who are the Chosen?";
};
func int DIA_Igaraz_Choosen_Condition()
{
if(Npc_KnowsInfo(other,DIA_Igaranz_NotWork) && (Npc_GetDistToWP(self,"NW_MONASTERY_GRASS_01") <= 500) && (KNOWS_FIRE_CONTEST == FALSE) && (hero.guild == GIL_NOV))
{
return TRUE;
};
};
func void DIA_Igaraz_Choosen_Info()
{
AI_Output(other,self,"DIA_Igaranz_Choosen_15_00"); //Who are the Chosen?
AI_Output(self,other,"DIA_Igaranz_Choosen_13_01"); //The novices whom Innos has ordained to take the test of magic.
AI_Output(self,other,"DIA_Igaranz_Choosen_13_02"); //He who passes it is accepted into the ranks of the Magicians of Fire.
Info_ClearChoices(DIA_Igaranz_Choosen);
Info_AddChoice(DIA_Igaranz_Choosen,Dialog_Back,DIA_Igaranz_Choosen_back);
Info_AddChoice(DIA_Igaranz_Choosen,"What is the Test of Magic?",DIA_Igaranz_Choosen_TestOfMagic);
Info_AddChoice(DIA_Igaranz_Choosen,"How can I be chosen?",DIA_Igaranz_Choosen_HowChoosen);
};
func void DIA_Igaranz_Choosen_back()
{
Info_ClearChoices(DIA_Igaranz_Choosen);
};
func void DIA_Igaranz_Choosen_TestOfMagic()
{
AI_Output(other,self,"DIA_Igaranz_Choosen_TestOfMagic_15_00"); //What is the Test of Magic?
AI_Output(self,other,"DIA_Igaranz_Choosen_TestOfMagic_13_01"); //A test which is announced by the high council to all chosen novices.
AI_Output(self,other,"DIA_Igaranz_Choosen_TestOfMagic_13_02"); //It is an assignment in which faith and cleverness are put to the test.
AI_Output(self,other,"DIA_Igaranz_Choosen_TestOfMagic_13_03"); //All the chosen novices take part - but it is only possible for one of them to complete it successfully.
};
func void DIA_Igaranz_Choosen_HowChoosen()
{
AI_Output(other,self,"DIA_Igaranz_Choosen_HowChoosen_15_00"); //How can I be chosen?
AI_Output(self,other,"DIA_Igaranz_Choosen_HowChoosen_13_01"); //You have no influence on that. Innos alone chooses his novices, and the High Council announces his will.
};
instance DIA_Igaranz_StudyInnos(C_Info)
{
npc = NOV_601_Igaraz;
nr = 2;
condition = DIA_Igaraz_StudyInnos_Condition;
information = DIA_Igaraz_StudyInnos_Info;
permanent = FALSE;
description = "How can I study the scriptures?";
};
func int DIA_Igaraz_StudyInnos_Condition()
{
if(Npc_KnowsInfo(other,DIA_Igaranz_NotWork) && (Npc_GetDistToWP(self,"NW_MONASTERY_GRASS_01") <= 500) && (Parlan_Erlaubnis == FALSE) && (other.guild == GIL_NOV))
{
return TRUE;
};
};
func void DIA_Igaraz_StudyInnos_Info()
{
AI_Output(other,self,"DIA_Igaranz_StudyInnos_15_00"); //How can I study the scriptures?
AI_Output(self,other,"DIA_Igaranz_StudyInnos_13_01"); //You must gain access to the library.
AI_Output(self,other,"DIA_Igaranz_StudyInnos_13_02"); //However, Master Parlan will only give you the key if you have first finished your duties.
};
instance DIA_Igaraz_IMTHEMAN(C_Info)
{
npc = NOV_601_Igaraz;
nr = 2;
condition = DIA_Igaraz_IMTHEMAN_Condition;
information = DIA_Igaraz_IMTHEMAN_Info;
important = TRUE;
};
func int DIA_Igaraz_IMTHEMAN_Condition()
{
if((Npc_GetDistToWP(self,"NW_TAVERNE_TROLLAREA_05") <= 3500) && Npc_IsInState(self,ZS_Talk) && (other.guild == GIL_NOV))
{
return TRUE;
};
};
func void DIA_Igaraz_IMTHEMAN_Info()
{
AI_Output(self,other,"DIA_Igaraz_IMTHEMAN_13_00"); //(proudly) It has happened. Innos has chosen me and I shall take part in the test of magic.
};
instance DIA_Igaraz_METOO(C_Info)
{
npc = NOV_601_Igaraz;
nr = 19;
condition = DIA_Igaraz_METOO_Condition;
information = DIA_Igaraz_METOO_Info;
permanent = FALSE;
description = "I'm in it, too ...";
};
var int DIA_Igaraz_METOO_NOPERM;
func int DIA_Igaraz_METOO_Condition()
{
if((Npc_GetDistToWP(self,"NW_TAVERNE_TROLLAREA_05") <= 3500) && (other.guild == GIL_NOV))
{
return TRUE;
};
};
func void DIA_Igaraz_METOO_Info()
{
AI_Output(other,self,"DIA_Igaraz_METOO_15_00"); //I'm in it, too - I demanded the Test of Fire.
AI_Output(self,other,"DIA_Igaraz_METOO_13_01"); //You did WHAT? So either you are a favorite of Innos, or completely crazy.
AI_Output(other,self,"DIA_Igaraz_METOO_15_02"); //I've already done a lot of crazy things, so I'm positive I can pull this off, too ...
AI_Output(self,other,"DIA_Igaraz_METOO_13_03"); //Innos holds his hand over me - therefore I shall pass this test.
Info_ClearChoices(DIA_Igaraz_METOO);
Info_AddChoice(DIA_Igaraz_METOO,Dialog_Back,DIA_Igaraz_METOO_BACK);
Info_AddChoice(DIA_Igaraz_METOO,"Maybe we could work together ...",DIA_Igaraz_METOO_HELP);
Info_AddChoice(DIA_Igaraz_METOO,"So, found anything out yet?",DIA_Igaraz_METOO_TELL);
Info_AddChoice(DIA_Igaraz_METOO,"Have you seen Agon or Ulf?",DIA_Igaraz_METOO_AGON);
};
func void DIA_Igaraz_METOO_BACK()
{
Info_ClearChoices(DIA_Igaraz_METOO);
};
func void DIA_Igaraz_METOO_TELL()
{
AI_Output(other,self,"DIA_Igaraz_METOO_TELL_15_00"); //And, found out anything yet?
AI_Output(self,other,"DIA_Igaraz_METOO_TELL_13_01"); //Since you stand no chance anyway, I may as well tell you:
AI_Output(self,other,"DIA_Igaraz_METOO_TELL_13_02"); //Don't bother looking near the farms - there is nothing there that will get you anywhere.
};
func void DIA_Igaraz_METOO_HELP()
{
AI_Output(other,self,"DIA_Igaraz_METOO_HELP_15_00"); //Maybe we could work together ...
AI_Output(self,other,"DIA_Igaraz_METOO_HELP_13_01"); //Forget it. I'll accomplish this mission alone. You would just be a hindrance to me.
};
func void DIA_Igaraz_METOO_AGON()
{
AI_Output(other,self,"DIA_Igaraz_METOO_AGON_15_00"); //Have you seen Agon or Ulf?
AI_Output(self,other,"DIA_Igaraz_METOO_AGON_13_01"); //We split up at the inn. I went to the farms and those two set out together - but where to, I don't know.
};
instance DIA_Igaraz_ADD(C_Info)
{
npc = NOV_601_Igaraz;
nr = 23;
condition = DIA_Igaraz_ADD_Condition;
information = DIA_Igaraz_ADD_Info;
permanent = FALSE;
description = "Do you know anything about a 'living rock'?";
};
func int DIA_Igaraz_ADD_Condition()
{
if((Npc_GetDistToWP(self,"NW_TAVERNE_TROLLAREA_05") <= 3500) && (MIS_GOLEM == LOG_Running) && (Npc_IsDead(Magic_Golem) == FALSE) && (Npc_KnowsInfo(other,DIA_Igaraz_Stein) == FALSE) && Npc_KnowsInfo(other,DIA_Igaraz_METOO))
{
return TRUE;
};
};
func void DIA_Igaraz_ADD_Info()
{
AI_Output(other,self,"DIA_Igaraz_Add_15_00"); //Do you know anything about a 'living rock'?
AI_Output(self,other,"DIA_Igaraz_Add_13_01"); //(cackling) No! Did Serpentes give you this test?
AI_Output(other,self,"DIA_Igaraz_Add_15_02"); //Yes, why?
AI_Output(self,other,"DIA_Igaraz_Add_13_03"); //I think I can imagine what he means ...
AI_Output(self,other,"DIA_Igaraz_Add_13_04"); //You wouldn't be the first person to fail this test ...
AI_Output(other,self,"DIA_Igaraz_Add_15_05"); //Where exactly can I find this living rock?
AI_Output(self,other,"DIA_Igaraz_Add_13_06"); //Just keep following this path. After quite a while, you'll come to a river.
AI_Output(self,other,"DIA_Igaraz_Add_13_07"); //Just continue to follow the path up the mountain. It's got to be up there someplace.
AI_Output(self,other,"DIA_Igaraz_Add_13_08"); //When you come to a bridge, you've gone too far.
AI_Output(self,other,"DIA_Igaraz_Add_13_09"); //(laughs) IF you get that far in the first place ...
AI_Output(self,other,"DIA_Igaraz_Add_13_10"); //That's all I'm going to tell you ... (sarcastic) It's supposed to be your TEST after all!
};
instance DIA_Igaraz_Pruefung(C_Info)
{
npc = NOV_601_Igaraz;
nr = 22;
condition = DIA_Igaraz_Pruefung_Condition;
information = DIA_Igaraz_Pruefung_Info;
description = "Have you found out anything new?";
};
func int DIA_Igaraz_Pruefung_Condition()
{
if((other.guild == GIL_NOV) && (Npc_HasItems(other,ItMi_RuneBlank) < 1) && Npc_KnowsInfo(other,DIA_Igaraz_METOO))
{
return TRUE;
};
};
func void DIA_Igaraz_Pruefung_Info()
{
AI_Output(other,self,"DIA_Igaraz_Pruefung_15_00"); //Have you found out anything new?
AI_Output(self,other,"DIA_Igaraz_Pruefung_13_01"); //Not yet, but I'm still searching.
AI_StopProcessInfos(self);
if(Igaraz_Wait == FALSE)
{
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"CONTESTWAIT");
Igaraz_Wait = TRUE;
};
};
instance DIA_Igaraz_Stein(C_Info)
{
npc = NOV_601_Igaraz;
nr = 1;
condition = DIA_Igaraz_Stein_Condition;
information = DIA_Igaraz_Stein_Info;
important = TRUE;
permanent = FALSE;
};
func int DIA_Igaraz_Stein_Condition()
{
if((Npc_GetDistToWP(self,"NW_TAVERNE_TROLLAREA_66") <= 3500) && (other.guild == GIL_NOV) && (Npc_HasItems(other,ItMi_RuneBlank) >= 1))
{
return TRUE;
};
};
func void DIA_Igaraz_Stein_Info()
{
AI_Output(self,other,"DIA_Igaraz_Seufz_13_00"); //Hey, wait. We need to talk ...
AI_Output(other,self,"DIA_Igaraz_Seufz_15_01"); //Actually, I don't think so ...
AI_Output(self,other,"DIA_Igaraz_Seufz_13_02"); //I've waited years for this test. Innos is with me and I MUST pass this test.
if(Npc_KnowsInfo(other,DIA_Ulf_Abrechnung))
{
AI_Output(other,self,"DIA_Igaraz_Seufz_15_03"); //That sounds familiar.
}
else
{
AI_Output(other,self,"DIA_Igaraz_Seufz_15_04"); //You're not the only one who says that.
};
AI_Output(self,other,"DIA_Igaraz_Seufz_13_05"); //Enough chatter. I need what you found. So, time for you to die!
AI_StopProcessInfos(self);
B_Attack(self,other,AR_KILL,0);
};
instance DIA_Igaranz_Kap2_EXIT(C_Info)
{
npc = NOV_601_Igaraz;
nr = 999;
condition = DIA_Igaraz_Kap2_EXIT_Condition;
information = DIA_Igaraz_Kap2_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Igaraz_Kap2_EXIT_Condition()
{
if(Kapitel == 2)
{
return TRUE;
};
};
func void DIA_Igaraz_Kap2_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Igaranz_Kap3_EXIT(C_Info)
{
npc = NOV_601_Igaraz;
nr = 999;
condition = DIA_Igaraz_Kap3_EXIT_Condition;
information = DIA_Igaraz_Kap3_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Igaraz_Kap3_EXIT_Condition()
{
if(Kapitel == 3)
{
return TRUE;
};
};
func void DIA_Igaraz_Kap3_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Igaranz_TalkAboutBabo(C_Info)
{
npc = NOV_601_Igaraz;
nr = 31;
condition = DIA_Igaraz_TalkAboutBabo_Condition;
information = DIA_Igaraz_TalkAboutBabo_Info;
permanent = FALSE;
description = "We need to talk about Babo.";
};
func int DIA_Igaraz_TalkAboutBabo_Condition()
{
if(MIS_BabosDocs == LOG_Running)
{
return TRUE;
};
};
func void DIA_Igaraz_TalkAboutBabo_Info()
{
AI_Output(other,self,"DIA_Igaranz_TalkAboutBabo_15_00"); //We need to talk about Babo.
AI_Output(self,other,"DIA_Igaranz_TalkAboutBabo_13_01"); //(reserved) Yes, what's wrong?
};
instance DIA_Igaranz_BabosBelongings(C_Info)
{
npc = NOV_601_Igaraz;
nr = 31;
condition = DIA_Igaraz_BabosBelongings_Condition;
information = DIA_Igaraz_BabosBelongings_Info;
permanent = FALSE;
description = "You've got something which belongs to Babo.";
};
func int DIA_Igaraz_BabosBelongings_Condition()
{
if(Npc_KnowsInfo(other,DIA_Igaranz_TalkAboutBabo))
{
return TRUE;
};
};
func void DIA_Igaraz_BabosBelongings_Info()
{
AI_Output(other,self,"DIA_Igaranz_BabosBelongings_15_00"); //You've got something which belongs to Babo.
AI_Output(self,other,"DIA_Igaranz_BabosBelongings_13_01"); //What might that be?
AI_Output(other,self,"DIA_Igaranz_BabosBelongings_15_02"); //A few papers. Babo would like them back.
AI_Output(self,other,"DIA_Igaranz_BabosBelongings_13_03"); //(mocking) He would, wouldn't he. I can imagine. Unfortunately, I prefer to keep them, which brings us to a bit of a dilemma.
};
instance DIA_Igaranz_WhereDocs(C_Info)
{
npc = NOV_601_Igaraz;
nr = 31;
condition = DIA_Igaraz_WhereDocs_Condition;
information = DIA_Igaraz_WhereDocs_Info;
permanent = FALSE;
description = "Where have you got the papers?";
};
func int DIA_Igaraz_WhereDocs_Condition()
{
if(Npc_KnowsInfo(other,DIA_Igaranz_BabosBelongings))
{
return TRUE;
};
};
func void DIA_Igaraz_WhereDocs_Info()
{
AI_Output(other,self,"DIA_Igaranz_WhereDocs_15_00"); //Where have you got the papers?
AI_Output(self,other,"DIA_Igaranz_WhereDocs_13_01"); //(smugly) Well, of course I don't have them on me. I'm afraid I can't help you further.
AI_Output(other,self,"DIA_Igaranz_WhereDocs_15_02"); //Where are they?
AI_Output(self,other,"DIA_Igaranz_WhereDocs_13_03"); //I have them safely locked up. And you will never get the key from me.
};
instance DIA_Igaranz_BabosJob(C_Info)
{
npc = NOV_601_Igaraz;
nr = 31;
condition = DIA_Igaraz_BabosJob_Condition;
information = DIA_Igaraz_BabosJob_Info;
permanent = FALSE;
description = "What was Babo supposed to do for you?";
};
func int DIA_Igaraz_BabosJob_Condition()
{
if(Npc_KnowsInfo(other,DIA_Igaranz_BabosBelongings))
{
return TRUE;
};
};
func void DIA_Igaraz_BabosJob_Info()
{
AI_Output(other,self,"DIA_Igaranz_BabosJob_15_00"); //What was Babo supposed to do for you?
AI_Output(self,other,"DIA_Igaranz_BabosJob_13_01"); //If I had known the baby would do it in his pants over a few swampweeds, then I would have seen to it that someone else took care of the monastery garden.
AI_Output(other,self,"DIA_Igaranz_BabosJob_15_02"); //He's supposed to grow swampweed?
AI_Output(self,other,"DIA_Igaranz_BabosJob_13_03"); //Of course. Since none of that stuff comes out from behind the barrier anymore, the price in the city has tripled.
AI_Output(self,other,"DIA_Igaranz_BabosJob_13_04"); //It could have been a good bargain for everyone involved. But Babo didn't want to play along.
};
instance DIA_Igaranz_Price(C_Info)
{
npc = NOV_601_Igaraz;
nr = 31;
condition = DIA_Igaraz_Price_Condition;
information = DIA_Igaraz_Price_Info;
permanent = FALSE;
description = "How much do you want for the papers?";
};
func int DIA_Igaraz_Price_Condition()
{
if(Npc_KnowsInfo(other,DIA_Igaranz_BabosBelongings))
{
return TRUE;
};
};
func void DIA_Igaraz_Price_Info()
{
AI_Output(other,self,"DIA_Igaranz_Price_15_00"); //How much do you want for the papers?
AI_Output(self,other,"DIA_Igaranz_Price_13_01"); //(laughs) Ha, actually they're almost priceless. You very rarely see something like that here.
AI_Output(self,other,"DIA_Igaranz_Price_13_02"); //But I have no desire to wager my future against a few gold pieces.
AI_Output(self,other,"DIA_Igaranz_Price_13_03"); //300 gold pieces and you can do what you like with the papers.
};
instance DIA_Igaranz_BuyIt(C_Info)
{
npc = NOV_601_Igaraz;
nr = 31;
condition = DIA_Igaraz_BuyIt_Condition;
information = DIA_Igaraz_BuyIt_Info;
permanent = FALSE;
description = "I want to buy those papers.";
};
func int DIA_Igaraz_BuyIt_Condition()
{
if(Npc_KnowsInfo(other,DIA_Igaranz_Price) && (Npc_HasItems(other,ItMi_Gold) >= 300))
{
return TRUE;
};
};
func void DIA_Igaraz_BuyIt_Info()
{
AI_Output(other,self,"DIA_Igaranz_BuyIt_15_00"); //I want to buy those papers.
AI_Output(self,other,"DIA_Igaranz_BuyIt_13_01"); //Look, I can't leave here right now. I'll give you the key to my chest, there's nothing else in there anyway.
B_GiveInvItems(other,self,ItMi_Gold,300);
B_GiveInvItems(self,other,ItKe_IgarazChest_Mis,1);
};
instance DIA_Igaraz_PICKPOCKET(C_Info)
{
npc = NOV_601_Igaraz;
nr = 900;
condition = DIA_Igaraz_PICKPOCKET_Condition;
information = DIA_Igaraz_PICKPOCKET_Info;
permanent = TRUE;
description = "(It would be easy to steal his key)";
};
func int DIA_Igaraz_PICKPOCKET_Condition()
{
if((MIS_BabosDocs == LOG_Running) && (Npc_GetTalentSkill(other,NPC_TALENT_PICKPOCKET) == 1) && (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE) && (Npc_HasItems(self,ItKe_IgarazChest_Mis) >= 1) && (other.attribute[ATR_DEXTERITY] >= (40 - Theftdiff)))
{
return TRUE;
};
};
func void DIA_Igaraz_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Igaraz_PICKPOCKET);
Info_AddChoice(DIA_Igaraz_PICKPOCKET,Dialog_Back,DIA_Igaraz_PICKPOCKET_BACK);
Info_AddChoice(DIA_Igaraz_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Igaraz_PICKPOCKET_DoIt);
};
func void DIA_Igaraz_PICKPOCKET_DoIt()
{
if(other.attribute[ATR_DEXTERITY] >= 40)
{
B_GiveInvItems(self,other,ItKe_IgarazChest_Mis,1);
self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE;
B_GiveThiefXP();
Info_ClearChoices(DIA_Igaraz_PICKPOCKET);
}
else
{
B_ResetThiefLevel();
AI_StopProcessInfos(self);
B_Attack(self,other,AR_Theft,1);
};
};
func void DIA_Igaraz_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Igaraz_PICKPOCKET);
};
instance DIA_Igaranz_Kap4_EXIT(C_Info)
{
npc = NOV_601_Igaraz;
nr = 999;
condition = DIA_Igaraz_Kap4_EXIT_Condition;
information = DIA_Igaraz_Kap4_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Igaraz_Kap4_EXIT_Condition()
{
if(Kapitel == 4)
{
return TRUE;
};
};
func void DIA_Igaraz_Kap4_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Igaranz_Kap5_EXIT(C_Info)
{
npc = NOV_601_Igaraz;
nr = 999;
condition = DIA_Igaraz_Kap5_EXIT_Condition;
information = DIA_Igaraz_Kap5_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Igaraz_Kap5_EXIT_Condition()
{
if(Kapitel == 5)
{
return TRUE;
};
};
func void DIA_Igaraz_Kap5_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Igaranz_Perm(C_Info)
{
npc = NOV_601_Igaraz;
nr = 2;
condition = DIA_Igaraz_Perm_Condition;
information = DIA_Igaraz_Perm_Info;
permanent = FALSE;
description = "Have you got anything interesting for me?";
};
func int DIA_Igaraz_Perm_Condition()
{
if((Kapitel >= 3) && (other.guild != GIL_KDF) && (MIS_BabosDocs != LOG_Running))
{
return TRUE;
};
};
func void DIA_Igaraz_Perm_Info()
{
AI_Output(other,self,"DIA_Igaranz_Perm_15_00"); //Have you got anything interesting for me?
AI_Output(self,other,"DIA_Igaranz_Perm_13_01"); //Ehm ... no.
AI_StopProcessInfos(self);
};
|
D
|
/*
RUN_OUTPUT:
---
Success
---
*/
extern (C) int printf(const char* fmt, ...);
int pass(int n){ return n; }
struct X
{
int m;
int opIndex(int m, int n)
{
return n;
}
}
/**********************************************/
struct S1f
{
int opDispatch(string name, A...)(A args)
{
static if (args.length)
return args[0];
else
return 0;
}
}
struct S1p
{
@property int opDispatch(string name, A...)(A args)
{
static if (args.length)
return args[0];
else
return 0;
}
}
void test1()
{
S1f s1f;
assert(s1f.func() == 0); // ok -> ok
assert(s1f.func(1) == 1); // ok -> ok
assert(pass(s1f.func()) == 0); // ok -> ok
assert(pass(s1f.func(1)) == 1); // ok -> ok
assert(X(s1f.func()).m == 0);
assert(X()[0, s1f.func()] == 0);
S1p s1p;
assert(s1p.prop == 0); // ok -> ok
assert((s1p.prop = 1) == 1); // CTng -> CTng
assert(pass(s1p.prop) == 0); // ok -> ok
assert(pass(s1p.prop = 2) == 2); // CTng -> CTng
assert(X(s1p.prop).m == 0);
assert(X()[0, s1p.prop] == 0);
}
/**********************************************/
struct S2f
{
template opDispatch(string name)
{
int opDispatch(A...)(A args)
{
static if (args.length)
return args[0];
else
return 0;
}
}
}
struct S2p
{
template opDispatch(string name)
{
@property int opDispatch(A...)(A args)
{
static if (args.length)
return args[0];
else
return 0;
}
}
}
void test2()
{
S2f s2f;
assert(s2f.func() == 0); // ok -> ok
assert(s2f.func(1) == 1); // ok -> ok
assert(pass(s2f.func()) == 0); // ok -> ok
assert(pass(s2f.func(1)) == 1); // ok -> ok
assert(X(s2f.func()).m == 0);
assert(X()[0, s2f.func()] == 0);
S2p s2p;
assert(s2p.prop == 0); // CTng -> ok
assert((s2p.prop = 1) == 1); // ok -> ok
assert(pass(s2p.prop) == 0); // CTng -> ok
assert(pass(s2p.prop = 2) == 2); // ok -> ok
assert(X(s2p.prop).m == 0);
assert(X()[0, s2p.prop] == 0);
}
/**********************************************/
struct S3f
{
template opDispatch(string name)
{
template opDispatch(T)
{
int opDispatch(A...)(A args)
{
static if (args.length)
return args[0];
else
return 0;
}
}
}
}
struct S3p
{
template opDispatch(string name)
{
template opDispatch(T)
{
@property int opDispatch(A...)(A args)
{
static if (args.length)
return args[0];
else
return 0;
}
}
}
}
void test3()
{
S3f s3f;
assert(s3f.func!int() == 0); // ok -> ok
assert(s3f.func!int(1) == 1); // ok -> ok
assert(pass(s3f.func!int()) == 0); // ok -> ok
assert(pass(s3f.func!int(1)) == 1); // ok -> ok
assert(X(s3f.func!int()).m == 0);
assert(X()[0, s3f.func!int()] == 0);
S3p s3p;
assert(s3p.prop!int == 0); // CTng -> ok
assert((s3p.prop!int = 1) == 1); // ok -> ok
assert(pass(s3p.prop!int) == 0); // CTng -> ok
assert(pass(s3p.prop!int = 2) == 2); // ok -> ok
assert(X(s3p.prop!int).m == 0);
assert(X()[0, s3p.prop!int] == 0);
}
/**********************************************/
struct S4f
{
ref int opDispatch(string name, A...)(A args)
{
static int n;
n = args.length;
return n;
}
}
struct S4p
{
@property ref int opDispatch(string name, A...)(A args)
{
static int n;
n = args.length;
return n;
}
}
void test4()
{
S4f s4f;
assert(s4f.func == 0); // getter
assert((s4f.func = 1) == 1); // setter
S4p s4p;
assert(s4p.prop == 0); // getter
assert((s4p.prop = 1) == 1); // setter
}
/**********************************************/
struct S5f
{
template opDispatch(string name)
{
ref int opDispatch(A...)(A args)
{
static int n;
n = args.length;
return n;
}
}
}
struct S5p
{
template opDispatch(string name)
{
@property ref int opDispatch(A...)(A args)
{
static int n;
n = args.length;
return n;
}
}
}
void test5()
{
S5f s5f;
assert(s5f.prop == 0); // getter ng -> ok
assert((s5f.prop = 1) == 1); // setter
S5p s5p;
assert(s5p.prop == 0); // getter ng -> ok
assert((s5p.prop = 1) == 1); // setter
}
/**********************************************/
struct S6f
{
template opDispatch(string name)
{
template opDispatch(T)
{
ref int opDispatch(A...)(A args)
{
static int n;
n = args.length;
return n;
}
}
}
}
struct S6p
{
template opDispatch(string name)
{
template opDispatch(T)
{
@property ref int opDispatch(A...)(A args)
{
static int n;
n = args.length;
return n;
}
}
}
}
void test6()
{
S6f s6f;
assert(s6f.prop!int == 0); // getter ng -> ok
assert((s6f.prop!int = 1) == 1); // setter
S6p s6p;
assert(s6p.prop!int == 0); // getter ng -> ok
assert((s6p.prop!int = 1) == 1); // setter
}
/**********************************************/
// https://issues.dlang.org/show_bug.cgi?id=7578
struct Foo7578
{
static int[] opDispatch(string op, Args...)(Args)
{
return [0];
}
}
void test7578()
{
Foo7578.attrs[0] = 1;
}
/**********************************************/
int main()
{
test1();
test2();
test3();
test4();
test5();
test6();
test7578();
printf("Success\n");
return 0;
}
|
D
|
pragma(ident); // just by itself
pragma(ident) declaration; // influence one declaration
pragma(ident): // influence subsequent declarations
declaration;
declaration;
pragma(ident) // influence block of declarations
{
declaration;
declaration;
}
pragma(ident) statement; // influence one statement
pragma(ident) // influence block of statements
{
statement;
statement;
}
|
D
|
// Written in the D programming language.
/*
Copyright: Copyright The D Language Foundation 2000-2013.
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP walterbright.com, Walter Bright), $(HTTP erdani.com,
Andrei Alexandrescu), and Kenji Hara
Source: $(PHOBOSSRC std/format/internal/write.d)
*/
module std.format.internal.write;
import std.format.spec : FormatSpec;
import std.range.primitives : isInputRange;
import std.traits;
version (StdUnittest)
{
import std.exception : assertCTFEable;
import std.format : format;
}
package(std.format):
/*
`bool`s are formatted as `"true"` or `"false"` with `%s` and as `1` or
`0` with integral-specific format specs.
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(BooleanTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
BooleanTypeOf!T val = obj;
if (f.spec == 's')
writeAligned(w, val ? "true" : "false", f);
else
formatValueImpl(w, cast(byte) val, f);
}
@safe pure unittest
{
assertCTFEable!(
{
formatTest(false, "false");
formatTest(true, "true");
});
}
@safe unittest
{
class C1
{
bool val;
alias val this;
this(bool v){ val = v; }
}
class C2 {
bool val;
alias val this;
this(bool v){ val = v; }
override string toString() const { return "C"; }
}
() @trusted {
formatTest(new C1(false), "false");
formatTest(new C1(true), "true");
formatTest(new C2(false), "C");
formatTest(new C2(true), "C");
} ();
struct S1
{
bool val;
alias val this;
}
struct S2
{
bool val;
alias val this;
string toString() const { return "S"; }
}
formatTest(S1(false), "false");
formatTest(S1(true), "true");
formatTest(S2(false), "S");
formatTest(S2(true), "S");
}
@safe pure unittest
{
string t1 = format("[%6s] [%6s] [%-6s]", true, false, true);
assert(t1 == "[ true] [ false] [true ]");
string t2 = format("[%3s] [%-2s]", true, false);
assert(t2 == "[true] [false]");
}
// https://issues.dlang.org/show_bug.cgi?id=20534
@safe pure unittest
{
assert(format("%r",false) == "\0");
}
@safe pure unittest
{
assert(format("%07s",true) == " true");
}
@safe pure unittest
{
assert(format("%=8s",true) == " true ");
assert(format("%=9s",false) == " false ");
assert(format("%=9s",true) == " true ");
assert(format("%-=9s",true) == " true ");
assert(format("%=10s",false) == " false ");
assert(format("%-=10s",false) == " false ");
}
/*
`null` literal is formatted as `"null"`
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(immutable T == immutable typeof(null)) && !is(T == enum) && !hasToString!(T, Char))
{
import std.format : enforceFmt;
const spec = f.spec;
enforceFmt(spec == 's', "null literal cannot match %" ~ spec);
writeAligned(w, "null", f);
}
@safe pure unittest
{
import std.exception : collectExceptionMsg;
import std.format : FormatException;
import std.range.primitives : back;
assert(collectExceptionMsg!FormatException(format("%p", null)).back == 'p');
assertCTFEable!(
{
formatTest(null, "null");
});
}
@safe pure unittest
{
string t = format("[%6s] [%-6s]", null, null);
assert(t == "[ null] [null ]");
}
/*
Integrals are formatted like $(REF printf, core, stdc, stdio).
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(IntegralTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
import std.range.primitives : put;
alias U = IntegralTypeOf!T;
U val = obj; // Extracting alias this may be impure/system/may-throw
if (f.spec == 'r')
{
// raw write, skip all else and write the thing
auto raw = (ref val) @trusted {
return (cast(const char*) &val)[0 .. val.sizeof];
}(val);
if (needToSwapEndianess(f))
{
foreach_reverse (c; raw)
put(w, c);
}
else
{
foreach (c; raw)
put(w, c);
}
return;
}
immutable uint base =
f.spec == 'x' || f.spec == 'X' || f.spec == 'a' || f.spec == 'A' ? 16 :
f.spec == 'o' ? 8 :
f.spec == 'b' ? 2 :
f.spec == 's' || f.spec == 'd' || f.spec == 'u'
|| f.spec == 'e' || f.spec == 'E' || f.spec == 'f' || f.spec == 'F'
|| f.spec == 'g' || f.spec == 'G' ? 10 :
0;
import std.format : enforceFmt;
enforceFmt(base > 0,
"incompatible format character for integral argument: %" ~ f.spec);
import std.math.algebraic : abs;
bool negative = false;
ulong arg = val;
static if (isSigned!U)
{
if (f.spec != 'x' && f.spec != 'X' && f.spec != 'b' && f.spec != 'o' && f.spec != 'u')
{
if (val < 0)
{
negative = true;
arg = cast(ulong) abs(val);
}
}
}
arg &= Unsigned!U.max;
char[64] digits = void;
size_t pos = digits.length - 1;
do
{
digits[pos--] = '0' + arg % base;
if (base > 10 && digits[pos + 1] > '9')
digits[pos + 1] += ((f.spec == 'x' || f.spec == 'a') ? 'a' : 'A') - '0' - 10;
arg /= base;
} while (arg > 0);
char[3] prefix = void;
size_t left = 2;
size_t right = 2;
// add sign
if (f.spec != 'x' && f.spec != 'X' && f.spec != 'b' && f.spec != 'o' && f.spec != 'u')
{
if (negative)
prefix[right++] = '-';
else if (f.flPlus)
prefix[right++] = '+';
else if (f.flSpace)
prefix[right++] = ' ';
}
// not a floating point like spec
if (f.spec == 'x' || f.spec == 'X' || f.spec == 'b' || f.spec == 'o' || f.spec == 'u'
|| f.spec == 'd' || f.spec == 's')
{
if (f.flHash && (base == 16) && obj != 0)
{
prefix[--left] = f.spec;
prefix[--left] = '0';
}
if (f.flHash && (base == 8) && obj != 0
&& (digits.length - (pos + 1) >= f.precision || f.precision == f.UNSPECIFIED))
prefix[--left] = '0';
writeAligned(w, prefix[left .. right], digits[pos + 1 .. $], "", f, true);
return;
}
FormatSpec!Char fs = f;
if (f.precision == f.UNSPECIFIED)
fs.precision = cast(typeof(fs.precision)) (digits.length - pos - 2);
// %f like output
if (f.spec == 'f' || f.spec == 'F'
|| ((f.spec == 'g' || f.spec == 'G') && (fs.precision >= digits.length - pos - 2)))
{
if (f.precision == f.UNSPECIFIED)
fs.precision = 0;
writeAligned(w, prefix[left .. right], digits[pos + 1 .. $], ".", "", fs,
(f.spec == 'g' || f.spec == 'G') ? PrecisionType.allDigits : PrecisionType.fractionalDigits);
return;
}
import std.algorithm.searching : all;
// at least one digit for %g
if ((f.spec == 'g' || f.spec == 'G') && fs.precision == 0)
fs.precision = 1;
// rounding
size_t digit_end = pos + fs.precision + ((f.spec == 'g' || f.spec == 'G') ? 1 : 2);
if (digit_end <= digits.length)
{
RoundingClass rt = RoundingClass.ZERO;
if (digit_end < digits.length)
{
auto tie = (f.spec == 'a' || f.spec == 'A') ? '8' : '5';
if (digits[digit_end] >= tie)
{
rt = RoundingClass.UPPER;
if (digits[digit_end] == tie && digits[digit_end + 1 .. $].all!(a => a == '0'))
rt = RoundingClass.FIVE;
}
else
{
rt = RoundingClass.LOWER;
if (digits[digit_end .. $].all!(a => a == '0'))
rt = RoundingClass.ZERO;
}
}
if (round(digits, pos + 1, digit_end, rt, negative,
f.spec == 'a' ? 'f' : (f.spec == 'A' ? 'F' : '9')))
{
pos--;
digit_end--;
}
}
// convert to scientific notation
char[1] int_digit = void;
int_digit[0] = digits[pos + 1];
digits[pos + 1] = '.';
char[4] suffix = void;
if (f.spec == 'e' || f.spec == 'E' || f.spec == 'g' || f.spec == 'G')
{
suffix[0] = (f.spec == 'e' || f.spec == 'g') ? 'e' : 'E';
suffix[1] = '+';
suffix[2] = cast(char) ('0' + (digits.length - pos - 2) / 10);
suffix[3] = cast(char) ('0' + (digits.length - pos - 2) % 10);
}
else
{
if (right == 3)
prefix[0] = prefix[2];
prefix[1] = '0';
prefix[2] = f.spec == 'a' ? 'x' : 'X';
left = right == 3 ? 0 : 1;
right = 3;
suffix[0] = f.spec == 'a' ? 'p' : 'P';
suffix[1] = '+';
suffix[2] = cast(char) ('0' + ((digits.length - pos - 2) * 4) / 10);
suffix[3] = cast(char) ('0' + ((digits.length - pos - 2) * 4) % 10);
}
import std.algorithm.comparison : min;
// remove trailing zeros
if ((f.spec == 'g' || f.spec == 'G') && !f.flHash)
{
digit_end = min(digit_end, digits.length);
while (digit_end > pos + 1 &&
(digits[digit_end - 1] == '0' || digits[digit_end - 1] == '.'))
digit_end--;
}
writeAligned(w, prefix[left .. right], int_digit[0 .. $],
digits[pos + 1 .. min(digit_end, $)],
suffix[0 .. $], fs,
(f.spec == 'g' || f.spec == 'G') ? PrecisionType.allDigits : PrecisionType.fractionalDigits);
}
// https://issues.dlang.org/show_bug.cgi?id=18838
@safe pure unittest
{
assert("%12,d".format(0) == " 0");
}
@safe pure unittest
{
import std.exception : collectExceptionMsg;
import std.format : FormatException;
import std.range.primitives : back;
assert(collectExceptionMsg!FormatException(format("%c", 5)).back == 'c');
assertCTFEable!(
{
formatTest(9, "9");
formatTest(10, "10");
});
}
@safe unittest
{
class C1
{
long val;
alias val this;
this(long v){ val = v; }
}
class C2
{
long val;
alias val this;
this(long v){ val = v; }
override string toString() const { return "C"; }
}
() @trusted {
formatTest(new C1(10), "10");
formatTest(new C2(10), "C");
} ();
struct S1
{
long val;
alias val this;
}
struct S2
{
long val;
alias val this;
string toString() const { return "S"; }
}
formatTest(S1(10), "10");
formatTest(S2(10), "S");
}
// https://issues.dlang.org/show_bug.cgi?id=20064
@safe unittest
{
assert(format( "%03,d", 1234) == "1,234");
assert(format( "%04,d", 1234) == "1,234");
assert(format( "%05,d", 1234) == "1,234");
assert(format( "%06,d", 1234) == "01,234");
assert(format( "%07,d", 1234) == "001,234");
assert(format( "%08,d", 1234) == "0,001,234");
assert(format( "%09,d", 1234) == "0,001,234");
assert(format("%010,d", 1234) == "00,001,234");
assert(format("%011,d", 1234) == "000,001,234");
assert(format("%012,d", 1234) == "0,000,001,234");
assert(format("%013,d", 1234) == "0,000,001,234");
assert(format("%014,d", 1234) == "00,000,001,234");
assert(format("%015,d", 1234) == "000,000,001,234");
assert(format("%016,d", 1234) == "0,000,000,001,234");
assert(format("%017,d", 1234) == "0,000,000,001,234");
assert(format( "%03,d", -1234) == "-1,234");
assert(format( "%04,d", -1234) == "-1,234");
assert(format( "%05,d", -1234) == "-1,234");
assert(format( "%06,d", -1234) == "-1,234");
assert(format( "%07,d", -1234) == "-01,234");
assert(format( "%08,d", -1234) == "-001,234");
assert(format( "%09,d", -1234) == "-0,001,234");
assert(format("%010,d", -1234) == "-0,001,234");
assert(format("%011,d", -1234) == "-00,001,234");
assert(format("%012,d", -1234) == "-000,001,234");
assert(format("%013,d", -1234) == "-0,000,001,234");
assert(format("%014,d", -1234) == "-0,000,001,234");
assert(format("%015,d", -1234) == "-00,000,001,234");
assert(format("%016,d", -1234) == "-000,000,001,234");
assert(format("%017,d", -1234) == "-0,000,000,001,234");
}
@safe pure unittest
{
string t1 = format("[%6s] [%-6s]", 123, 123);
assert(t1 == "[ 123] [123 ]");
string t2 = format("[%6s] [%-6s]", -123, -123);
assert(t2 == "[ -123] [-123 ]");
}
@safe pure unittest
{
formatTest(byte.min, "-128");
formatTest(short.min, "-32768");
formatTest(int.min, "-2147483648");
formatTest(long.min, "-9223372036854775808");
}
// https://issues.dlang.org/show_bug.cgi?id=21777
@safe pure unittest
{
assert(format!"%20.5,d"(cast(short) 120) == " 00,120");
assert(format!"%20.5,o"(cast(short) 120) == " 00,170");
assert(format!"%20.5,x"(cast(short) 120) == " 00,078");
assert(format!"%20.5,2d"(cast(short) 120) == " 0,01,20");
assert(format!"%20.5,2o"(cast(short) 120) == " 0,01,70");
assert(format!"%20.5,4d"(cast(short) 120) == " 0,0120");
assert(format!"%20.5,4o"(cast(short) 120) == " 0,0170");
assert(format!"%20.5,4x"(cast(short) 120) == " 0,0078");
assert(format!"%20.5,2x"(3000) == " 0,0b,b8");
assert(format!"%20.5,4d"(3000) == " 0,3000");
assert(format!"%20.5,4o"(3000) == " 0,5670");
assert(format!"%20.5,4x"(3000) == " 0,0bb8");
assert(format!"%20.5,d"(-400) == " -00,400");
assert(format!"%20.30d"(-400) == "-000000000000000000000000000400");
assert(format!"%20.5,4d"(0) == " 0,0000");
assert(format!"%0#.8,2s"(12345) == "00,01,23,45");
assert(format!"%0#.9,3x"(55) == "0x000,000,037");
}
// https://issues.dlang.org/show_bug.cgi?id=21814
@safe pure unittest
{
assert(format("%,0d",1000) == "1000");
}
// https://issues.dlang.org/show_bug.cgi?id=21817
@safe pure unittest
{
assert(format!"%u"(-5) == "4294967291");
}
// https://issues.dlang.org/show_bug.cgi?id=21820
@safe pure unittest
{
assert(format!"%#.0o"(0) == "0");
}
@safe pure unittest
{
assert(format!"%e"(10000) == "1.0000e+04");
assert(format!"%.2e"(10000) == "1.00e+04");
assert(format!"%.10e"(10000) == "1.0000000000e+04");
assert(format!"%e"(9999) == "9.999e+03");
assert(format!"%.2e"(9999) == "1.00e+04");
assert(format!"%.10e"(9999) == "9.9990000000e+03");
assert(format!"%f"(10000) == "10000");
assert(format!"%.2f"(10000) == "10000.00");
assert(format!"%g"(10000) == "10000");
assert(format!"%.2g"(10000) == "1e+04");
assert(format!"%.10g"(10000) == "10000");
assert(format!"%#g"(10000) == "10000.");
assert(format!"%#.2g"(10000) == "1.0e+04");
assert(format!"%#.10g"(10000) == "10000.00000");
assert(format!"%g"(9999) == "9999");
assert(format!"%.2g"(9999) == "1e+04");
assert(format!"%.10g"(9999) == "9999");
assert(format!"%a"(0x10000) == "0x1.0000p+16");
assert(format!"%.2a"(0x10000) == "0x1.00p+16");
assert(format!"%.10a"(0x10000) == "0x1.0000000000p+16");
assert(format!"%a"(0xffff) == "0xf.fffp+12");
assert(format!"%.2a"(0xffff) == "0x1.00p+16");
assert(format!"%.10a"(0xffff) == "0xf.fff0000000p+12");
}
@safe pure unittest
{
assert(format!"%.3e"(ulong.max) == "1.845e+19");
assert(format!"%.3f"(ulong.max) == "18446744073709551615.000");
assert(format!"%.3g"(ulong.max) == "1.84e+19");
assert(format!"%.3a"(ulong.max) == "0x1.000p+64");
assert(format!"%.3e"(long.min) == "-9.223e+18");
assert(format!"%.3f"(long.min) == "-9223372036854775808.000");
assert(format!"%.3g"(long.min) == "-9.22e+18");
assert(format!"%.3a"(long.min) == "-0x8.000p+60");
assert(format!"%e"(0) == "0e+00");
assert(format!"%f"(0) == "0");
assert(format!"%g"(0) == "0");
assert(format!"%a"(0) == "0x0p+00");
}
@safe pure unittest
{
assert(format!"%.0g"(1500) == "2e+03");
}
// https://issues.dlang.org/show_bug.cgi?id=21900#
@safe pure unittest
{
assert(format!"%.1a"(472) == "0x1.ep+08");
}
/*
Floating-point values are formatted like $(REF printf, core, stdc, stdio)
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(FloatingPointTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
import std.algorithm.searching : find;
import std.format : enforceFmt;
import std.range.primitives : put;
FloatingPointTypeOf!T val = obj;
const char spec = f.spec;
if (spec == 'r')
{
// raw write, skip all else and write the thing
auto raw = (ref val) @trusted {
return (cast(const char*) &val)[0 .. val.sizeof];
}(val);
if (needToSwapEndianess(f))
{
foreach_reverse (c; raw)
put(w, c);
}
else
{
foreach (c; raw)
put(w, c);
}
return;
}
enforceFmt(find("fgFGaAeEs", spec).length,
"incompatible format character for floating point argument: %" ~ spec);
FormatSpec!Char fs = f; // fs is copy for change its values.
fs.spec = spec == 's' ? 'g' : spec;
static if (is(T == float) || is(T == double)
|| (is(T == real) && (T.mant_dig == double.mant_dig || T.mant_dig == 64)))
{
alias tval = val;
}
else
{
import std.math.traits : isInfinity;
import std.math.operations : nextUp;
// reals that are not supported by printFloat are cast to double.
double tval = val;
// Numbers greater than double.max are converted to double.max:
if (val > double.max && !isInfinity(val))
tval = double.max;
if (val < -double.max && !isInfinity(val))
tval = -double.max;
// Numbers between the smallest representable double subnormal and 0.0
// are converted to the smallest representable double subnormal:
enum doubleLowest = nextUp(0.0);
if (val > 0 && val < doubleLowest)
tval = doubleLowest;
if (val < 0 && val > -doubleLowest)
tval = -doubleLowest;
}
import std.format.internal.floats : RoundingMode, printFloat;
import std.math.hardware; // cannot be selective, because FloatingPointControl might not be defined
auto mode = RoundingMode.toNearestTiesToEven;
if (!__ctfe)
{
// std.math's FloatingPointControl isn't available on all target platforms
static if (is(FloatingPointControl))
{
switch (FloatingPointControl.rounding)
{
case FloatingPointControl.roundUp:
mode = RoundingMode.up;
break;
case FloatingPointControl.roundDown:
mode = RoundingMode.down;
break;
case FloatingPointControl.roundToZero:
mode = RoundingMode.toZero;
break;
case FloatingPointControl.roundToNearest:
mode = RoundingMode.toNearestTiesToEven;
break;
default: assert(false, "Unknown floating point rounding mode");
}
}
}
printFloat(w, tval, fs, mode);
}
@safe unittest
{
assert(format("%.1f", 1337.7) == "1337.7");
assert(format("%,3.2f", 1331.982) == "1,331.98");
assert(format("%,3.0f", 1303.1982) == "1,303");
assert(format("%#,3.4f", 1303.1982) == "1,303.1982");
assert(format("%#,3.0f", 1303.1982) == "1,303.");
}
@safe pure unittest
{
import std.conv : to;
import std.exception : collectExceptionMsg;
import std.format : FormatException;
import std.meta : AliasSeq;
import std.range.primitives : back;
assert(collectExceptionMsg!FormatException(format("%d", 5.1)).back == 'd');
static foreach (T; AliasSeq!(float, double, real))
{
formatTest(to!( T)(5.5), "5.5");
formatTest(to!( const T)(5.5), "5.5");
formatTest(to!(immutable T)(5.5), "5.5");
formatTest(T.nan, "nan");
}
}
@safe unittest
{
formatTest(2.25, "2.25");
class C1
{
double val;
alias val this;
this(double v){ val = v; }
}
class C2
{
double val;
alias val this;
this(double v){ val = v; }
override string toString() const { return "C"; }
}
() @trusted {
formatTest(new C1(2.25), "2.25");
formatTest(new C2(2.25), "C");
} ();
struct S1
{
double val;
alias val this;
}
struct S2
{
double val;
alias val this;
string toString() const { return "S"; }
}
formatTest(S1(2.25), "2.25");
formatTest(S2(2.25), "S");
}
// https://issues.dlang.org/show_bug.cgi?id=19939
@safe unittest
{
assert(format("^%13,3.2f$", 1.00) == "^ 1.00$");
assert(format("^%13,3.2f$", 10.00) == "^ 10.00$");
assert(format("^%13,3.2f$", 100.00) == "^ 100.00$");
assert(format("^%13,3.2f$", 1_000.00) == "^ 1,000.00$");
assert(format("^%13,3.2f$", 10_000.00) == "^ 10,000.00$");
assert(format("^%13,3.2f$", 100_000.00) == "^ 100,000.00$");
assert(format("^%13,3.2f$", 1_000_000.00) == "^ 1,000,000.00$");
assert(format("^%13,3.2f$", 10_000_000.00) == "^10,000,000.00$");
}
// https://issues.dlang.org/show_bug.cgi?id=20069
@safe unittest
{
assert(format("%012,f", -1234.0) == "-1,234.000000");
assert(format("%013,f", -1234.0) == "-1,234.000000");
assert(format("%014,f", -1234.0) == "-01,234.000000");
assert(format("%011,f", 1234.0) == "1,234.000000");
assert(format("%012,f", 1234.0) == "1,234.000000");
assert(format("%013,f", 1234.0) == "01,234.000000");
assert(format("%014,f", 1234.0) == "001,234.000000");
assert(format("%015,f", 1234.0) == "0,001,234.000000");
assert(format("%016,f", 1234.0) == "0,001,234.000000");
assert(format( "%08,.2f", -1234.0) == "-1,234.00");
assert(format( "%09,.2f", -1234.0) == "-1,234.00");
assert(format("%010,.2f", -1234.0) == "-01,234.00");
assert(format("%011,.2f", -1234.0) == "-001,234.00");
assert(format("%012,.2f", -1234.0) == "-0,001,234.00");
assert(format("%013,.2f", -1234.0) == "-0,001,234.00");
assert(format("%014,.2f", -1234.0) == "-00,001,234.00");
assert(format( "%08,.2f", 1234.0) == "1,234.00");
assert(format( "%09,.2f", 1234.0) == "01,234.00");
assert(format("%010,.2f", 1234.0) == "001,234.00");
assert(format("%011,.2f", 1234.0) == "0,001,234.00");
assert(format("%012,.2f", 1234.0) == "0,001,234.00");
assert(format("%013,.2f", 1234.0) == "00,001,234.00");
assert(format("%014,.2f", 1234.0) == "000,001,234.00");
assert(format("%015,.2f", 1234.0) == "0,000,001,234.00");
assert(format("%016,.2f", 1234.0) == "0,000,001,234.00");
}
@safe unittest
{
import std.math.hardware; // cannot be selective, because FloatingPointControl might not be defined
// std.math's FloatingPointControl isn't available on all target platforms
static if (is(FloatingPointControl))
{
assert(FloatingPointControl.rounding == FloatingPointControl.roundToNearest);
}
// issue 20320
real a = 0.16;
real b = 0.016;
assert(format("%.1f", a) == "0.2");
assert(format("%.2f", b) == "0.02");
double a1 = 0.16;
double b1 = 0.016;
assert(format("%.1f", a1) == "0.2");
assert(format("%.2f", b1) == "0.02");
// issue 9889
assert(format("%.1f", 0.09) == "0.1");
assert(format("%.1f", -0.09) == "-0.1");
assert(format("%.1f", 0.095) == "0.1");
assert(format("%.1f", -0.095) == "-0.1");
assert(format("%.1f", 0.094) == "0.1");
assert(format("%.1f", -0.094) == "-0.1");
}
@safe unittest
{
double a = 123.456;
double b = -123.456;
double c = 123.0;
assert(format("%10.4f",a) == " 123.4560");
assert(format("%-10.4f",a) == "123.4560 ");
assert(format("%+10.4f",a) == " +123.4560");
assert(format("% 10.4f",a) == " 123.4560");
assert(format("%010.4f",a) == "00123.4560");
assert(format("%#10.4f",a) == " 123.4560");
assert(format("%10.4f",b) == " -123.4560");
assert(format("%-10.4f",b) == "-123.4560 ");
assert(format("%+10.4f",b) == " -123.4560");
assert(format("% 10.4f",b) == " -123.4560");
assert(format("%010.4f",b) == "-0123.4560");
assert(format("%#10.4f",b) == " -123.4560");
assert(format("%10.0f",c) == " 123");
assert(format("%-10.0f",c) == "123 ");
assert(format("%+10.0f",c) == " +123");
assert(format("% 10.0f",c) == " 123");
assert(format("%010.0f",c) == "0000000123");
assert(format("%#10.0f",c) == " 123.");
assert(format("%+010.4f",a) == "+0123.4560");
assert(format("% 010.4f",a) == " 0123.4560");
assert(format("% +010.4f",a) == "+0123.4560");
}
@safe unittest
{
string t1 = format("[%6s] [%-6s]", 12.3, 12.3);
assert(t1 == "[ 12.3] [12.3 ]");
string t2 = format("[%6s] [%-6s]", -12.3, -12.3);
assert(t2 == "[ -12.3] [-12.3 ]");
}
// https://issues.dlang.org/show_bug.cgi?id=20396
@safe unittest
{
import std.math.operations : nextUp;
assert(format!"%a"(nextUp(0.0f)) == "0x0.000002p-126");
assert(format!"%a"(nextUp(0.0)) == "0x0.0000000000001p-1022");
}
// https://issues.dlang.org/show_bug.cgi?id=20371
@safe unittest
{
assert(format!"%.1000a"(1.0).length == 1007);
assert(format!"%.600f"(0.1).length == 602);
assert(format!"%.600e"(0.1L).length == 606);
}
@safe unittest
{
import std.math.hardware; // cannot be selective, because FloatingPointControl might not be defined
// std.math's FloatingPointControl isn't available on all target platforms
static if (is(FloatingPointControl))
{
FloatingPointControl fpctrl;
fpctrl.rounding = FloatingPointControl.roundUp;
assert(format!"%.0e"(3.5) == "4e+00");
assert(format!"%.0e"(4.5) == "5e+00");
assert(format!"%.0e"(-3.5) == "-3e+00");
assert(format!"%.0e"(-4.5) == "-4e+00");
fpctrl.rounding = FloatingPointControl.roundDown;
assert(format!"%.0e"(3.5) == "3e+00");
assert(format!"%.0e"(4.5) == "4e+00");
assert(format!"%.0e"(-3.5) == "-4e+00");
assert(format!"%.0e"(-4.5) == "-5e+00");
fpctrl.rounding = FloatingPointControl.roundToZero;
assert(format!"%.0e"(3.5) == "3e+00");
assert(format!"%.0e"(4.5) == "4e+00");
assert(format!"%.0e"(-3.5) == "-3e+00");
assert(format!"%.0e"(-4.5) == "-4e+00");
fpctrl.rounding = FloatingPointControl.roundToNearest;
assert(format!"%.0e"(3.5) == "4e+00");
assert(format!"%.0e"(4.5) == "4e+00");
assert(format!"%.0e"(-3.5) == "-4e+00");
assert(format!"%.0e"(-4.5) == "-4e+00");
}
}
@safe pure unittest
{
static assert(format("%e",1.0) == "1.000000e+00");
static assert(format("%e",-1.234e156) == "-1.234000e+156");
static assert(format("%a",1.0) == "0x1p+0");
static assert(format("%a",-1.234e156) == "-0x1.7024c96ca3ce4p+518");
static assert(format("%f",1.0) == "1.000000");
static assert(format("%f",-1.234e156) ==
"-123399999999999990477495546305353609103201879173427886566531" ~
"0740685826234179310516880117527217443004051984432279880308552" ~
"009640198043032289366552939010719744.000000");
static assert(format("%g",1.0) == "1");
static assert(format("%g",-1.234e156) == "-1.234e+156");
static assert(format("%e",1.0f) == "1.000000e+00");
static assert(format("%e",-1.234e23f) == "-1.234000e+23");
static assert(format("%a",1.0f) == "0x1p+0");
static assert(format("%a",-1.234e23f) == "-0x1.a2187p+76");
static assert(format("%f",1.0f) == "1.000000");
static assert(format("%f",-1.234e23f) == "-123399998884238311030784.000000");
static assert(format("%g",1.0f) == "1");
static assert(format("%g",-1.234e23f) == "-1.234e+23");
}
// https://issues.dlang.org/show_bug.cgi?id=21641
@safe unittest
{
float a = -999999.8125;
assert(format("%#.5g",a) == "-1.0000e+06");
assert(format("%#.6g",a) == "-1.00000e+06");
}
// https://issues.dlang.org/show_bug.cgi?id=8424
@safe pure unittest
{
static assert(format("%s", 0.6f) == "0.6");
static assert(format("%s", 0.6) == "0.6");
static assert(format("%s", 0.6L) == "0.6");
}
// https://issues.dlang.org/show_bug.cgi?id=9297
@safe pure unittest
{
static if (real.mant_dig == 64) // 80 bit reals
{
assert(format("%.25f", 1.6180339887_4989484820_4586834365L) == "1.6180339887498948482072100");
}
}
// https://issues.dlang.org/show_bug.cgi?id=21853
@safe pure unittest
{
import std.math.exponential : log2;
// log2 is broken for x87-reals on some computers in CTFE
// the following test excludes these computers from the test
// (issue 21757)
enum test = cast(int) log2(3.05e2312L);
static if (real.mant_dig == 64 && test == 7681) // 80 bit reals
{
static assert(format!"%e"(real.max) == "1.189731e+4932");
}
}
// https://issues.dlang.org/show_bug.cgi?id=21842
@safe pure unittest
{
assert(format!"%-+05,g"(1.0) == "+1 ");
}
// https://issues.dlang.org/show_bug.cgi?id=20536
@safe pure unittest
{
real r = .00000095367431640625L;
assert(format("%a", r) == "0x1p-20");
}
// https://issues.dlang.org/show_bug.cgi?id=21840
@safe pure unittest
{
assert(format!"% 0,e"(0.0) == " 0.000000e+00");
}
// https://issues.dlang.org/show_bug.cgi?id=21841
@safe pure unittest
{
assert(format!"%0.0,e"(0.0) == "0e+00");
}
// https://issues.dlang.org/show_bug.cgi?id=21836
@safe pure unittest
{
assert(format!"%-5,1g"(0.0) == "0 ");
}
// https://issues.dlang.org/show_bug.cgi?id=21838
@safe pure unittest
{
assert(format!"%#,a"(0.0) == "0x0.p+0");
}
/*
Formatting a `creal` is deprecated but still kept around for a while.
*/
deprecated("Use of complex types is deprecated. Use std.complex")
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(immutable T : immutable creal) && !is(T == enum) && !hasToString!(T, Char))
{
import std.range.primitives : put;
immutable creal val = obj;
formatValueImpl(w, val.re, f);
if (val.im >= 0)
{
put(w, '+');
}
formatValueImpl(w, val.im, f);
put(w, 'i');
}
/*
Formatting an `ireal` is deprecated but still kept around for a while.
*/
deprecated("Use of imaginary types is deprecated. Use std.complex")
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(immutable T : immutable ireal) && !is(T == enum) && !hasToString!(T, Char))
{
import std.range.primitives : put;
immutable ireal val = obj;
formatValueImpl(w, val.im, f);
put(w, 'i');
}
/*
Individual characters are formatted as Unicode characters with `%s`
and as integers with integral-specific format specs
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(CharTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
import std.meta : AliasSeq;
CharTypeOf!T[1] val = obj;
if (f.spec == 's' || f.spec == 'c')
writeAligned(w, val[], f);
else
{
alias U = AliasSeq!(ubyte, ushort, uint)[CharTypeOf!T.sizeof/2];
formatValueImpl(w, cast(U) val[0], f);
}
}
@safe pure unittest
{
assertCTFEable!(
{
formatTest('c', "c");
});
}
@safe unittest
{
class C1
{
char val;
alias val this;
this(char v){ val = v; }
}
class C2
{
char val;
alias val this;
this(char v){ val = v; }
override string toString() const { return "C"; }
}
() @trusted {
formatTest(new C1('c'), "c");
formatTest(new C2('c'), "C");
} ();
struct S1
{
char val;
alias val this;
}
struct S2
{
char val;
alias val this;
string toString() const { return "S"; }
}
formatTest(S1('c'), "c");
formatTest(S2('c'), "S");
}
@safe unittest
{
//Little Endian
formatTest("%-r", cast( char)'c', ['c' ]);
formatTest("%-r", cast(wchar)'c', ['c', 0 ]);
formatTest("%-r", cast(dchar)'c', ['c', 0, 0, 0]);
formatTest("%-r", '本', ['\x2c', '\x67'] );
//Big Endian
formatTest("%+r", cast( char)'c', [ 'c']);
formatTest("%+r", cast(wchar)'c', [0, 'c']);
formatTest("%+r", cast(dchar)'c', [0, 0, 0, 'c']);
formatTest("%+r", '本', ['\x67', '\x2c']);
}
@safe pure unittest
{
string t1 = format("[%6s] [%-6s]", 'A', 'A');
assert(t1 == "[ A] [A ]");
string t2 = format("[%6s] [%-6s]", '本', '本');
assert(t2 == "[ 本] [本 ]");
}
/*
Strings are formatted like $(REF printf, core, stdc, stdio)
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, scope T obj,
scope const ref FormatSpec!Char f)
if (is(StringTypeOf!T) && !is(StaticArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
Unqual!(StringTypeOf!T) val = obj; // for `alias this`, see bug5371
formatRange(w, val, f);
}
@safe unittest
{
formatTest("abc", "abc");
}
@safe pure unittest
{
import std.exception : collectExceptionMsg;
import std.range.primitives : back;
assert(collectExceptionMsg(format("%d", "hi")).back == 'd');
}
@safe unittest
{
// Test for bug 5371 for classes
class C1
{
const string var;
alias var this;
this(string s){ var = s; }
}
class C2
{
string var;
alias var this;
this(string s){ var = s; }
}
() @trusted {
formatTest(new C1("c1"), "c1");
formatTest(new C2("c2"), "c2");
} ();
// Test for bug 5371 for structs
struct S1
{
const string var;
alias var this;
}
struct S2
{
string var;
alias var this;
}
formatTest(S1("s1"), "s1");
formatTest(S2("s2"), "s2");
}
@safe unittest
{
class C3
{
string val;
alias val this;
this(string s){ val = s; }
override string toString() const { return "C"; }
}
() @trusted { formatTest(new C3("c3"), "C"); } ();
struct S3
{
string val; alias val this;
string toString() const { return "S"; }
}
formatTest(S3("s3"), "S");
}
@safe pure unittest
{
//Little Endian
formatTest("%-r", "ab"c, ['a' , 'b' ]);
formatTest("%-r", "ab"w, ['a', 0 , 'b', 0 ]);
formatTest("%-r", "ab"d, ['a', 0, 0, 0, 'b', 0, 0, 0]);
formatTest("%-r", "日本語"c, ['\xe6', '\x97', '\xa5', '\xe6', '\x9c', '\xac',
'\xe8', '\xaa', '\x9e']);
formatTest("%-r", "日本語"w, ['\xe5', '\x65', '\x2c', '\x67', '\x9e', '\x8a']);
formatTest("%-r", "日本語"d, ['\xe5', '\x65', '\x00', '\x00', '\x2c', '\x67',
'\x00', '\x00', '\x9e', '\x8a', '\x00', '\x00']);
//Big Endian
formatTest("%+r", "ab"c, [ 'a', 'b']);
formatTest("%+r", "ab"w, [ 0, 'a', 0, 'b']);
formatTest("%+r", "ab"d, [0, 0, 0, 'a', 0, 0, 0, 'b']);
formatTest("%+r", "日本語"c, ['\xe6', '\x97', '\xa5', '\xe6', '\x9c', '\xac',
'\xe8', '\xaa', '\x9e']);
formatTest("%+r", "日本語"w, ['\x65', '\xe5', '\x67', '\x2c', '\x8a', '\x9e']);
formatTest("%+r", "日本語"d, ['\x00', '\x00', '\x65', '\xe5', '\x00', '\x00',
'\x67', '\x2c', '\x00', '\x00', '\x8a', '\x9e']);
}
@safe pure unittest
{
string t1 = format("[%6s] [%-6s]", "AB", "AB");
assert(t1 == "[ AB] [AB ]");
string t2 = format("[%6s] [%-6s]", "本Ä", "本Ä");
assert(t2 == "[ 本Ä] [本Ä ]");
}
// https://issues.dlang.org/show_bug.cgi?id=6640
@safe unittest
{
import std.range.primitives : front, popFront;
struct Range
{
@safe:
string value;
@property bool empty() const { return !value.length; }
@property dchar front() const { return value.front; }
void popFront() { value.popFront(); }
@property size_t length() const { return value.length; }
}
immutable table =
[
["[%s]", "[string]"],
["[%10s]", "[ string]"],
["[%-10s]", "[string ]"],
["[%(%02x %)]", "[73 74 72 69 6e 67]"],
["[%(%c %)]", "[s t r i n g]"],
];
foreach (e; table)
{
formatTest(e[0], "string", e[1]);
formatTest(e[0], Range("string"), e[1]);
}
}
@safe unittest
{
import std.meta : AliasSeq;
// string literal from valid UTF sequence is encoding free.
static foreach (StrType; AliasSeq!(string, wstring, dstring))
{
// Valid and printable (ASCII)
formatTest([cast(StrType)"hello"],
`["hello"]`);
// 1 character escape sequences (' is not escaped in strings)
formatTest([cast(StrType)"\"'\0\\\a\b\f\n\r\t\v"],
`["\"'\0\\\a\b\f\n\r\t\v"]`);
// 1 character optional escape sequences
formatTest([cast(StrType)"\'\?"],
`["'?"]`);
// Valid and non-printable code point (<= U+FF)
formatTest([cast(StrType)"\x10\x1F\x20test"],
`["\x10\x1F test"]`);
// Valid and non-printable code point (<= U+FFFF)
formatTest([cast(StrType)"\u200B..\u200F"],
`["\u200B..\u200F"]`);
// Valid and non-printable code point (<= U+10FFFF)
formatTest([cast(StrType)"\U000E0020..\U000E007F"],
`["\U000E0020..\U000E007F"]`);
}
// invalid UTF sequence needs hex-string literal postfix (c/w/d)
() @trusted
{
// U+FFFF with UTF-8 (Invalid code point for interchange)
formatTest([cast(string)[0xEF, 0xBF, 0xBF]],
`[[cast(char) 0xEF, cast(char) 0xBF, cast(char) 0xBF]]`);
// U+FFFF with UTF-16 (Invalid code point for interchange)
formatTest([cast(wstring)[0xFFFF]],
`[[cast(wchar) 0xFFFF]]`);
// U+FFFF with UTF-32 (Invalid code point for interchange)
formatTest([cast(dstring)[0xFFFF]],
`[[cast(dchar) 0xFFFF]]`);
} ();
}
/*
Static-size arrays are formatted as dynamic arrays.
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, auto ref T obj,
scope const ref FormatSpec!Char f)
if (is(StaticArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
formatValueImpl(w, obj[], f);
}
// Test for https://issues.dlang.org/show_bug.cgi?id=8310
@safe unittest
{
import std.array : appender;
import std.format : formatValue;
FormatSpec!char f;
auto w = appender!string();
char[2] two = ['a', 'b'];
formatValue(w, two, f);
char[2] getTwo() { return two; }
formatValue(w, getTwo(), f);
}
// https://issues.dlang.org/show_bug.cgi?id=18205
@safe pure unittest
{
assert("|%8s|".format("abc") == "| abc|");
assert("|%8s|".format("αβγ") == "| αβγ|");
assert("|%8s|".format(" ") == "| |");
assert("|%8s|".format("été"d) == "| été|");
assert("|%8s|".format("été 2018"w) == "|été 2018|");
assert("%2s".format("e\u0301"w) == " e\u0301");
assert("%2s".format("a\u0310\u0337"d) == " a\u0310\u0337");
}
/*
Dynamic arrays are formatted as input ranges.
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(DynamicArrayTypeOf!T) && !is(StringTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
static if (is(immutable(ArrayTypeOf!T) == immutable(void[])))
{
formatValueImpl(w, cast(const ubyte[]) obj, f);
}
else static if (!isInputRange!T)
{
alias U = Unqual!(ArrayTypeOf!T);
static assert(isInputRange!U, U.stringof ~ " must be an InputRange");
U val = obj;
formatValueImpl(w, val, f);
}
else
{
formatRange(w, obj, f);
}
}
// https://issues.dlang.org/show_bug.cgi?id=20848
@safe unittest
{
class C
{
immutable(void)[] data;
}
import std.typecons : Nullable;
Nullable!C c;
}
// alias this, input range I/F, and toString()
@safe unittest
{
struct S(int flags)
{
int[] arr;
static if (flags & 1)
alias arr this;
static if (flags & 2)
{
@property bool empty() const { return arr.length == 0; }
@property int front() const { return arr[0] * 2; }
void popFront() { arr = arr[1 .. $]; }
}
static if (flags & 4)
string toString() const { return "S"; }
}
formatTest(S!0b000([0, 1, 2]), "S!0([0, 1, 2])");
formatTest(S!0b001([0, 1, 2]), "[0, 1, 2]"); // Test for bug 7628
formatTest(S!0b010([0, 1, 2]), "[0, 2, 4]");
formatTest(S!0b011([0, 1, 2]), "[0, 2, 4]");
formatTest(S!0b100([0, 1, 2]), "S");
formatTest(S!0b101([0, 1, 2]), "S"); // Test for bug 7628
formatTest(S!0b110([0, 1, 2]), "S");
formatTest(S!0b111([0, 1, 2]), "S");
class C(uint flags)
{
int[] arr;
static if (flags & 1)
alias arr this;
this(int[] a) { arr = a; }
static if (flags & 2)
{
@property bool empty() const { return arr.length == 0; }
@property int front() const { return arr[0] * 2; }
void popFront() { arr = arr[1 .. $]; }
}
static if (flags & 4)
override string toString() const { return "C"; }
}
() @trusted {
formatTest(new C!0b000([0, 1, 2]), (new C!0b000([])).toString());
formatTest(new C!0b001([0, 1, 2]), "[0, 1, 2]"); // Test for bug 7628
formatTest(new C!0b010([0, 1, 2]), "[0, 2, 4]");
formatTest(new C!0b011([0, 1, 2]), "[0, 2, 4]");
formatTest(new C!0b100([0, 1, 2]), "C");
formatTest(new C!0b101([0, 1, 2]), "C"); // Test for bug 7628
formatTest(new C!0b110([0, 1, 2]), "C");
formatTest(new C!0b111([0, 1, 2]), "C");
} ();
}
@safe unittest
{
// void[]
void[] val0;
formatTest(val0, "[]");
void[] val = cast(void[]) cast(ubyte[])[1, 2, 3];
formatTest(val, "[1, 2, 3]");
void[0] sval0 = [];
formatTest(sval0, "[]");
void[3] sval = () @trusted { return cast(void[3]) cast(ubyte[3])[1, 2, 3]; } ();
formatTest(sval, "[1, 2, 3]");
}
@safe unittest
{
// const(T[]) -> const(T)[]
const short[] a = [1, 2, 3];
formatTest(a, "[1, 2, 3]");
struct S
{
const(int[]) arr;
alias arr this;
}
auto s = S([1,2,3]);
formatTest(s, "[1, 2, 3]");
}
@safe unittest
{
// nested range formatting with array of string
formatTest("%({%(%02x %)}%| %)", ["test", "msg"],
`{74 65 73 74} {6d 73 67}`);
}
@safe unittest
{
// stop auto escaping inside range formatting
auto arr = ["hello", "world"];
formatTest("%(%s, %)", arr, `"hello", "world"`);
formatTest("%-(%s, %)", arr, `hello, world`);
auto aa1 = [1:"hello", 2:"world"];
formatTest("%(%s:%s, %)", aa1, [`1:"hello", 2:"world"`, `2:"world", 1:"hello"`]);
formatTest("%-(%s:%s, %)", aa1, [`1:hello, 2:world`, `2:world, 1:hello`]);
auto aa2 = [1:["ab", "cd"], 2:["ef", "gh"]];
formatTest("%-(%s:%s, %)", aa2, [`1:["ab", "cd"], 2:["ef", "gh"]`, `2:["ef", "gh"], 1:["ab", "cd"]`]);
formatTest("%-(%s:%(%s%), %)", aa2, [`1:"ab""cd", 2:"ef""gh"`, `2:"ef""gh", 1:"ab""cd"`]);
formatTest("%-(%s:%-(%s%)%|, %)", aa2, [`1:abcd, 2:efgh`, `2:efgh, 1:abcd`]);
}
// https://issues.dlang.org/show_bug.cgi?id=18778
@safe pure unittest
{
assert(format("%-(%1$s - %1$s, %)", ["A", "B", "C"]) == "A - A, B - B, C - C");
}
@safe pure unittest
{
int[] a = [ 1, 3, 2 ];
formatTest("testing %(%s & %) embedded", a,
"testing 1 & 3 & 2 embedded");
formatTest("testing %((%s) %)) wyda3", a,
"testing (1) (3) (2) wyda3");
int[0] empt = [];
formatTest("(%s)", empt, "([])");
}
// input range formatting
private void formatRange(Writer, T, Char)(ref Writer w, ref T val, scope const ref FormatSpec!Char f)
if (isInputRange!T)
{
import std.conv : text;
import std.format : FormatException, formatValue, NoOpSink;
import std.range.primitives : ElementType, empty, front, hasLength,
walkLength, isForwardRange, isInfinite, popFront, put;
// in this mode, we just want to do a representative print to discover
// if the format spec is valid
enum formatTestMode = is(Writer == NoOpSink);
// Formatting character ranges like string
if (f.spec == 's')
{
alias E = ElementType!T;
static if (!is(E == enum) && is(CharTypeOf!E))
{
static if (is(StringTypeOf!T))
writeAligned(w, val[0 .. f.precision < $ ? f.precision : $], f);
else
{
if (!f.flDash)
{
static if (hasLength!T)
{
// right align
auto len = val.length;
}
else static if (isForwardRange!T && !isInfinite!T)
{
auto len = walkLength(val.save);
}
else
{
import std.format : enforceFmt;
enforceFmt(f.width == 0, "Cannot right-align a range without length");
size_t len = 0;
}
if (f.precision != f.UNSPECIFIED && len > f.precision)
len = f.precision;
if (f.width > len)
foreach (i ; 0 .. f.width - len)
put(w, ' ');
if (f.precision == f.UNSPECIFIED)
put(w, val);
else
{
size_t printed = 0;
for (; !val.empty && printed < f.precision; val.popFront(), ++printed)
put(w, val.front);
}
}
else
{
size_t printed = void;
// left align
if (f.precision == f.UNSPECIFIED)
{
static if (hasLength!T)
{
printed = val.length;
put(w, val);
}
else
{
printed = 0;
for (; !val.empty; val.popFront(), ++printed)
{
put(w, val.front);
static if (formatTestMode) break; // one is enough to test
}
}
}
else
{
printed = 0;
for (; !val.empty && printed < f.precision; val.popFront(), ++printed)
put(w, val.front);
}
if (f.width > printed)
foreach (i ; 0 .. f.width - printed)
put(w, ' ');
}
}
}
else
{
put(w, f.seqBefore);
if (!val.empty)
{
formatElement(w, val.front, f);
val.popFront();
for (size_t i; !val.empty; val.popFront(), ++i)
{
put(w, f.seqSeparator);
formatElement(w, val.front, f);
static if (formatTestMode) break; // one is enough to test
}
}
static if (!isInfinite!T) put(w, f.seqAfter);
}
}
else if (f.spec == 'r')
{
static if (is(DynamicArrayTypeOf!T))
{
alias ARR = DynamicArrayTypeOf!T;
scope a = cast(ARR) val;
foreach (e ; a)
{
formatValue(w, e, f);
static if (formatTestMode) break; // one is enough to test
}
}
else
{
for (size_t i; !val.empty; val.popFront(), ++i)
{
formatValue(w, val.front, f);
static if (formatTestMode) break; // one is enough to test
}
}
}
else if (f.spec == '(')
{
if (val.empty)
return;
// Nested specifier is to be used
for (;;)
{
auto fmt = FormatSpec!Char(f.nested);
w: while (true)
{
immutable r = fmt.writeUpToNextSpec(w);
// There was no format specifier, so break
if (!r)
break;
if (f.flDash)
formatValue(w, val.front, fmt);
else
formatElement(w, val.front, fmt);
// Check if there will be a format specifier farther on in the
// string. If so, continue the loop, otherwise break. This
// prevents extra copies of the `sep` from showing up.
foreach (size_t i; 0 .. fmt.trailing.length)
if (fmt.trailing[i] == '%')
continue w;
break w;
}
static if (formatTestMode)
{
break; // one is enough to test
}
else
{
if (f.sep !is null)
{
put(w, fmt.trailing);
val.popFront();
if (val.empty)
break;
put(w, f.sep);
}
else
{
val.popFront();
if (val.empty)
break;
put(w, fmt.trailing);
}
}
}
}
else
throw new FormatException(text("Incorrect format specifier for range: %", f.spec));
}
// https://issues.dlang.org/show_bug.cgi?id=20218
@safe pure unittest
{
void notCalled()
{
import std.range : repeat;
auto value = 1.repeat;
// test that range is not evaluated to completion at compiletime
format!"%s"(value);
}
}
// character formatting with ecaping
void formatChar(Writer)(ref Writer w, in dchar c, in char quote)
{
import std.format : formattedWrite;
import std.range.primitives : put;
import std.uni : isGraphical;
string fmt;
if (isGraphical(c))
{
if (c == quote || c == '\\')
put(w, '\\');
put(w, c);
return;
}
else if (c <= 0xFF)
{
if (c < 0x20)
{
foreach (i, k; "\n\r\t\a\b\f\v\0")
{
if (c == k)
{
put(w, '\\');
put(w, "nrtabfv0"[i]);
return;
}
}
}
fmt = "\\x%02X";
}
else if (c <= 0xFFFF)
fmt = "\\u%04X";
else
fmt = "\\U%08X";
formattedWrite(w, fmt, cast(uint) c);
}
/*
Associative arrays are formatted by using `':'` and $(D ", ") as
separators, and enclosed by `'['` and `']'`.
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(AssocArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
import std.format : enforceFmt, formatValue;
import std.range.primitives : put;
AssocArrayTypeOf!T val = obj;
const spec = f.spec;
enforceFmt(spec == 's' || spec == '(',
"incompatible format character for associative array argument: %" ~ spec);
enum const(Char)[] defSpec = "%s" ~ f.keySeparator ~ "%s" ~ f.seqSeparator;
auto fmtSpec = spec == '(' ? f.nested : defSpec;
auto key_first = true;
// testing correct nested format spec
import std.format : NoOpSink;
auto noop = NoOpSink();
auto test = FormatSpec!Char(fmtSpec);
enforceFmt(test.writeUpToNextSpec(noop),
"nested format string for associative array contains no format specifier");
enforceFmt(test.indexStart <= 2,
"positional parameter in nested format string for associative array may only be 1 or 2");
if (test.indexStart == 2)
key_first = false;
enforceFmt(test.writeUpToNextSpec(noop),
"nested format string for associative array contains only one format specifier");
enforceFmt(test.indexStart <= 2,
"positional parameter in nested format string for associative array may only be 1 or 2");
enforceFmt(test.indexStart == 0 || ((test.indexStart == 2) == key_first),
"wrong combination of positional parameters in nested format string");
enforceFmt(!test.writeUpToNextSpec(noop),
"nested format string for associative array contains more than two format specifiers");
size_t i = 0;
immutable end = val.length;
if (spec == 's')
put(w, f.seqBefore);
foreach (k, ref v; val)
{
auto fmt = FormatSpec!Char(fmtSpec);
foreach (pos; 1 .. 3)
{
fmt.writeUpToNextSpec(w);
if (key_first == (pos == 1))
{
if (f.flDash)
formatValue(w, k, fmt);
else
formatElement(w, k, fmt);
}
else
{
if (f.flDash)
formatValue(w, v, fmt);
else
formatElement(w, v, fmt);
}
}
if (f.sep !is null)
{
fmt.writeUpToNextSpec(w);
if (++i != end)
put(w, f.sep);
}
else
{
if (++i != end)
fmt.writeUpToNextSpec(w);
}
}
if (spec == 's')
put(w, f.seqAfter);
}
@safe unittest
{
import std.exception : collectExceptionMsg;
import std.format : FormatException;
import std.range.primitives : back;
assert(collectExceptionMsg!FormatException(format("%d", [0:1])).back == 'd');
int[string] aa0;
formatTest(aa0, `[]`);
// elements escaping
formatTest(["aaa":1, "bbb":2],
[`["aaa":1, "bbb":2]`, `["bbb":2, "aaa":1]`]);
formatTest(['c':"str"],
`['c':"str"]`);
formatTest(['"':"\"", '\'':"'"],
[`['"':"\"", '\'':"'"]`, `['\'':"'", '"':"\""]`]);
// range formatting for AA
auto aa3 = [1:"hello", 2:"world"];
// escape
formatTest("{%(%s:%s $ %)}", aa3,
[`{1:"hello" $ 2:"world"}`, `{2:"world" $ 1:"hello"}`]);
// use range formatting for key and value, and use %|
formatTest("{%([%04d->%(%c.%)]%| $ %)}", aa3,
[`{[0001->h.e.l.l.o] $ [0002->w.o.r.l.d]}`,
`{[0002->w.o.r.l.d] $ [0001->h.e.l.l.o]}`]);
// https://issues.dlang.org/show_bug.cgi?id=12135
formatTest("%(%s:<%s>%|,%)", [1:2], "1:<2>");
formatTest("%(%s:<%s>%|%)" , [1:2], "1:<2>");
}
@safe unittest
{
class C1
{
int[char] val;
alias val this;
this(int[char] v){ val = v; }
}
class C2
{
int[char] val;
alias val this;
this(int[char] v){ val = v; }
override string toString() const { return "C"; }
}
() @trusted {
formatTest(new C1(['c':1, 'd':2]), [`['c':1, 'd':2]`, `['d':2, 'c':1]`]);
formatTest(new C2(['c':1, 'd':2]), "C");
} ();
struct S1
{
int[char] val;
alias val this;
}
struct S2
{
int[char] val;
alias val this;
string toString() const { return "S"; }
}
formatTest(S1(['c':1, 'd':2]), [`['c':1, 'd':2]`, `['d':2, 'c':1]`]);
formatTest(S2(['c':1, 'd':2]), "S");
}
// https://issues.dlang.org/show_bug.cgi?id=21875
@safe unittest
{
import std.exception : assertThrown;
import std.format : FormatException;
auto aa = [ 1 : "x", 2 : "y", 3 : "z" ];
assertThrown!FormatException(format("%(%)", aa));
assertThrown!FormatException(format("%(%s%)", aa));
assertThrown!FormatException(format("%(%s%s%s%)", aa));
}
@safe unittest
{
import std.exception : assertThrown;
import std.format : FormatException;
auto aa = [ 1 : "x", 2 : "y", 3 : "z" ];
assertThrown!FormatException(format("%(%3$s%s%)", aa));
assertThrown!FormatException(format("%(%s%3$s%)", aa));
assertThrown!FormatException(format("%(%1$s%1$s%)", aa));
assertThrown!FormatException(format("%(%2$s%2$s%)", aa));
assertThrown!FormatException(format("%(%s%1$s%)", aa));
}
// https://issues.dlang.org/show_bug.cgi?id=21808
@safe unittest
{
auto spelled = [ 1 : "one" ];
assert(format("%-(%2$s (%1$s)%|, %)", spelled) == "one (1)");
spelled[2] = "two";
auto result = format("%-(%2$s (%1$s)%|, %)", spelled);
assert(result == "one (1), two (2)" || result == "two (2), one (1)");
}
enum HasToStringResult
{
none,
hasSomeToString,
inCharSink,
inCharSinkFormatString,
inCharSinkFormatSpec,
constCharSink,
constCharSinkFormatString,
constCharSinkFormatSpec,
customPutWriter,
customPutWriterFormatSpec,
}
private enum hasPreviewIn = !is(typeof(mixin(q{(in ref int a) => a})));
template hasToString(T, Char)
{
static if (isPointer!T)
{
// X* does not have toString, even if X is aggregate type has toString.
enum hasToString = HasToStringResult.none;
}
else static if (is(typeof(
{
T val = void;
const FormatSpec!Char f;
static struct S {void put(scope Char s){}}
S s;
val.toString(s, f);
static assert(!__traits(compiles, val.toString(s, FormatSpec!Char())),
"force toString to take parameters by ref");
static assert(!__traits(compiles, val.toString(S(), f)),
"force toString to take parameters by ref");
})))
{
enum hasToString = HasToStringResult.customPutWriterFormatSpec;
}
else static if (is(typeof(
{
T val = void;
static struct S {void put(scope Char s){}}
S s;
val.toString(s);
static assert(!__traits(compiles, val.toString(S())),
"force toString to take parameters by ref");
})))
{
enum hasToString = HasToStringResult.customPutWriter;
}
else static if (is(typeof({ T val = void; FormatSpec!Char f; val.toString((scope const(char)[] s){}, f); })))
{
enum hasToString = HasToStringResult.constCharSinkFormatSpec;
}
else static if (is(typeof({ T val = void; val.toString((scope const(char)[] s){}, "%s"); })))
{
enum hasToString = HasToStringResult.constCharSinkFormatString;
}
else static if (is(typeof({ T val = void; val.toString((scope const(char)[] s){}); })))
{
enum hasToString = HasToStringResult.constCharSink;
}
else static if (hasPreviewIn &&
is(typeof({ T val = void; FormatSpec!Char f; val.toString((in char[] s){}, f); })))
{
enum hasToString = HasToStringResult.inCharSinkFormatSpec;
}
else static if (hasPreviewIn &&
is(typeof({ T val = void; val.toString((in char[] s){}, "%s"); })))
{
enum hasToString = HasToStringResult.inCharSinkFormatString;
}
else static if (hasPreviewIn &&
is(typeof({ T val = void; val.toString((in char[] s){}); })))
{
enum hasToString = HasToStringResult.inCharSink;
}
else static if (is(typeof({ T val = void; return val.toString(); }()) S) && isSomeString!S)
{
enum hasToString = HasToStringResult.hasSomeToString;
}
else
{
enum hasToString = HasToStringResult.none;
}
}
@safe unittest
{
import std.range.primitives : isOutputRange;
static struct A
{
void toString(Writer)(ref Writer w)
if (isOutputRange!(Writer, string))
{}
}
static struct B
{
void toString(scope void delegate(scope const(char)[]) sink, scope FormatSpec!char fmt) {}
}
static struct C
{
void toString(scope void delegate(scope const(char)[]) sink, string fmt) {}
}
static struct D
{
void toString(scope void delegate(scope const(char)[]) sink) {}
}
static struct E
{
string toString() {return "";}
}
static struct F
{
void toString(Writer)(ref Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct G
{
string toString() {return "";}
void toString(Writer)(ref Writer w) if (isOutputRange!(Writer, string)) {}
}
static struct H
{
string toString() {return "";}
void toString(Writer)(ref Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct I
{
void toString(Writer)(ref Writer w) if (isOutputRange!(Writer, string)) {}
void toString(Writer)(ref Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct J
{
string toString() {return "";}
void toString(Writer)(ref Writer w, scope ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct K
{
void toString(Writer)(Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct L
{
void toString(Writer)(ref Writer w, scope const FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct M
{
void toString(scope void delegate(in char[]) sink, in FormatSpec!char fmt) {}
}
static struct N
{
void toString(scope void delegate(in char[]) sink, string fmt) {}
}
static struct O
{
void toString(scope void delegate(in char[]) sink) {}
}
with(HasToStringResult)
{
static assert(hasToString!(A, char) == customPutWriter);
static assert(hasToString!(B, char) == constCharSinkFormatSpec);
static assert(hasToString!(C, char) == constCharSinkFormatString);
static assert(hasToString!(D, char) == constCharSink);
static assert(hasToString!(E, char) == hasSomeToString);
static assert(hasToString!(F, char) == customPutWriterFormatSpec);
static assert(hasToString!(G, char) == customPutWriter);
static assert(hasToString!(H, char) == customPutWriterFormatSpec);
static assert(hasToString!(I, char) == customPutWriterFormatSpec);
static assert(hasToString!(J, char) == hasSomeToString);
static assert(hasToString!(K, char) == constCharSinkFormatSpec);
static assert(hasToString!(L, char) == none);
static if (hasPreviewIn)
{
static assert(hasToString!(M, char) == inCharSinkFormatSpec);
static assert(hasToString!(N, char) == inCharSinkFormatString);
static assert(hasToString!(O, char) == inCharSink);
}
}
}
// object formatting with toString
private void formatObject(Writer, T, Char)(ref Writer w, ref T val, scope const ref FormatSpec!Char f)
if (hasToString!(T, Char))
{
import std.format : NoOpSink;
import std.range.primitives : put;
enum overload = hasToString!(T, Char);
enum noop = is(Writer == NoOpSink);
static if (overload == HasToStringResult.customPutWriterFormatSpec)
{
static if (!noop) val.toString(w, f);
}
else static if (overload == HasToStringResult.customPutWriter)
{
static if (!noop) val.toString(w);
}
else static if (overload == HasToStringResult.constCharSinkFormatSpec)
{
static if (!noop) val.toString((scope const(char)[] s) { put(w, s); }, f);
}
else static if (overload == HasToStringResult.constCharSinkFormatString)
{
static if (!noop) val.toString((scope const(char)[] s) { put(w, s); }, f.getCurFmtStr());
}
else static if (overload == HasToStringResult.constCharSink)
{
static if (!noop) val.toString((scope const(char)[] s) { put(w, s); });
}
else static if (overload == HasToStringResult.inCharSinkFormatSpec)
{
static if (!noop) val.toString((in char[] s) { put(w, s); }, f);
}
else static if (overload == HasToStringResult.inCharSinkFormatString)
{
static if (!noop) val.toString((in char[] s) { put(w, s); }, f.getCurFmtStr());
}
else static if (overload == HasToStringResult.inCharSink)
{
static if (!noop) val.toString((in char[] s) { put(w, s); });
}
else static if (overload == HasToStringResult.hasSomeToString)
{
static if (!noop) put(w, val.toString());
}
else
{
static assert(0, "No way found to format " ~ T.stringof ~ " as string");
}
}
@system unittest
{
import std.exception : assertThrown;
import std.format : FormatException;
static interface IF1 { }
class CIF1 : IF1 { }
static struct SF1 { }
static union UF1 { }
static class CF1 { }
static interface IF2 { string toString(); }
static class CIF2 : IF2 { override string toString() { return ""; } }
static struct SF2 { string toString() { return ""; } }
static union UF2 { string toString() { return ""; } }
static class CF2 { override string toString() { return ""; } }
static interface IK1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const; }
static class CIK1 : IK1 { override void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("CIK1"); } }
static struct KS1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("KS1"); } }
static union KU1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("KU1"); } }
static class KC1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("KC1"); } }
IF1 cif1 = new CIF1;
assertThrown!FormatException(format("%f", cif1));
assertThrown!FormatException(format("%f", SF1()));
assertThrown!FormatException(format("%f", UF1()));
assertThrown!FormatException(format("%f", new CF1()));
IF2 cif2 = new CIF2;
assertThrown!FormatException(format("%f", cif2));
assertThrown!FormatException(format("%f", SF2()));
assertThrown!FormatException(format("%f", UF2()));
assertThrown!FormatException(format("%f", new CF2()));
IK1 cik1 = new CIK1;
assert(format("%f", cik1) == "CIK1");
assert(format("%f", KS1()) == "KS1");
assert(format("%f", KU1()) == "KU1");
assert(format("%f", new KC1()) == "KC1");
}
/*
Aggregates
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(T == class) && !is(T == enum))
{
import std.range.primitives : put;
enforceValidFormatSpec!(T, Char)(f);
// TODO: remove this check once `@disable override` deprecation cycle is finished
static if (__traits(hasMember, T, "toString") && isSomeFunction!(val.toString))
static assert(!__traits(isDisabled, T.toString), T.stringof ~
" cannot be formatted because its `toString` is marked with `@disable`");
if (val is null)
put(w, "null");
else
{
import std.algorithm.comparison : among;
enum overload = hasToString!(T, Char);
with(HasToStringResult)
static if ((is(T == immutable) || is(T == const) || is(T == shared)) && overload == none)
{
// Remove this when Object gets const toString
// https://issues.dlang.org/show_bug.cgi?id=7879
static if (is(T == immutable))
put(w, "immutable(");
else static if (is(T == const))
put(w, "const(");
else static if (is(T == shared))
put(w, "shared(");
put(w, typeid(Unqual!T).name);
put(w, ')');
}
else static if (overload.among(constCharSink, constCharSinkFormatString, constCharSinkFormatSpec) ||
(!isInputRange!T && !is(BuiltinTypeOf!T)))
{
formatObject!(Writer, T, Char)(w, val, f);
}
else
{
// string delegate() dg = &val.toString;
Object o = val; // workaround
string delegate() dg = &o.toString;
scope Object object = new Object();
if (dg.funcptr != (&object.toString).funcptr) // toString is overridden
{
formatObject(w, val, f);
}
else static if (isInputRange!T)
{
formatRange(w, val, f);
}
else static if (is(BuiltinTypeOf!T X))
{
X x = val;
formatValueImpl(w, x, f);
}
else
{
formatObject(w, val, f);
}
}
}
}
@system unittest
{
import std.array : appender;
import std.range.interfaces : inputRangeObject;
// class range (https://issues.dlang.org/show_bug.cgi?id=5154)
auto c = inputRangeObject([1,2,3,4]);
formatTest(c, "[1, 2, 3, 4]");
assert(c.empty);
c = null;
formatTest(c, "null");
}
@system unittest
{
// https://issues.dlang.org/show_bug.cgi?id=5354
// If the class has both range I/F and custom toString, the use of custom
// toString routine is prioritized.
// Enable the use of custom toString that gets a sink delegate
// for class formatting.
enum inputRangeCode =
q{
int[] arr;
this(int[] a){ arr = a; }
@property int front() const { return arr[0]; }
@property bool empty() const { return arr.length == 0; }
void popFront(){ arr = arr[1 .. $]; }
};
class C1
{
mixin(inputRangeCode);
void toString(scope void delegate(scope const(char)[]) dg,
scope const ref FormatSpec!char f) const
{
dg("[012]");
}
}
class C2
{
mixin(inputRangeCode);
void toString(scope void delegate(const(char)[]) dg, string f) const { dg("[012]"); }
}
class C3
{
mixin(inputRangeCode);
void toString(scope void delegate(const(char)[]) dg) const { dg("[012]"); }
}
class C4
{
mixin(inputRangeCode);
override string toString() const { return "[012]"; }
}
class C5
{
mixin(inputRangeCode);
}
formatTest(new C1([0, 1, 2]), "[012]");
formatTest(new C2([0, 1, 2]), "[012]");
formatTest(new C3([0, 1, 2]), "[012]");
formatTest(new C4([0, 1, 2]), "[012]");
formatTest(new C5([0, 1, 2]), "[0, 1, 2]");
}
// outside the unittest block, otherwise the FQN of the
// class contains the line number of the unittest
version (StdUnittest)
{
private class C {}
}
// https://issues.dlang.org/show_bug.cgi?id=7879
@safe unittest
{
const(C) c;
auto s = format("%s", c);
assert(s == "null");
immutable(C) c2 = new C();
s = format("%s", c2);
assert(s == "immutable(std.format.internal.write.C)");
const(C) c3 = new C();
s = format("%s", c3);
assert(s == "const(std.format.internal.write.C)");
shared(C) c4 = new C();
s = format("%s", c4);
assert(s == "shared(std.format.internal.write.C)");
}
// https://issues.dlang.org/show_bug.cgi?id=7879
@safe unittest
{
class F
{
override string toString() const @safe
{
return "Foo";
}
}
const(F) c;
auto s = format("%s", c);
assert(s == "null");
const(F) c2 = new F();
s = format("%s", c2);
assert(s == "Foo", s);
}
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(T == interface) && (hasToString!(T, Char) || !is(BuiltinTypeOf!T)) && !is(T == enum))
{
import std.range.primitives : put;
enforceValidFormatSpec!(T, Char)(f);
if (val is null)
put(w, "null");
else
{
static if (__traits(hasMember, T, "toString") && isSomeFunction!(val.toString))
static assert(!__traits(isDisabled, T.toString), T.stringof ~
" cannot be formatted because its `toString` is marked with `@disable`");
static if (hasToString!(T, Char) != HasToStringResult.none)
{
formatObject(w, val, f);
}
else static if (isInputRange!T)
{
formatRange(w, val, f);
}
else
{
version (Windows)
{
import core.sys.windows.com : IUnknown;
static if (is(T : IUnknown))
{
formatValueImpl(w, *cast(void**)&val, f);
}
else
{
formatValueImpl(w, cast(Object) val, f);
}
}
else
{
formatValueImpl(w, cast(Object) val, f);
}
}
}
}
@system unittest
{
import std.range.interfaces : InputRange, inputRangeObject;
// interface
InputRange!int i = inputRangeObject([1,2,3,4]);
formatTest(i, "[1, 2, 3, 4]");
assert(i.empty);
i = null;
formatTest(i, "null");
// interface (downcast to Object)
interface Whatever {}
class C : Whatever
{
override @property string toString() const { return "ab"; }
}
Whatever val = new C;
formatTest(val, "ab");
// https://issues.dlang.org/show_bug.cgi?id=11175
version (Windows)
{
import core.sys.windows.com : IID, IUnknown;
import core.sys.windows.windef : HRESULT;
interface IUnknown2 : IUnknown { }
class D : IUnknown2
{
extern(Windows) HRESULT QueryInterface(const(IID)* riid, void** pvObject) { return typeof(return).init; }
extern(Windows) uint AddRef() { return 0; }
extern(Windows) uint Release() { return 0; }
}
IUnknown2 d = new D;
string expected = format("%X", cast(void*) d);
formatTest(d, expected);
}
}
// Maybe T is noncopyable struct, so receive it by 'auto ref'.
void formatValueImpl(Writer, T, Char)(auto ref Writer w, auto ref T val,
scope const ref FormatSpec!Char f)
if ((is(T == struct) || is(T == union)) && (hasToString!(T, Char) || !is(BuiltinTypeOf!T))
&& !is(T == enum))
{
import std.range.primitives : put;
static if (__traits(hasMember, T, "toString") && isSomeFunction!(val.toString))
static assert(!__traits(isDisabled, T.toString), T.stringof ~
" cannot be formatted because its `toString` is marked with `@disable`");
enforceValidFormatSpec!(T, Char)(f);
static if (hasToString!(T, Char))
{
formatObject(w, val, f);
}
else static if (isInputRange!T)
{
formatRange(w, val, f);
}
else static if (is(T == struct))
{
enum left = T.stringof~"(";
enum separator = ", ";
enum right = ")";
put(w, left);
foreach (i, e; val.tupleof)
{
static if (__traits(identifier, val.tupleof[i]) == "this")
continue;
else static if (0 < i && val.tupleof[i-1].offsetof == val.tupleof[i].offsetof)
{
static if (i == val.tupleof.length - 1 || val.tupleof[i].offsetof != val.tupleof[i+1].offsetof)
put(w, separator~val.tupleof[i].stringof[4 .. $]~"}");
else
put(w, separator~val.tupleof[i].stringof[4 .. $]);
}
else static if (i+1 < val.tupleof.length && val.tupleof[i].offsetof == val.tupleof[i+1].offsetof)
put(w, (i > 0 ? separator : "")~"#{overlap "~val.tupleof[i].stringof[4 .. $]);
else
{
static if (i > 0)
put(w, separator);
formatElement(w, e, f);
}
}
put(w, right);
}
else
{
put(w, T.stringof);
}
}
// https://issues.dlang.org/show_bug.cgi?id=9588
@safe pure unittest
{
struct S { int x; bool empty() { return false; } }
formatTest(S(), "S(0)");
}
// https://issues.dlang.org/show_bug.cgi?id=4638
@safe unittest
{
struct U8 { string toString() const { return "blah"; } }
struct U16 { wstring toString() const { return "blah"; } }
struct U32 { dstring toString() const { return "blah"; } }
formatTest(U8(), "blah");
formatTest(U16(), "blah");
formatTest(U32(), "blah");
}
// https://issues.dlang.org/show_bug.cgi?id=3890
@safe unittest
{
struct Int{ int n; }
struct Pair{ string s; Int i; }
formatTest(Pair("hello", Int(5)),
`Pair("hello", Int(5))`);
}
// https://issues.dlang.org/show_bug.cgi?id=9117
@safe unittest
{
import std.format : formattedWrite;
static struct Frop {}
static struct Foo
{
int n = 0;
alias n this;
T opCast(T) () if (is(T == Frop))
{
return Frop();
}
string toString()
{
return "Foo";
}
}
static struct Bar
{
Foo foo;
alias foo this;
string toString()
{
return "Bar";
}
}
const(char)[] result;
void put(scope const char[] s) { result ~= s; }
Foo foo;
formattedWrite(&put, "%s", foo); // OK
assert(result == "Foo");
result = null;
Bar bar;
formattedWrite(&put, "%s", bar); // NG
assert(result == "Bar");
result = null;
int i = 9;
formattedWrite(&put, "%s", 9);
assert(result == "9");
}
@safe unittest
{
// union formatting without toString
union U1
{
int n;
string s;
}
U1 u1;
formatTest(u1, "U1");
// union formatting with toString
union U2
{
int n;
string s;
string toString() const { return s; }
}
U2 u2;
() @trusted { u2.s = "hello"; } ();
formatTest(u2, "hello");
}
@safe unittest
{
import std.array : appender;
import std.format : formatValue;
// https://issues.dlang.org/show_bug.cgi?id=7230
static struct Bug7230
{
string s = "hello";
union {
string a;
int b;
double c;
}
long x = 10;
}
Bug7230 bug;
bug.b = 123;
FormatSpec!char f;
auto w = appender!(char[])();
formatValue(w, bug, f);
assert(w.data == `Bug7230("hello", #{overlap a, b, c}, 10)`);
}
@safe unittest
{
import std.array : appender;
import std.format : formatValue;
static struct S{ @disable this(this); }
S s;
FormatSpec!char f;
auto w = appender!string();
formatValue(w, s, f);
assert(w.data == "S()");
}
@safe unittest
{
import std.array : appender;
import std.format : formatValue;
//struct Foo { @disable string toString(); }
//Foo foo;
interface Bar { @disable string toString(); }
Bar bar;
auto w = appender!(char[])();
FormatSpec!char f;
// NOTE: structs cant be tested : the assertion is correct so compilation
// continues and fails when trying to link the unimplemented toString.
//static assert(!__traits(compiles, formatValue(w, foo, f)));
static assert(!__traits(compiles, formatValue(w, bar, f)));
}
// https://issues.dlang.org/show_bug.cgi?id=21722
@safe unittest
{
struct Bar
{
void toString (scope void delegate (scope const(char)[]) sink, string fmt)
{
sink("Hello");
}
}
Bar b;
auto result = () @trusted { return format("%b", b); } ();
assert(result == "Hello");
static if (hasPreviewIn)
{
struct Foo
{
void toString(scope void delegate(in char[]) sink, in FormatSpec!char fmt)
{
sink("Hello");
}
}
Foo f;
assert(format("%b", f) == "Hello");
struct Foo2
{
void toString(scope void delegate(in char[]) sink, string fmt)
{
sink("Hello");
}
}
Foo2 f2;
assert(format("%b", f2) == "Hello");
}
}
@safe unittest
{
import std.array : appender;
import std.format : singleSpec;
// Bug #17269. Behavior similar to `struct A { Nullable!string B; }`
struct StringAliasThis
{
@property string value() const { assert(0); }
alias value this;
string toString() { return "helloworld"; }
private string _value;
}
struct TestContainer
{
StringAliasThis testVar;
}
auto w = appender!string();
auto spec = singleSpec("%s");
formatElement(w, TestContainer(), spec);
assert(w.data == "TestContainer(helloworld)", w.data);
}
// https://issues.dlang.org/show_bug.cgi?id=17269
@safe unittest
{
import std.typecons : Nullable;
struct Foo
{
Nullable!string bar;
}
Foo f;
formatTest(f, "Foo(Nullable.null)");
}
// https://issues.dlang.org/show_bug.cgi?id=19003
@safe unittest
{
struct S
{
int i;
@disable this();
invariant { assert(this.i); }
this(int i) @safe in { assert(i); } do { this.i = i; }
string toString() { return "S"; }
}
S s = S(1);
format!"%s"(s);
}
void enforceValidFormatSpec(T, Char)(scope const ref FormatSpec!Char f)
{
import std.format : enforceFmt;
import std.range : isInputRange;
import std.format.internal.write : hasToString, HasToStringResult;
enum overload = hasToString!(T, Char);
static if (
overload != HasToStringResult.constCharSinkFormatSpec &&
overload != HasToStringResult.constCharSinkFormatString &&
overload != HasToStringResult.inCharSinkFormatSpec &&
overload != HasToStringResult.inCharSinkFormatString &&
overload != HasToStringResult.customPutWriterFormatSpec &&
!isInputRange!T)
{
enforceFmt(f.spec == 's',
"Expected '%s' format specifier for type '" ~ T.stringof ~ "'");
}
}
/*
`enum`s are formatted like their base value
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(T == enum))
{
import std.array : appender;
import std.range.primitives : put;
if (f.spec == 's')
{
foreach (i, e; EnumMembers!T)
{
if (val == e)
{
formatValueImpl(w, __traits(allMembers, T)[i], f);
return;
}
}
auto w2 = appender!string();
// val is not a member of T, output cast(T) rawValue instead.
put(w2, "cast(" ~ T.stringof ~ ")");
static assert(!is(OriginalType!T == T), "OriginalType!" ~ T.stringof ~
"must not be equal to " ~ T.stringof);
FormatSpec!Char f2 = f;
f2.width = 0;
formatValueImpl(w2, cast(OriginalType!T) val, f2);
writeAligned(w, w2.data, f);
return;
}
formatValueImpl(w, cast(OriginalType!T) val, f);
}
@safe unittest
{
enum A { first, second, third }
formatTest(A.second, "second");
formatTest(cast(A) 72, "cast(A)72");
}
@safe unittest
{
enum A : string { one = "uno", two = "dos", three = "tres" }
formatTest(A.three, "three");
formatTest(cast(A)"mill\ón", "cast(A)mill\ón");
}
@safe unittest
{
enum A : bool { no, yes }
formatTest(A.yes, "yes");
formatTest(A.no, "no");
}
@safe unittest
{
// Test for bug 6892
enum Foo { A = 10 }
formatTest("%s", Foo.A, "A");
formatTest(">%4s<", Foo.A, "> A<");
formatTest("%04d", Foo.A, "0010");
formatTest("%+2u", Foo.A, "10");
formatTest("%02x", Foo.A, "0a");
formatTest("%3o", Foo.A, " 12");
formatTest("%b", Foo.A, "1010");
}
@safe pure unittest
{
enum A { one, two, three }
string t1 = format("[%6s] [%-6s]", A.one, A.one);
assert(t1 == "[ one] [one ]");
string t2 = format("[%10s] [%-10s]", cast(A) 10, cast(A) 10);
assert(t2 == "[ cast(A)" ~ "10] [cast(A)" ~ "10 ]"); // due to bug in style checker
}
// https://issues.dlang.org/show_bug.cgi?id=8921
@safe unittest
{
enum E : char { A = 'a', B = 'b', C = 'c' }
E[3] e = [E.A, E.B, E.C];
formatTest(e, "[A, B, C]");
E[] e2 = [E.A, E.B, E.C];
formatTest(e2, "[A, B, C]");
}
/*
Pointers are formatted as hex integers.
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, scope T val, scope const ref FormatSpec!Char f)
if (isPointer!T && !is(T == enum) && !hasToString!(T, Char))
{
static if (is(typeof({ shared const void* p = val; })))
alias SharedOf(T) = shared(T);
else
alias SharedOf(T) = T;
const SharedOf!(void*) p = val;
const pnum = () @trusted { return cast(ulong) p; }();
if (f.spec == 's')
{
if (p is null)
{
writeAligned(w, "null", f);
return;
}
FormatSpec!Char fs = f; // fs is copy for change its values.
fs.spec = 'X';
formatValueImpl(w, pnum, fs);
}
else
{
import std.format : enforceFmt;
enforceFmt(f.spec == 'X' || f.spec == 'x',
"Expected one of %s, %x or %X for pointer type.");
formatValueImpl(w, pnum, f);
}
}
@safe pure unittest
{
int* p;
string t1 = format("[%6s] [%-6s]", p, p);
assert(t1 == "[ null] [null ]");
}
@safe pure unittest
{
int* p = null;
formatTest(p, "null");
auto q = () @trusted { return cast(void*) 0xFFEECCAA; }();
formatTest(q, "FFEECCAA");
}
// https://issues.dlang.org/show_bug.cgi?id=11782
@safe pure unittest
{
import std.range : iota;
auto a = iota(0, 10);
auto b = iota(0, 10);
auto p = () @trusted { auto p = &a; return p; }();
assert(format("%s",p) != format("%s",b));
}
@safe pure unittest
{
// Test for https://issues.dlang.org/show_bug.cgi?id=7869
struct S
{
string toString() const { return ""; }
}
S* p = null;
formatTest(p, "null");
S* q = () @trusted { return cast(S*) 0xFFEECCAA; } ();
formatTest(q, "FFEECCAA");
}
// https://issues.dlang.org/show_bug.cgi?id=8186
@system unittest
{
class B
{
int* a;
this() { a = new int; }
alias a this;
}
formatTest(B.init, "null");
}
// https://issues.dlang.org/show_bug.cgi?id=9336
@system pure unittest
{
shared int i;
format("%s", &i);
}
// https://issues.dlang.org/show_bug.cgi?id=11778
@safe pure unittest
{
import std.exception : assertThrown;
import std.format : FormatException;
int* p = null;
assertThrown!FormatException(format("%d", p));
assertThrown!FormatException(format("%04d", () @trusted { return p + 2; } ()));
}
// https://issues.dlang.org/show_bug.cgi?id=12505
@safe pure unittest
{
void* p = null;
formatTest("%08X", p, "00000000");
}
/*
SIMD vectors are formatted as arrays.
*/
void formatValueImpl(Writer, V, Char)(auto ref Writer w, V val, scope const ref FormatSpec!Char f)
if (isSIMDVector!V)
{
formatValueImpl(w, val.array, f);
}
@safe unittest
{
import core.simd; // cannot be selective, because float4 might not be defined
static if (is(float4))
{
version (X86)
{
version (OSX) {/* https://issues.dlang.org/show_bug.cgi?id=17823 */}
}
else
{
float4 f;
f.array[0] = 1;
f.array[1] = 2;
f.array[2] = 3;
f.array[3] = 4;
formatTest(f, "[1, 2, 3, 4]");
}
}
}
/*
Delegates are formatted by `ReturnType delegate(Parameters) FunctionAttributes`
Known bug: Because of issue https://issues.dlang.org/show_bug.cgi?id=18269
the FunctionAttributes might be wrong.
*/
void formatValueImpl(Writer, T, Char)(auto ref Writer w, scope T, scope const ref FormatSpec!Char f)
if (isDelegate!T)
{
formatValueImpl(w, T.stringof, f);
}
@safe unittest
{
import std.array : appender;
import std.format : formatValue;
void func() @system { __gshared int x; ++x; throw new Exception("msg"); }
version (linux)
{
FormatSpec!char f;
auto w = appender!string();
formatValue(w, &func, f);
assert(w.data.length >= 15 && w.data[0 .. 15] == "void delegate()");
}
}
// string elements are formatted like UTF-8 string literals.
void formatElement(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(StringTypeOf!T) && !hasToString!(T, Char) && !is(T == enum))
{
import std.array : appender;
import std.format.write : formattedWrite, formatValue;
import std.range.primitives : put;
import std.utf : decode, UTFException;
StringTypeOf!T str = val; // https://issues.dlang.org/show_bug.cgi?id=8015
if (f.spec == 's')
{
try
{
// ignore other specifications and quote
for (size_t i = 0; i < str.length; )
{
auto c = decode(str, i);
// \uFFFE and \uFFFF are considered valid by isValidDchar,
// so need checking for interchange.
if (c == 0xFFFE || c == 0xFFFF)
goto LinvalidSeq;
}
put(w, '\"');
for (size_t i = 0; i < str.length; )
{
auto c = decode(str, i);
formatChar(w, c, '"');
}
put(w, '\"');
return;
}
catch (UTFException)
{
}
// If val contains invalid UTF sequence, formatted like HexString literal
LinvalidSeq:
static if (is(typeof(str[0]) : const(char)))
{
enum type = "";
alias IntArr = const(ubyte)[];
}
else static if (is(typeof(str[0]) : const(wchar)))
{
enum type = "w";
alias IntArr = const(ushort)[];
}
else static if (is(typeof(str[0]) : const(dchar)))
{
enum type = "d";
alias IntArr = const(uint)[];
}
formattedWrite(w, "[%(cast(" ~ type ~ "char) 0x%X%|, %)]", cast(IntArr) str);
}
else
formatValue(w, str, f);
}
@safe pure unittest
{
import std.array : appender;
import std.format.spec : singleSpec;
auto w = appender!string();
auto spec = singleSpec("%s");
formatElement(w, "Hello World", spec);
assert(w.data == "\"Hello World\"");
}
@safe unittest
{
import std.array : appender;
import std.format.spec : singleSpec;
auto w = appender!string();
auto spec = singleSpec("%s");
formatElement(w, "H", spec);
assert(w.data == "\"H\"", w.data);
}
// https://issues.dlang.org/show_bug.cgi?id=15888
@safe pure unittest
{
import std.array : appender;
import std.format.spec : singleSpec;
ushort[] a = [0xFF_FE, 0x42];
auto w = appender!string();
auto spec = singleSpec("%s");
formatElement(w, cast(wchar[]) a, spec);
assert(w.data == `[cast(wchar) 0xFFFE, cast(wchar) 0x42]`);
uint[] b = [0x0F_FF_FF_FF, 0x42];
w = appender!string();
spec = singleSpec("%s");
formatElement(w, cast(dchar[]) b, spec);
assert(w.data == `[cast(dchar) 0xFFFFFFF, cast(dchar) 0x42]`);
}
// Character elements are formatted like UTF-8 character literals.
void formatElement(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(CharTypeOf!T) && !is(T == enum))
{
import std.range.primitives : put;
import std.format.write : formatValue;
if (f.spec == 's')
{
put(w, '\'');
formatChar(w, val, '\'');
put(w, '\'');
}
else
formatValue(w, val, f);
}
// Maybe T is noncopyable struct, so receive it by 'auto ref'.
void formatElement(Writer, T, Char)(auto ref Writer w, auto ref T val, scope const ref FormatSpec!Char f)
if ((!is(StringTypeOf!T) || hasToString!(T, Char)) && !is(CharTypeOf!T) || is(T == enum))
{
import std.format.write : formatValue;
formatValue(w, val, f);
}
// Fix for https://issues.dlang.org/show_bug.cgi?id=1591
int getNthInt(string kind, A...)(uint index, A args)
{
return getNth!(kind, isIntegral, int)(index, args);
}
T getNth(string kind, alias Condition, T, A...)(uint index, A args)
{
import std.conv : text, to;
import std.format : FormatException;
switch (index)
{
foreach (n, _; A)
{
case n:
static if (Condition!(typeof(args[n])))
{
return to!T(args[n]);
}
else
{
throw new FormatException(
text(kind, " expected, not ", typeof(args[n]).stringof,
" for argument #", index + 1));
}
}
default:
throw new FormatException(text("Missing ", kind, " argument"));
}
}
private bool needToSwapEndianess(Char)(scope const ref FormatSpec!Char f)
{
import std.system : endian, Endian;
return endian == Endian.littleEndian && f.flPlus
|| endian == Endian.bigEndian && f.flDash;
}
void writeAligned(Writer, T, Char)(auto ref Writer w, T s, scope const ref FormatSpec!Char f)
if (isSomeString!T)
{
FormatSpec!Char fs = f;
fs.flZero = false;
writeAligned(w, "", "", s, fs);
}
@safe pure unittest
{
import std.array : appender;
import std.format : singleSpec;
auto w = appender!string();
auto spec = singleSpec("%s");
writeAligned(w, "a本Ä", spec);
assert(w.data == "a本Ä", w.data);
}
@safe pure unittest
{
import std.array : appender;
import std.format : singleSpec;
auto w = appender!string();
auto spec = singleSpec("%10s");
writeAligned(w, "a本Ä", spec);
assert(w.data == " a本Ä", "|" ~ w.data ~ "|");
}
@safe pure unittest
{
import std.array : appender;
import std.format : singleSpec;
auto w = appender!string();
auto spec = singleSpec("%-10s");
writeAligned(w, "a本Ä", spec);
assert(w.data == "a本Ä ", w.data);
}
enum PrecisionType
{
none,
integer,
fractionalDigits,
allDigits,
}
void writeAligned(Writer, T1, T2, T3, Char)(auto ref Writer w,
T1 prefix, T2 grouped, T3 suffix, scope const ref FormatSpec!Char f,
bool integer_precision = false)
if (isSomeString!T1 && isSomeString!T2 && isSomeString!T3)
{
writeAligned(w, prefix, grouped, "", suffix, f,
integer_precision ? PrecisionType.integer : PrecisionType.none);
}
void writeAligned(Writer, T1, T2, T3, T4, Char)(auto ref Writer w,
T1 prefix, T2 grouped, T3 fracts, T4 suffix, scope const ref FormatSpec!Char f,
PrecisionType p = PrecisionType.none)
if (isSomeString!T1 && isSomeString!T2 && isSomeString!T3 && isSomeString!T4)
{
// writes: left padding, prefix, leading zeros, grouped, fracts, suffix, right padding
if (p == PrecisionType.integer && f.precision == f.UNSPECIFIED)
p = PrecisionType.none;
import std.range.primitives : put;
long prefixWidth;
long groupedWidth = grouped.length; // TODO: does not take graphemes into account
long fractsWidth = fracts.length; // TODO: does not take graphemes into account
long suffixWidth;
// TODO: remove this workaround which hides issue 21815
if (f.width > 0)
{
prefixWidth = getWidth(prefix);
suffixWidth = getWidth(suffix);
}
auto doGrouping = f.flSeparator && groupedWidth > 0
&& f.separators > 0 && f.separators != f.UNSPECIFIED;
// front = number of symbols left of the leftmost separator
long front = doGrouping ? (groupedWidth - 1) % f.separators + 1 : 0;
// sepCount = number of separators to be inserted
long sepCount = doGrouping ? (groupedWidth - 1) / f.separators : 0;
long trailingZeros = 0;
if (p == PrecisionType.fractionalDigits)
trailingZeros = f.precision - (fractsWidth - 1);
if (p == PrecisionType.allDigits && f.flHash)
{
if (grouped != "0")
trailingZeros = f.precision - (fractsWidth - 1) - groupedWidth;
else
{
trailingZeros = f.precision - fractsWidth;
foreach (i;0 .. fracts.length)
if (fracts[i] != '0' && fracts[i] != '.')
{
trailingZeros = f.precision - (fracts.length - i);
break;
}
}
}
auto nodot = fracts == "." && trailingZeros == 0 && !f.flHash;
if (nodot) fractsWidth = 0;
long width = prefixWidth + sepCount + groupedWidth + fractsWidth + trailingZeros + suffixWidth;
long delta = f.width - width;
// with integers, precision is considered the minimum number of digits;
// if digits are missing, we have to recalculate everything
long pregrouped = 0;
if (p == PrecisionType.integer && groupedWidth < f.precision)
{
pregrouped = f.precision - groupedWidth;
delta -= pregrouped;
if (doGrouping)
{
front = ((front - 1) + pregrouped) % f.separators + 1;
delta -= (f.precision - 1) / f.separators - sepCount;
}
}
// left padding
if ((!f.flZero || p == PrecisionType.integer) && delta > 0)
{
if (f.flEqual)
{
foreach (i ; 0 .. delta / 2 + ((delta % 2 == 1 && !f.flDash) ? 1 : 0))
put(w, ' ');
}
else if (!f.flDash)
{
foreach (i ; 0 .. delta)
put(w, ' ');
}
}
// prefix
put(w, prefix);
// leading grouped zeros
if (f.flZero && p != PrecisionType.integer && !f.flDash && delta > 0)
{
if (doGrouping)
{
// front2 and sepCount2 are the same as above for the leading zeros
long front2 = (delta + front - 1) % (f.separators + 1) + 1;
long sepCount2 = (delta + front - 1) / (f.separators + 1);
delta -= sepCount2;
// according to POSIX: if the first symbol is a separator,
// an additional zero is put left of it, even if that means, that
// the total width is one more then specified
if (front2 > f.separators) { front2 = 1; }
foreach (i ; 0 .. delta)
{
if (front2 == 0)
{
put(w, f.separatorChar);
front2 = f.separators;
}
front2--;
put(w, '0');
}
// separator between zeros and grouped
if (front == f.separators)
put(w, f.separatorChar);
}
else
foreach (i ; 0 .. delta)
put(w, '0');
}
// grouped content
if (doGrouping)
{
// TODO: this does not take graphemes into account
foreach (i;0 .. pregrouped + grouped.length)
{
if (front == 0)
{
put(w, f.separatorChar);
front = f.separators;
}
front--;
put(w, i < pregrouped ? '0' : grouped[cast(size_t) (i - pregrouped)]);
}
}
else
{
foreach (i;0 .. pregrouped)
put(w, '0');
put(w, grouped);
}
// fracts
if (!nodot)
put(w, fracts);
// trailing zeros
foreach (i ; 0 .. trailingZeros)
put(w, '0');
// suffix
put(w, suffix);
// right padding
if (delta > 0)
{
if (f.flEqual)
{
foreach (i ; 0 .. delta / 2 + ((delta % 2 == 1 && f.flDash) ? 1 : 0))
put(w, ' ');
}
else if (f.flDash)
{
foreach (i ; 0 .. delta)
put(w, ' ');
}
}
}
@safe pure unittest
{
import std.array : appender;
import std.format : singleSpec;
auto w = appender!string();
auto spec = singleSpec("%s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pregroupingsuf", w.data);
w = appender!string();
spec = singleSpec("%20s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == " pregroupingsuf", w.data);
w = appender!string();
spec = singleSpec("%-20s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pregroupingsuf ", w.data);
w = appender!string();
spec = singleSpec("%020s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pre000000groupingsuf", w.data);
w = appender!string();
spec = singleSpec("%-020s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pregroupingsuf ", w.data);
w = appender!string();
spec = singleSpec("%20,1s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "preg,r,o,u,p,i,n,gsuf", w.data);
w = appender!string();
spec = singleSpec("%20,2s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == " pregr,ou,pi,ngsuf", w.data);
w = appender!string();
spec = singleSpec("%20,3s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == " pregr,oup,ingsuf", w.data);
w = appender!string();
spec = singleSpec("%20,10s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == " pregroupingsuf", w.data);
w = appender!string();
spec = singleSpec("%020,1s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "preg,r,o,u,p,i,n,gsuf", w.data);
w = appender!string();
spec = singleSpec("%020,2s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pre00,gr,ou,pi,ngsuf", w.data);
w = appender!string();
spec = singleSpec("%020,3s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pre00,0gr,oup,ingsuf", w.data);
w = appender!string();
spec = singleSpec("%020,10s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pre000,00groupingsuf", w.data);
w = appender!string();
spec = singleSpec("%021,3s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pre000,0gr,oup,ingsuf", w.data);
// According to https://github.com/dlang/phobos/pull/7112 this
// is defined by POSIX standard:
w = appender!string();
spec = singleSpec("%022,3s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pre0,000,0gr,oup,ingsuf", w.data);
w = appender!string();
spec = singleSpec("%023,3s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pre0,000,0gr,oup,ingsuf", w.data);
w = appender!string();
spec = singleSpec("%,3s");
writeAligned(w, "pre", "grouping", "suf", spec);
assert(w.data == "pregr,oup,ingsuf", w.data);
}
@safe pure unittest
{
import std.array : appender;
import std.format : singleSpec;
auto w = appender!string();
auto spec = singleSpec("%.10s");
writeAligned(w, "pre", "grouping", "suf", spec, true);
assert(w.data == "pre00groupingsuf", w.data);
w = appender!string();
spec = singleSpec("%.10,3s");
writeAligned(w, "pre", "grouping", "suf", spec, true);
assert(w.data == "pre0,0gr,oup,ingsuf", w.data);
w = appender!string();
spec = singleSpec("%25.10,3s");
writeAligned(w, "pre", "grouping", "suf", spec, true);
assert(w.data == " pre0,0gr,oup,ingsuf", w.data);
// precision has precedence over zero flag
w = appender!string();
spec = singleSpec("%025.12,3s");
writeAligned(w, "pre", "grouping", "suf", spec, true);
assert(w.data == " pre000,0gr,oup,ingsuf", w.data);
w = appender!string();
spec = singleSpec("%025.13,3s");
writeAligned(w, "pre", "grouping", "suf", spec, true);
assert(w.data == " pre0,000,0gr,oup,ingsuf", w.data);
}
@safe unittest
{
assert(format("%,d", 1000) == "1,000");
assert(format("%,f", 1234567.891011) == "1,234,567.891011");
assert(format("%,?d", '?', 1000) == "1?000");
assert(format("%,1d", 1000) == "1,0,0,0", format("%,1d", 1000));
assert(format("%,*d", 4, -12345) == "-1,2345");
assert(format("%,*?d", 4, '_', -12345) == "-1_2345");
assert(format("%,6?d", '_', -12345678) == "-12_345678");
assert(format("%12,3.3f", 1234.5678) == " 1,234.568", "'" ~
format("%12,3.3f", 1234.5678) ~ "'");
}
private long getWidth(T)(T s)
{
import std.algorithm.searching : all;
import std.uni : graphemeStride;
// check for non-ascii character
if (s.all!(a => a <= 0x7F)) return s.length;
//TODO: optimize this
long width = 0;
for (size_t i; i < s.length; i += graphemeStride(s, i))
++width;
return width;
}
enum RoundingClass { ZERO, LOWER, FIVE, UPPER }
bool round(T)(ref T sequence, size_t left, size_t right, RoundingClass type, bool negative, char max = '9')
in (left >= 0) // should be left > 0, but if you know ahead, that there's no carry, left == 0 is fine
in (left < sequence.length)
in (right >= 0)
in (right <= sequence.length)
in (right >= left)
in (max == '9' || max == 'f' || max == 'F')
{
import std.format.internal.floats : RoundingMode;
import std.math.hardware;
auto mode = RoundingMode.toNearestTiesToEven;
if (!__ctfe)
{
// std.math's FloatingPointControl isn't available on all target platforms
static if (is(FloatingPointControl))
{
switch (FloatingPointControl.rounding)
{
case FloatingPointControl.roundUp:
mode = RoundingMode.up;
break;
case FloatingPointControl.roundDown:
mode = RoundingMode.down;
break;
case FloatingPointControl.roundToZero:
mode = RoundingMode.toZero;
break;
case FloatingPointControl.roundToNearest:
mode = RoundingMode.toNearestTiesToEven;
break;
default: assert(false, "Unknown floating point rounding mode");
}
}
}
bool roundUp = false;
if (mode == RoundingMode.up)
roundUp = type != RoundingClass.ZERO && !negative;
else if (mode == RoundingMode.down)
roundUp = type != RoundingClass.ZERO && negative;
else if (mode == RoundingMode.toZero)
roundUp = false;
else
{
roundUp = type == RoundingClass.UPPER;
if (type == RoundingClass.FIVE)
{
// IEEE754 allows for two different ways of implementing roundToNearest:
if (mode == RoundingMode.toNearestTiesAwayFromZero)
roundUp = true;
else
{
// Round to nearest, ties to even
auto last = sequence[right - 1];
if (last == '.') last = sequence[right - 2];
roundUp = (last <= '9' && last % 2 != 0) || (last > '9' && last % 2 == 0);
}
}
}
if (!roundUp) return false;
foreach_reverse (i;left .. right)
{
if (sequence[i] == '.') continue;
if (sequence[i] == max)
sequence[i] = '0';
else
{
if (max != '9' && sequence[i] == '9')
sequence[i] = max == 'f' ? 'a' : 'A';
else
sequence[i]++;
return false;
}
}
sequence[left - 1] = '1';
return true;
}
@safe unittest
{
char[10] c;
size_t left = 5;
size_t right = 8;
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.UPPER, false) == true);
assert(c[4 .. 8] == "1.00");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.FIVE, false) == true);
assert(c[4 .. 8] == "1.00");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.LOWER, false) == false);
assert(c[4 .. 8] == "x.99");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.ZERO, false) == false);
assert(c[4 .. 8] == "x.99");
import std.math.hardware;
static if (is(FloatingPointControl))
{
FloatingPointControl fpctrl;
fpctrl.rounding = FloatingPointControl.roundUp;
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.UPPER, false) == true);
assert(c[4 .. 8] == "1.00");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.FIVE, false) == true);
assert(c[4 .. 8] == "1.00");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.LOWER, false) == true);
assert(c[4 .. 8] == "1.00");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.ZERO, false) == false);
assert(c[4 .. 8] == "x.99");
fpctrl.rounding = FloatingPointControl.roundDown;
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.UPPER, false) == false);
assert(c[4 .. 8] == "x.99");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.FIVE, false) == false);
assert(c[4 .. 8] == "x.99");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.LOWER, false) == false);
assert(c[4 .. 8] == "x.99");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.ZERO, false) == false);
assert(c[4 .. 8] == "x.99");
fpctrl.rounding = FloatingPointControl.roundToZero;
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.UPPER, false) == false);
assert(c[4 .. 8] == "x.99");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.FIVE, false) == false);
assert(c[4 .. 8] == "x.99");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.LOWER, false) == false);
assert(c[4 .. 8] == "x.99");
c[4 .. 8] = "x.99";
assert(round(c, left, right, RoundingClass.ZERO, false) == false);
assert(c[4 .. 8] == "x.99");
}
}
@safe unittest
{
char[10] c;
size_t left = 5;
size_t right = 8;
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.UPPER, true) == false);
assert(c[4 .. 8] == "x8.6");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.FIVE, true) == false);
assert(c[4 .. 8] == "x8.6");
c[4 .. 8] = "x8.4";
assert(round(c, left, right, RoundingClass.FIVE, true) == false);
assert(c[4 .. 8] == "x8.4");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.LOWER, true) == false);
assert(c[4 .. 8] == "x8.5");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.ZERO, true) == false);
assert(c[4 .. 8] == "x8.5");
import std.math.hardware;
static if (is(FloatingPointControl))
{
FloatingPointControl fpctrl;
fpctrl.rounding = FloatingPointControl.roundUp;
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.UPPER, true) == false);
assert(c[4 .. 8] == "x8.5");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.FIVE, true) == false);
assert(c[4 .. 8] == "x8.5");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.LOWER, true) == false);
assert(c[4 .. 8] == "x8.5");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.ZERO, true) == false);
assert(c[4 .. 8] == "x8.5");
fpctrl.rounding = FloatingPointControl.roundDown;
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.UPPER, true) == false);
assert(c[4 .. 8] == "x8.6");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.FIVE, true) == false);
assert(c[4 .. 8] == "x8.6");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.LOWER, true) == false);
assert(c[4 .. 8] == "x8.6");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.ZERO, true) == false);
assert(c[4 .. 8] == "x8.5");
fpctrl.rounding = FloatingPointControl.roundToZero;
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.UPPER, true) == false);
assert(c[4 .. 8] == "x8.5");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.FIVE, true) == false);
assert(c[4 .. 8] == "x8.5");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.LOWER, true) == false);
assert(c[4 .. 8] == "x8.5");
c[4 .. 8] = "x8.5";
assert(round(c, left, right, RoundingClass.ZERO, true) == false);
assert(c[4 .. 8] == "x8.5");
}
}
@safe unittest
{
char[10] c;
size_t left = 5;
size_t right = 8;
c[4 .. 8] = "x8.9";
assert(round(c, left, right, RoundingClass.UPPER, true, 'f') == false);
assert(c[4 .. 8] == "x8.a");
c[4 .. 8] = "x8.9";
assert(round(c, left, right, RoundingClass.UPPER, true, 'F') == false);
assert(c[4 .. 8] == "x8.A");
c[4 .. 8] = "x8.f";
assert(round(c, left, right, RoundingClass.UPPER, true, 'f') == false);
assert(c[4 .. 8] == "x9.0");
}
version (StdUnittest)
private void formatTest(T)(T val, string expected, size_t ln = __LINE__, string fn = __FILE__)
{
formatTest(val, [expected], ln, fn);
}
version (StdUnittest)
private void formatTest(T)(string fmt, T val, string expected, size_t ln = __LINE__, string fn = __FILE__) @safe
{
formatTest(fmt, val, [expected], ln, fn);
}
version (StdUnittest)
private void formatTest(T)(T val, string[] expected, size_t ln = __LINE__, string fn = __FILE__)
{
import core.exception : AssertError;
import std.algorithm.searching : canFind;
import std.array : appender;
import std.conv : text;
import std.exception : enforce;
import std.format.write : formatValue;
FormatSpec!char f;
auto w = appender!string();
formatValue(w, val, f);
enforce!AssertError(expected.canFind(w.data),
text("expected one of `", expected, "`, result = `", w.data, "`"), fn, ln);
}
version (StdUnittest)
private void formatTest(T)(string fmt, T val, string[] expected, size_t ln = __LINE__, string fn = __FILE__) @safe
{
import core.exception : AssertError;
import std.algorithm.searching : canFind;
import std.array : appender;
import std.conv : text;
import std.exception : enforce;
import std.format.write : formattedWrite;
auto w = appender!string();
formattedWrite(w, fmt, val);
enforce!AssertError(expected.canFind(w.data),
text("expected one of `", expected, "`, result = `", w.data, "`"), fn, ln);
}
|
D
|
void main() {
auto n = ri;
int[dchar][int] a;
auto c = new RedBlackTree!dchar;
foreach(i; 0..n) {
auto S = rs;
foreach(j; S) {
a[i][j]++;
c.insert(j);
}
}
debug a.writeln;
int[dchar] b;
foreach(i; c.array) b[i] = int.max;
foreach(i; a) {
debug i.writeln;
foreach(j; c.array) {
if(j in i) b[j] = min(b[j], i[j]);
else b[j] = 0;
}
}
dstring res;
foreach(i; c.array) {
res ~= i.repeat(b[i]).array;
}
res.writeln;
}
// ===================================
import std.stdio;
import std.string;
import std.conv;
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
|
module dwt.internal.mozilla.nsIDOMCDATASection;
import dwt.internal.mozilla.Common;
import dwt.internal.mozilla.nsID;
import dwt.internal.mozilla.nsIDOMText;
const char[] NS_IDOMCDATASECTION_IID_STR = "a6cf9071-15b3-11d2-932e-00805f8add32";
const nsIID NS_IDOMCDATASECTION_IID=
{0xa6cf9071, 0x15b3, 0x11d2,
[ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
interface nsIDOMCDATASection : nsIDOMText {
extern(System):
static const char[] IID_STR = NS_IDOMCDATASECTION_IID_STR;
static const nsIID IID = NS_IDOMCDATASECTION_IID;
}
|
D
|
module pegged.examples.strings;
import pegged.grammar;
@safe:
mixin(grammar(`
String:
# Example of a rule for double-quoted strings
String <~ doublequote (!doublequote Char)* doublequote
Char <~ backslash ( doublequote # '\' Escapes
/ quote
/ backslash
/ [bfnrt]
/ [0-2][0-7][0-7]
/ [0-7][0-7]?
/ 'x' Hex Hex
/ 'u' Hex Hex Hex Hex
/ 'U' Hex Hex Hex Hex Hex Hex Hex Hex
)
/ . # Or any char, really
Hex <- [0-9a-fA-F]
`));
unittest
{
assert(String(`"Hello, World!"`).successful);
assert(String(`"Hello,
World!"`).successful);
assert(String(`""`).successful);
assert(String(`"\'\""`).successful);
assert(String(`"\\"`).successful);
assert(String(`"\n\t\r"`).successful);
assert(String(`"\60\61\7\111"`).successful);
assert(String(`"\x40\x41"`).successful);
assert(String(`"\u00A0\u00FF"`).successful);
assert(String(`"\U000000A0\U000000B2"`).successful);
// Failures
assert(!String(`"Hello, World!`).successful);
assert(!String(`Hello, World!"`).successful);
assert(!String(`Hello, World!`).successful);
}
|
D
|
/*
Copyright (c) 2011-2013 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module dlib.core.linkedlist;
public:
struct LinkedListElement(T)
{
LinkedListElement!(T)* next = null;
T datum;
}
struct LinkedList(T, bool ordered = false)
{
LinkedListElement!(T)* head = null;
LinkedListElement!(T)* tail = null;
size_t length = 0;
void traverse(void delegate(ref T v, LinkedListElement!(T)* elem) func)
{
LinkedListElement!(T)* element = head;
while (element !is null)
{
func(element.datum, element);
element = element.next;
}
}
LinkedListElement!(T)* append(T v)
{
length++;
if (tail is null)
{
tail = new LinkedListElement!(T);
tail.datum = v;
}
else
{
tail.next = new LinkedListElement!(T);
tail.next.datum = v;
tail = tail.next;
}
if (head is null) head = tail;
return tail;
}
LinkedListElement!(T)* insertAfter(LinkedListElement!(T)* element, T v)
{
length++;
auto newElement = new LinkedListElement!(T);
newElement.datum = v;
newElement.next = element.next;
element.next = newElement;
if (element is tail) tail = newElement;
return newElement;
}
LinkedListElement!(T)* insertBeginning(T v)
{
length++;
auto newElement = new LinkedListElement!(T);
newElement.datum = v;
newElement.next = head;
head = newElement;
return newElement;
}
void removeAfter(LinkedListElement!(T)* element)
{
length--;
auto obsolete = element.next;
if (obsolete !is null)
{
if (obsolete is tail) tail = element;
element.next = obsolete.next;
delete obsolete;
}
}
void removeBeginning()
{
length--;
auto obsolete = head;
if (obsolete !is null)
{
head = obsolete.next;
delete obsolete;
}
}
void appendList(LinkedList!(T) list)
{
length += list.length;
tail.next = list.head;
tail = list.tail;
}
LinkedListElement!(T)* search(T v)
{
LinkedListElement!(T)* element = head;
LinkedListElement!(T)* prevElement = head;
while (element !is null)
{
if (element.datum == v)
{
static if (!ordered)
{
/*
* Move-to-front heuristic:
* Move an element to the beginning of the list once it is found.
* This scheme ensures that the most recently used items are also
* the quickest to find again.
*/
prevElement.next = element.next;
element.next = head;
head = element;
}
return element;
}
prevElement = element;
element = element.next;
}
return null;
}
}
|
D
|
import std.stdio;
void main() {
writefln("Hello World");
}
|
D
|
module external.rt.config;
extern(C) string[] rt_args() @nogc nothrow
{
return null; // no RT args provided
}
|
D
|
/* linenoise.h -- guerrilla line editing library against the idea that a
* line editing lib needs to be 20,000 lines of C code.
*
* See linenoise.c for more information.
*
* ------------------------------------------------------------------------
*
* Copyright (c) 2010, Salvatore Sanfilippo <antirez at gmail dot com>
* Copyright (c) 2010, Pieter Noordhuis <pcnoordhuis at gmail dot com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 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 deimos.linenoise;
extern(C):
struct linenoiseCompletions {
size_t len;
char **cvec;
}
alias linenoiseCompletionCallback = void function(const char *, linenoiseCompletions *);
void linenoiseSetCompletionCallback(linenoiseCompletionCallback);
void linenoiseAddCompletion(linenoiseCompletions *, const char *);
char *linenoise(const char *prompt);
int linenoiseHistoryAdd(const char *line);
int linenoiseHistorySetMaxLen(int len);
int linenoiseHistorySave(const char *filename);
int linenoiseHistoryLoad(const char *filename);
void linenoiseClearScreen();
void linenoiseSetMultiLine(int ml);
|
D
|
instance Mod_7754_OUT_Melchior_EIS (Npc_Default)
{
// ------ NSC ------
name = "Melchior";
guild = GIL_OUT;
id = 7754;
voice = 0;
flags = 0;
npctype = NPCTYPE_MAIN;
// ------ AIVARs ------
aivar[AIV_ToughGuy] = TRUE;
// ------ Attribute ------
B_SetAttributesToChapter (self, 1);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_COWARD;
// ------ Equippte Waffen ------
EquipItem (self, ItMw_Milizschwert);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------
B_SetNpcVisual (self, MALE, "Hum_Head_Fatbald", Face_N_Ricelord, BodyTex_N, ITAR_Eisgebiet_Miliz);
Mdl_SetModelFatness (self,0);
Mdl_ApplyOverlayMds (self, "Humans_Militia.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 30);
// ------ TA anmelden ------
daily_routine = Rtn_Start_7754;
};
FUNC VOID Rtn_Start_7754()
{
TA_Waermen (08,00,22,00,"MELCHIORSLAGER_01");
TA_Sleep (22,00,08,00,"MELCHIORSLAGER_02");
};
FUNC VOID Rtn_Fisk_7754()
{
TA_Stand_Guarding (08,00,22,00,"NW_FARM3_OUT_01");
TA_Stand_Guarding (22,00,08,00,"NW_FARM3_OUT_01");
};
|
D
|
/*******************************************************************************
* Copyright (c) 2004, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <[email protected]>
*******************************************************************************/
module dwtx.draw2d.CoordinateListener;
import dwt.dwthelper.utils;
import dwtx.draw2d.IFigure;
/**
* @since 3.1
*/
public interface CoordinateListener {
/**
* Indicates that the coordinate system has changed in a way that affects the absolute
* locations of contained figures.
* @param source the figure whose coordinate system changed
* @since 3.1
*/
void coordinateSystemChanged(IFigure source);
}
|
D
|
void main() { runSolver(); }
void problem() {
auto N = scan!int;
auto S = scan;
auto solve() {
foreach_reverse(i, c; S) {
if ("AGCT".canFind(c)) return i + 1;
}
return 0;
}
outputForAtCoder(&solve);
}
// ----------------------------------------------
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric, std.traits, std.functional, std.bigint, std.datetime.stopwatch, core.time, core.bitop;
T[][] combinations(T)(T[] s, in long m) { if (!m) return [[]]; if (s.empty) return []; return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(long n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");
Point invert(Point p) { return Point(p.y, p.x); }
long[] divisors(long n) { long[] ret; for (long i = 1; i * i <= n; i++) { if (n % i == 0) { ret ~= i; if (i * i != n) ret ~= n / i; } } return ret.sort.array; }
bool chmin(T)(ref T a, T b) { if (b < a) { a = b; return true; } else return false; }
bool chmax(T)(ref T a, T b) { if (b > a) { a = b; return true; } else return false; }
string charSort(alias S = "a < b")(string s) { return (cast(char[])((cast(byte[])s).sort!S.array)).to!string; }
ulong comb(ulong a, ulong b) { if (b == 0) {return 1;}else{return comb(a - 1, b - 1) * a / b;}}
string toAnswerString(R)(R r) { return r.map!"a.to!string".joiner(" ").array.to!string; }
struct ModInt(uint MD) if (MD < int.max) {ulong v;this(string v) {this(v.to!long);}this(int v) {this(long(v));}this(long v) {this.v = (v%MD+MD)%MD;}void opAssign(long t) {v = (t%MD+MD)%MD;}static auto normS(ulong x) {return (x<MD)?x:x-MD;}static auto make(ulong x) {ModInt m; m.v = x; return m;}auto opBinary(string op:"+")(ModInt r) const {return make(normS(v+r.v));}auto opBinary(string op:"-")(ModInt r) const {return make(normS(v+MD-r.v));}auto opBinary(string op:"*")(ModInt r) const {return make((ulong(v)*r.v%MD).to!ulong);}auto opBinary(string op:"^^", T)(T r) const {long x=v;long y=1;while(r){if(r%2==1)y=(y*x)%MD;x=x^^2%MD;r/=2;} return make(y);}auto opBinary(string op:"/")(ModInt r) const {return this*memoize!inv(r);}static ModInt inv(ModInt x) {return x^^(MD-2);}string toString() const {return v.to!string;}auto opOpAssign(string op)(ModInt r) {return mixin ("this=this"~op~"r");}}
alias MInt1 = ModInt!(10^^9 + 7);
alias MInt9 = ModInt!(998_244_353);
void outputForAtCoder(T)(T delegate() fn) {
static if (is(T == float) || is(T == double) || is(T == real)) "%.16f".writefln(fn());
else static if (is(T == void)) fn();
else static if (is(T == string)) fn().writeln;
else static if (isInputRange!T) {
static if (!is(string == ElementType!T) && isInputRange!(ElementType!T)) foreach(r; fn()) r.toAnswerString.writeln;
else foreach(r; fn()) r.writeln;
}
else fn().writeln;
}
void runSolver() {
enum BORDER = "==================================";
debug { BORDER.writeln; while(!stdin.eof) { "<<< Process time: %s >>>".writefln(benchmark!problem(1)); BORDER.writeln; } }
else problem();
}
enum YESNO = [true: "Yes", false: "No"];
// -----------------------------------------------
|
D
|
/Users/jonno/Desktop/SuperAwesomeSquares/DerivedData/SuperAwesomeSquares/Build/Intermediates/SuperAwesomeSquares.build/Debug-iphonesimulator/SuperAwesomeSquares.build/Objects-normal/x86_64/ViewController.o : /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/AppDelegate.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/Cell.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/ViewController.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/UIColor+Extensions.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/jonno/Desktop/SuperAwesomeSquares/DerivedData/SuperAwesomeSquares/Build/Intermediates/SuperAwesomeSquares.build/Debug-iphonesimulator/SuperAwesomeSquares.build/Objects-normal/x86_64/ViewController~partial.swiftmodule : /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/AppDelegate.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/Cell.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/ViewController.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/UIColor+Extensions.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/jonno/Desktop/SuperAwesomeSquares/DerivedData/SuperAwesomeSquares/Build/Intermediates/SuperAwesomeSquares.build/Debug-iphonesimulator/SuperAwesomeSquares.build/Objects-normal/x86_64/ViewController~partial.swiftdoc : /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/AppDelegate.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/Cell.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/ViewController.swift /Users/jonno/Desktop/SuperAwesomeSquares/SuperAwesomeSquares/UIColor+Extensions.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
|
func int b_teachplayertalentrunes(var C_NPC slf,var C_NPC oth,var int spell)
{
var int kosten;
var C_NPC scrolltrader;
kosten = b_getlearncosttalent(oth,NPC_TALENT_RUNES);
if(oth.lp < kosten)
{
PrintScreen(PRINT_NOTENOUGHLP,-1,-1,FONT_SCREENSMALL,2);
b_say(slf,oth,"$NOLEARNNOPOINTS");
return FALSE;
};
oth.lp = oth.lp - kosten;
Log_CreateTopic(TOPIC_TALENTRUNES,LOG_NOTE);
b_logentry(TOPIC_TALENTRUNES,"Чтобы создать руну, мне нужен свиток с заклинанием и определенные ингредиенты. При помощи этих ингредиентов и чистого рунного камня я могу создать руну на рунном столе.");
if(Npc_IsDead(gorax) == FALSE)
{
scrolltrader = Hlp_GetNpc(gorax);
}
else if(Npc_IsDead(isgaroth) == FALSE)
{
scrolltrader = Hlp_GetNpc(isgaroth);
}
else if(Npc_IsDead(engor) == FALSE)
{
scrolltrader = Hlp_GetNpc(engor);
}
else if(Npc_IsDead(orlan) == FALSE)
{
scrolltrader = Hlp_GetNpc(orlan);
};
if(spell == SPL_LIGHT)
{
PLAYER_TALENT_RUNES[SPL_LIGHT] = TRUE;
CreateInvItems(scrolltrader,itsc_light,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Свет': 1 золотая монета.");
};
if(spell == SPL_FIREBOLT)
{
PLAYER_TALENT_RUNES[SPL_FIREBOLT] = TRUE;
CreateInvItems(scrolltrader,itsc_firebolt,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Огненная стрела': 1 сера.");
};
if(spell == SPL_ICEBOLT)
{
PLAYER_TALENT_RUNES[SPL_ICEBOLT] = TRUE;
CreateInvItems(scrolltrader,itsc_icebolt,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Ледяная стрела': 1 ледяной кварц.");
};
if(spell == SPL_LIGHTHEAL)
{
PLAYER_TALENT_RUNES[SPL_LIGHTHEAL] = TRUE;
CreateInvItems(scrolltrader,itsc_lightheal,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Лечение легких ранений': 1 лечебная трава.");
};
if(spell == SPL_SUMMONGOBLINSKELETON)
{
PLAYER_TALENT_RUNES[SPL_SUMMONGOBLINSKELETON] = TRUE;
CreateInvItems(scrolltrader,itsc_sumgobskel,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Вызов скелета гоблина': 1 кость гоблина.");
};
if(spell == SPL_INSTANTFIREBALL)
{
PLAYER_TALENT_RUNES[SPL_INSTANTFIREBALL] = TRUE;
CreateInvItems(scrolltrader,itsc_instantfireball,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Огненный шар': 1 смола.");
};
if(spell == SPL_ZAP)
{
PLAYER_TALENT_RUNES[SPL_ZAP] = TRUE;
CreateInvItems(scrolltrader,itsc_zap,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Малая молния': 1 горный хрусталь.");
};
if(spell == SPL_SUMMONWOLF)
{
PLAYER_TALENT_RUNES[SPL_SUMMONWOLF] = TRUE;
CreateInvItems(scrolltrader,itsc_sumwolf,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Вызов волка': 1 шкура волка.");
};
if(spell == SPL_WINDFIST)
{
PLAYER_TALENT_RUNES[SPL_WINDFIST] = TRUE;
CreateInvItems(scrolltrader,itsc_windfist,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Кулак ветра': 1 уголь.");
};
if(spell == SPL_SLEEP)
{
PLAYER_TALENT_RUNES[SPL_SLEEP] = TRUE;
CreateInvItems(scrolltrader,itsc_sleep,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Сон': 1 болотная трава.");
};
if(spell == SPL_MEDIUMHEAL)
{
PLAYER_TALENT_RUNES[SPL_MEDIUMHEAL] = TRUE;
CreateInvItems(scrolltrader,itsc_mediumheal,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Лечение средних ранений': 1 лечебное растение.");
};
if(spell == SPL_LIGHTNINGFLASH)
{
PLAYER_TALENT_RUNES[SPL_LIGHTNINGFLASH] = TRUE;
CreateInvItems(scrolltrader,itsc_lightningflash,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Молния': 1 горный хрусталь и 1 ледяной кварц.");
};
if(spell == SPL_CHARGEFIREBALL)
{
PLAYER_TALENT_RUNES[SPL_CHARGEFIREBALL] = TRUE;
CreateInvItems(scrolltrader,itsc_chargefireball,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Большой огненный шар': 1 сера и 1 смола.");
};
if(spell == SPL_SUMMONSKELETON)
{
PLAYER_TALENT_RUNES[SPL_SUMMONSKELETON] = TRUE;
CreateInvItems(scrolltrader,itsc_sumskel,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Создание скелета': 1 кость скелета.");
};
if(spell == SPL_FEAR)
{
PLAYER_TALENT_RUNES[SPL_FEAR] = TRUE;
CreateInvItems(scrolltrader,itsc_fear,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Страх': 1 черная жемчужина.");
};
if(spell == SPL_ICECUBE)
{
PLAYER_TALENT_RUNES[SPL_ICECUBE] = TRUE;
CreateInvItems(scrolltrader,itsc_icecube,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Ледяной блок': 1 ледяной кварц и 1 аквамарин.");
};
if(spell == SPL_CHARGEZAP)
{
PLAYER_TALENT_RUNES[SPL_CHARGEZAP] = TRUE;
CreateInvItems(scrolltrader,itsc_thunderball,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Шаровая молния': 1 сера и 1 горный хрусталь.");
};
if(spell == SPL_SUMMONGOLEM)
{
PLAYER_TALENT_RUNES[SPL_SUMMONGOLEM] = TRUE;
CreateInvItems(scrolltrader,itsc_sumgol,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Вызов голема': 1 сердце каменного голема.");
};
if(spell == SPL_DESTROYUNDEAD)
{
PLAYER_TALENT_RUNES[SPL_DESTROYUNDEAD] = TRUE;
CreateInvItems(scrolltrader,itsc_harmundead,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Уничтожение нежити': 1 святая вода.");
};
if(spell == SPL_PYROKINESIS)
{
PLAYER_TALENT_RUNES[SPL_PYROKINESIS] = TRUE;
CreateInvItems(scrolltrader,itsc_pyrokinesis,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Большая огненная буря': 1 сера и 1 язык огненного ящера.");
};
if(spell == SPL_FIRESTORM)
{
PLAYER_TALENT_RUNES[SPL_FIRESTORM] = TRUE;
CreateInvItems(scrolltrader,itsc_firestorm,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Малая огненная буря': 1 сера и 1 смола.");
};
if(spell == SPL_ICEWAVE)
{
PLAYER_TALENT_RUNES[SPL_ICEWAVE] = TRUE;
CreateInvItems(scrolltrader,itsc_icewave,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Ледяная волна': 1 ледяной кварц и 1 аквамарин.");
};
if(spell == SPL_SUMMONDEMON)
{
PLAYER_TALENT_RUNES[SPL_SUMMONDEMON] = TRUE;
CreateInvItems(scrolltrader,itsc_sumdemon,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Вызов демона': 1 сердце демона.");
};
if(spell == SPL_FULLHEAL)
{
PLAYER_TALENT_RUNES[SPL_FULLHEAL] = TRUE;
CreateInvItems(scrolltrader,itsc_fullheal,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Лечение тяжелых ранений': 1 лечебный корень.");
};
if(spell == SPL_FIRERAIN)
{
PLAYER_TALENT_RUNES[SPL_FIRERAIN] = TRUE;
CreateInvItems(scrolltrader,itsc_firerain,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Огненный дождь': 1 смола, 1 сера и 1 язык огненного ящера.");
};
if(spell == SPL_BREATHOFDEATH)
{
PLAYER_TALENT_RUNES[SPL_BREATHOFDEATH] = TRUE;
CreateInvItems(scrolltrader,itsc_breathofdeath,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Дыхание смерти': 1 уголь и 1 черная жемчужина.");
};
if(spell == SPL_MASSDEATH)
{
PLAYER_TALENT_RUNES[SPL_MASSDEATH] = TRUE;
CreateInvItems(scrolltrader,itsc_massdeath,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Волна смерти': 1 кость скелета и 1 черная жемчужина.");
};
if(spell == SPL_ARMYOFDARKNESS)
{
PLAYER_TALENT_RUNES[SPL_ARMYOFDARKNESS] = TRUE;
CreateInvItems(scrolltrader,itsc_armyofdarkness,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Армия тьмы': 1 кость скелета, 1 черная жемчужина, 1 сердце каменного голема и 1 сердце демона.");
};
if(spell == SPL_SHRINK)
{
PLAYER_TALENT_RUNES[SPL_SHRINK] = TRUE;
CreateInvItems(scrolltrader,itsc_shrink,1);
b_logentry(TOPIC_TALENTRUNES,"Ингредиенты для руны 'Уменьшение монстра': 1 кость гоблина и 1 клык тролля.");
};
PrintScreen(PRINT_LEARNRUNES,-1,-1,FONT_SCREEN,2);
Npc_SetTalentSkill(oth,NPC_TALENT_RUNES,1);
return TRUE;
};
func int b_teachplayerpalrunes(var C_NPC slf,var C_NPC oth,var int spell,var int kosten)
{
if(oth.lp < kosten)
{
PrintScreen(PRINT_NOTENOUGHLP,-1,-1,FONT_SCREENSMALL,2);
b_say(slf,oth,"$NOLEARNNOPOINTS");
return FALSE;
};
oth.lp = oth.lp - kosten;
if(spell == SPL_PALLIGHT)
{
PLAYER_TALENT_RUNES[SPL_PALLIGHT] = TRUE;
CreateInvItems(slf,itru_pallight,1);
b_giveinvitems(slf,oth,itru_pallight,1);
};
if(spell == SPL_PALLIGHTHEAL)
{
PLAYER_TALENT_RUNES[SPL_PALLIGHTHEAL] = TRUE;
CreateInvItems(slf,itru_pallightheal,1);
b_giveinvitems(slf,oth,itru_pallightheal,1);
};
if(spell == SPL_PALHOLYBOLT)
{
PLAYER_TALENT_RUNES[SPL_PALHOLYBOLT] = TRUE;
CreateInvItems(slf,itru_palholybolt,1);
b_giveinvitems(slf,oth,itru_palholybolt,1);
};
if(spell == SPL_PALMEDIUMHEAL)
{
PLAYER_TALENT_RUNES[SPL_PALMEDIUMHEAL] = TRUE;
CreateInvItems(slf,itru_palmediumheal,1);
b_giveinvitems(slf,oth,itru_palmediumheal,1);
};
if(spell == SPL_PALREPELEVIL)
{
PLAYER_TALENT_RUNES[SPL_PALREPELEVIL] = TRUE;
CreateInvItems(slf,itru_palrepelevil,1);
b_giveinvitems(slf,oth,itru_palrepelevil,1);
};
if(spell == SPL_PALFULLHEAL)
{
PLAYER_TALENT_RUNES[SPL_PALFULLHEAL] = TRUE;
CreateInvItems(slf,itru_palfullheal,1);
b_giveinvitems(slf,oth,itru_palfullheal,1);
};
if(spell == SPL_PALDESTROYEVIL)
{
PLAYER_TALENT_RUNES[SPL_PALDESTROYEVIL] = TRUE;
CreateInvItems(slf,itru_paldestroyevil,1);
b_giveinvitems(slf,oth,itru_paldestroyevil,1);
};
return TRUE;
};
|
D
|
/home/santiago/Repositories/rust-projects/rpm/target/release/build/libc-a8b9274f8d3763aa/build_script_build-a8b9274f8d3763aa: /home/santiago/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.97/build.rs
/home/santiago/Repositories/rust-projects/rpm/target/release/build/libc-a8b9274f8d3763aa/build_script_build-a8b9274f8d3763aa.d: /home/santiago/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.97/build.rs
/home/santiago/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.97/build.rs:
|
D
|
/Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/Objects-normal/x86_64/FlutterWebViewFactory.o : /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/Size2D.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WindowIdJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnLoadResourceJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/LastTouchedAnchorOrImageJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/EnableViewportScaleJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/ConsoleLogJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageChannelJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PromisePolyfillJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/SupportZoomJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageListenerJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/CallAsyncJavaScriptBelowIOS14WrapperJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindTextHighlightJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OriginalViewPortMetaTagContentJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowBlurEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowFocusEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindElementsAtPointJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PrintJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptFetchRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewStatic.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKContentWorld.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLProtectionSpace.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessage.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HttpAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ClientCertChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ServerTrustChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CredentialDatabase.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SecCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/FlutterMethodCallDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/NSAttributedString.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLCredential.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageChannel.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PlatformUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PluginScriptsUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshControl.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKSecurityOrigin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SwiftFlutterPlugin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationAction.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKFrameInfo.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/LeakAvoider.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyWebStorageManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyCookieManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/WKProcessPoolManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/ChromeSafariBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebViewManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewMethodHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CustomeSchemeHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserNavigationController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKUserContentController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageListener.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UIColor.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslError.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKWindowFeatures.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Options.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/ContextMenuOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebViewOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/HitTestResult.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/PluginScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UserScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessagePort.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebViewTransport.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLRequest.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewFactory.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/simd.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Accessibility.framework/Modules/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/OrderedSet/OrderedSet-umbrella.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/flutter_inappwebview/flutter_inappwebview-umbrella.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCallbackCache.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngine.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterTexture.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterAppDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlugin.h /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewFlutterPlugin.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngineGroup.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterBinaryMessenger.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterViewController.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterHeadlessDartRunner.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/Flutter.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCodecs.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterChannels.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterMacros.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlatformViews.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterDartProject.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Headers/OrderedSet-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet6.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/kcdata.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/uuid.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/dyld.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/device.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/unextended-module.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/OrderedSet.build/module.modulemap /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_debug.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/bank.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_posix_sys_types.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_cdefs.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/net.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Modules/OrderedSet.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
/Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/Objects-normal/x86_64/FlutterWebViewFactory~partial.swiftmodule : /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/Size2D.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WindowIdJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnLoadResourceJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/LastTouchedAnchorOrImageJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/EnableViewportScaleJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/ConsoleLogJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageChannelJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PromisePolyfillJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/SupportZoomJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageListenerJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/CallAsyncJavaScriptBelowIOS14WrapperJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindTextHighlightJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OriginalViewPortMetaTagContentJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowBlurEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowFocusEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindElementsAtPointJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PrintJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptFetchRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewStatic.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKContentWorld.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLProtectionSpace.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessage.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HttpAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ClientCertChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ServerTrustChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CredentialDatabase.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SecCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/FlutterMethodCallDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/NSAttributedString.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLCredential.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageChannel.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PlatformUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PluginScriptsUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshControl.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKSecurityOrigin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SwiftFlutterPlugin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationAction.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKFrameInfo.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/LeakAvoider.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyWebStorageManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyCookieManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/WKProcessPoolManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/ChromeSafariBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebViewManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewMethodHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CustomeSchemeHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserNavigationController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKUserContentController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageListener.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UIColor.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslError.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKWindowFeatures.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Options.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/ContextMenuOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebViewOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/HitTestResult.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/PluginScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UserScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessagePort.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebViewTransport.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLRequest.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewFactory.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/simd.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Accessibility.framework/Modules/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/OrderedSet/OrderedSet-umbrella.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/flutter_inappwebview/flutter_inappwebview-umbrella.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCallbackCache.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngine.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterTexture.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterAppDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlugin.h /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewFlutterPlugin.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngineGroup.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterBinaryMessenger.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterViewController.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterHeadlessDartRunner.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/Flutter.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCodecs.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterChannels.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterMacros.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlatformViews.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterDartProject.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Headers/OrderedSet-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet6.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/kcdata.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/uuid.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/dyld.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/device.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/unextended-module.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/OrderedSet.build/module.modulemap /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_debug.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/bank.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_posix_sys_types.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_cdefs.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/net.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Modules/OrderedSet.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
/Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/Objects-normal/x86_64/FlutterWebViewFactory~partial.swiftdoc : /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/Size2D.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WindowIdJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnLoadResourceJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/LastTouchedAnchorOrImageJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/EnableViewportScaleJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/ConsoleLogJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageChannelJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PromisePolyfillJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/SupportZoomJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageListenerJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/CallAsyncJavaScriptBelowIOS14WrapperJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindTextHighlightJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OriginalViewPortMetaTagContentJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowBlurEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowFocusEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindElementsAtPointJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PrintJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptFetchRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewStatic.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKContentWorld.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLProtectionSpace.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessage.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HttpAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ClientCertChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ServerTrustChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CredentialDatabase.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SecCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/FlutterMethodCallDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/NSAttributedString.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLCredential.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageChannel.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PlatformUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PluginScriptsUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshControl.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKSecurityOrigin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SwiftFlutterPlugin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationAction.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKFrameInfo.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/LeakAvoider.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyWebStorageManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyCookieManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/WKProcessPoolManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/ChromeSafariBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebViewManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewMethodHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CustomeSchemeHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserNavigationController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKUserContentController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageListener.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UIColor.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslError.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKWindowFeatures.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Options.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/ContextMenuOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebViewOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/HitTestResult.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/PluginScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UserScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessagePort.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebViewTransport.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLRequest.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewFactory.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/simd.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Accessibility.framework/Modules/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/OrderedSet/OrderedSet-umbrella.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/flutter_inappwebview/flutter_inappwebview-umbrella.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCallbackCache.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngine.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterTexture.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterAppDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlugin.h /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewFlutterPlugin.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngineGroup.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterBinaryMessenger.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterViewController.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterHeadlessDartRunner.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/Flutter.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCodecs.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterChannels.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterMacros.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlatformViews.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterDartProject.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Headers/OrderedSet-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet6.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/kcdata.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/uuid.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/dyld.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/device.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/unextended-module.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/OrderedSet.build/module.modulemap /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_debug.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/bank.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_posix_sys_types.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_cdefs.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/net.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Modules/OrderedSet.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
/Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/Objects-normal/x86_64/FlutterWebViewFactory~partial.swiftsourceinfo : /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/Size2D.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WindowIdJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnLoadResourceJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/LastTouchedAnchorOrImageJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/EnableViewportScaleJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/ConsoleLogJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageChannelJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PromisePolyfillJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/SupportZoomJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/WebMessageListenerJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/CallAsyncJavaScriptBelowIOS14WrapperJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindTextHighlightJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OriginalViewPortMetaTagContentJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowBlurEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/OnWindowFocusEventJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/FindElementsAtPointJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PrintJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptFetchRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewStatic.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKContentWorld.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLProtectionSpace.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessage.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HttpAuthenticationChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ClientCertChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/ServerTrustChallenge.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CredentialDatabase.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationResponse.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SecCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslCertificate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/FlutterMethodCallDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserDelegate.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/NSAttributedString.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLCredential.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageChannel.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PlatformUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PluginScriptsJS/PluginScriptsUtil.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshControl.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKSecurityOrigin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SwiftFlutterPlugin.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKNavigationAction.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKFrameInfo.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/LeakAvoider.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyWebStorageManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/MyCookieManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/WKProcessPoolManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/ChromeSafariBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebViewManager.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewMethodHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/CustomeSchemeHandler.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserNavigationController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKUserContentController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariViewController.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessageListener.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UIColor.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/SslError.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WKWindowFeatures.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Options.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/PullToRefresh/PullToRefreshOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/SafariViewController/SafariBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/ContextMenuOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebViewOptions.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/HitTestResult.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/PluginScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/UserScript.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebMessagePort.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/WebViewTransport.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLRequest.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/InAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebView/FlutterWebViewFactory.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/simd.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Accessibility.framework/Modules/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMIDI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreMedia.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/simd.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/AVFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/DataDetection.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreAudio.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/FileProvider.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UniformTypeIdentifiers.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/_Concurrency.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/15.0/Accessibility.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/OrderedSet/OrderedSet-umbrella.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/Pods/Target\ Support\ Files/flutter_inappwebview/flutter_inappwebview-umbrella.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCallbackCache.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngine.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterTexture.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterAppDelegate.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlugin.h /Users/tinh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppWebViewFlutterPlugin.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterEngineGroup.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterBinaryMessenger.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterViewController.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterHeadlessDartRunner.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/Flutter.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterCodecs.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterChannels.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterMacros.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterPlatformViews.h /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Headers/FlutterDartProject.h /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Headers/OrderedSet-Swift.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet6.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/kcdata.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/uuid.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/dyld.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/device.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/flutter_inappwebview.build/unextended-module.modulemap /Users/tinh/Projects/Furniture-App-UI-2-Flutter/ios/build/Pods.build/Debug-iphonesimulator/OrderedSet.build/module.modulemap /Users/tinh/Documents/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_machine.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach_debug.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/mach.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/bank.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_posix_sys_types.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/darwin_cdefs.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/net.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/netinet.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UniformTypeIdentifiers.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/tinh/Projects/Furniture-App-UI-2-Flutter/build/ios/Debug-iphonesimulator/OrderedSet/OrderedSet.framework/Modules/OrderedSet.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
|
D
|
module elasticsearch.domain.action.response.document.get;
import vibe.data.json;
import elasticsearch.domain.action.response.base;
import elasticsearch.domain.action.request.document.get;
struct GetResult(T) {
@name("_index")
string index;
@name("_type")
string type;
@name("_id")
string id;
@name("_version")
ulong _version;
@name("found")
bool found;
@name("_source")
@optional
T source;
@name("fields")
@optional
Json fields;
public R field(R)(string name) {
return deserializeJson!R(fields[name]);
}
}
struct GetResponse(T) {
mixin Response!(GetRequest!T, GetResult!T);
}
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.