Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 8f6f4c4

Browse files
committed
Merge branch 'master' of git://github.com/hcatlin/libsass into python
2 parents 549c811 + 952868e commit 8f6f4c4

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace Sass {
5656
function_env(map<string, Function>()),
5757
extensions(multimap<Node, Node>()),
5858
pending_extensions(vector<pair<Node, Node> >()),
59-
source_refs(vector<char*>()),
59+
source_refs(vector<const char*>()),
6060
include_paths(vector<string>()),
6161
color_names_to_values(map<string, Node>()),
6262
color_values_to_names(map<Node, string>()),

context.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Sass {
2323
map<string, Function> function_env;
2424
multimap<Node, Node> extensions;
2525
vector<pair<Node, Node> > pending_extensions;
26-
vector<char*> source_refs; // all the source c-strings
26+
vector<const char*> source_refs; // all the source c-strings
2727
vector<string> include_paths;
2828
map<string, Node> color_names_to_values;
2929
map<Node, string> color_values_to_names;

document.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace Sass {
8787
return doc;
8888
}
8989

90-
Document Document::make_from_source_chars(Context& ctx, char* src, string path, bool own_source)
90+
Document Document::make_from_source_chars(Context& ctx, const char* src, string path, bool own_source)
9191
{
9292
Document doc(ctx);
9393
doc.path = path;
@@ -111,7 +111,7 @@ namespace Sass {
111111
doc.root = ctx.new_Node(Node::root, path, 1, 0);
112112
doc.lexed = Token::make();
113113
doc.own_source = false;
114-
doc.source = const_cast<char*>(t.begin);
114+
doc.source = t.begin;
115115
doc.end = t.end;
116116
doc.position = doc.source;
117117

document.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace Sass {
2929
enum CSS_Style { nested, expanded, compact, compressed, echo };
3030

3131
string path;
32-
char* source;
32+
const char* source;
3333
const char* position;
3434
const char* end;
3535
size_t line;
@@ -48,7 +48,7 @@ namespace Sass {
4848
~Document();
4949

5050
static Document make_from_file(Context& ctx, string path);
51-
static Document make_from_source_chars(Context& ctx, char* src, string path = "", bool own_source = false);
51+
static Document make_from_source_chars(Context& ctx, const char* src, string path = "", bool own_source = false);
5252
static Document make_from_token(Context& ctx, Token t, string path = "", size_t line_number = 1);
5353

5454
template <prelexer mx>
@@ -183,4 +183,4 @@ namespace Sass {
183183
string emit_css(CSS_Style style);
184184

185185
};
186-
}
186+
}

document_parser.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,10 @@ namespace Sass {
454454
pseudo << context.new_Node(Node::value, path, line, lexed);
455455
}
456456
else if (peek< binomial >(position)) {
457-
lex< coefficient >();
458-
pseudo << context.new_Node(Node::value, path, line, lexed);
457+
if (peek< coefficient >()) {
458+
lex< coefficient >();
459+
pseudo << context.new_Node(Node::value, path, line, lexed);
460+
}
459461
lex< exactly<'n'> >();
460462
pseudo << context.new_Node(Node::value, path, line, lexed);
461463
lex< sign >();

sass_interface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct sass_options {
1616
};
1717

1818
struct sass_context {
19-
char* source_string;
19+
const char* source_string;
2020
char* output_string;
2121
struct sass_options options;
2222
int error_status;
@@ -53,4 +53,4 @@ int sass_compile_folder (struct sass_folder_context* ctx);
5353

5454
#ifdef __cplusplus
5555
}
56-
#endif
56+
#endif

0 commit comments

Comments
 (0)