Compile generated parser with a test file

This commit is contained in:
josh committed 2021-07-05 23:05:55 -04:00
1 parent 748c219625
commit 3c874ae4c1
2 files changed
+9 -5

No files matched your search

+5 -5
View File
@@ -1,16 +1,16 @@
require "fileutils"
def write_grammar(grammar)
File.write("spec/run/test.i", grammar)
File.write("spec/run/testparser.i", grammar)
end
def build_parser
result = system(*%w[./imbecile.sh spec/run/test.i spec/run/test.d])
result = system(*%w[./imbecile.sh spec/run/testparser.i spec/run/testparser.d])
expect(result).to be_truthy
end
def compile
result = system(*%w[gdc -o spec/run/test spec/run/test.d])
def compile(test_file)
result = system(*%w[gdc -o spec/run/testparser spec/run/testparser.d], test_file)
expect(result).to be_truthy
end
@@ -30,6 +30,6 @@ rule Start [] <<
>>
EOF
build_parser
compile
compile("spec/test_d_lexer.d")
end
end
+4
View File
@@ -0,0 +1,4 @@
int main()
{
return 0;
}