From 511d4fb12d0a5ea2c112031bad628f7b0496f820 Mon Sep 17 00:00:00 2001 From: Jack <85714123+jackdotink@users.noreply.github.com> Date: Sat, 12 Oct 2024 22:39:25 -0500 Subject: [PATCH] implement table type access modifiers (#313) Implements table type access modifiers: ```luau type foo = { read bar: number write baz: string, } ``` --------- Co-authored-by: YetAnotherClown Co-authored-by: boyned//Kampfkarren <3190756+Kampfkarren@users.noreply.github.com> --- CHANGELOG.md | 5 + full-moon/src/ast/luau.rs | 32 +- full-moon/src/ast/luau_visitors.rs | 15 +- full-moon/src/ast/parsers.rs | 39 +- .../parser/type_table_no_right_brace/ast.snap | 4 +- .../pass/generic_functions/ast.snap | 1 - .../pass/shorthand_array_type/ast.snap | 3 +- .../pass/table_access_modifiers/ast.snap | 374 ++++++++++++++++++ .../pass/table_access_modifiers/source.lua | 4 + .../pass/table_access_modifiers/tokens.snap | 312 +++++++++++++++ .../tests/roblox_cases/pass/types/tokens.snap | 2 +- .../pass/types_chained_optionals/ast.snap | 2 +- .../roblox_cases/pass/types_exported/ast.snap | 2 - .../roblox_cases/pass/types_generic/ast.snap | 2 +- .../pass/types_nested_array/ast.snap | 3 +- .../pass/types_semicolon_delimeter/ast.snap | 3 +- 16 files changed, 773 insertions(+), 30 deletions(-) create mode 100644 full-moon/tests/roblox_cases/pass/table_access_modifiers/ast.snap create mode 100644 full-moon/tests/roblox_cases/pass/table_access_modifiers/source.lua create mode 100644 full-moon/tests/roblox_cases/pass/table_access_modifiers/tokens.snap diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d3bcaa..cd1cff97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased +### Added +- Added `access` fields that contain a `Option` to `TypeInfo::Array` and `TypeField`. +- Added support for parsing table type field access modifiers, such as `{ read foo: number }`. + ## [1.0.0] - 2024-10-08 ### Added diff --git a/full-moon/src/ast/luau.rs b/full-moon/src/ast/luau.rs index 2ffa4fc1..e4063f98 100644 --- a/full-moon/src/ast/luau.rs +++ b/full-moon/src/ast/luau.rs @@ -15,10 +15,22 @@ use derive_more::Display; #[non_exhaustive] pub enum TypeInfo { /// A shorthand type annotating the structure of an array: { number } - #[display("{}{}{}", braces.tokens().0, type_info, braces.tokens().1)] + #[display( + "{}{}{}{}", + braces.tokens().0, + display_option(access), + type_info, + braces.tokens().1 + )] Array { /// The braces (`{}`) containing the type info. braces: ContainedSpan, + /// The access modifer of the array, `read` in `{ read number }`. + #[cfg_attr( + feature = "serde", + serde(default, skip_serializing_if = "Option::is_none") + )] + access: Option, /// The type info for the values in the Array type_info: Box, }, @@ -266,8 +278,13 @@ pub enum IndexedTypeInfo { /// The `foo: number` in `{ foo: number }`. #[derive(Clone, Debug, Display, PartialEq, Node, Visit)] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] -#[display("{key}{colon}{value}")] +#[display("{}{key}{colon}{value}", display_option(access))] pub struct TypeField { + #[cfg_attr( + feature = "serde", + serde(default, skip_serializing_if = "Option::is_none") + )] + pub(crate) access: Option, pub(crate) key: TypeFieldKey, pub(crate) colon: TokenReference, pub(crate) value: TypeInfo, @@ -277,12 +294,18 @@ impl TypeField { /// Creates a new TypeField from the given key and value pub fn new(key: TypeFieldKey, value: TypeInfo) -> Self { Self { + access: None, key, colon: TokenReference::symbol(": ").unwrap(), value, } } + /// The access modifier of the field, `read` in `read foo: number`. + pub fn access(&self) -> Option<&TokenReference> { + self.access.as_ref() + } + /// The key of the field, `foo` in `foo: number`. pub fn key(&self) -> &TypeFieldKey { &self.key @@ -311,6 +334,11 @@ impl TypeField { } } + /// Returns a new TypeField with the given access modifier. + pub fn with_access(self, access: Option) -> Self { + Self { access, ..self } + } + /// Returns a new TypeField with the `:` token pub fn with_value(self, value: TypeInfo) -> Self { Self { value, ..self } diff --git a/full-moon/src/ast/luau_visitors.rs b/full-moon/src/ast/luau_visitors.rs index 5ebe94de..ae0cd26d 100644 --- a/full-moon/src/ast/luau_visitors.rs +++ b/full-moon/src/ast/luau_visitors.rs @@ -12,8 +12,13 @@ impl Visit for TypeInfo { fn visit(&self, visitor: &mut V) { visitor.visit_type_info(self); match self { - TypeInfo::Array { braces, type_info } => { + TypeInfo::Array { + braces, + access, + type_info, + } => { braces.tokens.0.visit(visitor); + access.visit(visitor); type_info.visit(visitor); braces.tokens.1.visit(visitor); } @@ -114,13 +119,19 @@ impl VisitMut for TypeInfo { self = match self { TypeInfo::Array { mut braces, + mut access, mut type_info, } => { braces.tokens.0 = braces.tokens.0.visit_mut(visitor); + access = access.visit_mut(visitor); type_info = type_info.visit_mut(visitor); braces.tokens.1 = braces.tokens.1.visit_mut(visitor); - TypeInfo::Array { braces, type_info } + TypeInfo::Array { + braces, + access, + type_info, + } } TypeInfo::Basic(__self_0) => TypeInfo::Basic(__self_0.visit_mut(visitor)), TypeInfo::Boolean(__self_0) => TypeInfo::Boolean(__self_0.visit_mut(visitor)), diff --git a/full-moon/src/ast/parsers.rs b/full-moon/src/ast/parsers.rs index a40c764a..68fcd71b 100644 --- a/full-moon/src/ast/parsers.rs +++ b/full-moon/src/ast/parsers.rs @@ -2583,6 +2583,14 @@ fn expect_type_table( let mut array_type = None; loop { + let access = if matches!(state.current(), Ok(token) if token.token_kind() == TokenKind::Identifier && matches!(token.token().to_string().as_str(), "read" | "write")) + && !matches!(state.peek(), Ok(token) if token.is_symbol(Symbol::Colon)) + { + Some(state.consume().unwrap()) + } else { + None + }; + let current_token = state.current()?; let field = if current_token.is_symbol(Symbol::RightBrace) { @@ -2620,6 +2628,7 @@ fn expect_type_table( }; ast::TypeField { + access, key: ast::TypeFieldKey::IndexSignature { brackets: ContainedSpan::new(left_brace, right_brace), inner: ast::TypeInfo::String(property), @@ -2674,6 +2683,7 @@ fn expect_type_table( has_indexer = true; ast::TypeField { + access, key: ast::TypeFieldKey::IndexSignature { brackets: ContainedSpan::new(left_brace, right_brace), inner: key, @@ -2686,17 +2696,20 @@ fn expect_type_table( && !(current_token.token_kind() == TokenKind::Identifier && matches!(state.peek(), Ok(token) if token.is_symbol(Symbol::Colon))) { - array_type = Some(match parse_type(state) { - ParserResult::Value(value) => value, - ParserResult::NotFound => { - state.token_error( - state.current().unwrap().clone(), - "expected type for table array", - ); - return Err(()); - } - ParserResult::LexerMoved => return Err(()), - }); + array_type = Some(( + access, + match parse_type(state) { + ParserResult::Value(value) => value, + ParserResult::NotFound => { + state.token_error( + state.current().unwrap().clone(), + "expected type for table array", + ); + return Err(()); + } + ParserResult::LexerMoved => return Err(()), + }, + )); break; } else { match parse_name(state) { @@ -2719,6 +2732,7 @@ fn expect_type_table( }; ast::TypeField { + access, key: ast::TypeFieldKey::Name(name.name), colon, value, @@ -2752,9 +2766,10 @@ fn expect_type_table( let braces = ContainedSpan::new(left_brace, right_brace); - if let Some(type_info) = array_type { + if let Some((access, type_info)) = array_type { Ok(ast::TypeInfo::Array { braces, + access, type_info: Box::new(type_info), }) } else { diff --git a/full-moon/tests/roblox_cases/fail/parser/type_table_no_right_brace/ast.snap b/full-moon/tests/roblox_cases/fail/parser/type_table_no_right_brace/ast.snap index a92add7d..cd3886dc 100644 --- a/full-moon/tests/roblox_cases/fail/parser/type_table_no_right_brace/ast.snap +++ b/full-moon/tests/roblox_cases/fail/parser/type_table_no_right_brace/ast.snap @@ -1,6 +1,7 @@ --- source: full-moon/tests/fail_cases.rs -expression: result.ast +expression: result.ast() +input_file: full-moon/tests/roblox_cases/fail/parser/type_table_no_right_brace --- nodes: stmts: @@ -409,4 +410,3 @@ eof: token_type: type: Eof trailing_trivia: [] - diff --git a/full-moon/tests/roblox_cases/pass/generic_functions/ast.snap b/full-moon/tests/roblox_cases/pass/generic_functions/ast.snap index f1a1fee9..7c44cb90 100644 --- a/full-moon/tests/roblox_cases/pass/generic_functions/ast.snap +++ b/full-moon/tests/roblox_cases/pass/generic_functions/ast.snap @@ -1,6 +1,5 @@ --- source: full-moon/tests/pass_cases.rs -assertion_line: 48 expression: ast.nodes() input_file: full-moon/tests/roblox_cases/pass/generic_functions --- diff --git a/full-moon/tests/roblox_cases/pass/shorthand_array_type/ast.snap b/full-moon/tests/roblox_cases/pass/shorthand_array_type/ast.snap index 784e4d37..9c6fab99 100644 --- a/full-moon/tests/roblox_cases/pass/shorthand_array_type/ast.snap +++ b/full-moon/tests/roblox_cases/pass/shorthand_array_type/ast.snap @@ -1,7 +1,7 @@ --- source: full-moon/tests/pass_cases.rs expression: ast.nodes() - +input_file: full-moon/tests/roblox_cases/pass/shorthand_array_type --- stmts: - - TypeDeclaration: @@ -494,4 +494,3 @@ stmts: type: Whitespace characters: " " - ~ - diff --git a/full-moon/tests/roblox_cases/pass/table_access_modifiers/ast.snap b/full-moon/tests/roblox_cases/pass/table_access_modifiers/ast.snap new file mode 100644 index 00000000..a1fc59fe --- /dev/null +++ b/full-moon/tests/roblox_cases/pass/table_access_modifiers/ast.snap @@ -0,0 +1,374 @@ +--- +source: full-moon/tests/pass_cases.rs +expression: ast.nodes() +input_file: full-moon/tests/roblox_cases/pass/table_access_modifiers +--- +stmts: + - - TypeDeclaration: + type_token: + leading_trivia: [] + token: + start_position: + bytes: 0 + line: 1 + character: 1 + end_position: + bytes: 4 + line: 1 + character: 5 + token_type: + type: Identifier + identifier: type + trailing_trivia: + - start_position: + bytes: 4 + line: 1 + character: 5 + end_position: + bytes: 5 + line: 1 + character: 6 + token_type: + type: Whitespace + characters: " " + base: + leading_trivia: [] + token: + start_position: + bytes: 5 + line: 1 + character: 6 + end_position: + bytes: 8 + line: 1 + character: 9 + token_type: + type: Identifier + identifier: Foo + trailing_trivia: + - start_position: + bytes: 8 + line: 1 + character: 9 + end_position: + bytes: 9 + line: 1 + character: 10 + token_type: + type: Whitespace + characters: " " + generics: ~ + equal_token: + leading_trivia: [] + token: + start_position: + bytes: 9 + line: 1 + character: 10 + end_position: + bytes: 10 + line: 1 + character: 11 + token_type: + type: Symbol + symbol: "=" + trailing_trivia: + - start_position: + bytes: 10 + line: 1 + character: 11 + end_position: + bytes: 11 + line: 1 + character: 12 + token_type: + type: Whitespace + characters: " " + declare_as: + Table: + braces: + tokens: + - leading_trivia: [] + token: + start_position: + bytes: 11 + line: 1 + character: 12 + end_position: + bytes: 12 + line: 1 + character: 13 + token_type: + type: Symbol + symbol: "{" + trailing_trivia: + - start_position: + bytes: 12 + line: 1 + character: 13 + end_position: + bytes: 13 + line: 1 + character: 13 + token_type: + type: Whitespace + characters: "\n" + - leading_trivia: [] + token: + start_position: + bytes: 52 + line: 4 + character: 1 + end_position: + bytes: 53 + line: 4 + character: 2 + token_type: + type: Symbol + symbol: "}" + trailing_trivia: [] + fields: + pairs: + - Punctuated: + - access: + leading_trivia: + - start_position: + bytes: 13 + line: 2 + character: 1 + end_position: + bytes: 14 + line: 2 + character: 2 + token_type: + type: Whitespace + characters: "\t" + token: + start_position: + bytes: 14 + line: 2 + character: 2 + end_position: + bytes: 18 + line: 2 + character: 6 + token_type: + type: Identifier + identifier: read + trailing_trivia: + - start_position: + bytes: 18 + line: 2 + character: 6 + end_position: + bytes: 19 + line: 2 + character: 7 + token_type: + type: Whitespace + characters: " " + key: + Name: + leading_trivia: [] + token: + start_position: + bytes: 19 + line: 2 + character: 7 + end_position: + bytes: 22 + line: 2 + character: 10 + token_type: + type: Identifier + identifier: bar + trailing_trivia: [] + colon: + leading_trivia: [] + token: + start_position: + bytes: 22 + line: 2 + character: 10 + end_position: + bytes: 23 + line: 2 + character: 11 + token_type: + type: Symbol + symbol: ":" + trailing_trivia: + - start_position: + bytes: 23 + line: 2 + character: 11 + end_position: + bytes: 24 + line: 2 + character: 12 + token_type: + type: Whitespace + characters: " " + value: + Basic: + leading_trivia: [] + token: + start_position: + bytes: 24 + line: 2 + character: 12 + end_position: + bytes: 30 + line: 2 + character: 18 + token_type: + type: Identifier + identifier: number + trailing_trivia: [] + - leading_trivia: [] + token: + start_position: + bytes: 30 + line: 2 + character: 18 + end_position: + bytes: 31 + line: 2 + character: 19 + token_type: + type: Symbol + symbol: "," + trailing_trivia: + - start_position: + bytes: 31 + line: 2 + character: 19 + end_position: + bytes: 32 + line: 2 + character: 19 + token_type: + type: Whitespace + characters: "\n" + - Punctuated: + - access: + leading_trivia: + - start_position: + bytes: 32 + line: 3 + character: 1 + end_position: + bytes: 33 + line: 3 + character: 2 + token_type: + type: Whitespace + characters: "\t" + token: + start_position: + bytes: 33 + line: 3 + character: 2 + end_position: + bytes: 38 + line: 3 + character: 7 + token_type: + type: Identifier + identifier: write + trailing_trivia: + - start_position: + bytes: 38 + line: 3 + character: 7 + end_position: + bytes: 39 + line: 3 + character: 8 + token_type: + type: Whitespace + characters: " " + key: + Name: + leading_trivia: [] + token: + start_position: + bytes: 39 + line: 3 + character: 8 + end_position: + bytes: 42 + line: 3 + character: 11 + token_type: + type: Identifier + identifier: baz + trailing_trivia: [] + colon: + leading_trivia: [] + token: + start_position: + bytes: 42 + line: 3 + character: 11 + end_position: + bytes: 43 + line: 3 + character: 12 + token_type: + type: Symbol + symbol: ":" + trailing_trivia: + - start_position: + bytes: 43 + line: 3 + character: 12 + end_position: + bytes: 44 + line: 3 + character: 13 + token_type: + type: Whitespace + characters: " " + value: + Basic: + leading_trivia: [] + token: + start_position: + bytes: 44 + line: 3 + character: 13 + end_position: + bytes: 50 + line: 3 + character: 19 + token_type: + type: Identifier + identifier: number + trailing_trivia: [] + - leading_trivia: [] + token: + start_position: + bytes: 50 + line: 3 + character: 19 + end_position: + bytes: 51 + line: 3 + character: 20 + token_type: + type: Symbol + symbol: "," + trailing_trivia: + - start_position: + bytes: 51 + line: 3 + character: 20 + end_position: + bytes: 52 + line: 3 + character: 20 + token_type: + type: Whitespace + characters: "\n" + - ~ \ No newline at end of file diff --git a/full-moon/tests/roblox_cases/pass/table_access_modifiers/source.lua b/full-moon/tests/roblox_cases/pass/table_access_modifiers/source.lua new file mode 100644 index 00000000..e784583e --- /dev/null +++ b/full-moon/tests/roblox_cases/pass/table_access_modifiers/source.lua @@ -0,0 +1,4 @@ +type Foo = { + read bar: number, + write baz: number, +} \ No newline at end of file diff --git a/full-moon/tests/roblox_cases/pass/table_access_modifiers/tokens.snap b/full-moon/tests/roblox_cases/pass/table_access_modifiers/tokens.snap new file mode 100644 index 00000000..d6b85a84 --- /dev/null +++ b/full-moon/tests/roblox_cases/pass/table_access_modifiers/tokens.snap @@ -0,0 +1,312 @@ +--- +source: full-moon/tests/pass_cases.rs +expression: tokens +input_file: full-moon/tests/roblox_cases/pass/table_access_modifiers +--- +- start_position: + bytes: 0 + line: 1 + character: 1 + end_position: + bytes: 4 + line: 1 + character: 5 + token_type: + type: Identifier + identifier: type +- start_position: + bytes: 4 + line: 1 + character: 5 + end_position: + bytes: 5 + line: 1 + character: 6 + token_type: + type: Whitespace + characters: " " +- start_position: + bytes: 5 + line: 1 + character: 6 + end_position: + bytes: 8 + line: 1 + character: 9 + token_type: + type: Identifier + identifier: Foo +- start_position: + bytes: 8 + line: 1 + character: 9 + end_position: + bytes: 9 + line: 1 + character: 10 + token_type: + type: Whitespace + characters: " " +- start_position: + bytes: 9 + line: 1 + character: 10 + end_position: + bytes: 10 + line: 1 + character: 11 + token_type: + type: Symbol + symbol: "=" +- start_position: + bytes: 10 + line: 1 + character: 11 + end_position: + bytes: 11 + line: 1 + character: 12 + token_type: + type: Whitespace + characters: " " +- start_position: + bytes: 11 + line: 1 + character: 12 + end_position: + bytes: 12 + line: 1 + character: 13 + token_type: + type: Symbol + symbol: "{" +- start_position: + bytes: 12 + line: 1 + character: 13 + end_position: + bytes: 13 + line: 1 + character: 13 + token_type: + type: Whitespace + characters: "\n" +- start_position: + bytes: 13 + line: 2 + character: 1 + end_position: + bytes: 14 + line: 2 + character: 2 + token_type: + type: Whitespace + characters: "\t" +- start_position: + bytes: 14 + line: 2 + character: 2 + end_position: + bytes: 18 + line: 2 + character: 6 + token_type: + type: Identifier + identifier: read +- start_position: + bytes: 18 + line: 2 + character: 6 + end_position: + bytes: 19 + line: 2 + character: 7 + token_type: + type: Whitespace + characters: " " +- start_position: + bytes: 19 + line: 2 + character: 7 + end_position: + bytes: 22 + line: 2 + character: 10 + token_type: + type: Identifier + identifier: bar +- start_position: + bytes: 22 + line: 2 + character: 10 + end_position: + bytes: 23 + line: 2 + character: 11 + token_type: + type: Symbol + symbol: ":" +- start_position: + bytes: 23 + line: 2 + character: 11 + end_position: + bytes: 24 + line: 2 + character: 12 + token_type: + type: Whitespace + characters: " " +- start_position: + bytes: 24 + line: 2 + character: 12 + end_position: + bytes: 30 + line: 2 + character: 18 + token_type: + type: Identifier + identifier: number +- start_position: + bytes: 30 + line: 2 + character: 18 + end_position: + bytes: 31 + line: 2 + character: 19 + token_type: + type: Symbol + symbol: "," +- start_position: + bytes: 31 + line: 2 + character: 19 + end_position: + bytes: 32 + line: 2 + character: 19 + token_type: + type: Whitespace + characters: "\n" +- start_position: + bytes: 32 + line: 3 + character: 1 + end_position: + bytes: 33 + line: 3 + character: 2 + token_type: + type: Whitespace + characters: "\t" +- start_position: + bytes: 33 + line: 3 + character: 2 + end_position: + bytes: 38 + line: 3 + character: 7 + token_type: + type: Identifier + identifier: write +- start_position: + bytes: 38 + line: 3 + character: 7 + end_position: + bytes: 39 + line: 3 + character: 8 + token_type: + type: Whitespace + characters: " " +- start_position: + bytes: 39 + line: 3 + character: 8 + end_position: + bytes: 42 + line: 3 + character: 11 + token_type: + type: Identifier + identifier: baz +- start_position: + bytes: 42 + line: 3 + character: 11 + end_position: + bytes: 43 + line: 3 + character: 12 + token_type: + type: Symbol + symbol: ":" +- start_position: + bytes: 43 + line: 3 + character: 12 + end_position: + bytes: 44 + line: 3 + character: 13 + token_type: + type: Whitespace + characters: " " +- start_position: + bytes: 44 + line: 3 + character: 13 + end_position: + bytes: 50 + line: 3 + character: 19 + token_type: + type: Identifier + identifier: number +- start_position: + bytes: 50 + line: 3 + character: 19 + end_position: + bytes: 51 + line: 3 + character: 20 + token_type: + type: Symbol + symbol: "," +- start_position: + bytes: 51 + line: 3 + character: 20 + end_position: + bytes: 52 + line: 3 + character: 20 + token_type: + type: Whitespace + characters: "\n" +- start_position: + bytes: 52 + line: 4 + character: 1 + end_position: + bytes: 53 + line: 4 + character: 2 + token_type: + type: Symbol + symbol: "}" +- start_position: + bytes: 53 + line: 4 + character: 2 + end_position: + bytes: 53 + line: 4 + character: 2 + token_type: + type: Eof \ No newline at end of file diff --git a/full-moon/tests/roblox_cases/pass/types/tokens.snap b/full-moon/tests/roblox_cases/pass/types/tokens.snap index bc1926f3..0ffc8b1c 100644 --- a/full-moon/tests/roblox_cases/pass/types/tokens.snap +++ b/full-moon/tests/roblox_cases/pass/types/tokens.snap @@ -6720,4 +6720,4 @@ input_file: full-moon/tests/roblox_cases/pass/types line: 51 character: 4 token_type: - type: Eof + type: Eof \ No newline at end of file diff --git a/full-moon/tests/roblox_cases/pass/types_chained_optionals/ast.snap b/full-moon/tests/roblox_cases/pass/types_chained_optionals/ast.snap index 67ae112b..33ab2bd8 100644 --- a/full-moon/tests/roblox_cases/pass/types_chained_optionals/ast.snap +++ b/full-moon/tests/roblox_cases/pass/types_chained_optionals/ast.snap @@ -1,6 +1,7 @@ --- source: full-moon/tests/pass_cases.rs expression: ast.nodes() +input_file: full-moon/tests/roblox_cases/pass/types_chained_optionals --- stmts: - - TypeDeclaration: @@ -653,4 +654,3 @@ stmts: type: Whitespace characters: "\n" - ~ - diff --git a/full-moon/tests/roblox_cases/pass/types_exported/ast.snap b/full-moon/tests/roblox_cases/pass/types_exported/ast.snap index 07cf137e..34bf460a 100644 --- a/full-moon/tests/roblox_cases/pass/types_exported/ast.snap +++ b/full-moon/tests/roblox_cases/pass/types_exported/ast.snap @@ -2,7 +2,6 @@ source: full-moon/tests/pass_cases.rs expression: ast.nodes() input_file: full-moon/tests/roblox_cases/pass/types_exported - --- stmts: - - TypeDeclaration: @@ -446,4 +445,3 @@ stmts: type: Whitespace characters: " " - ~ - diff --git a/full-moon/tests/roblox_cases/pass/types_generic/ast.snap b/full-moon/tests/roblox_cases/pass/types_generic/ast.snap index a5816a79..88274297 100644 --- a/full-moon/tests/roblox_cases/pass/types_generic/ast.snap +++ b/full-moon/tests/roblox_cases/pass/types_generic/ast.snap @@ -1,6 +1,7 @@ --- source: full-moon/tests/pass_cases.rs expression: ast.nodes() +input_file: full-moon/tests/roblox_cases/pass/types_generic --- stmts: - - TypeDeclaration: @@ -415,4 +416,3 @@ stmts: expr_list: pairs: [] - ~ - diff --git a/full-moon/tests/roblox_cases/pass/types_nested_array/ast.snap b/full-moon/tests/roblox_cases/pass/types_nested_array/ast.snap index ba27b2dd..4b86c7a5 100644 --- a/full-moon/tests/roblox_cases/pass/types_nested_array/ast.snap +++ b/full-moon/tests/roblox_cases/pass/types_nested_array/ast.snap @@ -1,7 +1,7 @@ --- source: full-moon/tests/pass_cases.rs expression: ast.nodes() - +input_file: full-moon/tests/roblox_cases/pass/types_nested_array --- stmts: - - TypeDeclaration: @@ -532,4 +532,3 @@ stmts: identifier: number trailing_trivia: [] - ~ - diff --git a/full-moon/tests/roblox_cases/pass/types_semicolon_delimeter/ast.snap b/full-moon/tests/roblox_cases/pass/types_semicolon_delimeter/ast.snap index 19ed3b8f..a0dbed67 100644 --- a/full-moon/tests/roblox_cases/pass/types_semicolon_delimeter/ast.snap +++ b/full-moon/tests/roblox_cases/pass/types_semicolon_delimeter/ast.snap @@ -1,7 +1,7 @@ --- source: full-moon/tests/pass_cases.rs expression: ast.nodes() - +input_file: full-moon/tests/roblox_cases/pass/types_semicolon_delimeter --- stmts: - - TypeDeclaration: @@ -320,4 +320,3 @@ stmts: type: Whitespace characters: "\n" - ~ -