Tag: lua

Lua Rocks

Inspired by reading [cached]Lua - an extensible extension language, specifically the section on using fallbacks to implement an expression parser, I wanted to see if I could do so in a safe manner. With safe meaning parsed expressions must not be able to execute arbitrary code.

Half an hour later, I have to say it is surprisingly easy! Less than 50 lines (including comments) is all it takes:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 …

© Julian Schrittwieser. Built using Pelican. Theme by Giulio Fidente on github. .