lib/scss_lint/sass/script.rb in scss-lint-0.29.0 vs lib/scss_lint/sass/script.rb in scss-lint-0.30.0
- old
+ new
@@ -4,10 +4,12 @@
module Sass::Script
# Since the Sass library is already loaded at this point.
# Define the `node_name` and `visit_method` class methods for each Sass Script
# parse tree node type so that our custom visitor can seamless traverse the
# tree.
+ # Define the `invalid_child_method_name` and `invalid_parent_method_name`
+ # class methods to make errors understandable.
#
# This would be easier if we could just define an `inherited` callback, but
# that won't work since the Sass library will have already been loaded before
# this code gets loaded, so the `inherited` callback won't be fired.
#
@@ -26,9 +28,17 @@
:script_#{node_name}
end
def self.visit_method
:visit_script_#{node_name}
+ end
+
+ def self.invalid_child_method_name
+ :"invalid_#{node_name}_child?"
+ end
+
+ def self.invalid_parent_method_name
+ :"invalid_#{node_name}_parent?"
end
end
DECL
end
end