/LuaLexer

This extension for Mediawiki add a Lua lexer for modules. This makes it possible to build parse tree for Lua code, to facilitate further lexical analysis in a collaborative environment.

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

GitHub issues

NOTE: This is only in the preparation. The goal is to insert LoganDark/lua-lexer and make it available.

This extension for Mediawiki add a Lua lexer for modules provided by the Scribunto extension. This makes it possible to build parse tree for Lua code, to facilitate further lexical analysis in a collaborative environment.

Usage

LuaLexer depends on the Scribunto extension, and provide a parse tree for Lua code.

  1. Download from Github (zip) and place the file(s) in a directory called LuaLexer in your extensions/ folder.

  2. Add the following code at the bottom of your LocalSettings.php:

    wfLoadExtension( 'LuaLexer' );
  3. Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Development

LuaLexer uses Mediawiki-Vagrant, and an instance can be made quite easily. A more complete setup can be found at the page vagrant.

  1. Make sure you have Vagrant, etc, prepare a development directory, and move to that directory.

  2. Clone Mediawiki

    git clone --recursive https://gerrit.wikimedia.org/r/mediawiki/vagrant .
  3. Add the role unless #? has been merged. (You need git-review to do this.)

    git review -d ?
  4. Run setup.

    ./setup.sh
  5. Enable role for LuaLexer. This pulls in the role for Scribunto, which then pulls in additional roles.

    vagrant roles enable lualexer
  6. Start the instance.

    vagrant up
  7. Done.