Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Commit f2e83a0

Browse files
committed
Merge branch 'upstream/master' into bleeding-edge
2 parents fe5da3f + cd3ee1c commit f2e83a0

Some content is hidden

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

88 files changed

+3348
-1550
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_style = spaces
11+
indent_size = 2
12+
13+
[{Makefile, Makefile.am}]
14+
indent_style = tab
15+
indent_size = 4

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
.sass-cache
55
*.gem
66
.svn/*
7-
.gitattributes
87

98
# Configuration stuff
109

@@ -38,6 +37,7 @@ libsass/*
3837
*.lo
3938
*.a
4039
a.out
40+
libsass.js
4141

4242
bin/*
4343
.deps/
@@ -49,6 +49,10 @@ sassc++
4949
libsass.la
5050
support/libsass.pc
5151

52+
# Cloned testing dirs
53+
sassc/
54+
sass-spec/
55+
5256
# libsass-python
5357
build/
5458
dist/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "sass2scss"]
2+
path = sass2scss
3+
url = https://github.com/mgreter/sass2scss.git

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ include *.cpp
44
include Makefile.am
55
include win32/*.h
66
include test/*.sass
7+
include sass2scss/sass2scss.*
78
include README.rst

Makefile

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CXX = g++
2-
CXXFLAGS = -Wall -O2 -fPIC
1+
CXX ?= g++
2+
CXXFLAGS = -Wall -O2 -fPIC -g
33
LDFLAGS = -fPIC
44

55
PREFIX = /usr/local
@@ -9,10 +9,32 @@ SASS_SASSC_PATH ?= sassc
99
SASS_SPEC_PATH ?= sass-spec
1010
SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
1111

12-
SOURCES = ast.cpp base64vlq.cpp bind.cpp constants.cpp context.cpp contextualize.cpp \
13-
copy_c_str.cpp error_handling.cpp eval.cpp expand.cpp extend.cpp file.cpp \
14-
functions.cpp inspect.cpp output_compressed.cpp output_nested.cpp \
15-
parser.cpp prelexer.cpp sass.cpp sass_interface.cpp source_map.cpp to_c.cpp to_string.cpp \
12+
SOURCES = \
13+
ast.cpp \
14+
base64vlq.cpp \
15+
bind.cpp \
16+
constants.cpp \
17+
context.cpp \
18+
contextualize.cpp \
19+
copy_c_str.cpp \
20+
emscripten_wrapper.cpp \
21+
error_handling.cpp \
22+
eval.cpp \
23+
expand.cpp \
24+
extend.cpp \
25+
file.cpp \
26+
functions.cpp \
27+
inspect.cpp \
28+
output_compressed.cpp \
29+
output_nested.cpp \
30+
parser.cpp \
31+
prelexer.cpp \
32+
sass.cpp \
33+
sass_interface.cpp \
34+
sass2scss/sass2scss.cpp \
35+
source_map.cpp \
36+
to_c.cpp \
37+
to_string.cpp \
1638
units.cpp
1739

1840
OBJECTS = $(SOURCES:.cpp=.o)
@@ -22,8 +44,11 @@ all: static
2244
static: libsass.a
2345
shared: libsass.so
2446

47+
js: static
48+
emcc -O2 libsass.a -o libsass.js -s EXPORTED_FUNCTIONS="['_sass_compile_emscripten']" -s DISABLE_EXCEPTION_CATCHING=0
49+
2550
libsass.a: $(OBJECTS)
26-
ar rvs $@ $(OBJECTS)
51+
$(AR) rvs $@ $(OBJECTS)
2752

2853
libsass.so: $(OBJECTS)
2954
$(CXX) -shared $(LDFLAGS) -o $@ $(OBJECTS)
@@ -43,13 +68,13 @@ install-shared: libsass.so
4368
$(SASSC_BIN): libsass.a
4469
cd $(SASS_SASSC_PATH) && make
4570

46-
test: $(SASSC_BIN) libsass.a
71+
test: $(SASSC_BIN) libsass.a
4772
ruby $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s $(LOG_FLAGS) $(SASS_SPEC_PATH)
4873

49-
test_build: $(SASSC_BIN) libsass.a
74+
test_build: $(SASSC_BIN) libsass.a
5075
ruby $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)
5176

52-
test_issues: $(SASSC_BIN) libsass.a
77+
test_issues: $(SASSC_BIN) libsass.a
5378
ruby $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues
5479

5580
clean:

Makefile.am

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,37 @@ pkgconfigdir = $(libdir)/pkgconfig
44
pkgconfig_DATA = support/libsass.pc
55

66
lib_LTLIBRARIES = libsass.la
7-
libsass_la_SOURCES = ast.cpp base64vlq.cpp bind.cpp constants.cpp context.cpp contextualize.cpp \
8-
copy_c_str.cpp error_handling.cpp eval.cpp expand.cpp extend.cpp file.cpp \
9-
functions.cpp inspect.cpp output_compressed.cpp output_nested.cpp \
10-
parser.cpp prelexer.cpp sass.cpp sass_interface.cpp source_map.cpp to_c.cpp to_string.cpp \
11-
units.cpp
7+
libsass_la_SOURCES = \
8+
ast.cpp \
9+
base64vlq.cpp \
10+
bind.cpp \
11+
constants.cpp \
12+
context.cpp \
13+
contextualize.cpp \
14+
copy_c_str.cpp \
15+
emscripten_wrapper.cpp \
16+
error_handling.cpp \
17+
eval.cpp \
18+
expand.cpp \
19+
extend.cpp \
20+
file.cpp \
21+
functions.cpp \
22+
inspect.cpp \
23+
output_compressed.cpp \
24+
output_nested.cpp \
25+
parser.cpp \
26+
prelexer.cpp \
27+
sass.cpp \
28+
sass_interface.cpp \
29+
source_map.cpp \
30+
to_c.cpp \
31+
to_string.cpp \
32+
units.cpp
33+
1234
libsass_la_LDFLAGS = -no-undefined -version-info 0:0:0
1335

1436
include_HEADERS = sass_interface.h sass.h
1537

16-
check_PROGRAMS = sassc++
17-
18-
sassc___SOURCES = sassc++.cpp
19-
sassc___LDADD = libsass.la
20-
2138
if ENABLE_TESTS
2239

2340
noinst_PROGRAMS = sass-tester

Readme.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
Libsass
22
=======
33

4-
by Aaron Leung and Hampton Catlin (@hcatlin)
4+
by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin])
55

66
[![Build Status](https://travis-ci.org/hcatlin/libsass.png?branch=master)](https://travis-ci.org/hcatlin/libsass)
77

88
http://github.com/hcatlin/libsass
99

1010
Libsass is just a library, but if you want to RUN libsass,
1111
then go to http://github.com/hcatlin/sassc or
12-
http://github.com/hcatlin/sassruby or find your local
13-
implementer.
12+
http://github.com/hcatlin/sassruby or
13+
[find your local implementer](https://github.com/hcatlin/libsass/wiki/Implementations).
1414

1515
About
1616
-----
@@ -22,10 +22,10 @@ This library strives to be light, simple, and easy to build and integrate with a
2222
Developing
2323
----------
2424

25-
As you may have noticed, the libsass repo itself has
25+
As you may have noticed, the libsass repo itself has
2626
no executables and no tests. Oh noes! How can you develop???
2727

28-
Well, luckily, SassC is the official binary wrapper for
28+
Well, luckily, SassC is the official binary wrapper for
2929
libsass and is *always* kept in sync. SassC uses a git submodule
3030
to include libsass. When developing libsass, its best to actually
3131
check out SassC and develop in that directory with the SassC spec
@@ -38,15 +38,7 @@ Tests
3838

3939
Since libsass is a pure library, tests are run through the [SassSpec](http://github.com/hcatlin/sass-spec) project using the [SassC](http://github.com/hcatlin/sassc) driver.
4040

41-
To run tests against libsass while developing, please ensure you have the latest version of the above projects cloned, and then define the following environment variables:
42-
43-
export SASS_SPEC_PATH=~/path/sass-spec
44-
export SASS_SASSC_PATH=~/path/sassc
45-
export SASS_LIBSASS_PATH=~/path/libsass
46-
47-
Obviously, update them to your local environment. Then, its just a matter of running...
48-
49-
make test
41+
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.
5042

5143
Usage
5244
-----
@@ -56,19 +48,21 @@ C interface that is defined in [sass_interface.h]. Its usage is pretty
5648
straight forward.
5749

5850
First, you create a sass context struct. We use these objects to define
59-
different execution parameters for the library. There are three
60-
different context types.
51+
different execution parameters for the library. There are three
52+
different context types.
6153

62-
sass_context // string-in-string-out compilation
63-
sass_file_context // file-based compilation
64-
sass_folder_context // full-folder multi-file
54+
```c
55+
sass_context(); // string-in-string-out compilation
56+
sass_file_context(); // file-based compilation
57+
sass_folder_context(); // full-folder multi-file
58+
```
6559

6660
Each of the contexts have slightly different behavior and are
6761
implemented seperately. This does add extra work to implementing
6862
a wrapper library, but we felt that a mixed-use context object
6963
provides for too much implicit logic. What if you set "input_string"
7064
AND "input_file"... what do we do? This would introduce bugs into
71-
wrapper libraries that would be difficult to debug.
65+
wrapper libraries that would be difficult to debug.
7266

7367
We anticipate that most adapters in most languages will define
7468
their own logic for how to separate these use cases based on the
@@ -77,37 +71,44 @@ interface, but is backed by three different processes.
7771

7872
To generate a context, use one of the following methods.
7973

80-
sass_new_context()
81-
sass_new_file_context()
82-
sass_new_folder_context()
74+
```c
75+
sass_new_context();
76+
sass_new_file_context();
77+
sass_new_folder_context();
78+
```
8379

84-
Again, please see the sass_interface.h for more information.
80+
Again, please see the [sass_interface.h] for more information.
8581

8682
And, to get even more information, then please see the implementations
8783
in SassC and SassC-Ruby.
8884

8985
About Sass
9086
----------
9187

92-
Sass is a CSS pre-processor language to add on exciting, new,
88+
Sass is a CSS pre-processor language to add on exciting, new,
9389
awesome features to CSS. Sass was the first language of its kind
9490
and by far the most mature and up to date codebase.
9591

96-
Sass was originally created by the co-creator of this library,
97-
Hampton Catlin (@hcatlin). The extension and continuing evolution
92+
Sass was originally created by the co-creator of this library,
93+
Hampton Catlin ([@hcatlin]). The extension and continuing evolution
9894
of the language has all been the result of years of work by Nathan
99-
Weizenbaum (@nex3) and Chris Eppstein (@chriseppstein).
95+
Weizenbaum ([@nex3]) and Chris Eppstein ([@chriseppstein]).
10096

10197
For more information about Sass itself, please visit http://sass-lang.com
10298

10399
Contribution Agreement
104100
----------------------
105101

106102
Any contribution to the project are seen as copyright assigned to Hampton Catlin, a
107-
human on the planet earth. Your contribution warrants that you have the right to
103+
human on the planet earth. Your contribution warrants that you have the right to
108104
assign copyright on your work. The intention here is to ensure that the project
109-
remains totally free (liberal, like).
105+
remains totally free (liberal, like).
110106

111107
Our MIT license is designed to be as simple, and liberal as possible.
112108

109+
[@hcatlin]: http://github.com/hcatlin
110+
[@akhleung]: http://github.com/akhleung
111+
[@chriseppstein]: http://github.com/chriseppstein
112+
[@nex3]: http://github.com/nex3
113113

114+
[sass_interface.h]: sass_interface.h

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy