Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis dolor ornare, lacinia purus id, sodales odio. Sed felis sapien, elementum eu semper ac, rhoncus id velit. Integer commodo ex libero, id semper elit tristique iaculis. Donec malesuada urna non feugiat consequat. Nam ipsum nulla, fermentum at elit sollicitudin, tempus euismod eros. Curabitur a neque id dolor convallis faucibus sagittis non turpis. Pellentesque ullamcorper, dolor eget dictum commodo, lorem dolor porttitor enim, porttitor cursus mauris metus aliquet nisi. Aliquam mollis volutpat magna in scelerisque. Nullam sodales malesuada orci, non consectetur augue tempus quis. Integer neque eros, iaculis ac ligula eu, mattis facilisis diam. Phasellus suscipit id urna vitae accumsan. Integer felis lacus, aliquam vel semper a, tincidunt in diam. Nulla euismod tincidunt malesuada. Aliquam id nisl euismod, lobortis mauris vitae, cursus quam. Sed id gravida velit, sed pharetra magna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis hendrerit rhoncus purus at scelerisque. Sed vulputate tincidunt mauris, eu elementum ligula. Vestibulum in est a urna cursus hendrerit. Ut vehicula elementum bibendum. Morbi auctor rutrum orci, eu porttitor enim pretium vitae. Donec scelerisque tortor risus, a lobortis purus aliquam at. Mauris vitae neque cursus, fringilla lacus sit amet, blandit nibh. Morbi porttitor ullamcorper erat at tincidunt. Nullam tincidunt facilisis augue a ultricies. Maecenas a tellus vitae eros finibus facilisis tincidunt ac massa.
template <typename T>
double Some::function(void* a, int b, T c) {
    const int hi = u>=w ? u>=v ? 0 : 1 : v>=w ? 1 : 2;
    const int lo = u<w ? u < v ? 0 : 1 : v<w ? 1 : 2;
    
    // Comment nom nom
    const auto b = [](int i, int j, int k, int B) {
        return (int[]){0x15,0x38,0x32,0x2c,0x0d,0x13,0x07,0x2a}[
            (i >> B & 1) << 2 | (j >> B & 1) << 1 | (k >> B & 1)
        ];
    };
    
    const auto shuffle = [&b](int i, int j, int k) {
        return b(i,j,k,0) + b(j,k,i,1) + b(k,i,j,2) + b(i,j,k,3) +
            b(j, k, i, 4) + b(k, i, j, 5) + b(i, j, k, 6) + b(j, k, i, 7);
    };
}
const color_theme = {
  monokai: {
    comment: 'color: #797979',
    scoping: 'color: #f8ff00',
    string: 'color: #f8ff00',
    identifier_1: 'color: #ff9b60',
    identiifer_2: 'color: #7fff4a',
    number: 'color: #9e86c8',
    reserved_1: 'color: #16bfff',
    reserved_2: 'color: #e80a62',
    operator: 'color: #e80a62'
  }
};

function colorise(src, lex) {
  // reserved_1 reserved_2 comment
  // operator scoping
  // string number
  // identifier_1 identifier_2
  // identifier ignore
  let index = 0; const tokens = [];
  const currentChar = () => src[index] || '';
  const skipWhitespace = () => { while (currentChar().match()) ++index; };
  const matchWord = (word) => src.substring(index).indexOf(word) === 0 && src[index + word.length].match();
  const matchSymbol = (symbol) => src.substring(index).indexOf(symbol) === 0;
  const retWord = (word, group) => tokens.push({ group, value: word, index: (index += word.length) - word.length });
  const retSymbol = (symbol, group) => tokens.push({ group, value: symbol, index: (index += symbol.length) - symbol.length });
  const getChars = (regex) => { let out = ''; while (currentChar().match(regex)) { out += currentChar(); ++index; } return out };
  
  inf: while (true) {
    skipWhitespace(); if (index >= src.length) break;
    for (let i of lex.reserved_words_1) if (matchWord(i)) { retWord(i,'reserved_1'); continue inf }
    for (let i of lex.reserved_words_2) if (matchWord(i)) { retWord(i,'reserved_2'); continue inf }
    
    for (let i of lex.operators) if (matchSymbol(i)) { retSymbol(i,'operator'); continue inf }
    for (let i of lex.scoping) if (matchSymbol(i)) { retSymbol(i,'scoping'); continue inf }
    for (let i of lex.ignore) if (matchSymbol(i)) { retSymbol(i,'ignore'); continue inf }
    throw `Unhandled token: ${JSON.stringify(src.slice(index))}`;
  }
  return tokens
    .map((x,i,a) => (x.group = lex.follow.reduce((acc, f) => acc || f(x,i,a), void 0) ?? x.group, x)) // TODO: Follow
    .map((x,i,a) => src.slice((a[i-1]?.index ?? 0) + (a[i-1]?.value.length ?? 0), x.index)
      +`${x.group==='ignore'?'':`<span class="mk ${x.group}">`}${src.slice(x.index,x.index+x.value.length)}${x.group==='ignore'?'':''}`)
    .join('');
}
int main(int argc, char** argv) {
    return 0;
}
Example of a code snippet
x := 0 // Added
y := 0 // Added
{ // Page 120
  r1 := x
  if (r1 >= 0) {
    y := 1
  }
} ||| {
  r2 := y
  x := r2
}
%%
allow (r1 = 1 && r2 = 1) [scuffed=allow]
// Thread 1
x := 1
r1 := x
// Thread 2
x := 2
r2 := x
// Thread 3
x := 3
r3 := x
last modified: Wed, 30 Oct 2024 17:25:43 GMT
aboutblogindexinterestsprojectstestuug