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

236 lines
3.3 KiB
Plaintext

[
Token {
kind: OpenTag(
Full,
),
span: (
1,
1,
),
},
Token {
kind: Function,
span: (
3,
1,
),
},
Token {
kind: Identifier(
"a",
),
span: (
3,
10,
),
},
Token {
kind: LeftParen,
span: (
3,
11,
),
},
Token {
kind: RightParen,
span: (
3,
12,
),
},
Token {
kind: Colon,
span: (
3,
13,
),
},
Token {
kind: Null,
span: (
3,
15,
),
},
Token {
kind: LeftBrace,
span: (
3,
20,
),
},
Token {
kind: Echo,
span: (
4,
5,
),
},
Token {
kind: LiteralString(
"looping..\n",
),
span: (
4,
10,
),
},
Token {
kind: SemiColon,
span: (
4,
23,
),
},
Token {
kind: Return,
span: (
6,
5,
),
},
Token {
kind: Null,
span: (
6,
12,
),
},
Token {
kind: SemiColon,
span: (
6,
16,
),
},
Token {
kind: RightBrace,
span: (
7,
1,
),
},
Token {
kind: Variable(
"bar",
),
span: (
9,
1,
),
},
Token {
kind: Equals,
span: (
9,
6,
),
},
Token {
kind: Identifier(
"a",
),
span: (
9,
8,
),
},
Token {
kind: LeftParen,
span: (
9,
9,
),
},
Token {
kind: Ellipsis,
span: (
9,
10,
),
},
Token {
kind: RightParen,
span: (
9,
13,
),
},
Token {
kind: SemiColon,
span: (
9,
14,
),
},
Token {
kind: Identifier(
"foo",
),
span: (
11,
1,
),
},
Token {
kind: Colon,
span: (
11,
4,
),
},
Token {
kind: Variable(
"bar",
),
span: (
12,
5,
),
},
Token {
kind: LeftParen,
span: (
12,
9,
),
},
Token {
kind: RightParen,
span: (
12,
10,
),
},
Token {
kind: SemiColon,
span: (
12,
11,
),
},
Token {
kind: Goto,
span: (
13,
5,
),
},
Token {
kind: Identifier(
"foo",
),
span: (
13,
10,
),
},
Token {
kind: SemiColon,
span: (
13,
13,
),
},
]