Florian Bösch (2014-03-07T07:56:09.000Z)
On Fri, Mar 7, 2014 at 8:36 AM, Claude Pache <claude.pache at gmail.com> wrote:

> We precisely discussed templates on es-discuss tonight. If I believe what
> I just read on [1], you will be able to write:
>
Ah cool, sorry :)

A follow up question on that has to do with line number/column.

If you're doing things like this in say myfile.js (line numbers leading)

01: compileShader('''essl
02:  void main(){
03:    gl_FragColor = vec3(1.0); // would be an error
04:  }
05: ''');

Then the function that gets such a string would very much like to say
something like:

Error in GLSL File: myfile.js, Line: 3
...

There's two complications with that. A string doesn't carry the line number
it comes from. Also, myfile.js might get concated with other files. And
lastly strings might get pasted together from smaller snippets.

The solution to this issue I'm using at the moment translates things like
that to:

compileShader('''#line 1 file myfile.js
#line 2 myfile.js
  void main(){
#line 3 myfile.js
    gl_FragColor = vec3(1.0); // would be an error
#line 4 myfile.js
  }
#line 5 myfile.js
''');

I'm wondering if there's interest to address this issue within ES? I'm also
wondering if Multiline strings are the right tool to address them?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140307/a5145b06/attachment-0001.html>
domenic at domenicdenicola.com (2014-03-20T16:22:43.616Z)
On Fri, Mar 7, 2014 at 8:36 AM, Claude Pache <claude.pache at gmail.com> wrote:

> We precisely discussed templates on es-discuss tonight. If I believe what
> I just read on [1], you will be able to write:

Ah cool, sorry :)

A follow up question on that has to do with line number/column.

If you're doing things like this in say myfile.js (line numbers leading)

```
01: compileShader('''essl
02:  void main(){
03:    gl_FragColor = vec3(1.0); // would be an error
04:  }
05: ''');
```

Then the function that gets such a string would very much like to say
something like:

```
Error in GLSL File: myfile.js, Line: 3
...
```

There's two complications with that. A string doesn't carry the line number
it comes from. Also, myfile.js might get concated with other files. And
lastly strings might get pasted together from smaller snippets.

The solution to this issue I'm using at the moment translates things like
that to:

```
compileShader('''#line 1 file myfile.js
#line 2 myfile.js
  void main(){
#line 3 myfile.js
    gl_FragColor = vec3(1.0); // would be an error
#line 4 myfile.js
  }
#line 5 myfile.js
''');
```

I'm wondering if there's interest to address this issue within ES? I'm also
wondering if Multiline strings are the right tool to address them?