/*
 * Highlighting rules for the C language for the of the HighlighterKit
 * framework.
 */
{
  Contexts = (
    {
      Keywords = (
        {
          Pattern = "{";
          ForegroundColor = "0 0.8 0";
          Bold = YES;
        },
        {
          Pattern = "}";
          ForegroundColor = "0 0.8 0";
          Bold = YES;
        },
        {
          Pattern = "\\[";
          ForegroundColor = "0 0.8 0";
          Bold = YES;
        },
        {
          Pattern = "\\]";
          ForegroundColor = "0 0.8 0";
          Bold = YES;
        },
        {
          Pattern = "(";
          ForegroundColor = "0 0.8 0";
          Bold = YES;
        },
        {
          Pattern = ")";
          ForegroundColor = "0 0.8 0";
          Bold = YES;
        },
        {
          Pattern = ";";
          ForegroundColor = "0.8 0 0.5";
          Bold = YES;
        },
        {
          Pattern = "<auto>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<break>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<case>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<char>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<const>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<continue>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<default>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<do>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<double>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<else>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<enum>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<extern>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<float>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<for>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<goto>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<if>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<int>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<long>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<register>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<return>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<short>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<signed>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<sizeof>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<static>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<struct>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<switch>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<typedef>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<union>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<inline>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<unsigned>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<void>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<volatile>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<while>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<wchar_t>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        },
        {
          Pattern = "<\\.\\.\\.>";
          ForegroundColor = "0.6 0.45 0.75";
          Bold = YES;
        }
      );
    },

    /* string */
    {
      Beginning = "\"";
      Ending = "\"";
      ContextSkips = (
        "\\\\\\\\",
        "\\\\\""
      );
      ForegroundColor = "0 0.7 0";
      Keywords = (
        {
          Pattern = "\\\\\\\\";
          ForegroundColor = "0 1 0";
          Bold = YES;
        },
        {
          Pattern = "\\\\[0123456789]{3}";
          ForegroundColor = "0 1 0";
          Bold = YES;
        },
        {
          Pattern = "\\\\0";
          ForegroundColor = "0 1 0";
          Bold = YES;
        },
        {
          Pattern = "\\\\\"";
          ForegroundColor = "0 1 0";
          Bold = YES;
        },
        {
          Pattern = "\\\\[ntfb]";
          ForegroundColor = "0 1 0";
          Bold = YES;
        },
        {
          Pattern = "%ll[iu]";
          ForegroundColor = "0 1 0";
          Bold = YES;
        },
        {
          Pattern = "%[0123456789]*\\.?[0123456789]*l?[%cdefginosupxX]";
          ForegroundColor = "0 1 0";
          Bold = YES;
        }
      );
    },

    /* character constant */
    {
      Beginning = "'"; 
      Ending = "'";
      ContextSkips = (
        "\\\\\\\\",
        "\\\\'"
      );
      ForegroundColor = "0.2 0.2 0.8";
      BackgroundColor = "0.8 0.8 0";
    },

    /* preproc directive */
    {
      Beginning = "^#";
      Ending = "\n";
      ContextSkips = (
        "\\\\\n"
      );
      ForegroundColor = "0.8 0 0";
      Bold = YES;
    },

    /* multi-line comment */
    {
      Beginning = "/\\*";
      Ending = "\\*/";
      ForegroundColor = "0 0.5 0";
      Italic = YES;
      Keywords = (
        {
          Pattern = "<TODO>";
          ForegroundColor = "0.8 0.1 0.1";
          Bold = YES;
        }
      );
    },

    /* inline comment */
    {
      Beginning = "//";
      Ending = "\n";
      ForegroundColor = "0 0.5 0";
      Italic = YES;
      Keywords = (
        {
          Pattern = "<TODO>";
          ForegroundColor = "0.8 0.1 0.1";
          Bold = YES;
        }
      );
    }
  );
}
