Allow storing a result value for a token from a lexer code block
This commit is contained in:
1 parent
ca8a360c0e
commit
bca0a14371
4 files changed
+74
-19
No files matched your search
@@ -317,4 +317,21 @@ EOF
|
||||
"pass1",
|
||||
])
|
||||
end
|
||||
|
||||
it "allows storing a result value for the lexer" do
|
||||
write_grammar <<EOF
|
||||
result_type ulong;
|
||||
token word /[a-z]+/ <<
|
||||
$$ = match.length;
|
||||
>>
|
||||
Start -> word <<
|
||||
$$ = $1;
|
||||
>>
|
||||
EOF
|
||||
build_parser
|
||||
compile("spec/test_lexer_result_value.d")
|
||||
results = run
|
||||
expect(results.stderr).to eq ""
|
||||
expect(results.status).to eq 0
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user