Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/libcst/_parser/types/py_token.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.3.1, created at 2023-09-25 06:43 +0000

1# Copyright (c) Meta Platforms, Inc. and affiliates. 

2# 

3# This source code is licensed under the MIT license found in the 

4# LICENSE file in the root directory of this source tree. 

5 

6 

7from dataclasses import dataclass 

8from typing import Optional, Tuple 

9 

10from libcst._add_slots import add_slots 

11from libcst._parser.parso.python.token import TokenType 

12from libcst._parser.types.whitespace_state import WhitespaceState 

13 

14 

15@add_slots 

16@dataclass(frozen=True) 

17class Token: 

18 type: TokenType 

19 string: str 

20 # The start of where `string` is in the source, not including leading whitespace. 

21 start_pos: Tuple[int, int] 

22 # The end of where `string` is in the source, not including trailing whitespace. 

23 end_pos: Tuple[int, int] 

24 whitespace_before: WhitespaceState 

25 whitespace_after: WhitespaceState 

26 # The relative indent this token adds. 

27 relative_indent: Optional[str]