neilsf / XC-BASIC

A compiling BASIC dialect for the Commodore-64
https://xc-basic.net/
MIT License
74 stars 15 forks source link

Allow global vars without global modifier in explicit mode. #112

Closed neilsf closed 3 years ago

neilsf commented 4 years ago

To access a global variable, the global modifier \ is currently mandatory in functions and procedures. However, the #100 explicit mode coming in V3 should allow to refer to global variables without the modifier.

Example:

PRAGMA explicit_mode = 1

DIM someGlobalVar AS int

PROC myProc
  REM notice there's no backslash before the variable name
  PRINT someGlobalVar
ENDPROC