Highlight things
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

28 Zeilen
1.3KB

  1. void
  2. highlight_c(void)
  3. {
  4. const char * c_keywords[] = {
  5. "register", "volatile", "auto", "const", "static", "extern", "if", "else",
  6. "do", "while", "for", "continue", "switch", "case", "default", "break",
  7. "enum", "union", "struct", "typedef", "goto", "void", "return", "sizeof",
  8. "char", "short", "int", "long", "signed", "unsigned", "float", "double",
  9. NULL
  10. };
  11. const char * preprocessor_keywords[] = {
  12. "#include", "#pragma", "#define", "#undef", "#ifdef", "#ifndef", "#elifdef", "#elifndef",
  13. "#if", "#elif", "#else", "#endif", "#embed", "#line", "#error", "#warning",
  14. NULL
  15. };
  16. new_char_tokens("+-&|.()[]{}", operator_hl);
  17. new_keyword_tokens(c_keywords, control_hl);
  18. new_keyword_tokens(preprocessor_keywords, special_hl);
  19. new_region_token("/\\*", "\\*/", comment_hl);
  20. new_region_token("//", "\\n", comment_hl);
  21. new_region_token("\"", "\"", string_literal_hl);
  22. new_region_token("<", ">", string_literal_hl);
  23. new_keyword_token("keyword", special_hl);
  24. new_keyword_token("while", operator_hl);
  25. }