diff --git a/src/scan.l b/src/scan.l index c3d9b1b8..747f31a7 100644 --- a/src/scan.l +++ b/src/scan.l @@ -33,6 +33,9 @@ %option extra-type="struct parser_control *" %option never-interactive + /* shebang */ +shebang #!.*$ + /* comment */ comment ;.*$ @@ -71,6 +74,7 @@ label #{uinteger} [ \t\n\r] /* skip whitespace */ {comment} /* skip comment */ +{shebang} /* skip shebang */ "#|" { BEGIN(BLOCK_COMMENT); diff --git a/t/shebang.scm b/t/shebang.scm new file mode 100755 index 00000000..3200aacf --- /dev/null +++ b/t/shebang.scm @@ -0,0 +1,9 @@ +#! /bin/sh +#| -*- scheme -*- +exec picrin $0 "$@" +|# + +(import (scheme base) + (scheme write)) + +(write (list 1 2 3))