-
-
Notifications
You must be signed in to change notification settings - Fork 685
Fix issue 17392 - Add Dub file for the lexer and parser #6771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name "dmd" | ||
| description "The DMD compiler" | ||
| authors "Walter Bright" | ||
| copyright "Copyright © 1999-2017, Digital Mars" | ||
| license "BSL-1.0" | ||
|
|
||
| targetType "none" | ||
| dependency ":parser" version="*" | ||
|
|
||
| subPackage { | ||
| name "root" | ||
| targetType "library" | ||
| sourcePaths "src/ddmd/root" | ||
| } | ||
|
|
||
| subPackage { | ||
| name "lexer" | ||
| targetType "library" | ||
| sourcePaths | ||
|
|
||
| sourceFiles \ | ||
| "src/ddmd/console.d" \ | ||
| "src/ddmd/entity.d" \ | ||
| "src/ddmd/errors.d" \ | ||
| "src/ddmd/globals.d" \ | ||
| "src/ddmd/id.d" \ | ||
| "src/ddmd/identifier.d" \ | ||
| "src/ddmd/lexer.d" \ | ||
| "src/ddmd/tokens.d" \ | ||
| "src/ddmd/utf.d" | ||
|
|
||
| // stringImportPaths cannot be used because it will make Dub extremely slow | ||
| // https://github.com/dlang/dub/issues/1199 | ||
| dflags "-J$PACKAGE_DIR" | ||
|
|
||
| dependency "dmd:root" version="*" | ||
| } | ||
|
|
||
| subPackage { | ||
| name "parser" | ||
| targetType "library" | ||
| sourcePaths | ||
|
|
||
| sourceFiles \ | ||
| "src/ddmd/astbase.d" \ | ||
| "src/ddmd/astbasevisitor.d" \ | ||
| "src/ddmd/parse.d" | ||
|
|
||
| dependency "dmd:lexer" version="*" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .dub | ||
| docs.json | ||
| __dummy.html | ||
| *.o | ||
| *.obj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| name "dmd-dub-test" | ||
| description "Test of the DMD Dub package" | ||
| license "BSL 1.0" | ||
|
|
||
| dependency "dmd" path="../../" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // The tests in this module are highlevel and mostly indented to make sure all | ||
| // necessary modules are included in the Dub package. | ||
|
|
||
| void main() | ||
| { | ||
| } | ||
|
|
||
| // lexer | ||
| unittest | ||
| { | ||
| import ddmd.lexer; | ||
| import ddmd.tokens; | ||
|
|
||
| immutable expected = [ | ||
| TOKvoid, | ||
| TOKidentifier, | ||
| TOKlparen, | ||
| TOKrparen, | ||
| TOKlcurly, | ||
| TOKrcurly | ||
| ]; | ||
|
|
||
| immutable sourceCode = "void test() {} // foobar"; | ||
| scope lexer = new Lexer("test", sourceCode.ptr, 0, sourceCode.length, 0, 0); | ||
| lexer.nextToken; | ||
|
|
||
| TOK[] result; | ||
|
|
||
| do | ||
| { | ||
| result ~= lexer.token.value; | ||
| } while (lexer.nextToken != TOKeof); | ||
|
|
||
| assert(result == expected); | ||
| } | ||
|
|
||
| // parser | ||
| unittest | ||
| { | ||
| import ddmd.astbase; | ||
| import ddmd.parse; | ||
|
|
||
| scope parser = new Parser!ASTBase(null, null, false); | ||
| assert(parser !is null); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have been D Language Foundation ;-)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not what the rest of the source files say 😉.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, probably it was simply forgotten to update them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @WalterBright @andralex - can we replace/update the copyright notice from Digital Mars to D Language Foundation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with it. @WalterBright ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> #7004