mirror of
https://github.com/notwa/lips
synced 2024-04-30 09:03:23 -07:00
allow comments after filenames
this is hack city but it will do until i refactor this crap
This commit is contained in:
parent
8546411e14
commit
9f6252117e
1
TODO
1
TODO
|
@ -1,4 +1,5 @@
|
||||||
unify/optimize ascii/asciiz/byte/halfword/word into BIN directives
|
unify/optimize ascii/asciiz/byte/halfword/word into BIN directives
|
||||||
|
also lex strings to binary strings, why not
|
||||||
|
|
||||||
directive aliases, are these right?
|
directive aliases, are these right?
|
||||||
DB = 'BYTE',
|
DB = 'BYTE',
|
||||||
|
|
|
@ -297,11 +297,19 @@ function Lexer:lex_filename(_yield)
|
||||||
end)
|
end)
|
||||||
_yield('STRING', fn, self.fn, self.line)
|
_yield('STRING', fn, self.fn, self.line)
|
||||||
|
|
||||||
if self.chr ~= '\n' then
|
self:read_spaces()
|
||||||
|
if self.chr == ';' or self.chrchr == '//' then
|
||||||
|
self:skip_to_EOL()
|
||||||
|
end
|
||||||
|
if self.chr == '\n' then
|
||||||
|
_yield('EOL', '\n', self.fn, self.line)
|
||||||
|
self:nextc()
|
||||||
|
elseif self.ord == self.EOF then
|
||||||
|
_yield('EOL', '\n', self.fn, self.line)
|
||||||
|
self.was_EOL = true
|
||||||
|
else
|
||||||
self:error('expected EOL after filename')
|
self:error('expected EOL after filename')
|
||||||
end
|
end
|
||||||
_yield('EOL', '\n', self.fn, self.line)
|
|
||||||
self:nextc()
|
|
||||||
|
|
||||||
return fn
|
return fn
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user