diff --git a/content/blog/dyno_alloy/index.md b/content/blog/dyno_alloy/index.md index 7b1fabf..52a1fcd 100644 --- a/content/blog/dyno_alloy/index.md +++ b/content/blog/dyno_alloy/index.md @@ -435,7 +435,7 @@ apply Alloy. First, here's the code in C++ that defines the various flags I'd be working with (though I've omitted flags that are not currently used in the implementation). -```C++ +{{< githubsnippet "chapel-lang/chapel" "390187df504f58cbf721a87d5632cdf7ea37563f" "frontend/include/chpl/resolution/scope-types.h" "C++" 45 >}} enum { /** Public */ PUBLIC = 1, @@ -450,7 +450,7 @@ used in the implementation). /** Something other than a method declaration */ NOT_METHOD = 128, }; -``` +{{< /githubsnippet >}} These are the flags that we model using a `Bitset`: `PUBLIC`, `METHOD_FIELD`, and `METHOD` are modeled using `positiveFlags`, and @@ -461,7 +461,7 @@ system (particularly when we _know_ it's an approximation). However, the flags aren't used arbitrarily; in fact, it wasn't too hard to track down the most important place in the code where bitsets are built. -```C++{linenos=true, linenostart=914} +{{< githubsnippet "chapel-lang/chapel" "390187df504f58cbf721a87d5632cdf7ea37563f" "frontend/lib/resolution/scope-queries.cpp" "C++" 914 >}} IdAndFlags::Flags curFilter = 0; /* ... some unrelated code ... */ if (skipPrivateVisibilities) { @@ -472,7 +472,7 @@ most important place in the code where bitsets are built. } else if (!includeMethods && receiverScopes.empty()) { curFilter |= IdAndFlags::NOT_METHOD; } -``` +{{< /githubsnippet >}} The above code converts the current search parameters into `Bitfield` flags. For instance, if a `use` statement is being processed that doesn't