Skip to content

Commit 04cee15

Browse files
committed
Move AST files into a package
1 parent 68d582f commit 04cee15

137 files changed

Lines changed: 1430 additions & 1243 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/src/.dscanner.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ unused_result="disabled"
119119
trust_too_much="-dmd.root.longdouble"
120120
builtin_property_names_check="-dmd.backend.obj,-dmd.backend.code,-dmd.backend.cc"
121121
object_const_check="-dmd.dtemplate"
122-
enum_array_literal_check="-dmd.astbase,-dmd.backend.oper,-dmd.backend.oper,-dmd.backend.var,-dmd.tokens,-dmd.expression"
122+
enum_array_literal_check="-dmd.ast.base,-dmd.backend.oper,-dmd.backend.oper,-dmd.backend.var,-dmd.tokens,-dmd.ast.expression"
123123
unused_variable_check="-dmd.backend.aarray,\
124124
-dmd.backend.blockopt,\
125125
-dmd.backend.cg,\

compiler/src/build.d

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ alias html = makeRule!((htmlBuilder, htmlRule) {
962962
}
963963
const stddocs = env.get("STDDOC", "").split();
964964
auto docSources = .sources.common ~ .sources.root ~ .sources.lexer ~ .sources.dmd.all
965-
~ env["D"].buildPath("astbase.d")
965+
~ env["D"].buildPath("ast/base.d")
966966
~ env["D"].buildPath("cxxfrontend.d")
967967
~ env["D"].buildPath("frontend.d");
968968
htmlBuilder.deps(docSources.chunks(1).map!(sourceArray =>
@@ -1574,24 +1574,29 @@ auto sourceFiles()
15741574
link.d mars.d main.d sarif.d lib/scanelf.d lib/scanmach.d lib/scanmscoff.d timetrace.d vsoptions.d
15751575
"),
15761576
frontend: fileArray(env["D"], "
1577-
access.d aggregate.d aliasthis.d argtypes_x86.d argtypes_sysv_x64.d argtypes_aarch64.d arrayop.d
1578-
arraytypes.d astenums.d ast_node.d astcodegen.d asttypename.d attrib.d attribsem.d blockexit.d builtin.d canthrow.d chkformat.d
1579-
cli.d clone.d compiler.d cond.d constfold.d cpreprocess.d ctfeexpr.d
1580-
ctorflow.d dcast.d dclass.d declaration.d delegatize.d denum.d deps.d dimport.d
1581-
dinterpret.d dmacro.d dmodule.d doc.d dscope.d dstruct.d dsymbol.d dsymbolsem.d
1582-
dtemplate.d dtoh.d dversion.d enumsem.d escape.d expression.d expressionsem.d func.d funcsem.d hdrgen.d
1583-
impcnvtab.d imphint.d importc.d init.d initsem.d inline.d inlinecost.d intrange.d json.d lambdacomp.d
1584-
mtype.d mustuse.d nogc.d nspace.d ob.d objc.d opover.d optimize.d
1585-
parse.d pragmasem.d printast.d rootobject.d safe.d
1586-
semantic2.d semantic3.d sideeffect.d statement.d
1587-
statementsem.d staticassert.d staticcond.d stmtstate.d target.d targetcompiler.d templatesem.d templateparamsem.d traits.d
1577+
access.d argtypes_x86.d argtypes_sysv_x64.d argtypes_aarch64.d arrayop.d
1578+
arraytypes.d attribsem.d blockexit.d builtin.d canthrow.d chkformat.d
1579+
cli.d clone.d compiler.d constfold.d cpreprocess.d ctfeexpr.d
1580+
ctorflow.d dcast.d delegatize.d deps.d
1581+
dinterpret.d dmacro.d doc.d dscope.d dsymbolsem.d
1582+
dtoh.d enumsem.d escape.d expressionsem.d funcsem.d hdrgen.d
1583+
impcnvtab.d imphint.d importc.d initsem.d inline.d inlinecost.d intrange.d json.d lambdacomp.d
1584+
mustuse.d nogc.d ob.d objc.d opover.d optimize.d
1585+
parse.d pragmasem.d rootobject.d safe.d
1586+
semantic2.d semantic3.d sideeffect.d
1587+
statementsem.d stmtstate.d target.d targetcompiler.d templatesem.d templateparamsem.d traits.d
15881588
typesem.d typinf.d utils.d
1589+
ast/aggregate.d ast/aliasthis.d ast/codegen.d ast/attrib.d ast/cond.d ast/dclass.d ast/declaration.d
1590+
ast/denum.d ast/dimport.d ast/dmodule.d ast/dstruct.d ast/dsymbol.d ast/dtemplate.d ast/dversion.d ast/enums.d
1591+
ast/expression.d ast/func.d ast/init.d ast/mtype.d ast/node.d ast/nspace.d ast/print.d ast/statement.d
1592+
ast/staticassert.d ast/staticcond.d ast/typename.d
1593+
dfa/entry.d dfa/utils.d dfa/fast/structure.d dfa/fast/analysis.d dfa/fast/report.d dfa/fast/expression.d dfa/fast/statement.d
15891594
iasm/package.d iasm/gcc.d
15901595
mangle/package.d mangle/basic.d mangle/cpp.d mangle/cppwin.d
15911596
visitor/package.d visitor/foreachvar.d visitor/parsetime.d visitor/permissive.d visitor/postorder.d visitor/statement_rewrite_walker.d
15921597
visitor/strict.d visitor/transitive.d
15931598
cparse.d
1594-
dfa/entry.d dfa/utils.d dfa/fast/structure.d dfa/fast/analysis.d dfa/fast/report.d dfa/fast/expression.d dfa/fast/statement.d
1599+
15951600
"),
15961601
backendHeaders: fileArray(env["C"], "
15971602
cc.d cdef.d cgcv.d code.d dt.d el.d global.d

compiler/src/dmd/access.d

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@
1313

1414
module dmd.access;
1515

16-
import dmd.aggregate;
17-
import dmd.astenums;
18-
import dmd.dclass;
19-
import dmd.dmodule;
16+
import dmd.ast.aggregate;
17+
import dmd.ast.enums;
18+
import dmd.ast.dclass;
19+
import dmd.ast.dmodule;
20+
import dmd.ast.dstruct;
21+
import dmd.ast.dsymbol;
22+
import dmd.ast.expression;
23+
2024
import dmd.dscope;
21-
import dmd.dstruct;
22-
import dmd.dsymbol;
2325
import dmd.dsymbolsem : toAlias;
2426
import dmd.errors;
25-
import dmd.expression;
2627
import dmd.funcsem : overloadApply;
2728
import dmd.location;
2829
import dmd.tokens;

compiler/src/dmd/argtypes_aarch64.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
module dmd.argtypes_aarch64;
1313

14+
import dmd.ast.enums;
15+
import dmd.ast.mtype;
16+
1417
import core.stdc.stdio;
15-
import dmd.astenums;
1618
import dmd.dsymbolsem : isPOD;
17-
import dmd.mtype;
1819
import dmd.typesem;
1920
import dmd.expressionsem : toUInteger;
2021

compiler/src/dmd/argtypes_sysv_x64.d

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
module dmd.argtypes_sysv_x64;
1313

1414
import core.stdc.stdio;
15-
import dmd.astenums;
16-
import dmd.declaration;
15+
16+
import dmd.ast.enums;
17+
import dmd.ast.declaration;
18+
import dmd.ast.mtype;
19+
1720
import dmd.dsymbolsem : isPOD;
18-
import dmd.mtype;
1921
import dmd.typesem;
2022
import dmd.expressionsem : toInteger;
2123
import dmd.target;

compiler/src/dmd/argtypes_x86.d

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ module dmd.argtypes_x86;
1414
import core.stdc.stdio;
1515
import core.checkedint;
1616

17-
import dmd.astenums;
18-
import dmd.declaration;
17+
import dmd.ast.enums;
18+
import dmd.ast.declaration;
19+
import dmd.ast.mtype;
20+
1921
import dmd.dsymbolsem : isPOD;
2022
import dmd.expressionsem : toInteger;
2123
import dmd.location;
22-
import dmd.mtype;
2324
import dmd.typesem;
2425
import dmd.target;
2526
import dmd.visitor;

compiler/src/dmd/arrayop.d

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@
1414
module dmd.arrayop;
1515

1616
import core.stdc.stdio;
17+
18+
import dmd.ast.enums;
19+
import dmd.ast.declaration;
20+
import dmd.ast.expression;
21+
import dmd.ast.mtype;
22+
1723
import dmd.arraytypes;
18-
import dmd.astenums;
1924
import dmd.dcast : implicitConvTo;
20-
import dmd.declaration;
2125
import dmd.dscope;
2226
import dmd.errors;
23-
import dmd.expression;
2427
import dmd.expressionsem;
2528
import dmd.funcsem;
2629
import dmd.hdrgen;
2730
import dmd.id;
2831
import dmd.identifier;
2932
import dmd.location;
30-
import dmd.mtype;
3133
import dmd.common.outbuffer;
3234
import dmd.tokens;
3335
import dmd.typesem : isAssignable, nextOf, toBasetype;
@@ -132,7 +134,7 @@ Expression arrayOp(BinExp e, Scope* sc)
132134
auto tiargs = new Objects();
133135
auto args = buildArrayOp(sc, e, tiargs);
134136

135-
import dmd.dtemplate : TemplateDeclaration;
137+
import dmd.ast.dtemplate : TemplateDeclaration;
136138
__gshared TemplateDeclaration arrayOp;
137139
if (arrayOp is null)
138140
{

compiler/src/dmd/arraytypes.d

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@
1111

1212
module dmd.arraytypes;
1313

14-
import dmd.dclass;
15-
import dmd.declaration;
16-
import dmd.dmodule;
17-
import dmd.dsymbol;
18-
import dmd.dtemplate;
19-
import dmd.expression;
20-
import dmd.func;
14+
import dmd.ast.dclass;
15+
import dmd.ast.declaration;
16+
import dmd.ast.dmodule;
17+
import dmd.ast.dsymbol;
18+
import dmd.ast.dtemplate;
19+
import dmd.ast.expression;
20+
import dmd.ast.func;
21+
import dmd.ast.init;
22+
import dmd.ast.mtype;
23+
import dmd.ast.statement;
24+
2125
import dmd.identifier;
22-
import dmd.init;
23-
import dmd.mtype;
2426
import dmd.root.array;
2527
import dmd.rootobject;
26-
import dmd.statement;
2728

2829
alias Strings = Array!(const(char)*);
2930
alias Identifiers = Array!(Identifier);
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,29 @@
77
* Copyright: Copyright (C) 1999-2026 by The D Language Foundation, All Rights Reserved
88
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
99
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
10-
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/compiler/src/dmd/aggregate.d, _aggregate.d)
11-
* Documentation: https://dlang.org/phobos/dmd_aggregate.html
12-
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/aggregate.d
10+
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ast/aggregate.d, _aggregate.d)
11+
* Documentation: https://dlang.org/phobos/dmd_ast_aggregate.html
12+
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/ast/aggregate.d
1313
*/
1414

15-
module dmd.aggregate;
15+
module dmd.ast.aggregate;
1616

1717
import core.stdc.stdio;
1818
import core.checkedint;
1919

20-
import dmd.aliasthis;
20+
import dmd.ast.aliasthis;
21+
import dmd.ast.enums;
22+
import dmd.ast.declaration;
23+
import dmd.ast.dsymbol;
24+
import dmd.ast.expression;
25+
import dmd.ast.func;
26+
import dmd.ast.mtype;
27+
2128
import dmd.arraytypes;
22-
import dmd.astenums;
23-
import dmd.declaration;
2429
import dmd.dscope;
25-
import dmd.dsymbol;
2630
import dmd.errors;
27-
import dmd.expression;
28-
import dmd.func;
2931
import dmd.identifier;
3032
import dmd.location;
31-
import dmd.mtype;
3233
import dmd.visitor;
3334

3435
/**
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
* Copyright: Copyright (C) 1999-2026 by The D Language Foundation, All Rights Reserved
77
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
88
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
9-
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/compiler/src/dmd/aliasthis.d, _aliasthis.d)
10-
* Documentation: https://dlang.org/phobos/dmd_aliasthis.html
11-
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/aliasthis.d
9+
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ast/aliasthis.d, _aliasthis.d)
10+
* Documentation: https://dlang.org/phobos/dmd_ast_aliasthis.html
11+
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/ast/aliasthis.d
1212
*/
1313

14-
module dmd.aliasthis;
14+
module dmd.ast.aliasthis;
1515

1616
import core.stdc.stdio;
1717

18-
import dmd.dsymbol;
18+
import dmd.ast.dsymbol;
1919
import dmd.identifier;
2020
import dmd.location;
2121
import dmd.visitor;

0 commit comments

Comments
 (0)