d-u-d-e / c-compiler

GNU General Public License v3.0
3 stars 0 forks source link

Implement a basic lexer #3

Closed d-u-d-e closed 1 week ago

d-u-d-e commented 2 weeks ago
albertoursino commented 2 weeks ago

I'm not able to test the lexer because when I run: ./test_compiler ../compiler_driver.py --chapter 1 --stage lex I get:

Traceback (most recent call last):
  File "/home/morga/repos/c-compiler/writing-a-c-compiler-tests/test_framework/basic.py", line 592, in test_valid
    self.compile_success(program)
  File "/home/morga/repos/c-compiler/writing-a-c-compiler-tests/test_framework/basic.py", line 359, in compile_success
    self.assertEqual(
AssertionError: compilation of /home/morga/repos/c-compiler/writing-a-c-compiler-tests/tests/chapter_1/valid/tabs.c failed with error:
/usr/bin/env: ‘python3\r’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines
d-u-d-e commented 2 weeks ago

Writing #!/usr/bin/env -S python3 should do the trick. See https://stackoverflow.com/questions/4303128/how-to-use-multiple-arguments-for-awk-with-a-shebang-i-e.