Lexer tokens are now created by the lexer

This is so positional information can be accurately embedded into them.
This commit is contained in:
2022-08-12 14:34:07 -05:00
parent accf528869
commit 856d5763d3
5 changed files with 89 additions and 70 deletions

View File

@@ -103,11 +103,11 @@ func (file *File) Close () {
// Location returns a location struct describing the current position inside of
// the file. This can be stored and used to print errors.
func (file *File) Location () (location Location) {
func (file *File) Location (width int) (location Location) {
return Location {
file: file,
row: file.currentLine,
column: file.currentColumn,
width: 1,
width: width,
}
}