Give identifier and int ast types

This commit is contained in:
Jeong YunWon
2023-05-10 19:17:11 +09:00
parent d495cd9129
commit 455bcc01a0
88 changed files with 3288 additions and 2300 deletions

View File

@@ -4,7 +4,7 @@
// regular strings. Since the parser has no definition of f-string formats (Pending PEP 701)
// we have to do the parsing here, manually.
use crate::{
ast::{self, Constant, Expr, ExprKind},
ast::{self, Constant, Expr, ExprKind, Int},
lexer::{LexicalError, LexicalErrorType},
parser::{parse_expression_at, LalrpopError, ParseError, ParseErrorType},
token::{StringKind, Tok},
@@ -314,7 +314,7 @@ impl<'a> StringParser<'a> {
)
})?,
),
conversion: conversion as _,
conversion: Int::new(conversion as _),
format_spec: spec,
}
.into(),
@@ -345,13 +345,13 @@ impl<'a> StringParser<'a> {
)
})?,
),
conversion: (if conversion == ConversionFlag::None
&& spec.is_none()
{
ConversionFlag::Repr
} else {
conversion
}) as _,
conversion: ast::Int::new(
(if conversion == ConversionFlag::None && spec.is_none() {
ConversionFlag::Repr
} else {
conversion
}) as _,
),
format_spec: spec,
}
.into(),