lib/parser.rb in nexus_parser-1.1.2 vs lib/parser.rb in nexus_parser-1.1.3

- old
+ new

@@ -85,11 +85,11 @@ parse_dimensions if @lexer.peek(NexusParser::Tokens::Dimensions) inf = 0 while true inf += 1 - raise (ParserError,"Either you have a gazillion taxa or more likely the parser is caught in an infinite loop trying to parser taxon labels. Check for double single quotes in this block.") if inf > 100000 + raise(NexusParser::ParseError,"Either you have a gazillion taxa or more likely the parser is caught in an infinite loop trying to parser taxon labels. Check for double single quotes in this block.") if inf > 100000 if @lexer.peek(NexusParser::Tokens::EndBlk) @lexer.pop(NexusParser::Tokens::EndBlk) break else @@ -119,11 +119,11 @@ def parse_characters_blk inf = 0 while true inf += 1 - raise (ParserError,"Either you have a gazillion characters or more likely the parser is caught in an infinite loop trying to parser character data. Check for double single quotes in this block.") if inf > 100000 + raise(NexusParser::ParseError,"Either you have a gazillion characters or more likely the parser is caught in an infinite loop trying to parser character data. Check for double single quotes in this block.") if inf > 100000 if @lexer.peek(NexusParser::Tokens::EndBlk) # we're at the end of the block, exit after geting rid of the semi-colon break else @lexer.pop(NexusParser::Tokens::Title) if @lexer.peek(NexusParser::Tokens::Title) # not used at present @@ -182,11 +182,11 @@ @lexer.pop(NexusParser::Tokens::CharStateLabels) inf = 0 while true inf += 1 - raise (ParserError,"Either you have a gazillion character state labels or more likely the parser is caught in an infinite loop while trying to parser character state labels. Check for double single quotes in this block.") if inf > 100000 + raise(NexusParser::ParseError,"Either you have a gazillion character state labels or more likely the parser is caught in an infinite loop while trying to parser character state labels. Check for double single quotes in this block.") if inf > 100000 if @lexer.peek(NexusParser::Tokens::SemiColon) break else opts = {} @@ -211,11 +211,11 @@ @lexer.pop(NexusParser::Tokens::Comma) if @lexer.peek(NexusParser::Tokens::Comma) # we may also have hit semicolon opts.update({:index => (index - 1), :name => name}) - raise(ParserError, "Error parsing character state labels for (or around) character #{index -1}.") if !opts[:name] + raise(NexusParser::ParseError, "Error parsing character state labels for (or around) character #{index -1}.") if !opts[:name] @builder.update_chr(opts) end end @lexer.pop(NexusParser::Tokens::SemiColon) @@ -246,10 +246,10 @@ @vars = {} inf = 0 # a crude iteration checker while true inf += 1 - raise (ParserError,"Either you have a gazillion notes or more likely parser is caught in an infinite loop inside the Begin Notes block. Check for double single quotes in this block.") if inf > 100000 + raise(NexusParser::ParseError,"Either you have a gazillion notes or more likely parser is caught in an infinite loop inside the Begin Notes block. Check for double single quotes in this block.") if inf > 100000 if @lexer.peek(NexusParser::Tokens::EndBlk) @lexer.pop(NexusParser::Tokens::EndBlk) @builder.add_note(@vars) # one still left to add break else