Skip to content
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

[D] Syntax Improvements #1850

Merged
merged 108 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
162671c
Fix D doc comments
BenjaminSchaaf Jan 16, 2019
23299b9
Fix spacing in D snippets
BenjaminSchaaf Jan 16, 2019
972c2da
Add rdmd to build system for running a single file immediately
BenjaminSchaaf Jan 16, 2019
9f746a4
Implement proper literal parsing for strings and numbers; fix nested …
BenjaminSchaaf Jan 16, 2019
61f9c41
Fix module declaration parsing
BenjaminSchaaf Jan 16, 2019
f5326d5
Fix attribute parsing with support for UDAs
BenjaminSchaaf Jan 17, 2019
f04ef62
Implement shebang parsing and module validation
BenjaminSchaaf Jan 17, 2019
3eccd67
Implement proper import parsing
BenjaminSchaaf Jan 17, 2019
2caa34b
Rudimentary reimplementation of function and variable parsing
BenjaminSchaaf Jan 17, 2019
2b6488a
Rename all contexts to match usage
BenjaminSchaaf Jan 18, 2019
e02d1c2
Implement alias parsing
BenjaminSchaaf Jan 18, 2019
0563c54
Implement validation-less token parsing for token strings
BenjaminSchaaf Jan 18, 2019
561fb1f
Implement non-templated aggregate parsing
BenjaminSchaaf Jan 18, 2019
cd763de
Implement enum parsing
BenjaminSchaaf Jan 18, 2019
c4ceaf6
Implement conditional declaration parsing
BenjaminSchaaf Jan 18, 2019
a506b68
Implement static foreach parsing
BenjaminSchaaf Jan 18, 2019
8478fbf
Implement static assert
BenjaminSchaaf Jan 18, 2019
d7c9368
Implement constructor parsing
BenjaminSchaaf Jan 18, 2019
79a6bb3
Fix meta_scope for token strings
BenjaminSchaaf Jan 18, 2019
7d2ecc8
Add function parsing tests
BenjaminSchaaf Jan 18, 2019
67d2413
Implement invariant parsing
BenjaminSchaaf Jan 18, 2019
551cb3c
Make comment inclusion implicit with prototype
BenjaminSchaaf Jan 18, 2019
2bc8445
Implement unittest parsing
BenjaminSchaaf Jan 18, 2019
af536c0
Implement special case alias this parsing
BenjaminSchaaf Jan 18, 2019
c243559
Implement version and debug spec parsing
BenjaminSchaaf Jan 19, 2019
e546000
Implement template and mixin parsing
BenjaminSchaaf Jan 19, 2019
aa78501
Fix static if else block not allowing an else static if
BenjaminSchaaf Jan 19, 2019
0ce5bc6
Bit of a refactor and add parsing for conditionals, loops and other f…
BenjaminSchaaf Jan 20, 2019
ed980b1
Implement with, synchronized, try/catch/finally, throw and scope stat…
BenjaminSchaaf Jan 20, 2019
4ed36e0
Implement asm statement
BenjaminSchaaf Jan 20, 2019
e2a6af7
Fix tests
BenjaminSchaaf Jan 21, 2019
81a86f5
Reimplement number parsing, fixing any inconsistencies
BenjaminSchaaf Jan 21, 2019
2fb7412
Implement aggregate template parsing
BenjaminSchaaf Jan 21, 2019
35ba040
Fix doc comment ligatures
BenjaminSchaaf Jan 21, 2019
303472f
Implement initial proper value parsing with heavy validation
BenjaminSchaaf Jan 22, 2019
d502658
Fix some expression and type parsing inconsistencies
BenjaminSchaaf Jan 22, 2019
97aba5f
Fix more minor inconsistencies and implement switch parsing
BenjaminSchaaf Jan 22, 2019
66a10aa
Implement typeof parsing
BenjaminSchaaf Jan 22, 2019
1b47eb1
Fix some more edge cases
BenjaminSchaaf Jan 22, 2019
37dfe2c
Fix typeof(return)
BenjaminSchaaf Jan 22, 2019
c3e956e
Initial lambda parsing implementation
BenjaminSchaaf Jan 22, 2019
0498955
Fix auto declarations
BenjaminSchaaf Jan 22, 2019
b1459ae
Implement parsing of single enum assignments and template constraints
BenjaminSchaaf Jan 22, 2019
553c4e0
Properly implement lambda parsing
BenjaminSchaaf Jan 22, 2019
8a25a0e
Fix some more small inconsistencies
BenjaminSchaaf Jan 22, 2019
e96ecc5
Implement function type parsing and fix small inconsistencies
BenjaminSchaaf Jan 22, 2019
b487bd2
Implement __traits parsing and fix small inconsistency with debug
BenjaminSchaaf Jan 22, 2019
1c4e621
Fix some remaining inconsistencies
BenjaminSchaaf Jan 23, 2019
cc32808
Fix some more inconsistencies
BenjaminSchaaf Jan 23, 2019
7792a51
Fix *= not being parsed correctly
BenjaminSchaaf Jan 23, 2019
b29a9d0
Implement function contract parsing
BenjaminSchaaf Jan 23, 2019
2f83a67
Fixed remaining inconsistencies again
BenjaminSchaaf Jan 23, 2019
af294cb
Fix some function/delegate inconsistencies
BenjaminSchaaf Jan 23, 2019
ef5bcae
Some remaining small fixes
BenjaminSchaaf Jan 23, 2019
6ffd4a7
Rework tmPreferences for D
BenjaminSchaaf Jan 23, 2019
de44796
Improve sublime-build files for D
BenjaminSchaaf Jan 23, 2019
19e5576
Fix destructor with attributes not being parsed correctly
BenjaminSchaaf Jan 23, 2019
6c2cc4f
Add DMD output parsing for building system
BenjaminSchaaf Jan 23, 2019
8cae9fa
Fix main snippets
BenjaminSchaaf Jan 23, 2019
51ebb72
Fix out contracts not being parsed correctly
BenjaminSchaaf Jan 23, 2019
edf762f
Add back old tests, fixing matches where required
BenjaminSchaaf Jan 23, 2019
f049ab7
Fix not all entities being included in symbol list
BenjaminSchaaf Jan 24, 2019
0290235
Replace `[^\s]` with `\S`
BenjaminSchaaf Jan 26, 2019
c7a789e
Replace `(?=.)` with ''
BenjaminSchaaf Jan 26, 2019
78effb9
Add meta.namespace scope for files declaring a module name
BenjaminSchaaf Jan 26, 2019
8b65012
Improve shebang handling
BenjaminSchaaf Jan 26, 2019
475a8a8
s/keyword.control.module.d/keyword.declaration.module.d/g
BenjaminSchaaf Jan 26, 2019
e8b230d
Clean up parser a little
BenjaminSchaaf Jan 26, 2019
a1934d0
Fix indentation and improve spacing
BenjaminSchaaf Feb 3, 2019
346b883
Change storage.modifier to punctuation.definition.numeric for binary …
BenjaminSchaaf Feb 5, 2019
8464f4a
Make loop keywords use keyword.control.loop.d
BenjaminSchaaf Feb 5, 2019
7de31ea
Change try/catch/finally/throw keywords to use exception scope
BenjaminSchaaf Feb 5, 2019
d7b705b
Fix brackets/parens confusion
BenjaminSchaaf Feb 5, 2019
2416707
Replace shebang single regex with a simple context
BenjaminSchaaf Feb 11, 2019
90d9fa0
Improve buile files and DMD output highlighting
BenjaminSchaaf Feb 18, 2019
421ea67
Clean up tmPreferences
BenjaminSchaaf Feb 18, 2019
1d9382d
Rework start of file parsing, including modules and shebangs. Also fi…
BenjaminSchaaf Feb 18, 2019
3767a04
Rename keyword.declaration.module to keyword.declaration.namespace
BenjaminSchaaf Feb 18, 2019
8f3565e
Fix number literal scopes
BenjaminSchaaf Feb 18, 2019
a75da79
Add proper identifier parsing and fix assert not being handled as a k…
BenjaminSchaaf Feb 19, 2019
f7d82f3
Fix variadic and slice scopes
BenjaminSchaaf Feb 19, 2019
e071f6e
Add keyword.declaration scopes to storage type declarations
BenjaminSchaaf Feb 19, 2019
d24d133
Fix switch ':' scope
BenjaminSchaaf Feb 19, 2019
ba37b44
Improve tests
BenjaminSchaaf Feb 19, 2019
06f7d69
Fix annotation parens scopes
BenjaminSchaaf Feb 19, 2019
3bae0ff
Fix import expression scope
BenjaminSchaaf Feb 19, 2019
0354835
Improve type specialization scopes
BenjaminSchaaf Feb 19, 2019
d776db5
Remove dead code
BenjaminSchaaf Feb 19, 2019
69a591b
Add meta.namespace to the module declaration
BenjaminSchaaf Feb 25, 2019
dbb212f
Add meta.string.d scope to strings and highlight string prefixes spec…
BenjaminSchaaf Feb 26, 2019
c6891c0
Add meta.function scopes for functions
BenjaminSchaaf Feb 26, 2019
7c3c130
Add meta.function scopes for lambdas
BenjaminSchaaf Feb 26, 2019
00a3967
Fix lambda operator scope
BenjaminSchaaf Feb 26, 2019
ea7f25c
Add function call meta scopes
BenjaminSchaaf Feb 26, 2019
76534e3
Fix line comment not including newlines
BenjaminSchaaf Feb 26, 2019
fe30031
Add class meta scope
BenjaminSchaaf Feb 26, 2019
bb450a1
Add interface, struct, union and enum meta scopes
BenjaminSchaaf Feb 26, 2019
c7a4857
Add meta.path to identifiers
BenjaminSchaaf Feb 26, 2019
43f8ebe
Fix ternary scope
BenjaminSchaaf Feb 27, 2019
2819f1d
Fix scope of `:` when used for comparison
BenjaminSchaaf Feb 27, 2019
4d168e8
Fix tests
BenjaminSchaaf Feb 27, 2019
141373d
Fix operator overloads being highlighted as keywords instead of entities
BenjaminSchaaf Feb 27, 2019
012b2e2
Fix scope for builtin at-attributes
BenjaminSchaaf Feb 27, 2019
06d1a44
Fix single value template arguments not popping
BenjaminSchaaf Feb 27, 2019
8b09acf
Fix switch with not working
BenjaminSchaaf Feb 27, 2019
8d63290
Add special case for `new` instances of classes using variable.function
BenjaminSchaaf Feb 27, 2019
8b359df
Fix concatenation operator scope
BenjaminSchaaf Feb 27, 2019
95c77fe
Fix template call operator scope
BenjaminSchaaf Feb 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 69 additions & 9 deletions D/Comments.tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>/*</string>
<string>//</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END</string>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>*/</string>
<string>/*</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_MODE</string>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string>block</string>
<string>*/</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_DISABLE_INDENT</string>
<string>TM_COMMENT_MODE_2</string>
<key>value</key>
<string>yes</string>
<string>block</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<string>TM_COMMENT_DISABLE_INDENT_2</string>
<key>value</key>
<string>//</string>
<string>yes</string>
</dict>
<dict>
<key>name</key>
Expand All @@ -57,6 +57,66 @@
<key>value</key>
<string>block</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_DISABLE_INDENT_3</string>
<key>value</key>
<string>yes</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_4</string>
<key>value</key>
<string>///</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_5</string>
<key>value</key>
<string>/**</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_5</string>
<key>value</key>
<string>*/</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_MODE_5</string>
<key>value</key>
<string>block</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_DISABLE_INDENT_5</string>
<key>value</key>
<string>yes</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_6</string>
<key>value</key>
<string>/++</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_6</string>
<key>value</key>
<string>+/</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_MODE_6</string>
<key>value</key>
<string>block</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_DISABLE_INDENT_6</string>
<key>value</key>
<string>yes</string>
</dict>
</array>
</dict>
</dict>
Expand Down
12 changes: 12 additions & 0 deletions D/Completion Rules.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.d</string>
<key>settings</key>
<dict>
<key>cancelCompletion</key>
<string>^\s*(\}?\s*(else|try|do|finally|synchonized|struct|union|unittest|debug)|(class|struct|interface|union)\s*[a-zA-Z_0-9]+*)$</string>
</dict>
</dict>
</plist>
13 changes: 13 additions & 0 deletions D/D Single File.sublime-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"shell_cmd": "dmd $file",
BenjaminSchaaf marked this conversation as resolved.
Show resolved Hide resolved
"file_regex": "^(.*?)\\(([0-9]+)(,[0-9]+)?\\)",
"selector": "source.d",

"variants":
[
{
"name": "Run",
"shell_cmd": "rdmd $file",
BenjaminSchaaf marked this conversation as resolved.
Show resolved Hide resolved
}
]
}
8 changes: 8 additions & 0 deletions D/D dub.sublime-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"shell_cmd": "dub build",
BenjaminSchaaf marked this conversation as resolved.
Show resolved Hide resolved
"file_regex": "^(.*?)\\(([0-9]+)(,[0-9]+)?\\)",
"working_dir": "${folder:${project_path:${file_path}}}",
"selector": "source.d",
"syntax": "Packages/D/DMD Output.sublime-syntax",
"keyfiles": ["dub.sdl", "dub.json"],
}
5 changes: 0 additions & 5 deletions D/D.sublime-build

This file was deleted.

Loading