mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-04-24 18:52:16 +00:00
Remove some lifetimes in codegen and clippy fix
This commit is contained in:
parent
8a96e9646b
commit
5247b2512c
@ -480,7 +480,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
|
||||
// and then by the terminal index. The value is described above.
|
||||
rust!(
|
||||
self.out,
|
||||
"const {}ACTION: &'static [{}] = &[",
|
||||
"const {}ACTION: &[{}] = &[",
|
||||
self.prefix,
|
||||
self.custom.state_type
|
||||
);
|
||||
@ -514,7 +514,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
|
||||
// Actions on EOF. Indexed just by state.
|
||||
rust!(
|
||||
self.out,
|
||||
"const {}EOF_ACTION: &'static [{}] = &[",
|
||||
"const {}EOF_ACTION: &[{}] = &[",
|
||||
self.prefix,
|
||||
self.custom.state_type
|
||||
);
|
||||
@ -528,7 +528,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
|
||||
// The goto table is indexed by state and *nonterminal*.
|
||||
rust!(
|
||||
self.out,
|
||||
"const {}GOTO: &'static [{}] = &[",
|
||||
"const {}GOTO: &[{}] = &[",
|
||||
self.prefix,
|
||||
self.custom.state_type
|
||||
);
|
||||
@ -585,7 +585,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
|
||||
|
||||
rust!(
|
||||
self.out,
|
||||
"let {p}r = {p}state_machine::Parser::drive(",
|
||||
"{p}state_machine::Parser::drive(",
|
||||
p = self.prefix,
|
||||
);
|
||||
rust!(self.out, "{p}StateMachine {{", p = self.prefix);
|
||||
@ -600,8 +600,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
|
||||
);
|
||||
rust!(self.out, "}},");
|
||||
rust!(self.out, "{p}tokens,", p = self.prefix);
|
||||
rust!(self.out, ");");
|
||||
rust!(self.out, "{p}r", p = self.prefix);
|
||||
rust!(self.out, ")");
|
||||
|
||||
self.end_parser_fn()
|
||||
}
|
||||
@ -1448,7 +1447,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
|
||||
|
||||
rust!(
|
||||
self.out,
|
||||
"const {}TERMINAL: &'static [&'static str] = &[",
|
||||
"const {}TERMINAL: &[&str] = &[",
|
||||
self.prefix
|
||||
);
|
||||
let all_terminals = if self.grammar.uses_error_recovery {
|
||||
|
Loading…
x
Reference in New Issue
Block a user