mirror of
https://github.com/danog/parser.git
synced 2024-11-30 04:29:13 +01:00
ac42958b4f
- 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
265 lines
3.7 KiB
Plaintext
265 lines
3.7 KiB
Plaintext
[
|
|
Token {
|
|
kind: OpenTag(
|
|
Full,
|
|
),
|
|
span: (
|
|
1,
|
|
1,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Function,
|
|
span: (
|
|
3,
|
|
1,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Identifier(
|
|
"fib",
|
|
),
|
|
span: (
|
|
3,
|
|
10,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftParen,
|
|
span: (
|
|
3,
|
|
13,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"n",
|
|
),
|
|
span: (
|
|
3,
|
|
14,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightParen,
|
|
span: (
|
|
3,
|
|
16,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftBrace,
|
|
span: (
|
|
3,
|
|
18,
|
|
),
|
|
},
|
|
Token {
|
|
kind: If,
|
|
span: (
|
|
4,
|
|
5,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftParen,
|
|
span: (
|
|
4,
|
|
8,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"n",
|
|
),
|
|
span: (
|
|
4,
|
|
9,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LessThan,
|
|
span: (
|
|
4,
|
|
12,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LiteralInteger(
|
|
2,
|
|
),
|
|
span: (
|
|
4,
|
|
14,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightParen,
|
|
span: (
|
|
4,
|
|
15,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftBrace,
|
|
span: (
|
|
4,
|
|
17,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Return,
|
|
span: (
|
|
5,
|
|
9,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"n",
|
|
),
|
|
span: (
|
|
5,
|
|
16,
|
|
),
|
|
},
|
|
Token {
|
|
kind: SemiColon,
|
|
span: (
|
|
5,
|
|
18,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightBrace,
|
|
span: (
|
|
6,
|
|
5,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Return,
|
|
span: (
|
|
8,
|
|
5,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Identifier(
|
|
"fib",
|
|
),
|
|
span: (
|
|
8,
|
|
12,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftParen,
|
|
span: (
|
|
8,
|
|
15,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"n",
|
|
),
|
|
span: (
|
|
8,
|
|
16,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Minus,
|
|
span: (
|
|
8,
|
|
19,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LiteralInteger(
|
|
1,
|
|
),
|
|
span: (
|
|
8,
|
|
21,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightParen,
|
|
span: (
|
|
8,
|
|
22,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Plus,
|
|
span: (
|
|
8,
|
|
24,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Identifier(
|
|
"fib",
|
|
),
|
|
span: (
|
|
8,
|
|
26,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftParen,
|
|
span: (
|
|
8,
|
|
29,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"n",
|
|
),
|
|
span: (
|
|
8,
|
|
30,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Minus,
|
|
span: (
|
|
8,
|
|
33,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LiteralInteger(
|
|
2,
|
|
),
|
|
span: (
|
|
8,
|
|
35,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightParen,
|
|
span: (
|
|
8,
|
|
36,
|
|
),
|
|
},
|
|
Token {
|
|
kind: SemiColon,
|
|
span: (
|
|
8,
|
|
37,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightBrace,
|
|
span: (
|
|
9,
|
|
1,
|
|
),
|
|
},
|
|
]
|