sassc 1.7.1 → 1.8.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/ext/libsass/.gitignore +10 -6
  4. data/ext/libsass/.travis.yml +4 -1
  5. data/ext/libsass/GNUmakefile.am +88 -0
  6. data/ext/libsass/Makefile +157 -76
  7. data/ext/libsass/Makefile.conf +47 -0
  8. data/ext/libsass/Readme.md +13 -14
  9. data/ext/libsass/appveyor.yml +25 -41
  10. data/ext/libsass/configure.ac +20 -7
  11. data/ext/libsass/contrib/plugin.cpp +1 -1
  12. data/ext/libsass/include/sass.h +15 -0
  13. data/ext/libsass/{sass.h → include/sass/base.h} +17 -9
  14. data/ext/libsass/{sass_context.h → include/sass/context.h} +3 -1
  15. data/ext/libsass/{sass_functions.h → include/sass/functions.h} +4 -4
  16. data/ext/libsass/{sass_interface.h → include/sass/interface.h} +5 -2
  17. data/ext/libsass/{sass_values.h → include/sass/values.h} +15 -1
  18. data/ext/libsass/{sass_version.h → include/sass/version.h} +0 -0
  19. data/ext/libsass/{sass_version.h.in → include/sass/version.h.in} +0 -0
  20. data/ext/libsass/{sass2scss.h → include/sass2scss.h} +6 -7
  21. data/ext/libsass/m4/m4-ax_cxx_compile_stdcxx_11.m4 +167 -0
  22. data/ext/libsass/script/ci-build-libsass +67 -23
  23. data/ext/libsass/src/GNUmakefile.am +54 -0
  24. data/ext/libsass/src/ast.cpp +2029 -0
  25. data/ext/libsass/{ast.hpp → src/ast.hpp} +832 -660
  26. data/ext/libsass/src/ast_def_macros.hpp +47 -0
  27. data/ext/libsass/src/ast_factory.hpp +93 -0
  28. data/ext/libsass/{ast_fwd_decl.hpp → src/ast_fwd_decl.hpp} +9 -4
  29. data/ext/libsass/{b64 → src/b64}/cencode.h +1 -1
  30. data/ext/libsass/{b64 → src/b64}/encode.h +0 -0
  31. data/ext/libsass/{backtrace.hpp → src/backtrace.hpp} +9 -10
  32. data/ext/libsass/{base64vlq.cpp → src/base64vlq.cpp} +2 -2
  33. data/ext/libsass/{base64vlq.hpp → src/base64vlq.hpp} +1 -2
  34. data/ext/libsass/{bind.cpp → src/bind.cpp} +96 -59
  35. data/ext/libsass/{bind.hpp → src/bind.hpp} +1 -1
  36. data/ext/libsass/src/c99func.c +54 -0
  37. data/ext/libsass/{cencode.c → src/cencode.c} +5 -5
  38. data/ext/libsass/src/color_maps.cpp +643 -0
  39. data/ext/libsass/src/color_maps.hpp +333 -0
  40. data/ext/libsass/{constants.cpp → src/constants.cpp} +10 -1
  41. data/ext/libsass/{constants.hpp → src/constants.hpp} +7 -0
  42. data/ext/libsass/{context.cpp → src/context.cpp} +152 -122
  43. data/ext/libsass/src/context.hpp +150 -0
  44. data/ext/libsass/{cssize.cpp → src/cssize.cpp} +123 -109
  45. data/ext/libsass/{cssize.hpp → src/cssize.hpp} +9 -13
  46. data/ext/libsass/{debug.hpp → src/debug.hpp} +9 -9
  47. data/ext/libsass/src/debugger.hpp +683 -0
  48. data/ext/libsass/{emitter.cpp → src/emitter.cpp} +13 -13
  49. data/ext/libsass/{emitter.hpp → src/emitter.hpp} +10 -11
  50. data/ext/libsass/src/environment.cpp +184 -0
  51. data/ext/libsass/src/environment.hpp +92 -0
  52. data/ext/libsass/src/error_handling.cpp +46 -0
  53. data/ext/libsass/src/error_handling.hpp +34 -0
  54. data/ext/libsass/src/eval.cpp +1462 -0
  55. data/ext/libsass/src/eval.hpp +107 -0
  56. data/ext/libsass/src/expand.cpp +653 -0
  57. data/ext/libsass/{expand.hpp → src/expand.hpp} +17 -16
  58. data/ext/libsass/{extend.cpp → src/extend.cpp} +198 -139
  59. data/ext/libsass/{extend.hpp → src/extend.hpp} +7 -8
  60. data/ext/libsass/{file.cpp → src/file.cpp} +103 -57
  61. data/ext/libsass/{file.hpp → src/file.hpp} +23 -14
  62. data/ext/libsass/{functions.cpp → src/functions.cpp} +642 -333
  63. data/ext/libsass/{functions.hpp → src/functions.hpp} +17 -4
  64. data/ext/libsass/{inspect.cpp → src/inspect.cpp} +147 -260
  65. data/ext/libsass/{inspect.hpp → src/inspect.hpp} +7 -7
  66. data/ext/libsass/{json.cpp → src/json.cpp} +33 -43
  67. data/ext/libsass/{json.hpp → src/json.hpp} +1 -1
  68. data/ext/libsass/{kwd_arg_macros.hpp → src/kwd_arg_macros.hpp} +0 -0
  69. data/ext/libsass/{lexer.cpp → src/lexer.cpp} +28 -0
  70. data/ext/libsass/{lexer.hpp → src/lexer.hpp} +25 -10
  71. data/ext/libsass/{listize.cpp → src/listize.cpp} +17 -13
  72. data/ext/libsass/{listize.hpp → src/listize.hpp} +0 -2
  73. data/ext/libsass/{mapping.hpp → src/mapping.hpp} +0 -0
  74. data/ext/libsass/src/memory_manager.cpp +76 -0
  75. data/ext/libsass/src/memory_manager.hpp +48 -0
  76. data/ext/libsass/{node.cpp → src/node.cpp} +89 -18
  77. data/ext/libsass/{node.hpp → src/node.hpp} +5 -6
  78. data/ext/libsass/{operation.hpp → src/operation.hpp} +18 -12
  79. data/ext/libsass/{output.cpp → src/output.cpp} +47 -55
  80. data/ext/libsass/{output.hpp → src/output.hpp} +5 -4
  81. data/ext/libsass/src/parser.cpp +2529 -0
  82. data/ext/libsass/{parser.hpp → src/parser.hpp} +84 -60
  83. data/ext/libsass/{paths.hpp → src/paths.hpp} +10 -13
  84. data/ext/libsass/{plugins.cpp → src/plugins.cpp} +14 -17
  85. data/ext/libsass/{plugins.hpp → src/plugins.hpp} +10 -11
  86. data/ext/libsass/{position.cpp → src/position.cpp} +5 -6
  87. data/ext/libsass/{position.hpp → src/position.hpp} +19 -22
  88. data/ext/libsass/{prelexer.cpp → src/prelexer.cpp} +401 -53
  89. data/ext/libsass/{prelexer.hpp → src/prelexer.hpp} +50 -10
  90. data/ext/libsass/{remove_placeholders.cpp → src/remove_placeholders.cpp} +12 -16
  91. data/ext/libsass/{remove_placeholders.hpp → src/remove_placeholders.hpp} +1 -7
  92. data/ext/libsass/{sass.cpp → src/sass.cpp} +3 -5
  93. data/ext/libsass/{sass2scss.cpp → src/sass2scss.cpp} +51 -46
  94. data/ext/libsass/{sass_context.cpp → src/sass_context.cpp} +114 -112
  95. data/ext/libsass/{sass_functions.cpp → src/sass_functions.cpp} +11 -18
  96. data/ext/libsass/{sass_interface.cpp → src/sass_interface.cpp} +44 -81
  97. data/ext/libsass/{sass_util.cpp → src/sass_util.cpp} +26 -8
  98. data/ext/libsass/{sass_util.hpp → src/sass_util.hpp} +14 -18
  99. data/ext/libsass/{sass_values.cpp → src/sass_values.cpp} +91 -20
  100. data/ext/libsass/{source_map.cpp → src/source_map.cpp} +13 -13
  101. data/ext/libsass/{source_map.hpp → src/source_map.hpp} +9 -9
  102. data/ext/libsass/{subset_map.hpp → src/subset_map.hpp} +29 -31
  103. data/ext/libsass/{support → src/support}/libsass.pc.in +0 -0
  104. data/ext/libsass/src/to_c.cpp +73 -0
  105. data/ext/libsass/src/to_c.hpp +41 -0
  106. data/ext/libsass/src/to_string.cpp +47 -0
  107. data/ext/libsass/{to_string.hpp → src/to_string.hpp} +9 -7
  108. data/ext/libsass/src/to_value.cpp +109 -0
  109. data/ext/libsass/src/to_value.hpp +50 -0
  110. data/ext/libsass/{units.cpp → src/units.cpp} +56 -51
  111. data/ext/libsass/{units.hpp → src/units.hpp} +8 -9
  112. data/ext/libsass/{utf8.h → src/utf8.h} +0 -0
  113. data/ext/libsass/{utf8 → src/utf8}/checked.h +0 -0
  114. data/ext/libsass/{utf8 → src/utf8}/core.h +12 -12
  115. data/ext/libsass/{utf8 → src/utf8}/unchecked.h +0 -0
  116. data/ext/libsass/{utf8_string.cpp → src/utf8_string.cpp} +0 -0
  117. data/ext/libsass/{utf8_string.hpp → src/utf8_string.hpp} +6 -6
  118. data/ext/libsass/{util.cpp → src/util.cpp} +144 -86
  119. data/ext/libsass/src/util.hpp +59 -0
  120. data/ext/libsass/src/values.cpp +137 -0
  121. data/ext/libsass/src/values.hpp +12 -0
  122. data/ext/libsass/test/test_node.cpp +33 -33
  123. data/ext/libsass/test/test_paths.cpp +5 -6
  124. data/ext/libsass/test/test_selector_difference.cpp +4 -5
  125. data/ext/libsass/test/test_specificity.cpp +4 -5
  126. data/ext/libsass/test/test_subset_map.cpp +91 -91
  127. data/ext/libsass/test/test_superselector.cpp +11 -11
  128. data/ext/libsass/test/test_unification.cpp +4 -4
  129. data/ext/libsass/win/libsass.targets +101 -0
  130. data/ext/libsass/win/libsass.vcxproj +45 -127
  131. data/ext/libsass/win/libsass.vcxproj.filters +303 -0
  132. data/lib/sassc/import_handler.rb +1 -1
  133. data/lib/sassc/native/native_functions_api.rb +3 -3
  134. data/lib/sassc/version.rb +1 -1
  135. data/test/custom_importer_test.rb +1 -4
  136. data/test/functions_test.rb +3 -2
  137. data/test/native_test.rb +4 -3
  138. metadata +117 -110
  139. data/ext/libsass/Makefile.am +0 -146
  140. data/ext/libsass/ast.cpp +0 -945
  141. data/ext/libsass/ast_def_macros.hpp +0 -21
  142. data/ext/libsass/ast_factory.hpp +0 -92
  143. data/ext/libsass/color_names.hpp +0 -327
  144. data/ext/libsass/context.hpp +0 -157
  145. data/ext/libsass/contextualize.cpp +0 -148
  146. data/ext/libsass/contextualize.hpp +0 -46
  147. data/ext/libsass/contextualize_eval.cpp +0 -93
  148. data/ext/libsass/contextualize_eval.hpp +0 -44
  149. data/ext/libsass/debugger.hpp +0 -558
  150. data/ext/libsass/environment.hpp +0 -163
  151. data/ext/libsass/error_handling.cpp +0 -35
  152. data/ext/libsass/error_handling.hpp +0 -32
  153. data/ext/libsass/eval.cpp +0 -1392
  154. data/ext/libsass/eval.hpp +0 -88
  155. data/ext/libsass/expand.cpp +0 -575
  156. data/ext/libsass/memory_manager.hpp +0 -57
  157. data/ext/libsass/parser.cpp +0 -2403
  158. data/ext/libsass/posix/getopt.c +0 -562
  159. data/ext/libsass/posix/getopt.h +0 -95
  160. data/ext/libsass/to_c.cpp +0 -61
  161. data/ext/libsass/to_c.hpp +0 -44
  162. data/ext/libsass/to_string.cpp +0 -34
  163. data/ext/libsass/util.hpp +0 -54
  164. data/ext/libsass/win/libsass.filters +0 -312
@@ -0,0 +1,47 @@
1
+ # this is merely a common Makefile multiple implementers can use
2
+
3
+ SOURCES = \
4
+ ast.cpp \
5
+ base64vlq.cpp \
6
+ bind.cpp \
7
+ color_maps.cpp \
8
+ constants.cpp \
9
+ context.cpp \
10
+ cssize.cpp \
11
+ emitter.cpp \
12
+ environment.cpp \
13
+ error_handling.cpp \
14
+ eval.cpp \
15
+ expand.cpp \
16
+ extend.cpp \
17
+ file.cpp \
18
+ functions.cpp \
19
+ inspect.cpp \
20
+ json.cpp \
21
+ lexer.cpp \
22
+ listize.cpp \
23
+ memory_manager.cpp \
24
+ node.cpp \
25
+ output.cpp \
26
+ parser.cpp \
27
+ plugins.cpp \
28
+ position.cpp \
29
+ prelexer.cpp \
30
+ remove_placeholders.cpp \
31
+ sass.cpp \
32
+ sass_util.cpp \
33
+ sass_values.cpp \
34
+ sass_context.cpp \
35
+ sass_functions.cpp \
36
+ sass_interface.cpp \
37
+ sass2scss.cpp \
38
+ source_map.cpp \
39
+ to_c.cpp \
40
+ to_string.cpp \
41
+ to_value.cpp \
42
+ units.cpp \
43
+ utf8_string.cpp \
44
+ values.cpp \
45
+ util.cpp
46
+
47
+ CSOURCES = cencode.c
@@ -1,4 +1,4 @@
1
- Libsass
1
+ LibSass
2
2
  =======
3
3
 
4
4
  by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin])
@@ -11,7 +11,7 @@ by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin])
11
11
 
12
12
  https://github.com/sass/libsass
13
13
 
14
- Libsass is just a library, but if you want to RUN libsass,
14
+ LibSass is just a library, but if you want to RUN LibSass,
15
15
  then go to https://github.com/sass/sassc or
16
16
  https://github.com/sass/ruby-libsass or
17
17
  [find your local implementer](https://github.com/sass/libsass/wiki/Implementations).
@@ -23,19 +23,19 @@ On Windows, you need MinGW with GCC 4.6+ or VS 2013 Update 4+. It is also possib
23
23
  About
24
24
  -----
25
25
 
26
- Libsass is a C/C++ port of the Sass CSS precompiler. The original version was written in Ruby, but this version is meant for efficiency and portability.
26
+ LibSass is a C/C++ port of the Sass CSS precompiler. The original version was written in Ruby, but this version is meant for efficiency and portability.
27
27
 
28
28
  This library strives to be light, simple, and easy to build and integrate with a variety of platforms and languages.
29
29
 
30
30
  Developing
31
31
  ----------
32
32
 
33
- As you may have noticed, the libsass repo itself has
33
+ As you may have noticed, the LibSass repo itself has
34
34
  no executables and no tests. Oh noes! How can you develop???
35
35
 
36
- Well, luckily, SassC is the official binary wrapper for
37
- libsass and is *always* kept in sync. SassC uses a git submodule
38
- to include libsass. When developing libsass, its best to actually
36
+ Well, luckily, [SassC](http://github.com/sass/sassc) is the official binary wrapper for
37
+ LibSass and is *always* kept in sync. SassC uses a git submodule
38
+ to include LibSass. When developing LibSass, its best to actually
39
39
  check out SassC and develop in that directory with the SassC spec
40
40
  and tests there.
41
41
 
@@ -44,21 +44,21 @@ We even run Travis tests for SassC!
44
44
  Tests
45
45
  -------
46
46
 
47
- Since libsass is a pure library, tests are run through the [SassSpec](https://github.com/sass/sass-spec) project using the [SassC](http://github.com/sass/sassc) driver.
47
+ Since LibSass is a pure library, tests are run through the [SassSpec](https://github.com/sass/sass-spec) project using the [SassC](http://github.com/sass/sassc) driver.
48
48
 
49
- To run tests against libsass while developing, you can run `./script/spec`. This will clone SassC and Sass-Spec under the project folder and then run the Sass-Spec test suite. You may want to update the clones to ensure you have the latest version.
49
+ To run tests against LibSass while developing, you can run `./script/spec`. This will clone SassC and Sass-Spec under the project folder and then run the Sass-Spec test suite. You may want to update the clones to ensure you have the latest version.
50
50
 
51
51
  Library Usage
52
52
  -------------
53
53
 
54
- While libsass is a library primarily written in C++, it provides a simple
55
- C interface which should be used by most implementers. Libsass does not do
54
+ While LibSass is a library primarily written in C++, it provides a simple
55
+ C interface which should be used by most implementers. LibSass does not do
56
56
  much on its own without an implementer. This can be a command line tool, like
57
57
  [sassc](https://github.com/sass/sassc) or a [binding](https://github.com/sass/libsass/wiki/Implementations)
58
58
  to your favorite programing language.
59
59
 
60
- If you want to build or interface with libsass, we recommend to check out the
61
- wiki pages about [building libsass](https://github.com/sass/libsass/wiki/Building-Libsass) and
60
+ If you want to build or interface with LibSass, we recommend to check out the
61
+ wiki pages about [building LibSass](https://github.com/sass/libsass/wiki/building-libsass) and
62
62
  the [C-API documentation](https://github.com/sass/libsass/wiki/API-Documentation).
63
63
 
64
64
  About Sass
@@ -93,4 +93,3 @@ Our MIT license is designed to be as simple, and liberal as possible.
93
93
  sass2scss was originally written by [Marcel Greter](@mgreter)
94
94
  and he happily agreed to have it merged into the project.
95
95
 
96
- [sass_interface.h]: sass_interface.h
@@ -1,37 +1,36 @@
1
+ os: Visual Studio 2015
2
+
1
3
  environment:
2
4
  CTEST_OUTPUT_ON_FAILURE: 1
5
+ ruby_version: 22-x64
6
+ TargetPath: sassc/bin/sassc
3
7
  matrix:
4
- - Compiler: mingw
5
- Build: static
6
- ruby_version: "21-x64"
7
- - Compiler: mingw
8
- Build: shared
9
- ruby_version: "21-x64"
10
8
  - Compiler: msvc
11
9
  Config: Release
12
- ruby_version: "21-x64"
13
10
  - Compiler: msvc
14
11
  Config: Debug
15
- ruby_version: "21-x64"
12
+ - Compiler: mingw
13
+ Build: static
14
+ - Compiler: mingw
15
+ Build: shared
16
16
 
17
17
  cache:
18
18
  - C:\Ruby%ruby_version%\lib\ruby\gems
19
+ - C:\mingw64
19
20
 
20
21
  install:
21
22
  - git clone https://github.com/sass/sassc.git
22
23
  - git clone https://github.com/sass/sass-spec.git
23
24
  - set PATH=C:\Ruby%ruby_version%\bin;%PATH%
24
- - set SASS_LIBSASS_PATH=..
25
25
  - ps: |
26
- if(!(gem which minitest 2>$nul)) { gem install minitest }
26
+ if(!(gem which minitest 2>$nul)) { gem install minitest --no-ri --no-rdoc }
27
27
  if ($env:Compiler -eq "mingw" -AND -Not (Test-Path "C:\mingw64")) {
28
28
  # Install MinGW.
29
- $url = "http://sourceforge.net/projects/mingw-w64/files/"
30
- $url += "Toolchains%20targetting%20Win64/Personal%20Builds/"
31
- $url += "mingw-builds/4.9.2/threads-win32/seh/"
32
- $url += "x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z/download"
33
- Invoke-WebRequest -UserAgent wget -Uri $url -OutFile x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z
34
- &7z x -oC:\ x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z > $null
29
+ $file = "x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z"
30
+ $url = "https://bintray.com/artifact/download/drewwells/generic/"
31
+ $url += $file
32
+ Invoke-WebRequest -UserAgent wget -Uri $url -OutFile $file
33
+ &7z x -oC:\ $file > $null
35
34
  }
36
35
  - set PATH=C:\mingw64\bin;%PATH%
37
36
  - set CC=gcc
@@ -41,31 +40,16 @@ build_script:
41
40
  if ($env:Compiler -eq "mingw") {
42
41
  mingw32-make -j4 sassc
43
42
  } else {
44
- msbuild /m:4 /p:Configuration=$env:Config win\libsass.sln
45
- }
46
- - ps: |
47
- if ($env:Compiler -eq "mingw") {
48
- sassc\bin\sassc.exe -v
49
- ruby -v
50
- } else {
51
- if ($env:Config -eq "Debug") {
52
- win\bin\Debug\sassc.exe -v
53
- ruby -v
54
- } else {
55
- win\bin\sassc.exe -v
56
- ruby -v
57
- }
43
+ msbuild /m:4 /p:Configuration=$env:Config sassc\win\sassc.sln
58
44
  }
59
45
 
46
+ # print the branding art
47
+ mv script/branding script/branding.ps1
48
+ script/branding.ps1
49
+
50
+ # print the version info
51
+ &$env:TargetPath -v
52
+ ruby -v
53
+
60
54
  test_script:
61
- - ps: |
62
- if ($env:Compiler -eq "mingw") {
63
- ruby sass-spec\sass-spec.rb -c sassc\bin\sassc.exe -s --ignore-todo sass-spec/spec
64
- } else {
65
- if ($env:Config -eq "Debug") {
66
- echo "test runner in debug mode build via msvc will throw debug assertions"
67
- echo ruby sass-spec\sass-spec.rb -c win\bin\Debug\sassc.exe -s --ignore-todo sass-spec/spec
68
- } else {
69
- ruby sass-spec\sass-spec.rb -c win\bin\sassc.exe -s --ignore-todo sass-spec/spec
70
- }
71
- }
55
+ - ps: ruby sass-spec/sass-spec.rb -c $env:TargetPath -s --ignore-todo sass-spec/spec
@@ -4,19 +4,32 @@
4
4
  AC_PREREQ([2.61])
5
5
 
6
6
  AC_INIT([libsass], m4_esyscmd_s([./version.sh]), [support@moovweb.com])
7
- AC_CONFIG_SRCDIR([ast.hpp])
7
+ AC_CONFIG_SRCDIR([src/ast.hpp])
8
8
  AC_CONFIG_MACRO_DIR([m4])
9
- AC_CONFIG_HEADERS([config.h])
10
- AC_CONFIG_FILES([sass_version.h])
9
+ AC_CONFIG_HEADERS([src/config.h])
10
+ AC_CONFIG_FILES([include/sass/version.h])
11
11
  AC_CONFIG_AUX_DIR([script])
12
12
  # These are flags passed to automake
13
13
  # Though they look like gcc flags!
14
14
  AM_INIT_AUTOMAKE([foreign parallel-tests -Wall])
15
15
  m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
16
+ # would fail with mingw otherwise
17
+ # m4_pattern_allow([AM_PROG_AR])
16
18
 
17
19
  # Checks for programs.
20
+ AC_PROG_CC
18
21
  AC_PROG_CXX
19
- AC_LANG([C++])
22
+ AC_LANG_PUSH([C])
23
+ AC_LANG_PUSH([C++])
24
+ AC_GNU_SOURCE
25
+ # Check fails on Travis, but it works fine
26
+ # AX_CXX_COMPILE_STDCXX_11([ext],[optional])
27
+ AC_CHECK_TOOL([AR], [ar], [false])
28
+ if test "x$is_mingw32" != "xyes"; then
29
+ AC_CHECK_TOOL([DLLTOOL], [dlltool], [false])
30
+ AC_CHECK_TOOL([DLLWRAP], [dllwrap], [false])
31
+ AC_CHECK_TOOL([WINDRES], [windres], [false])
32
+ fi
20
33
  LT_INIT([dlopen])
21
34
 
22
35
  # Checks for header files.
@@ -33,7 +46,7 @@ AC_CHECK_FUNCS([floor getcwd strtol])
33
46
  AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [enable testing the build]),
34
47
  [enable_tests="$enableval"], [enable_tests=no])
35
48
 
36
- AS_CASE([$host], [*-*-mingw32], [is_mingw32=yes], [is_mingw32=no])
49
+ AS_CASE([$target], [*-*-mingw32], [is_mingw32=yes], [is_mingw32=no])
37
50
  AM_CONDITIONAL(COMPILER_IS_MINGW32, test "x$is_mingw32" = "xyes")
38
51
 
39
52
  dnl The dlopen() function is in the C library for *BSD and in
@@ -86,7 +99,7 @@ the --with-sass-spec-dir=<dir> argument.
86
99
 
87
100
  # TODO: Remove this when automake requirements are 1.12+
88
101
  AC_MSG_CHECKING([whether we can use TAP mode])
89
- tmp=`$AWK '/TEST_LOG_DRIVER/' $srcdir/Makefile.in`
102
+ tmp=`$AWK '/TEST_LOG_DRIVER/' $srcdir/GNUmakefile.in`
90
103
  if test "x$tmp" != "x"; then
91
104
  use_tap=yes
92
105
  else
@@ -124,5 +137,5 @@ AC_SUBST(PACKAGE_VERSION)
124
137
 
125
138
  AC_MSG_NOTICE([Building libsass ($VERSION)])
126
139
 
127
- AC_CONFIG_FILES([Makefile support/libsass.pc])
140
+ AC_CONFIG_FILES([GNUmakefile src/GNUmakefile src/support/libsass.pc])
128
141
  AC_OUTPUT
@@ -1,7 +1,7 @@
1
1
  #include <cstring>
2
2
  #include <iostream>
3
3
  #include <stdint.h>
4
- #include "sass_values.h"
4
+ #include <sass.h>
5
5
 
6
6
  // gcc: g++ -shared plugin.cpp -o plugin.so -fPIC -Llib -lsass
7
7
  // mingw: g++ -shared plugin.cpp -o plugin.dll -Llib -lsass
@@ -0,0 +1,15 @@
1
+ #ifndef SASS_H
2
+ #define SASS_H
3
+
4
+ // #define DEBUG 1
5
+
6
+ // include API headers
7
+ #include <sass/base.h>
8
+ #include <sass/version.h>
9
+ #include <sass/values.h>
10
+ #include <sass/functions.h>
11
+ #include <sass/context.h>
12
+ #include <sass2scss.h>
13
+
14
+ #endif
15
+
@@ -1,5 +1,18 @@
1
- #ifndef SASS_H
2
- #define SASS_H
1
+ #ifndef SASS_BASE_H
2
+ #define SASS_BASE_H
3
+
4
+ #ifdef _MSC_VER
5
+ #pragma warning(disable : 4503)
6
+ #ifndef _SCL_SECURE_NO_WARNINGS
7
+ #define _SCL_SECURE_NO_WARNINGS
8
+ #endif
9
+ #ifndef _CRT_SECURE_NO_WARNINGS
10
+ #define _CRT_SECURE_NO_WARNINGS
11
+ #endif
12
+ #ifndef _CRT_NONSTDC_NO_DEPRECATE
13
+ #define _CRT_NONSTDC_NO_DEPRECATE
14
+ #endif
15
+ #endif
3
16
 
4
17
  #include <stddef.h>
5
18
  #include <stdbool.h>
@@ -18,10 +31,10 @@
18
31
  /* You should define ADD_EXPORTS *only* when building the DLL. */
19
32
  #ifdef ADD_EXPORTS
20
33
  #define ADDAPI __declspec(dllexport)
21
- #define ADDCALL __cdecl
34
+ #define ADDCALL __cdecl
22
35
  #else
23
36
  #define ADDAPI
24
- #define ADDCALL
37
+ #define ADDCALL
25
38
  #endif
26
39
 
27
40
  #else /* _WIN32 not defined. */
@@ -32,11 +45,6 @@
32
45
 
33
46
  #endif
34
47
 
35
- // include API headers
36
- #include "sass_version.h"
37
- #include "sass_values.h"
38
- #include "sass_functions.h"
39
-
40
48
  /* Make sure functions are exported with C linkage under C++ compilers. */
41
49
  #ifdef __cplusplus
42
50
  extern "C" {
@@ -3,7 +3,9 @@
3
3
 
4
4
  #include <stddef.h>
5
5
  #include <stdbool.h>
6
- #include "sass.h"
6
+ #include <sass/base.h>
7
+ #include <sass/values.h>
8
+ #include <sass/functions.h>
7
9
 
8
10
  #ifdef __cplusplus
9
11
  extern "C" {
@@ -3,7 +3,7 @@
3
3
 
4
4
  #include <stddef.h>
5
5
  #include <stdbool.h>
6
- #include "sass.h"
6
+ #include <sass/base.h>
7
7
 
8
8
  #ifdef __cplusplus
9
9
  extern "C" {
@@ -57,7 +57,7 @@ ADDAPI void ADDCALL sass_delete_importer (Sass_Importer_Entry cb);
57
57
  ADDAPI Sass_Import_List ADDCALL sass_make_import_list (size_t length);
58
58
  // Creator for a single import entry returned by the custom importer inside the list
59
59
  ADDAPI Sass_Import_Entry ADDCALL sass_make_import_entry (const char* path, char* source, char* srcmap);
60
- ADDAPI Sass_Import_Entry ADDCALL sass_make_import (const char* path, const char* base, char* source, char* srcmap);
60
+ ADDAPI Sass_Import_Entry ADDCALL sass_make_import (const char* imp_path, const char* abs_base, char* source, char* srcmap);
61
61
  // set error message to abort import and to print out a message (path from existing object is used in output)
62
62
  ADDAPI Sass_Import_Entry ADDCALL sass_import_set_error(Sass_Import_Entry import, const char* message, size_t line, size_t col);
63
63
 
@@ -67,8 +67,8 @@ ADDAPI void ADDCALL sass_import_set_list_entry (Sass_Import_List list, size_t id
67
67
  ADDAPI Sass_Import_Entry ADDCALL sass_import_get_list_entry (Sass_Import_List list, size_t idx);
68
68
 
69
69
  // Getters for import entry
70
- ADDAPI const char* ADDCALL sass_import_get_path (Sass_Import_Entry);
71
- ADDAPI const char* ADDCALL sass_import_get_base (Sass_Import_Entry);
70
+ ADDAPI const char* ADDCALL sass_import_get_imp_path (Sass_Import_Entry);
71
+ ADDAPI const char* ADDCALL sass_import_get_abs_path (Sass_Import_Entry);
72
72
  ADDAPI const char* ADDCALL sass_import_get_source (Sass_Import_Entry);
73
73
  ADDAPI const char* ADDCALL sass_import_get_srcmap (Sass_Import_Entry);
74
74
  // Explicit functions to take ownership of these items
@@ -1,9 +1,12 @@
1
1
  #ifndef SASS_C_INTERFACE_H
2
2
  #define SASS_C_INTERFACE_H
3
3
 
4
+ // the API in this header has been deprecated
5
+ // please use the new API from sass/context.h
6
+
4
7
  #include <stddef.h>
5
8
  #include <stdbool.h>
6
- #include "sass.h"
9
+ #include <sass/base.h>
7
10
 
8
11
  #ifdef __cplusplus
9
12
  extern "C" {
@@ -47,7 +50,7 @@ struct sass_options {
47
50
  struct sass_context {
48
51
  const char* input_path;
49
52
  const char* output_path;
50
- const char* source_string;
53
+ char* source_string;
51
54
  char* output_string;
52
55
  char* source_map_string;
53
56
  struct sass_options options;
@@ -3,7 +3,7 @@
3
3
 
4
4
  #include <stddef.h>
5
5
  #include <stdbool.h>
6
- #include "sass.h"
6
+ #include <sass/base.h>
7
7
 
8
8
  #ifdef __cplusplus
9
9
  extern "C" {
@@ -32,6 +32,14 @@ enum Sass_Separator {
32
32
  SASS_SPACE
33
33
  };
34
34
 
35
+ // Value Operators
36
+ enum Sass_OP {
37
+ AND, OR, // logical connectives
38
+ EQ, NEQ, GT, GTE, LT, LTE, // arithmetic relations
39
+ ADD, SUB, MUL, DIV, MOD, // arithmetic functions
40
+ NUM_OPS // so we know how big to make the op table
41
+ };
42
+
35
43
  // Return the sass tag for a generic sass value
36
44
  // Check is needed before accessing specific values!
37
45
  ADDAPI enum Sass_Tag ADDCALL sass_value_get_tag (const union Sass_Value* v);
@@ -119,6 +127,12 @@ ADDAPI void ADDCALL sass_delete_value (union Sass_Value* val);
119
127
  // Make a deep cloned copy of the given sass value
120
128
  ADDAPI union Sass_Value* ADDCALL sass_clone_value (const union Sass_Value* val);
121
129
 
130
+ // Stringify a Sass_Values and also return the result as a Sass_Value (of type STRING)
131
+ ADDAPI union Sass_Value* ADDCALL sass_value_stringify (const union Sass_Value* a, bool compressed, int precision);
132
+
133
+ // Execute an operation for two Sass_Values and return the result as a Sass_Value too
134
+ ADDAPI union Sass_Value* ADDCALL sass_value_op (enum Sass_OP op, const union Sass_Value* a, const union Sass_Value* b);
135
+
122
136
 
123
137
  #ifdef __cplusplus
124
138
  } // __cplusplus defined.