Documentation
GitHubTwitter
  • overview
    • What is Lua++?
    • Why Lua++?
  • language improvements
    • Compound Assignments
    • Postfix and Prefix Operators
    • The Continue Statement
    • Constant Variables
    • Type Annotations
      • Function Annotations
    • Classes
      • Constructors
      • Templating
      • Inheritance
      • Encapsulation
    • Events
    • Macros
      • Lenient
      • Comment
      • C-Arrays
  • contributing
    • Installing the Project
Powered by GitBook
On this page

Was this helpful?

  1. language improvements

Macros

Macros are commands within the code that allow for customization of the Lua++ compiler’s behavior. To use a macro one would use the --! prefix followed by the name of the macro. These macros must be the first statement of the program. Otherwise, the compiler will throw an error. Here are some examples:

--!<macro>
print("hello")

The following segment will not compile successfully as there is a statement preceding the macro definition:

local v = 1 -- NO
--!<macro>
print("hello")

PreviousEventsNextLenient

Last updated 2 years ago

Was this helpful?