Merge branch 'shebang'. close #134

This commit is contained in:
Yuichi Nishiwaki 2014-06-17 21:28:46 +09:00
commit 0ca09f355e
2 changed files with 13 additions and 0 deletions

View File

@ -33,6 +33,9 @@
%option extra-type="struct parser_control *" %option extra-type="struct parser_control *"
%option never-interactive %option never-interactive
/* shebang */
shebang #!.*$
/* comment */ /* comment */
comment ;.*$ comment ;.*$
@ -71,6 +74,7 @@ label #{uinteger}
[ \t\n\r] /* skip whitespace */ [ \t\n\r] /* skip whitespace */
{comment} /* skip comment */ {comment} /* skip comment */
{shebang} /* skip shebang */
"#|" { "#|" {
BEGIN(BLOCK_COMMENT); BEGIN(BLOCK_COMMENT);

9
t/shebang.scm Executable file
View File

@ -0,0 +1,9 @@
#! /bin/sh
#| -*- scheme -*-
exec picrin $0 "$@"
|#
(import (scheme base)
(scheme write))
(write (list 1 2 3))