Skip to content

Preserve shebang#533

Merged
gpetiot merged 5 commits intoocaml-ppx:masterfrom
gpetiot:preserve-shebang
Jan 12, 2019
Merged

Preserve shebang#533
gpetiot merged 5 commits intoocaml-ppx:masterfrom
gpetiot:preserve-shebang

Conversation

@gpetiot
Copy link
Copy Markdown
Collaborator

@gpetiot gpetiot commented Dec 24, 2018

Should fix #523

For now, only the first line is tested, maybe something smarter could be done in the future?

Copy link
Copy Markdown
Collaborator

@jberdine jberdine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks. Minor comments only. I wonder whether we should only accept #! for implementation (and toplevel?) files, but it doesn't seem worth the complexity to check.

in
Warnings.parse_options false (W.to_string warnings) ;
let lexbuf = Lexing.from_channel ic in
Lexer.skip_hash_bang lexbuf ;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to know how much was skipped looking at the lexbuf. That way, we would be sure we don't drop anything.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be addressed by my last commit.

@gpetiot gpetiot merged commit 6f3275d into ocaml-ppx:master Jan 12, 2019
@gpetiot gpetiot deleted the preserve-shebang branch January 12, 2019 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shebang triggers syntax error

4 participants