Fix bug in attribute value highlighting

Any newlines within strings are now properly catered for.

Fixes #3.
This commit is contained in:
Ben S
2015-11-23 12:56:37 +00:00
parent 2c27300233
commit 012448ebe8
3 changed files with 14 additions and 3 deletions

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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
// ------