public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
* shebang handling
@ 2021-07-04 22:09 Mark Wielaard
  2021-07-04 22:09 ` [PATCH 1/2] Handle shebang line, plus any whitespace and comment skipping in lexer Mark Wielaard
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Wielaard @ 2021-07-04 22:09 UTC (permalink / raw)
  To: gcc-rust

Hi,

Shebang handling, the first line starting with #! was not done fully
correct and it isn't necessary to keep track of the shebang line in
the AST or HIR Crate classes.

Because an inner attribute also starts with #! the first line isn't
regarded as a shebang line if the #! is followed by (optional)
whitespace and comments and a [. In that case the #! is seen as the
start of an inner attribute.

I added various testcases that hopefully show the funny things you can
get when the first line starts with #!.

 [PATCH 1/2] Handle shebang line, plus any whitespace and comment
 [PATCH 2/2] Remove has_shebang flag from AST and HIR Crate classes

Patches can also be found here:
https://code.wildebeest.org/git/user/mjw/gccrs/log/?h=shebang

Cheers,

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-05  5:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-04 22:09 shebang handling Mark Wielaard
2021-07-04 22:09 ` [PATCH 1/2] Handle shebang line, plus any whitespace and comment skipping in lexer Mark Wielaard
2021-07-04 22:09 ` [PATCH 2/2] Remove has_shebang flag from AST and HIR Crate classes Mark Wielaard
2021-07-05  5:46 ` shebang handling Marc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).