lib/TextParser.rb in taskjuggler-0.0.4 vs lib/TextParser.rb in taskjuggler-0.0.5

- old
+ new

@@ -168,10 +168,19 @@ end result end + # Return true if the scanner has processed all files. + def checkForEnd + token = @scanner.nextToken + unless token[0] == '.' + error('junk_at_expected_eof', + "Found garbage at expected end of file: #{token[1]}") + end + end + # Return the SourceFileInfo of the TextScanner at the beginning of the # currently processed TextParser::Rule. Or return nil if we don't have a # current position. def sourceFileInfo return nil if @stack.empty? @@ -241,10 +250,10 @@ # Make sure that we only have one possible transition for each # target. transitions.each do |key, value| rule.transitions.each do |trans| if trans.has_key?(key) - raise "Fatal Error: Rule #{rule.name} has ambigeous " + + raise "Fatal Error: Rule #{rule.name} has ambiguous " + "transitions for target #{key}" end end end rule.transitions << transitions