I wrote a function that takes characters and noticed that the Arduino Compiler treated some characters like system-reserved, and other like functions, and a few just like characters. Lowercase doesn't seem to be effected. I'm just wondering why.
2 Answers
The Arduino IDE does keyword coloration according to a very crude system. It simply scans for all the keywords.txt files included with:
- Arduino IDE
- Libraries bundled with the Arduino IDE
- Libraries you have installed to the libraries subfolder of your sketchbook
- Libraries bundled with the hardware package of the currently selected board - Hardware package of the currently selected board (recent IDE versions only)
There are several types of keyword identifiers that determine which color is used. The reason those letters are colored in your IDE is because some library you have installed just happens to have added them to its keywords.txt file. The Arduino IDE makes no attempt to determine whether you have included those libraries and so coloration doesn't necessarily mean they are "reserved". If you have not included the library that defines a specific keyword then the coloration of that keyword is meaningless.
For more information on keywords.txt see:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords
In WString.h is a define:
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
In other words, the letter F
is already a macro.
I don't know what your code:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
is supposed to do. I suppose you are just testing the syntax highlighting?
The syntax highlighting is designed to try to "help" you by colouring words in a pre-supplied file in a different way. It doesn't in any way affect how the compilation works. And, judging by what you posted, it can't always be relied upon. Personally, I ignore it.
Ctrl+K
to have your browser do this for you.