Skip to content

Commit

Permalink
Remove unecessary pub directive in the first parser
Browse files Browse the repository at this point in the history
  • Loading branch information
d-plaindoux committed Feb 3, 2025
1 parent 753a5a3 commit 5d54b65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bootstrap/src/bootstrap/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ parsec_rules!(
let transform:{String} = (skip "->" skip _=code)

// Main entries
pub let celma_parsec:{ASTParsec} = (_=parsec eos)
pub let celma_parsec_rules:{Vec<ASTParsecRule>} = (_=rules eos)
let celma_parsec:{ASTParsec} = (_=parsec eos)
let celma_parsec_rules:{Vec<ASTParsecRule>} = (_=rules eos)
);
7 changes: 2 additions & 5 deletions lang/src/meta/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ where
.rep()
.map(|v| v.into_iter().collect())
.bind(|s| {
if s == *"let" || s == *"pub" {
if s == *"let" {
parser(fail(false))
} else {
parser(returns(s))
Expand All @@ -80,10 +80,7 @@ fn parsec_rules<'a, S>() -> impl Parse<Vec<ASTParsecRule>, S> + Combine<Vec<ASTP
where
S: Stream<Item = char> + 'a,
{
string("pub")
.opt()
.and_left(skip())
.and_left(string("let"))
string("let")
.and_left(skip())
.and_right(ident())
.and_left(skip())
Expand Down

0 comments on commit 5d54b65

Please sign in to comment.