sassc 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/ext/libsass/.gitignore +13 -6
  4. data/ext/libsass/Makefile +42 -26
  5. data/ext/libsass/Makefile.am +43 -30
  6. data/ext/libsass/Readme.md +4 -2
  7. data/ext/libsass/appveyor.yml +10 -14
  8. data/ext/libsass/ast.cpp +54 -44
  9. data/ext/libsass/ast.hpp +404 -236
  10. data/ext/libsass/ast_def_macros.hpp +5 -0
  11. data/ext/libsass/ast_factory.hpp +6 -3
  12. data/ext/libsass/ast_fwd_decl.hpp +12 -0
  13. data/ext/libsass/b64/encode.h +2 -2
  14. data/ext/libsass/backtrace.hpp +13 -17
  15. data/ext/libsass/base64vlq.hpp +4 -1
  16. data/ext/libsass/bind.cpp +12 -15
  17. data/ext/libsass/bind.hpp +6 -6
  18. data/ext/libsass/color_names.hpp +4 -1
  19. data/ext/libsass/configure.ac +7 -21
  20. data/ext/libsass/constants.cpp +6 -4
  21. data/ext/libsass/constants.hpp +10 -4
  22. data/ext/libsass/context.cpp +89 -58
  23. data/ext/libsass/context.hpp +28 -35
  24. data/ext/libsass/contextualize.cpp +20 -10
  25. data/ext/libsass/contextualize.hpp +8 -23
  26. data/ext/libsass/contrib/libsass.spec +66 -0
  27. data/ext/libsass/cssize.cpp +547 -0
  28. data/ext/libsass/cssize.hpp +82 -0
  29. data/ext/libsass/debug.hpp +3 -3
  30. data/ext/libsass/debugger.hpp +358 -0
  31. data/ext/libsass/emitter.cpp +255 -0
  32. data/ext/libsass/emitter.hpp +83 -0
  33. data/ext/libsass/environment.hpp +7 -3
  34. data/ext/libsass/error_handling.cpp +11 -14
  35. data/ext/libsass/error_handling.hpp +9 -7
  36. data/ext/libsass/eval.cpp +253 -161
  37. data/ext/libsass/eval.hpp +13 -13
  38. data/ext/libsass/expand.cpp +135 -64
  39. data/ext/libsass/expand.hpp +11 -13
  40. data/ext/libsass/extend.cpp +66 -20
  41. data/ext/libsass/extend.hpp +6 -11
  42. data/ext/libsass/file.cpp +31 -26
  43. data/ext/libsass/file.hpp +6 -1
  44. data/ext/libsass/functions.cpp +270 -287
  45. data/ext/libsass/functions.hpp +8 -11
  46. data/ext/libsass/inspect.cpp +385 -255
  47. data/ext/libsass/inspect.hpp +15 -26
  48. data/ext/libsass/kwd_arg_macros.hpp +5 -0
  49. data/ext/libsass/mapping.hpp +4 -3
  50. data/ext/libsass/memory_manager.hpp +5 -2
  51. data/ext/libsass/node.cpp +50 -50
  52. data/ext/libsass/node.hpp +26 -27
  53. data/ext/libsass/operation.hpp +15 -4
  54. data/ext/libsass/output.cpp +401 -0
  55. data/ext/libsass/output.hpp +56 -0
  56. data/ext/libsass/parser.cpp +573 -399
  57. data/ext/libsass/parser.hpp +122 -88
  58. data/ext/libsass/paths.hpp +7 -2
  59. data/ext/libsass/plugins.cpp +155 -0
  60. data/ext/libsass/plugins.hpp +56 -0
  61. data/ext/libsass/position.cpp +128 -0
  62. data/ext/libsass/position.hpp +108 -11
  63. data/ext/libsass/prelexer.cpp +184 -110
  64. data/ext/libsass/prelexer.hpp +131 -24
  65. data/ext/libsass/remove_placeholders.cpp +1 -1
  66. data/ext/libsass/remove_placeholders.hpp +6 -6
  67. data/ext/libsass/sass.cpp +3 -3
  68. data/ext/libsass/sass.h +12 -4
  69. data/ext/libsass/sass2scss.cpp +3 -2
  70. data/ext/libsass/sass2scss.h +5 -0
  71. data/ext/libsass/sass_context.cpp +136 -37
  72. data/ext/libsass/sass_context.h +19 -10
  73. data/ext/libsass/sass_functions.cpp +29 -2
  74. data/ext/libsass/sass_functions.h +8 -2
  75. data/ext/libsass/sass_interface.cpp +32 -23
  76. data/ext/libsass/sass_interface.h +9 -4
  77. data/ext/libsass/sass_util.cpp +19 -23
  78. data/ext/libsass/sass_util.hpp +28 -27
  79. data/ext/libsass/sass_values.cpp +6 -4
  80. data/ext/libsass/sass_values.h +3 -3
  81. data/ext/libsass/script/ci-build-libsass +13 -1
  82. data/ext/libsass/script/ci-report-coverage +2 -1
  83. data/ext/libsass/source_map.cpp +79 -28
  84. data/ext/libsass/source_map.hpp +35 -16
  85. data/ext/libsass/subset_map.hpp +6 -4
  86. data/ext/libsass/to_c.hpp +4 -4
  87. data/ext/libsass/to_string.cpp +13 -8
  88. data/ext/libsass/to_string.hpp +6 -4
  89. data/ext/libsass/units.cpp +2 -1
  90. data/ext/libsass/units.hpp +6 -1
  91. data/ext/libsass/utf8_string.cpp +0 -5
  92. data/ext/libsass/utf8_string.hpp +3 -2
  93. data/ext/libsass/util.cpp +461 -49
  94. data/ext/libsass/util.hpp +34 -13
  95. data/ext/libsass/version.sh +10 -0
  96. data/ext/libsass/win/libsass.filters +20 -11
  97. data/ext/libsass/win/libsass.vcxproj +11 -8
  98. data/lib/sassc/importer.rb +1 -8
  99. data/lib/sassc/native.rb +7 -0
  100. data/lib/sassc/native/native_context_api.rb +5 -5
  101. data/lib/sassc/version.rb +1 -1
  102. data/test/native_test.rb +1 -1
  103. metadata +14 -10
  104. data/ext/libsass/copy_c_str.cpp +0 -13
  105. data/ext/libsass/copy_c_str.hpp +0 -5
  106. data/ext/libsass/output_compressed.cpp +0 -401
  107. data/ext/libsass/output_compressed.hpp +0 -95
  108. data/ext/libsass/output_nested.cpp +0 -364
  109. data/ext/libsass/output_nested.hpp +0 -108
  110. data/ext/libsass/test-driver +0 -127
  111. data/ext/libsass/token.hpp +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c779167157d51896c8f2f389090e3bbdf10ad30d
4
- data.tar.gz: 744962a099ec22bd66708d7954d3561f422e5a9e
3
+ metadata.gz: 84e3ac644262800f310def2ddd6a33b788173644
4
+ data.tar.gz: 60a9b9684751c114079664615eac210ca91b50f3
5
5
  SHA512:
6
- metadata.gz: 0c122bd12dc2c6ffa15b85d9ed1b0045a1419d7fbd2ad67220e3d332dea6b3fdfe725dd9d143f6680068ee033c41c066f70a30893483c7e757595d79ae9be2f9
7
- data.tar.gz: 6a0be2aeab3aa77e953861f328a9e09cffefefc8ef0521ca24e01e3d2e5493c9eca37d6b57c410764a9bd74c9f4a2e8715f672ddedfc18e557ea2c243552d5f4
6
+ metadata.gz: 447d7bf985003fb37bf86ae08e9b7f2aca73b440ff073926f809225eec7ccb152a9a8361111e2349f3894bda5b4c6f2c2a52a781ebb5cebe9873f37ebe90edfc
7
+ data.tar.gz: d5f9074a354e20f40b43cb48ae8ce8cae436f6c9b1a7cf7a5c3f3b8f6b6ba81bdd4ca5dd375ac921f565786e44e316885a6596ffab7f13f9173873b467d12a26
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ task prepare: "ext/lib/libsass.so"
11
11
  file "ext/lib/libsass.so" do
12
12
  gem_dir = File.expand_path(File.dirname(__FILE__)) + "/"
13
13
  cd "ext/libsass"
14
- sh "make lib/libsass.so"
14
+ sh 'make lib/libsass.so LDFLAGS="-Wall -O2"'
15
15
  cd gem_dir
16
16
  end
17
17
 
@@ -14,23 +14,25 @@
14
14
  Makefile.in
15
15
  /aclocal.m4
16
16
  /autom4te.cache/
17
- /config.guess
18
17
  /config.h
19
18
  /config.h.in
20
19
  /config.log
21
20
  /config.status
22
- /config.sub
23
21
  /configure
24
- /depcomp
25
- /install-sh
26
22
  /libtool
27
- /ltmain.sh
28
23
  /m4/libtool.m4
29
24
  /m4/ltoptions.m4
30
25
  /m4/ltsugar.m4
31
26
  /m4/ltversion.m4
32
27
  /m4/lt~obsolete.m4
33
- /missing
28
+ /script/compile
29
+ /script/config.guess
30
+ /script/config.sub
31
+ /script/depcomp
32
+ /script/install-sh
33
+ /script/ltmain.sh
34
+ /script/missing
35
+ /script/test-driver
34
36
  /stamp-h1
35
37
  src/Makefile
36
38
  libsass/*
@@ -44,6 +46,11 @@ libsass/*
44
46
  *.a
45
47
  a.out
46
48
  libsass.js
49
+ tester
50
+ tester.exe
51
+ build/
52
+ config.h.in*
53
+ lib/pkgconfig/
47
54
 
48
55
  bin/*
49
56
  .deps/
@@ -2,11 +2,12 @@ CC ?= gcc
2
2
  CXX ?= g++
3
3
  RM ?= rm -f
4
4
  CP ?= cp -a
5
- MKDIR ?= mkdir -p
5
+ MKDIR ?= mkdir
6
6
  WINDRES ?= windres
7
7
  CFLAGS ?= -Wall -O2
8
8
  CXXFLAGS ?= -Wall -O2
9
- LDFLAGS ?= -Wall -O2
9
+ LDFLAGS ?= -Wall -O2 -Wl,--no-undefined
10
+ CAT ?= $(if $(filter $(OS),Windows_NT),type,cat)
10
11
 
11
12
  ifneq (,$(findstring /cygdrive/,$(PATH)))
12
13
  UNAME := Cygwin
@@ -17,20 +18,30 @@ else
17
18
  ifneq (,$(findstring mingw32,$(MAKE)))
18
19
  UNAME := MinGW
19
20
  else
20
- UNAME := $(shell uname -s)
21
+ ifneq (,$(findstring MINGW32,$(shell uname -s)))
22
+ UNAME = MinGW
23
+ else
24
+ UNAME := $(shell uname -s)
25
+ endif
21
26
  endif
22
27
  endif
23
28
  endif
24
29
 
25
30
  ifeq "$(LIBSASS_VERSION)" ""
26
- ifneq "$(wildcard ./.git/ )" ""
27
- LIBSASS_VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
28
- endif
31
+ ifneq "$(wildcard ./.git/ )" ""
32
+ LIBSASS_VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
33
+ endif
34
+ endif
35
+
36
+ ifeq "$(LIBSASS_VERSION)" ""
37
+ ifneq ("$(wildcard VERSION)","")
38
+ LIBSASS_VERSION ?= $(shell $(CAT) VERSION)
39
+ endif
29
40
  endif
30
41
 
31
42
  ifneq "$(LIBSASS_VERSION)" ""
32
- CFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
33
- CXXFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
43
+ CFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
44
+ CXXFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
34
45
  endif
35
46
 
36
47
  # enable mandatory flag
@@ -43,18 +54,18 @@ else
43
54
  endif
44
55
 
45
56
  ifneq "$(SASS_LIBSASS_PATH)" ""
46
- CFLAGS += -I $(SASS_LIBSASS_PATH)
47
- CXXFLAGS += -I $(SASS_LIBSASS_PATH)
57
+ CFLAGS += -I $(SASS_LIBSASS_PATH)
58
+ CXXFLAGS += -I $(SASS_LIBSASS_PATH)
48
59
  endif
49
60
 
50
61
  ifneq "$(EXTRA_CFLAGS)" ""
51
- CFLAGS += $(EXTRA_CFLAGS)
62
+ CFLAGS += $(EXTRA_CFLAGS)
52
63
  endif
53
64
  ifneq "$(EXTRA_CXXFLAGS)" ""
54
- CXXFLAGS += $(EXTRA_CXXFLAGS)
65
+ CXXFLAGS += $(EXTRA_CXXFLAGS)
55
66
  endif
56
67
  ifneq "$(EXTRA_LDFLAGS)" ""
57
- LDFLAGS += $(EXTRA_LDFLAGS)
68
+ LDFLAGS += $(EXTRA_LDFLAGS)
58
69
  endif
59
70
 
60
71
  LDLIBS = -lstdc++ -lm
@@ -64,6 +75,11 @@ ifeq ($(UNAME),Darwin)
64
75
  LDFLAGS += -stdlib=libc++
65
76
  endif
66
77
 
78
+ ifneq (MinGW,$(UNAME))
79
+ LDFLAGS += -ldl
80
+ LDLIBS += -ldl
81
+ endif
82
+
67
83
  ifneq ($(BUILD),shared)
68
84
  BUILD = static
69
85
  endif
@@ -96,7 +112,7 @@ SOURCES = \
96
112
  constants.cpp \
97
113
  context.cpp \
98
114
  contextualize.cpp \
99
- copy_c_str.cpp \
115
+ cssize.cpp \
100
116
  error_handling.cpp \
101
117
  eval.cpp \
102
118
  expand.cpp \
@@ -106,9 +122,11 @@ SOURCES = \
106
122
  inspect.cpp \
107
123
  node.cpp \
108
124
  json.cpp \
109
- output_compressed.cpp \
110
- output_nested.cpp \
125
+ emitter.cpp \
126
+ output.cpp \
111
127
  parser.cpp \
128
+ plugins.cpp \
129
+ position.cpp \
112
130
  prelexer.cpp \
113
131
  remove_placeholders.cpp \
114
132
  sass.cpp \
@@ -127,14 +145,14 @@ SOURCES = \
127
145
 
128
146
  CSOURCES = cencode.c
129
147
 
130
- RESOURCES =
148
+ RESOURCES =
131
149
 
132
150
  LIBRARIES = lib/libsass.so
133
151
 
134
152
  ifeq (MinGW,$(UNAME))
135
153
  ifeq (shared,$(BUILD))
136
- CFLAGS += -D ADD_EXPORTS
137
- CXXFLAGS += -D ADD_EXPORTS
154
+ CFLAGS += -D ADD_EXPORTS
155
+ CXXFLAGS += -D ADD_EXPORTS
138
156
  LIBRARIES += lib/libsass.dll
139
157
  RESOURCES += res/resource.rc
140
158
  endif
@@ -167,16 +185,16 @@ debug-shared: shared
167
185
  static: lib/libsass.a
168
186
  shared: $(LIBRARIES)
169
187
 
170
- lib/libsass.a: $(COBJECTS) $(OBJECTS)
188
+ lib:
171
189
  $(MKDIR) lib
190
+
191
+ lib/libsass.a: lib $(COBJECTS) $(OBJECTS)
172
192
  $(AR) rcvs $@ $(COBJECTS) $(OBJECTS)
173
193
 
174
- lib/libsass.so: $(COBJECTS) $(OBJECTS)
175
- $(MKDIR) lib
194
+ lib/libsass.so: lib $(COBJECTS) $(OBJECTS)
176
195
  $(CXX) -shared $(LDFLAGS) -o $@ $(COBJECTS) $(OBJECTS) $(LDLIBS)
177
196
 
178
- lib/libsass.dll: $(COBJECTS) $(OBJECTS) $(RCOBJECTS)
179
- $(MKDIR) lib
197
+ lib/libsass.dll: lib $(COBJECTS) $(OBJECTS) $(RCOBJECTS)
180
198
  $(CXX) -shared $(LDFLAGS) -o $@ $(COBJECTS) $(OBJECTS) $(RCOBJECTS) $(LDLIBS) -s -Wl,--subsystem,windows,--out-implib,lib/libsass.a
181
199
 
182
200
  %.o: %.c
@@ -194,11 +212,9 @@ lib/libsass.dll: $(COBJECTS) $(OBJECTS) $(RCOBJECTS)
194
212
  install: install-$(BUILD)
195
213
 
196
214
  install-static: lib/libsass.a
197
- $(MKDIR) $(DESTDIR)$(PREFIX)\/lib/
198
215
  install -pm0755 $< $(DESTDIR)$(PREFIX)/$<
199
216
 
200
217
  install-shared: lib/libsass.so
201
- $(MKDIR) $(DESTDIR)$(PREFIX)\/lib/
202
218
  install -pm0755 $< $(DESTDIR)$(PREFIX)/$<
203
219
 
204
220
  $(SASSC_BIN): $(BUILD)
@@ -1,12 +1,20 @@
1
1
  ACLOCAL_AMFLAGS = -I m4
2
2
 
3
3
  AM_LDFLAGS = -lstdc++ -lm
4
- AM_CFLAGS = -Wall -fPIC
5
- AM_CXXFLAGS = -Wall -fPIC
6
- AM_CFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
7
- AM_CXXFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
4
+ AM_CFLAGS = -Wall
5
+ AM_CXXFLAGS = -Wall
8
6
 
9
- AM_CXXFLAGS += -std=c++0x
7
+ if COMPILER_IS_MINGW32
8
+ AM_CXXFLAGS += -std=gnu++0x
9
+ else
10
+ AM_CFLAGS += -fPIC
11
+ AM_CXXFLAGS += -fPIC
12
+ AM_CXXFLAGS += -std=c++0x
13
+ AM_LDFLAGS += -ldl
14
+ endif
15
+
16
+ AM_CFLAGS += -DLIBSASS_VERSION="\"$(VERSION)\""
17
+ AM_CXXFLAGS += -DLIBSASS_VERSION="\"$(VERSION)\""
10
18
 
11
19
  if ENABLE_COVERAGE
12
20
  AM_CFLAGS += -O0 --coverage
@@ -18,8 +26,6 @@ else
18
26
  AM_LDFLAGS += -O2
19
27
  endif
20
28
 
21
- VERSION = $(LIBSASS_VERSION)
22
-
23
29
  EXTRA_DIST = \
24
30
  COPYING \
25
31
  INSTALL \
@@ -34,7 +40,8 @@ lib_LTLIBRARIES = libsass.la
34
40
  libsass_la_SOURCES = \
35
41
  ast_fwd_decl.hpp ast_def_macros.hpp \
36
42
  kwd_arg_macros.hpp memory_manager.hpp \
37
- position.hpp operation.hpp \
43
+ position.cpp position.hpp \
44
+ operation.hpp \
38
45
  subset_map.hpp mapping.hpp \
39
46
  color_names.hpp backtrace.hpp \
40
47
  cencode.c b64/cencode.h b64/encode.h \
@@ -48,19 +55,20 @@ libsass_la_SOURCES = \
48
55
  constants.cpp constants.hpp \
49
56
  context.cpp context.hpp \
50
57
  contextualize.cpp contextualize.hpp \
51
- copy_c_str.cpp copy_c_str.hpp \
52
58
  error_handling.cpp error_handling.hpp \
53
59
  eval.cpp eval.hpp \
54
60
  expand.cpp expand.hpp \
55
61
  extend.cpp extend.hpp \
62
+ cssize.cpp cssize.hpp \
56
63
  file.cpp file.hpp \
57
64
  functions.cpp functions.hpp \
58
65
  inspect.cpp inspect.hpp \
59
66
  node.cpp node.hpp \
60
67
  json.cpp json.hpp \
61
- output_compressed.cpp output_compressed.hpp \
62
- output_nested.cpp output_nested.hpp \
68
+ emitter.cpp emitter.hpp \
69
+ output.cpp output.hpp \
63
70
  parser.cpp parser.hpp \
71
+ plugins.cpp plugins.hpp \
64
72
  prelexer.cpp prelexer.hpp \
65
73
  remove_placeholders.cpp remove_placeholders.hpp \
66
74
  sass.cpp sass.h \
@@ -85,22 +93,22 @@ include_HEADERS = sass2scss.h sass_context.h sass_functions.h sass_values.h sass
85
93
 
86
94
  if ENABLE_TESTS
87
95
 
88
- noinst_PROGRAMS = sassc_bin
96
+ noinst_PROGRAMS = tester
89
97
 
90
- sassc_bin_SOURCES = $(SASS_SASSC_PATH)/sassc.c
91
- sassc_bin_LDADD = libsass.la
92
- sassc_bin_CFLAGS = $(AM_CFLAGS)
93
- sassc_bin_CXXFLAGS = $(AM_CXXFLAGS)
94
- sassc_bin_LDFLAGS = $(AM_LDFLAGS) -no-install
98
+ tester_LDADD = libsass.la
99
+ tester_SOURCES = $(SASS_SASSC_PATH)/sassc.c
100
+ SASSC_VERSION=`cd "$(SASS_SASSC_PATH)" && ./version.sh`
101
+ tester_CFLAGS = $(AM_CFLAGS) -DSASSC_VERSION="\"$(SASSC_VERSION)\""
102
+ tester_CXXFLAGS = $(AM_CXXFLAGS) -DSASSC_VERSION="\"$(SASSC_VERSION)\""
103
+ tester_LDFLAGS = $(AM_LDFLAGS) -no-install
95
104
 
96
105
  if ENABLE_COVERAGE
97
- nodist_EXTRA_sassc_bin_SOURCES = non-existent-file-to-force-CXX-linking.cxx
106
+ nodist_EXTRA_tester_SOURCES = non-existent-file-to-force-CXX-linking.cxx
98
107
  nodist_EXTRA_libsass_la_SOURCES = non-existent-file-to-force-CXX-linking.cxx
99
108
  endif
100
109
 
101
110
  SASS_SASSC_PATH ?= sassc
102
111
  SASS_SPEC_PATH ?= sass-spec
103
- SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
104
112
 
105
113
  TESTS = \
106
114
  $(SASS_SPEC_PATH)/spec/basic \
@@ -118,7 +126,7 @@ TESTS = \
118
126
 
119
127
  SASS_TEST_FLAGS =
120
128
  LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) ./script/tap-driver
121
- AM_LOG_FLAGS = -c ./sassc_bin --ignore-todo $(LOG_FLAGS)
129
+ AM_LOG_FLAGS = -c ./tester --ignore-todo $(LOG_FLAGS)
122
130
  if USE_TAP
123
131
  AM_LOG_FLAGS += -t
124
132
  SASS_TEST_FLAGS += -t | tapout
@@ -127,19 +135,24 @@ else
127
135
  LOG_COMPILER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
128
136
  endif
129
137
 
130
- $(SASSC_BIN): libsass.la
131
- cd $(SASS_SASSC_PATH) && $(MAKE)
138
+ SASS_TESTER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
139
+
140
+ if COMPILER_IS_MINGW32
141
+ SASS_TESTER += -c $(SASS_LIBSASS_PATH)/tester.exe
142
+ else
143
+ SASS_TESTER += -c $(SASS_LIBSASS_PATH)/tester
144
+ endif
132
145
 
133
- test: $(SASSC_BIN)
134
- $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
146
+ test:
147
+ $(SASS_TESTER) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
135
148
 
136
- test_build: $(SASSC_BIN)
137
- $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
149
+ test_build:
150
+ $(SASS_TESTER) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
138
151
 
139
- test_full: $(SASSC_BIN)
140
- $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
152
+ test_full:
153
+ $(SASS_TESTER) $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
141
154
 
142
- test_issues: $(SASSC_BIN)
143
- $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues $(SASS_TEST_FLAGS)
155
+ test_issues:
156
+ $(SASS_TESTER) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues $(SASS_TEST_FLAGS)
144
157
 
145
158
  endif
@@ -15,7 +15,9 @@ then go to https://github.com/sass/sassc or
15
15
  https://github.com/sass/ruby-libsass or
16
16
  [find your local implementer](https://github.com/sass/libsass/wiki/Implementations).
17
17
 
18
- LibSass requires GCC 4.5+ or Clang/LLVM. If your OS is older, this version may not compile.
18
+ LibSass requires GCC 4.6+ or Clang/LLVM. If your OS is older, this version may not compile.
19
+
20
+ On Windows, you need MinGW with GCC 4.6+ or VS 2013 Update 4+. It is also possible to build LibSass with Clang/LLVM on Windows.
19
21
 
20
22
  About
21
23
  -----
@@ -87,7 +89,7 @@ Our MIT license is designed to be as simple, and liberal as possible.
87
89
  [@chriseppstein]: https://github.com/chriseppstein
88
90
  [@nex3]: https://github.com/nex3
89
91
 
90
- sass2scss was originally written by Marcel Greter [@mgreter]
92
+ sass2scss was originally written by [Marcel Greter](@mgreter)
91
93
  and he happily agreed to have it merged into the project.
92
94
 
93
95
  [sass_interface.h]: sass_interface.h
@@ -15,26 +15,23 @@ environment:
15
15
  ruby_version: "21-x64"
16
16
 
17
17
  cache:
18
- - x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z
19
- - C:\Ruby21-x64\lib\ruby\gems\2.1.0
20
- - C:\Ruby21-x64\bin
18
+ - C:\mingw64
19
+ - C:\Ruby%ruby_version%\lib\ruby\gems
21
20
 
22
21
  install:
23
22
  - git clone https://github.com/sass/sassc.git
24
23
  - git clone https://github.com/sass/sass-spec.git
25
24
  - set PATH=C:\Ruby%ruby_version%\bin;%PATH%
26
25
  - set SASS_LIBSASS_PATH=..
27
- - gem install minitest
28
26
  - ps: |
29
- if ($env:Compiler -eq "mingw") {
30
- if (-Not (Test-Path "x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z")) {
31
- # Install MinGW.
32
- $url = "http://sourceforge.net/projects/mingw-w64/files/"
33
- $url += "Toolchains%20targetting%20Win64/Personal%20Builds/"
34
- $url += "mingw-builds/4.9.2/threads-win32/seh/"
35
- $url += "x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z/download"
36
- Invoke-WebRequest -UserAgent wget -Uri $url -OutFile x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z
37
- }
27
+ if(!(gem which minitest 2>$nul)) { gem install minitest }
28
+ if ($env:Compiler -eq "mingw" -AND -Not (Test-Path "C:\mingw64")) {
29
+ # Install MinGW.
30
+ $url = "http://sourceforge.net/projects/mingw-w64/files/"
31
+ $url += "Toolchains%20targetting%20Win64/Personal%20Builds/"
32
+ $url += "mingw-builds/4.9.2/threads-win32/seh/"
33
+ $url += "x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z/download"
34
+ Invoke-WebRequest -UserAgent wget -Uri $url -OutFile x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z
38
35
  &7z x -oC:\ x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z > $null
39
36
  }
40
37
  - set PATH=C:\mingw64\bin;%PATH%
@@ -73,4 +70,3 @@ test_script:
73
70
  ruby sass-spec\sass-spec.rb -c win\bin\sassc.exe -s --ignore-todo sass-spec/spec
74
71
  }
75
72
  }
76
-
@@ -22,13 +22,13 @@ namespace Sass {
22
22
  return const_cast<Complex_Selector*>(this)->perform(&to_string) <
23
23
  const_cast<Complex_Selector&>(rhs).perform(&to_string);
24
24
  }
25
-
25
+
26
26
  bool Complex_Selector::operator==(const Complex_Selector& rhs) const {
27
27
  // TODO: We have to access the tail directly using tail_ since ADD_PROPERTY doesn't provide a const version.
28
28
 
29
29
  const Complex_Selector* pOne = this;
30
30
  const Complex_Selector* pTwo = &rhs;
31
-
31
+
32
32
  // Consume any empty references at the beginning of the Complex_Selector
33
33
  if (pOne->combinator() == Complex_Selector::ANCESTOR_OF && pOne->head()->is_empty_reference()) {
34
34
  pOne = pOne->tail_;
@@ -36,12 +36,12 @@ namespace Sass {
36
36
  if (pTwo->combinator() == Complex_Selector::ANCESTOR_OF && pTwo->head()->is_empty_reference()) {
37
37
  pTwo = pTwo->tail_;
38
38
  }
39
-
39
+
40
40
  while (pOne && pTwo) {
41
41
  if (pOne->combinator() != pTwo->combinator()) {
42
42
  return false;
43
43
  }
44
-
44
+
45
45
  if (*(pOne->head()) != *(pTwo->head())) {
46
46
  return false;
47
47
  }
@@ -49,7 +49,7 @@ namespace Sass {
49
49
  pOne = pOne->tail_;
50
50
  pTwo = pTwo->tail_;
51
51
  }
52
-
52
+
53
53
  return pOne == NULL && pTwo == NULL;
54
54
  }
55
55
 
@@ -63,7 +63,7 @@ namespace Sass {
63
63
  }
64
64
  return unified;
65
65
  }
66
-
66
+
67
67
  bool Simple_Selector::operator==(const Simple_Selector& rhs) const
68
68
  {
69
69
  // Compare the string representations for equality.
@@ -75,21 +75,21 @@ namespace Sass {
75
75
  To_String to_string;
76
76
  return pLHS->perform(&to_string) == pRHS->perform(&to_string);
77
77
  }
78
-
78
+
79
79
  bool Simple_Selector::operator<(const Simple_Selector& rhs) const {
80
80
  // Use the string representation for ordering.
81
81
 
82
82
  // Cast away const here. To_String should take a const object, but it doesn't.
83
83
  Simple_Selector* pLHS = const_cast<Simple_Selector*>(this);
84
84
  Simple_Selector* pRHS = const_cast<Simple_Selector*>(&rhs);
85
-
85
+
86
86
  To_String to_string;
87
87
  return pLHS->perform(&to_string) < pRHS->perform(&to_string);
88
88
  }
89
89
 
90
90
  Compound_Selector* Simple_Selector::unify_with(Compound_Selector* rhs, Context& ctx)
91
91
  {
92
- To_String to_string;
92
+ To_String to_string(&ctx);
93
93
  for (size_t i = 0, L = rhs->length(); i < L; ++i)
94
94
  { if (perform(&to_string) == (*rhs)[i]->perform(&to_string)) return rhs; }
95
95
 
@@ -102,7 +102,7 @@ namespace Sass {
102
102
  {
103
103
  if ((typeid(*(*rhs)[i]) == typeid(Pseudo_Selector) || typeid(*(*rhs)[i]) == typeid(Wrapped_Selector)) && (*rhs)[L-1]->is_pseudo_element())
104
104
  { found = true; break; }
105
- }
105
+ }
106
106
  }
107
107
  else
108
108
  {
@@ -118,7 +118,7 @@ namespace Sass {
118
118
  (*cpy) << this;
119
119
  return cpy;
120
120
  }
121
- Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->path(), rhs->position());
121
+ Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->pstate());
122
122
  for (size_t j = 0; j < i; ++j)
123
123
  { (*cpy) << (*rhs)[j]; }
124
124
  (*cpy) << this;
@@ -133,7 +133,7 @@ namespace Sass {
133
133
 
134
134
  // if the rhs is empty, just return a copy of this
135
135
  if (rhs->length() == 0) {
136
- Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->path(), rhs->position());
136
+ Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->pstate());
137
137
  (*cpy) << this;
138
138
  return cpy;
139
139
  }
@@ -141,7 +141,7 @@ namespace Sass {
141
141
  // if this is a universal selector and rhs is not empty, just return the rhs
142
142
  if (name() == "*")
143
143
  { return new (ctx.mem) Compound_Selector(*rhs); }
144
-
144
+
145
145
 
146
146
  Simple_Selector* rhs_0 = (*rhs)[0];
147
147
  // otherwise, this is a tag name
@@ -150,7 +150,7 @@ namespace Sass {
150
150
  // if rhs is universal, just return this tagname + rhs's qualifiers
151
151
  if (static_cast<Type_Selector*>(rhs_0)->name() == "*")
152
152
  {
153
- Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->path(), rhs->position());
153
+ Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->pstate());
154
154
  (*cpy) << this;
155
155
  for (size_t i = 1, L = rhs->length(); i < L; ++i)
156
156
  { (*cpy) << (*rhs)[i]; }
@@ -164,7 +164,7 @@ namespace Sass {
164
164
  { return 0; }
165
165
  }
166
166
  // else it's a tag name and a bunch of qualifiers -- just append them
167
- Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->path(), rhs->position());
167
+ Compound_Selector* cpy = new (ctx.mem) Compound_Selector(rhs->pstate());
168
168
  (*cpy) << this;
169
169
  (*cpy) += rhs;
170
170
  return cpy;
@@ -183,6 +183,7 @@ namespace Sass {
183
183
  return 0;
184
184
  }
185
185
  }
186
+ rhs->has_line_break(has_line_break());
186
187
  return Simple_Selector::unify_with(rhs, ctx);
187
188
  }
188
189
 
@@ -208,9 +209,9 @@ namespace Sass {
208
209
 
209
210
  Simple_Selector* lbase = base();
210
211
  Simple_Selector* rbase = rhs->base();
211
-
212
+
212
213
  // Check if pseudo-elements are the same between the selectors
213
-
214
+
214
215
  set<string> lpsuedoset, rpsuedoset;
215
216
  for (size_t i = 0, L = length(); i < L; ++i)
216
217
  {
@@ -262,12 +263,12 @@ namespace Sass {
262
263
  // catch-all
263
264
  return false;
264
265
  }
265
-
266
+
266
267
  bool Compound_Selector::operator==(const Compound_Selector& rhs) const {
267
268
  To_String to_string;
268
-
269
+
269
270
  // Check if pseudo-elements are the same between the selectors
270
-
271
+
271
272
  set<string> lpsuedoset, rpsuedoset;
272
273
  for (size_t i = 0, L = length(); i < L; ++i)
273
274
  {
@@ -290,33 +291,33 @@ namespace Sass {
290
291
  }
291
292
 
292
293
  // Check the base
293
-
294
+
294
295
  const Simple_Selector* const lbase = base();
295
296
  const Simple_Selector* const rbase = rhs.base();
296
-
297
+
297
298
  if ((lbase && !rbase) ||
298
299
  (!lbase && rbase) ||
299
300
  ((lbase && rbase) && (*lbase != *rbase))) {
300
301
  return false;
301
302
  }
302
-
303
-
303
+
304
+
304
305
  // Check the rest of the SimpleSelectors
305
306
  // Use string representations. We can't create a set of Simple_Selector pointers because std::set == std::set is going to call ==
306
307
  // on the pointers to determine equality. I don't know of a way to pass in a comparison object. The one you can specify as part of
307
308
  // the template type is used for ordering, but not equality. We also can't just put in non-pointer Simple_Selectors because the
308
309
  // class is intended to be subclassed, and we'd get splicing.
309
-
310
+
310
311
  set<string> lset, rset;
311
-
312
+
312
313
  for (size_t i = 0, L = length(); i < L; ++i)
313
314
  { lset.insert((*this)[i]->perform(&to_string)); }
314
315
  for (size_t i = 0, L = rhs.length(); i < L; ++i)
315
316
  { rset.insert(rhs[i]->perform(&to_string)); }
316
-
317
+
317
318
  return lset == rset;
318
319
  }
319
-
320
+
320
321
  bool Complex_Selector_Pointer_Compare::operator() (const Complex_Selector* const pLeft, const Complex_Selector* const pRight) const {
321
322
  return *pLeft < *pRight;
322
323
  }
@@ -361,7 +362,7 @@ namespace Sass {
361
362
  if (!found)
362
363
  { return false; }
363
364
 
364
- /*
365
+ /*
365
366
  Hmm, I hope I have the logic right:
366
367
 
367
368
  if lhs has a combinator:
@@ -413,7 +414,10 @@ namespace Sass {
413
414
  {
414
415
  if (!tail()) return 0;
415
416
  if (!head()) return tail()->context(ctx);
416
- return new (ctx.mem) Complex_Selector(path(), position(), combinator(), head(), tail()->context(ctx));
417
+ Complex_Selector* cpy = new (ctx.mem) Complex_Selector(pstate(), combinator(), head(), tail()->context(ctx));
418
+ cpy->media_block(media_block());
419
+ cpy->last_block(last_block());
420
+ return cpy;
417
421
  }
418
422
 
419
423
  Complex_Selector* Complex_Selector::innermost()
@@ -446,12 +450,12 @@ namespace Sass {
446
450
  if (tail()) cpy->tail(tail()->clone(ctx));
447
451
  return cpy;
448
452
  }
449
-
453
+
450
454
  Complex_Selector* Complex_Selector::cloneFully(Context& ctx) const
451
455
  {
452
456
  Complex_Selector* cpy = new (ctx.mem) Complex_Selector(*this);
453
457
 
454
- if (head()) {
458
+ if (head()) {
455
459
  cpy->head(head()->clone(ctx));
456
460
  }
457
461
 
@@ -461,20 +465,21 @@ namespace Sass {
461
465
 
462
466
  return cpy;
463
467
  }
464
-
468
+
465
469
  Compound_Selector* Compound_Selector::clone(Context& ctx) const
466
470
  {
467
471
  Compound_Selector* cpy = new (ctx.mem) Compound_Selector(*this);
468
472
  return cpy;
469
473
  }
470
-
471
474
 
472
475
 
476
+
477
+ /* not used anymore - remove?
473
478
  Selector_Placeholder* Selector::find_placeholder()
474
479
  {
475
480
  return 0;
476
- }
477
-
481
+ }*/
482
+
478
483
  void Selector_List::adjust_after_pushing(Complex_Selector* c)
479
484
  {
480
485
  if (c->has_reference()) has_reference(true);
@@ -486,6 +491,7 @@ namespace Sass {
486
491
  #endif
487
492
  }
488
493
 
494
+ /* not used anymore - remove?
489
495
  Selector_Placeholder* Selector_List::find_placeholder()
490
496
  {
491
497
  if (has_placeholder()) {
@@ -494,8 +500,9 @@ namespace Sass {
494
500
  }
495
501
  }
496
502
  return 0;
497
- }
503
+ }*/
498
504
 
505
+ /* not used anymore - remove?
499
506
  Selector_Placeholder* Complex_Selector::find_placeholder()
500
507
  {
501
508
  if (has_placeholder()) {
@@ -503,8 +510,9 @@ namespace Sass {
503
510
  else if (tail() && tail()->has_placeholder()) return tail()->find_placeholder();
504
511
  }
505
512
  return 0;
506
- }
513
+ }*/
507
514
 
515
+ /* not used anymore - remove?
508
516
  Selector_Placeholder* Compound_Selector::find_placeholder()
509
517
  {
510
518
  if (has_placeholder()) {
@@ -514,12 +522,13 @@ namespace Sass {
514
522
  // return this;
515
523
  }
516
524
  return 0;
517
- }
525
+ }*/
518
526
 
527
+ /* not used anymore - remove?
519
528
  Selector_Placeholder* Selector_Placeholder::find_placeholder()
520
529
  {
521
530
  return this;
522
- }
531
+ }*/
523
532
 
524
533
  vector<string> Compound_Selector::to_str_vec()
525
534
  {
@@ -533,8 +542,8 @@ namespace Sass {
533
542
 
534
543
  Compound_Selector* Compound_Selector::minus(Compound_Selector* rhs, Context& ctx)
535
544
  {
536
- To_String to_string;
537
- Compound_Selector* result = new (ctx.mem) Compound_Selector(path(), position());
545
+ To_String to_string(&ctx);
546
+ Compound_Selector* result = new (ctx.mem) Compound_Selector(pstate());
538
547
 
539
548
  // not very efficient because it needs to preserve order
540
549
  for (size_t i = 0, L = length(); i < L; ++i)
@@ -554,7 +563,7 @@ namespace Sass {
554
563
 
555
564
  return result;
556
565
  }
557
-
566
+
558
567
  void Compound_Selector::mergeSources(SourcesSet& sources, Context& ctx)
559
568
  {
560
569
  for (SourcesSet::iterator iterator = sources.begin(), endIterator = sources.end(); iterator != endIterator; ++iterator) {
@@ -562,6 +571,7 @@ namespace Sass {
562
571
  }
563
572
  }
564
573
 
574
+ /* not used anymore - remove?
565
575
  vector<Compound_Selector*> Complex_Selector::to_vector()
566
576
  {
567
577
  vector<Compound_Selector*> result;
@@ -575,7 +585,7 @@ namespace Sass {
575
585
  if (h) result.push_back(h);
576
586
  }
577
587
  return result;
578
- }
588
+ }*/
579
589
 
580
590
  }
581
591