Add p_input_index()

This commit is contained in:
josh committed 2026-07-11 22:58:26 -04:00
1 parent c0016f6d58
commit 2ebdeaa995
8 files changed
+173

No files matched your search

+15
View File
@@ -951,6 +951,21 @@ EOF
expect(results.status).to eq 0
end
it "exposes the current input byte offset via p_input_index()" do
write_grammar <<EOF
drop /\\s+/;
token a;
token b;
start Start;
Start -> a b;
EOF
run_propane(language: language)
compile("spec/test_input_index.#{language}", language: language)
results = run_test(language: language)
expect(results.stderr).to eq ""
expect(results.status).to eq 0
end
it "allows creating a JSON parser" do
ext = language == "cpp" ? "c" : language
write_grammar(File.read("spec/json_parser.#{ext}.propane"))