Skip to content

Commit

Permalink
feat(lexer): backticks act as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Nov 10, 2022
1 parent 6aebfd6 commit 7ffc5f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/fixtures/all.tape
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ Sleep .5
Sleep 0.5

# Type:
Type "All"
Type@.5 "All"
Type@500ms "All"
Type "Double Quote"
Type '"Single" Quote'
Type `"Backtick" 'Quote'`

# Keys:
Backspace
Expand Down
4 changes: 4 additions & 0 deletions lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (l *Lexer) NextToken() Token {
tok.Type = JSON
tok.Literal = "{" + l.readJSON() + "}"
l.readChar()
case '`':
tok.Type = STRING
tok.Literal = l.readString('`')
l.readChar()
case '\'':
tok.Type = STRING
tok.Literal = l.readString('\'')
Expand Down

0 comments on commit 7ffc5f8

Please sign in to comment.