Fix bug in attribute value highlighting
Any newlines within strings are now properly catered for. Fixes #3.
This commit is contained in:
@@ -49,7 +49,6 @@
|
||||
name = Rust;
|
||||
productInstallPath = "$(HOME)/Library/Bundles";
|
||||
productName = "Hello World";
|
||||
productReference = B57F6C2519FD60C000FDB959 /* Rust.bblm */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -100,7 +99,7 @@
|
||||
OTHER_CFLAGS = "";
|
||||
PRODUCT_NAME = Rust;
|
||||
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES;
|
||||
SDKROOT = macosx10.10;
|
||||
SDKROOT = macosx;
|
||||
USER_HEADER_SEARCH_PATHS = "/Volumes/BBEdit\\ SDK/Interfaces/Language\\ Modules/";
|
||||
WRAPPER_EXTENSION = bblm;
|
||||
};
|
||||
@@ -117,7 +116,7 @@
|
||||
OTHER_CFLAGS = "";
|
||||
PRODUCT_NAME = Rust;
|
||||
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES;
|
||||
SDKROOT = macosx10.10;
|
||||
SDKROOT = macosx;
|
||||
USER_HEADER_SEARCH_PATHS = "/Volumes/BBEdit\\ SDK/Interfaces/Language\\ Modules/";
|
||||
WRAPPER_EXTENSION = bblm;
|
||||
};
|
||||
|
||||
6
rust.mm
6
rust.mm
@@ -206,6 +206,12 @@ SInt32 skipAttribute(BBLMTextIterator &iter)
|
||||
length++;
|
||||
break;
|
||||
}
|
||||
else if (ch == '"')
|
||||
{
|
||||
// We only want to skip newlines in attributes if they're within a string.
|
||||
iter--;
|
||||
length += skipString(iter);
|
||||
}
|
||||
else if (ch == '\n' || ch == '\r')
|
||||
{
|
||||
break;
|
||||
|
||||
6
smoke.rs
6
smoke.rs
@@ -113,6 +113,12 @@
|
||||
|
||||
#[macro_use] use this_is_not_an_attribute;
|
||||
|
||||
#[unfinished_attribute // not a comment
|
||||
and this should be back to regular code. // back to comments again
|
||||
|
||||
#[unfinished_attribute="but look \ // not a comment
|
||||
a string!"] // back to comments again
|
||||
|
||||
// Macros
|
||||
// ------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user