示例#1
0
 def __init__(self):
     super().__init__()
     self.max_keyword = MAXIMUM_KEYWORD
     self.max_function = MAXIMUM_FUNCTION
     self.name = "Dragon Tokens"
     self.keyword_dictionary = invert_dictionary(
         self.keyword_token_dictionary)
     self.function_dictionary = invert_dictionary(
         self.function_token_dictionary)
示例#2
0
 def __init__(self):
     self.state = KEYWORD
     self.max_keyword = MAXIMUM_KEYWORD
     self.max_function = MAXIMUM_FUNCTION
     self.name = "Empty tokens"
     self.keyword_dictionary = invert_dictionary(
         self.keyword_token_dictionary)
     self.function_dictionary = invert_dictionary(
         self.function_token_dictionary)
示例#3
0
 def __init__(self):
     super().__init__()
     self.keyword_token_dictionary = {
         **self.keyword_token_dictionary,
         **self.dos_keyword_token_dictionary
     }
     self.function_token_dictionary = {
         **self.function_token_dictionary,
         **self.dos_function_token_dictionary
     }
     self.max_keyword = MAXIMUM_DOS_KEYWORD
     self.max_function = MAXIMUM_DOS_FUNCTION
     self.name = "Coco Extended RSDOS tokens"
     self.keyword_dictionary = invert_dictionary(
         self.keyword_token_dictionary)
     self.function_dictionary = invert_dictionary(
         self.function_token_dictionary)
示例#4
0
def test_given_an_empty_dictionary_invert_dictionary_returns_empty():
    source = {}
    expected = {}
    actual = invert_dictionary(source)
    assert actual == expected
示例#5
0
def test_given_a_dictionary_invert_dictionary_returns_inverse_dictionary():
    source = {0x80: "FOR", 0x81: "GO"}
    expected = {"FOR": 0x80, "GO": 0x81}
    actual = invert_dictionary(source)
    assert actual == expected