File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,17 @@ function FTL.Message:set_attribute (attribute)
124124 local k = # attributes + 1
125125 attributes [k ] = attribute
126126 map [id ] = k
127+ -- TODO Fix with working catch?
128+ -- getmetatable(self)[id] = attribute
127129end
128130
129131function FTL .Message :get_attribute (attribute )
130- local attributes = rawget (self , " attributes" ) or error (" No attributes" )
132+ -- local raw = rawget(self, attribute)
133+ -- if raw then return raw end
134+ -- if not rawget(self, "id") then
135+ -- error("Penlight bug, please use get_attribute() rather than table index syntax for now")
136+ -- end
137+ local attributes = rawget (self , " attributes" )
131138 local map = getmetatable (attributes ).map
132139 local k = map [attribute ]
133140 return attributes [k ]
Original file line number Diff line number Diff line change @@ -56,10 +56,17 @@ function FluentResource:load_node (node)
5656 id_name = " -" .. id_name
5757 end
5858 map [id_name ] = k
59+ -- TODO Fix with working catch?
60+ -- getmetatable(self)[id_name] = node
5961 end
6062end
6163
6264function FluentResource :get_message (identifier , isterm )
65+ -- local raw = rawget(self, identifier)
66+ -- if raw then return raw end
67+ -- if not rawget(self, "id") then
68+ -- error("Penlight bug, please use get_message() rather than table index syntax for now")
69+ -- end
6370 local id = string.match (identifier , " ^(%a[-_%a%d]+)" )
6471 if not id then return end
6572 local name = (isterm and " -" or " " ) .. id
You can’t perform that action at this time.
0 commit comments