lib/sdl4r/parser.rb in sdl4r-0.9.7 vs lib/sdl4r/parser.rb in sdl4r-0.9.8

- old
+ new

@@ -137,11 +137,11 @@ parse_error("Internal Error: empty token list", @tokenizer.line_no, UNKNOWN_POSITION) end first_token = tokens.first if first_token.literal? - first_token = Token.new("content") + first_token = Token.new(ANONYMOUS_TAG_NAME) tokens.insert(0, first_token) elsif first_token.type != :IDENTIFIER expecting_but_got( "IDENTIFIER", @@ -184,13 +184,12 @@ end return tag end + # Return the position at the end of the value list # - # @return The position at the end of the value list - # def add_tag_values(tag, tokens, start) size = tokens.size() i = start; while i < size @@ -645,8 +644,13 @@ # Close the reader and throw a SdlParseError using the format # Was expecting X but got Y. # def expecting_but_got(expecting, got, line, position) @tokenizer.expecting_but_got(expecting, got, line, position) + end + + # Raises a SdlParseError. + def parse_error(description, line_no, position) + @tokenizer.parse_error(description, line_no, position) end end end