Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Here-doc implementation #52

Open
dotmpe opened this issue Apr 23, 2018 · 1 comment
Open

Here-doc implementation #52

dotmpe opened this issue Apr 23, 2018 · 1 comment

Comments

@dotmpe
Copy link

dotmpe commented Apr 23, 2018

@parro-it since here-docs are a different beast than here-strings (#49), could you comment on what would be required to implement? I'm not familiar with Bison and neither have a good idea what the AST would look like.

I can see how extending the posix grammar it can be made to go into a javascript routine. E.g

      io_here: [
~       [
~         'DLESS here_end',
+         '$$ = yy.ioHere($1, $here_end);'
+       ],
+       [
+         'DLESSDASH here_end',
+         '$$ = yy.ioHere($1, $here_end);'
+       ]
      ],

But its not clear to me how to handle the here-doc text as a specially interpolated string, and stop at the custom here-doc marker.

ref docs http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_04

@parro-it
Copy link
Collaborator

I remember I have a plan on how to implement this feature, it was one of the only POSIX left to be done.
But I don't remember the plan details 😔.
I have to think about this some time more...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants