AST like coding syntax. Easy upgrade!

cym13 via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 6 16:38:50 PDT 2015


On Sunday, 6 September 2015 at 23:00:21 UTC, bitwise wrote:
> On Sunday, 6 September 2015 at 22:37:16 UTC, cym13 wrote:
>> On Sunday, 6 September 2015 at 21:16:18 UTC, Prudence wrote:
>>>[...]
>>
>> There already is a kind of "code string":
>>
>>     interpret(q{
>>          var a = 2;
>>          var b += a;
>>     });
>>
>> It doesn't do any kind of syntax check, but there again how do 
>> you want to have syntax check for any language? The D compiler 
>> is a D compiler, it can't support js syntax or whatever.
>
> Many IDEs support multiple languages and can infer language 
> automatically by syntax. It's probably much more difficult than 
> it seems, but I suppose one of these IDEs could be made to 
> parse and infer D token strings separately.

Sure, but the support for that will be an external tool, it 
doesn't have anything to do in the D compiler. q{} strings are 
meant to be seen specially by editors, they won't highlight them 
the same way for example, it is then the editor's job to detect 
other languages if it wants to. D has done his job in the matter.


More information about the Digitalmars-d mailing list