Simple value parser for deserializing value YSFFLUAU_TABLE-Parser format

Basically very simple parser that lets you retrive value from text:

local Parser = require("./Parser")
local try,value = pcall(Parser,[[
{
Hello = "World";
Vector3.zero;
"Cool Syntax" = true;
}
]])

It is not only limited with tables!

local value = Parser("5+5")

Althrough math here doesnt follow abstract trees is is fully calculated from right side to left order wise BUT NOT OPERATION WISE.
Parser does accept character escaping aswell:

local value = Parser([["\tTab\nNewLine"]])

Also supports most datatypes like CFrame for example:

local value = Parser([[
CFrame.new(0,10,0)*CFrame.Angles(0,math.pi*0.25,0)
]])

I was making a plugin where user should input tables in a text format for them to be parsed hence why i made that parser.
Im planning to release something even cooler :sunglasses: soon.
I have never in my life have written parser prior to that so it may be not the best implementation and honestly i regret using token system in general.
Plugin is written in --!strict mode so don’t worry about type errors.

https://create.roblox.com/store/asset/136331919522668
GitHub - YarikSuperpro/YSFFLUAU_TABLE-Parser

Cool download buttons (Press me to expand)

githubbutton|345x172.5
marketplace button|345x172.5

Fun fact:

YSFFLUAU_TABLE stands for Yarik’s Serialized Format for Luau table.

2 Likes

I dont know, this seems kinda cool, but why would you need to make tables in text format?

I mean if its for a future project, it might be nice, but who would ever input tables it text, you can’t even add data without making it hugely difficult.


LMAOAO, im sorry.

Try doing something more like this:

if not true then return end

its a lot more readable.

Good job, might someday use this idk.

That called undefined behavior.
You are returning wrong type with that example you shown.
Also there no any other way to do that anyway becouse you have to parse it manually as since string patterns is very limited.

Cool, now try making serializer for it in string format.

And why the hell you are arguing about “need of parser” in the post about parser itself?
!?!?!?! :skull:

Why would I make something thats useless, like who would actually need a serialiser that sorts tables in string format.

Not on my roadmap rn.

Im just saying the way I made it is a lot more readable, than a lot of nested code like you had in yours. Im trying to help you.

Im not arguing really, and im not saying theres a need for a parser at all, it doesnt matter if i made it in some other post. Im saying that no one needs a parser for string formatted tables, as its just easier to make one rather than having to make it in a string.

There is no autocomplete/intellisense.
no syntax highlighting.
and everything is just 10x harder to access and to append data to.

what example? the if statement?
I was just saying its a lot more readable than nested code like I previously mentioned. And what wrong type exactly? not true is just false? not a string or some other type?

Aswell as completelly paralized and broken :+1:

Ok fair but that a while loop so you cant do that+you must return tokens.

Parser is made purely for user input obviously and not to construct objects like that :skull:
Also i literally said that its for a plugin…

I get that, but just look at this part of your code

Screenshot 2025-06-15 at 10.26.53 PM

couldnt you have done:

if not match then return end

rather than having another indent? And it just continues… like for the rest of the screenshot i put on my last post.
And what difference does it make? Your can still make it so it returns a token at the end, while making it with my approach and why would it matter if its in a while loop, would it be different if it was in a for loop or smth?

What part of my response are you talking about? You havent quoted anything?

This will error.
You have to return tokens

uhh no it wont… You dont seem to understand.

that part of the script you dont even return anything. You just move on.
I see that its in a for loop, in that case, you can just do:

if not match then continue end

my error, but still, its a lot more readable that your code.

This will just continue to the next iteration, your code will do the same, but my version is 10x easier to read, rather than yours, which is very… i mean VERY unreadable.

Do you do any programming outside of roblox? Other developers would tell you the same things, people that use python, java, and people that went to uni, would all tell you, nested if statements are terrible.

Anyway, your not seeing the bigger picture, I still dont see a point to this, is this really neccessary? Like the whole thing? You just dont explain the benefits of this, and wouldn’t it be easier to be using a normal table instead? for your future project at least.

No one in their right mind would be using a string pretending its a table, its less performant keeping it as a string, as it needs to be parsed twice, unlike normal tables which are read straight by the roblox compiler, its more prone to fail, if appending or reading data goes wrong. And it takes up more memory in the long run, as again, it complies twice.

Like why? Just answer straight up, use a normal table for your future project, no need to reinvent the wheel.

1 Like

Maybe

I maybe wil look for that later

That not possible to grab userinput string and convert it into a table and more so serialize table into a string that would contain userdata/roblox types
That why this parser is made in the first place

DUDE I LITERALLY MADE IT FOR A DAMN PLUGIN WHERE YOU CAN COPY+PASTE TABLE TO A TEXTBOX :skull: WHY ARE YOU KEEP BRINGING UP THIS TOPIC?Im literally so confused as to what you are trying to prove.

2 Likes

Update v1.02 (technically 2nd update hence why v1.02)

  • Added some early returns in tokener as @JAcoboiskaka1121 suggested
  • Added support for types like: Enum[“Material”].Neon etc (side effect: Enum = .Neon → Enum = “Neon” althrough that is probably helpful now)
  • Color3 = true would now be a string and not a Color3 table for example:
    do [Color3] = true if you want to grab actual value and not a string.
  • fixed bug of nested table escaping outside. ( “;” or “,” separator were making it continue parsing till the first variable they see outside nested table)