Skip to content

Commit f43d48a

Browse files
committed
Reduced visibility of specialized expression parsers
1 parent c273eac commit f43d48a

10 files changed

Lines changed: 10 additions & 11 deletions

rusty_parser/src/expr/binary_expression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::tokens::{TokenType, any_token};
1010
use crate::{ExpressionPos, ExpressionPosTrait, ExpressionTrait, Keyword, Operator};
1111

1212
// result ::= <non-bin-expr> <operator> <expr>
13-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
13+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
1414
non_bin_expr()
1515
.then_with_in_context(
1616
second_parser(),

rusty_parser/src/expr/built_in_function_call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::input::StringView;
55
use crate::pc_specific::WithPos;
66
use crate::{ExpressionPos, ParserError};
77

8-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
8+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
99
built_in_function_call_p().with_pos()
1010
}
1111

rusty_parser/src/expr/function_call_or_array_element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{Expression, ExpressionPos, Expressions, NameAsTokens, ParserError};
1616
//
1717
// A function can be qualified.
1818

19-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
19+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
2020
name_as_tokens_p()
2121
.and(
2222
in_parenthesis(csv(expression_pos_p()).or_default()),

rusty_parser/src/expr/guard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::tokens::{any_symbol_of, any_token_of};
88
/// `result ::= " " | "("`
99
///
1010
/// The "(" will be undone.
11-
pub fn parser() -> impl Parser<StringView, Output = (), Error = ParserError> {
11+
pub(super) fn parser() -> impl Parser<StringView, Output = (), Error = ParserError> {
1212
whitespace_guard()
1313
.or(lparen_guard())
1414
.with_expected_message("Expected: '(' or whitespace")

rusty_parser/src/expr/integer_or_long_literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::tokens::{TokenType, any_token_of};
88
use crate::{Expression, ExpressionPos};
99

1010
// result ::= <digits> | <hex-digits> | <oct-digits>
11-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
11+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
1212
any_token_of!(
1313
TokenType::Digits,
1414
TokenType::HexDigits,

rusty_parser/src/expr/parenthesis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::input::StringView;
55
use crate::pc_specific::{OrExpected, WithPos, in_parenthesis};
66
use crate::{Expression, ExpressionPos, ParserError};
77

8-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
8+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
99
in_parenthesis(expression_pos_p().or_expected("expression inside parenthesis"))
1010
.map(|child| Expression::Parenthesis(Box::new(child)))
1111
.with_pos()

rusty_parser/src/expr/single_or_double_literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{Expression, ExpressionPos, ParserError};
1212

1313
// TODO support more qualifiers besides '#'
1414

15-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
15+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
1616
// read integer digits optionally (might start with . e.g. `.123`)
1717
digits()
1818
.to_option()

rusty_parser/src/expr/string_literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::pc_specific::*;
66
use crate::tokens::{MatchMode, TokenType, any_symbol_of, any_token_of};
77
use crate::{Expression, ExpressionPos, ParserError};
88

9-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
9+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
1010
surround(
1111
string_delimiter(),
1212
inside_string(),

rusty_parser/src/expr/unary_expression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::pc_specific::{OrExpected, WithPos, keyword};
77
use crate::tokens::minus_sign;
88
use crate::{ExpressionPos, ExpressionPosTrait, Keyword, ParserError, UnaryOperator};
99

10-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
10+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
1111
seq2(
1212
unary_op(),
1313
expression_pos_p().or_expected("expression after unary operator"),

rusty_parser/src/expr/variable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// TODO consider nesting variable/function_call modules inside property as they are only used there
21
use std::collections::VecDeque;
32

43
use rusty_pc::*;
@@ -17,7 +16,7 @@ use crate::{
1716
// must not be followed by parenthesis (solved by ordering of parsers)
1817
//
1918
// if <identifier-with-dots> contains dots, it might be converted to a property expression
20-
pub fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
19+
pub(super) fn parser() -> impl Parser<StringView, Output = ExpressionPos, Error = ParserError> {
2120
name_as_tokens_p().map(map_to_expr).with_pos()
2221
}
2322

0 commit comments

Comments
 (0)