chore(deps): add dmd library
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
parent
2ea6c43a66
commit
34174badd0
|
@ -7,3 +7,6 @@
|
||||||
[submodule "d-test-utils"]
|
[submodule "d-test-utils"]
|
||||||
path = d-test-utils
|
path = d-test-utils
|
||||||
url = https://github.com/dlang-community/d-test-utils.git
|
url = https://github.com/dlang-community/d-test-utils.git
|
||||||
|
[submodule "dmd"]
|
||||||
|
path = dmd
|
||||||
|
url = https://github.com/dlang/dmd.git
|
||||||
|
|
10
README.md
10
README.md
|
@ -16,9 +16,9 @@ when using the **--inplace** option.
|
||||||
|
|
||||||
### Building from source using Make
|
### Building from source using Make
|
||||||
* Clone the repository
|
* Clone the repository
|
||||||
* Run ```git submodule update --init --recursive``` in the dfmt directory
|
* Run `git submodule update --init --recursive` in the dfmt directory
|
||||||
* To compile with DMD, run ```make``` in the dfmt directory. To compile with
|
* To compile with DMD, run `make` in the dfmt directory. To compile with
|
||||||
LDC, run ```make ldc``` instead. The generated binary will be placed in ```dfmt/bin/```.
|
LDC, run `make ldc` instead. The generated binary will be placed in `dfmt/bin/`.
|
||||||
|
|
||||||
### Building from source using dub
|
### Building from source using dub
|
||||||
* Clone the repository
|
* Clone the repository
|
||||||
|
@ -69,8 +69,8 @@ dfmt --inplace --space_after_cast=false --max_line_length=80 \
|
||||||
```
|
```
|
||||||
|
|
||||||
## Disabling formatting
|
## Disabling formatting
|
||||||
Formatting can be temporarily disabled by placing the comments ```// dfmt off```
|
Formatting can be temporarily disabled by placing the comments `// dfmt off`
|
||||||
and ```// dfmt on``` around code that you do not want formatted.
|
and `// dfmt on` around code that you do not want formatted.
|
||||||
|
|
||||||
```d
|
```d
|
||||||
void main(string[] args)
|
void main(string[] args)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit b859107c37a948d0492fccb7a319f0a96b0eecb1
|
3
dub.json
3
dub.json
|
@ -4,7 +4,8 @@
|
||||||
"targetType": "autodetect",
|
"targetType": "autodetect",
|
||||||
"license": "BSL-1.0",
|
"license": "BSL-1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libdparse": ">=0.19.2 <1.0.0"
|
"libdparse": ">=0.19.2 <1.0.0",
|
||||||
|
"dmd": "~>2.105.2"
|
||||||
},
|
},
|
||||||
"targetPath" : "bin/",
|
"targetPath" : "bin/",
|
||||||
"targetName" : "dfmt",
|
"targetName" : "dfmt",
|
||||||
|
|
36
makefile
36
makefile
|
@ -1,8 +1,36 @@
|
||||||
|
DMD_ROOT_SRC := \
|
||||||
|
$(shell find dmd/compiler/src/dmd/common -name "*.d")\
|
||||||
|
$(shell find dmd/compiler/src/dmd/root -name "*.d")
|
||||||
|
DMD_LEXER_SRC := \
|
||||||
|
dmd/compiler/src/dmd/console.d \
|
||||||
|
dmd/compiler/src/dmd/entity.d \
|
||||||
|
dmd/compiler/src/dmd/errors.d \
|
||||||
|
dmd/compiler/src/dmd/errorsink.d \
|
||||||
|
dmd/compiler/src/dmd/location.d \
|
||||||
|
dmd/compiler/src/dmd/file_manager.d \
|
||||||
|
dmd/compiler/src/dmd/globals.d \
|
||||||
|
dmd/compiler/src/dmd/id.d \
|
||||||
|
dmd/compiler/src/dmd/identifier.d \
|
||||||
|
dmd/compiler/src/dmd/lexer.d \
|
||||||
|
dmd/compiler/src/dmd/tokens.d \
|
||||||
|
dmd/compiler/src/dmd/utils.d \
|
||||||
|
$(DMD_ROOT_SRC)
|
||||||
|
|
||||||
|
DMD_PARSER_SRC := \
|
||||||
|
dmd/compiler/src/dmd/astbase.d \
|
||||||
|
dmd/compiler/src/dmd/parse.d \
|
||||||
|
dmd/compiler/src/dmd/parsetimevisitor.d \
|
||||||
|
dmd/compiler/src/dmd/transitivevisitor.d \
|
||||||
|
dmd/compiler/src/dmd/permissivevisitor.d \
|
||||||
|
dmd/compiler/src/dmd/strictvisitor.d \
|
||||||
|
dmd/compiler/src/dmd/astenums.d \
|
||||||
|
$(DMD_LEXER_SRC)
|
||||||
|
|
||||||
SRC := $(shell find src -name "*.d") \
|
SRC := $(shell find src -name "*.d") \
|
||||||
$(shell find libdparse/src -name "*.d") \
|
$(shell find stdx-allocator/source -name "*.d") \
|
||||||
$(shell find stdx-allocator/source -name "*.d")
|
$(DMD_PARSER_SRC)
|
||||||
INCLUDE_PATHS := -Ilibdparse/src -Istdx-allocator/source -Isrc -Jbin
|
INCLUDE_PATHS := -Ilibdparse/src -Istdx-allocator/source -Isrc -Idmd/compiler/src -Jbin -Jdmd
|
||||||
DMD_COMMON_FLAGS := -dip25 -w $(INCLUDE_PATHS)
|
DMD_COMMON_FLAGS := -w $(INCLUDE_PATHS)
|
||||||
DMD_DEBUG_FLAGS := -debug -g $(DMD_COMMON_FLAGS)
|
DMD_DEBUG_FLAGS := -debug -g $(DMD_COMMON_FLAGS)
|
||||||
DMD_FLAGS := -O -inline $(DMD_COMMON_FLAGS)
|
DMD_FLAGS := -O -inline $(DMD_COMMON_FLAGS)
|
||||||
DMD_TEST_FLAGS := -unittest -g $(DMD_COMMON_FLAGS)
|
DMD_TEST_FLAGS := -unittest -g $(DMD_COMMON_FLAGS)
|
||||||
|
|
Loading…
Reference in New Issue