1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Don't bother checking the encoding of the template in SCSS::Parser.

This encoding should be checked at the higher-level entry points,
Sass::Engine and Sass::CSS.
This commit is contained in:
Nathan Weizenbaum 2010-05-28 17:20:08 -07:00
parent 01521c030e
commit 1a2b7cb62f

View file

@ -6,7 +6,9 @@ module Sass
# The parser for SCSS.
# It parses a string of code into a tree of {Sass::Tree::Node}s.
class Parser
# @param str [String, StringScanner] The source document to parse
# @param str [String, StringScanner] The source document to parse.
# Note that `Parser` *won't* raise a nice error message if this isn't properly parsed;
# for that, you should use the higher-level {Sass::Engine} or {Sass::CSS}.
# @param line [Fixnum] The line on which the source string appeared,
# if it's part of another document
def initialize(str, line = 1)
@ -46,10 +48,7 @@ module Sass
if @template.is_a?(StringScanner)
@template
else
StringScanner.new(
Haml::Util.check_encoding(@template) do |msg, line|
raise Sass::SyntaxError.new(msg, :line => line)
end.gsub("\r", ""))
StringScanner.new(@template.gsub("\r", ""))
end
end