generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Lpeg

Previous Thread :: Next Thread 
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
23 Apr 2013 03:33 PM
I'm looking into using Lpeg to parse a wiki-style syntax into a GUI system (clearly, not as flexible, but good enough for me), that I can use to write stuff with. However, I can't seem to find a portable Lpeg system that I can use.

Does anyone know how I could port Lpeg into ROBLOX? It would appear parts of it are written in C, but I can't be sure. Clarification would be nice, as well as any alternatives or facts I'm missing.

Also, are there any other libraries that people have ported into ROBLOX? I've ported portions of Penlight, and ROBLOX's RbxUtil runs on a ported JSON library. Past that, are there any other ported libraries out there?

Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
23 Apr 2013 03:34 PM
Afaik LPEG was all written in C using the Lua API, otherwise I'd use Moonscript in Roblox :/. By wiki-style, do you mean something like HTML/XML? I don't know what the wiki uses but if it's like that then that shouldn't be too hard..
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
23 Apr 2013 03:40 PM
It's the media-wiki system I thought I would use. It's not too hard to switch around the syntax with a good pattern system.

Mostly it would just be for headers and bold font, I mean, ROBLOX doesn't support much more. It's all I need. :D
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
23 Apr 2013 05:48 PM
I actually just found a markdown --> html script written in Lua, so I'll probably be using that to convert my stuff into tables and then converting that into my own styling system.

Anyone got any better ideas?
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
23 Apr 2013 05:52 PM
Nope, not really...

~ Slapped by Dekkonot ~
Report Abuse
ColorfulBody is not online. ColorfulBody
Joined: 17 Jun 2012
Total Posts: 2353
23 Apr 2013 07:48 PM
"I've ported portions of Penlight"

I've ported the class system, the XML module and the utils. I'm interested in whatever you have ported.

_________________________________________________________________________
I possess 4 ROBUX and 29 tickets.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
23 Apr 2013 07:58 PM
I ported Lexar and Pretty... Pretty easy considering it's just string stuff. :D

I also recently ported a Markdown system (Not penlight), and modified it into a parsing system for ROBLOX GUI's... And I get tables like this (pastebin: FEydgt2Z), which of course, I'm sure you can see the possibilities (And I'm exploiting them)
Report Abuse
ColorfulBody is not online. ColorfulBody
Joined: 17 Jun 2012
Total Posts: 2353
23 Apr 2013 07:58 PM
"I actually just found a markdown --> html script written in Lua, so I'll probably be using that to convert my stuff into tables and then converting that into my own styling system."

Porting LPEG would be a good idea because there are many libraries and tools in Lua that use it, and we could then use all of those in pure Lua (which means we could use them on ROBLOX). This includes MoonScript; just imagine how amazing it'd be to be able to create MoonScript script builders!

Anyway, if you could create a module/library that can be used to display Markdown markup in GUIs, I'd be interested. Markdown's very useful for writing documentation, and I have many documentation files for various projects written in Markdown; if I could just send the markup to a library and get it displayed as a GUI, then my life would be easier.

I think you should write a library that can display basic HTML code using a default style that cannot be changed. It wouldn't be possible to do much with that, but it'd be great for creating documentation files with tables, basic styling, headers, lists, etc.

Supporting just Markdown would be fine, but the problem with that is that Markdown doesn't have tables, and that tables are super cool.

Anaminus' gloo library has a great system for creating tables. The problem is that, right now, writing documentation files for anything that show in GUIs is just incredibly hard: either it's just text, or you have to write complex code to create the file correctly.

_________________________________________________________________________
I possess 4 ROBUX and 29 tickets.
Report Abuse
ColorfulBody is not online. ColorfulBody
Joined: 17 Jun 2012
Total Posts: 2353
23 Apr 2013 08:13 PM
Could you publish your ported pl.pretty somewhere? (and also your ported pl.lexer)

_________________________________________________________________________
I possess 4 ROBUX and 29 tickets.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
23 Apr 2013 08:17 PM
> Porting LPEG would be a good idea because there are many libraries and tools in Lua that use it, and we could then use all of those in pure Lua (which means we could use them on ROBLOX). This includes MoonScript; just imagine how amazing it'd be to be able to create MoonScript script builders!

Yeah, I want to just use LPEG for just expressions and tokenizing/splitting strings, as well as yes, compiling MoonScript, etc. I'm not about to spend hours porting it though....

As for Markdown, well, it'll work. My uh. libraries are highly dependent upon other scripts.

Currently I have about 27,000 lines of code in my system, but about 12,000 is redundant (being cloned from global to local from my compiler). That's becoming a rather large problem due to cross-dependencies and stuff, and most of my systems are interdependent (something like a ton of requires being listed at the top of a Lua modular).

An HTML system... well... seeing as I can't even parse markdown without a 1000 line long script, well, I don't think I'll be parsing HTML anytime soon. :D

As for Anaminus's gloo tables... I never understood them, but I did see his comments complaining about offset --> scale problems, which makes me want to steer far away from them.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
23 Apr 2013 08:45 PM
Oh, published the Penlight's on GitHub. :D
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
24 Apr 2013 07:55 PM
And... it works!

https://twitter.com/RbxQuenty/status/327223371458822145/photo/1
Report Abuse
ColorfulBody is not online. ColorfulBody
Joined: 17 Jun 2012
Total Posts: 2353
24 Apr 2013 08:14 PM
@Quenty

That's great! What does it support right now?

_________________________________________________________________________
I possess 4 ROBUX and 25 tickets.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
24 Apr 2013 08:32 PM
Headers and normal text, but it's flexible.
local Handlers = {
normal = function(Data, NewContainer, ScreenGui)
if Data.text ~= "" then
local TextContent = {}

TextContent[1] = { -- Will improve later for markdown emphasis, etc.
Text = Data.text;
Style = Styles.Normal;
}

local NewContainer, ContainerHeight = ConstructParagraph(NewContainer, TextContent, {
LineSpacingAt = 1.15; -- Standard in MS Word (115%)
}, ScreenGui)

return NewContainer, ContainerHeight
else
print("[ParagraphConstructor] - Data.text == \"\"");
return false;
end
end;
header = function(Data, NewContainer, ScreenGui)
if Data.text ~= "" then
local TextContent = {}

TextContent[1] = {
Text = assert(Data.text, "Data.text is nil");
Style = Styles.Headers[Data.level or 1];
}

local NewContainer, ContainerHeight = ConstructParagraph(NewContainer, TextContent, {
LineSpacingAt = 1;
}, ScreenGui)


return NewContainer, ContainerHeight
else
print("[ParagraphConstructor] - Data.text == \"\"");
return false;
end
end;
}
Report Abuse
IncrementXtwo is not online. IncrementXtwo
Joined: 18 Sep 2013
Total Posts: 10369
23 Nov 2016 07:11 PM
i still need lpeg.

i am working on a system that needs lpeg.

until or if roblox adds lpeg to the lua env i will be looking for a good port


I lurk in the shadows of ot http://www.roblox.com/--item?id=547395788
Report Abuse
IncrementXtwo is not online. IncrementXtwo
Joined: 18 Sep 2013
Total Posts: 10369
23 Nov 2016 08:11 PM
#HelpScriptersInNeedOfLpeg


I lurk in the shadows of ot http://www.roblox.com/--item?id=547395788
Report Abuse
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
23 Nov 2016 08:17 PM
^
http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting
Report Abuse
IncrementXtwo is not online. IncrementXtwo
Joined: 18 Sep 2013
Total Posts: 10369
23 Nov 2016 08:18 PM
^
i know scripting and before you say: "STRING PATTERNS!!!!!11!!!!"

lpeg is way more powerful then string patterns.




I lurk in the shadows of ot http://www.roblox.com/--item?id=547395788
Report Abuse
IncrementXtwo is not online. IncrementXtwo
Joined: 18 Sep 2013
Total Posts: 10369
23 Nov 2016 08:34 PM
we need lpeg in roblox


I lurk in the shadows of ot http://www.roblox.com/--item?id=547395788
Report Abuse
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
23 Nov 2016 08:39 PM
Why do you think you need it?
Report Abuse
IncrementXtwo is not online. IncrementXtwo
Joined: 18 Sep 2013
Total Posts: 10369
23 Nov 2016 08:51 PM
a string based DSL




I lurk in the shadows of ot http://www.roblox.com/--item?id=547395788
Report Abuse
IncrementXtwo is not online. IncrementXtwo
Joined: 18 Sep 2013
Total Posts: 10369
23 Nov 2016 09:13 PM
bump


I lurk in the shadows of ot http://www.roblox.com/--item?id=547395788
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image