Skip to content

Commit 366bc11

Browse files
committedDec 17, 2013
Add support for Source Map Revision 3.
The parser has been adjusted to keep track of the current position (line and column) instead of the current line. The position to the start of the token an AST node is generated from, is stored in the node. During code generation we keep track of the current position in the target file. For each node of interest we create a mapping between the position in the source and target file. Finally, a source map following the Source Map Revision 3 specification can be generated for the collected mappings.
·
v2.02.1.0-beta
1 parent 6f86b4b commit 366bc11

37 files changed

+1252
-750
lines changed
 

‎Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ SASS_SASSC_PATH ?= sassc
99
SASS_SPEC_PATH ?= sass-spec
1010
SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
1111

12-
SOURCES = ast.cpp bind.cpp constants.cpp context.cpp contextualize.cpp \
12+
SOURCES = ast.cpp base64vlq.cpp bind.cpp constants.cpp context.cpp contextualize.cpp \
1313
copy_c_str.cpp error_handling.cpp eval.cpp expand.cpp extend.cpp file.cpp \
1414
functions.cpp inspect.cpp output_compressed.cpp output_nested.cpp \
15-
parser.cpp prelexer.cpp sass.cpp sass_interface.cpp to_c.cpp to_string.cpp \
15+
parser.cpp prelexer.cpp sass.cpp sass_interface.cpp source_map.cpp to_c.cpp to_string.cpp \
1616
units.cpp
1717

1818
OBJECTS = $(SOURCES:.cpp=.o)

‎Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ACLOCAL_AMFLAGS = -I m4
22

33
lib_LTLIBRARIES = libsass.la
4-
libsass_la_SOURCES = ast.cpp bind.cpp constants.cpp context.cpp contextualize.cpp \
4+
libsass_la_SOURCES = ast.cpp base64vlq.cpp bind.cpp constants.cpp context.cpp contextualize.cpp \
55
copy_c_str.cpp error_handling.cpp eval.cpp expand.cpp extend.cpp file.cpp \
66
functions.cpp inspect.cpp output_compressed.cpp output_nested.cpp \
7-
parser.cpp prelexer.cpp sass.cpp sass_interface.cpp to_c.cpp to_string.cpp \
7+
parser.cpp prelexer.cpp sass.cpp sass_interface.cpp source_map.cpp to_c.cpp to_string.cpp \
88
units.cpp
99
libsass_la_LDFLAGS = -no-undefined -version-info 0:0:0
1010

‎ast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Sass {
2424
{
2525
if (!tail()) return 0;
2626
if (!head()) return tail()->context(ctx);
27-
return new (ctx.mem) Complex_Selector(path(), line(), combinator(), head(), tail()->context(ctx));
27+
return new (ctx.mem) Complex_Selector(path(), position(), combinator(), head(), tail()->context(ctx));
2828
}
2929

3030
Complex_Selector* Complex_Selector::innermost()

0 commit comments

Comments
 (0)
Please sign in to comment.