lib/modl/parser/orphan_handler.rb in modl-0.3.12 vs lib/modl/parser/orphan_handler.rb in modl-0.3.13

- old
+ new

@@ -58,18 +58,16 @@ new_structures.push(s) next end if pairs.has_key?(s.pair.key) - # TODO: raise an exception - puts 'Duplicate top level key.' + raise InterpreterError, 'Duplicate top level keys are not allowed.' else pairs[s.pair.key] = s end else - if pairs.length > 0 && !all_hidden(pairs.keys) - # TODO: raise an exception - puts 'Mixed top-level types.' + if pairs.length > 0 && !all_hidden(pairs.keys) && !s.top_level_conditional + raise InterpreterError, 'Mixed top-level types are not allowed.' else new_structures.push(s) end end end \ No newline at end of file