6ad92e53 by Adam Heath

No longer tokenize keypath at all; the adapter does it. This allows for

foo.bar.baz.one.two.three type access, and, even possibly supporting
xpath or xql type access, if a suitablly sophisticated adapter is
written.
1 parent 7327fc5e
...@@ -180,7 +180,11 @@ defaultExpressionParser = (view, node, type, models, value) -> ...@@ -180,7 +180,11 @@ defaultExpressionParser = (view, node, type, models, value) ->
180 formatters: pipes 180 formatters: pipes
181 bypass: path.indexOf(':') != -1 181 bypass: path.indexOf(':') != -1
182 bindContext: models 182 bindContext: models
183 firstPart = splitPath.shift() 183 parsingSupport = Rivets.config.adapter.parsingSupport
184 firstPart = if parsingSupport
185 splitPath[0]
186 else
187 splitPath.shift()
184 model = if firstPart 188 model = if firstPart
185 Rivets.config.adapter.read models, firstPart 189 Rivets.config.adapter.read models, firstPart
186 else 190 else
...@@ -191,7 +195,7 @@ defaultExpressionParser = (view, node, type, models, value) -> ...@@ -191,7 +195,7 @@ defaultExpressionParser = (view, node, type, models, value) ->
191 if dependencies = context.shift() 195 if dependencies = context.shift()
192 options.dependencies = dependencies.split /\s+/ 196 options.dependencies = dependencies.split /\s+/
193 197
194 binding = new Rivets.Binding node, type, model, keypath, options 198 binding = new Rivets.Binding node, type, (if parsingSupport then models else model), keypath, options
195 binding.view = view 199 binding.view = view
196 200
197 binding 201 binding
......