Skip to content

Commit 1dea8b9

Browse files
committed
Squashed 'libsass_src/' changes from f6afdbb9..7037f03f
7037f03f Merge pull request #3184 from mgreter/bugfix/x-mas-2023 5bb0ea0c Fix most urgent issues in 2023 2102188d Merge pull request #3176 from LilyWangLL/vcpkg-instructions f0605a31 Add vcpkg installation instructions 006bbf5c docs: Fix a few typos (#3172) b035bc3f Merge pull request #3169 from Taritsyn/master 0161a9f2 Add support of Visual Studio 2022 to the Visual C++ project file da91d985 Remove references to libsass.org (#3160) d593a6b1 Create libsass.spec 2f383929 Remove slack invite link from readme git-subtree-dir: libsass_src git-subtree-split: 7037f03fabeb2b18b5efa84403f5a6d7a990f460
1 parent e882218 commit 1dea8b9

15 files changed

+57
-32
lines changed

libsass_src/Readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Originally created by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin])
1010
[![Percentage of issues still open](http://isitmaintained.com/badge/open/sass/libsass.svg)](http://isitmaintained.com/project/sass/libsass "Percentage of issues still open")
1111
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/sass/libsass.svg)](http://isitmaintained.com/project/sass/libsass "Average time to resolve an issue")
1212
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=283068)](https://www.bountysource.com/trackers/283068-libsass?utm_source=283068&utm_medium=shield&utm_campaign=TRACKER_BADGE "Bountysource")
13-
[![Join us](https://libsass-slack.herokuapp.com/badge.svg)](https://libsass-slack.herokuapp.com/ "Slack communication channels")
1413

1514
**Warning:** [LibSass is deprecated](https://sass-lang.com/blog/libsass-is-deprecated).
1615
While it will continue to receive maintenance releases indefinitely, there are no

libsass_src/contrib/libsass.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Release: 1%{?dist}
44
Summary: A C/C++ implementation of a Sass compiler
55

66
License: MIT
7-
URL: http://libsass.org
7+
URL: https://sass-lang.com/
88
Source0: %{name}-%{version}.tar.gz
99

1010
BuildRequires: gcc-c++ >= 4.7

libsass_src/docs/build-on-gentoo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ EAPI=4
77
inherit eutils git-2 autotools
88

99
DESCRIPTION="A C/C++ implementation of a Sass compiler."
10-
HOMEPAGE="http://libsass.org/"
10+
HOMEPAGE="https://sass-lang.com/"
1111
EGIT_PROJECT='libsass'
1212
EGIT_REPO_URI="https://github.com/sass/libsass.git"
1313
LICENSE="MIT"
@@ -38,7 +38,7 @@ EAPI=4
3838
inherit eutils git-2 autotools
3939

4040
DESCRIPTION="Command Line Tool for LibSass."
41-
HOMEPAGE="http://libsass.org/"
41+
HOMEPAGE="https://sass-lang.com/"
4242
EGIT_PROJECT='sassc'
4343
EGIT_REPO_URI="https://github.com/sass/sassc.git"
4444
LICENSE="MIT"

libsass_src/docs/build.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ Since `libsass` is a library, it makes sense to install it as a shared library o
3333

3434
- [Building shared system library][4]
3535

36+
### Building from vcpkg
37+
38+
The libsass port in [vcpkg][12] is kept up to date by Microsoft team members and community contributors. You can download and install libsass using the vcpkg dependency manager:
39+
40+
```bash
41+
git clone https://github.com/Microsoft/vcpkg.git
42+
cd vcpkg
43+
./bootstrap-vcpkg.sh # ./bootstrap-vcpkg.bat for Windows
44+
./vcpkg integrate install
45+
./vcpkg install libsass
46+
```
47+
48+
If the version is out of date, please [create an issue or pull request][12] on the vcpkg repository.
49+
3650
Compiling with clang instead of gcc
3751
--
3852

@@ -95,3 +109,4 @@ Miscellaneous
95109
[9]: implementations.md
96110
[10]: build-on-darwin.md
97111
[11]: build-with-visual-studio.md
112+
[12]: https://github.com/Microsoft/vcpkg

libsass_src/docs/dev-ast-memory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ define DEBUG_SHARED_PTR
200200
```
201201

202202
This will print lost memory on exit to stderr. You can also use
203-
`setDbg(true)` on sepecific variables to emit reference counter
203+
`setDbg(true)` on specific variables to emit reference counter
204204
increase, decrease and other events.
205205

206206

libsass_src/res/resource.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BEGIN
2222
VALUE "FileDescription", "A C/C++ implementation of a Sass compiler"
2323
VALUE "FileVersion", "1.0.0.0"
2424
VALUE "InternalName", "libsass"
25-
VALUE "LegalCopyright", "\251 2017 libsass.org"
25+
VALUE "LegalCopyright", "\251 2017 sass-lang.org"
2626
VALUE "OriginalFilename", "libsass.dll"
2727
VALUE "ProductName", "LibSass Library"
2828
VALUE "ProductVersion", "1.0.0.0"

libsass_src/src/ast_selectors.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ namespace Sass {
868868
for (SimpleSelectorObj simple : elements()) {
869869
if (PseudoSelector * pseudo = Cast<PseudoSelector>(simple)) {
870870
if (SelectorList* sel = Cast<SelectorList>(pseudo->selector())) {
871-
if (parent) {
871+
if (parent && !parent->has_real_parent_ref()) {
872872
pseudo->selector(sel->resolve_parent_refs(
873873
pstack, traces, implicit_parent));
874874
}
@@ -976,20 +976,22 @@ namespace Sass {
976976
}
977977

978978
/* better return sass::vector? only - is empty container anyway? */
979-
SelectorList* ComplexSelector::resolve_parent_refs(SelectorStack pstack, Backtraces& traces, bool implicit_parent)
979+
SelectorList* ComplexSelector::resolve_parent_refs(
980+
SelectorStack pstack, Backtraces& traces, bool implicit_parent)
980981
{
981982

982983
sass::vector<sass::vector<ComplexSelectorObj>> vars;
983984

984985
auto parent = pstack.back();
986+
auto hasRealParent = has_real_parent_ref();
985987

986-
if (has_real_parent_ref() && !parent) {
988+
if (hasRealParent && !parent) {
987989
throw Exception::TopLevelParent(traces, pstate());
988990
}
989991

990992
if (!chroots() && parent) {
991993

992-
if (!has_real_parent_ref() && !implicit_parent) {
994+
if (!hasRealParent && !implicit_parent) {
993995
SelectorList* retval = SASS_MEMORY_NEW(SelectorList, pstate(), 1);
994996
retval->append(this);
995997
return retval;
@@ -1020,10 +1022,10 @@ namespace Sass {
10201022
for (auto items : res) {
10211023
if (items.size() > 0) {
10221024
ComplexSelectorObj first = SASS_MEMORY_COPY(items[0]);
1023-
first->hasPreLineFeed(first->hasPreLineFeed() || (!has_real_parent_ref() && hasPreLineFeed()));
1025+
first->hasPreLineFeed(first->hasPreLineFeed() || (!hasRealParent && hasPreLineFeed()));
10241026
// ToDo: remove once we know how to handle line feeds
10251027
// ToDo: currently a mashup between ruby and dart sass
1026-
// if (has_real_parent_ref()) first->has_line_feed(false);
1028+
// if (hasRealParent) first->has_line_feed(false);
10271029
// first->has_line_break(first->has_line_break() || has_line_break());
10281030
first->chroots(true); // has been resolved by now
10291031
for (size_t i = 1; i < items.size(); i += 1) {

libsass_src/src/debugger.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ inline void debug_ast(AST_Node* node, sass::string ind, Env* env)
430430
std::cerr << " <<" << selector->ns_name() << ">>";
431431
std::cerr << (selector->isClass() ? " [isClass]": " -");
432432
std::cerr << (selector->isSyntacticClass() ? " [isSyntacticClass]": " -");
433+
std::cerr << (selector->has_real_parent_ref(nullptr) ? " [real parent]" : " -");
433434
std::cerr << std::endl;
434435
debug_ast(selector->argument(), ind + " <= ", env);
435436
debug_ast(selector->selector(), ind + " || ", env);

libsass_src/src/fn_miscs.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,14 @@ namespace Sass {
160160
ExpressionObj cond = ARG("$condition", Expression)->perform(&expand.eval);
161161
bool is_true = !cond->is_false();
162162
ExpressionObj res = ARG(is_true ? "$if-true" : "$if-false", Expression);
163-
ValueObj qwe = Cast<Value>(res->perform(&expand.eval));
164-
// res = res->perform(&expand.eval.val_eval);
165-
qwe->set_delayed(false); // clone?
166-
return qwe.detach();
163+
ExpressionObj rv = res->perform(&expand.eval);
164+
ValueObj value = Cast<Value>(rv);
165+
if (value != nullptr) {
166+
value->set_delayed(false);
167+
return value.detach();
168+
}
169+
rv->set_delayed(false);
170+
return nullptr;
167171
}
168172

169173
//////////////////////////

libsass_src/src/inspect.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ namespace Sass {
463463
{ sep[0] = i % 2 ? ':' : ','; }
464464
ExpressionObj list_item = list->at(i);
465465
if (output_style() != TO_SASS) {
466+
if (list_item == nullptr) continue;
466467
if (list_item->is_invisible()) {
467468
// this fixes an issue with "" in a list
468469
if (!Cast<String_Constant>(list_item)) {
@@ -1088,7 +1089,7 @@ namespace Sass {
10881089

10891090
void Inspect::operator()(CompoundSelector* sel)
10901091
{
1091-
if (sel->hasRealParent()) {
1092+
if (sel->hasRealParent() /* || sel->has_real_parent_ref() */) {
10921093
append_string("&");
10931094
}
10941095
for (auto& item : sel->elements()) {

0 commit comments

Comments
 (0)