Commit d0f2c480 authored by Cool Fire's avatar Cool Fire

Implemented a few of the lexer cursor movement functions

parent 913823ec
Pipeline #240 passed with stage
in 42 seconds
......@@ -9,9 +9,12 @@ class Lexer < LexerFunctions
require_relative 'LexerConstants.rb'
attr_accessor :input
attr_reader :start, :pos
# Kickstart the lexer
def start
@start = 0
@pos = 0
lex method :lex_text
end
......@@ -32,12 +35,12 @@ class Lexer < LexerFunctions
# Ignore character
def ignore
# start = pos
@start = @pos
end
# Take a step back
def backup
# pos -= 1
@pos -= 1
end
# Look at the next char without consuming it
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment