RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Debug DrawingGPU Mesh StructsImGui FFIMath Structs (FFI)FFI C DefinitionsPID ControllersCSV LibraryDelay LineDequeDevelopment UtilitiesEvent ReferenceExtension SystemSignal FiltersGraph PathfindingUI BridgeInput Filter Constants2D Bilinear InterpolationIntrospectionJBeam Pretty PrinterJSON AST ParserSJSON ParserJSON Debug ParserJSON Pretty PrinterK-D Tree (2D Boxes)K-D Tree (3D)K-D Tree (3D)Lua SerializerC++/Lua BindingLua CoreLua ProfilerMath LibraryParticlesQuadtreeSettingsTCP ServerTimer SchedulerUtility Library
Call TracerDate UtilsDebug DrawingFilter Chainutils/ - Utility ModulesHeatmap GeneratorHTTP JSON ServerInteractive ShellLanguage MapPerformance ProfilerPixel Drawing LibraryHTTP ServerTorqueScript ParserWebSocket Server

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommonutils

TorqueScript Parser

Module defined in `lua/common/utils/torqueScriptParser.lua`. Parses TorqueScript source code into an AST using PEG (Parsing Expression Grammar).

Module defined in lua/common/utils/torqueScriptParser.lua. Parses TorqueScript source code into an AST using PEG (Parsing Expression Grammar).


Exports

Functions

M.parse(s)

Parse a TorqueScript source string into an AST.

  • Parameters:
    • s - string - TorqueScript source code
  • Returns: table - Abstract Syntax Tree

Internal Notes

  • Uses lua-luaepnf (Extended PEG Notation Format) library for grammar definition
  • TorqueScript is BeamNG's legacy scripting language (from Torque3D engine)
  • Useful for automated migration/analysis of legacy scripts

See Also

  • utils/ - Utility Modules - Directory overview
  • calltracer Reference - Related reference
  • dateUtils Reference - Related reference
  • debugDraw Reference - Related reference
  • Common Libraries Overview - Guide

HTTP Server

Module defined in `lua/common/utils/simpleHttpServer.lua`. Simple HTTP server with static file serving, JSON responses, custom route handlers, and HTML templating.

WebSocket Server

Module defined in `lua/common/utils/wsUtils.lua`. WebSocket server creation and management utilities using BeamNG's `BNGWebWSServer` API.

On this page

ExportsFunctionsM.parse(s)Internal NotesSee Also