remove parened field

This commit is contained in:
gluax 2022-03-14 07:58:51 -07:00
parent 377c65be21
commit 2c30cba70f
17 changed files with 30 additions and 167 deletions

View File

@ -376,7 +376,6 @@ impl Canonicalizer {
Statement::Definition(DefinitionStatement {
declaration_type: definition.declaration_type.clone(),
variable_names: definition.variable_names.clone(),
parened: definition.parened,
type_,
value,
span: definition.span.clone(),
@ -621,18 +620,11 @@ impl ReconstructingReducer for Canonicalizer {
type_: Option<Type>,
value: Expression,
) -> Result<DefinitionStatement> {
match &type_ {
Some(Type::Tuple(elements)) if elements.len() != 1 => {}
_ if definition.parened => {
return Err(AstError::invalid_parens_around_single_variable(&definition.span).into());
}
_ => {}
}
let type_ = self.canonicalize_self_type(type_.as_ref());
Ok(DefinitionStatement {
declaration_type: definition.declaration_type.clone(),
variable_names,
parened: definition.parened,
type_,
value,
span: definition.span.clone(),

View File

@ -48,7 +48,7 @@ impl Importer {
let pretty_package = package.join(".");
let resolved_package =
match wrapped_resolver.resolve_package(&package.iter().map(|x| &**x).collect::<Vec<_>>()[..], &span)? {
match wrapped_resolver.resolve_package(&package.iter().map(|x| &**x).collect::<Vec<_>>(), &span)? {
Some(x) => x,
None => return Err(AstError::unresolved_import(pretty_package, &span).into()),
};

View File

@ -286,7 +286,6 @@ pub trait ReconstructingReducer {
Ok(DefinitionStatement {
declaration_type: definition.declaration_type.clone(),
variable_names,
parened: definition.parened,
type_,
value,
span: definition.span.clone(),

View File

@ -33,8 +33,6 @@ pub struct DefinitionStatement {
pub declaration_type: Declare,
/// The bindings / variable names to declare.
pub variable_names: Vec<VariableName>,
/// Tracks whether the variable(s) are in parens.
pub parened: bool,
/// The types of the bindings, if specified, or inferred otherwise.
pub type_: Option<Type>,
/// An initializer value for the bindings.

View File

@ -295,14 +295,17 @@ impl ParserContext<'_> {
let declare = self.expect_oneof(&[Token::Let, Token::Const])?;
// Parse variable names.
let (variable_names, parened) = if self.peek_is_left_par() {
(
self.parse_paren_comma_list(|p| p.parse_variable_name(&declare).map(Some))
.map(|(vars, ..)| vars)?,
true,
)
let variable_names = if self.peek_is_left_par() {
let vars = self.parse_paren_comma_list(|p| p.parse_variable_name(&declare).map(Some))
.map(|(vars, ..)| vars)?;
if vars.len() == 1 {
return Err(ParserError::invalid_parens_around_single_variable(vars[0].span()).into());
}
vars
} else {
(vec![self.parse_variable_name(&declare)?], false)
vec![self.parse_variable_name(&declare)?]
};
// Parse an optional type ascription.
@ -323,7 +326,6 @@ impl ParserContext<'_> {
_ => unreachable!("parse_definition_statement_ shouldn't produce this"),
},
variable_names,
parened,
type_,
value: expr,
})

View File

@ -46,7 +46,7 @@ fn eat_identifier(input_tendril: &StrTendril) -> Option<StrTendril> {
if input_tendril.is_empty() {
return None;
}
let input = input_tendril[..].as_bytes();
let input = input_tendril.as_bytes();
if !input[0].is_ascii_alphabetic() {
return None;
@ -73,7 +73,7 @@ impl Token {
if escaped {
let string = input_tendril.to_string();
let escaped = &string[1..string.len()];
let escaped = &string[1..input_tendril.len()];
if escaped.len() != 1 {
return Err(ParserError::lexer_escaped_char_incorrect_length(escaped).into());
@ -158,7 +158,7 @@ impl Token {
if input_tendril.is_empty() {
return Err(ParserError::lexer_empty_input_tendril().into());
}
let input = input_tendril[..].as_bytes();
let input = input_tendril.as_bytes();
if !input[0].is_ascii_digit() {
return Err(ParserError::lexer_eat_integer_leading_zero(String::from_utf8_lossy(input)).into());
}
@ -205,7 +205,7 @@ impl Token {
if input_tendril.is_empty() {
return Err(ParserError::lexer_empty_input_tendril().into());
}
let input = input_tendril[..].as_bytes();
let input = input_tendril.as_bytes();
match input[0] {
x if x.is_ascii_whitespace() => return Ok((1, Token::WhiteSpace)),
b'"' => {

View File

@ -138,12 +138,4 @@ create_errors!(
msg: "tuples of 1 element are not allowed",
help: None,
}
/// For when a user puts parens around a single defined variable.
@formatted
invalid_parens_around_single_variable {
args: (),
msg: "do not put parens around single variable names",
help: None,
}
);

View File

@ -382,4 +382,12 @@ create_errors!(
msg: format!("There was an emoji found in the escaped unicode character: `{}`.", input),
help: None,
}
/// For when a user puts parens around a single defined variable.
@formatted
invalid_parens_around_single_variable {
args: (),
msg: "do not put parens around single variable names",
help: None,
}
);

View File

@ -95,7 +95,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32;\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -107,7 +106,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32; \\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -119,7 +117,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32; \\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -131,7 +128,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let xy_sum = 0i32; \\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -143,7 +139,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x2_sum = 0i32; \\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -294,7 +289,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}"
parened: false
type_: ~
value:
Binary:
@ -318,7 +312,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":13,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}"
parened: false
type_: ~
value:
Binary:
@ -342,7 +335,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}"
parened: false
type_: ~
value:
Binary:
@ -376,7 +368,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32; \\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -388,7 +379,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":44,\\\"line_stop\\\":44,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32;\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -400,7 +390,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32;\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -511,7 +500,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}"
parened: false
type_:
Array:
- Identifier: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}"
@ -634,7 +622,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":7,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}"
parened: false
type_: ~
value:
Call:
@ -652,7 +639,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}"
parened: false
type_: ~
value:
Call:
@ -669,7 +655,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":65,\\\"line_stop\\\":65,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}"
parened: false
type_: ~
value:
Call:

View File

@ -56,7 +56,6 @@ outputs:
variable_names:
- mutable: false
identifier: "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":11,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const str_len = 20u32; // saving const for convenience\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -68,7 +67,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = true;\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -78,7 +76,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let processed = 0u8;\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -106,7 +103,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}"
parened: false
type_: ~
value:
Access:
@ -133,7 +129,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let skipped = 0u8;\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -145,7 +140,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_empty = 0u8;\\\"}\"}"
parened: false
type_: ~
value:
Value:
@ -157,7 +151,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_sym = ' ';\\\"}\"}"
parened: false
type_: ~
value:
Value:

View File

@ -64,7 +64,6 @@ outputs:
variable_names:
- mutable: true
identifier: "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let digest: group = 0group;\\\"}\"}"
parened: false
type_: Group
value:
Value:
@ -144,7 +143,6 @@ outputs:
variable_names:
- mutable: false
identifier: "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":11,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}"
parened: false
type_: ~
value:
Call:

View File

@ -14,7 +14,6 @@ outputs:
col_stop: 6
path: ""
content: let x = expr;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}"
@ -37,7 +36,6 @@ outputs:
col_stop: 6
path: ""
content: let x = ();
parened: false
type_: ~
value:
TupleInit:
@ -68,7 +66,6 @@ outputs:
col_stop: 6
path: ""
content: let x = x+y;
parened: false
type_: ~
value:
Binary:
@ -103,7 +100,6 @@ outputs:
col_stop: 6
path: ""
content: "let x = (x,y);"
parened: false
type_: ~
value:
TupleInit:
@ -136,7 +132,6 @@ outputs:
col_stop: 6
path: ""
content: let x = x();
parened: false
type_: ~
value:
Call:
@ -169,7 +164,6 @@ outputs:
col_stop: 8
path: ""
content: const x = expr;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}"
@ -192,7 +186,6 @@ outputs:
col_stop: 8
path: ""
content: const x = ();
parened: false
type_: ~
value:
TupleInit:
@ -223,7 +216,6 @@ outputs:
col_stop: 8
path: ""
content: const x = x+y;
parened: false
type_: ~
value:
Binary:
@ -258,7 +250,6 @@ outputs:
col_stop: 8
path: ""
content: "const x = (x,y);"
parened: false
type_: ~
value:
TupleInit:
@ -291,7 +282,6 @@ outputs:
col_stop: 8
path: ""
content: const x = x();
parened: false
type_: ~
value:
Call:
@ -324,7 +314,6 @@ outputs:
col_stop: 6
path: ""
content: "let x: u32 = expr;"
parened: false
type_:
IntegerType: U32
value:
@ -348,7 +337,6 @@ outputs:
col_stop: 6
path: ""
content: "let x: u32 = ();"
parened: false
type_:
IntegerType: U32
value:
@ -380,7 +368,6 @@ outputs:
col_stop: 6
path: ""
content: "let x: u32 = x+y;"
parened: false
type_:
IntegerType: U32
value:
@ -416,7 +403,6 @@ outputs:
col_stop: 6
path: ""
content: "let x: u32 = (x,y);"
parened: false
type_:
IntegerType: U32
value:
@ -450,7 +436,6 @@ outputs:
col_stop: 6
path: ""
content: "let x: u32 = x();"
parened: false
type_:
IntegerType: U32
value:
@ -484,7 +469,6 @@ outputs:
col_stop: 8
path: ""
content: "const x: u32 = expr;"
parened: false
type_:
IntegerType: U32
value:
@ -508,7 +492,6 @@ outputs:
col_stop: 8
path: ""
content: "const x: u32 = ();"
parened: false
type_:
IntegerType: U32
value:
@ -540,7 +523,6 @@ outputs:
col_stop: 8
path: ""
content: "const x: u32 = x+y;"
parened: false
type_:
IntegerType: U32
value:
@ -576,7 +558,6 @@ outputs:
col_stop: 8
path: ""
content: "const x: u32 = (x,y);"
parened: false
type_:
IntegerType: U32
value:
@ -610,7 +591,6 @@ outputs:
col_stop: 8
path: ""
content: "const x: u32 = x();"
parened: false
type_:
IntegerType: U32
value:
@ -653,7 +633,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y) = expr;"
parened: true
type_: ~
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}"
@ -685,7 +664,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y) = ();"
parened: true
type_: ~
value:
TupleInit:
@ -725,7 +703,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y) = x+y;"
parened: true
type_: ~
value:
Binary:
@ -769,7 +746,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y) = (x,y);"
parened: true
type_: ~
value:
TupleInit:
@ -811,7 +787,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y) = x();"
parened: true
type_: ~
value:
Call:
@ -853,7 +828,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y) = expr;"
parened: true
type_: ~
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}"
@ -885,7 +859,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y) = ();"
parened: true
type_: ~
value:
TupleInit:
@ -925,7 +898,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y) = x+y;"
parened: true
type_: ~
value:
Binary:
@ -969,7 +941,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y) = (x,y);"
parened: true
type_: ~
value:
TupleInit:
@ -1011,7 +982,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y) = x();"
parened: true
type_: ~
value:
Call:
@ -1053,7 +1023,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y): u32 = expr;"
parened: true
type_:
IntegerType: U32
value:
@ -1086,7 +1055,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y): u32 = ();"
parened: true
type_:
IntegerType: U32
value:
@ -1127,7 +1095,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y): u32 = x+y;"
parened: true
type_:
IntegerType: U32
value:
@ -1172,7 +1139,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y): u32 = (x,y);"
parened: true
type_:
IntegerType: U32
value:
@ -1215,7 +1181,6 @@ outputs:
col_stop: 10
path: ""
content: "let (x, y): u32 = x();"
parened: true
type_:
IntegerType: U32
value:
@ -1258,7 +1223,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y): u32 = expr;"
parened: true
type_:
IntegerType: U32
value:
@ -1291,7 +1255,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y): u32 = ();"
parened: true
type_:
IntegerType: U32
value:
@ -1332,7 +1295,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y): u32 = x+y;"
parened: true
type_:
IntegerType: U32
value:
@ -1377,7 +1339,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y): u32 = (x,y);"
parened: true
type_:
IntegerType: U32
value:
@ -1420,7 +1381,6 @@ outputs:
col_stop: 12
path: ""
content: "const (x, y): u32 = x();"
parened: true
type_:
IntegerType: U32
value:
@ -1463,7 +1423,6 @@ outputs:
col_stop: 9
path: ""
content: "let (x,y,) = ();"
parened: true
type_: ~
value:
TupleInit:
@ -1482,37 +1441,6 @@ outputs:
col_stop: 16
path: ""
content: "let (x,y,) = ();"
- Definition:
declaration_type: Let
variable_names:
- mutable: true
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x,) = ();\\\"}\"}"
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 7
path: ""
content: "let (x,) = ();"
parened: true
type_: ~
value:
TupleInit:
elements: []
span:
line_start: 1
line_stop: 1
col_start: 12
col_stop: 14
path: ""
content: "let (x,) = ();"
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 14
path: ""
content: "let (x,) = ();"
- Definition:
declaration_type: Let
variable_names:
@ -1525,7 +1453,6 @@ outputs:
col_stop: 6
path: ""
content: "let x: [[u8; 2]; 2] = [[0,0], [0,0]];"
parened: false
type_:
Array:
- Array:

View File

@ -25,3 +25,5 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^"
- "Error [EPAR0370044]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x) = ...;\n | ^"
- "Error [EPAR0370044]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x,) = ...;\n | ^"

View File

@ -14,7 +14,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a . b;
parened: false
type_: ~
value:
Access:
@ -49,7 +48,6 @@ outputs:
col_stop: 6
path: ""
content: "let x = a :: b;"
parened: false
type_: ~
value:
Access:
@ -84,7 +82,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a == b;
parened: false
type_: ~
value:
Binary:
@ -119,7 +116,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a != b;
parened: false
type_: ~
value:
Binary:
@ -154,7 +150,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a > b;
parened: false
type_: ~
value:
Binary:
@ -189,7 +184,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a >= b;
parened: false
type_: ~
value:
Binary:
@ -224,7 +218,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a < b;
parened: false
type_: ~
value:
Binary:
@ -259,7 +252,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a <= b;
parened: false
type_: ~
value:
Binary:
@ -294,7 +286,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a > b;
parened: false
type_: ~
value:
Binary:
@ -329,7 +320,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a as b;
parened: false
type_: ~
value:
Cast:

View File

@ -33,7 +33,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aimport;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aimport\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aimport;\\\"}\"}"
@ -56,7 +55,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a_;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"a_\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = a_;\\\"}\"}"
@ -79,7 +77,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aas;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aas\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aas;\\\"}\"}"
@ -102,7 +99,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aconsole;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aconsole\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aconsole;\\\"}\"}"
@ -125,7 +121,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aconst;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aconst\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aconst;\\\"}\"}"
@ -148,7 +143,6 @@ outputs:
col_stop: 6
path: ""
content: let x = alet;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"alet\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = alet;\\\"}\"}"
@ -171,7 +165,6 @@ outputs:
col_stop: 6
path: ""
content: let x = afor;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"afor\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = afor;\\\"}\"}"
@ -194,7 +187,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aif;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aif\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aif;\\\"}\"}"
@ -217,7 +209,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aelse;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aelse\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aelse;\\\"}\"}"
@ -240,7 +231,6 @@ outputs:
col_stop: 6
path: ""
content: let x = ai8;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"ai8\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = ai8;\\\"}\"}"
@ -263,7 +253,6 @@ outputs:
col_stop: 6
path: ""
content: let x = ai16;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"ai16\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = ai16;\\\"}\"}"
@ -286,7 +275,6 @@ outputs:
col_stop: 6
path: ""
content: let x = ai32;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"ai32\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = ai32;\\\"}\"}"
@ -309,7 +297,6 @@ outputs:
col_stop: 6
path: ""
content: let x = ai64;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"ai64\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = ai64;\\\"}\"}"
@ -332,7 +319,6 @@ outputs:
col_stop: 6
path: ""
content: let x = ai128;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"ai128\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = ai128;\\\"}\"}"
@ -355,7 +341,6 @@ outputs:
col_stop: 6
path: ""
content: let x = au8;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"au8\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = au8;\\\"}\"}"
@ -378,7 +363,6 @@ outputs:
col_stop: 6
path: ""
content: let x = au16;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"au16\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = au16;\\\"}\"}"
@ -401,7 +385,6 @@ outputs:
col_stop: 6
path: ""
content: let x = au32;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"au32\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = au32;\\\"}\"}"
@ -424,7 +407,6 @@ outputs:
col_stop: 6
path: ""
content: let x = au64;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"au64\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = au64;\\\"}\"}"
@ -447,7 +429,6 @@ outputs:
col_stop: 6
path: ""
content: let x = au128;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"au128\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = au128;\\\"}\"}"
@ -470,7 +451,6 @@ outputs:
col_stop: 6
path: ""
content: let x = areturn;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"areturn\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = areturn;\\\"}\"}"
@ -493,7 +473,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aself;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aself\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aself;\\\"}\"}"
@ -516,7 +495,6 @@ outputs:
col_stop: 6
path: ""
content: let x = aSelf;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"aSelf\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = aSelf;\\\"}\"}"
@ -539,7 +517,6 @@ outputs:
col_stop: 6
path: ""
content: let x = atrue;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"atrue\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = atrue;\\\"}\"}"
@ -562,7 +539,6 @@ outputs:
col_stop: 6
path: ""
content: let x = afalse;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"afalse\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = afalse;\\\"}\"}"
@ -585,7 +561,6 @@ outputs:
col_stop: 6
path: ""
content: let x = a0;
parened: false
type_: ~
value:
Identifier: "{\"name\":\"a0\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = a0;\\\"}\"}"

View File

@ -97,6 +97,4 @@ const (x, y): u32 = x();
let (x,y,) = ();
let (x,) = ();
let x: [[u8; 2]; 2] = [[0,0], [0,0]];

View File

@ -52,3 +52,7 @@ let (x,y,,) = ();
let (,x,y) = ();
let (x,,y) = ();
let (x) = ...;
let (x,) = ...;