Skip to content

Commit

Permalink
Merge pull request lalrpop#585 from devsnek/fix-no-std
Browse files Browse the repository at this point in the history
fix more no-std items
  • Loading branch information
Marwes authored Jan 28, 2021
2 parents 97957b5 + 49bd3dc commit a8afe7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lalrpop/src/lr1/codegen/parse_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
rust!(self.out, "");
rust!(
self.out,
"fn expected_tokens(&self, state: {state_type}) -> Vec<String> {{",
"fn expected_tokens(&self, state: {state_type}) -> alloc::vec::Vec<alloc::string::String> {{",
state_type = state_type,
);
rust!(self.out, "{p}expected_tokens(state)", p = self.prefix);
Expand Down Expand Up @@ -346,12 +346,12 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
rust!(self.out, "start_location: Option<&Self::Location>,");
rust!(
self.out,
"states: &mut Vec<{state_type}>,",
"states: &mut alloc::vec::Vec<{state_type}>,",
state_type = state_type
);
rust!(
self.out,
"symbols: &mut Vec<{p}state_machine::SymbolTriple<Self>>,",
"symbols: &mut alloc::vec::Vec<{p}state_machine::SymbolTriple<Self>>,",
p = self.prefix,
);
rust!(
Expand Down Expand Up @@ -1553,7 +1553,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive
rust!(self.out, "if next_state == 0 {{");
rust!(self.out, "None");
rust!(self.out, "}} else {{");
rust!(self.out, "Some(terminal.to_string())");
rust!(self.out, "Some(alloc::string::ToString::to_string(terminal))");
rust!(self.out, "}}");
rust!(self.out, "}}).collect()");
rust!(self.out, "}}");
Expand Down
4 changes: 2 additions & 2 deletions lalrpop/src/normalize/macro_expand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ impl MacroExpander {
span,
expr: ExprSymbol { symbols: vec![] },
condition: None,
action: action("vec![]"),
action: action("alloc::vec![]"),
annotations: vec![],
},
// X* = <v:X+>
Expand Down Expand Up @@ -519,7 +519,7 @@ impl MacroExpander {
symbols: vec![repeat.symbol.clone()],
},
condition: None,
action: action("vec![<>]"),
action: action("alloc::vec![<>]"),
annotations: vec![],
},
// X+ = <v:X+> <e:X>
Expand Down

0 comments on commit a8afe7d

Please sign in to comment.