Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -774,6 +774,35 @@ Identifier: function(node, st, c) { | |
} | ||
} | ||
}, | ||
DictionaryLiteral: function(node, st, c) { | ||
CONCAT(st.compiler.jsBuffer, st.compiler.source.substring(st.compiler.lastPos, node.start)); | ||
st.compiler.lastPos = node.start; | ||
|
||
if (!node.keys.length) { | ||
CONCAT(st.compiler.jsBuffer, "objj_msgSend(objj_msgSend(CPDictionary, \"alloc\"), \"init\")"); | ||
} else { | ||
CONCAT(st.compiler.jsBuffer, "objj_msgSend(objj_msgSend(CPDictionary, \"alloc\"), \"initWithObjectsAndKeys:\""); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aljungberg
Author
Member
|
||
for (var i = 0; i < node.keys.length; i++) { | ||
var key = node.keys[i], | ||
value = node.values[i]; | ||
|
||
CONCAT(st.compiler.jsBuffer, ", "); | ||
|
||
st.compiler.lastPos = value.start; | ||
c(value, st, "Expression"); | ||
CONCAT(st.compiler.jsBuffer, st.compiler.source.substring(st.compiler.lastPos, value.end)); | ||
|
||
CONCAT(st.compiler.jsBuffer, ", "); | ||
|
||
st.compiler.lastPos = key.start; | ||
c(key, st, "Expression"); | ||
CONCAT(st.compiler.jsBuffer, st.compiler.source.substring(st.compiler.lastPos, key.end)); | ||
} | ||
CONCAT(st.compiler.jsBuffer, ")"); | ||
} | ||
|
||
st.compiler.lastPos = node.end; | ||
}, | ||
SelectorLiteralExpression: function(node, st, c) { | ||
CONCAT(st.compiler.jsBuffer, st.compiler.source.substring(st.compiler.lastPos, node.start)); | ||
CONCAT(st.compiler.jsBuffer, "sel_getUid(\""); | ||
|
1 comment
on commit 5200f94
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAY!!!
Do you think, perhaps, we should be using CFDictionaries here (since those exist at the language level) instead of CPDictionaries?