sass 3.3.0.alpha.215 → 3.3.0.alpha.216

Sign up to get free protection for your applications and to get access to all the features.
data/REVISION CHANGED
@@ -1 +1 @@
1
- 57f4d0e46d42fb99b311ea1d5793630ffea60d94
1
+ 8c564fa59aaefcd1263cf8ec370b60f15510f780
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0.alpha.215
1
+ 3.3.0.alpha.216
data/VERSION_DATE CHANGED
@@ -1 +1 @@
1
- 26 July 2013 23:28:51 GMT
1
+ 27 July 2013 00:44:58 GMT
data/lib/sass/engine.rb CHANGED
@@ -668,25 +668,35 @@ WARNING
668
668
  @options[:filename], @options[:importer])
669
669
  offset = parser.offset - 1
670
670
  res.unshift(hack_char) if hack_char
671
+
672
+ # Handle comments after a property name but before the colon.
671
673
  if comment = scanner.scan(Sass::SCSS::RX::COMMENT)
672
674
  res << comment
673
675
  offset += comment.length
674
676
  end
675
677
 
676
678
  name = line.text[0...scanner.pos]
677
- if scanned = scanner.scan(/\s*:(?:\s+|$)/)
679
+ if scanned = scanner.scan(/\s*:(?:\s+|$)/) # test for a property
678
680
  offset += scanned.length
679
681
  property = parse_property(name, res, scanner.rest, :new, line, offset)
680
682
  property.name_source_range = ident_range
681
683
  property
682
684
  else
683
685
  res.pop if comment
686
+
687
+ if trailing = (scanner.scan(/\s*#{Sass::SCSS::RX::COMMENT}/) ||
688
+ scanner.scan(/\s*#{Sass::SCSS::RX::SINGLE_LINE_COMMENT}/))
689
+ offset += trailing.length # skip over comment for rule processing
690
+ trailing.strip!
691
+ end
684
692
  interp_parsed = parse_interp(scanner.rest)
685
693
  selector_range = Sass::Source::Range.new(
686
694
  ident_range.start_pos,
687
695
  Sass::Source::Position.new(@line, to_parser_offset(line.offset) + line.text.length),
688
696
  @options[:filename], @options[:importer])
689
- Tree::RuleNode.new(res + interp_parsed, selector_range)
697
+ rule = Tree::RuleNode.new(res + interp_parsed, selector_range)
698
+ rule << Tree::CommentNode.new([trailing], :silent) if trailing
699
+ rule
690
700
  end
691
701
  end
692
702
 
@@ -531,6 +531,28 @@ SASS
531
531
  SCSS
532
532
  end
533
533
 
534
+ def test_immediately_following_comments
535
+ assert_sass_to_scss <<SCSS, <<SASS
536
+ .foobar {
537
+ // trailing comment
538
+ a: 1px;
539
+ }
540
+ SCSS
541
+ .foobar // trailing comment
542
+ a: 1px
543
+ SASS
544
+
545
+ assert_sass_to_scss <<SCSS, <<SASS
546
+ .foobar {
547
+ // trailing comment
548
+ a: 1px;
549
+ }
550
+ SCSS
551
+ .foobar /* trailing comment */
552
+ a: 1px
553
+ SASS
554
+ end
555
+
534
556
  def test_debug
535
557
  assert_renders <<SASS, <<SCSS
536
558
  foo
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 592302755
4
+ hash: 592302781
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 215
12
- version: 3.3.0.alpha.215
11
+ - 216
12
+ version: 3.3.0.alpha.216
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum