Ignore:
Timestamp:
08/18/09 01:11:29 (10 years ago)
Author:
bretzel_parpg
Message:

Started on putting options in the dialog map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/writing_editor/scripts/parser.py

    r250 r251  
    3636        self.resultFunction = result_function 
    3737        self.makeFunctions() 
    38         self.funcs = ["SCRIPTNAME", "NPC", "PC", "CALLSECTION", "ENDSECTION", "SECTION",  
     38        self.funcs = ["SCRIPTNAME", "NPC", "CALLSECTION", "ENDSECTION", "SECTION",  
    3939                      "SCRIPTNAME", "ENDOPTION", "OPTION", "PLAYSOUND",  
    40                       "SAY", "ATTACK", "RETURN", "ELIF", "IF", "ELSE"] 
     40                      "SAY", "ATTACK", "RETURN", "ELIF", "IF", "ELSE", "PC", "."] 
    4141 
    4242        self.func_by_name = {"NPC":self.npc, "PC":self.pc, "CALLSECTION":self.callsection, 
     
    4545                             "OPTION":self.option, "PLAYSOUND":self.playsound, 
    4646                             "SAY":self.say, "ATTACK":self.attack, "RETURN":self.return_, 
    47                              "ELIF":self.elif_, "IF":self.if_, "ELSE":self.else_} 
     47                             "ELIF":self.elif_, "IF":self.if_, "ELSE":self.else_, 
     48                             ".":self.option_item} 
    4849 
    4950 
     
    5354        @return: None 
    5455        """ 
    55         self.text = Word(alphas) 
     56        self.text = Word(alphanums) 
     57        self.nums = Word(nums) 
     58        self.period = Literal(".") 
    5659        self.space = Literal(" ") 
    5760        self.colon = Literal(":") 
     
    6568        self.scriptname = Combine(Word("SCRIPTNAME") + self.space + self.text) 
    6669        self.option = Combine(Word("OPTION") + self.space + self.text) 
     70        self.option_item = Combine(self.nums + Optional(self.space) + self.period + Optional(self.space) + self.text) 
    6771        self.endoption = Combine(Word("ENDOPTION") + self.space + self.text) 
    6872        self.playsound = Combine(Word("PLAYSOUND") + self.space + self.quote + self.text + self.quote) 
     
    102106 
    103107        for line in doc.split('\n'): 
    104             print line 
    105108            if (line == ""): 
    106109                continue 
Note: See TracChangeset for help on using the changeset viewer.