Parsing
Now that we have a working lexer, we need to take these resulting tokens and build our AST.
Like mentioned in our intro chapter, our parser adds context and meaning to our program.
If everything goes right, we should end up with an AST:
{
type: 'Program',
children: [
{
type: 'Assignment',
name: 'hello',
value: {
type: 'String',
value: 'world'
}
},
{
type: 'Log',
children: [
{
type: 'Literal',
value: 'hello'
}
]
}
]
}