Re: Allows the use of part of the language keywords?

2016-08-29 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Sunday, 28 August 2016 at 13:35:59 UTC, ketmar wrote: it has nothing to do with compiler: parser skips comments when peeking tokens. the only thing affected is simplistic syntax highlighter that can't do proper lookup. I have anyway never seen the necessity of the keyword "body" anyway. I

Re: Allows the use of part of the language keywords?

2016-08-28 Thread ketmar via Digitalmars-d
On Sunday, 28 August 2016 at 13:26:26 UTC, Chris Wright wrote: On Sun, 28 Aug 2016 08:35:06 +, ketmar wrote: i have a perfect solution to this: don't write such code! It would reflect poorly on the compiler if it failed to compile something simply because you added a few comments.

Re: Allows the use of part of the language keywords?

2016-08-28 Thread Chris Wright via Digitalmars-d
On Sun, 28 Aug 2016 08:35:06 +, ketmar wrote: > i have a perfect solution to this: don't write such code! It would reflect poorly on the compiler if it failed to compile something simply because you added a few comments. Especially since each C-style comment is likely its own token. A

Re: Allows the use of part of the language keywords?

2016-08-28 Thread Cauterite via Digitalmars-d
On Sunday, 28 August 2016 at 08:25:38 UTC, Basile B. wrote: to think that it can be detected with a simple lookup backward (or forward from the KW) is too simplistic. I'm not saying it'd necessarily be easy to distinguish keyword 'body' from identifier 'body' in the lexer, I'm just saying a

Re: Allows the use of part of the language keywords?

2016-08-28 Thread ketmar via Digitalmars-d
On Sunday, 28 August 2016 at 08:25:38 UTC, Basile B. wrote: On Sunday, 28 August 2016 at 08:07:27 UTC, Cauterite wrote: On Sunday, 28 August 2016 at 04:32:46 UTC, Basile B. wrote: You must keep track of the previous token, which is not usually done in a scanner. That sounds like a pretty

Re: Allows the use of part of the language keywords?

2016-08-28 Thread Basile B. via Digitalmars-d
On Sunday, 28 August 2016 at 08:07:27 UTC, Cauterite wrote: On Sunday, 28 August 2016 at 04:32:46 UTC, Basile B. wrote: You must keep track of the previous token, which is not usually done in a scanner. That sounds like a pretty trivial feature to me. There's no way that's a legitimate

Re: Allows the use of part of the language keywords?

2016-08-28 Thread Cauterite via Digitalmars-d
On Sunday, 28 August 2016 at 04:32:46 UTC, Basile B. wrote: You must keep track of the previous token, which is not usually done in a scanner. That sounds like a pretty trivial feature to me. There's no way that's a legitimate obstacle.

Re: Allows the use of part of the language keywords?

2016-08-27 Thread ketmar via Digitalmars-d
On Sunday, 28 August 2016 at 04:32:46 UTC, Basile B. wrote: sorry, i cannot find where exactly i was asked about workaround for "stolen body" case. maybe it's 'cause i DIDN'T ASKED FOR WORKAROUND?

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Chris Wright via Digitalmars-d
On Sun, 28 Aug 2016 04:32:46 +, Basile B. wrote: > Once again, the D style says to add a "_" after the keyword. If it's a > problem with the reflection it's also easy to check if an identifier > ends with "_" and then to remove it. Or use UDAs, which would be more general.

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Walter Bright via Digitalmars-d
On 8/27/2016 7:35 PM, ketmar wrote: getting our precious `body` back will be invaluable! You are not of the body! https://www.youtube.com/watch?v=m48xii7ndcg

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Basile B. via Digitalmars-d
On Sunday, 28 August 2016 at 02:35:57 UTC, ketmar wrote: On Saturday, 27 August 2016 at 20:45:56 UTC, Meta wrote: On Saturday, 27 August 2016 at 19:21:52 UTC, Walter Bright wrote: It also: 1. mucks with the usability of syntax highlighting, which is often based merely on tokens. 2. makes it

Re: Allows the use of part of the language keywords?

2016-08-27 Thread ketmar via Digitalmars-d
On Saturday, 27 August 2016 at 20:45:56 UTC, Meta wrote: On Saturday, 27 August 2016 at 19:21:52 UTC, Walter Bright wrote: It also: 1. mucks with the usability of syntax highlighting, which is often based merely on tokens. 2. makes it potentially much more difficult to add features to the

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Meta via Digitalmars-d
On Saturday, 27 August 2016 at 19:21:52 UTC, Walter Bright wrote: It also: 1. mucks with the usability of syntax highlighting, which is often based merely on tokens. 2. makes it potentially much more difficult to add features to the language, which is often done by finding new uses for the

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Walter Bright via Digitalmars-d
On 8/27/2016 6:36 AM, ZombineDev wrote: As Timon said, this won't make the grammar context dependent. Also, C# has the concept of contextual keywords. Such keywords have special meaning in certain contexts but are otherwise available for use as identifiers. C# also allows to use normal keywords

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Walter Bright via Digitalmars-d
On 8/27/2016 6:01 AM, Timon Gehr wrote: then not-entirely-trivial disambiguation has to be added to the parser. There's no ambiguity for the example in the OP though. It also: 1. mucks with the usability of syntax highlighting, which is often based merely on tokens. 2. makes it potentially

Re: Allows the use of part of the language keywords?

2016-08-27 Thread ZombineDev via Digitalmars-d
On Friday, 26 August 2016 at 18:58:25 UTC, Jonathan M Davis wrote: On Friday, August 26, 2016 17:59:39 Cauterite via Digitalmars-d wrote: On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: > package application.module.user.model; I get "Error: identifier expected following '.' instead of

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Timon Gehr via Digitalmars-d
On 26.08.2016 20:58, Jonathan M Davis via Digitalmars-d wrote: On Friday, August 26, 2016 17:59:39 Cauterite via Digitalmars-d wrote: On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: package application.module.user.model; I get "Error: identifier expected following '.' instead of

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Mike Parker via Digitalmars-d
On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: PS: editor don't support markdown or bbcode?- - See this: http://dlang.org/blog/2016/06/10/core-team-update-vladimir-panteleev/

Re: Allows the use of part of the language keywords?

2016-08-27 Thread Basile B. via Digitalmars-d
On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: Allows the use of part of the language keywords, example: [code] sturct module { // TODO } [code] The D style as used in phobos says that you must add a "_" at the end of the keyword that you wish to use as identifier. When the

Re: Allows the use of part of the language keywords?

2016-08-26 Thread Ali Çehreli via Digitalmars-d
On 08/26/2016 11:58 AM, Jonathan M Davis via Digitalmars-d wrote: On Friday, August 26, 2016 17:59:39 Cauterite via Digitalmars-d wrote: On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: package application.module.user.model; I get "Error: identifier expected following '.' instead of

Re: Allows the use of part of the language keywords?

2016-08-26 Thread Jonathan M Davis via Digitalmars-d
On Friday, August 26, 2016 17:59:39 Cauterite via Digitalmars-d wrote: > On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: > > package application.module.user.model; > > I get "Error: identifier expected following '.' instead of > 'module'" > So I'm not sure how that compiles for you. I

Re: Allows the use of part of the language keywords?

2016-08-26 Thread Cauterite via Digitalmars-d
On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: package application.module.user.model; I get "Error: identifier expected following '.' instead of 'module'" So I'm not sure how that compiles for you.

Allows the use of part of the language keywords?

2016-08-26 Thread Brian via Digitalmars-d
Allows the use of part of the language keywords, example: ```D package application.module.user.model; class User { // TODO } ``` [code] sturct module { // TODO } [code] PS: editor don't support markdown or bbcode?- -