[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

View file

@ -20,12 +20,14 @@ fun test() -> f64 {
// | Identifier:'"x"'
// | Colon:'":"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | RightParen:'")"'
// | ReturnType
// | Arrow:'"->"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Block
// | LeftBrace:'"{"'
// | ExpressionStatement
@ -45,7 +47,8 @@ fun test() -> f64 {
// | ReturnType
// | Arrow:'"->"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Block
// | LeftBrace:'"{"'
// | ExpressionStatement

View file

@ -16,7 +16,8 @@ fun test() -> f64 {
// | ReturnType
// | Arrow:'"->"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Block
// | LeftBrace:'"{"'
// | ExpressionStatement

View file

@ -41,7 +41,8 @@ fun test() -> bool {
// | ReturnType
// | Arrow:'"->"'
// | TypeExpression
// | Identifier:'"bool"'
// | TypeIdentifier
// | Identifier:'"bool"'
// | Block
// | LeftBrace:'"{"'
// | ExpressionStatement

View file

@ -29,7 +29,8 @@ fun test() -> f64 {
// | ReturnType
// | Arrow:'"->"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Block
// | LeftBrace:'"{"'
// | IfStatement

View file

@ -50,7 +50,8 @@ fun test() -> f64 {
// | ReturnType
// | Arrow:'"->"'
// | TypeExpression
// | Identifier:'"f64"'
// | TypeIdentifier
// | Identifier:'"f64"'
// | Block
// | LeftBrace:'"{"'
// | ExpressionStatement