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,10 +35,8 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some(
42, 42,
), ),
),
kind: None, kind: None,
}, },
}, },
@ -57,10 +55,8 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some(
42, 42,
), ),
),
kind: None, kind: None,
}, },
}, },

View File

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

View File

@ -221,10 +221,8 @@ 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,10 +277,8 @@ 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,10 +332,8 @@ 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,10 +425,8 @@ 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,10 +96,8 @@ 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,10 +223,8 @@ 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,10 +278,8 @@ 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,10 +295,8 @@ 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,10 +330,8 @@ 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,10 +357,8 @@ 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,10 +159,8 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some(
5, 5,
), ),
),
kind: None, kind: None,
}, },
}, },
@ -208,10 +206,8 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some(
10, 10,
), ),
),
kind: None, kind: None,
}, },
}, },

View File

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

View File

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

View File

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

View File

@ -82,10 +82,8 @@ 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,10 +98,8 @@ 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,10 +67,8 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (), custom: (),
node: Constant { node: Constant {
value: Int( value: Int(
Some(
3, 3,
), ),
),
kind: None, kind: None,
}, },
}, },