File tree Expand file tree Collapse file tree 4 files changed +40
-2
lines changed
Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1+ // Compiler implementation of the D programming language
2+ // Copyright (c) 1999-2016 by Digital Mars
3+ // All Rights Reserved
4+ // written by Walter Bright
5+ // http://www.digitalmars.com
6+ // Distributed under the Boost Software License, Version 1.0.
7+ // http://www.boost.org/LICENSE_1_0.txt
8+
9+ module ddmd.appl ;
10+
11+ import ddmd.dscope;
12+ import ddmd.expression;
13+
14+ struct Hooks
15+ {
16+ Expression function (TraitsExp e, Scope* sc) semanticTraits;
17+ }
18+
19+ void setHooks (Hooks hooks)
20+ {
21+ .hooks = hooks;
22+ }
23+
24+ Expression semanticTraitsHook (TraitsExp e, Scope* sc)
25+ {
26+ if (hooks.semanticTraitsHook)
27+ return hooks.semanticTraits(e, sc);
28+ return null ;
29+ }
30+
31+ package :
32+
33+ __gshared Hooks hooks;
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ endif
197197endif
198198
199199
200- FRONT_SRCS =$(addsuffix .d,access aggregate aliasthis apply argtypes arrayop \
200+ FRONT_SRCS =$(addsuffix .d,access aggregate aliasthis appl apply argtypes arrayop \
201201 arraytypes attrib builtin canthrow clone complex cond constfold \
202202 cppmangle ctfeexpr dcast dclass declaration delegatize denum dimport \
203203 dinifile dinterpret dmacro dmangle dmodule doc dscope dstruct dsymbol \
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import core.stdc.stdio;
1212import core.stdc.string ;
1313import ddmd.aggregate;
1414import ddmd.arraytypes;
15+ import ddmd.appl;
1516import ddmd.canthrow;
1617import ddmd.dclass;
1718import ddmd.declaration;
@@ -1186,6 +1187,10 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc)
11861187 {
11871188 return pointerBitmap (e);
11881189 }
1190+ if (Expression ret = semanticTraitsHook(e, sc))
1191+ {
1192+ return ret;
1193+ }
11891194
11901195 extern (D ) void * trait_search_fp(const (char )* seed, ref int cost)
11911196 {
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ DMDMAKE=$(MAKE) -fwin32.mak C=$C TK=$(TK) ROOT=$(ROOT) MAKE="$(MAKE)" HOST_DC="$
141141# ############################## Rule Variables ###############################
142142
143143# D front end
144- FRONT_SRCS =access.d aggregate.d aliasthis.d apply.d argtypes.d arrayop.d \
144+ FRONT_SRCS =access.d aggregate.d aliasthis.d appl.d apply.d argtypes.d arrayop.d \
145145 arraytypes.d attrib.d builtin.d canthrow.d clone.d complex.d \
146146 cond.d constfold.d cppmangle.d ctfeexpr.d dcast.d dclass.d \
147147 declaration.d delegatize.d denum.d dimport.d dinifile.d dinterpret.d \
You can’t perform that action at this time.
0 commit comments