parser/tests/0011/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

1153 lines
16 KiB
Plaintext

[
Token {
kind: OpenTag(
Full,
),
span: (
1,
1,
),
},
Token {
kind: Identifier(
"define",
),
span: (
3,
1,
),
},
Token {
kind: LeftParen,
span: (
3,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
3,
8,
),
},
Token {
kind: Comma,
span: (
3,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
3,
13,
),
},
Token {
kind: DoubleEquals,
span: (
3,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
3,
19,
),
},
Token {
kind: RightParen,
span: (
3,
21,
),
},
Token {
kind: SemiColon,
span: (
3,
22,
),
},
Token {
kind: Identifier(
"define",
),
span: (
4,
1,
),
},
Token {
kind: LeftParen,
span: (
4,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
4,
8,
),
},
Token {
kind: Comma,
span: (
4,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
4,
13,
),
},
Token {
kind: TripleEquals,
span: (
4,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
4,
20,
),
},
Token {
kind: RightParen,
span: (
4,
22,
),
},
Token {
kind: SemiColon,
span: (
4,
23,
),
},
Token {
kind: Identifier(
"define",
),
span: (
5,
1,
),
},
Token {
kind: LeftParen,
span: (
5,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
5,
8,
),
},
Token {
kind: Comma,
span: (
5,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
5,
13,
),
},
Token {
kind: BangEquals,
span: (
5,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
5,
19,
),
},
Token {
kind: RightParen,
span: (
5,
21,
),
},
Token {
kind: SemiColon,
span: (
5,
22,
),
},
Token {
kind: Identifier(
"define",
),
span: (
6,
1,
),
},
Token {
kind: LeftParen,
span: (
6,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
6,
8,
),
},
Token {
kind: Comma,
span: (
6,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
6,
13,
),
},
Token {
kind: BangDoubleEquals,
span: (
6,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
6,
20,
),
},
Token {
kind: RightParen,
span: (
6,
22,
),
},
Token {
kind: SemiColon,
span: (
6,
23,
),
},
Token {
kind: Identifier(
"define",
),
span: (
7,
1,
),
},
Token {
kind: LeftParen,
span: (
7,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
7,
8,
),
},
Token {
kind: Comma,
span: (
7,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
7,
13,
),
},
Token {
kind: Plus,
span: (
7,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
7,
18,
),
},
Token {
kind: RightParen,
span: (
7,
20,
),
},
Token {
kind: SemiColon,
span: (
7,
21,
),
},
Token {
kind: Identifier(
"define",
),
span: (
8,
1,
),
},
Token {
kind: LeftParen,
span: (
8,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
8,
8,
),
},
Token {
kind: Comma,
span: (
8,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
8,
13,
),
},
Token {
kind: Minus,
span: (
8,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
8,
18,
),
},
Token {
kind: RightParen,
span: (
8,
20,
),
},
Token {
kind: SemiColon,
span: (
8,
21,
),
},
Token {
kind: Identifier(
"define",
),
span: (
9,
1,
),
},
Token {
kind: LeftParen,
span: (
9,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
9,
8,
),
},
Token {
kind: Comma,
span: (
9,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
9,
13,
),
},
Token {
kind: Slash,
span: (
9,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
9,
18,
),
},
Token {
kind: RightParen,
span: (
9,
20,
),
},
Token {
kind: SemiColon,
span: (
9,
21,
),
},
Token {
kind: Identifier(
"define",
),
span: (
10,
1,
),
},
Token {
kind: LeftParen,
span: (
10,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
10,
8,
),
},
Token {
kind: Comma,
span: (
10,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
10,
13,
),
},
Token {
kind: Caret,
span: (
10,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
10,
18,
),
},
Token {
kind: RightParen,
span: (
10,
20,
),
},
Token {
kind: SemiColon,
span: (
10,
21,
),
},
Token {
kind: Identifier(
"define",
),
span: (
11,
1,
),
},
Token {
kind: LeftParen,
span: (
11,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
11,
8,
),
},
Token {
kind: Comma,
span: (
11,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
11,
13,
),
},
Token {
kind: Asterisk,
span: (
11,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
11,
18,
),
},
Token {
kind: RightParen,
span: (
11,
20,
),
},
Token {
kind: SemiColon,
span: (
11,
21,
),
},
Token {
kind: Identifier(
"define",
),
span: (
12,
1,
),
},
Token {
kind: LeftParen,
span: (
12,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
12,
8,
),
},
Token {
kind: Comma,
span: (
12,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
12,
13,
),
},
Token {
kind: RightShift,
span: (
12,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
12,
19,
),
},
Token {
kind: RightParen,
span: (
12,
21,
),
},
Token {
kind: SemiColon,
span: (
12,
22,
),
},
Token {
kind: Identifier(
"define",
),
span: (
13,
1,
),
},
Token {
kind: LeftParen,
span: (
13,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
13,
8,
),
},
Token {
kind: Comma,
span: (
13,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
13,
13,
),
},
Token {
kind: LeftShift,
span: (
13,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
13,
19,
),
},
Token {
kind: RightParen,
span: (
13,
21,
),
},
Token {
kind: SemiColon,
span: (
13,
22,
),
},
Token {
kind: Identifier(
"define",
),
span: (
14,
1,
),
},
Token {
kind: LeftParen,
span: (
14,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
14,
8,
),
},
Token {
kind: Comma,
span: (
14,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
14,
13,
),
},
Token {
kind: Pipe,
span: (
14,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
14,
18,
),
},
Token {
kind: RightParen,
span: (
14,
20,
),
},
Token {
kind: SemiColon,
span: (
14,
21,
),
},
Token {
kind: Identifier(
"define",
),
span: (
15,
1,
),
},
Token {
kind: LeftParen,
span: (
15,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
15,
8,
),
},
Token {
kind: Comma,
span: (
15,
11,
),
},
Token {
kind: Variable(
"a",
),
span: (
15,
13,
),
},
Token {
kind: Ampersand,
span: (
15,
16,
),
},
Token {
kind: Variable(
"b",
),
span: (
15,
18,
),
},
Token {
kind: RightParen,
span: (
15,
20,
),
},
Token {
kind: SemiColon,
span: (
15,
21,
),
},
Token {
kind: Identifier(
"define",
),
span: (
16,
1,
),
},
Token {
kind: LeftParen,
span: (
16,
7,
),
},
Token {
kind: LiteralString(
"a",
),
span: (
16,
8,
),
},
Token {
kind: Comma,
span: (
16,
11,
),
},
Token {
kind: BitwiseNot,
span: (
16,
13,
),
},
Token {
kind: Variable(
"b",
),
span: (
16,
14,
),
},
Token {
kind: RightParen,
span: (
16,
16,
),
},
Token {
kind: SemiColon,
span: (
16,
17,
),
},
Token {
kind: Echo,
span: (
18,
1,
),
},
Token {
kind: Variable(
"a",
),
span: (
18,
6,
),
},
Token {
kind: Plus,
span: (
18,
9,
),
},
Token {
kind: Variable(
"b",
),
span: (
18,
11,
),
},
Token {
kind: Asterisk,
span: (
18,
14,
),
},
Token {
kind: Variable(
"c",
),
span: (
18,
16,
),
},
Token {
kind: Slash,
span: (
18,
19,
),
},
Token {
kind: Variable(
"d",
),
span: (
18,
21,
),
},
Token {
kind: Minus,
span: (
18,
24,
),
},
Token {
kind: Dollar,
span: (
18,
26,
),
},
Token {
kind: LeftBrace,
span: (
18,
27,
),
},
Token {
kind: LiteralString(
"foo",
),
span: (
18,
28,
),
},
Token {
kind: Dot,
span: (
18,
34,
),
},
Token {
kind: Variable(
"c",
),
span: (
18,
36,
),
},
Token {
kind: Question,
span: (
18,
39,
),
},
Token {
kind: LiteralInteger(
4,
),
span: (
18,
41,
),
},
Token {
kind: Colon,
span: (
18,
43,
),
},
Token {
kind: LiteralInteger(
3,
),
span: (
18,
45,
),
},
Token {
kind: RightBrace,
span: (
18,
46,
),
},
Token {
kind: SemiColon,
span: (
18,
47,
),
},
]