Skip to content

Commit a04f669

Browse files
authored
Merge pull request #302 from rainers/master
changes for Visual D 1.4.1-beta2
2 parents fb6450c + 1f35707 commit a04f669

File tree

10 files changed

+549
-46
lines changed

10 files changed

+549
-46
lines changed

CHANGES

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,3 +1414,10 @@ Version history
14141414
* mago: fixed display of AA key in expanded view
14151415
* issue #291: allow overriding the default compiler executable path in the VC project settings
14161416
* issue #296: VC project integration: added support to build for ARM64 with LDC
1417+
1418+
2025-05-01 version 1.4.1-beta2
1419+
* issue #300: storage class adornments not updated after edits
1420+
* issue #301: mago: strip modifier from type before detecting arrays
1421+
* mago: improved stability when displaying arrays from invalid memory address
1422+
* dmdserver: fixed a couple of assertions causing the server to restart
1423+
* dmdserver: replaced new location storage to avoid leaking memory

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define VERSION_MINOR 4
33
#define VERSION_REVISION 1
44
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 1
5+
#define VERSION_BUILD 2

vdc/dmdserver/dmdinit.d

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ import dmd.dmodule;
2323
import dmd.dstruct;
2424
import dmd.dsymbol;
2525
import dmd.dtemplate;
26+
import dmd.escape;
2627
import dmd.expression;
2728
import dmd.func;
2829
import dmd.globals;
2930
import dmd.id;
3031
import dmd.identifier;
32+
import dmd.location;
3133
import dmd.mtype;
3234
import dmd.objc;
3335
import dmd.rootobject;
@@ -42,6 +44,8 @@ import core.stdc.string;
4244
////////////////////////////////////////////////////////////////
4345
alias countersType = uint[uint]; // actually uint[Key]
4446
alias EscapeInfer = RootObject[int];
47+
enum uint_1 : uint { initValue = 1 }
48+
4549

4650
enum string[2][] dmdStatics =
4751
[
@@ -108,6 +112,7 @@ enum string[2][] dmdStatics =
108112
["_D3dmd7arrayop7arrayOpFCQw10expression6BinExpPSQBt6dscope5ScopeZQByCQCo9dtemplate19TemplateDeclaration", "TemplateDeclaration"],
109113
["_D3dmd6errors18colorHighlightCodeFNbKSQBk6common9outbuffer9OutBufferZ6nestedi", "int"],
110114
["_D3dmd7dmodule6Module18loadCoreStdcConfigFZ16core_stdc_configCQCiQChQCc", "Module"],
115+
// EscapeState.reset not accessible in package dmd
111116
["_D3dmd6escape11EscapeState17scopeInferFailureHiCQBu10rootobject10RootObject", "EscapeInfer" ],
112117
];
113118

@@ -135,7 +140,7 @@ string genInitDmdStatics()
135140
{
136141
string s;
137142
foreach (decl; dmdStatics)
138-
s ~= cmangled(decl[0]) ~ " = " ~ decl[1] ~ ".init;\n";
143+
s ~= cmangled(decl[0]) ~ " = (" ~ decl[1] ~ ").init;\n";
139144
return s;
140145
}
141146

@@ -197,6 +202,7 @@ void dmdInit()
197202
//Token._init();
198203
Id.initialize();
199204
Expression._init();
205+
location_init();
200206

201207
target._init(global.params); // needed by Type._init
202208
Type._init();
@@ -394,6 +400,63 @@ void dmdSetupParams(const ref Options opts)
394400
global.filePath.setDim(0);
395401
foreach(i; opts.stringImportDirs)
396402
global.filePath.push(toStringz(i));
403+
404+
dmdSetupCompileEnv();
405+
}
406+
407+
void dmdSetupCompileEnv()
408+
{
409+
import dmd.common.charactertables;
410+
411+
global.compileEnv.previewIn = global.params.previewIn;
412+
global.compileEnv.transitionIn = global.params.v.vin;
413+
global.compileEnv.ddocOutput = global.params.ddoc.doOutput;
414+
415+
final switch(global.params.cIdentifierTable)
416+
{
417+
case CLIIdentifierTable.C99:
418+
global.compileEnv.cCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.C99);
419+
break;
420+
421+
case CLIIdentifierTable.C11:
422+
case CLIIdentifierTable.default_:
423+
// ImportC is defined against C11, not C23.
424+
// If it was C23 this needs to be changed to UAX31 instead.
425+
global.compileEnv.cCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.C11);
426+
break;
427+
428+
case CLIIdentifierTable.UAX31:
429+
global.compileEnv.cCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.UAX31);
430+
break;
431+
432+
case CLIIdentifierTable.All:
433+
global.compileEnv.cCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.LR);
434+
break;
435+
}
436+
437+
final switch(global.params.dIdentifierTable)
438+
{
439+
case CLIIdentifierTable.C99:
440+
global.compileEnv.dCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.C99);
441+
break;
442+
443+
case CLIIdentifierTable.C11:
444+
global.compileEnv.dCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.C11);
445+
break;
446+
447+
case CLIIdentifierTable.UAX31:
448+
global.compileEnv.dCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.UAX31);
449+
break;
450+
451+
case CLIIdentifierTable.All:
452+
case CLIIdentifierTable.default_:
453+
// @@@DEPRECATED_2.119@@@
454+
// Change the default to UAX31,
455+
// this is a breaking change as C99 (what D used for ~23 years),
456+
// has characters that are not in UAX31.
457+
global.compileEnv.dCharLookupTable = IdentifierCharLookup.forTable(IdentifierTable.LR);
458+
break;
459+
}
397460
}
398461

399462
// initialization that are necessary before restarting an analysis (which might run

0 commit comments

Comments
 (0)