Integrate ParseError to compiler-core::Error

This commit is contained in:
Jeong YunWon
2022-08-22 09:07:15 +09:00
parent 904fc477f1
commit 2b7bf79d29
5 changed files with 67 additions and 32 deletions

View File

@@ -186,7 +186,7 @@ impl<'a> FStringParser<'a> {
vec![self.expr(ExprKind::FormattedValue {
value: Box::new(
parse_fstring_expr(&expression)
.map_err(|e| InvalidExpression(Box::new(e.error)))?,
.map_err(|e| InvalidExpression(Box::new(e.into())))?,
),
conversion: conversion as _,
format_spec: spec,
@@ -204,7 +204,7 @@ impl<'a> FStringParser<'a> {
self.expr(ExprKind::FormattedValue {
value: Box::new(
parse_fstring_expr(&expression)
.map_err(|e| InvalidExpression(Box::new(e.error)))?,
.map_err(|e| InvalidExpression(Box::new(e.into())))?,
),
conversion: (if conversion == ConversionFlag::None && spec.is_none()
{