Guest User

Untitled

a guest
Apr 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. -- OUTPUT:
  2. -- Lua Version: Lua 5.1
  3. -- LPeg Version: 0.9
  4. -- <segmentation fault>
  5.  
  6. local lpeg = require "lpeg"
  7. local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V
  8. local C, Cs, Ct = lpeg.C, lpeg.Cs, lpeg.Ct
  9. local match = lpeg.match
  10.  
  11. local format = P {
  12. 'string',
  13. string = ((V 'literal')^0) * -1,
  14. literal = C(( P(1) - '%' )^1),
  15. }
  16.  
  17. print("Lua Version: " .. _VERSION)
  18. print("LPeg Version: " .. lpeg.version())
  19. match(Cs(#format), 'fooo')
Add Comment
Please, Sign In to add comment