scrapscript
scrapscript copied to clipboard
scrapscript shebang
Can you please allow # as comment char in the 1st line in a script?
That would make using #!/path/to/scrapscript.py there possible and so probably would allow directly executable scripts.
Current reaction:
$ ls -l test.ss
-rwxr-xr-x 1 yeti yeti 104 Dec 8 16:08 test.ss
$ ./test.ss
Traceback (most recent call last):
File "/tmp/mc-yeti/scrapscript.py", line 2800, in <module>
main()
File "/tmp/mc-yeti/scrapscript.py", line 2796, in main
args.func(args)
File "/tmp/mc-yeti/scrapscript.py", line 2611, in eval_command
tokens = tokenize(program)
File "/tmp/mc-yeti/scrapscript.py", line 239, in tokenize
while (token := lexer.read_one()) and not isinstance(token, EOF):
File "/tmp/mc-yeti/scrapscript.py", line 180, in read_one
raise ParseError(f"unexpected token {c!r}", ("<input>", self.lineno, self.colno, self.line))
File "<input>", line 1
#
^
__main__.ParseError: unexpected token '#'
Or is that a case of PEBCAK?
This is a good point---I will think about what to do here.
You can use the compiler now if you want to directly execute a scrap.