diff --git a/.gitmodules b/.gitmodules index 921283e..cd5bd3a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,3 +14,6 @@ [submodule "libddoc"] path = libddoc url = https://github.com/economicmodeling/libddoc +[submodule "stdx-allocator"] + path = stdx-allocator + url = https://github.com/dlang-community/stdx-allocator diff --git a/build.bat b/build.bat index 4d35502..12d11b6 100644 --- a/build.bat +++ b/build.bat @@ -14,6 +14,8 @@ set INIFILED= set DSYMBOL= set CONTAINERS= set LIBDDOC= +set STDXALLOCATOR= +set STDXALLOCATORBLOCKS= for %%x in (src\*.d) do set CORE=!CORE! %%x for %%x in (src\analysis\*.d) do set ANALYSIS=!ANALYSIS! %%x @@ -26,18 +28,20 @@ for %%x in (dsymbol\src\dsymbol\builtin\*.d) do set DSYMBOL=!DSYMBOL! %%x for %%x in (dsymbol\src\dsymbol\conversion\*.d) do set DSYMBOL=!DSYMBOL! %%x for %%x in (containers\src\containers\*.d) do set CONTAINERS=!CONTAINERS! %%x for %%x in (containers\src\containers\internal\*.d) do set CONTAINERS=!CONTAINERS! %%x +for %%x in (stdx-allocator\source\stdx\allocator\*.d) do set STDXALLOCATOR=!STDXALLOCATOR! %%x +for %%x in (stdx-allocator\source\stdx\allocator\building_blocks\*.d) do set STDXALLOCATORBLOCKS=!STDXALLOCATORBLOCKS! %%x if "%1" == "test" goto test_cmd @echo on -%DC% %CORE% %STD% %LIBDPARSE% %LIBDDOC% %ANALYSIS% %INIFILED% %DSYMBOL% %CONTAINERS% %DFLAGS% -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -ofbin\dscanner.exe +%DC% %CORE% %STD% %LIBDPARSE% %LIBDDOC% %ANALYSIS% %INIFILED% %DSYMBOL% %CONTAINERS% %STDXALLOCATOR% %STDXALLOCATORBLOCKS% %DFLAGS% -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -I"stdx-allocator\source" -ofbin\dscanner.exe goto eof :test_cmd @echo on set TESTNAME="bin\dscanner-unittest" -%DC% %STD% %LIBDPARSE% %LIBDDOC% %INIFILED% %DSYMBOL% %CONTAINERS% -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -lib %TESTFLAGS% -of%TESTNAME%.lib -if exist %TESTNAME%.lib %DC% %CORE% %ANALYSIS% %TESTNAME%.lib -I"src" -I"inifiled\source" -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -unittest %TESTFLAGS% -of%TESTNAME%.exe +%DC% %STD% %LIBDPARSE% %LIBDDOC% %INIFILED% %DSYMBOL% %CONTAINERS% %STDXALLOCATOR% %STDXALLOCATORBLOCKS% -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -I"stdx-allocator\source" -lib %TESTFLAGS% -of%TESTNAME%.lib +if exist %TESTNAME%.lib %DC% %CORE% %ANALYSIS% %TESTNAME%.lib -I"src" -I"inifiled\source" -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -I"stdx-allocator\source" -unittest %TESTFLAGS% -of%TESTNAME%.exe if exist %TESTNAME%.exe %TESTNAME%.exe if exist %TESTNAME%.obj del %TESTNAME%.obj diff --git a/containers b/containers index f58dd7b..6c5504c 160000 --- a/containers +++ b/containers @@ -1 +1 @@ -Subproject commit f58dd7bf160f76762a79029a6bda7637d5a788e7 +Subproject commit 6c5504cc80b75192b24cebe93209521c03f806d8 diff --git a/dsymbol b/dsymbol index 89f6ee8..5b90412 160000 --- a/dsymbol +++ b/dsymbol @@ -1 +1 @@ -Subproject commit 89f6ee88bf8d0fc0df232cba56bf797f5b3b0487 +Subproject commit 5b90412457ac5f1d67c04e4da01587edfd529ad5 diff --git a/dub.json b/dub.json index d47d769..cf61ec7 100644 --- a/dub.json +++ b/dub.json @@ -12,11 +12,12 @@ "StdLoggerDisableWarning" ], "dependencies" : { - "libdparse" : "~>0.8.0-alpha.2", - "dsymbol" : "~>0.3.0-alpha.1", + "libdparse": "~>0.8.0-alpha.5", + "dsymbol" : "~>0.3.0-alpha.3", "inifiled" : ">=1.0.2", "emsi_containers" : "~>0.6.0", - "libddoc" : "~>0.3.0-beta.1" + "libddoc" : "~>0.3.0-beta.1", + "stdx-allocator" : "~>2.77.0" }, "targetPath" : "bin" } diff --git a/libddoc b/libddoc index 128d60b..476c096 160000 --- a/libddoc +++ b/libddoc @@ -1 +1 @@ -Subproject commit 128d60bd3f6913eeab8e67a775cecc2a4e47f4c8 +Subproject commit 476c0964ee173d7574155aa2a9caa2bc019a3754 diff --git a/libdparse b/libdparse index 687c0ca..ee0fa01 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit 687c0ca751747ebe498c183da1a3ee3119d57932 +Subproject commit ee0fa01ab74b6bf27bed3c7bdb9d6fb789963342 diff --git a/makefile b/makefile index 8176882..4d81700 100644 --- a/makefile +++ b/makefile @@ -11,14 +11,18 @@ LIB_SRC := \ $(shell find inifiled/source/ -name "*.d")\ $(shell find libdparse/src/std/experimental/ -name "*.d")\ $(shell find libdparse/src/dparse/ -name "*.d")\ - $(shell find libddoc/src -name "*.d") + $(shell find libddoc/src -name "*.d") \ + $(shell find stdx-allocator/source -name "*.d") PROJECT_SRC := $(shell find src/ -name "*.d") SRC := $(LIB_SRC) $(PROJECT_SRC) INCLUDE_PATHS = \ - -Iinifiled/source -Isrc\ - -Ilibdparse/src\ - -Idsymbol/src -Icontainers/src\ - -Ilibddoc/src + -Isrc \ + -Iinifiled/source \ + -Ilibdparse/src \ + -Idsymbol/src \ + -Icontainers/src \ + -Ilibddoc/src \ + -Istdx-allocator/source VERSIONS = DEBUG_VERSIONS = -version=dparse_verbose DMD_FLAGS = -w -inline -release -O -J. -od${OBJ_DIR} -version=StdLoggerDisableWarning -fPIC diff --git a/src/analysis/helpers.d b/src/analysis/helpers.d index 390c7b2..f379118 100644 --- a/src/analysis/helpers.d +++ b/src/analysis/helpers.d @@ -16,8 +16,8 @@ import dsymbol.modulecache : ModuleCache; import analysis.config; import analysis.run; import analysis.base; -import std.experimental.allocator.mallocator; -import std.experimental.allocator; +import stdx.allocator.mallocator; +import stdx.allocator; S between(S)(S value, S before, S after) if (isSomeString!S) { @@ -50,7 +50,6 @@ void assertAnalyzerWarnings(string code, const StaticAnalysisConfig config, { import analysis.run : parseModule; import dparse.lexer : StringCache, Token; - import std.ascii : newline; StringCache cache = StringCache(StringCache.defaultBucketCount); RollbackAllocator r; @@ -61,7 +60,7 @@ void assertAnalyzerWarnings(string code, const StaticAnalysisConfig config, // Run the code and get any warnings MessageSet rawWarnings = analyze("test", m, config, moduleCache, tokens); - string[] codeLines = code.split(newline); + string[] codeLines = code.splitLines(); // Get the warnings ordered by line string[size_t] warnings; diff --git a/src/analysis/run.d b/src/analysis/run.d index 3079e17..b3f13d6 100644 --- a/src/analysis/run.d +++ b/src/analysis/run.d @@ -18,10 +18,10 @@ import dparse.ast; import dparse.rollback_allocator; import std.typecons : scoped; -import std.experimental.allocator : CAllocatorImpl; -import std.experimental.allocator.mallocator : Mallocator; -import std.experimental.allocator.building_blocks.region : Region; -import std.experimental.allocator.building_blocks.allocator_list : AllocatorList; +import stdx.allocator : CAllocatorImpl; +import stdx.allocator.mallocator : Mallocator; +import stdx.allocator.building_blocks.region : Region; +import stdx.allocator.building_blocks.allocator_list : AllocatorList; import analysis.config; import analysis.base; diff --git a/stdx-allocator b/stdx-allocator new file mode 160000 index 0000000..7487970 --- /dev/null +++ b/stdx-allocator @@ -0,0 +1 @@ +Subproject commit 7487970b58f4a2c0d495679329a8a2857111f3fd