summaryrefslogtreecommitdiff
path: root/src/grammar.lalrpop
diff options
context:
space:
mode:
authorNanoTech2016-12-08 09:20:39 +0000
committerNanoTech2017-03-10 23:48:28 -0600
commit0b2d2ccee2023198d60b48154b9b211e47b782ec (patch)
tree2da08badda644c47cd6b93322a9aeb6e994c2527 /src/grammar.lalrpop
parente72192c0c1825f36f054263437029d05d717c957 (diff)
Replace Cow<'i, str> with &'i str in Expr
Cow::Owned is never used in Expr
Diffstat (limited to 'src/grammar.lalrpop')
-rw-r--r--src/grammar.lalrpop7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/grammar.lalrpop b/src/grammar.lalrpop
index 91f8b8d..63c17ad 100644
--- a/src/grammar.lalrpop
+++ b/src/grammar.lalrpop
@@ -4,7 +4,6 @@ use core::Expr::*;
use grammar_util::*;
use lexer::*;
-use std::borrow::Cow;
use std::collections::HashMap;
use std::iter;
use std::iter::FromIterator;
@@ -25,7 +24,7 @@ extern {
Nat => Tok::Natural(<usize>),
Text => Tok::Text(<String>),
Bool => Tok::Bool(<bool>),
- Label => Tok::Identifier(<Cow<'input, str>>),
+ Label => Tok::Identifier(<&'input str>),
Const => Tok::Const(<core::Const>),
Let => Tok::Keyword(Keyword::Let),
In => Tok::Keyword(Keyword::In),
@@ -65,7 +64,7 @@ ExprB: BoxExpr<'input> = {
Lambda "(" <Label> ":" <Expr> ")" "->" <ExprB> => bx(Lam(<>)),
Pi "(" <Label> ":" <Expr> ")" "->" <ExprB> => bx(Pi(<>)),
If <Expr> Then <ExprB> Else <ExprC> => bx(BoolIf(<>)),
- <ExprC> "->" <ExprB> => bx(Pi(Cow::Borrowed("_"), <>)),
+ <ExprC> "->" <ExprB> => bx(Pi("_", <>)),
Let <Label> <(":" <Expr>)?> "=" <Expr> In <ExprB> => bx(Let(<>)),
"[" <a:Elems> "]" ":" <b:ListLike> <c:ExprE> => bx(b(c, a)),
ExprC,
@@ -157,6 +156,6 @@ Record: BoxExpr<'input> = {
FieldValues = SepBy1<",", Field<"=">>;
FieldTypes = SepBy<",", Field<":">>;
-Field<Sep>: (Cow<'input, str>, ParsedExpr<'input>) = {
+Field<Sep>: (&'input str, ParsedExpr<'input>) = {
<a:Label> Sep <b:Expr> => (a, *b),
};