diff --git a/crates/compiler/fmt/src/expr.rs b/crates/compiler/fmt/src/expr.rs index c6b60e88df..f1fbd614f0 100644 --- a/crates/compiler/fmt/src/expr.rs +++ b/crates/compiler/fmt/src/expr.rs @@ -979,7 +979,7 @@ fn format_str_segment(seg: &StrSegment, buf: &mut Buf) { } } -fn push_op(buf: &mut Buf, op: BinOp) { +pub fn push_op(buf: &mut Buf, op: BinOp) { match op { called_via::BinOp::Caret => buf.push('^'), called_via::BinOp::Star => buf.push('*'), diff --git a/crates/compiler/fmt/src/lib.rs b/crates/compiler/fmt/src/lib.rs index 9b63c03610..a9d9ba959f 100644 --- a/crates/compiler/fmt/src/lib.rs +++ b/crates/compiler/fmt/src/lib.rs @@ -7,6 +7,7 @@ pub mod collection; pub mod def; pub mod expr; pub mod header; +pub mod migrate; pub mod node; pub mod pattern; pub mod spaces; diff --git a/crates/compiler/fmt/src/migrate.rs b/crates/compiler/fmt/src/migrate.rs new file mode 100644 index 0000000000..3ac2430ce0 --- /dev/null +++ b/crates/compiler/fmt/src/migrate.rs @@ -0,0 +1,1401 @@ +use roc_module::called_via::UnaryOp; +use roc_parse::{ + ast::{ + AbilityImpls, AssignedField, Base, Collection, Defs, Expr, FunctionArrow, Header, + ImplementsAbilities, ImplementsAbility, ImplementsClause, ImportAlias, ImportAsKeyword, + ImportExposingKeyword, ImportedModuleName, IngestedFileAnnotation, IngestedFileImport, + ModuleImport, ModuleImportParams, Pattern, Spaced, Spaces, SpacesBefore, Tag, + TypeAnnotation, TypeDef, TypeHeader, TypeVar, ValueDef, + }, + header::{ + AppHeader, ExposedName, HostedHeader, Keyword, KeywordItem, ModuleHeader, ModuleName, + PackageHeader, PlatformHeader, + }, + ident::Accessor, +}; +use roc_region::all::Loc; + +use crate::{ + annotation::{is_collection_multiline, Parens}, + collection::Braces, + expr::{expr_lift_spaces, fmt_str_literal, format_sq_literal, push_op}, + header::{ + fmt_app_header, fmt_hosted_header, fmt_package_header, fmt_platform_header, + fmt_spaces_with_outdent, + }, + pattern::snakify_camel_ident, + spaces::fmt_spaces, + Buf, +}; + +#[derive(Copy, Clone, Debug)] +pub enum Suffix { + None, + Comma, + OpenRound, + Question, +} + +trait Fmt { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError>; +} + +impl Fmt for Expr<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + fmt_expr(buf, indent, self, suffix) + } +} + +impl Fmt for Pattern<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + fmt_pattern(buf, indent, self, suffix) + } +} + +impl Fmt for &F { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + (*self).fmt(buf, indent, suffix) + } +} + +impl Fmt for Loc { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + self.value.fmt(buf, indent, suffix) + } +} + +impl Fmt for AssignedField<'_, F> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + AssignedField::RequiredValue(name, comment_or_newlines, loc1) => { + buf.indent(indent); + buf.push_str(name.value); + if !comment_or_newlines.is_empty() { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + buf.indent(indent); + buf.push_str(":"); + buf.spaces(1); + loc1.fmt(buf, indent, Suffix::None)?; + } + AssignedField::OptionalValue(name, comment_or_newlines, loc1) => { + buf.indent(indent); + buf.push_str(name.value); + if !comment_or_newlines.is_empty() { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + buf.indent(indent); + buf.push_str(":"); + buf.spaces(1); + loc1.fmt(buf, indent, Suffix::None)?; + } + AssignedField::IgnoredValue(name, comment_or_newlines, loc1) => { + buf.indent(indent); + buf.push('_'); + buf.push_str(name.value); + if !comment_or_newlines.is_empty() { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + buf.indent(indent); + buf.push_str(":"); + buf.spaces(1); + loc1.fmt(buf, indent, Suffix::None)?; + } + AssignedField::LabelOnly(name) => { + buf.indent(indent); + buf.push_str(name.value); + } + AssignedField::SpaceBefore(assigned_field, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + assigned_field.fmt(buf, indent, suffix)?; + } + AssignedField::SpaceAfter(assigned_field, comment_or_newlines) => { + assigned_field.fmt(buf, indent, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + } + Ok(()) + } +} + +pub fn fmt_pattern( + buf: &mut Buf, + indent: u16, + pat: &Pattern<'_>, + suffix: Suffix, +) -> Result<(), MigrateError> { + match pat { + Pattern::Identifier { ident } => { + buf.indent(indent); + buf.push_str(ident); + } + Pattern::QualifiedIdentifier { module_name, ident } => { + buf.indent(indent); + buf.push_str(module_name); + buf.push('.'); + buf.push_str(ident); + } + Pattern::Tag(tag) => { + buf.indent(indent); + buf.push_str(tag); + } + Pattern::OpaqueRef(opaque_ref) => { + buf.indent(indent); + buf.push_str(opaque_ref); + } + Pattern::Apply(loc, locs) => { + fmt_pattern(buf, indent, &loc.value, Suffix::OpenRound)?; + for loc in locs.iter() { + fmt_pattern(buf, indent, &loc.value, Suffix::Comma)?; + } + buf.indent(indent); + buf.push(')'); + } + Pattern::PncApply(loc, collection) => { + fmt_pattern(buf, indent, &loc.value, Suffix::OpenRound)?; + for loc in collection.iter() { + fmt_pattern(buf, indent, &loc.value, Suffix::Comma)?; + } + if !collection.final_comments().is_empty() { + fmt_spaces(buf, collection.final_comments().iter(), indent); + } + buf.indent(indent); + buf.push(')'); + } + Pattern::RecordDestructure(collection) => { + fmt_collection(buf, indent, Braces::Curly, None, *collection, None)?; + } + Pattern::RequiredField(name, loc) => { + buf.indent(indent); + buf.push_str(name); + buf.push_str(":"); + buf.spaces(1); + fmt_pattern(buf, indent, &loc.value, Suffix::None)?; + } + Pattern::OptionalField(name, loc) => { + buf.indent(indent); + buf.push_str(name); + buf.push_str("?"); + buf.spaces(1); + fmt_expr(buf, indent, &loc.value, Suffix::Question)?; + } + Pattern::NumLiteral(num_literal) => { + buf.indent(indent); + buf.push_str(num_literal); + } + Pattern::NonBase10Literal { + string, + base, + is_negative, + } => { + buf.indent(indent); + if *is_negative { + buf.push('-'); + } + match base { + Base::Hex => buf.push_str("0x"), + Base::Octal => buf.push_str("0o"), + Base::Binary => buf.push_str("0b"), + Base::Decimal => { /* nothing */ } + } + buf.push_str(string); + } + Pattern::FloatLiteral(float_literal) => { + buf.indent(indent); + buf.push_str(float_literal); + } + Pattern::StrLiteral(str_literal) => { + buf.indent(indent); + fmt_str_literal(buf, *str_literal, indent); + } + Pattern::Underscore(name) => { + buf.indent(indent); + buf.push('_'); + buf.push_str(name); + } + Pattern::SingleQuote(single_quote) => { + buf.indent(indent); + buf.push('\''); + buf.push_str(single_quote); + buf.push('\''); + } + Pattern::Tuple(collection) => { + fmt_collection(buf, indent, Braces::Round, None, *collection, None)?; + } + Pattern::List(collection) => { + fmt_collection(buf, indent, Braces::Square, None, *collection, None)?; + } + Pattern::ListRest(rest) => { + buf.indent(indent); + buf.push_str(".."); + if let Some(rest) = rest { + fmt_spaces(buf, rest.0.iter(), indent); + buf.indent(indent); + buf.ensure_ends_with_whitespace(); + buf.push_str("as"); + fmt_spaces(buf, rest.1.spaces_before.iter(), indent); + buf.ensure_ends_with_whitespace(); + buf.indent(indent); + buf.push_str(rest.1.identifier.value); + } + } + Pattern::As(loc, pattern_as) => { + fmt_pattern(buf, indent, &loc.value, Suffix::None)?; + buf.indent(indent); + buf.push_str(" as"); + fmt_spaces(buf, pattern_as.spaces_before.iter(), indent); + buf.ensure_ends_with_whitespace(); + buf.indent(indent); + buf.push_str(pattern_as.identifier.value); + } + Pattern::SpaceBefore(pattern, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + fmt_pattern(buf, indent, pattern, suffix)?; + } + Pattern::SpaceAfter(pattern, comment_or_newlines) => { + fmt_pattern(buf, indent, pattern, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + Pattern::Malformed(_malformed) => { + return Err(MigrateError::MalformedPatternNotSupported); + } + Pattern::MalformedIdent(_, _bad_ident) => { + return Err(MigrateError::MalformedPatternIdentNotSupported); + } + Pattern::MalformedExpr(_expr) => { + return Err(MigrateError::MalformedPatternAsExprNotSupported); + } + } + + if !matches!(pat, Pattern::SpaceAfter(..) | Pattern::SpaceBefore(..)) { + fmt_suffix(buf, indent, suffix); + } + + Ok(()) +} + +pub fn fmt_expr( + buf: &mut Buf, + indent: u16, + expr: &Expr<'_>, + suffix: Suffix, +) -> Result<(), MigrateError> { + match expr { + Expr::Float(string) => { + buf.indent(indent); + buf.push_str(string); + } + Expr::Num(string) => { + buf.indent(indent); + buf.push_str(string); + } + Expr::Tag(string) | Expr::OpaqueRef(string) => { + buf.indent(indent); + buf.push_str(string) + } + Expr::SingleQuote(string) => { + buf.indent(indent); + format_sq_literal(buf, string); + } + Expr::NonBase10Int { + base, + string, + is_negative, + } => { + buf.indent(indent); + if *is_negative { + buf.push('-'); + } + + match base { + Base::Hex => buf.push_str("0x"), + Base::Octal => buf.push_str("0o"), + Base::Binary => buf.push_str("0b"), + Base::Decimal => { /* nothing */ } + } + + buf.push_str(string); + } + Expr::Str(literal) => { + fmt_str_literal(buf, *literal, indent); + } + Expr::Var { module_name, ident } => { + buf.indent(indent); + if !module_name.is_empty() { + buf.push_str(module_name); + buf.push('.'); + } + if buf.flags().snakify { + snakify_camel_ident(buf, ident); + } else { + buf.push_str(ident); + } + } + Expr::Underscore(name) => { + buf.indent(indent); + buf.push('_'); + buf.push_str(name); + } + Expr::Crash => { + buf.indent(indent); + buf.push_str("crash"); + } + Expr::Dbg => { + buf.indent(indent); + buf.push_str("dbg"); + } + Expr::Try => { + buf.indent(indent); + buf.push_str("try"); + } + Expr::RecordAccess(expr, name) => { + buf.indent(indent); + fmt_expr(buf, indent, expr, Suffix::None)?; + buf.push_str("."); + buf.push_str(name); + } + Expr::TupleAccess(expr, index) => { + buf.indent(indent); + fmt_expr(buf, indent, expr, Suffix::None)?; + buf.push_str("."); + buf.push_str(index); + } + Expr::AccessorFunction(Accessor::TupleIndex(string)) + | Expr::AccessorFunction(Accessor::RecordField(string)) => { + buf.indent(indent); + buf.push_str("."); + buf.push_str(string); + } + Expr::RecordUpdater(name) => { + buf.indent(indent); + buf.push_str("&"); + buf.push_str(name); + } + Expr::TrySuffix(expr) => { + fmt_expr(buf, indent, expr, Suffix::Question)?; + } + Expr::List(collection) => { + fmt_collection(buf, indent, Braces::Square, None, *collection, None)?; + } + Expr::RecordUpdate { update, fields } => { + fmt_collection( + buf, + indent, + Braces::Curly, + Some(CollectionHead::Update(update)), + *fields, + None, + )?; + } + Expr::Record(collection) => { + fmt_collection(buf, indent, Braces::Curly, None, *collection, None)?; + } + Expr::Tuple(collection) => { + fmt_collection(buf, indent, Braces::Round, None, *collection, None)?; + } + Expr::RecordBuilder { mapper, fields } => { + fmt_collection( + buf, + indent, + Braces::Curly, + Some(CollectionHead::Mapper(mapper)), + *fields, + None, + )?; + } + Expr::Closure(args, body) => { + buf.indent(indent); + buf.push('|'); + for arg in *args { + fmt_pattern(buf, indent, &arg.value, Suffix::None)?; + } + buf.indent(indent); + buf.push_str("|"); + buf.spaces(1); + fmt_expr(buf, indent, &body.value, Suffix::None)?; + } + Expr::Defs(defs, final_expr) => { + buf.indent(indent); + buf.push('{'); + buf.ensure_ends_with_newline(); + + for (index, def) in defs.defs().enumerate() { + let spaces_before = &defs.spaces[defs.space_before[index].indices()]; + let spaces_after = &defs.spaces[defs.space_after[index].indices()]; + + if !spaces_before.is_empty() { + fmt_spaces(buf, spaces_before.iter(), indent + 4); + } + + match def { + Ok(type_def) => type_def.fmt(buf, indent + 4, Suffix::None)?, + Err(value_def) => value_def.fmt(buf, indent + 4, Suffix::None)?, + } + + if !spaces_after.is_empty() { + fmt_spaces(buf, spaces_after.iter(), indent + 4); + } + } + + fmt_expr(buf, indent + 4, &final_expr.value, Suffix::None)?; + + buf.ensure_ends_with_newline(); + buf.indent(indent); + buf.push('}'); + } + Expr::DbgStmt { + first, + extra_args, + continuation, + pnc_style: _, + } => { + buf.indent(indent); + buf.push_str("dbg"); + buf.spaces(1); + fmt_expr(buf, indent, &first.value, Suffix::None)?; + for arg in *extra_args { + buf.push_str(","); + buf.spaces(1); + fmt_expr(buf, indent, &arg.value, Suffix::None)?; + } + buf.ensure_ends_with_newline(); + fmt_expr(buf, indent, &continuation.value, Suffix::None)?; + } + Expr::LowLevelTry(..) => todo!(), + Expr::LowLevelDbg(..) => todo!(), + Expr::Apply(func, args, _) => { + fmt_expr(buf, indent, &func.value, Suffix::OpenRound)?; + for arg in *args { + // TODO: make the suffix depend on whether we're multiline + fmt_expr(buf, indent, &arg.value, Suffix::Comma)?; + } + buf.indent(indent); + buf.push(')'); + } + Expr::PncApply(func, collection) => { + fmt_expr(buf, indent, &func.value, Suffix::OpenRound)?; + for arg in collection.iter() { + // TODO: make the suffix depend on whether we're multiline + fmt_expr(buf, indent, &arg.value, Suffix::Comma)?; + } + if !collection.final_comments().is_empty() { + fmt_spaces(buf, collection.final_comments().iter(), indent); + } + buf.indent(indent); + buf.push(')'); + } + Expr::BinOps(expr_op_pairs, last_expr) => { + for (expr, op) in *expr_op_pairs { + fmt_expr(buf, indent, &expr.value, Suffix::None)?; + buf.spaces(1); + buf.indent(indent); + push_op(buf, op.value); + buf.spaces(1); + } + fmt_expr(buf, indent, &last_expr.value, Suffix::None)?; + } + Expr::UnaryOp(expr, op) => { + buf.indent(indent); + let ch = match op.value { + UnaryOp::Negate => "-", + UnaryOp::Not => "!", + }; + buf.push_str(ch); + fmt_expr(buf, indent, &expr.value, Suffix::None)?; + } + Expr::If { + if_thens, + final_else, + indented_else: _, + } => { + for (i, (cond, then)) in if_thens.iter().enumerate() { + buf.indent(indent); + if i == 0 { + buf.push_str("if"); + } else { + buf.push_str("else if"); + } + buf.spaces(1); + fmt_expr(buf, indent, &cond.value, Suffix::None)?; + buf.spaces(1); + fmt_expr_ensure_block(buf, indent, &then.value)?; + } + buf.indent(indent); + buf.spaces(1); + buf.push_str("else"); + buf.spaces(1); + fmt_expr_ensure_block(buf, indent, &final_else.value)?; + } + Expr::When(cond, when_branchs) => { + buf.indent(indent); + buf.push_str("when"); + buf.spaces(1); + fmt_expr(buf, indent, &cond.value, Suffix::None)?; + buf.indent(indent); + buf.push('{'); + buf.ensure_ends_with_newline(); + for branch in when_branchs.iter() { + for (i, pat) in branch.patterns.iter().enumerate() { + if i != 0 { + buf.indent(indent); + buf.push_str(" |"); + buf.spaces(1); + } + fmt_pattern(buf, indent + 4, &pat.value, Suffix::None)?; + } + if let Some(guard) = &branch.guard { + buf.indent(indent); + buf.push_str(" if"); + buf.spaces(1); + fmt_expr(buf, indent + 4, &guard.value, Suffix::None)?; + } + buf.indent(indent); + buf.push_str("->"); + fmt_expr(buf, indent + 4, &branch.value.value, Suffix::None)?; + } + buf.indent(indent); + buf.push('}'); + } + Expr::Return(value, cont) => { + buf.indent(indent); + buf.push_str("return"); + buf.spaces(1); + fmt_expr(buf, indent, &value.value, Suffix::None)?; + buf.ensure_ends_with_newline(); + if let Some(cont) = cont { + fmt_expr(buf, indent, &cont.value, Suffix::None)?; + } + } + Expr::SpaceBefore(expr, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + fmt_expr(buf, indent, expr, suffix)?; + } + Expr::SpaceAfter(expr, comment_or_newlines) => { + fmt_expr(buf, indent, expr, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + Expr::ParensAround(expr) => { + buf.indent(indent); + buf.push('('); + fmt_expr(buf, indent, expr, Suffix::None)?; + buf.indent(indent); + buf.push(')'); + } + Expr::MalformedIdent(_name, _bad_ident) => { + return Err(MigrateError::MalformedIdentNotSupported) + } + Expr::PrecedenceConflict(_precedence_conflict) => { + return Err(MigrateError::PrecedenceConflictNotSupported) + } + Expr::EmptyRecordBuilder(_inner) => todo!(), + Expr::SingleFieldRecordBuilder(_loc) => todo!(), + Expr::OptionalFieldInRecordBuilder(_loc, _loc1) => todo!(), + } + + if !matches!(expr, Expr::SpaceAfter(..) | Expr::SpaceBefore(..)) { + fmt_suffix(buf, indent, suffix); + } + + Ok(()) +} + +pub fn fmt_expr_top_level( + buf: &mut Buf<'_>, + indent: u16, + expr: &Expr<'_>, +) -> Result<(), MigrateError> { + let expr = expr_lift_spaces(Parens::NotNeeded, buf.text.bump(), expr); + if !expr.before.is_empty() { + fmt_spaces(buf, expr.before.iter(), indent); + } + match expr.item { + Expr::Defs(defs, final_expr) => { + fmt_defs(buf, defs)?; + fmt_expr(buf, indent, &final_expr.value, Suffix::None)?; + } + _ => { + fmt_expr(buf, indent, &expr.item, Suffix::None)?; + } + } + if !expr.after.is_empty() { + fmt_spaces(buf, expr.after.iter(), indent); + } + Ok(()) +} + +fn fmt_expr_ensure_block( + buf: &mut Buf<'_>, + indent: u16, + expr: &Expr<'_>, +) -> Result<(), MigrateError> { + if matches!(expr, Expr::Defs(..)) { + fmt_expr(buf, indent, expr, Suffix::None)?; + } else { + buf.indent(indent); + buf.push('{'); + buf.ensure_ends_with_newline(); + fmt_expr(buf, indent + 4, expr, Suffix::None)?; + buf.ensure_ends_with_newline(); + buf.indent(indent); + buf.push('}'); + } + Ok(()) +} + +fn fmt_suffix(buf: &mut Buf, indent: u16, suffix: Suffix) { + buf.indent(indent); + match suffix { + Suffix::None => {} + Suffix::Comma => buf.push(','), + Suffix::OpenRound => buf.push('('), + Suffix::Question => buf.push('?'), + } +} + +enum CollectionHead<'a> { + Mapper(&'a Loc>), + Update(&'a Loc>), +} + +enum CollectionTail<'a> { + Ext(TypeAnnotation<'a>), +} + +fn fmt_collection( + buf: &mut Buf<'_>, + indent: u16, + braces: Braces, + head: Option>, + collection: Collection<'_, F>, + tail: Option>, +) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push(braces.start()); + if collection.is_empty() && collection.final_comments().is_empty() && head.is_none() { + buf.push(braces.end()); + return Ok(()); + } + + if let Some(head) = head { + match head { + CollectionHead::Mapper(mapper) => { + fmt_expr(buf, indent, &mapper.value, Suffix::None)?; + buf.indent(indent); + buf.push_str("<-"); + } + CollectionHead::Update(update) => { + fmt_expr(buf, indent, &update.value, Suffix::None)?; + buf.indent(indent); + buf.push_str("&"); + } + } + } + + for item in collection.iter() { + item.fmt(buf, indent + 4, Suffix::Comma)?; + } + + if let Some(tail) = tail { + match tail { + CollectionTail::Ext(ext) => { + buf.indent(indent); + buf.push_str(".."); + ext.fmt(buf, indent, Suffix::None)?; + } + } + } + + if !collection.final_comments().is_empty() { + fmt_spaces(buf, collection.final_comments().iter(), indent); + } + + buf.indent(indent); + buf.push(braces.end()); + + Ok(()) +} +impl Fmt for TypeVar<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + TypeVar::Identifier(name) => { + buf.indent(indent); + buf.push_str(name); + + fmt_suffix(buf, indent, suffix); + } + TypeVar::SpaceBefore(type_var, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + type_var.fmt(buf, indent, suffix)?; + } + TypeVar::SpaceAfter(type_var, comment_or_newlines) => { + type_var.fmt(buf, indent, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + TypeVar::Malformed(expr) => { + fmt_expr(buf, indent, expr, suffix)?; + } + } + Ok(()) + } +} + +impl Fmt for TypeHeader<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str(self.name.value); + buf.push('('); + for arg in self.vars { + arg.fmt(buf, indent, Suffix::Comma)?; + } + buf.indent(indent); + buf.push(')'); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for Tag<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + Tag::Apply { name, args } => { + buf.indent(indent); + buf.push_str(name.value); + if !args.is_empty() { + buf.push('('); + for arg in args.iter() { + arg.fmt(buf, indent, Suffix::Comma)?; + } + buf.indent(indent); + buf.push(')'); + } + + fmt_suffix(buf, indent, suffix); + } + Tag::SpaceBefore(tag, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + tag.fmt(buf, indent, suffix)?; + } + Tag::SpaceAfter(tag, comment_or_newlines) => { + tag.fmt(buf, indent, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + } + Ok(()) + } +} + +impl Fmt for TypeAnnotation<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + TypeAnnotation::Function(args, function_arrow, res) => { + for arg in args.iter() { + arg.fmt(buf, indent, Suffix::Comma)?; + } + match function_arrow { + FunctionArrow::Pure => { + buf.push_str(" ->"); + } + FunctionArrow::Effectful => { + buf.push_str(" =>"); + } + } + buf.spaces(1); + res.fmt(buf, indent, Suffix::None)?; + } + TypeAnnotation::Apply(module, func, locs) => { + buf.indent(indent); + if !module.is_empty() { + buf.push_str(module); + buf.push('.'); + } + buf.push_str(func); + if !locs.is_empty() { + buf.push('('); + for loc in locs.iter() { + loc.fmt(buf, indent, Suffix::Comma)?; + } + buf.indent(indent); + buf.push(')'); + } + } + TypeAnnotation::BoundVariable(name) => { + buf.indent(indent); + buf.push_str(name); + } + TypeAnnotation::As(lhs, comment_or_newlines, type_header) => { + lhs.fmt(buf, indent, Suffix::None)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + buf.indent(indent); + buf.push_str("as"); + buf.spaces(1); + type_header.fmt(buf, indent, Suffix::None)?; + } + TypeAnnotation::Record { fields, ext } => { + fmt_collection( + buf, + indent, + Braces::Curly, + None, + *fields, + ext.map(|ext| CollectionTail::Ext(ext.value)), + )?; + } + TypeAnnotation::Tuple { elems, ext } => { + fmt_collection( + buf, + indent, + Braces::Round, + None, + *elems, + ext.map(|ext| CollectionTail::Ext(ext.value)), + )?; + } + TypeAnnotation::TagUnion { ext, tags } => { + fmt_collection( + buf, + indent, + Braces::Square, + None, + *tags, + ext.map(|ext| CollectionTail::Ext(ext.value)), + )?; + } + TypeAnnotation::Inferred => { + buf.indent(indent); + buf.push_str("_"); + } + TypeAnnotation::Wildcard => { + buf.indent(indent); + buf.push_str("*"); + } + TypeAnnotation::Where(left, clauses) => { + left.fmt(buf, indent, Suffix::None)?; + for clause in clauses.iter() { + buf.indent(indent); + buf.push_str(" where"); + buf.spaces(1); + clause.value.fmt(buf, indent, Suffix::None)?; + } + } + TypeAnnotation::SpaceBefore(type_annotation, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + type_annotation.fmt(buf, indent, suffix)?; + } + TypeAnnotation::SpaceAfter(type_annotation, comment_or_newlines) => { + type_annotation.fmt(buf, indent, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + TypeAnnotation::Malformed(_) => todo!(), + } + + if !matches!( + self, + TypeAnnotation::SpaceAfter(..) | TypeAnnotation::SpaceBefore(..) + ) { + fmt_suffix(buf, indent, suffix); + } + Ok(()) + } +} + +impl Fmt for Spaced<'_, F> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + Spaced::Item(value) => value.fmt(buf, indent, suffix)?, + Spaced::SpaceBefore(spaced, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + spaced.fmt(buf, indent, suffix)?; + } + Spaced::SpaceAfter(spaced, comment_or_newlines) => { + spaced.fmt(buf, indent, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + } + Ok(()) + } +} + +impl Fmt for &str { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str(self); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for ImplementsClause<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + self.var.value.fmt(buf, indent, Suffix::None)?; + buf.indent(indent); + buf.push_str(" implements"); + buf.spaces(1); + for (i, var) in self.abilities.iter().enumerate() { + if i > 0 { + buf.indent(indent); + buf.spaces(1); + buf.push_str("&"); + buf.spaces(1); + } + var.fmt(buf, indent, Suffix::None)?; + } + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for ImplementsAbilities<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + if !self.before_implements_kw.is_empty() { + buf.newline(); + buf.indent(indent); + fmt_spaces(buf, self.before_implements_kw.iter(), indent); + } + buf.ensure_ends_with_newline(); + buf.indent(indent); + buf.push_str(roc_parse::keyword::IMPLEMENTS); + if !self.after_implements_kw.is_empty() { + fmt_spaces(buf, self.after_implements_kw.iter(), indent); + } + buf.ensure_ends_with_whitespace(); + fmt_collection(buf, indent, Braces::Square, None, self.item.value, None)?; + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for AbilityImpls<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + AbilityImpls::AbilityImpls(impls) => { + fmt_collection(buf, indent, Braces::Curly, None, *impls, None)?; + fmt_suffix(buf, indent, suffix); + } + AbilityImpls::SpaceBefore(impls, spaces) => { + fmt_spaces(buf, spaces.iter(), indent); + impls.fmt(buf, indent, suffix)?; + } + AbilityImpls::SpaceAfter(impls, spaces) => { + impls.fmt(buf, indent, suffix)?; + fmt_spaces(buf, spaces.iter(), indent); + } + } + Ok(()) + } +} + +impl Fmt for ImplementsAbility<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + ImplementsAbility::ImplementsAbility { ability, impls } => { + ability.fmt(buf, indent, Suffix::None)?; + if let Some(impls) = impls { + buf.push_str(" implements"); + buf.spaces(1); + impls.fmt(buf, indent, Suffix::None)?; + } + fmt_suffix(buf, indent, suffix); + } + ImplementsAbility::SpaceBefore(implements_ability, comment_or_newlines) => { + fmt_spaces(buf, comment_or_newlines.iter(), indent); + implements_ability.fmt(buf, indent, suffix)?; + } + ImplementsAbility::SpaceAfter(implements_ability, comment_or_newlines) => { + implements_ability.fmt(buf, indent, suffix)?; + fmt_spaces(buf, comment_or_newlines.iter(), indent); + } + } + Ok(()) + } +} +impl Fmt for TypeDef<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + TypeDef::Alias { header, ann } => { + header.fmt(buf, indent, Suffix::None)?; + buf.push_str(" :"); + buf.spaces(1); + ann.fmt(buf, indent, Suffix::None)?; + } + TypeDef::Opaque { + header, + typ, + derived, + } => { + header.fmt(buf, indent, Suffix::None)?; + buf.push_str(" :="); + buf.spaces(1); + typ.fmt(buf, indent, Suffix::None)?; + if let Some(derived) = derived { + buf.push_str(" implements"); + buf.spaces(1); + derived.fmt(buf, indent, Suffix::None)?; + } + } + TypeDef::Ability { + header: _, + loc_implements: _, + members: _, + } => return Err(MigrateError::AbilitiesNotSupported), + } + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +#[derive(Debug)] +pub enum MigrateError { + AbilitiesNotSupported, + MalformedIdentNotSupported, + MalformedPatternNotSupported, + MalformedPatternIdentNotSupported, + MalformedPatternAsExprNotSupported, + PrecedenceConflictNotSupported, +} + +impl Fmt for ValueDef<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + ValueDef::Annotation(pat, ty) => { + fmt_pattern(buf, indent, &pat.value, Suffix::None)?; + buf.indent(indent); + buf.push_str(":"); + buf.spaces(1); + ty.fmt(buf, indent, Suffix::None)?; + } + ValueDef::Body(pat, body) => { + fmt_pattern(buf, indent, &pat.value, Suffix::None)?; + buf.indent(indent); + buf.push_str(" ="); + buf.spaces(1); + body.fmt(buf, indent, Suffix::None)?; + } + ValueDef::AnnotatedBody { + ann_pattern, + ann_type, + lines_between, + body_pattern, + body_expr, + } => { + ann_pattern.fmt(buf, indent, Suffix::None)?; + buf.indent(indent); + buf.push_str(":"); + buf.spaces(1); + ann_type.fmt(buf, indent, Suffix::None)?; + fmt_spaces(buf, lines_between.iter(), indent); + body_pattern.fmt(buf, indent, Suffix::None)?; + buf.indent(indent); + buf.push_str(" ="); + buf.spaces(1); + body_expr.fmt(buf, indent, Suffix::None)?; + } + ValueDef::Dbg { + condition, + preceding_comment: _, + } => { + buf.indent(indent); + buf.push_str("dbg"); + buf.spaces(1); + fmt_expr(buf, indent, &condition.value, Suffix::None)?; + } + ValueDef::Expect { + condition, + preceding_comment: _, + } => { + buf.indent(indent); + buf.push_str("expect"); + buf.spaces(1); + fmt_expr(buf, indent, &condition.value, Suffix::None)?; + } + ValueDef::ModuleImport(module_import) => { + module_import.fmt(buf, indent, Suffix::None)?; + } + ValueDef::IngestedFileImport(ingested_file_import) => { + ingested_file_import.fmt(buf, indent, Suffix::None)?; + } + ValueDef::Stmt(loc) => { + fmt_expr(buf, indent, &loc.value, suffix)?; + } + ValueDef::StmtAfterExpr => todo!(), + } + Ok(()) + } +} + +impl Fmt for IngestedFileImport<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + let Self { + before_path, + path, + name, + annotation, + } = self; + + buf.indent(indent); + buf.push_str("import"); + + let indent = indent + 4; + + if !before_path.is_empty() { + fmt_spaces(buf, before_path.iter(), indent); + } + fmt_str_literal(buf, path.value, indent); + + name.keyword.fmt(buf, indent, Suffix::None)?; + buf.indent(indent); + buf.push_str(name.item.value); + + if let Some(annotation) = annotation { + annotation.fmt(buf, indent, Suffix::None)?; + } + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for IngestedFileAnnotation<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + if !self.before_colon.is_empty() { + fmt_spaces(buf, self.before_colon.iter(), indent); + } + buf.indent(indent); + buf.push_str(":"); + buf.spaces(1); + self.annotation.fmt(buf, indent, Suffix::None)?; + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for ImportedModuleName<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + + if let Some(package_shorthand) = self.package { + buf.push_str(package_shorthand); + buf.push_str("."); + } + + self.name.fmt(buf, indent, Suffix::None)?; + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for Spaces<'_, F> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + if !self.before.is_empty() { + fmt_spaces(buf, self.before.iter(), indent); + } + self.item.fmt(buf, indent, Suffix::None)?; + if !self.after.is_empty() { + fmt_spaces(buf, self.after.iter(), indent); + } + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for SpacesBefore<'_, F> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + if !self.before.is_empty() { + fmt_spaces(buf, self.before.iter(), indent); + } + self.item.fmt(buf, indent, suffix)?; + Ok(()) + } +} + +impl Fmt for ExposedName<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str(self.as_str()); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for ModuleName<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str(self.as_str()); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for ModuleImport<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + let Self { + before_name, + name, + params, + alias, + exposed, + } = self; + + buf.indent(indent); + buf.push_str("import"); + + if !before_name.is_empty() { + fmt_spaces(buf, before_name.iter(), indent); + } + + name.fmt(buf, indent, Suffix::None)?; + if let Some(params) = params { + params.fmt(buf, indent, Suffix::None)?; + } + if let Some(alias) = alias { + alias.fmt(buf, indent, Suffix::None)?; + } + + if let Some(exposed) = exposed { + exposed.keyword.fmt(buf, indent, Suffix::None)?; + fmt_collection(buf, indent, Braces::Square, None, exposed.item, None)?; + } + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} +macro_rules! impl_fmt_for_keywords { + ($($t:ty),*) => { + $( + impl Fmt for $t { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str(<$t as Keyword>::KEYWORD); + fmt_suffix(buf, indent, suffix); + Ok(()) + } + } + )* + }; +} + +impl_fmt_for_keywords!(ImportExposingKeyword, ImportAsKeyword); + +impl Fmt for ImportAlias<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str(self.as_str()); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for ModuleImportParams<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + if !self.before.is_empty() { + fmt_spaces(buf, self.before.iter(), indent); + } + fmt_collection(buf, indent, Braces::Curly, None, self.params.value, None)?; + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for KeywordItem<'_, K, V> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str(K::KEYWORD); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for ModuleHeader<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + buf.indent(indent); + buf.push_str("module"); + + let mut indent = fmt_spaces_with_outdent(buf, self.after_keyword, 0); + + if let Some(params) = &self.params { + if is_collection_multiline(¶ms.pattern.value) { + indent = 4; + } + + fmt_collection(buf, indent, Braces::Curly, None, params.pattern.value, None)?; + + indent = fmt_spaces_with_outdent(buf, params.before_arrow, indent); + buf.push_str("->"); + indent = fmt_spaces_with_outdent(buf, params.after_arrow, indent); + } + + fmt_collection(buf, indent, Braces::Square, None, self.exposes, None)?; + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for AppHeader<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + fmt_app_header(buf, self); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for PackageHeader<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + fmt_package_header(buf, self); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for PlatformHeader<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + fmt_platform_header(buf, self); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for HostedHeader<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + fmt_hosted_header(buf, self); + fmt_suffix(buf, indent, suffix); + Ok(()) + } +} + +impl Fmt for Header<'_> { + fn fmt(&self, buf: &mut Buf, indent: u16, suffix: Suffix) -> Result<(), MigrateError> { + match self { + Header::Module(module_header) => module_header.fmt(buf, indent, suffix), + Header::App(app_header) => app_header.fmt(buf, indent, suffix), + Header::Package(package_header) => package_header.fmt(buf, indent, suffix), + Header::Platform(platform_header) => platform_header.fmt(buf, indent, suffix), + Header::Hosted(hosted_header) => hosted_header.fmt(buf, indent, suffix), + } + } +} + +pub fn fmt_header( + buf: &mut Buf<'_>, + header: &SpacesBefore<'_, Header<'_>>, +) -> Result<(), MigrateError> { + header.fmt(buf, 0, Suffix::None) +} + +pub fn fmt_defs(buf: &mut Buf<'_>, defs: &Defs<'_>) -> Result<(), MigrateError> { + for (index, def) in defs.defs().enumerate() { + let spaces_before = &defs.spaces[defs.space_before[index].indices()]; + let spaces_after = &defs.spaces[defs.space_after[index].indices()]; + + if !spaces_before.is_empty() { + fmt_spaces(buf, spaces_before.iter(), 0); + } + + match def { + Ok(type_def) => type_def.fmt(buf, 0, Suffix::None)?, + Err(value_def) => value_def.fmt(buf, 0, Suffix::None)?, + } + + if !spaces_after.is_empty() { + fmt_spaces(buf, spaces_after.iter(), 0); + } + } + Ok(()) +} diff --git a/crates/compiler/test_syntax/src/test_helpers.rs b/crates/compiler/test_syntax/src/test_helpers.rs index 11e1171d12..138ae1abad 100644 --- a/crates/compiler/test_syntax/src/test_helpers.rs +++ b/crates/compiler/test_syntax/src/test_helpers.rs @@ -7,6 +7,7 @@ use roc_can::scope::Scope; use roc_can_solo::env::SoloEnv; use roc_can_solo::scope::SoloScope; use roc_error_macros::set_panic_not_exit; +use roc_fmt::migrate::{MigrateError, Suffix}; use roc_fmt::{annotation::Formattable, header::fmt_header, MigrationFlags}; use roc_module::ident::QualifiedModuleName; use roc_module::symbol::{IdentIds, Interns, ModuleIds, PackageModuleIds, Symbol}; @@ -30,7 +31,7 @@ use roc_types::{ types::{AliasVar, Type}, }; -use roc_fmt::Buf; +use roc_fmt::{migrate, Buf}; /// Source code to parse. Usually in the form of a test case. #[derive(Debug, Copy, Clone, PartialEq, Eq)] @@ -253,6 +254,77 @@ impl<'a> Output<'a> { } } } + + pub fn migrate(&self) -> Result { + match self { + Output::Header(header) => { + let arena = Bump::new(); + let mut buf = Buf::new_in( + &arena, + MigrationFlags { + snakify: false, + parens_and_commas: false, + }, + ); + migrate::fmt_header(&mut buf, header)?; + buf.fmt_end_of_file(); + Ok(InputOwned::Header(buf.as_str().to_string())) + } + Output::ModuleDefs(defs) => { + let arena = Bump::new(); + let mut buf = Buf::new_in( + &arena, + MigrationFlags { + snakify: false, + parens_and_commas: false, + }, + ); + migrate::fmt_defs(&mut buf, defs)?; + buf.fmt_end_of_file(); + Ok(InputOwned::ModuleDefs(buf.as_str().to_string())) + } + Output::Expr(expr) => { + let arena = Bump::new(); + let mut buf = Buf::new_in( + &arena, + MigrationFlags { + snakify: false, + parens_and_commas: false, + }, + ); + migrate::fmt_expr_top_level(&mut buf, 0, &expr.value)?; + buf.fmt_end_of_file(); + Ok(InputOwned::Expr(buf.as_str().to_string())) + } + Output::Full(full_ast) => { + let arena = Bump::new(); + let mut buf = Buf::new_in( + &arena, + MigrationFlags { + snakify: false, + parens_and_commas: false, + }, + ); + migrate::fmt_header(&mut buf, &full_ast.header)?; + migrate::fmt_defs(&mut buf, &full_ast.defs)?; + buf.fmt_end_of_file(); + Ok(InputOwned::Full(buf.as_str().to_string())) + } + Output::Pattern(pat) => { + let arena = Bump::new(); + let mut buf = Buf::new_in( + &arena, + MigrationFlags { + snakify: false, + parens_and_commas: false, + }, + ); + migrate::fmt_pattern(&mut buf, 0, &pat.value, Suffix::None)?; + buf.fmt_end_of_file(); + Ok(InputOwned::Pattern(buf.as_str().to_string())) + } + } + } } impl<'a> Malformed for Output<'a> { diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/bad_opaque_ref.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/bad_opaque_ref.expr.migrated.roc new file mode 100644 index 0000000000..be2b8e6858 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/bad_opaque_ref.expr.migrated.roc @@ -0,0 +1 @@ +I() \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/if_in_record_field_opt_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/if_in_record_field_opt_pat.expr.migrated.roc new file mode 100644 index 0000000000..51c2a79cfb --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/if_in_record_field_opt_pat.expr.migrated.roc @@ -0,0 +1,10 @@ +O({p: if + a + { + + A + } else { + &m + }}, # +) : e +i diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/implements_after_comment_with_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/implements_after_comment_with_newline.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/implements_after_comment_with_newline.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/looks_like_implements.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/looks_like_implements.expr.migrated.roc new file mode 100644 index 0000000000..e4e59e431b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/looks_like_implements.expr.migrated.roc @@ -0,0 +1,2 @@ +N((implements),h,(0),) : B +T diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/module_dot_tuple.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/module_dot_tuple.expr.migrated.roc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/negative_number_in_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/negative_number_in_pattern.expr.migrated.roc new file mode 100644 index 0000000000..0c1d19a993 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/negative_number_in_pattern.expr.migrated.roc @@ -0,0 +1,2 @@ +N(-0,T,) : A +zT diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/opaque_in_ann_apply_arg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/opaque_in_ann_apply_arg.expr.migrated.roc new file mode 100644 index 0000000000..5b715577a4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/opaque_in_ann_apply_arg.expr.migrated.roc @@ -0,0 +1,4 @@ +B(@A,) : w +# +@A = e +i diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/parens_comment_in_ty_annotation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/parens_comment_in_ty_annotation.expr.migrated.roc new file mode 100644 index 0000000000..d9b5873f8d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/parens_comment_in_ty_annotation.expr.migrated.roc @@ -0,0 +1,3 @@ +Zx((e # +),f,) : i +s diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/parens_in_type_def_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/parens_in_type_def_apply.expr.migrated.roc new file mode 100644 index 0000000000..75361d799e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/parens_in_type_def_apply.expr.migrated.roc @@ -0,0 +1,2 @@ +U((b(a,)),) : b +a diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/pattern_opt_field_bonanza.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/pattern_opt_field_bonanza.expr.migrated.roc new file mode 100644 index 0000000000..42d35b3119 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/pattern_opt_field_bonanza.expr.migrated.roc @@ -0,0 +1,4 @@ +M({s: s({J& + },)},{s: s({J& + },)},) : p +y diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/qualified_tag.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/qualified_tag.expr.migrated.roc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/quotes_in_parens_in_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/quotes_in_parens_in_pat.expr.migrated.roc new file mode 100644 index 0000000000..dbdf5ba5ed --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/quotes_in_parens_in_pat.expr.migrated.roc @@ -0,0 +1,4 @@ +Q(( +""" +"""("",)),) : a +q diff --git a/crates/compiler/test_syntax/tests/snapshots/malformed/repr_7346.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/malformed/repr_7346.expr.migrated.roc new file mode 100644 index 0000000000..41f2fba7a1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/malformed/repr_7346.expr.migrated.roc @@ -0,0 +1,6 @@ +il3(|k| # w#z +{ + CCC(@C,( # i + t!(K,)),) : i + C +},) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_demand_signature_is_multiline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ability_demand_signature_is_multiline.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_demand_signature_is_multiline.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_multi_line.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ability_multi_line.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_multi_line.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_single_line.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ability_single_line.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_single_line.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_two_in_a_row.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ability_two_in_a_row.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_two_in_a_row.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/accidentally_indented_else.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/accidentally_indented_else.expr.migrated.roc new file mode 100644 index 0000000000..7a6127fe5d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/accidentally_indented_else.expr.migrated.roc @@ -0,0 +1,9 @@ +if +h +{ + + A +} else { + &e +} +s # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/add_var_with_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/add_var_with_spaces.expr.migrated.roc new file mode 100644 index 0000000000..5345b8a83f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/add_var_with_spaces.expr.migrated.roc @@ -0,0 +1 @@ +x + 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/add_with_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/add_with_spaces.expr.migrated.roc new file mode 100644 index 0000000000..e0ef584020 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/add_with_spaces.expr.migrated.roc @@ -0,0 +1 @@ +1 + 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/alias_ann_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/alias_ann_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..30bf28d9d3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/alias_ann_in_parens.expr.migrated.roc @@ -0,0 +1,3 @@ +M() : +r +h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/alias_comment_after_head.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/alias_comment_after_head.expr.migrated.roc new file mode 100644 index 0000000000..5b779edaac --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/alias_comment_after_head.expr.migrated.roc @@ -0,0 +1,3 @@ +A( # +p,) : e +A diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/alias_parens_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/alias_parens_comment.expr.migrated.roc new file mode 100644 index 0000000000..952bb5c0ef --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/alias_parens_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +K() : # +s +K diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/alias_parens_comment_indent.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/alias_parens_comment_indent.expr.migrated.roc new file mode 100644 index 0000000000..2e5c940682 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/alias_parens_comment_indent.expr.migrated.roc @@ -0,0 +1,4 @@ +O() : O(z, +# +) +b # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_apply_record_with_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_apply_record_with_newlines.expr.migrated.roc new file mode 100644 index 0000000000..16e3e6987b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_apply_record_with_newlines.expr.migrated.roc @@ -0,0 +1,4 @@ +8: O( +{ +},) +Q diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_closed_union.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_closed_union.expr.migrated.roc new file mode 100644 index 0000000000..1617b171fb --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_closed_union.expr.migrated.roc @@ -0,0 +1,4 @@ +foo: [True,Perhaps(Thing,),] +foo = True + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_effectful_fn.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_effectful_fn.expr.migrated.roc new file mode 100644 index 0000000000..6b7da2ae88 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_effectful_fn.expr.migrated.roc @@ -0,0 +1,5 @@ +launchTheNukes: {}, => Result(Bool,LaunchNukeErr,) +launchTheNukes = |{}| +crash("todo",) + +launchTheNukes diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_extra_indented_implements.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_extra_indented_implements.expr.migrated.roc new file mode 100644 index 0000000000..ff29cc01b7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_extra_indented_implements.expr.migrated.roc @@ -0,0 +1,5 @@ +2: +r where e + implements +P +u diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_open_union.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_open_union.expr.migrated.roc new file mode 100644 index 0000000000..d78036d30e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_open_union.expr.migrated.roc @@ -0,0 +1,4 @@ +foo: [True,Perhaps(Thing,),..*] +foo = True + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_parens_comments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_parens_comments.expr.migrated.roc new file mode 100644 index 0000000000..7b06240010 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_parens_comments.expr.migrated.roc @@ -0,0 +1,6 @@ +r: +r +# +# + +h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_parens_where_implements_func.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_parens_where_implements_func.expr.migrated.roc new file mode 100644 index 0000000000..77897a233a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_parens_where_implements_func.expr.migrated.roc @@ -0,0 +1,5 @@ +x: a + where +e + implements K, -> Z +s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_pattern_comment_before_body.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_pattern_comment_before_body.expr.migrated.roc new file mode 100644 index 0000000000..b1a0439ac4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_pattern_comment_before_body.expr.migrated.roc @@ -0,0 +1,4 @@ +H() : p +# +s = p +d # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_record_pat_with_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_record_pat_with_comment.expr.migrated.roc new file mode 100644 index 0000000000..7ea8b84614 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_record_pat_with_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +{l: s, # +}: s +o diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_tag_union_newline_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_tag_union_newline_comment.expr.migrated.roc new file mode 100644 index 0000000000..543ed5eb03 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_tag_union_newline_comment.expr.migrated.roc @@ -0,0 +1,4 @@ +k: +[T,..m +] # +D diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ann_where_e_newline_implements.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ann_where_e_newline_implements.expr.migrated.roc new file mode 100644 index 0000000000..18fa5a551f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ann_where_e_newline_implements.expr.migrated.roc @@ -0,0 +1,4 @@ +J() : [ +] where e + implements T +i diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotate_tuple_func.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotate_tuple_func.expr.migrated.roc new file mode 100644 index 0000000000..5ef5098e96 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotate_tuple_func.expr.migrated.roc @@ -0,0 +1,3 @@ +1: (f, + ww, -> p,..e) +Mh diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotated_empty_record_destructure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_empty_record_destructure.expr.migrated.roc new file mode 100644 index 0000000000..150f39651c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_empty_record_destructure.expr.migrated.roc @@ -0,0 +1,3 @@ +E(): B +{} = B +B diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotated_record_destructure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_record_destructure.expr.migrated.roc new file mode 100644 index 0000000000..856cc924ff --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_record_destructure.expr.migrated.roc @@ -0,0 +1,4 @@ +{x,y,}: Foo +{x,y,} = {x: "foo"y: 3.14} + +x diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotated_tag_destructure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_tag_destructure.expr.migrated.roc new file mode 100644 index 0000000000..5c09c46e60 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_tag_destructure.expr.migrated.roc @@ -0,0 +1,4 @@ +UserId(x,): [UserId(I64,),] +UserId(x,) = UserId(42,) + +x diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotated_tuple_destructure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_tuple_destructure.expr.migrated.roc new file mode 100644 index 0000000000..82fbd00e4d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotated_tuple_destructure.expr.migrated.roc @@ -0,0 +1,4 @@ +(x,y,): Foo +(x,y,) = ("foo",3.14,) + +x diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_apply_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_apply_newlines.expr.migrated.roc new file mode 100644 index 0000000000..a8febd1b2a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_apply_newlines.expr.migrated.roc @@ -0,0 +1,4 @@ +A( +p,) : +e +A diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_comment_before_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_comment_before_as.expr.migrated.roc new file mode 100644 index 0000000000..5ee6a10b6a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_comment_before_as.expr.migrated.roc @@ -0,0 +1,3 @@ +e: A # +as H() +n diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_comment_before_colon.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_comment_before_colon.expr.migrated.roc new file mode 100644 index 0000000000..f04b2db4e2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_comment_before_colon.expr.migrated.roc @@ -0,0 +1,4 @@ +A( +e, # g +) : A +AA diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_double_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_double_as.expr.migrated.roc new file mode 100644 index 0000000000..1e10503c70 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_double_as.expr.migrated.roc @@ -0,0 +1,2 @@ +s: eas A()as A() +s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tag_parens_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tag_parens_comment.expr.migrated.roc new file mode 100644 index 0000000000..7262a934f4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tag_parens_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +g: [T(T, # + ),] +D diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_comment.expr.migrated.roc new file mode 100644 index 0000000000..b16dc2a2ff --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +3: (..n # +), -> n +0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_newline.expr.migrated.roc new file mode 100644 index 0000000000..0c93ca73da --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_newline.expr.migrated.roc @@ -0,0 +1,3 @@ +d: (J,..g +) +2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_parens_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_parens_newlines.expr.migrated.roc new file mode 100644 index 0000000000..e6385ee44f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuple_parens_newlines.expr.migrated.roc @@ -0,0 +1,4 @@ +p: (.. +i +) +{} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuples_ext_galore.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuples_ext_galore.expr.migrated.roc new file mode 100644 index 0000000000..4aa7559963 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/annotation_tuples_ext_galore.expr.migrated.roc @@ -0,0 +1,2 @@ +1: ((),..n) +l diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/applies_in_binop.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/applies_in_binop.expr.migrated.roc new file mode 100644 index 0000000000..9b6e22c280 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/applies_in_binop.expr.migrated.roc @@ -0,0 +1,3 @@ +Str.getUnsafe(haystack,haystackIndex,) +== +Str.getUnsafe(needle,needleIndex,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_bang_bang_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_bang_bang_closure.expr.migrated.roc new file mode 100644 index 0000000000..67d4c3d3ea --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_bang_bang_closure.expr.migrated.roc @@ -0,0 +1,3 @@ +!! +|w| 2( +n,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_binop_switch.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_binop_switch.expr.migrated.roc new file mode 100644 index 0000000000..d769eb3e9b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_binop_switch.expr.migrated.roc @@ -0,0 +1,2 @@ +i < 2 +-6 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_closure_pizza.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_closure_pizza.expr.migrated.roc new file mode 100644 index 0000000000..9f0ff47355 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_closure_pizza.expr.migrated.roc @@ -0,0 +1,2 @@ +foo +|> Dict.keepIf(|(k,_v,)| List.contains(keysToDelete,k,) |> Bool.not,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_parenthetical_tag_args.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_parenthetical_tag_args.expr.migrated.roc new file mode 100644 index 0000000000..3acfa442fd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_parenthetical_tag_args.expr.migrated.roc @@ -0,0 +1 @@ +Whee((12),(34),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_record_ann.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_record_ann.expr.migrated.roc new file mode 100644 index 0000000000..47f1767a71 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_record_ann.expr.migrated.roc @@ -0,0 +1,3 @@ +a: N({h +},) +g diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_record_parens_newline_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_record_parens_newline_field.expr.migrated.roc new file mode 100644 index 0000000000..2c137d361a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_record_parens_newline_field.expr.migrated.roc @@ -0,0 +1,2 @@ +0({lxtl: (se # + )},) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag.expr.migrated.roc new file mode 100644 index 0000000000..a2b6c7eeaf --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag.expr.migrated.roc @@ -0,0 +1 @@ +Whee(12,34,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_pnc.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_pnc.expr.migrated.roc new file mode 100644 index 0000000000..a2b6c7eeaf --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_pnc.expr.migrated.roc @@ -0,0 +1 @@ +Whee(12,34,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_single_arg_pnc.pattern.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_single_arg_pnc.pattern.migrated.roc new file mode 100644 index 0000000000..735015a2f3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_single_arg_pnc.pattern.migrated.roc @@ -0,0 +1 @@ +Ok(a,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_single_arg_whitespace.pattern.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_single_arg_whitespace.pattern.migrated.roc new file mode 100644 index 0000000000..735015a2f3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tag_single_arg_whitespace.pattern.migrated.roc @@ -0,0 +1 @@ +Ok(a,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_three_args.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_three_args.expr.migrated.roc new file mode 100644 index 0000000000..6f690bdc1c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_three_args.expr.migrated.roc @@ -0,0 +1 @@ +a(b,c,d,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_tuple_ext_parens_ty.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tuple_ext_parens_ty.expr.migrated.roc new file mode 100644 index 0000000000..314fe63454 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_tuple_ext_parens_ty.expr.migrated.roc @@ -0,0 +1,2 @@ +i: M((),c,) +t diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_two_args.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_two_args.expr.migrated.roc new file mode 100644 index 0000000000..1d2d815b06 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_two_args.expr.migrated.roc @@ -0,0 +1 @@ +whee(12,34,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_two_args_pnc.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_two_args_pnc.expr.migrated.roc new file mode 100644 index 0000000000..1d2d815b06 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_two_args_pnc.expr.migrated.roc @@ -0,0 +1 @@ +whee(12,34,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_unary_negation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_unary_negation.expr.migrated.roc new file mode 100644 index 0000000000..d14197d611 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_unary_negation.expr.migrated.roc @@ -0,0 +1 @@ +-whee(12,foo,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/apply_unary_not.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/apply_unary_not.expr.migrated.roc new file mode 100644 index 0000000000..f5044ee9b3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/apply_unary_not.expr.migrated.roc @@ -0,0 +1 @@ +!whee(12,foo,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/arg_pattern_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/arg_pattern_as.expr.migrated.roc new file mode 100644 index 0000000000..9a81f05ffc --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/arg_pattern_as.expr.migrated.roc @@ -0,0 +1,2 @@ +|{x,y,} as point@Location(inner,) as outer| +crash("",) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/as_in_func_type_args.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/as_in_func_type_args.expr.migrated.roc new file mode 100644 index 0000000000..61917bad78 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/as_in_func_type_args.expr.migrated.roc @@ -0,0 +1,3 @@ +e: J +as H(), -> A +r diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/assign_parens_item_newline_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/assign_parens_item_newline_comment.expr.migrated.roc new file mode 100644 index 0000000000..8c2632940f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/assign_parens_item_newline_comment.expr.migrated.roc @@ -0,0 +1,5 @@ +a = ( +i +# +) +r diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/backslash_closure_last_expr.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/backslash_closure_last_expr.expr.migrated.roc new file mode 100644 index 0000000000..885b91b0d4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/backslash_closure_last_expr.expr.migrated.roc @@ -0,0 +1,2 @@ +b +|e| s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/bang_newline_double_accessor.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/bang_newline_double_accessor.expr.migrated.roc new file mode 100644 index 0000000000..cc8ba27a39 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/bang_newline_double_accessor.expr.migrated.roc @@ -0,0 +1,4 @@ +0 +! +.d +.d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/bangs_and_tuple_accessors.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/bangs_and_tuple_accessors.expr.migrated.roc new file mode 100644 index 0000000000..b73d922fe0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/bangs_and_tuple_accessors.expr.migrated.roc @@ -0,0 +1,3 @@ +J +! +.1(!.0,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/basic_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/basic_apply.expr.migrated.roc new file mode 100644 index 0000000000..2816614ffe --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/basic_apply.expr.migrated.roc @@ -0,0 +1 @@ +whee(1,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/basic_docs.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/basic_docs.expr.migrated.roc new file mode 100644 index 0000000000..2f66a22f48 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/basic_docs.expr.migrated.roc @@ -0,0 +1,9 @@ +## first line of docs +## second line +## third line +## fourth line +## +## sixth line after doc new line +x = 5 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/basic_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/basic_field.expr.migrated.roc new file mode 100644 index 0000000000..10f0d56fcc --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/basic_field.expr.migrated.roc @@ -0,0 +1 @@ +rec.field diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/basic_tag.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/basic_tag.expr.migrated.roc new file mode 100644 index 0000000000..23f36beb39 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/basic_tag.expr.migrated.roc @@ -0,0 +1 @@ +Whee diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/basic_tuple.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/basic_tuple.expr.migrated.roc new file mode 100644 index 0000000000..8e9d6596c5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/basic_tuple.expr.migrated.roc @@ -0,0 +1 @@ +(1,2,3,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/basic_var.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/basic_var.expr.migrated.roc new file mode 100644 index 0000000000..c6284d24b6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/basic_var.expr.migrated.roc @@ -0,0 +1 @@ +whee diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/binop_apply_complex.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/binop_apply_complex.expr.migrated.roc new file mode 100644 index 0000000000..bb165683ce --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/binop_apply_complex.expr.migrated.roc @@ -0,0 +1 @@ +N < l((r * N),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/binop_assign_defs_nested.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/binop_assign_defs_nested.expr.migrated.roc new file mode 100644 index 0000000000..fe29880a60 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/binop_assign_defs_nested.expr.migrated.roc @@ -0,0 +1,5 @@ +5 - (({ + e = (( + r)) + 1 +})) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/binop_closure_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/binop_closure_apply.expr.migrated.roc new file mode 100644 index 0000000000..050bd02e1c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/binop_closure_apply.expr.migrated.roc @@ -0,0 +1,3 @@ +d + +(|w| x)( +x,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/binops_comment_indent_change.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/binops_comment_indent_change.expr.migrated.roc new file mode 100644 index 0000000000..b888b0d9fa --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/binops_comment_indent_change.expr.migrated.roc @@ -0,0 +1,4 @@ +r ^ +-f( +# +-P,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/block_string_ann.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/block_string_ann.expr.migrated.roc new file mode 100644 index 0000000000..47c656f4f6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/block_string_ann.expr.migrated.roc @@ -0,0 +1,2 @@ +"${g}": q +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/body_block_string_apply_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/body_block_string_apply_string.expr.migrated.roc new file mode 100644 index 0000000000..4da470d6a6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/body_block_string_apply_string.expr.migrated.roc @@ -0,0 +1,5 @@ +t = +""" +" +"""("",) +S diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/body_with_unneeded_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/body_with_unneeded_parens.expr.migrated.roc new file mode 100644 index 0000000000..be03e8a1a5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/body_with_unneeded_parens.expr.migrated.roc @@ -0,0 +1,3 @@ +a = ( +6) +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/call_bang.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/call_bang.expr.migrated.roc new file mode 100644 index 0000000000..006b5f6f18 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/call_bang.expr.migrated.roc @@ -0,0 +1 @@ +launchTheNukes!(123,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/call_bang_no_space.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/call_bang_no_space.expr.migrated.roc new file mode 100644 index 0000000000..d8bfed935e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/call_bang_no_space.expr.migrated.roc @@ -0,0 +1 @@ +fxFn!(arg,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/can_ignored_field_in_import.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/can_ignored_field_in_import.expr.migrated.roc new file mode 100644 index 0000000000..1d5e2dbb0b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/can_ignored_field_in_import.expr.migrated.roc @@ -0,0 +1,3 @@ +importP{_: h +} +t! diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/capture_body_parens_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/capture_body_parens_comment.expr.migrated.roc new file mode 100644 index 0000000000..72fda6bf4b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/capture_body_parens_comment.expr.migrated.roc @@ -0,0 +1,2 @@ +|L| E +# diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_arg_parens_then_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_arg_parens_then_comment.expr.migrated.roc new file mode 100644 index 0000000000..e092bcfef1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_arg_parens_then_comment.expr.migrated.roc @@ -0,0 +1 @@ +|8| T # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_complex_pattern_indent_issue.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_complex_pattern_indent_issue.expr.migrated.roc new file mode 100644 index 0000000000..8d30cdcf3b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_complex_pattern_indent_issue.expr.migrated.roc @@ -0,0 +1,4 @@ +|I({p? Y( + Y,)?,},[ +],)| +K # ( diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_in_apply_in_binop.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_in_apply_in_binop.expr.migrated.roc new file mode 100644 index 0000000000..5eec83aa87 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_in_apply_in_binop.expr.migrated.roc @@ -0,0 +1,2 @@ +m0(|w| w?(e,),) +/ s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_in_binop_with_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_in_binop_with_spaces.expr.migrated.roc new file mode 100644 index 0000000000..8518120de5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_in_binop_with_spaces.expr.migrated.roc @@ -0,0 +1,2 @@ +i > |s| s +-a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_newline_empty_record_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_newline_empty_record_newline.expr.migrated.roc new file mode 100644 index 0000000000..57791a1dbe --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_newline_empty_record_newline.expr.migrated.roc @@ -0,0 +1,4 @@ +|L| +{ +} +Θ diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_parens_double_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_parens_double_newlines.expr.migrated.roc new file mode 100644 index 0000000000..ae685d1f95 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_parens_double_newlines.expr.migrated.roc @@ -0,0 +1,3 @@ +|L(z, + +)| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_pat_reccord_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_pat_reccord_comment.expr.migrated.roc new file mode 100644 index 0000000000..a3d2bbec3f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_pat_reccord_comment.expr.migrated.roc @@ -0,0 +1,2 @@ +|{i, # + e,}| a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_with_binops_and_unary.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_with_binops_and_unary.expr.migrated.roc new file mode 100644 index 0000000000..fbde549294 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_with_binops_and_unary.expr.migrated.roc @@ -0,0 +1,3 @@ +m +^ (-|w| m)( +w,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/closure_with_underscores.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/closure_with_underscores.expr.migrated.roc new file mode 100644 index 0000000000..952256d78f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/closure_with_underscores.expr.migrated.roc @@ -0,0 +1 @@ +|__name| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comma_prefixed_indented_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comma_prefixed_indented_record.expr.migrated.roc new file mode 100644 index 0000000000..0bb283c540 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comma_prefixed_indented_record.expr.migrated.roc @@ -0,0 +1,8 @@ +Model(position,) : +{evaluated: Set(position,) + openSet: Set(position,) + costs: Dict.Dict(position,F64,) + cameFrom: Dict.Dict(position,position,) +} + +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_annotation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_annotation.expr.migrated.roc new file mode 100644 index 0000000000..ba394f5f80 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_annotation.expr.migrated.roc @@ -0,0 +1,3 @@ +F() : e # + +q diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_dbg_in_empty_record_assignment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_dbg_in_empty_record_assignment.expr.migrated.roc new file mode 100644 index 0000000000..7e62fbd24c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_dbg_in_empty_record_assignment.expr.migrated.roc @@ -0,0 +1,2 @@ +dbg(l,) # +n diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_def.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_def.moduledefs.migrated.roc new file mode 100644 index 0000000000..11c39e4de9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_def.moduledefs.migrated.roc @@ -0,0 +1 @@ +foo = 1 # comment after diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_expr_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_expr_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..1fea7b8d17 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_expr_in_parens.expr.migrated.roc @@ -0,0 +1 @@ +i # abc diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_op.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_op.expr.migrated.roc new file mode 100644 index 0000000000..c69fc1a583 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_op.expr.migrated.roc @@ -0,0 +1,2 @@ +12 * # test! +92 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_whitespace_apply_arg_inside_pnc_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_whitespace_apply_arg_inside_pnc_apply.expr.migrated.roc new file mode 100644 index 0000000000..edac8b8665 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_after_whitespace_apply_arg_inside_pnc_apply.expr.migrated.roc @@ -0,0 +1,9 @@ +PP(P(@P(P( +P(PPP(P( +PPP,), +), +), +PP(mport, # <|"P +),), +),), +) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_colon_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_colon_def.expr.migrated.roc new file mode 100644 index 0000000000..98cf00994b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_colon_def.expr.migrated.roc @@ -0,0 +1,3 @@ +w # +: n +Q diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_comma_in_tuple_type_with_func.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_comma_in_tuple_type_with_func.expr.migrated.roc new file mode 100644 index 0000000000..2ce3e050ca --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_comma_in_tuple_type_with_func.expr.migrated.roc @@ -0,0 +1,3 @@ +1: (M,b, # , + h, -> g,..e) +h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_equals_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_equals_def.expr.migrated.roc new file mode 100644 index 0000000000..f5b068eb32 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_equals_def.expr.migrated.roc @@ -0,0 +1,3 @@ +t # + = 3 +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_op.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_op.expr.migrated.roc new file mode 100644 index 0000000000..68be28015e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_op.expr.migrated.roc @@ -0,0 +1,2 @@ +3 # test! ++ 4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_pat_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_pat_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..7a668b0c4c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_before_pat_in_parens.expr.migrated.roc @@ -0,0 +1,4 @@ + +# +6: s +h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_closure_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_closure_pat.expr.migrated.roc new file mode 100644 index 0000000000..f87a865f6e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_closure_pat.expr.migrated.roc @@ -0,0 +1,2 @@ +|L( # +i,)| -e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_closure_pat_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_closure_pat_apply.expr.migrated.roc new file mode 100644 index 0000000000..b3ea45a2a5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_closure_pat_apply.expr.migrated.roc @@ -0,0 +1,2 @@ +|LM( # +Q,)| f8 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_tuple_ext.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_tuple_ext.expr.migrated.roc new file mode 100644 index 0000000000..bb26223127 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_in_tuple_ext.expr.migrated.roc @@ -0,0 +1,2 @@ +t: () +p # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_indent_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_indent_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..0103a77ba4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_indent_in_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +1(0, # +# +): gi +M diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_inside_empty_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_inside_empty_list.expr.migrated.roc new file mode 100644 index 0000000000..45837472f6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_inside_empty_list.expr.migrated.roc @@ -0,0 +1,2 @@ +[ # comment +] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_parens_in_typ_annotation_record_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_parens_in_typ_annotation_record_field.expr.migrated.roc new file mode 100644 index 0000000000..66afad1c47 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_parens_in_typ_annotation_record_field.expr.migrated.roc @@ -0,0 +1,3 @@ +i: {t: J # +} +A diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/comment_with_non_ascii.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/comment_with_non_ascii.expr.migrated.roc new file mode 100644 index 0000000000..9b2c419163 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/comment_with_non_ascii.expr.migrated.roc @@ -0,0 +1,2 @@ +3 # 2 × 2 ++ 4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/compare_apply_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/compare_apply_record.expr.migrated.roc new file mode 100644 index 0000000000..223b9a2c91 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/compare_apply_record.expr.migrated.roc @@ -0,0 +1,4 @@ +x > +x({ + +},) < r diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/control_characters_in_scalar.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/control_characters_in_scalar.expr.migrated.roc new file mode 100644 index 0000000000..81a9bcb91b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/control_characters_in_scalar.expr.migrated.roc @@ -0,0 +1 @@ +'\u(7)' diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/crash.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/crash.expr.migrated.roc new file mode 100644 index 0000000000..8045e45c4e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/crash.expr.migrated.roc @@ -0,0 +1,11 @@ +_ = crash("",) +_ = crash("","",) +_ = crash(15,123,) +_ = try(foo,(|_| crash("",)),) +_ = +{ + _ = crash("",) + crash +} + +{f: crash("",)} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/crazy_annotation_left.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_annotation_left.expr.migrated.roc new file mode 100644 index 0000000000..e8930daba4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_annotation_left.expr.migrated.roc @@ -0,0 +1,4 @@ +1(0( # +0,), +)(f,): f +t diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/crazy_annotation_left2.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_annotation_left2.expr.migrated.roc new file mode 100644 index 0000000000..8330618a96 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_annotation_left2.expr.migrated.roc @@ -0,0 +1,6 @@ +1(ts(0, + +# +), +)(f,): i7f +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/crazy_implements_bangs.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_implements_bangs.expr.migrated.roc new file mode 100644 index 0000000000..0e8b96ded1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_implements_bangs.expr.migrated.roc @@ -0,0 +1,4 @@ +P() := p implements +# +implements [] +n diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/crazy_parens_multiline_str_question_etc.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_parens_multiline_str_question_etc.expr.migrated.roc new file mode 100644 index 0000000000..228fff9ee4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_parens_multiline_str_question_etc.expr.migrated.roc @@ -0,0 +1,6 @@ +(({ + d + - + """ + """()? +}))(Y,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/crazy_pat_ann.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_pat_ann.expr.migrated.roc new file mode 100644 index 0000000000..babde706c4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/crazy_pat_ann.expr.migrated.roc @@ -0,0 +1,4 @@ +0( +# +f,): f +t diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/curried_function_type.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/curried_function_type.expr.migrated.roc new file mode 100644 index 0000000000..a35450e977 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/curried_function_type.expr.migrated.roc @@ -0,0 +1,2 @@ +1: w, -> w, -> p +h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg.expr.migrated.roc new file mode 100644 index 0000000000..b9aa22549d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg.expr.migrated.roc @@ -0,0 +1 @@ +dbg(1,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_double.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_double.expr.migrated.roc new file mode 100644 index 0000000000..e7cd75f501 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_double.expr.migrated.roc @@ -0,0 +1 @@ +dbg(dbg,g,g,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_double_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_double_newline.expr.migrated.roc new file mode 100644 index 0000000000..db98eb6820 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_double_newline.expr.migrated.roc @@ -0,0 +1,2 @@ +dbg(dbg, +a,g,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_extra_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_extra_parens.expr.migrated.roc new file mode 100644 index 0000000000..f894dd4a4a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_extra_parens.expr.migrated.roc @@ -0,0 +1,2 @@ +dbg(d,z,) +dd diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_newline_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_newline_apply.expr.migrated.roc new file mode 100644 index 0000000000..a71388a121 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_newline_apply.expr.migrated.roc @@ -0,0 +1,4 @@ +dbg( + +izzb, +interfacesb,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_a_over_a.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_a_over_a.expr.migrated.roc new file mode 100644 index 0000000000..4c854d0915 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_a_over_a.expr.migrated.roc @@ -0,0 +1,2 @@ +dbg(a / a,) +d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_in_double_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_in_double_parens.expr.migrated.roc new file mode 100644 index 0000000000..e2b9d27b4b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_in_double_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +({ + (dbg(r,)) + r +}) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_zero_args.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_zero_args.expr.migrated.roc new file mode 100644 index 0000000000..a9c0e31c98 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_pnc_zero_args.expr.migrated.roc @@ -0,0 +1,2 @@ +dbg() +d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt.expr.migrated.roc new file mode 100644 index 0000000000..a9eef8ef26 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt.expr.migrated.roc @@ -0,0 +1,4 @@ + +dbg (1 == 1) + +4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..d38d4774fc --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_in_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +(dbg D, +q + +h) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_multiline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_multiline.expr.migrated.roc new file mode 100644 index 0000000000..8332c85b49 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_multiline.expr.migrated.roc @@ -0,0 +1,4 @@ +dbg (5, + 666,) + +4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_two_exprs.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_two_exprs.expr.migrated.roc new file mode 100644 index 0000000000..4ed64023ec --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_stmt_two_exprs.expr.migrated.roc @@ -0,0 +1,6 @@ +dbg +(q( +qt,)) + +g( +qt,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/dbg_then_double_parens_cont.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_then_double_parens_cont.expr.migrated.roc new file mode 100644 index 0000000000..73c94e97d5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/dbg_then_double_parens_cont.expr.migrated.roc @@ -0,0 +1,4 @@ +dbg g + +L +# diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/def_bang.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/def_bang.expr.migrated.roc new file mode 100644 index 0000000000..1bf0bc2ec7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/def_bang.expr.migrated.roc @@ -0,0 +1,4 @@ +launchTheNukes! = |{}| +boom + +launchTheNukes!({},) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/def_multistring_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/def_multistring_apply.expr.migrated.roc new file mode 100644 index 0000000000..5d23f0f443 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/def_multistring_apply.expr.migrated.roc @@ -0,0 +1,4 @@ +e = +""" +"""(a,) +p diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/defs_suffixed_middle_extra_indents.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/defs_suffixed_middle_extra_indents.moduledefs.migrated.roc new file mode 100644 index 0000000000..ad6dc61f23 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/defs_suffixed_middle_extra_indents.moduledefs.migrated.roc @@ -0,0 +1,13 @@ +main = +{ + a = "Foo" + Stdout.line?(a,) + + printBar? +} + +printBar = +{ + b = "Bar" + Stdout.line(b,) +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/destructure_tag_assignment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/destructure_tag_assignment.expr.migrated.roc new file mode 100644 index 0000000000..5644db2ac4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/destructure_tag_assignment.expr.migrated.roc @@ -0,0 +1,2 @@ +Email(str,) = Email("blah@example.com",) +str diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/docs.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/docs.expr.migrated.roc new file mode 100644 index 0000000000..2d217990cd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/docs.expr.migrated.roc @@ -0,0 +1,8 @@ +####### +### not docs! +## actually docs +## +###### +x = 5 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/double_closure_newlines_binop.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/double_closure_newlines_binop.expr.migrated.roc new file mode 100644 index 0000000000..ad45fd4d92 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/double_closure_newlines_binop.expr.migrated.roc @@ -0,0 +1,3 @@ +|j| e(|B +| B,) +> s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/double_function_tuple.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/double_function_tuple.expr.migrated.roc new file mode 100644 index 0000000000..4ada859f59 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/double_function_tuple.expr.migrated.roc @@ -0,0 +1,3 @@ +1: (w, -> p, + w, -> p,) +h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/double_parens_comment_tuple_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/double_parens_comment_tuple_pat.expr.migrated.roc new file mode 100644 index 0000000000..538702be86 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/double_parens_comment_tuple_pat.expr.migrated.roc @@ -0,0 +1,4 @@ +(0( # + e,),0( # + p,),): f +t # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/double_question_binop.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/double_question_binop.expr.migrated.roc new file mode 100644 index 0000000000..1f1acfa1df --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/double_question_binop.expr.migrated.roc @@ -0,0 +1 @@ +get_name!({},) ?? "Bob" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/double_space_before.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/double_space_before.expr.migrated.roc new file mode 100644 index 0000000000..efc1c2bef1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/double_space_before.expr.migrated.roc @@ -0,0 +1,4 @@ +1: ( + + M,..w) +ah diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/effectful_closure_statements.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/effectful_closure_statements.expr.migrated.roc new file mode 100644 index 0000000000..13f932cae8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/effectful_closure_statements.expr.migrated.roc @@ -0,0 +1,18 @@ +|{}| +{ + echo("Welcome to the DMV!",) + age = readInt + + if age < 16 { + + { + echo("You're too young to drive!",) + exit(1,) + } + } else { + + {} + } + + echo("Let's get started on your driver's license application.",) +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_app_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_app_header.header.migrated.roc new file mode 100644 index 0000000000..1ee25711f7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_app_header.header.migrated.roc @@ -0,0 +1 @@ +app [] {} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_hosted_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_hosted_header.header.migrated.roc new file mode 100644 index 0000000000..aad4617748 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_hosted_header.header.migrated.roc @@ -0,0 +1 @@ +hosted [] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_list.expr.migrated.roc new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_list.expr.migrated.roc @@ -0,0 +1 @@ +[] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_module_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_module_header.header.migrated.roc new file mode 100644 index 0000000000..9fd98c5b23 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_module_header.header.migrated.roc @@ -0,0 +1 @@ +module [] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_old_hosted_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_old_hosted_header.header.migrated.roc new file mode 100644 index 0000000000..aad4617748 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_old_hosted_header.header.migrated.roc @@ -0,0 +1 @@ +hosted [] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_package_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_package_header.header.migrated.roc new file mode 100644 index 0000000000..313246d359 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_package_header.header.migrated.roc @@ -0,0 +1 @@ +package [] {} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_platform_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_platform_header.header.migrated.roc new file mode 100644 index 0000000000..e8bedcb5ba --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_platform_header.header.migrated.roc @@ -0,0 +1 @@ +platform "rtfeldman/blah" requires {} { init : {}, update : {} } exposes [] packages {} imports [] provides [] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record.expr.migrated.roc new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record.expr.migrated.roc @@ -0,0 +1 @@ +{} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_dbg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_dbg.expr.migrated.roc new file mode 100644 index 0000000000..7ab968a068 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_dbg.expr.migrated.roc @@ -0,0 +1,5 @@ +{} = +dbg c + +c +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_implements.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_implements.expr.migrated.roc new file mode 100644 index 0000000000..4e40298665 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_implements.expr.migrated.roc @@ -0,0 +1,2 @@ +O({},implements,) +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_return.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_return.expr.migrated.roc new file mode 100644 index 0000000000..cdb0e66a05 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_return.expr.migrated.roc @@ -0,0 +1,4 @@ +{} = +return f + +d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_tag.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_tag.expr.migrated.roc new file mode 100644 index 0000000000..d16f980aee --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assign_tag.expr.migrated.roc @@ -0,0 +1,3 @@ + +P +O diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assignment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assignment.expr.migrated.roc new file mode 100644 index 0000000000..a6519e44dd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_assignment.expr.migrated.roc @@ -0,0 +1,2 @@ +B +I diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_eq_dbg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_eq_dbg.expr.migrated.roc new file mode 100644 index 0000000000..d5e800d2db --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_eq_dbg.expr.migrated.roc @@ -0,0 +1,2 @@ +dbg(n,) +d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_eq_newlines_doubleeq.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_eq_newlines_doubleeq.expr.migrated.roc new file mode 100644 index 0000000000..9ff6e4e8e8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_eq_newlines_doubleeq.expr.migrated.roc @@ -0,0 +1,3 @@ +d == +g +d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_newline_assign.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_newline_assign.expr.migrated.roc new file mode 100644 index 0000000000..b98fffd9b6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_newline_assign.expr.migrated.roc @@ -0,0 +1,3 @@ + +{} +I diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_update.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_update.expr.migrated.roc new file mode 100644 index 0000000000..0c49574fa7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_record_update.expr.migrated.roc @@ -0,0 +1 @@ +{e&} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_string.expr.migrated.roc new file mode 100644 index 0000000000..e16c76dff8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_string.expr.migrated.roc @@ -0,0 +1 @@ +"" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/empty_try_pnc.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/empty_try_pnc.expr.migrated.roc new file mode 100644 index 0000000000..7bf5dd8b17 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/empty_try_pnc.expr.migrated.roc @@ -0,0 +1 @@ +try()(t,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/equals.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/equals.expr.migrated.roc new file mode 100644 index 0000000000..04dfc84773 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/equals.expr.migrated.roc @@ -0,0 +1 @@ +x == y diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/equals_with_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/equals_with_spaces.expr.migrated.roc new file mode 100644 index 0000000000..04dfc84773 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/equals_with_spaces.expr.migrated.roc @@ -0,0 +1 @@ +x == y diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/expect.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/expect.expr.migrated.roc new file mode 100644 index 0000000000..d5c03f0843 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/expect.expr.migrated.roc @@ -0,0 +1,3 @@ +expect 1 == 1 + +4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/expect_defs.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/expect_defs.moduledefs.migrated.roc new file mode 100644 index 0000000000..7cde7832c0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/expect_defs.moduledefs.migrated.roc @@ -0,0 +1,22 @@ +expect +{ + html: Html({},) + html = + Element("a",43,[HtmlAttr("href","https://www.roc-lang.org/",),],[Text("Roc",),],) + + actual: {nodes: List(RenderedNode,)siblingIds: List(U64,)} + actual = + indexNodes({nodes: []siblingIds: []},html,) + + expected: {nodes: List(RenderedNode,)siblingIds: List(U64,)} + expected = { + nodes: [ + RenderedText("Roc",), + RenderedElement("a",{emptyRenderedAttrs&htmlAttrs: Dict.fromList([("href","https://www.roc-lang.org/",),],)},[0,],), + ] + siblingIds: [1,] + } + + (actual.nodes == expected.nodes) + and (actual.siblingIds == expected.siblingIds) +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/expect_single_line.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/expect_single_line.expr.migrated.roc new file mode 100644 index 0000000000..b90a629804 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/expect_single_line.expr.migrated.roc @@ -0,0 +1,7 @@ +x = 5 + +expect x == y + +expect y == z + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ext_on_fn_ty.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ext_on_fn_ty.expr.migrated.roc new file mode 100644 index 0000000000..cdc63f6178 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ext_on_fn_ty.expr.migrated.roc @@ -0,0 +1,2 @@ +t: (w, => p,..a) +t diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline.expr.migrated.roc new file mode 100644 index 0000000000..90beac7093 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline.expr.migrated.roc @@ -0,0 +1,10 @@ +if foo { + + { + x = a # 1 + x + } # 2 +} else { + # 3 + c +} # 4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..eba21cf633 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline_in_parens.expr.migrated.roc @@ -0,0 +1,3 @@ +B() : {} + +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/f_not_not_f.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/f_not_not_f.expr.migrated.roc new file mode 100644 index 0000000000..87fc1520d5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/f_not_not_f.expr.migrated.roc @@ -0,0 +1,3 @@ +f +! +!f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/float_with_underscores.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/float_with_underscores.expr.migrated.roc new file mode 100644 index 0000000000..e02be8ab89 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/float_with_underscores.expr.migrated.roc @@ -0,0 +1 @@ +-1_23_456.0_1_23_456 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/fn_with_record_arg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/fn_with_record_arg.expr.migrated.roc new file mode 100644 index 0000000000..3c4c7b9998 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/fn_with_record_arg.expr.migrated.roc @@ -0,0 +1,5 @@ +table: { + height: Pixels +}, -> Table +table = |{height,}| crash("not implemented",) +table diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/full_app_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/full_app_header.header.migrated.roc new file mode 100644 index 0000000000..1c24947c0d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/full_app_header.header.migrated.roc @@ -0,0 +1 @@ +app [quicksort] { pf: platform "./platform" } diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/full_app_header_trailing_commas.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/full_app_header_trailing_commas.header.migrated.roc new file mode 100644 index 0000000000..1c24947c0d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/full_app_header_trailing_commas.header.migrated.roc @@ -0,0 +1 @@ +app [quicksort] { pf: platform "./platform" } diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/func_ty_parens_crazyness.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/func_ty_parens_crazyness.expr.migrated.roc new file mode 100644 index 0000000000..2ef41d3e11 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/func_ty_parens_crazyness.expr.migrated.roc @@ -0,0 +1,3 @@ +N() : f, -> ( + u,..I), -> * +I diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/function_effect_types.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/function_effect_types.header.migrated.roc new file mode 100644 index 0000000000..b80f1b040b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/function_effect_types.header.migrated.roc @@ -0,0 +1,6 @@ +platform "cli" + requires {} { main! : {} => Result {} [] } # TODO FIXME + exposes [] + packages {} + imports [Foo.{ Foo }] + provides [main_for_host] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/function_with_tuple_ext_type.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/function_with_tuple_ext_type.expr.migrated.roc new file mode 100644 index 0000000000..0e5569d74e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/function_with_tuple_ext_type.expr.migrated.roc @@ -0,0 +1,4 @@ +f: (Str,..a), -> (Str,..a) +f = |x| x + +f(("Str",42,),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/function_with_tuple_type.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/function_with_tuple_type.expr.migrated.roc new file mode 100644 index 0000000000..4f2380d1ba --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/function_with_tuple_type.expr.migrated.roc @@ -0,0 +1,4 @@ +f: I64, -> (I64,I64,) +f = |x| (x,x + 1,) + +f(42,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/h_greater_comment_minus_div.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/h_greater_comment_minus_div.expr.migrated.roc new file mode 100644 index 0000000000..f93dae2503 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/h_greater_comment_minus_div.expr.migrated.roc @@ -0,0 +1,2 @@ +h > # +-h / d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/h_parens_as_parens_h_ann.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/h_parens_as_parens_h_ann.expr.migrated.roc new file mode 100644 index 0000000000..e6991b2f9c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/h_parens_as_parens_h_ann.expr.migrated.roc @@ -0,0 +1,2 @@ +N() : A(Has H(),H,) +I diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/highest_float.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/highest_float.expr.migrated.roc new file mode 100644 index 0000000000..85b9a14668 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/highest_float.expr.migrated.roc @@ -0,0 +1 @@ +179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/highest_int.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/highest_int.expr.migrated.roc new file mode 100644 index 0000000000..2045006eda --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/highest_int.expr.migrated.roc @@ -0,0 +1 @@ +9223372036854775807 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/i_over_not_g.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/i_over_not_g.expr.migrated.roc new file mode 100644 index 0000000000..b3237495f7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/i_over_not_g.expr.migrated.roc @@ -0,0 +1,3 @@ +i / +! +g diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/if_bang_then_bang_indented_else.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/if_bang_then_bang_indented_else.expr.migrated.roc new file mode 100644 index 0000000000..ca0d9ef969 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/if_bang_then_bang_indented_else.expr.migrated.roc @@ -0,0 +1,8 @@ +if !a! { + + t +} else { + + l +} +5 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/if_bang_then_else_one_line.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/if_bang_then_else_one_line.expr.migrated.roc new file mode 100644 index 0000000000..6ee9717663 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/if_bang_then_else_one_line.expr.migrated.roc @@ -0,0 +1,7 @@ +f = if !b! { + "" +} else { + + e +} +"" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/if_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/if_def.expr.migrated.roc new file mode 100644 index 0000000000..68ad46ac01 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/if_def.expr.migrated.roc @@ -0,0 +1,3 @@ +iffy = 5 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/if_newline_then_negate_else_recordupdater.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/if_newline_then_negate_else_recordupdater.expr.migrated.roc new file mode 100644 index 0000000000..6f7cf1ad6f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/if_newline_then_negate_else_recordupdater.expr.migrated.roc @@ -0,0 +1,7 @@ +if +h +{ + !f # +} else { + &m +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/if_then_weird_indent.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/if_then_weird_indent.expr.migrated.roc new file mode 100644 index 0000000000..646ae0c34a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/if_then_weird_indent.expr.migrated.roc @@ -0,0 +1,12 @@ +if +k +{ + + A +} else { + + { + e + r + } +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/implements_annotation_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/implements_annotation_comment.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/implements_annotation_comment.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/implements_in_pat_after_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/implements_in_pat_after_comment.expr.migrated.roc new file mode 100644 index 0000000000..fdbf592e65 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/implements_in_pat_after_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +s( # +implements,): s +s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/implements_in_pnc_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/implements_in_pnc_pattern.expr.migrated.roc new file mode 100644 index 0000000000..c0f294d88b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/implements_in_pnc_pattern.expr.migrated.roc @@ -0,0 +1,2 @@ +g(implements,x,) = c +c diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/implements_newline_in_fn_ty.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/implements_newline_in_fn_ty.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/implements_newline_in_fn_ty.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/implements_newlines_comments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/implements_newlines_comments.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/implements_newlines_comments.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/implements_not_keyword.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/implements_not_keyword.expr.migrated.roc new file mode 100644 index 0000000000..587dc1b08e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/implements_not_keyword.expr.migrated.roc @@ -0,0 +1,3 @@ +A = B(implements,) ++ s +1 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/implements_record_destructure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/implements_record_destructure.expr.migrated.roc new file mode 100644 index 0000000000..09ccba90ff --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/implements_record_destructure.expr.migrated.roc @@ -0,0 +1,2 @@ +{implements,} = d +I diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import.moduledefs.migrated.roc new file mode 100644 index 0000000000..743fe848a0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import.moduledefs.migrated.roc @@ -0,0 +1 @@ +importJson diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import_backslash_as_m.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import_backslash_as_m.expr.migrated.roc new file mode 100644 index 0000000000..ace67bf492 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import_backslash_as_m.expr.migrated.roc @@ -0,0 +1,2 @@ +import"\\"asm +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import_from_package.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import_from_package.moduledefs.migrated.roc new file mode 100644 index 0000000000..00dfbd3496 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import_from_package.moduledefs.migrated.roc @@ -0,0 +1,6 @@ +importjson.Decode +importjson.Decodeas +importjson.Decodeexposing[Decoder, + map,] +importjson.Decodeasexposing[Decoder, + map,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import_in_closure_with_curlies_after.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import_in_closure_with_curlies_after.expr.migrated.roc new file mode 100644 index 0000000000..9bb4930cc1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import_in_closure_with_curlies_after.expr.migrated.roc @@ -0,0 +1,5 @@ +|L| +{ + importU + {}(e,) +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import_with_alias.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_alias.moduledefs.migrated.roc new file mode 100644 index 0000000000..09a5f17c5d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_alias.moduledefs.migrated.roc @@ -0,0 +1,2 @@ +importJsonEncodeas +importBytes.Decodeas diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import_with_comments.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_comments.moduledefs.migrated.roc new file mode 100644 index 0000000000..b8a6cb2b26 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_comments.moduledefs.migrated.roc @@ -0,0 +1,49 @@ +import +# comment +Jsonasexposing[map,] + +importJsonasexposing[map,] + +importJsonas + +importJsonasexposing[map,] + +importJsonasexposing[map, + map2,] + +importJson +# comment +exposing[map, + map2,] + +importJsonas +# comment +exposing[map,] + +importJsonexposing +# comment +[map,] + +importJsonasexposing +# comment +[map,] + +importJsonasexposing[ + # comment + map, +] + +import +# comment 1 +Jsonas +# comment 4 +exposing +# comment 5 +[ + # comment 6 + map, +] + +importA +# comment between imports +importB diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import_with_exposed.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_exposed.moduledefs.migrated.roc new file mode 100644 index 0000000000..6cc722dbce --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_exposed.moduledefs.migrated.roc @@ -0,0 +1,4 @@ +importJsonexposing[map,Decoder,] +importJsonexposing[map, + Decoder,] +importJsonexposing[] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/import_with_params.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_params.moduledefs.migrated.roc new file mode 100644 index 0000000000..6e81f372c7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/import_with_params.moduledefs.migrated.roc @@ -0,0 +1,7 @@ +importpf.Menu{echoread} +importMenu{echo + read} +importMenu{echo + read}as +importMenu{echoread}asexposing[main, + credits,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ingested_file.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ingested_file.moduledefs.migrated.roc new file mode 100644 index 0000000000..91c85b521b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ingested_file.moduledefs.migrated.roc @@ -0,0 +1,2 @@ +import"path/to/file.txt"asfile: Str +import"path/to/file.txt"asfile: List(U8,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/inline_import.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/inline_import.expr.migrated.roc new file mode 100644 index 0000000000..832b2833f0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/inline_import.expr.migrated.roc @@ -0,0 +1,4 @@ +importJsonexposing[int,] +importJson.Encodeas + +JE.encode((int(42,)),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/inline_ingested_file.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/inline_ingested_file.expr.migrated.roc new file mode 100644 index 0000000000..ca36ced8dc --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/inline_ingested_file.expr.migrated.roc @@ -0,0 +1,3 @@ +import"users.json"asdata: Str + +parseJson(data,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/inline_ingested_file_no_ann.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/inline_ingested_file_no_ann.expr.migrated.roc new file mode 100644 index 0000000000..10da09a7f4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/inline_ingested_file_no_ann.expr.migrated.roc @@ -0,0 +1,3 @@ +import"users.json"asdata + +parseJson(data,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/int_with_underscore.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/int_with_underscore.expr.migrated.roc new file mode 100644 index 0000000000..634bc502f2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/int_with_underscore.expr.migrated.roc @@ -0,0 +1 @@ +1__23 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/lambda_in_chain.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/lambda_in_chain.expr.migrated.roc new file mode 100644 index 0000000000..30abdf49ff --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/lambda_in_chain.expr.migrated.roc @@ -0,0 +1,4 @@ +"a string" +|> Str.toUtf8 +|> List.map(|byte| byte + 1,) +|> List.reverse diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/lambda_indent.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/lambda_indent.expr.migrated.roc new file mode 100644 index 0000000000..fc94b351f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/lambda_indent.expr.migrated.roc @@ -0,0 +1,2 @@ +|x| +1 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/large_tuple_index.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/large_tuple_index.expr.migrated.roc new file mode 100644 index 0000000000..e46886f850 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/large_tuple_index.expr.migrated.roc @@ -0,0 +1 @@ +.18888888888888888888 + h.22222222222222222222 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_indent_not_enough.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_indent_not_enough.expr.migrated.roc new file mode 100644 index 0000000000..92ff22280c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_indent_not_enough.expr.migrated.roc @@ -0,0 +1,9 @@ +myList = [ + 0, + [ + a, + b, + ], + 1, +] +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_same_indent_no_trailing_comma.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_same_indent_no_trailing_comma.expr.migrated.roc new file mode 100644 index 0000000000..7b492fe356 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_same_indent_no_trailing_comma.expr.migrated.roc @@ -0,0 +1,5 @@ +myList = [ + 0, + 1, +] +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_same_indent_with_trailing_comma.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_same_indent_with_trailing_comma.expr.migrated.roc new file mode 100644 index 0000000000..7b492fe356 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_closing_same_indent_with_trailing_comma.expr.migrated.roc @@ -0,0 +1,5 @@ +myList = [ + 0, + 1, +] +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_comma_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_comma_newlines.expr.migrated.roc new file mode 100644 index 0000000000..5a767769a0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_comma_newlines.expr.migrated.roc @@ -0,0 +1,3 @@ +[s, + +] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_comment_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_comment_newline.expr.migrated.roc new file mode 100644 index 0000000000..d3208cf1b7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_comment_newline.expr.migrated.roc @@ -0,0 +1,3 @@ +[L, # + +] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_list_not_not_closure_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_list_not_not_closure_newline.expr.migrated.roc new file mode 100644 index 0000000000..38413183a6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_list_not_not_closure_newline.expr.migrated.roc @@ -0,0 +1,2 @@ +[[!!|L| t( + M,),],] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_lots_of_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_lots_of_spaces.expr.migrated.roc new file mode 100644 index 0000000000..5e8489f21c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_lots_of_spaces.expr.migrated.roc @@ -0,0 +1,5 @@ +[J, + # + + # + u,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_minus_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_minus_newlines.expr.migrated.roc new file mode 100644 index 0000000000..d78a521fb9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_minus_newlines.expr.migrated.roc @@ -0,0 +1,2 @@ +[K, +] - i diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_pattern_weird_indent.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_pattern_weird_indent.expr.migrated.roc new file mode 100644 index 0000000000..f198ca3e54 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_pattern_weird_indent.expr.migrated.roc @@ -0,0 +1,4 @@ +when []{ + + [1,2, + 3,]->""} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/list_patterns.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/list_patterns.expr.migrated.roc new file mode 100644 index 0000000000..10ceb7b333 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/list_patterns.expr.migrated.roc @@ -0,0 +1,10 @@ +when []{ + + []->{} + [..,]->{} + [_,..,_,..,]->{} + [a,b,c,d,]->{} + [a,b,..,]->{} + [..,c,d,]->{} + [[A,],[..,],[a,],]->{} + [[[],[],],[[],x,],]->{}} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/long_complex_application_with_pnc.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/long_complex_application_with_pnc.expr.migrated.roc new file mode 100644 index 0000000000..38813ef2dc --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/long_complex_application_with_pnc.expr.migrated.roc @@ -0,0 +1,5 @@ +combine(mix(vodka,gin,),Juices({ + color: Colors.orange + flavor: Flavors.orange + amount: 1 + 2 +},),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/lowest_float.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/lowest_float.expr.migrated.roc new file mode 100644 index 0000000000..adff835788 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/lowest_float.expr.migrated.roc @@ -0,0 +1 @@ +-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/lowest_int.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/lowest_int.expr.migrated.roc new file mode 100644 index 0000000000..7928ab8b55 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/lowest_int.expr.migrated.roc @@ -0,0 +1 @@ +-9223372036854775808 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/mega_parens_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/mega_parens_pat.expr.migrated.roc new file mode 100644 index 0000000000..825831914e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/mega_parens_pat.expr.migrated.roc @@ -0,0 +1,4 @@ +1(0( # +f,),)(0( # +f,),): f +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/middle_when_branch_comment_after_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/middle_when_branch_comment_after_parens.expr.migrated.roc new file mode 100644 index 0000000000..20a10e7e09 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/middle_when_branch_comment_after_parens.expr.migrated.roc @@ -0,0 +1,5 @@ +when n{ + + O->(s + ) # + O->t} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/min_parens_number.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/min_parens_number.expr.migrated.roc new file mode 100644 index 0000000000..05176db61e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/min_parens_number.expr.migrated.roc @@ -0,0 +1 @@ +-(8) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/minimal_app_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/minimal_app_header.header.migrated.roc new file mode 100644 index 0000000000..1ee25711f7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/minimal_app_header.header.migrated.roc @@ -0,0 +1 @@ +app [] {} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/minus_minus_block_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/minus_minus_block_string.expr.migrated.roc new file mode 100644 index 0000000000..5d023f1fad --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/minus_minus_block_string.expr.migrated.roc @@ -0,0 +1,3 @@ +-- +""" +""" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/minus_minus_six.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/minus_minus_six.expr.migrated.roc new file mode 100644 index 0000000000..712cb37d93 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/minus_minus_six.expr.migrated.roc @@ -0,0 +1 @@ +-(-6) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/minus_newline_minus.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/minus_newline_minus.expr.migrated.roc new file mode 100644 index 0000000000..daf6cafe7d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/minus_newline_minus.expr.migrated.roc @@ -0,0 +1,2 @@ +s - +-{} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/minus_newline_minus_minus.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/minus_newline_minus_minus.expr.migrated.roc new file mode 100644 index 0000000000..945253b077 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/minus_newline_minus_minus.expr.migrated.roc @@ -0,0 +1,2 @@ +p - +-t - 1 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/minus_not_h.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/minus_not_h.expr.migrated.roc new file mode 100644 index 0000000000..512f4b5e3d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/minus_not_h.expr.migrated.roc @@ -0,0 +1 @@ +-!h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/minus_twelve_minus_five.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/minus_twelve_minus_five.expr.migrated.roc new file mode 100644 index 0000000000..2dbede8ec7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/minus_twelve_minus_five.expr.migrated.roc @@ -0,0 +1 @@ +-12 - 5 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/mixed_docs.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/mixed_docs.expr.migrated.roc new file mode 100644 index 0000000000..4d9a22c8c3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/mixed_docs.expr.migrated.roc @@ -0,0 +1,7 @@ +### not docs! +## docs, but with a problem +## (namely that this is a mix of docs and regular comments) +# not docs +x = 5 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/module_def_newline.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/module_def_newline.moduledefs.migrated.roc new file mode 100644 index 0000000000..7d736b4723 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/module_def_newline.moduledefs.migrated.roc @@ -0,0 +1,6 @@ +main = +{ + i = 64 + + i +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/module_multiline_exposes.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/module_multiline_exposes.header.migrated.roc new file mode 100644 index 0000000000..1c274a703b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/module_multiline_exposes.header.migrated.roc @@ -0,0 +1,2 @@ +module [a,b, + c,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/module_with_multiline_params_and_exposes.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_multiline_params_and_exposes.header.migrated.roc new file mode 100644 index 0000000000..b02cd8ca98 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_multiline_params_and_exposes.header.migrated.roc @@ -0,0 +1,4 @@ +module {echo, + # comment before param + read,} -> [mainMenu, + credits,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/module_with_newline.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_newline.header.migrated.roc new file mode 100644 index 0000000000..9fd98c5b23 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_newline.header.migrated.roc @@ -0,0 +1 @@ +module [] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/module_with_optional_param.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_optional_param.header.migrated.roc new file mode 100644 index 0000000000..5722e8344f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_optional_param.header.migrated.roc @@ -0,0 +1 @@ +module {x,y? 0?,} -> [menu,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/module_with_params.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_params.header.migrated.roc new file mode 100644 index 0000000000..b6f840d629 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_params.header.migrated.roc @@ -0,0 +1 @@ +module {echo,read,} -> [menu,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/module_with_params_and_multiline_exposes.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_params_and_multiline_exposes.header.migrated.roc new file mode 100644 index 0000000000..3834aff610 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/module_with_params_and_multiline_exposes.header.migrated.roc @@ -0,0 +1,2 @@ +module {echo,read,} -> [mainMenu, + credits,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/mul_comment_neg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/mul_comment_neg.expr.migrated.roc new file mode 100644 index 0000000000..080b28607a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/mul_comment_neg.expr.migrated.roc @@ -0,0 +1,3 @@ +n * f +# +-f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multi_char_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multi_char_string.expr.migrated.roc new file mode 100644 index 0000000000..810c96eeeb --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multi_char_string.expr.migrated.roc @@ -0,0 +1 @@ +"foo" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multilin_str_body.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multilin_str_body.expr.migrated.roc new file mode 100644 index 0000000000..8bd2a51604 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multilin_str_body.expr.migrated.roc @@ -0,0 +1,5 @@ +a = +""" +"f +""" +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_apply_equals_multiline_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_apply_equals_multiline_apply.expr.migrated.roc new file mode 100644 index 0000000000..3ace6c1f05 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_apply_equals_multiline_apply.expr.migrated.roc @@ -0,0 +1,6 @@ + +MT( +q,) + = g( +q,) +dbgT diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_binop_when_with_comments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_binop_when_with_comments.expr.migrated.roc new file mode 100644 index 0000000000..98854c5aa4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_binop_when_with_comments.expr.migrated.roc @@ -0,0 +1,26 @@ +when +x ++ 1 # comment 1 +> 0 # comment 2 +{ + + y-> + 3 + * 2 # comment 3 + < 1 # comment 4 + + z-> + 4 + / 5 # comment 5 + < 1 # comment 6 + + 46 # first pattern comment + | 95 # alternative comment 1 + | 126 # alternative comment 2 + | 150-> # This comment came after the -> + # This comment is for the expr + foo(bar,) + |> Result.withDefault("",) # one last comment + + _-> + 42} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_after_newlines_in_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_after_newlines_in_pat.expr.migrated.roc new file mode 100644 index 0000000000..8875dee1d5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_after_newlines_in_pat.expr.migrated.roc @@ -0,0 +1,5 @@ +4( + +""" +""",): C +U diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_and_str_in_alias.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_and_str_in_alias.expr.migrated.roc new file mode 100644 index 0000000000..00e9d73d79 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_and_str_in_alias.expr.migrated.roc @@ -0,0 +1,4 @@ +8 +""" +"""("",)(f,): C +U diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_apply_in_parens_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_apply_in_parens_pat.expr.migrated.roc new file mode 100644 index 0000000000..97e6ed1277 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_apply_in_parens_pat.expr.migrated.roc @@ -0,0 +1,4 @@ +u( +""" +"""(0,),): f +s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_crazyness.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_crazyness.expr.migrated.roc new file mode 100644 index 0000000000..86b42550e2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_crazyness.expr.migrated.roc @@ -0,0 +1,4 @@ +""" +"""("${i + """ + """}",) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_in_closure_in_when_guard_wtf.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_in_closure_in_when_guard_wtf.expr.migrated.roc new file mode 100644 index 0000000000..f1cb8950d6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_in_closure_in_when_guard_wtf.expr.migrated.roc @@ -0,0 +1,6 @@ +when f +{ + + s if |t| + """ + """->e} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_in_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_in_pat.expr.migrated.roc new file mode 100644 index 0000000000..269de00f5a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_in_pat.expr.migrated.roc @@ -0,0 +1,4 @@ +1( +""" +""","^",2,): A +"" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_interpolation_records.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_interpolation_records.expr.migrated.roc new file mode 100644 index 0000000000..d8eb0b0eae --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_interpolation_records.expr.migrated.roc @@ -0,0 +1,8 @@ +""" +${{ + } + i} +${{ + } + i} +""" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_opt_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_opt_field.expr.migrated.roc new file mode 100644 index 0000000000..f25931f7f2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_opt_field.expr.migrated.roc @@ -0,0 +1,3 @@ +{l: + """ + """}("",) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_pnc_apply_in_assignment_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_pnc_apply_in_assignment_newline.expr.migrated.roc new file mode 100644 index 0000000000..5aa57cbf54 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_pnc_apply_in_assignment_newline.expr.migrated.roc @@ -0,0 +1,6 @@ +({ + e = + """ + """().d + e +})(m,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_pnc_apply_in_assignment_record_access_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_pnc_apply_in_assignment_record_access_newline.expr.migrated.roc new file mode 100644 index 0000000000..373d1bac00 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_str_pnc_apply_in_assignment_record_access_newline.expr.migrated.roc @@ -0,0 +1,4 @@ +i = +""" +"""().1 +p diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_string.expr.migrated.roc new file mode 100644 index 0000000000..dac15f6fd0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_string.expr.migrated.roc @@ -0,0 +1,12 @@ +a = "Hello,\n\nWorld!" +b = +""" +Hello,\n\nWorld! +""" +c = +""" +Hello, + +World! +""" +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_string_in_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_string_in_apply.expr.migrated.roc new file mode 100644 index 0000000000..e6449f6fcf --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_string_in_apply.expr.migrated.roc @@ -0,0 +1,4 @@ +e( +""" +"\" +""",) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_tuple_with_comments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_tuple_with_comments.expr.migrated.roc new file mode 100644 index 0000000000..57f7c7374d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_tuple_with_comments.expr.migrated.roc @@ -0,0 +1,13 @@ +( + # before 1 + 1, + # after 1 + + # before 2 + 2, + # after 2 + + # before 3 + 3, + # after 3 +) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_type_signature.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_type_signature.expr.migrated.roc new file mode 100644 index 0000000000..c64916d757 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_type_signature.expr.migrated.roc @@ -0,0 +1,4 @@ +f: +{} + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiline_type_signature_with_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_type_signature_with_comment.expr.migrated.roc new file mode 100644 index 0000000000..5101d8b9f6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiline_type_signature_with_comment.expr.migrated.roc @@ -0,0 +1,4 @@ +f: # comment +{} + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiple_fields.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiple_fields.expr.migrated.roc new file mode 100644 index 0000000000..1a0fcdc76e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiple_fields.expr.migrated.roc @@ -0,0 +1 @@ +rec.abc.def.ghi diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/multiple_operators.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/multiple_operators.expr.migrated.roc new file mode 100644 index 0000000000..2c5d3de9e3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/multiple_operators.expr.migrated.roc @@ -0,0 +1 @@ +31 * 42 + 534 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/neg_float_literal_pnc_apply_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/neg_float_literal_pnc_apply_pat.expr.migrated.roc new file mode 100644 index 0000000000..d7ff6f8f76 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/neg_float_literal_pnc_apply_pat.expr.migrated.roc @@ -0,0 +1,2 @@ +-8.(): C +p diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/neg_inf_float.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/neg_inf_float.expr.migrated.roc new file mode 100644 index 0000000000..ebd26be430 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/neg_inf_float.expr.migrated.roc @@ -0,0 +1 @@ +-inf diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/neg_nested_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/neg_nested_parens.expr.migrated.roc new file mode 100644 index 0000000000..942a102abd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/neg_nested_parens.expr.migrated.roc @@ -0,0 +1,2 @@ +-(0(1( +d,),)) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/neg_newline_four.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/neg_newline_four.expr.migrated.roc new file mode 100644 index 0000000000..8142dae7c7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/neg_newline_four.expr.migrated.roc @@ -0,0 +1,2 @@ +-( +4) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/negate_apply_parens_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/negate_apply_parens_comment.expr.migrated.roc new file mode 100644 index 0000000000..ef88fca607 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/negate_apply_parens_comment.expr.migrated.roc @@ -0,0 +1,4 @@ +-(({ + 4 + 4 +})(4,)) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/negate_multiline_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/negate_multiline_string.expr.migrated.roc new file mode 100644 index 0000000000..d2425cbeed --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/negate_multiline_string.expr.migrated.roc @@ -0,0 +1,3 @@ +- +""" +""" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/negate_multiline_string_with_quote.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/negate_multiline_string_with_quote.expr.migrated.roc new file mode 100644 index 0000000000..5b6b8b9b50 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/negate_multiline_string_with_quote.expr.migrated.roc @@ -0,0 +1,4 @@ +- +""" +"< +""" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/negative_float.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/negative_float.expr.migrated.roc new file mode 100644 index 0000000000..f6ffe6d3ad --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/negative_float.expr.migrated.roc @@ -0,0 +1 @@ +-42.9 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/negative_in_apply_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/negative_in_apply_def.expr.migrated.roc new file mode 100644 index 0000000000..00738c6d01 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/negative_in_apply_def.expr.migrated.roc @@ -0,0 +1,3 @@ +a = A( +-g,a,) +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/negative_int.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/negative_int.expr.migrated.roc new file mode 100644 index 0000000000..6a0e60d48b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/negative_int.expr.migrated.roc @@ -0,0 +1 @@ +-42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/negative_single_quote.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/negative_single_quote.expr.migrated.roc new file mode 100644 index 0000000000..e880112006 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/negative_single_quote.expr.migrated.roc @@ -0,0 +1 @@ +-'i' diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nested_def_annotation.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nested_def_annotation.moduledefs.migrated.roc new file mode 100644 index 0000000000..cf4817cb2f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nested_def_annotation.moduledefs.migrated.roc @@ -0,0 +1,8 @@ +main = +{ + wrappedNotEq: a,a, -> Bool + wrappedNotEq = |num1num2| + num1 != num2 + + wrappedNotEq(2,3,) +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nested_if.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nested_if.expr.migrated.roc new file mode 100644 index 0000000000..bb163e4e83 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nested_if.expr.migrated.roc @@ -0,0 +1,10 @@ +if t1 { + + 1 +}else if t2 { + + 2 +} else { + + 3 +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nested_if_unindented.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nested_if_unindented.expr.migrated.roc new file mode 100644 index 0000000000..5e07480ef8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nested_if_unindented.expr.migrated.roc @@ -0,0 +1,7 @@ +if "" { + -p +}else if "" { + -p +} else { + .e +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nested_list_comment_in_closure_arg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nested_list_comment_in_closure_arg.expr.migrated.roc new file mode 100644 index 0000000000..b066afc396 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nested_list_comment_in_closure_arg.expr.migrated.roc @@ -0,0 +1,3 @@ +|I([[ + O, # + i,],],)| i diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nested_parens_in_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nested_parens_in_pattern.expr.migrated.roc new file mode 100644 index 0000000000..89385f3ce9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nested_parens_in_pattern.expr.migrated.roc @@ -0,0 +1,2 @@ +J(x,): i +i diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nested_when_comment_in_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nested_when_comment_in_pat.expr.migrated.roc new file mode 100644 index 0000000000..50a3da8358 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nested_when_comment_in_pat.expr.migrated.roc @@ -0,0 +1,6 @@ +when 6{ + + O( # + B,)->when 6{ + + 1->O}} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/new_lambda_as_second_statement.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/new_lambda_as_second_statement.moduledefs.migrated.roc new file mode 100644 index 0000000000..7c6e21e981 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/new_lambda_as_second_statement.moduledefs.migrated.roc @@ -0,0 +1,6 @@ +my_var = +{ + some_var # c + or other_thing # ^D + final_expr +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_equals.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_equals.expr.migrated.roc new file mode 100644 index 0000000000..8237a696ec --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_equals.expr.migrated.roc @@ -0,0 +1,4 @@ +x = +5 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_import_str_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_import_str_as.expr.migrated.roc new file mode 100644 index 0000000000..050d6b0d0e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_import_str_as.expr.migrated.roc @@ -0,0 +1,3 @@ +import""as + das +A diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_mul.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_mul.expr.migrated.roc new file mode 100644 index 0000000000..065d4b5ea4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_mul.expr.migrated.roc @@ -0,0 +1,2 @@ +3 * +4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_opt_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_opt_field.expr.migrated.roc new file mode 100644 index 0000000000..fc25e3e8c0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_opt_field.expr.migrated.roc @@ -0,0 +1,2 @@ +{i: + p} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_paren.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_paren.expr.migrated.roc new file mode 100644 index 0000000000..1212ca5db4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_paren.expr.migrated.roc @@ -0,0 +1,2 @@ + +A diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_sub.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_sub.expr.migrated.roc new file mode 100644 index 0000000000..d7d9beae80 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_after_sub.expr.migrated.roc @@ -0,0 +1,2 @@ +3 - +4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_and_spaces_before_less_than.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_and_spaces_before_less_than.expr.migrated.roc new file mode 100644 index 0000000000..8d5652a188 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_and_spaces_before_less_than.expr.migrated.roc @@ -0,0 +1,4 @@ +x = 1 +< 2 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_add.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_add.expr.migrated.roc new file mode 100644 index 0000000000..d9661e2e91 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_add.expr.migrated.roc @@ -0,0 +1,2 @@ +3 ++ 4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_and_after_implements_opaque.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_and_after_implements_opaque.expr.migrated.roc new file mode 100644 index 0000000000..fd66bb6345 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_and_after_implements_opaque.expr.migrated.roc @@ -0,0 +1,5 @@ +P() := W implements + +implements +[] +t diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_import_curlies.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_import_curlies.expr.migrated.roc new file mode 100644 index 0000000000..95aa61b1fa --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_import_curlies.expr.migrated.roc @@ -0,0 +1,3 @@ +importP +{} +y diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_sub.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_sub.expr.migrated.roc new file mode 100644 index 0000000000..391a7d231f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_before_sub.expr.migrated.roc @@ -0,0 +1,2 @@ +3 +- 4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_packages.full.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_packages.full.migrated.roc new file mode 100644 index 0000000000..48e565d5db --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_packages.full.migrated.roc @@ -0,0 +1,4 @@ +app [main] { pf: "generic-test-platform/main.roc" } + +main = +Stdout.line("I'm a Roc application!",) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_type_alias_application.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_type_alias_application.expr.migrated.roc new file mode 100644 index 0000000000..0ac9b0d1e2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_type_alias_application.expr.migrated.roc @@ -0,0 +1,3 @@ +A() : A( +A,) +p diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_type_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_type_def.expr.migrated.roc new file mode 100644 index 0000000000..e607b9601b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_in_type_def.expr.migrated.roc @@ -0,0 +1,2 @@ +R() : D +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_inside_empty_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_inside_empty_list.expr.migrated.roc new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_inside_empty_list.expr.migrated.roc @@ -0,0 +1,2 @@ +[ +] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/newline_singleton_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/newline_singleton_list.expr.migrated.roc new file mode 100644 index 0000000000..0b7876bf85 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/newline_singleton_list.expr.migrated.roc @@ -0,0 +1,3 @@ +[ + 1, +] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/no_newline_after_implements.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/no_newline_after_implements.expr.migrated.roc new file mode 100644 index 0000000000..81750b96f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/no_newline_after_implements.expr.migrated.roc @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_hosted_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_hosted_header.header.migrated.roc new file mode 100644 index 0000000000..97c4fd30d2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_hosted_header.header.migrated.roc @@ -0,0 +1,5 @@ +hosted [ + Stuff, + Things, + somethingElse, +] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_old_hosted_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_old_hosted_header.header.migrated.roc new file mode 100644 index 0000000000..97c4fd30d2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_old_hosted_header.header.migrated.roc @@ -0,0 +1,5 @@ +hosted [ + Stuff, + Things, + somethingElse, +] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_package_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_package_header.header.migrated.roc new file mode 100644 index 0000000000..e9ac71957f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_package_header.header.migrated.roc @@ -0,0 +1,3 @@ +package [Foo, Bar] { + foo: "./foo", +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_platform_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_platform_header.header.migrated.roc new file mode 100644 index 0000000000..18e9f949b7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nonempty_platform_header.header.migrated.roc @@ -0,0 +1,6 @@ +platform "foo/barbaz" + requires { Model } { main : {} } + exposes [] + packages { foo: "./foo" } + imports [] + provides [main_for_host] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/not_double_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/not_double_parens.expr.migrated.roc new file mode 100644 index 0000000000..6e7706c893 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/not_double_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +! +(( +E) +) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/not_multiline_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/not_multiline_string.expr.migrated.roc new file mode 100644 index 0000000000..f556a19bf9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/not_multiline_string.expr.migrated.roc @@ -0,0 +1,3 @@ +! +""" +""" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/not_record_updater.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/not_record_updater.expr.migrated.roc new file mode 100644 index 0000000000..fc2b508c61 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/not_record_updater.expr.migrated.roc @@ -0,0 +1,3 @@ +e +! +&s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/not_tag.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/not_tag.expr.migrated.roc new file mode 100644 index 0000000000..47771b02c8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/not_tag.expr.migrated.roc @@ -0,0 +1,4 @@ +!({ + C + 2 +}) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/num_bang_amp_z_dot_t.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/num_bang_amp_z_dot_t.expr.migrated.roc new file mode 100644 index 0000000000..63d71bb5dc --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/num_bang_amp_z_dot_t.expr.migrated.roc @@ -0,0 +1,3 @@ +4 +! +&z.t diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/number_literal_suffixes.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/number_literal_suffixes.expr.migrated.roc new file mode 100644 index 0000000000..335be6a9f5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/number_literal_suffixes.expr.migrated.roc @@ -0,0 +1,34 @@ +{ + u8: 123u8 + u16: 123u16 + u32: 123u32 + u64: 123u64 + u128: 123u128 + i8: 123i8 + i16: 123i16 + i32: 123i32 + i64: 123i64 + i128: 123i128 + dec: 123dec + u8Neg: -123u8 + u16Neg: -123u16 + u32Neg: -123u32 + u64Neg: -123u64 + u128Neg: -123u128 + i8Neg: -123i8 + i16Neg: -123i16 + i32Neg: -123i32 + i64Neg: -123i64 + i128Neg: -123i128 + decNeg: -123dec + u8Bin: 0b101u8 + u16Bin: 0b101u16 + u32Bin: 0b101u32 + u64Bin: 0b101u64 + u128Bin: 0b101u128 + i8Bin: 0b101i8 + i16Bin: 0b101i16 + i32Bin: 0b101i32 + i64Bin: 0b101i64 + i128Bin: 0b101i128 +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/old_app_header.full.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/old_app_header.full.migrated.roc new file mode 100644 index 0000000000..a245ef5d36 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/old_app_header.full.migrated.roc @@ -0,0 +1,9 @@ +app [main] { + cli: platform "../basic-cli/platform/main.roc", +} + +importcli.Stdout + +main = +Stdout.line("hello",) + diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/old_interface_header.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/old_interface_header.header.migrated.roc new file mode 100644 index 0000000000..7f3f2539e8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/old_interface_header.header.migrated.roc @@ -0,0 +1 @@ +module [Foo,foo,bar,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/one_char_string.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/one_char_string.expr.migrated.roc new file mode 100644 index 0000000000..92232f694a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/one_char_string.expr.migrated.roc @@ -0,0 +1 @@ +"x" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/one_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/one_def.expr.migrated.roc new file mode 100644 index 0000000000..b5a1b3af49 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/one_def.expr.migrated.roc @@ -0,0 +1,4 @@ +# leading comment +x = 5 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/one_minus_two.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/one_minus_two.expr.migrated.roc new file mode 100644 index 0000000000..095076294f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/one_minus_two.expr.migrated.roc @@ -0,0 +1 @@ +1 - 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/one_plus_two.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/one_plus_two.expr.migrated.roc new file mode 100644 index 0000000000..e0ef584020 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/one_plus_two.expr.migrated.roc @@ -0,0 +1 @@ +1 + 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/one_spaced_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/one_spaced_def.expr.migrated.roc new file mode 100644 index 0000000000..b5a1b3af49 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/one_spaced_def.expr.migrated.roc @@ -0,0 +1,4 @@ +# leading comment +x = 5 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_comment_after_head.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_comment_after_head.expr.migrated.roc new file mode 100644 index 0000000000..2fbd4db77c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_comment_after_head.expr.migrated.roc @@ -0,0 +1,3 @@ +A( # +p,) := a +A diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_destructure_first_item_in_body.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_destructure_first_item_in_body.expr.migrated.roc new file mode 100644 index 0000000000..b063303824 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_destructure_first_item_in_body.expr.migrated.roc @@ -0,0 +1,2 @@ +@Thunk(it,) = id((@A({},)),) +it({},) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.migrated.roc new file mode 100644 index 0000000000..277b5e3895 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.migrated.roc @@ -0,0 +1,33 @@ +A() := U8 implements +implements [Eq,Hash,] + +A() := a where a implements Other implements +implements [Eq,Hash,] + +A() := a where a implements Other implements + +implements [Eq,Hash,] + +A() := U8 implements +implements [Eq implements {eq},Hash implements {hash},] + +A() := U8 implements +implements [Eq implements {eqeq1},] + +A() := U8 implements +implements [Eq implements {eqeq1},Hash,] + +A() := U8 implements +implements [Hash,Eq implements {eqeq1},] + +A() := U8 implements +implements [] + +A() := a where a implements Other implements + +implements [Eq implements {eq},Hash implements {hash},] + +A() := U8 implements +implements [Eq implements {},] + +0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_expr.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_expr.expr.migrated.roc new file mode 100644 index 0000000000..6783cae16a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_expr.expr.migrated.roc @@ -0,0 +1 @@ +@Age diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_expr_with_arguments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_expr_with_arguments.expr.migrated.roc new file mode 100644 index 0000000000..c2767b595f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_expr_with_arguments.expr.migrated.roc @@ -0,0 +1 @@ +@Age(m,n,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_pattern.expr.migrated.roc new file mode 100644 index 0000000000..99ac21ac10 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_pattern.expr.migrated.roc @@ -0,0 +1,3 @@ +when n{ + + @Age->1} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_pattern_with_arguments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_pattern_with_arguments.expr.migrated.roc new file mode 100644 index 0000000000..587b44a612 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_reference_pattern_with_arguments.expr.migrated.roc @@ -0,0 +1,3 @@ +when n{ + + @Add(n,m,)->n + m} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_simple.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_simple.moduledefs.migrated.roc new file mode 100644 index 0000000000..ef511d3b81 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_simple.moduledefs.migrated.roc @@ -0,0 +1 @@ +Age() := U8 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_with_type_arguments.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_with_type_arguments.moduledefs.migrated.roc new file mode 100644 index 0000000000..33651af98d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_with_type_arguments.moduledefs.migrated.roc @@ -0,0 +1 @@ +Bookmark(a,) := {chapter: Strstanza: Strnotes: a} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ops_with_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ops_with_newlines.expr.migrated.roc new file mode 100644 index 0000000000..a044634e57 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ops_with_newlines.expr.migrated.roc @@ -0,0 +1,4 @@ +3 ++ + +4 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opt_field_newline_in_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opt_field_newline_in_pat.expr.migrated.roc new file mode 100644 index 0000000000..ca74e00874 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opt_field_newline_in_pat.expr.migrated.roc @@ -0,0 +1,4 @@ +{i? + Y?, +} = p +Q diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opt_field_newline_in_ty.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opt_field_newline_in_ty.expr.migrated.roc new file mode 100644 index 0000000000..93becb26cf --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opt_field_newline_in_ty.expr.migrated.roc @@ -0,0 +1,3 @@ +0: {i + : d} +O diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opt_record_field_pat_assign.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opt_record_field_pat_assign.expr.migrated.roc new file mode 100644 index 0000000000..e467d7133b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opt_record_field_pat_assign.expr.migrated.roc @@ -0,0 +1,4 @@ +{e? f( + 4,)?,} = f( +e,) +r diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/outdented_app_with_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_app_with_record.expr.migrated.roc new file mode 100644 index 0000000000..de2742f274 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_app_with_record.expr.migrated.roc @@ -0,0 +1,4 @@ +x = foo((baz({ + bar: blah +},)),) +x diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/outdented_colon_in_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_colon_in_record.expr.migrated.roc new file mode 100644 index 0000000000..fe0051fd58 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_colon_in_record.expr.migrated.roc @@ -0,0 +1,6 @@ +x = foo({ + bar + : + blah +},) +x diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/outdented_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_list.expr.migrated.roc new file mode 100644 index 0000000000..f1c1b56d61 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_list.expr.migrated.roc @@ -0,0 +1,4 @@ +a = [ + 1,2,3, +] +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/outdented_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_record.expr.migrated.roc new file mode 100644 index 0000000000..aba0e58ab3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/outdented_record.expr.migrated.roc @@ -0,0 +1,4 @@ +x = foo({ + bar: blah +},) +x diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/p_return_f_minus_f.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/p_return_f_minus_f.expr.migrated.roc new file mode 100644 index 0000000000..a648aa2160 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/p_return_f_minus_f.expr.migrated.roc @@ -0,0 +1,6 @@ +p +return # +{ + f + -f +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/packed_singleton_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/packed_singleton_list.expr.migrated.roc new file mode 100644 index 0000000000..e8b1a170fd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/packed_singleton_list.expr.migrated.roc @@ -0,0 +1 @@ +[1,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/paren_newline_before_return.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/paren_newline_before_return.expr.migrated.roc new file mode 100644 index 0000000000..9156117089 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/paren_newline_before_return.expr.migrated.roc @@ -0,0 +1,4 @@ +i + +return u + diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_apply_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_apply_newline.expr.migrated.roc new file mode 100644 index 0000000000..87fb27f8b4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_apply_newline.expr.migrated.roc @@ -0,0 +1,5 @@ +({ + f + N +}) +N # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_apply_not_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_apply_not_parens.expr.migrated.roc new file mode 100644 index 0000000000..2244edfc78 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_apply_not_parens.expr.migrated.roc @@ -0,0 +1,2 @@ +!(4 +)(4,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_comment_in_str_interpolation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_comment_in_str_interpolation.expr.migrated.roc new file mode 100644 index 0000000000..9b09b8b6df --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_comment_in_str_interpolation.expr.migrated.roc @@ -0,0 +1,2 @@ +"${S # + }" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_comment_tuple.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_comment_tuple.expr.migrated.roc new file mode 100644 index 0000000000..cf92496390 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_comment_tuple.expr.migrated.roc @@ -0,0 +1,2 @@ +((0 # + ),L,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_empty_record_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_empty_record_apply.expr.migrated.roc new file mode 100644 index 0000000000..dc9a60f5ef --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_empty_record_apply.expr.migrated.roc @@ -0,0 +1,3 @@ +({ +})({ +},) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_func_apply_type.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_func_apply_type.expr.migrated.roc new file mode 100644 index 0000000000..94e004831d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_func_apply_type.expr.migrated.roc @@ -0,0 +1,2 @@ +si: (e,..e, -> A) +A diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_newline_in_func_type.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_newline_in_func_type.expr.migrated.roc new file mode 100644 index 0000000000..6c95c241f6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_newline_in_func_type.expr.migrated.roc @@ -0,0 +1,3 @@ +C() : +h, -> a +C diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_newlines_before_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_newlines_before_as.expr.migrated.roc new file mode 100644 index 0000000000..662fb33de0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_newlines_before_as.expr.migrated.roc @@ -0,0 +1,3 @@ +1: * # +as J() +l diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parens_record_updater.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parens_record_updater.expr.migrated.roc new file mode 100644 index 0000000000..a0ccdc36c1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parens_record_updater.expr.migrated.roc @@ -0,0 +1,2 @@ +T +&n diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parenthesized_type_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parenthesized_type_def.expr.migrated.roc new file mode 100644 index 0000000000..7d33a412ce --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parenthesized_type_def.expr.migrated.roc @@ -0,0 +1,2 @@ +D() : b +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parenthesized_type_def_space_before.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parenthesized_type_def_space_before.expr.migrated.roc new file mode 100644 index 0000000000..38116d3db1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parenthesized_type_def_space_before.expr.migrated.roc @@ -0,0 +1,2 @@ +A() : b +a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_apply.expr.migrated.roc new file mode 100644 index 0000000000..d00fe8eb92 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_apply.expr.migrated.roc @@ -0,0 +1 @@ +(whee)(1,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_basic_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_basic_field.expr.migrated.roc new file mode 100644 index 0000000000..e3021fdd5c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_basic_field.expr.migrated.roc @@ -0,0 +1 @@ +(rec).field diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_field_qualified_var.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_field_qualified_var.expr.migrated.roc new file mode 100644 index 0000000000..0a21108ee8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_field_qualified_var.expr.migrated.roc @@ -0,0 +1 @@ +(One.Two.rec).field diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_var.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_var.expr.migrated.roc new file mode 100644 index 0000000000..c6284d24b6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parenthetical_var.expr.migrated.roc @@ -0,0 +1 @@ +whee diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parse_alias.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parse_alias.expr.migrated.roc new file mode 100644 index 0000000000..97d063253f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parse_alias.expr.migrated.roc @@ -0,0 +1,3 @@ +Blah(a,b,) : Foo.Bar.Baz(x,y,) + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/parse_as_ann.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/parse_as_ann.expr.migrated.roc new file mode 100644 index 0000000000..85cb3712ae --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/parse_as_ann.expr.migrated.roc @@ -0,0 +1,3 @@ +foo: Foo.Bar.Baz(x,y,)as Blah(a,b,) + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pat_parens_newline_before_pipe_when.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pat_parens_newline_before_pipe_when.expr.migrated.roc new file mode 100644 index 0000000000..58f3061ad8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pat_parens_newline_before_pipe_when.expr.migrated.roc @@ -0,0 +1,5 @@ +when 0 +{ + S( # + H, + ) | B->e} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pat_space_after_comma.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pat_space_after_comma.expr.migrated.roc new file mode 100644 index 0000000000..0131de4584 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pat_space_after_comma.expr.migrated.roc @@ -0,0 +1,3 @@ +{i, + p,} = 5 +Q diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as.expr.migrated.roc new file mode 100644 index 0000000000..b7e0bc45d8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as.expr.migrated.roc @@ -0,0 +1,3 @@ +when 0{ + + _ as n->n} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as_list_rest.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as_list_rest.expr.migrated.roc new file mode 100644 index 0000000000..8c4c11e782 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as_list_rest.expr.migrated.roc @@ -0,0 +1,3 @@ +when myList{ + + [first,.. as rest,]->0} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as_spaces.expr.migrated.roc new file mode 100644 index 0000000000..c1bb385040 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_as_spaces.expr.migrated.roc @@ -0,0 +1,5 @@ +when 0{ + + 0 # foobar + as # barfoo + n->{}} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pattern_comma_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_comma_newlines.expr.migrated.roc new file mode 100644 index 0000000000..9e6425d2bb --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_comma_newlines.expr.migrated.roc @@ -0,0 +1,3 @@ +1(i,p, # +): f +n diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pattern_record_apply_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_record_apply_comment.expr.migrated.roc new file mode 100644 index 0000000000..f54bdb0475 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_record_apply_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +s({t, # +},): s +p # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pattern_with_as_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_with_as_parens.expr.migrated.roc new file mode 100644 index 0000000000..325173657c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_with_as_parens.expr.migrated.roc @@ -0,0 +1,3 @@ +when t{ + + Ok({} as d,)->S} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pattern_with_space_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_with_space_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..93753bb990 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pattern_with_space_in_parens.expr.migrated.roc @@ -0,0 +1,3 @@ +when Delmin((Del(rx,)),0,){ + + Delmin(Del(ry,),_,)->Node(Black,0,Bool.false,ry,)} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pizza_dbg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pizza_dbg.expr.migrated.roc new file mode 100644 index 0000000000..1addeed52f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pizza_dbg.expr.migrated.roc @@ -0,0 +1 @@ +1 |> dbg diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pizza_question.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pizza_question.moduledefs.migrated.roc new file mode 100644 index 0000000000..e047485f4f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pizza_question.moduledefs.migrated.roc @@ -0,0 +1,7 @@ +main = +parseArgs?({},) +|> List.dropFirst(1,) +|> List.mapTry?(Str.toU8,) +|> List.sum +|> |total| "Sum of numbers: ${Num.to_str total}" +|> Str.toUpper diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/plus_if.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/plus_if.expr.migrated.roc new file mode 100644 index 0000000000..cf2aed96d8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/plus_if.expr.migrated.roc @@ -0,0 +1,5 @@ +1 * if Bool.true { + 1 +} else { + 1 +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/plus_when.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/plus_when.expr.migrated.roc new file mode 100644 index 0000000000..d6be931be4 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/plus_when.expr.migrated.roc @@ -0,0 +1,5 @@ +1 + +when Foo{ + + Foo->2 + Bar->3} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pnc_apply_comment_after_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_apply_comment_after_newline.expr.migrated.roc new file mode 100644 index 0000000000..86ad618890 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_apply_comment_after_newline.expr.migrated.roc @@ -0,0 +1,2 @@ +i(i, +)(t,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pnc_apply_neg_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_apply_neg_pattern.expr.migrated.roc new file mode 100644 index 0000000000..ffdd2228e1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_apply_neg_pattern.expr.migrated.roc @@ -0,0 +1,2 @@ +-8(): C +8 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pnc_dbg_parens_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_dbg_parens_comment.expr.migrated.roc new file mode 100644 index 0000000000..1507c4e96b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_dbg_parens_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +dbg(5, # +) +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pnc_parens_apply_etc.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_parens_apply_etc.expr.migrated.roc new file mode 100644 index 0000000000..8fa1fb24dd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pnc_parens_apply_etc.expr.migrated.roc @@ -0,0 +1,3 @@ + +3(): B +z diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/pos_inf_float.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/pos_inf_float.expr.migrated.roc new file mode 100644 index 0000000000..8484d062f5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/pos_inf_float.expr.migrated.roc @@ -0,0 +1 @@ +inf diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/positive_float.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/positive_float.expr.migrated.roc new file mode 100644 index 0000000000..a23417e2b8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/positive_float.expr.migrated.roc @@ -0,0 +1 @@ +42.9 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/positive_int.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/positive_int.expr.migrated.roc new file mode 100644 index 0000000000..d81cc0710e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/positive_int.expr.migrated.roc @@ -0,0 +1 @@ +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/provides_type.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/provides_type.header.migrated.roc new file mode 100644 index 0000000000..407c12d334 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/provides_type.header.migrated.roc @@ -0,0 +1 @@ +app [quicksort, Flags, Model] { pf: "./platform" } diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/qualified_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/qualified_field.expr.migrated.roc new file mode 100644 index 0000000000..e06c36489f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/qualified_field.expr.migrated.roc @@ -0,0 +1 @@ +One.Two.rec.abc.def.ghi diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/qualified_var.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/qualified_var.expr.migrated.roc new file mode 100644 index 0000000000..d6d63278b8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/qualified_var.expr.migrated.roc @@ -0,0 +1 @@ +One.Two.whee diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_access_after_tuple.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_access_after_tuple.expr.migrated.roc new file mode 100644 index 0000000000..4685c8f600 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_access_after_tuple.expr.migrated.roc @@ -0,0 +1 @@ +({a: 0},{b: 1},).0.a diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_builder.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_builder.expr.migrated.roc new file mode 100644 index 0000000000..8df987dcc5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_builder.expr.migrated.roc @@ -0,0 +1,2 @@ +{Foo.Bar.baz<-x: 5y: 0 +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_builder_ignored_fields.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_builder_ignored_fields.expr.migrated.roc new file mode 100644 index 0000000000..9ad399bc39 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_builder_ignored_fields.expr.migrated.roc @@ -0,0 +1,2 @@ +{Foo.Bar.baz<-x: 5y: 0_z: 3_: 2 +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_comment_newline_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_comment_newline_field.expr.migrated.roc new file mode 100644 index 0000000000..023bf3b326 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_comment_newline_field.expr.migrated.roc @@ -0,0 +1,2 @@ +{ # + a} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_destructure_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_destructure_def.expr.migrated.roc new file mode 100644 index 0000000000..88c3bf87d6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_destructure_def.expr.migrated.roc @@ -0,0 +1,5 @@ +# leading comment +{x,y,} = 5 +y = 6 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_destructure_field_bang.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_destructure_field_bang.expr.migrated.roc new file mode 100644 index 0000000000..ed2b86822c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_destructure_field_bang.expr.migrated.roc @@ -0,0 +1,3 @@ +{launchTheNukes!,code,} = config + +launchTheNukes!(code,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_double_newline_comment_field.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_double_newline_comment_field.expr.migrated.roc new file mode 100644 index 0000000000..be32afd9c1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_double_newline_comment_field.expr.migrated.roc @@ -0,0 +1,4 @@ +{ + +# +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_func_type_decl.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_func_type_decl.expr.migrated.roc new file mode 100644 index 0000000000..b026aa8965 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_func_type_decl.expr.migrated.roc @@ -0,0 +1,9 @@ +f: +{ + getLine: Effect(Str,) + putLine: Str, -> Effect(Int,) + text: Str + value: Int(*,) +} + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_literal_field_bang.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_literal_field_bang.expr.migrated.roc new file mode 100644 index 0000000000..364f1a359c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_literal_field_bang.expr.migrated.roc @@ -0,0 +1,4 @@ +{ + answer: 42 + launchTheNukes!: |{}| boom +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_type_with_function.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_type_with_function.expr.migrated.roc new file mode 100644 index 0000000000..7e9c1c9e3e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_type_with_function.expr.migrated.roc @@ -0,0 +1,3 @@ +x: {init: {}, -> Modelupdate: Model,Str, -> Modelview: Model, -> Str} + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_update.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_update.expr.migrated.roc new file mode 100644 index 0000000000..9d7eca65f5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_update.expr.migrated.roc @@ -0,0 +1 @@ +{Foo.Bar.baz&x: 5y: 0} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_update_apply_closure_comments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_update_apply_closure_comments.expr.migrated.roc new file mode 100644 index 0000000000..f1a99de5e8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_update_apply_closure_comments.expr.migrated.roc @@ -0,0 +1,3 @@ +{ # +h&}(| # +i| 0,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_update_comment_before_ampersand.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_update_comment_before_ampersand.expr.migrated.roc new file mode 100644 index 0000000000..c71fd7a525 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_update_comment_before_ampersand.expr.migrated.roc @@ -0,0 +1,2 @@ +{i # +&} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_closure_weirdness.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_closure_weirdness.expr.migrated.roc new file mode 100644 index 0000000000..00c98b6252 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_closure_weirdness.expr.migrated.roc @@ -0,0 +1,2 @@ +&rm?(|L2| t,) ++ c diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_literal_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_literal_apply.expr.migrated.roc new file mode 100644 index 0000000000..4ffbde6ddf --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_literal_apply.expr.migrated.roc @@ -0,0 +1,5 @@ +data = +{x: 5y: 0} +|> &y(3,) + +data diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_var_apply.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_var_apply.expr.migrated.roc new file mode 100644 index 0000000000..e4930e10ab --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_updater_var_apply.expr.migrated.roc @@ -0,0 +1 @@ +foo(&bar,5,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_with_if.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_with_if.expr.migrated.roc new file mode 100644 index 0000000000..758fb24ef2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_with_if.expr.migrated.roc @@ -0,0 +1,5 @@ +{x: if Bool.true { + 1 + } else { + 2 + }y: 3} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_with_lots_of_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/record_with_lots_of_newlines.expr.migrated.roc new file mode 100644 index 0000000000..347a599eb0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_with_lots_of_newlines.expr.migrated.roc @@ -0,0 +1,3 @@ +{t # + +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/repr_7342.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/repr_7342.expr.migrated.roc new file mode 100644 index 0000000000..a67b22ad6f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/repr_7342.expr.migrated.roc @@ -0,0 +1,5 @@ +({ + 1( # + Q,a,): t + n +}) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/requires_type.header.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/requires_type.header.migrated.roc new file mode 100644 index 0000000000..abf9f3ab81 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/requires_type.header.migrated.roc @@ -0,0 +1,6 @@ +platform "test/types" + requires { Flags, Model } { main : App Flags Model } + exposes [] + packages {} + imports [] + provides [main_for_host] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_apply_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_apply_newline.expr.migrated.roc new file mode 100644 index 0000000000..3b9d0ca72c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_apply_newline.expr.migrated.roc @@ -0,0 +1,6 @@ +return +{ + n + r +} +# diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_empty_assign.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_empty_assign.expr.migrated.roc new file mode 100644 index 0000000000..ce12d33f2c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_empty_assign.expr.migrated.roc @@ -0,0 +1,7 @@ +return +# +{ + s + r +} + diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_field_access_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_field_access_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..2ff990aa1b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_field_access_in_parens.expr.migrated.roc @@ -0,0 +1,3 @@ +(return .o +) +ss diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_in_apply_func.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_apply_func.expr.migrated.roc new file mode 100644 index 0000000000..6f441303cb --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_apply_func.expr.migrated.roc @@ -0,0 +1,3 @@ +( +return -3e +)(g,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_in_if.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_if.expr.migrated.roc new file mode 100644 index 0000000000..85b531de4a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_if.expr.migrated.roc @@ -0,0 +1,16 @@ +maybeEarlyReturn = |x| +{ + y = + if x > 5 { + + return "abc" + + } else { + + x + 2 + } + + Num.to_str(y,) +} + +maybeEarlyReturn(10,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_in_static_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_static_def.expr.migrated.roc new file mode 100644 index 0000000000..0e90c7ae9d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_static_def.expr.migrated.roc @@ -0,0 +1,18 @@ +staticValueDef = +{ + someVal = + if 10 > 5 { + + { + x = 5 + return x + } + } else { + + 6 + } + + someVal + 2 +} + +staticValueDef diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_in_when.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_when.expr.migrated.roc new file mode 100644 index 0000000000..916b32e06d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_in_when.expr.migrated.roc @@ -0,0 +1,15 @@ +maybeEarlyReturn = |x| +{ + y = + when x{ + + 5-> + return + "abc" + + _->x + 2} + + Num.to_str(y,) +} + +maybeEarlyRetun(3,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_minus_one.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_minus_one.expr.migrated.roc new file mode 100644 index 0000000000..06ee22ecf7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_minus_one.expr.migrated.roc @@ -0,0 +1,3 @@ +return -r + +1 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_multiline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_multiline.expr.migrated.roc new file mode 100644 index 0000000000..f45ec67e4b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_multiline.expr.migrated.roc @@ -0,0 +1,5 @@ +return +something +|> pipeToFunction +|> andAnother + diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_only_statement.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_only_statement.expr.migrated.roc new file mode 100644 index 0000000000..46206fc4ce --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_only_statement.expr.migrated.roc @@ -0,0 +1,4 @@ +identityFn = |x| +return x + +identityFn(45,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_parens_comments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_parens_comments.expr.migrated.roc new file mode 100644 index 0000000000..0ecf01916d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_parens_comments.expr.migrated.roc @@ -0,0 +1,5 @@ +return (3 # +# +) + +Z diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_record_update_comment_empty_fields.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_record_update_comment_empty_fields.expr.migrated.roc new file mode 100644 index 0000000000..f2e4afbcfb --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_record_update_comment_empty_fields.expr.migrated.roc @@ -0,0 +1,4 @@ +return +{ # +g&}(e,) + diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_then_nested_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_then_nested_parens.expr.migrated.roc new file mode 100644 index 0000000000..85cd10e78e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_then_nested_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +return n + +0 +# diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/return_with_after.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/return_with_after.expr.migrated.roc new file mode 100644 index 0000000000..221579b58c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/return_with_after.expr.migrated.roc @@ -0,0 +1,6 @@ +return -1 +# +{ + X + s +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/sep_annotation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/sep_annotation.expr.migrated.roc new file mode 100644 index 0000000000..c37db07f4a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/sep_annotation.expr.migrated.roc @@ -0,0 +1,5 @@ +E(): i + +E + = h +0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/separate_defs.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/separate_defs.moduledefs.migrated.roc new file mode 100644 index 0000000000..f4e86c2d50 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/separate_defs.moduledefs.migrated.roc @@ -0,0 +1,7 @@ +App(state,initData,) : Html.Internal.Shared.App(state,initData,) +Html(state,) : Html.Internal.Shared.Html(state,) +Attribute(state,) : Html.Internal.Shared.Attribute(state,) + +element = Html.Internal.Shared.element +text = Html.Internal.Shared.text +none = Html.Internal.Shared.none diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/single_arg_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/single_arg_closure.expr.migrated.roc new file mode 100644 index 0000000000..272790ac2e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/single_arg_closure.expr.migrated.roc @@ -0,0 +1 @@ +|a| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/single_arg_with_underscore_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/single_arg_with_underscore_closure.expr.migrated.roc new file mode 100644 index 0000000000..dc1e7b1718 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/single_arg_with_underscore_closure.expr.migrated.roc @@ -0,0 +1 @@ +|the_answer| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/single_question_binop_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/single_question_binop_closure.expr.migrated.roc new file mode 100644 index 0000000000..2a855b09d0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/single_question_binop_closure.expr.migrated.roc @@ -0,0 +1,2 @@ +fallible!(args,) ? |my_err| +my_err * 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/single_question_binop_tag.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/single_question_binop_tag.expr.migrated.roc new file mode 100644 index 0000000000..1404f27c17 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/single_question_binop_tag.expr.migrated.roc @@ -0,0 +1 @@ +fallible!(args,) ? WrapOverErr diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/single_underscore_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/single_underscore_closure.expr.migrated.roc new file mode 100644 index 0000000000..5265c381f6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/single_underscore_closure.expr.migrated.roc @@ -0,0 +1 @@ +|_| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/sneaky_and_expr.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/sneaky_and_expr.expr.migrated.roc new file mode 100644 index 0000000000..06085c0407 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/sneaky_and_expr.expr.migrated.roc @@ -0,0 +1,3 @@ +a +{} = ands +d diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/sneaky_implements_in_opaque_fn_type.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/sneaky_implements_in_opaque_fn_type.expr.migrated.roc new file mode 100644 index 0000000000..dd0a8c3e98 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/sneaky_implements_in_opaque_fn_type.expr.migrated.roc @@ -0,0 +1,2 @@ +N() := e, -> implements +I diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/space_after_opt_field_pat.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/space_after_opt_field_pat.expr.migrated.roc new file mode 100644 index 0000000000..eac63315de --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/space_after_opt_field_pat.expr.migrated.roc @@ -0,0 +1,3 @@ +{p? + m?,}: J +O diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/space_before_colon.full.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/space_before_colon.full.migrated.roc new file mode 100644 index 0000000000..51acedc684 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/space_before_colon.full.migrated.roc @@ -0,0 +1,3 @@ +app [main] { pf: platform "path" } + +main = Stdout.line("Hello",) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/space_before_parens_space_after.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/space_before_parens_space_after.expr.migrated.roc new file mode 100644 index 0000000000..ee175794d3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/space_before_parens_space_after.expr.migrated.roc @@ -0,0 +1,3 @@ +i +4 +# ( diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/space_only_after_minus.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/space_only_after_minus.expr.migrated.roc new file mode 100644 index 0000000000..82b2d8de84 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/space_only_after_minus.expr.migrated.roc @@ -0,0 +1 @@ +x - y diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/spaced_singleton_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/spaced_singleton_list.expr.migrated.roc new file mode 100644 index 0000000000..e8b1a170fd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/spaced_singleton_list.expr.migrated.roc @@ -0,0 +1 @@ +[1,] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/spaces_inside_empty_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/spaces_inside_empty_list.expr.migrated.roc new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/spaces_inside_empty_list.expr.migrated.roc @@ -0,0 +1 @@ +[] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/standalone_module_defs.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/standalone_module_defs.moduledefs.migrated.roc new file mode 100644 index 0000000000..2c6e02bbfd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/standalone_module_defs.moduledefs.migrated.roc @@ -0,0 +1,7 @@ +# comment 1 +foo = 1 + +# comment 2 +bar = "hi" +baz = "stuff" +# comment n diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/stmt_parens_minus.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/stmt_parens_minus.expr.migrated.roc new file mode 100644 index 0000000000..4164acc6f9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/stmt_parens_minus.expr.migrated.roc @@ -0,0 +1,2 @@ +i +-2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/stmts_in_empty_record_assignment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/stmts_in_empty_record_assignment.expr.migrated.roc new file mode 100644 index 0000000000..d064c52495 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/stmts_in_empty_record_assignment.expr.migrated.roc @@ -0,0 +1,6 @@ +{} = +{ + p + t +} +J diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/str_block_multiple_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/str_block_multiple_newlines.expr.migrated.roc new file mode 100644 index 0000000000..aba21f55a3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/str_block_multiple_newlines.expr.migrated.roc @@ -0,0 +1,5 @@ +""" + + +# +""" # diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/str_minus_pnc_call_multiline_str.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/str_minus_pnc_call_multiline_str.expr.migrated.roc new file mode 100644 index 0000000000..ae2b538731 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/str_minus_pnc_call_multiline_str.expr.migrated.roc @@ -0,0 +1,3 @@ +""(- +""" +"""(),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/string_without_escape.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/string_without_escape.expr.migrated.roc new file mode 100644 index 0000000000..1fe6198fd3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/string_without_escape.expr.migrated.roc @@ -0,0 +1 @@ +"123 abc 456 def" diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/sub_var_with_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/sub_var_with_spaces.expr.migrated.roc new file mode 100644 index 0000000000..8fcf287f48 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/sub_var_with_spaces.expr.migrated.roc @@ -0,0 +1 @@ +x - 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/sub_with_spaces.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/sub_with_spaces.expr.migrated.roc new file mode 100644 index 0000000000..095076294f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/sub_with_spaces.expr.migrated.roc @@ -0,0 +1 @@ +1 - 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question.expr.migrated.roc new file mode 100644 index 0000000000..89b2e56eb0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question.expr.migrated.roc @@ -0,0 +1 @@ +Stdout.line??? diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_multiple_defs.moduledefs.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_multiple_defs.moduledefs.migrated.roc new file mode 100644 index 0000000000..7143490c0a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_multiple_defs.moduledefs.migrated.roc @@ -0,0 +1,7 @@ +main = +{ + a?("Bar",) + x = B.b?("Foo",) + + c?(x,) +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_nested.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_nested.expr.migrated.roc new file mode 100644 index 0000000000..9688458829 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_nested.expr.migrated.roc @@ -0,0 +1 @@ +foo?((bar?(baz,)),(blah(stuff,)),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_one_def.full.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_one_def.full.migrated.roc new file mode 100644 index 0000000000..5e380bdde7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_one_def.full.migrated.roc @@ -0,0 +1,18 @@ +app [main] { + cli: "../basic-cli/platform/main.roc", +} + +importcli.Stdout + +main = +# is this a valid statement? +{ + "Foo" |> A.x? + + # what about this? + "Bar" |> B.y?( + {config: "config"},) + + C.z("Bar",) +} + diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_optional_last.full.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_optional_last.full.migrated.roc new file mode 100644 index 0000000000..659aa3cf68 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/suffixed_question_optional_last.full.migrated.roc @@ -0,0 +1,9 @@ +app [main] { + cli: platform "", +} + +main = +"jq --version" +|> Cmd.new +|> Cmd.status +|> Result.mapErr?(UnableToCheckJQVersion,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tag_destructure_bang.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tag_destructure_bang.expr.migrated.roc new file mode 100644 index 0000000000..1297b0d787 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tag_destructure_bang.expr.migrated.roc @@ -0,0 +1,3 @@ +Config(launchTheNukes!,code,) = cfg + +launchTheNukes!(code,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tag_destructure_bang_no_space.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tag_destructure_bang_no_space.expr.migrated.roc new file mode 100644 index 0000000000..1297b0d787 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tag_destructure_bang_no_space.expr.migrated.roc @@ -0,0 +1,3 @@ +Config(launchTheNukes!,code,) = cfg + +launchTheNukes!(code,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tag_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tag_pattern.expr.migrated.roc new file mode 100644 index 0000000000..136e77ff9d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tag_pattern.expr.migrated.roc @@ -0,0 +1 @@ +|Thing| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tag_union_ann_with_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tag_union_ann_with_as.expr.migrated.roc new file mode 100644 index 0000000000..31c36d8b13 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tag_union_ann_with_as.expr.migrated.roc @@ -0,0 +1,2 @@ +1: [N(*as S(),),] +_ diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tag_union_functions_as.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tag_union_functions_as.expr.migrated.roc new file mode 100644 index 0000000000..7975930a7a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tag_union_functions_as.expr.migrated.roc @@ -0,0 +1,3 @@ +main_for_host: [StdoutWrite(Str,{}, -> Op,),StderrWrite(Str,{}, -> Op,),Done,]as Op() +main_for_host = main +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ten_times_eleven.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/ten_times_eleven.expr.migrated.roc new file mode 100644 index 0000000000..fcd553b9b9 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ten_times_eleven.expr.migrated.roc @@ -0,0 +1 @@ +10 * 11 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/three_arg_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/three_arg_closure.expr.migrated.roc new file mode 100644 index 0000000000..c78cfbf87c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/three_arg_closure.expr.migrated.roc @@ -0,0 +1 @@ +|abc| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/triple_paren_pat_ann.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/triple_paren_pat_ann.expr.migrated.roc new file mode 100644 index 0000000000..07e73dda14 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/triple_paren_pat_ann.expr.migrated.roc @@ -0,0 +1,3 @@ +1(0(0, +),)(f,): f +i diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/triple_quote_craziness.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/triple_quote_craziness.expr.migrated.roc new file mode 100644 index 0000000000..95d9b4b5d5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/triple_quote_craziness.expr.migrated.roc @@ -0,0 +1,6 @@ +H( +""" +""",) = f( +""" +""",) +f! diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/try_blank_in_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/try_blank_in_list.expr.migrated.roc new file mode 100644 index 0000000000..4efa80f7b6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/try_blank_in_list.expr.migrated.roc @@ -0,0 +1,2 @@ +L([try, # [then2[# +],) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/try_function_after_pipe.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/try_function_after_pipe.expr.migrated.roc new file mode 100644 index 0000000000..7f1b189191 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/try_function_after_pipe.expr.migrated.roc @@ -0,0 +1,2 @@ +"123" +|> try(Str.toU64,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/try_pipe_suffix.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/try_pipe_suffix.expr.migrated.roc new file mode 100644 index 0000000000..c99c6d6fd2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/try_pipe_suffix.expr.migrated.roc @@ -0,0 +1 @@ +Str.toU64("123",) |> try diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/try_plain_prefix.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/try_plain_prefix.expr.migrated.roc new file mode 100644 index 0000000000..5417dd0d2b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/try_plain_prefix.expr.migrated.roc @@ -0,0 +1 @@ +try(Str.toU64,"123",) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/try_subtract.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/try_subtract.expr.migrated.roc new file mode 100644 index 0000000000..90d0835959 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/try_subtract.expr.migrated.roc @@ -0,0 +1 @@ +try - w diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_access_after_ident.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_access_after_ident.expr.migrated.roc new file mode 100644 index 0000000000..534f41b81b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_access_after_ident.expr.migrated.roc @@ -0,0 +1,2 @@ +abc = (1,2,3,) +abc.0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_access_after_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_access_after_record.expr.migrated.roc new file mode 100644 index 0000000000..c8f7b714eb --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_access_after_record.expr.migrated.roc @@ -0,0 +1 @@ +{a: (1,2,)}.a.0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_accessor_function.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_accessor_function.expr.migrated.roc new file mode 100644 index 0000000000..45a85fac11 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_accessor_function.expr.migrated.roc @@ -0,0 +1 @@ +.1((1,2,3,),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_apply_parens_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_apply_parens_comment.expr.migrated.roc new file mode 100644 index 0000000000..7be8657eef --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_apply_parens_comment.expr.migrated.roc @@ -0,0 +1,4 @@ +(({ + L + L + })(L,),L,) # \ diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_destructure_bang.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_destructure_bang.expr.migrated.roc new file mode 100644 index 0000000000..df433a7547 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_destructure_bang.expr.migrated.roc @@ -0,0 +1,3 @@ +(launchTheNukes!,code,) = config + +launchTheNukes!(code,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_funcs_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_funcs_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..859ca3841f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_funcs_in_parens.expr.migrated.roc @@ -0,0 +1,2 @@ +f: (a,b, -> c,d, -> e,g,) +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_function_annotation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_function_annotation.expr.migrated.roc new file mode 100644 index 0000000000..99c587fee6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_function_annotation.expr.migrated.roc @@ -0,0 +1,4 @@ +11 +: (I,s, + Mw, -> r,..l) +asl diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_type.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_type.expr.migrated.roc new file mode 100644 index 0000000000..00dbec4b7f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_type.expr.migrated.roc @@ -0,0 +1,4 @@ +f: (Str,Str,), -> (Str,Str,) +f = |x| x + +f((1,2,),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuple_type_ext.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_type_ext.expr.migrated.roc new file mode 100644 index 0000000000..c44f836b2c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuple_type_ext.expr.migrated.roc @@ -0,0 +1,4 @@ +f: (Str,Str,..a), -> (Str,Str,..a) +f = |x| x + +f((1,2,),) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/tuples_parens_comments.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/tuples_parens_comments.expr.migrated.roc new file mode 100644 index 0000000000..807a139265 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/tuples_parens_comments.expr.migrated.roc @@ -0,0 +1,8 @@ +(i, # + + { + ( + # + (EsE)) + ui + },) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/two_arg_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/two_arg_closure.expr.migrated.roc new file mode 100644 index 0000000000..8c2186a000 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/two_arg_closure.expr.migrated.roc @@ -0,0 +1 @@ +|ab| 42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/two_branch_when.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/two_branch_when.expr.migrated.roc new file mode 100644 index 0000000000..71996a97ba --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/two_branch_when.expr.migrated.roc @@ -0,0 +1,4 @@ +when x{ + + ""->1 + "mise"->2} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/two_spaced_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/two_spaced_def.expr.migrated.roc new file mode 100644 index 0000000000..3616875083 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/two_spaced_def.expr.migrated.roc @@ -0,0 +1,5 @@ +# leading comment +x = 5 +y = 6 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/type_ann_tag_union_parens_applies.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/type_ann_tag_union_parens_applies.expr.migrated.roc new file mode 100644 index 0000000000..9f3b8e9c41 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/type_ann_tag_union_parens_applies.expr.migrated.roc @@ -0,0 +1,3 @@ +1: [N(H(S, + ),),] +_ diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/type_decl_with_underscore.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/type_decl_with_underscore.expr.migrated.roc new file mode 100644 index 0000000000..ff57603893 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/type_decl_with_underscore.expr.migrated.roc @@ -0,0 +1,2 @@ +doStuff: UserId, -> Dict(Str,_,) +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/type_signature_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/type_signature_def.expr.migrated.roc new file mode 100644 index 0000000000..7ce5b5230a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/type_signature_def.expr.migrated.roc @@ -0,0 +1,4 @@ +foo: Int +foo = 4 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/type_signature_function_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/type_signature_function_def.expr.migrated.roc new file mode 100644 index 0000000000..44eb97ecc1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/type_signature_function_def.expr.migrated.roc @@ -0,0 +1,4 @@ +foo: Int,Float, -> Bool +foo = |x_| 42 + +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/type_tuple_where_annotation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/type_tuple_where_annotation.expr.migrated.roc new file mode 100644 index 0000000000..7d739c0462 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/type_tuple_where_annotation.expr.migrated.roc @@ -0,0 +1,3 @@ +nextWhileLess: List(Bucket,),k,U8, -> (U64,U32,) where k implements Hash & Eq +nextWhileLess = |bucketskeyshifts| foo +nextWhileLess diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation.expr.migrated.roc new file mode 100644 index 0000000000..c91f4d0348 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation.expr.migrated.roc @@ -0,0 +1 @@ +-foo diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_access.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_access.expr.migrated.roc new file mode 100644 index 0000000000..f6f246e507 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_access.expr.migrated.roc @@ -0,0 +1 @@ +-rec1.field diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_arg.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_arg.expr.migrated.roc new file mode 100644 index 0000000000..ccde34ffca --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_arg.expr.migrated.roc @@ -0,0 +1 @@ +whee(12,-foo,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_with_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_with_parens.expr.migrated.roc new file mode 100644 index 0000000000..7066ab7061 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unary_negation_with_parens.expr.migrated.roc @@ -0,0 +1 @@ +-(whee(12,foo,)) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unary_not.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unary_not.expr.migrated.roc new file mode 100644 index 0000000000..81e6c7d6f1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unary_not.expr.migrated.roc @@ -0,0 +1 @@ +!blah diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unary_not_with_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unary_not_with_parens.expr.migrated.roc new file mode 100644 index 0000000000..423b1be604 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unary_not_with_parens.expr.migrated.roc @@ -0,0 +1 @@ +!(whee(12,foo,)) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/underscore_expr_in_def.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/underscore_expr_in_def.expr.migrated.roc new file mode 100644 index 0000000000..67aa67a363 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/underscore_expr_in_def.expr.migrated.roc @@ -0,0 +1,2 @@ +J() : R +n_p diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/underscore_in_assignment_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/underscore_in_assignment_pattern.expr.migrated.roc new file mode 100644 index 0000000000..7ef2b3d393 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/underscore_in_assignment_pattern.expr.migrated.roc @@ -0,0 +1,7 @@ +Pair(x,_,) = Pair(0,1,) +Pair(_,y,) = Pair(0,1,) +Pair(_,_,) = Pair(0,1,) +_ = Pair(0,1,) +Pair(Pair(x,_,),Pair(_,y,),) = Pair((Pair(0,1,)),(Pair(2,3,)),) + +0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unicode_overflow_str.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unicode_overflow_str.expr.migrated.roc new file mode 100644 index 0000000000..663e7e6850 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unicode_overflow_str.expr.migrated.roc @@ -0,0 +1 @@ +m("\u(FFFFFF)",s,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/unindented_if_in_closure.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/unindented_if_in_closure.expr.migrated.roc new file mode 100644 index 0000000000..eaec758dd1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/unindented_if_in_closure.expr.migrated.roc @@ -0,0 +1,6 @@ +|A| if !s! { + + f +} else { + -9 +} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/value_def_confusion.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/value_def_confusion.expr.migrated.roc new file mode 100644 index 0000000000..432551533f --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/value_def_confusion.expr.migrated.roc @@ -0,0 +1,3 @@ +a: F +F() : h +abc diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/var_else.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/var_else.expr.migrated.roc new file mode 100644 index 0000000000..b77561fbda --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/var_else.expr.migrated.roc @@ -0,0 +1 @@ +elsewhere diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/var_if.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/var_if.expr.migrated.roc new file mode 100644 index 0000000000..c1587d9726 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/var_if.expr.migrated.roc @@ -0,0 +1 @@ +iffy diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/var_is.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/var_is.expr.migrated.roc new file mode 100644 index 0000000000..59c383a482 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/var_is.expr.migrated.roc @@ -0,0 +1 @@ +isnt diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/var_minus_two.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/var_minus_two.expr.migrated.roc new file mode 100644 index 0000000000..8fcf287f48 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/var_minus_two.expr.migrated.roc @@ -0,0 +1 @@ +x - 2 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/var_then.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/var_then.expr.migrated.roc new file mode 100644 index 0000000000..b192c1601e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/var_then.expr.migrated.roc @@ -0,0 +1 @@ +thenever diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/var_when.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/var_when.expr.migrated.roc new file mode 100644 index 0000000000..8a8a8a68ac --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/var_when.expr.migrated.roc @@ -0,0 +1 @@ +whenever diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_branch_comment_after_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_branch_comment_after_parens.expr.migrated.roc new file mode 100644 index 0000000000..42a5eb9bd1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_branch_comment_after_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +when n{ + + O->s} +# diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_comment_after_pattern.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_comment_after_pattern.expr.migrated.roc new file mode 100644 index 0000000000..b5eaa4edaf --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_comment_after_pattern.expr.migrated.roc @@ -0,0 +1,4 @@ +when nns{ + + O # +->r} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_comment_bbefore_if.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_comment_bbefore_if.expr.migrated.roc new file mode 100644 index 0000000000..1a60a4de01 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_comment_bbefore_if.expr.migrated.roc @@ -0,0 +1,4 @@ +when 0 +{ + S # + if S->e} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_if_guard.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_if_guard.expr.migrated.roc new file mode 100644 index 0000000000..065b6f4fda --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_if_guard.expr.migrated.roc @@ -0,0 +1,10 @@ +when x{ + + _-> + 1 + + _-> + 2 + + Ok-> + 3} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_assignment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_assignment.expr.migrated.roc new file mode 100644 index 0000000000..3893f2db37 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_assignment.expr.migrated.roc @@ -0,0 +1,4 @@ +x = when n{ + + 0->0} +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binop_in_assign_with_sneaky_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binop_in_assign_with_sneaky_newline.expr.migrated.roc new file mode 100644 index 0000000000..434fc382a8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binop_in_assign_with_sneaky_newline.expr.migrated.roc @@ -0,0 +1,5 @@ +j = m % when f +{ + e->(i + )} +h diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binop_in_closure_in_when_guard_wow_fuzzer.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binop_in_closure_in_when_guard_wow_fuzzer.expr.migrated.roc new file mode 100644 index 0000000000..285fae627d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binop_in_closure_in_when_guard_wow_fuzzer.expr.migrated.roc @@ -0,0 +1,7 @@ +when f +{ + + 3 if |t| m % when f + { + z->e( + z,)}->m} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binops.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binops.expr.migrated.roc new file mode 100644 index 0000000000..bf6eabe28a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_binops.expr.migrated.roc @@ -0,0 +1,4 @@ +di < s < (when b +{ + 7->7e})( +zl,) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_closure_in_when_guard_wtf.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_closure_in_when_guard_wtf.expr.migrated.roc new file mode 100644 index 0000000000..f94f617270 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_closure_in_when_guard_wtf.expr.migrated.roc @@ -0,0 +1,7 @@ +when f +{ + + s if |t| when 0 + { + z->f( + z,)}->m} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_function.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_function.expr.migrated.roc new file mode 100644 index 0000000000..2c0e02ec95 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_function.expr.migrated.roc @@ -0,0 +1,4 @@ +func = |x| when n{ + + 0->0} +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_function_python_style_indent.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_function_python_style_indent.expr.migrated.roc new file mode 100644 index 0000000000..2c0e02ec95 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_function_python_style_indent.expr.migrated.roc @@ -0,0 +1,4 @@ +func = |x| when n{ + + 0->0} +42 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_list.expr.migrated.roc new file mode 100644 index 0000000000..e734d1a902 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_list.expr.migrated.roc @@ -0,0 +1,3 @@ +[when 2{ + 8->[ + ]},] diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..13cf1425b0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +when x{ + + Ok-> + 3} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_parens_indented.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_parens_indented.expr.migrated.roc new file mode 100644 index 0000000000..532051fed1 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_parens_indented.expr.migrated.roc @@ -0,0 +1,3 @@ +when x{ + + Ok->3} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_in_when_guard_wtf.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_when_guard_wtf.expr.migrated.roc new file mode 100644 index 0000000000..ea86830c25 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_in_when_guard_wtf.expr.migrated.roc @@ -0,0 +1,7 @@ +when f +{ + + s if when 0 + { + z->f( + z,)}->m} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_newline_after_condition.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_newline_after_condition.expr.migrated.roc new file mode 100644 index 0000000000..5f20174c46 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_newline_after_condition.expr.migrated.roc @@ -0,0 +1,4 @@ +when n +# s +{ + O->1} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_newline_before_is_and_in_branch_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_newline_before_is_and_in_branch_parens.expr.migrated.roc new file mode 100644 index 0000000000..2bc1a90012 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_newline_before_is_and_in_branch_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +when 0 +{ + B-> + t} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_result_list.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_result_list.expr.migrated.roc new file mode 100644 index 0000000000..2a6067d45e --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_result_list.expr.migrated.roc @@ -0,0 +1,4 @@ +when Ok([],){ + + Ok([],)->{} + _->{}} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_with_alternative_patterns.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_alternative_patterns.expr.migrated.roc new file mode 100644 index 0000000000..a251dfe8c6 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_alternative_patterns.expr.migrated.roc @@ -0,0 +1,7 @@ +when x{ + + "blah" | "blop"->1 + "foo" | + "bar" + | "baz"->2 + "stuff"->4} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_with_function_application.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_function_application.expr.migrated.roc new file mode 100644 index 0000000000..caea937393 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_function_application.expr.migrated.roc @@ -0,0 +1,5 @@ +when x{ + + 1->Num.neg( + 2,) + _->4} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_with_negative_numbers.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_negative_numbers.expr.migrated.roc new file mode 100644 index 0000000000..6115693850 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_negative_numbers.expr.migrated.roc @@ -0,0 +1,4 @@ +when x{ + + 1->2 + -3->4} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_with_numbers.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_numbers.expr.migrated.roc new file mode 100644 index 0000000000..3ecdd61ae7 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_numbers.expr.migrated.roc @@ -0,0 +1,4 @@ +when x{ + + 1->2 + 3->4} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_with_records.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_records.expr.migrated.roc new file mode 100644 index 0000000000..ee51daff5a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_records.expr.migrated.roc @@ -0,0 +1,4 @@ +when x{ + + {y,}->2 + {z,w,}->4} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_with_tuple_in_record.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_tuple_in_record.expr.migrated.roc new file mode 100644 index 0000000000..23a0b61fe8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_tuple_in_record.expr.migrated.roc @@ -0,0 +1,4 @@ +when {foo: (1,2,)}{ + + {foo: (1,x,),}->x + {foo: (_,b,),}->3 + b} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/when_with_tuples.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_tuples.expr.migrated.roc new file mode 100644 index 0000000000..f51cc297d5 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/when_with_tuples.expr.migrated.roc @@ -0,0 +1,4 @@ +when (1,2,){ + + (1,x,)->x + (_,b,)->3 + b} diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_and_implements_lookalikes.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_and_implements_lookalikes.expr.migrated.roc new file mode 100644 index 0000000000..612258f838 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_and_implements_lookalikes.expr.migrated.roc @@ -0,0 +1,5 @@ +({ + i: a # + wherew(implementsI,) + e +}) diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_function.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_function.expr.migrated.roc new file mode 100644 index 0000000000..76f6c8b77b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_function.expr.migrated.roc @@ -0,0 +1,3 @@ +f: a, -> b, -> c where a implements A + +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_bound_abilities.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_bound_abilities.expr.migrated.roc new file mode 100644 index 0000000000..64ce5d377c --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_bound_abilities.expr.migrated.roc @@ -0,0 +1,7 @@ +f: a, -> b where a implements Hash & Eq where b implements Eq & Hash & Display + +f: a, -> b + where a implements Hash & Eq where +b implements Hash & Display & Eq + +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has.expr.migrated.roc new file mode 100644 index 0000000000..84ada4f266 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has.expr.migrated.roc @@ -0,0 +1,3 @@ +f: a, -> b, -> c where a implements A where b implements Eq where c implements Ord + +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.migrated.roc new file mode 100644 index 0000000000..719a27e048 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.migrated.roc @@ -0,0 +1,6 @@ +f: a, -> b, -> c + where a implements Hash where +b implements Eq where +c implements Ord + +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_non_function.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_non_function.expr.migrated.roc new file mode 100644 index 0000000000..0d0e84ee29 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_non_function.expr.migrated.roc @@ -0,0 +1,3 @@ +f: a where a implements A + +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_on_newline.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_on_newline.expr.migrated.roc new file mode 100644 index 0000000000..c8bc5f52c3 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_on_newline.expr.migrated.roc @@ -0,0 +1,4 @@ +f: a, -> U64 + where a implements Hash + +f diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_ident.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_ident.expr.migrated.roc new file mode 100644 index 0000000000..f010a58e0b --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_ident.expr.migrated.roc @@ -0,0 +1,4 @@ +where: {where: I32} +where = {where: 1} + +where.where diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_implements_lots_of_newlines.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_implements_lots_of_newlines.expr.migrated.roc new file mode 100644 index 0000000000..359583c72d --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_implements_lots_of_newlines.expr.migrated.roc @@ -0,0 +1,7 @@ +T() : [ +] # + where +e + implements +T +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_in_parens.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_in_parens.expr.migrated.roc new file mode 100644 index 0000000000..34f4820fa0 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_in_parens.expr.migrated.roc @@ -0,0 +1,4 @@ +L() : (l where + e + implements Z,..I) +s diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_in_tuple_after_comment.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_in_tuple_after_comment.expr.migrated.roc new file mode 100644 index 0000000000..6790abc5b8 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_in_tuple_after_comment.expr.migrated.roc @@ -0,0 +1,3 @@ +1: (* # + where e implements J,..*) +l diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_in_tuple_plain.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_in_tuple_plain.expr.migrated.roc new file mode 100644 index 0000000000..21156b0acd --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_in_tuple_plain.expr.migrated.roc @@ -0,0 +1,2 @@ +1: A(* where e implements J,*,) +l diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_newline_p_implements.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_newline_p_implements.expr.migrated.roc new file mode 100644 index 0000000000..f970dc58e2 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_newline_p_implements.expr.migrated.roc @@ -0,0 +1,4 @@ +2: (..e +) where +p implements T +e diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/zero_float.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/zero_float.expr.migrated.roc new file mode 100644 index 0000000000..ba66466c2a --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/zero_float.expr.migrated.roc @@ -0,0 +1 @@ +0.0 diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/zero_int.expr.migrated.roc b/crates/compiler/test_syntax/tests/snapshots/pass/zero_int.expr.migrated.roc new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/crates/compiler/test_syntax/tests/snapshots/pass/zero_int.expr.migrated.roc @@ -0,0 +1 @@ +0 diff --git a/crates/compiler/test_syntax/tests/test_snapshots.rs b/crates/compiler/test_syntax/tests/test_snapshots.rs index e043c474ea..1860f2d574 100644 --- a/crates/compiler/test_syntax/tests/test_snapshots.rs +++ b/crates/compiler/test_syntax/tests/test_snapshots.rs @@ -98,6 +98,8 @@ mod test_snapshots { for file in list(&res_dir) { let test = if let Some(test) = file.strip_suffix(".formatted.roc") { test + } else if let Some(test) = file.strip_suffix(".migrated.roc") { + test } else if let Some(test) = file.strip_suffix(".roc") { test } else if let Some(test) = file.strip_suffix(".result-ast") { @@ -889,6 +891,7 @@ mod test_snapshots { let input_path = parent.join(format!("{name}.{ty}.roc")); let result_path = parent.join(format!("{name}.{ty}.result-ast")); let formatted_path = parent.join(format!("{name}.{ty}.formatted.roc")); + let migrated_path = parent.join(format!("{name}.{ty}.migrated.roc")); let source = std::fs::read_to_string(&input_path).unwrap_or_else(|err| { panic!("Could not find a snapshot test result at {input_path:?} - {err:?}") @@ -933,6 +936,23 @@ mod test_snapshots { true, Some(expect_canonicalize_panics(name)), ); + + let arena = Bump::new(); + + let actual = input.parse_in(&arena).unwrap_or_else(|err| { + panic!("Unexpected parse failure when parsing this for formatting:\n\n{}\n\nParse error was:\n\n{:#?}\n\n", input.as_str(), err); + }); + + let output = actual.migrate(); + + match output { + Ok(output) => { + compare_snapshots(&migrated_path, Some(output.as_ref().as_str())); + } + Err(err) => { + println!("Skipping migration test for {name}.{ty}.roc: {err:?}"); + } + } } }