<div dir="ltr">On Tue, Nov 5, 2013 at 5:42 PM, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">While thinking on a new string literal that may support DSL's, the syntax should optionally receive a language specification on opening.<div>The thing that sucks most about DSL's is that the IDE can't syntax hilight them, but if it was provided what language the string was, then a smart IDE could apply syntax hilighting for that language within the scring scope.</div>

<div>Eg, this sort of thing is supported in html, which is usually hilighted correctly by IDE's:</div><div>  <script type="text/javascript"> or <script language="javascript"></div><div>

<br></div><div>And exists in many other places too.</div></div></blockquote><div><br></div><div>I agree. For that suggest the following syntax (independent of this proposal):<br></div><div><br></div><div>That is, support UDA for expressions.</div>
<div><br></div><div>----</div><div><div>void main(){</div><div>  import std.conv:text;</div><div><br></div><div>  int var=12;</div><div><br></div><div>  @("syntax=python")</div><div>  r{</div><div>    def fun:</div>
<div>      print(@var) #will expand to tuple element 12</div><div>      print(@(<a href="http://var.to">var.to</a>!string)) #will expand to tuple element "12"</div><div><br></div><div>    }</div><div>   .text</div>
<div>   .run_python;</div><div><br></div><div>  void run_python(string a){</div><div>    import std.system;</div><div>    system("python -c "~a.escapeShellFileName);</div><div>  }</div><div>}</div></div><div><div>
----</div><div></div></div><div><br></div><div> </div></div></div></div>