lib/shift-lang/builder.rb in shift-lang-0.1.1 vs lib/shift-lang/builder.rb in shift-lang-0.1.2

- old
+ new

@@ -40,28 +40,50 @@ this_statement = statement.keys[0] case this_statement when :model_definition_statement + if num_tabs != 0 + @clean = false + puts "Error at line #{line_number} character 1 : #{line}" + end model = Builder::DBModel.new(statement[:model_definition_statement][:model_name]) when :model_attribute_definition_statement + if num_tabs != 1 + @clean = false + puts "Error at line #{line_number} character 1 : #{line}" + end model_attribute = statement[:model_attribute_definition_statement] model.add_attribute(model_attribute[:attribute_name], model_attribute[:attribute_type]) when :url if (last_statement == :model_attribute_definition_statement) add_model model end + if num_tabs != 0 + @clean = false + puts "Error at line #{line_number} character 1 : #{line}" + end + url = statement[:url] when :url_method if url_handler add_handler url_handler end + if num_tabs != 1 + @clean = false + puts "Error at line #{line_number} character 1 : #{line}" + end + url_handler = Builder::UrlHandler.new(url, statement[:url_method].to_s) else + if num_tabs < 2 + @clean = false + puts "Error at line #{line_number} character 1 : #{line}" + end stmt = { :statement => statement, :num_tabs => num_tabs } if !url_handler \ No newline at end of file