[fine] Parse alternate types

This commit is contained in:
John Doty 2024-02-01 07:56:30 -08:00
parent f7acfd588d
commit afa4812074
10 changed files with 73 additions and 26 deletions

View file

@ -15,7 +15,8 @@ fun f3() {}
// | Identifier:'"x"'
// | Colon:'":"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Comma:'","'
// | Error:'"Error at 'fun': expect ')' to end a parameter list"'
// | FunctionDecl
@ -27,7 +28,8 @@ fun f3() {}
// | Identifier:'"x"'
// | Colon:'":"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Comma:'","'
// | Error
// | Error:'"Error at ',': expected parameter"'
@ -36,7 +38,8 @@ fun f3() {}
// | Identifier:'"z"'
// | Colon:'":"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | RightParen:'")"'
// | Block
// | LeftBrace:'"{"'

View file

@ -15,7 +15,8 @@ fun fib(n: f64) -> f64 {
// | Identifier:'"f1"'
// | Colon:'":"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Comma:'","'
// | Error:'"Error at 'fun': expect ')' to end a parameter list"'
// | FunctionDecl
@ -27,12 +28,14 @@ fun fib(n: f64) -> f64 {
// | Identifier:'"n"'
// | Colon:'":"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | RightParen:'")"'
// | ReturnType
// | Arrow:'"->"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Block
// | LeftBrace:'"{"'
// | ExpressionStatement