Skip to content

Commit

Permalink
Be a bit more pragmatic with language guessing
Browse files Browse the repository at this point in the history
  • Loading branch information
ogham committed Nov 23, 2015
1 parent 487b87d commit 85a4eb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust.mm
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,14 @@ OSErr guessLanguage(BBLMParamBlock &params)
{
BBLMTextIterator iter(params);

if (iter.strcmp("use ", 4) == 0 || iter.strcmp("#![crate_id", 11) == 0)
if (iter.strcmp("#![crate_name", 13) == 0)
{
params.fGuessLanguageParams.fGuessResult = kBBLMGuessDefiniteYes;
}
else if (iter.strcmp("use ", 4) == 0 || iter.strcmp("//! ", 4) == 0)
{
params.fGuessLanguageParams.fGuessResult = kBBLMGuessMaybe;
}

return noErr;
}
Expand Down

0 comments on commit 85a4eb2

Please sign in to comment.