File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ function FluentNode:_init (ast, resource)
3030 end
3131 end
3232 end
33- tablex .foreachi (ast , function (leaf ) self :inject (leaf_to_node (leaf , resource )) end )
33+ tablex .foreachi (ast , function (leaf )
34+ local node = leaf_to_node (leaf , resource )
35+ self :inject (node )
36+ end )
3437end
3538
3639function FluentNode :inject (node )
@@ -111,16 +114,16 @@ end
111114
112115function FTL .Message :set_attribute (attribute )
113116 local id = attribute .id .name
114- local attributes = rawget ( self , " attributes" )
115- local map = rawget ( getmetatable (attributes ), " map" )
117+ local attributes = self . attributes
118+ local map = getmetatable (attributes ). map
116119 local k = # attributes + 1
117120 attributes [k ] = attribute
118121 map [id ] = k
119122end
120123
121124function FTL .Message :get_attribute (attribute )
122- local attributes = rawget ( self , " attributes" )
123- local map = rawget ( getmetatable (attributes ), " map" )
125+ local attributes = self . attributes
126+ local map = getmetatable (attributes ). map
124127 local k = map [attribute ]
125128 return attributes [k ]
126129end
Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ function FluentResource:get_message (identifier, isterm)
6969 local k = map [name ]
7070 local entry = body [k ]
7171 if not entry then return end
72- local attr = string.match (identifier , " %.([(%a[-_%a%d]+)$" )
73- return attr and entry :get_attribute (attr ) or entry
72+ local attribute = string.match (identifier , " %.([(%a[-_%a%d]+)$" )
73+ return attribute and entry :get_attribute (attribute ) or entry
7474end
7575
7676function FluentResource :get_term (identifier )
You can’t perform that action at this time.
0 commit comments