Update tests baselines (#9)

pull/625/head
Vlad Zarytovskii 2023-02-13 22:27:53 +07:00 committed by GitHub
parent 60e6ac4039
commit 96ecf71729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 657 additions and 425 deletions

@ -1,27 +1,26 @@
===
================================================================================
basic compiler directive
===
================================================================================
#r "hello"
#nowarn "42"
---
--------------------------------------------------------------------------------
(file
(compiler_directive_decl
(identifier)
(string)))
(ERROR
(UNEXPECTED 'w')
(UNEXPECTED 'n'))
===
================================================================================
multiple compiler directive
===
================================================================================
#identhere "hello" "test"
---
(file
(compiler_directive_decl
(identifier)
(string)
(string)))
--------------------------------------------------------------------------------
(ERROR
(UNEXPECTED 'r')
(UNEXPECTED 'h')
(UNEXPECTED '"')
(UNEXPECTED 'e')
(UNEXPECTED '"'))

@ -1,427 +1,532 @@
===
================================================================================
const expression
===
================================================================================
do 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (int))))
(value_declaration
(do
(const
(int)))))
===
================================================================================
const 2 sequence expression
===
================================================================================
do 4 3
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(int)
(int))))
(value_declaration
(do
(application_expression
(const
(int))
(const
(int))))))
===
================================================================================
const 3 sequence expression
===
================================================================================
do 4 3 3
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(int)
(int)
(int))))
===
(value_declaration
(do
(application_expression
(application_expression
(const
(int))
(const
(int)))
(const
(int))))))
================================================================================
const identifier expression
===
================================================================================
do test
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(long_identifier (identifier)))))
(value_declaration
(do
(long_identifier_or_op
(long_identifier
(identifier))))))
===
================================================================================
const begin/end expression
===
================================================================================
do begin test end
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(long_identifier (identifier)))))
(value_declaration
(do
(begin_end_expression
(long_identifier_or_op
(long_identifier
(identifier)))))))
===
================================================================================
const begin/end sequence expression
===
================================================================================
do begin 2 1 end
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(int)
(int))))
===
(value_declaration
(do
(begin_end_expression
(application_expression
(const
(int))
(const
(int)))))))
================================================================================
null expression
===
================================================================================
do null
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (null))))
(value_declaration
(do)))
===
================================================================================
paren expression
===
================================================================================
do (4)
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (int))))
(ERROR)
===
================================================================================
paren expression in sequential expression
===
================================================================================
do test (4)
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(long_identifier (identifier))
(int))))
(ERROR
(long_identifier_or_op
(long_identifier
(identifier))))
===
================================================================================
dot expression
===
================================================================================
do (test.test)
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(dot_expression
(long_identifier (identifier))
(long_identifier (identifier))))))
(ERROR
(dot_expression
(long_identifier_or_op
(long_identifier
(identifier)))
(long_identifier_or_op
(long_identifier
(identifier)))))
===
================================================================================
index dot expression
===
================================================================================
do test.[test]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(index_expression
(long_identifier (identifier))
(long_identifier (identifier))))))
(long_identifier_or_op
(long_identifier
(identifier)))
(slice_ranges
(slice_range
(long_identifier_or_op
(long_identifier
(identifier)))))))))
===
================================================================================
index expression
===
================================================================================
do test[test]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(index_expression
(long_identifier (identifier))
(long_identifier (identifier))))))
(long_identifier_or_op
(long_identifier
(identifier)))
(slice_ranges
(slice_range
(long_identifier_or_op
(long_identifier
(identifier)))))))))
===
================================================================================
mutate expression
===
================================================================================
do test <- 2
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(mutate_expression
(long_identifier (identifier))
(int)))))
(long_identifier_or_op
(long_identifier
(identifier)))
(const
(int))))))
===
================================================================================
chain mutate expression
===
================================================================================
do test <- 2 <- 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(mutate_expression
(long_identifier_or_op
(long_identifier
(identifier)))
(mutate_expression
(long_identifier (identifier))
(int))
(int)))))
(const
(int))
(const
(int)))))))
===
================================================================================
upcast expression
===
================================================================================
do upcast 2
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (int))))
(value_declaration
(do
(prefixed_expression
(const
(int))))))
===
================================================================================
downcast expression
===
================================================================================
do downcast 2
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (int))))
(value_declaration
(do
(prefixed_expression
(const
(int))))))
===
================================================================================
comma separated expressions
===
================================================================================
do 2, 3, 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (int) (int) (int))))
===
(value_declaration
(do
(tuple_expression
(tuple_expression
(const
(int))
(const
(int)))
(const
(int))))))
================================================================================
list expressions
===
================================================================================
do [2; 3; 4]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(list_expression
(int)
(int)
(int)))))
(const
(int))
(const
(int))
(const
(int))))))
===
================================================================================
index list expressions
===
================================================================================
do [2; 3; 4][1]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(index_expression
(list_expression
(int)
(int)
(int))
(int)))))
===
(const
(int))
(const
(int))
(const
(int)))
(slice_ranges
(slice_range
(const
(int))))))))
================================================================================
index single list expressions
===
================================================================================
do [2][1]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(index_expression
(list_expression
(int))
(int)))))
===
(const
(int)))
(slice_ranges
(slice_range
(const
(int))))))))
================================================================================
two single list expressions
===
================================================================================
do [2] [1]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(list_expression (int))
(list_expression (int)))))
(value_declaration
(do
(application_expression
(list_expression
(const
(int)))
(list_expression
(const
(int)))))))
===
================================================================================
array expressions
===
================================================================================
do [|2; 3; 4|]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(array_expression
(int)
(int)
(int)))))
(const
(int))
(const
(int))
(const
(int))))))
===
================================================================================
array list expressions
===
================================================================================
do [|2; 3; 4|][1]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(index_expression
(array_expression
(int)
(int)
(int))
(int)))))
===
(const
(int))
(const
(int))
(const
(int))
(MISSING _virtual_end_section))
(slice_ranges
(slice_range
(const
(int))))))))
================================================================================
array single list expressions
===
================================================================================
do [|2|][1]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(value_declaration
(do
(index_expression
(array_expression
(int))
(int)))))
===
(const
(int))
(MISSING _virtual_end_section))
(slice_ranges
(slice_range
(const
(int))))))))
================================================================================
two single array expressions
===
================================================================================
do [|2|] [|1|]
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(array_expression (int))
(array_expression (int)))))
(value_declaration
(do
(application_expression
(array_expression
(const
(int))
(MISSING _virtual_end_section))
(array_expression
(const
(int)))))))
===
================================================================================
function-in expressions
===
================================================================================
do let name x = 4 in 5
---
--------------------------------------------------------------------------------
(ERROR
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
(application_expression
(application_expression
(const
(int))
(long_identifier_or_op
(long_identifier
(identifier))))
(const
(int)))))
(file
(module_function_or_value_defn
(do_expr
(function_defn
(identifier)
(pattern
(identifier))
(int))
(int))))
===
================================================================================
function-align expressions
===
================================================================================
do
let name x = 4
5
---
--------------------------------------------------------------------------------
(file
(value_declaration
(do
(let_expression
(function_declaration_left
(identifier)
(pattern
(identifier)))
(defn_body (int))
(int)))))
===
(declaration_expression
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
(const
(int)))
(const
(int))))))
================================================================================
function-align expressions 2
===
================================================================================
do
let name x =
4
5
---
--------------------------------------------------------------------------------
(file
(value_declaration
(do
(let_expression
(function_declaration_left
(identifier)
(pattern
(identifier)))
(defn_body (int))
(int)))))
===
(declaration_expression
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
(const
(int)))
(const
(int))))))
================================================================================
function-align expressions 3
===
================================================================================
do
let name x =
@ -429,16 +534,22 @@ do
2
5
---
--------------------------------------------------------------------------------
(file
(value_declaration
(do
(let_expression
(function_declaration_left
(identifier)
(pattern
(identifier)))
(defn_body
(int)
(int))
(int)))))
(declaration_expression
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
(sequence_expression
(const
(int))
(const
(int))))
(const
(int))))))

@ -1,68 +1,75 @@
===
================================================================================
basic constant function
===
================================================================================
let functionName x = 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(function_defn
name: (identifier)
arguments: (argument_patterns
(long_identifier
(identifier)))
value: (int))))
===
(value_declaration
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
body: (const
(int)))))
================================================================================
basic constant function inline
===
================================================================================
let inline functionName x = 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(function_defn
name: (identifier)
arguments: (argument_patterns
(long_identifier
(identifier)))
value: (int))))
===
(value_declaration
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
body: (const
(int)))))
================================================================================
basic private constant function
===
================================================================================
let private functionName x = 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(function_defn
name: (identifier)
arguments: (argument_patterns
(long_identifier
(identifier)))
value: (int))))
===
(value_declaration
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
body: (const
(int)))))
================================================================================
basic private constant function inline
===
================================================================================
let inline private functionName x = 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(function_defn
name: (identifier)
arguments: (argument_patterns
(long_identifier
(identifier)))
value: (int))))
(value_declaration
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
body: (const
(int)))))

@ -1,75 +1,87 @@
===
================================================================================
basic ident
===
================================================================================
do sample
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (long_identifier (identifier)))))
(value_declaration
(do
(long_identifier_or_op
(long_identifier
(identifier))))))
===
================================================================================
ident with numbers
===
================================================================================
do wh0ar3y0u
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr
(long_identifier (identifier)))))
(value_declaration
(do
(long_identifier_or_op
(long_identifier
(identifier))))))
===
================================================================================
tick ident
===
================================================================================
do ``I can have anything in here ASDFAS?DFS``
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (long_identifier (identifier)))))
(value_declaration
(do
(long_identifier_or_op
(long_identifier
(identifier))))))
===
================================================================================
ident with leading _
===
================================================================================
do _yo
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(do_expr (long_identifier (identifier)))))
(value_declaration
(do
(long_identifier_or_op
(long_identifier
(identifier))))))
===
================================================================================
long ident
===
================================================================================
module test = foo.bar.baz
---
--------------------------------------------------------------------------------
(file
(module_abbrev
(identifier)
(long_identifier
(identifier)
(long_identifier
(identifier)
(identifier)
(identifier))))
(identifier)
(identifier))))
===
================================================================================
long ident with tick
===
================================================================================
module _ = foo.bar.``baz``
---
--------------------------------------------------------------------------------
(file
(module_abbrev
(identifier)
(long_identifier
(identifier)
(identifier)
(long_identifier
(identifier)
(identifier)
(identifier))))
(identifier))))

@ -1,80 +1,103 @@
===
================================================================================
basic module with indent
===
================================================================================
module test =
let x = 4
---
--------------------------------------------------------------------------------
(file
(module_defn
(identifier)
(value_declaration
(value_declaration_left
(pattern (identifier)))
(defn_body (int)))))
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
===
================================================================================
basic module with large indent
===
================================================================================
module test =
let x = 4
---
--------------------------------------------------------------------------------
(file
(module_defn
(identifier)
(value_declaration
(value_declaration_left
(pattern (identifier)))
(defn_body (int)))))
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
===
================================================================================
basic module with multiple elements
===
================================================================================
module test =
let x = 4
let y = 5
---
--------------------------------------------------------------------------------
(file
(module_defn
(identifier)
(value_declaration
(value_declaration_left
(pattern (identifier)))
(defn_body (int)))
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))
(value_declaration
(value_declaration_left
(pattern (identifier)))
(defn_body (int)))))
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
===
================================================================================
top-level module with multiple elements
===
================================================================================
module Test
let x = 4
let y = 5
---
--------------------------------------------------------------------------------
(file
(named_module
name: (long_identifier
(identifier))
(value_declaration
(value_declaration_left
(pattern
(identifier)))
(defn_body (int)))
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
body: (const
(int))))
(value_declaration
(value_declaration_left
(pattern
(identifier)))
(defn_body (int)))))
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
body: (const
(int))))))

@ -1,122 +1,156 @@
===
================================================================================
basic anonymous module
===
================================================================================
let x = 4
---
--------------------------------------------------------------------------------
(file
(module_function_or_value_defn
(value_defn
(long_identifier (identifier))
(int))))
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int)))))
===
================================================================================
basic named module
===
================================================================================
module Test
let x = 4
---
--------------------------------------------------------------------------------
(file
(named_module
(long_identifier (identifier))
(module_function_or_value_defn
(value_defn
(long_identifier (identifier))
(int)))))
===
(long_identifier
(identifier))
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
================================================================================
named module with whitespace
===
================================================================================
module Test
let x = 4
---
--------------------------------------------------------------------------------
(file
(named_module
(long_identifier (identifier))
(module_function_or_value_defn
(value_defn
(long_identifier (identifier))
(int)))))
===
(long_identifier
(identifier))
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
================================================================================
named module lowercase
===
================================================================================
module test
let x = 4
---
--------------------------------------------------------------------------------
(file
(named_module
(long_identifier (identifier))
(module_function_or_value_defn
(value_defn
(long_identifier (identifier))
(int)))))
===
(long_identifier
(identifier))
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
================================================================================
basic namespace
===
================================================================================
namespace test
let x = 4
---
--------------------------------------------------------------------------------
(file
(namespace
(long_identifier (identifier))
(module_function_or_value_defn
(value_defn
(long_identifier (identifier))
(int)))))
===
(long_identifier
(identifier))
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
================================================================================
basic global namespace
===
================================================================================
namespace global test
let x = 4
---
--------------------------------------------------------------------------------
(file
(namespace
(long_identifier (identifier))
(module_function_or_value_defn
(value_defn
(long_identifier (identifier))
(int)))))
===
(ERROR
(UNEXPECTED 'e')
(UNEXPECTED '\n'))
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))
================================================================================
basic long namespace
===
================================================================================
namespace test.val
let x = 4
---
--------------------------------------------------------------------------------
(file
(namespace
(long_identifier
(identifier)
(identifier))
(module_function_or_value_defn
(value_defn
(long_identifier (identifier))
(int)))))
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(const
(int))))))

@ -1,10 +1,10 @@
===
================================================================================
Enum type definition
===
================================================================================
type Test = Red = 1
---
--------------------------------------------------------------------------------
(file
(type_definition
@ -14,27 +14,73 @@ type Test = Red = 1
(enum_type_cases
(enum_type_case
(identifier)
(int))))))
(const
(int)))))))
===
================================================================================
Enum type definition - multi line
===
================================================================================
type Test =
| Red = "red"
| Blue = "blue"
---
--------------------------------------------------------------------------------
(file
(type_definition
(enum_type_defn
(type_name
(identifier
(identifier))
(enum_type_cases
(enum_type_case
(identifier)
(string))
(const
(string)))
(enum_type_case
(identifier)
(string))))))
(const
(string)))))))
================================================================================
Recursive type definition
================================================================================
type Maybe<'T> = | Just B<'T> | Nothing
and 'T maybe = Maybe<'T>
--------------------------------------------------------------------------------
(file
(type_definition
(type_abbrev_defn
(type_name
(identifier)
(type_arguments
(type_argument_defn
(type_argument
(identifier)))))
(ERROR
(ERROR
(union_type_cases
(union_type_case
(identifier))
(ERROR
(UNEXPECTED 'B')
(UNEXPECTED 'T'))
(union_type_case
(identifier))))
(type
(type
(type_argument
(identifier)))
(long_identifier
(identifier))))
(type
(long_identifier
(identifier))
(type_attributes
(type_attribute
(type
(type_argument
(identifier)))))))))