~ubuntu-branches/ubuntu/utopic/slimit/utopic

« back to all changes in this revision

Viewing changes to src/slimit/lexer.py

  • Committer: Package Import Robot
  • Author(s): TANIGUCHI Takaki
  • Date: 2012-05-21 10:10:05 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120521101005-gri2543svknqok53
Tags: 0.7.2-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
        # Terminal types
242
242
        'NUMBER', 'STRING', 'ID', 'REGEX',
243
243
 
 
244
        # Properties
 
245
        'GETPROP', 'SETPROP',
 
246
 
244
247
        # Comments
245
248
        'LINE_COMMENT', 'BLOCK_COMMENT',
246
249
 
411
414
        )
412
415
    identifier = identifier_start + identifier_part
413
416
 
 
417
    getprop = r'get' + r'(?=\s' + identifier + r')'
 
418
    @ply.lex.TOKEN(getprop)
 
419
    def t_GETPROP(self, token):
 
420
        return token
 
421
 
 
422
    setprop = r'set' + r'(?=\s' + identifier + r')'
 
423
    @ply.lex.TOKEN(setprop)
 
424
    def t_SETPROP(self, token):
 
425
        return token
 
426
 
414
427
    @ply.lex.TOKEN(identifier)
415
428
    def t_ID(self, token):
416
429
        token.type = self.keywords_dict.get(token.value, 'ID')