Skip blank lines

This commit is contained in:
Josh Holtrop 2021-05-01 09:39:19 -04:00
parent 04393dcc51
commit 9884047090

View File

@ -13,7 +13,9 @@ module Imbecile
line = line.chomp line = line.chomp
line_number = line_index + 1 line_number = line_index + 1
if line =~ /^\s*#/ if line =~ /^\s*#/
# Skip comment line. # Skip comment lines.
elsif line =~ /^\s*$/
# Skip blank lines.
elsif line =~ /^\s*token\s+(\S+)\s+(.*)$/ elsif line =~ /^\s*token\s+(\S+)\s+(.*)$/
name, expr = $1, $2 name, expr = $1, $2
unless name =~ /^[a-zA-Z_][a-zA-Z_0-9]*$/ unless name =~ /^[a-zA-Z_][a-zA-Z_0-9]*$/