Lines Matching refs:nesting_state
129 nesting_state = cpplint.NestingState()
132 nesting_state, error_collector)
145 nesting_state = cpplint.NestingState()
147 nesting_state.Update('foo.h', lines, i, error_collector)
148 cpplint.CheckStyle('foo.h', lines, i, 'h', nesting_state,
151 nesting_state, error_collector)
152 nesting_state.CheckCompletedBlocks('foo.h', error_collector)
160 nesting_state = cpplint.NestingState()
167 nesting_state, error_collector)
200 nesting_state = cpplint.NestingState()
206 nesting_state, error_collector)
258 nesting_state = cpplint.NestingState()
260 nesting_state.Update('foo.h', lines, i, error_collector)
261 cpplint.CheckForNamespaceIndentation('foo.h', nesting_state,
5340 self.nesting_state = cpplint.NestingState()
5346 self.nesting_state.Update('test.cc',
5351 self.assertEquals(self.nesting_state.stack, [])
5355 self.assertEquals(len(self.nesting_state.stack), 1)
5356 self.assertTrue(isinstance(self.nesting_state.stack[0],
5358 self.assertTrue(self.nesting_state.stack[0].seen_open_brace)
5359 self.assertEquals(self.nesting_state.stack[0].name, '')
5362 self.assertEquals(len(self.nesting_state.stack), 3)
5363 self.assertTrue(self.nesting_state.stack[0].seen_open_brace)
5364 self.assertTrue(self.nesting_state.stack[1].seen_open_brace)
5365 self.assertFalse(self.nesting_state.stack[2].seen_open_brace)
5366 self.assertEquals(self.nesting_state.stack[0].name, '')
5367 self.assertEquals(self.nesting_state.stack[1].name, 'outer')
5368 self.assertEquals(self.nesting_state.stack[2].name, 'inner')
5371 self.assertTrue(self.nesting_state.stack[2].seen_open_brace)
5374 self.assertEquals(len(self.nesting_state.stack), 0)
5378 self.assertEquals(len(self.nesting_state.stack), 1)
5379 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5380 self.assertEquals(self.nesting_state.stack[0].name, 'A')
5381 self.assertFalse(self.nesting_state.stack[0].is_derived)
5382 self.assertEquals(self.nesting_state.stack[0].class_indent, 0)
5386 self.assertEquals(len(self.nesting_state.stack), 1)
5387 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5388 self.assertEquals(self.nesting_state.stack[0].name, 'B')
5389 self.assertTrue(self.nesting_state.stack[0].is_derived)
5394 self.assertEquals(len(self.nesting_state.stack), 1)
5395 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5396 self.assertEquals(self.nesting_state.stack[0].name, 'C')
5397 self.assertTrue(self.nesting_state.stack[0].is_derived)
5401 self.assertEquals(len(self.nesting_state.stack), 0)
5404 self.assertEquals(len(self.nesting_state.stack), 2)
5405 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5406 self.assertEquals(self.nesting_state.stack[0].name, 'D')
5407 self.assertFalse(self.nesting_state.stack[0].is_derived)
5408 self.assertTrue(isinstance(self.nesting_state.stack[1], cpplint._ClassInfo))
5409 self.assertEquals(self.nesting_state.stack[1].name, 'E')
5410 self.assertFalse(self.nesting_state.stack[1].is_derived)
5411 self.assertEquals(self.nesting_state.stack[1].class_indent, 2)
5412 self.assertEquals(self.nesting_state.InnermostClass().name, 'E')
5415 self.assertEquals(len(self.nesting_state.stack), 0)
5419 self.assertEquals(len(self.nesting_state.stack), 1)
5420 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5421 self.assertEquals(self.nesting_state.stack[0].access, 'private')
5424 self.assertEquals(self.nesting_state.stack[0].access, 'public')
5426 self.assertEquals(self.nesting_state.stack[0].access, 'public')
5428 self.assertEquals(self.nesting_state.stack[0].access, 'protected')
5430 self.assertEquals(self.nesting_state.stack[0].access, 'private')
5433 self.assertEquals(len(self.nesting_state.stack), 2)
5434 self.assertTrue(isinstance(self.nesting_state.stack[1], cpplint._ClassInfo))
5435 self.assertEquals(self.nesting_state.stack[1].access, 'public')
5436 self.assertEquals(self.nesting_state.stack[0].access, 'private')
5439 self.assertEquals(self.nesting_state.stack[1].access, 'protected')
5440 self.assertEquals(self.nesting_state.stack[0].access, 'private')
5443 self.assertEquals(len(self.nesting_state.stack), 0)
5447 self.assertEquals(len(self.nesting_state.stack), 1)
5448 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5449 self.assertEquals(self.nesting_state.stack[0].name, 'A')
5450 self.assertFalse(self.nesting_state.stack[0].is_derived)
5454 self.assertEquals(len(self.nesting_state.stack), 1)
5455 self.assertFalse(isinstance(self.nesting_state.stack[0],
5459 self.assertEquals(len(self.nesting_state.stack), 0)
5462 self.assertEquals(len(self.nesting_state.pp_stack), 0)
5464 self.assertEquals(len(self.nesting_state.pp_stack), 1)
5466 self.assertEquals(len(self.nesting_state.pp_stack), 0)
5469 self.assertEquals(len(self.nesting_state.pp_stack), 1)
5471 self.assertEquals(len(self.nesting_state.pp_stack), 1)
5473 self.assertEquals(len(self.nesting_state.pp_stack), 2)
5475 self.assertEquals(len(self.nesting_state.pp_stack), 2)
5477 self.assertEquals(len(self.nesting_state.pp_stack), 1)
5479 self.assertEquals(len(self.nesting_state.pp_stack), 0)
5488 self.assertEquals(len(self.nesting_state.pp_stack), 0)
5489 self.assertEquals(len(self.nesting_state.stack), 1)
5490 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5491 self.assertEquals(self.nesting_state.stack[0].name, 'A')
5493 self.assertEquals(len(self.nesting_state.stack), 0)
5497 self.assertEquals(len(self.nesting_state.pp_stack), 1)
5498 self.assertEquals(len(self.nesting_state.stack), 1)
5499 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5500 self.assertEquals(self.nesting_state.stack[0].name, 'D')
5501 self.assertFalse(self.nesting_state.stack[0].is_derived)
5505 self.assertEquals(len(self.nesting_state.stack), 1)
5506 self.assertEquals(self.nesting_state.stack[0].name, 'D')
5507 self.assertTrue(self.nesting_state.stack[0].is_derived)
5508 self.assertFalse(self.nesting_state.stack[0].seen_open_brace)
5512 self.assertEquals(len(self.nesting_state.stack), 1)
5513 self.assertEquals(self.nesting_state.stack[0].name, 'D')
5514 self.assertFalse(self.nesting_state.stack[0].is_derived)
5515 self.assertTrue(self.nesting_state.stack[0].seen_open_brace)
5518 self.assertEquals(len(self.nesting_state.pp_stack), 0)
5519 self.assertEquals(len(self.nesting_state.stack), 1)
5520 self.assertEquals(self.nesting_state.stack[0].name, 'D')
5521 self.assertFalse(self.nesting_state.stack[0].is_derived)
5522 self.assertFalse(self.nesting_state.stack[0].seen_open_brace)
5525 self.assertEquals(len(self.nesting_state.stack), 0)
5530 self.assertEquals(len(self.nesting_state.stack), 0)
5532 self.assertEquals(len(self.nesting_state.stack), 1)
5533 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5534 self.assertEquals(self.nesting_state.stack[0].name, 'A')
5540 self.assertEquals(len(self.nesting_state.stack), 1)
5541 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5542 self.assertEquals(self.nesting_state.stack[0].name, 'C')
5544 self.assertEquals(len(self.nesting_state.stack), 0)
5547 self.assertEquals(len(self.nesting_state.stack), 1)
5548 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5549 self.assertEquals(self.nesting_state.stack[0].name, 'D')
5552 self.assertEquals(len(self.nesting_state.stack), 0)
5559 self.assertEquals(len(self.nesting_state.stack), 1)
5560 self.assertFalse(isinstance(self.nesting_state.stack[0],
5564 self.assertEquals(len(self.nesting_state.stack), 1)
5565 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5566 self.assertEquals(self.nesting_state.stack[0].name, 'K')
5571 self.assertEquals(len(self.nesting_state.stack), 1)
5572 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5577 self.assertEquals(len(self.nesting_state.stack), 2)
5578 self.assertTrue(isinstance(self.nesting_state.stack[1], cpplint._ClassInfo))
5582 self.assertEquals(len(self.nesting_state.stack), 1)
5583 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5584 self.assertEquals(self.nesting_state.stack[0].name, 'A')
5585 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0)
5589 self.assertEquals(len(self.nesting_state.stack), 1)
5590 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5592 self.assertEquals(len(self.nesting_state.stack), 1)
5593 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0)
5596 self.assertEquals(len(self.nesting_state.stack), 0)
5599 self.assertEquals(len(self.nesting_state.stack), 1)
5600 self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo))
5601 self.assertEquals(self.nesting_state.stack[0].name, 'B')
5606 self.assertEquals(len(self.nesting_state.stack), 1)
5607 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5610 self.assertEquals(len(self.nesting_state.stack), 1)
5611 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0)
5614 self.assertEquals(len(self.nesting_state.stack), 1)
5615 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5618 self.assertEquals(len(self.nesting_state.stack), 1)
5619 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5621 self.assertEquals(len(self.nesting_state.stack), 1)
5622 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0)
5625 self.assertEquals(len(self.nesting_state.stack), 0)
5630 self.assertEquals(len(self.nesting_state.stack), 1)
5631 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0)
5632 self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._NO_ASM)
5635 self.assertEquals(len(self.nesting_state.stack), 1)
5636 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5637 self.assertEquals(self.nesting_state.stack[-1].inline_asm,
5654 self.assertEquals(len(self.nesting_state.stack), 1)
5655 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5656 self.assertEquals(self.nesting_state.stack[-1].inline_asm,
5661 self.assertEquals(len(self.nesting_state.stack), 1)
5662 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5663 self.assertEquals(self.nesting_state.stack[-1].inline_asm,
5667 self.assertEquals(len(self.nesting_state.stack), 1)
5668 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1)
5669 self.assertEquals(self.nesting_state.stack[-1].inline_asm,
5673 self.assertEquals(len(self.nesting_state.stack), 1)
5674 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0)
5675 self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._END_ASM)
5678 self.assertEquals(len(self.nesting_state.stack), 2)
5679 self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0)
5680 self.assertEquals(self.nesting_state.stack[-1].inline_asm,
5684 self.assertEquals(len(self.nesting_state.stack), 1)
5687 self.assertEquals(len(self.nesting_state.stack), 0)