Skip to content

Commit 822cac5

Browse files
committed
parse_expression{=>_starts}_at
1 parent aa101e4 commit 822cac5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

parser/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ mod string;
125125
mod token;
126126

127127
pub use parser::{
128-
parse, parse_expression, parse_expression_at, parse_program, parse_starts_at, parse_tokens,
129-
ParseError, ParseErrorType,
128+
parse, parse_expression, parse_expression_starts_at, parse_program, parse_starts_at,
129+
parse_tokens, ParseError, ParseErrorType,
130130
};
131131
pub use string::FStringErrorType;
132132
pub use token::{StringKind, Tok};

parser/src/parser.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn parse_program(source: &str, source_path: &str) -> Result<ast::Suite, Pars
7070
///
7171
/// ```
7272
pub fn parse_expression(source: &str, path: &str) -> Result<ast::Expr, ParseError> {
73-
parse_expression_at(source, path, TextSize::default())
73+
parse_expression_starts_at(source, path, TextSize::default())
7474
}
7575

7676
/// Parses a Python expression from a given location.
@@ -84,12 +84,12 @@ pub fn parse_expression(source: &str, path: &str) -> Result<ast::Expr, ParseErro
8484
/// somewhat silly, location:
8585
///
8686
/// ```
87-
/// use rustpython_parser::{text_size::TextSize, parse_expression_at};
87+
/// use rustpython_parser::{text_size::TextSize, parse_expression_starts_at};
8888
///
89-
/// let expr = parse_expression_at("1 + 2", "<embedded>", TextSize::from(400));
89+
/// let expr = parse_expression_starts_at("1 + 2", "<embedded>", TextSize::from(400));
9090
/// assert!(expr.is_ok());
9191
/// ```
92-
pub fn parse_expression_at(
92+
pub fn parse_expression_starts_at(
9393
source: &str,
9494
path: &str,
9595
offset: TextSize,

parser/src/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use crate::{
77
ast::{self, Constant, Expr, ExprKind, Int},
88
lexer::{LexicalError, LexicalErrorType},
9-
parser::{parse_expression_at, LalrpopError, ParseError, ParseErrorType},
9+
parser::{parse_expression_starts_at, LalrpopError, ParseError, ParseErrorType},
1010
token::{StringKind, Tok},
1111
};
1212
use itertools::Itertools;
@@ -575,7 +575,7 @@ impl<'a> StringParser<'a> {
575575
fn parse_fstring_expr(source: &str, location: TextSize) -> Result<Expr, ParseError> {
576576
let fstring_body = format!("({source})");
577577
let start = location - TextSize::from(1);
578-
parse_expression_at(&fstring_body, "<fstring>", start)
578+
parse_expression_starts_at(&fstring_body, "<fstring>", start)
579579
}
580580

581581
fn parse_string(

0 commit comments

Comments
 (0)