Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bc2dac873 | ||
|
|
07b020f253 | ||
|
|
ec10c4bf7f | ||
|
|
e28267063f | ||
|
|
adbf51d973 | ||
|
|
439556cbe4 | ||
|
|
0fe7412e14 | ||
|
|
565243f64b | ||
|
|
46fe844c16 | ||
|
|
bfdc57e356 | ||
|
|
1154b0df63 | ||
|
|
2c05ab8682 |
@@ -7,17 +7,18 @@ This is a BBEdit 11 Language Module for [Rust](http://www.rust-lang.org). It pro
|
||||
|
||||
- Complete syntax highlighting
|
||||
- Special support for lifetimes, attributes, and identifiers
|
||||
- Customisable colours using the [BBEdit 11 colour thing](http://barebones.com/products/bbedit/bbedit11.html)
|
||||
- Customisable colours using the [BBEdit 11 colour editor](http://barebones.com/products/bbedit/bbedit11.html)
|
||||
- Language features
|
||||
- Go to start of/end of/previous/next function
|
||||
- Go to named symbol
|
||||
- Indexed function menu
|
||||
- Code folding
|
||||
|
||||
By default, it highlights anything beginning with a capital letter in a certain colour. To turn this off, just change the Identifier colour to be the same as the default text colour in Preferences.
|
||||
|
||||
### Installation
|
||||
|
||||
The simplest way is to just [download the package](https://github.com/ogham/Rust.bblm/releases/tag/0.2) and put it in this folder:
|
||||
The simplest way is to just [download the package](https://github.com/ogham/Rust.bblm/releases/tag/0.4.0) and put it in this folder:
|
||||
|
||||
~/Application Support/BBEdit/Language Modules
|
||||
|
||||
|
||||
373
info.plist
373
info.plist
@@ -2,178 +2,205 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>me.bsago.bblm.rust</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>BBLM</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>com.barebones.bblminfo</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>BBLMCanGuessLanguage</key>
|
||||
<true/>
|
||||
<key>BBLMColorsSyntax</key>
|
||||
<true/>
|
||||
<key>BBLMDroppedFilePathStyle</key>
|
||||
<string>POSIX</string>
|
||||
<key>BBLMCommentLineDefault</key>
|
||||
<string>// </string>
|
||||
<key>BBLMCommentPrefixDefault</key>
|
||||
<string>/* </string>
|
||||
<key>BBLMCommentSuffixDefault</key>
|
||||
<string> */</string>
|
||||
<key>BBLMIsCaseSensitive</key>
|
||||
<true/>
|
||||
<key>BBLMRunNames</key>
|
||||
<dict>
|
||||
<key>me.bsago.bblm.rust.lifetime</key>
|
||||
<string>'lifetime</string>
|
||||
<key>me.bsago.bblm.rust.identifier</key>
|
||||
<string>Identifier</string>
|
||||
<key>me.bsago.bblm.rust.function</key>
|
||||
<string>fn functionname</string>
|
||||
<key>me.bsago.bblm.rust.module</key>
|
||||
<string>mod modulename</string>
|
||||
</dict>
|
||||
<key>BBLMRunColors</key>
|
||||
<dict>
|
||||
<key>me.bsago.bblm.rust.module</key>
|
||||
<string>rgb(135, 2, 219)</string>
|
||||
<key>me.bsago.bblm.rust.lifetime</key>
|
||||
<string>rgb(133, 20, 75)</string>
|
||||
<key>me.bsago.bblm.rust.identifier</key>
|
||||
<string>rgb(61, 153, 112)</string>
|
||||
<key>me.bsago.bblm.rust.function</key>
|
||||
<string>rgb(219, 135, 2)</string>
|
||||
</dict>
|
||||
<key>BBLMKeywords</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>RunKind</key>
|
||||
<string>com.barebones.bblm.keyword</string>
|
||||
<key>Keywords</key>
|
||||
<array>
|
||||
<string>abstract</string>
|
||||
<string>alignof</string>
|
||||
<string>as</string>
|
||||
<string>become</string>
|
||||
<string>box</string>
|
||||
<string>break</string>
|
||||
<string>const</string>
|
||||
<string>continue</string>
|
||||
<string>crate</string>
|
||||
<string>do</string>
|
||||
<string>else</string>
|
||||
<string>enum</string>
|
||||
<string>extern</string>
|
||||
<string>false</string>
|
||||
<string>final</string>
|
||||
<string>fn</string>
|
||||
<string>for</string>
|
||||
<string>if</string>
|
||||
<string>impl</string>
|
||||
<string>in</string>
|
||||
<string>let</string>
|
||||
<string>loop</string>
|
||||
<string>macro</string>
|
||||
<string>macro_rules</string>
|
||||
<string>match</string>
|
||||
<string>mod</string>
|
||||
<string>move</string>
|
||||
<string>mut</string>
|
||||
<string>offsetof</string>
|
||||
<string>override</string>
|
||||
<string>priv</string>
|
||||
<string>proc</string>
|
||||
<string>pub</string>
|
||||
<string>pure</string>
|
||||
<string>ref</string>
|
||||
<string>return</string>
|
||||
<string>self</string>
|
||||
<string>sizeof</string>
|
||||
<string>static</string>
|
||||
<string>struct</string>
|
||||
<string>super</string>
|
||||
<string>trait</string>
|
||||
<string>true</string>
|
||||
<string>type</string>
|
||||
<string>typeof</string>
|
||||
<string>unsafe</string>
|
||||
<string>unsized</string>
|
||||
<string>use</string>
|
||||
<string>virtual</string>
|
||||
<string>where</string>
|
||||
<string>while</string>
|
||||
<string>yield</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>RunKind</key>
|
||||
<string>com.barebones.bblm.predefined-symbol</string>
|
||||
<key>Keywords</key>
|
||||
<array>
|
||||
<string>bool</string>
|
||||
<string>char</string>
|
||||
<string>f32</string>
|
||||
<string>f64</string>
|
||||
<string>float</string>
|
||||
<string>i16</string>
|
||||
<string>i32</string>
|
||||
<string>i64</string>
|
||||
<string>i8</string>
|
||||
<string>isize</string>
|
||||
<string>str</string>
|
||||
<string>u16</string>
|
||||
<string>u32</string>
|
||||
<string>u64</string>
|
||||
<string>u8</string>
|
||||
<string>usize</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>BBLMLanguageCode</key>
|
||||
<string>Rust</string>
|
||||
<key>BBLMLanguageDisplayName</key>
|
||||
<string>Rust</string>
|
||||
<key>BBLMEntryPointName</key>
|
||||
<string>rustMain</string>
|
||||
<key>BBLMScansFunctions</key>
|
||||
<true/>
|
||||
<key>BBLMFunctionScannerDoesFoldsToo</key>
|
||||
<false/>
|
||||
<key>BBLMSuffixMap</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>BBLMLanguageSuffix</key>
|
||||
<string>.rs</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>BBLMUseHTMLFileSearchRules</key>
|
||||
<false/>
|
||||
<key>BBLMSpellableRunKinds</key>
|
||||
<array>
|
||||
<string>com.barebones.bblm.line-comment</string>
|
||||
<string>com.barebones.bblm.block-comment</string>
|
||||
</array>
|
||||
<key>BBLMNonSpellableRunKinds</key>
|
||||
<array>
|
||||
<string>com.barebones.bblm.code</string>
|
||||
<string>com.barebones.bblm.double-string</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>me.bsago.bblm.rust</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>BBLM</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>com.barebones.bblminfo</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>BBLMCanGuessLanguage</key>
|
||||
<true/>
|
||||
<key>BBLMColorsSyntax</key>
|
||||
<true/>
|
||||
<key>BBLMDroppedFilePathStyle</key>
|
||||
<string>POSIX</string>
|
||||
<key>BBLMCommentLineDefault</key>
|
||||
<string>// </string>
|
||||
<key>BBLMCommentPrefixDefault</key>
|
||||
<string>/* </string>
|
||||
<key>BBLMCommentSuffixDefault</key>
|
||||
<string> */</string>
|
||||
<key>BBLMIsCaseSensitive</key>
|
||||
<true/>
|
||||
<key>BBLMRunNames</key>
|
||||
<dict>
|
||||
<key>me.bsago.bblm.rust.lifetime</key>
|
||||
<string>'lifetime</string>
|
||||
<key>me.bsago.bblm.rust.identifier</key>
|
||||
<string>Identifier</string>
|
||||
<key>me.bsago.bblm.rust.function</key>
|
||||
<string>fn functionname</string>
|
||||
<key>me.bsago.bblm.rust.module</key>
|
||||
<string>mod modulename</string>
|
||||
</dict>
|
||||
<key>BBLMRunColors</key>
|
||||
<dict>
|
||||
<key>me.bsago.bblm.rust.module</key>
|
||||
<string>rgb(135, 2, 219)</string>
|
||||
<key>me.bsago.bblm.rust.lifetime</key>
|
||||
<string>rgb(133, 20, 75)</string>
|
||||
<key>me.bsago.bblm.rust.identifier</key>
|
||||
<string>rgb(61, 153, 112)</string>
|
||||
<key>me.bsago.bblm.rust.function</key>
|
||||
<string>rgb(219, 135, 2)</string>
|
||||
</dict>
|
||||
<key>BBLMKeywords</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>RunKind</key>
|
||||
<string>com.barebones.bblm.keyword</string>
|
||||
<key>Keywords</key>
|
||||
<array>
|
||||
<string>abstract</string>
|
||||
<string>alignof</string>
|
||||
<string>as</string>
|
||||
<string>become</string>
|
||||
<string>box</string>
|
||||
<string>break</string>
|
||||
<string>const</string>
|
||||
<string>continue</string>
|
||||
<string>crate</string>
|
||||
<string>do</string>
|
||||
<string>else</string>
|
||||
<string>enum</string>
|
||||
<string>extern</string>
|
||||
<string>false</string>
|
||||
<string>final</string>
|
||||
<string>fn</string>
|
||||
<string>for</string>
|
||||
<string>if</string>
|
||||
<string>impl</string>
|
||||
<string>in</string>
|
||||
<string>let</string>
|
||||
<string>loop</string>
|
||||
<string>macro</string>
|
||||
<string>macro_rules</string>
|
||||
<string>match</string>
|
||||
<string>mod</string>
|
||||
<string>move</string>
|
||||
<string>mut</string>
|
||||
<string>offsetof</string>
|
||||
<string>override</string>
|
||||
<string>priv</string>
|
||||
<string>proc</string>
|
||||
<string>pub</string>
|
||||
<string>pure</string>
|
||||
<string>ref</string>
|
||||
<string>return</string>
|
||||
<string>self</string>
|
||||
<string>sizeof</string>
|
||||
<string>static</string>
|
||||
<string>struct</string>
|
||||
<string>super</string>
|
||||
<string>trait</string>
|
||||
<string>true</string>
|
||||
<string>type</string>
|
||||
<string>typeof</string>
|
||||
<string>unsafe</string>
|
||||
<string>unsized</string>
|
||||
<string>use</string>
|
||||
<string>virtual</string>
|
||||
<string>where</string>
|
||||
<string>while</string>
|
||||
<string>yield</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>RunKind</key>
|
||||
<string>com.barebones.bblm.predefined-symbol</string>
|
||||
<key>Keywords</key>
|
||||
<array>
|
||||
<string>blkcnt_t</string>
|
||||
<string>blksize_t</string>
|
||||
<string>bool</string>
|
||||
<string>c_char</string>
|
||||
<string>c_double</string>
|
||||
<string>c_float</string>
|
||||
<string>c_int</string>
|
||||
<string>c_long</string>
|
||||
<string>c_schar</string>
|
||||
<string>c_short</string>
|
||||
<string>c_uchar</string>
|
||||
<string>c_uint</string>
|
||||
<string>c_ulong</string>
|
||||
<string>c_ushort</string>
|
||||
<string>char</string>
|
||||
<string>clock_t</string>
|
||||
<string>dev_t</string>
|
||||
<string>f32</string>
|
||||
<string>f64</string>
|
||||
<string>float</string>
|
||||
<string>gid_t</string>
|
||||
<string>i16</string>
|
||||
<string>i32</string>
|
||||
<string>i64</string>
|
||||
<string>i8</string>
|
||||
<string>ino_t</string>
|
||||
<string>isize</string>
|
||||
<string>mode_t</string>
|
||||
<string>nlink_t</string>
|
||||
<string>off_t</string>
|
||||
<string>pid_t</string>
|
||||
<string>ptrdiff_t</string>
|
||||
<string>size_t</string>
|
||||
<string>str</string>
|
||||
<string>suseconds_t</string>
|
||||
<string>time_t</string>
|
||||
<string>u16</string>
|
||||
<string>u32</string>
|
||||
<string>u64</string>
|
||||
<string>u8</string>
|
||||
<string>uid_t</string>
|
||||
<string>usize</string>
|
||||
<string>wchar_t</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>BBLMLanguageCode</key>
|
||||
<string>Rust</string>
|
||||
<key>BBLMLanguageDisplayName</key>
|
||||
<string>Rust</string>
|
||||
<key>BBLMEntryPointName</key>
|
||||
<string>rustMain</string>
|
||||
<key>BBLMScansFunctions</key>
|
||||
<true/>
|
||||
<key>BBLMFunctionScannerDoesFoldsToo</key>
|
||||
<true/>
|
||||
<key>BBLMSuffixMap</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>BBLMLanguageSuffix</key>
|
||||
<string>.rs</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>BBLMUseHTMLFileSearchRules</key>
|
||||
<false/>
|
||||
<key>BBLMSpellableRunKinds</key>
|
||||
<array>
|
||||
<string>com.barebones.bblm.line-comment</string>
|
||||
<string>com.barebones.bblm.block-comment</string>
|
||||
</array>
|
||||
<key>BBLMNonSpellableRunKinds</key>
|
||||
<array>
|
||||
<string>com.barebones.bblm.code</string>
|
||||
<string>com.barebones.bblm.double-string</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
155
rust.mm
155
rust.mm
@@ -386,70 +386,105 @@ SInt32 scanForSymbol(BBLMTextIterator &iter,
|
||||
BBLMParamBlock ¶ms,
|
||||
const BBLMCallbackBlock *callbacks)
|
||||
{
|
||||
SInt32 whitespaceLen, wordLen;
|
||||
SInt32 whitespaceLen, wordLen = 0, parametersLen = 0;
|
||||
UniChar ch;
|
||||
int keywordLen = strlen(keyword);
|
||||
|
||||
if (iter.strcmp(keyword, keywordLen) == 0)
|
||||
{
|
||||
iter += keywordLen;
|
||||
if ((whitespaceLen = skipWhitespace(iter)))
|
||||
|
||||
// Check for end of word, so 'enum' doesn't also match 'enumerate'.
|
||||
// But also check for '<', so 'impl<'a>' is a legit statement, even with no whitespace.
|
||||
whitespaceLen = skipWhitespace(iter);
|
||||
if (whitespaceLen == 0 && iter.strcmp("<", 1) != 0)
|
||||
{
|
||||
bool is_test = iter.strcmp("test", 4) == 0;
|
||||
|
||||
if ((wordLen = skipWord(iter)))
|
||||
iter -= keywordLen + whitespaceLen;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SInt32 start_of_name = iter.Offset();
|
||||
SInt32 start_of_function;
|
||||
while ((ch = iter.GetNextChar()))
|
||||
{
|
||||
if (ch == '{' || ch == ';')
|
||||
{
|
||||
UInt32 funLen = skipToEndOfFunction(iter);
|
||||
|
||||
// Skip over trait method definitions and extern functions
|
||||
if (funLen == 0)
|
||||
iter--;
|
||||
start_of_function = iter.Offset();
|
||||
break;
|
||||
}
|
||||
else if (ch == '(')
|
||||
{
|
||||
while ((ch = iter.GetNextChar()))
|
||||
{
|
||||
return 0;
|
||||
whitespaceLen++;
|
||||
if (ch == '{' || ch == ';')
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore modules called 'test'
|
||||
if (strcmp(keyword, "mod") == 0 && is_test)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
UInt32 tokenOffset, funIndex;
|
||||
UInt32 nameLen;
|
||||
BBLMProcInfo info;
|
||||
|
||||
iter -= (wordLen + funLen);
|
||||
iter -= (keywordLen + whitespaceLen);
|
||||
|
||||
nameLen = keywordLen + whitespaceLen + wordLen;
|
||||
|
||||
bblmAddTokenToBuffer(callbacks, params.fFcnParams.fTokenBuffer, iter.Address(),
|
||||
nameLen, &tokenOffset);
|
||||
|
||||
iter += (nameLen - wordLen);
|
||||
|
||||
iter -= (keywordLen + whitespaceLen);
|
||||
info.fFirstChar = info.fFunctionStart = iter.Offset();
|
||||
info.fSelStart = iter.Offset() + keywordLen + whitespaceLen;
|
||||
info.fSelEnd = info.fSelStart + wordLen;
|
||||
info.fFunctionEnd = info.fSelEnd + funLen;
|
||||
info.fIndentLevel = indentLevel;
|
||||
info.fKind = typeIfSo;
|
||||
info.fFlags = 0;
|
||||
info.fNameStart = tokenOffset;
|
||||
info.fNameLength = nameLen;
|
||||
bblmAddFunctionToList(callbacks, params.fFcnParams.fFcnList, info, &funIndex);
|
||||
bblmAddFoldRange(callbacks, info.fFunctionStart, funLen, kBBLMFunctionAutoFold);
|
||||
iter += (keywordLen + whitespaceLen);
|
||||
return info.fFunctionEnd;
|
||||
iter--;
|
||||
start_of_function = iter.Offset();
|
||||
break;
|
||||
}
|
||||
else if (ch == '\n')
|
||||
{
|
||||
start_of_function = iter.Offset();
|
||||
break;
|
||||
}
|
||||
else if (ch)
|
||||
{
|
||||
whitespaceLen++;
|
||||
}
|
||||
else
|
||||
{
|
||||
iter -= (whitespaceLen + keywordLen);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
UInt32 funLen = skipToEndOfFunction(iter);
|
||||
|
||||
// Skip over trait method definitions and extern functions
|
||||
if (funLen == 0)
|
||||
{
|
||||
iter -= keywordLen;
|
||||
return 0;
|
||||
}
|
||||
|
||||
UInt32 tokenOffset, funIndex;
|
||||
UInt32 nameLen;
|
||||
|
||||
iter -= (wordLen + funLen);
|
||||
iter -= (keywordLen + whitespaceLen);
|
||||
|
||||
nameLen = keywordLen + whitespaceLen + wordLen;
|
||||
|
||||
bblmAddTokenToBuffer(callbacks, params.fFcnParams.fTokenBuffer, iter.Address(),
|
||||
nameLen, &tokenOffset);
|
||||
|
||||
iter += (nameLen - wordLen);
|
||||
iter -= (keywordLen + whitespaceLen);
|
||||
|
||||
BBLMProcInfo info;
|
||||
info.fFirstChar = info.fFunctionStart = iter.Offset();
|
||||
info.fSelStart = iter.Offset() + keywordLen + whitespaceLen;
|
||||
info.fSelEnd = info.fSelStart + wordLen;
|
||||
info.fFunctionStart = start_of_function;
|
||||
info.fFunctionEnd = info.fSelEnd + funLen;
|
||||
info.fIndentLevel = indentLevel;
|
||||
info.fKind = typeIfSo;
|
||||
info.fFlags = 0;
|
||||
info.fNameStart = tokenOffset;
|
||||
info.fNameLength = nameLen;
|
||||
|
||||
bblmAddFunctionToList(callbacks, params.fFcnParams.fFcnList, info, &funIndex);
|
||||
|
||||
// But still allow the user to fold them
|
||||
// (the length changes here are to cut off the opening { and closing } from the fold range
|
||||
bblmAddFoldRange(callbacks, start_of_function + 1, funLen - 2, kBBLMFunctionAutoFold);
|
||||
|
||||
iter += (keywordLen + whitespaceLen);
|
||||
return info.fFunctionEnd;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -569,7 +604,7 @@ OSErr calculateRuns(BBLMParamBlock ¶ms, const BBLMCallbackBlock *callbacks)
|
||||
bool wordchr = false;
|
||||
while ((ch = iter.GetNextChar()))
|
||||
{
|
||||
if (ch == 'r' && iter.strcmp("##\"", 3) == 0)
|
||||
if (ch == 'r' && iter.CharsLeft() >= 3 && iter.strcmp("##\"", 3) == 0)
|
||||
{
|
||||
iter--;
|
||||
if (!makeCodeRun(iter, runStart, *callbacks)) return noErr;
|
||||
@@ -675,7 +710,7 @@ OSErr calculateRuns(BBLMParamBlock ¶ms, const BBLMCallbackBlock *callbacks)
|
||||
iter--;
|
||||
}
|
||||
}
|
||||
else if (ch == 'a' && iter.strcmp("cro_rules!", 10) == 0)
|
||||
else if (ch == 'a' && iter.CharsLeft() >= 10 && iter.strcmp("cro_rules!", 10) == 0)
|
||||
{
|
||||
iter += 10;
|
||||
ch = iter.GetNextChar();
|
||||
@@ -763,11 +798,31 @@ OSErr calculateRuns(BBLMParamBlock ¶ms, const BBLMCallbackBlock *callbacks)
|
||||
if (!addRun(kBBLMFileIncludeRunKind, runStart, runLen, *callbacks)) return noErr;
|
||||
break;
|
||||
}
|
||||
else
|
||||
else if (ch)
|
||||
{
|
||||
spacey = isspace(ch) || ch == ':' || ch == '{';
|
||||
runLen++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (iter.strcmp(" as ", 4) == 0)
|
||||
{
|
||||
if (!addRun(kBBLMFileIncludeRunKind, runStart, runLen, *callbacks)) return noErr;
|
||||
runStart = iter.Offset();
|
||||
iter += 4;
|
||||
if (!addRun(kBBLMCodeRunKind, runStart, 4, *callbacks)) return noErr;
|
||||
|
||||
runStart = iter.Offset();
|
||||
runLen = skipWord(iter);
|
||||
if (!addRun(moduleColour, runStart, runLen, *callbacks)) return noErr;
|
||||
|
||||
iter++;
|
||||
runLen = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!addRun(kBBLMFileIncludeRunKind, runStart, runLen, *callbacks)) return noErr;
|
||||
|
||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 293 KiB After Width: | Height: | Size: 294 KiB |
11
smoke.rs
11
smoke.rs
@@ -118,3 +118,14 @@
|
||||
macro_rules! parse {
|
||||
($thing: expr) => { $thing };
|
||||
}
|
||||
|
||||
// `use` statements
|
||||
// ----------------
|
||||
|
||||
use flux;
|
||||
use flux::capacitor;
|
||||
use flux::capacitor::Component::*;
|
||||
use flux::capacitor::Component::{ImpurePalladium, ThinkingAluminium, TimeyWimeyDevice};
|
||||
use flux::capacitor as cap;
|
||||
use super;
|
||||
use self;
|
||||
|
||||
Reference in New Issue
Block a user