Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Boa Token Output
[src/lib/lib.rs:31] &tokens = [
Token {
data: Keyword(
Const,
),
pos: Position {
column_number: 1,
line_number: 1,
},
},
Token {
data: Identifier(
"fib",
),
pos: Position {
column_number: 7,
line_number: 1,
},
},
Token {
data: Punctuator(
Assign,
),
pos: Position {
column_number: 11,
line_number: 1,
},
},
Token {
data: Identifier(
"n",
),
pos: Position {
column_number: 13,
line_number: 1,
},
},
Token {
data: Punctuator(
Arrow,
),
pos: Position {
column_number: 15,
line_number: 1,
},
},
Token {
data: Punctuator(
OpenBlock,
),
pos: Position {
column_number: 17,
line_number: 1,
},
},
Token {
data: Keyword(
If,
),
pos: Position {
column_number: 3,
line_number: 2,
},
},
Token {
data: Punctuator(
OpenParen,
),
pos: Position {
column_number: 6,
line_number: 2,
},
},
Token {
data: Identifier(
"n",
),
pos: Position {
column_number: 7,
line_number: 2,
},
},
Token {
data: Punctuator(
LessThanOrEq,
),
pos: Position {
column_number: 9,
line_number: 2,
},
},
Token {
data: NumericLiteral(
1.0,
),
pos: Position {
column_number: 11,
line_number: 2,
},
},
Token {
data: Punctuator(
CloseParen,
),
pos: Position {
column_number: 12,
line_number: 2,
},
},
Token {
data: Punctuator(
OpenBlock,
),
pos: Position {
column_number: 14,
line_number: 2,
},
},
Token {
data: Keyword(
Return,
),
pos: Position {
column_number: 5,
line_number: 3,
},
},
Token {
data: Identifier(
"n",
),
pos: Position {
column_number: 12,
line_number: 3,
},
},
Token {
data: Punctuator(
Semicolon,
),
pos: Position {
column_number: 13,
line_number: 3,
},
},
Token {
data: Punctuator(
CloseBlock,
),
pos: Position {
column_number: 3,
line_number: 4,
},
},
Token {
data: Keyword(
Else,
),
pos: Position {
column_number: 5,
line_number: 4,
},
},
Token {
data: Punctuator(
OpenBlock,
),
pos: Position {
column_number: 10,
line_number: 4,
},
},
Token {
data: Keyword(
Return,
),
pos: Position {
column_number: 5,
line_number: 5,
},
},
Token {
data: Identifier(
"fib",
),
pos: Position {
column_number: 12,
line_number: 5,
},
},
Token {
data: Punctuator(
OpenParen,
),
pos: Position {
column_number: 15,
line_number: 5,
},
},
Token {
data: Identifier(
"n",
),
pos: Position {
column_number: 16,
line_number: 5,
},
},
Token {
data: Punctuator(
Sub,
),
pos: Position {
column_number: 18,
line_number: 5,
},
},
Token {
data: NumericLiteral(
1.0,
),
pos: Position {
column_number: 20,
line_number: 5,
},
},
Token {
data: Punctuator(
CloseParen,
),
pos: Position {
column_number: 21,
line_number: 5,
},
},
Token {
data: Punctuator(
Add,
),
pos: Position {
column_number: 23,
line_number: 5,
},
},
Token {
data: Identifier(
"fib",
),
pos: Position {
column_number: 25,
line_number: 5,
},
},
Token {
data: Punctuator(
OpenParen,
),
pos: Position {
column_number: 28,
line_number: 5,
},
},
Token {
data: Identifier(
"n",
),
pos: Position {
column_number: 29,
line_number: 5,
},
},
Token {
data: Punctuator(
Sub,
),
pos: Position {
column_number: 31,
line_number: 5,
},
},
Token {
data: NumericLiteral(
2.0,
),
pos: Position {
column_number: 33,
line_number: 5,
},
},
Token {
data: Punctuator(
CloseParen,
),
pos: Position {
column_number: 34,
line_number: 5,
},
},
Token {
data: Punctuator(
Semicolon,
),
pos: Position {
column_number: 35,
line_number: 5,
},
},
Token {
data: Punctuator(
CloseBlock,
),
pos: Position {
column_number: 3,
line_number: 6,
},
},
Token {
data: Punctuator(
CloseBlock,
),
pos: Position {
column_number: 1,
line_number: 7,
},
},
Token {
data: Punctuator(
Semicolon,
),
pos: Position {
column_number: 2,
line_number: 7,
},
},
Token {
data: Identifier(
"console",
),
pos: Position {
column_number: 1,
line_number: 9,
},
},
Token {
data: Punctuator(
Dot,
),
pos: Position {
column_number: 8,
line_number: 9,
},
},
Token {
data: Identifier(
"log",
),
pos: Position {
column_number: 9,
line_number: 9,
},
},
Token {
data: Punctuator(
OpenParen,
),
pos: Position {
column_number: 12,
line_number: 9,
},
},
Token {
data: Identifier(
"fib",
),
pos: Position {
column_number: 13,
line_number: 9,
},
},
Token {
data: Punctuator(
OpenParen,
),
pos: Position {
column_number: 16,
line_number: 9,
},
},
Token {
data: NumericLiteral(
10.0,
),
pos: Position {
column_number: 17,
line_number: 9,
},
},
Token {
data: Punctuator(
CloseParen,
),
pos: Position {
column_number: 18,
line_number: 9,
},
},
Token {
data: Punctuator(
CloseParen,
),
pos: Position {
column_number: 19,
line_number: 9,
},
},
Token {
data: Punctuator(
Semicolon,
),
pos: Position {
column_number: 20,
line_number: 9,
},
},
Token {
data: Keyword(
Let,
),
pos: Position {
column_number: 1,
line_number: 11,
},
},
Token {
data: Identifier(
"a",
),
pos: Position {
column_number: 5,
line_number: 11,
},
},
Token {
data: Punctuator(
Assign,
),
pos: Position {
column_number: 7,
line_number: 11,
},
},
Token {
data: StringLiteral(
"hello world",
),
pos: Position {
column_number: 9,
line_number: 11,
},
},
Token {
data: Punctuator(
Semicolon,
),
pos: Position {
column_number: 22,
line_number: 11,
},
},
Token {
data: Identifier(
"a",
),
pos: Position {
column_number: 1,
line_number: 12,
},
},
Token {
data: Punctuator(
Semicolon,
),
pos: Position {
column_number: 2,
line_number: 12,
},
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.