Skip to content

Commit

Permalink
perf(parser): Shrink lalrpop's symbol size slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Jan 12, 2019
1 parent 7bd988e commit fff12fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parser/src/grammar.lalrpop
Expand Up @@ -829,8 +829,8 @@ pub TopExpr: SpannedExpr<Id> = {
"shebang line"? <expr: SpExpr> SkipExtraTokens => expr,
};

pub ReplLine: Option<ReplLine<Id>> = {
<TopExpr> => Some(ReplLine::Expr(<>)),
"block open" <PlainValueBinding> "block close" => Some(ReplLine::Let(<>)),
pub ReplLine: Option<Box<ReplLine<Id>>> = {
<TopExpr> => Some(Box::new(ReplLine::Expr(<>))),
"block open" <PlainValueBinding> "block close" => Some(Box::new(ReplLine::Let(<>))),
=> None,
};
1 change: 1 addition & 0 deletions parser/src/lib.rs
Expand Up @@ -475,6 +475,7 @@ where

match result {
Ok(repl_line) => {
let repl_line = repl_line.map(|b| *b);
if parse_errors.has_errors() {
Err((repl_line, transform_errors(input.span(), parse_errors)))
} else {
Expand Down

0 comments on commit fff12fa

Please sign in to comment.