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

435 lines
6.1 KiB
Plaintext

[
Token {
kind: OpenTag(
Full,
),
span: (
1,
1,
),
},
Token {
kind: Class,
span: (
3,
1,
),
},
Token {
kind: Identifier(
"Foo2",
),
span: (
3,
7,
),
},
Token {
kind: LeftBrace,
span: (
3,
12,
),
},
Token {
kind: Use,
span: (
4,
5,
),
},
Token {
kind: Identifier(
"B",
),
span: (
4,
9,
),
},
Token {
kind: LeftBrace,
span: (
4,
11,
),
},
Token {
kind: Identifier(
"foo",
),
span: (
5,
9,
),
},
Token {
kind: As,
span: (
5,
13,
),
},
Token {
kind: Protected,
span: (
5,
16,
),
},
Token {
kind: Identifier(
"bar",
),
span: (
5,
26,
),
},
Token {
kind: SemiColon,
span: (
5,
29,
),
},
Token {
kind: RightBrace,
span: (
6,
5,
),
},
Token {
kind: RightBrace,
span: (
7,
1,
),
},
Token {
kind: Class,
span: (
9,
1,
),
},
Token {
kind: Identifier(
"Bar2",
),
span: (
9,
7,
),
},
Token {
kind: LeftBrace,
span: (
9,
12,
),
},
Token {
kind: Use,
span: (
10,
5,
),
},
Token {
kind: Identifier(
"B",
),
span: (
10,
9,
),
},
Token {
kind: Comma,
span: (
10,
10,
),
},
Token {
kind: Identifier(
"C",
),
span: (
11,
9,
),
},
Token {
kind: LeftBrace,
span: (
11,
11,
),
},
Token {
kind: Identifier(
"B",
),
span: (
12,
13,
),
},
Token {
kind: DoubleColon,
span: (
12,
14,
),
},
Token {
kind: Identifier(
"foo",
),
span: (
12,
16,
),
},
Token {
kind: Insteadof,
span: (
12,
20,
),
},
Token {
kind: Identifier(
"C",
),
span: (
12,
30,
),
},
Token {
kind: SemiColon,
span: (
12,
31,
),
},
Token {
kind: RightBrace,
span: (
13,
9,
),
},
Token {
kind: RightBrace,
span: (
14,
1,
),
},
Token {
kind: Class,
span: (
16,
1,
),
},
Token {
kind: Identifier(
"Bar3",
),
span: (
16,
7,
),
},
Token {
kind: LeftBrace,
span: (
16,
12,
),
},
Token {
kind: Use,
span: (
17,
5,
),
},
Token {
kind: Identifier(
"B",
),
span: (
17,
9,
),
},
Token {
kind: LeftBrace,
span: (
17,
11,
),
},
Token {
kind: Identifier(
"B",
),
span: (
17,
13,
),
},
Token {
kind: DoubleColon,
span: (
17,
14,
),
},
Token {
kind: Identifier(
"foo",
),
span: (
17,
16,
),
},
Token {
kind: As,
span: (
17,
20,
),
},
Token {
kind: Identifier(
"bar",
),
span: (
17,
23,
),
},
Token {
kind: SemiColon,
span: (
17,
26,
),
},
Token {
kind: RightBrace,
span: (
17,
28,
),
},
Token {
kind: RightBrace,
span: (
18,
1,
),
},
Token {
kind: Class,
span: (
20,
1,
),
},
Token {
kind: Identifier(
"Bar4",
),
span: (
20,
7,
),
},
Token {
kind: LeftBrace,
span: (
20,
12,
),
},
Token {
kind: Use,
span: (
21,
5,
),
},
Token {
kind: Identifier(
"B",
),
span: (
21,
9,
),
},
Token {
kind: LeftBrace,
span: (
21,
11,
),
},
Token {
kind: Identifier(
"foo",
),
span: (
21,
13,
),
},
Token {
kind: As,
span: (
21,
17,
),
},
Token {
kind: Identifier(
"bar",
),
span: (
21,
20,
),
},
Token {
kind: SemiColon,
span: (
21,
23,
),
},
Token {
kind: RightBrace,
span: (
21,
25,
),
},
Token {
kind: RightBrace,
span: (
22,
1,
),
},
]