forked from M-Labs/nac3
1
0
Fork 0

nac3parser: fix broken tests

This commit is contained in:
ychenfo 2022-03-08 02:36:40 +08:00
parent f7e62ab5b7
commit d848c2284e
11 changed files with 41 additions and 93 deletions

View File

@ -1460,16 +1460,16 @@ class Foo(A, B):
tokens, tokens,
vec![ vec![
Tok::Int { Tok::Int {
value: Some(47i64), value: 47i128,
}, },
Tok::Int { Tok::Int {
value: Some(13i64), value: 13i128,
}, },
Tok::Int { Tok::Int {
value: Some(0i64), value: 0i128,
}, },
Tok::Int { Tok::Int {
value: Some(123i64), value: 123i128,
}, },
Tok::Float { value: 0.2 }, Tok::Float { value: 0.2 },
Tok::Complex { Tok::Complex {
@ -1492,7 +1492,7 @@ class Foo(A, B):
fn $name() { fn $name() {
let source = format!(r"99232 # {}", $eol); let source = format!(r"99232 # {}", $eol);
let tokens = lex_source(&source); let tokens = lex_source(&source);
assert_eq!(tokens, vec![Tok::Int { value: Some(99232i64) }, Tok::Newline]); assert_eq!(tokens, vec![Tok::Int { value: 99232i128 }, Tok::Newline]);
} }
)* )*
} }
@ -1515,9 +1515,9 @@ class Foo(A, B):
assert_eq!( assert_eq!(
tokens, tokens,
vec![ vec![
Tok::Int { value: Some(123i64) }, Tok::Int { value: 123i128 },
Tok::Newline, Tok::Newline,
Tok::Int { value: Some(456i64) }, Tok::Int { value: 456i128 },
Tok::Newline, Tok::Newline,
] ]
) )
@ -1544,15 +1544,15 @@ class Foo(A, B):
}, },
Tok::Equal, Tok::Equal,
Tok::Int { Tok::Int {
value: Some(99i64) value: 99i128
}, },
Tok::Plus, Tok::Plus,
Tok::Int { Tok::Int {
value: Some(2i64) value: 2i128
}, },
Tok::Minus, Tok::Minus,
Tok::Int { Tok::Int {
value: Some(0i64) value: 0i128
}, },
Tok::Newline, Tok::Newline,
] ]
@ -1579,7 +1579,7 @@ class Foo(A, B):
Tok::Newline, Tok::Newline,
Tok::Indent, Tok::Indent,
Tok::Return, Tok::Return,
Tok::Int { value: Some(99i64) }, Tok::Int { value: 99i128 },
Tok::Newline, Tok::Newline,
Tok::Dedent, Tok::Dedent,
] ]
@ -1622,7 +1622,7 @@ class Foo(A, B):
Tok::Newline, Tok::Newline,
Tok::Indent, Tok::Indent,
Tok::Return, Tok::Return,
Tok::Int { value: Some(99i64) }, Tok::Int { value: 99i128 },
Tok::Newline, Tok::Newline,
Tok::Dedent, Tok::Dedent,
Tok::Dedent, Tok::Dedent,
@ -1660,7 +1660,7 @@ class Foo(A, B):
Tok::Newline, Tok::Newline,
Tok::Indent, Tok::Indent,
Tok::Return, Tok::Return,
Tok::Int { value: Some(99i64) }, Tok::Int { value: 99i128 },
Tok::Newline, Tok::Newline,
Tok::Dedent, Tok::Dedent,
Tok::Dedent, Tok::Dedent,
@ -1698,9 +1698,9 @@ class Foo(A, B):
}, },
Tok::Equal, Tok::Equal,
Tok::Lsqb, Tok::Lsqb,
Tok::Int { value: Some(1i64) }, Tok::Int { value: 1i128 },
Tok::Comma, Tok::Comma,
Tok::Int { value: Some(2i64) }, Tok::Int { value: 2i128 },
Tok::Rsqb, Tok::Rsqb,
Tok::Newline, Tok::Newline,
] ]

View File

@ -35,9 +35,7 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 42,
42,
),
), ),
kind: None, kind: None,
}, },
@ -57,9 +55,7 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 42,
42,
),
), ),
kind: None, kind: None,
}, },

View File

@ -35,9 +35,7 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 1,
1,
),
), ),
kind: None, kind: None,
}, },
@ -57,9 +55,7 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 2,
2,
),
), ),
kind: None, kind: None,
}, },

View File

@ -221,9 +221,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 3,
3,
),
), ),
kind: None, kind: None,
}, },
@ -279,9 +277,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 3,
3,
),
), ),
kind: None, kind: None,
}, },
@ -336,9 +332,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 3,
3,
),
), ),
kind: None, kind: None,
}, },
@ -431,9 +425,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 3,
3,
),
), ),
kind: None, kind: None,
}, },

View File

@ -96,9 +96,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 1,
1,
),
), ),
kind: None, kind: None,
}, },
@ -225,9 +223,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 2,
2,
),
), ),
kind: None, kind: None,
}, },
@ -282,9 +278,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 1,
1,
),
), ),
kind: None, kind: None,
}, },
@ -301,9 +295,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 2,
2,
),
), ),
kind: None, kind: None,
}, },
@ -338,9 +330,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 1,
1,
),
), ),
kind: None, kind: None,
}, },
@ -367,9 +357,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 3,
3,
),
), ),
kind: None, kind: None,
}, },

View File

@ -159,9 +159,7 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 5,
5,
),
), ),
kind: None, kind: None,
}, },
@ -208,9 +206,7 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 10,
10,
),
), ),
kind: None, kind: None,
}, },

View File

@ -26,9 +26,7 @@ expression: parse_ast
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 1,
1,
),
), ),
kind: None, kind: None,
}, },
@ -55,9 +53,7 @@ expression: parse_ast
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 10,
10,
),
), ),
kind: None, kind: None,
}, },
@ -88,9 +84,7 @@ expression: parse_ast
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 2,
2,
),
), ),
kind: None, kind: None,
}, },
@ -117,9 +111,7 @@ expression: parse_ast
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 20,
20,
),
), ),
kind: None, kind: None,
}, },
@ -150,9 +142,7 @@ expression: parse_ast
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 30,
30,
),
), ),
kind: None, kind: None,
}, },

View File

@ -82,9 +82,7 @@ expression: parse_ast
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 2,
2,
),
), ),
kind: None, kind: None,
}, },

View File

@ -67,9 +67,7 @@ expression: parse_ast
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 2,
2,
),
), ),
kind: None, kind: None,
}, },

View File

@ -82,9 +82,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 4,
4,
),
), ),
kind: None, kind: None,
}, },
@ -100,9 +98,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 5,
5,
),
), ),
kind: None, kind: None,
}, },

View File

@ -67,9 +67,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some( 3,
3,
),
), ),
kind: None, kind: None,
}, },