Skip to content

Commit

Permalink
Fix column number for values
Browse files Browse the repository at this point in the history
  • Loading branch information
j8r committed Dec 1, 2018
1 parent 0cda7dc commit eb0bfc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lexer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module CON::Lexer::Main
def next_value : Type | CON::Token
skip_whitespaces_and_comments
@buffer.clear
case @current_char
value = case @current_char
when '"' then next_char; consume_string
when '[' then next_char; Token::BeginArray
when ']' then next_char; Token::EndArray
Expand All @@ -77,6 +77,8 @@ module CON::Lexer::Main
when '\0' then Token::EOF
else raise "Unknown char: '#{@current_char}'"
end
@column_number = 1
value
end

def next_key : String | Nil | CON::Token
Expand All @@ -89,7 +91,6 @@ module CON::Lexer::Main
when ']' then next_char; return Token::EndArray
when '\0' then return Token::EOF
end
@column_number = 1
consume_key
end

Expand Down

0 comments on commit eb0bfc5

Please sign in to comment.