GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - root-cli/MTA-Preprocessor: C++ macros inside mta.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
std
std
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
meta.xml
meta.xml
 
 
preprocessor.lua
preprocessor.lua
 
 

Repository files navigation

MTA-Preprocessor

C++ macros inside mta.

instructions

  1. include "scriptName" - load specified file with macro support
  2. ignore [n] - ignore next line, or N next lines, ignore 10 will ignore next 10 lines
  3. define name value - set value under name.
  4. precompile name value - same as above but value become executed and result is stores under name.
  5. undef name - remove variable.
  6. ifdef name - check if variables is in use.
  7. ifndef name - check if variables isn't used yet.
  8. if condition - skip chunk of code if result of condition equal false.
  9. else - if condition was false.
  10. endif - end of if.

I recommend to set uppercase name.

Macros starting with # char at start.

Examples

#define A 1
#define B 1
#precompile C A+B
print(C)

final code will be: print(2)

#define ADD1(A,B) A+B
#precompile ADD2(A,B) A+B

print(ADD1(1,2)) -- print(1+2)
print(ADD2(1,2)) -- print(3)

How start working with this?

Simply add one line to your code:

loadstring(exports.prepocessor:install())()

where prepocessor is resource name. Then you can use dofile function that accept filename argument, example dofile("test.lua") will load test.lua with macro support

About

C++ macros inside mta.

Resources

Readme
GPL-3.0 license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.