~ubuntu-branches/debian/experimental/haserl/experimental

« back to all changes in this revision

Viewing changes to src/haserl_lualib.lua

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2015-02-19 04:36:21 UTC
  • mfrom: (1.2.1) (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20150219043621-6db7ppltyp7r8ukz
Tags: 0.9.34-1
* [8f33166] Imported Upstream version 0.9.34
* [88cf705] Bump Standards-Version to 3.9.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
function haserl.setfield (f, v)
26
26
                                                -- From programming in Lua 1st Ed.
27
27
        local t = _G                            -- start with the table of globals
28
 
        for w, d in string.gfind(f, '([%w_%-]+)(.?)') do
 
28
        for w, d in string.gmatch(f, '([%w_%-]+)(.?)') do
29
29
                if (tonumber(w)) then
30
30
                        w = tonumber(w)
31
31
                end
40
40
 
41
41
function haserl.getfield (f)
42
42
        local v = _G                            -- start with the table of globals
43
 
        for w in string.gfind(f, '[%w_]+') do
 
43
        for w in string.gmatch(f, '[%w_]+') do
44
44
                v = v[w]
45
45
        end
46
46
        return v