lib/antelope/ace/scanner.rb in antelope-0.2.2 vs lib/antelope/ace/scanner.rb in antelope-0.2.3

- old
+ new

@@ -118,9 +118,19 @@ if @scanner.scan(/(\s+)/) @line += @scanner[1].count("\n") end end + # Scans for a comment. If the next token is a number sign (#), + # it will consume all characters until the next newline. + # + # @return [Boolean] if a comment was matched. + def scan_comment + if @scanner.scan(/\#(.*)\n/) + @line += 1 + end + end + private # Raises an error. # # @raise [SyntaxError] always.