diff --git a/app/src/processing/app/syntax/PdeKeywords.java b/app/src/processing/app/syntax/PdeKeywords.java index 8740b0675..d1b23b867 100644 --- a/app/src/processing/app/syntax/PdeKeywords.java +++ b/app/src/processing/app/syntax/PdeKeywords.java @@ -54,6 +54,7 @@ public class PdeKeywords { KNOWN_TOKEN_TYPES.put("DATA_TYPE", TokenTypes.DATA_TYPE); KNOWN_TOKEN_TYPES.put("LITERAL_BOOLEAN", TokenTypes.LITERAL_BOOLEAN); KNOWN_TOKEN_TYPES.put("LITERAL_CHAR", TokenTypes.LITERAL_CHAR); + KNOWN_TOKEN_TYPES.put("PREPROCESSOR", TokenTypes.PREPROCESSOR); } // lookup table for the TokenMarker subclass, handles coloring @@ -112,6 +113,9 @@ public class PdeKeywords { String pieces[] = PApplet.split(line, '\t'); String keyword = pieces[0].trim(); + if (keyword.startsWith("\\#")) { + keyword = keyword.replace("\\#", "#"); + } if (pieces.length >= 2) { keywordOldToken.put(keyword, pieces[1]); diff --git a/app/src/processing/app/syntax/SketchTextArea.java b/app/src/processing/app/syntax/SketchTextArea.java index 3c5676e02..457e17b87 100644 --- a/app/src/processing/app/syntax/SketchTextArea.java +++ b/app/src/processing/app/syntax/SketchTextArea.java @@ -125,6 +125,7 @@ public class SketchTextArea extends RSyntaxTextArea { setSyntaxTheme(TokenTypes.LITERAL_BOOLEAN, "literal_boolean"); setSyntaxTheme(TokenTypes.LITERAL_CHAR, "literal_char"); setSyntaxTheme(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote"); + setSyntaxTheme(TokenTypes.PREPROCESSOR, "preprocessor"); Style style = getSyntaxScheme().getStyle(TokenTypes.IDENTIFIER); style.foreground = processing.app.Theme.getColor("editor.fgcolor"); diff --git a/build/shared/lib/keywords.txt b/build/shared/lib/keywords.txt index 5b7c81913..16d6d1918 100644 --- a/build/shared/lib/keywords.txt +++ b/build/shared/lib/keywords.txt @@ -248,3 +248,14 @@ export KEYWORD3 RESERVED_WORD >> Bitshift ; SemiColon -= DecrementCompound + +\#include KEYWORD3 PREPROCESSOR +\#define KEYWORD3 PREPROCESSOR +\#elif KEYWORD3 PREPROCESSOR +\#else KEYWORD3 PREPROCESSOR +\#error KEYWORD3 PREPROCESSOR +\#if KEYWORD3 PREPROCESSOR +\#ifdef KEYWORD3 PREPROCESSOR +\#ifndef KEYWORD3 PREPROCESSOR +\#pragma KEYWORD3 PREPROCESSOR +\#warning KEYWORD3 PREPROCESSOR diff --git a/build/shared/lib/theme/theme.txt b/build/shared/lib/theme/theme.txt index 9c397cfa2..e583d6f25 100644 --- a/build/shared/lib/theme/theme.txt +++ b/build/shared/lib/theme/theme.txt @@ -100,6 +100,7 @@ editor.reserved_word_2.style = #00979C,plain editor.literal_boolean.style = #00979C,plain editor.literal_char.style = #00979C,plain editor.literal_string_double_quote.style = #00979C,plain +editor.preprocessor.style = #5E6D03,plain # http://www.arduino.cc/ editor.url.style = #0000ff,underlined