TG9541/stm8ef

Support upcomming e4thcom features #ifdef and #ifndef in codeload.py

TG9541 opened this issue · 1 comments

The upcoming e4thcom version supports conditional transfer code after #ifdef name, e.g.

\ example: skip the rest of the file if test is defined
#ifdef test \\

\ example define test unless it's defined
#ifndef test : test ;

\ example: load PD_DDR unless it's defined
#ifndef PD_DDR \res MCU: STM8S103
#ifndef PD_DDR \res export PD_DDR

The change will be added to codeload3.py (update to Python3 in #390) and the new version will be the new default. The Python2.7 version will be preserved as codeload2.py.

The following rules apply:

  • the conditionals #ifdef <name> or #ifndef <name> have to be the first word on a line
  • ordinary STM8 eForth console input may follow a conditional
  • #require, #include, \res or \\ may follow a conditional and have to be the first word on a line in all other cases