Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
200 stars 48 forks source link

scope attribute for foreach parameters #262

Closed gdamore closed 1 year ago

gdamore commented 1 year ago

The following syntax results in an error in LSP..

foreach(scope string key, scope Node value; nmap2)

The error message is "Basic type, type constructor, symbol, typeof, __traits, __vector or mixin expected"

This syntax is perfectly legal, and occurs in the dub source code. Furthermore, it is documented as legal as "scope" is one of the "ForeachTypeAttributes".

I suspect libdparse does not understand this -- I ran into this in my own grammar, probably because I was borrowing the libdparse grammar.

WebFreak001 commented 1 year ago

(will be a few weeks until it's inside serve-d though)