code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
module dminers;
import std.stdio;
import derelict.sdl2.sdl;
import derelict.sdl2.image;
struct Game
{
private static bool[] keys = new bool[65536];
private static int xMouse, yMouse, mouseButton;
enum GameState
{
Stopped,
Started,
Quitting,
};
GameState gameState;
void start()
{
gameState = GameState.Started;
while (gameState == GameState.Started)
{
debug writeln("Starting gamestate");
// The end-line comments are there to prevent eclipse's auto formating
// from messing up the sprite data.
import std.conv;
auto SPRITES = [//
"" ~ //
" !!!! " ~ //
" !oooo " ~ //
" !oooo " ~ //
" ** " ~ //
" **XX " ~ //
" o*XX " ~ //
" ** " ~ //
" ** " ~ //
" ** " ~ //
" ooo " ~ //
" ! " ~ //
" !!!! " ~ //
" !oooo " ~ //
" oooo " ~ //
" **XXX" ~ //
" *oXXX" ~ //
" **** " ~ //
" ** ** " ~ //
"** oo" ~ //
"oo " ~ //
" !!! " ~ //
" !oooo " ~ //
"!!oooo " ~ //
" ** XX" ~ //
" ***oX" ~ //
" ** XX" ~ //
" *** " ~ //
" ***** " ~ //
"o** ** " ~ //
"o oo" ~ //
" !!!! " ~ //
"!!oooo " ~ //
" !oooo " ~ //
" ** " ~ //
" **XXX" ~ //
" *oXXX" ~ //
" ** " ~ //
" o*** " ~ //
" o** " ~ //
" oo " ~ //
" " ~ //
" " ~ //
" !!!! " ~ //
" !oooo " ~ //
" !oooo " ~ //
" ** " ~ //
" **XX " ~ //
" o*XX " ~ //
" #*# # " ~ //
" ### " ~ //
" " ~ //
" " ~ //
" " ~ //
" " ~ //
" " ~ //
" # " ~ //
"#!!!! #" ~ //
" !oooo " ~ //
" #o#o# " ~ //
" ##### " ~ //
" " ~ //
" " ~ //
" " ~ //
" " ~ //
" " ~ //
" " ~ //
" " ~ //
" " ~ //
" # " ~ //
"# #"//
].to!(char[]);
// TODO(Jon): Set up a window with SDL
SDL_Init(SDL_INIT_VIDEO);
scope (exit) SDL_Quit();
SDL_Window* window;
SDL_Renderer* renderer;
SDL_CreateWindowAndRenderer(640, 500, SDL_WINDOW_RESIZABLE, &window, &renderer);
// // Create the window
// A a = new A();
// a.setSize(640, 500);
// a.setResizable(false);
// a.enableEvents(KeyEvent.KEY_PRESSED | MouseEvent.MOUSE_DRAGGED | MouseEvent.MOUSE_MOVED | MouseEvent.MOUSE_PRESSED | MouseEvent.MOUSE_RELEASED);
// a.setVisible(true);
//
// // Set up the graphics objects we'll need
// Graphics gr = a.getGraphics();
// BufferedImage img = new BufferedImage(640, 480, BufferedImage.TYPE_INT_RGB);
// int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
int[] pixels = new int [640 * 480];
//
// Image img2 = a.createImage(640, 480);
// Graphics gr2 = img2.getGraphics();
// gr2.setColor(new Color(255, 255, 255));
import std.random;
auto gen = Random(unpredictableSeed);
int[] level = new int[1024 * 2048];
// Level data. Defining arrays like this takes up a lot of space, so
// this can be optimised
string[] levelNames = ["Level 1: Miners4k", "Level 2: Rocks", "Level 3: Descent", "Level 4: Slime", "Level 5: Massive", "Level 6: Riiiight", "You won!"];
string[] infoStrings = ["Bring the gold home!", "Rocks are impenetrable.", "Use arrow keys to scroll.", "Slime explodes on contact!", "Wide level!", "Timekiller!", "Bonus level!"];
int[] slimes = [0, 0, 0, 6, 10, 25, 0];
int current_level = 0;
// Loop until escape is pressed.
// First set up the level, then run the main game loop.
// The main game loop ends when the level is over or when escape is pressed
while (!keys[27] || this.gameState == GameState.Quitting)
{
// First set up the variables for the current level
int level_width = current_level / 4 * 384 + 640;
int level_height = current_level>1?1024:480;
int level_rocks = (current_level - 1) / 2 * 100;
int level_target = current_level * 500;
int level_diggers = current_level * current_level * 50;
int level_goldLumps = current_level * current_level * 50;
// Special levels that don't conform to the formulas
if (current_level == 0)
{
level_rocks = 0;
level_target = 100;
level_diggers = 50;
level_goldLumps = 10;
}
if (current_level == 1)
{
level_rocks = 10;
level_target = 200;
level_goldLumps = 30;
}
if (current_level == 2) level_rocks = 50;
if (current_level == 6)
{
level_height = 2048;
level_target = 99999;
level_diggers = 800;
}
// Jon: The is in seconds
int level_timeLimit = level_target * 2;
// Create the heightmap for the surface by subdivision
level[0] = 200;
level[512] = 200;
for (int i = 512; i > 1; i /= 2)
{
for (int p = 0; p < 1024; p += i)
{
int d0 = level[p];
int d1 = level[(p + i) & 1023];
auto random = uniform(0, i, gen);
level[p + i / 2] = (d0 + d1) / 2 + (random - i / 2) / 4;
}
}
// Create the platforms for gold-dumping
for (int x = 0; x < 88; x++)
{
level[x] = level[88] - 2;
level[level_width - x - 1] = level[level_width - 88 - 1] - 2;
}
// Render the level graphics
for (int y = 1; y < level_height; y++)
for (int x = 0; x < level_width; x++)
{
int i = x | y << 10;
auto r1 = uniform(0.0f, 1.0f, gen);
auto r2 = uniform(0.0f, 1.0f, gen);
auto r3 = uniform(0.0f, 1.0f, gen);
double br = 1.2 - (r1 - 0.5) * r2 * r3 * 0.6;
br *= (1 - i / (1024 * 6048.0));
if (x < 8 || x >= level_width - 8 || y >= level_height - 8) // Rock on the edges
{
int c = cast(int)(180 * br);
level[i] = c << 16 | c << 8 | c;
}
else if (y < level[i % 1024]) // Nothing on top of the level
{
level[i] = 0;
}
else
// Dirt and grass
{
int r = cast(int)(111 * br);
int g = cast(int)(92 * br);
int b = cast(int)(51 * br);
if (y < level[x] + 4) // Grass if it's the top four pixels
{
r = cast(int)(44 * br);
g = cast(int)(148 * br);
b = cast(int)(49 * br);
if (x < 88 || x > level_width - 89)
{
r = b = g;
}
}
level[i] = r << 16 | g << 8 | b;
}
if (y >= level_height - 10 && slimes[current_level] > 0)
{
level[i] = 0x00ff00;
}
}
// Add all gold, rocks and slime blobs to the level graphics
for (int i = 0; i < level_goldLumps + level_rocks + slimes[current_level]; i++)
{
// Pick a position, but favor deeper positions
int x = uniform(0, level_width - 40, gen) + 20;
int y0 = uniform(0, level_height - 240, gen) + 200;
int y1 = uniform(0, level_height - 240, gen) + 200;
int y2 = uniform(0, level_height - 240, gen) + 200;
int y = y1 > y0 ? y1 : y0;
if (y2 > y) y = y2;
// Determine the type and size in the ugliest way possible
int type = 0;
int size = uniform(0, 8, gen) + 4;
if (i >= level_goldLumps) // If it's not gold lumps, then it's rocks
{
size = uniform(0, 32, gen) + 8;
type = 1;
if (i - level_goldLumps >= level_rocks) // Of course, it might be slime
{
type = 2;
size = 6;
}
}
// Render the blob
for (int xx = x - size; xx <= x + size; xx++)
for (int yy = y - size; yy <= y + size; yy++)
{
int d = (xx - x) * (xx - x) + (yy - y) * (yy - y);
if (xx >= 0 && yy >= 0 && xx < 1024 && yy < 2048 && d < size * size)
{
if (type == 1)
{
// Rocks (type 1) have a cool gradient
int d2 = cast(int)(((xx - x + size / 3.0) * (xx - x + size / 3.0) / size / size + (yy - y + size / 3.0) * (yy - y + size / 3.0) / size / size) * 64);
int c = 200 - d2 - uniform(0, 16, gen);
if (level[xx | yy << 10] != 0) level[xx | yy << 10] = c << 16 | c << 8 | c;
}
else
{
// Slime and gold are monocolored
if (level[xx | yy << 10] != 0) level[xx | yy << 10] = (type * 128 - type / 2) << 16 ^ 0xffff00;
}
}
}
}
// Set up the miners as a 2d array. Each miner has 8 variables.
// Jon: I made a real struct here for sanity's sake.
struct Miner
{
int x_position;
int y_position;
int direction; // Either -1 or 1
int walk_animation_step; // Between 0 and 15
int jump_velocity; // Between -1 and 16. -1 = on ground, 0 = falling, 1-8 = jumping straight, 9-16 = jumping one pixel up.
int carrying_gold; // 1 or 0
int alive; // 1 or 0
int distance_fallen; // 0 if the miner is on the ground
}
Miner[] miners = new Miner[level_diggers];
// miners[i][0] = x position
// miners[i][1] = y position
// miners[i][2] = direction (-1 or 1)
// miners[i][3] = walk animation step, between 0 and 15
// miners[i][4] = jump velocity, between -1 and 16. -1 = on ground, 0 = falling, 1-8 = jumping straight, 9-16 = jumping one pixel up.
// miners[i][5] = 1 if the miner is carrying a gold lump, 0 otherwise
// miners[i][6] = 0 if the miner is alive, otherwise it's the death animation frame
// miners[i][7] = distance the miner has fallen. 0 if the miner is on the ground.
for (int i = 0; i < miners.length; i++)
{
miners[i].x_position = uniform(0, 88 - 24 - 16, gen) + 24;
if (i < miners.length / 2) miners[i].x_position = level_width - miners[i].x_position;
miners[i].y_position = -uniform(0, 400, gen);
miners[i].direction = uniform(0, 2, gen) * 2 - 1;
miners[i].distance_fallen = -640;
}
// Last known mouse positions
int xMo = 0;
int yMo = 0;
mouseButton = 1;
// Camera position
int xo = 0;
int yo = 0;
// Various variables
int score = 0;
bool levelOver = false;
bool levelStarted = false;
import std.datetime;
long roundsStartTime = Clock.currStdTime;
long lastTime = roundsStartTime;
// Run main loop until the level is over and another level needs to be created, or until escape is pressed
while (!levelOver && !keys[27])
{
// First calculate the mouse positions
// xM = current mouse position
// xMo = old mouse position
int xM = xMouse + xo;
int yM = yMouse + yo;
// Handle painting only if the level is started
if (levelStarted && mouseButton > 0)
{
// Draw a line by interpolating between the old mouse
// positon and the new position, one pixel at a time
import std.math;
// TODO(Jon): Is this right?
int d = cast(int)sqrt(cast(double)(xM - xMo) * (xM - xMo) + (yM - yMo) * (yM - yMo)) + 1;
for (int i = 0; i < d; i++)
{
int xm = xM + (xMo - xM) * i / d;
int ym = yM + (yMo - yM) * i / d;
// Draw a box with the corners missing around each position
for (int xx = -3; xx <= 3; xx++)
for (int yy = -3; yy <= 3; yy++)
{
if ((xx != -3 && xx != 3) || (yy != -3 && yy != 3)) // Missing corners
{
int x = xm + xx;
int y = ym + yy;
if (x >= 0 && y >= 0 && x < 1024 && y < 2048)
{
if (mouseButton == 3 || keys[17]) // Right mouse button, or shift pressed
{
int r = level[x | y << 10] >> 16 & 0xff;
int g = level[x | y << 10] >> 8 & 0xff;
int b = level[x | y << 10] >> 0 & 0xff;
// Only clear the terrain if it isn't gold (r and g equal),
// rock (r, g and b equal) or slime (r and b equal)
if (r != g && r != b) level[x | y << 10] = 0;
}
else
{
// Only add dirt if there's no terrain on the pixel
if (level[x | y << 10] == 0)
{
double br = 1.6 - (uniform(0.0f, 1.0f, gen) - 0.5) * uniform(0.0f, 1.0f, gen) * uniform(0.0f, 1.0f, gen) * 0.6;
br *= (1 - (x | y << 10) / (1024 * 6048.0));
int r = cast(int)(111 * br);
int g = cast(int)(92 * br);
int b = cast(int)(51 * br);
level[x | y << 10] = r << 16 | g << 8 | b;
}
}
}
}
}
}
}
// Set the last known mouse position to the current mouse position
xMo = xM;
yMo = yM;
// Blit the terrain data to the screen buffer.
for (int yPixel = 0; yPixel < 480; yPixel++)
{
// This method call can be replaced by a smaller for-loop, but this is way faster
// public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
//System.arraycopy(level, xo | (yo + yPixel) << 10, pixels, yPixel * 640, 640);
// Jon: In D we can use slice operators to copy the arrays
size_t start = xo | (yo + yPixel) << 10;
size_t pixelStart = yPixel * 640;
pixels[pixelStart .. pixelStart + 640] = level[start .. start + 640];
}
// Jon: Here's some red, for testing.
// for (int yPixel = 0; yPixel < 480; yPixel++)
// {
// for (int xPixel = 0; xPixel < 640; xPixel++)
// {
// pixels[(yPixel * 640) + xPixel] = 0x000000FF;
// }
// }
debug writeln("Rendering miners");
// Render all miners
for (int i = 0; i < miners.length; i++)
{
// Only render the miner if the death animation hasn't finished playing
if (miners[i].alive < 4 * 4)
{
for (int xx = -3; xx <= 3; xx++)
for (int yy = -8; yy <= 1; yy++)
{
// Flip the x position if the miner is facing left by multiplying the
// x position by the direction
int x = miners[i].x_position - xo + xx * miners[i].direction;
int y = miners[i].y_position - yo + yy;
// If the pixel is onscreen
if (x >= 0 && y >= 0 && x < 640 && y < 480)
{
// Get the character from the animation data
char ch = SPRITES[(xx + 3) + (yy + 8) * 7 + (miners[i].walk_animation_step / 4) * 7 * 10];
if (miners[i].alive > 0) // Get ANOTHER character if the death animation is playing
{
ch = SPRITES[(xx + 3) + (yy + 8) * 7 + (miners[i].alive / 4 + 3) * 7 * 10];
}
if (ch == 'X' && miners[i].carrying_gold == 1) pixels[x + y * 640] = 0xffff00; // Gold. Only render if the miner is holding gold
if (ch == 'o') pixels[x + y * 640] = 0xDB8EaF; // Skin
if (ch == '!') pixels[x + y * 640] = 0x00FF00; // Hair
if (ch == '*') pixels[x + y * 640] = 0x0000FF; // Clothes
if (ch == '#') pixels[x + y * 640] = 0xFF0000; // Blood
}
}
}
}
debug writeln("Finished rendering miners");
// Game logic. Is run once every 25 ms by making sure the lastTime variable is at least as big as
// currentTimeMillis, and increasing it by 25 every time the loop is run.
while (levelStarted && lastTime < Clock.currStdTime)
{
import std.conv;
debug writeln("Current time is: " ~ Clock.currStdTime.to!string);
lastTime += 25 * 1_000 * 10; // Convert to hecto-nanoseconds
debug writeln("Last time is now: " ~ lastTime.to!string);
// Slime spreading. Pick 400 random pixels, and if they're slime, spread slime
// around them in a random direction.
for (int i = 0; i < 400; i++)
{
int x = uniform(0, 1021, gen) + 1;
int y = uniform(0, 1021, gen) + 1;
int x2 = x + uniform(0, 3, gen) - 1;
int y2 = y + uniform(0, 3, gen) - 1;
if (level[x2 | y2 << 10] == 0x00ff00)
{
// A small box around the slime helps it spread slightly faster, and makes
// it look a bit better
for (int xx = -1; xx <= 1; xx++)
for (int yy = -1; yy <= 1; yy++)
{
level[(x + xx) | (y + yy) << 10] = 0x00ff00;
}
}
}
// Miner logic
for (int i = 0; i < miners.length; i++)
{
// Only run logic if the miner isn't dead.
if (miners[i].alive == 0)
{
if (miners[i].jump_velocity > 1 && miners[i].y_position > 1) // If the miner is jumping and isn't above the screen
{
// If the pixel he's trying to reach is cleared
if ((level[(miners[i].x_position + miners[i].direction) | (miners[i].y_position - miners[i].jump_velocity / 8) << 10]) == 0)
{
// Move him there, and decrease the falling time
miners[i].x_position += miners[i].direction;
miners[i].y_position -= miners[i].jump_velocity / 8;
miners[i].walk_animation_step = (miners[i].walk_animation_step + 1) & 15; // Animation
miners[i].jump_velocity--;
}
else
{
// Stop jumping
miners[i].jump_velocity = 0;
}
}
else
{
// If the miner is inside gold, move him up one pixel
if (miners[i].y_position > 0 && level[miners[i].x_position | miners[i].y_position << 10] == 0xffff00)
miners[i].y_position--;
// If the miner is on top of a black pixel, or if the miner is above the screen
if (miners[i].y_position < 4 || level[(miners[i].x_position) | (miners[i].y_position + 1) << 10] == 0)
{
// 66% chance of jumping if the miner is on the ground
if (miners[i].jump_velocity == -1 && uniform(0, 3, gen) != 0)
{
miners[i].jump_velocity = 16;
}
else
{
// Otherwise, fall up to three pixels down and increase the distance fallen
for (int j = 0; j < 2; j++)
if (miners[i].y_position < 4 || level[(miners[i].x_position) | (miners[i].y_position + 1) << 10] == 0)
{
miners[i].y_position++;
miners[i].jump_velocity = 0;
miners[i].distance_fallen++;
}
}
}
else
// If the miner isn't on top of a black pixel
{
// If the miner has fallen more than 100 pixels, kill him.
if (miners[i].distance_fallen > 100)
{
miners[i].alive = 1;
level_diggers--;
miners[i].x_position -= miners[i].direction;
}
// Miner hasn't fallen, and is on the ground
miners[i].distance_fallen = 0;
miners[i].jump_velocity = -1;
// There's a 1/20 chance each tick that a miner will stand still.
// This breaks up piles of miners, and makes them feel more dynamic
if (uniform(0, 20, gen) != 0)
{
// Assume the miner has hit a wall
bool hit = true;
// The miner can walk up slopes 4 pixels high, and down slopes two pixels deep, so check for free pixels in that range
for (int y = 2; y >= -4; y--)
{
if ((level[(miners[i].x_position + miners[i].direction) | (miners[i].y_position + y) << 10]) == 0)
{
miners[i].x_position += miners[i].direction;
miners[i].y_position += y;
miners[i].walk_animation_step = (miners[i].walk_animation_step + 1) & 15;
hit = false;
break;
}
}
// 1/10 chance the miner will turn around if he's hit a wall
// 1/4000 chance the miner will turn around if he didn't hit a wall
if (uniform(0, hit ? 10 : 4000, gen) == 0)
{
miners[i].direction *= -1;
if (hit)
{
// 66% chance the miner will jump when he turns around if he hit a wall
if (uniform(0, 3, gen) != 0) miners[i].jump_velocity = 16;
}
}
}
}
}
// Check if the miner should drop gold.
// A miner drops gold if he's holding gold, is above ground, and is directly on top of either gold pile
if (miners[i].carrying_gold == 1 && miners[i].y_position <= level[miners[i].x_position] && (miners[i].x_position == 8 + 32 || miners[i].x_position == level_width - 8 - 32))
{
score++;
// Slide four pixel of gold diagonally down until they hit ground
for (int j = 0; j < 4; j++)
{
int xx = miners[i].x_position;
int yy = miners[i].y_position - 5;
bool done = false;
while (!done)
{
if (level[(xx + 0) | (yy + 1) << 10] == 0) // Straight down
{
yy++;
}
else if (level[(xx - 1) | (yy + 1) << 10] == 0) // Diagonally to the left
{
xx--;
yy++;
}
else if (level[(xx + 1) | (yy + 1) << 10] == 0) // Diagonally to the right
{
xx++;
yy++;
}
else
// No more falling!
{
done = true;
}
}
// If the resulting position is above ground, add the gold pixel
if (yy < level[xx]) level[xx | yy << 10] = 0xfefe00;
}
// Clear the carrying gold flag
miners[i].carrying_gold = 0;
}
// Check the rendered pixels to see if the miner hits gold or slime
// This check was originally embedded in the rendering loop to save space,
// but the fixed time fix forced me to separate them.
for (int xx = -3; xx <= 3; xx++)
for (int yy = -8; yy <= 1; yy++)
{
int x = miners[i].x_position + xx * miners[i].direction;
int y = miners[i].y_position + yy;
if (x >= 0 && y >= 0 && x < level_width && y < level_height)
{
// If the pixel was rendered
if (SPRITES[(xx + 3) + (yy + 8) * 7 + (miners[i].walk_animation_step / 4) * 7 * 10] != ' ')
{
// If the pixel is slime, blow up the miner
if (level[x | y << 10] == 0x00ff00)
{
miners[i].alive = 1;
level_diggers--;
// Render a black sphere of radius 16 to the level
int s = 16;
for (int xxb = -s; xxb <= +s; xxb++)
for (int yyb = -s; yyb <= +s; yyb++)
{
int dd = xxb * xxb + yyb * yyb;
int xxa = xxb + miners[i].x_position;
int yya = yyb + miners[i].y_position - 4;
// This destroys everything except the level borders
if (xxa >= 4 && yya >= 4 && xxa < level_width - 4 && yya < level_height - 4 && dd < s * s)
{
level[xxa | yya << 10] = 0x000000;
}
}
}
// If the miner isn't carrying gold, and the pixel is gold
if (miners[i].carrying_gold == 0 && level[x | y << 10] == 0xffff00)
{
// Remove a box of gold from the level
for (int xxx = -1; xxx <= 1; xxx++)
for (int yyy = -1; yyy <= 1; yyy++)
{
if (level[(x + xxx) & 1023 | ((y + yyy) & 1023) << 10] == 0xffff00) level[(x + xxx) & 1023 | ((y + yyy) & 1023) << 10] = 0x000000;
}
// Add it to the miner
miners[i].carrying_gold = 1;
}
}
}
}
}
else
{
// If the miner is dead, increase the miner death
// animation one step
if (miners[i].alive < 4 * 4) miners[i].alive++;
}
}
// Move the camera if the left, right, up or down arrow keys are pressed
if (keys[37] && xo > 8) xo -= 8;
if (keys[39] && xo < level_width - 640) xo += 8;
if (keys[38] && yo > 8) yo -= 8;
if (keys[40] && yo < level_height - 480) yo += 8;
}
// Draw the rendered graphics to our offscreen image
// TODO(Jon): Figure out drawing text
// gr2.drawImage(img, 0, 0, null);
SDL_RenderClear(renderer);
SDL_Texture* texture;
{
uint rmask, gmask, bmask, amask;
version (LittleEndian)
{
rmask = 0x00ff0000;
gmask = 0x0000ff00;
bmask = 0x000000ff;
amask = 0x00000000;
}
version (BigEndian)
{
rmask = 0x00ff0000;
gmask = 0x0000ff00;
bmask = 0x000000ff;
amask = 0x00000000;
}
SDL_Surface* surface = SDL_CreateRGBSurfaceFrom(cast(void*)pixels, 640, 480, 32, 4 * 640, rmask, gmask, bmask, amask);
import std.exception : enforce;
texture = enforce(SDL_CreateTextureFromSurface(renderer, surface));
SDL_FreeSurface(surface);
}
SDL_Rect sourceRect;
sourceRect.x = 0;
sourceRect.y = 0;
sourceRect.w = 640;
sourceRect.h = 480;
SDL_Rect destinationRect = sourceRect;
SDL_RenderCopy(renderer, texture, &sourceRect, &destinationRect);
SDL_RenderPresent(renderer);
SDL_DestroyTexture(texture);
// If the level hasn't started yet, display the level information and wait for a mouse click
if (!levelStarted)
{
// TODO(Jon): Figure out drawing text
// gr2.setFont(new Font("Sans-Serif", Font.BOLD, 30));
// gr2.drawString(levelNames[current_level], 200, 100);
// gr2.setFont(new Font("Sans-Serif", Font.PLAIN, 12));
// gr2.drawString(infoStrings[current_level], 200, 116);
// gr2.drawString("(click to start)", 200, 132);
if (mouseButton > 0)
{
levelStarted = true;
mouseButton = 0;
}
roundsStartTime = Clock.currStdTime;
lastTime = roundsStartTime;
}
// Render game stats
// Jon: Instead of ms, we're using hnsec, which is 10_000_000ths of a second
long passedTime = (Clock.currStdTime - roundsStartTime) / 10_000_000;
// TODO(Jon): Figure out drawing text
// gr2.drawString("Miners: " + level_diggers, 10, 36);
// gr2.drawString("Gold: " + score + " / " + level_target, 10, 48);
// gr2.drawString("Time left: " + (level_timeLimit - passedTime), 10, 60);
// gr.drawImage(img2, 0, 0, null);
import core.thread;
// If the level was won, show splash, wait two seconds, then end main game loop
if (score >= level_target)
{
debug writeln("Level passed");
// Only increase the current level if we're not on the last level
if (current_level < 6)
{
current_level++;
}
// TODO(Jon): Figure out drawing text
// gr2.setFont(new Font("Sans-Serif", Font.BOLD, 30));
// gr2.drawString("LEVEL PASSED!", 200, 100);
// gr.drawImage(img2, 0, 0, null);
Thread.sleep(2000.dur!("msecs"));
levelOver = true;
}
import std.conv;
debug writeln("Level passedTime: " ~ passedTime.to!string ~ " of limit: " ~ level_timeLimit.to!string);
// If the level was lost, show splash, wait two seconds, then end main game loop
// The level can be lost by losing all miners, running out of time, or pressing 'k'
if (level_diggers <= 0 || (level_timeLimit - passedTime) <= 0 || keys[75])
{
debug if (level_diggers <= 0) writeln("Level failed because all diggers are dead.");
import std.conv;
debug if ((level_timeLimit - passedTime) <= 0) writeln("Level failed because time ran out. passedTime: " ~ passedTime.to!string ~ " of limit: " ~ level_timeLimit.to!string);
// TODO(Jon): Figure out drawing text
// gr2.setFont(new Font("Sans-Serif", Font.BOLD, 30));
// gr2.drawString("LEVEL FAILED!", 200, 100);
// gr.drawImage(img2, 0, 0, null);
Thread.sleep(2000.dur!("msecs"));
levelOver = true;
}
// A small sleep prevents the game from eating all the cpu power
Thread.sleep(10.dur!("msecs"));
this.pumpEvents;
}
this.pumpEvents;
}
// System.exit(0) makes sure nothing is left in the background
import core.stdc.stdlib;
exit(0);
}
}
void pumpEvents()
{
// Pump events
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
{
// System.exit(0) makes sure nothing is left in the background
import core.stdc.stdlib;
exit(0);
} break;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
{
debug writeln("Mouse button pressed! " ~ (event.type == SDL_MOUSEBUTTONUP ? "Up" : "Down"));
if (event.type == SDL_MOUSEBUTTONDOWN)
{
if (event.button.button == SDL_BUTTON_LEFT)
{
mouseButton = 1;
}
else if (event.button.button == SDL_BUTTON_RIGHT)
{
mouseButton = 3;
}
}
else
{
mouseButton = 0;
}
} break;
case SDL_KEYDOWN:
case SDL_KEYUP:
{
// If the key pressed was ESC
if (event.key.keysym.sym == SDLK_ESCAPE)
{
keys[27] = true;
}
else if (event.key.keysym.sym == SDLK_RSHIFT)
{
}
} break;
case SDL_MOUSEMOTION:
{
xMouse = event.motion.x;
yMouse = event.motion.y;
import std.conv;
debug writeln("Mouse was moved! x: " ~ xMouse.to!string ~ " y: " ~ yMouse.to!string);
} break;
default: break;
}
}
}
}
void main()
{
debug writeln("Starting Dminers");
// Load the SDL 2 library.
DerelictSDL2.load();
DerelictSDL2Image.load();
auto game = Game();
game.start;
debug writeln("Finishing Dminers");
}
|
D
|
module battle.state.battleover;
import std.typecons;
import dau.all;
import model.all;
import title.title;
import battle.battle;
import gui.battleover;
import battle.system.all;
/// player may choose to end turn
class BattleOver : State!Battle {
this(Flag!"Victory" victory) {
_victory = victory;
}
override {
void enter(Battle b) {
b.disableSystem!TileHoverSystem;
b.gui.addElement(new BattleOverPopup(_victory));
}
void update(Battle b, float time, InputManager input) {
if (input.skip) {
b.gui.clear();
setScene(new Title());
}
}
}
private:
Flag!"Victory" _victory;
}
|
D
|
/Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/build/TestProjectForSibersCompanyByKurilovP.build/Debug-iphonesimulator/TestProjectForSibersCompanyByKurilovP.build/Objects-normal/x86_64/Alert.o : /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIImageView+Cache.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/ErrorResponse.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/AppDelegate.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/CharacterDetailViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/CharacterImageCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/ChararcterCellViewModels/CharacterTableCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/ChararcterDetailCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterImageTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterDetailTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/Cells/CharacterTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/DefaultCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterImageViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/DiscardableImageCacheItem.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Origin.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Location.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UITextField+ClearButton.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Info.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManager.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/СharacterDetailController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/HudHelper.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Character.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManagerError.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListCoordinator.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/RequestFeeds.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIColor+AppColors.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/NetworkRequests.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/ReachabilityConnect.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Result.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/Constant.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkEndpoint.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/Alert.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharacterImageView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/build/TestProjectForSibersCompanyByKurilovP.build/Debug-iphonesimulator/TestProjectForSibersCompanyByKurilovP.build/Objects-normal/x86_64/Alert~partial.swiftmodule : /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIImageView+Cache.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/ErrorResponse.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/AppDelegate.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/CharacterDetailViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/CharacterImageCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/ChararcterCellViewModels/CharacterTableCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/ChararcterDetailCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterImageTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterDetailTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/Cells/CharacterTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/DefaultCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterImageViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/DiscardableImageCacheItem.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Origin.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Location.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UITextField+ClearButton.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Info.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManager.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/СharacterDetailController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/HudHelper.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Character.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManagerError.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListCoordinator.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/RequestFeeds.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIColor+AppColors.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/NetworkRequests.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/ReachabilityConnect.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Result.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/Constant.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkEndpoint.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/Alert.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharacterImageView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/build/TestProjectForSibersCompanyByKurilovP.build/Debug-iphonesimulator/TestProjectForSibersCompanyByKurilovP.build/Objects-normal/x86_64/Alert~partial.swiftdoc : /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIImageView+Cache.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/ErrorResponse.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/AppDelegate.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/CharacterDetailViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/CharacterImageCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/ChararcterCellViewModels/CharacterTableCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/ChararcterDetailCellViewModels/ChararcterDetailCellViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListViewModel.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterImageTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/Cells/CharacterDetailTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/Cells/CharacterTableCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/DefaultCell.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterImageViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharacterDetailTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListTableCellViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Protocols/CharactersListViewModelProtocol.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/DiscardableImageCacheItem.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Origin.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Location.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UITextField+ClearButton.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Info.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManager.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharactersImageController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterDetailScreen/СharacterDetailController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListController.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/HudHelper.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Models/Character.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkManagerError.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharactersListScreen/CharactersListCoordinator.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/RequestFeeds.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Extensions/UIColor+AppColors.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Requests/NetworkRequests.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/ReachabilityConnect.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/Result.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Helper/Constant.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Service/NetworkEndpoint.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Base/Alert.swift /Users/pavelkurilov/Library/Mobile\ Documents/com~apple~CloudDocs/TestProjectForSibersCompanyByKurilovP/TestProjectForSibersCompanyByKurilovP/Screens/CharacterImageScreen/CharacterImageView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;
immutable int MOD = 10^^9+7;
immutable int MAX = 401;
void main() {
auto s = readln.split.map!(to!int);
auto N = s[0];
auto K = s[1];
auto A = readln.split.map!(to!long).array;
auto B = readln.split.map!(to!long).array;
auto p = new long[][](MAX, MAX);
foreach (i; 0..MAX) {
p[i][0] = 1;
foreach (j; 1..MAX) {
p[i][j] = p[i][j-1] * i % MOD;
}
}
auto ps = new long[][](MAX, MAX+1);
foreach (i; 0..MAX) {
ps[i][0] = 1;
foreach (j; 1..MAX) {
ps[i][j] = (ps[i][j-1] + p[j][i]) % MOD;
}
}
auto dp = new long[][](N+1, K+1);
foreach (i; 0..N+1) fill(dp[i], 0);
dp[0][0] = 1;
foreach (i; 1..N+1) {
foreach (j; 0..K+1) {
foreach (k; 0..j+1) {
auto wa = ps[j-k][B[i-1].to!int] - ps[j-k][A[i-1].to!int-1];
dp[i][j] += dp[i-1][k] * wa % MOD;
dp[i][j] %= MOD;
}
}
}
//dp.writeln;
writeln((dp[N][K]+MOD)%MOD);
}
|
D
|
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module flow.batch.service.api.BatchPart;
import hunt.time.LocalDateTime;
alias Date = LocalDateTime ;
interface BatchPart {
string getId();
string getBatchType();
string getBatchId();
Date getCreateTime();
Date getCompleteTime();
bool isCompleted();
string getBatchSearchKey();
string getBatchSearchKey2();
string getStatus();
string getScopeId();
string getScopeType();
string getSubScopeId();
string getResultDocumentJson();
string getTenantId();
}
|
D
|
/Users/jonb/Documents/GitHub/rustapps/twitterplotter/target/debug/deps/rand_hc-cd225f050b5b923b.rmeta: /Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/lib.rs /Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/hc128.rs
/Users/jonb/Documents/GitHub/rustapps/twitterplotter/target/debug/deps/librand_hc-cd225f050b5b923b.rlib: /Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/lib.rs /Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/hc128.rs
/Users/jonb/Documents/GitHub/rustapps/twitterplotter/target/debug/deps/rand_hc-cd225f050b5b923b.d: /Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/lib.rs /Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/hc128.rs
/Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/lib.rs:
/Users/jonb/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/hc128.rs:
|
D
|
/*
* gravity.d
*
* This file holds bindings to pango's pango-gravity.h. The original
* copyright is displayed below, but does not pertain to this file.
*
* Author: Dave Wilkinson
*
*/
module binding.pango.gravity;
/* Pango
* pango-gravity.h: Gravity routines
*
* Copyright (C) 2006, 2007 Red Hat Software
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* PangoGravity:
* @PANGO_GRAVITY_SOUTH: Glyphs stand upright (default)
* @PANGO_GRAVITY_EAST: Glyphs are rotated 90 degrees clockwise
* @PANGO_GRAVITY_NORTH: Glyphs are upside-down
* @PANGO_GRAVITY_WEST: Glyphs are rotated 90 degrees counter-clockwise
* @PANGO_GRAVITY_AUTO: Gravity is resolved from the context matrix
*
* The #PangoGravity type represents the orientation of glyphs in a segment
* of text. This is useful when rendering vertical text layouts. In
* those situations, the layout is rotated using a non-identity PangoMatrix,
* and then glyph orientation is controlled using #PangoGravity.
* Not every value in this enumeration makes sense for every usage of
* #PangoGravity; for example, %PANGO_GRAVITY_AUTO only can be passed to
* pango_context_set_base_gravity() and can only be returned by
* pango_context_get_base_gravity().
*
* See also: #PangoGravityHint
*
* Since: 1.16
**/
enum PangoGravity {
PANGO_GRAVITY_SOUTH,
PANGO_GRAVITY_EAST,
PANGO_GRAVITY_NORTH,
PANGO_GRAVITY_WEST,
PANGO_GRAVITY_AUTO
}
/**
* PangoGravityHint:
* @PANGO_GRAVITY_HINT_NATURAL: scripts will take their natural gravity based
* on the base gravity and the script. This is the default.
* @PANGO_GRAVITY_HINT_STRONG: always use the base gravity set, regardless of
* the script.
* @PANGO_GRAVITY_HINT_LINE: for scripts not in their natural direction (eg.
* Latin in East gravity), choose per-script gravity such that every script
* respects the line progression. This means, Latin and Arabic will take
* opposite gravities and both flow top-to-bottom for example.
*
* The #PangoGravityHint defines how horizontal scripts should behave in a
* vertical context. That is, English excerpt in a vertical paragraph for
* example.
*
* See #PangoGravity.
*
* Since: 1.16
**/
enum PangoGravityHint {
PANGO_GRAVITY_HINT_NATURAL,
PANGO_GRAVITY_HINT_STRONG,
PANGO_GRAVITY_HINT_LINE
}
/**
* PANGO_GRAVITY_IS_VERTICAL:
* @gravity: the #PangoGravity to check
*
* Whether a #PangoGravity represents vertical writing directions.
*
* Returns: %TRUE if @gravity is %PANGO_GRAVITY_EAST or %PANGO_GRAVITY_WEST,
* %FALSE otherwise.
*
* Since: 1.16
**/
//#define PANGO_GRAVITY_IS_VERTICAL(gravity) ((gravity) == PANGO_GRAVITY_EAST || (gravity) == PANGO_GRAVITY_WEST)
import binding.pango.matrix;
import binding.pango.script;
extern(C):
double pango_gravity_to_rotation (PangoGravity gravity);
PangoGravity pango_gravity_get_for_matrix (PangoMatrix *matrix);
PangoGravity pango_gravity_get_for_script (PangoScript script,
PangoGravity base_gravity,
PangoGravityHint hint);
|
D
|
/Users/dimdew/CLionProjects/talent_plan_kv/simple_kv/target/release/deps/strsim-7154edeaf70fb41d.rmeta: /Users/dimdew/.cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.8.0/src/lib.rs
/Users/dimdew/CLionProjects/talent_plan_kv/simple_kv/target/release/deps/libstrsim-7154edeaf70fb41d.rlib: /Users/dimdew/.cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.8.0/src/lib.rs
/Users/dimdew/CLionProjects/talent_plan_kv/simple_kv/target/release/deps/strsim-7154edeaf70fb41d.d: /Users/dimdew/.cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.8.0/src/lib.rs
/Users/dimdew/.cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.8.0/src/lib.rs:
|
D
|
class c{
void f(int a,int b){
Print(a,b);
}
void g(int a,int b){
Print(a);
Print(b);
}
}
class d extends c{
void f(int a,int b){
Print(a);
Print(2.3);
Print(b);
}
}
int main(){
c obj;
obj=new d;
obj.f(5,4);
}
|
D
|
instance GUR_1204_BaalNamib(Npc_Default)
{
name[0] = "Baal Namib";
npcType = npctype_main;
guild = GIL_GUR;
level = 29;
flags = NPC_FLAG_IMMORTAL;
voice = 2;
id = 1204;
attribute[ATR_STRENGTH] = 70;
attribute[ATR_DEXTERITY] = 55;
attribute[ATR_MANA_MAX] = 50;
attribute[ATR_MANA] = 50;
attribute[ATR_HITPOINTS_MAX] = 388;
attribute[ATR_HITPOINTS] = 388;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Psionic",20,1,gur_armor_m);
B_Scale(self);
Mdl_SetModelFatness(self,-1);
Npc_SetTalentSkill(self,NPC_TALENT_MAGE,6);
CreateInvItem(self,ItArRuneSleep);
EquipItem(self,Namibs_Keule);
daily_routine = Rtn_Start_1204;
fight_tactic = FAI_HUMAN_MAGE;
};
func void Rtn_Start_1204()
{
TA_Smalltalk(8,0,20,0,"PSI_PATH_1");
TA_Smalltalk(20,0,8,0,"PSI_PATH_1");
};
|
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-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/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.globals;
import dmd.id;
import dmd.identifier;
import dmd.lexer;
import dmd.errors;
import dmd.root.filename;
import dmd.root.outbuffer;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.root.string;
import dmd.tokens;
// 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;
/**********************************
* Set operator precedence for each operator.
*
* Used by hdrgen
*/
immutable PREC[TOK.max + 1] precedence =
[
TOK.type : PREC.expr,
TOK.error : PREC.expr,
TOK.objcClassReference : PREC.expr, // Objective-C class reference, same as TOK.type
TOK.typeof_ : PREC.primary,
TOK.mixin_ : PREC.primary,
TOK.import_ : PREC.primary,
TOK.dotVariable : PREC.primary,
TOK.scope_ : PREC.primary,
TOK.identifier : PREC.primary,
TOK.this_ : PREC.primary,
TOK.super_ : PREC.primary,
TOK.int64 : PREC.primary,
TOK.float64 : PREC.primary,
TOK.complex80 : PREC.primary,
TOK.null_ : PREC.primary,
TOK.string_ : PREC.primary,
TOK.arrayLiteral : PREC.primary,
TOK.assocArrayLiteral : PREC.primary,
TOK.classReference : PREC.primary,
TOK.file : PREC.primary,
TOK.fileFullPath : PREC.primary,
TOK.line : PREC.primary,
TOK.moduleString : PREC.primary,
TOK.functionString : PREC.primary,
TOK.prettyFunction : PREC.primary,
TOK.typeid_ : PREC.primary,
TOK.is_ : PREC.primary,
TOK.assert_ : PREC.primary,
TOK.halt : PREC.primary,
TOK.template_ : PREC.primary,
TOK.dSymbol : PREC.primary,
TOK.function_ : PREC.primary,
TOK.variable : PREC.primary,
TOK.symbolOffset : PREC.primary,
TOK.structLiteral : PREC.primary,
TOK.compoundLiteral : PREC.primary,
TOK.arrayLength : PREC.primary,
TOK.delegatePointer : PREC.primary,
TOK.delegateFunctionPointer : PREC.primary,
TOK.remove : PREC.primary,
TOK.tuple : PREC.primary,
TOK.traits : PREC.primary,
TOK.default_ : PREC.primary,
TOK.overloadSet : PREC.primary,
TOK.void_ : PREC.primary,
TOK.vectorArray : PREC.primary,
// post
TOK.dotTemplateInstance : PREC.primary,
TOK.dotIdentifier : PREC.primary,
TOK.dotTemplateDeclaration : PREC.primary,
TOK.dot : PREC.primary,
TOK.dotType : PREC.primary,
TOK.plusPlus : PREC.primary,
TOK.minusMinus : PREC.primary,
TOK.prePlusPlus : PREC.primary,
TOK.preMinusMinus : PREC.primary,
TOK.call : PREC.primary,
TOK.slice : PREC.primary,
TOK.array : PREC.primary,
TOK.index : PREC.primary,
TOK.delegate_ : PREC.unary,
TOK.address : PREC.unary,
TOK.star : PREC.unary,
TOK.negate : PREC.unary,
TOK.uadd : PREC.unary,
TOK.not : PREC.unary,
TOK.tilde : PREC.unary,
TOK.delete_ : PREC.unary,
TOK.new_ : PREC.unary,
TOK.newAnonymousClass : PREC.unary,
TOK.cast_ : PREC.unary,
TOK.vector : PREC.unary,
TOK.pow : PREC.pow,
TOK.mul : PREC.mul,
TOK.div : PREC.mul,
TOK.mod : PREC.mul,
TOK.add : PREC.add,
TOK.min : PREC.add,
TOK.concatenate : PREC.add,
TOK.leftShift : PREC.shift,
TOK.rightShift : PREC.shift,
TOK.unsignedRightShift : PREC.shift,
TOK.lessThan : PREC.rel,
TOK.lessOrEqual : PREC.rel,
TOK.greaterThan : PREC.rel,
TOK.greaterOrEqual : PREC.rel,
TOK.in_ : PREC.rel,
/* Note that we changed precedence, so that < and != have the same
* precedence. This change is in the parser, too.
*/
TOK.equal : PREC.rel,
TOK.notEqual : PREC.rel,
TOK.identity : PREC.rel,
TOK.notIdentity : PREC.rel,
TOK.and : PREC.and,
TOK.xor : PREC.xor,
TOK.or : PREC.or,
TOK.andAnd : PREC.andand,
TOK.orOr : PREC.oror,
TOK.question : PREC.cond,
TOK.assign : PREC.assign,
TOK.construct : PREC.assign,
TOK.blit : PREC.assign,
TOK.addAssign : PREC.assign,
TOK.minAssign : PREC.assign,
TOK.concatenateAssign : PREC.assign,
TOK.concatenateElemAssign : PREC.assign,
TOK.concatenateDcharAssign : PREC.assign,
TOK.mulAssign : PREC.assign,
TOK.divAssign : PREC.assign,
TOK.modAssign : PREC.assign,
TOK.powAssign : PREC.assign,
TOK.leftShiftAssign : PREC.assign,
TOK.rightShiftAssign : PREC.assign,
TOK.unsignedRightShiftAssign : PREC.assign,
TOK.andAssign : PREC.assign,
TOK.orAssign : PREC.assign,
TOK.xorAssign : PREC.assign,
TOK.comma : PREC.expr,
TOK.declaration : PREC.expr,
TOK.interval : PREC.assign,
];
enum ParseStatementFlags : int
{
semi = 1, // empty ';' statements are allowed, but deprecated
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;
}
/*****************************
* 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;
}
/**************************************
* dump mixin expansion to file for better debugging
*/
private bool writeMixin(const(char)[] s, ref Loc loc)
{
if (!global.params.mixinOut)
return false;
OutBuffer* ob = global.params.mixinOut;
ob.writestring("// expansion at ");
ob.writestring(loc.toChars());
ob.writenl();
global.params.mixinLines++;
loc = Loc(global.params.mixinFile, global.params.mixinLines + 1, loc.charnum);
// write by line to create consistent line endings
size_t lastpos = 0;
for (size_t i = 0; i < s.length; ++i)
{
// detect LF and CRLF
const c = s[i];
if (c == '\n' || (c == '\r' && i+1 < s.length && s[i+1] == '\n'))
{
ob.writestring(s[lastpos .. i]);
ob.writenl();
global.params.mixinLines++;
if (c == '\r')
++i;
lastpos = i + 1;
}
}
if(lastpos < s.length)
ob.writestring(s[lastpos .. $]);
if (s.length == 0 || s[$-1] != '\n')
{
ob.writenl(); // ensure empty line after expansion
global.params.mixinLines++;
}
ob.writenl();
global.params.mixinLines++;
return true;
}
/***********************************************************
*/
class Parser(AST) : 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
}
/*********************
* 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)
{
super(_module ? _module.srcfile.toChars() : null, input.ptr, 0, input.length, doDocComment, false);
//printf("Parser::Parser()\n");
scanloc = loc;
if (!writeMixin(input, scanloc) && loc.filename)
{
/* Create a pseudo-filename for the mixin string, as it may not even exist
* in the source file.
*/
char* filename = cast(char*)mem.xmalloc(strlen(loc.filename) + 7 + (loc.linnum).sizeof * 3 + 1);
sprintf(filename, "%s-mixin-%d", loc.filename, cast(int)loc.linnum);
scanloc.filename = filename;
}
mod = _module;
linkage = LINK.d;
//nextToken(); // start up the scanner
}
extern (D) this(AST.Module _module, const(char)[] input, bool doDocComment)
{
super(_module ? _module.srcfile.toChars() : null, input.ptr, 0, input.length, doDocComment, false);
//printf("Parser::Parser()\n");
mod = _module;
linkage = LINK.d;
//nextToken(); // start up the scanner
}
AST.Dsymbols* parseModule()
{
const comment = token.blockComment;
bool isdeprecated = false;
AST.Expression msg = null;
AST.Expressions* udas = null;
AST.Dsymbols* decldefs;
AST.Dsymbol lastDecl = mod; // for attaching ddoc unittests to module decl
Token* tk;
if (skipAttributes(&token, &tk) && tk.value == TOK.module_)
{
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;
}
// ModuleDeclation leads off
if (token.value == TOK.module_)
{
const loc = token.loc;
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `module`");
goto Lerr;
}
Identifier[] a;
Identifier id = token.ident;
while (nextToken() == TOK.dot)
{
a ~= id;
nextToken();
if (token.value != TOK.identifier)
{
error("identifier expected following `package`");
goto Lerr;
}
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);
}
decldefs = parseDeclDefs(0, &lastDecl);
if (token.value != TOK.endOfFile)
{
error(token.loc, "unrecognized declaration");
goto Lerr;
}
return decldefs;
Lerr:
while (token.value != TOK.semicolon && token.value != TOK.endOfFile)
nextToken();
nextToken();
return new AST.Dsymbols();
}
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("conflicting storage class `deprecated(%s)` and `deprecated(%s)`", msg.toChars(), e.toChars());
}
msg = e;
return true;
}
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;
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:
{
// mixin(string)
nextToken();
auto exps = parseArguments();
check(TOK.semicolon);
s = new AST.CompileDeclaration(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.dim)
*pLastDecl = (*a)[a.dim - 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_:
if (global.params.useUnitTests || global.params.doDocComments || global.params.doHdrGeneration)
{
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);
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.dim)
*pLastDecl = (*a)[a.dim - 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))
{
// @@@DEPRECATED@@@
// 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.
if (tk.value == TOK.identifier && tk.ident == Id._body)
deprecation("Usage of the `body` keyword is deprecated. Use `do` instead.");
a = parseDeclarations(true, pAttrs, pAttrs.comment);
if (a && a.dim)
*pLastDecl = (*a)[a.dim - 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(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("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.dim);
for (size_t i = res.idents.dim; 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.dim);
for (size_t i = res.identExps.dim; 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("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;
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;
}
}
const attrloc = token.loc;
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)
{
nextToken();
if (token.value == TOK.identifier)
s = new AST.DebugSymbol(token.loc, token.ident);
else if (token.value == TOK.int32Literal || token.value == TOK.int64Literal)
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();
break;
}
condition = parseDebugCondition();
goto Lcondition;
case TOK.version_:
startloc = token.loc;
nextToken();
if (token.value == TOK.assign)
{
nextToken();
if (token.value == TOK.identifier)
s = new AST.VersionSymbol(token.loc, token.ident);
else if (token.value == TOK.int32Literal || token.value == TOK.int64Literal)
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();
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.dim)
{
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 lookingForElseSave = lookingForElse;
lookingForElse = Loc();
nextToken();
a = parseDeclDefs(0, pLastDecl);
if (token.value != TOK.rightCurly)
{
/* { */
error("matching `}` expected, not `%s`", token.toChars());
}
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)
{
if (orig & added)
{
OutBuffer buf;
AST.stcToBuffer(&buf, added);
error("redundant attribute `%s`", buf.peekChars());
return orig | added;
}
const Redundant = (STC.const_ | STC.scope_ |
(global.params.previewIn ? STC.ref_ : 0));
orig |= added;
if ((orig & STC.in_) && (added & Redundant))
{
if (added & STC.const_)
error("attribute `const` is redundant with previously-applied `in`");
else if (global.params.previewIn)
{
error("attribute `%s` is redundant with previously-applied `in`",
(orig & STC.scope_) ? "scope".ptr : "ref".ptr);
}
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 (global.params.previewIn)
{
// Windows `printf` does not support `%1$s`
const(char*) stc_str = (orig & STC.scope_) ? "scope".ptr : "ref".ptr;
error("attribute `in` cannot be added after `%s`: remove `%s`",
stc_str, stc_str);
}
else
error("attribute `in` cannot be added after `scope`: remove `scope` and use `-preview=in`");
return orig;
}
if (added & (STC.const_ | STC.immutable_ | STC.manifest))
{
StorageClass u = orig & (STC.const_ | STC.immutable_ | STC.manifest);
if (u & (u - 1))
error("conflicting attribute `%s`", Token.toChars(token.value));
}
if (added & (STC.gshared | STC.shared_ | STC.tls))
{
StorageClass u = orig & (STC.gshared | STC.shared_ | STC.tls);
if (u & (u - 1))
error("conflicting attribute `%s`", Token.toChars(token.value));
}
if (added & STC.safeGroup)
{
StorageClass u = orig & STC.safeGroup;
if (u & (u - 1))
error("conflicting attribute `@%s`", token.toChars());
}
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;
exp = new AST.CallExp(loc, exp, parseArguments());
}
if (udas is null)
udas = new AST.Expressions();
udas.push(exp);
return 0;
}
if (token.value == TOK.leftParenthesis)
{
// Multi-UDAs ( `@( ArgumentList )`) form, concatenate with existing
if (peekNext() == TOK.rightParenthesis)
error("empty attribute list is not allowed");
udas = AST.UserAttributeDeclaration.concat(udas, parseArguments());
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_;
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:
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("members of template declaration expected");
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
tiargs = parseTemplateSingleArgument();
}
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
*/
private AST.Objects* parseTemplateSingleArgument()
{
//printf("parseTemplateSingleArgument()\n");
auto tiargs = new AST.Objects();
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:
tiargs.push(ta);
nextToken();
break;
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.hexadecimalString:
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
AST.Expression ea = parsePrimaryExp();
tiargs.push(ea);
break;
}
default:
error("template argument expected following `!`");
break;
}
return tiargs;
}
/**********************************
* Parse a static assertion.
* Current token is 'static'.
*/
private AST.StaticAssert parseStaticAssert()
{
const loc = token.loc;
AST.Expression exp;
AST.Expression msg = null;
//printf("parseStaticAssert()\n");
nextToken();
nextToken();
check(TOK.leftParenthesis);
exp = parseAssignExp();
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);
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("`%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;
}
/**************************************
* 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)
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 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)
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);
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);
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 '{'
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 (global.params.doDocComments && 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.098@@@
* 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;
int hasdefault = 0;
StorageClass varargsStc;
// Attributes allowed for ...
enum VarArgsStc = STC.const_ | STC.immutable_ | STC.shared_ | STC.scope_ | STC.return_;
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_:
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_;
goto L2;
L2:
storageClass = appendStorageClass(storageClass, stc);
continue;
version (none)
{
case TOK.static_:
stc = STC.static_;
goto L2;
case TOK.auto_:
storageClass = STC.auto_;
goto L4;
case TOK.alias_:
storageClass = STC.alias_;
goto L4;
L4:
nextToken();
ai = null;
if (token.value == TOK.identifier)
{
ai = token.ident;
nextToken();
}
at = null; // no type
ae = null; // no default argument
if (token.value == TOK.assign) // = defaultArg
{
nextToken();
ae = parseDefaultInitExp();
hasdefault = 1;
}
else
{
if (hasdefault)
error("default argument expected for `alias %s`", ai ? ai.toChars() : "");
}
goto L3;
}
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");
if (tpl && token.value == TOK.identifier)
{
const tv = peekNext();
if (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 goto _else;
}
else
{
_else:
at = parseType(&ai);
}
ae = null;
if (token.value == TOK.assign) // = defaultArg
{
nextToken();
ae = parseDefaultInitExp();
hasdefault = 1;
}
else
{
if (hasdefault)
error("default argument expected for `%s`", ai ? ai.toChars() : at.toChars());
}
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 s = new AST.Dsymbols();
s.push(em);
auto uad = new AST.UserAttributeDeclaration(udas, s);
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("`}` 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("{ } 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;
}
private 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("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 && te.args)
{
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_)
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.dim > 0);
// We're good. Replay indices in the reverse order.
tid = cast(AST.TypeQualified)t;
while (dimStack.dim)
{
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
TOK 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
* Return array of Declaration *'s.
*/
private AST.Dsymbols* parseDeclarations(bool autodecl, PrefixAttributes!AST* pAttrs, const(char)* comment)
{
StorageClass storage_class = STC.undefined_;
TOK tok = TOK.reserved;
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 AliasAssignment:
* identifier = type;
*/
if (token.value == TOK.identifier && peekNext() == TOK.assign)
{
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);
addComment(s, comment);
auto a = new AST.Dsymbols();
a.push(s);
return a;
}
if (token.value == TOK.alias_)
{
const loc = token.loc;
tok = token.value;
nextToken();
/* Look for:
* alias identifier this;
*/
if (token.value == TOK.identifier && peekNext() == TOK.this_)
{
auto s = new AST.AliasThis(loc, token.ident);
nextToken();
check(TOK.this_);
check(TOK.semicolon);
auto a = new AST.Dsymbols();
a.push(s);
addComment(s, comment);
return a;
}
version (none)
{
/* 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 AliasThis(loc, token.ident);
nextToken();
check(TOK.semicolon);
auto a = new Dsymbols();
a.push(s);
addComment(s, comment);
return a;
}
}
/* Look for:
* alias identifier = type;
* alias identifier(...) = type;
*/
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)
)
{
// function (parameters) { statements... }
// delegate (parameters) { statements... }
// (parameters) { statements... }
// (parameters) => expression
// { statements... }
// identifier => expression
// ref (parameters) { statements... }
// 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;
assert(tpl_ !is null && tpl_.members.dim == 1);
auto fd = cast(AST.FuncLiteralDeclaration) (*tpl_.members)[0];
auto tf = cast(AST.TypeFunction) fd.type;
assert(tf.parameterList.parameters.dim > 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 `%s` declarations", Token.toChars(tok));
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.093@@@
// Deprecated in 2020-07, can be made an error in 2.103
deprecation("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 `%s` declaration", Token.toChars(tok));
break;
}
break;
}
return a;
}
// alias StorageClasses type ident;
}
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))
{
// @@@DEPRECATED@@@
// 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.
if (tk.value == TOK.identifier && tk.ident == Id._body)
deprecation("Usage of the `body` keyword is deprecated. Use `do` instead.");
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("multiple declarations must have the same type, not `%s` and `%s`", tfirst.toChars(), t.toChars());
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))
error("no identifier for declarator `%s`", t.toChars());
if (tok == TOK.alias_)
{
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 `%s` declarations", Token.toChars(tok));
if (token.value == TOK.assign)
{
nextToken();
_init = parseInitializer();
}
if (_init)
{
if (isThis)
error("cannot use syntax `alias this = %s`, use `alias %s this` instead", _init.toChars(), _init.toChars());
else
error("alias cannot have initializer");
}
v = new AST.AliasDeclaration(loc, 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 `%s` declaration", Token.toChars(tok));
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);
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.Initializer _init = null;
if (token.value == TOK.assign)
{
nextToken();
_init = parseInitializer();
}
auto v = new AST.VarDeclaration(loc, t, ident, _init);
v.storage_class = storage_class;
if (pAttrs)
pAttrs.storageClass = STC.undefined_;
AST.Dsymbol 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(v.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:
error("semicolon expected, not `%s`", token.toChars());
break;
}
}
break;
}
return a;
}
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.ref_)
{
// function ref (parameters) { statements... }
// delegate ref (parameters) { statements... }
stc = STC.ref_;
nextToken();
}
if (token.value != TOK.leftParenthesis && token.value != TOK.leftCurly)
{
// 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.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);
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(token.loc, "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)
{
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 (!global.params.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(ParseStatementFlags.semi);
f.endloc = endloc;
break;
case TOK.identifier:
if (token.ident == Id._body)
{
// @@@DEPRECATED@@@
// 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.");
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
{
f.frequires.push(parseStatement(ParseStatementFlags.curly | ParseStatementFlags.scope_));
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_)
error("cannot use function constraints for non-template functions. Use `static if` instead");
else
error("semicolon expected following function declaration");
}
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)
{
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);
}
/*****************************************
* 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();
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.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)
{
ai = token.ident;
at = null; // infer argument type
nextToken();
goto Larg;
}
}
at = parseType(&ai);
if (!ai)
error("no identifier for declarator `%s`", at.toChars());
Larg:
auto p = new AST.Parameter(storageClass, at, ai, null, null);
parameters.push(p);
if (token.value == TOK.comma)
{
nextToken();
continue;
}
break;
}
check(TOK.semicolon);
AST.Expression aggr = parseExpression();
if (token.value == TOK.slice && parameters.dim == 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.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
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.hexadecimalString:
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 == TOK.identifier)
{
error("found `%s` when expecting `;` or `=`, did you mean `%s %s = %s`?", peek(&token).toChars(), exp.toChars(), token.toChars(), peek(peek(&token)).toChars());
nextToken();
}
else
check(TOK.semicolon, "statement");
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.dim > 1)
{
auto as = new AST.Statements();
as.reserve(a.dim);
foreach (i; 0 .. a.dim)
{
AST.Dsymbol d = (*a)[i];
s = new AST.ExpStatement(loc, d);
as.push(s);
}
s = new AST.CompoundDeclarationStatement(loc, as);
}
else if (a.dim == 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;
if (peekNext() == TOK.leftParenthesis)
{
// mixin(string)
AST.Expression e = parseAssignExp();
check(TOK.semicolon);
if (e.op == TOK.mixin_)
{
AST.MixinExp cpe = cast(AST.MixinExp)e;
s = new AST.CompileStatement(loc, cpe.exps);
}
else
{
s = new AST.ExpStatement(loc, e);
}
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 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.semi | 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);
check(TOK.rightCurly, "compound statement");
lookingForElse = lookingForElseSave;
break;
}
case TOK.while_:
{
AST.Parameter param = null;
nextToken();
check(TOK.leftParenthesis);
param = parseAssignCondition();
AST.Expression condition = parseExpression();
check(TOK.rightParenthesis);
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))
{
if (flags & ParseStatementFlags.semi)
deprecation("use `{ }` for an empty statement, not `;`");
else
error("use `{ }` for an empty statement, not `;`");
}
nextToken();
s = new AST.ExpStatement(loc, cast(AST.Expression)null);
break;
case TOK.do_:
{
AST.Statement _body;
AST.Expression condition;
nextToken();
const lookingForElseSave = lookingForElse;
lookingForElse = Loc.initial;
_body = parseStatement(ParseStatementFlags.scope_);
lookingForElse = lookingForElseSave;
check(TOK.while_);
check(TOK.leftParenthesis);
condition = parseExpression();
check(TOK.rightParenthesis);
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_:
{
AST.Parameter param = null;
AST.Expression condition;
nextToken();
check(TOK.leftParenthesis);
param = parseAssignCondition();
condition = parseExpression();
check(TOK.rightParenthesis);
{
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)
{
error("debug conditions can only be declared at module scope");
nextToken();
nextToken();
goto Lerror;
}
cond = parseDebugCondition();
goto Lcondition;
case TOK.version_:
nextToken();
if (token.value == TOK.assign)
{
error("version conditions can only be declared at module scope");
nextToken();
nextToken();
goto Lerror;
}
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(ParseStatementFlags.semi);
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();
check(TOK.rightParenthesis);
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.dim > 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.semi | 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(ParseStatementFlags.semi);
}
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.dim; 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.semi | ParseStatementFlags.curlyScope));
}
s = new AST.CompoundStatement(loc, statements);
}
else
s = parseStatement(ParseStatementFlags.semi);
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();
check(TOK.rightParenthesis);
}
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();
check(TOK.rightParenthesis);
_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(token.loc, "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);
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 = null;
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, TOK.file); break;
case TOK.fileFullPath: e = new AST.FileInitExp(token.loc, TOK.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.
* 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);
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("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 && !e.parens)
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.hexadecimalString:
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;
int 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)
{
// @@@DEPRECATED@@@
// 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.");
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;
version (none)
{
case TOK.static_:
continue;
case TOK.auto_:
case TOK.alias_:
t = peek(t);
if (t.value == TOK.identifier)
t = peek(t);
if (t.value == TOK.assign)
{
t = peek(t);
if (!isExpression(&t))
return false;
}
goto L3;
}
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_:
case TOK.hexadecimalString:
{
// 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_ || token.value == TOK.hexadecimalString)
{
if (token.postfix)
{
if (token.postfix != postfix)
error("mismatched string literal postfixes `'%c'` and `'%c'`", postfix, token.postfix);
postfix = token.postfix;
}
error("Implicit string concatenation is error-prone and disallowed in D");
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:
nextToken();
if (token.value == TOK.leftParenthesis)
{
e = new AST.TypeExp(loc, t);
e = new AST.CallExp(loc, e, parseArguments());
break;
}
check(TOK.dot, t.toChars());
if (token.value != TOK.identifier)
{
error("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("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.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();
e.parens = 1;
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.dim == 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(TOK.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(TOK.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_:
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 null;
}
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_:
version (none)
{
case TOK.tilde:
case TOK.and:
case TOK.mul:
case TOK.min:
case TOK.add:
}
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 `(...)`.");
return null;
}
e = new AST.TypeExp(loc, t);
e.parens = true;
e = parsePostExp(e);
}
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;
}
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(TOK.plusPlus, loc, e);
break;
case TOK.minusMinus:
e = new AST.PostExp(TOK.minusMinus, loc, e);
break;
case TOK.leftParenthesis:
e = new AST.CallExp(loc, e, parseArguments());
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();
TOK op = token.value;
switch (op)
{
case TOK.equal:
case TOK.notEqual:
nextToken();
auto e2 = parseShiftExp();
e = new AST.EqualExp(op, loc, e, e2);
break;
case TOK.is_:
op = TOK.identity;
goto L1;
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 = TOK.notIdentity;
goto L1;
}
L1:
nextToken();
auto e2 = parseShiftExp();
e = new AST.IdentityExp(op, loc, e, e2);
break;
case TOK.lessThan:
case TOK.lessOrEqual:
case TOK.greaterThan:
case TOK.greaterOrEqual:
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;
auto e = parseCmpExp();
while (token.value == TOK.and)
{
checkParens(TOK.and, e);
nextToken();
auto e2 = parseCmpExp();
checkParens(TOK.and, e2);
e = new AST.AndExp(loc, e, e2);
loc = token.loc;
}
return e;
}
private AST.Expression parseXorExp()
{
const loc = token.loc;
auto e = parseAndExp();
while (token.value == TOK.xor)
{
checkParens(TOK.xor, e);
nextToken();
auto e2 = parseAndExp();
checkParens(TOK.xor, e2);
e = new AST.XorExp(loc, e, e2);
}
return e;
}
private AST.Expression parseOrExp()
{
const loc = token.loc;
auto e = parseXorExp();
while (token.value == TOK.or)
{
checkParens(TOK.or, e);
nextToken();
auto e2 = parseXorExp();
checkParens(TOK.or, e2);
e = new AST.OrExp(loc, e, e2);
}
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, TOK.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, TOK.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()
{
AST.Expression e;
e = parseCondExp();
if (e is null)
return e;
// require parens for e.g. `t ? a = 1 : b = 2`
if (e.op == TOK.question && !e.parens && precedence[token.value] == PREC.assign)
dmd.errors.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:
nextToken();
auto e2 = parseAssignExp();
e = new AST.AssignExp(loc, e, e2);
break;
case TOK.addAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.AddAssignExp(loc, e, e2);
break;
case TOK.minAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.MinAssignExp(loc, e, e2);
break;
case TOK.mulAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.MulAssignExp(loc, e, e2);
break;
case TOK.divAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.DivAssignExp(loc, e, e2);
break;
case TOK.modAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.ModAssignExp(loc, e, e2);
break;
case TOK.powAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.PowAssignExp(loc, e, e2);
break;
case TOK.andAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.AndAssignExp(loc, e, e2);
break;
case TOK.orAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.OrAssignExp(loc, e, e2);
break;
case TOK.xorAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.XorAssignExp(loc, e, e2);
break;
case TOK.leftShiftAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.ShlAssignExp(loc, e, e2);
break;
case TOK.rightShiftAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.ShrAssignExp(loc, e, e2);
break;
case TOK.unsignedRightShiftAssign:
nextToken();
auto e2 = parseAssignExp();
e = new AST.UshrAssignExp(loc, e, e2);
break;
case TOK.concatenateAssign:
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;
arguments = new AST.Expressions();
const endtok = token.value == TOK.leftBracket ? TOK.rightBracket : TOK.rightParenthesis;
nextToken();
while (token.value != endtok && token.value != TOK.endOfFile)
{
auto arg = parseAssignExp();
arguments.push(arg);
if (token.value != TOK.comma)
break;
nextToken(); //comma
}
check(endtok);
return arguments;
}
/*******************************************
*/
private AST.Expression parseNewExp(AST.Expression thisexp)
{
const loc = token.loc;
nextToken();
AST.Expressions* newargs = null;
AST.Expressions* arguments = null;
if (token.value == TOK.leftParenthesis)
{
newargs = parseArguments();
}
// An anonymous nested class starts with "class"
if (token.value == TOK.class_)
{
nextToken();
if (token.value == TOK.leftParenthesis)
arguments = parseArguments();
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, newargs, 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;
auto edim = AST.typeToExpression(index);
if (!edim)
{
error("cannot create a `%s` with `new`", t.toChars);
return new AST.NullExp(loc);
}
t = new AST.TypeSArray(taa.next, edim);
}
else if (token.value == TOK.leftParenthesis && t.ty != Tsarray)
{
arguments = parseArguments();
}
auto e = new AST.NewExp(loc, thisexp, newargs, t, arguments);
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;
}
enum PREC : int
{
zero,
expr,
assign,
cond,
oror,
andand,
or,
xor,
and,
equal,
rel,
shift,
add,
mul,
pow,
unary,
primary,
}
|
D
|
/* This is free and unencumbered software released into the public domain. */
module drylib;
import std.bigint : BigInt;
////////////////////////////////////////////////////////////////////////////////
// Type Definitions
// Boolean (true or false)
alias Bool = bool;
// Character
alias Char = dchar;
// Complex number (arbitrary size)
alias Complex = creal; // FIXME
// Floating-point number (native size)
alias Float = real;
// Floating-point number (32-bit single-precision)
alias Float32 = float;
// Floating-point number (64-bit double-precision)
alias Float64 = double;
// Integer number (native size)
static if (size_t.sizeof >= 8)
alias Int = long; // 64-bit
else
alias Int = int; // 32-bit
// Integer number (8-bit)
alias Int8 = byte;
// Integer number (16-bit)
alias Int16 = short;
// Integer number (32-bit)
alias Int32 = int;
// Integer number (64-bit)
alias Int64 = long;
// Integer number (128-bit)
//alias Int128 = cent; // TODO
// Integer number (arbitrary size)
alias Integer = BigInt;
// Natural number (arbitrary size)
alias Natural = Integer;
// Rational number (arbitrary size)
struct Rational {
public:
Integer numerator;
Integer denominator;
}
// Real number (arbitrary size)
struct Real {
public:
Float64 value; // FIXME
}
// Machine word (native size)
static if (size_t.sizeof >= 8)
alias Word = ulong; // 64-bit
else
alias Word = uint; // 32-bit
// Machine word (8-bit)
alias Word8 = ubyte;
// Machine word (16-bit)
alias Word16 = ushort;
// Machine word (32-bit)
alias Word32 = uint;
// Machine word (64-bit)
alias Word64 = ulong;
|
D
|
module dub.version_;
enum dubVersion = "v1.23.0";
|
D
|
/Users/michael/Desktop/Buildcoin/ChartTest/build/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ChartHighlighter.o : /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/Legend.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/Description.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/LegendEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/michael/Desktop/Buildcoin/ChartTest/build/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/michael/Desktop/Buildcoin/ChartTest/build/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ChartHighlighter~partial.swiftmodule : /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/Legend.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/Description.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/LegendEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/michael/Desktop/Buildcoin/ChartTest/build/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/michael/Desktop/Buildcoin/ChartTest/build/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ChartHighlighter~partial.swiftdoc : /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/Legend.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/Description.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Charts/Source/Charts/Components/LegendEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/michael/Desktop/Buildcoin/ChartTest/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/michael/Desktop/Buildcoin/ChartTest/build/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
instance Mod_7263_PSINOV_Novize_OGY (Npc_Default)
{
//-------- primary data --------
name = Name_Novize;
Npctype = Npctype_mt_sumpfnovize;
guild = GIL_out;
level = 9;
voice = 0;
id = 7263;
//-------- abilities --------
attribute[ATR_STRENGTH] = 15;
attribute[ATR_DEXTERITY] = 15;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 148;
attribute[ATR_HITPOINTS] = 20;
protection[PROT_MAGIC] = -1;
//-------- visuals --------
// animations
Mdl_SetVisual (self,"HUMANS.MDS");
Mdl_ApplyOverlayMds (self,"Humans_Mage.mds");
// body mesh ,bdytex,skin,head mesh ,headtex,teethtex,ruestung
Mdl_SetVisualBody (self,"hum_body_Naked0",1, 1 ,"Hum_Head_FatBald", 29 , 1, NOV_ARMOR_M);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_COWARD;
//-------- Talente --------
//-------- inventory --------
//-------------Daily Routine-------------
daily_routine = Rtn_start_7263;
};
FUNC VOID Rtn_start_7263 ()
{
TA_Sit_Campfire (00,00,08,00,"GRYD_054");
TA_Sit_Campfire (08,00,24,00,"GRYD_054");
};
|
D
|
/*
Copyright (c) 2015, Dennis Meuwissen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
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.
License does not apply to code and information found in the ./info directory.
*/
module game.delta;
import std.stdio;
// GTA delta data format:
// 1 byte: delta x offset inside sprite rectangle
// 1 byte: delta y offset inside sprite rectangle
// while inside delta data range:
// 1 byte: number of pixels (n)
// n bytes: pixel data
// if end of data range reached, break
// 1 byte: number of bytes to skip. skipping an entire row will skip > sprite.width, because
// they are meant to be stored in 256x256 pages.
// 1 byte: 0x00
public class Delta {
private ubyte[] _data;
private uint _imageWidth;
// Creates a new delta from raw data.
this(const ubyte[] data, const uint imageWidth) {
_imageWidth = imageWidth;
_data = data.dup;
}
// Creates a new delta from a mask and image.
this(const ubyte[] image, const ubyte[] mask, const uint imageWidth) {
_imageWidth = imageWidth;
_data.length = 0;
uint offset = 0;
while (offset < image.length) {
// Count the pixels to skip.
const uint skipStart = offset;
while (!mask[offset++] && offset < mask.length) {}
if (offset >= mask.length) {
break;
}
offset--;
// Add starting x, y.
const uint skip = offset - skipStart;
if (_data.length == 0) {
_data ~= [cast(ubyte)(skip % imageWidth), cast(ubyte)(skip / imageWidth)];
// Add skip instruction.
} else {
_data ~= [cast(ubyte)skip, 0];
}
// Count pixels to draw.
const uint dataStart = offset;
while (mask[offset++] && offset < mask.length) {}
offset--;
// Add pixels to draw.
const uint dataEnd = offset;
_data ~= cast(ubyte)(dataEnd - dataStart);
_data ~= image[dataStart..dataEnd];
}
}
// Makes this delta's skip instructions take into account that the target image is not stored in a page with other sprites.
public void makeNonPaged(const uint pageSize) {
uint offset = 2;
while (offset < _data.length) {
offset += _data[offset++];
if (offset >= _data.length) {
break;
}
// If the delta's skip command would go beyond the sprite's width,
// transform it to be in the bounds of the sprite width instead of the page width.
if (_data[offset] >= _imageWidth) {
_data[offset] -= pageSize - _imageWidth;
}
offset += 2;
}
}
// Applies this delta to an image.
public void applyTo(ref ubyte[] image) {
uint destOffset = _data[1] * _imageWidth + _data[0];
uint offset = 2;
while (offset < _data.length) {
const ubyte pixels = _data[offset++];
image[destOffset..destOffset + pixels] = _data[offset..offset + pixels];
offset += pixels;
destOffset += pixels;
if (offset >= _data.length) {
break;
}
destOffset += _data[offset];
offset += 2;
}
}
// Returns this delta's mask image, where non-0 pixels are pixels that are present in the delta information.
public void applyMaskTo(ref ubyte[] mask) {
uint destOffset = _data[1] * _imageWidth + _data[0];
uint offset = 2;
while (offset < _data.length) {
const ubyte pixels = _data[offset++];
mask[destOffset..destOffset + pixels] = 0xFF;
offset += pixels;
destOffset += pixels;
if (offset >= _data.length) {
break;
}
destOffset += _data[offset];
offset += 2;
}
}
}
|
D
|
module ae.utils.meta_x;
// Based on idea from Timon Gehr.
// http://forum.dlang.org/post/jdiu5s$13bo$1@digitalmars.com
template X(string x)
{
enum X = xImpl(x);
}
private string xImpl(string x)
{
string r;
for (size_t i=0; i<x.length; i++)
if (x[i]=='@' && x[i+1]=='(')
{
auto j = i+2;
for (int nest=1; nest; j++)
nest += x[j] == '(' ? +1 : x[j] == ')' ? -1 : 0;
r ~= `"~(` ~ x[i+2..j-1] ~ `)~"`;
i = j-1;
}
else
{
if (x[i]=='"' || x[i]=='\\')
r ~= "\\";
r ~= x[i];
}
return `"` ~ r ~ `"`;
}
unittest
{
enum VAR = "aoeu";
int aoeu;
string INSTALL_MEANING_OF_LIFE(string TARGET)
{
return mixin(X!q{
@(TARGET) = 42;
});
}
mixin(INSTALL_MEANING_OF_LIFE(VAR));
assert(aoeu == 42);
}
|
D
|
/*****************************************************************************
*
* Higgs JavaScript Virtual Machine
*
* This file is part of the Higgs project. The project is distributed at:
* https://github.com/maximecb/Higgs
*
* Copyright (c) 2012-2014, Maxime Chevalier-Boisvert. All rights reserved.
*
* This software is licensed under the following license (Modified BSD
* License):
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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 runtime.vm;
import core.memory;
import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.stdint;
import std.typecons;
import std.path;
import std.file;
import options;
import stats;
import util.misc;
import parser.parser;
import parser.ast;
import ir.ir;
import ir.ast;
import runtime.layout;
import runtime.string;
import runtime.object;
import runtime.gc;
import jit.codeblock;
import jit.jit;
/**
Run-time error
*/
class RunError : Error
{
/// Associated virtual machine
VM vm;
/// Exception value
ValuePair excVal;
/// Error constructor name
string name;
/// Error message
string message;
/// Stack trace
IRInstr[] trace;
this(VM vm, ValuePair excVal, IRInstr[] trace)
{
this.vm = vm;
this.excVal = excVal;
this.trace = trace;
this.name = "run-time error";
if (excVal.type is Type.OBJECT)
{
auto errName = getProp(
vm,
excVal,
"name"w
);
if (errName.type is Type.STRING)
this.name = errName.toString();
auto msgStr = getProp(
vm,
excVal,
"message"w
);
this.message = msgStr.toString();
}
else
{
this.message = excVal.toString();
}
super(toString());
}
override string toString()
{
string str = name ~ ": " ~ message;
foreach (instr; trace)
{
auto fun = instr.block.fun;
auto pos = instr.srcPos? instr.srcPos:fun.ast.pos;
str ~= "\n" ~ fun.getName ~ " (" ~ to!string(pos) ~ ")";
}
return str;
}
}
/**
Memory word union
*/
union Word
{
static Word int32v(int32 i) { Word w; w.int32Val = i; return w; }
static Word int64v(int64 i) { Word w; w.int64Val = i; return w; }
static Word uint32v(uint32 i) { Word w; w.uint32Val = i; return w; }
static Word uint64v(uint64 i) { Word w; w.uint64Val = i; return w; }
static Word float64v(float64 f) { Word w; w.floatVal = f; return w; }
static Word refv(refptr p) { Word w; w.ptrVal = p; return w; }
static Word ptrv(rawptr p) { Word w; w.ptrVal = p; return w; }
int8 int8Val;
int16 int16Val;
int32 int32Val;
int64 int64Val;
uint8 uint8Val;
uint16 uint16Val;
uint32 uint32Val;
uint64 uint64Val;
float64 floatVal;
refptr refVal;
rawptr ptrVal;
IRFunction funVal;
IRInstr insVal;
ObjMap mapVal;
}
unittest
{
assert (
Word.sizeof == rawptr.sizeof,
"word size does not match pointer size"
);
}
/// Word type values
enum Type : ubyte
{
INT32 = 0,
INT64,
FLOAT64,
RAWPTR,
RETADDR,
CONST,
FUNPTR,
MAPPTR,
// GC heap pointer types
REFPTR,
OBJECT,
ARRAY,
CLOSURE,
STRING
}
/**
Test if a given type is a heap pointer
*/
bool isHeapPtr(Type type)
{
switch (type)
{
case Type.REFPTR:
case Type.OBJECT:
case Type.ARRAY:
case Type.CLOSURE:
case Type.STRING:
return true;
default:
return false;
}
}
/**
Produce a string representation of a type tag
*/
string typeToString(Type type)
{
// Switch on the type tag
switch (type)
{
case Type.INT32: return "int32";
case Type.INT64: return "int64";
case Type.FLOAT64: return "float64";
case Type.RAWPTR: return "raw pointer";
case Type.RETADDR: return "return address";
case Type.CONST: return "const";
case Type.FUNPTR: return "funptr";
case Type.MAPPTR: return "mapptr";
case Type.REFPTR: return "ref pointer";
case Type.OBJECT: return "object";
case Type.ARRAY: return "array";
case Type.CLOSURE: return "closure";
case Type.STRING: return "string";
default:
assert (false, "unsupported type");
}
}
/**
Test if a reference points to an object of a given layout
*/
bool refIsLayout(refptr ptr, uint32 layoutId)
{
return (ptr !is null && obj_get_header(ptr) == layoutId);
}
/// Word and type pair
struct ValuePair
{
Word word;
Type type;
this(Word word, Type type)
{
this.word = word;
this.type = type;
}
this(refptr ptr, Type type)
{
this.word.ptrVal = ptr;
this.type = type;
}
/**
Test if a value is an object of a given layout
*/
bool isLayout(uint32 layoutId)
{
return (
type is Type.REFPTR &&
refIsLayout(word.ptrVal, layoutId)
);
}
/**
Produce a string representation of a value pair
*/
string toString()
{
// Switch on the type tag
switch (type)
{
case Type.INT32:
return to!string(word.int32Val);
case Type.FLOAT64:
if (word.floatVal != word.floatVal)
return "NaN";
if (word.floatVal == 1.0/0)
return "Infinity";
if (word.floatVal == -1.0/0)
return "-Infinity";
return to!string(word.floatVal);
case Type.RAWPTR:
return to!string(word.ptrVal);
case Type.RETADDR:
return to!string(word.ptrVal);
case Type.CONST:
if (this == TRUE)
return "true";
if (this == FALSE)
return "false";
if (this == UNDEF)
return "undefined";
if (this == MISSING)
return "missing";
assert (
false,
"unsupported constant " ~ to!string(word.uint64Val)
);
case Type.FUNPTR:
return "funptr";
case Type.MAPPTR:
return "mapptr";
case Type.REFPTR:
if (this == NULL)
return "null";
if (ptrValid(word.ptrVal) is false)
return "invalid refptr";
if (isLayout(LAYOUT_OBJ))
return "object";
if (isLayout(LAYOUT_CLOS))
return "function";
if (isLayout(LAYOUT_ARR))
return "array";
return "refptr";
case Type.OBJECT:
return "object";
case Type.ARRAY:
return "array";
case Type.CLOSURE:
return "closure";
case Type.STRING:
return extractStr(word.ptrVal);
default:
assert (false, "unsupported value type");
}
}
}
// Note: low byte is set to allow for one byte immediate comparison
immutable NULL = ValuePair(Word(0x00), Type.REFPTR);
immutable TRUE = ValuePair(Word(0x01), Type.CONST);
immutable FALSE = ValuePair(Word(0x02), Type.CONST);
immutable UNDEF = ValuePair(Word(0x03), Type.CONST);
immutable MISSING = ValuePair(Word(0x04), Type.CONST);
/// Stack size, 256K words (2MB)
immutable size_t STACK_SIZE = 2^^18;
/// Initial heap size, 16M bytes
immutable size_t HEAP_INIT_SIZE = 2^^24;
/// Initial link table size
immutable size_t LINK_TBL_INIT_SIZE = 8192;
/// Initial base object size
immutable size_t BASE_OBJ_INIT_SIZE = 128;
/// Initial global object size
immutable size_t GLOBAL_OBJ_INIT_SIZE = 512;
/// Initial executable heap size, 16M bytes
immutable size_t EXEC_HEAP_INIT_SIZE = 2 ^^ 24;
/**
Virtual Machine (VM) instance
*/
class VM
{
/// Word stack
Word* wStack;
/// Type stack
Type* tStack;
/// Word stack upper limit
Word* wUpperLimit;
/// Type stack upper limit
Type* tUpperLimit;
/// Word and type stack pointers (stack top)
Word* wsp;
/// Type stack pointer (stack top)
Type* tsp;
/// Heap start pointer
ubyte* heapStart;
/// Heap size
size_t heapSize;
/// Heap upper limit
ubyte* heapLimit;
/// Allocation pointer
ubyte* allocPtr;
/// To-space heap pointers, for garbage collection
ubyte* toStart;
ubyte* toLimit;
ubyte* toAlloc;
/// Linked list of GC roots
GCRoot* firstRoot;
/// Set of weak references to functions referenced in the heap
/// To be cleaned up by the GC
IRFunction[void*] funRefs;
/// Set of functions found live by the GC during collection
IRFunction[void*] liveFuns;
/// Set of weak references to class maps referenced in the heap
/// To be cleaned up by the GC
ObjMap[void*] mapRefs;
/// Set of maps found live by the GC during collection
ObjMap[void*] liveMaps;
/// Garbage collection count
size_t gcCount = 0;
/// Link table words
Word* wLinkTable;
/// Link table types
Type* tLinkTable;
/// Link table size
uint32 linkTblSize;
/// Free link table entries
uint32[] linkTblFree;
/// String table reference
refptr strTbl;
/// Object prototype object
ValuePair objProto;
/// Array prototype object
ValuePair arrProto;
/// Function prototype object
ValuePair funProto;
/// Global object reference
ValuePair globalObj;
/// Runtime error value (uncaught exceptions)
RunError runError;
/// Executable heap
CodeBlock execHeap;
/// Current instruction (set when calling into host code)
IRInstr curInstr;
/// Map of return addresses to return entries
RetEntry[CodePtr] retAddrMap;
/// List of code fragments, in memory order
CodeFragment[] fragList;
/// Queue of block versions to be compiled
CodeFragment[] compQueue;
/// List of references to code fragments to be linked
FragmentRef[] refList;
/// Function entry stub
EntryStub entryStub;
/// Constructor entry stub
EntryStub ctorStub;
/// Branch target stubs
BranchStub[] branchStubs;
/// Space to save registers when calling into hosted code
Word* regSave;
/**
Constructor, initializes the VM state
*/
this(bool loadRuntime = true, bool loadStdLib = true)
{
assert (
!(loadStdLib && !loadRuntime),
"cannot load stdlib without loading runtime"
);
// Allocate the word stack
wStack = cast(Word*)GC.malloc(
Word.sizeof * STACK_SIZE,
GC.BlkAttr.NO_SCAN |
GC.BlkAttr.NO_INTERIOR
);
// Allocate the type stack
tStack = cast(Type*)GC.malloc(
Type.sizeof * STACK_SIZE,
GC.BlkAttr.NO_SCAN |
GC.BlkAttr.NO_INTERIOR
);
// Initialize the stack limit pointers
wUpperLimit = wStack + STACK_SIZE;
tUpperLimit = tStack + STACK_SIZE;
// Initialize the stack pointers just past the end of the stack
wsp = wUpperLimit;
tsp = tUpperLimit;
// Allocate a block of immovable memory for the heap
heapSize = HEAP_INIT_SIZE;
heapStart = cast(ubyte*)GC.malloc(
heapSize,
GC.BlkAttr.NO_SCAN |
GC.BlkAttr.NO_INTERIOR
);
// Check that the allocation was successful
if (heapStart is null)
throw new Error("heap allocation failed");
// Initialize the allocation and limit pointers
allocPtr = heapStart;
heapLimit = heapStart + heapSize;
/// Link table size
linkTblSize = LINK_TBL_INIT_SIZE;
/// Free link table entries
linkTblFree = new LinkIdx[linkTblSize];
for (uint32 i = 0; i < linkTblSize; ++i)
linkTblFree[i] = i;
/// Link table words
wLinkTable = cast(Word*)GC.malloc(
Word.sizeof * linkTblSize,
GC.BlkAttr.NO_SCAN |
GC.BlkAttr.NO_INTERIOR
);
/// Link table types
tLinkTable = cast(Type*)GC.malloc(
Type.sizeof * linkTblSize,
GC.BlkAttr.NO_SCAN |
GC.BlkAttr.NO_INTERIOR
);
// Initialize the link table
for (size_t i = 0; i < linkTblSize; ++i)
{
wLinkTable[i].int32Val = 0;
tLinkTable[i] = Type.INT32;
}
// Allocate and initialize the string table
strTbl = strtbl_alloc(this, STR_TBL_INIT_SIZE);
// Allocate the object prototype object
objProto = newObj(
this,
new ObjMap(this, BASE_OBJ_INIT_SIZE),
NULL
);
// Allocate the array prototype object
arrProto = newObj(
this,
new ObjMap(this, BASE_OBJ_INIT_SIZE),
objProto
);
// Allocate the function prototype object
funProto = newObj(
this,
new ObjMap(this, BASE_OBJ_INIT_SIZE),
objProto
);
// Allocate the global object
globalObj = newObj(
this,
new ObjMap(this, GLOBAL_OBJ_INIT_SIZE),
objProto
);
// Allocate the executable heap
execHeap = new CodeBlock(EXEC_HEAP_INIT_SIZE, opts.jit_genasm);
// Allocate the register save space
regSave = cast(Word*)GC.malloc(
Word.sizeof * allocRegs.length,
GC.BlkAttr.NO_SCAN |
GC.BlkAttr.NO_INTERIOR
);
// If the runtime library should be loaded
if (loadRuntime)
{
// Load the layout code
load("runtime/layout.js");
// Load the runtime library
load("runtime/runtime.js");
}
// If the standard library should be loaded
if (loadStdLib)
{
load("stdlib/object.js");
load("stdlib/error.js");
load("stdlib/function.js");
load("stdlib/math.js");
load("stdlib/string.js");
load("stdlib/array.js");
load("stdlib/number.js");
load("stdlib/boolean.js");
load("stdlib/date.js");
load("stdlib/json.js");
load("stdlib/regexp.js");
load("stdlib/map.js");
load("stdlib/global.js");
load("stdlib/commonjs.js");
}
}
/**
Set the value and type of a stack slot
*/
void setSlot(StackIdx idx, Word w, Type t)
{
assert (
&wsp[idx] >= wStack && &wsp[idx] < wUpperLimit,
format("invalid stack slot index (%s/%s)", idx, stackSize)
);
assert (
!isHeapPtr(t) ||
w.ptrVal == null ||
(w.ptrVal >= heapStart && w.ptrVal < heapLimit),
"ref ptr out of heap in setSlot: " ~
to!string(w.ptrVal)
);
wsp[idx] = w;
tsp[idx] = t;
}
/**
Set the value and type of a stack slot from a value/type pair
*/
void setSlot(StackIdx idx, ValuePair val)
{
setSlot(idx, val.word, val.type);
}
/**
Set a stack slot to an integer value
*/
void setSlot(StackIdx idx, uint32 val)
{
setSlot(idx, Word.int32v(val), Type.INT32);
}
/**
Set a stack slot to a float value
*/
void setSlot(StackIdx idx, float64 val)
{
setSlot(idx, Word.float64v(val), Type.FLOAT64);
}
/**
Get a word from the word stack
*/
Word getWord(StackIdx idx)
{
assert (
&wsp[idx] >= wStack && &wsp[idx] < wUpperLimit,
format("invalid stack slot index (%s/%s)", idx, stackSize)
);
return wsp[idx];
}
/**
Get a type from the type stack
*/
Type getType(StackIdx idx)
{
assert (
&tsp[idx] >= tStack && &tsp[idx] < tUpperLimit,
"invalid stack slot index"
);
return tsp[idx];
}
/**
Get a value/type pair from the stack
*/
ValuePair getSlot(StackIdx idx)
{
return ValuePair(getWord(idx), getType(idx));
}
/**
Copy a value from one stack slot to another
*/
void move(StackIdx src, StackIdx dst)
{
assert (
&wsp[src] >= wStack && &wsp[src] < wUpperLimit,
"invalid move src index"
);
assert (
&wsp[dst] >= wStack && &wsp[dst] < wUpperLimit,
"invalid move dst index"
);
wsp[dst] = wsp[src];
tsp[dst] = tsp[src];
}
/**
Push a word and type on the stack
*/
void push(Word w, Type t)
{
push(1);
setSlot(0, w, t);
}
/**
Push a value pair on the stack
*/
void push(ValuePair val)
{
push(1);
setSlot(0, val.word, val.type);
}
/**
Allocate space on the stack
*/
void push(size_t numWords)
{
wsp -= numWords;
tsp -= numWords;
if (wsp < wStack)
throw new Error("stack overflow");
}
/**
Free space on the stack
*/
void pop(size_t numWords)
{
wsp += numWords;
tsp += numWords;
if (wsp > wUpperLimit)
throw new Error("stack underflow");
}
/**
Get the number of stack slots
*/
size_t stackSize()
{
return wUpperLimit - wsp;
}
/**
Allocate a link table entry
*/
LinkIdx allocLink()
{
if (linkTblFree.length == 0)
{
assert (false, "no free link entries");
}
auto idx = linkTblFree.back;
linkTblFree.popBack();
return idx;
}
/**
Free a link table entry
*/
void freeLink(LinkIdx idx)
{
assert (
idx <= linkTblSize,
"invalid link index"
);
// Remove any heap reference
wLinkTable[idx].uint32Val = 0;
tLinkTable[idx] = Type.INT32;
linkTblFree ~= idx;
}
/**
Get the word associated with a link value
*/
Word getLinkWord(LinkIdx idx)
{
assert (
idx <= linkTblSize,
"invalid link index"
);
return wLinkTable[idx];
}
/**
Get the type associated with a link value
*/
Type getLinkType(LinkIdx idx)
{
assert (
idx <= linkTblSize,
"invalid link index"
);
return tLinkTable[idx];
}
/**
Set the word associated with a link value
*/
void setLinkWord(LinkIdx idx, Word word)
{
assert (
idx <= linkTblSize,
"invalid link index"
);
wLinkTable[idx] = word;
}
/**
Set the type associated with a link value
*/
void setLinkType(LinkIdx idx, Type type)
{
assert (
idx <= linkTblSize,
"invalid link index"
);
tLinkTable[idx] = type;
}
/**
Get the value pair for an IR value
*/
ValuePair getValue(IRValue val)
{
// If the value has an associated output slot
if (auto dstVal = cast(IRDstValue)val)
{
assert (
dstVal.outSlot != NULL_STACK,
"out slot unassigned for:\n" ~
dstVal.toString()
);
//writefln("getting value from slot of %s", val);
// Get the value at the output slot
return getSlot(dstVal.outSlot);
}
// Get the constant value pair for this IR value
return val.cstValue();
}
/**
Get the value of an instruction's argument
*/
ValuePair getArgVal(IRInstr instr, size_t argIdx)
{
// Get the argument IRValue
auto val = instr.getArg(argIdx);
return getValue(val);
}
/**
Get a boolean argument value
*/
bool getArgBool(IRInstr instr, size_t argIdx)
{
auto argVal = getArgVal(instr, argIdx);
assert (
argVal.type == Type.CONST,
"expected constant value for arg " ~ to!string(argIdx)
);
return (argVal.word.int8Val == TRUE.word.int8Val);
}
/**
Get an argument value and ensure it is an uint32
*/
uint32_t getArgUint32(IRInstr instr, size_t argIdx)
{
auto argVal = getArgVal(instr, argIdx);
assert (
argVal.type == Type.INT32,
"expected uint32 value for arg " ~ to!string(argIdx)
);
assert (
argVal.word.int32Val >= 0,
"expected positive value"
);
return argVal.word.uint32Val;
}
/**
Get an argument value and ensure it is a string object pointer
*/
refptr getArgStr(IRInstr instr, size_t argIdx)
{
auto strVal = getArgVal(instr, argIdx);
assert (
strVal.type is Type.STRING,
format("expected string value for arg %s of:\n%s", argIdx, instr)
);
return strVal.word.ptrVal;
}
/**
Prepares the callee stack-frame for a call
*/
void callFun(
IRFunction fun, // Function to call
CodePtr retAddr, // Return address
refptr closPtr, // Closure pointer
ValuePair thisVal, // This value
uint32_t argCount,
ValuePair* argVals
)
{
//writefln("call to %s (%s)", fun.name, cast(void*)fun);
//writefln("num args: %s", argCount);
//writeln("clos ptr: ", closPtr);
assert (
fun !is null,
"null IRFunction pointer"
);
// Compute the number of missing arguments
size_t argDiff = (fun.numParams > argCount)? (fun.numParams - argCount):0;
// Push undefined values for the missing last arguments
for (size_t i = 0; i < argDiff; ++i)
push(UNDEF);
// Push the visible function arguments in reverse order
for (size_t i = 0; i < argCount; ++i)
{
auto argVal = argVals[argCount-(1+i)];
push(argVal);
}
// Push the argument count
push(Word.int32v(argCount), Type.INT32);
// Push the "this" argument
push(thisVal);
// Push the closure argument
push(Word.ptrv(closPtr), Type.CLOSURE);
// Push the return address
push(Word.ptrv(cast(rawptr)retAddr), Type.RETADDR);
// Push space for the callee locals
auto numLocals = fun.numLocals - NUM_HIDDEN_ARGS - fun.numParams;
push(numLocals);
}
/**
Execute a unit-level IR function
*/
ValuePair exec(IRFunction fun)
{
assert (
fun.entryBlock !is null,
"function has no entry block"
);
//writeln(fun.toString());
// Register this function in the function reference set
funRefs[cast(void*)fun] = fun;
// Compile the entry block of the unit function
auto entryFn = compileUnit(this, fun);
// Start recording execution time
stats.execTimeStart();
// Call into the compiled code
entryFn();
// Stop recording execution time
stats.execTimeStop();
// If a runtime error occurred, throw the exception object
if (runError)
{
auto error = runError;
runError = null;
throw error;
}
// Ensure the stack contains at least one value
assert (
stackSize() >= 1,
"stack is empty, no return value found"
);
// Get the return value
auto retVal = ValuePair(*wsp, *tsp);
// Pop the return value off the stack
pop(1);
return retVal;
}
/**
Execute a unit-level function
*/
ValuePair exec(FunExpr fun)
{
auto ir = astToIR(this, fun);
return exec(ir);
}
/**
Get the path for a load command based on a (potentially relative) path
*/
string getLoadPath(string fileName)
{
// If the path is relative, first check the Higgs lib dir
if (!isAbsolute(fileName))
{
auto libFile = buildPath(import("libdir.txt"), fileName);
if (!exists(fileName) && exists(libFile))
fileName = to!string(libFile);
}
return fileName;
}
/**
Parse and execute a source file
*/
ValuePair load(string fileName)
{
auto file = getLoadPath(fileName);
auto ast = parseFile(file);
return exec(ast);
}
/**
Parse and execute a source string
*/
ValuePair evalString(string input, string fileName = "string")
{
//writefln("input: %s", input);
auto ast = parseString(input, fileName);
auto result = exec(ast);
return result;
}
/// Stack frame visit function
alias void delegate(
IRFunction fun,
Word* wsp,
Type* tsp,
size_t depth,
size_t frameSize,
IRInstr callInstr
) VisitFrameFn;
/**
Visit each stack frame currently on the stack
*/
void visitStack(VisitFrameFn visitFrame)
{
// If the stack is empty, stop
if (this.stackSize() == 0)
return;
// Get the current stack pointers
auto wsp = this.wsp;
auto tsp = this.tsp;
// Current instruction
auto curInstr = this.curInstr;
// For each stack frame, starting from the topmost
for (size_t depth = 0;; depth++)
{
assert (curInstr !is null);
auto curFun = curInstr.block.fun;
assert (curFun !is null);
auto numLocals = curFun.numLocals;
auto numParams = curFun.numParams;
auto argcSlot = curFun.argcVal.outSlot;
auto raSlot = curFun.raVal.outSlot;
assert (
wsp + numLocals <= this.wUpperLimit,
"no room for numLocals in stack frame"
);
// Get the argument count
auto argCount = wsp[argcSlot].int32Val;
// Compute the actual number of extra arguments to pop
size_t extraArgs = (argCount > numParams)? (argCount - numParams):0;
// Compute the number of locals in this frame
auto frameSize = numLocals + extraArgs;
/*
writeln("curFun: ", curFun.getName);
writeln("numLocals=", numLocals);
writeln("argcSlot=", argcSlot);
writeln("raSlot=", raSlot);
writeln("argCount=", argCount);
writeln("frameSize=", frameSize);
*/
// Get the return address
assert (
tsp[raSlot] is Type.RETADDR,
"invalid type tag at return address slot"
);
auto retAddr = cast(CodePtr)wsp[raSlot].ptrVal;
// Find the return address entry
assert (
retAddr in retAddrMap,
"no return entry for return address: " ~ to!string(retAddr)
);
auto retEntry = retAddrMap[retAddr];
// Visit this stack frame
visitFrame(
curFun,
wsp,
tsp,
depth,
frameSize,
curInstr
);
// If we reached the bottom of the stack, stop
if (retEntry.callInstr is null)
break;
// Pop the stack frame
wsp += frameSize;
tsp += frameSize;
// Move to the caller frame's context
curInstr = retEntry.callInstr;
}
}
}
/**
Throw an exception, unwinding the stack until an exception handler
is found. Returns a pointer to the exception handler code.
*/
extern (C) CodePtr throwExc(
VM vm,
IRInstr throwInstr,
CodeFragment throwHandler,
Word excWord,
Type excType
)
{
//writefln("entering throwExc");
// Stack trace (throwing instruction and call instructions)
IRInstr[] trace;
// Get the exception handler code, if supplied
auto curHandler = throwHandler;
// Get a GC root for the exception object
auto excObj = GCRoot(
vm,
(excType is Type.OBJECT)? excWord.ptrVal:null,
Type.OBJECT
);
// Until we're done unwinding the stack
for (IRInstr curInstr = throwInstr;;)
{
assert (curInstr !is null);
//writeln("unwinding: ", curInstr.toString, " in ", curInstr.block.fun.getName);
//writeln("stack size: ", vm.stackSize);
// Add the current instruction to the stack trace
trace ~= curInstr;
// If the exception value is an object,
// add trace information to the object
if (excObj.ptr)
{
auto propName = to!wstring(trace.length-1);
auto fun = curInstr.block.fun;
auto pos = curInstr.srcPos? curInstr.srcPos:fun.ast.pos;
auto strObj = GCRoot(
vm,
getString(
vm,
to!wstring(
curInstr.block.fun.getName ~
" (" ~ pos.toString ~ ")"
)
),
Type.STRING
);
setProp(
vm,
excObj.pair,
propName,
strObj.pair
);
setProp(
vm,
excObj.pair,
"length"w,
ValuePair(Word.int64v(trace.length), Type.INT32)
);
}
// If the current instruction has an exception handler
if (curHandler !is null)
{
//writefln("found exception handler");
// If the exception handler is not yet compiled, compile it
if (curHandler.ended is false)
{
auto excTarget = curInstr.getTarget(1);
vm.queue(curHandler);
vm.compile(excTarget.target.firstInstr);
}
auto excCodeAddr = curHandler.getCodePtr(vm.execHeap);
// Push the exception value on the stack
vm.push(excWord, excType);
// Return the exception handler address
return excCodeAddr;
}
auto curFun = curInstr.block.fun;
assert (curFun !is null);
auto numLocals = curFun.numLocals;
auto numParams = curFun.numParams;
auto argcSlot = curFun.argcVal.outSlot;
auto raSlot = curFun.raVal.outSlot;
// Get the return address
auto retAddr = cast(CodePtr)vm.wsp[raSlot].ptrVal;
// Find the return address entry
assert (
retAddr in vm.retAddrMap,
"no return entry for return address: " ~ to!string(retAddr)
);
auto retEntry = vm.retAddrMap[retAddr];
// Get the calling instruction and context for this stack frame
curInstr = retEntry.callInstr;
// If we have reached the bottom of the stack
if (curInstr is null)
{
//writeln("reached stack bottom");
assert (retEntry.retCode !is null);
// Set the runtime error value
vm.runError = new RunError(vm, ValuePair(excWord, excType), trace);
// Return the return code branch
return retEntry.retCode.getCodePtr(vm.execHeap);
}
// Get the exception handler code for the calling instruction
if (retEntry.excCode)
curHandler = retEntry.excCode;
// Get the argument count
auto argCount = vm.wsp[argcSlot].int32Val;
// Compute the actual number of extra arguments to pop
size_t extraArgs = (argCount > numParams)? (argCount - numParams):0;
// Pop all local stack slots and arguments
vm.pop(numLocals + extraArgs);
}
assert (false);
}
/**
Throw a JavaScript error object as an exception
*/
extern (C) CodePtr throwError(
VM vm,
IRInstr throwInstr,
CodeFragment throwHandler,
string ctorName,
string errMsg
)
{
auto errStr = GCRoot(
vm,
getString(vm, to!wstring(errMsg)),
Type.STRING
);
auto errCtor = GCRoot(
vm,
getProp(
vm,
vm.globalObj,
to!wstring(ctorName)
)
);
// If the error constructor is an object
if (errCtor.type is Type.OBJECT)
{
auto errProto = GCRoot(
vm,
getProp(
vm,
errCtor.pair,
"prototype"w
)
);
// If the error prototype is an object
if (errCtor.type is Type.OBJECT)
{
// Create the error object
auto excObj = GCRoot(
vm,
newObj(
vm,
new ObjMap(vm, 1),
errProto.pair
)
);
// Set the error "message" property
setProp(
vm,
excObj.pair,
"message"w,
errStr.pair
);
return throwExc(
vm,
throwInstr,
throwHandler,
excObj.word,
excObj.type
);
}
}
// Throw the error string directly
return throwExc(
vm,
throwInstr,
throwHandler,
errStr.word,
errStr.type,
);
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwtx.jface.text.information.IInformationProvider;
import dwtx.jface.text.information.InformationPresenter; // packageimport
import dwtx.jface.text.information.IInformationProviderExtension; // packageimport
import dwtx.jface.text.information.IInformationPresenterExtension; // packageimport
import dwtx.jface.text.information.IInformationProviderExtension2; // packageimport
import dwtx.jface.text.information.IInformationPresenter; // packageimport
import dwt.dwthelper.utils;
import dwtx.jface.text.IRegion;
import dwtx.jface.text.ITextViewer;
/**
* Provides information related to the content of a text viewer.
* <p>
* In order to provide backward compatibility for clients of <code>IInformationProvider</code>, extension
* interfaces are used to provide a means of evolution. The following extension interfaces exist:
* <ul>
* <li>{@link IInformationProviderExtension} since version 2.1 introducing
* the ability to provide the element for a given subject</li>
* <li>{@link IInformationProviderExtension2} since version 3.0 introducing
* the ability to provide its own information control creator</li>
* </ul>
* </p>
* <p>
* Clients may implement this interface.
* </p>
*
* @see dwtx.jface.text.information.IInformationProviderExtension
* @see dwtx.jface.text.information.IInformationProviderExtension2
* @see dwtx.jface.text.information.IInformationPresenter
* @see dwtx.jface.text.ITextViewer
* @since 2.0
*/
public interface IInformationProvider {
/**
* Returns the region of the text viewer's document close to the given
* offset that contains a subject about which information can be provided.<p>
* For example, if information can be provided on a per code block basis,
* the offset should be used to find the enclosing code block and the source
* range of the block should be returned.
*
* @param textViewer the text viewer in which information has been requested
* @param offset the offset at which information has been requested
* @return the region of the text viewer's document containing the information subject
*/
IRegion getSubject(ITextViewer textViewer, int offset);
/**
* Returns the information about the given subject or <code>null</code> if
* no information is available. It depends on the concrete configuration in which
* format the information is to be provided. For example, information presented
* in an information control displaying HTML, should be provided in HTML.
*
* @param textViewer the viewer in whose document the subject is contained
* @param subject the text region constituting the information subject
* @return the information about the subject
* @see IInformationPresenter
* @deprecated As of 2.1, replaced by {@link IInformationProviderExtension#getInformation2(ITextViewer, IRegion)}
*/
String getInformation(ITextViewer textViewer, IRegion subject);
}
|
D
|
instance Mod_7628_BUD_Sterling_VM (Npc_Default)
{
//-------- primary data --------
name = "Sterling";
npctype = npctype_MAIN;
guild = GIL_out;
level = 2;
voice = 0;
id = 7628;
//-------- abilities --------
B_SetAttributesToChapter (self, 2);
//-------- visuals --------
// animations
Mdl_SetVisual (self,"HUMANS.MDS");
Mdl_ApplyOverlayMds (self,"Humans_Tired.mds");
// body mesh, head mesh, hairmesh, face-tex, hair-tex, skin
Mdl_SetVisualBody (self,"hum_body_Naked0",2,2,"Hum_Head_FatBald", 0, 2, VLK_ARMOR_L);
Mdl_SetModelFatness (self, 0);
fight_tactic = FAI_HUMAN_COWARD;
//-------- Talents --------
B_SetFightSkills (self, 15);
//-------- inventory --------
//-------------Daily Routine-------------
daily_routine = Rtn_start_7628;
};
FUNC VOID Rtn_start_7628 ()
{
TA_Pick_Ore (08,00,23,00,"MINE_GO_14");
TA_Pick_Ore (23,00,08,00,"MINE_GO_14");
};
|
D
|
instance STRF_1103_Straefling(Npc_Default)
{
name[0] = NAME_Straefling;
guild = GIL_STRF;
id = 1103;
voice = 13;
flags = 0;
npcType = NPCTYPE_OCAMBIENT;
B_SetAttributesToChapter(self,1);
fight_tactic = FAI_HUMAN_COWARD;
// EquipItem(self,ItMw_2H_Axe_L_01);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_N_Weak_BaalNetbek,BodyTex_N,ITAR_Prisoner);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,15);
daily_routine = Rtn_Start_1103;
};
func void Rtn_Start_1103()
{
TA_Sit_Campfire(8,0,23,0,"OC_PRISON_CELL_01_SIT");
TA_Sit_Campfire(23,0,8,0,"OC_PRISON_CELL_01_SIT");
};
|
D
|
/Users/mu/Hello/.build/x86_64-apple-macosx/debug/Service.build/Services/TypeServiceFactory.swift.o : /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceID.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Deprecated.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/Service.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceCache.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Extendable.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceType.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Config/Config.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Provider/Provider.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/Container.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/SubContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/BasicSubContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/BasicContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/ServiceError.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/ContainerAlias.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/Services.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Exports.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Environment/Environment.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceFactory.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/BasicServiceFactory.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/TypeServiceFactory.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/mu/Hello/.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/mu/Hello/.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/mu/Hello/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mu/Hello/.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mu/Hello/.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/mu/Hello/.build/x86_64-apple-macosx/debug/Service.build/Services/TypeServiceFactory~partial.swiftmodule : /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceID.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Deprecated.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/Service.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceCache.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Extendable.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceType.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Config/Config.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Provider/Provider.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/Container.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/SubContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/BasicSubContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/BasicContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/ServiceError.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/ContainerAlias.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/Services.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Exports.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Environment/Environment.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceFactory.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/BasicServiceFactory.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/TypeServiceFactory.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/mu/Hello/.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/mu/Hello/.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/mu/Hello/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mu/Hello/.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mu/Hello/.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/mu/Hello/.build/x86_64-apple-macosx/debug/Service.build/Services/TypeServiceFactory~partial.swiftdoc : /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceID.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Deprecated.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/Service.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceCache.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Extendable.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceType.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Config/Config.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Provider/Provider.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/Container.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/SubContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/BasicSubContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/BasicContainer.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/ServiceError.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Container/ContainerAlias.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/Services.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Utilities/Exports.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Environment/Environment.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/ServiceFactory.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/BasicServiceFactory.swift /Users/mu/Hello/.build/checkouts/service/Sources/Service/Services/TypeServiceFactory.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/mu/Hello/.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/mu/Hello/.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/mu/Hello/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mu/Hello/.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mu/Hello/.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
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_6_banking-1113812911.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_6_banking-1113812911.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM ROCKTYPE
283.600006 83.1999969 4.4000001 84.1999969 2 4 -38 142.5 140 6.19999981 6.19999981 sediments, limestone, extrusives
21.8999996 87.1999969 3.5 52 0 4 -37 143.399994 9069 4.4000001 4.4000001 extrusives, basalts
52 88 1.89999998 323 0 1 -38 140.699997 1147 2 2.79999995 extrusives, basalts, baked contacts
216 82 1.60000002 999.900024 0 1 -38 140.699997 1148 1.60000002 2.29999995 extrusives, basalts
244.5 81.6999969 9.80000019 0 2 10 -9.60000038 119.300003 1209 5.80000019 10.6999998 extrusives
51 49 12 0 4 6 -9.30000019 124.300003 1207 6.0999999 12.1000004 extrusives, pillow basalts, intrusives
249.300003 82.3000031 8.60000038 0 2 10 -9.69999981 120.099998 1208 5.0999999 9.39999962 sediments, tuffs
264.399994 75 15.6000004 0 2 65 -8.80000019 126.699997 1206 10.3999996 18 extrusives, intrusives
349.5 78.1999969 4.69999981 999.900024 5 35 -36.0999985 149.100006 1153 6.0999999 7.5999999 sediments, weathered volcanics
294.399994 82.9000015 1.89999998 472.299988 8 23 -33.5999985 150.600006 1154 2.0999999 2.79999995 sediments
282.5 75.8000031 13 10 0 1 -37 150 1835 16.5 20.7000008 sediments
326.700012 73.3000031 5 75 0 1 -33 149 1834 6.9000001 8.30000019 sediments
282.100006 86.3000031 4.80000019 37 0 5 -38 143.5 1818 5.5 7.19999981 extrusives
266.299988 86.5999985 1.5 82 0 5 -38.5 143.5 1897 1.89999998 1.89999998 extrusives
236.600006 78.5 0 7.5 0 35 -17.2000008 131.5 1894 0 0 sediments, red mudstones
56 83 6 56 0 5 -38 143.5 1859 8 8 extrusives
270.5 80.4000015 0 125 5 23 -32.5 138.5 1976 8.39999962 8.39999962 sediments, red clays
256.899994 86.9000015 0 88 5 23 -36 137 1974 8.39999962 8.39999962 sediments, weathered
23.7999992 84.1999969 5.0999999 78.9000015 0 1 -34 144 1963 5.30000019 7.30000019 sediments, baked
|
D
|
// Tests regarding src/dmd/blockexit.d
//
// See ../../README.md for information about DMD unit tests.
module semantic.control_flow;
import dmd.blockexit : BE;
import dmd.func : FuncDeclaration;
import dmd.statement : Statement;
import dmd.visitor : Visitor;
import support;
//========================================================================================
// Sanity checks for simple statements
//
unittest { testStatement(`int i;`, BE.fallthru); }
unittest { testStatement(`return;`, BE.return_); }
unittest { testStatement(`void mayThrow(); return mayThrow();`, BE.return_ | BE.throw_); }
unittest { testStatement(`throw new Exception("");`, BE.throw_); }
unittest { testStatement(`throw new Error("");`, BE.errthrow); }
unittest { testStatement(`assert(0);`, BE.halt); }
unittest { testStatement(`int i; assert(i);`, BE.fallthru); } // Should this include errthrow?
/// Checks that `blockExit` yields `expected` for the given `code`.
void testStatement(const string stmt, const BE expected)
{
const code = "void test() {\n" ~ stmt ~ "\n}";
executeTest(code, (fd) {
testBlockExit(fd, fd.fbody, expected);
});
}
//========================================================================================
// Sanity checks for nested statements
//
@("if-else")
unittest
{
executeTest(q{
void test(int i)
{
if (i)
throw new Exception("");
else
return;
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 1);
auto if_ = (*stmts)[0].isIfStatement();
assert(if_);
testBlockExit(fd, fd.fbody, BE.throw_ | BE.return_);
testBlockExit(fd, if_, BE.throw_ | BE.return_);
testBlockExit(fd, if_.ifbody, BE.throw_);
testBlockExit(fd, if_.elsebody, BE.return_);
});
}
@("while")
unittest
{
executeTest(q{
int mayThrow();
int i;
void test()
{
mayThrow();
while (i) { i++; }
while (mayThrow()) {}
while (i) { mayThrow(); }
while (true) { assert(0); }
while (true) { continue; }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 6);
// Calling mayThrow might throw
testBlockExit(fd, (*stmts)[0], BE.fallthru | BE.throw_);
// Increment loop
testBlockExit(fd, (*stmts)[1], BE.fallthru);
// Calling mayThrow somewhere in the loop
testBlockExit(fd, (*stmts)[2], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[3], BE.fallthru | BE.throw_);
// Infinite loops
testBlockExit(fd, (*stmts)[4], BE.halt);
testBlockExit(fd, (*stmts)[5], BE.none);
});
}
@("do-while")
unittest
{
executeTest(q{
int mayThrow();
void test()
{
do {} while (false);
do { mayThrow(); } while (false);
do {} while (mayThrow());
do { assert(0); } while (mayThrow());
do { break; } while (true);
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 5);
// No-op loop
testBlockExit(fd, (*stmts)[0], BE.fallthru);
// Calling mayThrow somewhere in the loop
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[2], BE.fallthru | BE.throw_);
// Aborted before calling mayThrow
testBlockExit(fd, (*stmts)[3], BE.halt);
// Skipped infinite loop
testBlockExit(fd, (*stmts)[4], BE.fallthru);
});
}
@("for")
unittest
{
executeTest(q{
int mayThrow();
void test()
{
for (int i = 0; i < 1; i++) {}
for (int i = mayThrow(); i < 1; i++) {}
for (int i = 0; i < mayThrow(); i++) {}
for (int i = 0; i < 1; i += mayThrow()) {}
for (int i = 0; i < 1; i++)
mayThrow();
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 5);
// No-op loop
testBlockExit(fd, (*stmts)[0], BE.fallthru);
// Calling mayThrow somewhere in the loop
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[2], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[3], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[4], BE.fallthru | BE.throw_);
});
}
@("foreach-array")
unittest
{
executeTest(q{
int[] mayThrow();
void test()
{
foreach (i; [1, 2, 3]) {}
foreach (i; mayThrow()) {}
foreach (i; [1, 2, 3]) { mayThrow(); }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 3);
// No-op loop
testBlockExit(fd, (*stmts)[0], BE.fallthru);
// Calling mayThrow somewhere in the loop
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[2], BE.fallthru | BE.throw_);
});
}
@("foreach-range")
unittest
{
executeTest(q{
struct Range
{
bool empty() const;
int front() const;
void popFront();
}
void test()
{
foreach (i; Range()) {}
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 1);
testBlockExit(fd, (*stmts)[0], BE.fallthru | BE.throw_);
});
}
@("foreach-tuple")
unittest
{
executeTest(q{
struct Range
{
int a;
double b;
}
void test()
{
Range r;
foreach (ref m; r.tupleof)
m = 1;
foreach (ref m; r.tupleof)
return;
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 3);
testBlockExit(fd, (*stmts)[0], BE.fallthru);
testBlockExit(fd, (*stmts)[1], BE.fallthru);
testBlockExit(fd, (*stmts)[2], BE.return_);
});
}
@("switch-case")
unittest
{
executeTest(q{
int mayThrow();
void test(int i)
{
final switch (i)
{
case 1: break;
}
switch (i)
{
case 0:
case 1: break;
case 2: goto default;
default:
case 3: goto case 2;
}
final switch (i)
{
case 1: mayThrow(); break;
}
final switch (mayThrow())
{
case 1: break;
}
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 4);
// final switch might pass or abort on invalid values
const baseline = BE.fallthru | BE.halt;
testBlockExit(fd, (*stmts)[0], baseline);
// Complex control flow inside switch-case
// ENHANCEMENT: goto never leaves the switch-case
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.goto_);
// Calling mayThrow might throw
testBlockExit(fd, (*stmts)[2], baseline | BE.throw_);
testBlockExit(fd, (*stmts)[3], baseline | BE.throw_);
});
}
@("try-catch-caught")
unittest
{
executeTest(q{
void mayThrow();
void test()
{
try { mayThrow(); } catch (Exception e) {}
try { mayThrow(); throw new Error(""); } catch (Throwable) {}
try { mayThrow(); } catch (Throwable) { throw new Exception(""); }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 3);
// Calls mayThrow but catches all exceptions
testBlockExit(fd, (*stmts)[0], BE.fallthru);
// Throws and catches Error
auto tc = (*stmts)[1].isTryCatchStatement();
testBlockExit(fd, tc, BE.fallthru);
// Throws from handler
tc = (*stmts)[2].isTryCatchStatement();
testBlockExit(fd, tc, BE.fallthru | BE.throw_);
});
}
@("try-catch-escape")
unittest
{
executeTest(q{
void mayThrow();
void test()
{
try { mayThrow(); } catch (Error e) {}
try { mayThrow(); throw new Error(""); } catch (Exception) {}
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 2);
// Throws exception but catches Error
auto tc = (*stmts)[0].isTryCatchStatement();
testBlockExit(fd, tc, BE.fallthru | BE.throw_);
// Throws exception + error but only catches Exception
tc = (*stmts)[1].isTryCatchStatement();
testBlockExit(fd, tc, BE.fallthru | BE.errthrow);
});
}
@("try-catch-skipped")
unittest
{
executeTest(q{
void test()
{
try {} catch (Exception) {}
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 0);
});
}
@("try-finally")
unittest
{
executeTest(q{
void mayThrow();
void neverThrows() nothrow;
void test()
{
{ try mayThrow(); finally neverThrows(); }
{ try neverThrows(); finally mayThrow(); }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 2);
testBlockExit(fd, (*stmts)[0], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.throw_);
});
}
@("try-finally-override")
unittest
{
executeTest(q{
void mayThrow();
void test()
{
{ try mayThrow(); finally throw new Error(""); }
{ try throw new Error(""); finally mayThrow(); }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 2);
// ENHANCEMENT: finally block trumps the try-block
testBlockExit(fd, (*stmts)[0], BE.throw_ | BE.errthrow);
testBlockExit(fd, (*stmts)[1], BE.throw_ | BE.errthrow);
});
}
@("scope-exit")
unittest
{
executeTest(q{
void test()
{
scope (exit) throw new Exception("");
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
// FIXME: null statement without errors?!?
assert(stmts.length == 2);
assert((*stmts)[0] is null);
testBlockExit(fd, (*stmts)[1], BE.throw_);
});
}
@("scope-success")
unittest
{
executeTest(q{
void test()
{
scope (success) throw new Exception("");
}
},
(FuncDeclaration fd)
{
// Rewritten as:
// bool __os2 = false;
// try
// {
// }
// catch(Throwable __o3)
// {
// __os2 = true;
// throw __o3;
// }
// if (!__os2)
// throw new Exception("");
//
// FIXME: null statement at index 1 without errors?!?
auto stmts = getStatements(fd);
assert(stmts.length == 4);
// BUG(?): blockexit yields `fallthru` for the try-catch because the exception is typed as `Throwable`
testBlockExit(fd, (*stmts)[2], BE.fallthru);
assert((*stmts)[2].isTryCatchStatement());
testBlockExit(fd, fd.fbody, BE.fallthru | BE.throw_);
});
}
@("scope-failure")
unittest
{
executeTest(q{
void test()
{
scope (failure) throw new Exception("");
throw new Exception("");
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
// FIXME: null statement without errors?!?
assert(stmts.length == 2);
assert((*stmts)[0] is null);
assert((*stmts)[1] !is null);
testBlockExit(fd, (*stmts)[1], BE.throw_);
});
}
@("scope-success-skipped")
unittest
{
executeTest(q{
void test()
{
scope (success) assert(0);
throw new Exception("");
}
},
(FuncDeclaration fd)
{
// Rewritten as
// bool __os2 = false;
// try
// {
// try
// {
// throw new Exception("");
// }
// catch(Throwable __o3)
// {
// __os2 = true;
// throw __o3;
// }
// }
// finally
// if (!__os2)
// assert(0);
auto stmts = getStatements(fd);
// FIXME: null statement at index 1 without errors?!?
assert(stmts.length == 3);
testBlockExit(fd, (*stmts)[2], BE.throw_ | BE.halt);
assert((*stmts)[2].isTryFinallyStatement());
// ENHANCEMENT: Includes BE.halt even though the assert(0) is unreachable!
testBlockExit(fd, fd.fbody, BE.throw_ | BE.halt);
});
}
@("scope-failure-skipped")
unittest
{
executeTest(q{
void test()
{
scope (failure) throw new Exception("");
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 0); // Eliminated because the body is nothrow
});
}
@("scope-failure-implies-nothrow")
unittest
{
testStatement(q{
scope (failure) assert(false);
throw new Exception("");
}, BE.halt);
}
@("with")
unittest
{
executeTest(q{
struct S
{
int a;
}
S mayThrow();
void test()
{
with (S(1)) {}
with (mayThrow()) { assert(0); }
with (S(1)) { mayThrow(); }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 3);
testBlockExit(fd, (*stmts)[0], BE.fallthru);
testBlockExit(fd, (*stmts)[1], BE.throw_ | BE.halt);
testBlockExit(fd, (*stmts)[2], BE.fallthru | BE.throw_);
testBlockExit(fd, fd.fbody, BE.throw_ | BE.halt);
});
}
@("synchronized-plain")
unittest
{
executeTest(q{
void mayThrow();
void test()
{
{ synchronized {} }
{ synchronized { mayThrow(); } }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 2);
testBlockExit(fd, (*stmts)[0], BE.fallthru);
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.throw_);
});
}
@("synchronized-object")
unittest
{
executeTest(q{
Object obj;
Object mayThrow();
void test()
{
{ synchronized(obj) {} }
{ synchronized(obj) { mayThrow(); } }
{ synchronized(mayThrow()) { return; } }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 3);
testBlockExit(fd, (*stmts)[0], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.throw_);
testBlockExit(fd, (*stmts)[2], BE.return_ | BE.throw_);
});
}
@("goto")
unittest
{
executeTest(q{
void test()
{
Lstart: {}
goto Lstart;
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 2);
testBlockExit(fd, (*stmts)[0], BE.fallthru);
testBlockExit(fd, (*stmts)[1], BE.goto_);
// ENHANCEMENT: Could detect the infinite loop
testBlockExit(fd, fd.fbody, BE.goto_);
});
}
@("asm")
unittest
{
executeTest(q{
void test()
{
asm {int 3; }
asm nothrow {int 3; }
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 2);
testBlockExit(fd, (*stmts)[0], BE.fallthru | BE.return_ | BE.goto_ | BE.halt | BE.throw_);
testBlockExit(fd, (*stmts)[1], BE.fallthru | BE.return_ | BE.goto_ | BE.halt);
});
}
// Pruned statements
@("misc")
unittest
{
executeTest(q{
void test()
{
pragma(msg, "Hello");
static assert(1);
}
},
(FuncDeclaration fd)
{
auto stmts = getStatements(fd);
assert(stmts.length == 0);
});
}
//========================================================================================
// Utilities used by the tests defined above
//
/++
+ Fetches the list of statements from the function body.
+ Unwraps `CompoundStatement`'s consisting of a single statement as necessary.
+
+ Params:
+ fd = declaration providing the function body
+
+ Returns: a list of top-level statements in the function body
+/
auto getStatements(FuncDeclaration fd)
{
assert(fd.fbody);
auto cs = fd.fbody.isCompoundStatement();
assert(cs);
auto stmts = cs.statements;
assert(stmts);
// Body sometimes wrapped in additional CompoundStatments?
while (stmts.length == 1)
{
auto s = (*stmts)[0].isCompoundStatement();
if (!s)
break;
stmts = s.statements;
assert(stmts);
}
return stmts;
}
/// Callback implementing the actual test
alias Handler = void delegate(FuncDeclaration);
/++
+ Compiles the given code and applies the callback to the test function found in
+ the resulting AST (or raises an error if no matching `FuncDeclaration` exists).
+
+ Params:
+ code = the test code (must contain a function named `test`)
+ handler = the callback
+/
void executeTest(const string code, Handler handler)
{
import dmd.visitor : SemanticTimeTransitiveVisitor;
/// Visitor that searches the AST for a `FuncDeclaration` named `test`
extern (C++) static final class TestVisitor : SemanticTimeTransitiveVisitor
{
Handler handler;
bool called;
extern(D) this(Handler handler)
{
assert(handler);
this.handler = handler;
}
alias visit = typeof(super).visit;
override void visit(FuncDeclaration fd)
{
assert(fd);
if (fd.ident && fd.ident.toString() == "test")
{
handler(fd);
called = true;
}
}
}
scope visitor = new TestVisitor(handler);
executeTest(code, visitor);
assert(visitor.called, "No FuncDeclaration found!");
}
/// Compiles `code` and applies the visitor to the resulting AST.
void executeTest(const string code, Visitor visitor)
{
assert(code);
assert(visitor);
auto res = support.compiles(code);
if (!res)
{
const error = "Test failed!"
~ "\n===========================================\n"
~ code
~ "\n===========================================\n"
~ res.toString();
assert(false, error);
}
auto mod = cast() res.module_;
assert(mod);
mod.accept(visitor);
}
/++
+ Formats the given BE value as an array of BE's values,
+ e.g. `BE.throw_ | BE.halt` is printed as `[throw_, halt]`.
+
+ Params:
+ be = bitfield consisting of BE's values
+
+ Returns: the string representation of `be`
+/
string beToString(const int be)
{
string result = "[";
bool first = true;
foreach (const member; __traits(allMembers, BE))
{
enum val = __traits(getMember, BE, member);
if (val == BE.any || (be & val) == 0)
continue;
if (first)
first = false;
else
result ~= ", ";
result ~= member;
}
result ~= "]";
return result;
}
/++
+ Verifiies that `blockexit` yields `expected` when called for the
+ statement `stmt` located inside of a function represented by `fd`.
+
+ Params:
+ fd = the function containing `stmt`
+ stmt = the statement to check
+ expected = the return values expected from `blockexit`
+/
void testBlockExit(FuncDeclaration fd, Statement stmt, const BE expected)
{
import dmd.globals : global;
import dmd.blockexit : blockExit;
assert(fd);
assert(stmt);
const actual = blockExit(stmt, fd, false);
assert(actual == expected, beToString(actual) ~ " != " ~ beToString(expected));
assert(!global.errors, "`blockExit` raised an error!");
}
//========================================================================================
// Common setup identical to the other tests:
//
/// Initialize the frontend before each test
@beforeEach void initializeFrontend()
{
import dmd.frontend : initDMD;
initDMD();
}
/// Deinitialize the frontend after each test
@afterEach void deinitializeFrontend()
{
import dmd.frontend : deinitializeDMD;
deinitializeDMD();
}
|
D
|
//Автор Кристофер Миллер. Переработано для Динрус Виталием Кулич.
//Библиотека визуальных конпонентов VIZ (первоначально DFL).
module viz.drawing;
private import viz.x.dlib;
private import viz.x.winapi, viz.base, viz.x.utf, viz.x.com,
viz.x.wincom;
/// X and Y coordinate.
struct Точка // docmain
{
union
{
struct
{
LONG ш;
LONG в;
}
POINT точка; // package
}
/// Construct а new Точка.
static Точка opCall(цел ш, цел в)
{
Точка тчк;
тчк.ш = ш;
тчк.в = в;
return тчк;
}
static Точка opCall()
{
Точка тчк;
return тчк;
}
т_рав opEquals(Точка тчк)
{
return ш == тчк.ш && в == тчк.в;
}
Точка opAdd(Размер разм)
{
Точка результат;
результат.ш = ш + разм.ширина;
результат.в = в + разм.высота;
return результат;
}
Точка opSub(Размер разм)
{
Точка результат;
результат.ш = ш - разм.ширина;
результат.в = в - разм.высота;
return результат;
}
проц opAddAssign(Размер разм)
{
ш += разм.ширина;
в += разм.высота;
}
проц opSubAssign(Размер разм)
{
ш -= разм.ширина;
в -= разм.высота;
}
Точка opNeg()
{
return Точка(-ш, -в);
}
}
/// ширина and высота.
struct Размер // docmain
{
union
{
struct
{
цел ширина;
цел высота;
}
РАЗМЕР размер; // package
}
/// Construct а new Размер.
static Размер opCall(цел ширина, цел высота)
{
Размер разм;
разм.ширина = ширина;
разм.высота = высота;
return разм;
}
static Размер opCall()
{
Размер разм;
return разм;
}
т_рав opEquals(Размер разм)
{
return ширина == разм.ширина && высота == разм.высота;
}
Размер opAdd(Размер разм)
{
Размер результат;
результат.ширина = ширина + разм.ширина;
результат.высота = высота + разм.высота;
return результат;
}
Размер opSub(Размер разм)
{
Размер результат;
результат.ширина = ширина - разм.ширина;
результат.высота = высота - разм.высота;
return результат;
}
проц opAddAssign(Размер разм)
{
ширина += разм.ширина;
высота += разм.высота;
}
проц opSubAssign(Размер разм)
{
ширина -= разм.ширина;
высота -= разм.высота;
}
}
/// X, Y, ширина and высота rectangle dimensions.
struct Прям // docmain
{
цел ш, в, ширина, высота;
// Used internally.
проц дайПрям(RECT* к) // package
{
к.лево = ш;
к.right = ш + ширина;
к.top = в;
к.bottom = в + высота;
}
Точка положение() // getter
{
return Точка(ш, в);
}
проц положение(Точка тчк) // setter
{
ш = тчк.ш;
в = тчк.в;
}
Размер размер() //getter
{
return Размер(ширина, высота);
}
проц размер(Размер разм) // setter
{
ширина = разм.ширина;
высота = разм.высота;
}
цел право() // getter
{
return ш + ширина;
}
цел низ() // getter
{
return в + высота;
}
/// Construct а new Прям.
static Прям opCall(цел ш, цел в, цел ширина, цел высота)
{
Прям к;
к.ш = ш;
к.в = в;
к.ширина = ширина;
к.высота = высота;
return к;
}
static Прям opCall(Точка положение, Размер размер)
{
Прям к;
к.ш = положение.ш;
к.в = положение.в;
к.ширина = размер.ширина;
к.высота = размер.высота;
return к;
}
static Прям opCall()
{
Прям к;
return к;
}
// Used internally.
static Прям opCall(RECT* rect) // package
{
Прям к;
к.ш = rect.лево;
к.в = rect.top;
к.ширина = rect.right - rect.лево;
к.высота = rect.bottom - rect.top;
return к;
}
/// Construct а new Прям from лево, верх, право and низ значения.
static Прям изЛВПН(цел лево, цел верх, цел право, цел низ)
{
Прям к;
к.ш = лево;
к.в = верх;
к.ширина = право - лево;
к.высота = низ - верх;
return к;
}
т_рав opEquals(Прям к)
{
return ш == к.ш && в == к.в &&
ширина == к.ширина && высота == к.высота;
}
бул содержит(цел c_x, цел c_y)
{
if(c_x >= ш && c_y >= в)
{
if(c_x <= право && c_y <= низ)
return да;
}
return нет;
}
бул содержит(Точка поз)
{
return содержит(поз.ш, поз.в);
}
// Contained entirely within -this-.
бул содержит(Прям к)
{
if(к.ш >= ш && к.в >= в)
{
if(к.право <= право && к.низ <= низ)
return да;
}
return нет;
}
проц инфлируй(цел i_width, цел i_height)
{
ш -= i_width;
ширина += i_width * 2;
в -= i_height;
высота += i_height * 2;
}
проц инфлируй(Размер insz)
{
инфлируй(insz.ширина, insz.высота);
}
// Just tests if there's an intersection.
бул пересекаетсяС(Прям к)
{
if(к.право >= ш && к.низ >= в)
{
if(к.в <= низ && к.ш <= право)
return да;
}
return нет;
}
проц смещение(цел ш, цел в)
{
this.ш += ш;
this.в += в;
}
проц смещение(Точка тчк)
{
//return смещение(тчк.ш, тчк.в);
this.ш += тчк.ш;
this.в += тчк.в;
}
/+
// Modify -this- to include only the intersection
// of -this- and -к-.
проц intersect(Прям к)
{
}
+/
// проц смещение(Точка), проц смещение(цел, цел)
// static Прям union(Прям, Прям)
}
unittest
{
Прям к = Прям(3, 3, 3, 3);
assert(к.содержит(3, 3));
assert(!к.содержит(3, 2));
assert(к.содержит(6, 6));
assert(!к.содержит(6, 7));
assert(к.содержит(к));
assert(к.содержит(Прям(4, 4, 2, 2)));
assert(!к.содержит(Прям(2, 4, 4, 2)));
assert(!к.содержит(Прям(4, 3, 2, 4)));
к.инфлируй(2, 1);
assert(к.ш == 1);
assert(к.право == 8);
assert(к.в == 2);
assert(к.низ == 7);
к.инфлируй(-2, -1);
assert(к == Прям(3, 3, 3, 3));
assert(к.пересекаетсяС(Прям(4, 4, 2, 9)));
assert(к.пересекаетсяС(Прям(3, 3, 1, 1)));
assert(к.пересекаетсяС(Прям(0, 3, 3, 0)));
assert(к.пересекаетсяС(Прям(3, 2, 0, 1)));
assert(!к.пересекаетсяС(Прям(3, 1, 0, 1)));
assert(к.пересекаетсяС(Прям(5, 6, 1, 1)));
assert(!к.пересекаетсяС(Прям(7, 6, 1, 1)));
assert(!к.пересекаетсяС(Прям(6, 7, 1, 1)));
}
/// Цвет значение representation
struct Цвет // docmain
{
/// Red, зелёный, синий and альфа channel цвет значения.
ббайт к() // getter
{ оцениЦвет(); return цвет.красный; }
ббайт з() // getter
{ оцениЦвет(); return цвет.зелёный; }
ббайт с() // getter
{ оцениЦвет(); return цвет.синий; }
ббайт а() // getter
{ /+ оцениЦвет(); +/ return цвет.альфа; }
/// Return the numeric цвет значение.
COLORREF вАкзс()
{
оцениЦвет();
return цвет.cref;
}
/// Return the numeric красный, зелёный and синий цвет значение.
COLORREF вКзс()
{
оцениЦвет();
return цвет.cref & 0x00FFFFFF;
}
// Used internally.
HBRUSH создайКисть() // package
{
HBRUSH hbr;
if(_systemColorIndex == Цвет.INVAILD_SYSTEM_COLOR_INDEX)
hbr = CreateSolidBrush(вКзс());
else
hbr = GetSysColorBrush(_systemColorIndex);
return hbr;
}
deprecated static Цвет opCall(COLORREF argb)
{
Цвет nc;
nc.цвет.cref = argb;
return nc;
}
/// Construct а new цвет.
static Цвет opCall(ббайт альфа, Цвет ктрл)
{
Цвет nc;
nc.цвет.синий = ктрл.цвет.синий;
nc.цвет.зелёный = ктрл.цвет.зелёный;
nc.цвет.красный = ктрл.цвет.красный;
nc.цвет.альфа = альфа;
return nc;
}
static Цвет opCall(ббайт красный, ббайт зелёный, ббайт синий)
{
Цвет nc;
nc.цвет.синий = синий;
nc.цвет.зелёный = зелёный;
nc.цвет.красный = красный;
nc.цвет.альфа = 0xFF;
return nc;
}
static Цвет opCall(ббайт альфа, ббайт красный, ббайт зелёный, ббайт синий)
{
return изАкзс(альфа, красный, зелёный, синий);
}
//alias opCall изАкзс;
static Цвет изАкзс(ббайт альфа, ббайт красный, ббайт зелёный, ббайт синий)
{
Цвет nc;
nc.цвет.синий = синий;
nc.цвет.зелёный = зелёный;
nc.цвет.красный = красный;
nc.цвет.альфа = альфа;
return nc;
}
static Цвет изКзс(COLORREF кзс)
{
if(CLR_NONE == кзс)
return пуст;
Цвет nc;
nc.цвет.cref = кзс;
nc.цвет.альфа = 0xFF;
return nc;
}
static Цвет изКзс(ббайт альфа, COLORREF кзс)
{
Цвет nc;
nc.цвет.cref = кзс | ((cast(COLORREF)альфа) << 24);
return nc;
}
static Цвет пуст() // getter
{
return Цвет(0, 0, 0, 0);
}
/// Return а completely прозрачный цвет значение.
static Цвет прозрачный() // getter
{
return Цвет.изАкзс(0, 0xFF, 0xFF, 0xFF);
}
deprecated alias смешайСЦветом blend;
/// Blend colors; альфа channels are ignored.
// Blends the цвет channels half way.
// Does not consider альфа channels and discards them.
// The new blended цвет is returned; -this- Цвет is not изменён.
Цвет смешайСЦветом(Цвет ко)
{
if(*this == Цвет.пуст)
return ко;
if(ко == Цвет.пуст)
return *this;
оцениЦвет();
ко.оцениЦвет();
return Цвет((cast(бцел)цвет.красный + cast(бцел)ко.цвет.красный) >> 1,
(cast(бцел)цвет.зелёный + cast(бцел)ко.цвет.зелёный) >> 1,
(cast(бцел)цвет.синий + cast(бцел)ко.цвет.синий) >> 1);
}
/// Alpha blend this цвет with а background цвет to return а solid цвет (100% opaque).
// Blends with цветФона if this цвет has непрозрачность to produce а solid цвет.
// Returns the new solid цвет, or the original цвет if нет непрозрачность.
// If цветФона has непрозрачность, it is ignored.
// The new blended цвет is returned; -this- Цвет is not изменён.
Цвет плотныйЦвет(Цвет цветФона)
{
//if(0x7F == this.цвет.альфа)
// return смешайСЦветом(цветФона);
//if(*this == Цвет.пуст) // Checked if(0 == this.цвет.альфа)
// return цветФона;
if(0 == this.цвет.альфа)
return цветФона;
if(цветФона == Цвет.пуст)
return *this;
if(0xFF == this.цвет.альфа)
return *this;
оцениЦвет();
цветФона.оцениЦвет();
float fa, ba;
fa = cast(float)цвет.альфа / 255.0;
ba = 1.0 - fa;
Цвет результат;
результат.цвет.альфа = 0xFF;
результат.цвет.красный = cast(ббайт)(this.цвет.красный * fa + цветФона.цвет.красный * ba);
результат.цвет.зелёный = cast(ббайт)(this.цвет.зелёный * fa + цветФона.цвет.зелёный * ba);
результат.цвет.синий = cast(ббайт)(this.цвет.синий * fa + цветФона.цвет.синий * ba);
return результат;
}
package static Цвет системныйЦвет(цел индексЦвета)
{
Цвет ктрл;
ктрл.sysIndex = индексЦвета;
ктрл.цвет.альфа = 0xFF;
return ктрл;
}
// Gets цвет индекс or INVAILD_SYSTEM_COLOR_INDEX.
package цел _systemColorIndex() // getter
{
return sysIndex;
}
package const ббайт INVAILD_SYSTEM_COLOR_INDEX = ббайт.max;
private:
union _color
{
struct
{
align(1):
ббайт красный;
ббайт зелёный;
ббайт синий;
ббайт альфа;
}
COLORREF cref;
}
static assert(_color.sizeof == бцел.sizeof);
_color цвет;
ббайт sysIndex = INVAILD_SYSTEM_COLOR_INDEX;
проц оцениЦвет()
{
if(sysIndex != INVAILD_SYSTEM_COLOR_INDEX)
{
цвет.cref = GetSysColor(sysIndex);
//цвет.альфа = 0xFF; // Should already be установи.
}
}
}
class СистемныеЦвета // docmain
{
private this()
{
}
static:
Цвет активныйБордюр() // getter
{
return Цвет.системныйЦвет(COLOR_ACTIVEBORDER);
}
Цвет активныйЗаголовок() // getter
{
return Цвет.системныйЦвет(COLOR_ACTIVECAPTION);
}
Цвет текстАктивногоЗаголовка() // getter
{
return Цвет.системныйЦвет(COLOR_CAPTIONTEXT);
}
Цвет рабочееПространствоПрилож() // getter
{
return Цвет.системныйЦвет(COLOR_APPWORKSPACE);
}
Цвет упрэлт() // getter
{
return Цвет.системныйЦвет(COLOR_BTNFACE);
}
Цвет тёмныйУпр() // getter
{
return Цвет.системныйЦвет(COLOR_BTNSHADOW);
}
Цвет оченьТёмныйУпр() // getter
{
return Цвет.системныйЦвет(COLOR_3DDKSHADOW); // ?
}
Цвет светлыйУпр() // getter
{
return Цвет.системныйЦвет(COLOR_3DLIGHT);
}
Цвет оченьСветлыйУпр() // getter
{
return Цвет.системныйЦвет(COLOR_BTNHIGHLIGHT); // ?
}
Цвет текстУпр() // getter
{
return Цвет.системныйЦвет(COLOR_BTNTEXT);
}
Цвет рабочийСтол() // getter
{
return Цвет.системныйЦвет(COLOR_DESKTOP);
}
Цвет серыйТекст() // getter
{
return Цвет.системныйЦвет(COLOR_GRAYTEXT);
}
Цвет подсветка() // getter
{
return Цвет.системныйЦвет(COLOR_HIGHLIGHT);
}
Цвет подсветкаТекста() // getter
{
return Цвет.системныйЦвет(COLOR_HIGHLIGHTTEXT);
}
Цвет хотТрэк() // getter
{
return Цвет(0, 0, 0xFF); // ?
}
Цвет неактивныйБордюр() // getter
{
return Цвет.системныйЦвет(COLOR_INACTIVEBORDER);
}
Цвет неактивныйЗаголовок() // getter
{
return Цвет.системныйЦвет(COLOR_INACTIVECAPTION);
}
Цвет текстНеактивногоЗаголовка() // getter
{
return Цвет.системныйЦвет(COLOR_INACTIVECAPTIONTEXT);
}
Цвет инфо() // getter
{
return Цвет.системныйЦвет(COLOR_INFOBK);
}
Цвет текстИнфо() // getter
{
return Цвет.системныйЦвет(COLOR_INFOTEXT);
}
Цвет меню() // getter
{
return Цвет.системныйЦвет(COLOR_MENU);
}
Цвет текстМеню() // getter
{
return Цвет.системныйЦвет(COLOR_MENUTEXT);
}
Цвет полосаПрокрутки() // getter
{
return Цвет.системныйЦвет(CTLCOLOR_SCROLLBAR);
}
Цвет окно() // getter
{
return Цвет.системныйЦвет(COLOR_WINDOW);
}
Цвет рамкаОкна() // getter
{
return Цвет.системныйЦвет(COLOR_WINDOWFRAME);
}
Цвет текстОкна() // getter
{
return Цвет.системныйЦвет(COLOR_WINDOWTEXT);
}
}
class СистемныеПиктограммы // docmain
{
private this()
{
}
static:
Пиктограмма приложение() // getter
{
return new Пиктограмма(LoadIconA(пусто, IDI_APPLICATION), нет);
}
Пиктограмма ошибка() // getter
{
return new Пиктограмма(LoadIconA(пусто, IDI_HAND), нет);
}
Пиктограмма вопрос() // getter
{
return new Пиктограмма(LoadIconA(пусто, IDI_QUESTION), нет);
}
Пиктограмма предупреждение() // getter
{
return new Пиктограмма(LoadIconA(пусто, IDI_EXCLAMATION), нет);
}
Пиктограмма информация() // getter
{
return new Пиктограмма(LoadIconA(пусто, IDI_INFORMATION), нет);
}
}
/+
class ImageFormat
{
/+
this(guid)
{
}
final guid() // getter
{
return guid;
}
+/
static:
ImageFormat bmp() // getter
{
return пусто;
}
ImageFormat пиктограмма() // getter
{
return пусто;
}
}
+/
abstract class Рисунок // docmain
{
//флаги(); // getter ???
/+
final ImageFormat rawFormat(); // getter
+/
static Битмап изУкНаБитмап(HBITMAP hbm) // package
{
return new Битмап(hbm, нет); // Not owned. Up to caller to manage or call вымести().
}
/+
static Рисунок изФайла(Ткст file)
{
return new Рисунок(LoadImageA());
}
+/
проц рисуй(Графика з, Точка тчк);
проц рисуйРастяни(Графика з, Прям к);
Размер размер(); // getter
цел ширина() // getter
{
return размер.ширина;
}
цел высота() // getter
{
return размер.высота;
}
цел _imgtype(HGDIOBJ* ph) // internal
{
if(ph)
*ph = HGDIOBJ.init;
return 0; // 1 = битмап; 2 = пиктограмма.
}
}
class Битмап: Рисунок // docmain
{
// Load from а bmp file.
this(Ткст фимя)
{
this.hbm = cast(HBITMAP)viz.x.utf.загрузиРисунок(пусто, фимя, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if(!this.hbm)
throw new ВизИскл("Unable to загрузка битмап from file '" ~ фимя ~ "'");
}
// Used internally.
this(HBITMAP hbm, бул owned = да)
{
this.hbm = hbm;
this.owned = owned;
}
final HBITMAP указатель() // getter
{
return hbm;
}
private проц _getInfo(BITMAP* bm)
{
if(GetObjectA(hbm, BITMAP.sizeof, bm) != BITMAP.sizeof)
throw new ВизИскл("Unable to get рисунок информация");
}
final override Размер размер() // getter
{
BITMAP bm;
_getInfo(&bm);
return Размер(bm.bmWidth, bm.bmHeight);
}
final override цел ширина() // getter
{
return размер.ширина;
}
final override цел высота() // getter
{
return размер.высота;
}
private проц _draw(Графика з, Точка тчк, HDC memdc)
{
HGDIOBJ hgo;
Размер разм;
разм = размер;
hgo = SelectObject(memdc, hbm);
BitBlt(з.указатель, тчк.ш, тчк.в, разм.ширина, разм.высота, memdc, 0, 0, SRCCOPY);
SelectObject(memdc, hgo); // Old битмап.
}
final override проц рисуй(Графика з, Точка тчк)
{
HDC memdc;
memdc = CreateCompatibleDC(з.указатель);
try
{
_draw(з, тчк, memdc);
}
finally
{
DeleteDC(memdc);
}
}
// -tempMemGraphics- is used as а temporary Графика instead of
// creating and destroying а temporary one for each call.
final проц рисуй(Графика з, Точка тчк, Графика tempMemGraphics)
{
_draw(з, тчк, tempMemGraphics.указатель);
}
private проц _drawStretched(Графика з, Прям к, HDC memdc)
{
HGDIOBJ hgo;
Размер разм;
цел lstretch;
разм = размер;
hgo = SelectObject(memdc, hbm);
lstretch = SetStretchBltMode(з.указатель, COLORONCOLOR);
StretchBlt(з.указатель, к.ш, к.в, к.ширина, к.высота, memdc, 0, 0, разм.ширина, разм.высота, SRCCOPY);
SetStretchBltMode(з.указатель, lstretch);
SelectObject(memdc, hgo); // Old битмап.
}
final override проц рисуйРастяни(Графика з, Прям к)
{
HDC memdc;
memdc = CreateCompatibleDC(з.указатель);
try
{
_drawStretched(з, к, memdc);
}
finally
{
DeleteDC(memdc);
}
}
// -tempMemGraphics- is used as а temporary Графика instead of
// creating and destroying а temporary one for each call.
final проц рисуйРастяни(Графика з, Прям к, Графика tempMemGraphics)
{
_drawStretched(з, к, tempMemGraphics.указатель);
}
проц вымести()
{
assert(owned);
DeleteObject(hbm);
hbm = пусто;
}
~this()
{
if(owned)
вымести();
}
override цел _imgtype(HGDIOBJ* ph) // internal
{
if(ph)
*ph = cast(HGDIOBJ)hbm;
return 1;
}
private:
HBITMAP hbm;
бул owned = да;
}
class Картинка: Рисунок // docmain
{
// Note: requires OleInitialize(пусто).
// Throws исключение on failure.
this(Stream stm)
{
this.ipic = _fromStream(stm);
if(!this.ipic)
throw new ВизИскл("Unable to загрузка picture from stream");
}
// Throws исключение on failure.
this(Ткст фимя)
{
this.ipic = _fromFileName(фимя);
if(!this.ipic)
throw new ВизИскл("Unable to загрузка picture from file '" ~ фимя ~ "'");
}
this(проц[] mem)
{
this.ipic = _fromMemory(mem);
if(!this.ipic)
throw new ВизИскл("Unable to загрузка picture from memory");
}
private this(viz.x.wincom.IPicture ipic)
{
this.ipic = ipic;
}
// Returns пусто on failure instead of throwing исключение.
static Картинка изПотока(Stream stm)
{
auto ipic = _fromStream(stm);
if(!ipic)
return пусто;
return new Картинка(ipic);
}
// Returns пусто on failure instead of throwing исключение.
static Картинка изФайла(Ткст фимя)
{
auto ipic = _fromFileName(фимя);
if(!ipic)
return пусто;
return new Картинка(ipic);
}
static Картинка изПамяти(проц[] mem)
{
auto ipic = _fromMemory(mem);
if(!ipic)
return пусто;
return new Картинка(ipic);
}
final проц рисуй(HDC hdc, Точка тчк) // package
{
цел lhx, lhy;
цел ширина, высота;
lhx = loghimX;
lhy = loghimY;
ширина = MAP_LOGHIM_TO_PIX(lhx, GetDeviceCaps(hdc, LOGPIXELSX));
высота = MAP_LOGHIM_TO_PIX(lhy, GetDeviceCaps(hdc, LOGPIXELSY));
ipic.Render(hdc, тчк.ш, тчк.в + высота, ширина, -высота, 0, 0, lhx, lhy, пусто);
}
final override проц рисуй(Графика з, Точка тчк)
{
return рисуй(з.указатель, тчк);
}
final проц рисуйРастяни(HDC hdc, Прям к) // package
{
цел lhx, lhy;
lhx = loghimX;
lhy = loghimY;
ipic.Render(hdc, к.ш, к.в + к.высота, к.ширина, -к.высота, 0, 0, lhx, lhy, пусто);
}
final override проц рисуйРастяни(Графика з, Прям к)
{
return рисуйРастяни(з.указатель, к);
}
final OLE_XSIZE_HIMETRIC loghimX() // getter
{
OLE_XSIZE_HIMETRIC xsz;
if(S_OK != ipic.get_Width(&xsz))
return 0; // ?
return xsz;
}
final OLE_YSIZE_HIMETRIC loghimY() // getter
{
OLE_YSIZE_HIMETRIC ysz;
if(S_OK != ipic.get_Height(&ysz))
return 0; // ?
return ysz;
}
final override цел ширина() // getter
{
Графика з;
цел результат;
з = Графика.дайЭкран();
результат = дайШирину(з);
з.вымести();
return результат;
}
final override цел высота() // getter
{
Графика з;
цел результат;
з = Графика.дайЭкран();
результат = дайВысоту(з);
з.вымести();
return результат;
}
final override Размер размер() // getter
{
Графика з;
Размер результат;
з = Графика.дайЭкран();
результат = дайРазмер(з);
з.вымести();
return результат;
}
final цел дайШирину(HDC hdc) // package
{
return MAP_LOGHIM_TO_PIX(loghimX, GetDeviceCaps(hdc, LOGPIXELSX));
}
final цел дайШирину(Графика з)
{
return дайШирину(з.указатель);
}
final цел дайВысоту(HDC hdc) // package
{
return MAP_LOGHIM_TO_PIX(loghimY, GetDeviceCaps(hdc, LOGPIXELSX));
}
final цел дайВысоту(Графика з)
{
return дайВысоту(з.указатель);
}
final Размер дайРазмер(HDC hdc) // package
{
return Размер(дайШирину(hdc), дайВысоту(hdc));
}
final Размер дайРазмер(Графика з)
{
return Размер(дайШирину(з), дайВысоту(з));
}
проц вымести()
{
if(HBITMAP.init != _hbmimgtype)
{
DeleteObject(_hbmimgtype);
_hbmimgtype = HBITMAP.init;
}
if(ipic)
{
ipic.Release();
ipic = пусто;
}
}
~this()
{
вымести();
}
final HBITMAP вУкНаБитмап(HDC hdc) // package
{
HDC memdc;
HBITMAP результат;
HGDIOBJ oldbm;
memdc = CreateCompatibleDC(hdc);
if(!memdc)
throw new ВизИскл("Device ошибка");
try
{
Размер разм;
разм = дайРазмер(hdc);
результат = CreateCompatibleBitmap(hdc, разм.ширина, разм.высота);
if(!результат)
{
bad_bm:
throw new ВизИскл("Unable to allocate рисуноr");
}
oldbm = SelectObject(memdc, результат);
рисуй(memdc, Точка(0, 0));
}
finally
{
if(oldbm)
SelectObject(memdc, oldbm);
DeleteDC(memdc);
}
return результат;
}
final Битмап вБитмап(HDC hdc) // package
{
HBITMAP hbm;
hbm = вУкНаБитмап(hdc);
if(!hbm)
throw new ВизИскл("Unable to create битмап");
return new Битмап(hbm, да); // Owned.
}
final Битмап вБитмап()
{
Битмап результат;
scope Графика з = Графика.дайЭкран();
результат = вБитмап(з);
//з.вымести(); // scope'd
return результат;
}
final Битмап вБитмап(Графика з)
{
return вБитмап(з.указатель);
}
HBITMAP _hbmimgtype;
override цел _imgtype(HGDIOBJ* ph) // internal
{
if(ph)
{
if(HBITMAP.init == _hbmimgtype)
{
scope Графика з = Графика.дайЭкран();
_hbmimgtype = вУкНаБитмап(з.указатель);
//з.вымести(); // scope'd
}
*ph = _hbmimgtype;
}
return 1;
}
private:
viz.x.wincom.IPicture ipic = пусто;
static viz.x.wincom.IPicture _fromIStream(viz.x.wincom.winapi.IStream istm)
{
viz.x.wincom.IPicture ipic;
switch(OleLoadPicture(istm, 0, FALSE, &_IID_IPicture, cast(проц**)&ipic))
{
case S_OK:
return ipic;
debug(VIZ_X)
{
case E_OUTOFMEMORY:
debug assert(0, "Картинка: Вне памяти");
break;
case E_NOINTERFACE:
debug assert(0, "Картинка: The object does not support the interface");
break;
case E_UNEXPECTED:
debug assert(0, "Картинка: Unexpected ошибка");
break;
case E_POINTER:
debug assert(0, "Картинка: Invalid pointer");
break;
case E_FAIL:
debug assert(0, "Картинка: Fail");
break;
}
default: ;
}
return пусто;
}
static viz.x.wincom.IPicture _fromStream(Stream stm)
in
{
assert(stm !is пусто);
}
body
{
scope ПотокВИПоток istm = new ПотокВИПоток(stm);
return _fromIStream(istm);
}
static viz.x.wincom.IPicture _fromFileName(Ткст фимя)
{
alias viz.x.winapi.HANDLE HANDLE; // Otherwise, odd conflict with wine.
HANDLE hf;
HANDLE hg;
ук pg;
DWORD dwsz, dw;
hf = viz.x.utf.createFile(фимя, GENERIC_READ, FILE_SHARE_READ, пусто,
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, пусто);
if(!hf)
return пусто;
dwsz = GetFileSize(hf, пусто);
if(0xFFFFFFFF == dwsz)
{
failclose:
ЗакройДескр(hf);
return пусто;
}
hg = GlobalAlloc(GMEM_MOVEABLE, dwsz);
if(!hg)
goto failclose;
pg = GlobalLock(hg);
if(!pg)
{
ЗакройДескр(hf);
ЗакройДескр(hg);
return пусто;
}
if(!ReadFile(hf, pg, dwsz, &dw, пусто) || dwsz != dw)
{
ЗакройДескр(hf);
GlobalUnlock(hg);
ЗакройДескр(hg);
return пусто;
}
ЗакройДескр(hf);
GlobalUnlock(hg);
winapi.IStream istm;
viz.x.wincom.IPicture ipic;
if(S_OK != CreateStreamOnHGlobal(hg, TRUE, &istm))
{
ЗакройДескр(hg);
return пусто;
}
// Don't need to ЗакройДескр(hg) due to 2nd парам being TRUE.
ipic = _fromIStream(istm);
istm.Release();
return ipic;
}
static viz.x.wincom.IPicture _fromMemory(проц[] mem)
{
return _fromIStream(new ИПотокПамяти(mem));
}
}
enum СокращениеТекста: UINT
{
НЕУК = 0,
ЭЛЛИПСИС = DT_END_ELLIPSIS,
ЭЛЛИПСИС_ПУТЬ = DT_PATH_ELLIPSIS,
}
enum ФлагиФорматаТекста: UINT
{
БЕЗ_ПРЕФИКСОВ = DT_NOPREFIX,
DIRECTION_RIGHT_TO_LEFT = DT_RTLREADING,
ПРЕРВАТЬ_СЛОВО = DT_WORDBREAK,
ЕДИНАЯ_СТРОКА = DT_SINGLELINE,
БЕЗ_ОБРЕЗКИ = DT_NOCLIP,
ЛИМИТ_СТРОКА = DT_EDITКОНТРОЛ,
}
enum РасположениеТекста: UINT
{
ЛЕВ = DT_LEFT, ПРАВ = DT_RIGHT,
ЦЕНТР = DT_CENTER,
ВЕРХ = DT_TOP, /// Single line only расположение.
НИЗ = DT_BOTTOM,
СРЕДН = DT_VCENTER,
}
class ФорматТекста
{
this()
{
}
this(ФорматТекста tf)
{
_trim = tf._trim;
_flags = tf._flags;
_align = tf._align;
_params = tf._params;
}
this(ФлагиФорматаТекста флаги)
{
_flags = флаги;
}
static ФорматТекста генерныйДефолт() // getter
{
ФорматТекста результат;
результат = new ФорматТекста;
результат._trim = СокращениеТекста.НЕУК;
результат._flags = ФлагиФорматаТекста.БЕЗ_ПРЕФИКСОВ | ФлагиФорматаТекста.ПРЕРВАТЬ_СЛОВО |
ФлагиФорматаТекста.БЕЗ_ОБРЕЗКИ | ФлагиФорматаТекста.ЛИМИТ_СТРОКА;
return результат;
}
static ФорматТекста генернаяТипографика() // getter
{
return new ФорматТекста;
}
final проц расположение(РасположениеТекста ta) // setter
{
_align = ta;
}
final РасположениеТекста расположение() // getter
{
return _align;
}
final проц флагиФормата(ФлагиФорматаТекста tff) // setter
{
_flags = tff;
}
final ФлагиФорматаТекста флагиФормата() // getter
{
return _flags;
}
final проц сокращение(СокращениеТекста tt) // getter
{
_trim = tt;
}
final СокращениеТекста сокращение() // getter
{
return _trim;
}
// Units of the average character ширина.
final проц длинаТаб(цел tablen) // setter
{
_params.iTabLength = tablen;
}
final цел длинаТаб() // getter
{
return _params.iTabLength;
}
// Units of the average character ширина.
final проц левыйКрай(цел разм) // setter
{
_params.iLeftMargin = разм;
}
final цел левыйКрай() // getter
{
return _params.iLeftMargin;
}
// Units of the average character ширина.
final проц правыйКрай(цел разм) // setter
{
_params.iRightMargin = разм;
}
final цел правыйКрай() // getter
{
return _params.iRightMargin;
}
private:
СокращениеТекста _trim = СокращениеТекста.НЕУК; // СокращениеТекста.CHARACTER.
ФлагиФорматаТекста _flags = ФлагиФорматаТекста.БЕЗ_ПРЕФИКСОВ | ФлагиФорматаТекста.ПРЕРВАТЬ_СЛОВО;
РасположениеТекста _align = РасположениеТекста.ЛЕВ;
package DRAWTEXTPARAMS _params = { DRAWTEXTPARAMS.sizeof, 8, 0, 0 };
}
// Note: currently only works with the one screen.
class Экран
{
static Экран первичныйЭкран() // getter
{
static Экран _ps;
if(!_ps)
{
synchronized
{
if(!_ps)
_ps = new Экран();
}
}
return _ps;
}
Прям границы() // getter
{
RECT area;
if(!GetWindowRect(GetDesktopWindow(), &area))
assert(0);
return Прям(&area);
}
Прям рабочаяЗона() // getter
{
RECT area;
if(!SystemParametersInfoA(SPI_GETWORKAREA, 0, &area, FALSE))
return границы;
return Прям(&area);
}
private:
this() { }
}
class Графика // docmain
{
// Used internally.
this(HDC hdc, бул owned = да)
{
this.hdc = hdc;
this.owned = owned;
}
~this()
{
if(owned)
вымести();
}
// Used internally.
final проц drawSizeGrip(цел право, цел низ) // package
{
Цвет light, dark;
цел ш, в;
light = СистемныеЦвета.оченьСветлыйУпр;
dark = СистемныеЦвета.тёмныйУпр;
scope Перо lightPen = new Перо(light);
scope Перо darkPen = new Перо(dark);
ш = право;
в = низ;
ш -= 3;
в -= 3;
рисуйЛинию(darkPen, ш, низ, право, в);
ш--;
в--;
рисуйЛинию(darkPen, ш, низ, право, в);
рисуйЛинию(lightPen, ш - 1, низ, право, в - 1);
ш -= 3;
в -= 3;
рисуйЛинию(darkPen, ш, низ, право, в);
ш--;
в--;
рисуйЛинию(darkPen, ш, низ, право, в);
рисуйЛинию(lightPen, ш - 1, низ, право, в - 1);
ш -= 3;
в -= 3;
рисуйЛинию(darkPen, ш, низ, право, в);
ш--;
в--;
рисуйЛинию(darkPen, ш, низ, право, в);
рисуйЛинию(lightPen, ш - 1, низ, право, в - 1);
}
// Used internally.
// вСплит=да means the перемещение grip moves лево to право; нет means верх to низ.
final проц drawMoveGrip(Прям movableArea, бул вСплит = да, т_мера count = 5) // package
{
const цел MSPACE = 4;
const цел MWIDTH = 3;
const цел MHEIGHT = 3;
if(!count || !movableArea.ширина || !movableArea.высота)
return;
Цвет norm, light, dark, ddark;
цел ш, в;
т_мера iw;
norm = СистемныеЦвета.упрэлт;
light = СистемныеЦвета.оченьСветлыйУпр.смешайСЦветом(norm); // center
//dark = СистемныеЦвета.тёмныйУпр.смешайСЦветом(norm); // верх
ббайт ubmin(цел ub) { if(ub <= 0) return 0; return ub; }
dark = Цвет(ubmin(cast(цел)norm.к - 0x10), ubmin(cast(цел)norm.з - 0x10), ubmin(cast(цел)norm.с - 0x10));
//ddark = СистемныеЦвета.оченьТёмныйУпр; // низ
ddark = СистемныеЦвета.тёмныйУпр.смешайСЦветом(Цвет(0x10, 0x10, 0x10)); // низ
//scope Перо lightPen = new Перо(light);
scope Перо darkPen = new Перо(dark);
scope Перо ddarkPen = new Перо(ddark);
проц drawSingleMoveGrip()
{
Точка[3] pts;
pts[0].ш = ш + MWIDTH - 2;
pts[0].в = в;
pts[1].ш = ш;
pts[1].в = в;
pts[2].ш = ш;
pts[2].в = в + MHEIGHT - 1;
рисуйЛинии(darkPen, pts);
pts[0].ш = ш + MWIDTH - 1;
pts[0].в = в + 1;
pts[1].ш = pts[0].ш;
pts[1].в = в + MHEIGHT - 1;
pts[2].ш = ш;
pts[2].в = pts[1].в;
рисуйЛинии(ddarkPen, pts);
заполниПрямоугольник(light, ш + 1, в + 1, 1, 1);
}
if(вСплит)
{
ш = movableArea.ш + (movableArea.ширина / 2 - MWIDTH / 2);
//в = movableArea.высота / 2 - ((MWIDTH * count) + (MSPACE * (count - 1))) / 2;
в = movableArea.в + (movableArea.высота / 2 - ((MWIDTH * count) + (MSPACE * count)) / 2);
for(iw = 0; iw != count; iw++)
{
drawSingleMoveGrip();
в += MHEIGHT + MSPACE;
}
}
else // гСплит
{
//ш = movableArea.ширина / 2 - ((MHEIGHT * count) + (MSPACE * (count - 1))) / 2;
ш = movableArea.ш + (movableArea.ширина / 2 - ((MHEIGHT * count) + (MSPACE * count)) / 2);
в = movableArea.в + (movableArea.высота / 2 - MHEIGHT / 2);
for(iw = 0; iw != count; iw++)
{
drawSingleMoveGrip();
ш += MWIDTH + MSPACE;
}
}
}
package final ФорматТекста дайФорматКэшированногоТекста()
{
static ФорматТекста фмт = пусто;
if(!фмт)
фмт = ФорматТекста.генерныйДефолт;
return фмт;
}
// Windows 95/98/Me limits -текст- to 8192 characters.
final проц рисуйТекст(Ткст текст, Шрифт шрифт, Цвет цвет, Прям к, ФорматТекста фмт)
{
// Should SaveDC/RestoreDC be used instead?
COLORREF prevColor;
HFONT prevFont;
цел prevBkMode;
prevColor = SetTextColor(hdc, цвет.вКзс());
prevFont = cast(HFONT)SelectObject(hdc, шрифт ? шрифт.указатель : пусто);
prevBkMode = SetBkMode(hdc, TRANSPARENT);
RECT rect;
к.дайПрям(&rect);
viz.x.utf.рисуйТекстДоп(hdc, текст, &rect, DT_EXPANDTABS | DT_TABSTOP |
фмт._trim | фмт._flags | фмт._align, &фмт._params);
// Reset stuff.
//if(CLR_INVALID != prevColor)
SetTextColor(hdc, prevColor);
//if(prevFont)
SelectObject(hdc, prevFont);
//if(prevBkMode)
SetBkMode(hdc, prevBkMode);
}
final проц рисуйТекст(Ткст текст, Шрифт шрифт, Цвет цвет, Прям к)
{
return рисуйТекст(текст, шрифт, цвет, к, дайФорматКэшированногоТекста());
}
final проц рисуйТекстДезакт(Ткст текст, Шрифт шрифт, Цвет цвет, Цвет цветФона, Прям к, ФорматТекста фмт)
{
к.смещение(1, 1);
//рисуйТекст(текст, шрифт, Цвет(24, цвет).плотныйЦвет(цветФона), к, фмт); // Lighter, lower one.
//рисуйТекст(текст, шрифт, Цвет.изКзс(~цвет.вКзс() & 0xFFFFFF), к, фмт); // Lighter, lower one.
рисуйТекст(текст, шрифт, Цвет(192, Цвет.изКзс(~цвет.вКзс() & 0xFFFFFF)).плотныйЦвет(цветФона), к, фмт); // Lighter, lower one.
к.смещение(-1, -1);
рисуйТекст(текст, шрифт, Цвет(128, цвет).плотныйЦвет(цветФона), к, фмт);
}
final проц рисуйТекстДезакт(Ткст текст, Шрифт шрифт, Цвет цвет, Цвет цветФона, Прям к)
{
return рисуйТекстДезакт(текст, шрифт, цвет, цветФона, к, дайФорматКэшированногоТекста());
}
/+
final Размер мерьТекст(Ткст текст, Шрифт шрифт)
{
РАЗМЕР разм;
HFONT prevFont;
prevFont = cast(HFONT)SelectObject(hdc, шрифт ? шрифт.указатель : пусто);
viz.x.utf.getTextExtentPoint32(hdc, текст, &разм);
//if(prevFont)
SelectObject(hdc, prevFont);
return Размер(разм.cx, разм.cy);
}
+/
private const цел DEFAULT_MEASURE_SIZE = short.max; // Has to be smaller because it's 16-bits on win9x.
final Размер мерьТекст(Ткст текст, Шрифт шрифт, цел максШирина, ФорматТекста фмт)
{
RECT rect;
HFONT prevFont;
rect.лево = 0;
rect.top = 0;
rect.right = максШирина;
rect.bottom = DEFAULT_MEASURE_SIZE;
prevFont = cast(HFONT)SelectObject(hdc, шрифт ? шрифт.указатель : пусто);
if(!viz.x.utf.рисуйТекстДоп(hdc, текст, &rect, DT_EXPANDTABS | DT_TABSTOP |
фмт._trim | фмт._flags | фмт._align | DT_CALCRECT | DT_NOCLIP, &фмт._params))
{
//throw new ВизИскл("Text measure ошибка");
rect.лево = 0;
rect.top = 0;
rect.right = 0;
rect.bottom = 0;
}
//if(prevFont)
SelectObject(hdc, prevFont);
return Размер(rect.right - rect.лево, rect.bottom - rect.top);
}
final Размер мерьТекст(Ткст текст, Шрифт шрифт, ФорматТекста фмт)
{
return мерьТекст(текст, шрифт, DEFAULT_MEASURE_SIZE, фмт);
}
final Размер мерьТекст(Ткст текст, Шрифт шрифт, цел максШирина)
{
return мерьТекст(текст, шрифт, максШирина, дайФорматКэшированногоТекста());
}
final Размер мерьТекст(Ткст текст, Шрифт шрифт)
{
return мерьТекст(текст, шрифт, DEFAULT_MEASURE_SIZE, дайФорматКэшированногоТекста());
}
/+
// Doesn't work... viz.x.utf.рисуйТекстДоп uses а different buffer!
// final Ткст getTrimmedText(Ткст текст, Шрифт шрифт, Прям к, ФорматТекста фмт) // deprecated
{
switch(фмт.сокращение)
{
case СокращениеТекста.ЭЛЛИПСИС:
case СокращениеТекста.ЭЛЛИПСИС_ПУТЬ:
{
сим[] newтекст;
RECT rect;
HFONT prevFont;
newтекст = текст.dup;
к.дайПрям(&rect);
prevFont = cast(HFONT)SelectObject(hdc, шрифт ? шрифт.указатель : пусто);
// DT_CALCRECT needs to prevent it from actually drawing.
if(!viz.x.utf.рисуйТекстДоп(hdc, newтекст, &rect, DT_EXPANDTABS | DT_TABSTOP |
фмт._trim | фмт._flags | фмт._align | DT_CALCRECT | DT_MODIFYSTRING | DT_NOCLIP, &фмт._params))
{
//throw new ВизИскл("Text сокращение ошибка");
}
//if(prevFont)
SelectObject(hdc, prevFont);
for(т_мера iw = 0; iw != newтекст.length; iw++)
{
if(!newтекст[iw])
return newтекст[0 .. iw];
}
//return newтекст;
// There was нет change, so нет sense in keeping the duplicate.
delete newтекст;
return текст;
}
break;
default: ;
return текст;
}
}
// final Ткст getTrimmedText(Ткст текст, Шрифт шрифт, Прям к, СокращениеТекста trim)
{
scope фмт = new ФорматТекста(ФлагиФорматаТекста.БЕЗ_ПРЕФИКСОВ | ФлагиФорматаТекста.ПРЕРВАТЬ_СЛОВО |
ФлагиФорматаТекста.БЕЗ_ОБРЕЗКИ | ФлагиФорматаТекста.ЛИМИТ_СТРОКА);
фмт.сокращение = trim;
return getTrimmedText(текст, шрифт, к, фмт);
}
+/
final проц рисуйПиктограмму(Пиктограмма пиктограмма, Прям к)
{
// DrawIconEx operates differently if the ширина or высота is zero
// so bail out if zero and pretend the zero размер пиктограмма was drawn.
цел ширина = к.ширина;
if(!ширина)
return;
цел высота = к.высота;
if(!высота)
return;
DrawIconEx(указатель, к.ш, к.в, пиктограмма.указатель, ширина, высота, 0, пусто, DI_NORMAL);
}
final проц рисуйПиктограмму(Пиктограмма пиктограмма, цел ш, цел в)
{
DrawIconEx(указатель, ш, в, пиктограмма.указатель, 0, 0, 0, пусто, DI_NORMAL);
}
final проц заполниПрямоугольник(Кисть кисть, Прям к)
{
заполниПрямоугольник(кисть, к.ш, к.в, к.ширина, к.высота);
}
final проц заполниПрямоугольник(Кисть кисть, цел ш, цел в, цел ширина, цел высота)
{
RECT rect;
rect.лево = ш;
rect.right = ш + ширина;
rect.top = в;
rect.bottom = в + высота;
FillRect(указатель, &rect, кисть.указатель);
}
// Extra function.
final проц заполниПрямоугольник(Цвет цвет, Прям к)
{
заполниПрямоугольник(цвет, к.ш, к.в, к.ширина, к.высота);
}
// Extra function.
final проц заполниПрямоугольник(Цвет цвет, цел ш, цел в, цел ширина, цел высота)
{
RECT rect;
цел prevBkColor;
prevBkColor = SetBkColor(hdc, цвет.вКзс());
rect.лево = ш;
rect.top = в;
rect.right = ш + ширина;
rect.bottom = в + высота;
ExtTextOutA(hdc, ш, в, ETO_НЕПРОЗРАЧНЫЙ, &rect, "", 0, пусто);
// Reset stuff.
//if(CLR_INVALID != prevBkColor)
SetBkColor(hdc, prevBkColor);
}
final проц заполниРегион(Кисть кисть, Регион регион)
{
FillRgn(указатель, регион.указатель, кисть.указатель);
}
static Графика изУок(УОК уок)
{
return new ОбщаяГрафика(уок, GetDC(уок));
}
/// Get the entire screen's Графика for the primary monitor.
static Графика дайЭкран()
{
return new ОбщаяГрафика(пусто, GetWindowDC(пусто));
}
final проц рисуйЛинию(Перо pen, Точка старт, Точка end)
{
рисуйЛинию(pen, старт.ш, старт.в, end.ш, end.в);
}
final проц рисуйЛинию(Перо pen, цел стартX, цел стартY, цел endX, цел endY)
{
ПЕРО prevPen;
prevPen = SelectObject(hdc, pen.указатель);
MoveToEx(hdc, стартX, стартY, пусто);
LineTo(hdc, endX, endY);
// Reset stuff.
SelectObject(hdc, prevPen);
}
// First two точки is the first line, the other точки link а line
// to the previous Точка.
final проц рисуйЛинии(Перо pen, Точка[] точки)
{
if(точки.length < 2)
{
assert(0); // Not enough line точки.
return;
}
ПЕРО prevPen;
цел i;
prevPen = SelectObject(hdc, pen.указатель);
MoveToEx(hdc, точки[0].ш, точки[0].в, пусто);
for(i = 1;;)
{
LineTo(hdc, точки[i].ш, точки[i].в);
if(++i == точки.length)
break;
}
// Reset stuff.
SelectObject(hdc, prevPen);
}
final проц рисуйАрку(Перо pen, цел ш, цел в, цел ширина, цел высота, цел arcX1, цел arcY1, цел arcX2, цел arcY2)
{
ПЕРО prevPen;
prevPen = SelectObject(hdc, pen.указатель);
Arc(hdc, ш, в, ш + ширина, в + высота, arcX1, arcY1, arcX2, arcY2);
// Reset stuff.
SelectObject(hdc, prevPen);
}
final проц рисуйАрку(Перо pen, Прям к, Точка arc1, Точка arc2)
{
рисуйАрку(pen, к.ш, к.в, к.ширина, к.высота, arc1.ш, arc1.в, arc2.ш, arc2.в);
}
final проц рисуйБезье(Перо pen, Точка[4] точки)
{
ПЕРО prevPen;
POINT* cpts;
prevPen = SelectObject(hdc, pen.указатель);
// This assumes а Точка is laid out exactly like а Точка.
static assert(Точка.sizeof == POINT.sizeof);
cpts = cast(POINT*)cast(Точка*)точки;
PolyBezier(hdc, cpts, 4);
// Reset stuff.
SelectObject(hdc, prevPen);
}
final проц рисуйБезье(Перо pen, Точка pt1, Точка pt2, Точка pt3, Точка pt4)
{
Точка[4] точки;
точки[0] = pt1;
точки[1] = pt2;
точки[2] = pt3;
точки[3] = pt4;
рисуйБезье(pen, точки);
}
// First 4 точки are the first bezier, each next 3 are the next
// beziers, using the previous last Точка as the стартing Точка.
final проц рисуйБезьеМн(Перо pen, Точка[] точки)
{
if(точки.length < 1 || (точки.length - 1) % 3)
{
assert(0); // Bad number of точки.
//return; // Let PolyBezier() do what it wants with the bad number.
}
ПЕРО prevPen;
POINT* cpts;
prevPen = SelectObject(hdc, pen.указатель);
// This assumes а Точка is laid out exactly like а Точка.
static assert(Точка.sizeof == POINT.sizeof);
cpts = cast(POINT*)cast(Точка*)точки;
PolyBezier(hdc, cpts, точки.length);
// Reset stuff.
SelectObject(hdc, prevPen);
}
// TODO: drawCurve(), drawClosedCurve() ...
final проц рисуйЭллипс(Перо pen, Прям к)
{
рисуйЭллипс(pen, к.ш, к.в, к.ширина, к.высота);
}
final проц рисуйЭллипс(Перо pen, цел ш, цел в, цел ширина, цел высота)
{
ПЕРО prevPen;
HBRUSH prevBrush;
prevPen = SelectObject(hdc, pen.указатель);
prevBrush = SelectObject(hdc, cast(HBRUSH)GetStockObject(NULL_BRUSH)); // Don't fill it in.
Ellipse(hdc, ш, в, ш + ширина, в + высота);
// Reset stuff.
SelectObject(hdc, prevPen);
SelectObject(hdc, prevBrush);
}
// TODO: drawPie()
final проц рисуйМногоугольник(Перо pen, Точка[] точки)
{
if(точки.length < 2)
{
assert(0); // Need at least 2 точки.
//return;
}
ПЕРО prevPen;
HBRUSH prevBrush;
POINT* cpts;
prevPen = SelectObject(hdc, pen.указатель);
prevBrush = SelectObject(hdc, cast(HBRUSH)GetStockObject(NULL_BRUSH)); // Don't fill it in.
// This assumes а Точка is laid out exactly like а Точка.
static assert(Точка.sizeof == POINT.sizeof);
cpts = cast(POINT*)cast(Точка*)точки;
Polygon(hdc, cpts, точки.length);
// Reset stuff.
SelectObject(hdc, prevPen);
SelectObject(hdc, prevBrush);
}
final проц рисуйПрямоугольник(Перо pen, Прям к)
{
рисуйПрямоугольник(pen, к.ш, к.в, к.ширина, к.высота);
}
final проц рисуйПрямоугольник(Перо pen, цел ш, цел в, цел ширина, цел высота)
{
ПЕРО prevPen;
HBRUSH prevBrush;
prevPen = SelectObject(hdc, pen.указатель);
prevBrush = SelectObject(hdc, cast(HBRUSH)GetStockObject(NULL_BRUSH)); // Don't fill it in.
viz.x.winapi.Rectangle(hdc, ш, в, ш + ширина, в + высота);
// Reset stuff.
SelectObject(hdc, prevPen);
SelectObject(hdc, prevBrush);
}
/+
final проц рисуйПрямоугольник(Цвет ктрл, Прям к)
{
рисуйПрямоугольник(ктрл, к.ш, к.в, к.ширина, к.высота);
}
final проц рисуйПрямоугольник(Цвет ктрл, цел ш, цел в, цел ширина, цел высота)
{
}
+/
final проц рисуйПрямоугольники(Перо pen, Прям[] rs)
{
ПЕРО prevPen;
HBRUSH prevBrush;
prevPen = SelectObject(hdc, pen.указатель);
prevBrush = SelectObject(hdc, cast(HBRUSH)GetStockObject(NULL_BRUSH)); // Don't fill it in.
foreach(inout Прям к; rs)
{
viz.x.winapi.Rectangle(hdc, к.ш, к.в, к.ш + к.ширина, к.в + к.высота);
}
// Reset stuff.
SelectObject(hdc, prevPen);
SelectObject(hdc, prevBrush);
}
// Force pending графика operations.
final проц слей()
{
GdiFlush();
}
final Цвет дайБлижайшийЦвет(Цвет ктрл)
{
COLORREF cref;
cref = GetNearestColor(указатель, ктрл.вКзс());
if(CLR_INVALID == cref)
return Цвет.пуст;
return Цвет.изКзс(ктрл.а, cref); // Preserve альфа.
}
final Размер getScaleSize(Шрифт f)
{
// http://support.microsoft.com/kb/125681
Размер результат;
version(DIALOG_BOX_SCALE)
{
const Ткст SAMPLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
результат = мерьТекст(SAMPLE, f);
результат.ширина = (результат.ширина / (SAMPLE.length / 2) + 1) / 2;
TEXTMETRICA tma;
if(GetTextMetricsA(указатель, &tma))
результат.высота = tma.tmHeight;
}
else
{
const Ткст SAMPLE = "Abcdefghijklmnopqrstuvwxyz";
результат = мерьТекст(SAMPLE, f);
результат.ширина /= SAMPLE.length;
}
return результат;
}
final бул копируйВ(HDC dest, цел destX, цел destY, цел ширина, цел высота, цел srcX = 0, цел srcY = 0, DWORD rop = SRCCOPY) // package
{
return cast(бул)viz.x.winapi.BitBlt(dest, destX, destY, ширина, высота, this.указатель, srcX, srcY, rop);
}
final бул копируйВ(Графика destGraphics, цел destX, цел destY, цел ширина, цел высота, цел srcX = 0, цел srcY = 0, DWORD rop = SRCCOPY)
{
return копируйВ(destGraphics.указатель, destX, destY, ширина, высота, srcX, srcY, rop);
}
final бул копируйВ(Графика destGraphics, Прям границы)
{
return копируйВ(destGraphics.указатель, границы.ш, границы.в, границы.ширина, границы.высота);
}
final HDC указатель() // getter
{
return hdc;
}
проц вымести()
{
assert(owned);
DeleteDC(hdc);
hdc = пусто;
}
private:
HDC hdc;
бул owned = да;
}
/// Графика for а surface in memory.
class ГрафикаВПамяти: Графика // docmain
{
// Графика compatible with the текущий screen.
this(цел ширина, цел высота)
{
HDC hdc;
hdc = GetWindowDC(пусто);
scope(exit)
ReleaseDC(пусто, hdc);
this(ширина, высота, hdc);
}
// graphicsCompatible cannot be another ГрафикаВПамяти.
this(цел ширина, цел высота, Графика graphicsCompatible)
{
if(cast(ГрафикаВПамяти)graphicsCompatible)
{
//throw new ВизИскл("Графика cannot be compatible with memory");
assert(0, "Графика cannot be compatible with memory");
}
this(ширина, высота, graphicsCompatible.указатель);
}
// Used internally.
this(цел ширина, цел высота, HDC hdcCompatible) // package
{
_w = ширина;
_h = высота;
hbm = CreateCompatibleBitmap(hdcCompatible, ширина, высота);
if(!hbm)
throw new ВизИскл("Unable to allocate Графика memory");
scope(failure)
{
DeleteObject(hbm);
//hbm = HBITMAP.init;
}
HDC hdcc;
hdcc = CreateCompatibleDC(hdcCompatible);
if(!hdcc)
throw new ВизИскл("Unable to allocate Графика");
scope(failure)
DeleteDC(hdcc);
hbmOld = SelectObject(hdcc, hbm);
scope(failure)
SelectObject(hdcc, hbmOld);
super(hdcc);
}
final цел ширина() // getter
{
return _w;
}
final цел высота() // getter
{
return _h;
}
final Размер размер() // getter
{
return Размер(_w, _h);
}
final HBITMAP укНаБитмап() // getter // package
{
return hbm;
}
// Needs to копируй so it can be selected into other DC`s.
final HBITMAP вУкНаБитмап(HDC hdc) // package
{
HDC memdc;
HBITMAP результат;
HGDIOBJ oldbm;
memdc = CreateCompatibleDC(hdc);
if(!memdc)
throw new ВизИскл("Device ошибка");
try
{
результат = CreateCompatibleBitmap(hdc, ширина, высота);
if(!результат)
{
bad_bm:
throw new ВизИскл("Unable to allocate рисуноr");
}
oldbm = SelectObject(memdc, результат);
копируйВ(memdc, 0, 0, ширина, высота);
}
finally
{
if(oldbm)
SelectObject(memdc, oldbm);
DeleteDC(memdc);
}
return результат;
}
final Битмап вБитмап(HDC hdc) // package
{
HBITMAP hbm;
hbm = вУкНаБитмап(hdc);
if(!hbm)
throw new ВизИскл("Unable to create битмап");
return new Битмап(hbm, да); // Owned.
}
final Битмап вБитмап()
{
Графика з;
Битмап результат;
з = Графика.дайЭкран();
результат = вБитмап(з);
з.вымести();
return результат;
}
final Битмап вБитмап(Графика з)
{
return вБитмап(з.указатель);
}
override проц вымести()
{
SelectObject(hdc, hbmOld);
hbmOld = HGDIOBJ.init;
DeleteObject(hbm);
hbm = HBITMAP.init;
super.вымести();
}
private:
HGDIOBJ hbmOld;
HBITMAP hbm;
цел _w, _h;
}
// Use with GetDC()/GetWindowDC()/GetDCEx() so that
// the HDC is properly released instead of deleted.
package class ОбщаяГрафика: Графика
{
// Used internally.
this(УОК уок, HDC hdc, бул owned = да)
{
super(hdc, owned);
this.уок = уок;
}
override проц вымести()
{
ReleaseDC(уок, hdc);
hdc = пусто;
}
package:
УОК уок;
}
class Пиктограмма: Рисунок // docmain
{
// Used internally.
this(HICON hi, бул owned = да)
{
this.hi = hi;
this.owned = owned;
}
deprecated static Пиктограмма поУказателю(HICON hi)
{
return new Пиктограмма(hi, нет); // Not owned. Up to caller to manage or call вымести().
}
// -bm- can be пусто.
// NOTE: the bitmaps in -ii- need to be deleted! _deleteBitmaps() is а быстрыйЗапуск.
private проц _getInfo(ICONINFO* ii, BITMAP* bm = пусто)
{
if(GetIconInfo(hi, ii))
{
if(!bm)
return;
HBITMAP hbm;
if(ii.hbmColor)
hbm = ii.hbmColor;
else // Monochrome.
hbm = ii.hbmMask;
if(GetObjectA(hbm, BITMAP.sizeof, bm) == BITMAP.sizeof)
return;
}
// Fell through, failed.
throw new ВизИскл("Unable to get рисунок информация");
}
private проц _deleteBitmaps(ICONINFO* ii)
{
DeleteObject(ii.hbmColor);
ii.hbmColor = пусто;
DeleteObject(ii.hbmMask);
ii.hbmMask = пусто;
}
final Битмап вБитмап()
{
ICONINFO ii;
BITMAP bm;
_getInfo(&ii, &bm);
// Not calling _deleteBitmaps() because I'm keeping one.
HBITMAP hbm;
if(ii.hbmColor)
{
hbm = ii.hbmColor;
DeleteObject(ii.hbmMask);
}
else // Monochrome.
{
hbm = ii.hbmMask;
}
return new Битмап(hbm, да); // Yes owned.
}
final override проц рисуй(Графика з, Точка тчк)
{
з.рисуйПиктограмму(this, тчк.ш, тчк.в);
}
final override проц рисуйРастяни(Графика з, Прям к)
{
з.рисуйПиктограмму(this, к);
}
final override Размер размер() // getter
{
ICONINFO ii;
BITMAP bm;
_getInfo(&ii, &bm);
_deleteBitmaps(&ii);
return Размер(bm.bmWidth, bm.bmHeight);
}
final override цел ширина() // getter
{
return размер.ширина;
}
final override цел высота() // getter
{
return размер.высота;
}
~this()
{
if(owned)
вымести();
}
цел _imgtype(HGDIOBJ* ph) // internal
{
if(ph)
*ph = cast(HGDIOBJ)hi;
return 2;
}
проц вымести()
{
assert(owned);
DestroyIcon(hi);
hi = пусто;
}
final HICON указатель() // getter
{
return hi;
}
private:
HICON hi;
бул owned = да;
}
enum ЕдиницаГрафики: ббайт // docmain ?
{
ПИКСЕЛЬ,
ДИСПЛЕЙ, // 1/75 inch.
ДОКУМЕНТ, // 1/300 inch.
ДЮЙМ, // 1 inch, der.
МИЛЛИМЕТР, // 25.4 millimeters in 1 inch.
POINT, // 1/72 inch.
//WORLD, // ?
TWIP, // Extra. 1/1440 inch.
}
/+
// TODO: check if correct implementation.
enum GenericFontFamilies
{
MONOSPACE = FF_MODERN,
SANS_SERIF = FF_ROMAN,
SERIF = FF_SWISS,
}
+/
/+
abstract class FontCollection
{
abstract FontFamily[] families(); // getter
}
class FontFamily
{
/+
this(GenericFontFamilies genericFamily)
{
}
+/
this(Ткст имя)
{
}
this(Ткст имя, FontCollection fontCollection)
{
}
final Ткст имя() // getter
{
}
static FontFamily[] families() // getter
{
}
/+
// TODO: implement.
static FontFamily genericMonospace() // getter
{
}
static FontFamily genericSansSerif() // getter
{
}
static FontFamily genericSerif() // getter
{
}
+/
}
+/
// Flags.
enum СтильШрифта: ббайт
{
ОБЫЧНЫЙ = 0, ПОЛУЖИРНЫЙ = 1,
КУРСИВ = 2,
ПОДЧЁРКНУТЫЙ = 4,
ЗАЧЁРКНУТЫЙ = 8,
}
enum СглаживаниеШрифта
{
ПО_УМОЛЧАНИЮ = DEFAULT_QUALITY,
ВКЛ = ANTIALIASED_QUALITY,
ВЫКЛ = NONANTIALIASED_QUALITY,
}
class Шрифт // docmain
{
// Used internally.
static проц LOGFONTAtoLogFont(inout ШрифтЛога шл, LOGFONTA* plfa) // package // deprecated
{
шл.шла = *plfa;
шл.имяФаса = viz.x.utf.изАнзи0(plfa.lfFaceName.ptr);
}
// Used internally.
static проц LOGFONTWtoLogFont(inout ШрифтЛога шл, LOGFONTW* plfw) // package // deprecated
{
шл.шлш = *plfw;
шл.имяФаса = viz.x.utf.изЮникода0(plfw.lfFaceName.ptr);
}
// Used internally.
this(HFONT hf, LOGFONTA* plfa, бул owned = да) // package // deprecated
{
ШрифтЛога шл;
LOGFONTAtoLogFont(шл, plfa);
this.hf = hf;
this.owned = owned;
this._unit = ЕдиницаГрафики.POINT;
_fstyle = _style(шл);
_initLf(шл);
}
// Used internally.
this(HFONT hf, inout ШрифтЛога шл, бул owned = да) // package
{
this.hf = hf;
this.owned = owned;
this._unit = ЕдиницаГрафики.POINT;
_fstyle = _style(шл);
_initLf(шл);
}
// Used internally.
this(HFONT hf, бул owned = да) // package
{
this.hf = hf;
this.owned = owned;
this._unit = ЕдиницаГрафики.POINT;
ШрифтЛога шл;
_info(шл);
_fstyle = _style(шл);
_initLf(шл);
}
// Used internally.
this(LOGFONTA* plfa, бул owned = да) // package // deprecated
{
ШрифтЛога шл;
LOGFONTAtoLogFont(шл, plfa);
this(_create(шл), шл, owned);
}
// Used internally.
this(inout ШрифтЛога шл, бул owned = да) // package
{
this(_create(шл), шл, owned);
}
package static HFONT _create(inout ШрифтЛога шл)
{
HFONT результат;
результат = viz.x.utf.createFontIndirect(шл);
if(!результат)
throw new ВизИскл("Unable to create шрифт");
return результат;
}
private static проц _style(inout ШрифтЛога шл, СтильШрифта стиль)
{
шл.шл.lfWeight = (стиль & СтильШрифта.ПОЛУЖИРНЫЙ) ? FW_BOLD : FW_NORMAL;
шл.шл.lfItalic = (стиль & СтильШрифта.КУРСИВ) ? TRUE : FALSE;
шл.шл.lfUnderline = (стиль & СтильШрифта.ПОДЧЁРКНУТЫЙ) ? TRUE : FALSE;
шл.шл.lfStrikeOut = (стиль & СтильШрифта.ЗАЧЁРКНУТЫЙ) ? TRUE : FALSE;
}
private static СтильШрифта _style(inout ШрифтЛога шл)
{
СтильШрифта стиль = СтильШрифта.ОБЫЧНЫЙ;
if(шл.шл.lfWeight >= FW_BOLD)
стиль |= СтильШрифта.ПОЛУЖИРНЫЙ;
if(шл.шл.lfItalic)
стиль |= СтильШрифта.КУРСИВ;
if(шл.шл.lfUnderline)
стиль |= СтильШрифта.ПОДЧЁРКНУТЫЙ;
if(шл.шл.lfStrikeOut)
стиль |= СтильШрифта.ЗАЧЁРКНУТЫЙ;
return стиль;
}
package проц _info(LOGFONTA* шл) // deprecated
{
if(GetObjectA(hf, LOGFONTA.sizeof, шл) != LOGFONTA.sizeof)
throw new ВизИскл("Unable to get шрифт информация");
}
package проц _info(LOGFONTW* шл) // deprecated
{
auto proc = cast(GetObjectWProc)GetProcAddress(GetModuleHandleA("gdi32.dll"), "GetObjectW");
if(!proc || proc(hf, LOGFONTW.sizeof, шл) != LOGFONTW.sizeof)
throw new ВизИскл("Unable to get шрифт информация");
}
package проц _info(inout ШрифтЛога шл)
{
if(!viz.x.utf.getLogFont(hf, шл))
throw new ВизИскл("Unable to get шрифт информация");
}
package static LONG getLfHeight(float emSize, ЕдиницаГрафики unit)
{
LONG результат;
HDC hdc;
switch(unit)
{
case ЕдиницаГрафики.ПИКСЕЛЬ:
результат = cast(LONG)emSize;
break;
case ЕдиницаГрафики.POINT:
hdc = GetWindowDC(пусто);
результат = MulDiv(cast(цел)(emSize * 100), GetDeviceCaps(hdc, LOGPIXELSY), 72 * 100);
ReleaseDC(пусто, hdc);
break;
case ЕдиницаГрафики.ДИСПЛЕЙ:
hdc = GetWindowDC(пусто);
результат = MulDiv(cast(цел)(emSize * 100), GetDeviceCaps(hdc, LOGPIXELSY), 75 * 100);
ReleaseDC(пусто, hdc);
break;
case ЕдиницаГрафики.МИЛЛИМЕТР:
hdc = GetWindowDC(пусто);
результат = MulDiv(cast(цел)(emSize * 100), GetDeviceCaps(hdc, LOGPIXELSY), 2540);
ReleaseDC(пусто, hdc);
break;
case ЕдиницаГрафики.ДЮЙМ:
hdc = GetWindowDC(пусто);
результат = cast(LONG)(emSize * cast(float)GetDeviceCaps(hdc, LOGPIXELSY));
ReleaseDC(пусто, hdc);
break;
case ЕдиницаГрафики.ДОКУМЕНТ:
hdc = GetWindowDC(пусто);
результат = MulDiv(cast(цел)(emSize * 100), GetDeviceCaps(hdc, LOGPIXELSY), 300 * 100);
ReleaseDC(пусто, hdc);
break;
case ЕдиницаГрафики.TWIP:
hdc = GetWindowDC(пусто);
результат = MulDiv(cast(цел)(emSize * 100), GetDeviceCaps(hdc, LOGPIXELSY), 1440 * 100);
ReleaseDC(пусто, hdc);
break;
}
return результат;
}
package static float getEmSize(HDC hdc, LONG lfHeight, ЕдиницаГрафики toUnit)
{
float результат;
if(lfHeight < 0)
lfHeight = -lfHeight;
switch(toUnit)
{
case ЕдиницаГрафики.ПИКСЕЛЬ:
результат = cast(float)lfHeight;
break;
case ЕдиницаГрафики.POINT:
результат = cast(float)MulDiv(lfHeight, 72, GetDeviceCaps(hdc, LOGPIXELSY));
break;
case ЕдиницаГрафики.МИЛЛИМЕТР:
результат = cast(float)MulDiv(lfHeight, 254, GetDeviceCaps(hdc, LOGPIXELSY)) / 10.0;
break;
case ЕдиницаГрафики.ДЮЙМ:
результат = cast(float)lfHeight / cast(float)GetDeviceCaps(hdc, LOGPIXELSY);
break;
case ЕдиницаГрафики.ДОКУМЕНТ:
результат = cast(float)MulDiv(lfHeight, 300, GetDeviceCaps(hdc, LOGPIXELSY));
break;
case ЕдиницаГрафики.TWIP:
результат = cast(float)MulDiv(lfHeight, 1440, GetDeviceCaps(hdc, LOGPIXELSY));
break;
}
return результат;
}
package static float getEmSize(LONG lfHeight, ЕдиницаГрафики toUnit)
{
if(ЕдиницаГрафики.ПИКСЕЛЬ == toUnit)
{
if(lfHeight < 0)
return cast(float)-lfHeight;
return cast(float)lfHeight;
}
HDC hdc;
hdc = GetWindowDC(пусто);
float результат = getEmSize(hdc, lfHeight, toUnit);
ReleaseDC(пусто, hdc);
return результат;
}
this(Шрифт шрифт, СтильШрифта стиль)
{
ШрифтЛога шл;
_unit = шрифт._unit;
шрифт._info(шл);
_style(шл, стиль);
this(_create(шл));
_fstyle = стиль;
_initLf(шрифт, шл);
}
this(Ткст имя, float emSize, ЕдиницаГрафики unit)
{
this(имя, emSize, СтильШрифта.ОБЫЧНЫЙ, unit);
}
this(Ткст имя, float emSize, СтильШрифта стиль = СтильШрифта.ОБЫЧНЫЙ,
ЕдиницаГрафики unit = ЕдиницаГрафики.POINT)
{
this(имя, emSize, стиль, unit, DEFAULT_CHARSET, СглаживаниеШрифта.ПО_УМОЛЧАНИЮ);
}
this(Ткст имя, float emSize, СтильШрифта стиль,
ЕдиницаГрафики unit, СглаживаниеШрифта smoothing)
{
this(имя, emSize, стиль, unit, DEFAULT_CHARSET, smoothing);
}
//
// This is а somewhat internal function.
// -гарнитураГди- is one of *_CHARSET from wingdi.h
this(Ткст имя, float emSize, СтильШрифта стиль,
ЕдиницаГрафики unit, ббайт гарнитураГди,
СглаживаниеШрифта smoothing = СглаживаниеШрифта.ПО_УМОЛЧАНИЮ)
{
ШрифтЛога шл;
_unit = unit;
шл.имяФаса = имя;
шл.шл.lfHeight = -getLfHeight(emSize, unit);
_style(шл, стиль);
шл.шл.lfCharSet = гарнитураГди;
шл.шл.lfOutPrecision = OUT_DEFAULT_PRECIS;
шл.шл.lfClipPrecision = CLIP_DEFAULT_PRECIS;
//шл.шл.lfQuality = DEFAULT_QUALITY;
шл.шл.lfQuality = smoothing;
шл.шл.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
this(_create(шл));
_fstyle = стиль;
_initLf(шл);
}
~this()
{
if(owned)
DeleteObject(hf);
}
final HFONT указатель() // getter
{
return hf;
}
final ЕдиницаГрафики unit() // getter
{
return _unit;
}
final float размер() // getter
{
/+
LOGFONTA шл;
_info(&шл);
return getEmSize(шл.шл.lfHeight, _unit);
+/
return getEmSize(this.lfHeight, _unit);
}
final float дайРазмер(ЕдиницаГрафики unit)
{
/+
LOGFONTA шл;
_info(&шл);
return getEmSize(шл.шл.lfHeight, unit);
+/
return getEmSize(this.lfHeight, unit);
}
final float дайРазмер(ЕдиницаГрафики unit, Графика з)
{
return getEmSize(з.указатель, this.lfHeight, unit);
}
final СтильШрифта стиль() // getter
{
return _fstyle;
}
final Ткст имя() // getter
{
return lfName;
}
final ббайт гарнитураГди() // getter
{
return lfCharSet;
}
/+
private проц _initLf(LOGFONTA* шл)
{
this.lfHeight = шл.lfHeight;
this.lfName = вТкст(шл.lfFaceName.ptr).dup;
this.lfCharSet = шл.lfCharSet;
}
+/
private проц _initLf(inout ШрифтЛога шл)
{
this.lfHeight = шл.шл.lfHeight;
this.lfName = шл.имяФаса;
this.lfCharSet = шл.шл.lfCharSet;
}
/+
private проц _initLf(Шрифт otherfont, LOGFONTA* шл)
{
this.lfHeight = otherfont.lfHeight;
this.lfName = otherfont.lfName;
this.lfCharSet = otherfont.lfCharSet;
}
+/
private проц _initLf(Шрифт otherfont, inout ШрифтЛога шл)
{
this.lfHeight = otherfont.lfHeight;
this.lfName = otherfont.lfName;
this.lfCharSet = otherfont.lfCharSet;
}
private:
HFONT hf;
ЕдиницаГрафики _unit;
бул owned = да;
СтильШрифта _fstyle;
LONG lfHeight;
Ткст lfName;
ббайт lfCharSet;
}
enum ПСтильПера: UINT
{
Сплошной = PS_SOLID, Штрих = PS_DASH,
Пунктир = PS_DOT,
ШтрихПунктир = PS_DASHDOT,
ШтрихПунктирПунктир = PS_DASHDOTDOT,
Никакой = PS_NULL,
ВРамке = PS_INSIDEFRAME,
}
// If the pen ширина is greater than 1 the стиль cannot have dashes or dots.
class Перо // docmain
{
// Used internally.
this(ПЕРО hp, бул owned = да)
{
this.hp = hp;
this.owned = owned;
}
this(Цвет цвет, цел ширина = 1, ПСтильПера ps = ПСтильПера.Сплошной)
{
hp = CreatePen(ps, ширина, цвет.вКзс());
}
~this()
{
if(owned)
DeleteObject(hp);
}
final ПЕРО указатель() // getter
{
return hp;
}
private:
ПЕРО hp;
бул owned = да;
}
class Кисть // docmain
{
// Used internally.
this(HBRUSH hb, бул owned = да)
{
this.hb = hb;
this.owned = owned;
}
protected this()
{
}
~this()
{
if(owned)
DeleteObject(hb);
}
final HBRUSH указатель() // getter
{
return hb;
}
private:
HBRUSH hb;
бул owned = да;
}
class ПлотнаяКисть: Кисть // docmain
{
this(Цвет ктрл)
{
super(CreateSolidBrush(ктрл.вКзс()));
}
/+
final проц цвет(Цвет ктрл) // setter
{
// delete..
super.hb = CreateSolidBrush(ктрл.вКзс());
}
+/
final Цвет цвет() // getter
{
Цвет результат;
LOGBRUSH lb;
if(GetObjectA(hb, lb.sizeof, &lb))
{
результат = Цвет.изКзс(lb.lbColor);
}
return результат;
}
}
// PatternBrush has the win9x/ME limitation of not supporting images larger than 8x8 pixels.
// TextureBrush supports any размер images but requires GDI+.
/+
class PatternBrush: Кисть
{
//CreatePatternBrush() ...
}
+/
/+
class TextureBrush: Кисть
{
// GDI+ ...
}
+/
enum HatchStyle: LONG
{
ГОРИЗ = HS_HORIZONTAL, ВЕРТ = HS_VERTICAL,
FORWARD_DIAGONAL = HS_FDIAGONAL,
BACKWARD_DIAGONAL = HS_BDIAGONAL,
CROSS = HS_CROSS,
DIAGONAL_CROSS = HS_DIAGCROSS,
}
class HatchBrush: Кисть // docmain
{
this(HatchStyle hs, Цвет ктрл)
{
super(CreateHatchBrush(hs, ктрл.вКзс()));
}
final Цвет foregroundColor() // getter
{
Цвет результат;
LOGBRUSH lb;
if(GetObjectA(hb, lb.sizeof, &lb))
{
результат = Цвет.изКзс(lb.lbColor);
}
return результат;
}
final HatchStyle hatchStyle() // getter
{
HatchStyle результат;
LOGBRUSH lb;
if(GetObjectA(hb, lb.sizeof, &lb))
{
результат = cast(HatchStyle)lb.lbHatch;
}
return результат;
}
}
class Регион // docmain
{
// Used internally.
this(HRGN hrgn, бул owned = да)
{
this.hrgn = hrgn;
this.owned = owned;
}
~this()
{
if(owned)
DeleteObject(hrgn);
}
final HRGN указатель() // getter
{
return hrgn;
}
override т_рав opEquals(Объект o)
{
Регион rgn = cast(Регион)o;
if(!rgn)
return 0; // Not equal.
return opEquals(rgn);
}
т_рав opEquals(Регион rgn)
{
return hrgn == rgn.hrgn;
}
private:
HRGN hrgn;
бул owned = да;
}
|
D
|
@property bool isFunctionType() {
with (CXTypeKind)
return kind == CXType_FunctionNoProto || kind == CXType_FunctionProto
||
func.resultType.isValid;
}
@property bool isFunctionPointerType() {
with (CXTypeKind)
return kind == CXType_Pointer && pointeeType.isFunctionType;
}
|
D
|
/**
Copyright: Copyright (c) 2017-2018 Andrey Penechko.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Andrey Penechko.
*/
module voxelman.container.gapbuffer;
import std.algorithm : max, equal;
import std.math : abs;
import std.stdio;
import std.experimental.allocator.gc_allocator;
alias allocator = GCAllocator.instance;
import voxelman.math : nextPOT;
import voxelman.container.chunkedrange;
struct GapBuffer(T)
{
private T* buffer;
size_t length;
alias opDollar = length;
private size_t gapLength;
private size_t gapStart;
private size_t secondChunkLength() const { return length - gapStart; }
private size_t secondChunkStart() { return gapStart + gapLength; }
private size_t capacity() { return gapLength + length; }
private alias gapEnd = secondChunkStart;
void putAt(size_t index, const T[] items ...)
{
reserve(items.length);
moveGapTo(index);
assert(index+items.length <= capacity);
buffer[index..index+items.length] = items;
length += items.length;
gapStart += items.length;
gapLength -= items.length;
//printStructure();
}
void put(const T[] items ...) { putAt(length, items); }
alias putBack = put;
void putFront(const T[] items ...) { putAt(0, items); }
void remove(size_t from, size_t itemsToRemove)
{
assert(from + itemsToRemove <= capacity);
moveGapTo(from);
length -= itemsToRemove;
gapLength += itemsToRemove;
}
void removeFront(size_t itemsToRemove = 1) { remove(0, itemsToRemove); }
void removeBack(size_t itemsToRemove = 1) { remove(length-itemsToRemove, itemsToRemove); }
void reserve(size_t items)
{
assert(cast(ptrdiff_t)(length - gapStart) >= 0); // invariant
if (gapLength < items)
{
import core.memory;
GC.removeRange(buffer);
size_t newCapacity = nextPOT(capacity + items);
void[] tmp = buffer[0..capacity];
allocator.reallocate(tmp, newCapacity*T.sizeof);
buffer = cast(T*)tmp.ptr;
moveItems(secondChunkStart, newCapacity-secondChunkLength, secondChunkLength);
gapLength = newCapacity - length;
GC.addRange(buffer, capacity * T.sizeof, typeid(T));
}
}
void clear() nothrow
{
gapLength = capacity;
length = 0;
gapStart = 0;
}
ref T front() { return this[0]; }
ref T back() { return this[$-1]; }
ref T opIndex(size_t at)
{
assert(at < length);
immutable size_t index = at < gapStart ? at : at + gapLength;
return buffer[index];
}
auto opSlice()
{
return GapBufferSlice!T(&this, 0, length);
}
auto opSlice(size_t from, size_t to)
{
return this[][from..to];
}
T[] getContinuousSlice(size_t from, size_t to)
{
moveGapTo(to);
return buffer[from..to];
}
private void moveItems(size_t from, size_t to, size_t length)
{
//writefln(" moveItems %s -> %s %s", from, to, length);
if ( (to == from) || (length == 0) ) return;
if (from > to)
{
while(length > 0)
{
buffer[to++] = buffer[from++];
--length;
}
}
else
{
from += length;
to += length;
while(length > 0)
{
buffer[--to] = buffer[--from];
--length;
}
}
}
private void moveGapTo(size_t newGapPos)
{
//writefln("moveGapTo %s -> %s %s", gapStart, newGapPos, gapLength);
//printStructure();
if (newGapPos < gapStart)
{
immutable size_t itemsToMove = gapStart - newGapPos;
moveItems(newGapPos, gapEnd - itemsToMove, itemsToMove);
gapStart = newGapPos;
}
else if (newGapPos > gapStart)
{
immutable size_t itemsToMove = newGapPos - gapStart;
moveItems(secondChunkStart, gapStart, itemsToMove);
gapStart = newGapPos;
}
//printStructure();
}
private void printStructure()
{
writefln(" >%s|%s|%s", gapStart, gapLength, secondChunkLength);
writefln(" >%(%s, %) | %(%s, %) | %(%s, %)", buffer[0..gapStart], buffer[gapStart..gapEnd], buffer[gapEnd..capacity]);
}
int opApply(scope int delegate(ref T) dg)
{
int result = 0;
foreach(ref v; buffer[0..gapStart])
if (dg(v)) break;
foreach(ref v; buffer[gapEnd..capacity])
if (dg(v)) break;
return result;
}
int opApply(scope int delegate(size_t, ref T) dg)
{
int result = 0;
size_t index;
foreach(ref v; buffer[0..gapStart])
if (dg(index++, v)) break;
foreach(ref v; buffer[gapEnd..capacity])
if (dg(index++, v)) break;
return result;
}
}
struct GapBufferSlice(T)
{
private GapBuffer!T* buf;
size_t start;
size_t length;
alias opDollar = length;
bool empty() { return length == 0; }
ref T front() { return (*buf)[start]; }
ref T back() { return (*buf)[start+length-1]; }
void popFront() { ++start; --length; }
void popBack() { --length; }
auto save() { return this; }
ref T opIndex(size_t at) { return (*buf)[start + at]; }
auto opSlice(size_t from, size_t to)
{
assert(from <= length, "From must be less than length");
assert(to <= length);
assert(from <= to);
immutable size_t len = to - from;
return GapBufferSlice(buf, start+from, len);
}
ChunkedRange!T toChunkedRange()
{
size_t end = start + length;
if (start < buf.gapStart)
{
if (end >= buf.gapStart)
{
// slice contains the gap
T[] first = buf.buffer[start..buf.gapStart];
T* secondPtr = &buf.buffer[buf.gapEnd];
size_t secondLength = length - (buf.gapStart-start);
return ChunkedRange!T(first, secondLength, secondPtr, null, &GapBufferSlice_popFront!T);
}
else
{
// slice if before gap
T[] first = buf.buffer[start..end];
return ChunkedRange!T(first, 0, null, null, &GapBufferSlice_popFront!T);
}
}
else
{
// slice if after gap
size_t from = start + buf.gapLength;
size_t to = from + length;
T[] first = buf.buffer[from..to];
return ChunkedRange!T(first, 0, null, null, &GapBufferSlice_popFront!T);
}
}
}
private static void GapBufferSlice_popFront(T)(
ref T[] front,
ref size_t secondLength,
ref void* secondPtr,
ref void* unused)
{
front = (cast(T*)secondPtr)[0..secondLength];
secondPtr = null;
secondLength = 0;
}
unittest
{
GapBuffer!char buf;
buf.put("ab");
buf.remove(1, 1);
assert(buf[].equal("a"));
assert(buf.length == 1);
}
unittest
{
GapBuffer!int buf;
assert(buf.length == 0);
assert(buf.gapStart == 0);
assert(buf.secondChunkLength == 0);
buf.put(1, 2, 3, 4);
assert(buf.length == 4);
assert(buf[].equal([1, 2, 3, 4]));
buf.putAt(2, 7, 8);
assert(buf.length == 6);
assert(buf[].equal([1, 2, 7, 8, 3, 4]));
buf.remove(2, 2);
assert(buf.length == 4);
assert(buf[].equal([1, 2, 3, 4]));
buf.remove(0, 4);
assert(buf.length == 0);
assert(buf[].equal((int[]).init));
}
unittest
{
GapBuffer!int buf;
buf.putFront(1, 2, 3, 4);
//writefln("%s\n", buf[]);
buf.putFront(1, 2, 3, 4);
//writefln("%s\n", buf[]);
buf.putFront(1, 2, 3, 4);
//writefln("%s\n", buf[]);
buf.putFront(1, 2, 3, 4);
//writefln("%s\n", buf[]);
assert(buf[].equal([
1, 2, 3, 4,
1, 2, 3, 4,
1, 2, 3, 4,
1, 2, 3, 4,
]));
buf.clear;
assert(buf.length == 0);
}
|
D
|
// float
module std.typeinfo.ti_float;
private import std.math;
class TypeInfo_f : TypeInfo
{
char[] toString() { return "float"; }
hash_t getHash(void *p)
{
return *cast(uint *)p;
}
static int _equals(float f1, float f2)
{
return f1 == f2 ||
(isnan(f1) && isnan(f2));
}
static int _compare(float d1, float d2)
{
if (d1 !<>= d2) // if either are NaN
{
if (isnan(d1))
{ if (isnan(d2))
return 0;
return -1;
}
return 1;
}
return (d1 == d2) ? 0 : ((d1 < d2) ? -1 : 1);
}
int equals(void *p1, void *p2)
{
return _equals(*cast(float *)p1, *cast(float *)p2);
}
int compare(void *p1, void *p2)
{
return _compare(*cast(float *)p1, *cast(float *)p2);
}
size_t tsize()
{
return float.sizeof;
}
void swap(void *p1, void *p2)
{
float t;
t = *cast(float *)p1;
*cast(float *)p1 = *cast(float *)p2;
*cast(float *)p2 = t;
}
void[] init()
{ static float r;
return (cast(float *)&r)[0 .. 1];
}
}
|
D
|
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.numeric;
import std.stdio;
import std.string;
void main()
{
string s = readln.chomp;
string t = readln.chomp;
for (long diff = 0; diff < s.length; ++diff)
{
char[] n;
n.length = s.length;
for (long i = 0; i < s.length; ++i)
{
long d = i + diff;
if (s.length <= d)
{
d %= s.length;
}
n[i] = s[d];
}
if (n == t)
{
writeln("Yes");
return;
}
}
writeln("No");
}
|
D
|
import std.random;
import colors;
struct Coordinate {
int x;
int y;
}
enum Direction : Coordinate {
DOWN = Coordinate(0, 1),
UP = Coordinate(0, -1),
LEFT = Coordinate(-1, 0),
RIGHT = Coordinate(1, 0),
NONE = Coordinate(0, 0)
}
class Snake {
private int x_max;
private int y_max;
private Coordinate[] parts;
public Direction direction;
this(int x_max, int y_max, Coordinate start, Direction dir) {
this.x_max = x_max;
this.y_max = y_max;
parts ~= start;
direction = dir;
}
void changeDir(Direction dir) {
if (dir != Direction.NONE) {
direction = dir;
}
}
void move(bool grow) {
Coordinate moveTo = Coordinate(parts[0].x + direction.x, parts[0].y + direction.y);
if (!grow) {
parts = parts[0 .. $-1];
}
parts = moveTo ~ parts;
}
bool checkGameOver() {
bool gameOver = false;
// Out of bounds
if (getHead().x > x_max || getHead.x < 0) {
gameOver = true;
} else if (getHead().y > y_max || getHead.y < 0) {
gameOver = true;
} else {
// Collision with self
foreach (i, firstPart; getParts()) {
foreach (j, secondPart; getParts()) {
if (i != j && firstPart == secondPart) {
gameOver = true;
}
}
}
}
return gameOver;
}
Coordinate getHead() {
return parts[0];
}
Coordinate[] getParts() {
return parts;
}
}
class Fruit {
private int x_max;
private int y_max;
public Coordinate location;
this(int x_max, int y_max) {
this.x_max = x_max;
this.y_max = y_max;
respawn();
}
void respawn() {
auto rnd = Random(unpredictableSeed);
int x = uniform(0, x_max - 1, rnd);
int y = uniform(0, y_max - 1, rnd);
location = Coordinate(x, y);
}
}
|
D
|
/*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* 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 compoundShapes;
import demo;
// TODO_ERIN test joints on compounds.
class CompoundShapes : Demo
{
BodyDef bd;
Body rBody;
ShapeDef sd;
this() {
bVec2 gravity = bVec2(0.0f, -9.81f);
super(gravity);
init();
}
void init() {
{
bVec2 position = bVec2(0.0f, -10.0f);
float angle = 0.0f;
bd = new BodyDef(position, angle);
rBody = world.createBody(bd);
sd = new PolyDef();
sd.setAsBox(50.0f, 10.0f);
rBody.createShape(sd);
}
{
float radius = 0.5f;
float density = 2.0f;
auto sd1 = new CircleDef(density, radius);
sd1.localPosition.set(-0.5f, 0.5f);
density = 0.0f;
auto sd2 = new CircleDef(density, radius);
sd2.localPosition.set(0.5f, 0.5f);
for (int i = 0; i < 10; ++i)
{
float x = randomRange(-0.1f, 0.1f);
bVec2 position = bVec2(x + 5.0f, 1.05f + 2.5f * i);
float angle = randomRange(-PI, PI);
bd = new BodyDef(position, angle);
rBody = world.createBody(bd);
rBody.createShape(sd1);
rBody.createShape(sd2);
rBody.setMassFromShapes();
}
}
{
auto sd1 = new PolyDef();
sd1.setAsBox(0.25f, 0.5f);
sd1.density = 2.0f;
auto sd2 = new PolyDef();
sd2.setAsBox(0.25f, 0.5f, bVec2(0.0f, -0.5f), 0.5f * PI);
sd2.density = 2.0f;
for (int i = 0; i < 10; ++i)
{
float x = randomRange(-0.1f, 0.1f);
bVec2 position = bVec2(x - 5.0f, 1.05f + 2.5f * i);
float angle = randomRange(-PI, PI);
bd = new BodyDef(position, angle);
rBody = world.createBody(bd);
rBody.createShape(sd1);
rBody.createShape(sd2);
rBody.setMassFromShapes();
}
}
{
bXForm xf1;
xf1.R.set(0.3524f * PI);
xf1.position = bMul(xf1.R, bVec2(1.0f, 0.0f));
auto sd1 = new PolyDef();
sd1.vertices.length = 3;
sd1.vertices[0] = bMul(xf1, bVec2(-1.0f, 0.0f));
sd1.vertices[1] = bMul(xf1, bVec2(1.0f, 0.0f));
sd1.vertices[2] = bMul(xf1, bVec2(0.0f, 0.5f));
sd1.density = 2.0f;
bXForm xf2;
xf2.R.set(-0.3524f * PI);
xf2.position = bMul(xf2.R, bVec2(-1.0f, 0.0f));
auto sd2 = new PolyDef();
sd2.vertices.length = 3;
sd2.vertices[0] = bMul(xf2, bVec2(-1.0f, 0.0f));
sd2.vertices[1] = bMul(xf2, bVec2(1.0f, 0.0f));
sd2.vertices[2] = bMul(xf2, bVec2(0.0f, 0.5f));
sd2.density = 2.0f;
for (int i = 0; i < 10; ++i)
{
float x = randomRange(-0.1f, 0.1f);
bVec2 position = bVec2(x, 5.05f + 2.5f * i);
float angle = 0.0f;
bd = new BodyDef(position, angle);
rBody = world.createBody(bd);
rBody.createShape(sd1);
rBody.createShape(sd2);
rBody.setMassFromShapes();
}
}
{
auto sd_bottom = new PolyDef();
sd_bottom.setAsBox( 1.5f, 0.15f );
sd_bottom.density = 4.0f;
auto sd_left = new PolyDef();
sd_left.setAsBox(0.15f, 2.7f, bVec2(-1.45f, 2.35f), 0.2f);
sd_left.density = 4.0f;
auto sd_right = new PolyDef();;
sd_right.setAsBox(0.15f, 2.7f, bVec2(1.45f, 2.35f), -0.2f);
sd_right.density = 4.0f;
bVec2 position = bVec2( 0.0f, 2.0f );
float angle = 0.0f;
bd = new BodyDef(position, angle);
rBody = world.createBody(bd);
rBody.createShape(sd_bottom);
rBody.createShape(sd_left);
rBody.createShape(sd_right);
rBody.setMassFromShapes();
}
}
void update() {}
}
|
D
|
instance DIA_Addon_Emilio_EXIT(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 999;
condition = DIA_Addon_Emilio_EXIT_Condition;
information = DIA_Addon_Emilio_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Addon_Emilio_EXIT_Condition()
{
return TRUE;
};
func void DIA_Addon_Emilio_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Addon_Emilio_PICKPOCKET(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 900;
condition = DIA_Addon_Emilio_PICKPOCKET_Condition;
information = DIA_Addon_Emilio_PICKPOCKET_Info;
permanent = TRUE;
description = PICKPOCKET_COMM;
};
func int DIA_Addon_Emilio_PICKPOCKET_Condition()
{
return C_Beklauen(76,112);
};
func void DIA_Addon_Emilio_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Addon_Emilio_PICKPOCKET);
Info_AddChoice(DIA_Addon_Emilio_PICKPOCKET,Dialog_Back,DIA_Addon_Emilio_PICKPOCKET_BACK);
Info_AddChoice(DIA_Addon_Emilio_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Addon_Emilio_PICKPOCKET_DoIt);
};
func void DIA_Addon_Emilio_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Addon_Emilio_PICKPOCKET);
};
func void DIA_Addon_Emilio_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Addon_Emilio_PICKPOCKET);
};
instance DIA_Addon_BDT_10015_Emilio_Hi(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 1;
condition = DIA_Addon_Emilio_Hi_Condition;
information = DIA_Addon_Emilio_Hi_Info;
permanent = FALSE;
description = "Ты выглядишь, как рудокоп.";
};
func int DIA_Addon_Emilio_Hi_Condition()
{
return TRUE;
};
func void DIA_Addon_Emilio_Hi_Info()
{
AI_Output(other,self,"DIA_Addon_BDT_10015_Emilio_Hi_15_00"); //Ты выглядишь, как рудокоп.
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Hi_10_01"); //Я и есть рудокоп. Последний раз, когда я был в шахте, я устал как собака.
if(SC_KnowsRavensGoldmine == FALSE)
{
B_LogEntry(TOPIC_Addon_RavenKDW,LogText_Addon_RavensGoldmine);
B_LogEntry(TOPIC_Addon_Sklaven,LogText_Addon_RavensGoldmine);
B_LogEntry(TOPIC_Addon_ScoutBandits,Log_Text_Addon_ScoutBandits);
};
SC_KnowsRavensGoldmine = TRUE;
};
instance DIA_Addon_BDT_10015_Emilio_Gold(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 2;
condition = DIA_Addon_Emilio_Gold_Condition;
information = DIA_Addon_Emilio_Gold_Info;
permanent = FALSE;
description = "Куда девается золото, которое вы добываете?";
};
func int DIA_Addon_Emilio_Gold_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_BDT_10015_Emilio_Hi))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_Gold_Info()
{
AI_Output(other,self,"DIA_Addon_BDT_10015_Emilio_Gold_15_00"); //Куда девается золото, которое вы добываете?
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Gold_10_01"); //Торус собирает его и распределяет. Никому не разрешается забирать себе то, что он нашел.
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Gold_10_02"); //Каждый получает свою долю - таким образом, не обделены даже стражники и охотники.
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Gold_10_03"); //Мне кажется, это хорошая система. С тех пор как ввели это правило, количество смертей уменьшилось, а рудокопы все равно получают больше, чем те, кто не работает в шахте.
};
instance DIA_Addon_BDT_10015_Emilio_Stein(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 3;
condition = DIA_Addon_Emilio_Stein_Condition;
information = DIA_Addon_Emilio_Stein_Info;
permanent = FALSE;
description = "Что это за система с красными камнями?";
};
func int DIA_Addon_Emilio_Stein_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Emilio_Jetzt))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_Stein_Info()
{
AI_Output(other,self,"DIA_Addon_BDT_10015_Emilio_Stein_15_00"); //Что это за система с красными камнями?
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Stein_10_01"); //Это придумали Торус и Эстебан.
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Stein_10_02"); //Торус заботится о распределении золота, а Эстебан организует работников для шахты.
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Stein_10_03"); //Конечно, он не хочет бегать к Торусу каждый раз, когда кто-то идет в шахту.
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Stein_10_04"); //Поэтому он и дает работникам одну из таких красных каменных плиток, и Торус тогда точно знает, кого пускать. Это как пропуск.
};
var int Emilio_Switch;
instance DIA_Addon_Emilio_Attentat(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 4;
condition = DIA_Addon_Emilio_Attentat_Condition;
information = DIA_Addon_Emilio_Attentat_Info;
permanent = TRUE;
description = "Что тебе известно о нападении?";
};
func int DIA_Addon_Emilio_Attentat_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Emilio_VonEmilio) && Npc_IsDead(Senyan))
{
return FALSE;
}
else if(MIS_Judas == LOG_Running)
{
return TRUE;
}
else
{
return FALSE;
};
return FALSE;
};
func void DIA_Addon_Emilio_Attentat_Info()
{
AI_Output(other,self,"DIA_Addon_Emilio_Attentat_15_00"); //Что тебе известно о нападении?
if(Emilio_Switch == 0)
{
AI_Output(self,other,"DIA_Addon_Emilio_Attentat_10_01"); //(испуганно) Эй, приятель, я не хочу ничего об этом знать!
Emilio_Switch = 1;
}
else
{
AI_Output(self,other,"DIA_Addon_Emilio_Attentat_10_02"); //(испуганно) ВООБЩЕ НИЧЕГО!
Emilio_Switch = 0;
};
};
instance DIA_Addon_BDT_10015_Emilio_Senyan(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 1;
condition = DIA_Addon_Emilio_Senyan_Condition;
information = DIA_Addon_Emilio_Senyan_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Addon_Emilio_Senyan_Condition()
{
if(Npc_IsDead(Senyan))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_Senyan_Info()
{
if(Senyan_Called == TRUE)
{
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Senyan_10_00"); //(пытливо) Скажи мне, ПОЧЕМУ Сеньян закричал: 'Посмотрите, кто пришел'?
AI_Output(other,self,"DIA_Addon_BDT_10015_Emilio_Senyan_15_01"); //(сухо) Невыплаченные долги.
}
else
{
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Senyan_10_02"); //Ты убил Сеньяна!
};
AI_Output(other,self,"DIA_Addon_BDT_10015_Emilio_Senyan_15_03"); //А что? Какие-то проблемы?
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Senyan_10_04"); //(быстро) Нет, приятель, у меня к тебе по этому поводу никаких претензий.
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Senyan_10_05"); //Даже наоборот. (фальшиво) Этот ублюдок работал на Эстебана.
Senyan_CONTRA = LOG_SUCCESS;
B_LogEntry(Topic_Addon_Esteban,"Эмилио не на стороне Эстебана.");
};
instance DIA_Addon_Emilio_Jetzt(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 5;
condition = DIA_Addon_Emilio_Jetzt_Condition;
information = DIA_Addon_Emilio_Jetzt_Info;
permanent = FALSE;
description = "Почему ты сейчас не в шахте?";
};
func int DIA_Addon_Emilio_Jetzt_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_BDT_10015_Emilio_Hi))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_Jetzt_Info()
{
AI_Output(other,self,"DIA_Addon_Emilio_Jetzt_15_00"); //Почему ты сейчас не в шахте?
AI_Output(self,other,"DIA_Addon_Emilio_Jetzt_10_01"); //(слегка неуверенно) Я был там достаточно долго и вкалывал, пока не стал валиться с ног от усталости. Теперь мне надо отдохнуть несколько дней.
AI_Output(self,other,"DIA_Addon_Emilio_Jetzt_10_02"); //(вздыхая) Прежде чем я получу следующий красный камень.
};
instance DIA_Addon_Emilio_VonEmilio(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 6;
condition = DIA_Addon_Emilio_VonEmilio_Condition;
information = DIA_Addon_Emilio_VonEmilio_Info;
permanent = FALSE;
description = "Леннар рассказывал мне о тебе...";
};
func int DIA_Addon_Emilio_VonEmilio_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Emilio_Jetzt) && Npc_KnowsInfo(other,DIA_Addon_Lennar_Attentat))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_VonEmilio_Info()
{
AI_Output(other,self,"DIA_Addon_Emilio_VonEmilio_15_00"); //Леннар рассказывал мне о тебе...
AI_Output(self,other,"DIA_Addon_Emilio_VonEmilio_10_01"); //Леннар? Этот парень - идиот. Ты, наверное, заметил.
AI_Output(other,self,"DIA_Addon_Emilio_VonEmilio_15_02"); //Он сказал, что ты не был в шахте с тех пор, как произошло нападение.
AI_Output(self,other,"DIA_Addon_Emilio_VonEmilio_10_03"); //(испуганно) Я... ничего не знаю!
if(!Npc_IsDead(Senyan))
{
AI_Output(self,other,"DIA_Addon_Emilio_VonEmilio_10_04"); //Ты работаешь вместе с Сеньяном!
AI_Output(self,other,"DIA_Addon_Emilio_VonEmilio_10_05"); //И вы оба в сговоре с Эстебаном! Я в точности слышал, о чем вы там болтали!
AI_Output(self,other,"DIA_Addon_Emilio_VonEmilio_10_06"); //Пока что Эстебан ничем не помог нам. Почему я должен верить его людям?
AI_Output(self,other,"DIA_Addon_Emilio_VonEmilio_10_07"); //Оставь меня в покое!
AI_StopProcessInfos(self);
};
B_LogEntry(Topic_Addon_Esteban,"Эмилио думает, что Леннар - идиот.");
};
instance DIA_Addon_Emilio_HilfMir(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 7;
condition = DIA_Addon_Emilio_HilfMir_Condition;
information = DIA_Addon_Emilio_HilfMir_Info;
permanent = FALSE;
description = "Помоги мне выяснить, кто организовал нападение!";
};
func int DIA_Addon_Emilio_HilfMir_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Emilio_VonEmilio) && Npc_IsDead(Senyan))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_HilfMir_Info()
{
AI_Output(other,self,"DIA_Addon_Emilio_HilfMir_15_00"); //Помоги мне выяснить, кто организовал нападение!
AI_Output(self,other,"DIA_Addon_Emilio_HilfMir_10_01"); //Нет! Я не хочу в это ввязываться!
AI_Output(other,self,"DIA_Addon_Emilio_HilfMir_15_02"); //Если даже такой идиот, как Леннар, заметил, что ты ведешь себя странно, вряд ли пройдет много времени, прежде чем это заметит Эстебан.
AI_Output(self,other,"DIA_Addon_Emilio_HilfMir_10_03"); //(неловко) Я... черт! Я скажу тебе одно имя. И больше ничего.
AI_Output(other,self,"DIA_Addon_Emilio_HilfMir_15_04"); //Слушаю.
AI_Output(self,other,"DIA_Addon_Emilio_HilfMir_10_05"); //Хуно... поговори с Хуно. Он должен что-то знать об этом деле.
Emilio_TellAll = TRUE;
B_LogEntry(Topic_Addon_Esteban,"Эмилио наконец назвал имя: Хуно.");
};
instance DIA_Addon_Emilio_GegenEsteban(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 8;
condition = DIA_Addon_Emilio_GegenEsteban_Condition;
information = DIA_Addon_Emilio_GegenEsteban_Info;
permanent = FALSE;
description = "Что ты имеешь против Эстебана?";
};
func int DIA_Addon_Emilio_GegenEsteban_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_BDT_10015_Emilio_Senyan))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_GegenEsteban_Info()
{
AI_Output(other,self,"DIA_Addon_Emilio_GegenEsteban_15_00"); //Что ты имеешь против Эстебана?
AI_Output(self,other,"DIA_Addon_Emilio_GegenEsteban_10_01"); //Все, о чем эта свинья думает, - это деньги.
AI_Output(self,other,"DIA_Addon_Emilio_GegenEsteban_10_02"); //Каждые несколько дней одного из нас съедают ползуны.
AI_Output(self,other,"DIA_Addon_Emilio_GegenEsteban_10_03"); //Но Эстебан даже и не думает послать в шахту несколько бойцов.
AI_Output(self,other,"DIA_Addon_Emilio_GegenEsteban_10_04"); //А все почему? Потому что эти ребята из личной гвардии Ворона и Эстебан до дрожи в коленях боится говорить с ними.
AI_Output(self,other,"DIA_Addon_Emilio_GegenEsteban_10_05"); //Ему проще дать нам всем подохнуть!
};
instance DIA_Addon_BDT_10015_Emilio_Mine(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 9;
condition = DIA_Addon_Emilio_Mine_Condition;
information = DIA_Addon_Emilio_Mine_Info;
permanent = FALSE;
description = DIALOG_ADDON_MINE_DESCRIPTION;
};
func int DIA_Addon_Emilio_Mine_Condition()
{
if((MIS_Send_Buddler == LOG_Running) && (Player_SentBuddler < 3) && (Npc_HasItems(other,ItMi_Addon_Stone_01) >= 1))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_Mine_Info()
{
B_Say(other,self,"$MINE_ADDON_DESCRIPTION");
B_GiveInvItems(other,self,ItMi_Addon_Stone_01,1);
AI_Output(self,other,"DIA_Addon_BDT_10015_Emilio_Mine_10_00"); //Значит, ты теперь главный. Ладно, тогда я пошел.
Player_SentBuddler = Player_SentBuddler + 1;
B_GivePlayerXP(XP_Addon_MINE);
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"MINE");
};
instance DIA_Addon_Emilio_Hacker(C_Info)
{
npc = BDT_10015_Addon_Emilio;
nr = 9;
condition = DIA_Addon_Emilio_Hacker_Condition;
information = DIA_Addon_Emilio_Hacker_Info;
permanent = TRUE;
description = "Как дела?";
};
func int DIA_Addon_Emilio_Hacker_Condition()
{
if(Npc_GetDistToWP(self,"ADW_MINE_09_PICK") <= 500)
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Emilio_Hacker_Info()
{
AI_Output(other,self,"DIA_Addon_BDT_10004_Emilio_Hacker_15_00"); //Как дела?
AI_Output(self,other,"DIA_Addon_BDT_10004_Emilio_Hacker_10_01"); //Я просто валюсь с ног.
};
|
D
|
// URL: https://atcoder.jp/contests/abc060/tasks/arc073_a
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;
auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void pickV(R,T...)(ref R r,ref T t){foreach(ref v;t)pick(r,v);}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readM(T)(size_t r,size_t c,ref T[][]t){t=new T[][](r);foreach(ref v;t)readA(c,v);}
void readC(T...)(size_t n,ref T t){foreach(ref v;t)v=new typeof(v)(n);foreach(i;0..n){auto r=rdsp;foreach(ref v;t)pick(r,v[i]);}}
void readS(T)(size_t n,ref T t){t=new T(n);foreach(ref v;t){auto r=rdsp;foreach(ref j;v.tupleof)pick(r,j);}}
void writeA(T)(size_t n,T t){foreach(i,v;t.enumerate){write(v);if(i<n-1)write(" ");}writeln;}
version(unittest) {} else
void main()
{
int n, tc; readV(n, tc);
int[] t; readA(n, t);
auto ans = 0;
foreach (i; 0..n-1)
ans += t[i+1]-t[i] > tc ? tc : t[i+1]-t[i];
ans += tc;
writeln(ans);
}
|
D
|
/*
* Copyright (c) 2006-2012 Erin Catto http://www.box2d.org
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
module dbox.rope.b2rope;
import core.stdc.float_;
import core.stdc.math;
import core.stdc.stdlib;
import core.stdc.string;
import dbox.common;
import dbox.common.b2math;
///
struct b2RopeDef
{
///
b2Vec2* vertices;
///
int32 count;
///
float32* masses;
///
b2Vec2 gravity = b2Vec2(0, 0);
///
float32 damping = 0.1f;
/// Stretching stiffness
float32 k2 = 0.9f;
/// Bending stiffness. Values above 0.5 can make the simulation blow up.
float32 k3 = 0.1f;
}
///
struct b2Rope
{
/// This struct must be properly initialized with an explicit constructor.
@disable this();
/// This struct cannot be copied.
@disable this(this);
/// Explicit constructor.
this(int) { }
///
~this()
{
if (m_ps) b2Free(m_ps);
if (m_p0s) b2Free(m_p0s);
if (m_vs) b2Free(m_vs);
if (m_ims) b2Free(m_ims);
if (m_Ls) b2Free(m_Ls);
if (m_as) b2Free(m_as);
}
///
void Initialize(const(b2RopeDef)* def)
{
assert(def.count >= 3);
m_count = def.count;
m_ps = cast(b2Vec2*)b2Alloc(m_count * b2memSizeOf!b2Vec2);
m_p0s = cast(b2Vec2*)b2Alloc(m_count * b2memSizeOf!b2Vec2);
m_vs = cast(b2Vec2*)b2Alloc(m_count * b2memSizeOf!b2Vec2);
m_ims = cast(float32*)b2Alloc(m_count * b2memSizeOf!float32);
for (int32 i = 0; i < m_count; ++i)
{
m_ps[i] = def.vertices[i];
m_p0s[i] = def.vertices[i];
m_vs[i].SetZero();
float32 m = def.masses[i];
if (m > 0.0f)
{
m_ims[i] = 1.0f / m;
}
else
{
m_ims[i] = 0.0f;
}
}
int32 count2 = m_count - 1;
int32 count3 = m_count - 2;
m_Ls = cast(float32*)b2Alloc(count2 * b2memSizeOf!float32);
m_as = cast(float32*)b2Alloc(count3 * b2memSizeOf!float32);
for (int32 i = 0; i < count2; ++i)
{
b2Vec2 p1 = m_ps[i];
b2Vec2 p2 = m_ps[i + 1];
m_Ls[i] = b2Distance(p1, p2);
}
for (int32 i = 0; i < count3; ++i)
{
b2Vec2 p1 = m_ps[i];
b2Vec2 p2 = m_ps[i + 1];
b2Vec2 p3 = m_ps[i + 2];
b2Vec2 d1 = p2 - p1;
b2Vec2 d2 = p3 - p2;
float32 a = b2Cross(d1, d2);
float32 b = b2Dot(d1, d2);
m_as[i] = b2Atan2(a, b);
}
m_gravity = def.gravity;
m_damping = def.damping;
m_k2 = def.k2;
m_k3 = def.k3;
}
///
void Step(float32 h, int32 iterations)
{
if (h == 0.0)
{
return;
}
float32 d = expf(-h * m_damping);
for (int32 i = 0; i < m_count; ++i)
{
m_p0s[i] = m_ps[i];
if (m_ims[i] > 0.0f)
{
m_vs[i] += h * m_gravity;
}
m_vs[i] *= d;
m_ps[i] += h * m_vs[i];
}
for (int32 i = 0; i < iterations; ++i)
{
SolveC2();
SolveC3();
SolveC2();
}
float32 inv_h = 1.0f / h;
for (int32 i = 0; i < m_count; ++i)
{
m_vs[i] = inv_h * (m_ps[i] - m_p0s[i]);
}
}
///
void SolveC2()
{
int32 count2 = m_count - 1;
for (int32 i = 0; i < count2; ++i)
{
b2Vec2 p1 = m_ps[i];
b2Vec2 p2 = m_ps[i + 1];
b2Vec2 d = p2 - p1;
float32 L = d.Normalize();
float32 im1 = m_ims[i];
float32 im2 = m_ims[i + 1];
if (im1 + im2 == 0.0f)
{
continue;
}
float32 s1 = im1 / (im1 + im2);
float32 s2 = im2 / (im1 + im2);
p1 -= m_k2 * s1 * (m_Ls[i] - L) * d;
p2 += m_k2 * s2 * (m_Ls[i] - L) * d;
m_ps[i] = p1;
m_ps[i + 1] = p2;
}
}
///
void SetAngle(float32 angle)
{
int32 count3 = m_count - 2;
for (int32 i = 0; i < count3; ++i)
{
m_as[i] = angle;
}
}
///
void SolveC3()
{
int32 count3 = m_count - 2;
for (int32 i = 0; i < count3; ++i)
{
b2Vec2 p1 = m_ps[i];
b2Vec2 p2 = m_ps[i + 1];
b2Vec2 p3 = m_ps[i + 2];
float32 m1 = m_ims[i];
float32 m2 = m_ims[i + 1];
float32 m3 = m_ims[i + 2];
b2Vec2 d1 = p2 - p1;
b2Vec2 d2 = p3 - p2;
float32 L1sqr = d1.LengthSquared();
float32 L2sqr = d2.LengthSquared();
if (L1sqr * L2sqr == 0.0f)
{
continue;
}
float32 a = b2Cross(d1, d2);
float32 b = b2Dot(d1, d2);
float32 angle = b2Atan2(a, b);
b2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew();
b2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew();
b2Vec2 J1 = -Jd1;
b2Vec2 J2 = Jd1 - Jd2;
b2Vec2 J3 = Jd2;
float32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3);
if (mass == 0.0f)
{
continue;
}
mass = 1.0f / mass;
float32 C = angle - m_as[i];
while (C > b2_pi)
{
angle -= 2 * b2_pi;
C = angle - m_as[i];
}
while (C < -b2_pi)
{
angle += 2.0f * b2_pi;
C = angle - m_as[i];
}
float32 impulse = -m_k3 * mass * C;
p1 += (m1 * impulse) * J1;
p2 += (m2 * impulse) * J2;
p3 += (m3 * impulse) * J3;
m_ps[i] = p1;
m_ps[i + 1] = p2;
m_ps[i + 2] = p3;
}
}
///
void Draw(b2Draw draw) const
{
b2Color c = b2Color(0.4f, 0.5f, 0.7f);
for (int32 i = 0; i < m_count - 1; ++i)
{
draw.DrawSegment(m_ps[i], m_ps[i + 1], c);
}
}
///
int32 GetVertexCount() const
{
return m_count;
}
///
const(b2Vec2)* GetVertices() const
{
return m_ps;
}
private:
int32 m_count;
b2Vec2* m_ps;
b2Vec2* m_p0s;
b2Vec2* m_vs;
float32* m_ims;
float32* m_Ls;
float32* m_as;
b2Vec2 m_gravity = b2Vec2(0, 0);
float32 m_damping = 0;
float32 m_k2 = 1.0f;
float32 m_k3 = 0.1f;
}
|
D
|
module UnrealScript.UTGame.UTDmgType_VehicleExplosion;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.UTGame.UTDmgType_Burning;
extern(C++) interface UTDmgType_VehicleExplosion : UTDmgType_Burning
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class UTGame.UTDmgType_VehicleExplosion")); }
private static __gshared UTDmgType_VehicleExplosion mDefaultProperties;
@property final static UTDmgType_VehicleExplosion DefaultProperties() { mixin(MGDPC("UTDmgType_VehicleExplosion", "UTDmgType_VehicleExplosion UTGame.Default__UTDmgType_VehicleExplosion")); }
}
|
D
|
// Copyright Gushcha Anton 2012.
// 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)
/// Модуль для безопасного ведения логов
/**
* @file log.d Модуль безопасного ведения логов. Позволяет вести несколько логов одновременно, записывать
* сообщения разных уровней важности. Если запись в лог фейлит, приложение целиком остается цело.
*/
module util.log;
import std.stdio;
import std.array;
import std.datetime;
/// Уровень сообщения в логе
enum LOG_ERROR_LEVEL
{
NOTICE = 0,
WARNING = 1,
DEBUG = 2,
FATAL = 3
}
/// Стандартный лог для сопуствующих модулей
public enum GENERAL_LOG = "General.log";
/// Вывод в консоль всех сообщений
enum PRINT_ALL = true;
/// Директория для создание лога по умолчанию
enum DEFAULT_DIR = "./";
/// Хранилище логов
private File*[string] logsMap;
/// Стили отображения
private string[LOG_ERROR_LEVEL] logsStyles;
/// Инициализация модуля
static this()
{
logsStyles = [
LOG_ERROR_LEVEL.NOTICE : "Notice: ",
LOG_ERROR_LEVEL.WARNING : "Warning: ",
LOG_ERROR_LEVEL.DEBUG : "Debug: ",
LOG_ERROR_LEVEL.FATAL : "FATAL ERROR: "
];
}
/// Закрытие логов при выходе
static ~this()
{
foreach(log; logsMap)
if (log !is null)
log.close();
}
// Alias simple functions
void writeFatalLog(string msg, string logName = GENERAL_LOG, bool forcedMute = false)
{
writeLog(msg, LOG_ERROR_LEVEL.FATAL, logName, forcedMute);
}
void writeWarningLog(string msg, string logName = GENERAL_LOG, bool forcedMute = false)
{
writeLog(msg, LOG_ERROR_LEVEL.WARNING, logName, forcedMute);
}
void writeDebugLog(string msg, string logName = GENERAL_LOG, bool forcedMute = false)
{
writeLog(msg, LOG_ERROR_LEVEL.DEBUG, logName, forcedMute);
}
void writeNoticeLog(string msg, string logName = GENERAL_LOG, bool forcedMute = false)
{
writeLog(msg, LOG_ERROR_LEVEL.NOTICE, logName, forcedMute);
}
/// Создать лог
/**
* @par logName Имя лога
* @par dirName Папка, где будет создан лог
*/
void createLog(string logName, string dirName = DEFAULT_DIR)
{
if (logName.empty) return;
if (logName in logsMap)
{
writeln(logsStyles[LOG_ERROR_LEVEL.WARNING], "Tried to recreate ", logName, ". Aborted.");
return;
}
try
{
auto f = new File(dirName~"/"~logName, "w");
logsMap[logName] = f;
}
catch(Exception e)
{
writeln(logsStyles[LOG_ERROR_LEVEL.WARNING], "Failed to create ", logName, ". Aborted.");
}
}
/// Закрыть лог
/**
* @par logName Имя лога
*/
void closeLog(string logName)
{
if(logName.empty) return;
if(logName in logsMap)
logsMap[logName].close();
}
/// Записать в лог сообщение
/**
* Записывает сообщение $(B msg) в лог с именем $(B logName). Лог должен быть заранее созданс с помощью createLog.
* Параметр $(B errLevel) описывает уровень важности сообщения. DEBUG и WARNING/FATAL сообщения всегда выводятся на экран.
* NOTICE сообщения обычно только записываются в файл. FATAL сообщения предвещают скорое падение системы. Если глобальный
* флаг $(B PRINT_ALL) установлен в $(B true), в консоль будут выводится все сообщения. Флаг $(B forcedMute) указывает, нужно
* ли принудительно заглушить вывод сообщения в консоль.
*/
void writeLog(string msg, LOG_ERROR_LEVEL errLevel = LOG_ERROR_LEVEL.DEBUG, string logName = GENERAL_LOG, bool forcedMute = false) nothrow
{
try
{
if( ( errLevel == LOG_ERROR_LEVEL.FATAL || errLevel == LOG_ERROR_LEVEL.WARNING || PRINT_ALL ) && !forcedMute )
writeln(logsStyles[errLevel], msg);
if (!logName.empty && logName in logsMap)
{
auto logFile = logsMap[logName];
if (logFile is null)
{
//if(!forcedMute)
// writeln(logsStyles[LOG_ERROR_LEVEL.WARNING], "Log ", logName, " doesnt exist. Creating new log.");
logsMap.remove(logName);
createLog(logName);
logFile = logsMap[logName];
}
try
{
auto currTime = Clock.currTime();
auto timeString = currTime.toISOExtString();
logFile.writeln("["~timeString~"]:"~logsStyles[errLevel], msg);
}
catch(Exception e)
{
writeln(logsStyles[LOG_ERROR_LEVEL.WARNING], "Log ", logName, " writing failed.");
}
}
else
{
//if(!forcedMute)
// writeln(logsStyles[LOG_ERROR_LEVEL.WARNING], "Log ", logName, " doesnt exist. Creating new log.");
createLog(logName);
}
} catch(Exception e)
{
}
}
unittest
{
import std.process;
import std.regex;
import std.path;
write("Testing log system... ");
scope(success) writeln("Finished!");
scope(failure) writeln("Failed!");
createLog("TestLog");
writeLog("Notice msg!", LOG_ERROR_LEVEL.NOTICE, "TestLog", true);
writeLog("Warning msg!", LOG_ERROR_LEVEL.WARNING, "TestLog", true);
writeLog("Debug msg!", LOG_ERROR_LEVEL.DEBUG, "TestLog", true);
writeLog("Fatal msg!", LOG_ERROR_LEVEL.FATAL, "TestLog", true);
closeLog("TestLog");
auto f = new File(DEFAULT_DIR~"TestLog", "r");
// Перед проверкой удаляем из строки дату
assert(replace(f.readln()[0..$-1], regex(r"[\[][\p{InBasicLatin}]*[\]][:]"), "") == logsStyles[LOG_ERROR_LEVEL.NOTICE]~"Notice msg!", "Log notice testing fail!");
assert(replace(f.readln()[0..$-1], regex(r"[\[][\p{InBasicLatin}]*[\]][:]"), "") == logsStyles[LOG_ERROR_LEVEL.WARNING]~"Warning msg!", "Log warning testing fail!");
assert(replace(f.readln()[0..$-1], regex(r"[\[][\p{InBasicLatin}]*[\]][:]"), "") == logsStyles[LOG_ERROR_LEVEL.DEBUG]~"Debug msg!", "Log debug testing fail!");
assert(replace(f.readln()[0..$-1], regex(r"[\[][\p{InBasicLatin}]*[\]][:]"), "") == logsStyles[LOG_ERROR_LEVEL.FATAL]~"Fatal msg!", "Log fatal testing fail!");
f.close();
version(linux)
system("rm "~buildNormalizedPath(DEFAULT_DIR~"TestLog"));
version(Windows)
system("del "~buildNormalizedPath(DEFAULT_DIR~"TestLog"));
}
|
D
|
//Process a config file from monkeynews.json file
module configjson;
import std.json;
///Generic settings seperated from the benchmark specific configuration struct for reuse.
struct GenericSettings
{
//This does not use bitflags currently because it's not important and going to be CTFE'd
///How many iterations
uint iterations = 3;
///Dump each measurement individually rather than taking the mean
bool putEachMeasurement = false;
/++
Attempt to flush the cachce of newly minted memory between independant variable measurements
i.e. if you take a large number of measurement you can see how hot or cold caches effect it.
+/
bool flushCache = false;
///Allow the garbage collector to run as normal
bool enableGC = true;
///Force a collection on each independant measurement
bool collectOnIndependant = true;
///Force a collection on each iteration
bool collectOnIteration = true;
this(uint iters)
{
iterations = iters;
}
}
GenericSettings fromConfig(JSONValue x)
{
assert(0);
}
|
D
|
/*
* Entity - Entity is an object-relational mapping tool for the D programming language. Referring to the design idea of JPA.
*
* Copyright (C) 2015-2018 Shanghai Putao Technology Co., Ltd
*
* Developer: HuntLabs.cn
*
* Licensed under the Apache-2.0 License.
*
*/
module entity.criteria.Join;
import entity;
class Join(F,T) : Root!T
{
private JoinType _joinType;
private EntityFieldInfo _info;
private Root!F _from;
this(CriteriaBuilder _builder,EntityFieldInfo info, Root!F from, JoinType joinType = JoinType.INNER) {
_info = info;
_joinType = joinType;
_from = from;
super(_builder);
}
public EntityInfo!T opDispatch(string name)()
{
return super.opDispatch!(name)();
}
public string getJoinOnString()
{
return _from.getTableName() ~ "." ~ _info.getJoinColumn() ~ " = " ~ getTableName() ~ "." ~ getEntityInfo().getPrimaryKeyString();
}
}
|
D
|
module model.building_properties;
import stream;
import std.conv;
import std.typecons : Nullable;
import model.building_type;
import model.resource;
/// Building properties
struct BuildingProperties {
/// Building type that this building can be upgraded from
Nullable!(model.BuildingType) baseBuilding;
/// Resources required for building
int[model.Resource] buildResources;
/// Max health points of the building
int maxHealth;
/// Max number of workers in the building
int maxWorkers;
/// Resources required to start another task
int[model.Resource] workResources;
/// Whether performing a task spawn new workers
bool produceWorker;
/// Resource produced when performing a task
Nullable!(model.Resource) produceResource;
/// Amount of resources/workers produced when performing one task
int produceAmount;
/// Score points given for performing one task
int produceScore;
/// Whether building is harvesting. In this case resource can only be produced if it is harvestable on the planet
bool harvest;
/// Amount of work needed to finish one task
int workAmount;
this(Nullable!(model.BuildingType) baseBuilding, int[model.Resource] buildResources, int maxHealth, int maxWorkers, int[model.Resource] workResources, bool produceWorker, Nullable!(model.Resource) produceResource, int produceAmount, int produceScore, bool harvest, int workAmount) {
this.baseBuilding = baseBuilding;
this.buildResources = buildResources;
this.maxHealth = maxHealth;
this.maxWorkers = maxWorkers;
this.workResources = workResources;
this.produceWorker = produceWorker;
this.produceResource = produceResource;
this.produceAmount = produceAmount;
this.produceScore = produceScore;
this.harvest = harvest;
this.workAmount = workAmount;
}
/// Read BuildingProperties from reader
static BuildingProperties readFrom(Stream reader) {
Nullable!(model.BuildingType) baseBuilding;
if (reader.readBool()) {
baseBuilding = readBuildingType(reader);
} else {
baseBuilding.nullify();
}
int[model.Resource] buildResources;
int buildResourcesSize = reader.readInt();
buildResources.clear();
for (int buildResourcesIndex = 0; buildResourcesIndex < buildResourcesSize; buildResourcesIndex++) {
model.Resource buildResourcesKey;
int buildResourcesValue;
buildResourcesKey = readResource(reader);
buildResourcesValue = reader.readInt();
buildResources[buildResourcesKey] = buildResourcesValue;
}
int maxHealth;
maxHealth = reader.readInt();
int maxWorkers;
maxWorkers = reader.readInt();
int[model.Resource] workResources;
int workResourcesSize = reader.readInt();
workResources.clear();
for (int workResourcesIndex = 0; workResourcesIndex < workResourcesSize; workResourcesIndex++) {
model.Resource workResourcesKey;
int workResourcesValue;
workResourcesKey = readResource(reader);
workResourcesValue = reader.readInt();
workResources[workResourcesKey] = workResourcesValue;
}
bool produceWorker;
produceWorker = reader.readBool();
Nullable!(model.Resource) produceResource;
if (reader.readBool()) {
produceResource = readResource(reader);
} else {
produceResource.nullify();
}
int produceAmount;
produceAmount = reader.readInt();
int produceScore;
produceScore = reader.readInt();
bool harvest;
harvest = reader.readBool();
int workAmount;
workAmount = reader.readInt();
return BuildingProperties(baseBuilding, buildResources, maxHealth, maxWorkers, workResources, produceWorker, produceResource, produceAmount, produceScore, harvest, workAmount);
}
/// Write BuildingProperties to writer
void writeTo(Stream writer) const {
if (baseBuilding.isNull()) {
writer.write(false);
} else {
writer.write(true);
auto baseBuildingValue = baseBuilding.get;
writer.write(cast(int)(baseBuildingValue));
}
writer.write(cast(int)(buildResources.length));
foreach (buildResourcesKey, buildResourcesValue; buildResources) {
writer.write(cast(int)(buildResourcesKey));
writer.write(buildResourcesValue);
}
writer.write(maxHealth);
writer.write(maxWorkers);
writer.write(cast(int)(workResources.length));
foreach (workResourcesKey, workResourcesValue; workResources) {
writer.write(cast(int)(workResourcesKey));
writer.write(workResourcesValue);
}
writer.write(produceWorker);
if (produceResource.isNull()) {
writer.write(false);
} else {
writer.write(true);
auto produceResourceValue = produceResource.get;
writer.write(cast(int)(produceResourceValue));
}
writer.write(produceAmount);
writer.write(produceScore);
writer.write(harvest);
writer.write(workAmount);
}
}
|
D
|
a male religious living in a cloister and devoting himself to contemplation and prayer and work
of communal life sequestered from the world under religious vows
|
D
|
// Written in the D programming language.
/**
* Information about the target operating system, environment, and CPU.
*
* Copyright: Copyright The D Language Foundation 2000 - 2011
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(HTTP digitalmars.com, Walter Bright) and
$(HTTP jmdavisprog.com, Jonathan M Davis)
* Source: $(PHOBOSSRC std/system.d)
*/
module std.system;
immutable
{
/++
Operating system.
Note:
This is for cases where you need a value representing the OS at
runtime. If you're doing something which should compile differently
on different OSes, then please use `version (Windows)`,
`version (linux)`, etc.
See_Also:
$(DDSUBLINK spec/version,PredefinedVersions, Predefined Versions)
+/
enum OS
{
win32 = 1, /// Microsoft 32 bit Windows systems
win64, /// Microsoft 64 bit Windows systems
linux, /// All Linux Systems, except for Android
osx, /// Mac OS X
freeBSD, /// FreeBSD
netBSD, /// NetBSD
dragonFlyBSD, /// DragonFlyBSD
solaris, /// Solaris
android, /// Android
wasm,
otherPosix /// Other Posix Systems
}
/// The OS that the program was compiled for.
version (Win32) OS os = OS.win32;
else version (Win64) OS os = OS.win64;
else version (Android) OS os = OS.android;
else version (linux) OS os = OS.linux;
else version (OSX) OS os = OS.osx;
else version (FreeBSD) OS os = OS.freeBSD;
else version (NetBSD) OS os = OS.netBSD;
else version (DragonFlyBSD) OS os = OS.dragonFlyBSD;
else version (Posix) OS os = OS.otherPosix;
else version (WebAssembly) OS os = OS.wasm;
else static assert(0, "Unknown OS.");
/++
Byte order endianness.
Note:
This is intended for cases where you need to deal with endianness at
runtime. If you're doing something which should compile differently
depending on whether you're compiling on a big endian or little
endian machine, then please use `version (BigEndian)` and
`version (LittleEndian)`.
See_Also:
$(DDSUBLINK spec/version,PredefinedVersions, Predefined Versions)
+/
enum Endian
{
bigEndian, /// Big endian byte order
littleEndian /// Little endian byte order
}
/// The endianness that the program was compiled for.
version (LittleEndian) Endian endian = Endian.littleEndian;
else Endian endian = Endian.bigEndian;
}
|
D
|
/home/ubuntu/substrate-node-template/target/release/wbuild-runner/node-template-runtime6620869906145500559/target/x86_64-unknown-linux-gnu/release/deps/rand_chacha-0a30b1a3fae7f07c.rmeta: /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/lib.rs /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/chacha.rs /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/guts.rs
/home/ubuntu/substrate-node-template/target/release/wbuild-runner/node-template-runtime6620869906145500559/target/x86_64-unknown-linux-gnu/release/deps/librand_chacha-0a30b1a3fae7f07c.rlib: /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/lib.rs /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/chacha.rs /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/guts.rs
/home/ubuntu/substrate-node-template/target/release/wbuild-runner/node-template-runtime6620869906145500559/target/x86_64-unknown-linux-gnu/release/deps/rand_chacha-0a30b1a3fae7f07c.d: /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/lib.rs /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/chacha.rs /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/guts.rs
/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/lib.rs:
/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/chacha.rs:
/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.0/src/guts.rs:
|
D
|
; Copyright (C) 2016 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
.source ITestDefault2.java
.interface public dot.junit.opcodes.invoke_super_range.d.ITestDefault2
.method public testDefault()V
.limit regs 2
return-void
.end method
.source ITestDefault.java
.interface public dot.junit.opcodes.invoke_super_range.d.ITestDefault
.method public testDefault()V
.limit regs 2
return-void
.end method
.source ITestConflict.java
.interface public dot.junit.opcodes.invoke_super_range.d.ITestConflict
.implements dot.junit.opcodes.invoke_super_range.d.ITestDefault
.implements dot.junit.opcodes.invoke_super_range.d.ITestDefault2
.source T_invoke_super_range_28.java
.class public dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_28
.super java/lang/Object
.implements dot.junit.opcodes.invoke_super_range.d.ITestConflict
.method public <init>()V
.limit regs 2
invoke-direct {v1}, java/lang/Object/<init>()V
return-void
.end method
.method public run()V
.limit regs 1
invoke-super/range {v0}, dot/junit/opcodes/invoke_super_range/d/ITestConflict/testDefault()V
return-void
.end method
|
D
|
/*
* Hunt - A refined core library for D programming language.
*
* Copyright (C) 2018-2019 HuntLabs
*
* Website: https://www.huntlabs.net/
*
* Licensed under the Apache-2.0 License.
*
*/
module hunt.event.selector.Epoll;
// dfmt off
version(HAVE_EPOLL):
// dfmt on
import std.exception;
import std.socket;
import std.string;
import core.time;
import core.stdc.string;
import core.stdc.errno;
import core.sys.posix.sys.types;
import core.sys.posix.netinet.tcp;
import core.sys.posix.netinet.in_;
import core.sys.posix.unistd;
import core.sys.posix.sys.resource;
import core.sys.posix.sys.time;
import core.sys.linux.epoll;
import hunt.event.selector.Selector;
import hunt.Exceptions;
import hunt.io.channel;
import hunt.logging.ConsoleLogger;
import hunt.event.timer;
import hunt.system.Error;
import hunt.concurrency.TaskPool;
/* Max. theoretical number of file descriptors on system. */
__gshared size_t fdLimit = 0;
shared static this() {
rlimit fileLimit;
getrlimit(RLIMIT_NOFILE, &fileLimit);
fdLimit = fileLimit.rlim_max;
}
/**
*/
class AbstractSelector : Selector {
enum int NUM_KEVENTS = 1024;
private int _epollFD;
private bool isDisposed = false;
private epoll_event[NUM_KEVENTS] events;
private EventChannel _eventChannel;
this(size_t number, size_t divider, size_t maxChannels = 1500) {
super(number, divider, maxChannels);
// http://man7.org/linux/man-pages/man2/epoll_create.2.html
/*
* Set the close-on-exec (FD_CLOEXEC) flag on the new file descriptor.
* See the description of the O_CLOEXEC flag in open(2) for reasons why
* this may be useful.
*/
_epollFD = epoll_create1(EPOLL_CLOEXEC);
if (_epollFD < 0)
throw new IOException("epoll_create failed");
_eventChannel = new EpollEventChannel(this);
register(_eventChannel);
}
~this() @nogc {
// dispose();
}
override void dispose() {
if (isDisposed)
return;
version (HUNT_IO_DEBUG)
tracef("disposing selector[fd=%d]...", _epollFD);
isDisposed = true;
_eventChannel.close();
int r = core.sys.posix.unistd.close(_epollFD);
if(r != 0) {
version (HUNT_IO_DEBUG) warningf("error: %d", r);
}
super.dispose();
}
override void onStop() {
version (HUNT_IO_DEBUG)
infof("Selector stopping. fd=%d, id: %d", _epollFD, number);
if(!_eventChannel.isClosed()) {
_eventChannel.trigger();
// _eventChannel.onWrite();
}
}
override bool register(AbstractChannel channel) {
assert(channel !is null);
int infd = cast(int) channel.handle;
version (HUNT_IO_DEBUG)
tracef("register channel: fd=%d", infd);
size_t index = cast(size_t)(infd / divider);
if (index >= channels.length) {
debug warningf("expanding channels uplimit to %d", index);
import std.algorithm : max;
size_t length = max(cast(size_t)(index * 3 / 2), 16);
AbstractChannel[] arr = new AbstractChannel[length];
arr[0 .. channels.length] = channels[0 .. $];
channels = arr;
}
channels[index] = channel;
// epoll_event e;
// e.data.fd = infd;
// e.data.ptr = cast(void*) channel;
// e.events = EPOLLIN | EPOLLET | EPOLLERR | EPOLLHUP | EPOLLRDHUP | EPOLLOUT;
// int s = epoll_ctl(_epollFD, EPOLL_CTL_ADD, infd, &e);
// if (s == -1) {
// debug warningf("failed to register channel: fd=%d", infd);
// return false;
// } else {
// return true;
// }
if (epollCtl(channel, EPOLL_CTL_ADD)) {
return true;
} else {
debug warningf("failed to register channel: fd=%d", infd);
return false;
}
}
override bool deregister(AbstractChannel channel) {
size_t fd = cast(size_t) channel.handle;
size_t index = cast(size_t)(fd / divider);
version (HUNT_IO_DEBUG)
tracef("deregister channel: fd=%d, index=%d", fd, index);
channels[index] = null;
if (epollCtl(channel, EPOLL_CTL_DEL)) {
return true;
} else {
warningf("deregister channel failed: fd=%d", fd);
return false;
}
}
override bool update(AbstractChannel channel) {
if (epollCtl(channel, EPOLL_CTL_MOD)) {
return true;
} else {
warningf("update channel failed: fd=%d", fd);
return false;
}
}
/**
timeout: in millisecond
*/
protected override int doSelect(long timeout) {
int len = 0;
if (timeout <= 0) { /* Indefinite or no wait */
do {
// http://man7.org/linux/man-pages/man2/epoll_wait.2.html
// https://stackoverflow.com/questions/6870158/epoll-wait-fails-due-to-eintr-how-to-remedy-this/6870391#6870391
len = epoll_wait(_epollFD, events.ptr, events.length, cast(int) timeout);
} while ((len == -1) && (errno == EINTR));
} else { /* Bounded wait; bounded restarts */
len = iepoll(_epollFD, events.ptr, events.length, cast(int) timeout);
}
if(defaultPoolThreads > 0) { // using worker thread
foreach (i; 0 .. len) {
AbstractChannel channel = cast(AbstractChannel)(events[i].data.ptr);
if (channel is null) {
debug warningf("channel is null");
} else {
uint currentEvents = events[i].events;
workerPool.put(cast(int)channel.handle, makeTask(&handeChannelEvent, channel, currentEvents));
}
}
} else {
foreach (i; 0 .. len) {
AbstractChannel channel = cast(AbstractChannel)(events[i].data.ptr);
if (channel is null) {
debug warningf("channel is null");
} else {
handeChannelEvent(channel, events[i].events);
}
}
}
return len;
}
private void handeChannelEvent(AbstractChannel channel, uint event) {
version (HUNT_IO_DEBUG)
infof("handling event: selector=%d, events=%d, channel=%d", this._epollFD, event, channel.handle);
try {
if (isClosed(event)) { // && errno != EINTR
/* An error has occured on this fd, or the socket is not
ready for reading (why were we notified then?) */
version (HUNT_IO_DEBUG) {
if (isError(event)) {
warningf("channel error: fd=%s, event=%d, errno=%d, message=%s",
channel.handle, event, errno, getErrorMessage(errno));
} else {
tracef("channel closed: fd=%d, errno=%d, message=%s",
channel.handle, errno, getErrorMessage(errno));
}
}
// FIXME: Needing refactor or cleanup -@zxp at 2/28/2019, 3:25:24 PM
// May be triggered twice for a channel, for example:
// events=8197, fd=13
// events=8221, fd=13
// The remote connection broken abnormally, so the channel should be notified.
// channel.onClose(); // More tests are needed
channel.close();
} else if (event == EPOLLIN) {
version (HUNT_IO_DEBUG)
tracef("channel read event: fd=%d", channel.handle);
channel.onRead();
} else if (event == EPOLLOUT) {
version (HUNT_IO_DEBUG)
tracef("channel write event: fd=%d", channel.handle);
channel.onWrite();
} else if (event == (EPOLLIN | EPOLLOUT)) {
version (HUNT_IO_DEBUG)
tracef("channel read and write: fd=%d", channel.handle);
channel.onWrite();
channel.onRead();
} else {
debug warningf("this thread only for read/write/close events, event: %d", event);
}
} catch (Exception e) {
debug {
errorf("error while handing channel: fd=%s, exception=%s, message=%s",
channel.handle, typeid(e), e.msg);
}
version(HUNT_DEBUG) warning(e);
}
}
private int iepoll(int epfd, epoll_event* events, int numfds, int timeout) {
long start, now;
int remaining = timeout;
timeval t;
long diff;
gettimeofday(&t, null);
start = t.tv_sec * 1000 + t.tv_usec / 1000;
for (;;) {
int res = epoll_wait(epfd, events, numfds, remaining);
if (res < 0 && errno == EINTR) {
if (remaining >= 0) {
gettimeofday(&t, null);
now = t.tv_sec * 1000 + t.tv_usec / 1000;
diff = now - start;
remaining -= diff;
if (diff < 0 || remaining <= 0) {
return 0;
}
start = now;
}
} else {
return res;
}
}
}
// https://blog.csdn.net/ljx0305/article/details/4065058
private static bool isError(uint events) nothrow {
return (events & EPOLLERR) != 0;
}
private static bool isClosed(uint e) nothrow {
return (e & EPOLLERR) != 0 || (e & EPOLLHUP) != 0 || (e & EPOLLRDHUP) != 0
|| (!(e & EPOLLIN) && !(e & EPOLLOUT)) != 0;
}
private static bool isReadable(uint events) nothrow {
return (events & EPOLLIN) != 0;
}
private static bool isWritable(uint events) nothrow {
return (events & EPOLLOUT) != 0;
}
private static buildEpollEvent(AbstractChannel channel, ref epoll_event ev) {
ev.data.ptr = cast(void*) channel;
// ev.data.fd = channel.handle;
ev.events = EPOLLRDHUP | EPOLLERR | EPOLLHUP;
if (channel.hasFlag(ChannelFlag.Read))
ev.events |= EPOLLIN;
if (channel.hasFlag(ChannelFlag.Write))
ev.events |= EPOLLOUT;
// if (channel.hasFlag(ChannelFlag.OneShot))
// ev.events |= EPOLLONESHOT;
if (channel.hasFlag(ChannelFlag.ETMode))
ev.events |= EPOLLET;
return ev;
}
private bool epollCtl(AbstractChannel channel, int opcode) {
assert(channel !is null);
const fd = channel.handle;
assert(fd >= 0, "The channel.handle is not initialized!");
epoll_event ev;
buildEpollEvent(channel, ev);
int res = 0;
do {
res = epoll_ctl(_epollFD, opcode, fd, &ev);
}
while ((res == -1) && (errno == EINTR));
/*
* A channel may be registered with several Selectors. When each Selector
* is polled a EPOLL_CTL_DEL op will be inserted into its pending update
* list to remove the file descriptor from epoll. The "last" Selector will
* close the file descriptor which automatically unregisters it from each
* epoll descriptor. To avoid costly synchronization between Selectors we
* allow pending updates to be processed, ignoring errors. The errors are
* harmless as the last update for the file descriptor is guaranteed to
* be EPOLL_CTL_DEL.
*/
if (res < 0 && errno != EBADF && errno != ENOENT && errno != EPERM) {
warning("epoll_ctl failed");
return false;
} else
return true;
}
}
|
D
|
/*
Copyright © 2020, Inochi2D Project
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna Nielsen
*/
module creator.utils.repair;
import inochi2d;
private {
}
/**
Attempts to repair a corrupt puppet
*/
void incAttemptRepairPuppet(Puppet p) {
// Attempt to repair node IDs
incRegenerateNodeIDs(p.root);
// Finish off by rescanning nodes.
p.rescanNodes();
}
/**
Attempts to repair puppet IDs
*/
void incRegenerateNodeIDs(Node n) {
foreach(child; n.children) {
incRegenerateNodeIDs(child);
}
// Force a new UUID
n.forceSetUUID(inCreateUUID());
}
|
D
|
void main() { runSolver(); }
void problem() {
auto QN = scan!long;
auto Q = scan!long(2 * QN).chunks(2).array;
auto solve() {
enum long N = 2L^^20;
auto arr = new long[](N);
arr[] = -1;
auto uf = UnionFind(N);
foreach(q; Q) {
const t = q[0];
const x = q[1];
const h = x % N;
if (t == 1) {
const root = uf.root(h);
arr[root % N] = x;
uf.unite(root, (root + 1) % N);
} else {
arr[h].writeln;
}
}
}
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"];
// -----------------------------------------------
struct UnionFind {
long[] parent;
this(long size) {
parent.length = size;
foreach(i; 0..size) parent[i] = i;
}
long root(long x) {
if (parent[x] == x) return x;
return parent[x] = root(parent[x]);
}
long unite(long x, long y) {
long rootX = root(x);
long rootY = root(y);
if (rootX == rootY) return rootY;
return parent[rootX] = rootY;
}
bool same(long x, long y) {
long rootX = root(x);
long rootY = root(y);
return rootX == rootY;
}
}
|
D
|
module UnrealScript.TribesGame.TrSeqAct_AIStopSkiing;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.SequenceAction;
extern(C++) interface TrSeqAct_AIStopSkiing : SequenceAction
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrSeqAct_AIStopSkiing")); }
private static __gshared TrSeqAct_AIStopSkiing mDefaultProperties;
@property final static TrSeqAct_AIStopSkiing DefaultProperties() { mixin(MGDPC("TrSeqAct_AIStopSkiing", "TrSeqAct_AIStopSkiing TribesGame.Default__TrSeqAct_AIStopSkiing")); }
}
|
D
|
var int Daniel_ItemsGiven_Chapter_1;
var int Daniel_ItemsGiven_Chapter_2;
var int Daniel_ItemsGiven_Chapter_3;
var int Daniel_ItemsGiven_Chapter_4;
var int Daniel_ItemsGiven_Chapter_5;
FUNC VOID B_GiveTradeInv_Mod_Daniel_REL (var C_NPC slf)
{
if (Npc_HasItems(slf, ItMi_Flask) < 10) {
CreateInvItems(slf, ItMi_Flask, 10 - Npc_HasItems(slf, ItMi_Flask));
};
if ((Kapitel >= 1)
&& (Daniel_ItemsGiven_Chapter_1 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 100);
CreateInvItems (slf,ItPo_Mana_01 ,10);
CreateInvItems (slf,ItPo_Health_01 ,10);
CreateInvItems (slf, ItPo_Health_Addon_04, 2);
CreateInvItems (slf, ItPo_Mana_Addon_04, 2);
CreateInvItems (slf,ItMi_ApfelTabak ,2); //für Abuyin
CreateInvItems (slf,ItWr_Astronomy_Mis,1); //Für Mission HygalsBringBook
CreateInvItems (slf,ItFo_Addon_Pfeffer_01,1);//FÜR Mission fortuno
// ------ Scrolls ------
CreateInvItems (slf,ItSc_Light ,6);
CreateInvItems (slf,ItSc_Sleep ,1);
CreateInvItems (slf,ItSc_Firebolt ,20);
CreateInvItems (slf,ItSc_Icebolt_Fake ,8);
CreateInvItems (slf,ItSc_IceLance_Fake ,8);
CreateInvItems (slf,ItSc_InstantFireball ,10);
CreateInvItems (slf,ItSc_LightningFlash ,5);
CreateInvItems (slf,ItSc_HarmUndead ,3);
CreateInvItems (slf,ItSc_Firestorm ,3);
CreateInvItems (slf,ItSc_IceWave_Fake ,1);
CreateInvItems (slf,ItSc_Zap ,5);
CreateInvItems (slf,ItSc_IceCube_Fake ,3);
CreateInvItems (slf,ItSc_Windfist ,3);
CreateInvItems (slf,ItSc_IceWave_Fake ,1);
CreateInvItems (slf,ItSc_Firerain ,1);
CreateInvItems (slf,ItSc_Shrink ,1);
CreateInvItems (slf,ItSc_ThunderStorm ,1);
CreateInvItems (slf,ItSc_SumGobSkel ,1);
CreateInvItems (slf,ItSc_SumSkel ,1);
CreateInvItems (slf,ItSc_SumWolf ,1);
CreateInvItems (slf,ItSc_SumGol ,1);
CreateInvItems (slf,ItSc_SumDemon ,1);
CreateInvItems (slf, ItPo_ZufallsDrink, 1);
CreateInvItems (slf, ItRu_TeleportKhorata, 1);
// ------ AmRiBe ------
CreateInvItems (slf,ItBe_Addon_Prot_MAGIC, 1);
CreateInvItems (slf,ItAm_Hp_Mana_01 ,1);
CreateInvItems (slf, ItPo_Gegengift, 2);
CreateInvItems (slf, ItMi_Runeblank, 1);
Daniel_ItemsGiven_Chapter_1 = TRUE;
};
if ((Kapitel >= 2)
&& Daniel_ItemsGiven_Chapter_2 == FALSE)
{
CreateInvItems (slf, ItMi_Gold, 60);
CreateInvItems (slf, ItPo_Health_Addon_04, 2);
CreateInvItems (slf, ItPo_Mana_Addon_04, 2);
CreateInvItems (slf,ItPo_Mana_01 ,15);
CreateInvItems (slf,ItPo_Mana_02 , 1);
CreateInvItems (slf,ItPo_Health_01 ,15);
CreateInvItems (slf,ItPo_Health_02 , 2);
CreateInvItems (slf,ItPo_Perm_Str, 1);
CreateInvItems (slf,ItSc_Icebolt_Fake ,8);
CreateInvItems (slf,ItSc_IceWave_Fake ,1);
CreateInvItems (slf,ItSc_IceCube_Fake ,3);
CreateInvItems (slf, ItPo_Gegengift, 2);
Daniel_ItemsGiven_Chapter_2 = TRUE;
};
if ((Kapitel >= 3)
&& (Daniel_ItemsGiven_Chapter_3 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 120);
CreateInvItems (slf, ItPo_Health_Addon_04, 2);
CreateInvItems (slf, ItPo_Mana_Addon_04, 2);
CreateInvItems (slf,ItPo_Mana_01 ,25);
CreateInvItems (slf,ItPo_Mana_02 , 3);
CreateInvItems (slf,ItPo_Health_01 ,25);
CreateInvItems (slf,ItPo_Health_02 , 15);
CreateInvItems (slf,ItPo_Perm_Mana , 1);
CreateInvItems (slf, ItPo_Speed, 1);
CreateInvItems (slf,ItSc_Icebolt_Fake ,8);
CreateInvItems (slf,ItSc_IceWave_Fake ,1);
CreateInvItems (slf,ItSc_IceCube_Fake ,3);
CreateInvItems (slf, ItPo_Gegengift, 2);
Daniel_ItemsGiven_Chapter_3 = TRUE;
};
if ((Kapitel >= 4)
&& (Daniel_ItemsGiven_Chapter_4 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 220);
CreateInvItems (slf, ItPo_Health_Addon_04, 3);
CreateInvItems (slf, ItPo_Mana_Addon_04, 3);
CreateInvItems (slf,ItPo_Mana_01 ,35);
CreateInvItems (slf,ItPo_Mana_02 , 15);
CreateInvItems (slf,ItPo_Health_01 ,35);
CreateInvItems (slf,ItPo_Health_02 , 20);
CreateInvItems (slf,ItPo_Health_03 , 10);
CreateInvItems (slf,ItPo_Perm_Mana , 1);
CreateInvItems (slf, ItPo_Speed, 1);
CreateInvItems (slf,ItSc_Icebolt_Fake ,8);
CreateInvItems (slf,ItSc_IceWave_Fake ,1);
CreateInvItems (slf,ItSc_IceCube_Fake ,3);
CreateInvItems (slf, ItPo_Gegengift, 2);
CreateInvItems (slf, ItPo_ZufallsDrink, 1);
Daniel_ItemsGiven_Chapter_4 = TRUE;
};
if ((Kapitel >= 5)
&& (Daniel_ItemsGiven_Chapter_5 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 321);
CreateInvItems (slf, ItPo_Health_Addon_04, 5);
CreateInvItems (slf, ItPo_Mana_Addon_04, 5);
CreateInvItems (slf,ItPo_Mana_01 ,55);
CreateInvItems (slf,ItPo_Mana_02 , 35);
CreateInvItems (slf,ItPo_Mana_03 , 15);
CreateInvItems (slf,ItPo_Health_01 ,55);
CreateInvItems (slf,ItPo_Health_02 , 30);
CreateInvItems (slf,ItPo_Health_03 , 20);
CreateInvItems (slf,ItPo_Perm_Health, 1);
CreateInvItems (slf, ItPo_Speed, 1);
CreateInvItems (slf,ItSc_Icebolt_Fake ,8);
CreateInvItems (slf,ItSc_IceWave_Fake ,1);
CreateInvItems (slf,ItSc_IceCube_Fake ,3);
CreateInvItems (slf, ItPo_Gegengift, 2);
Daniel_ItemsGiven_Chapter_5 = TRUE;
};
};
|
D
|
module UnrealScript.Engine.K2Input_Float;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.K2Input;
extern(C++) interface K2Input_Float : K2Input
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.K2Input_Float")); }
private static __gshared K2Input_Float mDefaultProperties;
@property final static K2Input_Float DefaultProperties() { mixin(MGDPC("K2Input_Float", "K2Input_Float Engine.Default__K2Input_Float")); }
@property final auto ref float DefaultFloat() { mixin(MGPC("float", 84)); }
}
|
D
|
// Copyright Brian Schott (Hackerpilot) 2014.
// 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 dscanner.analysis.objectconst;
import std.stdio;
import std.regex;
import dparse.ast;
import dparse.lexer;
import dscanner.analysis.base;
import dscanner.analysis.helpers;
import dsymbol.scope_ : Scope;
/**
* Checks that opEquals, opCmp, toHash, 'opCast', and toString are either const,
* immutable, or inout.
*/
final class ObjectConstCheck : BaseAnalyzer
{
alias visit = BaseAnalyzer.visit;
///
this(string fileName, const(Scope)* sc, bool skipTests = false)
{
super(fileName, sc, skipTests);
}
mixin visitTemplate!ClassDeclaration;
mixin visitTemplate!InterfaceDeclaration;
mixin visitTemplate!UnionDeclaration;
mixin visitTemplate!StructDeclaration;
override void visit(const AttributeDeclaration d)
{
if (d.attribute.attribute == tok!"const" && inAggregate)
{
constColon = true;
}
d.accept(this);
}
override void visit(const Declaration d)
{
import std.algorithm : any;
bool setConstBlock;
if (inAggregate && d.attributes && d.attributes.any!(a => a.attribute == tok!"const"))
{
setConstBlock = true;
constBlock = true;
}
if (inAggregate && d.functionDeclaration !is null && !constColon && !constBlock
&& isInteresting(d.functionDeclaration.name.text)
&& !hasConst(d.functionDeclaration.memberFunctionAttributes))
{
addErrorMessage(d.functionDeclaration.name.line,
d.functionDeclaration.name.column, "dscanner.suspicious.object_const",
"Methods 'opCmp', 'toHash', 'opEquals', 'opCast', and/or 'toString' are non-const.");
}
d.accept(this);
if (!inAggregate)
constColon = false;
if (setConstBlock)
constBlock = false;
}
private static bool hasConst(const MemberFunctionAttribute[] attributes)
{
import std.algorithm : any;
return attributes.any!(a => a.tokenType == tok!"const"
|| a.tokenType == tok!"immutable" || a.tokenType == tok!"inout");
}
private static bool isInteresting(string name)
{
return name == "opCmp" || name == "toHash" || name == "opEquals"
|| name == "toString" || name == "opCast";
}
private bool constBlock;
private bool constColon;
}
unittest
{
import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig;
StaticAnalysisConfig sac = disabledConfig();
sac.object_const_check = Check.enabled;
assertAnalyzerWarnings(q{
void testConsts()
{
// Will be ok because all are declared const/immutable
class Cat
{
const bool opEquals(Object a, Object b) // ok
{
return true;
}
const int opCmp(Object o) // ok
{
return 1;
}
const hash_t toHash() // ok
{
return 0;
}
const string toString() // ok
{
return "Cat";
}
}
class Bat
{
const: override string toString() { return "foo"; } // ok
}
class Fox
{
const{ override string toString() { return "foo"; }} // ok
}
// Will warn, because none are const
class Dog
{
bool opEquals(Object a, Object b) // [warn]: Methods 'opCmp', 'toHash', 'opEquals', 'opCast', and/or 'toString' are non-const.
{
return true;
}
int opCmp(Object o) // [warn]: Methods 'opCmp', 'toHash', 'opEquals', 'opCast', and/or 'toString' are non-const.
{
return 1;
}
hash_t toHash() // [warn]: Methods 'opCmp', 'toHash', 'opEquals', 'opCast', and/or 'toString' are non-const.
{
return 0;
}
string toString() // [warn]: Methods 'opCmp', 'toHash', 'opEquals', 'opCast', and/or 'toString' are non-const.
{
return "Dog";
}
}
}
}c, sac);
stderr.writeln("Unittest for ObjectConstCheck passed.");
}
|
D
|
/**
* Benchmark ptr hashing.
*
* Copyright: Copyright Martin Nowak 2011 - 2015.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Martin Nowak
*/
import std.random;
void main(string[] args)
{
auto rnd = Xorshift32(33);
int[int* ] aa;
auto keys = new int*[](32768);
foreach (ref k; keys)
k = new int;
foreach (_; 0 .. 10)
foreach (__; 0 .. 100_000)
++aa[keys[uniform(0, keys.length, rnd)]];
if (aa.length != keys.length)
assert(0);
}
|
D
|
/Users/benjohnson/Desktop/swift-opencl/build/swift-opencl.build/Debug/swift-opencl.build/Objects-normal/x86_64/CLEvent.o : /Users/benjohnson/Desktop/swift-opencl/Sources/CLBuffer.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLCommandQueue.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLContext.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLDevice.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLError.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLEvent.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLInfoProvider.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLKernel.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLMemory.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLPlatform.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLProgram.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLWorkgroup.swift /Users/benjohnson/Desktop/swift-opencl/Sources/Extensions.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/OpenCL.swiftmodule
/Users/benjohnson/Desktop/swift-opencl/build/swift-opencl.build/Debug/swift-opencl.build/Objects-normal/x86_64/CLEvent~partial.swiftmodule : /Users/benjohnson/Desktop/swift-opencl/Sources/CLBuffer.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLCommandQueue.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLContext.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLDevice.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLError.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLEvent.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLInfoProvider.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLKernel.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLMemory.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLPlatform.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLProgram.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLWorkgroup.swift /Users/benjohnson/Desktop/swift-opencl/Sources/Extensions.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/OpenCL.swiftmodule
/Users/benjohnson/Desktop/swift-opencl/build/swift-opencl.build/Debug/swift-opencl.build/Objects-normal/x86_64/CLEvent~partial.swiftdoc : /Users/benjohnson/Desktop/swift-opencl/Sources/CLBuffer.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLCommandQueue.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLContext.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLDevice.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLError.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLEvent.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLInfoProvider.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLKernel.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLMemory.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLPlatform.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLProgram.swift /Users/benjohnson/Desktop/swift-opencl/Sources/CLWorkgroup.swift /Users/benjohnson/Desktop/swift-opencl/Sources/Extensions.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/OpenCL.swiftmodule
|
D
|
// REQUIRED_ARGS: -d
// Test cases using deprecated features
module deprecate1;
import core.stdc.stdio : printf;
import std.traits;
import std.math : isNaN;
/**************************************
volatile
**************************************/
void test5a(int *j)
{
int i;
volatile i = *j;
volatile i = *j;
}
void test5()
{
int x;
test5a(&x);
}
// from test23
static int i2 = 1;
void test2()
{
volatile { int i2 = 2; }
assert(i2 == 1);
}
// bug 1200. Other tests in test42.d
void foo6e() {
volatile debug {}
}
/**************************************
octal literals
**************************************/
void test10()
{
int b = 0b_1_1__1_0_0_0_1_0_1_0_1_0_;
assert(b == 3626);
b = 0_1_2_3_4_;
printf("b = %d\n", b);
assert(b == 668);
}
/**************************************
typedef
**************************************/
template func19( T )
{
typedef T function () fp = &erf;
T erf()
{
printf("erf()\n");
return T.init;
}
}
alias func19!( int ) F19;
F19.fp tc;
void test19()
{
printf("tc = %p\n", tc);
assert(tc() == 0);
}
/**************************************/
// http://www.digitalmars.com/d/archives/digitalmars/D/bugs/578.html
typedef void* T60;
class A60
{
int List[T60][int][uint];
void GetMsgHandler(T60 h,uint Msg)
{
assert(Msg in List[h][0]); //Offending line
}
}
void test60()
{
}
/**************************************/
// http://www.digitalmars.com/d/archives/digitalmars/D/bugs/576.html
typedef ulong[3] BBB59;
template A59()
{
void foo(BBB59 a)
{
printf("A.foo\n");
bar(a);
}
}
struct B59
{
mixin A59!();
void bar(BBB59 a)
{
printf("B.bar\n");
}
}
void test59()
{
ulong[3] aa;
BBB59 a;
B59 b;
b.foo(a);
}
/***************************************/
// From variadic.d
template foo33(TA...)
{
const TA[0] foo33=0;
}
template bar33(TA...)
{
const TA[0..1][0] bar33=TA[0..1][0].init;
}
void test33()
{
typedef int dummy33=0;
typedef int myint=3;
assert(foo33!(int)==0);
assert(bar33!(int)==int.init);
assert(bar33!(myint)==myint.init);
assert(foo33!(int,dummy33)==0);
assert(bar33!(int,dummy33)==int.init);
assert(bar33!(myint,dummy33)==myint.init);
}
/***************************************/
// Bug 875 ICE(glue.c)
void test41()
{
double bongos(int flux, string soup)
{
return 0.0;
}
auto foo = mk_future(& bongos, 99, "soup"[]);
}
int mk_future(A, B...)(A cmd, B args)
{
typedef ReturnType!(A) TReturn;
typedef ParameterTypeTuple!(A) TParams;
typedef B TArgs;
alias Foo41!(TReturn, TParams, TArgs) TFoo;
return 0;
}
class Foo41(A, B, C) {
this(A delegate(B), C)
{
}
}
// Typedef tests from test4.d
/* ================================ */
void test4_test26()
{
typedef int foo = cast(foo)3;
foo x;
assert(x == cast(foo)3);
typedef int bar = 4;
bar y;
assert(y == cast(bar)4);
}
/* ================================ */
struct Foo28
{
int a;
int b = 7;
}
void test4_test28()
{
version (all)
{
int a;
int b = 1;
typedef int t = 2;
t c;
t d = cast(t)3;
assert(int.init == 0);
assert(a.init == 0);
assert(b.init == 0);
assert(t.init == cast(t)2);
assert(c.init == cast(t)2);
printf("d.init = %d\n", d.init);
assert(d.init == cast(t)2);
assert(Foo28.a.init == 0);
assert(Foo28.b.init == 0);
}
else
{
int a;
int b = 1;
typedef int t = 2;
t c;
t d = cast(t)3;
assert(int.init == 0);
assert(a.init == 0);
assert(b.init == 1);
assert(t.init == cast(t)2);
assert(c.init == cast(t)2);
printf("d.init = %d\n", d.init);
assert(d.init == cast(t)3);
assert(Foo28.a.init == 0);
assert(Foo28.b.init == 7);
}
}
// from template4.d test 4
void template4_test4()
{
typedef char Typedef;
static if (is(Typedef Char == typedef))
{
static if (is(Char == char))
{ }
else static assert(0);
}
else static assert(0);
}
// from structlit
typedef int myint10 = 4;
struct S10
{
int i;
union
{ int x = 2;
int y;
}
int j = 3;
myint10 k;
}
void structlit_test10()
{
S10 s = S10( 1 );
assert(s.i == 1);
assert(s.x == 2);
assert(s.y == 2);
assert(s.j == 3);
assert(s.k == 4);
static S10 t = S10( 1 );
assert(t.i == 1);
assert(t.x == 2);
assert(t.y == 2);
assert(t.j == 3);
assert(t.k == 4);
S10 u = S10( 1, 5 );
assert(u.i == 1);
assert(u.x == 5);
assert(u.y == 5);
assert(u.j == 3);
assert(u.k == 4);
static S10 v = S10( 1, 6 );
assert(v.i == 1);
assert(v.x == 6);
assert(v.y == 6);
assert(v.j == 3);
assert(v.k == 4);
}
/******************************************/
void test15_test1()
{
int i;
bool[] b = new bool[10];
for (i = 0; i < 10; i++)
assert(b[i] == false);
typedef bool tbit = true;
tbit[] tb = new tbit[63];
for (i = 0; i < 63; i++)
assert(tb[i] == true);
}
void test15_test2()
{
int i;
byte[] b = new byte[10];
for (i = 0; i < 10; i++)
{ //printf("b[%d] = %d\n", i, b[i]);
assert(b[i] == 0);
}
typedef byte tbyte = 0x23;
tbyte[] tb = new tbyte[63];
for (i = 0; i < 63; i++)
assert(tb[i] == 0x23);
}
void test15_test3()
{
int i;
ushort[] b = new ushort[10];
for (i = 0; i < 10; i++)
{ //printf("b[%d] = %d\n", i, b[i]);
assert(b[i] == 0);
}
typedef ushort tushort = 0x2345;
tushort[] tb = new tushort[63];
for (i = 0; i < 63; i++)
assert(tb[i] == 0x2345);
}
void test15_test4()
{
int i;
float[] b = new float[10];
for (i = 0; i < 10; i++)
{ //printf("b[%d] = %d\n", i, b[i]);
assert(isNaN(b[i]));
}
typedef float tfloat = 0.0;
tfloat[] tb = new tfloat[63];
for (i = 0; i < 63; i++)
assert(tb[i] == cast(tfloat)0.0);
}
/************************************/
// failed to compile on DMD0.050, only with typedef (alias was OK)
typedef int[int] T11;
T11 a11;
void test15_test11()
{
1 in a11;
}
/************************************/
// ICE(cgelem.c) on 0.050, alias was OK.
struct A12
{
int x;
int y;
int x1;
int x2;
}
typedef A12 B12;
template V12(T)
{
T buf;
T get()
{
return buf;
}
}
alias V12!(B12) foo12;
void test15_test12()
{
B12 b = foo12.get();
}
/************************************/
// test15_test13. Failed to compile DMD0.050, OK with alias.
typedef int[] T13;
static T13 a13=[1,2,3];
/************************************************/
// Failed to compile DMD0.050, OK with alias.
typedef int foo3;
foo3 [foo3] list3;
void testaa_test3()
{
list3[cast(foo3)5] = cast(foo3)2;
foo3 x = list3.keys[0]; // This line fails.
assert(x == cast(foo3)5);
}
/*****************************************/
void test20_test32()
{
typedef int Type = 12;
static Type[5] var = [0:1, 3:2];
assert(var[0] == 1);
assert(var[1] == 12);
assert(var[2] == 12);
assert(var[3] == 2);
assert(var[4] == 12);
}
/**************************************/
class A2
{
T opCast(T)()
{
auto s = T.stringof;
printf("A.opCast!(%.*s)\n", s.length, s.ptr);
return T.init;
}
}
void opover2_test2()
{
auto a = new A2();
auto x = cast(int)a;
assert(x == 0);
typedef int myint_BUG6712 = 7;
auto y = cast(myint_BUG6712)a;
assert(y == 7);
}
/**************************************/
// http://www.digitalmars.com/d/archives/10750.html
// test12.d, test7(). ICE(constfold.c)
template base7( T )
{
void errfunc() { throw new Exception("no init"); }
typedef T safeptr = cast(T)&errfunc;
}
alias int function(int) mfp;
alias base7!(mfp) I_V_fp;
typedef bool antibool = 1;
antibool[8] z21 = [ cast(antibool) 0, ];
void test12_test21()
{
assert(z21[7]);
}
/**************************************/
// test12.d, test41.
// Might be related to this:
// http://www.digitalmars.com/d/archives/digitalmars/D/INVALID_HANDLE_VALUE_const_55633.html
typedef void* H41;
const H41 INVALID_H41_VALUE = cast(H41)-1;
/*******************************************/
struct Ranged(T)
{
T value, min, max, range;
}
typedef Ranged!(float) Degree = {0f, 0f, 360f, 360f};
void test28_test5()
{
static Degree a;
assert(a.value == 0f);
assert(a.min == 0f);
assert(a.max == 360f);
assert(a.range == 360f);
}
/*******************************************/
void test28_test6()
{
struct Foo
{
void foo() { }
}
typedef Foo Bar;
Bar a;
a.foo();
}
/*******************************************/
typedef uint socket_t = -1u;
class Socket
{
socket_t sock;
void accept()
{
socket_t newsock;
}
}
void test28_test16()
{
}
/*******************************************/
typedef int Xint = 42;
void test28_test56()
{
Xint[3][] x = new Xint[3][4];
foreach(Xint[3] i; x) {
foreach (Xint j; i)
assert(j == 42);
}
}
void test28_test57()
{
Xint[3][] x = new Xint[3][4];
x.length = 200;
assert(x.length == 200);
foreach(Xint[3] i; x) {
foreach (Xint j; i)
assert(j == 42);
}
}
/******************************************/
// from runnable/traits.d
typedef int traits_myint;
static assert(__traits(isArithmetic, traits_myint) == true);
static assert(__traits(isScalar, traits_myint) == true);
static assert(__traits(isIntegral, traits_myint) == true);
mixin template Members6674()
{
static int i1;
static int i2;
static int i3; //comment out to make func2 visible
static int i4; //comment out to make func1 visible
}
class Test6674
{
mixin Members6674;
typedef void function() func1;
typedef bool function() func2;
}
static assert([__traits(allMembers,Test6674)] == [
"i1","i2","i3","i4",
"func1","func2",
"toString","toHash","opCmp","opEquals","Monitor","factory"]);
/***************************************************/
// Bug 1523. typedef only.
struct BaseStruct {
int n;
char c;
}
typedef BaseStruct MyStruct26;
void myFunction(MyStruct26) {}
void test42_test26()
{
myFunction(MyStruct26(0, 'x'));
}
/***************************************************/
// typedef only
class Foo30
{
int i;
}
typedef Foo30 Bar30;
void test42_test30()
{
Bar30 testBar = new Bar30();
auto j = testBar.i;
}
/***************************************************/
// test55. bug 1767
class DebugInfo
{
typedef int CVHeaderType ;
enum anon:CVHeaderType{ CV_NONE, CV_DOS, CV_NT, CV_DBG }
}
/***************************************************/
void test42_test102()
{
typedef const(char)[] A;
A stripl(A s)
{
uint i;
return s[i .. $];
}
}
/***************************************************/
// test42.d test107(). segfault 2.020
class foo107 {}
typedef foo107 bar107;
void x107()
{
bar107 a = new bar107();
bar107 b = new bar107();
bool c = (a == b);
}
/***************************************************/
// Bug 3668. segfault regression 2.032.
void test42_test167()
{
typedef byte[] Foo;
Foo bar;
foreach(value; bar){}
}
// Bug 190. Test42.d, test 225.
typedef int avocado;
void eat(avocado x225 = .x225);
avocado x225;
/***************************************************/
typedef ireal BUG3919;
alias typeof(BUG3919.init*BUG3919.init) ICE3919;
alias typeof(BUG3919.init/BUG3919.init) ICE3920;
/*****************************************/
// rejectsvalid 0.100. typedef only.
void testswitch_test18()
{
enum E { a, b }
typedef E F;
F i = E.a;
final switch (i)
{
case E.a:
case E.b:
break;
}
}
/************************************/
void testconst_test7()
{
typedef void *HANDLE;
const HANDLE INVALID_HANDLE_VALUE = cast(HANDLE)-1;
}
/************************************/
void testconst_test67()
{
typedef char mychar;
alias immutable(mychar)[] mystring;
mystring s = cast(mystring)"hello";
mychar c = s[0];
}
/************************************/
void testconst_test71()
{
string s = "hello world";
char c = s[0];
typedef char mychar;
alias immutable(mychar)[] mystring;
mystring t = cast(mystring)("hello world");
mychar d = t[0];
}
/************************************/
class foo86 { }
typedef shared foo86 Y86;
void testconst_test86()
{
pragma(msg, Y86);
shared(Y86) x = new Y86;
}
/************************************/
class Class19 : Throwable
{
this() { super(""); }
}
typedef Class19 Alias19;
void testdstress_test19()
{
try{
throw new Alias19();
}catch{
return;
}
assert(0);
}
/************************************/
public static const uint U20 = (cast(uint)(-1)) >>> 2;
typedef uint myType20;
public static const myType20 T20 = (cast(myType20)(-1)) >>> 2;
void testdstress_test20()
{
assert(U20 == 0x3FFFFFFF);
assert(T20 == 0x3FFFFFFF);
}
/******************************************************/
class ABC { }
typedef ABC DEF;
TypeInfo foo()
{
ABC c;
return typeid(DEF);
}
void testtypeid_test1()
{
TypeInfo ti = foo();
TypeInfo_Typedef td = cast(TypeInfo_Typedef)ti;
assert(td);
ti = td.base;
TypeInfo_Class tc = cast(TypeInfo_Class)ti;
assert(tc);
printf("%.*s\n", tc.info.name.length, tc.info.name.ptr);
assert(tc.info.name == "deprecate1.ABC");
}
/******************************************************/
union MyUnion5{
int i;
byte b;
}
typedef MyUnion5* Foo5;
void testtypeid_test5()
{
TypeInfo ti = typeid(Foo5);
assert(!(ti is null));
assert(ti.tsize==(Foo5).sizeof);
assert(ti.toString()=="deprecate1.Foo5");
}
/***********************************/
// test8.d test13()
typedef void *HWND;
const HWND hWnd = cast(HWND)(null);
/***********************************/
typedef int* IP;
void test8_test21()
{
int i = 5;
IP ip = cast(IP) &i;
assert(*ip == 5);
}
/***********************************/
// http://www.digitalmars.com/d/archives/7812.html
typedef int delegate() DG;
class A23 {
int foo() { return 7; }
DG pfoo() { return &this.foo; } //this is ok
}
void test8_test23()
{
int i;
A23 a = new A23;
DG dg = &a.foo;
i = dg();
assert(i == 7);
DG dg2 = a.pfoo();
i = dg2();
assert(i == 7);
}
/***********************************/
// test8 test29()
typedef int[] tint;
void Set( ref tint array, int newLength )
{
array.length= newLength;
}
/***********************************/
struct V41 { int x; }
typedef V41 W41 = { 3 };
class Node41
{
W41 v;
}
void test8_test41()
{
Node41 n = new Node41;
printf("n.v.x == %d\n", n.v.x);
assert(n.v.x == 3);
}
/***********************************/
// http://www.digitalmars.com/d/archives/digitalmars/D/bugs/1801.html
// test8 test47. ICE(e2ir.c)
typedef string Qwert47;
string yuiop47(Qwert47 asdfg)
{
return asdfg[4..6];
}
/***********************************/
void test22_test28()
{
typedef cdouble Y;
Y five = cast(Y) (4.0i + 0.4);
}
/*******************************************/
// Bug 184
struct vegetarian
{
carrots areYummy;
}
typedef ptrdiff_t carrots;
void test23_test35()
{
assert(vegetarian.sizeof == ptrdiff_t.sizeof);
}
/*******************************************/
// bug 185
void test23_test36()
{
typedef double type = 5.0;
type t;
assert (t == type.init);
type[] ts = new type[10];
ts.length = 20;
foreach (i; ts)
{
assert(i == cast(type)5.0);
}
}
/*******************************************/
typedef int Int1;
typedef int Int2;
int show(Int1 v)
{
printf("Int1: %d", v);
return 1;
}
int show(Int2 v) {
printf("Int2: %d", v);
return 2;
}
int show(int i) {
printf("int: %d", i);
return 3;
}
int show(long l) {
printf("long: %d", l);
return 4;
}
int show(uint u) {
printf("uint: %d", u);
return 5;
}
void test23_test49()
{ int i;
Int1 value1 = 42;
Int2 value2 = 69;
i = show(value1 + value2);
assert(i == 3);
i = show(value2 + value1);
assert(i == 3);
i = show(2 * value1);
assert(i == 3);
i = show(value1 * 2);
assert(i == 3);
i = show(value1 + value1);
assert(i == 1);
i = show(value2 - value2);
assert(i == 2);
i = show(value1 + 2);
assert(i == 3);
i = show(3 + value2);
assert(i == 3);
i = show(3u + value2);
assert(i == 5);
i = show(value1 + 3u);
assert(i == 5);
long l = 23;
i = show(value1 + l);
assert(i == 4);
i = show(l + value2);
assert(i == 4);
short s = 105;
i = show(s + value1);
assert(i == 3);
i = show(value2 + s);
assert(i == 3);
}
/*******************************************/
void test23_test51()
{
typedef int fooQ = 10;
int[3][] p = new int[3][5];
int[3][] q = new int[3][](5);
int[][] r = new int[][](5,3);
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 3; j++)
{
assert(r[i][j] == 0);
r[i][j] = i * j;
}
}
fooQ[][] s = new fooQ[][](5,3);
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 3; j++)
{
assert(s[i][j] == 10);
s[i][j] = cast(fooQ)(i * j);
}
}
typedef fooQ[][] barQ;
barQ b = new barQ(5,3);
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 3; j++)
{
assert(b[i][j] == 10);
b[i][j] = cast(fooQ)(i * j);
}
}
}
/*******************************************/
typedef ubyte x53 = void;
void test23_test53()
{
new x53[10];
}
/*******************************************/
void test23_test55()
{
typedef uint myintX = 6;
myintX[500][] data;
data.length = 1;
assert(data.length == 1);
foreach (ref foo; data)
{
assert(foo.length == 500);
foreach (ref u; foo)
{ //printf("u = %u\n", u);
assert(u == 6);
u = 23;
}
}
foreach (ref foo; data)
{
assert(foo.length == 500);
foreach (u; foo)
{ assert(u == 23);
auto v = u;
v = 23;
}
}
typedef byte mybyte = 7;
mybyte[500][] mata;
mata.length = 1;
assert(mata.length == 1);
foreach (ref foo; mata)
{
assert(foo.length == 500);
foreach (ref u; foo)
{ //printf("u = %u\n", u);
assert(u == 7);
u = 24;
}
}
foreach (ref foo; mata)
{
assert(foo.length == 500);
foreach (u; foo)
{ assert(u == 24);
auto v = u;
v = 24;
}
}
}
/*******************************************/
typedef string String67;
int f67( string c, string a )
{
return 1;
}
int f67( string c, String67 a )
{
return 2;
}
void test23_test67()
{
printf("test67()\n");
int i;
i = f67( "", "" );
assert(i == 1);
i = f67( "", cast(String67)"" );
assert(i == 2);
i = f67( null, "" );
assert(i == 1);
i = f67( null, cast(String67)"" );
assert(i == 2);
}
/************************************************/
void test34_test14()
{
typedef Exception TypedefException;
try
{
}
catch(TypedefException e)
{
}
}
/************************************************/
void test34_test52()
{
struct Foo {
typedef int Y;
}
with (Foo) {
Y y;
}
}
/***************************************************/
void test6289()
{
typedef immutable(int)[] X;
static assert(is(typeof(X.init[]) == X));
static assert(is(typeof((immutable(int[])).init[]) == immutable(int)[]));
static assert(is(typeof((const(int[])).init[]) == const(int)[]));
static assert(is(typeof((const(int[3])).init[]) == const(int)[]));
}
/***************************************************/
// 4237
struct Struct4237(T) { T value; }
void foo4237()
{
typedef int Number = 1;
Struct4237!Number s;
pragma(msg, typeof(s).mangleof);
assert(s.value == 1);
}
void bar4237()
{
typedef real Number = 2;
Struct4237!Number s;
pragma(msg, typeof(s).mangleof);
assert(s.value == 2); // Assertion failure
}
void test4237()
{
foo4237(); bar4237();
}
/******************************************/
// 3990
void test3990()
{
int[] a1 = [5, 4, 3];
assert(*a1 == 5);
alias typeof(a1) T1;
assert(is(typeof(*T1)));
int[3] a2 = [5, 4, 3];
assert(*a2 == 5);
alias typeof(a2) T2;
assert(is(typeof(*T2)));
}
/******************************************/
// from extra-files/test2.d
typedef void* HANDLE18;
HANDLE18 testx18()
{
return null;
}
void test18()
{
assert(testx18() is null);
}
/******************************************/
int main()
{
test2();
test5();
test10();
test19();
test33();
test41();
test59();
test60();
test4_test26();
test4_test28();
structlit_test10();
test15_test1();
test15_test2();
test15_test3();
test15_test4();
test15_test11();
test15_test12();
test20_test32();
opover2_test2();
test12_test21();
test28_test5();
test28_test6();
test28_test16();
test28_test56();
test28_test57();
testaa_test3();
test42_test26();
test42_test30();
test42_test102();
test42_test167();
testswitch_test18();
testconst_test7();
testconst_test67();
testconst_test71();
testconst_test86();
testdstress_test19();
testdstress_test20();
testtypeid_test1();
testtypeid_test5();
test8_test21();
test8_test23();
test8_test41();
test22_test28();
test23_test35();
test23_test36();
test23_test49();
test23_test51();
test23_test53();
test23_test55();
test23_test67();
test34_test14();
test34_test52();
test3990();
test6289();
test4237();
test18();
return 0;
}
|
D
|
module decisionmakers.changepassword;
import std.exception;
import std.stdio;
import vibe.vibe;
import validators.all;
import command.decisionmakerinterface;
import command.all;
import commands.changepassword;
import helpers.testhelper;
struct ChangePasswordFacts
{
bool userLoggedIn;
bool repeatedPasswordMatches;
bool existingPasswordIsCorrect;
ulong usrId;
string password;
}
class ChangePasswordDM : AbstractDecisionMaker,DecisionMakerInterface
{
private ChangePasswordFacts facts;
public this(ref ChangePasswordFacts facts) @safe
{
enforce(facts.userLoggedIn, "Sorry, you must be logged in to perform this action.");
enforce(facts.repeatedPasswordMatches, "Sorry, your repeated password does not match the new password.");
enforce(facts.existingPasswordIsCorrect, "Sorry, your current password doesn't match what you've entered as your existing password.");
(new Password(facts.password, "password"));
(new PositiveNumber!ulong(facts.usrId, "usrId"));
this.facts = facts;
this.executeCommandsAsyncronously = true;
}
public void issueCommands(CommandBusInterface commandBus) @safe
{
auto command = new ChangePasswordCommand(
this.facts.usrId,
this.facts.password
);
commandBus.append(command, typeid(ChangePasswordCommand));
}
}
unittest {
ChangePasswordFacts facts;
facts.usrId = 1;
facts.password = "MyNewCrazyPassword";
// Test passing facts
function (ref ChangePasswordFacts facts) {
facts.userLoggedIn = true;
facts.repeatedPasswordMatches = true;
facts.existingPasswordIsCorrect = true;
TestHelper.testDecisionMaker!(
ChangePasswordDM,
ChangePasswordFacts,
)(facts, 1, false);
}(facts);
// Test failing facts
function (ref ChangePasswordFacts facts) {
facts.userLoggedIn = false;
facts.repeatedPasswordMatches = true;
facts.existingPasswordIsCorrect = true;
TestHelper.testDecisionMaker!(
ChangePasswordDM,
ChangePasswordFacts
)(facts, 0, true);
}(facts);
// Test failing facts
function (ref ChangePasswordFacts facts) {
facts.userLoggedIn = true;
facts.repeatedPasswordMatches = false;
facts.existingPasswordIsCorrect = true;
TestHelper.testDecisionMaker!(
ChangePasswordDM,
ChangePasswordFacts
)(facts, 0, true);
}(facts);
// Test failing facts
function (ref ChangePasswordFacts facts) {
facts.userLoggedIn = true;
facts.repeatedPasswordMatches = true;
facts.existingPasswordIsCorrect = false;
TestHelper.testDecisionMaker!(
ChangePasswordDM,
ChangePasswordFacts
)(facts, 0, true);
}(facts);
}
|
D
|
module file.replay.playerio;
/*
* Player and handicap serialization to/from text files.
* See net.handicap for serialization to/from binary network packages.
*/
import std.algorithm;
import std.conv;
import std.string;
import enumap;
static import basics.globals;
import file.io;
import net.handicap;
import net.plnr;
import net.profile;
import net.style;
package:
/*
* Usage:
* 1. Feed us as many IoLines in here as you want. You should feed all
* "+"-lines from the replay. We'll discard all others.
* 2. Call loseOwnershipOfProfileArray() and assign it where you want.
* 3. Let the parser object go out of scope.
*/
struct ProfileImporter {
private:
Profile[PlNr] ret;
public:
void parse(in IoLine i)
{
if (i.text1 != basics.globals.replayPlayer
&& i.text1 != basics.globals.replayFriend
&& i.text1 != basics.globals.replaySingleHandi
) {
return;
}
immutable plnr = PlNr(i.nr1 & 0xFF);
touch(plnr);
// For back-compat, we accept the FRIEND directive, even though
// since March 2018, we only write PLAYER directives.
if (i.text1 == basics.globals.replayPlayer
|| i.text1 == basics.globals.replayFriend
) {
addNameAndStyleTo(ret[plnr], i);
}
else {
addHandicapTo(ret[plnr].handicap, i);
}
}
Profile[PlNr] loseOwnershipOfProfileArray()
{
auto temp = ret;
ret = null;
return temp;
}
private:
void touch(in PlNr plnr)
{
const p = plnr in ret;
if (p is null) {
ret[plnr] = Profile();
}
}
static void addNameAndStyleTo(ref Profile p, in IoLine i)
{
p.style = stringToStyle(i.text2);
p.name = i.text3;
}
static void addHandicapTo(ref Handicap h, in IoLine i)
{
foreach (key, word; handiKeywords.byKeyValue) {
if (word == i.text2) {
addHandicapTo(h, key, i.text3);
return;
}
}
}
static void addHandicapTo(ref Handicap h, in HandiKey key, in string val)
{
try final switch (key) {
case HandiKey.initialLix:
h.initialLix = val.stringToFrac;
break;
case HandiKey.initialSkills:
h.initialSkills = val.stringToFrac;
break;
case HandiKey.delayInPhyus:
h.delayInPhyus = val.to!short;
break;
case HandiKey.score:
h.score = val.stringToFrac;
break;
}
catch (Exception) {}
}
}
/*
* We own only a reference to somebody else's Profile[PlNr].
* We expect other code not to modify that Profile[PlNr] while we iterate.
*/
struct ProfileExporter {
private:
const(Profile[PlNr]) _source;
SingleProfileExporter _single;
public:
this(const(Profile[PlNr]) src) pure nothrow @safe @nogc
{
_source = src;
if (_source.length == 0) {
assert (empty);
return;
}
immutable PlNr minpl = _source.byKey.fold!min(_source.byKey.front);
_single = SingleProfileExporter(minpl, *(minpl in _source));
}
bool empty() const pure nothrow @safe @nogc { return _single.empty; }
IoLine front() const { return _single.front; }
void popFront() @nogc
{
_single.popFront;
if (! _single.empty) {
return;
}
PlNr next = _single.plnr; // Find next-bigger after _single.plnr.
foreach (PlNr i; _source.byKey) {
if (i > _single.plnr && (next == _single.plnr || i < next)) {
next = i;
}
}
if (next != _single.plnr) {
_single = SingleProfileExporter(next, *(next in _source));
assert (! _single.empty && ! empty);
}
}
}
private:
struct SingleProfileExporter {
private:
Profile _source;
PlNr _plnr;
bool _empty = true; // To be overwritten with false in non-default ctor.
bool _wrotePlayerLine = false;
HandiKey _nextKey = HandiKey.initialLix;
public:
this(in PlNr plnr, in Profile prof) pure nothrow @safe @nogc
{
_plnr = plnr;
_source = prof;
_empty = false;
}
PlNr plnr() const pure nothrow @safe @nogc { return _plnr; }
bool empty() const pure nothrow @safe @nogc { return _empty; }
IoLine front() const
{
assert (! empty);
if (! _wrotePlayerLine) {
return IoLine.Plus(basics.globals.replayPlayer, _plnr,
styleToString(_source.style), _source.name);
}
IoLine ret = IoLine.Plus(basics.globals.replaySingleHandi, _plnr,
handiKeywords[_nextKey], "");
final switch (_nextKey) {
case HandiKey.initialLix:
ret.text3 = _source.handicap.initialLix.fracToString;
break;
case HandiKey.initialSkills:
ret.text3 = _source.handicap.initialSkills.fracToString;
break;
case HandiKey.delayInPhyus:
ret.text3 = _source.handicap.delayInPhyus.to!string;
break;
case HandiKey.score:
ret.text3 = _source.handicap.score.fracToString;
break;
}
return ret;
}
void popFront() @nogc
{
if (! _wrotePlayerLine) {
_wrotePlayerLine = true;
if (_source.handicap.initialLix != Fraction.init)
return;
}
if (_nextKey == HandiKey.initialLix) {
_nextKey = HandiKey.initialSkills;
if (_source.handicap.initialSkills != Fraction.init)
return;
}
if (_nextKey == HandiKey.initialSkills) {
_nextKey = HandiKey.delayInPhyus;
if (_source.handicap.delayInPhyus != short.init)
return;
}
if (_nextKey == HandiKey.delayInPhyus) {
_nextKey = HandiKey.score;
if (_source.handicap.score != Fraction.init)
return;
}
if (_nextKey == HandiKey.score) {
_empty = true;
}
}
}
enum HandiKey {
initialLix,
initialSkills,
delayInPhyus,
score,
}
immutable Enumap!(HandiKey, string) handiKeywords = enumap.enumap(
HandiKey.initialLix, "LixInHatch",
HandiKey.initialSkills, "SkillsInPanel",
HandiKey.delayInPhyus, "SpawnDelayInPhyus",
HandiKey.score, "Score");
string fracToString(in Fraction frac)
{
return "%d/%d".format(frac.numerator, frac.denominator);
}
Fraction stringToFrac(in string s) pure nothrow @safe
{
try {
immutable slash = s.countUntil('/');
alias Num = typeof(Fraction.numerator());
if (slash < 0) {
return Fraction(s[].strip.to!Num, 1);
}
// Slash found. Parse two ints.
return Fraction(s[0 .. slash].strip.to!Num,
s[slash + 1 .. $].strip.to!Num);
}
catch (Exception) {
return Fraction.init;
}
}
unittest {
assert (stringToFrac("12/34") == Fraction(12, 34));
assert (stringToFrac(" 12 / 35 ") == Fraction(12, 35));
assert (stringToFrac("-2/-3") == Fraction(2, 3));
assert (stringToFrac("5/-3") == Fraction(-5, 3));
assert (stringToFrac("5") == Fraction(5, 1));
assert (stringToFrac("Rubbish") == Fraction.init);
assert (stringToFrac("Rubbish/More Rubbish") == Fraction.init);
assert (stringToFrac("3/Rubbish") == Fraction.init);
}
version (unittest) {
Profile unittestGuy()
{
Profile p;
p.name = "TestGuy";
p.style = Style.orange;
p.handicap.initialLix = Fraction(2, 3);
p.handicap.delayInPhyus = 10*15;
return p;
}
Profile unittestLady()
{
Profile p;
p.name = "TestLady";
p.style = Style.red;
p.handicap.initialSkills = Fraction(5, 6);
p.handicap.score = Fraction(1, 2);
return p;
}
}
unittest {
Profile tg = unittestGuy();
assert (SingleProfileExporter(PlNr(3), tg)
.map!(line => line.toString)
.equal(["+PLAYER 3 Orange TestGuy",
"+HANDICAP 3 LixInHatch 2/3",
"+HANDICAP 3 SpawnDelayInPhyus 150"]));
tg.handicap = Handicap.init;
assert (SingleProfileExporter(PlNr(7), tg)
.map!(line => line.toString)
.equal(["+PLAYER 7 Orange TestGuy"]));
}
unittest {
Profile[PlNr] arr;
assert (ProfileExporter(arr).empty);
arr[PlNr(2)] = unittestLady();
arr[PlNr(0)] = unittestGuy();
assert (ProfileExporter(arr)
.map!(line => line.toString)
.equal(["+PLAYER 0 Orange TestGuy",
"+HANDICAP 0 LixInHatch 2/3",
"+HANDICAP 0 SpawnDelayInPhyus 150",
"+PLAYER 2 Red TestLady",
"+HANDICAP 2 SkillsInPanel 5/6",
"+HANDICAP 2 Score 1/2"]));
ProfileImporter importer;
foreach (ioLine; ProfileExporter(arr)) {
importer.parse(ioLine);
}
Profile[PlNr] copied = importer.loseOwnershipOfProfileArray();
assert (copied == arr);
assert (ProfileExporter(copied).map!(line => line.toString)
.equal(ProfileExporter(arr).map!(line => line.toString)));
}
|
D
|
a treatise advancing a new point of view resulting from research
|
D
|
instance GUR_1209_BaalOrun(Npc_Default)
{
name[0] = "Baal Orun";
npcType = npctype_main;
guild = GIL_GUR;
level = 28;
flags = NPC_FLAG_IMMORTAL;
voice = 12;
id = 1209;
attribute[ATR_STRENGTH] = 70;
attribute[ATR_DEXTERITY] = 50;
attribute[ATR_MANA_MAX] = 60;
attribute[ATR_MANA] = 60;
attribute[ATR_HITPOINTS_MAX] = 418;
attribute[ATR_HITPOINTS] = 418;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Psionic",20,1,gur_armor_m);
B_Scale(self);
Mdl_SetModelFatness(self,-1);
Npc_SetTalentSkill(self,NPC_TALENT_MAGE,6);
EquipItem(self,Oruns_Keule);
daily_routine = Rtn_start_1209;
fight_tactic = FAI_HUMAN_MAGE;
};
func void Rtn_start_1209()
{
TA_Boss(7,0,0,0,"PSI_PATH_2_6");
TA_Sleep(0,0,7,0,"PSI_TREE_IN");
};
func void rtn_ritual_1209()
{
TA_Stay(5,0,1,0,"GURU_RITUAL_04");
TA_Stay(1,0,5,0,"GURU_RITUAL_04");
};
|
D
|
/Users/DanielChang/Documents/Vapor/Hello/.build/debug/Leaf.build/Leaf.swift.o : /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/libc.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Node.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/PathIndexable.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Polymorphic.swiftmodule
/Users/DanielChang/Documents/Vapor/Hello/.build/debug/Leaf.build/Leaf~partial.swiftmodule : /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/libc.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Node.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/PathIndexable.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Polymorphic.swiftmodule
/Users/DanielChang/Documents/Vapor/Hello/.build/debug/Leaf.build/Leaf~partial.swiftdoc : /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/libc.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Node.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/PathIndexable.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/Polymorphic.swiftmodule
|
D
|
module mysql.exception;
class MySQLException : Exception {
this(string msg, string file = __FILE__, size_t line = __LINE__) pure {
super(msg, file, line);
}
}
class MySQLConnectionException: MySQLException {
this(string msg, string file = __FILE__, size_t line = __LINE__) pure {
super(msg, file, line);
}
}
class MySQLProtocolException: MySQLException {
this(string msg, string file = __FILE__, size_t line = __LINE__) pure {
super(msg, file, line);
}
}
class MySQLErrorException : Exception {
this(string msg, string file = __FILE__, size_t line = __LINE__) pure {
super(msg, file, line);
}
}
class MySQLDuplicateEntryException : MySQLErrorException {
this(string msg, string file = __FILE__, size_t line = __LINE__) pure {
super(msg, file, line);
}
}
|
D
|
// idt.d - all the idt goodness you can handle
module kernel.idt;
import kernel.vga;
static import gdt = kernel.gdt;
import kernel.core.util;
import kernel.mem.vmem;
alias gdt.IntGateDesc64 IDTEntry;
public align(1) struct IDTPtr
{
ushort limit;
ulong base;
}
public extern(C) IDTPtr idtp;
public enum StackType : uint
{
StackFault = 1,
DoubleFault,
NMI,
Debug,
MCE
}
/* Declare an IDT of 256 entries. Although we will only use the
* first 32 entries in this tutorial, the rest exists as a bit
* of a trap. If any undefined IDT entry is hit, it normally
* will cause an "Unhandled Interrupt" exception. Any descriptor
* for which the 'presence' bit is cleared (0) will generate an
* "Unhandled Interrupt" exception */
IDTEntry[256] Entries;
public void setGate(uint num, gdt.SysSegType64 gateType, ulong funcPtr, uint dplFlags, uint istFlags)
{
with(Entries[num])
{
target_lo = funcPtr & 0xFFFF;
segment = 0x10;
ist = istFlags;
p = 1;
dpl = dplFlags;
type = cast(uint)gateType;
target_mid = (funcPtr >> 16) & 0xFFFF;
target_hi = funcPtr >> 32;
}
}
void setIntGate(uint num, void* funcPtr, uint ist = 0)
{
setGate(num, gdt.SysSegType64.IntGate, cast(ulong)funcPtr, 0, ist);
}
void setSysGate(uint num, void* funcPtr, uint ist = 0)
{
setGate(num, gdt.SysSegType64.IntGate, cast(ulong)funcPtr, 3, ist);
}
void install()
{
idtp.limit = (IDTEntry.sizeof * Entries.length) - 1;
idtp.base = cast(ulong)Entries.ptr;
setIntGate(0, &isr0);
setIntGate(1, &isr1, StackType.Debug);
setIntGate(2, &isr2, StackType.NMI);
setSysGate(3, &isr3, StackType.Debug);
setSysGate(4, &isr4);
setIntGate(5, &isr5);
setIntGate(6, &isr6);
setIntGate(7, &isr7);
setIntGate(8, &isr8, StackType.DoubleFault);
setIntGate(9, &isr9);
setIntGate(10, &isr10);
setIntGate(11, &isr11);
setIntGate(12, &isr12, StackType.StackFault);
setIntGate(13, &isr13);
setIntGate(14, &isr14);
setIntGate(15, &isr15);
setIntGate(16, &isr16);
setIntGate(17, &isr17);
setIntGate(18, &isr18, StackType.MCE);
setIntGate(19, &isr19);
setIntGate(20, &isr20);
setIntGate(21, &isr21);
setIntGate(22, &isr22);
setIntGate(23, &isr23);
setIntGate(24, &isr24);
setIntGate(25, &isr25);
setIntGate(26, &isr26);
setIntGate(27, &isr27);
setIntGate(28, &isr28);
setIntGate(29, &isr29);
setIntGate(30, &isr30);
setIntGate(31, &isr31);
setSysGate(0x80, &isr128);
asm { "lidt (idtp)"; }
}
/*
Exception# Description Error Code?
0 Division By Zero Exception No
1 Debug Exception No
2 Non Maskable Interrupt Exception No
3 Breakpoint Exception No
4 Into Detected Overflow Exception No
5 Out of Bounds Exception No
6 Invalid Opcode Exception No
7 No Coprocessor Exception No
8 Double Fault Exception Yes
9 Coprocessor Segment Overrun Exception No
10 Bad TSS Exception Yes
11 Segment Not Present Exception Yes
12 Stack Fault Exception Yes
13 General Protection Fault Exception Yes
14 Page Fault Exception Yes
15 Unknown Interrupt Exception No
16 Coprocessor Fault Exception No
17 Alignment Check Exception (486+) No
18 Machine Check Exception (Pentium/586+) No
19 to 31 Reserved Exceptions No
*/
template ISR(int num, bool needDummyError = true)
{
const char[] ISR =
"extern(C) void isr" ~ num.stringof ~ "()
{
asm
{
naked; " ~
(needDummyError ? "`pushq $0`;" : "") ~
"`pushq $" ~ num.stringof ~ "`;
`jmp isr_common`;
}
}";
}
mixin(ISR!(0));
mixin(ISR!(1));
mixin(ISR!(2));
mixin(ISR!(3));
mixin(ISR!(4));
mixin(ISR!(5));
mixin(ISR!(6));
mixin(ISR!(7));
mixin(ISR!(8, false));
mixin(ISR!(9));
mixin(ISR!(10, false));
mixin(ISR!(11, false));
mixin(ISR!(12, false));
mixin(ISR!(13, false));
mixin(ISR!(14, false));
mixin(ISR!(15));
mixin(ISR!(16));
mixin(ISR!(17));
mixin(ISR!(18));
mixin(ISR!(19));
mixin(ISR!(20));
mixin(ISR!(21));
mixin(ISR!(22));
mixin(ISR!(23));
mixin(ISR!(24));
mixin(ISR!(25));
mixin(ISR!(26));
mixin(ISR!(27));
mixin(ISR!(28));
mixin(ISR!(29));
mixin(ISR!(30));
mixin(ISR!(31));
mixin(ISR!(128));
extern(C) void isr_common()
{
asm
{
naked;
"pushq %%rax";
"pushq %%rbx";
"pushq %%rcx";
"pushq %%rdx";
"pushq %%rsi";
"pushq %%rdi";
"pushq %%rbp";
"pushq %%r8";
"pushq %%r9";
"pushq %%r10";
"pushq %%r11";
"pushq %%r12";
"pushq %%r13";
"pushq %%r14";
"pushq %%r15";
// we don't have to push %rsp, %rip and flags; they are pushed
// automatically on an interrupt
"mov %%rsp, %%rdi";
"call faultHandler";
"popq %%r15";
"popq %%r14";
"popq %%r13";
"popq %%r12";
"popq %%r11";
"popq %%r10";
"popq %%r9";
"popq %%r8";
"popq %%rbp";
"popq %%rdi";
"popq %%rsi";
"popq %%rdx";
"popq %%rcx";
"popq %%rbx";
"popq %%rax";
// A haiku
// We need to print a stack trace
// I hate a-s-m
// This is a job for Jarrett
// Cleans up the pushed error code and pushed ISR num
"add $16, %%rsp";
"iretq"; /* pops 5 things in order: rIP, CS, rFLAGS, rSP, and SS */
}
}
enum Type
{
DivByZero = 0,
Debug = 1,
NMI = 2,
Breakpoint = 3,
INTO = 4,
OutOfBounds = 5,
InvalidOpcode = 6,
NoCoproc = 7,
DoubleFault = 8,
CoprocSegOver = 9,
BadTSS = 10,
SegNotPresent = 11,
StackFault = 12,
GPF = 13,
PageFault = 14,
UnknownInterrupt = 15,
CoprocFault = 16,
AlignCheck = 17,
MachineCheck = 18,
Syscall = 128
}
private const char[][] exceptionMessages =
[
"Division By Zero", //0
"Debug", //1
"Non Maskable Interrupt", //2
"Breakpoint Exception", //3
"Into Detected Overflow Exception", //4
"Out of Bounds Exception", //5
"Invalid Opcode Exception", //6
"No Coprocessor Exception", //7
"Double Fault Exception", //8
"Coprocessor Segment Overrun Exception", //9
"Bad TSS Exception", //10
"Segment Not Present Exception", //11
"Stack Fault Exception", //12
"General Protection Fault Exception", //13
"Page Fault Exception", //14
"Unknown Interrupt Exception", //15
"Coprocessor Fault Exception", //16
"Alignment Check Exception (486+)", //17
"Machine Check Exception (Pentium/586+)", //18
"Reserved", //19
"Reserved", //20
"Reserved", //21
"Reserved", //22
"Reserved", //23
"Reserved", //24
"Reserved", //25
"Reserved", //26
"Reserved", //27
"Reserved", //28
"Reserved", //29
"Reserved", //30
"Reserved", //31
"SYSCALL" //128
];
/* This defines what the stack looks like after an ISR was running */
private align(1) struct interrupt_stack
{
// registers we pushed
long r15, r14, r13, r12, r11, r10, r9, r8, rbp, rdi, rsi, rdx, rcx, rbx, rax;
// data, pushed by isr
long int_no, err_code;
// pushed automatically by the processor
long rip, cs, rflags, rsp, ss;
}
alias void function(interrupt_stack*) InterruptHandler;
private InterruptHandler[256] InterruptHandlers;
public void ignoreHandler(interrupt_stack* stak)
{
}
void setCustomHandler(size_t i, InterruptHandler h, int ist = -1)
{
assert(i < InterruptHandlers.length, "Invalid handler index");
InterruptHandlers[i] = h;
if(ist >= 0)
Entries[i].ist = ist;
}
void stack_dump(interrupt_stack* r) {
kdebugfln!(DEBUG_INTERRUPTS, "r15: 0x{x} / r14: 0x{x} / r13: 0x{x} / r12: 0x{x} / r11: 0x{x}")
(r.r15, r.r14, r.r13, r.r12, r.r11);
kdebugfln!(DEBUG_INTERRUPTS, "r10: 0x{x} / r9: 0x{x} / r8: 0x{x} / rbp: 0x{x} / rdi: 0x{x}")
(r.r10, r.r9, r.r8, r.rbp, r.rdi);
kdebugfln!(DEBUG_INTERRUPTS, "rsi: 0x{x} / rdx: 0x{x} / rcx: 0x{x} / rbx: 0x{x} / rax: 0x{x}")
(r.rsi, r.rdx, r.rcx, r.rbx, r.rax);
kdebugfln!(DEBUG_INTERRUPTS, "ss: 0x{x} / rsp: 0x{x} / cs: 0x{x}")(r.ss, r.rsp, r.cs);
}
/* All of our Exception handling Interrupt Service Routines will
* point to this function. This will tell us what exception has
* happened! Right now, we simply halt the system by hitting an
* endless loop. All ISRs disable interrupts while they are being
* serviced as a 'locking' mechanism to prevent an IRQ from
* happening and messing up kernel data structures */
extern(C) void faultHandler(interrupt_stack* r)
{
if(InterruptHandlers[r.int_no])
{
InterruptHandlers[r.int_no](r);
return;
}
if(r.int_no < 32) {
kdebugfln!(DEBUG_INTERRUPTS, "{}. Code = {}, IP = {x}")(exceptionMessages[r.int_no], r.err_code, r.rip);
kdebugfln!(DEBUG_INTERRUPTS, "Stack dump:")();
stack_dump(r);
} else {
kdebugfln!(DEBUG_INTERRUPTS, "Unknown exception {}.")(r.int_no);
}
asm{hlt;}
}
|
D
|
// This is a runnable test as we are testing a linker error
// https://issues.dlang.org/show_bug.cgi?id=18973
struct X {
@disable size_t toHash() const;
@disable string toString() const;
@disable bool opEquals(const ref X) const;
@disable int opCmp(const ref X) const;
}
// https://issues.dlang.org/show_bug.cgi?id=9161
public struct dummy
{
static auto opCall(C)(in C[] name)
{
return name;
}
@disable ~this(); //comment this out to avoid error
}
void main()
{
assert(dummy("ABCDE") == "ABCDE");
}
|
D
|
module kerisy.file.Exceptions;
import std.format;
class FileException : Exception
{
this(string message, string file = __FILE__, size_t line = __LINE__)
{
super(message, file, line);
}
}
class AccessDeniedException : Exception
{
this(string path, string file = __FILE__, size_t line = __LINE__)
{
super(format("The file %s could not be accessed.", path), file, line);
}
}
class FileNotFoundException : Exception
{
this(string path, string file = __FILE__, size_t line = __LINE__)
{
super(format("The file %s does not exist.", path), file, line);
}
}
|
D
|
instance Info_Renyu_EXIT(C_Info)
{
npc = Org_860_Renyu;
nr = 999;
condition = Info_Renyu_EXIT_Condition;
information = Info_Renyu_EXIT_Info;
permanent = 1;
description = DIALOG_ENDE;
};
func int Info_Renyu_EXIT_Condition()
{
return 1;
};
func void Info_Renyu_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance ORG_860_Renyu_GetLost(C_Info)
{
npc = Org_860_Renyu;
nr = 1;
condition = ORG_860_Renyu_GetLost_Condition;
information = ORG_860_Renyu_GetLost_Info;
permanent = 1;
important = 1;
};
func int ORG_860_Renyu_GetLost_Condition()
{
};
func void ORG_860_Renyu_GetLost_Info()
{
AI_Output(self,other,"Org_860_Renyu_GetLost_Info_06_00"); //Spadaj!
AI_StopProcessInfos(self);
};
instance org_860_renyu_deal(C_Info)
{
npc = Org_860_Renyu;
condition = org_860_renyu_deal_condition;
information = org_860_renyu_deal_info;
important = 0;
permanent = 0;
description = "Jestem tutaj, aby złożyć wam pewną propozycję.";
};
func int org_860_renyu_deal_condition()
{
if(Npc_KnowsInfo(hero,org_862_jacko_angebot) && (Kalom_DrugMonopol == LOG_RUNNING))
{
return TRUE;
};
};
func void org_860_renyu_deal_info()
{
AI_Output(other,self,"ORG_860_Renyu_DEAL_Info_15_01"); //Jestem tutaj, aby złożyć wam pewną propozycję.
AI_Output(self,other,"ORG_860_Renyu_DEAL_Info_06_02"); //Hm... ciekawe, o co chodzi?
AI_Output(other,self,"ORG_860_Renyu_DEAL_Info_15_03"); //Bractwo wie, co sobie tutaj wyprawiliście i przysłali mnie, bym położył temu kres!
AI_Output(self,other,"ORG_860_Renyu_DEAL_Info_06_04"); //Przejdź do rzeczy!
Info_ClearChoices(org_860_renyu_deal);
Info_AddChoice(org_860_renyu_deal,"Żądam 500 bryłek.",org_860_renyu_deal_500);
Info_AddChoice(org_860_renyu_deal,"Żądam 250 bryłek.",org_860_renyu_deal_250);
};
func void org_860_renyu_deal_500()
{
var C_Npc Killian;
var C_Npc Jacko;
AI_Output(other,self,"ORG_860_Renyu_DEAL_500_Info_15_01"); //Dacie 500 bryłek, a zadbam o to, by Bractwo dało wam spokój.
AI_Output(self,other,"ORG_860_Renyu_DEAL_500_Info_06_02"); //A jeśli nie zapłacimy? Co wtedy zrobisz?
AI_Output(other,self,"ORG_860_Renyu_DEAL_500_Info_15_03"); //Wtedy przyślę wam kilku Strażników Świątynnych, którzy dostaną ode mnie gruby worek ziela, żeby wypruli wam flaki!
AI_Output(self,other,"ORG_860_Renyu_DEAL_500_Info_06_04"); //Wiesz co - myślę, że powinniśmy pokazać Bractwu, że z nami nie ma żartów. Poślemy im twoje szczątki jako ostrzeżenie!
AI_StopProcessInfos(self);
Npc_SetTarget(self,hero);
AI_StartState(self,ZS_Attack,1,"");
Killian = Hlp_GetNpc(Org_861_Killian);
Npc_SetTarget(Killian,hero);
AI_StartState(Killian,ZS_Attack,1,"");
Jacko = Hlp_GetNpc(Org_862_Jacko);
Npc_SetTarget(Jacko,hero);
AI_StartState(Jacko,ZS_Attack,1,"");
};
func void org_860_renyu_deal_250()
{
AI_Output(other,self,"ORG_860_Renyu_DEAL_250_Info_15_01"); //Dacie 250 bryłek, a zadbam o to, by Bractwo zostawiło was w spokoju.
AI_Output(self,other,"ORG_860_Renyu_DEAL_250_Info_06_02"); //Hmmm... no dobra. Zgoda. Ale jeśli spróbujesz mnie okiwać, to lepiej módl się, byś mnie już nigdy nie spotkał na swojej drodze. To jak, umowa stoi?
AI_Output(other,self,"ORG_860_Renyu_DEAL_250_Info_15_03"); //Pewnie, dawaj tę rudę!
Info_ClearChoices(org_860_renyu_deal);
CreateInvItems(self,ItMiNugget,250);
B_GiveInvItems(self,other,ItMiNugget,250);
idiots_deal = TRUE;
B_LogEntry(CH1_DrugMonopol,"Dostałem od Renyu 250 bryłek rudy. W zamian za to będzie mógł kontynuować swe prace.");
Kalom_DrugMonopol = LOG_FAILED;
Log_SetTopicStatus(CH1_DrugMonopol,LOG_FAILED);
Info_Kalom_Success.permanent = 0;
};
instance ORG_860_RENYU_LOST(C_Info)
{
npc = Org_860_Renyu;
condition = org_860_renyu_lost_condition;
information = org_860_renyu_lost_info;
important = 0;
permanent = 0;
description = "I co powiesz teraz, sparszywiała kaleko?!";
};
func int org_860_renyu_lost_condition()
{
var C_Npc Renyu;
Renyu = Hlp_GetNpc(Org_860_Renyu);
if((Renyu.aivar[AIV_WASDEFEATEDBYSC] == TRUE) && Npc_KnowsInfo(hero,org_860_renyu_deal) && (Kalom_DrugMonopol == LOG_RUNNING) && (idiots_deal == FALSE))
{
return TRUE;
};
};
func void org_860_renyu_lost_info()
{
AI_Output(other,self,"Org_861_Killian_WORK_Info_15_01"); //I co powiesz teraz, sparszywiała kaleko?!
AI_Output(self,other,"ORG_860_Renyu_LOST_Info_06_02"); //Już dobrze, człowieku, wygrałeś! Przestaniemy! Zioło jest twoje!
Stooges_Fled = TRUE;
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"ARBEITSLOS");
B_ExchangeRoutine(Org_861_Killian,"ARBEITSLOS");
B_ExchangeRoutine(Org_862_Jacko,"ARBEITSLOS");
B_LogEntry(CH1_DrugMonopol,"Udało mi się przekonać Renyu, aby zaprzestał swojego małego procederu.");
B_GiveXP(XP_JackoRetired);
};
|
D
|
/**
* Быстрый поиск в именах файлов Win 32/64, Linux 32/64
*
* MGW 26.04.2014 18:56:44 + ревизия 29.07.17
*
*/
import std.file;
import std.stdio;
import std.path;
import asc1251;
string[] dirs; // Список точек входа для индексации
string nameFileIndex; // Имя файла индекса
size_t[1000] vec; // вектор кеша на строки до 1000 символов
struct StNameFile {
size_t FullPath; // Полный путь из массива mPath
char[] NameFile; // Имя файла
ulong sizeFile; // Размер файла
}
StNameFile[] mName; // массив имен файлов
char[][] mPath; // массив Путей. Номер соответствует полнуму пути
size_t[] iPath; // Массив списка длинн
void help() {
writeln();
writeln("usage: ffc NameFileIndex.txt Dir1 Dir2 ...");
writeln("------------------------------------------");
writeln(`ffc index.txt C:\windows D:\ E:\ ---> Example for Windows`);
writeln(`./ffc index.txt / ---> Start with root user. Example for Linux`);
}
int main(string[] args) {
char[] nameFile, pathFile;
foreach (i, arg; args) {
switch(i) {
case 0: // Имя программы
break;
case 1: // Имя файла индекса
nameFileIndex = arg; break;
default:
dirs ~= arg; break;
}
}
// Проверка имени индекса
if(nameFileIndex.length == 0) { writeln("Error: Not name file index"); help(); return 1; }
// Проверка точек входа
if(dirs.length == 0) { writeln("Error: Not dir for index"); help(); return 2; }
size_t predNom; char[] predPath; // Ускоритель
// Вернуть номер пути из массива
size_t getNomPath(char[] path) {
size_t rez, i; bool f = false;
size_t dlPath = path.length; // Длина пути уже известна, отлично!
if(predPath == path) return predNom;
// Взять длину и посмотреть, если там == 0, то выйти и добавить
if(vec[dlPath] > 0) {
size_t nomTest = vec[dlPath] - 1;
for(;nomTest != 0;) {
if(path == mPath[nomTest]) {
rez = nomTest; f = true; // Найдено!!!
predPath = path; predNom = rez; // Запомним в ускорителе
break;
}
else {
nomTest = iPath[nomTest]; // Ищем дальше ...
if(nomTest>0) nomTest--;
}
}
}
if(!f) { // Ни чего не найдено, надо создавать запись
mPath ~= path; // Добавить путь в массив
rez = mPath.length-1; // Запомним новый размер
// нужно сделать объмен с кешом
iPath ~= vec[dlPath]; vec[dlPath] = rez + 1;
}
return rez;
} // end getNomPath -----------------------------
string name;
File fError = File("err" ~ nameFileIndex, "w");
foreach(nameDir; dirs) {
// Формируем массивы mPath и iPath
try {
// Здесь обрабатываем точки входа
// char[] tmpName; auto name;
auto p = dirEntries(nameDir, SpanMode.depth, false);
while(!p.empty) {
zz:
try {
name = p.front;
char[] tmpName = cast(char[])name;
bool f;
try {
f = isDir(tmpName);
}
catch(Exception e) {
version(Windows) {
fError.writeln(fromUtf8to1251(cast(char[])e.msg), " - while()");
}
version(linux) {
fError.writeln(e.msg, " - while()");
}
p.popFront(); // NEXT
goto zz;
}
if(!f) {
pathFile = fromUtf8to1251(cast(char[])dirName(tmpName));
nameFile = fromUtf8to1251(cast(char[])baseName(tmpName));
size_t nom = getNomPath(pathFile);
// Добавить элемент в массивы
StNameFile el; el.FullPath = nom; el.NameFile = nameFile; el.sizeFile = getSize(name); mName ~= el;
}
p.popFront(); // NEXT
}
catch(Exception e) {
version(Windows) {
fError.writeln(fromUtf8to1251(cast(char[])e.msg), " - while()");
}
version(linux) {
fError.writeln(e.msg, " - while()");
}
goto zz;
}
}
}
catch(Exception ee) {
version(Windows) {
fError.writeln(fromUtf8to1251(cast(char[])ee.msg), " - dirEntries()");
}
version(linux) {
fError.writeln(ee.msg, " - dirEntries()");
}
}
}
// Массивы построены. Сохраняем в файл.
File fIndex = File(nameFileIndex, "w");
foreach(el; mPath) { fIndex.writeln(el); }
fIndex.writeln("#####");
foreach(el; mName) { fIndex.writeln(el.FullPath, "|", el.NameFile, "|", el.sizeFile); }
return 0;
}
|
D
|
/home/tanveerahmed/Desktop/IOT-Development/Rust_Codes/closures_threads/target/debug/deps/closures_threads-4df1552b6ca8278f: src/main.rs
/home/tanveerahmed/Desktop/IOT-Development/Rust_Codes/closures_threads/target/debug/deps/closures_threads-4df1552b6ca8278f.d: src/main.rs
src/main.rs:
|
D
|
module multiboot;
import ldc.attributes;
///
struct MultibootTagIterator
{
nothrow:
@nogc:
void* currentTag;
uint remainingLen;
multiboot_tag* front()
{
return cast(multiboot_tag*) currentTag;
}
void popFront()
{
if (remainingLen <= 0)
return;
int skip = (front().size + 7) & (~7);
currentTag += skip;
}
bool empty()
{
return (remainingLen <= 0) || (front.type == MULTIBOOT_TAG_TYPE_END) || (front.size < 4);
}
MultibootTagIterator save()
{
return MultibootTagIterator(currentTag, remainingLen);
}
}
MultibootTagIterator iterateMultibootTags(void* bootdata) nothrow @nogc
{
uint totalLen = *(cast(int*)(bootdata)) - 8;
return MultibootTagIterator(bootdata + 8, totalLen);
}
/** How many bytes from the start of the file we search for the header. */
enum MULTIBOOT_SEARCH = 32_768;
///
enum MULTIBOOT_HEADER_ALIGN = 8;
/** The magic field should contain this. */
enum MULTIBOOT2_HEADER_MAGIC = 0xe85250d6;
/** This should be in %eax. */
enum MULTIBOOT2_BOOTLOADER_MAGIC = 0x36d76289;
/** Alignment of multiboot modules. */
enum MULTIBOOT_MOD_ALIGN = 0x00001000;
/** Alignment of the multiboot info structure. */
enum MULTIBOOT_INFO_ALIGN = 0x00000008;
/** Flags set in the 'flags' member of the multiboot header. */
enum MULTIBOOT_TAG_ALIGN = 8;
enum MULTIBOOT_TAG_TYPE_END = 0;
enum MULTIBOOT_TAG_TYPE_CMDLINE = 1;
enum MULTIBOOT_TAG_TYPE_BOOT_LOADER_NAME = 2;
enum MULTIBOOT_TAG_TYPE_MODULE = 3;
enum MULTIBOOT_TAG_TYPE_BASIC_MEMINFO = 4;
enum MULTIBOOT_TAG_TYPE_BOOTDEV = 5;
enum MULTIBOOT_TAG_TYPE_MMAP = 6;
enum MULTIBOOT_TAG_TYPE_VBE = 7;
enum MULTIBOOT_TAG_TYPE_FRAMEBUFFER = 8;
enum MULTIBOOT_TAG_TYPE_ELF_SECTIONS = 9;
enum MULTIBOOT_TAG_TYPE_APM = 10;
enum MULTIBOOT_TAG_TYPE_EFI32 = 11;
enum MULTIBOOT_TAG_TYPE_EFI64 = 12;
enum MULTIBOOT_TAG_TYPE_SMBIOS = 13;
enum MULTIBOOT_TAG_TYPE_ACPI_OLD = 14;
enum MULTIBOOT_TAG_TYPE_ACPI_NEW = 15;
enum MULTIBOOT_TAG_TYPE_NETWORK = 16;
enum MULTIBOOT_TAG_TYPE_EFI_MMAP = 17;
enum MULTIBOOT_TAG_TYPE_EFI_BS = 18;
enum MULTIBOOT_HEADER_TAG_END = 0;
enum MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST = 1;
enum MULTIBOOT_HEADER_TAG_ADDRESS = 2;
enum MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS = 3;
enum MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS = 4;
enum MULTIBOOT_HEADER_TAG_FRAMEBUFFER = 5;
enum MULTIBOOT_HEADER_TAG_MODULE_ALIGN = 6;
enum MULTIBOOT_HEADER_TAG_EFI_BS = 7;
enum MULTIBOOT_ARCHITECTURE_I386 = 0;
enum MULTIBOOT_ARCHITECTURE_MIPS32 = 4;
enum MULTIBOOT_HEADER_TAG_OPTIONAL = 1;
enum MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED = 1;
enum MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED = 2;
extern (C):
alias multiboot_uint8_t = ubyte;
alias multiboot_uint16_t = ushort;
alias multiboot_uint32_t = uint;
alias multiboot_uint64_t = ulong;
alias multiboot_memory_map_t = multiboot_mmap_entry;
struct multiboot_header
{
/** Must be MULTIBOOT_MAGIC - see above. */
multiboot_uint32_t magic;
/** ISA */
multiboot_uint32_t architecture;
/** Total header length. */
multiboot_uint32_t header_length;
/** The above fields plus this one must equal 0 mod 2^32. */
multiboot_uint32_t checksum;
}
struct multiboot_header_tag
{
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
}
struct multiboot_header_tag_information_request
{
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
multiboot_uint32_t[0] requests;
}
struct multiboot_header_tag_address
{
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
multiboot_uint32_t header_addr;
multiboot_uint32_t load_addr;
multiboot_uint32_t load_end_addr;
multiboot_uint32_t bss_end_addr;
}
struct multiboot_header_tag_entry_address
{
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
multiboot_uint32_t entry_addr;
}
struct multiboot_header_tag_console_flags
{
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
multiboot_uint32_t console_flags;
}
struct multiboot_header_tag_framebuffer
{
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
multiboot_uint32_t width;
multiboot_uint32_t height;
multiboot_uint32_t depth;
}
struct multiboot_header_tag_module_align
{
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
}
struct multiboot_color
{
multiboot_uint8_t red;
multiboot_uint8_t green;
multiboot_uint8_t blue;
}
enum multiboot_uint32_t MULTIBOOT_MEMORY_AVAILABLE = 1;
enum multiboot_uint32_t MULTIBOOT_MEMORY_RESERVED = 2;
enum multiboot_uint32_t MULTIBOOT_MEMORY_ACPI_RECLAIMABLE = 3;
enum multiboot_uint32_t MULTIBOOT_MEMORY_NVS = 4;
enum multiboot_uint32_t MULTIBOOT_MEMORY_BADRAM = 5;
struct multiboot_mmap_entry
{
multiboot_uint64_t addr;
multiboot_uint64_t len;
multiboot_uint32_t type;
multiboot_uint32_t zero;
}
struct multiboot_tag
{
multiboot_uint32_t type;
multiboot_uint32_t size;
}
struct multiboot_tag_string
{
multiboot_uint32_t type;
multiboot_uint32_t size;
char[0] string;
}
struct multiboot_tag_module
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t mod_start;
multiboot_uint32_t mod_end;
char[0] cmdline;
}
struct multiboot_tag_basic_meminfo
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t mem_lower;
multiboot_uint32_t mem_upper;
}
struct multiboot_tag_bootdev
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t biosdev;
multiboot_uint32_t slice;
multiboot_uint32_t part;
}
struct multiboot_tag_mmap
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t entry_size;
multiboot_uint32_t entry_version;
multiboot_mmap_entry[0] entries;
}
struct multiboot_vbe_info_block
{
multiboot_uint8_t[512] external_specification;
}
struct multiboot_vbe_mode_info_block
{
multiboot_uint8_t[256] external_specification;
}
struct multiboot_tag_vbe
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint16_t vbe_mode;
multiboot_uint16_t vbe_interface_seg;
multiboot_uint16_t vbe_interface_off;
multiboot_uint16_t vbe_interface_len;
multiboot_vbe_info_block vbe_control_info;
multiboot_vbe_mode_info_block vbe_mode_info;
}
struct multiboot_tag_framebuffer_common
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint64_t framebuffer_addr;
multiboot_uint32_t framebuffer_pitch;
multiboot_uint32_t framebuffer_width;
multiboot_uint32_t framebuffer_height;
multiboot_uint8_t framebuffer_bpp;
multiboot_uint8_t framebuffer_type;
multiboot_uint16_t reserved;
}
enum MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED = 0;
enum MULTIBOOT_FRAMEBUFFER_TYPE_RGB = 1;
enum MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT = 2;
struct multiboot_tag_framebuffer
{
multiboot_tag_framebuffer_common common;
multiboot_uint8_t framebuffer_red_field_position;
multiboot_uint8_t framebuffer_red_mask_size;
multiboot_uint8_t framebuffer_green_field_position;
multiboot_uint8_t framebuffer_green_mask_size;
multiboot_uint8_t framebuffer_blue_field_position;
multiboot_uint8_t framebuffer_blue_mask_size;
}
struct multiboot_tag_elf_sections
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t num;
multiboot_uint32_t entsize;
multiboot_uint32_t shndx;
char[0] sections;
}
struct multiboot_tag_apm
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint16_t version_;
multiboot_uint16_t cseg;
multiboot_uint32_t offset;
multiboot_uint16_t cseg_16;
multiboot_uint16_t dseg;
multiboot_uint16_t flags;
multiboot_uint16_t cseg_len;
multiboot_uint16_t cseg_16_len;
multiboot_uint16_t dseg_len;
}
struct multiboot_tag_efi32
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t pointer;
}
struct multiboot_tag_efi64
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint64_t pointer;
}
struct multiboot_tag_smbios
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint8_t major;
multiboot_uint8_t minor;
multiboot_uint8_t[6] reserved;
multiboot_uint8_t[0] tables;
}
struct multiboot_tag_old_acpi
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint8_t[0] rsdp;
}
struct multiboot_tag_new_acpi
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint8_t[0] rsdp;
}
struct multiboot_tag_network
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint8_t[0] dhcpack;
}
struct multiboot_tag_efi_mmap
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t descr_size;
multiboot_uint32_t descr_vers;
multiboot_uint8_t[0] efi_mmap;
}
|
D
|
instance ORC_8564_VANHAN(C_Npc)
{
name[0] = "Призрак орка-шамана";
guild = GIL_ORC;
aivar[AIV_MM_REAL_ID] = ID_ORCSHAMAN;
voice = 18;
id = 8564;
level = 150;
flags = ORCTEMPLENPCFLAGS;
attribute[ATR_STRENGTH] = 150;
attribute[ATR_DEXTERITY] = 450;
attribute[ATR_HITPOINTS_MAX] = 3000;
attribute[ATR_HITPOINTS] = 3000;
attribute[ATR_MANA_MAX] = 1000;
attribute[ATR_MANA] = 1000;
protection[PROT_BLUNT] = 300;
protection[PROT_EDGE] = 300;
protection[PROT_POINT] = 300;
protection[PROT_FIRE] = 100;
protection[PROT_FLY] = 500;
protection[PROT_MAGIC] = 100;
HitChance[NPC_TALENT_1H] = 100;
HitChance[NPC_TALENT_2H] = 100;
HitChance[NPC_TALENT_BOW] = 100;
HitChance[NPC_TALENT_CROSSBOW] = 100;
damagetype = DAM_EDGE;
fight_tactic = FAI_ORC;
senses = SENSE_HEAR | SENSE_SEE;
senses_range = PERC_DIST_ORC_ACTIVE_MAX;
aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM;
aivar[AIV_MM_FollowInWater] = FALSE;
EquipItem(self,itmw_orcstaff);
CreateInvItems(self,itke_orcshaman_shv,1);
aivar[AIV_MagicUser] = MAGIC_ALWAYS_MINE;
start_aistate = ZS_MM_AllScheduler;
Mdl_SetVisual(self,"Orc.mds");
Mdl_SetVisualBody(self,"Orc_BodyShamEl",DEFAULT,DEFAULT,"Orc_HeadShaman",1,DEFAULT,-1);
start_aistate = ZS_MM_Rtn_DragonRest;
aivar[AIV_MM_RestStart] = OnlyRoutine;
Npc_SetTalentSkill(self,NPC_TALENT_MAGE,6);
};
func void rtn_tot_8564()
{
TA_Stand_WP(8,0,22,0,"TOT");
TA_Stand_WP(22,0,8,0,"TOT");
};
|
D
|
/Users/mehulghoderao/Documents/Miscelleneous/Rust/Example/target/debug/deps/Example-faa3366532de02b2.rmeta: src/main.rs
/Users/mehulghoderao/Documents/Miscelleneous/Rust/Example/target/debug/deps/Example-faa3366532de02b2.d: src/main.rs
src/main.rs:
|
D
|
// Copyright Ferdinand Majerech 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
module dyaml.escapes;
package:
///Translation table from YAML escapes to dchars.
immutable dchar[dchar] fromEscapes;
///Translation table from dchars to YAML escapes.
immutable dchar[dchar] toEscapes;
///Translation table from prefixes of escaped hexadecimal format characters to their lengths.
immutable uint[dchar] escapeHexCodes;
static this()
{
fromEscapes =
['0': '\0',
'a': '\x07',
'b': '\x08',
't': '\x09',
'\t': '\x09',
'n': '\x0A',
'v': '\x0B',
'f': '\x0C',
'r': '\x0D',
'e': '\x1B',
' ': '\x20',
'\"': '\"',
'\\': '\\',
'N': '\u0085',
'_': '\xA0',
'L': '\u2028',
'P': '\u2029'];
toEscapes =
['\0': '0',
'\x07': 'a',
'\x08': 'b',
'\x09': 't',
'\x0A': 'n',
'\x0B': 'v',
'\x0C': 'f',
'\x0D': 'r',
'\x1B': 'e',
'\"': '\"',
'\\': '\\',
'\u0085': 'N',
'\xA0': '_',
'\u2028': 'L',
'\u2029': 'P'];
escapeHexCodes = ['x': 2, 'u': 4, 'U': 8];
}
|
D
|
module owlchain.xdr.manageDataResult;
import owlchain.xdr.type;
import owlchain.xdr.manageDataResultCode;
import owlchain.xdr.xdrDataInputStream;
import owlchain.xdr.xdrDataOutputStream;
struct ManageDataResult
{
ManageDataResultCode code;
static void encode(XdrDataOutputStream stream, ref const ManageDataResult encoded)
{
encodeManageDataResultCode(stream, encoded.code);
}
static ManageDataResult decode(XdrDataInputStream stream)
{
ManageDataResult decoded;
decoded.code = decodeManageDataResultCode(stream);
return decoded;
}
}
|
D
|
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/TaskDelegate.o : /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/MultipartFormData.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Timeline.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Alamofire.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Response.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/TaskDelegate.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/SessionDelegate.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Validation.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/SessionManager.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/AFError.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Notifications.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Result.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Request.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Zhongli/Desktop/NewsDemo/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/TaskDelegate~partial.swiftmodule : /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/MultipartFormData.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Timeline.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Alamofire.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Response.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/TaskDelegate.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/SessionDelegate.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Validation.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/SessionManager.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/AFError.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Notifications.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Result.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Request.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Zhongli/Desktop/NewsDemo/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/TaskDelegate~partial.swiftdoc : /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/MultipartFormData.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Timeline.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Alamofire.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Response.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/TaskDelegate.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/SessionDelegate.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Validation.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/SessionManager.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/AFError.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Notifications.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Result.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/Request.swift /Users/Zhongli/Desktop/NewsDemo/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Zhongli/Desktop/NewsDemo/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap
|
D
|
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/RetryPolicy.o : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/RetryPolicy~partial.swiftmodule : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/RetryPolicy~partial.swiftdoc : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/RetryPolicy~partial.swiftsourceinfo : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/Users/hernaniruegasvillarreal/Downloads/9.07/Build/Intermediates/Flappy\ Bird.build/Debug-iphonesimulator/Flappy\ Bird.build/Objects-normal/x86_64/GameScene.o : /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/GameScene.swift /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/GameViewController.swift /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/AppDelegate.swift /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/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.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/Darwin.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/ObjectiveC.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/simd.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.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/QuartzCore.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/GameplayKit.swiftmodule
/Users/hernaniruegasvillarreal/Downloads/9.07/Build/Intermediates/Flappy\ Bird.build/Debug-iphonesimulator/Flappy\ Bird.build/Objects-normal/x86_64/GameScene~partial.swiftmodule : /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/GameScene.swift /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/GameViewController.swift /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/AppDelegate.swift /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/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.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/Darwin.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/ObjectiveC.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/simd.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.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/QuartzCore.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/GameplayKit.swiftmodule
/Users/hernaniruegasvillarreal/Downloads/9.07/Build/Intermediates/Flappy\ Bird.build/Debug-iphonesimulator/Flappy\ Bird.build/Objects-normal/x86_64/GameScene~partial.swiftdoc : /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/GameScene.swift /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/GameViewController.swift /Users/hernaniruegasvillarreal/Downloads/9.07/Flappy\ Bird/AppDelegate.swift /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/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.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/Darwin.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/ObjectiveC.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/simd.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.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/QuartzCore.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/GameplayKit.swiftmodule
|
D
|
module hunt.framework.config.AuthUserConfig;
import hunt.framework.Init;
import std.algorithm;
import std.array;
import std.conv;
import std.file;
import std.path;
import std.stdio;
import std.range;
import std.string;
import hunt.logging;
/**
* Convert the permission format from Hunt to Shiro, which means that
* all the '.' will be replaced with the ':'.
*/
static string toShiroPermissions(string value) {
return value.replace('.', ':');
}
/**
*
*/
class AuthUserConfig {
static class User {
string name;
string password;
string[] roles;
override string toString() {
return "name: " ~ name ~ ", role: " ~ roles.to!string();
}
}
static class Role {
string name;
/**
* Examples:
* printer:query,print:lp7200
*
* See_also:
* https://shiro.apache.org/permissions.html
*/
string[] permissions;
override string toString() {
return "name: " ~ name ~ ", permissions: " ~ permissions.to!string();
}
}
User[] users;
Role[] roles;
static AuthUserConfig load(string userConfigFile, string roleConfigFile) {
version(HUNT_DEBUG) {
tracef("Loading users from %s", userConfigFile);
tracef("Loading roles from %s", roleConfigFile);
}
AuthUserConfig config = new AuthUserConfig();
if (exists(userConfigFile)) {
File f = File(userConfigFile, "r");
scope(exit) f.close();
string line;
while((line = f.readln()) !is null) {
line = line.strip();
if(line.empty) continue;
if (line[0] == '#' || line[0] == ';')
continue;
string[] parts = split(line, " ");
if(parts.length < 2) continue;
string fieldValue;
string password;
string roles;
int fieldIndex = 1;
foreach(string v; parts[1..$]) {
fieldValue = v.strip();
if(fieldValue.empty) continue;
if(fieldIndex == 1) password = fieldValue;
if(fieldIndex == 2) roles = fieldValue;
fieldIndex++;
if(fieldIndex > 2) break;
}
User user = new User();
user.name = parts[0].strip();
user.password = password;
user.roles = roles.split("|");
config.users ~= user;
}
}
if (exists(roleConfigFile)) {
File f = File(roleConfigFile, "r");
scope(exit) f.close();
string line;
while((line = f.readln()) !is null) {
line = line.strip();
if(line.empty) continue;
if (line[0] == '#' || line[0] == ';')
continue;
string[] parts = split(line, " ");
if(parts.length < 2) continue;
Role role = new Role();
role.name = parts[0].strip();
string permissions;
foreach(string v; parts[1..$]) {
permissions = v.strip();
if(!permissions.empty) break;
}
role.permissions = permissions.split("|").map!(p => p.strip().toShiroPermissions()).array;
config.roles ~= role;
}
}
return config;
}
}
|
D
|
module math.linear.quaternion;
import std.math;
import core.internal.traits : Unconst;
////import std.traits : Unconst;
import std.traits;
import math.linear.vector;
import math.linear.axis_rot;
public import math.linear._qv;
public import math.linear._qa;
alias opBinaryImpl = math.linear._qv.opBinaryImpl;
// TODO: Add tests to ensure T is a compotable type (number, etc...).
struct Quat(T) {
union {
T[4] data;
struct {
T dataAngle;
T[3] dataAxis;
}
struct {
T w;
T x;
T y;
T z;
}
}
this(T dataAngle, T[3] dataAxis ...) {
this.dataAngle = dataAngle;
this.dataAxis = dataAxis;
}
this(T[4] data) {
this.data = data;
}
this(T[3] dataAxis, T dataAngle) {
this.dataAngle = dataAngle;
this.dataAxis = dataAxis;
}
this(typeof(this) v) {
this.data = v.data;
}
this(AxisRot!T data) {
import std.stdio;
if (data.angle==0)
this.data = [1,0,0,0];
else {
this.w = cast(T) cos(cast(real) data.angle/2);
this.dataAxis[] = data.axis[] * cast(T) sin(cast(real) data.angle/2);
}
}
const
Quat!NT castType(NT)() {
return Quat!NT(data.arrayCast!NT);
}
inout
auto opBinary(string op, T)(inout T b) if (__traits(compiles, opBinaryImpl!op(this, b))){
return opBinaryImpl!op(this, b);
}
inout
auto opBinaryRight(string op, T)(inout T a) if (__traits(compiles, opBinaryImpl!op(a, this))){
return opBinaryImpl!op(a,this);
}
auto opOpAssign(string op, T)(T b) if (__traits(compiles, opOpAssignImpl!op(this, b))){
return opOpAssignImpl!op(this, b);
}
static const {
Quat!T fromAxisRot(T)(AxisRot!T a) {
return Quat!T(a);
}
Quat!T fromAxisRot(T)(Vec!(T,3) axis, T angle) {
return Quat!T(AxisRot!T(axis,angle));
}
Quat!T fromAxisRot(T)(T angle, Vec!(T,3) axis) {
return Quat!T(AxisRot!T(axis,angle));
}
Quat!T fromMagnitudeVector(T)(Vec!(T,3) a) {
return Quat!T(AxisRot!T(a.magnitude,a.normalized));
}
}
@property inout
T magnitudeSquared() {
return this.w^^2 + this.x^^2 + this.y^^2 + this.z^^2;
}
@property inout
T magnitude() {
return cast(T) sqrt(cast(real) this.magnitudeSquared);
}
void normalize() {
this.data[] /= this.magnitude;
}
const
Quat!T normalized() {
Quat!T n;
n.data[] = this.data[] / this.magnitude;
return n;
}
@property {
const
T angle() {
return 2 * cast(T) acos(cast(real) this.w);
}
const
Vec!(T,3) axis() {
Vec!(T,3) n;
n.data[] = this.dataAxis[] / cast(T) sqrt(cast(real) 1 - this.w*this.w);
return n;
}
void angle(T n) {
this.w = cast(T) cos(cast(real) n/2);
}
void axis(Vec!(T,3) n) {
this.dataAxis[] = n[] * cast(T) sin(cast(real) this.angle/2);
}
}
static
Quat!T identity() {
return quat!T(1,[0,0,0]);
}
void invert() {
this.x = -this.x;
this.y = -this.y;
this.z = -this.z;
}
alias conjugate = invert;
inout
Quat!T inverse() {
return Quat!T(this.w, [-this.x, -this.y, -this.z]);
}
alias conjugated = inverse;
}
auto quat(T)(T[4] data) {
return Quat!T(data);
}
auto quat(T)(T dataAngle, T[3] dataAxis ...) {
return Quat!T(dataAngle, dataAxis);
}
auto quat(T)(T[3] dataAxis, T dataAngle) {
return Quat!T(dataAngle, dataAxis);
}
auto quat(T)(Quat!T data) {
return Quat!T(data);
}
auto quat(T)(AxisRot!T data) {
return Quat!T(data);
}
auto opBinaryImpl(string op:"*", T,U)(const Quat!T a, const Quat!U b)
if (isNumeric!T && isNumeric!U)
{
alias NT = Unconst!(typeof(rvalueOf!T*rvalueOf!U));
return Quat!(NT) ( - a.x * b.x - a.y * b.y - a.z * b.z + a.w * b.w
, a.x * b.w + a.y * b.z - a.z * b.y + a.w * b.x
, - a.x * b.z + a.y * b.w + a.z * b.x + a.w * b.y
, a.x * b.y - a.y * b.x + a.z * b.w + a.w * b.z
);
}
void opOpAssignImpl(string op:"*", size_t size,T,U)(ref Quat!T a, const Quat!U b)
if (isNumeric!T && isNumeric!U)
{
a.w = - a.x * b.x - a.y * b.y - a.z * b.z + a.w * b.w ;
a.x = a.x * b.w + a.y * b.z - a.z * b.y + a.w * b.x ;
a.y = - a.x * b.z + a.y * b.w + a.z * b.x + a.w * b.y ;
a.z = a.x * b.y - a.y * b.x + a.z * b.w + a.w * b.z ;
}
private {
NT[] arrayCast(NT,OT)(OT[] xs) {
NT[] nxs = new NT[xs.length];
foreach (i,e; xs) {
nxs[i] = cast(NT) e;
}
return nxs;
}
NT[L] arrayCast(NT,OT,size_t L)(OT[L] xs) {
NT[L] nxs;
foreach (i,e; xs) {
nxs[i] = cast(NT) e;
}
return nxs;
}
}
unittest {
void testValues(A,B)(A a1, A a2, A a3, A a4, B b1, B b2, B b3, B b4) {
{
Quat!A a = [a1,a2,a3,a4];
Quat!B b = [b1,b2,b3,b4];
static assert(is(typeof(a*b) == Quat!(typeof(a1+b1))));
}
{
const Quat!A a = [a1,a2,a3,a4];
const Quat!B b = [b1,b2,b3,b4];
static assert(is(typeof(a*b) == Quat!(typeof(a1+b1))));
}
{
const Quat!A a = [a1,a2,a3,a4];
Quat!B b = [b1,b2,b3,b4];
static assert(is(typeof(a*b) == Quat!(typeof(a1+b1))));
}
{
Quat!A a = [a1,a2,a3,a4];
const Quat!B b = [b1,b2,b3,b4];
static assert(is(typeof(a*b) == Quat!(typeof(a1+b1))));
}
}
testValues!(int,int)(1,2,3,4,2,3,4,5);
testValues!(float,float)(1.5,2.5,3,4,2.5,3,4.5,5);
testValues!(int,float)(1,2,3,4,2.5,3,4.5,5);
testValues!(float,double)(1.5,2.5,3,4,2.5,3,4.5,5);
}
|
D
|
instance Mod_1447_BUD_Buddler_MT (Npc_Default)
{
//-------- primary data --------
name = Name_Buddler;
npctype = npctype_mt_buddler;
guild = GIL_out;
level = 2;
voice = 0;
id = 1447;
//-------- abilities --------
B_SetAttributesToChapter (self, 1);
//-------- visuals --------
// animations
Mdl_SetVisual (self,"HUMANS.MDS");
Mdl_ApplyOverlayMds (self,"Humans_Tired.mds");
// body mesh, head mesh, hairmesh, face-tex, hair-tex, skin
Mdl_SetVisualBody (self,"hum_body_Naked0",2,1,"Hum_Head_Thief", 69, 1, VLK_ARMOR_L);
Mdl_SetModelFatness (self, 0);
fight_tactic = FAI_HUMAN_COWARD;
//-------- Talents --------
B_SetFightSkills (self, 10);
//-------- inventory --------
B_CreateAmbientInv (self);
//-------------Daily Routine-------------
daily_routine = Rtn_start_1447;
};
FUNC VOID Rtn_start_1447 ()
{
TA_Sleep (22,00,08,00,"OCR_HUT_43");
TA_Play_Lute (08,00,22,00,"OCR_MARKETPLACE_SCAVENGER");
};
|
D
|
/**
* D header file for C99.
*
* $(C_HEADER_DESCRIPTION pubs.opengroup.org/onlinepubs/009695399/basedefs/_wchar.h.html, _wchar.h)
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Sean Kelly
* Source: $(DRUNTIMESRC core/stdc/_wchar_.d)
* Standards: ISO/IEC 9899:1999 (E)
*/
module core.stdc.wchar_;
import core.stdc.config;
import core.stdc.stdarg; // for va_list
import core.stdc.stdio; // for FILE, not exposed per spec
public import core.stdc.stddef; // for wchar_t
public import core.stdc.time; // for tm
public import core.stdc.stdint; // for WCHAR_MIN, WCHAR_MAX
extern (C):
@system:
nothrow:
@nogc:
version (CRuntime_Glibc)
{
///
struct mbstate_t
{
int __count;
union ___value
{
wint_t __wch = 0;
char[4] __wchb;
}
___value __value;
}
}
else version (FreeBSD)
{
///
union __mbstate_t // <sys/_types.h>
{
char[128] _mbstate8 = 0;
long _mbstateL;
}
///
alias mbstate_t = __mbstate_t;
}
else version (NetBSD)
{
///
union __mbstate_t
{
int64_t __mbstateL;
char[128] __mbstate8;
}
///
alias mbstate_t = __mbstate_t;
}
else version (OpenBSD)
{
///
union __mbstate_t
{
char[128] __mbstate8 = 0;
int64_t __mbstateL;
}
///
alias mbstate_t = __mbstate_t;
}
else version (DragonFlyBSD)
{
///
union __mbstate_t // <sys/stdint.h>
{
char[128] _mbstate8 = 0;
long _mbstateL;
}
///
alias mbstate_t = __mbstate_t;
}
else version (Solaris)
{
///
struct __mbstate_t
{
version (D_LP64)
{
long[4] __filler;
}
else
{
int[6] __filler;
}
}
///
alias mbstate_t = __mbstate_t;
}
else version (CRuntime_UClibc)
{
///
struct mbstate_t
{
wchar_t __mask = 0;
wchar_t __wc = 0;
}
}
else
{
///
alias int mbstate_t;
}
///
alias wchar_t wint_t;
///
enum wchar_t WEOF = 0xFFFF;
///
int fwprintf(FILE* stream, const scope wchar_t* format, scope const ...);
///
int fwscanf(FILE* stream, const scope wchar_t* format, scope ...);
///
int swprintf(wchar_t* s, size_t n, const scope wchar_t* format, scope const ...);
///
int swscanf(const scope wchar_t* s, const scope wchar_t* format, scope ...);
///
int vfwprintf(FILE* stream, const scope wchar_t* format, va_list arg);
///
int vfwscanf(FILE* stream, const scope wchar_t* format, va_list arg);
///
int vswprintf(wchar_t* s, size_t n, const scope wchar_t* format, va_list arg);
///
int vswscanf(const scope wchar_t* s, const scope wchar_t* format, va_list arg);
///
int vwprintf(const scope wchar_t* format, va_list arg);
///
int vwscanf(const scope wchar_t* format, va_list arg);
///
int wprintf(const scope wchar_t* format, scope const ...);
///
int wscanf(const scope wchar_t* format, scope ...);
// No unsafe pointer manipulation.
@trusted
{
///
wint_t fgetwc(FILE* stream);
///
wint_t fputwc(wchar_t c, FILE* stream);
}
///
wchar_t* fgetws(wchar_t* s, int n, FILE* stream);
///
int fputws(const scope wchar_t* s, FILE* stream);
// No unsafe pointer manipulation.
extern (D) @trusted
{
///
wint_t getwchar() { return fgetwc(stdin); }
///
wint_t putwchar(wchar_t c) { return fputwc(c,stdout); }
}
///
alias getwc = fgetwc;
///
alias putwc = fputwc;
// No unsafe pointer manipulation.
@trusted
{
///
wint_t ungetwc(wint_t c, FILE* stream);
///
version (CRuntime_Microsoft)
{
// MSVC defines this as an inline function.
int fwide(FILE* stream, int mode) { return mode; }
}
else
{
int fwide(FILE* stream, int mode);
}
}
///
double wcstod(const scope wchar_t* nptr, wchar_t** endptr);
///
float wcstof(const scope wchar_t* nptr, wchar_t** endptr);
///
real wcstold(const scope wchar_t* nptr, wchar_t** endptr);
///
c_long wcstol(const scope wchar_t* nptr, wchar_t** endptr, int base);
///
long wcstoll(const scope wchar_t* nptr, wchar_t** endptr, int base);
///
c_ulong wcstoul(const scope wchar_t* nptr, wchar_t** endptr, int base);
///
ulong wcstoull(const scope wchar_t* nptr, wchar_t** endptr, int base);
///
pure wchar_t* wcscpy(return scope wchar_t* s1, scope const wchar_t* s2);
///
pure wchar_t* wcsncpy(return scope wchar_t* s1, scope const wchar_t* s2, size_t n);
///
pure wchar_t* wcscat(return scope wchar_t* s1, scope const wchar_t* s2);
///
pure wchar_t* wcsncat(return scope wchar_t* s1, scope const wchar_t* s2, size_t n);
///
pure int wcscmp(scope const wchar_t* s1, scope const wchar_t* s2);
///
int wcscoll(scope const wchar_t* s1, scope const wchar_t* s2);
///
pure int wcsncmp(scope const wchar_t* s1, scope const wchar_t* s2, size_t n);
///
size_t wcsxfrm(scope wchar_t* s1, scope const wchar_t* s2, size_t n);
///
pure inout(wchar_t)* wcschr(return scope inout(wchar_t)* s, wchar_t c);
///
pure size_t wcscspn(scope const wchar_t* s1, scope const wchar_t* s2);
///
pure inout(wchar_t)* wcspbrk(return scope inout(wchar_t)* s1, scope const wchar_t* s2);
///
pure inout(wchar_t)* wcsrchr(return scope inout(wchar_t)* s, wchar_t c);
///
pure size_t wcsspn(scope const wchar_t* s1, scope const wchar_t* s2);
///
pure inout(wchar_t)* wcsstr(return scope inout(wchar_t)* s1, scope const wchar_t* s2);
///
wchar_t* wcstok(return scope wchar_t* s1, scope const wchar_t* s2, wchar_t** ptr);
///
pure size_t wcslen(scope const wchar_t* s);
///
pure inout(wchar_t)* wmemchr(return scope inout wchar_t* s, wchar_t c, size_t n);
///
pure int wmemcmp(scope const wchar_t* s1, scope const wchar_t* s2, size_t n);
///
pure wchar_t* wmemcpy(return scope wchar_t* s1, scope const wchar_t* s2, size_t n);
///
pure wchar_t* wmemmove(return scope wchar_t* s1, scope const wchar_t* s2, size_t n);
///
pure wchar_t* wmemset(return scope wchar_t* s, wchar_t c, size_t n);
///
size_t wcsftime(wchar_t* s, size_t maxsize, const scope wchar_t* format, const scope tm* timeptr);
version (Windows)
{
///
wchar_t* _wasctime(tm*); // non-standard
///
wchar_t* _wctime(time_t*); // non-standard
///
wchar_t* _wstrdate(wchar_t*); // non-standard
///
wchar_t* _wstrtime(wchar_t*); // non-standard
}
// No unsafe pointer manipulation.
@trusted
{
///
wint_t btowc(int c);
///
int wctob(wint_t c);
}
///
int mbsinit(const scope mbstate_t* ps);
///
size_t mbrlen(const scope char* s, size_t n, mbstate_t* ps);
///
size_t mbrtowc(wchar_t* pwc, const scope char* s, size_t n, mbstate_t* ps);
///
size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps);
///
size_t mbsrtowcs(wchar_t* dst, const scope char** src, size_t len, mbstate_t* ps);
///
size_t wcsrtombs(char* dst, const scope wchar_t** src, size_t len, mbstate_t* ps);
|
D
|
/Users/oishikdas/projects/rust/password_manager_rust/target/debug/deps/cpuid_bool-6f0b39c1373bf24a.rmeta: /Users/oishikdas/.cargo/registry/src/github.com-1ecc6299db9ec823/cpuid-bool-0.1.2/src/lib.rs
/Users/oishikdas/projects/rust/password_manager_rust/target/debug/deps/libcpuid_bool-6f0b39c1373bf24a.rlib: /Users/oishikdas/.cargo/registry/src/github.com-1ecc6299db9ec823/cpuid-bool-0.1.2/src/lib.rs
/Users/oishikdas/projects/rust/password_manager_rust/target/debug/deps/cpuid_bool-6f0b39c1373bf24a.d: /Users/oishikdas/.cargo/registry/src/github.com-1ecc6299db9ec823/cpuid-bool-0.1.2/src/lib.rs
/Users/oishikdas/.cargo/registry/src/github.com-1ecc6299db9ec823/cpuid-bool-0.1.2/src/lib.rs:
|
D
|
module UnrealScript.TribesGame.GFxTrPage_TrainVideo;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.TribesGame.GFxTrAction;
import UnrealScript.TribesGame.GFxTrPage;
import UnrealScript.GFxUI.GFxObject;
extern(C++) interface GFxTrPage_TrainVideo : GFxTrPage
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.GFxTrPage_TrainVideo")); }
private static __gshared GFxTrPage_TrainVideo mDefaultProperties;
@property final static GFxTrPage_TrainVideo DefaultProperties() { mixin(MGDPC("GFxTrPage_TrainVideo", "GFxTrPage_TrainVideo TribesGame.Default__GFxTrPage_TrainVideo")); }
static struct Functions
{
private static __gshared
{
ScriptFunction mInitialize;
ScriptFunction mShowModel;
ScriptFunction mSpecialAction;
ScriptFunction mFillData;
ScriptFunction mFillOption;
ScriptFunction mFillDescription;
}
public @property static final
{
ScriptFunction Initialize() { mixin(MGF("mInitialize", "Function TribesGame.GFxTrPage_TrainVideo.Initialize")); }
ScriptFunction ShowModel() { mixin(MGF("mShowModel", "Function TribesGame.GFxTrPage_TrainVideo.ShowModel")); }
ScriptFunction SpecialAction() { mixin(MGF("mSpecialAction", "Function TribesGame.GFxTrPage_TrainVideo.SpecialAction")); }
ScriptFunction FillData() { mixin(MGF("mFillData", "Function TribesGame.GFxTrPage_TrainVideo.FillData")); }
ScriptFunction FillOption() { mixin(MGF("mFillOption", "Function TribesGame.GFxTrPage_TrainVideo.FillOption")); }
ScriptFunction FillDescription() { mixin(MGF("mFillDescription", "Function TribesGame.GFxTrPage_TrainVideo.FillDescription")); }
}
}
@property final
{
bool bValid() { mixin(MGBPC(356, 0x1)); }
bool bValid(bool val) { mixin(MSBPC(356, 0x1)); }
}
final:
void Initialize()
{
(cast(ScriptObject)this).ProcessEvent(Functions.Initialize, cast(void*)0, cast(void*)0);
}
void ShowModel()
{
(cast(ScriptObject)this).ProcessEvent(Functions.ShowModel, cast(void*)0, cast(void*)0);
}
void SpecialAction(GFxTrAction Action)
{
ubyte params[4];
params[] = 0;
*cast(GFxTrAction*)params.ptr = Action;
(cast(ScriptObject)this).ProcessEvent(Functions.SpecialAction, params.ptr, cast(void*)0);
}
void FillData(GFxObject DataList)
{
ubyte params[4];
params[] = 0;
*cast(GFxObject*)params.ptr = DataList;
(cast(ScriptObject)this).ProcessEvent(Functions.FillData, params.ptr, cast(void*)0);
}
GFxObject FillOption(int ActionIndex)
{
ubyte params[8];
params[] = 0;
*cast(int*)params.ptr = ActionIndex;
(cast(ScriptObject)this).ProcessEvent(Functions.FillOption, params.ptr, cast(void*)0);
return *cast(GFxObject*)¶ms[4];
}
GFxObject FillDescription(GFxObject DataList)
{
ubyte params[8];
params[] = 0;
*cast(GFxObject*)params.ptr = DataList;
(cast(ScriptObject)this).ProcessEvent(Functions.FillDescription, params.ptr, cast(void*)0);
return *cast(GFxObject*)¶ms[4];
}
}
|
D
|
IL JL;
|
D
|
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module flow.eventsubscription.service.impl.persistence.entity.data.impl.MybatisEventSubscriptionDataManager;
import hunt.logging;
import hunt.collection.ArrayList;
import hunt.collection.HashMap;
import hunt.collection.List;
import hunt.collection.Map;
//import flow.common.db.DbSqlSession;
//import flow.common.persistence.cache.CachedEntityMatcher;
import flow.eventsubscription.service.api.EventSubscription;
import flow.eventsubscription.service.EventSubscriptionServiceConfiguration;
import flow.eventsubscription.service.impl.EventSubscriptionQueryImpl;
import flow.eventsubscription.service.impl.persistence.entity.CompensateEventSubscriptionEntity;
import flow.eventsubscription.service.impl.persistence.entity.CompensateEventSubscriptionEntityImpl;
import flow.eventsubscription.service.impl.persistence.entity.EventSubscriptionEntity;
import flow.eventsubscription.service.impl.persistence.entity.EventSubscriptionEntityImpl;
import flow.eventsubscription.service.impl.persistence.entity.GenericEventSubscriptionEntity;
import flow.eventsubscription.service.impl.persistence.entity.GenericEventSubscriptionEntityImpl;
import flow.eventsubscription.service.impl.persistence.entity.MessageEventSubscriptionEntity;
import flow.eventsubscription.service.impl.persistence.entity.MessageEventSubscriptionEntityImpl;
import flow.eventsubscription.service.impl.persistence.entity.SignalEventSubscriptionEntity;
import flow.eventsubscription.service.impl.persistence.entity.SignalEventSubscriptionEntityImpl;
import flow.eventsubscription.service.impl.persistence.entity.data.AbstractEventSubscriptionDataManager;
import flow.eventsubscription.service.impl.persistence.entity.data.EventSubscriptionDataManager;
import hunt.Exceptions;
import hunt.entity;
import flow.common.AbstractEngineConfiguration;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.EventSubscriptionsByExecutionAndTypeMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.EventSubscriptionsByExecutionIdMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.EventSubscriptionsByNameMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.EventSubscriptionsByProcInstTypeAndActivityMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.EventSubscriptionsByScopeDefinitionIdAndTypeMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.EventSubscriptionsBySubScopeIdMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.MessageEventSubscriptionsByProcInstAndEventNameMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.SignalEventSubscriptionByEventNameMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.SignalEventSubscriptionByNameAndExecutionMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.SignalEventSubscriptionByProcInstAndEventNameMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.SignalEventSubscriptionByScopeAndEventNameMatcher;
//import flow.eventsubscription.service.impl.persistence.entity.data.impl.cachematcher.SignalEventSubscriptionByScopeIdAndTypeMatcher;
/**
* @author Joram Barrez
*/
class MybatisEventSubscriptionDataManager : EntityRepository!(EventSubscriptionEntityImpl , string) , EventSubscriptionDataManager {
private EventSubscriptionServiceConfiguration eventSubscriptionServiceConfiguration;
alias insert = CrudRepository!(EventSubscriptionEntityImpl , string).insert;
alias findById = CrudRepository!(EventSubscriptionEntityImpl , string).findById;
alias update = CrudRepository!(EventSubscriptionEntityImpl , string).update;
//this(EventSubscriptionServiceConfiguration eventSubscriptionServiceConfiguration) {
// this.eventSubscriptionServiceConfiguration = eventSubscriptionServiceConfiguration;
//}
//
//public EventSubscriptionServiceConfiguration getEventSubscriptionServiceConfiguration() {
// return eventSubscriptionServiceConfiguration;
//}
public void setEventSubscriptionServiceConfiguration(EventSubscriptionServiceConfiguration eventSubscriptionServiceConfiguration) {
this.eventSubscriptionServiceConfiguration = eventSubscriptionServiceConfiguration;
}
//class MybatisEventSubscriptionDataManager : AbstractEventSubscriptionDataManager!EventSubscriptionEntity , EventSubscriptionDataManager {
//private static List<Class<? extends EventSubscriptionEntity>> ENTITY_SUBCLASSES = new ArrayList<>();
//
//static {
// ENTITY_SUBCLASSES.add(MessageEventSubscriptionEntityImpl.class);
// ENTITY_SUBCLASSES.add(SignalEventSubscriptionEntityImpl.class);
// ENTITY_SUBCLASSES.add(CompensateEventSubscriptionEntityImpl.class);
//}
//protected CachedEntityMatcher<EventSubscriptionEntity> eventSubscriptionsByNameMatcher = new EventSubscriptionsByNameMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> eventSubscriptionsByExecutionIdMatcher = new EventSubscriptionsByExecutionIdMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> eventSubscriptionsBySubScopeIdMatcher = new EventSubscriptionsBySubScopeIdMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> eventSubscriptionsByProcInstTypeAndActivityMatcher = new EventSubscriptionsByProcInstTypeAndActivityMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> eventSubscriptionsByExecutionAndTypeMatcher = new EventSubscriptionsByExecutionAndTypeMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> eventSubscriptionsByScopeDefinitionIdAndTypeMatcher = new EventSubscriptionsByScopeDefinitionIdAndTypeMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> signalEventSubscriptionByNameAndExecutionMatcher = new SignalEventSubscriptionByNameAndExecutionMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> signalEventSubscriptionByProcInstAndEventNameMatcher = new SignalEventSubscriptionByProcInstAndEventNameMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> signalEventSubscriptionByScopeAndEventNameMatcher = new SignalEventSubscriptionByScopeAndEventNameMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> signalEventSubscriptionByScopeIdAndTypeMatcher = new SignalEventSubscriptionByScopeIdAndTypeMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> signalEventSubscriptionByEventNameMatcher = new SignalEventSubscriptionByEventNameMatcher();
//
//protected CachedEntityMatcher<EventSubscriptionEntity> messageEventSubscriptionsByProcInstAndEventNameMatcher = new MessageEventSubscriptionsByProcInstAndEventNameMatcher();
this(EventSubscriptionServiceConfiguration eventSubscriptionServiceConfiguration) {
this.eventSubscriptionServiceConfiguration = eventSubscriptionServiceConfiguration;
super(entityManagerFactory.currentEntityManager());
}
public void insert(EventSubscriptionEntity entity) {
insert(cast(EventSubscriptionEntityImpl)entity);
//getDbSqlSession().insert(entity);
}
public EventSubscriptionEntity update(EventSubscriptionEntity entity) {
return update(cast(EventSubscriptionEntityImpl)entity);
//getDbSqlSession().update(entity);
//return entity;
}
public void dele(string id) {
EventSubscriptionEntity entity = findById(id);
if (entity !is null)
{
remove(cast(EventSubscriptionEntityImpl)entity);
}
//delete(entity);
}
public void dele(EventSubscriptionEntity entity) {
if (entity !is null)
{
remove(cast(EventSubscriptionEntityImpl)entity);
}
//getDbSqlSession().delete(entity);
}
public EventSubscriptionEntity findById(string executionId) {
//if (isExecutionTreeFetched(executionId)) {
// return getEntityCache().findInCache(getManagedEntityClass(), executionId);
//}
//return super.findById(executionId);
return find(executionId);
}
//
//public Class<? extends EventSubscriptionEntity> getManagedEntityClass() {
// return EventSubscriptionEntityImpl.class;
//}
//
//
//public List<Class<? extends EventSubscriptionEntity>> getManagedEntitySubClasses() {
// return ENTITY_SUBCLASSES;
//}
override
public EventSubscriptionEntity create() {
// only allowed to create subclasses
throw new UnsupportedOperationException();
}
public CompensateEventSubscriptionEntity createCompensateEventSubscription() {
return new CompensateEventSubscriptionEntityImpl();
}
public MessageEventSubscriptionEntity createMessageEventSubscription() {
return new MessageEventSubscriptionEntityImpl();
}
public SignalEventSubscriptionEntity createSignalEventSubscription() {
return new SignalEventSubscriptionEntityImpl();
}
public GenericEventSubscriptionEntity createGenericEventSubscriptionEntity() {
return new GenericEventSubscriptionEntityImpl();
}
public long findEventSubscriptionCountByQueryCriteria(EventSubscriptionQueryImpl eventSubscriptionQueryImpl) {
implementationMissing(false);
return 0;
// string query = "selectEventSubscriptionCountByQueryCriteria";
//return (Long) getDbSqlSession().selectOne(query, eventSubscriptionQueryImpl);
}
public List!EventSubscription findEventSubscriptionsByQueryCriteria(EventSubscriptionQueryImpl eventSubscriptionQueryImpl) {
implementationMissing(false);
return new ArrayList!EventSubscription;
// string query = "selectEventSubscriptionByQueryCriteria";
//return getDbSqlSession().selectList(query, eventSubscriptionQueryImpl, getManagedEntityClass());
}
public List!MessageEventSubscriptionEntity findMessageEventSubscriptionsByProcessInstanceAndEventName( string processInstanceId, string eventName) {
implementationMissing(false);
return null;
//Map<string, string> params = new HashMap<>();
//params.put("processInstanceId", processInstanceId);
//params.put("eventName", eventName);
//return toMessageEventSubscriptionEntityList(getList("selectMessageEventSubscriptionsByProcessInstanceAndEventName",
// params, messageEventSubscriptionsByProcInstAndEventNameMatcher, true));
}
public List!SignalEventSubscriptionEntity findSignalEventSubscriptionsByEventName( string eventName, string tenantId) {
implementationMissing(false);
return null;
// string query = "selectSignalEventSubscriptionsByEventName";
//
// Map<string, string> params = new HashMap<>();
//params.put("eventName", eventName);
//if (tenantId !is null && !tenantId.equals(EventSubscriptionServiceConfiguration.NO_TENANT_ID)) {
// params.put("tenantId", tenantId);
//}
//
//List<EventSubscriptionEntity> result = getList(query, params, signalEventSubscriptionByEventNameMatcher, true);
//return toSignalEventSubscriptionEntityList(result);
}
public List!SignalEventSubscriptionEntity findSignalEventSubscriptionsByProcessInstanceAndEventName( string processInstanceId, string eventName) {
implementationMissing(false);
return null;
// string query = "selectSignalEventSubscriptionsByProcessInstanceAndEventName";
//Map<string, string> params = new HashMap<>();
//params.put("processInstanceId", processInstanceId);
//params.put("eventName", eventName);
//return toSignalEventSubscriptionEntityList(getList(query, params, signalEventSubscriptionByProcInstAndEventNameMatcher, true));
}
public List!SignalEventSubscriptionEntity findSignalEventSubscriptionsByScopeAndEventName( string scopeId, string scopeType, string eventName) {
implementationMissing(false);
return null;
// string query = "selectSignalEventSubscriptionsByScopeAndEventName";
//Map<string, string> params = new HashMap<>();
//params.put("scopeId", scopeId);
//params.put("scopeType", scopeType);
//params.put("eventName", eventName);
//return toSignalEventSubscriptionEntityList(getList(query, params, signalEventSubscriptionByScopeAndEventNameMatcher, true));
}
public List!SignalEventSubscriptionEntity findSignalEventSubscriptionsByNameAndExecution( string name, string executionId) {
implementationMissing(false);
return null;
//Map<string, string> params = new HashMap<>();
//params.put("executionId", executionId);
//params.put("eventName", name);
//return toSignalEventSubscriptionEntityList(getList("selectSignalEventSubscriptionsByNameAndExecution", params, signalEventSubscriptionByNameAndExecutionMatcher, true));
}
public List!EventSubscriptionEntity findEventSubscriptionsByExecutionAndType( string executionId, string type) {
implementationMissing(false);
return null;
//Map<string, string> params = new HashMap<>();
//params.put("executionId", executionId);
//params.put("eventType", type);
//return getList("selectEventSubscriptionsByExecutionAndType", params, eventSubscriptionsByExecutionAndTypeMatcher, true);
}
public List!EventSubscriptionEntity findEventSubscriptionsByProcessInstanceAndActivityId( string processInstanceId, string activityId, string type) {
implementationMissing(false);
return null;
//Map<string, string> params = new HashMap<>();
//params.put("processInstanceId", processInstanceId);
//params.put("eventType", type);
//params.put("activityId", activityId);
//return getList("selectEventSubscriptionsByProcessInstanceTypeAndActivity", params, eventSubscriptionsByProcInstTypeAndActivityMatcher, true);
}
public List!EventSubscriptionEntity findEventSubscriptionsByExecution( string executionId) {
implementationMissing(false);
return null;
//DbSqlSession dbSqlSession = getDbSqlSession();
//
//// If the execution has been inserted in the same command execution as this query, there can't be any in the database
//if (isEntityInserted(dbSqlSession, "execution", executionId)) {
// return getListFromCache(eventSubscriptionsByExecutionIdMatcher, executionId);
//}
//
//return getList(dbSqlSession, "selectEventSubscriptionsByExecution", executionId, eventSubscriptionsByExecutionIdMatcher, true);
}
public List!EventSubscriptionEntity findEventSubscriptionsBySubScopeId( string subScopeId) {
implementationMissing(false);
return null;
//DbSqlSession dbSqlSession = getDbSqlSession();
//
//// If the sub scope has been inserted in the same command execution as this query, there can't be any in the database
//if (isEntityInserted(dbSqlSession, "subScopeId", subScopeId)) {
// return getListFromCache(eventSubscriptionsBySubScopeIdMatcher, subScopeId);
//}
//
//return getList(dbSqlSession, "selectEventSubscriptionsBySubScopeId", subScopeId, eventSubscriptionsBySubScopeIdMatcher, true);
}
public List!EventSubscriptionEntity findEventSubscriptionsByTypeAndProcessDefinitionId(string type, string processDefinitionId, string tenantId) {
scope(exit)
{
_manager.close();
}
string query = "SELECT * FROM EventSubscriptionEntityImpl u WHERE "~((type is null || type.length == 0) ? "" :(" u.eventType = :type"));
query = query ~ " AND u.processDefinitionId = :processDefinitionId";
query = query ~ " AND (u.executionId is null OR u.executionId = '')";
query = query ~ " AND (u.processInstanceId is null OR u.processInstanceId = '') AND";
query = query ~ ((tenantId !is null && tenantId.length != 0) ? (" u.tenantId = :tenantId"): " (u.tenantId = '' OR u.tenantId is null)");
//logInfof("query : %s",query);
auto queryBuilder = _manager.createQuery!(EventSubscriptionEntityImpl)(query);
if(type !is null && type.length != 0)
{
queryBuilder.setParameter("type",type);
}
queryBuilder.setParameter("processDefinitionId",processDefinitionId);
if (tenantId !is null && tenantId.length != 0)
{
queryBuilder.setParameter("tenantId",tenantId);
}
EventSubscriptionEntityImpl[] array = queryBuilder.getResultList();
List!EventSubscriptionEntity rt = new ArrayList!EventSubscriptionEntity;
foreach(EventSubscriptionEntityImpl e; array)
{
rt.add(cast(EventSubscriptionEntity)e);
}
return rt;
// string query = "selectEventSubscriptionsByTypeAndProcessDefinitionId";
//Map<string, string> params = new HashMap<>();
//if (type !is null) {
// params.put("eventType", type);
//}
//params.put("processDefinitionId", processDefinitionId);
//if (tenantId !is null && !tenantId.equals(EventSubscriptionServiceConfiguration.NO_TENANT_ID)) {
// params.put("tenantId", tenantId);
//}
//return getDbSqlSession().selectList(query, params);
//implementationMissing(false);
//return null;
}
public List!EventSubscriptionEntity findEventSubscriptionsByName( string type, string eventName, string tenantId) {
implementationMissing(false);
return null;
//Map<string, string> params = new HashMap<>();
//params.put("eventType", type);
//params.put("eventName", eventName);
//if (tenantId !is null && !tenantId.equals(EventSubscriptionServiceConfiguration.NO_TENANT_ID)) {
// params.put("tenantId", tenantId);
//}
//
//return getList("selectEventSubscriptionsByName", params, eventSubscriptionsByNameMatcher, true);
}
public List!EventSubscriptionEntity findEventSubscriptionsByNameAndExecution(string type, string eventName, string executionId) {
implementationMissing(false);
return null;
// string query = "selectEventSubscriptionsByNameAndExecution";
//Map<string, string> params = new HashMap<>();
//params.put("eventType", type);
//params.put("eventName", eventName);
//params.put("executionId", executionId);
//return getDbSqlSession().selectList(query, params);
}
public MessageEventSubscriptionEntity findMessageStartEventSubscriptionByName(string messageName, string tenantId) {
implementationMissing(false);
return null;
//Map<string, string> params = new HashMap<>();
//params.put("eventName", messageName);
//if (tenantId !is null && !tenantId.equals(EventSubscriptionServiceConfiguration.NO_TENANT_ID)) {
// params.put("tenantId", tenantId);
//}
//MessageEventSubscriptionEntity entity = (MessageEventSubscriptionEntity) getDbSqlSession().selectOne("selectMessageStartEventSubscriptionByName", params);
//return entity;
}
public void updateEventSubscriptionTenantId(string oldTenantId, string newTenantId) {
implementationMissing(false);
//Map<string, string> params = new HashMap<>();
//params.put("oldTenantId", oldTenantId);
//params.put("newTenantId", newTenantId);
//getDbSqlSession().update("updateTenantIdOfEventSubscriptions", params);
}
public void deleteEventSubscriptionsForProcessDefinition(string processDefinitionId) {
implementationMissing(false);
// getDbSqlSession().delete("deleteEventSubscriptionsForProcessDefinition", processDefinitionId, EventSubscriptionEntityImpl.class);
}
public void deleteEventSubscriptionsByExecutionId(string executionId) {
implementationMissing(false);
//DbSqlSession dbSqlSession = getDbSqlSession();
//if (isEntityInserted(dbSqlSession, "execution", executionId)) {
// deleteCachedEntities(dbSqlSession, eventSubscriptionsByExecutionIdMatcher, executionId);
//} else {
// bulkDelete("deleteEventSubscriptionsByExecutionId", eventSubscriptionsByExecutionIdMatcher, executionId);
//}
}
public void deleteEventSubscriptionsForScopeIdAndType(string scopeId, string scopeType) {
implementationMissing(false);
//Map<string, string> params = new HashMap<>();
//params.put("scopeId", scopeId);
//params.put("scopeType", scopeType);
//bulkDelete("deleteEventSubscriptionsForScopeIdAndType", signalEventSubscriptionByScopeIdAndTypeMatcher, params);
}
public void deleteEventSubscriptionsForScopeDefinitionIdAndType(string scopeDefinitionId, string scopeType) {
implementationMissing(false);
//Map<string, string> params = new HashMap<>();
//params.put("scopeDefinitionId", scopeDefinitionId);
//params.put("scopeType", scopeType);
//bulkDelete("deleteEventSubscriptionsForScopeDefinitionIdAndType", eventSubscriptionsByScopeDefinitionIdAndTypeMatcher, params);
}
protected List!SignalEventSubscriptionEntity toSignalEventSubscriptionEntityList(List!EventSubscriptionEntity result) {
implementationMissing(false);
return null;
//List<SignalEventSubscriptionEntity> signalEventSubscriptionEntities = new ArrayList<>(result.size());
//for (EventSubscriptionEntity eventSubscriptionEntity : result) {
// signalEventSubscriptionEntities.add((SignalEventSubscriptionEntity) eventSubscriptionEntity);
//}
//return signalEventSubscriptionEntities;
}
protected List!MessageEventSubscriptionEntity toMessageEventSubscriptionEntityList(List!EventSubscriptionEntity result) {
implementationMissing(false);
return null;
//List<MessageEventSubscriptionEntity> messageEventSubscriptionEntities = new ArrayList<>(result.size());
//for (EventSubscriptionEntity eventSubscriptionEntity : result) {
// messageEventSubscriptionEntities.add((MessageEventSubscriptionEntity) eventSubscriptionEntity);
//}
//return messageEventSubscriptionEntities;
}
}
|
D
|
module sdfs.client.app;
import std.stdio : writeln, writefln;
import std.path;
import std.file;
import buffer.rpc.client;
import appbase.utils;
import sdfs.client.configuration;
extern (C) short upload(const string trackerHost, const ushort trackerPort, const ushort messageMagic,
const scope void[] content, ref string url, ref string errorInfo);
void main(string[] args)
{
if (args.length < 2)
{
writeln("Usage: sdfs.client filename.");
return;
}
if (!args[1].exists)
{
writefln("File %s not exists.", args[1]);
return;
}
version (Posix)
{
import core.sys.posix.signal;
sigset_t mask1;
sigemptyset(&mask1);
sigaddset(&mask1, SIGPIPE);
sigaddset(&mask1, SIGILL);
sigprocmask(SIG_BLOCK, &mask1, null);
}
Config.initConfiguration();
string url, errorInfo;
immutable short result = upload(
config.server.host.tracker.value,
config.server.port.tracker.as!ushort,
config.sys.protocol.magic.as!ushort,
read(args[1]),
url, errorInfo);
writeln(result);
writeln(url);
writeln(errorInfo);
}
|
D
|
import std.stdio;
import std.conv : to;
import std.file;
import procon28.decoder;
import procon28.encoder;
import procon28.geometry;
import std.algorithm.searching;
import std.algorithm.iteration;
void main(string[] args) {
auto output = args[1].readText.decode_output;
auto piece = args[2].readText.decode_piece;
auto new_piece = args[3];
auto merge_ids = args[4..$].to!(int[]);
P[] merged;
auto piece_id = output[merge_ids[0]].piece_idx;
foreach (id; merge_ids) {
writeln(output[id].piece_idx);
merged = merge_piece(piece[output[id].piece_idx][output[id].spin_level].move(output[id].x, output[id].y), merged)[0].adjust;
}
P[][] spin_all = [merged];
foreach (_;0..7) {
merged = rotate90(merged);
spin_all ~= merged.adjust;
}
P[][][] replaced ;
foreach(i, p; piece) {
if (i == piece_id)
replaced ~= spin_all;
else if (merge_ids[1..$].map!(a => output[a].piece_idx).any!(a => a == i))
continue;
else
replaced ~= p;
}
auto output_file = File (new_piece, "w");
output_file.write(replaced.pieces_pp);
}
|
D
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_6_BeT-5517634152.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_6_BeT-5517634152.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
instance Mod_7015_HS_Bauer_REL (Npc_Default)
{
// ------ NSC ------
name = "Bauer";
guild = GIL_OUT;
id = 7015;
voice = 5;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 1); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_COWARD; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_1h_Bau_mace);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_FatBald", Face_P_NormalBart01, BodyTex_P, ITAR_Hofstaatler);
Mdl_SetModelFatness (self, 1);
Mdl_ApplyOverlayMds (self, "Humans_Tired.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 20); //Grenzen für Talent-Level liegen bei 30 und 60
senses_range = 100;
// ------ TA anmelden ------
daily_routine = Rtn_Start_7015;
};
FUNC VOID Rtn_Start_7015 ()
{
TA_Rake_FP (08,00,22,00,"REL_267");
TA_Sleep (22,00,08,00,"REL_267");
};
|
D
|
a large number or amount
|
D
|
import std.stdio;
void main() {
auto Δ = 1;
Δ++;
writeln(Δ);
}
|
D
|
/*
Copyright (c) 2012 Ola Østtveit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
module EntityConsole;
import std.algorithm;
import std.conv;
import std.range;
import std.string;
import derelict.opengl.gl;
import gl3n.linalg;
import Console;
import Game;
import SubSystem.Graphics;
class EntityConsole : Console
{
public:
this(Game p_game)
{
game = p_game;
entity = null;
executeCommand = &this.executeEntityCommand;
}
void setEntity(Entity p_entity)
{
entity = p_entity;
if (entity !is null)
active = true;
}
override bool isActive()
{
return entity !is null;
}
OutputLine[] executeEntityCommand(string command)
{
if (entity is null)
{
return [];
}
if (command == "help")
{
return [OutputLine("Commands available: ", vec3(1, 1, 1)),
OutputLine("help - shows this list", vec3(1, 1, 1)),
OutputLine("exit/quit - closes this console", vec3(1, 1, 1)),
OutputLine("values - list values in entity", vec3(1, 1, 1)),
OutputLine("value key - prints value of given key", vec3(1, 1, 1)),
OutputLine("keys - list keys in entity", vec3(1, 1, 1)),
OutputLine("register - registers entity", vec3(1, 1, 1)),
OutputLine("set key value - sets key to the given value", vec3(1, 1, 1)),
OutputLine("Don't panic", vec3(0, 1, 0)),];
}
else if (command == "exit" || command == "quit")
{
entity = null;
return [];
}
else if (command == "values")
{
OutputLine[] values;
foreach (key, value; entity.values)
values ~= OutputLine(key ~ ": " ~ to!string(value.until("\\n")), vec3(1, 1, 1));
values ~= OutputLine("", vec3(1, 1, 1));
return values;
}
else if (command.startsWith("value"))
{
command.skipOver("value");
auto key = command.strip;
return [OutputLine(entity.getValue(key), vec3(1, 1, 1))];
}
else if (command == "keys")
{
OutputLine[] lines;
auto keys = entity.values.keys.dup;
for (int n = 0; n < keys.length; n += 2)
lines ~= OutputLine(to!string(keys[n..min(n+2, keys.length-1)]), vec3(1, 1, 1));
lines ~= OutputLine("", vec3(1, 1, 1));
return lines;
}
else if (command == "register")
{
game.registerEntity(entity);
return [OutputLine("Registered entity " ~ to!string(entity.id), vec3(1, 1, 1))];
}
else if (command.startsWith("set"))
{
try
{
command.skipOver("set");
auto parameters = command.strip.split(" ");
string key = parameters[0];
string value = reduce!((a, b) => (a ~= " " ~ b))(parameters[1..$]);
entity.setValue(key, value);
string text = to!string(entity.values);
return [OutputLine(to!string(text.until("\\n")), vec3(1, 1, 1))];
}
catch (ConvException e) {}
}
return [OutputLine("?? " ~ command, vec3(1, 0, 0))];
}
override void display(Graphics graphics, float elapsedTime)
{
if (!isActive() || entity is null)
return;
assert(entity !is null);
assert(game !is null),
assert(game.m_placer.hasComponent(entity));
auto placerComponent = game.m_placer.getComponent(entity);
glPushMatrix();
glScalef(graphics.zoom, graphics.zoom, 1.0);
glTranslatef(-graphics.getCenterEntityPosition.x, -graphics.getCenterEntityPosition.y, 0.0);
glTranslatef(placerComponent.position.x, placerComponent.position.y, 0.0);
glScalef(1.0 / graphics.zoom, 1.0 / graphics.zoom, 1.0);
glPushMatrix();
glColor4f(0.0, 0.5, 0.5, 0.8);
glBegin(GL_QUADS);
glVertex2f( 0.0, -0.2);
glVertex2f( 0.0, 0.5);
glVertex2f( 0.9, 0.5);
glVertex2f( 0.9, -0.2);
glEnd();
glPopMatrix();
glPushMatrix();
glTranslatef(0.05, -0.15, 0.0);
glScalef(0.05, 0.05, 1.0);
glColor3f(0.2, 1.0, 0.4);
if (to!int(elapsedTime*2) % 2 == 0)
graphics.renderString(inputLine);
else
graphics.renderString(inputLine ~ "_");
foreach (outputLine; take(outputBuffer.retro, 12))
{
glTranslatef(0.0, 1.0, 0.0);
glColor3f(outputLine.color.r, outputLine.color.g, outputLine.color.b);
graphics.renderString(outputLine.text);
}
glPopMatrix();
glPopMatrix();
}
private:
Game game;
Entity entity;
}
|
D
|
module mordor.common.streams.notify;
public import mordor.common.streams.filter;
class NotifyStream : FilterStream
{
this(Stream parent, bool ownsParent = true)
{
super(parent, ownsParent);
}
void delegate() notifyOnClose() { return _closeDg; }
void notifyOnClose(void delegate() dg) { _closeDg = dg; }
void delegate() notifyOnEof() { return _eofDg; }
void notifyOnEof(void delegate() dg) { _eofDg = dg; }
void close(CloseType type)
{
super.close(type);
if (_closeDg !is null)
_closeDg();
}
size_t read(Buffer b, size_t len)
{
size_t result = super.read(b, len);
if (result == 0 && _eofDg !is null) {
_eofDg();
}
return result;
}
private:
void delegate() _closeDg, _eofDg;
}
|
D
|
/**
This module contains the core functionality of the vibe.d framework.
Copyright: © 2012-2017 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module vibe.core.core;
public import vibe.core.task;
import eventcore.core;
import vibe.core.args;
import vibe.core.concurrency;
import vibe.core.log;
import vibe.core.sync : ManualEvent, createSharedManualEvent;
import vibe.core.taskpool : TaskPool;
import vibe.internal.async;
import vibe.internal.array : FixedRingBuffer;
//import vibe.utils.array;
import std.algorithm;
import std.conv;
import std.encoding;
import core.exception;
import std.exception;
import std.functional;
import std.range : empty, front, popFront;
import std.string;
import std.traits : isFunctionPointer;
import std.typecons : Typedef, Tuple, tuple;
import std.variant;
import core.atomic;
import core.sync.condition;
import core.sync.mutex;
import core.stdc.stdlib;
import core.thread;
version(Posix)
{
import core.sys.posix.signal;
import core.sys.posix.unistd;
import core.sys.posix.pwd;
static if (__traits(compiles, {import core.sys.posix.grp; getgrgid(0);})) {
import core.sys.posix.grp;
} else {
extern (C) {
struct group {
char* gr_name;
char* gr_passwd;
gid_t gr_gid;
char** gr_mem;
}
group* getgrgid(gid_t);
group* getgrnam(in char*);
}
}
}
version (Windows)
{
import core.stdc.signal;
}
/**************************************************************************************************/
/* Public functions */
/**************************************************************************************************/
/**
Performs final initialization and runs the event loop.
This function performs three tasks:
$(OL
$(LI Makes sure that no unrecognized command line options are passed to
the application and potentially displays command line help. See also
`vibe.core.args.finalizeCommandLineOptions`.)
$(LI Performs privilege lowering if required.)
$(LI Runs the event loop and blocks until it finishes.)
)
Params:
args_out = Optional parameter to receive unrecognized command line
arguments. If left to `null`, an error will be reported if
any unrecognized argument is passed.
See_also: ` vibe.core.args.finalizeCommandLineOptions`, `lowerPrivileges`,
`runEventLoop`
*/
int runApplication(string[]* args_out = null)
@safe {
try if (!() @trusted { return finalizeCommandLineOptions(); } () ) return 0;
catch (Exception e) {
logDiagnostic("Error processing command line: %s", e.msg);
return 1;
}
lowerPrivileges();
logDiagnostic("Running event loop...");
int status;
version (VibeDebugCatchAll) {
try {
status = runEventLoop();
} catch( Throwable th ){
logError("Unhandled exception in event loop: %s", th.msg);
logDiagnostic("Full exception: %s", th.toString().sanitize());
return 1;
}
} else {
status = runEventLoop();
}
logDiagnostic("Event loop exited with status %d.", status);
return status;
}
/// A simple echo server, listening on a privileged TCP port.
unittest {
import vibe.core.core;
import vibe.core.net;
int main()
{
// first, perform any application specific setup (privileged ports still
// available if run as root)
listenTCP(7, (conn) {
try conn.write(conn);
catch (Exception e) { /* log error */ }
});
// then use runApplication to perform the remaining initialization and
// to run the event loop
return runApplication();
}
}
/** The same as above, but performing the initialization sequence manually.
This allows to skip any additional initialization (opening the listening
port) if an invalid command line argument or the `--help` switch is
passed to the application.
*/
unittest {
import vibe.core.core;
import vibe.core.net;
int main()
{
// process the command line first, to be able to skip the application
// setup if not required
if (!finalizeCommandLineOptions()) return 0;
// then set up the application
listenTCP(7, (conn) {
try conn.write(conn);
catch (Exception e) { /* log error */ }
});
// finally, perform privilege lowering (safe to skip for non-server
// applications)
lowerPrivileges();
// and start the event loop
return runEventLoop();
}
}
/**
Starts the vibe.d event loop for the calling thread.
Note that this function is usually called automatically by the vibe.d
framework. However, if you provide your own `main()` function, you may need
to call either this or `runApplication` manually.
The event loop will by default continue running during the whole life time
of the application, but calling `runEventLoop` multiple times in sequence
is allowed. Tasks will be started and handled only while the event loop is
running.
Returns:
The returned value is the suggested code to return to the operating
system from the `main` function.
See_Also: `runApplication`
*/
int runEventLoop()
@safe nothrow {
setupSignalHandlers();
logDebug("Starting event loop.");
s_eventLoopRunning = true;
scope (exit) {
s_eventLoopRunning = false;
s_exitEventLoop = false;
() @trusted nothrow {
scope (failure) assert(false); // notifyAll is not marked nothrow
st_threadShutdownCondition.notifyAll();
} ();
}
// runs any yield()ed tasks first
assert(!s_exitEventLoop, "Exit flag set before event loop has started.");
s_exitEventLoop = false;
performIdleProcessing();
if (getExitFlag()) return 0;
Task exit_task;
// handle exit flag in the main thread to exit when
// exitEventLoop(true) is called from a thread)
() @trusted nothrow {
if (s_isMainThread)
exit_task = runTask(toDelegate(&watchExitFlag));
} ();
while (true) {
auto er = s_scheduler.waitAndProcess();
if (er != ExitReason.idle || s_exitEventLoop) {
logDebug("Event loop exit reason (exit flag=%s): %s", s_exitEventLoop, er);
break;
}
performIdleProcessing();
}
// make sure the exit flag watch task finishes together with this loop
// TODO: would be niced to do this without exceptions
if (exit_task && exit_task.running)
exit_task.interrupt();
logDebug("Event loop done (scheduled tasks=%s, waiters=%s, thread exit=%s).",
s_scheduler.scheduledTaskCount, eventDriver.core.waiterCount, s_exitEventLoop);
eventDriver.core.clearExitFlag();
s_exitEventLoop = false;
return 0;
}
/**
Stops the currently running event loop.
Calling this function will cause the event loop to stop event processing and
the corresponding call to runEventLoop() will return to its caller.
Params:
shutdown_all_threads = If true, exits event loops of all threads -
false by default. Note that the event loops of all threads are
automatically stopped when the main thread exits, so usually
there is no need to set shutdown_all_threads to true.
*/
void exitEventLoop(bool shutdown_all_threads = false)
@safe nothrow {
logDebug("exitEventLoop called (%s)", shutdown_all_threads);
assert(s_eventLoopRunning || shutdown_all_threads, "Exiting event loop when none is running.");
if (shutdown_all_threads) {
() @trusted nothrow {
atomicStore(st_term, true);
st_threadsSignal.emit();
} ();
}
// shutdown the calling thread
s_exitEventLoop = true;
if (s_eventLoopRunning) eventDriver.core.exit();
}
/**
Process all pending events without blocking.
Checks if events are ready to trigger immediately, and run their callbacks if so.
Returns: Returns false $(I iff) exitEventLoop was called in the process.
*/
bool processEvents()
@safe nothrow {
return !s_scheduler.process().among(ExitReason.exited, ExitReason.outOfWaiters);
}
/**
Wait once for events and process them.
*/
ExitReason runEventLoopOnce()
@safe nothrow {
auto ret = s_scheduler.waitAndProcess();
if (ret == ExitReason.idle)
performIdleProcessing();
return ret;
}
/**
Sets a callback that is called whenever no events are left in the event queue.
The callback delegate is called whenever all events in the event queue have been
processed. Returning true from the callback will cause another idle event to
be triggered immediately after processing any events that have arrived in the
meantime. Returning false will instead wait until another event has arrived first.
*/
void setIdleHandler(void delegate() @safe nothrow del)
@safe nothrow {
s_idleHandler = () @safe nothrow { del(); return false; };
}
/// ditto
void setIdleHandler(bool delegate() @safe nothrow del)
@safe nothrow {
s_idleHandler = del;
}
/**
Runs a new asynchronous task.
task will be called synchronously from within the vibeRunTask call. It will
continue to run until vibeYield() or any of the I/O or wait functions is
called.
Note that the maximum size of all args must not exceed `maxTaskParameterSize`.
*/
Task runTask(ARGS...)(void delegate(ARGS) @safe task, auto ref ARGS args)
{
return runTask_internal!((ref tfi) { tfi.set(task, args); });
}
///
Task runTask(ARGS...)(void delegate(ARGS) @system task, auto ref ARGS args)
@system {
return runTask_internal!((ref tfi) { tfi.set(task, args); });
}
/// ditto
Task runTask(CALLABLE, ARGS...)(CALLABLE task, auto ref ARGS args)
if (!is(CALLABLE : void delegate(ARGS)) && is(typeof(CALLABLE.init(ARGS.init))))
{
return runTask_internal!((ref tfi) { tfi.set(task, args); });
}
/**
Runs an asyncronous task that is guaranteed to finish before the caller's
scope is left.
*/
auto runTaskScoped(FT, ARGS)(scope FT callable, ARGS args)
{
static struct S {
Task handle;
@disable this(this);
~this()
{
handle.joinUninterruptible();
}
}
return S(runTask(callable, args));
}
package Task runTask_internal(alias TFI_SETUP)()
{
import std.typecons : Tuple, tuple;
TaskFiber f;
while (!f && !s_availableFibers.empty) {
f = s_availableFibers.back;
s_availableFibers.popBack();
if (() @trusted nothrow { return f.state; } () != Fiber.State.HOLD) f = null;
}
if (f is null) {
// if there is no fiber available, create one.
if (s_availableFibers.capacity == 0) s_availableFibers.capacity = 1024;
logDebugV("Creating new fiber...");
f = new TaskFiber;
}
TFI_SETUP(f.m_taskFunc);
f.bumpTaskCounter();
auto handle = f.task();
debug Task self = Task.getThis();
debug if (TaskFiber.ms_taskEventCallback) {
() @trusted { TaskFiber.ms_taskEventCallback(TaskEvent.preStart, handle); } ();
}
s_scheduler.switchTo(handle);
debug if (TaskFiber.ms_taskEventCallback) {
() @trusted { TaskFiber.ms_taskEventCallback(TaskEvent.postStart, handle); } ();
}
return handle;
}
/**
Runs a new asynchronous task in a worker thread.
Only function pointers with weakly isolated arguments are allowed to be
able to guarantee thread-safety.
*/
void runWorkerTask(FT, ARGS...)(FT func, auto ref ARGS args)
if (isFunctionPointer!FT)
{
setupWorkerThreads();
st_workerPool.runTask(func, args);
}
/// ditto
void runWorkerTask(alias method, T, ARGS...)(shared(T) object, auto ref ARGS args)
if (is(typeof(__traits(getMember, object, __traits(identifier, method)))))
{
setupWorkerThreads();
st_workerPool.runTask!method(object, args);
}
/**
Runs a new asynchronous task in a worker thread, returning the task handle.
This function will yield and wait for the new task to be created and started
in the worker thread, then resume and return it.
Only function pointers with weakly isolated arguments are allowed to be
able to guarantee thread-safety.
*/
Task runWorkerTaskH(FT, ARGS...)(FT func, auto ref ARGS args)
if (isFunctionPointer!FT)
{
setupWorkerThreads();
return st_workerPool.runTaskH(func, args);
}
/// ditto
Task runWorkerTaskH(alias method, T, ARGS...)(shared(T) object, auto ref ARGS args)
if (is(typeof(__traits(getMember, object, __traits(identifier, method)))))
{
setupWorkerThreads();
return st_workerPool.runTaskH!method(object, args);
}
/// Running a worker task using a function
unittest {
static void workerFunc(int param)
{
logInfo("Param: %s", param);
}
static void test()
{
runWorkerTask(&workerFunc, 42);
runWorkerTask(&workerFunc, cast(ubyte)42); // implicit conversion #719
runWorkerTaskDist(&workerFunc, 42);
runWorkerTaskDist(&workerFunc, cast(ubyte)42); // implicit conversion #719
}
}
/// Running a worker task using a class method
unittest {
static class Test {
void workerMethod(int param)
shared {
logInfo("Param: %s", param);
}
}
static void test()
{
auto cls = new shared Test;
runWorkerTask!(Test.workerMethod)(cls, 42);
runWorkerTask!(Test.workerMethod)(cls, cast(ubyte)42); // #719
runWorkerTaskDist!(Test.workerMethod)(cls, 42);
runWorkerTaskDist!(Test.workerMethod)(cls, cast(ubyte)42); // #719
}
}
/// Running a worker task using a function and communicating with it
unittest {
static void workerFunc(Task caller)
{
int counter = 10;
while (receiveOnly!string() == "ping" && --counter) {
logInfo("pong");
caller.send("pong");
}
caller.send("goodbye");
}
static void test()
{
Task callee = runWorkerTaskH(&workerFunc, Task.getThis);
do {
logInfo("ping");
callee.send("ping");
} while (receiveOnly!string() == "pong");
}
static void work719(int) {}
static void test719() { runWorkerTaskH(&work719, cast(ubyte)42); }
}
/// Running a worker task using a class method and communicating with it
unittest {
static class Test {
void workerMethod(Task caller) shared {
int counter = 10;
while (receiveOnly!string() == "ping" && --counter) {
logInfo("pong");
caller.send("pong");
}
caller.send("goodbye");
}
}
static void test()
{
auto cls = new shared Test;
Task callee = runWorkerTaskH!(Test.workerMethod)(cls, Task.getThis());
do {
logInfo("ping");
callee.send("ping");
} while (receiveOnly!string() == "pong");
}
static class Class719 {
void work(int) shared {}
}
static void test719() {
auto cls = new shared Class719;
runWorkerTaskH!(Class719.work)(cls, cast(ubyte)42);
}
}
unittest { // run and join local task from outside of a task
int i = 0;
auto t = runTask({ sleep(1.msecs); i = 1; });
t.join();
assert(i == 1);
}
unittest { // run and join worker task from outside of a task
__gshared int i = 0;
auto t = runWorkerTaskH({ sleep(5.msecs); i = 1; });
t.join();
assert(i == 1);
}
/**
Runs a new asynchronous task in all worker threads concurrently.
This function is mainly useful for long-living tasks that distribute their
work across all CPU cores. Only function pointers with weakly isolated
arguments are allowed to be able to guarantee thread-safety.
The number of tasks started is guaranteed to be equal to
`workerThreadCount`.
*/
void runWorkerTaskDist(FT, ARGS...)(FT func, auto ref ARGS args)
if (is(typeof(*func) == function))
{
setupWorkerThreads();
return st_workerPool.runTaskDist(func, args);
}
/// ditto
void runWorkerTaskDist(alias method, T, ARGS...)(shared(T) object, ARGS args)
{
setupWorkerThreads();
return st_workerPool.runTaskDist!method(object, args);
}
/**
Sets up num worker threads.
This function gives explicit control over the number of worker threads.
Note, to have an effect the function must be called prior to related worker
tasks functions which set up the default number of worker threads
implicitly.
Params:
num = The number of worker threads to initialize. Defaults to
`logicalProcessorCount`.
See_also: `runWorkerTask`, `runWorkerTaskH`, `runWorkerTaskDist`
*/
public void setupWorkerThreads(uint num = logicalProcessorCount())
{
static bool s_workerThreadsStarted = false;
if (s_workerThreadsStarted) return;
s_workerThreadsStarted = true;
synchronized (st_threadsMutex) {
if (!st_workerPool)
st_workerPool = new shared TaskPool;
}
}
/**
Determines the number of logical processors in the system.
This number includes virtual cores on hyper-threading enabled CPUs.
*/
public @property uint logicalProcessorCount()
{
version (linux) {
import core.sys.linux.sys.sysinfo;
return get_nprocs();
} else version (OSX) {
int count;
size_t count_len = count.sizeof;
sysctlbyname("hw.logicalcpu", &count, &count_len, null, 0);
return cast(uint)count_len;
} else version (FreeBSD) {
int count;
size_t count_len = count.sizeof;
sysctlbyname("hw.logicalcpu", &count, &count_len, null, 0);
return cast(uint)count_len;
} else version (NetBSD) {
int count;
size_t count_len = count.sizeof;
sysctlbyname("hw.logicalcpu", &count, &count_len, null, 0);
return cast(uint)count_len;
} else version (Windows) {
import core.sys.windows.windows;
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
return sysinfo.dwNumberOfProcessors;
} else static assert(false, "Unsupported OS!");
}
version (OSX) private extern(C) int sysctlbyname(const(char)* name, void* oldp, size_t* oldlen, void* newp, size_t newlen);
version (FreeBSD) private extern(C) int sysctlbyname(const(char)* name, void* oldp, size_t* oldlen, void* newp, size_t newlen);
version (NetBSD) private extern(C) int sysctlbyname(const(char)* name, void* oldp, size_t* oldlen, void* newp, size_t newlen);
version (linux) static if (__VERSION__ <= 2066) private extern(C) int get_nprocs();
/**
Suspends the execution of the calling task to let other tasks and events be
handled.
Calling this function in short intervals is recommended if long CPU
computations are carried out by a task. It can also be used in conjunction
with Signals to implement cross-fiber events with no polling.
Throws:
May throw an `InterruptException` if `Task.interrupt()` gets called on
the calling task.
*/
void yield()
@safe {
auto t = Task.getThis();
if (t != Task.init) {
auto tf = () @trusted { return t.taskFiber; } ();
tf.handleInterrupt();
s_scheduler.yield();
tf.handleInterrupt();
} else {
// Let yielded tasks execute
() @safe nothrow { performIdleProcessing(); } ();
}
}
/**
Suspends the execution of the calling task until `switchToTask` is called
manually.
This low-level scheduling function is usually only used internally. Failure
to call `switchToTask` will result in task starvation and resource leakage.
Params:
on_interrupt = If specified, is required to
See_Also: `switchToTask`
*/
void hibernate(scope void delegate() @safe nothrow on_interrupt = null)
@safe nothrow {
auto t = Task.getThis();
if (t == Task.init) {
runEventLoopOnce();
} else {
auto tf = () @trusted { return t.taskFiber; } ();
tf.handleInterrupt(on_interrupt);
s_scheduler.hibernate();
tf.handleInterrupt(on_interrupt);
}
}
/**
Switches execution to the given task.
This function can be used in conjunction with `hibernate` to wake up a
task. The task must live in the same thread as the caller.
See_Also: `hibernate`
*/
void switchToTask(Task t)
@safe nothrow {
s_scheduler.switchTo(t);
}
/**
Suspends the execution of the calling task for the specified amount of time.
Note that other tasks of the same thread will continue to run during the
wait time, in contrast to $(D core.thread.Thread.sleep), which shouldn't be
used in vibe.d applications.
Throws: May throw an `InterruptException` if the task gets interrupted using
`Task.interrupt()`.
*/
void sleep(Duration timeout)
@safe {
assert(timeout >= 0.seconds, "Argument to sleep must not be negative.");
if (timeout <= 0.seconds) return;
auto tm = setTimer(timeout, null);
tm.wait();
}
///
unittest {
import vibe.core.core : sleep;
import vibe.core.log : logInfo;
import core.time : msecs;
void test()
{
logInfo("Sleeping for half a second...");
sleep(500.msecs);
logInfo("Done sleeping.");
}
}
/**
Returns a new armed timer.
Note that timers can only work if an event loop is running.
Params:
timeout = Determines the minimum amount of time that elapses before the timer fires.
callback = This delegate will be called when the timer fires
periodic = Speficies if the timer fires repeatedly or only once
Returns:
Returns a Timer object that can be used to identify and modify the timer.
See_also: createTimer
*/
Timer setTimer(Duration timeout, void delegate() nothrow @safe callback, bool periodic = false)
@safe nothrow {
auto tm = createTimer(callback);
tm.rearm(timeout, periodic);
return tm;
}
///
unittest {
void printTime()
@safe nothrow {
import std.datetime;
logInfo("The time is: %s", Clock.currTime());
}
void test()
{
import vibe.core.core;
// start a periodic timer that prints the time every second
setTimer(1.seconds, toDelegate(&printTime), true);
}
}
/// Compatibility overload - use a `@safe nothrow` callback instead.
deprecated("Use an @safe nothrow callback as argument to setTimer.")
Timer setTimer(Duration timeout, void delegate() callback, bool periodic = false)
@safe nothrow {
return setTimer(timeout, () @trusted nothrow {
try callback();
catch (Exception e) {
logWarn("Timer callback failed: %s", e.msg);
scope (failure) assert(false);
logDebug("Full error: %s", e.toString().sanitize);
}
});
}
/**
Creates a new timer without arming it.
See_also: setTimer
*/
Timer createTimer(void delegate() nothrow @safe callback)
@safe nothrow {
auto ret = Timer(eventDriver.timers.create());
if (callback !is null) {
runTask((void delegate() nothrow @safe cb, Timer tm) {
while (!tm.unique || tm.pending) {
tm.wait();
cb();
}
}, callback, ret);
}
return ret;
}
/**
Creates an event to wait on an existing file descriptor.
The file descriptor usually needs to be a non-blocking socket for this to
work.
Params:
file_descriptor = The Posix file descriptor to watch
event_mask = Specifies which events will be listened for
Returns:
Returns a newly created FileDescriptorEvent associated with the given
file descriptor.
*/
FileDescriptorEvent createFileDescriptorEvent(int file_descriptor, FileDescriptorEvent.Trigger event_mask)
@safe nothrow {
return FileDescriptorEvent(file_descriptor, event_mask);
}
/**
Sets the stack size to use for tasks.
The default stack size is set to 512 KiB on 32-bit systems and to 16 MiB
on 64-bit systems, which is sufficient for most tasks. Tuning this value
can be used to reduce memory usage for large numbers of concurrent tasks
or to avoid stack overflows for applications with heavy stack use.
Note that this function must be called at initialization time, before any
task is started to have an effect.
Also note that the stack will initially not consume actual physical memory -
it just reserves virtual address space. Only once the stack gets actually
filled up with data will physical memory then be reserved page by page. This
means that the stack can safely be set to large sizes on 64-bit systems
without having to worry about memory usage.
*/
void setTaskStackSize(size_t sz)
nothrow {
TaskFiber.ms_taskStackSize = sz;
}
/**
The number of worker threads used for processing worker tasks.
Note that this function will cause the worker threads to be started,
if they haven't already.
See_also: `runWorkerTask`, `runWorkerTaskH`, `runWorkerTaskDist`,
`setupWorkerThreads`
*/
@property size_t workerThreadCount()
out(count) { assert(count > 0, "No worker threads started after setupWorkerThreads!?"); }
body {
setupWorkerThreads();
return st_threads.count!(c => c.isWorker);
}
/**
Disables the signal handlers usually set up by vibe.d.
During the first call to `runEventLoop`, vibe.d usually sets up a set of
event handlers for SIGINT, SIGTERM and SIGPIPE. Since in some situations
this can be undesirable, this function can be called before the first
invocation of the event loop to avoid this.
Calling this function after `runEventLoop` will have no effect.
*/
void disableDefaultSignalHandlers()
{
synchronized (st_threadsMutex)
s_disableSignalHandlers = true;
}
/**
Sets the effective user and group ID to the ones configured for privilege lowering.
This function is useful for services run as root to give up on the privileges that
they only need for initialization (such as listening on ports <= 1024 or opening
system log files).
*/
void lowerPrivileges(string uname, string gname)
@safe {
if (!isRoot()) return;
if (uname != "" || gname != "") {
static bool tryParse(T)(string s, out T n)
{
import std.conv, std.ascii;
if (!isDigit(s[0])) return false;
n = parse!T(s);
return s.length==0;
}
int uid = -1, gid = -1;
if (uname != "" && !tryParse(uname, uid)) uid = getUID(uname);
if (gname != "" && !tryParse(gname, gid)) gid = getGID(gname);
setUID(uid, gid);
} else logWarn("Vibe was run as root, and no user/group has been specified for privilege lowering. Running with full permissions.");
}
// ditto
void lowerPrivileges()
@safe {
lowerPrivileges(s_privilegeLoweringUserName, s_privilegeLoweringGroupName);
}
/**
Sets a callback that is invoked whenever a task changes its status.
This function is useful mostly for implementing debuggers that
analyze the life time of tasks, including task switches. Note that
the callback will only be called for debug builds.
*/
void setTaskEventCallback(TaskEventCallback func)
{
debug TaskFiber.ms_taskEventCallback = func;
}
/**
A version string representing the current vibe version
*/
enum vibeVersionString = "1.0.0-alpha";
/**
Generic file descriptor event.
This kind of event can be used to wait for events on a non-blocking
file descriptor. Note that this can usually only be used on socket
based file descriptors.
*/
struct FileDescriptorEvent {
/** Event mask selecting the kind of events to listen for.
*/
enum Trigger {
none = 0, /// Match no event (invalid value)
read = 1<<0, /// React on read-ready events
write = 1<<1, /// React on write-ready events
any = read|write /// Match any kind of event
}
private {
StreamSocketFD m_socket;
Trigger m_trigger;
}
@safe:
private this(int fd, Trigger event_mask)
nothrow {
m_socket = eventDriver.sockets.adoptStream(fd);
}
this(this)
nothrow {
if (m_socket != StreamSocketFD.invalid)
eventDriver.sockets.addRef(m_socket);
}
~this()
nothrow {
if (m_socket != StreamSocketFD.invalid)
eventDriver.sockets.releaseRef(m_socket);
}
/** Waits for the selected event to occur.
Params:
which = Optional event mask to react only on certain events
timeout = Maximum time to wait for an event
Returns:
The overload taking the timeout parameter returns true if
an event was received on time and false otherwise.
*/
void wait(Trigger which = Trigger.any)
{
wait(Duration.max, which);
}
/// ditto
bool wait(Duration timeout, Trigger which = Trigger.any)
{
if ((which & m_trigger) == Trigger.none) return true;
assert((which & m_trigger) == Trigger.read, "Waiting for write event not yet supported.");
Waitable!(IOCallback,
cb => eventDriver.sockets.waitForData(m_socket, cb),
(cb) { assert(false, "timeout not supported."); }
) readwaiter;
asyncAwaitAny!true(timeout, readwaiter);
return true;
}
}
/**
Represents a timer.
*/
struct Timer {
private {
typeof(eventDriver.timers) m_driver;
TimerID m_id;
debug uint m_magicNumber = 0x4d34f916;
}
@safe:
private this(TimerID id)
nothrow {
assert(id != TimerID.init, "Invalid timer ID.");
m_driver = eventDriver.timers;
m_id = id;
}
this(this)
nothrow {
debug assert(m_magicNumber == 0x4d34f916, "Timer corrupted.");
if (m_driver) m_driver.addRef(m_id);
}
~this()
nothrow {
debug assert(m_magicNumber == 0x4d34f916, "Timer corrupted.");
if (m_driver) m_driver.releaseRef(m_id);
}
/// True if the timer is yet to fire.
@property bool pending() nothrow { return m_driver.isPending(m_id); }
/// The internal ID of the timer.
@property size_t id() const nothrow { return m_id; }
bool opCast() const nothrow { return m_driver !is null; }
/// Determines if this reference is the only one
@property bool unique() const nothrow { return m_driver ? m_driver.isUnique(m_id) : false; }
/** Resets the timer to the specified timeout
*/
void rearm(Duration dur, bool periodic = false) nothrow
in { assert(dur > 0.seconds, "Negative timer duration specified."); }
body { m_driver.set(m_id, dur, periodic ? dur : 0.seconds); }
/** Resets the timer and avoids any firing.
*/
void stop() nothrow { if (m_driver) m_driver.stop(m_id); }
/** Waits until the timer fires.
*/
void wait()
{
asyncAwait!(TimerCallback,
cb => m_driver.wait(m_id, cb),
cb => m_driver.cancelWait(m_id)
);
}
}
/**************************************************************************************************/
/* private types */
/**************************************************************************************************/
private void setupGcTimer()
{
s_gcTimer = createTimer(() @trusted {
import core.memory;
logTrace("gc idle collect");
GC.collect();
GC.minimize();
s_ignoreIdleForGC = true;
});
s_gcCollectTimeout = dur!"seconds"(2);
}
package(vibe) void performIdleProcessing()
@safe nothrow {
bool again = !getExitFlag();
while (again) {
if (s_idleHandler)
again = s_idleHandler();
else again = false;
again = (s_scheduler.schedule() == ScheduleStatus.busy || again) && !getExitFlag();
if (again) {
auto er = eventDriver.core.processEvents(0.seconds);
if (er.among!(ExitReason.exited, ExitReason.outOfWaiters)) {
logDebug("Setting exit flag due to driver signalling exit");
s_exitEventLoop = true;
return;
}
}
}
if (s_scheduler.scheduledTaskCount) logDebug("Exiting from idle processing although there are still yielded tasks");
if (!s_ignoreIdleForGC && s_gcTimer) {
s_gcTimer.rearm(s_gcCollectTimeout);
} else s_ignoreIdleForGC = false;
}
private struct ThreadContext {
Thread thread;
bool isWorker;
this(Thread thr, bool worker) { this.thread = thr; this.isWorker = worker; }
}
/**************************************************************************************************/
/* private functions */
/**************************************************************************************************/
private {
Duration s_gcCollectTimeout;
Timer s_gcTimer;
bool s_ignoreIdleForGC = false;
__gshared core.sync.mutex.Mutex st_threadsMutex;
shared TaskPool st_workerPool;
shared ManualEvent st_threadsSignal;
__gshared ThreadContext[] st_threads;
__gshared Condition st_threadShutdownCondition;
shared bool st_term = false;
bool s_isMainThread = false; // set in shared static this
bool s_exitEventLoop = false;
package bool s_eventLoopRunning = false;
bool delegate() @safe nothrow s_idleHandler;
TaskScheduler s_scheduler;
FixedRingBuffer!TaskFiber s_availableFibers;
size_t s_maxRecycledFibers = 100;
string s_privilegeLoweringUserName;
string s_privilegeLoweringGroupName;
__gshared bool s_disableSignalHandlers = false;
}
private bool getExitFlag()
@trusted nothrow {
return s_exitEventLoop || atomicLoad(st_term);
}
package @property bool isEventLoopRunning() @safe nothrow @nogc { return s_eventLoopRunning; }
package @property ref TaskScheduler taskScheduler() @safe nothrow @nogc { return s_scheduler; }
package void recycleFiber(TaskFiber fiber)
@safe nothrow {
if (s_availableFibers.length >= s_maxRecycledFibers) {
auto fl = s_availableFibers.front;
s_availableFibers.popFront();
fl.shutdown();
() @trusted {
try destroy(fl);
catch (Exception e) logWarn("Failed to destroy fiber: %s", e.msg);
} ();
}
if (s_availableFibers.full)
s_availableFibers.capacity = 2 * s_availableFibers.capacity;
s_availableFibers.put(fiber);
}
private void setupSignalHandlers()
@trusted nothrow {
scope (failure) assert(false); // _d_monitorexit is not nothrow
__gshared bool s_setup = false;
// only initialize in main thread
synchronized (st_threadsMutex) {
if (s_setup) return;
s_setup = true;
if (s_disableSignalHandlers) return;
logTrace("setup signal handler");
version(Posix){
// support proper shutdown using signals
sigset_t sigset;
sigemptyset(&sigset);
sigaction_t siginfo;
siginfo.sa_handler = &onSignal;
siginfo.sa_mask = sigset;
siginfo.sa_flags = SA_RESTART;
sigaction(SIGINT, &siginfo, null);
sigaction(SIGTERM, &siginfo, null);
siginfo.sa_handler = &onBrokenPipe;
sigaction(SIGPIPE, &siginfo, null);
}
version(Windows){
// WORKAROUND: we don't care about viral @nogc attribute here!
import std.traits;
signal(SIGABRT, cast(ParameterTypeTuple!signal[1])&onSignal);
signal(SIGTERM, cast(ParameterTypeTuple!signal[1])&onSignal);
signal(SIGINT, cast(ParameterTypeTuple!signal[1])&onSignal);
}
}
}
// per process setup
shared static this()
{
version(Windows){
version(VibeLibeventDriver) enum need_wsa = true;
else version(VibeWin32Driver) enum need_wsa = true;
else enum need_wsa = false;
static if (need_wsa) {
logTrace("init winsock");
// initialize WinSock2
import std.c.windows.winsock;
WSADATA data;
WSAStartup(0x0202, &data);
}
}
s_isMainThread = true;
// COMPILER BUG: Must be some kind of module constructor order issue:
// without this, the stdout/stderr handles are not initialized before
// the log module is set up.
import std.stdio; File f; f.close();
initializeLogModule();
logTrace("create driver core");
st_threadsMutex = new Mutex;
st_threadShutdownCondition = new Condition(st_threadsMutex);
auto thisthr = Thread.getThis();
thisthr.name = "main";
assert(st_threads.length == 0, "Main thread not the first thread!?");
st_threads ~= ThreadContext(thisthr, false);
st_threadsSignal = createSharedManualEvent();
version(VibeIdleCollect) {
logTrace("setup gc");
driverCore.setupGcTimer();
}
version (VibeNoDefaultArgs) {}
else {
readOption("uid|user", &s_privilegeLoweringUserName, "Sets the user name or id used for privilege lowering.");
readOption("gid|group", &s_privilegeLoweringGroupName, "Sets the group name or id used for privilege lowering.");
}
import std.concurrency;
scheduler = new VibedScheduler;
import vibe.core.sync : SpinLock;
SpinLock.setup();
}
shared static ~this()
{
shutdownDriver();
size_t tasks_left = s_scheduler.scheduledTaskCount;
if (tasks_left > 0)
logWarn("There were still %d tasks running at exit.", tasks_left);
}
// per thread setup
static this()
{
/// workaround for:
// object.Exception@src/rt/minfo.d(162): Aborting: Cycle detected between modules with ctors/dtors:
// vibe.core.core -> vibe.core.drivers.native -> vibe.core.drivers.libasync -> vibe.core.core
if (Thread.getThis().isDaemon && Thread.getThis().name == "CmdProcessor") return;
auto thisthr = Thread.getThis();
synchronized (st_threadsMutex)
if (!st_threads.any!(c => c.thread is thisthr))
st_threads ~= ThreadContext(thisthr, false);
import vibe.core.sync : SpinLock;
SpinLock.setup();
}
static ~this()
{
auto thisthr = Thread.getThis();
bool is_main_thread = s_isMainThread;
synchronized (st_threadsMutex) {
auto idx = st_threads.countUntil!(c => c.thread is thisthr);
logDebug("Thread exit %s (index %s) (main=%s)", thisthr.name, idx, is_main_thread);
}
if (is_main_thread) {
shared(TaskPool) tpool;
synchronized (st_threadsMutex) swap(tpool, st_workerPool);
if (tpool) {
logDiagnostic("Main thread still waiting for worker threads.");
tpool.terminate();
}
logDiagnostic("Main thread exiting");
}
synchronized (st_threadsMutex) {
auto idx = st_threads.countUntil!(c => c.thread is thisthr);
assert(idx >= 0, "No more threads registered");
if (idx >= 0) {
st_threads[idx] = st_threads[$-1];
st_threads.length--;
}
}
// delay deletion of the main event driver to "~shared static this()"
if (!is_main_thread) shutdownDriver();
st_threadShutdownCondition.notifyAll();
}
private void shutdownDriver()
{
if (ManualEvent.ms_threadEvent != EventID.init) {
eventDriver.events.releaseRef(ManualEvent.ms_threadEvent);
ManualEvent.ms_threadEvent = EventID.init;
}
eventDriver.dispose();
}
private void watchExitFlag()
{
auto emit_count = st_threadsSignal.emitCount;
while (true) {
synchronized (st_threadsMutex) {
if (getExitFlag()) break;
}
try emit_count = st_threadsSignal.wait(emit_count);
catch (InterruptException e) return;
}
logDebug("main thread exit");
eventDriver.core.exit();
}
private extern(C) void extrap()
@safe nothrow {
logTrace("exception trap");
}
private extern(C) void onSignal(int signal)
nothrow {
atomicStore(st_term, true);
try st_threadsSignal.emit(); catch (Throwable) {}
logInfo("Received signal %d. Shutting down.", signal);
}
private extern(C) void onBrokenPipe(int signal)
nothrow {
logTrace("Broken pipe.");
}
version(Posix)
{
private bool isRoot() @trusted { return geteuid() == 0; }
private void setUID(int uid, int gid)
@trusted {
logInfo("Lowering privileges to uid=%d, gid=%d...", uid, gid);
if (gid >= 0) {
enforce(getgrgid(gid) !is null, "Invalid group id!");
enforce(setegid(gid) == 0, "Error setting group id!");
}
//if( initgroups(const char *user, gid_t group);
if (uid >= 0) {
enforce(getpwuid(uid) !is null, "Invalid user id!");
enforce(seteuid(uid) == 0, "Error setting user id!");
}
}
private int getUID(string name)
@trusted {
auto pw = getpwnam(name.toStringz());
enforce(pw !is null, "Unknown user name: "~name);
return pw.pw_uid;
}
private int getGID(string name)
@trusted {
auto gr = getgrnam(name.toStringz());
enforce(gr !is null, "Unknown group name: "~name);
return gr.gr_gid;
}
} else version(Windows){
private bool isRoot() @safe { return false; }
private void setUID(int uid, int gid)
@safe {
enforce(false, "UID/GID not supported on Windows.");
}
private int getUID(string name)
@safe {
enforce(false, "Privilege lowering not supported on Windows.");
assert(false);
}
private int getGID(string name)
@safe {
enforce(false, "Privilege lowering not supported on Windows.");
assert(false);
}
}
|
D
|
module android.java.android.renderscript.AllocationAdapter;
public import android.java.android.renderscript.AllocationAdapter_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!AllocationAdapter;
import import11 = android.java.android.view.Surface;
import import5 = android.java.android.renderscript.Element;
import import14 = android.java.java.lang.Class;
import import10 = android.java.java.nio.ByteBuffer;
import import1 = android.java.android.renderscript.AllocationAdapter;
|
D
|
/home/thinkpad/Dropbox/Tests/rust/pomodoro/target/debug/build/rand-969b32ce38387445/build_script_build-969b32ce38387445: /home/thinkpad/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/build.rs
/home/thinkpad/Dropbox/Tests/rust/pomodoro/target/debug/build/rand-969b32ce38387445/build_script_build-969b32ce38387445.d: /home/thinkpad/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/build.rs
/home/thinkpad/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/build.rs:
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/fail161.d(15): Error: template instance MetaString!"2 == 1" does not match template declaration MetaString(String)
---
*/
template MetaString(String)
{
alias String Value;
}
void main()
{
alias MetaString!("2 == 1") S;
assert(mixin(S.Value));
}
|
D
|
/Users/zhumatthew/Desktop/finalProject/Build/Intermediates/FinalProject.build/Debug-iphonesimulator/CoreDataService.build/Objects-normal/x86_64/NSEntityDescription_Service.o : /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Extension/NSEntityDescription_Service.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/CoreDataService.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Protocol/NamedEntity.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Extension/NSFetchRequest_Service.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/CoreDataService.h /Users/zhumatthew/Desktop/finalProject/Build/Intermediates/FinalProject.build/Debug-iphonesimulator/CoreDataService.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
/Users/zhumatthew/Desktop/finalProject/Build/Intermediates/FinalProject.build/Debug-iphonesimulator/CoreDataService.build/Objects-normal/x86_64/NSEntityDescription_Service~partial.swiftmodule : /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Extension/NSEntityDescription_Service.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/CoreDataService.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Protocol/NamedEntity.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Extension/NSFetchRequest_Service.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/CoreDataService.h /Users/zhumatthew/Desktop/finalProject/Build/Intermediates/FinalProject.build/Debug-iphonesimulator/CoreDataService.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
/Users/zhumatthew/Desktop/finalProject/Build/Intermediates/FinalProject.build/Debug-iphonesimulator/CoreDataService.build/Objects-normal/x86_64/NSEntityDescription_Service~partial.swiftdoc : /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Extension/NSEntityDescription_Service.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/CoreDataService.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Protocol/NamedEntity.swift /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/Extension/NSFetchRequest_Service.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zhumatthew/Desktop/finalProject/CoreDataService/Source/CoreDataService.h /Users/zhumatthew/Desktop/finalProject/Build/Intermediates/FinalProject.build/Debug-iphonesimulator/CoreDataService.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
|
D
|
a hard lump produced by the concretion of mineral salts
an incrustation that forms on the teeth and gums
the branch of mathematics that is concerned with limits and with the differentiation and integration of functions
|
D
|
/Users/sameersiddiqui/Projects/HafsaInspectorApp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Material.build/Objects-normal/x86_64/Material+UIImage+Blank.o : /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BarView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BottomNavigationController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BottomTabBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CapturePreview.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CaptureSession.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CaptureView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CardView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ControlView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ErrorTextField.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/FabButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/FlatButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Grid.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/IconButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ImageCardView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Layout.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+Obj-C.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+String.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Blank.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Color.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Crop.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+FilterBlur.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Network.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Resize.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Size.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+TintColor.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialBasicAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialBorder.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionReusableView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewCell.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewDataSource.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewDelegate.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewLayout.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialColor.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDataSourceItem.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDepth.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDevice.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialEdgeInset.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialGravity.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialIcon.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialKeyframeAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialLabel.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialLayer.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialPulseAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialPulseView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialRadius.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialShape.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialSpacing.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialSwitch.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTableViewCell.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTextLayer.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTransitionAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Menu.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MenuController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MenuView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationDrawerController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationItem.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RaisedButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RobotoFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RootController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/SearchBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/SearchBarController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/StatusBarController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TabBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Text.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextField.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextStorage.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Toolbar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ToolbarController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/sameersiddiqui/Projects/Test\ Code/SwiftTest/Pods/Google/Headers/module.modulemap /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Target\ Support\ Files/Material/Material-umbrella.h /Users/sameersiddiqui/Projects/HafsaInspectorApp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Material.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/sameersiddiqui/Projects/HafsaInspectorApp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Material.build/Objects-normal/x86_64/Material+UIImage+Blank~partial.swiftmodule : /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BarView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BottomNavigationController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BottomTabBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CapturePreview.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CaptureSession.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CaptureView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CardView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ControlView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ErrorTextField.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/FabButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/FlatButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Grid.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/IconButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ImageCardView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Layout.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+Obj-C.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+String.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Blank.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Color.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Crop.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+FilterBlur.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Network.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Resize.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Size.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+TintColor.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialBasicAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialBorder.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionReusableView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewCell.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewDataSource.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewDelegate.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewLayout.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialColor.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDataSourceItem.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDepth.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDevice.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialEdgeInset.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialGravity.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialIcon.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialKeyframeAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialLabel.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialLayer.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialPulseAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialPulseView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialRadius.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialShape.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialSpacing.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialSwitch.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTableViewCell.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTextLayer.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTransitionAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Menu.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MenuController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MenuView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationDrawerController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationItem.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RaisedButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RobotoFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RootController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/SearchBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/SearchBarController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/StatusBarController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TabBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Text.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextField.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextStorage.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Toolbar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ToolbarController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/sameersiddiqui/Projects/Test\ Code/SwiftTest/Pods/Google/Headers/module.modulemap /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Target\ Support\ Files/Material/Material-umbrella.h /Users/sameersiddiqui/Projects/HafsaInspectorApp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Material.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/sameersiddiqui/Projects/HafsaInspectorApp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Material.build/Objects-normal/x86_64/Material+UIImage+Blank~partial.swiftdoc : /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BarView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BottomNavigationController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/BottomTabBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CapturePreview.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CaptureSession.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CaptureView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/CardView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ControlView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ErrorTextField.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/FabButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/FlatButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Grid.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/IconButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ImageCardView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Layout.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+Obj-C.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+String.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Blank.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Color.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Crop.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+FilterBlur.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Network.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Resize.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+Size.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage+TintColor.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Material+UIImage.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialBasicAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialBorder.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionReusableView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewCell.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewDataSource.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewDelegate.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialCollectionViewLayout.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialColor.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDataSourceItem.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDepth.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialDevice.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialEdgeInset.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialGravity.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialIcon.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialKeyframeAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialLabel.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialLayer.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialPulseAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialPulseView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialRadius.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialShape.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialSpacing.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialSwitch.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTableViewCell.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTextLayer.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialTransitionAnimation.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MaterialView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Menu.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MenuController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/MenuView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationDrawerController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/NavigationItem.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RaisedButton.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RobotoFont.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/RootController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/SearchBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/SearchBarController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/StatusBarController.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TabBar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Text.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextField.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextStorage.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/TextView.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/Toolbar.swift /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Material/Sources/iOS/ToolbarController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/sameersiddiqui/Projects/Test\ Code/SwiftTest/Pods/Google/Headers/module.modulemap /Users/sameersiddiqui/Projects/HafsaInspectorApp/Pods/Target\ Support\ Files/Material/Material-umbrella.h /Users/sameersiddiqui/Projects/HafsaInspectorApp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Material.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/fail19744.d(8): Error: Top-level function `test` has no `this` to which `return` can apply
---
*/
int* test(return scope int* n) return
{
return n;
}
|
D
|
/home/jinx/src/rustPrograms/closurePractice/target/debug/deps/closurePractice-7c5b1717fc2999bf: src/main.rs
/home/jinx/src/rustPrograms/closurePractice/target/debug/deps/closurePractice-7c5b1717fc2999bf.d: src/main.rs
src/main.rs:
|
D
|
/***********************************************************************\
* objidl.d *
* *
* Windows API header module *
* *
* Translated from MinGW Windows headers *
* *
* Placed into public domain *
\***********************************************************************/
// TODO (Don):
// # why is "alias IPSFactoryBuffer* LPPSFACTORYBUFFER;" in this file,
// rather than in objfwd ?
// # do we need the proxies that are defined in this file?
module win32.objidl;
import win32.unknwn;
import win32.objfwd;
private import win32.windef;
private import win32.basetyps;
private import win32.oleidl;
private import win32.wtypes;
private import win32.winbase; // for FILETIME
private import win32.rpcdce;
struct STATSTG {
LPOLESTR pwcsName;
DWORD type;
ULARGE_INTEGER cbSize;
FILETIME mtime;
FILETIME ctime;
FILETIME atime;
DWORD grfMode;
DWORD grfLocksSupported;
CLSID clsid;
DWORD grfStateBits;
DWORD reserved;
}
enum STGTY {
STGTY_STORAGE = 1,
STGTY_STREAM,
STGTY_LOCKBYTES,
STGTY_PROPERTY
}
enum STREAM_SEEK {
STREAM_SEEK_SET,
STREAM_SEEK_CUR,
STREAM_SEEK_END
}
struct INTERFACEINFO {
LPUNKNOWN pUnk;
IID iid;
WORD wMethod;
}
alias INTERFACEINFO* LPINTERFACEINFO;
enum CALLTYPE {
CALLTYPE_TOPLEVEL = 1,
CALLTYPE_NESTED,
CALLTYPE_ASYNC,
CALLTYPE_TOPLEVEL_CALLPENDING,
CALLTYPE_ASYNC_CALLPENDING
}
enum PENDINGTYPE {
PENDINGTYPE_TOPLEVEL = 1,
PENDINGTYPE_NESTED
}
enum PENDINGMSG {
PENDINGMSG_CANCELCALL = 0,
PENDINGMSG_WAITNOPROCESS,
PENDINGMSG_WAITDEFPROCESS
}
alias OLECHAR** SNB;
enum DATADIR {
DATADIR_GET = 1,
DATADIR_SET
}
alias WORD CLIPFORMAT;
alias CLIPFORMAT* LPCLIPFORMAT;
struct DVTARGETDEVICE {
DWORD tdSize;
WORD tdDriverNameOffset;
WORD tdDeviceNameOffset;
WORD tdPortNameOffset;
WORD tdExtDevmodeOffset;
BYTE tdData[1];
}
struct FORMATETC {
CLIPFORMAT cfFormat;
DVTARGETDEVICE* ptd;
DWORD dwAspect;
LONG lindex;
DWORD tymed;
}
alias FORMATETC* LPFORMATETC;
struct RemSTGMEDIUM {
DWORD tymed;
DWORD dwHandleType;
ULONG pData;
uint pUnkForRelease;
uint cbData;
BYTE data[1];
}
struct HLITEM {
ULONG uHLID;
LPWSTR pwzFriendlyName;
}
struct STATDATA {
FORMATETC formatetc;
DWORD grfAdvf;
IAdviseSink* pAdvSink;
DWORD dwConnection;
}
struct STATPROPSETSTG {
FMTID fmtid;
CLSID clsid;
DWORD grfFlags;
FILETIME mtime;
FILETIME ctime;
FILETIME atime;
}
enum EXTCONN {
EXTCONN_STRONG = 1,
EXTCONN_WEAK = 2,
EXTCONN_CALLABLE = 4
}
struct MULTI_QI {
CPtr!(IID) pIID;
IUnknown pItf;
HRESULT hr;
}
struct AUTH_IDENTITY {
USHORT* User;
ULONG UserLength;
USHORT* Domain;
ULONG DomainLength;
USHORT* Password;
ULONG PasswordLength;
ULONG Flags;
}
struct COAUTHINFO {
DWORD dwAuthnSvc;
DWORD dwAuthzSvc;
LPWSTR pwszServerPrincName;
DWORD dwAuthnLevel;
DWORD dwImpersonationLevel;
AUTH_IDENTITY* pAuthIdentityData;
DWORD dwCapabilities;
}
struct COSERVERINFO {
DWORD dwReserved1;
LPWSTR pwszName;
COAUTHINFO* pAuthInfo;
DWORD dwReserved2;
}
struct BIND_OPTS {
DWORD cbStruct;
DWORD grfFlags;
DWORD grfMode;
DWORD dwTickCountDeadline;
}
alias BIND_OPTS* LPBIND_OPTS;
struct BIND_OPTS2 {
DWORD cbStruct;
DWORD grfFlags;
DWORD grfMode;
DWORD dwTickCountDeadline;
DWORD dwTrackFlags;
DWORD dwClassContext;
LCID locale;
COSERVERINFO* pServerInfo;
}
alias BIND_OPTS2* LPBIND_OPTS2;
enum BIND_FLAGS {
BIND_MAYBOTHERUSER = 1,
BIND_JUSTTESTEXISTENCE
}
struct STGMEDIUM {
DWORD tymed;
union {
HBITMAP hBitmap;
PVOID hMetaFilePict;
HENHMETAFILE hEnhMetaFile;
HGLOBAL hGlobal;
LPWSTR lpszFileName;
LPSTREAM pstm;
LPSTORAGE pstg;
}
LPUNKNOWN pUnkForRelease;
}
alias STGMEDIUM* LPSTGMEDIUM;
enum LOCKTYPE {
LOCK_WRITE = 1,
LOCK_EXCLUSIVE = 2,
LOCK_ONLYONCE = 4
}
alias uint RPCOLEDATAREP;
struct RPCOLEMESSAGE {
PVOID reserved1;
RPCOLEDATAREP dataRepresentation;
PVOID Buffer;
ULONG cbBuffer;
ULONG iMethod;
PVOID reserved2[5];
ULONG rpcFlags;
}
alias RPCOLEMESSAGE* PRPCOLEMESSAGE;
enum MKSYS {
MKSYS_NONE,
MKSYS_GENERICCOMPOSITE,
MKSYS_FILEMONIKER,
MKSYS_ANTIMONIKER,
MKSYS_ITEMMONIKER,
MKSYS_POINTERMONIKER
}
enum MKREDUCE {
MKRREDUCE_ALL,
MKRREDUCE_ONE = 196608,
MKRREDUCE_TOUSER = 131072,
MKRREDUCE_THROUGHUSER = 65536
}
struct RemSNB {
uint ulCntStr;
uint ulCntChar;
OLECHAR rgString[1];
}
enum ADVF {
ADVF_NODATA = 1,
ADVF_PRIMEFIRST = 2,
ADVF_ONLYONCE = 4,
ADVFCACHE_NOHANDLER = 8,
ADVFCACHE_FORCEBUILTIN = 16,
ADVFCACHE_ONSAVE = 32,
ADVF_DATAONSTOP = 64
}
enum TYMED {
TYMED_HGLOBAL = 1,
TYMED_FILE = 2,
TYMED_ISTREAM = 4,
TYMED_ISTORAGE = 8,
TYMED_GDI = 16,
TYMED_MFPICT = 32,
TYMED_ENHMF = 64,
TYMED_NULL = 0
}
enum SERVERCALL {
SERVERCALL_ISHANDLED,
SERVERCALL_REJECTED,
SERVERCALL_RETRYLATER
}
struct CAUB {
ULONG cElems;
ubyte* pElems;
}
struct CAI {
ULONG cElems;
short* pElems;
}
struct CAUI {
ULONG cElems;
USHORT* pElems;
}
struct CAL {
ULONG cElems;
int* pElems;
}
struct CAUL {
ULONG cElems;
ULONG* pElems;
}
struct CAFLT {
ULONG cElems;
float* pElems;
}
struct CADBL {
ULONG cElems;
double* pElems;
}
struct CACY {
ULONG cElems;
CY* pElems;
}
struct CADATE {
ULONG cElems;
DATE* pElems;
}
struct CABSTR {
ULONG cElems;
BSTR* pElems;
}
struct CABSTRBLOB {
ULONG cElems;
BSTRBLOB* pElems;
}
struct CABOOL {
ULONG cElems;
VARIANT_BOOL* pElems;
}
struct CASCODE {
ULONG cElems;
SCODE* pElems;
}
struct CAH {
ULONG cElems;
LARGE_INTEGER* pElems;
}
struct CAUH {
ULONG cElems;
ULARGE_INTEGER* pElems;
}
struct CALPSTR {
ULONG cElems;
LPSTR* pElems;
}
struct CALPWSTR {
ULONG cElems;
LPWSTR* pElems;
}
struct CAFILETIME {
ULONG cElems;
FILETIME* pElems;
}
struct CACLIPDATA {
ULONG cElems;
CLIPDATA* pElems;
}
struct CACLSID {
ULONG cElems;
CLSID* pElems;
}
alias PROPVARIANT* LPPROPVARIANT;
struct CAPROPVARIANT {
ULONG cElems;
LPPROPVARIANT pElems;
}
struct PROPVARIANT {
VARTYPE vt;
WORD wReserved1;
WORD wReserved2;
WORD wReserved3;
union {
CHAR cVal;
UCHAR bVal;
short iVal;
USHORT uiVal;
VARIANT_BOOL boolVal;
int lVal;
ULONG ulVal;
float fltVal;
SCODE scode;
LARGE_INTEGER hVal;
ULARGE_INTEGER uhVal;
double dblVal;
CY cyVal;
DATE date;
FILETIME filetime;
CLSID* puuid;
BLOB blob;
CLIPDATA* pclipdata;
LPSTREAM pStream;
LPSTORAGE pStorage;
BSTR bstrVal;
BSTRBLOB bstrblobVal;
LPSTR pszVal;
LPWSTR pwszVal;
CAUB caub;
CAI cai;
CAUI caui;
CABOOL cabool;
CAL cal;
CAUL caul;
CAFLT caflt;
CASCODE cascode;
CAH cah;
CAUH cauh;
CADBL cadbl;
CACY cacy;
CADATE cadate;
CAFILETIME cafiletime;
CACLSID cauuid;
CACLIPDATA caclipdata;
CABSTR cabstr;
CABSTRBLOB cabstrblob;
CALPSTR calpstr;
CALPWSTR calpwstr;
CAPROPVARIANT capropvar;
}
}
struct PROPSPEC {
ULONG ulKind;
union {
PROPID propid;
LPOLESTR lpwstr;
}
}
struct STATPROPSTG {
LPOLESTR lpwstrName;
PROPID propid;
VARTYPE vt;
}
enum PROPSETFLAG {
PROPSETFLAG_DEFAULT,
PROPSETFLAG_NONSIMPLE,
PROPSETFLAG_ANSI,
PROPSETFLAG_UNBUFFERED = 4
}
struct STORAGELAYOUT {
DWORD LayoutType;
OLECHAR* pwcsElementName;
LARGE_INTEGER cOffset;
LARGE_INTEGER cBytes;
}
struct SOLE_AUTHENTICATION_SERVICE {
DWORD dwAuthnSvc;
DWORD dwAuthzSvc;
OLECHAR* pPrincipalName;
HRESULT hr;
}
const OLECHAR* COLE_DEFAULT_PRINCIPAL = cast ( OLECHAR* )(-1);
enum EOLE_AUTHENTICATION_CAPABILITIES {
EOAC_NONE = 0,
EOAC_MUTUAL_AUTH = 0x1,
EOAC_SECURE_REFS = 0x2,
EOAC_ACCESS_CONTROL = 0x4,
EOAC_APPID = 0x8,
EOAC_DYNAMIC = 0x10,
EOAC_STATIC_CLOAKING = 0x20,
EOAC_DYNAMIC_CLOAKING = 0x40,
EOAC_ANY_AUTHORITY = 0x80,
EOAC_MAKE_FULLSIC = 0x100,
EOAC_REQUIRE_FULLSIC = 0x200,
EOAC_AUTO_IMPERSONATE = 0x400,
EOAC_DEFAULT = 0x800,
EOAC_DISABLE_AAA = 0x1000,
EOAC_NO_CUSTOM_MARSHAL = 0x2000
}
struct SOLE_AUTHENTICATION_INFO {
DWORD dwAuthnSvc;
DWORD dwAuthzSvc;
void* pAuthInfo;
}
const void* COLE_DEFAULT_AUTHINFO = cast( void* )(-1 );
struct SOLE_AUTHENTICATION_LIST {
DWORD cAuthInfo;
SOLE_AUTHENTICATION_INFO* aAuthInfo;
}
/++
Original
interface IEnumFORMATETC : IUnknown {
HRESULT Next(ULONG, FORMATETC*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
@ HRESULT Clone(IEnumFORMATETC**);
}
++/
interface IEnumFORMATETC: IUnknown {
HRESULT Next(ULONG celt, FORMATETC* rgelt, ULONG* pceltFetched);
HRESULT Skip(ULONG celt);
HRESULT Reset();
HRESULT Clone(IEnumFORMATETC* ppenum);
}
interface IEnumHLITEM : IUnknown {
HRESULT Next(ULONG, HLITEM*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumHLITEM**);
}
interface IEnumSTATDATA : IUnknown {
HRESULT Next(ULONG, STATDATA*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumSTATDATA**);
}
interface IEnumSTATPROPSETSTG : IUnknown {
HRESULT Next(ULONG, STATPROPSETSTG*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumSTATPROPSETSTG**);
}
interface IEnumSTATPROPSTG : IUnknown {
HRESULT Next(ULONG, STATPROPSTG*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumSTATPROPSTG**);
}
interface IEnumSTATSTG : IUnknown {
HRESULT Next(ULONG, STATSTG*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumSTATSTG**);
}
interface IEnumString : IUnknown {
HRESULT Next(ULONG, LPOLESTR*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumString**);
}
interface IEnumMoniker : IUnknown {
HRESULT Next(ULONG, IMoniker*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumMoniker**);
}
interface IEnumUnknown : IUnknown {
HRESULT Next(ULONG, IUnknown*, ULONG*);
HRESULT Skip(ULONG);
HRESULT Reset();
HRESULT Clone(IEnumUnknown**);
}
interface ISequentialStream : IUnknown {
HRESULT Read(void*, ULONG, ULONG*);
HRESULT Write(void* , ULONG, ULONG*);
}
interface IStream : ISequentialStream {
HRESULT Seek(LARGE_INTEGER, DWORD, ULARGE_INTEGER*);
HRESULT SetSize(ULARGE_INTEGER);
HRESULT CopyTo(IStream, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*);
HRESULT Commit(DWORD);
HRESULT Revert();
HRESULT LockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
HRESULT UnlockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
HRESULT Stat(STATSTG*, DWORD);
HRESULT Clone(LPSTREAM*);
}
interface IMarshal : IUnknown {
HRESULT GetUnmarshalClass(REFIID, PVOID, DWORD, PVOID, DWORD, CLSID*);
HRESULT GetMarshalSizeMax(REFIID, PVOID, DWORD, PVOID, PDWORD, ULONG*);
HRESULT MarshalInterface(IStream, REFIID, PVOID, DWORD, PVOID, DWORD);
HRESULT UnmarshalInterface(IStream, REFIID, void**);
HRESULT ReleaseMarshalData(IStream);
HRESULT DisconnectObject(DWORD);
}
interface IStdMarshalInfo : IUnknown {
HRESULT GetClassForHandler(DWORD, PVOID, CLSID*);
}
interface IMalloc : IUnknown {
void* Alloc(ULONG);
void* Realloc(void*, ULONG);
void Free(void*);
ULONG GetSize(void*);
int DidAlloc(void*);
void HeapMinimize();
}
interface IMallocSpy : IUnknown {
ULONG PreAlloc(ULONG);
void* PostAlloc(void*);
void* PreFree(void*, BOOL);
void PostFree(BOOL);
ULONG PreRealloc(void*, ULONG, void**, BOOL);
void* PostRealloc(void*, BOOL);
void* PreGetSize(void*, BOOL);
ULONG PostGetSize(ULONG, BOOL);
void* PreDidAlloc(void*, BOOL);
int PostDidAlloc(void*, BOOL, int);
void PreHeapMinimize();
void PostHeapMinimize();
}
interface IMessageFilter : IUnknown {
DWORD HandleInComingCall(DWORD, HTASK, DWORD, LPINTERFACEINFO);
DWORD RetryRejectedCall(HTASK, DWORD, DWORD);
DWORD MessagePending(HTASK, DWORD, DWORD);
}
interface IPersist : IUnknown {
HRESULT GetClassID(CLSID*);
}
interface IPersistStream : IPersist {
HRESULT IsDirty();
HRESULT Load(IStream*);
HRESULT Save(IStream*, BOOL);
HRESULT GetSizeMax(PULARGE_INTEGER);
}
interface IRunningObjectTable : IUnknown {
HRESULT Register(DWORD, LPUNKNOWN, LPMONIKER, PDWORD);
HRESULT Revoke(DWORD);
HRESULT IsRunning(LPMONIKER);
HRESULT GetObject(LPMONIKER, LPUNKNOWN*);
HRESULT NoteChangeTime(DWORD, LPFILETIME);
HRESULT GetTimeOfLastChange(LPMONIKER, LPFILETIME);
HRESULT EnumRunning(IEnumMoniker**);
}
interface IBindCtx : IUnknown {
HRESULT RegisterObjectBound(LPUNKNOWN);
HRESULT RevokeObjectBound(LPUNKNOWN);
HRESULT ReleaseBoundObjects();
HRESULT SetBindOptions(LPBIND_OPTS);
HRESULT GetBindOptions(LPBIND_OPTS);
HRESULT GetRunningObjectTable(IRunningObjectTable**);
HRESULT RegisterObjectParam(LPOLESTR, IUnknown*);
HRESULT GetObjectParam(LPOLESTR, IUnknown**);
HRESULT EnumObjectParam(IEnumString**);
HRESULT RevokeObjectParam(LPOLESTR);
}
interface IMoniker: IPersistStream {
HRESULT BindToObject(IBindCtx*, IMoniker*, REFIID, PVOID*);
HRESULT BindToStorage(IBindCtx*, IMoniker*, REFIID, PVOID*);
HRESULT Reduce(IBindCtx*, DWORD, IMoniker**, IMoniker**);
HRESULT ComposeWith(IMoniker*, BOOL, IMoniker**);
HRESULT Enum(BOOL, IEnumMoniker**);
HRESULT IsEqual(IMoniker*);
HRESULT Hash(PDWORD);
HRESULT IsRunning(IBindCtx*, IMoniker*, IMoniker*);
HRESULT GetTimeOfLastChange(IBindCtx*, IMoniker*, LPFILETIME);
HRESULT Inverse(IMoniker**);
HRESULT CommonPrefixWith(IMoniker*, IMoniker**);
HRESULT RelativePathTo(IMoniker*, IMoniker**);
HRESULT GetDisplayName(IBindCtx*, IMoniker*, LPOLESTR*);
HRESULT ParseDisplayName(IBindCtx*, IMoniker*, LPOLESTR, ULONG*, IMoniker**);
HRESULT IsSystemMoniker(PDWORD);
}
interface IPersistStorage : IPersist
{
HRESULT IsDirty();
HRESULT InitNew(LPSTORAGE);
HRESULT Load(LPSTORAGE);
HRESULT Save(LPSTORAGE, BOOL);
HRESULT SaveCompleted(LPSTORAGE);
HRESULT HandsOffStorage();
}
interface IPersistFile : IPersist
{
HRESULT IsDirty();
HRESULT Load(LPCOLESTR, DWORD);
HRESULT Save(LPCOLESTR, BOOL);
HRESULT SaveCompleted(LPCOLESTR);
HRESULT GetCurFile(LPOLESTR*);
}
interface IAdviseSink : IUnknown {
HRESULT QueryInterface(REFIID, PVOID*);
ULONG AddRef();
ULONG Release();
void OnDataChange(FORMATETC*, STGMEDIUM*);
void OnViewChange(DWORD, LONG);
void OnRename(IMoniker*);
void OnSave();
void OnClose();
}
interface IAdviseSink2 : IAdviseSink
{
void OnLinkSrcChange(IMoniker*);
}
/++
Original
interface IDataObject : IUnknown {
HRESULT GetData(FORMATETC*, STGMEDIUM*);
HRESULT GetDataHere(FORMATETC*, STGMEDIUM*);
HRESULT QueryGetData(FORMATETC*);
HRESULT GetCanonicalFormatEtc(FORMATETC*, FORMATETC*);
HRESULT SetData(FORMATETC*, STGMEDIUM*, BOOL);
@ HRESULT EnumFormatEtc(DWORD, IEnumFORMATETC**);
HRESULT DAdvise(FORMATETC*, DWORD, IAdviseSink*, PDWORD);
HRESULT DUnadvise(DWORD);
@ HRESULT EnumDAdvise(IEnumSTATDATA**);
}
++/
interface IDataObject : IUnknown {
HRESULT GetData(FORMATETC*, STGMEDIUM*);
HRESULT GetDataHere(FORMATETC*, STGMEDIUM*);
HRESULT QueryGetData(FORMATETC*);
HRESULT GetCanonicalFormatEtc(FORMATETC*, FORMATETC*);
HRESULT SetData(FORMATETC*, STGMEDIUM*, BOOL);
HRESULT EnumFormatEtc(DWORD, IEnumFORMATETC*);
HRESULT DAdvise(FORMATETC*, DWORD, IAdviseSink*, PDWORD);
HRESULT DUnadvise(DWORD);
HRESULT EnumDAdvise(IEnumSTATDATA*);
}
interface IDataAdviseHolder : IUnknown {
HRESULT Advise(IDataObject*, FORMATETC*, DWORD, IAdviseSink*, PDWORD);
HRESULT Unadvise(DWORD);
HRESULT EnumAdvise(IEnumSTATDATA**);
HRESULT SendOnDataChange(IDataObject*, DWORD, DWORD);
}
interface IStorage : IUnknown {
HRESULT CreateStream(LPCWSTR, DWORD, DWORD, DWORD, IStream*);
HRESULT OpenStream(LPCWSTR, PVOID, DWORD, DWORD, IStream*);
HRESULT CreateStorage(LPCWSTR, DWORD, DWORD, DWORD, IStorage*);
HRESULT OpenStorage(LPCWSTR, IStorage, DWORD, SNB, DWORD, IStorage*);
HRESULT CopyTo(DWORD, IID* , SNB, IStorage);
HRESULT MoveElementTo(LPCWSTR, IStorage, LPCWSTR, DWORD);
HRESULT Commit(DWORD);
HRESULT Revert();
HRESULT EnumElements(DWORD, PVOID, DWORD, IEnumSTATSTG*);
HRESULT DestroyElement(LPCWSTR);
HRESULT RenameElement(LPCWSTR, LPCWSTR);
HRESULT SetElementTimes(LPCWSTR, FILETIME* , FILETIME* , FILETIME* );
HRESULT SetClass(REFCLSID);
HRESULT SetStateBits(DWORD, DWORD);
HRESULT Stat(STATSTG*, DWORD);
}
// FIXME: GetClassID from IPersist not there - what to do about it?
interface IRootStorage : IPersist {
HRESULT QueryInterface(REFIID, PVOID*);
ULONG AddRef();
ULONG Release();
HRESULT SwitchToFile(LPOLESTR);
}
interface IRpcChannelBuffer : IUnknown {
HRESULT GetBuffer(RPCOLEMESSAGE*, REFIID);
HRESULT SendReceive(RPCOLEMESSAGE*, PULONG);
HRESULT FreeBuffer(RPCOLEMESSAGE*);
HRESULT GetDestCtx(PDWORD, PVOID*);
HRESULT IsConnected();
}
interface IRpcProxyBuffer : IUnknown {
HRESULT Connect(IRpcChannelBuffer*);
void Disconnect();
}
interface IRpcStubBuffer : IUnknown {
HRESULT Connect(LPUNKNOWN);
void Disconnect();
HRESULT Invoke(RPCOLEMESSAGE*, LPRPCSTUBBUFFER);
LPRPCSTUBBUFFER IsIIDSupported(REFIID);
ULONG CountRefs();
HRESULT DebugServerQueryInterface(PVOID*);
HRESULT DebugServerRelease(PVOID);
}
interface IPSFactoryBuffer : IUnknown {
HRESULT CreateProxy(LPUNKNOWN, REFIID, LPRPCPROXYBUFFER*, PVOID*);
HRESULT CreateStub(REFIID, LPUNKNOWN, LPRPCSTUBBUFFER*);
}
alias IPSFactoryBuffer* LPPSFACTORYBUFFER;
interface ILockBytes : IUnknown {
HRESULT ReadAt(ULARGE_INTEGER, PVOID, ULONG, ULONG*);
HRESULT WriteAt(ULARGE_INTEGER, PCVOID, ULONG, ULONG*);
HRESULT Flush();
HRESULT SetSize(ULARGE_INTEGER);
HRESULT LockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
HRESULT UnlockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
HRESULT Stat(STATSTG*, DWORD);
}
interface IExternalConnection : IUnknown {
HRESULT AddConnection(DWORD, DWORD);
HRESULT ReleaseConnection(DWORD, DWORD, BOOL);
}
interface IRunnableObject : IUnknown {
HRESULT GetRunningClass(LPCLSID);
HRESULT Run(LPBC);
BOOL IsRunning();
HRESULT LockRunning(BOOL, BOOL);
HRESULT SetContainedObject(BOOL);
}
interface IROTData : IUnknown {
HRESULT GetComparisonData(PVOID, ULONG, PULONG);
}
interface IChannelHook : IUnknown {
void ClientGetSize(REFGUID, REFIID, PULONG);
void ClientFillBuffer(REFGUID, REFIID, PULONG, PVOID);
void ClientNotify(REFGUID, REFIID, ULONG, PVOID, DWORD, HRESULT);
void ServerNotify(REFGUID, REFIID, ULONG, PVOID, DWORD);
void ServerGetSize(REFGUID, REFIID, HRESULT, PULONG);
void ServerFillBuffer(REFGUID, REFIID, PULONG, PVOID, HRESULT);
}
interface IPropertyStorage : IUnknown {
HRESULT ReadMultiple(ULONG, PROPSPEC* , PROPVARIANT*);
HRESULT WriteMultiple(ULONG, PROPSPEC* , PROPVARIANT*, PROPID);
HRESULT DeleteMultiple(ULONG, PROPSPEC* );
HRESULT ReadPropertyNames(ULONG, PROPID* , LPWSTR*);
HRESULT WritePropertyNames(ULONG, PROPID* , LPWSTR* );
HRESULT DeletePropertyNames(ULONG, PROPID* );
HRESULT SetClass(REFCLSID);
HRESULT Commit(DWORD);
HRESULT Revert();
HRESULT Enum(IEnumSTATPROPSTG**);
HRESULT Stat(STATPROPSTG*);
HRESULT SetTimes(FILETIME* , FILETIME* , FILETIME* );
}
interface IPropertySetStorage : IUnknown {
HRESULT Create(REFFMTID, CLSID*, DWORD, DWORD, LPPROPERTYSTORAGE*);
HRESULT Open(REFFMTID, DWORD, LPPROPERTYSTORAGE*);
HRESULT Delete(REFFMTID);
HRESULT Enum(IEnumSTATPROPSETSTG**);
}
interface IClientSecurity : IUnknown {
HRESULT QueryBlanket(PVOID, PDWORD, PDWORD, OLECHAR**, PDWORD, PDWORD, RPC_AUTH_IDENTITY_HANDLE**, PDWORD*);
HRESULT SetBlanket(PVOID, DWORD, DWORD, LPWSTR, DWORD, DWORD, RPC_AUTH_IDENTITY_HANDLE*, DWORD);
HRESULT CopyProxy(LPUNKNOWN, LPUNKNOWN*);
}
interface IServerSecurity : IUnknown {
HRESULT QueryBlanket(PDWORD, PDWORD, OLECHAR**, PDWORD, PDWORD, RPC_AUTHZ_HANDLE*, PDWORD*);
HRESULT ImpersonateClient();
HRESULT RevertToSelf();
HRESULT IsImpersonating();
}
interface IClassActivator : IUnknown {
HRESULT GetClassObject(REFCLSID, DWORD, LCID, REFIID, PVOID*);
}
interface IFillLockBytes : IUnknown {
HRESULT FillAppend(void* , ULONG, PULONG);
HRESULT FillAt(ULARGE_INTEGER, void* , ULONG, PULONG);
HRESULT SetFillSize(ULARGE_INTEGER);
HRESULT Terminate(BOOL);
}
interface IProgressNotify : IUnknown {
HRESULT OnProgress(DWORD, DWORD, BOOL, BOOL);
}
interface ILayoutStorage : IUnknown {
HRESULT LayoutScript(STORAGELAYOUT*, DWORD, DWORD);
HRESULT BeginMonitor();
HRESULT EndMonitor();
HRESULT ReLayoutDocfile(OLECHAR*);
}
interface IGlobalInterfaceTable : IUnknown {
HRESULT RegisterInterfaceInGlobal(IUnknown*, REFIID, DWORD*);
HRESULT RevokeInterfaceFromGlobal(DWORD);
HRESULT GetInterfaceFromGlobal(DWORD, REFIID, void**);
}
/+
// These are probably unnecessary for D.
extern (Windows) {
HRESULT IMarshal_GetUnmarshalClass_Proxy(IMarshal*, REFIID, void*, DWORD, void*, DWORD, CLSID*);
void IMarshal_GetUnmarshalClass_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMarshal_GetMarshalSizeMax_Proxy(IMarshal*, REFIID, void*, DWORD, void*, DWORD, DWORD*);
void IMarshal_GetMarshalSizeMax_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMarshal_MarshalInterface_Proxy(IMarshal*, IStream*, REFIID, void*, DWORD, void*, DWORD);
void IMarshal_MarshalInterface_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMarshal_UnmarshalInterface_Proxy(IMarshal*, IStream*, REFIID, void**);
void IMarshal_UnmarshalInterface_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMarshal_ReleaseMarshalData_Proxy(IMarshal*, IStream*);
void IMarshal_ReleaseMarshalData_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMarshal_DisconnectObject_Proxy(IMarshal*, DWORD);
void IMarshal_DisconnectObject_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void* IMalloc_Alloc_Proxy(IMalloc*, ULONG);
void IMalloc_Alloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void* IMalloc_Realloc_Proxy(IMalloc*, void*, ULONG);
void IMalloc_Realloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IMalloc_Free_Proxy(IMalloc*, void*);
void IMalloc_Free_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
ULONG IMalloc_GetSize_Proxy(IMalloc*, void*);
void IMalloc_GetSize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
int IMalloc_DidAlloc_Proxy(IMalloc*, void*);
void IMalloc_DidAlloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IMalloc_HeapMinimize_Proxy(IMalloc*);
void IMalloc_HeapMinimize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
ULONG IMallocSpy_PreAlloc_Proxy(IMallocSpy*, ULONG cbRequest);
void IMallocSpy_PreAlloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void* IMallocSpy_PostAlloc_Proxy(IMallocSpy*, void*);
void IMallocSpy_PostAlloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void* IMallocSpy_PreFree_Proxy(IMallocSpy*, void*, BOOL);
void IMallocSpy_PreFree_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IMallocSpy_PostFree_Proxy(IMallocSpy*, BOOL);
void IMallocSpy_PostFree_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
ULONG IMallocSpy_PreRealloc_Proxy(IMallocSpy*, void*, ULONG, void**, BOOL);
void IMallocSpy_PreRealloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void* IMallocSpy_PostRealloc_Proxy(IMallocSpy*, void*, BOOL);
void IMallocSpy_PostRealloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void* IMallocSpy_PreGetSize_Proxy(IMallocSpy*, void*, BOOL);
void IMallocSpy_PreGetSize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
ULONG IMallocSpy_PostGetSize_Proxy(IMallocSpy*, ULONG, BOOL);
void IMallocSpy_PostGetSize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void* IMallocSpy_PreDidAlloc_Proxy(IMallocSpy*, void*, BOOL);
void IMallocSpy_PreDidAlloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
int IMallocSpy_PostDidAlloc_Proxy(IMallocSpy*, void*, BOOL, int);
void IMallocSpy_PostDidAlloc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IMallocSpy_PreHeapMinimize_Proxy(IMallocSpy* );
void IMallocSpy_PreHeapMinimize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IMallocSpy_PostHeapMinimize_Proxy(IMallocSpy*);
void IMallocSpy_PostHeapMinimize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStdMarshalInfo_GetClassForHandler_Proxy(IStdMarshalInfo*, DWORD, void*, CLSID*);
void IStdMarshalInfo_GetClassForHandler_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
DWORD IExternalConnection_AddConnection_Proxy(IExternalConnection*, DWORD, DWORD);
void IExternalConnection_AddConnection_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
DWORD IExternalConnection_ReleaseConnection_Proxy(IExternalConnection*, DWORD, DWORD, BOOL);
void IExternalConnection_ReleaseConnection_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumUnknown_RemoteNext_Proxy(IEnumUnknown*, ULONG, IUnknown**, ULONG*);
void IEnumUnknown_RemoteNext_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumUnknown_Skip_Proxy(IEnumUnknown*, ULONG);
void IEnumUnknown_Skip_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumUnknown_Reset_Proxy(IEnumUnknown* );
void IEnumUnknown_Reset_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumUnknown_Clone_Proxy(IEnumUnknown*, IEnumUnknown**);
void IEnumUnknown_Clone_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_RegisterObjectBound_Proxy(IBindCtx*, IUnknown*punk);
void IBindCtx_RegisterObjectBound_Stub(IRpcStubBuffer*, IRpcChannelBuffer*_pRpcChannelBuffer, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_RevokeObjectBound_Proxy(IBindCtx*, IUnknown*punk);
void IBindCtx_RevokeObjectBound_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_ReleaseBoundObjects_Proxy(IBindCtx*);
void IBindCtx_ReleaseBoundObjects_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_SetBindOptions_Proxy(IBindCtx*, BIND_OPTS*);
void IBindCtx_SetBindOptions_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_GetBindOptions_Proxy(IBindCtx*, BIND_OPTS*pbindopts);
void IBindCtx_GetBindOptions_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_GetRunningObjectTable_Proxy(IBindCtx*, IRunningObjectTable**);
void IBindCtx_GetRunningObjectTable_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_RegisterObjectParam_Proxy(IBindCtx*, LPCSTR, IUnknown*);
void IBindCtx_RegisterObjectParam_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_GetObjectParam_Proxy(IBindCtx*, LPCSTR, IUnknown**);
void IBindCtx_GetObjectParam_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_EnumObjectParam_Proxy(IBindCtx*, IEnumString**);
void IBindCtx_EnumObjectParam_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IBindCtx_RevokeObjectParam_Proxy(IBindCtx*, LPCSTR);
void IBindCtx_RevokeObjectParam_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumMoniker_RemoteNext_Proxy(IEnumMoniker*, ULONG, IMoniker**, ULONG*);
void IEnumMoniker_RemoteNext_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumMoniker_Skip_Proxy(IEnumMoniker*, ULONG);
void IEnumMoniker_Skip_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumMoniker_Reset_Proxy(IEnumMoniker*);
void IEnumMoniker_Reset_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumMoniker_Clone_Proxy(IEnumMoniker*, IEnumMoniker**);
void IEnumMoniker_Clone_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunnableObject_GetRunningClass_Proxy(IRunnableObject*, LPCLSID);
void IRunnableObject_GetRunningClass_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunnableObject_Run_Proxy(IRunnableObject*, LPBINDCTX);
void IRunnableObject_Run_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
BOOL IRunnableObject_IsRunning_Proxy(IRunnableObject*);
void IRunnableObject_IsRunning_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunnableObject_LockRunning_Proxy(IRunnableObject*, BOOL, BOOL);
void IRunnableObject_LockRunning_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunnableObject_SetContainedObject_Proxy(IRunnableObject*, BOOL);
void IRunnableObject_SetContainedObject_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunningObjectTable_Register_Proxy(IRunningObjectTable*, DWORD, IUnknown*, IMoniker*, DWORD*);
void IRunningObjectTable_Register_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunningObjectTable_Revoke_Proxy(IRunningObjectTable*, DWORD);
void IRunningObjectTable_Revoke_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunningObjectTable_IsRunning_Proxy(IRunningObjectTable*, IMoniker*);
void IRunningObjectTable_IsRunning_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunningObjectTable_GetObject_Proxy(IRunningObjectTable*, IMoniker*, IUnknown**);
void IRunningObjectTable_GetObject_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunningObjectTable_NoteChangeTime_Proxy(IRunningObjectTable*, DWORD, FILETIME*);
void IRunningObjectTable_NoteChangeTime_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunningObjectTable_GetTimeOfLastChange_Proxy(IRunningObjectTable*, IMoniker*, FILETIME*);
void IRunningObjectTable_GetTimeOfLastChange_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRunningObjectTable_EnumRunning_Proxy(IRunningObjectTable*, IEnumMoniker**);
void IRunningObjectTable_EnumRunning_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersist_GetClassID_Proxy(IPersist*, CLSID*);
void IPersist_GetClassID_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStream_IsDirty_Proxy(IPersistStream*);
void IPersistStream_IsDirty_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStream_Load_Proxy(IPersistStream*, IStream*);
void IPersistStream_Load_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStream_Save_Proxy(IPersistStream*, IStream*, BOOL);
void IPersistStream_Save_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStream_GetSizeMax_Proxy(IPersistStream*, ULARGE_INTEGER*);
void IPersistStream_GetSizeMax_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_RemoteBindToObject_Proxy(IMoniker*, IBindCtx*, IMoniker*, REFIID, IUnknown**);
void IMoniker_RemoteBindToObject_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_RemoteBindToStorage_Proxy(IMoniker*, IBindCtx*, IMoniker*, REFIID, IUnknown**);
void IMoniker_RemoteBindToStorage_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_Reduce_Proxy(IMoniker*, IBindCtx*, DWORD, IMoniker**, IMoniker**);
void IMoniker_Reduce_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_ComposeWith_Proxy(IMoniker*, IMoniker*, BOOL, IMoniker**);
void IMoniker_ComposeWith_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_Enum_Proxy(IMoniker*, BOOL, IEnumMoniker**);
void IMoniker_Enum_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_IsEqual_Proxy(IMoniker*, IMoniker*);
void IMoniker_IsEqual_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_Hash_Proxy(IMoniker*, DWORD*);
void IMoniker_Hash_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_IsRunning_Proxy(IMoniker*, IBindCtx*, IMoniker*, IMoniker*);
void IMoniker_IsRunning_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_GetTimeOfLastChange_Proxy(IMoniker*, IBindCtx*, IMoniker*, FILETIME*);
void IMoniker_GetTimeOfLastChange_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_Inverse_Proxy(IMoniker*, IMoniker**);
void IMoniker_Inverse_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_CommonPrefixWith_Proxy(IMoniker*, IMoniker*, IMoniker**);
void IMoniker_CommonPrefixWith_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_RelativePathTo_Proxy(IMoniker*, IMoniker*, IMoniker**);
void IMoniker_RelativePathTo_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_GetDisplayName_Proxy(IMoniker*, IBindCtx*, IMoniker*, LPCSTR*);
void IMoniker_GetDisplayName_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_ParseDisplayName_Proxy(IMoniker*, IBindCtx*, IMoniker*, LPCSTR, ULONG*, IMoniker**);
void IMoniker_ParseDisplayName_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IMoniker_IsSystemMoniker_Proxy(IMoniker*, DWORD*);
void IMoniker_IsSystemMoniker_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IROTData_GetComparisonData_Proxy(IROTData*, BYTE*, ULONG cbMax, ULONG*);
void IROTData_GetComparisonData_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumString_RemoteNext_Proxy(IEnumString*, ULONG, LPCSTR*rgelt, ULONG*);
void IEnumString_RemoteNext_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumString_Skip_Proxy(IEnumString*, ULONG);
void IEnumString_Skip_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumString_Reset_Proxy(IEnumString*);
void IEnumString_Reset_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumString_Clone_Proxy(IEnumString*, IEnumString**);
void IEnumString_Clone_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_RemoteRead_Proxy(IStream*, BYTE*, ULONG, ULONG*);
void IStream_RemoteRead_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_RemoteWrite_Proxy(IStream*, BYTE*pv, ULONG, ULONG*);
void IStream_RemoteWrite_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_RemoteSeek_Proxy(IStream*, LARGE_INTEGER, DWORD, ULARGE_INTEGER*);
void IStream_RemoteSeek_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_SetSize_Proxy(IStream*, ULARGE_INTEGER);
void IStream_SetSize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_RemoteCopyTo_Proxy(IStream*, IStream*, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*);
void IStream_RemoteCopyTo_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_Commit_Proxy(IStream*, DWORD);
void IStream_Commit_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_Revert_Proxy(IStream*);
void IStream_Revert_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_LockRegion_Proxy(IStream*, ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
void IStream_LockRegion_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_UnlockRegion_Proxy(IStream*, ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
void IStream_UnlockRegion_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_Stat_Proxy(IStream*, STATSTG*, DWORD);
void IStream_Stat_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStream_Clone_Proxy(IStream*, IStream**);
void IStream_Clone_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATSTG_RemoteNext_Proxy(IEnumSTATSTG*, ULONG, STATSTG*, ULONG*);
void IEnumSTATSTG_RemoteNext_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATSTG_Skip_Proxy(IEnumSTATSTG*, ULONG celt);
void IEnumSTATSTG_Skip_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATSTG_Reset_Proxy(IEnumSTATSTG*);
void IEnumSTATSTG_Reset_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATSTG_Clone_Proxy(IEnumSTATSTG*, IEnumSTATSTG**);
void IEnumSTATSTG_Clone_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_CreateStream_Proxy(IStorage*, OLECHAR*, DWORD, DWORD, DWORD, IStream**);
void IStorage_CreateStream_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_RemoteOpenStream_Proxy(IStorage*, CPtr!(OLECHAR), uint, BYTE*, DWORD, DWORD, IStream**);
void IStorage_RemoteOpenStream_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_CreateStorage_Proxy(IStorage*, OLECHAR*, DWORD, DWORD, DWORD, IStorage**);
void IStorage_CreateStorage_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_OpenStorage_Proxy(IStorage*, OLECHAR*, IStorage*, DWORD, SNB, DWORD, IStorage**);
void IStorage_OpenStorage_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_CopyTo_Proxy(IStorage*, DWORD, CPtr!(IID), SNB, IStorage*);
void IStorage_CopyTo_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_MoveElementTo_Proxy(IStorage*, CPtr!(OLECHAR), IStorage*, CPtr!(OLECHAR), DWORD);
void IStorage_MoveElementTo_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_Commit_Proxy(IStorage*, DWORD);
void IStorage_Commit_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_Revert_Proxy(IStorage*);
void IStorage_Revert_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_RemoteEnumElements_Proxy(IStorage*, DWORD, uint, BYTE*, DWORD, IEnumSTATSTG**);
void IStorage_RemoteEnumElements_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_DestroyElement_Proxy(IStorage*, OLECHAR*);
void IStorage_DestroyElement_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_RenameElement_Proxy(IStorage*, CPtr!(OLECHAR), CPtr!(OLECHAR));
void IStorage_RenameElement_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_SetElementTimes_Proxy(IStorage*, CPtr!(OLECHAR), CPtr!(FILETIME), CPtr!(FILETIME), CPtr!(FILETIME));
void IStorage_SetElementTimes_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_SetClass_Proxy(IStorage*, REFCLSID);
void IStorage_SetClass_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_SetStateBits_Proxy(IStorage*, DWORD, DWORD);
void IStorage_SetStateBits_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IStorage_Stat_Proxy(IStorage*, STATSTG*, DWORD);
void IStorage_Stat_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistFile_IsDirty_Proxy(IPersistFile*);
void IPersistFile_IsDirty_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistFile_Load_Proxy(IPersistFile*, LPCOLESTR, DWORD);
void IPersistFile_Load_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistFile_Save_Proxy(IPersistFile*, LPCOLESTR pszFileName, BOOL);
void IPersistFile_Save_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistFile_SaveCompleted_Proxy(IPersistFile*, LPCOLESTR);
void IPersistFile_SaveCompleted_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistFile_GetCurFile_Proxy(IPersistFile*, LPCSTR*);
void IPersistFile_GetCurFile_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStorage_IsDirty_Proxy(IPersistStorage*);
void IPersistStorage_IsDirty_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStorage_InitNew_Proxy(IPersistStorage*, IStorage*);
void IPersistStorage_InitNew_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStorage_Load_Proxy(IPersistStorage*, IStorage*);
void IPersistStorage_Load_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStorage_Save_Proxy(IPersistStorage*, IStorage*, BOOL);
void IPersistStorage_Save_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStorage_SaveCompleted_Proxy(IPersistStorage*, IStorage*);
void IPersistStorage_SaveCompleted_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPersistStorage_HandsOffStorage_Proxy(IPersistStorage*);
void IPersistStorage_HandsOffStorage_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT ILockBytes_RemoteReadAt_Proxy(ILockBytes*, ULARGE_INTEGER, BYTE*, ULONG, ULONG*);
void ILockBytes_RemoteReadAt_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT ILockBytes_RemoteWriteAt_Proxy(ILockBytes*, ULARGE_INTEGER, BYTE*pv, ULONG, ULONG*);
void ILockBytes_RemoteWriteAt_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT ILockBytes_Flush_Proxy(ILockBytes*);
void ILockBytes_Flush_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT ILockBytes_SetSize_Proxy(ILockBytes*, ULARGE_INTEGER);
void ILockBytes_SetSize_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT ILockBytes_LockRegion_Proxy(ILockBytes*, ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
void ILockBytes_LockRegion_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT ILockBytes_UnlockRegion_Proxy(ILockBytes*, ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
void ILockBytes_UnlockRegion_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT ILockBytes_Stat_Proxy(ILockBytes*, STATSTG*, DWORD);
void ILockBytes_Stat_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumFORMATETC_RemoteNext_Proxy(IEnumFORMATETC*, ULONG, FORMATETC*, ULONG*);
void IEnumFORMATETC_RemoteNext_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumFORMATETC_Skip_Proxy(IEnumFORMATETC*, ULONG);
void IEnumFORMATETC_Skip_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumFORMATETC_Reset_Proxy(IEnumFORMATETC*);
void IEnumFORMATETC_Reset_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumFORMATETC_Clone_Proxy(IEnumFORMATETC*, IEnumFORMATETC**);
void IEnumFORMATETC_Clone_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumFORMATETC_Next_Proxy(IEnumFORMATETC*, ULONG, FORMATETC*, ULONG*);
HRESULT IEnumFORMATETC_Next_Stub(IEnumFORMATETC*, ULONG, FORMATETC*, ULONG*);
HRESULT IEnumSTATDATA_RemoteNext_Proxy(IEnumSTATDATA*, ULONG, STATDATA*, ULONG*);
void IEnumSTATDATA_RemoteNext_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATDATA_Skip_Proxy(IEnumSTATDATA*, ULONG);
void IEnumSTATDATA_Skip_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATDATA_Reset_Proxy(IEnumSTATDATA*);
void IEnumSTATDATA_Reset_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATDATA_Clone_Proxy(IEnumSTATDATA*, IEnumSTATDATA**);
void IEnumSTATDATA_Clone_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IEnumSTATDATA_Next_Proxy(IEnumSTATDATA*, ULONG, STATDATA*, ULONG*);
HRESULT IEnumSTATDATA_Next_Stub(IEnumSTATDATA*, ULONG, STATDATA*, ULONG*);
HRESULT IRootStorage_SwitchToFile_Proxy(IRootStorage*, LPCSTR);
void IRootStorage_SwitchToFile_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IAdviseSink_RemoteOnDataChange_Proxy(IAdviseSink*, FORMATETC*, RemSTGMEDIUM*);
void IAdviseSink_RemoteOnDataChange_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IAdviseSink_RemoteOnViewChange_Proxy(IAdviseSink*, DWORD, LONG);
void IAdviseSink_RemoteOnViewChange_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IAdviseSink_RemoteOnRename_Proxy(IAdviseSink*, IMoniker*);
void IAdviseSink_RemoteOnRename_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IAdviseSink_RemoteOnSave_Proxy(IAdviseSink*);
void IAdviseSink_RemoteOnSave_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IAdviseSink_RemoteOnClose_Proxy(IAdviseSink*);
void IAdviseSink_RemoteOnClose_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IAdviseSink_OnDataChange_Proxy(IAdviseSink*, FORMATETC*, STGMEDIUM*);
void IAdviseSink_OnDataChange_Stub(IAdviseSink*, FORMATETC*, RemSTGMEDIUM*);
void IAdviseSink_OnViewChange_Proxy(IAdviseSink*, DWORD, LONG);
void IAdviseSink_OnViewChange_Stub(IAdviseSink*, DWORD, LONG);
void IAdviseSink_OnRename_Proxy(IAdviseSink*, IMoniker*);
void IAdviseSink_OnRename_Stub(IAdviseSink*, IMoniker*);
void IAdviseSink_OnSave_Proxy(IAdviseSink*);
void IAdviseSink_OnSave_Stub(IAdviseSink*);
void IAdviseSink_OnClose_Proxy(IAdviseSink*);
HRESULT IAdviseSink_OnClose_Stub(IAdviseSink*);
void IAdviseSink2_RemoteOnLinkSrcChange_Proxy(IAdviseSink2*, IMoniker*);
void IAdviseSink2_RemoteOnLinkSrcChange_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IAdviseSink2_OnLinkSrcChange_Proxy(IAdviseSink2*, IMoniker*);
void IAdviseSink2_OnLinkSrcChange_Stub(IAdviseSink2*, IMoniker*);
HRESULT IDataObject_RemoteGetData_Proxy(IDataObject*, FORMATETC*, RemSTGMEDIUM**);
void IDataObject_RemoteGetData_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_RemoteGetDataHere_Proxy(IDataObject*, FORMATETC*, RemSTGMEDIUM**);
void IDataObject_RemoteGetDataHere_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_QueryGetData_Proxy(IDataObject*, FORMATETC*);
void IDataObject_QueryGetData_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_GetCanonicalFormatEtc_Proxy(IDataObject*, FORMATETC*, FORMATETC*);
void IDataObject_GetCanonicalFormatEtc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_RemoteSetData_Proxy(IDataObject*, FORMATETC*, RemSTGMEDIUM*, BOOL);
void IDataObject_RemoteSetData_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_EnumFormatEtc_Proxy(IDataObject*, DWORD, IEnumFORMATETC**);
void IDataObject_EnumFormatEtc_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_DAdvise_Proxy(IDataObject*, FORMATETC*, DWORD, IAdviseSink*, DWORD*);
void IDataObject_DAdvise_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_DUnadvise_Proxy(IDataObject*, DWORD);
void IDataObject_DUnadvise_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_EnumDAdvise_Proxy(IDataObject*, IEnumSTATDATA**);
void IDataObject_EnumDAdvise_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataObject_GetData_Proxy(IDataObject*, FORMATETC*, STGMEDIUM*);
HRESULT IDataObject_GetData_Stub(IDataObject*, FORMATETC*, RemSTGMEDIUM**);
HRESULT IDataObject_GetDataHere_Proxy(IDataObject*, FORMATETC*, STGMEDIUM*);
HRESULT IDataObject_GetDataHere_Stub(IDataObject*, FORMATETC*, RemSTGMEDIUM**);
HRESULT IDataObject_SetData_Proxy(IDataObject*, FORMATETC*, STGMEDIUM*, BOOL);
HRESULT IDataObject_SetData_Stub(IDataObject*, FORMATETC*, RemSTGMEDIUM*, BOOL);
HRESULT IDataAdviseHolder_Advise_Proxy(IDataAdviseHolder*, IDataObject*, FORMATETC*, DWORD, IAdviseSink*, DWORD*);
void IDataAdviseHolder_Advise_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataAdviseHolder_Unadvise_Proxy(IDataAdviseHolder*, DWORD);
void IDataAdviseHolder_Unadvise_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataAdviseHolder_EnumAdvise_Proxy(IDataAdviseHolder*, IEnumSTATDATA**);
void IDataAdviseHolder_EnumAdvise_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IDataAdviseHolder_SendOnDataChange_Proxy(IDataAdviseHolder*, IDataObject*, DWORD, DWORD);
void IDataAdviseHolder_SendOnDataChange_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
DWORD IMessageFilter_HandleInComingCall_Proxy(IMessageFilter*, DWORD, HTASK, DWORD, LPINTERFACEINFO);
void IMessageFilter_HandleInComingCall_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
DWORD IMessageFilter_RetryRejectedCall_Proxy(IMessageFilter*, HTASK, DWORD, DWORD);
void IMessageFilter_RetryRejectedCall_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
DWORD IMessageFilter_MessagePending_Proxy(IMessageFilter*, HTASK, DWORD, DWORD);
void IMessageFilter_MessagePending_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcChannelBuffer_GetBuffer_Proxy(IRpcChannelBuffer*, RPCOLEMESSAGE*, REFIID);
void IRpcChannelBuffer_GetBuffer_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcChannelBuffer_SendReceive_Proxy(IRpcChannelBuffer*, RPCOLEMESSAGE*, ULONG*);
void IRpcChannelBuffer_SendReceive_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcChannelBuffer_FreeBuffer_Proxy(IRpcChannelBuffer*, RPCOLEMESSAGE*);
void IRpcChannelBuffer_FreeBuffer_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcChannelBuffer_GetDestCtx_Proxy(IRpcChannelBuffer*, DWORD*, void**);
void IRpcChannelBuffer_GetDestCtx_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcChannelBuffer_IsConnected_Proxy(IRpcChannelBuffer*);
void IRpcChannelBuffer_IsConnected_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcProxyBuffer_Connect_Proxy(IRpcProxyBuffer*, IRpcChannelBuffer*pRpcChannelBuffer);
void IRpcProxyBuffer_Connect_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IRpcProxyBuffer_Disconnect_Proxy(IRpcProxyBuffer*);
void IRpcProxyBuffer_Disconnect_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcStubBuffer_Connect_Proxy(IRpcStubBuffer*, IUnknown*);
void IRpcStubBuffer_Connect_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IRpcStubBuffer_Disconnect_Proxy(IRpcStubBuffer*);
void IRpcStubBuffer_Disconnect_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcStubBuffer_Invoke_Proxy(IRpcStubBuffer*, RPCOLEMESSAGE*, IRpcChannelBuffer*);
void IRpcStubBuffer_Invoke_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
IRpcStubBuffer*IRpcStubBuffer_IsIIDSupported_Proxy(IRpcStubBuffer*, REFIID);
void IRpcStubBuffer_IsIIDSupported_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
ULONG IRpcStubBuffer_CountRefs_Proxy(IRpcStubBuffer*);
void IRpcStubBuffer_CountRefs_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IRpcStubBuffer_DebugServerQueryInterface_Proxy(IRpcStubBuffer*, void**);
void IRpcStubBuffer_DebugServerQueryInterface_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void IRpcStubBuffer_DebugServerRelease_Proxy(IRpcStubBuffer*, void*);
void IRpcStubBuffer_DebugServerRelease_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPSFactoryBuffer_CreateProxy_Proxy(IPSFactoryBuffer*, IUnknown*, REFIID, IRpcProxyBuffer**, void**);
void IPSFactoryBuffer_CreateProxy_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
HRESULT IPSFactoryBuffer_CreateStub_Proxy(IPSFactoryBuffer*, REFIID, IUnknown*, IRpcStubBuffer**);
void IPSFactoryBuffer_CreateStub_Stub(IRpcStubBuffer*, IRpcChannelBuffer*, PRPC_MESSAGE, PDWORD);
void SNB_to_xmit(SNB*, RemSNB**);
void SNB_from_xmit(RemSNB*, SNB*);
void SNB_free_inst(SNB*);
void SNB_free_xmit(RemSNB*);
HRESULT IEnumUnknown_Next_Proxy(IEnumUnknown*, ULONG, IUnknown**, ULONG*);
HRESULT IEnumUnknown_Next_Stub(IEnumUnknown*, ULONG, IUnknown**, ULONG*);
HRESULT IEnumMoniker_Next_Proxy(IEnumMoniker*, ULONG, IMoniker**, ULONG*);
HRESULT IEnumMoniker_Next_Stub(IEnumMoniker*, ULONG, IMoniker**, ULONG*);
HRESULT IMoniker_BindToObject_Proxy(IMoniker*, IBindCtx*, IMoniker*, REFIID, void**);
HRESULT IMoniker_BindToObject_Stub(IMoniker*, IBindCtx*, IMoniker*, REFIID, IUnknown**);
HRESULT IMoniker_BindToStorage_Proxy(IMoniker*, IBindCtx*, IMoniker*, REFIID, void**);
HRESULT IMoniker_BindToStorage_Stub(IMoniker*, IBindCtx*, IMoniker*, REFIID, IUnknown**);
HRESULT IEnumString_Next_Proxy(IEnumString*, ULONG, LPCSTR*, ULONG*);
HRESULT IEnumString_Next_Stub(IEnumString*, ULONG, LPCSTR*, ULONG*);
HRESULT IStream_Read_Proxy(IStream*, void*, ULONG, ULONG*);
HRESULT IStream_Read_Stub(IStream*, BYTE*, ULONG, ULONG*);
HRESULT IStream_Write_Proxy(IStream*, void*, ULONG, ULONG*);
HRESULT IStream_Write_Stub(IStream*, BYTE*, ULONG, ULONG*);
HRESULT IStream_Seek_Proxy(IStream*, LARGE_INTEGER, DWORD, ULARGE_INTEGER*);
HRESULT IStream_Seek_Stub(IStream*, LARGE_INTEGER, DWORD, ULARGE_INTEGER*);
HRESULT IStream_CopyTo_Proxy(IStream*, IStream*, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*);
HRESULT IStream_CopyTo_Stub(IStream*, IStream*, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*);
HRESULT IEnumSTATSTG_Next_Proxy(IEnumSTATSTG*, ULONG, STATSTG*, ULONG*);
HRESULT IEnumSTATSTG_Next_Stub(IEnumSTATSTG*, ULONG, STATSTG*, ULONG*);
HRESULT IStorage_OpenStream_Proxy(IStorage*, OLECHAR*, void*, DWORD, DWORD, IStream**);
HRESULT IStorage_OpenStream_Stub(IStorage*, OLECHAR*, uint, BYTE*, DWORD, DWORD, IStream** );
HRESULT IStorage_EnumElements_Proxy(IStorage*, DWORD, void*, DWORD, IEnumSTATSTG**);
HRESULT IStorage_EnumElements_Stub(IStorage*, DWORD, uint, BYTE*, DWORD, IEnumSTATSTG**);
HRESULT ILockBytes_ReadAt_Proxy(ILockBytes*, ULARGE_INTEGER, void*, ULONG, ULONG*);
HRESULT ILockBytes_ReadAt_Stub(ILockBytes*, ULARGE_INTEGER, BYTE*, ULONG, ULONG*);
HRESULT ILockBytes_WriteAt_Proxy(ILockBytes*, ULARGE_INTEGER, CPtr!(void), ULONG, ULONG*);
HRESULT ILockBytes_WriteAt_Stub(ILockBytes*, ULARGE_INTEGER, BYTE*, ULONG, ULONG*);
}
+/
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.