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
216 lines
3.1 KiB
Plaintext
216 lines
3.1 KiB
Plaintext
[
|
|
Token {
|
|
kind: OpenTag(
|
|
Full,
|
|
),
|
|
span: (
|
|
1,
|
|
1,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"foo",
|
|
),
|
|
span: (
|
|
3,
|
|
1,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Equals,
|
|
span: (
|
|
3,
|
|
6,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Identifier(
|
|
"give_me_foo",
|
|
),
|
|
span: (
|
|
3,
|
|
8,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftParen,
|
|
span: (
|
|
3,
|
|
19,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightParen,
|
|
span: (
|
|
3,
|
|
20,
|
|
),
|
|
},
|
|
Token {
|
|
kind: SemiColon,
|
|
span: (
|
|
3,
|
|
21,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"a",
|
|
),
|
|
span: (
|
|
5,
|
|
1,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Equals,
|
|
span: (
|
|
5,
|
|
4,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LeftBracket,
|
|
span: (
|
|
5,
|
|
6,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LiteralString(
|
|
"single",
|
|
),
|
|
span: (
|
|
6,
|
|
5,
|
|
),
|
|
},
|
|
Token {
|
|
kind: DoubleArrow,
|
|
span: (
|
|
6,
|
|
14,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"foo",
|
|
),
|
|
span: (
|
|
6,
|
|
17,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Instanceof,
|
|
span: (
|
|
6,
|
|
22,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Identifier(
|
|
"Foo",
|
|
),
|
|
span: (
|
|
6,
|
|
33,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Comma,
|
|
span: (
|
|
6,
|
|
36,
|
|
),
|
|
},
|
|
Token {
|
|
kind: LiteralString(
|
|
"multiple",
|
|
),
|
|
span: (
|
|
7,
|
|
5,
|
|
),
|
|
},
|
|
Token {
|
|
kind: DoubleArrow,
|
|
span: (
|
|
7,
|
|
16,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"foo",
|
|
),
|
|
span: (
|
|
7,
|
|
19,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Instanceof,
|
|
span: (
|
|
7,
|
|
24,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Identifier(
|
|
"Bar",
|
|
),
|
|
span: (
|
|
7,
|
|
35,
|
|
),
|
|
},
|
|
Token {
|
|
kind: BooleanAnd,
|
|
span: (
|
|
7,
|
|
39,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Variable(
|
|
"foo",
|
|
),
|
|
span: (
|
|
7,
|
|
42,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Instanceof,
|
|
span: (
|
|
7,
|
|
47,
|
|
),
|
|
},
|
|
Token {
|
|
kind: Identifier(
|
|
"Baz",
|
|
),
|
|
span: (
|
|
7,
|
|
58,
|
|
),
|
|
},
|
|
Token {
|
|
kind: RightBracket,
|
|
span: (
|
|
8,
|
|
1,
|
|
),
|
|
},
|
|
Token {
|
|
kind: SemiColon,
|
|
span: (
|
|
8,
|
|
2,
|
|
),
|
|
},
|
|
]
|