BeginProgram: Maps1

BeginMain:
	MapDecl: {<string>|<string>} dictionary
	
	PrintLine: "dictionary size: ", mapsize(dictionary)
	PrintLine: "dictionary is ", (isEmptyMap(dictionary) ? "empty" : "not empty")
	Assign: dictionary{"apple"} = "red"
	Assign: dictionary{"banana"} = "yellow"
	Assign: dictionary{"cantaloupe"} = "orange"
	Assign: dictionary{"dragonfruit"} = "red"
	Assign: dictionary{"elderberry"} = "purple"

	PrintLine: "dictionary size: ", mapsize(dictionary)
	PrintLine: "dictionary is ", (isEmptyMap(dictionary) ? "empty" : "not empty")

	PrintLine: "bananas are " , dictionary{"banana"} 

	ScalarDecl: <string> x = "dragonfruit"
	BeginIf: mapContains(dictionary, x)
		PrintLine: x , " are " , dictionary{x} 
	Else
		PrintLine: "Can't find " , x
	EndIf

	Assign: x = "fig"
	BeginIf: mapContains(dictionary, x)
		PrintLine: x , " are " , dictionary{x} 
	Else
		PrintLine: "Can't find " , x
	EndIf

	Assign: x = "elderberry"
	Statement: mapRemove(dictionary, x)
	BeginIf: mapContains(dictionary, x)
		PrintLine: x , " are " , dictionary{x} 
	Else
		PrintLine: "Can't find " , x
	EndIf
	
	PrintLine: mapToString(dictionary)
EndMain
EndProgram
