Another cursed Garry's Mod module. This time, it adds the C preprocessor to Lua scripts

Overview

gm_cpreprocessor

Another cursed Garry's Mod module. This time, it adds the C preprocessor to Lua scripts.

It works by detouring RunStringEx and overriding the executed Lua source code with MSVC compiler, gnu compiler or clang preprocess-only mode output.

Demo

garrysmod/lua/cpreprocessor_test.lua

#define MACRO(NAME) function Print ## NAME () print("hello world") end

MACRO(HelloWorld)

PrintHelloWorld()
require("cpreprocessor")... lua_openscript cpreprocessor_test.lua Running script cpreprocessor_test.lua... hello world">
lua_run require("cpreprocessor")
> require("cpreprocessor")...
lua_openscript cpreprocessor_test.lua
Running script cpreprocessor_test.lua...
hello world

Requirements

MSVC compiler, gnu compiler, or clang installed to the system

You might also like...
A memory safe Lua interpreter

Hematita Da Lua Hematita Da Lua is an interpreter for the scripting language Lua, written entirely in 100% safe Rust. Hematita is the portugese word f

A script language like Python or Lua written in Rust, with exactly the same syntax as Go's.

A script language like Python or Lua written in Rust, with exactly the same syntax as Go's.

A super-lightweight Lua microservice (toy) framework.

Hive A super-lightweight microservice (toy) framework written in Rust. It uses Lua as interface to provide simple, fun developing experience and fast

A parser, compiler, and virtual machine evaluator for a minimal subset of Lua; written from scratch in Rust.

lust: Lua in Rust This project implements a parser, compiler, and virtual machine evaluator for a minimal subset of Lua. It is written from scratch in

Rust scaffold system with Lua embedded applets.
Rust scaffold system with Lua embedded applets.

brickpack-2022 Demo Powered by Github Actions CI/CD (Heroku) https://demo-1642622230.herokuapp.com/#/users Frontent Runner Rendered sample code (Lua 5

This tool converts Lua code to TS automatically, including the conversion of common standards to their TS equivalents.

lua-to-ts This tool converts Lua code to TS automatically, including the conversion of common standards to their TS equivalents. Code that fails to be

Node.js bindings to Lua

Node.js bindings to Lua

Easy way to write Node.js module using Rust

node-bindgen Easy way to write native Node.js module using idiomatic Rust Features Easy: Just write idiomatic Rust code, node-bindgen take care of gen

Python module implemented in Rust for counting the number of one bits in a numpy array.

bit-counter Package for counting the number of one bits in a numpy array of uint8 values. Implemented as a Python module using Rust, providing high pe

Comments
  • another billy creation no one asked for but needed

    another billy creation no one asked for but needed

    another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed another billy creation no one asked for but needed

    opened by NoSharp 3
Owner
William
aka Billy
William
๐Ÿ“ฆ Pack hundreds of Garry's Mod Lua files into just a handful

?? gluapack gluapack is a program that can pack hundreds of Garry's Mod Lua files into just a handful. Features Quick, easy and portable - perfect for

null 11 Aug 10, 2021
๐Ÿฑโ€๐Ÿ‘ค Cross-language static library for accessing the Lua state in Garry's Mod server plugins

gmserverplugin This is a utility library for making Server Plugins that access the Lua state in Garry's Mod. Currently, accessing the Lua state from a

William 5 Feb 7, 2022
Lua bytecode parser written in Rust using nom, part of metaworm's lua decompiler

luac-parser (ไธญๆ–‡) luaๅญ—่Š‚็ ่งฃๆžๅ™จ, ็›ฎๅ‰ๆ”ฏๆŒ lua51, lua53, lua54 ่ฟ™ๆ˜ฏ็›ฎๅ‰ๆ•ˆๆžœๆœ€ๅฅฝ็š„luaๅ็ผ–่ฏ‘ๅ™จ metaworm's luadec ็š„ไธ€้ƒจๅˆ† ๅฏไปฅๅŸบไบŽๆญคไปฃ็ ๅฎšๅˆถไฝ ๆ‰€้œ€็š„luaๅญ—่Š‚็ ่งฃๆžๅ™จ๏ผŒ็ผ–่ฏ‘ๆˆWASM๏ผŒ่ฎฉmetaworm's luadecๅŠ ่ฝฝไฝฟ็”จ๏ผŒๆฅๅ็ผ–

metaworm 4 Mar 16, 2023
An npm scripts runner written in Rust.

dum replaces npm run. Instead of waiting 200ms for your npm client to start, it will start immediately. ?? You can help the author become a full-time

EGOIST 1.3k Jan 9, 2023
Rust library for build scripts to compile C/C++ code into a Rust library

A library to compile C/C++/assembly into a Rust library/application.

Alex Crichton 1.3k Dec 21, 2022
Lua 5.3 bindings for Rust

rust-lua53 Aims to be complete Rust bindings for Lua 5.3 and beyond. Currently, master is tracking Lua 5.3.3. Requires a Unix-like environment. On Win

J.C. Moyer 150 Dec 14, 2022
Safe Rust bindings to Lua 5.1

rust-lua Copyright 2014 Lily Ballard Description This is a set of Rust bindings to Lua 5.1. The goal is to provide a (relatively) safe interface to Lu

Lily Ballard 124 Jan 5, 2023
Zero-cost high-level lua 5.3 wrapper for Rust

td_rlua This library is a high-level binding for Lua 5.3. You don't have access to the Lua stack, all you can do is read/write variables (including ca

null 47 May 4, 2022
Rust library to interface with Lua

hlua This library is a high-level binding for Lua 5.2. You don't have access to the Lua stack, all you can do is read/write variables (including callb

Pierre Krieger 488 Dec 26, 2022
Pure Rust Lua implementation

purua Pure Rust Lua implementation Usage $ bat lua_examples/defun.lua โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚ File: lua_examples/d

Kondo Uchio 35 Dec 28, 2021