New language extension: Allow underscores in identifiers
Posted: Sat Aug 11, 2012 4:34 am
Release v4.3 of Astrobe will allow the use of the underscore character ('_') in Oberon identifier names (i.e. constant definitions etc.) For example:
can then be written as
This feature is solely intended for use with multi-word uppercase identifiers like these.
Normally you should avoid using uppercase names in Oberon programs to eliminate the possibility of clashing with Oberon's reserved words and standard procedures. However using peripheral register names in your programs that match those used by NXP, STMicroelectronics etc. in their documentation is felt to be a justifiable exception to the rule.
The problem is that the Oberon convention of writing multi-word names in CamelCaps cannot be used for uppercase names. The resulting difficulty of distinguishing each word has a negative impact on legibility. This particularly applies to some of the STMicroelectronics' definitions:
When underscores are allowed these can then be written as:
Code: Select all
MCU.PINMODEOD0
Code: Select all
MCU.PINMODE_OD0
Normally you should avoid using uppercase names in Oberon programs to eliminate the possibility of clashing with Oberon's reserved words and standard procedures. However using peripheral register names in your programs that match those used by NXP, STMicroelectronics etc. in their documentation is felt to be a justifiable exception to the rule.
The problem is that the Oberon convention of writing multi-word names in CamelCaps cannot be used for uppercase names. The resulting difficulty of distinguishing each word has a negative impact on legibility. This particularly applies to some of the STMicroelectronics' definitions:
Code: Select all
GPIOCCRH
GPIOCODR
RCCAPB2ENR
Code: Select all
GPIOC_CRH
GPIOC_ODR
RCC_APB2ENR