StringLiteral -> StringLit

This commit is contained in:
damirka 2021-05-25 16:07:55 +03:00
parent f0525792a9
commit f36d9b960f
4 changed files with 5 additions and 5 deletions

View File

@ -690,7 +690,7 @@ impl ParserContext {
Token::False => Expression::Value(ValueExpression::Boolean("false".into(), span)),
Token::AddressLit(value) => Expression::Value(ValueExpression::Address(value, span)),
Token::CharLit(value) => Expression::Value(ValueExpression::Char(value, span)),
Token::StringLiteral(value) => Expression::Value(ValueExpression::String(value, span)),
Token::StringLit(value) => Expression::Value(ValueExpression::String(value, span)),
Token::LeftParen => self.parse_tuple_expression(&span)?,
Token::LeftSquare => self.parse_array_expression(&span)?,
Token::Ident(name) => {

View File

@ -228,7 +228,7 @@ impl ParserContext {
let start_span;
let string = match self.expect_any()? {
SpannedToken {
token: Token::StringLiteral(chars),
token: Token::StringLit(chars),
span,
} => {
start_span = span;

View File

@ -248,7 +248,7 @@ impl Token {
return (0, None);
}
return (i + 1, Some(Token::StringLiteral(string)));
return (i + 1, Some(Token::StringLit(string)));
}
b'\'' => {
let mut i = 1;

View File

@ -25,7 +25,7 @@ pub enum Token {
// Literals
CommentLine(#[serde(with = "leo_ast::common::tendril_json")] StrTendril),
CommentBlock(#[serde(with = "leo_ast::common::tendril_json")] StrTendril),
StringLiteral(Vec<char>),
StringLit(Vec<char>),
Ident(#[serde(with = "leo_ast::common::tendril_json")] StrTendril),
Int(#[serde(with = "leo_ast::common::tendril_json")] StrTendril),
True,
@ -191,7 +191,7 @@ impl fmt::Display for Token {
match self {
CommentLine(s) => write!(f, "{}", s),
CommentBlock(s) => write!(f, "{}", s),
StringLiteral(content) => {
StringLit(content) => {
write!(f, "\"")?;
for character in content {
write!(f, "{}", character)?;