Changeset 1574 for cobra/trunk/Source/CobraTokenizer.cobra
- Timestamp:
- 08/12/08 23:46:19 (5 months ago)
- Files:
-
- 1 modified
-
cobra/trunk/Source/CobraTokenizer.cobra (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/CobraTokenizer.cobra
r1572 r1574 1 use System.Text.RegularExpressions 2 3 1 4 class CobraTokenizer 2 5 inherits Tokenizer … … 392 395 #print '<> onWHITESPACE_COMMENT_2' 393 396 return nil 394 397 395 398 ## 396 399 ## Comment out block … … 507 510 return tok 508 511 512 var _directiveRE = Regex(r'#\s*\.([\w\-]+)\.', RegexOptions.Compiled) 513 509 514 def onSINGLE_LINE_COMMENT(tok as IToken) as IToken? 510 515 # eat these 516 517 # check for .no-warnings. 518 reMatch = _directiveRE.match(tok.text) 519 if reMatch.success 520 name = reMatch.groups[1].value 521 branch name 522 on 'no-warnings', .addNoWarning(tok) 523 # for testify 524 on 'args', pass # TODO: actually this could be worth implementing outside of testify 525 on 'compile-only', pass 526 on 'error', pass 527 on 'multi', pass 528 on 'multipart', pass 529 on 'skip', pass 530 on 'warning', pass 531 else, .throwError('Unrecognized compiler directive "[name]".') 532 511 533 return nil 512 534
