Simple Löve/Lua highlight parser

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
BrotSagtMist
Party member
Posts: 607
Joined: Fri Aug 06, 2021 10:30 pm

Simple Löve/Lua highlight parser

Post by BrotSagtMist »

Something i had laying around and was about to replace: A simple lua parser compatible with Löves print function.
parse.zip
(2.68 KiB) Downloaded 176 times
Maybe someone can find a use for it.
Features :
-compatible with most of luajit syntax (only unique comment blocks may fail)
-Brackets/blocks are checked for closing
-colors are detected
-==,~= and >= are separated
-themeable
Usage:

Code: Select all

parse=require("lovehl")
T={"each line in its own string\n",
"ending with newline\n"}
TP= parse(T)-- turns each string into a table in another table
love.graphics.print(TP[1]) -- that Löve can print
Example output
Image
Example usage in a text editor:
Image
As bonus ive added a rainbow text converter that follows the same usage, simply require rainbow to get:
Image
obey
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Simple Löve/Lua highlight parser

Post by Gunroar:Cannon() »

Woah, really cool! Very useful, and nice rainbow function(though may not be very practical :ultrahappy: )
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: Google [Bot], targetcreature and 52 guests