haml 3.2.0.alpha.10 → 3.2.0.alpha.13
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of haml might be problematic. Click here for more details.
- data/.yardopts +19 -7
- data/CHANGELOG.md +1224 -0
- data/FAQ.md +157 -0
- data/README.md +99 -62
- data/REFERENCE.md +1404 -0
- data/Rakefile +52 -341
- data/init.rb +1 -18
- data/lib/haml.rb +6 -30
- data/lib/haml/buffer.rb +37 -16
- data/lib/haml/compiler.rb +52 -13
- data/lib/haml/engine.rb +61 -44
- data/lib/haml/exec.rb +21 -4
- data/lib/haml/filters.rb +136 -166
- data/lib/haml/helpers.rb +37 -10
- data/lib/haml/helpers/action_view_extensions.rb +2 -1
- data/lib/haml/helpers/action_view_mods.rb +67 -181
- data/lib/haml/helpers/rails_323_textarea_fix.rb +39 -0
- data/lib/haml/helpers/xss_mods.rb +9 -11
- data/lib/haml/html.rb +22 -9
- data/lib/haml/html/erb.rb +1 -1
- data/lib/haml/parser.rb +22 -15
- data/lib/haml/railtie.rb +2 -13
- data/lib/haml/template.rb +18 -85
- data/lib/haml/template/options.rb +1 -1
- data/lib/haml/template/plugin.rb +15 -101
- data/lib/haml/util.rb +120 -603
- data/lib/haml/version.rb +1 -107
- data/test/{haml/engine_test.rb → engine_test.rb} +137 -143
- data/test/{haml/erb → erb}/_av_partial_1.erb +1 -1
- data/test/{haml/erb → erb}/_av_partial_2.erb +1 -1
- data/test/{haml/erb → erb}/action_view.erb +1 -1
- data/test/{haml/erb → erb}/standard.erb +0 -0
- data/test/filters_test.rb +141 -0
- data/test/gemfiles/Gemfile.rails-3.0.x +4 -6
- data/test/gemfiles/Gemfile.rails-3.1.x +5 -6
- data/test/gemfiles/Gemfile.rails-3.2.x +6 -0
- data/test/haml-spec/LICENSE +14 -0
- data/test/{haml/spec → haml-spec}/README.md +26 -17
- data/test/haml-spec/lua_haml_spec.lua +38 -0
- data/test/haml-spec/perl_haml_test.pl +81 -0
- data/test/haml-spec/ruby_haml_test.rb +23 -0
- data/test/{haml/spec → haml-spec}/tests.json +132 -54
- data/test/{haml/helper_test.rb → helper_test.rb} +50 -36
- data/test/{haml/html2haml → html2haml}/erb_tests.rb +0 -0
- data/test/{haml/html2haml_test.rb → html2haml_test.rb} +11 -5
- data/test/{haml/markaby → markaby}/standard.mab +0 -0
- data/test/{haml/mocks → mocks}/article.rb +0 -0
- data/test/{haml/results → results}/content_for_layout.xhtml +0 -0
- data/test/{haml/results → results}/eval_suppressed.xhtml +0 -0
- data/test/{haml/results → results}/helpers.xhtml +0 -0
- data/test/{haml/results → results}/helpful.xhtml +0 -0
- data/test/{haml/results → results}/just_stuff.xhtml +0 -0
- data/test/{haml/results → results}/list.xhtml +0 -0
- data/test/{haml/results → results}/nuke_inner_whitespace.xhtml +0 -0
- data/test/{haml/results → results}/nuke_outer_whitespace.xhtml +0 -0
- data/test/{haml/results → results}/original_engine.xhtml +0 -0
- data/test/{haml/results → results}/partial_layout.xhtml +0 -0
- data/test/{haml/results → results}/partials.xhtml +0 -0
- data/test/{haml/results → results}/render_layout.xhtml +0 -0
- data/test/{haml/results → results}/silent_script.xhtml +1 -1
- data/test/{haml/results → results}/standard.xhtml +0 -0
- data/test/{haml/results → results}/tag_parsing.xhtml +0 -0
- data/test/{haml/results → results}/very_basic.xhtml +0 -0
- data/test/{haml/results → results}/whitespace_handling.xhtml +46 -50
- data/test/{haml/template_test.rb → template_test.rb} +20 -81
- data/test/{haml/templates → templates}/_av_partial_1.haml +1 -1
- data/test/{haml/templates → templates}/_av_partial_1_ugly.haml +1 -1
- data/test/{haml/templates → templates}/_av_partial_2.haml +1 -1
- data/test/{haml/templates → templates}/_av_partial_2_ugly.haml +1 -1
- data/test/{haml/templates → templates}/_layout.erb +0 -0
- data/test/{haml/templates → templates}/_layout_for_partial.haml +0 -0
- data/test/{haml/templates → templates}/_partial.haml +0 -0
- data/test/{haml/templates → templates}/_text_area.haml +0 -0
- data/test/{haml/templates → templates}/action_view.haml +1 -1
- data/test/{haml/templates → templates}/action_view_ugly.haml +1 -1
- data/test/{haml/templates → templates}/breakage.haml +0 -0
- data/test/{haml/templates → templates}/content_for_layout.haml +0 -0
- data/test/{haml/templates → templates}/eval_suppressed.haml +0 -0
- data/test/{haml/templates → templates}/helpers.haml +0 -0
- data/test/{haml/templates → templates}/helpful.haml +0 -0
- data/test/{haml/templates → templates}/just_stuff.haml +0 -0
- data/test/{haml/templates → templates}/list.haml +0 -0
- data/test/{haml/templates → templates}/nuke_inner_whitespace.haml +0 -0
- data/test/{haml/templates → templates}/nuke_outer_whitespace.haml +0 -0
- data/test/{haml/templates → templates}/original_engine.haml +0 -0
- data/test/templates/partial_layout.haml +3 -0
- data/test/{haml/templates → templates}/partialize.haml +0 -0
- data/test/{haml/templates → templates}/partials.haml +0 -0
- data/test/{haml/templates → templates}/render_layout.haml +0 -0
- data/test/{haml/templates → templates}/silent_script.haml +2 -2
- data/test/{haml/templates → templates}/standard.haml +0 -0
- data/test/{haml/templates → templates}/standard_ugly.haml +0 -0
- data/test/{haml/templates → templates}/tag_parsing.haml +0 -0
- data/test/{haml/templates → templates}/very_basic.haml +0 -0
- data/test/{haml/templates → templates}/whitespace_handling.haml +0 -0
- data/test/test_helper.rb +42 -34
- data/test/util_test.rb +80 -0
- metadata +259 -427
- data/CONTRIBUTING +0 -3
- data/REVISION +0 -1
- data/VERSION +0 -1
- data/VERSION_NAME +0 -1
- data/extra/update_watch.rb +0 -13
- data/lib/haml/root.rb +0 -7
- data/lib/haml/shared.rb +0 -78
- data/lib/haml/template/patch.rb +0 -58
- data/lib/sass.rb +0 -8
- data/lib/sass/plugin.rb +0 -10
- data/lib/sass/rails2_shim.rb +0 -9
- data/lib/sass/rails3_shim.rb +0 -16
- data/test/benchmark.rb +0 -91
- data/test/gemfiles/Gemfile.rails-2.0.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.0.x.lock +0 -38
- data/test/gemfiles/Gemfile.rails-2.1.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.1.x.lock +0 -38
- data/test/gemfiles/Gemfile.rails-2.2.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.2.x.lock +0 -38
- data/test/gemfiles/Gemfile.rails-2.3.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.3.x.lock +0 -40
- data/test/gemfiles/Gemfile.rails-3.0.x.lock +0 -85
- data/test/gemfiles/Gemfile.rails-3.1.x.lock +0 -98
- data/test/gemfiles/Gemfile.rails-xss-2.3.x +0 -9
- data/test/gemfiles/Gemfile.rails-xss-2.3.x.lock +0 -42
- data/test/haml/results/filters.xhtml +0 -62
- data/test/haml/spec/lua_haml_spec.lua +0 -30
- data/test/haml/spec/ruby_haml_test.rb +0 -19
- data/test/haml/spec_test.rb +0 -44
- data/test/haml/templates/filters.haml +0 -66
- data/test/haml/templates/partial_layout.haml +0 -10
- data/test/haml/util_test.rb +0 -300
- data/test/linked_rails.rb +0 -42
- data/vendor/sass/CONTRIBUTING +0 -3
- data/vendor/sass/MIT-LICENSE +0 -20
- data/vendor/sass/README.md +0 -201
- data/vendor/sass/Rakefile +0 -339
- data/vendor/sass/TODO +0 -39
- data/vendor/sass/VERSION +0 -1
- data/vendor/sass/VERSION_NAME +0 -1
- data/vendor/sass/bin/sass +0 -8
- data/vendor/sass/bin/sass-convert +0 -7
- data/vendor/sass/bin/scss +0 -8
- data/vendor/sass/doc-src/FAQ.md +0 -35
- data/vendor/sass/doc-src/INDENTED_SYNTAX.md +0 -210
- data/vendor/sass/doc-src/SASS_CHANGELOG.md +0 -2327
- data/vendor/sass/doc-src/SASS_REFERENCE.md +0 -1965
- data/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md +0 -155
- data/vendor/sass/ext/extconf.rb +0 -10
- data/vendor/sass/extra/update_watch.rb +0 -13
- data/vendor/sass/init.rb +0 -18
- data/vendor/sass/lib/sass.rb +0 -73
- data/vendor/sass/lib/sass/cache_stores.rb +0 -15
- data/vendor/sass/lib/sass/cache_stores/base.rb +0 -86
- data/vendor/sass/lib/sass/cache_stores/chain.rb +0 -33
- data/vendor/sass/lib/sass/cache_stores/filesystem.rb +0 -60
- data/vendor/sass/lib/sass/cache_stores/memory.rb +0 -47
- data/vendor/sass/lib/sass/cache_stores/null.rb +0 -25
- data/vendor/sass/lib/sass/callbacks.rb +0 -66
- data/vendor/sass/lib/sass/css.rb +0 -295
- data/vendor/sass/lib/sass/engine.rb +0 -878
- data/vendor/sass/lib/sass/environment.rb +0 -166
- data/vendor/sass/lib/sass/error.rb +0 -201
- data/vendor/sass/lib/sass/exec.rb +0 -672
- data/vendor/sass/lib/sass/importers.rb +0 -22
- data/vendor/sass/lib/sass/importers/base.rb +0 -139
- data/vendor/sass/lib/sass/importers/filesystem.rb +0 -149
- data/vendor/sass/lib/sass/less.rb +0 -382
- data/vendor/sass/lib/sass/logger.rb +0 -15
- data/vendor/sass/lib/sass/logger/base.rb +0 -32
- data/vendor/sass/lib/sass/logger/log_level.rb +0 -49
- data/vendor/sass/lib/sass/plugin.rb +0 -132
- data/vendor/sass/lib/sass/plugin/compiler.rb +0 -383
- data/vendor/sass/lib/sass/plugin/configuration.rb +0 -123
- data/vendor/sass/lib/sass/plugin/generic.rb +0 -15
- data/vendor/sass/lib/sass/plugin/merb.rb +0 -48
- data/vendor/sass/lib/sass/plugin/rack.rb +0 -60
- data/vendor/sass/lib/sass/plugin/rails.rb +0 -47
- data/vendor/sass/lib/sass/plugin/staleness_checker.rb +0 -173
- data/vendor/sass/lib/sass/railtie.rb +0 -9
- data/vendor/sass/lib/sass/repl.rb +0 -58
- data/vendor/sass/lib/sass/root.rb +0 -7
- data/vendor/sass/lib/sass/script.rb +0 -40
- data/vendor/sass/lib/sass/script/bool.rb +0 -18
- data/vendor/sass/lib/sass/script/color.rb +0 -480
- data/vendor/sass/lib/sass/script/css_lexer.rb +0 -29
- data/vendor/sass/lib/sass/script/css_parser.rb +0 -31
- data/vendor/sass/lib/sass/script/funcall.rb +0 -175
- data/vendor/sass/lib/sass/script/functions.rb +0 -1386
- data/vendor/sass/lib/sass/script/interpolation.rb +0 -79
- data/vendor/sass/lib/sass/script/lexer.rb +0 -339
- data/vendor/sass/lib/sass/script/list.rb +0 -83
- data/vendor/sass/lib/sass/script/literal.rb +0 -250
- data/vendor/sass/lib/sass/script/node.rb +0 -99
- data/vendor/sass/lib/sass/script/number.rb +0 -452
- data/vendor/sass/lib/sass/script/operation.rb +0 -99
- data/vendor/sass/lib/sass/script/parser.rb +0 -474
- data/vendor/sass/lib/sass/script/string.rb +0 -51
- data/vendor/sass/lib/sass/script/string_interpolation.rb +0 -103
- data/vendor/sass/lib/sass/script/unary_operation.rb +0 -64
- data/vendor/sass/lib/sass/script/variable.rb +0 -59
- data/vendor/sass/lib/sass/scss.rb +0 -17
- data/vendor/sass/lib/sass/scss/css_parser.rb +0 -46
- data/vendor/sass/lib/sass/scss/parser.rb +0 -960
- data/vendor/sass/lib/sass/scss/rx.rb +0 -128
- data/vendor/sass/lib/sass/scss/sass_parser.rb +0 -11
- data/vendor/sass/lib/sass/scss/script_lexer.rb +0 -15
- data/vendor/sass/lib/sass/scss/script_parser.rb +0 -25
- data/vendor/sass/lib/sass/scss/static_parser.rb +0 -40
- data/vendor/sass/lib/sass/selector.rb +0 -361
- data/vendor/sass/lib/sass/selector/abstract_sequence.rb +0 -62
- data/vendor/sass/lib/sass/selector/comma_sequence.rb +0 -81
- data/vendor/sass/lib/sass/selector/sequence.rb +0 -233
- data/vendor/sass/lib/sass/selector/simple.rb +0 -113
- data/vendor/sass/lib/sass/selector/simple_sequence.rb +0 -134
- data/vendor/sass/lib/sass/shared.rb +0 -78
- data/vendor/sass/lib/sass/tree/charset_node.rb +0 -22
- data/vendor/sass/lib/sass/tree/comment_node.rb +0 -90
- data/vendor/sass/lib/sass/tree/debug_node.rb +0 -18
- data/vendor/sass/lib/sass/tree/directive_node.rb +0 -23
- data/vendor/sass/lib/sass/tree/each_node.rb +0 -24
- data/vendor/sass/lib/sass/tree/extend_node.rb +0 -29
- data/vendor/sass/lib/sass/tree/for_node.rb +0 -36
- data/vendor/sass/lib/sass/tree/function_node.rb +0 -27
- data/vendor/sass/lib/sass/tree/if_node.rb +0 -52
- data/vendor/sass/lib/sass/tree/import_node.rb +0 -68
- data/vendor/sass/lib/sass/tree/media_node.rb +0 -32
- data/vendor/sass/lib/sass/tree/mixin_def_node.rb +0 -27
- data/vendor/sass/lib/sass/tree/mixin_node.rb +0 -32
- data/vendor/sass/lib/sass/tree/node.rb +0 -201
- data/vendor/sass/lib/sass/tree/prop_node.rb +0 -148
- data/vendor/sass/lib/sass/tree/return_node.rb +0 -18
- data/vendor/sass/lib/sass/tree/root_node.rb +0 -28
- data/vendor/sass/lib/sass/tree/rule_node.rb +0 -136
- data/vendor/sass/lib/sass/tree/variable_node.rb +0 -30
- data/vendor/sass/lib/sass/tree/visitors/base.rb +0 -75
- data/vendor/sass/lib/sass/tree/visitors/check_nesting.rb +0 -133
- data/vendor/sass/lib/sass/tree/visitors/convert.rb +0 -260
- data/vendor/sass/lib/sass/tree/visitors/cssize.rb +0 -175
- data/vendor/sass/lib/sass/tree/visitors/deep_copy.rb +0 -87
- data/vendor/sass/lib/sass/tree/visitors/perform.rb +0 -332
- data/vendor/sass/lib/sass/tree/visitors/set_options.rb +0 -97
- data/vendor/sass/lib/sass/tree/visitors/to_css.rb +0 -210
- data/vendor/sass/lib/sass/tree/warn_node.rb +0 -18
- data/vendor/sass/lib/sass/tree/while_node.rb +0 -18
- data/vendor/sass/lib/sass/util.rb +0 -721
- data/vendor/sass/lib/sass/util/subset_map.rb +0 -101
- data/vendor/sass/lib/sass/version.rb +0 -112
- data/vendor/sass/rails/init.rb +0 -1
- data/vendor/sass/sass.gemspec +0 -33
- data/vendor/sass/test/Gemfile +0 -4
- data/vendor/sass/test/Gemfile.lock +0 -19
- data/vendor/sass/test/sass/cache_test.rb +0 -89
- data/vendor/sass/test/sass/callbacks_test.rb +0 -61
- data/vendor/sass/test/sass/conversion_test.rb +0 -1199
- data/vendor/sass/test/sass/css2sass_test.rb +0 -373
- data/vendor/sass/test/sass/data/hsl-rgb.txt +0 -319
- data/vendor/sass/test/sass/engine_test.rb +0 -2567
- data/vendor/sass/test/sass/extend_test.rb +0 -1348
- data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
- data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
- data/vendor/sass/test/sass/functions_test.rb +0 -1038
- data/vendor/sass/test/sass/importer_test.rb +0 -192
- data/vendor/sass/test/sass/less_conversion_test.rb +0 -653
- data/vendor/sass/test/sass/logger_test.rb +0 -58
- data/vendor/sass/test/sass/mock_importer.rb +0 -49
- data/vendor/sass/test/sass/more_results/more1.css +0 -9
- data/vendor/sass/test/sass/more_results/more1_with_line_comments.css +0 -26
- data/vendor/sass/test/sass/more_results/more_import.css +0 -29
- data/vendor/sass/test/sass/more_templates/_more_partial.sass +0 -2
- data/vendor/sass/test/sass/more_templates/more1.sass +0 -23
- data/vendor/sass/test/sass/more_templates/more_import.sass +0 -11
- data/vendor/sass/test/sass/plugin_test.rb +0 -472
- data/vendor/sass/test/sass/results/alt.css +0 -4
- data/vendor/sass/test/sass/results/basic.css +0 -9
- data/vendor/sass/test/sass/results/compact.css +0 -5
- data/vendor/sass/test/sass/results/complex.css +0 -86
- data/vendor/sass/test/sass/results/compressed.css +0 -1
- data/vendor/sass/test/sass/results/expanded.css +0 -19
- data/vendor/sass/test/sass/results/if.css +0 -3
- data/vendor/sass/test/sass/results/import.css +0 -31
- data/vendor/sass/test/sass/results/import_charset.css +0 -4
- data/vendor/sass/test/sass/results/import_charset_1_8.css +0 -4
- data/vendor/sass/test/sass/results/import_charset_ibm866.css +0 -4
- data/vendor/sass/test/sass/results/line_numbers.css +0 -49
- data/vendor/sass/test/sass/results/mixins.css +0 -95
- data/vendor/sass/test/sass/results/multiline.css +0 -24
- data/vendor/sass/test/sass/results/nested.css +0 -22
- data/vendor/sass/test/sass/results/options.css +0 -1
- data/vendor/sass/test/sass/results/parent_ref.css +0 -13
- data/vendor/sass/test/sass/results/script.css +0 -16
- data/vendor/sass/test/sass/results/scss_import.css +0 -31
- data/vendor/sass/test/sass/results/scss_importee.css +0 -2
- data/vendor/sass/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
- data/vendor/sass/test/sass/results/subdir/subdir.css +0 -3
- data/vendor/sass/test/sass/results/units.css +0 -11
- data/vendor/sass/test/sass/results/warn.css +0 -0
- data/vendor/sass/test/sass/results/warn_imported.css +0 -0
- data/vendor/sass/test/sass/script_conversion_test.rb +0 -285
- data/vendor/sass/test/sass/script_test.rb +0 -514
- data/vendor/sass/test/sass/scss/css_test.rb +0 -922
- data/vendor/sass/test/sass/scss/rx_test.rb +0 -156
- data/vendor/sass/test/sass/scss/scss_test.rb +0 -1273
- data/vendor/sass/test/sass/scss/test_helper.rb +0 -37
- data/vendor/sass/test/sass/templates/_imported_charset_ibm866.sass +0 -4
- data/vendor/sass/test/sass/templates/_imported_charset_utf8.sass +0 -4
- data/vendor/sass/test/sass/templates/_partial.sass +0 -2
- data/vendor/sass/test/sass/templates/alt.sass +0 -16
- data/vendor/sass/test/sass/templates/basic.sass +0 -23
- data/vendor/sass/test/sass/templates/bork1.sass +0 -2
- data/vendor/sass/test/sass/templates/bork2.sass +0 -2
- data/vendor/sass/test/sass/templates/bork3.sass +0 -2
- data/vendor/sass/test/sass/templates/bork4.sass +0 -2
- data/vendor/sass/test/sass/templates/bork5.sass +0 -3
- data/vendor/sass/test/sass/templates/compact.sass +0 -17
- data/vendor/sass/test/sass/templates/complex.sass +0 -305
- data/vendor/sass/test/sass/templates/compressed.sass +0 -15
- data/vendor/sass/test/sass/templates/expanded.sass +0 -17
- data/vendor/sass/test/sass/templates/if.sass +0 -11
- data/vendor/sass/test/sass/templates/import.sass +0 -12
- data/vendor/sass/test/sass/templates/import_charset.sass +0 -7
- data/vendor/sass/test/sass/templates/import_charset_1_8.sass +0 -4
- data/vendor/sass/test/sass/templates/import_charset_ibm866.sass +0 -9
- data/vendor/sass/test/sass/templates/importee.less +0 -2
- data/vendor/sass/test/sass/templates/importee.sass +0 -19
- data/vendor/sass/test/sass/templates/line_numbers.sass +0 -13
- data/vendor/sass/test/sass/templates/mixin_bork.sass +0 -5
- data/vendor/sass/test/sass/templates/mixins.sass +0 -76
- data/vendor/sass/test/sass/templates/multiline.sass +0 -20
- data/vendor/sass/test/sass/templates/nested.sass +0 -25
- data/vendor/sass/test/sass/templates/nested_bork1.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork2.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork3.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork4.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork5.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_import.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_mixin_bork.sass +0 -6
- data/vendor/sass/test/sass/templates/options.sass +0 -2
- data/vendor/sass/test/sass/templates/parent_ref.sass +0 -25
- data/vendor/sass/test/sass/templates/script.sass +0 -101
- data/vendor/sass/test/sass/templates/scss_import.scss +0 -11
- data/vendor/sass/test/sass/templates/scss_importee.scss +0 -1
- data/vendor/sass/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
- data/vendor/sass/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
- data/vendor/sass/test/sass/templates/subdir/subdir.sass +0 -6
- data/vendor/sass/test/sass/templates/units.sass +0 -11
- data/vendor/sass/test/sass/templates/warn.sass +0 -3
- data/vendor/sass/test/sass/templates/warn_imported.sass +0 -4
- data/vendor/sass/test/sass/test_helper.rb +0 -8
- data/vendor/sass/test/sass/util/subset_map_test.rb +0 -91
- data/vendor/sass/test/sass/util_test.rb +0 -266
- data/vendor/sass/test/test_helper.rb +0 -69
- data/vendor/sass/vendor/fssm/Gemfile +0 -3
- data/vendor/sass/vendor/fssm/LICENSE +0 -20
- data/vendor/sass/vendor/fssm/README.markdown +0 -83
- data/vendor/sass/vendor/fssm/Rakefile +0 -11
- data/vendor/sass/vendor/fssm/example.rb +0 -12
- data/vendor/sass/vendor/fssm/fssm.gemspec +0 -24
- data/vendor/sass/vendor/fssm/lib/fssm.rb +0 -37
- data/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
- data/vendor/sass/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
- data/vendor/sass/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
- data/vendor/sass/vendor/fssm/lib/fssm/backends/rbfsevent.rb +0 -42
- data/vendor/sass/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
- data/vendor/sass/vendor/fssm/lib/fssm/monitor.rb +0 -36
- data/vendor/sass/vendor/fssm/lib/fssm/path.rb +0 -94
- data/vendor/sass/vendor/fssm/lib/fssm/pathname.rb +0 -36
- data/vendor/sass/vendor/fssm/lib/fssm/state/directory.rb +0 -75
- data/vendor/sass/vendor/fssm/lib/fssm/state/file.rb +0 -24
- data/vendor/sass/vendor/fssm/lib/fssm/support.rb +0 -92
- data/vendor/sass/vendor/fssm/lib/fssm/tree.rb +0 -176
- data/vendor/sass/vendor/fssm/lib/fssm/version.rb +0 -3
- data/vendor/sass/vendor/fssm/profile/prof-cache.rb +0 -40
- data/vendor/sass/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
- data/vendor/sass/vendor/fssm/profile/prof-pathname-rubinius.rb +0 -35
- data/vendor/sass/vendor/fssm/profile/prof-pathname.rb +0 -68
- data/vendor/sass/vendor/fssm/profile/prof-plain-pathname.html +0 -988
- data/vendor/sass/vendor/fssm/profile/prof.html +0 -2379
- data/vendor/sass/vendor/fssm/spec/count_down_latch.rb +0 -151
- data/vendor/sass/vendor/fssm/spec/monitor_spec.rb +0 -202
- data/vendor/sass/vendor/fssm/spec/path_spec.rb +0 -96
- data/vendor/sass/vendor/fssm/spec/root/duck/quack.txt +0 -0
- data/vendor/sass/vendor/fssm/spec/root/file.css +0 -0
- data/vendor/sass/vendor/fssm/spec/root/file.rb +0 -0
- data/vendor/sass/vendor/fssm/spec/root/file.yml +0 -0
- data/vendor/sass/vendor/fssm/spec/root/moo/cow.txt +0 -0
- data/vendor/sass/vendor/fssm/spec/spec_helper.rb +0 -14
- data/vendor/sass/yard/callbacks.rb +0 -29
- data/vendor/sass/yard/default/fulldoc/html/css/common.sass +0 -26
- data/vendor/sass/yard/default/layout/html/footer.erb +0 -12
- data/vendor/sass/yard/inherited_hash.rb +0 -41
@@ -1,79 +0,0 @@
|
|
1
|
-
module Sass::Script
|
2
|
-
# A SassScript object representing `#{}` interpolation outside a string.
|
3
|
-
#
|
4
|
-
# @see StringInterpolation
|
5
|
-
class Interpolation < Node
|
6
|
-
# Interpolation in a property is of the form `before #{mid} after`.
|
7
|
-
#
|
8
|
-
# @param before [Node] The SassScript before the interpolation
|
9
|
-
# @param mid [Node] The SassScript within the interpolation
|
10
|
-
# @param after [Node] The SassScript after the interpolation
|
11
|
-
# @param wb [Boolean] Whether there was whitespace between `before` and `#{`
|
12
|
-
# @param wa [Boolean] Whether there was whitespace between `}` and `after`
|
13
|
-
# @param originally_text [Boolean]
|
14
|
-
# Whether the original format of the interpolation was plain text,
|
15
|
-
# not an interpolation.
|
16
|
-
# This is used when converting back to SassScript.
|
17
|
-
def initialize(before, mid, after, wb, wa, originally_text = false)
|
18
|
-
@before = before
|
19
|
-
@mid = mid
|
20
|
-
@after = after
|
21
|
-
@whitespace_before = wb
|
22
|
-
@whitespace_after = wa
|
23
|
-
@originally_text = originally_text
|
24
|
-
end
|
25
|
-
|
26
|
-
# @return [String] A human-readable s-expression representation of the interpolation
|
27
|
-
def inspect
|
28
|
-
"(interpolation #{@before.inspect} #{@mid.inspect} #{@after.inspect})"
|
29
|
-
end
|
30
|
-
|
31
|
-
# @see Node#to_sass
|
32
|
-
def to_sass(opts = {})
|
33
|
-
res = ""
|
34
|
-
res << @before.to_sass(opts) if @before
|
35
|
-
res << ' ' if @before && @whitespace_before
|
36
|
-
res << '#{' unless @originally_text
|
37
|
-
res << @mid.to_sass(opts)
|
38
|
-
res << '}' unless @originally_text
|
39
|
-
res << ' ' if @after && @whitespace_after
|
40
|
-
res << @after.to_sass(opts) if @after
|
41
|
-
res
|
42
|
-
end
|
43
|
-
|
44
|
-
# Returns the three components of the interpolation, `before`, `mid`, and `after`.
|
45
|
-
#
|
46
|
-
# @return [Array<Node>]
|
47
|
-
# @see #initialize
|
48
|
-
# @see Node#children
|
49
|
-
def children
|
50
|
-
[@before, @mid, @after].compact
|
51
|
-
end
|
52
|
-
|
53
|
-
# @see Node#deep_copy
|
54
|
-
def deep_copy
|
55
|
-
node = dup
|
56
|
-
node.instance_variable_set('@before', @before.deep_copy) if @before
|
57
|
-
node.instance_variable_set('@mid', @mid.deep_copy)
|
58
|
-
node.instance_variable_set('@after', @after.deep_copy) if @after
|
59
|
-
node
|
60
|
-
end
|
61
|
-
|
62
|
-
protected
|
63
|
-
|
64
|
-
# Evaluates the interpolation.
|
65
|
-
#
|
66
|
-
# @param environment [Sass::Environment] The environment in which to evaluate the SassScript
|
67
|
-
# @return [Sass::Script::String] The SassScript string that is the value of the interpolation
|
68
|
-
def _perform(environment)
|
69
|
-
res = ""
|
70
|
-
res << @before.perform(environment).to_s if @before
|
71
|
-
res << " " if @before && @whitespace_before
|
72
|
-
val = @mid.perform(environment)
|
73
|
-
res << (val.is_a?(Sass::Script::String) ? val.value : val.to_s)
|
74
|
-
res << " " if @after && @whitespace_after
|
75
|
-
res << @after.perform(environment).to_s if @after
|
76
|
-
opts(Sass::Script::String.new(res))
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,339 +0,0 @@
|
|
1
|
-
require 'sass/scss/rx'
|
2
|
-
|
3
|
-
require 'strscan'
|
4
|
-
|
5
|
-
module Sass
|
6
|
-
module Script
|
7
|
-
# The lexical analyzer for SassScript.
|
8
|
-
# It takes a raw string and converts it to individual tokens
|
9
|
-
# that are easier to parse.
|
10
|
-
class Lexer
|
11
|
-
include Sass::SCSS::RX
|
12
|
-
|
13
|
-
# A struct containing information about an individual token.
|
14
|
-
#
|
15
|
-
# `type`: \[`Symbol`\]
|
16
|
-
# : The type of token.
|
17
|
-
#
|
18
|
-
# `value`: \[`Object`\]
|
19
|
-
# : The Ruby object corresponding to the value of the token.
|
20
|
-
#
|
21
|
-
# `line`: \[`Fixnum`\]
|
22
|
-
# : The line of the source file on which the token appears.
|
23
|
-
#
|
24
|
-
# `offset`: \[`Fixnum`\]
|
25
|
-
# : The number of bytes into the line the SassScript token appeared.
|
26
|
-
#
|
27
|
-
# `pos`: \[`Fixnum`\]
|
28
|
-
# : The scanner position at which the SassScript token appeared.
|
29
|
-
Token = Struct.new(:type, :value, :line, :offset, :pos)
|
30
|
-
|
31
|
-
# The line number of the lexer's current position.
|
32
|
-
#
|
33
|
-
# @return [Fixnum]
|
34
|
-
attr_reader :line
|
35
|
-
|
36
|
-
# The number of bytes into the current line
|
37
|
-
# of the lexer's current position.
|
38
|
-
#
|
39
|
-
# @return [Fixnum]
|
40
|
-
attr_reader :offset
|
41
|
-
|
42
|
-
# A hash from operator strings to the corresponding token types.
|
43
|
-
OPERATORS = {
|
44
|
-
'+' => :plus,
|
45
|
-
'-' => :minus,
|
46
|
-
'*' => :times,
|
47
|
-
'/' => :div,
|
48
|
-
'%' => :mod,
|
49
|
-
'=' => :single_eq,
|
50
|
-
':' => :colon,
|
51
|
-
'(' => :lparen,
|
52
|
-
')' => :rparen,
|
53
|
-
',' => :comma,
|
54
|
-
'and' => :and,
|
55
|
-
'or' => :or,
|
56
|
-
'not' => :not,
|
57
|
-
'==' => :eq,
|
58
|
-
'!=' => :neq,
|
59
|
-
'>=' => :gte,
|
60
|
-
'<=' => :lte,
|
61
|
-
'>' => :gt,
|
62
|
-
'<' => :lt,
|
63
|
-
'#{' => :begin_interpolation,
|
64
|
-
'}' => :end_interpolation,
|
65
|
-
';' => :semicolon,
|
66
|
-
'{' => :lcurly,
|
67
|
-
}
|
68
|
-
|
69
|
-
OPERATORS_REVERSE = Sass::Util.map_hash(OPERATORS) {|k, v| [v, k]}
|
70
|
-
|
71
|
-
TOKEN_NAMES = Sass::Util.map_hash(OPERATORS_REVERSE) {|k, v| [k, v.inspect]}.merge({
|
72
|
-
:const => "variable (e.g. $foo)",
|
73
|
-
:ident => "identifier (e.g. middle)",
|
74
|
-
:bool => "boolean (e.g. true, false)",
|
75
|
-
})
|
76
|
-
|
77
|
-
# A list of operator strings ordered with longer names first
|
78
|
-
# so that `>` and `<` don't clobber `>=` and `<=`.
|
79
|
-
OP_NAMES = OPERATORS.keys.sort_by {|o| -o.size}
|
80
|
-
|
81
|
-
# A sub-list of {OP_NAMES} that only includes operators
|
82
|
-
# with identifier names.
|
83
|
-
IDENT_OP_NAMES = OP_NAMES.select {|k, v| k =~ /^\w+/}
|
84
|
-
|
85
|
-
# A hash of regular expressions that are used for tokenizing.
|
86
|
-
REGULAR_EXPRESSIONS = {
|
87
|
-
:whitespace => /\s+/,
|
88
|
-
:comment => COMMENT,
|
89
|
-
:single_line_comment => SINGLE_LINE_COMMENT,
|
90
|
-
:variable => /(\$)(#{IDENT})/,
|
91
|
-
:ident => /(#{IDENT})(\()?/,
|
92
|
-
:number => /(-)?(?:(\d*\.\d+)|(\d+))([a-zA-Z%]+)?/,
|
93
|
-
:color => HEXCOLOR,
|
94
|
-
:bool => /(true|false)\b/,
|
95
|
-
:ident_op => %r{(#{Regexp.union(*IDENT_OP_NAMES.map{|s| Regexp.new(Regexp.escape(s) + "(?!#{NMCHAR}|\Z)")})})},
|
96
|
-
:op => %r{(#{Regexp.union(*OP_NAMES)})},
|
97
|
-
}
|
98
|
-
|
99
|
-
class << self
|
100
|
-
private
|
101
|
-
def string_re(open, close)
|
102
|
-
/#{open}((?:\\.|\#(?!\{)|[^#{close}\\#])*)(#{close}|#\{)/
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
# A hash of regular expressions that are used for tokenizing strings.
|
107
|
-
#
|
108
|
-
# The key is a `[Symbol, Boolean]` pair.
|
109
|
-
# The symbol represents which style of quotation to use,
|
110
|
-
# while the boolean represents whether or not the string
|
111
|
-
# is following an interpolated segment.
|
112
|
-
STRING_REGULAR_EXPRESSIONS = {
|
113
|
-
[:double, false] => string_re('"', '"'),
|
114
|
-
[:single, false] => string_re("'", "'"),
|
115
|
-
[:double, true] => string_re('', '"'),
|
116
|
-
[:single, true] => string_re('', "'"),
|
117
|
-
[:uri, false] => /url\(#{W}(#{URLCHAR}*?)(#{W}\)|#\{)/,
|
118
|
-
[:uri, true] => /(#{URLCHAR}*?)(#{W}\)|#\{)/,
|
119
|
-
}
|
120
|
-
|
121
|
-
# @param str [String, StringScanner] The source text to lex
|
122
|
-
# @param line [Fixnum] The line on which the SassScript appears.
|
123
|
-
# Used for error reporting
|
124
|
-
# @param offset [Fixnum] The number of characters in on which the SassScript appears.
|
125
|
-
# Used for error reporting
|
126
|
-
# @param options [{Symbol => Object}] An options hash;
|
127
|
-
# see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
|
128
|
-
def initialize(str, line, offset, options)
|
129
|
-
@scanner = str.is_a?(StringScanner) ? str : StringScanner.new(str)
|
130
|
-
@line = line
|
131
|
-
@offset = offset
|
132
|
-
@options = options
|
133
|
-
@interpolation_stack = []
|
134
|
-
@prev = nil
|
135
|
-
end
|
136
|
-
|
137
|
-
# Moves the lexer forward one token.
|
138
|
-
#
|
139
|
-
# @return [Token] The token that was moved past
|
140
|
-
def next
|
141
|
-
@tok ||= read_token
|
142
|
-
@tok, tok = nil, @tok
|
143
|
-
@prev = tok
|
144
|
-
return tok
|
145
|
-
end
|
146
|
-
|
147
|
-
# Returns whether or not there's whitespace before the next token.
|
148
|
-
#
|
149
|
-
# @return [Boolean]
|
150
|
-
def whitespace?(tok = @tok)
|
151
|
-
if tok
|
152
|
-
@scanner.string[0...tok.pos] =~ /\s\Z/
|
153
|
-
else
|
154
|
-
@scanner.string[@scanner.pos, 1] =~ /^\s/ ||
|
155
|
-
@scanner.string[@scanner.pos - 1, 1] =~ /\s\Z/
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
# Returns the next token without moving the lexer forward.
|
160
|
-
#
|
161
|
-
# @return [Token] The next token
|
162
|
-
def peek
|
163
|
-
@tok ||= read_token
|
164
|
-
end
|
165
|
-
|
166
|
-
# Rewinds the underlying StringScanner
|
167
|
-
# to before the token returned by \{#peek}.
|
168
|
-
def unpeek!
|
169
|
-
@scanner.pos = @tok.pos if @tok
|
170
|
-
end
|
171
|
-
|
172
|
-
# @return [Boolean] Whether or not there's more source text to lex.
|
173
|
-
def done?
|
174
|
-
whitespace unless after_interpolation? && @interpolation_stack.last
|
175
|
-
@scanner.eos? && @tok.nil?
|
176
|
-
end
|
177
|
-
|
178
|
-
# @return [Boolean] Whether or not the last token lexed was `:end_interpolation`.
|
179
|
-
def after_interpolation?
|
180
|
-
@prev && @prev.type == :end_interpolation
|
181
|
-
end
|
182
|
-
|
183
|
-
# Raise an error to the effect that `name` was expected in the input stream
|
184
|
-
# and wasn't found.
|
185
|
-
#
|
186
|
-
# This calls \{#unpeek!} to rewind the scanner to immediately after
|
187
|
-
# the last returned token.
|
188
|
-
#
|
189
|
-
# @param name [String] The name of the entity that was expected but not found
|
190
|
-
# @raise [Sass::SyntaxError]
|
191
|
-
def expected!(name)
|
192
|
-
unpeek!
|
193
|
-
Sass::SCSS::Parser.expected(@scanner, name, @line)
|
194
|
-
end
|
195
|
-
|
196
|
-
# Records all non-comment text the lexer consumes within the block
|
197
|
-
# and returns it as a string.
|
198
|
-
#
|
199
|
-
# @yield A block in which text is recorded
|
200
|
-
# @return [String]
|
201
|
-
def str
|
202
|
-
old_pos = @tok ? @tok.pos : @scanner.pos
|
203
|
-
yield
|
204
|
-
new_pos = @tok ? @tok.pos : @scanner.pos
|
205
|
-
@scanner.string[old_pos...new_pos]
|
206
|
-
end
|
207
|
-
|
208
|
-
private
|
209
|
-
|
210
|
-
def read_token
|
211
|
-
return if done?
|
212
|
-
return unless value = token
|
213
|
-
type, val, size = value
|
214
|
-
size ||= @scanner.matched_size
|
215
|
-
|
216
|
-
val.line = @line if val.is_a?(Script::Node)
|
217
|
-
Token.new(type, val, @line,
|
218
|
-
current_position - size, @scanner.pos - size)
|
219
|
-
end
|
220
|
-
|
221
|
-
def whitespace
|
222
|
-
nil while scan(REGULAR_EXPRESSIONS[:whitespace]) ||
|
223
|
-
scan(REGULAR_EXPRESSIONS[:comment]) ||
|
224
|
-
scan(REGULAR_EXPRESSIONS[:single_line_comment])
|
225
|
-
end
|
226
|
-
|
227
|
-
def token
|
228
|
-
if after_interpolation? && (interp_type = @interpolation_stack.pop)
|
229
|
-
return string(interp_type, true)
|
230
|
-
end
|
231
|
-
|
232
|
-
variable || string(:double, false) || string(:single, false) || number ||
|
233
|
-
color || bool || string(:uri, false) || raw(UNICODERANGE) ||
|
234
|
-
special_fun || special_val || ident_op || ident || op
|
235
|
-
end
|
236
|
-
|
237
|
-
def variable
|
238
|
-
_variable(REGULAR_EXPRESSIONS[:variable])
|
239
|
-
end
|
240
|
-
|
241
|
-
def _variable(rx)
|
242
|
-
line = @line
|
243
|
-
offset = @offset
|
244
|
-
return unless scan(rx)
|
245
|
-
|
246
|
-
[:const, @scanner[2]]
|
247
|
-
end
|
248
|
-
|
249
|
-
def ident
|
250
|
-
return unless scan(REGULAR_EXPRESSIONS[:ident])
|
251
|
-
[@scanner[2] ? :funcall : :ident, @scanner[1]]
|
252
|
-
end
|
253
|
-
|
254
|
-
def string(re, open)
|
255
|
-
return unless scan(STRING_REGULAR_EXPRESSIONS[[re, open]])
|
256
|
-
if @scanner[2] == '#{' #'
|
257
|
-
@scanner.pos -= 2 # Don't actually consume the #{
|
258
|
-
@interpolation_stack << re
|
259
|
-
end
|
260
|
-
str =
|
261
|
-
if re == :uri
|
262
|
-
Script::String.new("#{'url(' unless open}#{@scanner[1]}#{')' unless @scanner[2] == '#{'}")
|
263
|
-
else
|
264
|
-
Script::String.new(@scanner[1].gsub(/\\(['"]|\#\{)/, '\1'), :string)
|
265
|
-
end
|
266
|
-
[:string, str]
|
267
|
-
end
|
268
|
-
|
269
|
-
def number
|
270
|
-
return unless scan(REGULAR_EXPRESSIONS[:number])
|
271
|
-
value = @scanner[2] ? @scanner[2].to_f : @scanner[3].to_i
|
272
|
-
value = -value if @scanner[1]
|
273
|
-
[:number, Script::Number.new(value, Array(@scanner[4]))]
|
274
|
-
end
|
275
|
-
|
276
|
-
def color
|
277
|
-
return unless s = scan(REGULAR_EXPRESSIONS[:color])
|
278
|
-
raise Sass::SyntaxError.new(<<MESSAGE.rstrip) unless s.size == 4 || s.size == 7
|
279
|
-
Colors must have either three or six digits: '#{s}'
|
280
|
-
MESSAGE
|
281
|
-
value = s.scan(/^#(..?)(..?)(..?)$/).first.
|
282
|
-
map {|num| num.ljust(2, num).to_i(16)}
|
283
|
-
[:color, Script::Color.new(value)]
|
284
|
-
end
|
285
|
-
|
286
|
-
def bool
|
287
|
-
return unless s = scan(REGULAR_EXPRESSIONS[:bool])
|
288
|
-
[:bool, Script::Bool.new(s == 'true')]
|
289
|
-
end
|
290
|
-
|
291
|
-
def special_fun
|
292
|
-
return unless str1 = scan(/((-[\w-]+-)?calc|expression|progid:[a-z\.]*)\(/i)
|
293
|
-
str2, _ = Sass::Shared.balance(@scanner, ?(, ?), 1)
|
294
|
-
c = str2.count("\n")
|
295
|
-
old_line = @line
|
296
|
-
old_offset = @offset
|
297
|
-
@line += c
|
298
|
-
@offset = (c == 0 ? @offset + str2.size : str2[/\n(.*)/, 1].size)
|
299
|
-
[:special_fun,
|
300
|
-
Sass::Util.merge_adjacent_strings(
|
301
|
-
[str1] + Sass::Engine.parse_interp(str2, old_line, old_offset, @options)),
|
302
|
-
str1.size + str2.size]
|
303
|
-
end
|
304
|
-
|
305
|
-
def special_val
|
306
|
-
return unless scan(/!important/i)
|
307
|
-
[:string, Script::String.new("!important")]
|
308
|
-
end
|
309
|
-
|
310
|
-
def ident_op
|
311
|
-
return unless op = scan(REGULAR_EXPRESSIONS[:ident_op])
|
312
|
-
[OPERATORS[op]]
|
313
|
-
end
|
314
|
-
|
315
|
-
def op
|
316
|
-
return unless op = scan(REGULAR_EXPRESSIONS[:op])
|
317
|
-
@interpolation_stack << nil if op == :begin_interpolation
|
318
|
-
[OPERATORS[op]]
|
319
|
-
end
|
320
|
-
|
321
|
-
def raw(rx)
|
322
|
-
return unless val = scan(rx)
|
323
|
-
[:raw, val]
|
324
|
-
end
|
325
|
-
|
326
|
-
def scan(re)
|
327
|
-
return unless str = @scanner.scan(re)
|
328
|
-
c = str.count("\n")
|
329
|
-
@line += c
|
330
|
-
@offset = (c == 0 ? @offset + str.size : str[/\n(.*)/, 1].size)
|
331
|
-
str
|
332
|
-
end
|
333
|
-
|
334
|
-
def current_position
|
335
|
-
@offset + 1
|
336
|
-
end
|
337
|
-
end
|
338
|
-
end
|
339
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
module Sass::Script
|
2
|
-
# A SassScript object representing a CSS list.
|
3
|
-
# This includes both comma-separated lists and space-separated lists.
|
4
|
-
class List < Literal
|
5
|
-
# The Ruby array containing the contents of the list.
|
6
|
-
#
|
7
|
-
# @return [Array<Literal>]
|
8
|
-
attr_reader :value
|
9
|
-
alias_method :children, :value
|
10
|
-
alias_method :to_a, :value
|
11
|
-
|
12
|
-
# The operator separating the values of the list.
|
13
|
-
# Either `:comma` or `:space`.
|
14
|
-
#
|
15
|
-
# @return [Symbol]
|
16
|
-
attr_reader :separator
|
17
|
-
|
18
|
-
# Creates a new list.
|
19
|
-
#
|
20
|
-
# @param value [Array<Literal>] See \{#value}
|
21
|
-
# @param separator [String] See \{#separator}
|
22
|
-
def initialize(value, separator)
|
23
|
-
super(value)
|
24
|
-
@separator = separator
|
25
|
-
end
|
26
|
-
|
27
|
-
# @see Node#deep_copy
|
28
|
-
def deep_copy
|
29
|
-
node = dup
|
30
|
-
node.instance_variable_set('@value', value.map {|c| c.deep_copy})
|
31
|
-
node
|
32
|
-
end
|
33
|
-
|
34
|
-
# @see Node#eq
|
35
|
-
def eq(other)
|
36
|
-
Sass::Script::Bool.new(
|
37
|
-
self.class == other.class && self.value == other.value &&
|
38
|
-
self.separator == other.separator)
|
39
|
-
end
|
40
|
-
|
41
|
-
# @see Node#to_s
|
42
|
-
def to_s(opts = {})
|
43
|
-
raise Sass::SyntaxError.new("() isn't a valid CSS value.") if value.empty?
|
44
|
-
return value.reject {|e| e.is_a?(List) && e.value.empty?}.map {|e| e.to_s(opts)}.join(sep_str)
|
45
|
-
end
|
46
|
-
|
47
|
-
# @see Node#to_sass
|
48
|
-
def to_sass(opts = {})
|
49
|
-
precedence = Sass::Script::Parser.precedence_of(separator)
|
50
|
-
value.map do |v|
|
51
|
-
if v.is_a?(List) && Sass::Script::Parser.precedence_of(v.separator) <= precedence
|
52
|
-
"(#{v.to_sass(opts)})"
|
53
|
-
else
|
54
|
-
v.to_sass(opts)
|
55
|
-
end
|
56
|
-
end.join(sep_str(nil))
|
57
|
-
end
|
58
|
-
|
59
|
-
# @see Node#inspect
|
60
|
-
def inspect
|
61
|
-
"(#{to_sass})"
|
62
|
-
end
|
63
|
-
|
64
|
-
protected
|
65
|
-
|
66
|
-
# @see Node#_perform
|
67
|
-
def _perform(environment)
|
68
|
-
list = Sass::Script::List.new(
|
69
|
-
value.map {|e| e.perform(environment)},
|
70
|
-
separator)
|
71
|
-
list.options = self.options
|
72
|
-
list
|
73
|
-
end
|
74
|
-
|
75
|
-
private
|
76
|
-
|
77
|
-
def sep_str(opts = self.options)
|
78
|
-
return ' ' if separator == :space
|
79
|
-
return ',' if opts && opts[:style] == :compressed
|
80
|
-
return ', '
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|