parser/tests/0019/tokens.txt
Saif Eddin Gmati ac42958b4f chore: refactor project structure
- added `prelude`
- moved `ast` to `parser`
- moved `Lexer` from `crate::lexer::lexer::Lexer` to `crate::lexer::Lexer`
- renamed `LexerError` to `SyntaxError`
- moved `SyntaxError` to `token::error`
- implemented `Display` for `SyntaxError`
- add `tokens.txt` to integration tests
- removed all unit tests for `Lexer` ( everything is tested in integration tests )
- improved syntax error assertations
2022-12-04 08:56:53 +00:00

1602 lines
23 KiB
Plaintext

[
Token {
kind: OpenTag(
Full,
),
span: (
1,
1,
),
},
Token {
kind: Namespace,
span: (
3,
1,
),
},
Token {
kind: LeftBrace,
span: (
3,
11,
),
},
Token {
kind: Function,
span: (
4,
5,
),
},
Token {
kind: Identifier(
"globalFunc",
),
span: (
4,
14,
),
},
Token {
kind: LeftParen,
span: (
4,
24,
),
},
Token {
kind: RightParen,
span: (
4,
25,
),
},
Token {
kind: LeftBrace,
span: (
4,
27,
),
},
Token {
kind: RightBrace,
span: (
4,
28,
),
},
Token {
kind: RightBrace,
span: (
5,
1,
),
},
Token {
kind: Namespace,
span: (
7,
1,
),
},
Token {
kind: Identifier(
"foo",
),
span: (
7,
11,
),
},
Token {
kind: LeftBrace,
span: (
7,
15,
),
},
Token {
kind: Variable(
"a",
),
span: (
8,
5,
),
},
Token {
kind: Equals,
span: (
8,
8,
),
},
Token {
kind: Function,
span: (
8,
10,
),
},
Token {
kind: LeftParen,
span: (
8,
19,
),
},
Token {
kind: RightParen,
span: (
8,
20,
),
},
Token {
kind: LeftBrace,
span: (
8,
22,
),
},
Token {
kind: RightBrace,
span: (
8,
23,
),
},
Token {
kind: SemiColon,
span: (
8,
24,
),
},
Token {
kind: Variable(
"b",
),
span: (
9,
5,
),
},
Token {
kind: Equals,
span: (
9,
8,
),
},
Token {
kind: Function,
span: (
9,
10,
),
},
Token {
kind: LeftParen,
span: (
9,
19,
),
},
Token {
kind: Ampersand,
span: (
9,
20,
),
},
Token {
kind: Variable(
"b",
),
span: (
9,
21,
),
},
Token {
kind: RightParen,
span: (
9,
23,
),
},
Token {
kind: LeftBrace,
span: (
9,
25,
),
},
Token {
kind: RightBrace,
span: (
9,
26,
),
},
Token {
kind: SemiColon,
span: (
9,
27,
),
},
Token {
kind: Variable(
"c",
),
span: (
10,
5,
),
},
Token {
kind: Equals,
span: (
10,
8,
),
},
Token {
kind: Function,
span: (
10,
10,
),
},
Token {
kind: Ampersand,
span: (
10,
19,
),
},
Token {
kind: LeftParen,
span: (
10,
20,
),
},
Token {
kind: RightParen,
span: (
10,
21,
),
},
Token {
kind: LeftBrace,
span: (
10,
23,
),
},
Token {
kind: RightBrace,
span: (
10,
24,
),
},
Token {
kind: SemiColon,
span: (
10,
25,
),
},
Token {
kind: Variable(
"d",
),
span: (
11,
5,
),
},
Token {
kind: Equals,
span: (
11,
8,
),
},
Token {
kind: Function,
span: (
11,
10,
),
},
Token {
kind: Ampersand,
span: (
11,
19,
),
},
Token {
kind: LeftParen,
span: (
11,
20,
),
},
Token {
kind: Ampersand,
span: (
11,
21,
),
},
Token {
kind: Variable(
"b",
),
span: (
11,
22,
),
},
Token {
kind: RightParen,
span: (
11,
24,
),
},
Token {
kind: LeftBrace,
span: (
11,
26,
),
},
Token {
kind: Return,
span: (
11,
28,
),
},
Token {
kind: Variable(
"b",
),
span: (
11,
35,
),
},
Token {
kind: SemiColon,
span: (
11,
37,
),
},
Token {
kind: RightBrace,
span: (
11,
39,
),
},
Token {
kind: SemiColon,
span: (
11,
40,
),
},
Token {
kind: Variable(
"e",
),
span: (
12,
5,
),
},
Token {
kind: Equals,
span: (
12,
8,
),
},
Token {
kind: Fn,
span: (
12,
10,
),
},
Token {
kind: LeftParen,
span: (
12,
13,
),
},
Token {
kind: RightParen,
span: (
12,
14,
),
},
Token {
kind: DoubleArrow,
span: (
12,
16,
),
},
Token {
kind: Null,
span: (
12,
19,
),
},
Token {
kind: SemiColon,
span: (
12,
23,
),
},
Token {
kind: Variable(
"f",
),
span: (
13,
5,
),
},
Token {
kind: Equals,
span: (
13,
8,
),
},
Token {
kind: Fn,
span: (
13,
10,
),
},
Token {
kind: LeftParen,
span: (
13,
13,
),
},
Token {
kind: Ampersand,
span: (
13,
14,
),
},
Token {
kind: Variable(
"b",
),
span: (
13,
15,
),
},
Token {
kind: RightParen,
span: (
13,
17,
),
},
Token {
kind: DoubleArrow,
span: (
13,
19,
),
},
Token {
kind: Null,
span: (
13,
22,
),
},
Token {
kind: SemiColon,
span: (
13,
26,
),
},
Token {
kind: Variable(
"g",
),
span: (
14,
5,
),
},
Token {
kind: Equals,
span: (
14,
8,
),
},
Token {
kind: Fn,
span: (
14,
10,
),
},
Token {
kind: Ampersand,
span: (
14,
13,
),
},
Token {
kind: LeftParen,
span: (
14,
14,
),
},
Token {
kind: RightParen,
span: (
14,
15,
),
},
Token {
kind: DoubleArrow,
span: (
14,
17,
),
},
Token {
kind: Null,
span: (
14,
20,
),
},
Token {
kind: SemiColon,
span: (
14,
24,
),
},
Token {
kind: Variable(
"h",
),
span: (
15,
5,
),
},
Token {
kind: Equals,
span: (
15,
8,
),
},
Token {
kind: Fn,
span: (
15,
10,
),
},
Token {
kind: Ampersand,
span: (
15,
13,
),
},
Token {
kind: LeftParen,
span: (
15,
14,
),
},
Token {
kind: Ampersand,
span: (
15,
15,
),
},
Token {
kind: Variable(
"b",
),
span: (
15,
16,
),
},
Token {
kind: RightParen,
span: (
15,
18,
),
},
Token {
kind: DoubleArrow,
span: (
15,
20,
),
},
Token {
kind: Variable(
"b",
),
span: (
15,
23,
),
},
Token {
kind: SemiColon,
span: (
15,
25,
),
},
Token {
kind: RightBrace,
span: (
16,
1,
),
},
Token {
kind: Namespace,
span: (
18,
1,
),
},
Token {
kind: Identifier(
"bar",
),
span: (
18,
11,
),
},
Token {
kind: LeftBrace,
span: (
18,
15,
),
},
Token {
kind: Variable(
"a",
),
span: (
19,
5,
),
},
Token {
kind: Equals,
span: (
19,
8,
),
},
Token {
kind: Static,
span: (
19,
10,
),
},
Token {
kind: Function,
span: (
19,
17,
),
},
Token {
kind: LeftParen,
span: (
19,
26,
),
},
Token {
kind: RightParen,
span: (
19,
27,
),
},
Token {
kind: LeftBrace,
span: (
19,
29,
),
},
Token {
kind: RightBrace,
span: (
19,
30,
),
},
Token {
kind: SemiColon,
span: (
19,
31,
),
},
Token {
kind: Variable(
"b",
),
span: (
20,
5,
),
},
Token {
kind: Equals,
span: (
20,
8,
),
},
Token {
kind: Static,
span: (
20,
10,
),
},
Token {
kind: Function,
span: (
20,
17,
),
},
Token {
kind: LeftParen,
span: (
20,
26,
),
},
Token {
kind: Ampersand,
span: (
20,
27,
),
},
Token {
kind: Variable(
"b",
),
span: (
20,
28,
),
},
Token {
kind: RightParen,
span: (
20,
30,
),
},
Token {
kind: LeftBrace,
span: (
20,
32,
),
},
Token {
kind: RightBrace,
span: (
20,
33,
),
},
Token {
kind: SemiColon,
span: (
20,
34,
),
},
Token {
kind: Variable(
"c",
),
span: (
21,
5,
),
},
Token {
kind: Equals,
span: (
21,
8,
),
},
Token {
kind: Static,
span: (
21,
10,
),
},
Token {
kind: Function,
span: (
21,
17,
),
},
Token {
kind: Ampersand,
span: (
21,
26,
),
},
Token {
kind: LeftParen,
span: (
21,
27,
),
},
Token {
kind: RightParen,
span: (
21,
28,
),
},
Token {
kind: LeftBrace,
span: (
21,
30,
),
},
Token {
kind: RightBrace,
span: (
21,
31,
),
},
Token {
kind: SemiColon,
span: (
21,
32,
),
},
Token {
kind: Variable(
"d",
),
span: (
22,
5,
),
},
Token {
kind: Equals,
span: (
22,
8,
),
},
Token {
kind: Static,
span: (
22,
10,
),
},
Token {
kind: Function,
span: (
22,
17,
),
},
Token {
kind: Ampersand,
span: (
22,
26,
),
},
Token {
kind: LeftParen,
span: (
22,
27,
),
},
Token {
kind: Ampersand,
span: (
22,
28,
),
},
Token {
kind: Variable(
"b",
),
span: (
22,
29,
),
},
Token {
kind: RightParen,
span: (
22,
31,
),
},
Token {
kind: LeftBrace,
span: (
22,
33,
),
},
Token {
kind: Return,
span: (
22,
35,
),
},
Token {
kind: Variable(
"b",
),
span: (
22,
42,
),
},
Token {
kind: SemiColon,
span: (
22,
44,
),
},
Token {
kind: RightBrace,
span: (
22,
46,
),
},
Token {
kind: SemiColon,
span: (
22,
47,
),
},
Token {
kind: Variable(
"e",
),
span: (
23,
5,
),
},
Token {
kind: Equals,
span: (
23,
8,
),
},
Token {
kind: Static,
span: (
23,
10,
),
},
Token {
kind: Fn,
span: (
23,
17,
),
},
Token {
kind: LeftParen,
span: (
23,
20,
),
},
Token {
kind: RightParen,
span: (
23,
21,
),
},
Token {
kind: DoubleArrow,
span: (
23,
23,
),
},
Token {
kind: Null,
span: (
23,
26,
),
},
Token {
kind: SemiColon,
span: (
23,
30,
),
},
Token {
kind: Variable(
"f",
),
span: (
24,
5,
),
},
Token {
kind: Equals,
span: (
24,
8,
),
},
Token {
kind: Static,
span: (
24,
10,
),
},
Token {
kind: Fn,
span: (
24,
17,
),
},
Token {
kind: LeftParen,
span: (
24,
20,
),
},
Token {
kind: Ampersand,
span: (
24,
21,
),
},
Token {
kind: Variable(
"b",
),
span: (
24,
22,
),
},
Token {
kind: RightParen,
span: (
24,
24,
),
},
Token {
kind: DoubleArrow,
span: (
24,
26,
),
},
Token {
kind: Null,
span: (
24,
29,
),
},
Token {
kind: SemiColon,
span: (
24,
33,
),
},
Token {
kind: Variable(
"g",
),
span: (
25,
5,
),
},
Token {
kind: Equals,
span: (
25,
8,
),
},
Token {
kind: Static,
span: (
25,
10,
),
},
Token {
kind: Fn,
span: (
25,
17,
),
},
Token {
kind: Ampersand,
span: (
25,
20,
),
},
Token {
kind: LeftParen,
span: (
25,
21,
),
},
Token {
kind: RightParen,
span: (
25,
22,
),
},
Token {
kind: DoubleArrow,
span: (
25,
24,
),
},
Token {
kind: Null,
span: (
25,
27,
),
},
Token {
kind: SemiColon,
span: (
25,
31,
),
},
Token {
kind: Variable(
"h",
),
span: (
26,
5,
),
},
Token {
kind: Equals,
span: (
26,
8,
),
},
Token {
kind: Static,
span: (
26,
10,
),
},
Token {
kind: Fn,
span: (
26,
17,
),
},
Token {
kind: Ampersand,
span: (
26,
20,
),
},
Token {
kind: LeftParen,
span: (
26,
21,
),
},
Token {
kind: Ampersand,
span: (
26,
22,
),
},
Token {
kind: Variable(
"b",
),
span: (
26,
23,
),
},
Token {
kind: RightParen,
span: (
26,
25,
),
},
Token {
kind: DoubleArrow,
span: (
26,
27,
),
},
Token {
kind: Variable(
"b",
),
span: (
26,
30,
),
},
Token {
kind: SemiColon,
span: (
26,
32,
),
},
Token {
kind: RightBrace,
span: (
27,
1,
),
},
Token {
kind: Namespace,
span: (
29,
1,
),
},
Token {
kind: Identifier(
"baz",
),
span: (
29,
11,
),
},
Token {
kind: LeftBrace,
span: (
29,
15,
),
},
Token {
kind: Function,
span: (
30,
5,
),
},
Token {
kind: Identifier(
"a",
),
span: (
30,
14,
),
},
Token {
kind: LeftParen,
span: (
30,
15,
),
},
Token {
kind: Ampersand,
span: (
30,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
30,
17,
),
},
Token {
kind: RightParen,
span: (
30,
19,
),
},
Token {
kind: LeftBrace,
span: (
30,
21,
),
},
Token {
kind: RightBrace,
span: (
30,
22,
),
},
Token {
kind: Function,
span: (
31,
5,
),
},
Token {
kind: Ampersand,
span: (
31,
14,
),
},
Token {
kind: Identifier(
"b",
),
span: (
31,
15,
),
},
Token {
kind: LeftParen,
span: (
31,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
31,
17,
),
},
Token {
kind: RightParen,
span: (
31,
19,
),
},
Token {
kind: LeftBrace,
span: (
31,
21,
),
},
Token {
kind: Return,
span: (
31,
23,
),
},
Token {
kind: Variable(
"b",
),
span: (
31,
30,
),
},
Token {
kind: SemiColon,
span: (
31,
32,
),
},
Token {
kind: RightBrace,
span: (
31,
34,
),
},
Token {
kind: Function,
span: (
32,
5,
),
},
Token {
kind: Ampersand,
span: (
32,
14,
),
},
Token {
kind: Identifier(
"c",
),
span: (
32,
15,
),
},
Token {
kind: LeftParen,
span: (
32,
16,
),
},
Token {
kind: RightParen,
span: (
32,
17,
),
},
Token {
kind: LeftBrace,
span: (
32,
19,
),
},
Token {
kind: Return,
span: (
32,
21,
),
},
Token {
kind: Variable(
"b",
),
span: (
32,
28,
),
},
Token {
kind: SemiColon,
span: (
32,
30,
),
},
Token {
kind: RightBrace,
span: (
32,
32,
),
},
Token {
kind: RightBrace,
span: (
33,
1,
),
},
]