Skip to content

Commit 1c35cbc

Browse files
committed
[WIP] [DNM] Backport dart sass parser and more
1 parent 2853424 commit 1c35cbc

File tree

110 files changed

+3038
-2546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+3038
-2546
lines changed

.travis.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,44 @@ sudo: required
2020

2121
matrix:
2222
include :
23+
- os: linux
24+
compiler: gcc
25+
env: AUTOTOOLS=no COVERAGE=yes BUILD=static
26+
- os: linux
27+
compiler: g++-5
28+
env: AUTOTOOLS=yes COVERAGE=no BUILD=shared
29+
addons:
30+
apt:
31+
sources:
32+
- ubuntu-toolchain-r-test
33+
packages:
34+
- g++-5
35+
- os: linux
36+
compiler: g++-8
37+
env: AUTOTOOLS=yes COVERAGE=no BUILD=shared
38+
addons:
39+
apt:
40+
sources:
41+
- ubuntu-toolchain-r-test
42+
packages:
43+
- g++-8
2344
- os: linux
2445
compiler: clang
2546
# This build runs with ASan and we set `detect_odr_violation=0`
2647
# to work around https://bugs.llvm.org/show_bug.cgi?id=37545.
2748
env: AUTOTOOLS=no COVERAGE=no BUILD=static ASAN_OPTIONS=detect_odr_violation=0
49+
- os: linux
50+
compiler: clang
51+
env: AUTOTOOLS=yes COVERAGE=no BUILD=shared
52+
- os: osx
53+
compiler: clang
54+
env: AUTOTOOLS=no COVERAGE=no BUILD=shared
55+
- os: osx
56+
compiler: clang
57+
env: AUTOTOOLS=no COVERAGE=no BUILD=static
58+
- os: osx
59+
compiler: clang
60+
env: AUTOTOOLS=yes COVERAGE=no BUILD=shared
2861

2962
script:
3063
- ./script/ci-build-libsass

Makefile.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ HPPFILES = \
88
ast.hpp \
99
ast2c.hpp \
1010
ast_css.hpp \
11+
ast_base.hpp \
1112
ast_def_macros.hpp \
1213
ast_fwd_decl.hpp \
1314
ast_helpers.hpp \
1415
ast_selectors.hpp \
16+
ast_containers.hpp \
1517
ast_supports.hpp \
1618
ast_values.hpp \
1719
backtrace.hpp \
@@ -176,7 +178,6 @@ SOURCES = \
176178
source_state.cpp \
177179
source_span.cpp \
178180
error_handling.cpp \
179-
MurmurHash2.cpp \
180181
memory/allocator.cpp \
181182
memory/shared_ptr.cpp \
182183
LUrlParser/LUrlParser.cpp \

appveyor.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
os: Visual Studio 2015
2+
3+
environment:
4+
CTEST_OUTPUT_ON_FAILURE: 1
5+
ruby_version: 24-x64
6+
TargetPath: sassc/bin/sassc.exe
7+
matrix:
8+
- Compiler: msvc
9+
Config: Release
10+
Platform: Win32
11+
- Compiler: msvc
12+
Config: Debug
13+
Platform: Win32
14+
- Compiler: msvc
15+
Config: Release
16+
Platform: Win64
17+
- Compiler: mingw
18+
Build: static
19+
- Compiler: mingw
20+
Build: shared
21+
22+
cache:
23+
- C:\Ruby%ruby_version%\lib\ruby\gems
24+
- C:\mingw64
25+
26+
# Uncomment to debug hanging builds via RDP, password can be found/set under Environment-Variables in appveyor settings!
27+
#
28+
# init:
29+
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
30+
#
31+
# on_finish:
32+
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
33+
34+
install:
35+
- git clone https://github.com/sass/sassc.git
36+
- git clone https://github.com/mgreter/sass-spec.git --branch feature/libsass-parser-backport
37+
- set PATH=C:\Ruby%ruby_version%\bin;%PATH%
38+
- ps: |
39+
if(!(gem which minitest 2>$nul)) { gem install minitest --no-ri --no-rdoc }
40+
if(!(gem which hrx 2>$nul)) { gem install hrx --no-ri --no-rdoc }
41+
if ($env:Compiler -eq "mingw" -AND -Not (Test-Path "C:\mingw64")) {
42+
# Install MinGW.
43+
$file = "x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z"
44+
wget https://bintray.com/artifact/download/drewwells/generic/$file -OutFile $file
45+
&7z x -oC:\ $file > $null
46+
}
47+
- set PATH=C:\mingw64\bin;%PATH%
48+
- set CC=gcc
49+
50+
build_script:
51+
- ps: |
52+
if ($env:Compiler -eq "mingw") {
53+
mingw32-make -j4 sassc
54+
} else {
55+
msbuild /m:4 /p:"Configuration=$env:Config;Platform=$env:Platform" sassc\win\sassc.sln
56+
}
57+
58+
# print the branding art
59+
mv script/branding script/branding.ps1
60+
script/branding.ps1
61+
62+
# print the version info
63+
&$env:TargetPath -v
64+
ruby -v
65+
66+
test_script:
67+
- ps: |
68+
$PRNR = $env:APPVEYOR_PULL_REQUEST_NUMBER
69+
$env:TargetPath = Join-Path $pwd.Path $env:TargetPath
70+
If (Test-Path "$env:TargetPath") {
71+
ruby sass-spec/sass-spec.rb --probe-todo --impl libsass -c $env:TargetPath -s sass-spec/spec
72+
if(-not($?)) {
73+
echo "sass-spec tests failed"
74+
exit 1
75+
}
76+
} else {
77+
echo "spec runner not found (compile error?)"
78+
exit 1
79+
}
80+
Write-Host "Explicitly testing the case when cwd has Unicode characters: " -nonewline
81+
# See comments in gh-1774 for details.
82+
cd test/e2e/unicode-pwd/Sáss-UŢF8/
83+
&$env:TargetPath ./input.scss 2>&1>$null
84+
if(-not($?)) {
85+
echo "Failed!"
86+
exit 1
87+
} else {
88+
echo "Success!"
89+
}

include/sass/base.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ enum Sass_Output_Style {
6868
SASS_STYLE_COMPRESSED,
6969
// only used internaly
7070
SASS_STYLE_INSPECT,
71-
SASS_STYLE_TO_SASS,
7271
SASS_STYLE_TO_CSS
7372
};
7473

script/ci-build-libsass

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,28 +107,42 @@ if [ "$CONTINUOUS_INTEGRATION" == "true" ] && [ "$TRAVIS_PULL_REQUEST" != "false
107107
([ "$TRAVIS_OS_NAME" == "linux" ] || [ "$TRAVIS_OS_NAME" == "osx" ] || [ "$TRAVIS_OS_NAME" == "cygwin" ]);
108108
then
109109

110-
echo "Fetching PR $TRAVIS_PULL_REQUEST"
110+
if [ "x$TRAVIS_PULL_REQUEST" != "2918" ]; then
111111

112-
JSON=$(curl -L -sS https://api.github.com/repos/sass/libsass/pulls/$TRAVIS_PULL_REQUEST)
112+
echo "Checking out refactoring branch"
113+
cd sass-spec
114+
if ! git config remote.mgreter.url > /dev/null; then
115+
git remote add mgreter https://github.com/mgreter/sass-spec.git -f
116+
git checkout -b refactoring mgreter/feature/libsass-parser-backport
117+
fi
118+
cd ..
119+
make $MAKE_OPTS test_probe
113120

114-
if [[ $JSON =~ "API rate limit exceeded" ]];
115-
then
116-
echo "Travis rate limit on github exceeded"
117-
echo "Retrying via 'special purpose proxy'"
118-
JSON=$(curl -L -sS https://github-api-reverse-proxy.herokuapp.com/repos/sass/libsass/pulls/$TRAVIS_PULL_REQUEST)
119-
fi
121+
else
120122

121-
RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
123+
echo "Fetching PR $TRAVIS_PULL_REQUEST"
122124

123-
if [[ $JSON =~ $RE_SPEC_PR ]];
124-
then
125-
SPEC_PR="${BASH_REMATCH[2]}"
126-
echo "Fetching Sass Spec PR $SPEC_PR"
127-
git -C sass-spec fetch -u origin pull/$SPEC_PR/head:ci-spec-pr-$SPEC_PR
128-
git -C sass-spec checkout --force ci-spec-pr-$SPEC_PR
129-
make $MAKE_OPTS test_probe
130-
else
131-
make $MAKE_OPTS test_probe
125+
JSON=$(curl -L -sS https://api.github.com/repos/sass/libsass/pulls/$TRAVIS_PULL_REQUEST)
126+
127+
if [[ $JSON =~ "API rate limit exceeded" ]];
128+
then
129+
echo "Travis rate limit on github exceeded"
130+
echo "Retrying via 'special purpose proxy'"
131+
JSON=$(curl -L -sS https://github-api-reverse-proxy.herokuapp.com/repos/sass/libsass/pulls/$TRAVIS_PULL_REQUEST)
132+
fi
133+
134+
RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
135+
136+
if [[ $JSON =~ $RE_SPEC_PR ]];
137+
then
138+
SPEC_PR="${BASH_REMATCH[2]}"
139+
echo "Fetching Sass Spec PR $SPEC_PR"
140+
git -C sass-spec fetch -u origin pull/$SPEC_PR/head:ci-spec-pr-$SPEC_PR
141+
git -C sass-spec checkout --force ci-spec-pr-$SPEC_PR
142+
make $MAKE_OPTS test_probe
143+
else
144+
make $MAKE_OPTS test_probe
145+
fi
132146
fi
133147
else
134148
make $MAKE_OPTS test_probe

src/MurmurHash2.cpp

Whitespace-only changes.

0 commit comments

Comments
 (0)