text
stringlengths
0
15.7k
source
stringlengths
6
112
mainJsonBuilder's toString()
map.applescript
property __keyIndexHash : {}
map.applescript
property __val_lo : 32
map.applescript
property __val_hi : 126
map.applescript
property __val_0 : 48
map.applescript
property __val_9 : 57
map.applescript
property __upper_a : 65
map.applescript
property __upper_z : 90
map.applescript
property __lower_a : 97
map.applescript
property __lower_z : 122
map.applescript
property __unsupported_chr : __val_hi - __val_lo + 1
map.applescript
on __makeGlyphNode() -- (void) as node
map.applescript
set nodeList to {}
map.applescript
repeat with i from 1 to __unsupported_chr
map.applescript
set end of nodeList to missing value
map.applescript
set theNode to {index:missing value, nodes:nodeList}
map.applescript
return theNode
map.applescript
end __makeGlyphNode
map.applescript
on __makeGlyphInNode(parentNode, idx) --(node, int) as node
map.applescript
set foundNode to item idx of nodes of parentNode
map.applescript
if (foundNode is not missing value) then
map.applescript
return foundNode
map.applescript
set newNode to __makeGlyphNode() of me
map.applescript
set item idx of nodes of parentNode to newNode
map.applescript
return newNode
map.applescript
end __makeGlyphInNode
map.applescript
on __getGlyphInNode(parentNode, idx) --(node, int) as node
map.applescript
return item idx of nodes of parentNode
map.applescript
end __getGlyphInNode
map.applescript
on __setKeyAndIndexToHash(key, idx) --(string, int) as void
map.applescript
if (count __keyIndexHash) = 0 then
map.applescript
set __keyIndexHash to __makeGlyphNode() of me
map.applescript
set newNode to __keyIndexHash
map.applescript
set lastChr to (count key)
map.applescript
set nodeIdx to __chrToHashIndex(item chr of key) of me
map.applescript
set newNode to __makeGlyphInNode(newNode, nodeIdx) of me
map.applescript
set index of newNode to idx
map.applescript
end __setKeyAndIndexToHash
map.applescript
on __getIndexForKey(key) -- (string) as int or missing value
map.applescript
set currentNode to __keyIndexHash
map.applescript
set idx to missing value
map.applescript
set idx to index of currentNode
map.applescript
return idx
map.applescript
end __getIndexForKey
map.applescript
on __chrToHashIndex(chr) -- (string) as int
map.applescript
set val to ((id of chr) - __val_lo) + 1
map.applescript
if val is greater than or equal to __unsupported_chr or val is less than or equal to 1 then
map.applescript
set val to __unsupported_chr
map.applescript
end __chrToHashIndex
map.applescript
on hashDescription()
map.applescript
__traverseChildNodes(__keyIndexHash) of me
map.applescript
end hashDescription
map.applescript
on __traverseChildNodes(node)
map.applescript
__printNode(node) of me
map.applescript
if ((item i of nodes of node) is not missing value) then
map.applescript
__traverseChildNodes(item i of nodes of node)
map.applescript
end __traverseChildNodes
map.applescript
on __printNode(node) -- (node) as string
map.applescript
set end of output to (character id (i + __val_lo - 1))
map.applescript
set end of output to "."
map.applescript
set end of output to index of node as string
map.applescript
log __JoinList(output, " ") of me
map.applescript
end __printNode
map.applescript
on __JoinList(theList, TheDelimiter)
map.applescript
set AppleScript's text item delimiters to {TheDelimiter}
map.applescript
end __JoinList
map.applescript
newMethod("newInstanceFromString")
map.applescript
set sut to my newInstanceFromString("
map.applescript
assertEqual("TypeScript", sut's getValue("ts"), "First Item")
map.applescript
assertEqual("Markdown", sut's getValue("md"), "Second Item")
map.applescript
assertEqual(missing value, sut's getValue("nah"), "Not found")
map.applescript
newMethod("toJsonString")
map.applescript
assertEqual("{\"ts\": \"TypeScript\", \"md\": \"Markdown\"}", sut's toJsonString(), "Basic")
map.applescript
newMethod("clear")
map.applescript
sut's clear()
map.applescript
assertEqual("{}", sut's toJsonString(), "Basic")
map.applescript
newMethod("isEmpty")
map.applescript
set sut to my new()
map.applescript
assertTrue(sut's isEmpty(), "Empty")
map.applescript
sut's putValue("first", "una")
map.applescript
assertFalse(sut's isEmpty(), "Non-Empty")
map.applescript
set logger to std's import("logger")'s new("map")
map.applescript
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables({})
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
on fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables(prefs)
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
set tableNames to fmGUI_ManageSecurity_AccessRecord_GetTablesNames({})
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
set recordAccessList to {}
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
repeat with oneTableName in tableNames
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
set oneTableRec to fmGUI_ManageSecurity_AccessRecord_GetInfo_OneTable({tableName:oneTableName})
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
copy oneTableRec to end of recordAccessList
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
return recordAccessList
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
error "unable to fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables - " & errMsg number errNum
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
end fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables
fmGUI_ManageSecurity_AccessRecord_GetInfo_AllTables.applescript
property NSDataDetector : class "NSDataDetector"
ASDataDetector.applescript
property NSLocale : class "NSLocale"
ASDataDetector.applescript
on detectData(theText, dataTypes)
ASDataDetector.applescript
set num to 0
ASDataDetector.applescript
repeat with thisType in dataTypes
ASDataDetector.applescript
set num to num + (thisType as integer)
ASDataDetector.applescript
set aDetector to NSDataDetector's dataDetectorWithTypes:num |error|:(missing value)
ASDataDetector.applescript
set matches to aDetector's matchesInString:theText options:0 range:{location:0, |length|:count theText}
ASDataDetector.applescript