diff --git a/parser/tests/errors.rs b/parser/tests/errors.rs index 9caefb9afb..cb8deb5f18 100644 --- a/parser/tests/errors.rs +++ b/parser/tests/errors.rs @@ -1,16 +1,15 @@ use fe_common::diagnostics::diagnostics_string; use fe_parser::grammar::{contracts, expressions, functions, module, types}; - use fe_parser::{ParseResult, Parser}; use insta::assert_snapshot; -pub fn err_string(mut parse_fn: F, should_fail: bool, src: &str) -> String +pub fn err_string(test_name: &str, mut parse_fn: F, should_fail: bool, src: &str) -> String where F: FnMut(&mut Parser) -> ParseResult, T: std::fmt::Debug, { let mut files = fe_common::files::FileStore::new(); - let id = files.add_file("[test snippet]", src); + let id = files.add_file(test_name, src); let mut parser = Parser::new(src, id); if should_fail != parse_fn(&mut parser).is_err() { @@ -23,10 +22,10 @@ where } macro_rules! test_parse_err { - ($name:ident, $parse_fn:expr, $should_fail:expr, $string:expr) => { + ($name:ident, $parse_fn:expr, $should_fail:expr, $src:expr) => { #[test] fn $name() { - let err = err_string($parse_fn, $should_fail, $string); + let err = err_string(stringify!($name), $parse_fn, $should_fail, $src); assert_snapshot!(err); } }; diff --git a/parser/tests/fixtures/parsers/assert_stmt.ron b/parser/tests/fixtures/parsers/assert_stmt.ron deleted file mode 100644 index 6c4824970d..0000000000 --- a/parser/tests/fixtures/parsers/assert_stmt.ron +++ /dev/null @@ -1,43 +0,0 @@ -assert x -assert x, y ---- -[ - Node( - kind: Assert( - test: Node( - kind: Name("x"), - span: Span( - start: 7, - end: 8, - ), - ), - msg: None, - ), - span: Span( - start: 0, - end: 8, - ), - ), - Node( - kind: Assert( - test: Node( - kind: Name("x"), - span: Span( - start: 16, - end: 17, - ), - ), - msg: Some(Node( - kind: Name("y"), - span: Span( - start: 19, - end: 20, - ), - )), - ), - span: Span( - start: 9, - end: 20, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/augassign_stmt.ron b/parser/tests/fixtures/parsers/augassign_stmt.ron deleted file mode 100644 index 7289b04b3b..0000000000 --- a/parser/tests/fixtures/parsers/augassign_stmt.ron +++ /dev/null @@ -1,333 +0,0 @@ -x += y -x -= y -x *= y -x /= y -x %= y -x &= y -x |= y -x ^= y -x <<= y -x >>= y -x **= y ---- -[ - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - op: Node( - kind: Add, - span: Span( - start: 2, - end: 4, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 5, - end: 6, - ), - ), - ), - span: Span( - start: 0, - end: 6, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 7, - end: 8, - ), - ), - op: Node( - kind: Sub, - span: Span( - start: 9, - end: 11, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 12, - end: 13, - ), - ), - ), - span: Span( - start: 7, - end: 13, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 14, - end: 15, - ), - ), - op: Node( - kind: Mult, - span: Span( - start: 16, - end: 18, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 19, - end: 20, - ), - ), - ), - span: Span( - start: 14, - end: 20, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 21, - end: 22, - ), - ), - op: Node( - kind: Div, - span: Span( - start: 23, - end: 25, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 26, - end: 27, - ), - ), - ), - span: Span( - start: 21, - end: 27, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 28, - end: 29, - ), - ), - op: Node( - kind: Mod, - span: Span( - start: 30, - end: 32, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 33, - end: 34, - ), - ), - ), - span: Span( - start: 28, - end: 34, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 35, - end: 36, - ), - ), - op: Node( - kind: BitAnd, - span: Span( - start: 37, - end: 39, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 40, - end: 41, - ), - ), - ), - span: Span( - start: 35, - end: 41, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 42, - end: 43, - ), - ), - op: Node( - kind: BitOr, - span: Span( - start: 44, - end: 46, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 47, - end: 48, - ), - ), - ), - span: Span( - start: 42, - end: 48, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 49, - end: 50, - ), - ), - op: Node( - kind: BitXor, - span: Span( - start: 51, - end: 53, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 54, - end: 55, - ), - ), - ), - span: Span( - start: 49, - end: 55, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 56, - end: 57, - ), - ), - op: Node( - kind: LShift, - span: Span( - start: 58, - end: 61, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 62, - end: 63, - ), - ), - ), - span: Span( - start: 56, - end: 63, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 64, - end: 65, - ), - ), - op: Node( - kind: RShift, - span: Span( - start: 66, - end: 69, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 70, - end: 71, - ), - ), - ), - span: Span( - start: 64, - end: 71, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 72, - end: 73, - ), - ), - op: Node( - kind: Pow, - span: Span( - start: 74, - end: 77, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 78, - end: 79, - ), - ), - ), - span: Span( - start: 72, - end: 79, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/base_type.ron b/parser/tests/fixtures/parsers/base_type.ron deleted file mode 100644 index a0287c86f7..0000000000 --- a/parser/tests/fixtures/parsers/base_type.ron +++ /dev/null @@ -1,60 +0,0 @@ -MyType -fixed128x18[1] -bool[1][2] ---- -[ - Node( - kind: Base( - base: "MyType", - ), - span: Span( - start: 0, - end: 6, - ), - ), - Node( - kind: Array( - typ: Node( - kind: Base( - base: "fixed128x18", - ), - span: Span( - start: 7, - end: 18, - ), - ), - dimension: 1, - ), - span: Span( - start: 7, - end: 21, - ), - ), - Node( - kind: Array( - typ: Node( - kind: Array( - typ: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 22, - end: 26, - ), - ), - dimension: 1, - ), - span: Span( - start: 22, - end: 29, - ), - ), - dimension: 2, - ), - span: Span( - start: 22, - end: 32, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/bitwise_and.ron b/parser/tests/fixtures/parsers/bitwise_and.ron deleted file mode 100644 index e647893829..0000000000 --- a/parser/tests/fixtures/parsers/bitwise_and.ron +++ /dev/null @@ -1,93 +0,0 @@ -x -x & y -x & y & z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: BitAnd, - span: Span( - start: 4, - end: 5, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 6, - end: 7, - ), - ), - ), - span: Span( - start: 2, - end: 7, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 8, - end: 9, - ), - ), - op: Node( - kind: BitAnd, - span: Span( - start: 10, - end: 11, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 12, - end: 13, - ), - ), - ), - span: Span( - start: 8, - end: 13, - ), - ), - op: Node( - kind: BitAnd, - span: Span( - start: 14, - end: 15, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 16, - end: 17, - ), - ), - ), - span: Span( - start: 8, - end: 17, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/bitwise_or.ron b/parser/tests/fixtures/parsers/bitwise_or.ron deleted file mode 100644 index 39c167538c..0000000000 --- a/parser/tests/fixtures/parsers/bitwise_or.ron +++ /dev/null @@ -1,93 +0,0 @@ -x -x | y -x | y | z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: BitOr, - span: Span( - start: 4, - end: 5, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 6, - end: 7, - ), - ), - ), - span: Span( - start: 2, - end: 7, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 8, - end: 9, - ), - ), - op: Node( - kind: BitOr, - span: Span( - start: 10, - end: 11, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 12, - end: 13, - ), - ), - ), - span: Span( - start: 8, - end: 13, - ), - ), - op: Node( - kind: BitOr, - span: Span( - start: 14, - end: 15, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 16, - end: 17, - ), - ), - ), - span: Span( - start: 8, - end: 17, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/bitwise_xor.ron b/parser/tests/fixtures/parsers/bitwise_xor.ron deleted file mode 100644 index 6d09d64f24..0000000000 --- a/parser/tests/fixtures/parsers/bitwise_xor.ron +++ /dev/null @@ -1,93 +0,0 @@ -x -x ^ y -x ^ y ^ z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: BitXor, - span: Span( - start: 4, - end: 5, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 6, - end: 7, - ), - ), - ), - span: Span( - start: 2, - end: 7, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 8, - end: 9, - ), - ), - op: Node( - kind: BitXor, - span: Span( - start: 10, - end: 11, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 12, - end: 13, - ), - ), - ), - span: Span( - start: 8, - end: 13, - ), - ), - op: Node( - kind: BitXor, - span: Span( - start: 14, - end: 15, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 16, - end: 17, - ), - ), - ), - span: Span( - start: 8, - end: 17, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/compound_stmt.ron b/parser/tests/fixtures/parsers/compound_stmt.ron deleted file mode 100644 index b803777463..0000000000 --- a/parser/tests/fixtures/parsers/compound_stmt.ron +++ /dev/null @@ -1,115 +0,0 @@ -if a: - b -while a: - b -for a in b: - c ---- -[ - Node( - kind: If( - test: Node( - kind: Name("a"), - span: Span( - start: 3, - end: 4, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 10, - end: 11, - ), - ), - ), - span: Span( - start: 10, - end: 11, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 0, - end: 11, - ), - ), - Node( - kind: While( - test: Node( - kind: Name("a"), - span: Span( - start: 18, - end: 19, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 25, - end: 26, - ), - ), - ), - span: Span( - start: 25, - end: 26, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 12, - end: 26, - ), - ), - Node( - kind: For( - target: Node( - kind: Name("a"), - span: Span( - start: 31, - end: 32, - ), - ), - iter: Node( - kind: Name("b"), - span: Span( - start: 36, - end: 37, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("c"), - span: Span( - start: 43, - end: 44, - ), - ), - ), - span: Span( - start: 43, - end: 44, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 27, - end: 44, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/conjunct.ron b/parser/tests/fixtures/parsers/conjunct.ron deleted file mode 100644 index a4a7a8988d..0000000000 --- a/parser/tests/fixtures/parsers/conjunct.ron +++ /dev/null @@ -1,93 +0,0 @@ -x -x and y -x and y and z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BoolOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: And, - span: Span( - start: 4, - end: 7, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 8, - end: 9, - ), - ), - ), - span: Span( - start: 2, - end: 9, - ), - ), - Node( - kind: BoolOperation( - left: Node( - kind: BoolOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 10, - end: 11, - ), - ), - op: Node( - kind: And, - span: Span( - start: 12, - end: 15, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 16, - end: 17, - ), - ), - ), - span: Span( - start: 10, - end: 17, - ), - ), - op: Node( - kind: And, - span: Span( - start: 18, - end: 21, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 22, - end: 23, - ), - ), - ), - span: Span( - start: 10, - end: 23, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/contract_def.ron b/parser/tests/fixtures/parsers/contract_def.ron deleted file mode 100644 index 17a054b77a..0000000000 --- a/parser/tests/fixtures/parsers/contract_def.ron +++ /dev/null @@ -1,210 +0,0 @@ -contract Foo: - x: address - pub y: u256 - const z: u8 - pub const a: u8 - pub def foo() -> u8: - return 10 ---- -[ - Node( - kind: ContractDef( - name: Node( - kind: "Foo", - span: Span( - start: 9, - end: 12, - ), - ), - fields: [ - Node( - kind: Field( - pub_qual: None, - const_qual: None, - name: Node( - kind: "x", - span: Span( - start: 18, - end: 19, - ), - ), - typ: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 21, - end: 28, - ), - ), - value: None, - ), - span: Span( - start: 18, - end: 28, - ), - ), - Node( - kind: Field( - pub_qual: Some(Node( - kind: PubQualifier(), - span: Span( - start: 33, - end: 36, - ), - )), - const_qual: None, - name: Node( - kind: "y", - span: Span( - start: 37, - end: 38, - ), - ), - typ: Node( - kind: Base( - base: "u256", - ), - span: Span( - start: 40, - end: 44, - ), - ), - value: None, - ), - span: Span( - start: 33, - end: 44, - ), - ), - Node( - kind: Field( - pub_qual: None, - const_qual: Some(Node( - kind: ConstQualifier(), - span: Span( - start: 49, - end: 54, - ), - )), - name: Node( - kind: "z", - span: Span( - start: 55, - end: 56, - ), - ), - typ: Node( - kind: Base( - base: "u8", - ), - span: Span( - start: 58, - end: 60, - ), - ), - value: None, - ), - span: Span( - start: 49, - end: 60, - ), - ), - Node( - kind: Field( - pub_qual: Some(Node( - kind: PubQualifier(), - span: Span( - start: 65, - end: 68, - ), - )), - const_qual: Some(Node( - kind: ConstQualifier(), - span: Span( - start: 69, - end: 74, - ), - )), - name: Node( - kind: "a", - span: Span( - start: 75, - end: 76, - ), - ), - typ: Node( - kind: Base( - base: "u8", - ), - span: Span( - start: 78, - end: 80, - ), - ), - value: None, - ), - span: Span( - start: 65, - end: 80, - ), - ), - ], - body: [ - Node( - kind: FuncDef( - pub_qual: Some(Node( - kind: PubQualifier(), - span: Span( - start: 85, - end: 88, - ), - )), - name: Node( - kind: "foo", - span: Span( - start: 93, - end: 96, - ), - ), - args: [], - return_type: Some(Node( - kind: Base( - base: "u8", - ), - span: Span( - start: 102, - end: 104, - ), - )), - body: [ - Node( - kind: Return( - value: Some(Node( - kind: Num("10"), - span: Span( - start: 121, - end: 123, - ), - )), - ), - span: Span( - start: 114, - end: 123, - ), - ), - ], - ), - span: Span( - start: 85, - end: 123, - ), - ), - ], - ), - span: Span( - start: 0, - end: 123, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/disjunct.ron b/parser/tests/fixtures/parsers/disjunct.ron deleted file mode 100644 index e30e2ca0f6..0000000000 --- a/parser/tests/fixtures/parsers/disjunct.ron +++ /dev/null @@ -1,93 +0,0 @@ -x -x or y -x or y or z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BoolOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: Or, - span: Span( - start: 4, - end: 6, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 7, - end: 8, - ), - ), - ), - span: Span( - start: 2, - end: 8, - ), - ), - Node( - kind: BoolOperation( - left: Node( - kind: BoolOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 9, - end: 10, - ), - ), - op: Node( - kind: Or, - span: Span( - start: 11, - end: 13, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 14, - end: 15, - ), - ), - ), - span: Span( - start: 9, - end: 15, - ), - ), - op: Node( - kind: Or, - span: Span( - start: 16, - end: 18, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 19, - end: 20, - ), - ), - ), - span: Span( - start: 9, - end: 20, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/emit_stmt.ron b/parser/tests/fixtures/parsers/emit_stmt.ron deleted file mode 100644 index 05f016e4eb..0000000000 --- a/parser/tests/fixtures/parsers/emit_stmt.ron +++ /dev/null @@ -1,76 +0,0 @@ -emit Foo() -emit Foo(1, 2) ---- -[ - Node( - kind: Emit( - name: Node( - kind: "Foo", - span: Span( - start: 5, - end: 8, - ), - ), - args: Node( - kind: [], - span: Span( - start: 8, - end: 10, - ), - ), - ), - span: Span( - start: 0, - end: 10, - ), - ), - Node( - kind: Emit( - name: Node( - kind: "Foo", - span: Span( - start: 16, - end: 19, - ), - ), - args: Node( - kind: [ - Node( - kind: Arg(Node( - kind: Num("1"), - span: Span( - start: 20, - end: 21, - ), - )), - span: Span( - start: 20, - end: 21, - ), - ), - Node( - kind: Arg(Node( - kind: Num("2"), - span: Span( - start: 23, - end: 24, - ), - )), - span: Span( - start: 23, - end: 24, - ), - ), - ], - span: Span( - start: 19, - end: 25, - ), - ), - ), - span: Span( - start: 11, - end: 25, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/event_def.ron b/parser/tests/fixtures/parsers/event_def.ron deleted file mode 100644 index 7cb278e033..0000000000 --- a/parser/tests/fixtures/parsers/event_def.ron +++ /dev/null @@ -1,79 +0,0 @@ -event Foo: - x: bar - idx y: address ---- -[ - Node( - kind: EventDef( - name: Node( - kind: "Foo", - span: Span( - start: 6, - end: 9, - ), - ), - fields: [ - Node( - kind: EventField( - idx_qual: None, - name: Node( - kind: "x", - span: Span( - start: 15, - end: 16, - ), - ), - typ: Node( - kind: Base( - base: "bar", - ), - span: Span( - start: 18, - end: 21, - ), - ), - ), - span: Span( - start: 15, - end: 21, - ), - ), - Node( - kind: EventField( - idx_qual: Some(Node( - kind: IdxQualifier(), - span: Span( - start: 26, - end: 29, - ), - )), - name: Node( - kind: "y", - span: Span( - start: 30, - end: 31, - ), - ), - typ: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 33, - end: 40, - ), - ), - ), - span: Span( - start: 26, - end: 40, - ), - ), - ], - ), - span: Span( - start: 0, - end: 40, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/event_field.ron b/parser/tests/fixtures/parsers/event_field.ron deleted file mode 100644 index 9228f93d9d..0000000000 --- a/parser/tests/fixtures/parsers/event_field.ron +++ /dev/null @@ -1,61 +0,0 @@ -x: address -idx x: address ---- -[ - Node( - kind: EventField( - idx_qual: None, - name: Node( - kind: "x", - span: Span( - start: 0, - end: 1, - ), - ), - typ: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 3, - end: 10, - ), - ), - ), - span: Span( - start: 0, - end: 10, - ), - ), - Node( - kind: EventField( - idx_qual: Some(Node( - kind: IdxQualifier(), - span: Span( - start: 11, - end: 14, - ), - )), - name: Node( - kind: "x", - span: Span( - start: 15, - end: 16, - ), - ), - typ: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 18, - end: 25, - ), - ), - ), - span: Span( - start: 11, - end: 25, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/expr.ron b/parser/tests/fixtures/parsers/expr.ron deleted file mode 100644 index 9122743e93..0000000000 --- a/parser/tests/fixtures/parsers/expr.ron +++ /dev/null @@ -1,206 +0,0 @@ -x -x if y else z -not x -"a \"string\"\t" -123 -foo.bar(1, 2, x=3) -x[y] ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: Ternary( - if_expr: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - test: Node( - kind: Name("y"), - span: Span( - start: 7, - end: 8, - ), - ), - else_expr: Node( - kind: Name("z"), - span: Span( - start: 14, - end: 15, - ), - ), - ), - span: Span( - start: 2, - end: 15, - ), - ), - Node( - kind: UnaryOperation( - op: Node( - kind: Not, - span: Span( - start: 16, - end: 19, - ), - ), - operand: Node( - kind: Name("x"), - span: Span( - start: 20, - end: 21, - ), - ), - ), - span: Span( - start: 16, - end: 21, - ), - ), - Node( - kind: Str([ - "a \"string\"\t", - ]), - span: Span( - start: 22, - end: 38, - ), - ), - Node( - kind: Num("123"), - span: Span( - start: 39, - end: 42, - ), - ), - Node( - kind: Call( - func: Node( - kind: Attribute( - value: Node( - kind: Name("foo"), - span: Span( - start: 43, - end: 46, - ), - ), - attr: Node( - kind: "bar", - span: Span( - start: 47, - end: 50, - ), - ), - ), - span: Span( - start: 43, - end: 50, - ), - ), - args: Node( - kind: [ - Node( - kind: Arg(Node( - kind: Num("1"), - span: Span( - start: 51, - end: 52, - ), - )), - span: Span( - start: 51, - end: 52, - ), - ), - Node( - kind: Arg(Node( - kind: Num("2"), - span: Span( - start: 54, - end: 55, - ), - )), - span: Span( - start: 54, - end: 55, - ), - ), - Node( - kind: Kwarg(Kwarg( - name: Node( - kind: "x", - span: Span( - start: 57, - end: 58, - ), - ), - value: Node( - kind: Num("3"), - span: Span( - start: 59, - end: 60, - ), - ), - )), - span: Span( - start: 57, - end: 60, - ), - ), - ], - span: Span( - start: 50, - end: 61, - ), - ), - ), - span: Span( - start: 43, - end: 61, - ), - ), - Node( - kind: Subscript( - value: Node( - kind: Name("x"), - span: Span( - start: 62, - end: 63, - ), - ), - slices: Node( - kind: [ - Node( - kind: Index(Node( - kind: Name("y"), - span: Span( - start: 64, - end: 65, - ), - )), - span: Span( - start: 64, - end: 65, - ), - ), - ], - span: Span( - start: 63, - end: 66, - ), - ), - ), - span: Span( - start: 62, - end: 66, - ), - ), -] \ No newline at end of file diff --git a/parser/tests/fixtures/parsers/factor.ron b/parser/tests/fixtures/parsers/factor.ron deleted file mode 100644 index 9e562699f7..0000000000 --- a/parser/tests/fixtures/parsers/factor.ron +++ /dev/null @@ -1,80 +0,0 @@ -+x --x -~x -x ---- -[ - Node( - kind: UnaryOperation( - op: Node( - kind: UAdd, - span: Span( - start: 0, - end: 1, - ), - ), - operand: Node( - kind: Name("x"), - span: Span( - start: 1, - end: 2, - ), - ), - ), - span: Span( - start: 0, - end: 2, - ), - ), - Node( - kind: UnaryOperation( - op: Node( - kind: USub, - span: Span( - start: 3, - end: 4, - ), - ), - operand: Node( - kind: Name("x"), - span: Span( - start: 4, - end: 5, - ), - ), - ), - span: Span( - start: 3, - end: 5, - ), - ), - Node( - kind: UnaryOperation( - op: Node( - kind: Invert, - span: Span( - start: 6, - end: 7, - ), - ), - operand: Node( - kind: Name("x"), - span: Span( - start: 7, - end: 8, - ), - ), - ), - span: Span( - start: 6, - end: 8, - ), - ), - Node( - kind: Name("x"), - span: Span( - start: 9, - end: 10, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/for_stmt.ron b/parser/tests/fixtures/parsers/for_stmt.ron deleted file mode 100644 index 59fed16c2d..0000000000 --- a/parser/tests/fixtures/parsers/for_stmt.ron +++ /dev/null @@ -1,106 +0,0 @@ -for a in b: - c - -for a in b: - c -else: - d ---- -[ - Node( - kind: For( - target: Node( - kind: Name("a"), - span: Span( - start: 4, - end: 5, - ), - ), - iter: Node( - kind: Name("b"), - span: Span( - start: 9, - end: 10, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("c"), - span: Span( - start: 16, - end: 17, - ), - ), - ), - span: Span( - start: 16, - end: 17, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 0, - end: 17, - ), - ), - Node( - kind: For( - target: Node( - kind: Name("a"), - span: Span( - start: 23, - end: 24, - ), - ), - iter: Node( - kind: Name("b"), - span: Span( - start: 28, - end: 29, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("c"), - span: Span( - start: 35, - end: 36, - ), - ), - ), - span: Span( - start: 35, - end: 36, - ), - ), - ], - or_else: [ - Node( - kind: Expr( - value: Node( - kind: Name("d"), - span: Span( - start: 47, - end: 48, - ), - ), - ), - span: Span( - start: 47, - end: 48, - ), - ), - ], - ), - span: Span( - start: 19, - end: 48, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/func_def.ron b/parser/tests/fixtures/parsers/func_def.ron deleted file mode 100644 index f70a37b46a..0000000000 --- a/parser/tests/fixtures/parsers/func_def.ron +++ /dev/null @@ -1,235 +0,0 @@ -def foo(x: bool): - x -def foo(x: bool) -> (): - x -pub def foo(x: bool, y: address,) -> bool: - x ---- -[ - Node( - kind: FuncDef( - pub_qual: None, - name: Node( - kind: "foo", - span: Span( - start: 4, - end: 7, - ), - ), - args: [ - Node( - kind: FuncDefArg( - name: Node( - kind: "x", - span: Span( - start: 8, - end: 9, - ), - ), - typ: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 11, - end: 15, - ), - ), - ), - span: Span( - start: 8, - end: 15, - ), - ), - ], - return_type: None, - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("x"), - span: Span( - start: 22, - end: 23, - ), - ), - ), - span: Span( - start: 22, - end: 23, - ), - ), - ], - ), - span: Span( - start: 0, - end: 23, - ), - ), - Node( - kind: FuncDef( - pub_qual: None, - name: Node( - kind: "foo", - span: Span( - start: 28, - end: 31, - ), - ), - args: [ - Node( - kind: FuncDefArg( - name: Node( - kind: "x", - span: Span( - start: 32, - end: 33, - ), - ), - typ: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 35, - end: 39, - ), - ), - ), - span: Span( - start: 32, - end: 39, - ), - ), - ], - return_type: Some(Node( - kind: Tuple( - items: [], - ), - span: Span( - start: 44, - end: 46, - ), - )), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("x"), - span: Span( - start: 52, - end: 53, - ), - ), - ), - span: Span( - start: 52, - end: 53, - ), - ), - ], - ), - span: Span( - start: 24, - end: 53, - ), - ), - Node( - kind: FuncDef( - pub_qual: Some(Node( - kind: PubQualifier(), - span: Span( - start: 54, - end: 57, - ), - )), - name: Node( - kind: "foo", - span: Span( - start: 62, - end: 65, - ), - ), - args: [ - Node( - kind: FuncDefArg( - name: Node( - kind: "x", - span: Span( - start: 66, - end: 67, - ), - ), - typ: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 69, - end: 73, - ), - ), - ), - span: Span( - start: 66, - end: 73, - ), - ), - Node( - kind: FuncDefArg( - name: Node( - kind: "y", - span: Span( - start: 75, - end: 76, - ), - ), - typ: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 78, - end: 85, - ), - ), - ), - span: Span( - start: 75, - end: 85, - ), - ), - ], - return_type: Some(Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 91, - end: 95, - ), - )), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("x"), - span: Span( - start: 101, - end: 102, - ), - ), - ), - span: Span( - start: 101, - end: 102, - ), - ), - ], - ), - span: Span( - start: 54, - end: 102, - ), - ), -] \ No newline at end of file diff --git a/parser/tests/fixtures/parsers/func_stmt.ron b/parser/tests/fixtures/parsers/func_stmt.ron deleted file mode 100644 index a223a071f5..0000000000 --- a/parser/tests/fixtures/parsers/func_stmt.ron +++ /dev/null @@ -1,50 +0,0 @@ -while a: - b -pass ---- -[ - [ - Node( - kind: While( - test: Node( - kind: Name("a"), - span: Span( - start: 6, - end: 7, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 13, - end: 14, - ), - ), - ), - span: Span( - start: 13, - end: 14, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 0, - end: 14, - ), - ), - ], - [ - Node( - kind: Pass, - span: Span( - start: 15, - end: 19, - ), - ), - ], -] diff --git a/parser/tests/fixtures/parsers/generic_type_desc.ron b/parser/tests/fixtures/parsers/generic_type_desc.ron deleted file mode 100644 index 0ea7dea27f..0000000000 --- a/parser/tests/fixtures/parsers/generic_type_desc.ron +++ /dev/null @@ -1,488 +0,0 @@ -foo -foo> -foo > -foo>> -foo>>> -foo > > > ---- -[ - Node( - kind: Generic( - base: Node( - kind: "foo", - span: Span( - start: 0, - end: 3, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "address", - )), - span: Span( - start: 4, - end: 11, - ), - ), - Node( - kind: TypeDesc(Array( - typ: Node( - kind: Base( - base: "bytes", - ), - span: Span( - start: 13, - end: 18, - ), - ), - dimension: 100, - )), - span: Span( - start: 13, - end: 23, - ), - ), - ], - ), - span: Span( - start: 0, - end: 24, - ), - ), - Node( - kind: Generic( - base: Node( - kind: "foo", - span: Span( - start: 25, - end: 28, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "MyType", - )), - span: Span( - start: 29, - end: 35, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 37, - end: 40, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "bool", - )), - span: Span( - start: 41, - end: 45, - ), - ), - Node( - kind: TypeDesc(Base( - base: "uint128", - )), - span: Span( - start: 47, - end: 54, - ), - ), - ], - )), - span: Span( - start: 37, - end: 55, - ), - ), - ], - ), - span: Span( - start: 25, - end: 56, - ), - ), - Node( - kind: Generic( - base: Node( - kind: "foo", - span: Span( - start: 57, - end: 60, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "MyType", - )), - span: Span( - start: 61, - end: 67, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 69, - end: 72, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "bool", - )), - span: Span( - start: 73, - end: 77, - ), - ), - Node( - kind: TypeDesc(Base( - base: "uint128", - )), - span: Span( - start: 79, - end: 86, - ), - ), - ], - )), - span: Span( - start: 69, - end: 87, - ), - ), - ], - ), - span: Span( - start: 57, - end: 89, - ), - ), - Node( - kind: Generic( - base: Node( - kind: "foo", - span: Span( - start: 90, - end: 93, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "MyType", - )), - span: Span( - start: 94, - end: 100, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 102, - end: 105, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "bool", - )), - span: Span( - start: 106, - end: 110, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 112, - end: 115, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "asdf", - )), - span: Span( - start: 116, - end: 120, - ), - ), - Node( - kind: TypeDesc(Base( - base: "foo", - )), - span: Span( - start: 122, - end: 125, - ), - ), - ], - )), - span: Span( - start: 112, - end: 126, - ), - ), - ], - )), - span: Span( - start: 102, - end: 127, - ), - ), - ], - ), - span: Span( - start: 90, - end: 128, - ), - ), - Node( - kind: Generic( - base: Node( - kind: "foo", - span: Span( - start: 129, - end: 132, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "MyType", - )), - span: Span( - start: 133, - end: 139, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 141, - end: 144, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "bool", - )), - span: Span( - start: 145, - end: 149, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 151, - end: 154, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "asdf", - )), - span: Span( - start: 155, - end: 159, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 161, - end: 164, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "foo", - )), - span: Span( - start: 165, - end: 168, - ), - ), - Node( - kind: TypeDesc(Base( - base: "bar", - )), - span: Span( - start: 170, - end: 173, - ), - ), - ], - )), - span: Span( - start: 161, - end: 174, - ), - ), - ], - )), - span: Span( - start: 151, - end: 175, - ), - ), - ], - )), - span: Span( - start: 141, - end: 176, - ), - ), - ], - ), - span: Span( - start: 129, - end: 177, - ), - ), - Node( - kind: Generic( - base: Node( - kind: "foo", - span: Span( - start: 178, - end: 181, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "MyType", - )), - span: Span( - start: 182, - end: 188, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 190, - end: 193, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "bool", - )), - span: Span( - start: 194, - end: 198, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 200, - end: 203, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "asdf", - )), - span: Span( - start: 204, - end: 208, - ), - ), - Node( - kind: TypeDesc(Generic( - base: Node( - kind: "foo", - span: Span( - start: 210, - end: 213, - ), - ), - args: [ - Node( - kind: TypeDesc(Base( - base: "foo", - )), - span: Span( - start: 214, - end: 217, - ), - ), - Node( - kind: TypeDesc(Base( - base: "bar", - )), - span: Span( - start: 219, - end: 222, - ), - ), - ], - )), - span: Span( - start: 210, - end: 223, - ), - ), - ], - )), - span: Span( - start: 200, - end: 225, - ), - ), - ], - )), - span: Span( - start: 190, - end: 227, - ), - ), - ], - ), - span: Span( - start: 178, - end: 229, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/if_stmt.ron b/parser/tests/fixtures/parsers/if_stmt.ron deleted file mode 100644 index 9a28bca6e0..0000000000 --- a/parser/tests/fixtures/parsers/if_stmt.ron +++ /dev/null @@ -1,488 +0,0 @@ -if a: - b - -if a: - b -else: - c - -if a: - b -elif c: - d - -if a: - b -elif c: - d -else: - e - -if a: - b -elif c: - d -elif e: - f - -if a: - b -elif c: - d -elif e: - f -else: - g ---- -[ - Node( - kind: If( - test: Node( - kind: Name("a"), - span: Span( - start: 3, - end: 4, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 10, - end: 11, - ), - ), - ), - span: Span( - start: 10, - end: 11, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 0, - end: 11, - ), - ), - Node( - kind: If( - test: Node( - kind: Name("a"), - span: Span( - start: 16, - end: 17, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 23, - end: 24, - ), - ), - ), - span: Span( - start: 23, - end: 24, - ), - ), - ], - or_else: [ - Node( - kind: Expr( - value: Node( - kind: Name("c"), - span: Span( - start: 35, - end: 36, - ), - ), - ), - span: Span( - start: 35, - end: 36, - ), - ), - ], - ), - span: Span( - start: 13, - end: 36, - ), - ), - Node( - kind: If( - test: Node( - kind: Name("a"), - span: Span( - start: 41, - end: 42, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 48, - end: 49, - ), - ), - ), - span: Span( - start: 48, - end: 49, - ), - ), - ], - or_else: [ - Node( - kind: If( - test: Node( - kind: Name("c"), - span: Span( - start: 55, - end: 56, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("d"), - span: Span( - start: 62, - end: 63, - ), - ), - ), - span: Span( - start: 62, - end: 63, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 50, - end: 63, - ), - ), - ], - ), - span: Span( - start: 38, - end: 63, - ), - ), - Node( - kind: If( - test: Node( - kind: Name("a"), - span: Span( - start: 68, - end: 69, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 75, - end: 76, - ), - ), - ), - span: Span( - start: 75, - end: 76, - ), - ), - ], - or_else: [ - Node( - kind: If( - test: Node( - kind: Name("c"), - span: Span( - start: 82, - end: 83, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("d"), - span: Span( - start: 89, - end: 90, - ), - ), - ), - span: Span( - start: 89, - end: 90, - ), - ), - ], - or_else: [ - Node( - kind: Expr( - value: Node( - kind: Name("e"), - span: Span( - start: 101, - end: 102, - ), - ), - ), - span: Span( - start: 101, - end: 102, - ), - ), - ], - ), - span: Span( - start: 77, - end: 102, - ), - ), - ], - ), - span: Span( - start: 65, - end: 102, - ), - ), - Node( - kind: If( - test: Node( - kind: Name("a"), - span: Span( - start: 107, - end: 108, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 114, - end: 115, - ), - ), - ), - span: Span( - start: 114, - end: 115, - ), - ), - ], - or_else: [ - Node( - kind: If( - test: Node( - kind: Name("c"), - span: Span( - start: 121, - end: 122, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("d"), - span: Span( - start: 128, - end: 129, - ), - ), - ), - span: Span( - start: 128, - end: 129, - ), - ), - ], - or_else: [ - Node( - kind: If( - test: Node( - kind: Name("e"), - span: Span( - start: 135, - end: 136, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("f"), - span: Span( - start: 142, - end: 143, - ), - ), - ), - span: Span( - start: 142, - end: 143, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 130, - end: 143, - ), - ), - ], - ), - span: Span( - start: 116, - end: 143, - ), - ), - ], - ), - span: Span( - start: 104, - end: 143, - ), - ), - Node( - kind: If( - test: Node( - kind: Name("a"), - span: Span( - start: 148, - end: 149, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 155, - end: 156, - ), - ), - ), - span: Span( - start: 155, - end: 156, - ), - ), - ], - or_else: [ - Node( - kind: If( - test: Node( - kind: Name("c"), - span: Span( - start: 162, - end: 163, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("d"), - span: Span( - start: 169, - end: 170, - ), - ), - ), - span: Span( - start: 169, - end: 170, - ), - ), - ], - or_else: [ - Node( - kind: If( - test: Node( - kind: Name("e"), - span: Span( - start: 176, - end: 177, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("f"), - span: Span( - start: 183, - end: 184, - ), - ), - ), - span: Span( - start: 183, - end: 184, - ), - ), - ], - or_else: [ - Node( - kind: Expr( - value: Node( - kind: Name("g"), - span: Span( - start: 195, - end: 196, - ), - ), - ), - span: Span( - start: 195, - end: 196, - ), - ), - ], - ), - span: Span( - start: 171, - end: 196, - ), - ), - ], - ), - span: Span( - start: 157, - end: 196, - ), - ), - ], - ), - span: Span( - start: 145, - end: 196, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/list.ron b/parser/tests/fixtures/parsers/list.ron deleted file mode 100644 index e14d61ecc7..0000000000 --- a/parser/tests/fixtures/parsers/list.ron +++ /dev/null @@ -1,63 +0,0 @@ -[] -[x] -[1, 2, 3, ] ---- -[ - Node( - kind: List( - elts: [], - ), - span: Span( - start: 0, - end: 2, - ), - ), - Node( - kind: List( - elts: [ - Node( - kind: Name("x"), - span: Span( - start: 4, - end: 5, - ), - ), - ], - ), - span: Span( - start: 3, - end: 6, - ), - ), - Node( - kind: List( - elts: [ - Node( - kind: Num("1"), - span: Span( - start: 8, - end: 9, - ), - ), - Node( - kind: Num("2"), - span: Span( - start: 11, - end: 12, - ), - ), - Node( - kind: Num("3"), - span: Span( - start: 14, - end: 15, - ), - ), - ], - ), - span: Span( - start: 7, - end: 18, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/map_type.ron b/parser/tests/fixtures/parsers/map_type.ron deleted file mode 100644 index 4ca1f834dc..0000000000 --- a/parser/tests/fixtures/parsers/map_type.ron +++ /dev/null @@ -1,344 +0,0 @@ -map -map> -map > -map>> -map>>> -map > > > ---- -[ - Node( - kind: Map( - from: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 4, - end: 11, - ), - ), - to: Node( - kind: Array( - typ: Node( - kind: Base( - base: "bytes", - ), - span: Span( - start: 13, - end: 18, - ), - ), - dimension: 100, - ), - span: Span( - start: 13, - end: 23, - ), - ), - ), - span: Span( - start: 0, - end: 24, - ), - ), - Node( - kind: Map( - from: Node( - kind: Base( - base: "MyType", - ), - span: Span( - start: 29, - end: 35, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 41, - end: 45, - ), - ), - to: Node( - kind: Base( - base: "uint128", - ), - span: Span( - start: 47, - end: 54, - ), - ), - ), - span: Span( - start: 37, - end: 55, - ), - ), - ), - span: Span( - start: 25, - end: 56, - ), - ), - Node( - kind: Map( - from: Node( - kind: Base( - base: "MyType", - ), - span: Span( - start: 61, - end: 67, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 73, - end: 77, - ), - ), - to: Node( - kind: Base( - base: "uint128", - ), - span: Span( - start: 79, - end: 86, - ), - ), - ), - span: Span( - start: 69, - end: 87, - ), - ), - ), - span: Span( - start: 57, - end: 89, - ), - ), - Node( - kind: Map( - from: Node( - kind: Base( - base: "MyType", - ), - span: Span( - start: 94, - end: 100, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 106, - end: 110, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "asdf", - ), - span: Span( - start: 116, - end: 120, - ), - ), - to: Node( - kind: Base( - base: "foo", - ), - span: Span( - start: 122, - end: 125, - ), - ), - ), - span: Span( - start: 112, - end: 126, - ), - ), - ), - span: Span( - start: 102, - end: 127, - ), - ), - ), - span: Span( - start: 90, - end: 128, - ), - ), - Node( - kind: Map( - from: Node( - kind: Base( - base: "MyType", - ), - span: Span( - start: 133, - end: 139, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 145, - end: 149, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "asdf", - ), - span: Span( - start: 155, - end: 159, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "foo", - ), - span: Span( - start: 165, - end: 168, - ), - ), - to: Node( - kind: Base( - base: "bar", - ), - span: Span( - start: 170, - end: 173, - ), - ), - ), - span: Span( - start: 161, - end: 174, - ), - ), - ), - span: Span( - start: 151, - end: 175, - ), - ), - ), - span: Span( - start: 141, - end: 176, - ), - ), - ), - span: Span( - start: 129, - end: 177, - ), - ), - Node( - kind: Map( - from: Node( - kind: Base( - base: "MyType", - ), - span: Span( - start: 182, - end: 188, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 194, - end: 198, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "asdf", - ), - span: Span( - start: 204, - end: 208, - ), - ), - to: Node( - kind: Map( - from: Node( - kind: Base( - base: "foo", - ), - span: Span( - start: 214, - end: 217, - ), - ), - to: Node( - kind: Base( - base: "bar", - ), - span: Span( - start: 219, - end: 222, - ), - ), - ), - span: Span( - start: 210, - end: 223, - ), - ), - ), - span: Span( - start: 200, - end: 225, - ), - ), - ), - span: Span( - start: 190, - end: 227, - ), - ), - ), - span: Span( - start: 178, - end: 229, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/module_stmt.ron b/parser/tests/fixtures/parsers/module_stmt.ron deleted file mode 100644 index 5ec6bef4e5..0000000000 --- a/parser/tests/fixtures/parsers/module_stmt.ron +++ /dev/null @@ -1,79 +0,0 @@ -import foo -contract Foo: - x: bar ---- -[ - Node( - kind: SimpleImport( - names: [ - Node( - kind: SimpleImportName( - path: [ - Node( - kind: "foo", - span: Span( - start: 7, - end: 10, - ), - ), - ], - alias: None, - ), - span: Span( - start: 7, - end: 10, - ), - ), - ], - ), - span: Span( - start: 0, - end: 10, - ), - ), - Node( - kind: ContractDef( - name: Node( - kind: "Foo", - span: Span( - start: 20, - end: 23, - ), - ), - fields: [ - Node( - kind: Field( - pub_qual: None, - const_qual: None, - name: Node( - kind: "x", - span: Span( - start: 29, - end: 30, - ), - ), - typ: Node( - kind: Base( - base: "bar", - ), - span: Span( - start: 32, - end: 35, - ), - ), - value: None, - ), - span: Span( - start: 29, - end: 35, - ), - ), - ], - body: [], - ), - span: Span( - start: 11, - end: 35, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/numbers.ron b/parser/tests/fixtures/parsers/numbers.ron deleted file mode 100644 index 286b28dd27..0000000000 --- a/parser/tests/fixtures/parsers/numbers.ron +++ /dev/null @@ -1,43 +0,0 @@ -123 -00001 -123457 -0xBEEF1234 -0xdeadbeef ---- -[ - Node( - kind: Num("123"), - span: Span( - start: 0, - end: 3, - ), - ), - Node( - kind: Num("00001"), - span: Span( - start: 4, - end: 9, - ), - ), - Node( - kind: Num("123457"), - span: Span( - start: 10, - end: 16, - ), - ), - Node( - kind: Num("0xBEEF1234"), - span: Span( - start: 17, - end: 27, - ), - ), - Node( - kind: Num("0xdeadbeef"), - span: Span( - start: 28, - end: 38, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/op_precedence.ron b/parser/tests/fixtures/parsers/op_precedence.ron deleted file mode 100644 index 3b720272c9..0000000000 --- a/parser/tests/fixtures/parsers/op_precedence.ron +++ /dev/null @@ -1,114 +0,0 @@ -a + b * -c ** d / e ---- -[ - Node( - kind: BinOperation( - left: Node( - kind: Name("a"), - span: Span( - start: 0, - end: 1, - ), - ), - op: Node( - kind: Add, - span: Span( - start: 2, - end: 3, - ), - ), - right: Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Name("b"), - span: Span( - start: 4, - end: 5, - ), - ), - op: Node( - kind: Mult, - span: Span( - start: 6, - end: 7, - ), - ), - right: Node( - kind: UnaryOperation( - op: Node( - kind: USub, - span: Span( - start: 8, - end: 9, - ), - ), - operand: Node( - kind: BinOperation( - left: Node( - kind: Name("c"), - span: Span( - start: 9, - end: 10, - ), - ), - op: Node( - kind: Pow, - span: Span( - start: 11, - end: 13, - ), - ), - right: Node( - kind: Name("d"), - span: Span( - start: 14, - end: 15, - ), - ), - ), - span: Span( - start: 9, - end: 15, - ), - ), - ), - span: Span( - start: 8, - end: 15, - ), - ), - ), - span: Span( - start: 4, - end: 15, - ), - ), - op: Node( - kind: Div, - span: Span( - start: 16, - end: 17, - ), - ), - right: Node( - kind: Name("e"), - span: Span( - start: 18, - end: 19, - ), - ), - ), - span: Span( - start: 4, - end: 19, - ), - ), - ), - span: Span( - start: 0, - end: 19, - ), - ), -] \ No newline at end of file diff --git a/parser/tests/fixtures/parsers/power.ron b/parser/tests/fixtures/parsers/power.ron deleted file mode 100644 index b5d186d95e..0000000000 --- a/parser/tests/fixtures/parsers/power.ron +++ /dev/null @@ -1,145 +0,0 @@ -x ** y -x -1 ** 2 ** 3 -(1 ** 2) ** 3 ---- -[ - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - op: Node( - kind: Pow, - span: Span( - start: 2, - end: 4, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 5, - end: 6, - ), - ), - ), - span: Span( - start: 0, - end: 6, - ), - ), - Node( - kind: Name("x"), - span: Span( - start: 7, - end: 8, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Num("1"), - span: Span( - start: 9, - end: 10, - ), - ), - op: Node( - kind: Pow, - span: Span( - start: 11, - end: 13, - ), - ), - right: Node( - kind: BinOperation( - left: Node( - kind: Num("2"), - span: Span( - start: 14, - end: 15, - ), - ), - op: Node( - kind: Pow, - span: Span( - start: 16, - end: 18, - ), - ), - right: Node( - kind: Num("3"), - span: Span( - start: 19, - end: 20, - ), - ), - ), - span: Span( - start: 14, - end: 20, - ), - ), - ), - span: Span( - start: 9, - end: 20, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Num("1"), - span: Span( - start: 22, - end: 23, - ), - ), - op: Node( - kind: Pow, - span: Span( - start: 24, - end: 26, - ), - ), - right: Node( - kind: Num("2"), - span: Span( - start: 27, - end: 28, - ), - ), - ), - span: Span( - start: 21, - end: 29, - ), - ), - op: Node( - kind: Pow, - span: Span( - start: 30, - end: 32, - ), - ), - right: Node( - kind: Num("3"), - span: Span( - start: 33, - end: 34, - ), - ), - ), - span: Span( - start: 21, - end: 34, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/primary.ron b/parser/tests/fixtures/parsers/primary.ron deleted file mode 100644 index a6ec8e2d3a..0000000000 --- a/parser/tests/fixtures/parsers/primary.ron +++ /dev/null @@ -1,189 +0,0 @@ -a -a.b -a[b] -a(b) -a.b[c](d) ---- -[ - Node( - kind: Name("a"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: Attribute( - value: Node( - kind: Name("a"), - span: Span( - start: 2, - end: 3, - ), - ), - attr: Node( - kind: "b", - span: Span( - start: 4, - end: 5, - ), - ), - ), - span: Span( - start: 2, - end: 5, - ), - ), - Node( - kind: Subscript( - value: Node( - kind: Name("a"), - span: Span( - start: 6, - end: 7, - ), - ), - slices: Node( - kind: [ - Node( - kind: Index(Node( - kind: Name("b"), - span: Span( - start: 8, - end: 9, - ), - )), - span: Span( - start: 8, - end: 9, - ), - ), - ], - span: Span( - start: 7, - end: 10, - ), - ), - ), - span: Span( - start: 6, - end: 10, - ), - ), - Node( - kind: Call( - func: Node( - kind: Name("a"), - span: Span( - start: 11, - end: 12, - ), - ), - args: Node( - kind: [ - Node( - kind: Arg(Node( - kind: Name("b"), - span: Span( - start: 13, - end: 14, - ), - )), - span: Span( - start: 13, - end: 14, - ), - ), - ], - span: Span( - start: 12, - end: 15, - ), - ), - ), - span: Span( - start: 11, - end: 15, - ), - ), - Node( - kind: Call( - func: Node( - kind: Subscript( - value: Node( - kind: Attribute( - value: Node( - kind: Name("a"), - span: Span( - start: 16, - end: 17, - ), - ), - attr: Node( - kind: "b", - span: Span( - start: 18, - end: 19, - ), - ), - ), - span: Span( - start: 16, - end: 19, - ), - ), - slices: Node( - kind: [ - Node( - kind: Index(Node( - kind: Name("c"), - span: Span( - start: 20, - end: 21, - ), - )), - span: Span( - start: 20, - end: 21, - ), - ), - ], - span: Span( - start: 19, - end: 22, - ), - ), - ), - span: Span( - start: 16, - end: 22, - ), - ), - args: Node( - kind: [ - Node( - kind: Arg(Node( - kind: Name("d"), - span: Span( - start: 23, - end: 24, - ), - )), - span: Span( - start: 23, - end: 24, - ), - ), - ], - span: Span( - start: 22, - end: 25, - ), - ), - ), - span: Span( - start: 16, - end: 25, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/return_stmt.ron b/parser/tests/fixtures/parsers/return_stmt.ron deleted file mode 100644 index f2da843196..0000000000 --- a/parser/tests/fixtures/parsers/return_stmt.ron +++ /dev/null @@ -1,60 +0,0 @@ -return -return x -return not x ---- -[ - Node( - kind: Return( - value: None, - ), - span: Span( - start: 0, - end: 6, - ), - ), - Node( - kind: Return( - value: Some(Node( - kind: Name("x"), - span: Span( - start: 14, - end: 15, - ), - )), - ), - span: Span( - start: 7, - end: 15, - ), - ), - Node( - kind: Return( - value: Some(Node( - kind: UnaryOperation( - op: Node( - kind: Not, - span: Span( - start: 23, - end: 26, - ), - ), - operand: Node( - kind: Name("x"), - span: Span( - start: 27, - end: 28, - ), - ), - ), - span: Span( - start: 23, - end: 28, - ), - )), - ), - span: Span( - start: 16, - end: 28, - ), - ), -] \ No newline at end of file diff --git a/parser/tests/fixtures/parsers/revert_stmt.ron b/parser/tests/fixtures/parsers/revert_stmt.ron deleted file mode 100644 index d0d66cb409..0000000000 --- a/parser/tests/fixtures/parsers/revert_stmt.ron +++ /dev/null @@ -1,11 +0,0 @@ -revert ---- -[ - Node( - kind: Revert, - span: Span( - start: 0, - end: 6, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/shift_expr.ron b/parser/tests/fixtures/parsers/shift_expr.ron deleted file mode 100644 index 8914036436..0000000000 --- a/parser/tests/fixtures/parsers/shift_expr.ron +++ /dev/null @@ -1,123 +0,0 @@ -x -x << y -x >> y -x << y >> z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: LShift, - span: Span( - start: 4, - end: 6, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 7, - end: 8, - ), - ), - ), - span: Span( - start: 2, - end: 8, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 9, - end: 10, - ), - ), - op: Node( - kind: RShift, - span: Span( - start: 11, - end: 13, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 14, - end: 15, - ), - ), - ), - span: Span( - start: 9, - end: 15, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 16, - end: 17, - ), - ), - op: Node( - kind: LShift, - span: Span( - start: 18, - end: 20, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 21, - end: 22, - ), - ), - ), - span: Span( - start: 16, - end: 22, - ), - ), - op: Node( - kind: RShift, - span: Span( - start: 23, - end: 25, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 26, - end: 27, - ), - ), - ), - span: Span( - start: 16, - end: 27, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/simple_import.ron b/parser/tests/fixtures/parsers/simple_import.ron deleted file mode 100644 index f20372b453..0000000000 --- a/parser/tests/fixtures/parsers/simple_import.ron +++ /dev/null @@ -1,162 +0,0 @@ -import foo -import foo as bar, baz -import foo as bar, baz, bing as bop ---- -[ - Node( - kind: SimpleImport( - names: [ - Node( - kind: SimpleImportName( - path: [ - Node( - kind: "foo", - span: Span( - start: 7, - end: 10, - ), - ), - ], - alias: None, - ), - span: Span( - start: 7, - end: 10, - ), - ), - ], - ), - span: Span( - start: 0, - end: 10, - ), - ), - Node( - kind: SimpleImport( - names: [ - Node( - kind: SimpleImportName( - path: [ - Node( - kind: "foo", - span: Span( - start: 18, - end: 21, - ), - ), - ], - alias: Some(Node( - kind: "bar", - span: Span( - start: 25, - end: 28, - ), - )), - ), - span: Span( - start: 18, - end: 28, - ), - ), - Node( - kind: SimpleImportName( - path: [ - Node( - kind: "baz", - span: Span( - start: 30, - end: 33, - ), - ), - ], - alias: None, - ), - span: Span( - start: 30, - end: 33, - ), - ), - ], - ), - span: Span( - start: 11, - end: 33, - ), - ), - Node( - kind: SimpleImport( - names: [ - Node( - kind: SimpleImportName( - path: [ - Node( - kind: "foo", - span: Span( - start: 41, - end: 44, - ), - ), - ], - alias: Some(Node( - kind: "bar", - span: Span( - start: 48, - end: 51, - ), - )), - ), - span: Span( - start: 41, - end: 51, - ), - ), - Node( - kind: SimpleImportName( - path: [ - Node( - kind: "baz", - span: Span( - start: 53, - end: 56, - ), - ), - ], - alias: None, - ), - span: Span( - start: 53, - end: 56, - ), - ), - Node( - kind: SimpleImportName( - path: [ - Node( - kind: "bing", - span: Span( - start: 58, - end: 62, - ), - ), - ], - alias: Some(Node( - kind: "bop", - span: Span( - start: 66, - end: 69, - ), - )), - ), - span: Span( - start: 58, - end: 69, - ), - ), - ], - ), - span: Span( - start: 34, - end: 69, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/slices.ron b/parser/tests/fixtures/parsers/slices.ron deleted file mode 100644 index cd85ecbe06..0000000000 --- a/parser/tests/fixtures/parsers/slices.ron +++ /dev/null @@ -1,64 +0,0 @@ -x -x, -x, x ---- -[ - [ - Node( - kind: Index(Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - )), - span: Span( - start: 0, - end: 1, - ), - ), - ], - [ - Node( - kind: Index(Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - )), - span: Span( - start: 2, - end: 3, - ), - ), - ], - [ - Node( - kind: Index(Node( - kind: Name("x"), - span: Span( - start: 5, - end: 6, - ), - )), - span: Span( - start: 5, - end: 6, - ), - ), - Node( - kind: Index(Node( - kind: Name("x"), - span: Span( - start: 8, - end: 9, - ), - )), - span: Span( - start: 8, - end: 9, - ), - ), - ], -] diff --git a/parser/tests/fixtures/parsers/small_stmt.ron b/parser/tests/fixtures/parsers/small_stmt.ron deleted file mode 100644 index 6b183ce140..0000000000 --- a/parser/tests/fixtures/parsers/small_stmt.ron +++ /dev/null @@ -1,188 +0,0 @@ -return -assert x -emit Foo() -pass -break -continue -revert -x: bool = y -x = y -x += y -x ---- -[ - Node( - kind: Return( - value: None, - ), - span: Span( - start: 0, - end: 6, - ), - ), - Node( - kind: Assert( - test: Node( - kind: Name("x"), - span: Span( - start: 14, - end: 15, - ), - ), - msg: None, - ), - span: Span( - start: 7, - end: 15, - ), - ), - Node( - kind: Emit( - name: Node( - kind: "Foo", - span: Span( - start: 21, - end: 24, - ), - ), - args: Node( - kind: [], - span: Span( - start: 24, - end: 26, - ), - ), - ), - span: Span( - start: 16, - end: 26, - ), - ), - Node( - kind: Pass, - span: Span( - start: 27, - end: 31, - ), - ), - Node( - kind: Break, - span: Span( - start: 32, - end: 37, - ), - ), - Node( - kind: Continue, - span: Span( - start: 38, - end: 46, - ), - ), - Node( - kind: Revert, - span: Span( - start: 47, - end: 53, - ), - ), - Node( - kind: VarDecl( - target: Node( - kind: Name("x"), - span: Span( - start: 54, - end: 55, - ), - ), - typ: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 57, - end: 61, - ), - ), - value: Some(Node( - kind: Name("y"), - span: Span( - start: 64, - end: 65, - ), - )), - ), - span: Span( - start: 54, - end: 65, - ), - ), - Node( - kind: Assign( - targets: [ - Node( - kind: Name("x"), - span: Span( - start: 66, - end: 67, - ), - ), - ], - value: Node( - kind: Name("y"), - span: Span( - start: 70, - end: 71, - ), - ), - ), - span: Span( - start: 66, - end: 71, - ), - ), - Node( - kind: AugAssign( - target: Node( - kind: Name("x"), - span: Span( - start: 72, - end: 73, - ), - ), - op: Node( - kind: Add, - span: Span( - start: 74, - end: 76, - ), - ), - value: Node( - kind: Name("y"), - span: Span( - start: 77, - end: 78, - ), - ), - ), - span: Span( - start: 72, - end: 78, - ), - ), - Node( - kind: Expr( - value: Node( - kind: Name("x"), - span: Span( - start: 79, - end: 80, - ), - ), - ), - span: Span( - start: 79, - end: 80, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/struct_def.ron b/parser/tests/fixtures/parsers/struct_def.ron deleted file mode 100644 index 7a24b730a6..0000000000 --- a/parser/tests/fixtures/parsers/struct_def.ron +++ /dev/null @@ -1,157 +0,0 @@ -struct Foo: - x: address - pub y: u256 - const z: u8 - pub const a: u8 ---- -[ - Node( - kind: StructDef( - name: Node( - kind: "Foo", - span: Span( - start: 7, - end: 10, - ), - ), - fields: [ - Node( - kind: Field( - pub_qual: None, - const_qual: None, - name: Node( - kind: "x", - span: Span( - start: 16, - end: 17, - ), - ), - typ: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 19, - end: 26, - ), - ), - value: None, - ), - span: Span( - start: 16, - end: 26, - ), - ), - Node( - kind: Field( - pub_qual: Some(Node( - kind: PubQualifier(), - span: Span( - start: 31, - end: 34, - ), - )), - const_qual: None, - name: Node( - kind: "y", - span: Span( - start: 35, - end: 36, - ), - ), - typ: Node( - kind: Base( - base: "u256", - ), - span: Span( - start: 38, - end: 42, - ), - ), - value: None, - ), - span: Span( - start: 31, - end: 42, - ), - ), - Node( - kind: Field( - pub_qual: None, - const_qual: Some(Node( - kind: ConstQualifier(), - span: Span( - start: 47, - end: 52, - ), - )), - name: Node( - kind: "z", - span: Span( - start: 53, - end: 54, - ), - ), - typ: Node( - kind: Base( - base: "u8", - ), - span: Span( - start: 56, - end: 58, - ), - ), - value: None, - ), - span: Span( - start: 47, - end: 58, - ), - ), - Node( - kind: Field( - pub_qual: Some(Node( - kind: PubQualifier(), - span: Span( - start: 63, - end: 66, - ), - )), - const_qual: Some(Node( - kind: ConstQualifier(), - span: Span( - start: 67, - end: 72, - ), - )), - name: Node( - kind: "a", - span: Span( - start: 73, - end: 74, - ), - ), - typ: Node( - kind: Base( - base: "u8", - ), - span: Span( - start: 76, - end: 78, - ), - ), - value: None, - ), - span: Span( - start: 63, - end: 78, - ), - ), - ], - ), - span: Span( - start: 0, - end: 78, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/sum.ron b/parser/tests/fixtures/parsers/sum.ron deleted file mode 100644 index afbde78541..0000000000 --- a/parser/tests/fixtures/parsers/sum.ron +++ /dev/null @@ -1,123 +0,0 @@ -x -x + y -x - y -x + y - z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: Add, - span: Span( - start: 4, - end: 5, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 6, - end: 7, - ), - ), - ), - span: Span( - start: 2, - end: 7, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 8, - end: 9, - ), - ), - op: Node( - kind: Sub, - span: Span( - start: 10, - end: 11, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 12, - end: 13, - ), - ), - ), - span: Span( - start: 8, - end: 13, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 14, - end: 15, - ), - ), - op: Node( - kind: Add, - span: Span( - start: 16, - end: 17, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 18, - end: 19, - ), - ), - ), - span: Span( - start: 14, - end: 19, - ), - ), - op: Node( - kind: Sub, - span: Span( - start: 20, - end: 21, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 22, - end: 23, - ), - ), - ), - span: Span( - start: 14, - end: 23, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/target.ron b/parser/tests/fixtures/parsers/target.ron deleted file mode 100644 index eb160f233d..0000000000 --- a/parser/tests/fixtures/parsers/target.ron +++ /dev/null @@ -1,86 +0,0 @@ -x.y -x(y).z -x ---- -[ - Node( - kind: Attribute( - value: Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - attr: Node( - kind: "y", - span: Span( - start: 2, - end: 3, - ), - ), - ), - span: Span( - start: 0, - end: 3, - ), - ), - Node( - kind: Attribute( - value: Node( - kind: Call( - func: Node( - kind: Name("x"), - span: Span( - start: 4, - end: 5, - ), - ), - args: Node( - kind: [ - Node( - kind: Arg(Node( - kind: Name("y"), - span: Span( - start: 6, - end: 7, - ), - )), - span: Span( - start: 6, - end: 7, - ), - ), - ], - span: Span( - start: 5, - end: 8, - ), - ), - ), - span: Span( - start: 4, - end: 8, - ), - ), - attr: Node( - kind: "z", - span: Span( - start: 9, - end: 10, - ), - ), - ), - span: Span( - start: 4, - end: 10, - ), - ), - Node( - kind: Name("x"), - span: Span( - start: 11, - end: 12, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/term.ron b/parser/tests/fixtures/parsers/term.ron deleted file mode 100644 index be7b664f15..0000000000 --- a/parser/tests/fixtures/parsers/term.ron +++ /dev/null @@ -1,153 +0,0 @@ -x -x * y -x / y -x % y -x * y / z ---- -[ - Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 2, - end: 3, - ), - ), - op: Node( - kind: Mult, - span: Span( - start: 4, - end: 5, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 6, - end: 7, - ), - ), - ), - span: Span( - start: 2, - end: 7, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 8, - end: 9, - ), - ), - op: Node( - kind: Div, - span: Span( - start: 10, - end: 11, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 12, - end: 13, - ), - ), - ), - span: Span( - start: 8, - end: 13, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 14, - end: 15, - ), - ), - op: Node( - kind: Mod, - span: Span( - start: 16, - end: 17, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 18, - end: 19, - ), - ), - ), - span: Span( - start: 14, - end: 19, - ), - ), - Node( - kind: BinOperation( - left: Node( - kind: BinOperation( - left: Node( - kind: Name("x"), - span: Span( - start: 20, - end: 21, - ), - ), - op: Node( - kind: Mult, - span: Span( - start: 22, - end: 23, - ), - ), - right: Node( - kind: Name("y"), - span: Span( - start: 24, - end: 25, - ), - ), - ), - span: Span( - start: 20, - end: 25, - ), - ), - op: Node( - kind: Div, - span: Span( - start: 26, - end: 27, - ), - ), - right: Node( - kind: Name("z"), - span: Span( - start: 28, - end: 29, - ), - ), - ), - span: Span( - start: 20, - end: 29, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/tuple.ron b/parser/tests/fixtures/parsers/tuple.ron deleted file mode 100644 index f52816d3a2..0000000000 --- a/parser/tests/fixtures/parsers/tuple.ron +++ /dev/null @@ -1,113 +0,0 @@ -(x,) -(x, y) -(1, 2, 3, ) -( x -, y -, z -) ---- -[ - Node( - kind: Tuple( - elts: [ - Node( - kind: Name("x"), - span: Span( - start: 1, - end: 2, - ), - ), - ], - ), - span: Span( - start: 0, - end: 4, - ), - ), - Node( - kind: Tuple( - elts: [ - Node( - kind: Name("x"), - span: Span( - start: 6, - end: 7, - ), - ), - Node( - kind: Name("y"), - span: Span( - start: 9, - end: 10, - ), - ), - ], - ), - span: Span( - start: 5, - end: 11, - ), - ), - Node( - kind: Tuple( - elts: [ - Node( - kind: Num("1"), - span: Span( - start: 13, - end: 14, - ), - ), - Node( - kind: Num("2"), - span: Span( - start: 16, - end: 17, - ), - ), - Node( - kind: Num("3"), - span: Span( - start: 19, - end: 20, - ), - ), - ], - ), - span: Span( - start: 12, - end: 23, - ), - ), - Node( - kind: Tuple( - elts: [ - Node( - kind: Name("x"), - span: Span( - start: 26, - end: 27, - ), - ), - Node( - kind: Name("y"), - span: Span( - start: 30, - end: 31, - ), - ), - Node( - kind: Name("z"), - span: Span( - start: 34, - end: 35, - ), - ), - ], - ), - span: Span( - start: 24, - end: 37, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/type_def.ron b/parser/tests/fixtures/parsers/type_def.ron deleted file mode 100644 index acf6b19e05..0000000000 --- a/parser/tests/fixtures/parsers/type_def.ron +++ /dev/null @@ -1,37 +0,0 @@ -type Msg = bytes[100] ---- -[ - Node( - kind: TypeDef( - name: Node( - kind: "Msg", - span: Span( - start: 5, - end: 8, - ), - ), - typ: Node( - kind: Array( - typ: Node( - kind: Base( - base: "bytes", - ), - span: Span( - start: 11, - end: 16, - ), - ), - dimension: 100, - ), - span: Span( - start: 11, - end: 21, - ), - ), - ), - span: Span( - start: 0, - end: 21, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/type_desc.ron b/parser/tests/fixtures/parsers/type_desc.ron deleted file mode 100644 index 7720c4f7e0..0000000000 --- a/parser/tests/fixtures/parsers/type_desc.ron +++ /dev/null @@ -1,79 +0,0 @@ -() -(u8, u16) -address -map ---- -[ - Node( - kind: Tuple( - items: [], - ), - span: Span( - start: 0, - end: 2, - ), - ), - Node( - kind: Tuple( - items: [ - Node( - kind: Base( - base: "u8", - ), - span: Span( - start: 4, - end: 6, - ), - ), - Node( - kind: Base( - base: "u16", - ), - span: Span( - start: 8, - end: 11, - ), - ), - ], - ), - span: Span( - start: 3, - end: 12, - ), - ), - Node( - kind: Base( - base: "address", - ), - span: Span( - start: 13, - end: 20, - ), - ), - Node( - kind: Map( - from: Node( - kind: Base( - base: "address", - ), - span: Span( - start: 25, - end: 32, - ), - ), - to: Node( - kind: Base( - base: "bool", - ), - span: Span( - start: 34, - end: 38, - ), - ), - ), - span: Span( - start: 21, - end: 39, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/vardecl_stmt.ron b/parser/tests/fixtures/parsers/vardecl_stmt.ron deleted file mode 100644 index 34c8f806a7..0000000000 --- a/parser/tests/fixtures/parsers/vardecl_stmt.ron +++ /dev/null @@ -1,61 +0,0 @@ -x: uint128 -x: uint128 = y ---- -[ - Node( - kind: VarDecl( - target: Node( - kind: Name("x"), - span: Span( - start: 0, - end: 1, - ), - ), - typ: Node( - kind: Base( - base: "uint128", - ), - span: Span( - start: 3, - end: 10, - ), - ), - value: None, - ), - span: Span( - start: 0, - end: 10, - ), - ), - Node( - kind: VarDecl( - target: Node( - kind: Name("x"), - span: Span( - start: 11, - end: 12, - ), - ), - typ: Node( - kind: Base( - base: "uint128", - ), - span: Span( - start: 14, - end: 21, - ), - ), - value: Some(Node( - kind: Name("y"), - span: Span( - start: 24, - end: 25, - ), - )), - ), - span: Span( - start: 11, - end: 25, - ), - ), -] diff --git a/parser/tests/fixtures/parsers/while_stmt.ron b/parser/tests/fixtures/parsers/while_stmt.ron deleted file mode 100644 index 73f24ca693..0000000000 --- a/parser/tests/fixtures/parsers/while_stmt.ron +++ /dev/null @@ -1,92 +0,0 @@ -while a: - b - -while a: - b -else: - c ---- -[ - Node( - kind: While( - test: Node( - kind: Name("a"), - span: Span( - start: 6, - end: 7, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 13, - end: 14, - ), - ), - ), - span: Span( - start: 13, - end: 14, - ), - ), - ], - or_else: [], - ), - span: Span( - start: 0, - end: 14, - ), - ), - Node( - kind: While( - test: Node( - kind: Name("a"), - span: Span( - start: 22, - end: 23, - ), - ), - body: [ - Node( - kind: Expr( - value: Node( - kind: Name("b"), - span: Span( - start: 29, - end: 30, - ), - ), - ), - span: Span( - start: 29, - end: 30, - ), - ), - ], - or_else: [ - Node( - kind: Expr( - value: Node( - kind: Name("c"), - span: Span( - start: 41, - end: 42, - ), - ), - ), - span: Span( - start: 41, - end: 42, - ), - ), - ], - ), - span: Span( - start: 16, - end: 42, - ), - ), -] diff --git a/parser/tests/fixtures/tokenizer/basic.py.json b/parser/tests/fixtures/tokenizer/basic.py.json deleted file mode 100644 index 6eeeaf61a6..0000000000 --- a/parser/tests/fixtures/tokenizer/basic.py.json +++ /dev/null @@ -1,480 +0,0 @@ - -# Test comment -class TestClassDefinition(WithParent1, WithParent2): - foo = 'bar' - - def foo(): - return 'bar' - -test = 'foo' ---- -[ - { - "typ": "NL", - "string": "\n", - "start": [ - 1, - 0 - ], - "end": [ - 2, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Test comment", - "start": [ - 2, - 0 - ], - "end": [ - 2, - 14 - ], - "line": "# Test comment\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 2, - 14 - ], - "end": [ - 3, - 0 - ], - "line": "# Test comment\n" - }, - { - "typ": "NAME", - "string": "class", - "start": [ - 3, - 0 - ], - "end": [ - 3, - 5 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NAME", - "string": "TestClassDefinition", - "start": [ - 3, - 6 - ], - "end": [ - 3, - 25 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 3, - 25 - ], - "end": [ - 3, - 26 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NAME", - "string": "WithParent1", - "start": [ - 3, - 26 - ], - "end": [ - 3, - 37 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 3, - 37 - ], - "end": [ - 3, - 38 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NAME", - "string": "WithParent2", - "start": [ - 3, - 39 - ], - "end": [ - 3, - 50 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 3, - 50 - ], - "end": [ - 3, - 51 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 3, - 51 - ], - "end": [ - 3, - 52 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 3, - 52 - ], - "end": [ - 4, - 0 - ], - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 4, - 0 - ], - "end": [ - 4, - 4 - ], - "line": " foo = 'bar'\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 4, - 4 - ], - "end": [ - 4, - 7 - ], - "line": " foo = 'bar'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 4, - 8 - ], - "end": [ - 4, - 9 - ], - "line": " foo = 'bar'\n" - }, - { - "typ": "STRING", - "string": "'bar'", - "start": [ - 4, - 10 - ], - "end": [ - 4, - 15 - ], - "line": " foo = 'bar'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 4, - 15 - ], - "end": [ - 5, - 0 - ], - "line": " foo = 'bar'\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 5, - 0 - ], - "end": [ - 6, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 6, - 4 - ], - "end": [ - 6, - 7 - ], - "line": " def foo():\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 6, - 8 - ], - "end": [ - 6, - 11 - ], - "line": " def foo():\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 6, - 11 - ], - "end": [ - 6, - 12 - ], - "line": " def foo():\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 6, - 12 - ], - "end": [ - 6, - 13 - ], - "line": " def foo():\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 6, - 13 - ], - "end": [ - 6, - 14 - ], - "line": " def foo():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 6, - 14 - ], - "end": [ - 7, - 0 - ], - "line": " def foo():\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 7, - 0 - ], - "end": [ - 7, - 8 - ], - "line": " return 'bar'\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 7, - 8 - ], - "end": [ - 7, - 14 - ], - "line": " return 'bar'\n" - }, - { - "typ": "STRING", - "string": "'bar'", - "start": [ - 7, - 15 - ], - "end": [ - 7, - 20 - ], - "line": " return 'bar'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 7, - 20 - ], - "end": [ - 8, - 0 - ], - "line": " return 'bar'\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 8, - 0 - ], - "end": [ - 9, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 9, - 0 - ], - "end": [ - 9, - 0 - ], - "line": "test = 'foo'" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 9, - 0 - ], - "end": [ - 9, - 0 - ], - "line": "test = 'foo'" - }, - { - "typ": "NAME", - "string": "test", - "start": [ - 9, - 0 - ], - "end": [ - 9, - 4 - ], - "line": "test = 'foo'" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 9, - 5 - ], - "end": [ - 9, - 6 - ], - "line": "test = 'foo'" - }, - { - "typ": "STRING", - "string": "'foo'", - "start": [ - 9, - 7 - ], - "end": [ - 9, - 12 - ], - "line": "test = 'foo'" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 9, - 12 - ], - "end": [ - 9, - 12 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 9, - 12 - ], - "end": [ - 9, - 12 - ], - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/continued_statements.py.json b/parser/tests/fixtures/tokenizer/continued_statements.py.json deleted file mode 100644 index c04618b309..0000000000 --- a/parser/tests/fixtures/tokenizer/continued_statements.py.json +++ /dev/null @@ -1,795 +0,0 @@ -foo = "bar" \ - "baz" \ - "bing" - -foo = ( - "bar" - "baz" - "bing" -) - -foo = ( - "bar" + - "baz" + - "bing" -) - -foo = ( - "bar" - + "baz" - + "bing" -) - -foo = bar or \ - baz or \ - bing ---- -[ - { - "typ": "NAME", - "string": "foo", - "start": [ - 1, - 0 - ], - "end": [ - 1, - 3 - ], - "line": "foo = \"bar\" \\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 1, - 4 - ], - "end": [ - 1, - 5 - ], - "line": "foo = \"bar\" \\\n" - }, - { - "typ": "STRING", - "string": "\"bar\"", - "start": [ - 1, - 6 - ], - "end": [ - 1, - 11 - ], - "line": "foo = \"bar\" \\\n" - }, - { - "typ": "STRING", - "string": "\"baz\"", - "start": [ - 2, - 4 - ], - "end": [ - 2, - 9 - ], - "line": " \"baz\" \\\n" - }, - { - "typ": "STRING", - "string": "\"bing\"", - "start": [ - 3, - 4 - ], - "end": [ - 3, - 10 - ], - "line": " \"bing\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 3, - 10 - ], - "end": [ - 4, - 0 - ], - "line": " \"bing\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 4, - 0 - ], - "end": [ - 5, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 5, - 0 - ], - "end": [ - 5, - 3 - ], - "line": "foo = (\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 5, - 4 - ], - "end": [ - 5, - 5 - ], - "line": "foo = (\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 5, - 6 - ], - "end": [ - 5, - 7 - ], - "line": "foo = (\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 5, - 7 - ], - "end": [ - 6, - 0 - ], - "line": "foo = (\n" - }, - { - "typ": "STRING", - "string": "\"bar\"", - "start": [ - 6, - 4 - ], - "end": [ - 6, - 9 - ], - "line": " \"bar\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 6, - 9 - ], - "end": [ - 7, - 0 - ], - "line": " \"bar\"\n" - }, - { - "typ": "STRING", - "string": "\"baz\"", - "start": [ - 7, - 4 - ], - "end": [ - 7, - 9 - ], - "line": " \"baz\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 7, - 9 - ], - "end": [ - 8, - 0 - ], - "line": " \"baz\"\n" - }, - { - "typ": "STRING", - "string": "\"bing\"", - "start": [ - 8, - 4 - ], - "end": [ - 8, - 10 - ], - "line": " \"bing\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 8, - 10 - ], - "end": [ - 9, - 0 - ], - "line": " \"bing\"\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 9, - 0 - ], - "end": [ - 9, - 1 - ], - "line": ")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 9, - 1 - ], - "end": [ - 10, - 0 - ], - "line": ")\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 10, - 0 - ], - "end": [ - 11, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 11, - 0 - ], - "end": [ - 11, - 3 - ], - "line": "foo = (\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 11, - 4 - ], - "end": [ - 11, - 5 - ], - "line": "foo = (\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 11, - 6 - ], - "end": [ - 11, - 7 - ], - "line": "foo = (\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 11, - 7 - ], - "end": [ - 12, - 0 - ], - "line": "foo = (\n" - }, - { - "typ": "STRING", - "string": "\"bar\"", - "start": [ - 12, - 4 - ], - "end": [ - 12, - 9 - ], - "line": " \"bar\" +\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 12, - 10 - ], - "end": [ - 12, - 11 - ], - "line": " \"bar\" +\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 12, - 11 - ], - "end": [ - 13, - 0 - ], - "line": " \"bar\" +\n" - }, - { - "typ": "STRING", - "string": "\"baz\"", - "start": [ - 13, - 4 - ], - "end": [ - 13, - 9 - ], - "line": " \"baz\" +\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 13, - 10 - ], - "end": [ - 13, - 11 - ], - "line": " \"baz\" +\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 13, - 11 - ], - "end": [ - 14, - 0 - ], - "line": " \"baz\" +\n" - }, - { - "typ": "STRING", - "string": "\"bing\"", - "start": [ - 14, - 4 - ], - "end": [ - 14, - 10 - ], - "line": " \"bing\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 14, - 10 - ], - "end": [ - 15, - 0 - ], - "line": " \"bing\"\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 15, - 0 - ], - "end": [ - 15, - 1 - ], - "line": ")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 15, - 1 - ], - "end": [ - 16, - 0 - ], - "line": ")\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 16, - 0 - ], - "end": [ - 17, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 17, - 0 - ], - "end": [ - 17, - 3 - ], - "line": "foo = (\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 17, - 4 - ], - "end": [ - 17, - 5 - ], - "line": "foo = (\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 17, - 6 - ], - "end": [ - 17, - 7 - ], - "line": "foo = (\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 17, - 7 - ], - "end": [ - 18, - 0 - ], - "line": "foo = (\n" - }, - { - "typ": "STRING", - "string": "\"bar\"", - "start": [ - 18, - 4 - ], - "end": [ - 18, - 9 - ], - "line": " \"bar\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 18, - 9 - ], - "end": [ - 19, - 0 - ], - "line": " \"bar\"\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 19, - 4 - ], - "end": [ - 19, - 5 - ], - "line": " + \"baz\"\n" - }, - { - "typ": "STRING", - "string": "\"baz\"", - "start": [ - 19, - 6 - ], - "end": [ - 19, - 11 - ], - "line": " + \"baz\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 19, - 11 - ], - "end": [ - 20, - 0 - ], - "line": " + \"baz\"\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 20, - 4 - ], - "end": [ - 20, - 5 - ], - "line": " + \"bing\"\n" - }, - { - "typ": "STRING", - "string": "\"bing\"", - "start": [ - 20, - 6 - ], - "end": [ - 20, - 12 - ], - "line": " + \"bing\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 20, - 12 - ], - "end": [ - 21, - 0 - ], - "line": " + \"bing\"\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 21, - 0 - ], - "end": [ - 21, - 1 - ], - "line": ")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 21, - 1 - ], - "end": [ - 22, - 0 - ], - "line": ")\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 22, - 0 - ], - "end": [ - 23, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 23, - 0 - ], - "end": [ - 23, - 3 - ], - "line": "foo = bar or \\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 23, - 4 - ], - "end": [ - 23, - 5 - ], - "line": "foo = bar or \\\n" - }, - { - "typ": "NAME", - "string": "bar", - "start": [ - 23, - 6 - ], - "end": [ - 23, - 9 - ], - "line": "foo = bar or \\\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 23, - 10 - ], - "end": [ - 23, - 12 - ], - "line": "foo = bar or \\\n" - }, - { - "typ": "NAME", - "string": "baz", - "start": [ - 24, - 4 - ], - "end": [ - 24, - 7 - ], - "line": " baz or \\\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 24, - 8 - ], - "end": [ - 24, - 10 - ], - "line": " baz or \\\n" - }, - { - "typ": "NAME", - "string": "bing", - "start": [ - 25, - 4 - ], - "end": [ - 25, - 8 - ], - "line": " bing" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 25, - 8 - ], - "end": [ - 25, - 8 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 25, - 8 - ], - "end": [ - 25, - 8 - ], - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/one_stmt_form_feed.v.py.json b/parser/tests/fixtures/tokenizer/one_stmt_form_feed.v.py.json deleted file mode 100644 index e43830e269..0000000000 --- a/parser/tests/fixtures/tokenizer/one_stmt_form_feed.v.py.json +++ /dev/null @@ -1,201 +0,0 @@ -event Greet: - name: bytes32 - age: uint8 ---- -[ - { - "typ": "NAME", - "string": "event", - "start": [ - 1, - 0 - ], - "end": [ - 1, - 5 - ], - "line": "event Greet:\n" - }, - { - "typ": "NAME", - "string": "Greet", - "start": [ - 1, - 6 - ], - "end": [ - 1, - 11 - ], - "line": "event Greet:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 1, - 11 - ], - "end": [ - 1, - 12 - ], - "line": "event Greet:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 1, - 12 - ], - "end": [ - 2, - 0 - ], - "line": "event Greet:\n" - }, - { - "typ": "INDENT", - "string": " \f ", - "start": [ - 2, - 0 - ], - "end": [ - 2, - 9 - ], - "line": " \f name: bytes32\n" - }, - { - "typ": "NAME", - "string": "name", - "start": [ - 2, - 9 - ], - "end": [ - 2, - 13 - ], - "line": " \f name: bytes32\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 2, - 13 - ], - "end": [ - 2, - 14 - ], - "line": " \f name: bytes32\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 2, - 15 - ], - "end": [ - 2, - 22 - ], - "line": " \f name: bytes32\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 2, - 22 - ], - "end": [ - 3, - 0 - ], - "line": " \f name: bytes32\n" - }, - { - "typ": "NAME", - "string": "age", - "start": [ - 3, - 4 - ], - "end": [ - 3, - 7 - ], - "line": " age: uint8" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 3, - 7 - ], - "end": [ - 3, - 8 - ], - "line": " age: uint8" - }, - { - "typ": "NAME", - "string": "uint8", - "start": [ - 3, - 9 - ], - "end": [ - 3, - 14 - ], - "line": " age: uint8" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 3, - 14 - ], - "end": [ - 3, - 14 - ], - "line": "" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 3, - 14 - ], - "end": [ - 3, - 14 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 3, - 14 - ], - "end": [ - 3, - 14 - ], - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/single_quote_strings.py.json b/parser/tests/fixtures/tokenizer/single_quote_strings.py.json deleted file mode 100644 index 1ded053c02..0000000000 --- a/parser/tests/fixtures/tokenizer/single_quote_strings.py.json +++ /dev/null @@ -1,506 +0,0 @@ -foo = "bar" - -foo = 'bar' - -foo = ' \nbar ' - -foo = " \ -bar -" - -foo = ' \ -bar -' - -foo = ' \ -bar \ -' - -foo = ' \n\ -bar \r \ -lkjasdkfas \ -' ---- -[ - { - "typ": "NAME", - "string": "foo", - "start": [ - 1, - 0 - ], - "end": [ - 1, - 3 - ], - "line": "foo = \"bar\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 1, - 4 - ], - "end": [ - 1, - 5 - ], - "line": "foo = \"bar\"\n" - }, - { - "typ": "STRING", - "string": "\"bar\"", - "start": [ - 1, - 6 - ], - "end": [ - 1, - 11 - ], - "line": "foo = \"bar\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 1, - 11 - ], - "end": [ - 2, - 0 - ], - "line": "foo = \"bar\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 2, - 0 - ], - "end": [ - 3, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 3, - 0 - ], - "end": [ - 3, - 3 - ], - "line": "foo = 'bar'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 3, - 4 - ], - "end": [ - 3, - 5 - ], - "line": "foo = 'bar'\n" - }, - { - "typ": "STRING", - "string": "'bar'", - "start": [ - 3, - 6 - ], - "end": [ - 3, - 11 - ], - "line": "foo = 'bar'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 3, - 11 - ], - "end": [ - 4, - 0 - ], - "line": "foo = 'bar'\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 4, - 0 - ], - "end": [ - 5, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 5, - 0 - ], - "end": [ - 5, - 3 - ], - "line": "foo = ' \\nbar '\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 5, - 4 - ], - "end": [ - 5, - 5 - ], - "line": "foo = ' \\nbar '\n" - }, - { - "typ": "STRING", - "string": "' \\nbar '", - "start": [ - 5, - 6 - ], - "end": [ - 5, - 15 - ], - "line": "foo = ' \\nbar '\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 5, - 15 - ], - "end": [ - 6, - 0 - ], - "line": "foo = ' \\nbar '\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 6, - 0 - ], - "end": [ - 7, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 7, - 0 - ], - "end": [ - 7, - 3 - ], - "line": "foo = \" \\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 7, - 4 - ], - "end": [ - 7, - 5 - ], - "line": "foo = \" \\\n" - }, - { - "typ": "ERRORTOKEN", - "string": "\" \\\nbar\n", - "start": [ - 7, - 6 - ], - "end": [ - 9, - 0 - ], - "line": "foo = \" \\\n" - }, - { - "typ": "ERRORTOKEN", - "string": "\"", - "start": [ - 9, - 0 - ], - "end": [ - 9, - 1 - ], - "line": "\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 9, - 1 - ], - "end": [ - 10, - 0 - ], - "line": "\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 10, - 0 - ], - "end": [ - 11, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 11, - 0 - ], - "end": [ - 11, - 3 - ], - "line": "foo = ' \\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 11, - 4 - ], - "end": [ - 11, - 5 - ], - "line": "foo = ' \\\n" - }, - { - "typ": "ERRORTOKEN", - "string": "' \\\nbar\n", - "start": [ - 11, - 6 - ], - "end": [ - 13, - 0 - ], - "line": "foo = ' \\\n" - }, - { - "typ": "ERRORTOKEN", - "string": "'", - "start": [ - 13, - 0 - ], - "end": [ - 13, - 1 - ], - "line": "'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 13, - 1 - ], - "end": [ - 14, - 0 - ], - "line": "'\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 14, - 0 - ], - "end": [ - 15, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 15, - 0 - ], - "end": [ - 15, - 3 - ], - "line": "foo = ' \\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 15, - 4 - ], - "end": [ - 15, - 5 - ], - "line": "foo = ' \\\n" - }, - { - "typ": "STRING", - "string": "' \\\nbar \\\n'", - "start": [ - 15, - 6 - ], - "end": [ - 17, - 1 - ], - "line": "foo = ' \\\nbar \\\n'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 17, - 1 - ], - "end": [ - 18, - 0 - ], - "line": "'\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 18, - 0 - ], - "end": [ - 19, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 19, - 0 - ], - "end": [ - 19, - 3 - ], - "line": "foo = ' \\n\\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 19, - 4 - ], - "end": [ - 19, - 5 - ], - "line": "foo = ' \\n\\\n" - }, - { - "typ": "STRING", - "string": "' \\n\\\nbar \\r \\\nlkjasdkfas \\\n'", - "start": [ - 19, - 6 - ], - "end": [ - 22, - 1 - ], - "line": "foo = ' \\n\\\nbar \\r \\\nlkjasdkfas \\\n'" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 22, - 1 - ], - "end": [ - 22, - 1 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 22, - 1 - ], - "end": [ - 22, - 1 - ], - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/tokenize.py.json b/parser/tests/fixtures/tokenizer/tokenize.py.json deleted file mode 100644 index 66cd76c9fe..0000000000 --- a/parser/tests/fixtures/tokenizer/tokenize.py.json +++ /dev/null @@ -1,57224 +0,0 @@ -"""Tokenization help for Python programs. - -tokenize(readline) is a generator that breaks a stream of bytes into -Python tokens. It decodes the bytes according to PEP-0263 for -determining source file encoding. - -It accepts a readline-like method which is called repeatedly to get the -next line of input (or b"" for EOF). It generates 5-tuples with these -members: - - the token type (see token.py) - the token (a string) - the starting (row, column) indices of the token (a 2-tuple of ints) - the ending (row, column) indices of the token (a 2-tuple of ints) - the original line (string) - -It is designed to match the working of the Python tokenizer exactly, except -that it produces COMMENT tokens for comments and gives type OP for all -operators. Additionally, all token lists start with an ENCODING token -which tells you which encoding was used to decode the bytes stream. -""" - -__author__ = 'Ka-Ping Yee ' -__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, ' - 'Skip Montanaro, Raymond Hettinger, Trent Nelson, ' - 'Michael Foord') -from builtins import open as _builtin_open -from codecs import lookup, BOM_UTF8 -import collections -from io import TextIOWrapper -from itertools import chain -import itertools as _itertools -import re -import sys -from token import * - -cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII) -blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII) - -import token -__all__ = token.__all__ + ["tokenize", "detect_encoding", - "untokenize", "TokenInfo"] -del token - -EXACT_TOKEN_TYPES = { - '(': LPAR, - ')': RPAR, - '[': LSQB, - ']': RSQB, - ':': COLON, - ',': COMMA, - ';': SEMI, - '+': PLUS, - '-': MINUS, - '*': STAR, - '/': SLASH, - '|': VBAR, - '&': AMPER, - '<': LESS, - '>': GREATER, - '=': EQUAL, - '.': DOT, - '%': PERCENT, - '{': LBRACE, - '}': RBRACE, - '==': EQEQUAL, - '!=': NOTEQUAL, - '<=': LESSEQUAL, - '>=': GREATEREQUAL, - '~': TILDE, - '^': CIRCUMFLEX, - '<<': LEFTSHIFT, - '>>': RIGHTSHIFT, - '**': DOUBLESTAR, - '+=': PLUSEQUAL, - '-=': MINEQUAL, - '*=': STAREQUAL, - '/=': SLASHEQUAL, - '%=': PERCENTEQUAL, - '&=': AMPEREQUAL, - '|=': VBAREQUAL, - '^=': CIRCUMFLEXEQUAL, - '<<=': LEFTSHIFTEQUAL, - '>>=': RIGHTSHIFTEQUAL, - '**=': DOUBLESTAREQUAL, - '//': DOUBLESLASH, - '//=': DOUBLESLASHEQUAL, - '...': ELLIPSIS, - '->': RARROW, - '@': AT, - '@=': ATEQUAL, -} - -class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')): - def __repr__(self): - annotated_type = '%d (%s)' % (self.type, tok_name[self.type]) - return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' % - self._replace(type=annotated_type)) - - @property - def exact_type(self): - if self.type == OP and self.string in EXACT_TOKEN_TYPES: - return EXACT_TOKEN_TYPES[self.string] - else: - return self.type - -def group(*choices): return '(' + '|'.join(choices) + ')' -def any(*choices): return group(*choices) + '*' -def maybe(*choices): return group(*choices) + '?' - -# Note: we use unicode matching for names ("\w") but ascii matching for -# number literals. -Whitespace = r'[ \f\t]*' -Comment = r'#[^\r\n]*' -Ignore = Whitespace + any(r'\\\r?\n' + Whitespace) + maybe(Comment) -Name = r'\w+' - -Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+' -Binnumber = r'0[bB](?:_?[01])+' -Octnumber = r'0[oO](?:_?[0-7])+' -Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)' -Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) -Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*' -Pointfloat = group(r'[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?', - r'\.[0-9](?:_?[0-9])*') + maybe(Exponent) -Expfloat = r'[0-9](?:_?[0-9])*' + Exponent -Floatnumber = group(Pointfloat, Expfloat) -Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]') -Number = group(Imagnumber, Floatnumber, Intnumber) - -# Return the empty string, plus all of the valid string prefixes. -def _all_string_prefixes(): - # The valid string prefixes. Only contain the lower case versions, - # and don't contain any permutations (include 'fr', but not - # 'rf'). The various permutations will be generated. - _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr'] - # if we add binary f-strings, add: ['fb', 'fbr'] - result = {''} - for prefix in _valid_string_prefixes: - for t in _itertools.permutations(prefix): - # create a list with upper and lower versions of each - # character - for u in _itertools.product(*[(c, c.upper()) for c in t]): - result.add(''.join(u)) - return result - -def _compile(expr): - return re.compile(expr, re.UNICODE) - -# Note that since _all_string_prefixes includes the empty string, -# StringPrefix can be the empty string (making it optional). -StringPrefix = group(*_all_string_prefixes()) - -# Tail end of ' string. -Single = r"[^'\\]*(?:\\.[^'\\]*)*'" -# Tail end of " string. -Double = r'[^"\\]*(?:\\.[^"\\]*)*"' -# Tail end of ''' string. -Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''" -# Tail end of """ string. -Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""' -Triple = group(StringPrefix + "'''", StringPrefix + '"""') -# Single-line ' or " string. -String = group(StringPrefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*'", - StringPrefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*"') - -# Because of leftmost-then-longest match semantics, be sure to put the -# longest operators first (e.g., if = came before ==, == would get -# recognized as two instances of =). -Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"!=", - r"//=?", r"->", - r"[+\-*/%&@|^=<>]=?", - r"~") - -Bracket = '[][(){}]' -Special = group(r'\r?\n', r'\.\.\.', r'[:;.,@]') -Funny = group(Operator, Bracket, Special) - -PlainToken = group(Number, Funny, String, Name) -Token = Ignore + PlainToken - -# First (or only) line of ' or " string. -ContStr = group(StringPrefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*" + - group("'", r'\\\r?\n'), - StringPrefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*' + - group('"', r'\\\r?\n')) -PseudoExtras = group(r'\\\r?\n|\Z', Comment, Triple) -PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name) - -# For a given string prefix plus quotes, endpats maps it to a regex -# to match the remainder of that string. _prefix can be empty, for -# a normal single or triple quoted string (with no prefix). -endpats = {} -for _prefix in _all_string_prefixes(): - endpats[_prefix + "'"] = Single - endpats[_prefix + '"'] = Double - endpats[_prefix + "'''"] = Single3 - endpats[_prefix + '"""'] = Double3 - -# A set of all of the single and triple quoted string prefixes, -# including the opening quotes. -single_quoted = set() -triple_quoted = set() -for t in _all_string_prefixes(): - for u in (t + '"', t + "'"): - single_quoted.add(u) - for u in (t + '"""', t + "'''"): - triple_quoted.add(u) - -tabsize = 8 - -class TokenError(Exception): pass - -class StopTokenizing(Exception): pass - - -class Untokenizer: - - def __init__(self): - self.tokens = [] - self.prev_row = 1 - self.prev_col = 0 - self.encoding = None - - def add_whitespace(self, start): - row, col = start - if row < self.prev_row or row == self.prev_row and col < self.prev_col: - raise ValueError("start ({},{}) precedes previous end ({},{})" - .format(row, col, self.prev_row, self.prev_col)) - row_offset = row - self.prev_row - if row_offset: - self.tokens.append("\\\n" * row_offset) - self.prev_col = 0 - col_offset = col - self.prev_col - if col_offset: - self.tokens.append(" " * col_offset) - - def untokenize(self, iterable): - it = iter(iterable) - indents = [] - startline = False - for t in it: - if len(t) == 2: - self.compat(t, it) - break - tok_type, token, start, end, line = t - if tok_type == ENCODING: - self.encoding = token - continue - if tok_type == ENDMARKER: - break - if tok_type == INDENT: - indents.append(token) - continue - elif tok_type == DEDENT: - indents.pop() - self.prev_row, self.prev_col = end - continue - elif tok_type in (NEWLINE, NL): - startline = True - elif startline and indents: - indent = indents[-1] - if start[1] >= len(indent): - self.tokens.append(indent) - self.prev_col = len(indent) - startline = False - self.add_whitespace(start) - self.tokens.append(token) - self.prev_row, self.prev_col = end - if tok_type in (NEWLINE, NL): - self.prev_row += 1 - self.prev_col = 0 - return "".join(self.tokens) - - def compat(self, token, iterable): - indents = [] - toks_append = self.tokens.append - startline = token[0] in (NEWLINE, NL) - prevstring = False - - for tok in chain([token], iterable): - toknum, tokval = tok[:2] - if toknum == ENCODING: - self.encoding = tokval - continue - - if toknum in (NAME, NUMBER): - tokval += ' ' - - # Insert a space between two consecutive strings - if toknum == STRING: - if prevstring: - tokval = ' ' + tokval - prevstring = True - else: - prevstring = False - - if toknum == INDENT: - indents.append(tokval) - continue - elif toknum == DEDENT: - indents.pop() - continue - elif toknum in (NEWLINE, NL): - startline = True - elif startline and indents: - toks_append(indents[-1]) - startline = False - toks_append(tokval) - - -def untokenize(iterable): - """Transform tokens back into Python source code. - It returns a bytes object, encoded using the ENCODING - token, which is the first token sequence output by tokenize. - - Each element returned by the iterable must be a token sequence - with at least two elements, a token number and token value. If - only two tokens are passed, the resulting output is poor. - - Round-trip invariant for full input: - Untokenized source will match input source exactly - - Round-trip invariant for limited input: - # Output bytes will tokenize back to the input - t1 = [tok[:2] for tok in tokenize(f.readline)] - newcode = untokenize(t1) - readline = BytesIO(newcode).readline - t2 = [tok[:2] for tok in tokenize(readline)] - assert t1 == t2 - """ - ut = Untokenizer() - out = ut.untokenize(iterable) - if ut.encoding is not None: - out = out.encode(ut.encoding) - return out - - -def _get_normal_name(orig_enc): - """Imitates get_normal_name in tokenizer.c.""" - # Only care about the first 12 characters. - enc = orig_enc[:12].lower().replace("_", "-") - if enc == "utf-8" or enc.startswith("utf-8-"): - return "utf-8" - if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \ - enc.startswith(("latin-1-", "iso-8859-1-", "iso-latin-1-")): - return "iso-8859-1" - return orig_enc - -def detect_encoding(readline): - """ - The detect_encoding() function is used to detect the encoding that should - be used to decode a Python source file. It requires one argument, readline, - in the same way as the tokenize() generator. - - It will call readline a maximum of twice, and return the encoding used - (as a string) and a list of any lines (left as bytes) it has read in. - - It detects the encoding from the presence of a utf-8 bom or an encoding - cookie as specified in pep-0263. If both a bom and a cookie are present, - but disagree, a SyntaxError will be raised. If the encoding cookie is an - invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, - 'utf-8-sig' is returned. - - If no encoding is specified, then the default of 'utf-8' will be returned. - """ - try: - filename = readline.__self__.name - except AttributeError: - filename = None - bom_found = False - encoding = None - default = 'utf-8' - def read_or_stop(): - try: - return readline() - except StopIteration: - return b'' - - def find_cookie(line): - try: - # Decode as UTF-8. Either the line is an encoding declaration, - # in which case it should be pure ASCII, or it must be UTF-8 - # per default encoding. - line_string = line.decode('utf-8') - except UnicodeDecodeError: - msg = "invalid or missing encoding declaration" - if filename is not None: - msg = '{} for {!r}'.format(msg, filename) - raise SyntaxError(msg) - - match = cookie_re.match(line_string) - if not match: - return None - encoding = _get_normal_name(match.group(1)) - try: - codec = lookup(encoding) - except LookupError: - # This behaviour mimics the Python interpreter - if filename is None: - msg = "unknown encoding: " + encoding - else: - msg = "unknown encoding for {!r}: {}".format(filename, - encoding) - raise SyntaxError(msg) - - if bom_found: - if encoding != 'utf-8': - # This behaviour mimics the Python interpreter - if filename is None: - msg = 'encoding problem: utf-8' - else: - msg = 'encoding problem for {!r}: utf-8'.format(filename) - raise SyntaxError(msg) - encoding += '-sig' - return encoding - - first = read_or_stop() - if first.startswith(BOM_UTF8): - bom_found = True - first = first[3:] - default = 'utf-8-sig' - if not first: - return default, [] - - encoding = find_cookie(first) - if encoding: - return encoding, [first] - if not blank_re.match(first): - return default, [first] - - second = read_or_stop() - if not second: - return default, [first] - - encoding = find_cookie(second) - if encoding: - return encoding, [first, second] - - return default, [first, second] - - -def open(filename): - """Open a file in read only mode using the encoding detected by - detect_encoding(). - """ - buffer = _builtin_open(filename, 'rb') - try: - encoding, lines = detect_encoding(buffer.readline) - buffer.seek(0) - text = TextIOWrapper(buffer, encoding, line_buffering=True) - text.mode = 'r' - return text - except: - buffer.close() - raise - - -def tokenize(readline): - """ - The tokenize() generator requires one argument, readline, which - must be a callable object which provides the same interface as the - readline() method of built-in file objects. Each call to the function - should return one line of input as bytes. Alternatively, readline - can be a callable function terminating with StopIteration: - readline = open(myfile, 'rb').__next__ # Example of alternate readline - - The generator produces 5-tuples with these members: the token type; the - token string; a 2-tuple (srow, scol) of ints specifying the row and - column where the token begins in the source; a 2-tuple (erow, ecol) of - ints specifying the row and column where the token ends in the source; - and the line on which the token was found. The line passed is the - logical line; continuation lines are included. - - The first token sequence will always be an ENCODING token - which tells you which encoding was used to decode the bytes stream. - """ - # This import is here to avoid problems when the itertools module is not - # built yet and tokenize is imported. - from itertools import chain, repeat - encoding, consumed = detect_encoding(readline) - rl_gen = iter(readline, b"") - empty = repeat(b"") - return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding) - - -def _tokenize(readline, encoding): - lnum = parenlev = continued = 0 - numchars = '0123456789' - contstr, needcont = '', 0 - contline = None - indents = [0] - - if encoding is not None: - if encoding == "utf-8-sig": - # BOM will already have been stripped. - encoding = "utf-8" - yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '') - last_line = b'' - line = b'' - while True: # loop over lines in stream - try: - # We capture the value of the line variable here because - # readline uses the empty string '' to signal end of input, - # hence `line` itself will always be overwritten at the end - # of this loop. - last_line = line - line = readline() - except StopIteration: - line = b'' - - if encoding is not None: - line = line.decode(encoding) - lnum += 1 - pos, max = 0, len(line) - - if contstr: # continued string - if not line: - raise TokenError("EOF in multi-line string", strstart) - endmatch = endprog.match(line) - if endmatch: - pos = end = endmatch.end(0) - yield TokenInfo(STRING, contstr + line[:end], - strstart, (lnum, end), contline + line) - contstr, needcont = '', 0 - contline = None - elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n': - yield TokenInfo(ERRORTOKEN, contstr + line, - strstart, (lnum, len(line)), contline) - contstr = '' - contline = None - continue - else: - contstr = contstr + line - contline = contline + line - continue - - elif parenlev == 0 and not continued: # new statement - if not line: break - column = 0 - while pos < max: # measure leading whitespace - if line[pos] == ' ': - column += 1 - elif line[pos] == '\t': - column = (column//tabsize + 1)*tabsize - elif line[pos] == '\f': - column = 0 - else: - break - pos += 1 - if pos == max: - break - - if line[pos] in '#\r\n': # skip comments or blank lines - if line[pos] == '#': - comment_token = line[pos:].rstrip('\r\n') - yield TokenInfo(COMMENT, comment_token, - (lnum, pos), (lnum, pos + len(comment_token)), line) - pos += len(comment_token) - - yield TokenInfo(NL, line[pos:], - (lnum, pos), (lnum, len(line)), line) - continue - - if column > indents[-1]: # count indents or dedents - indents.append(column) - yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line) - while column < indents[-1]: - if column not in indents: - raise IndentationError( - "unindent does not match any outer indentation level", - ("", lnum, pos, line)) - indents = indents[:-1] - - yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line) - - else: # continued statement - if not line: - raise TokenError("EOF in multi-line statement", (lnum, 0)) - continued = 0 - - while pos < max: - pseudomatch = _compile(PseudoToken).match(line, pos) - if pseudomatch: # scan for tokens - start, end = pseudomatch.span(1) - spos, epos, pos = (lnum, start), (lnum, end), end - if start == end: - continue - token, initial = line[start:end], line[start] - - if (initial in numchars or # ordinary number - (initial == '.' and token != '.' and token != '...')): - yield TokenInfo(NUMBER, token, spos, epos, line) - elif initial in '\r\n': - if parenlev > 0: - yield TokenInfo(NL, token, spos, epos, line) - else: - yield TokenInfo(NEWLINE, token, spos, epos, line) - - elif initial == '#': - assert not token.endswith("\n") - yield TokenInfo(COMMENT, token, spos, epos, line) - - elif token in triple_quoted: - endprog = _compile(endpats[token]) - endmatch = endprog.match(line, pos) - if endmatch: # all on one line - pos = endmatch.end(0) - token = line[start:pos] - yield TokenInfo(STRING, token, spos, (lnum, pos), line) - else: - strstart = (lnum, start) # multiple lines - contstr = line[start:] - contline = line - break - - # Check up to the first 3 chars of the token to see if - # they're in the single_quoted set. If so, they start - # a string. - # We're using the first 3, because we're looking for - # "rb'" (for example) at the start of the token. If - # we switch to longer prefixes, this needs to be - # adjusted. - # Note that initial == token[:1]. - # Also note that single quote checking must come after - # triple quote checking (above). - elif (initial in single_quoted or - token[:2] in single_quoted or - token[:3] in single_quoted): - if token[-1] == '\n': # continued string - strstart = (lnum, start) - # Again, using the first 3 chars of the - # token. This is looking for the matching end - # regex for the correct type of quote - # character. So it's really looking for - # endpats["'"] or endpats['"'], by trying to - # skip string prefix characters, if any. - endprog = _compile(endpats.get(initial) or - endpats.get(token[1]) or - endpats.get(token[2])) - contstr, needcont = line[start:], 1 - contline = line - break - else: # ordinary string - yield TokenInfo(STRING, token, spos, epos, line) - - elif initial.isidentifier(): # ordinary name - yield TokenInfo(NAME, token, spos, epos, line) - elif initial == '\\': # continued stmt - continued = 1 - else: - if initial in '([{': - parenlev += 1 - elif initial in ')]}': - parenlev -= 1 - yield TokenInfo(OP, token, spos, epos, line) - else: - yield TokenInfo(ERRORTOKEN, line[pos], - (lnum, pos), (lnum, pos+1), line) - pos += 1 - - # Add an implicit NEWLINE if the input doesn't end in one - if last_line and last_line[-1] not in '\r\n': - yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '') - for indent in indents[1:]: # pop remaining indent levels - yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '') - yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '') - - -# An undocumented, backwards compatible, API for all the places in the standard -# library that expect to be able to use tokenize with strings -def generate_tokens(readline): - return _tokenize(readline, None) - -def main(): - import argparse - - # Helper error handling routines - def perror(message): - print(message, file=sys.stderr) - - def error(message, filename=None, location=None): - if location: - args = (filename,) + location + (message,) - perror("%s:%d:%d: error: %s" % args) - elif filename: - perror("%s: error: %s" % (filename, message)) - else: - perror("error: %s" % message) - sys.exit(1) - - # Parse the arguments and options - parser = argparse.ArgumentParser(prog='python -m tokenize') - parser.add_argument(dest='filename', nargs='?', - metavar='filename.py', - help='the file to tokenize; defaults to stdin') - parser.add_argument('-e', '--exact', dest='exact', action='store_true', - help='display token names using the exact type') - args = parser.parse_args() - - try: - # Tokenize the input - if args.filename: - filename = args.filename - with _builtin_open(filename, 'rb') as f: - tokens = list(tokenize(f.readline)) - else: - filename = "" - tokens = _tokenize(sys.stdin.readline, None) - - # Output the tokenization - for token in tokens: - token_type = token.type - if args.exact: - token_type = token.exact_type - token_range = "%d,%d-%d,%d:" % (token.start + token.end) - print("%-20s%-15s%-15r" % - (token_range, tok_name[token_type], token.string)) - except IndentationError as err: - line, column = err.args[1][1:3] - error(err.args[0], filename, (line, column)) - except TokenError as err: - line, column = err.args[1] - error(err.args[0], filename, (line, column)) - except SyntaxError as err: - error(err, filename) - except OSError as err: - error(err) - except KeyboardInterrupt: - print("interrupted\n") - except Exception as err: - perror("unexpected error: %s" % err) - raise - -if __name__ == "__main__": - main() ---- -[ - { - "typ": "STRING", - "string": "\"\"\"Tokenization help for Python programs.\n\ntokenize(readline) is a generator that breaks a stream of bytes into\nPython tokens. It decodes the bytes according to PEP-0263 for\ndetermining source file encoding.\n\nIt accepts a readline-like method which is called repeatedly to get the\nnext line of input (or b\"\" for EOF). It generates 5-tuples with these\nmembers:\n\n the token type (see token.py)\n the token (a string)\n the starting (row, column) indices of the token (a 2-tuple of ints)\n the ending (row, column) indices of the token (a 2-tuple of ints)\n the original line (string)\n\nIt is designed to match the working of the Python tokenizer exactly, except\nthat it produces COMMENT tokens for comments and gives type OP for all\noperators. Additionally, all token lists start with an ENCODING token\nwhich tells you which encoding was used to decode the bytes stream.\n\"\"\"", - "start": [ - 1, - 0 - ], - "end": [ - 21, - 3 - ], - "line": "\"\"\"Tokenization help for Python programs.\n\ntokenize(readline) is a generator that breaks a stream of bytes into\nPython tokens. It decodes the bytes according to PEP-0263 for\ndetermining source file encoding.\n\nIt accepts a readline-like method which is called repeatedly to get the\nnext line of input (or b\"\" for EOF). It generates 5-tuples with these\nmembers:\n\n the token type (see token.py)\n the token (a string)\n the starting (row, column) indices of the token (a 2-tuple of ints)\n the ending (row, column) indices of the token (a 2-tuple of ints)\n the original line (string)\n\nIt is designed to match the working of the Python tokenizer exactly, except\nthat it produces COMMENT tokens for comments and gives type OP for all\noperators. Additionally, all token lists start with an ENCODING token\nwhich tells you which encoding was used to decode the bytes stream.\n\"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 21, - 3 - ], - "end": [ - 22, - 0 - ], - "line": "\"\"\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 22, - 0 - ], - "end": [ - 23, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "__author__", - "start": [ - 23, - 0 - ], - "end": [ - 23, - 10 - ], - "line": "__author__ = 'Ka-Ping Yee '\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 23, - 11 - ], - "end": [ - 23, - 12 - ], - "line": "__author__ = 'Ka-Ping Yee '\n" - }, - { - "typ": "STRING", - "string": "'Ka-Ping Yee '", - "start": [ - 23, - 13 - ], - "end": [ - 23, - 41 - ], - "line": "__author__ = 'Ka-Ping Yee '\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 23, - 41 - ], - "end": [ - 24, - 0 - ], - "line": "__author__ = 'Ka-Ping Yee '\n" - }, - { - "typ": "NAME", - "string": "__credits__", - "start": [ - 24, - 0 - ], - "end": [ - 24, - 11 - ], - "line": "__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 24, - 12 - ], - "end": [ - 24, - 13 - ], - "line": "__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 24, - 14 - ], - "end": [ - 24, - 15 - ], - "line": "__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '\n" - }, - { - "typ": "STRING", - "string": "'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '", - "start": [ - 24, - 15 - ], - "end": [ - 24, - 67 - ], - "line": "__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 24, - 67 - ], - "end": [ - 25, - 0 - ], - "line": "__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '\n" - }, - { - "typ": "STRING", - "string": "'Skip Montanaro, Raymond Hettinger, Trent Nelson, '", - "start": [ - 25, - 15 - ], - "end": [ - 25, - 66 - ], - "line": " 'Skip Montanaro, Raymond Hettinger, Trent Nelson, '\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 25, - 66 - ], - "end": [ - 26, - 0 - ], - "line": " 'Skip Montanaro, Raymond Hettinger, Trent Nelson, '\n" - }, - { - "typ": "STRING", - "string": "'Michael Foord'", - "start": [ - 26, - 15 - ], - "end": [ - 26, - 30 - ], - "line": " 'Michael Foord')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 26, - 30 - ], - "end": [ - 26, - 31 - ], - "line": " 'Michael Foord')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 26, - 31 - ], - "end": [ - 27, - 0 - ], - "line": " 'Michael Foord')\n" - }, - { - "typ": "NAME", - "string": "from", - "start": [ - 27, - 0 - ], - "end": [ - 27, - 4 - ], - "line": "from builtins import open as _builtin_open\n" - }, - { - "typ": "NAME", - "string": "builtins", - "start": [ - 27, - 5 - ], - "end": [ - 27, - 13 - ], - "line": "from builtins import open as _builtin_open\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 27, - 14 - ], - "end": [ - 27, - 20 - ], - "line": "from builtins import open as _builtin_open\n" - }, - { - "typ": "NAME", - "string": "open", - "start": [ - 27, - 21 - ], - "end": [ - 27, - 25 - ], - "line": "from builtins import open as _builtin_open\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 27, - 26 - ], - "end": [ - 27, - 28 - ], - "line": "from builtins import open as _builtin_open\n" - }, - { - "typ": "NAME", - "string": "_builtin_open", - "start": [ - 27, - 29 - ], - "end": [ - 27, - 42 - ], - "line": "from builtins import open as _builtin_open\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 27, - 42 - ], - "end": [ - 28, - 0 - ], - "line": "from builtins import open as _builtin_open\n" - }, - { - "typ": "NAME", - "string": "from", - "start": [ - 28, - 0 - ], - "end": [ - 28, - 4 - ], - "line": "from codecs import lookup, BOM_UTF8\n" - }, - { - "typ": "NAME", - "string": "codecs", - "start": [ - 28, - 5 - ], - "end": [ - 28, - 11 - ], - "line": "from codecs import lookup, BOM_UTF8\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 28, - 12 - ], - "end": [ - 28, - 18 - ], - "line": "from codecs import lookup, BOM_UTF8\n" - }, - { - "typ": "NAME", - "string": "lookup", - "start": [ - 28, - 19 - ], - "end": [ - 28, - 25 - ], - "line": "from codecs import lookup, BOM_UTF8\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 28, - 25 - ], - "end": [ - 28, - 26 - ], - "line": "from codecs import lookup, BOM_UTF8\n" - }, - { - "typ": "NAME", - "string": "BOM_UTF8", - "start": [ - 28, - 27 - ], - "end": [ - 28, - 35 - ], - "line": "from codecs import lookup, BOM_UTF8\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 28, - 35 - ], - "end": [ - 29, - 0 - ], - "line": "from codecs import lookup, BOM_UTF8\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 29, - 0 - ], - "end": [ - 29, - 6 - ], - "line": "import collections\n" - }, - { - "typ": "NAME", - "string": "collections", - "start": [ - 29, - 7 - ], - "end": [ - 29, - 18 - ], - "line": "import collections\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 29, - 18 - ], - "end": [ - 30, - 0 - ], - "line": "import collections\n" - }, - { - "typ": "NAME", - "string": "from", - "start": [ - 30, - 0 - ], - "end": [ - 30, - 4 - ], - "line": "from io import TextIOWrapper\n" - }, - { - "typ": "NAME", - "string": "io", - "start": [ - 30, - 5 - ], - "end": [ - 30, - 7 - ], - "line": "from io import TextIOWrapper\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 30, - 8 - ], - "end": [ - 30, - 14 - ], - "line": "from io import TextIOWrapper\n" - }, - { - "typ": "NAME", - "string": "TextIOWrapper", - "start": [ - 30, - 15 - ], - "end": [ - 30, - 28 - ], - "line": "from io import TextIOWrapper\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 30, - 28 - ], - "end": [ - 31, - 0 - ], - "line": "from io import TextIOWrapper\n" - }, - { - "typ": "NAME", - "string": "from", - "start": [ - 31, - 0 - ], - "end": [ - 31, - 4 - ], - "line": "from itertools import chain\n" - }, - { - "typ": "NAME", - "string": "itertools", - "start": [ - 31, - 5 - ], - "end": [ - 31, - 14 - ], - "line": "from itertools import chain\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 31, - 15 - ], - "end": [ - 31, - 21 - ], - "line": "from itertools import chain\n" - }, - { - "typ": "NAME", - "string": "chain", - "start": [ - 31, - 22 - ], - "end": [ - 31, - 27 - ], - "line": "from itertools import chain\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 31, - 27 - ], - "end": [ - 32, - 0 - ], - "line": "from itertools import chain\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 32, - 0 - ], - "end": [ - 32, - 6 - ], - "line": "import itertools as _itertools\n" - }, - { - "typ": "NAME", - "string": "itertools", - "start": [ - 32, - 7 - ], - "end": [ - 32, - 16 - ], - "line": "import itertools as _itertools\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 32, - 17 - ], - "end": [ - 32, - 19 - ], - "line": "import itertools as _itertools\n" - }, - { - "typ": "NAME", - "string": "_itertools", - "start": [ - 32, - 20 - ], - "end": [ - 32, - 30 - ], - "line": "import itertools as _itertools\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 32, - 30 - ], - "end": [ - 33, - 0 - ], - "line": "import itertools as _itertools\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 33, - 0 - ], - "end": [ - 33, - 6 - ], - "line": "import re\n" - }, - { - "typ": "NAME", - "string": "re", - "start": [ - 33, - 7 - ], - "end": [ - 33, - 9 - ], - "line": "import re\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 33, - 9 - ], - "end": [ - 34, - 0 - ], - "line": "import re\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 34, - 0 - ], - "end": [ - 34, - 6 - ], - "line": "import sys\n" - }, - { - "typ": "NAME", - "string": "sys", - "start": [ - 34, - 7 - ], - "end": [ - 34, - 10 - ], - "line": "import sys\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 34, - 10 - ], - "end": [ - 35, - 0 - ], - "line": "import sys\n" - }, - { - "typ": "NAME", - "string": "from", - "start": [ - 35, - 0 - ], - "end": [ - 35, - 4 - ], - "line": "from token import *\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 35, - 5 - ], - "end": [ - 35, - 10 - ], - "line": "from token import *\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 35, - 11 - ], - "end": [ - 35, - 17 - ], - "line": "from token import *\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 35, - 18 - ], - "end": [ - 35, - 19 - ], - "line": "from token import *\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 35, - 19 - ], - "end": [ - 36, - 0 - ], - "line": "from token import *\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 36, - 0 - ], - "end": [ - 37, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "cookie_re", - "start": [ - 37, - 0 - ], - "end": [ - 37, - 9 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 37, - 10 - ], - "end": [ - 37, - 11 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "re", - "start": [ - 37, - 12 - ], - "end": [ - 37, - 14 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 37, - 14 - ], - "end": [ - 37, - 15 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "compile", - "start": [ - 37, - 15 - ], - "end": [ - 37, - 22 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 37, - 22 - ], - "end": [ - 37, - 23 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "STRING", - "string": "r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)'", - "start": [ - 37, - 23 - ], - "end": [ - 37, - 64 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 37, - 64 - ], - "end": [ - 37, - 65 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "re", - "start": [ - 37, - 66 - ], - "end": [ - 37, - 68 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 37, - 68 - ], - "end": [ - 37, - 69 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "ASCII", - "start": [ - 37, - 69 - ], - "end": [ - 37, - 74 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 37, - 74 - ], - "end": [ - 37, - 75 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 37, - 75 - ], - "end": [ - 38, - 0 - ], - "line": "cookie_re = re.compile(r'^[ \\t\\f]*#.*?coding[:=][ \\t]*([-\\w.]+)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "blank_re", - "start": [ - 38, - 0 - ], - "end": [ - 38, - 8 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 38, - 9 - ], - "end": [ - 38, - 10 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "re", - "start": [ - 38, - 11 - ], - "end": [ - 38, - 13 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 38, - 13 - ], - "end": [ - 38, - 14 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "compile", - "start": [ - 38, - 14 - ], - "end": [ - 38, - 21 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 38, - 21 - ], - "end": [ - 38, - 22 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "STRING", - "string": "br'^[ \\t\\f]*(?:[#\\r\\n]|$)'", - "start": [ - 38, - 22 - ], - "end": [ - 38, - 48 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 38, - 48 - ], - "end": [ - 38, - 49 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "re", - "start": [ - 38, - 50 - ], - "end": [ - 38, - 52 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 38, - 52 - ], - "end": [ - 38, - 53 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "NAME", - "string": "ASCII", - "start": [ - 38, - 53 - ], - "end": [ - 38, - 58 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 38, - 58 - ], - "end": [ - 38, - 59 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 38, - 59 - ], - "end": [ - 39, - 0 - ], - "line": "blank_re = re.compile(br'^[ \\t\\f]*(?:[#\\r\\n]|$)', re.ASCII)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 39, - 0 - ], - "end": [ - 40, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 40, - 0 - ], - "end": [ - 40, - 6 - ], - "line": "import token\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 40, - 7 - ], - "end": [ - 40, - 12 - ], - "line": "import token\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 40, - 12 - ], - "end": [ - 41, - 0 - ], - "line": "import token\n" - }, - { - "typ": "NAME", - "string": "__all__", - "start": [ - 41, - 0 - ], - "end": [ - 41, - 7 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 41, - 8 - ], - "end": [ - 41, - 9 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 41, - 10 - ], - "end": [ - 41, - 15 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 41, - 15 - ], - "end": [ - 41, - 16 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "NAME", - "string": "__all__", - "start": [ - 41, - 16 - ], - "end": [ - 41, - 23 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 41, - 24 - ], - "end": [ - 41, - 25 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 41, - 26 - ], - "end": [ - 41, - 27 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "STRING", - "string": "\"tokenize\"", - "start": [ - 41, - 27 - ], - "end": [ - 41, - 37 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 41, - 37 - ], - "end": [ - 41, - 38 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "STRING", - "string": "\"detect_encoding\"", - "start": [ - 41, - 39 - ], - "end": [ - 41, - 56 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 41, - 56 - ], - "end": [ - 41, - 57 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 41, - 57 - ], - "end": [ - 42, - 0 - ], - "line": "__all__ = token.__all__ + [\"tokenize\", \"detect_encoding\",\n" - }, - { - "typ": "STRING", - "string": "\"untokenize\"", - "start": [ - 42, - 27 - ], - "end": [ - 42, - 39 - ], - "line": " \"untokenize\", \"TokenInfo\"]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 42, - 39 - ], - "end": [ - 42, - 40 - ], - "line": " \"untokenize\", \"TokenInfo\"]\n" - }, - { - "typ": "STRING", - "string": "\"TokenInfo\"", - "start": [ - 42, - 41 - ], - "end": [ - 42, - 52 - ], - "line": " \"untokenize\", \"TokenInfo\"]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 42, - 52 - ], - "end": [ - 42, - 53 - ], - "line": " \"untokenize\", \"TokenInfo\"]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 42, - 53 - ], - "end": [ - 43, - 0 - ], - "line": " \"untokenize\", \"TokenInfo\"]\n" - }, - { - "typ": "NAME", - "string": "del", - "start": [ - 43, - 0 - ], - "end": [ - 43, - 3 - ], - "line": "del token\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 43, - 4 - ], - "end": [ - 43, - 9 - ], - "line": "del token\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 43, - 9 - ], - "end": [ - 44, - 0 - ], - "line": "del token\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 44, - 0 - ], - "end": [ - 45, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "EXACT_TOKEN_TYPES", - "start": [ - 45, - 0 - ], - "end": [ - 45, - 17 - ], - "line": "EXACT_TOKEN_TYPES = {\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 45, - 18 - ], - "end": [ - 45, - 19 - ], - "line": "EXACT_TOKEN_TYPES = {\n" - }, - { - "typ": "OP", - "string": "{", - "start": [ - 45, - 20 - ], - "end": [ - 45, - 21 - ], - "line": "EXACT_TOKEN_TYPES = {\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 45, - 21 - ], - "end": [ - 46, - 0 - ], - "line": "EXACT_TOKEN_TYPES = {\n" - }, - { - "typ": "STRING", - "string": "'('", - "start": [ - 46, - 4 - ], - "end": [ - 46, - 7 - ], - "line": " '(': LPAR,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 46, - 7 - ], - "end": [ - 46, - 8 - ], - "line": " '(': LPAR,\n" - }, - { - "typ": "NAME", - "string": "LPAR", - "start": [ - 46, - 11 - ], - "end": [ - 46, - 15 - ], - "line": " '(': LPAR,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 46, - 15 - ], - "end": [ - 46, - 16 - ], - "line": " '(': LPAR,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 46, - 16 - ], - "end": [ - 47, - 0 - ], - "line": " '(': LPAR,\n" - }, - { - "typ": "STRING", - "string": "')'", - "start": [ - 47, - 4 - ], - "end": [ - 47, - 7 - ], - "line": " ')': RPAR,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 47, - 7 - ], - "end": [ - 47, - 8 - ], - "line": " ')': RPAR,\n" - }, - { - "typ": "NAME", - "string": "RPAR", - "start": [ - 47, - 11 - ], - "end": [ - 47, - 15 - ], - "line": " ')': RPAR,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 47, - 15 - ], - "end": [ - 47, - 16 - ], - "line": " ')': RPAR,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 47, - 16 - ], - "end": [ - 48, - 0 - ], - "line": " ')': RPAR,\n" - }, - { - "typ": "STRING", - "string": "'['", - "start": [ - 48, - 4 - ], - "end": [ - 48, - 7 - ], - "line": " '[': LSQB,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 48, - 7 - ], - "end": [ - 48, - 8 - ], - "line": " '[': LSQB,\n" - }, - { - "typ": "NAME", - "string": "LSQB", - "start": [ - 48, - 11 - ], - "end": [ - 48, - 15 - ], - "line": " '[': LSQB,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 48, - 15 - ], - "end": [ - 48, - 16 - ], - "line": " '[': LSQB,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 48, - 16 - ], - "end": [ - 49, - 0 - ], - "line": " '[': LSQB,\n" - }, - { - "typ": "STRING", - "string": "']'", - "start": [ - 49, - 4 - ], - "end": [ - 49, - 7 - ], - "line": " ']': RSQB,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 49, - 7 - ], - "end": [ - 49, - 8 - ], - "line": " ']': RSQB,\n" - }, - { - "typ": "NAME", - "string": "RSQB", - "start": [ - 49, - 11 - ], - "end": [ - 49, - 15 - ], - "line": " ']': RSQB,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 49, - 15 - ], - "end": [ - 49, - 16 - ], - "line": " ']': RSQB,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 49, - 16 - ], - "end": [ - 50, - 0 - ], - "line": " ']': RSQB,\n" - }, - { - "typ": "STRING", - "string": "':'", - "start": [ - 50, - 4 - ], - "end": [ - 50, - 7 - ], - "line": " ':': COLON,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 50, - 7 - ], - "end": [ - 50, - 8 - ], - "line": " ':': COLON,\n" - }, - { - "typ": "NAME", - "string": "COLON", - "start": [ - 50, - 11 - ], - "end": [ - 50, - 16 - ], - "line": " ':': COLON,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 50, - 16 - ], - "end": [ - 50, - 17 - ], - "line": " ':': COLON,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 50, - 17 - ], - "end": [ - 51, - 0 - ], - "line": " ':': COLON,\n" - }, - { - "typ": "STRING", - "string": "','", - "start": [ - 51, - 4 - ], - "end": [ - 51, - 7 - ], - "line": " ',': COMMA,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 51, - 7 - ], - "end": [ - 51, - 8 - ], - "line": " ',': COMMA,\n" - }, - { - "typ": "NAME", - "string": "COMMA", - "start": [ - 51, - 11 - ], - "end": [ - 51, - 16 - ], - "line": " ',': COMMA,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 51, - 16 - ], - "end": [ - 51, - 17 - ], - "line": " ',': COMMA,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 51, - 17 - ], - "end": [ - 52, - 0 - ], - "line": " ',': COMMA,\n" - }, - { - "typ": "STRING", - "string": "';'", - "start": [ - 52, - 4 - ], - "end": [ - 52, - 7 - ], - "line": " ';': SEMI,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 52, - 7 - ], - "end": [ - 52, - 8 - ], - "line": " ';': SEMI,\n" - }, - { - "typ": "NAME", - "string": "SEMI", - "start": [ - 52, - 11 - ], - "end": [ - 52, - 15 - ], - "line": " ';': SEMI,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 52, - 15 - ], - "end": [ - 52, - 16 - ], - "line": " ';': SEMI,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 52, - 16 - ], - "end": [ - 53, - 0 - ], - "line": " ';': SEMI,\n" - }, - { - "typ": "STRING", - "string": "'+'", - "start": [ - 53, - 4 - ], - "end": [ - 53, - 7 - ], - "line": " '+': PLUS,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 53, - 7 - ], - "end": [ - 53, - 8 - ], - "line": " '+': PLUS,\n" - }, - { - "typ": "NAME", - "string": "PLUS", - "start": [ - 53, - 11 - ], - "end": [ - 53, - 15 - ], - "line": " '+': PLUS,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 53, - 15 - ], - "end": [ - 53, - 16 - ], - "line": " '+': PLUS,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 53, - 16 - ], - "end": [ - 54, - 0 - ], - "line": " '+': PLUS,\n" - }, - { - "typ": "STRING", - "string": "'-'", - "start": [ - 54, - 4 - ], - "end": [ - 54, - 7 - ], - "line": " '-': MINUS,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 54, - 7 - ], - "end": [ - 54, - 8 - ], - "line": " '-': MINUS,\n" - }, - { - "typ": "NAME", - "string": "MINUS", - "start": [ - 54, - 11 - ], - "end": [ - 54, - 16 - ], - "line": " '-': MINUS,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 54, - 16 - ], - "end": [ - 54, - 17 - ], - "line": " '-': MINUS,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 54, - 17 - ], - "end": [ - 55, - 0 - ], - "line": " '-': MINUS,\n" - }, - { - "typ": "STRING", - "string": "'*'", - "start": [ - 55, - 4 - ], - "end": [ - 55, - 7 - ], - "line": " '*': STAR,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 55, - 7 - ], - "end": [ - 55, - 8 - ], - "line": " '*': STAR,\n" - }, - { - "typ": "NAME", - "string": "STAR", - "start": [ - 55, - 11 - ], - "end": [ - 55, - 15 - ], - "line": " '*': STAR,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 55, - 15 - ], - "end": [ - 55, - 16 - ], - "line": " '*': STAR,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 55, - 16 - ], - "end": [ - 56, - 0 - ], - "line": " '*': STAR,\n" - }, - { - "typ": "STRING", - "string": "'/'", - "start": [ - 56, - 4 - ], - "end": [ - 56, - 7 - ], - "line": " '/': SLASH,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 56, - 7 - ], - "end": [ - 56, - 8 - ], - "line": " '/': SLASH,\n" - }, - { - "typ": "NAME", - "string": "SLASH", - "start": [ - 56, - 11 - ], - "end": [ - 56, - 16 - ], - "line": " '/': SLASH,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 56, - 16 - ], - "end": [ - 56, - 17 - ], - "line": " '/': SLASH,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 56, - 17 - ], - "end": [ - 57, - 0 - ], - "line": " '/': SLASH,\n" - }, - { - "typ": "STRING", - "string": "'|'", - "start": [ - 57, - 4 - ], - "end": [ - 57, - 7 - ], - "line": " '|': VBAR,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 57, - 7 - ], - "end": [ - 57, - 8 - ], - "line": " '|': VBAR,\n" - }, - { - "typ": "NAME", - "string": "VBAR", - "start": [ - 57, - 11 - ], - "end": [ - 57, - 15 - ], - "line": " '|': VBAR,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 57, - 15 - ], - "end": [ - 57, - 16 - ], - "line": " '|': VBAR,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 57, - 16 - ], - "end": [ - 58, - 0 - ], - "line": " '|': VBAR,\n" - }, - { - "typ": "STRING", - "string": "'&'", - "start": [ - 58, - 4 - ], - "end": [ - 58, - 7 - ], - "line": " '&': AMPER,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 58, - 7 - ], - "end": [ - 58, - 8 - ], - "line": " '&': AMPER,\n" - }, - { - "typ": "NAME", - "string": "AMPER", - "start": [ - 58, - 11 - ], - "end": [ - 58, - 16 - ], - "line": " '&': AMPER,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 58, - 16 - ], - "end": [ - 58, - 17 - ], - "line": " '&': AMPER,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 58, - 17 - ], - "end": [ - 59, - 0 - ], - "line": " '&': AMPER,\n" - }, - { - "typ": "STRING", - "string": "'<'", - "start": [ - 59, - 4 - ], - "end": [ - 59, - 7 - ], - "line": " '<': LESS,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 59, - 7 - ], - "end": [ - 59, - 8 - ], - "line": " '<': LESS,\n" - }, - { - "typ": "NAME", - "string": "LESS", - "start": [ - 59, - 11 - ], - "end": [ - 59, - 15 - ], - "line": " '<': LESS,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 59, - 15 - ], - "end": [ - 59, - 16 - ], - "line": " '<': LESS,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 59, - 16 - ], - "end": [ - 60, - 0 - ], - "line": " '<': LESS,\n" - }, - { - "typ": "STRING", - "string": "'>'", - "start": [ - 60, - 4 - ], - "end": [ - 60, - 7 - ], - "line": " '>': GREATER,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 60, - 7 - ], - "end": [ - 60, - 8 - ], - "line": " '>': GREATER,\n" - }, - { - "typ": "NAME", - "string": "GREATER", - "start": [ - 60, - 11 - ], - "end": [ - 60, - 18 - ], - "line": " '>': GREATER,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 60, - 18 - ], - "end": [ - 60, - 19 - ], - "line": " '>': GREATER,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 60, - 19 - ], - "end": [ - 61, - 0 - ], - "line": " '>': GREATER,\n" - }, - { - "typ": "STRING", - "string": "'='", - "start": [ - 61, - 4 - ], - "end": [ - 61, - 7 - ], - "line": " '=': EQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 61, - 7 - ], - "end": [ - 61, - 8 - ], - "line": " '=': EQUAL,\n" - }, - { - "typ": "NAME", - "string": "EQUAL", - "start": [ - 61, - 11 - ], - "end": [ - 61, - 16 - ], - "line": " '=': EQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 61, - 16 - ], - "end": [ - 61, - 17 - ], - "line": " '=': EQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 61, - 17 - ], - "end": [ - 62, - 0 - ], - "line": " '=': EQUAL,\n" - }, - { - "typ": "STRING", - "string": "'.'", - "start": [ - 62, - 4 - ], - "end": [ - 62, - 7 - ], - "line": " '.': DOT,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 62, - 7 - ], - "end": [ - 62, - 8 - ], - "line": " '.': DOT,\n" - }, - { - "typ": "NAME", - "string": "DOT", - "start": [ - 62, - 11 - ], - "end": [ - 62, - 14 - ], - "line": " '.': DOT,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 62, - 14 - ], - "end": [ - 62, - 15 - ], - "line": " '.': DOT,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 62, - 15 - ], - "end": [ - 63, - 0 - ], - "line": " '.': DOT,\n" - }, - { - "typ": "STRING", - "string": "'%'", - "start": [ - 63, - 4 - ], - "end": [ - 63, - 7 - ], - "line": " '%': PERCENT,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 63, - 7 - ], - "end": [ - 63, - 8 - ], - "line": " '%': PERCENT,\n" - }, - { - "typ": "NAME", - "string": "PERCENT", - "start": [ - 63, - 11 - ], - "end": [ - 63, - 18 - ], - "line": " '%': PERCENT,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 63, - 18 - ], - "end": [ - 63, - 19 - ], - "line": " '%': PERCENT,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 63, - 19 - ], - "end": [ - 64, - 0 - ], - "line": " '%': PERCENT,\n" - }, - { - "typ": "STRING", - "string": "'{'", - "start": [ - 64, - 4 - ], - "end": [ - 64, - 7 - ], - "line": " '{': LBRACE,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 64, - 7 - ], - "end": [ - 64, - 8 - ], - "line": " '{': LBRACE,\n" - }, - { - "typ": "NAME", - "string": "LBRACE", - "start": [ - 64, - 11 - ], - "end": [ - 64, - 17 - ], - "line": " '{': LBRACE,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 64, - 17 - ], - "end": [ - 64, - 18 - ], - "line": " '{': LBRACE,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 64, - 18 - ], - "end": [ - 65, - 0 - ], - "line": " '{': LBRACE,\n" - }, - { - "typ": "STRING", - "string": "'}'", - "start": [ - 65, - 4 - ], - "end": [ - 65, - 7 - ], - "line": " '}': RBRACE,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 65, - 7 - ], - "end": [ - 65, - 8 - ], - "line": " '}': RBRACE,\n" - }, - { - "typ": "NAME", - "string": "RBRACE", - "start": [ - 65, - 11 - ], - "end": [ - 65, - 17 - ], - "line": " '}': RBRACE,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 65, - 17 - ], - "end": [ - 65, - 18 - ], - "line": " '}': RBRACE,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 65, - 18 - ], - "end": [ - 66, - 0 - ], - "line": " '}': RBRACE,\n" - }, - { - "typ": "STRING", - "string": "'=='", - "start": [ - 66, - 4 - ], - "end": [ - 66, - 8 - ], - "line": " '==': EQEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 66, - 8 - ], - "end": [ - 66, - 9 - ], - "line": " '==': EQEQUAL,\n" - }, - { - "typ": "NAME", - "string": "EQEQUAL", - "start": [ - 66, - 11 - ], - "end": [ - 66, - 18 - ], - "line": " '==': EQEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 66, - 18 - ], - "end": [ - 66, - 19 - ], - "line": " '==': EQEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 66, - 19 - ], - "end": [ - 67, - 0 - ], - "line": " '==': EQEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'!='", - "start": [ - 67, - 4 - ], - "end": [ - 67, - 8 - ], - "line": " '!=': NOTEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 67, - 8 - ], - "end": [ - 67, - 9 - ], - "line": " '!=': NOTEQUAL,\n" - }, - { - "typ": "NAME", - "string": "NOTEQUAL", - "start": [ - 67, - 11 - ], - "end": [ - 67, - 19 - ], - "line": " '!=': NOTEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 67, - 19 - ], - "end": [ - 67, - 20 - ], - "line": " '!=': NOTEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 67, - 20 - ], - "end": [ - 68, - 0 - ], - "line": " '!=': NOTEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'<='", - "start": [ - 68, - 4 - ], - "end": [ - 68, - 8 - ], - "line": " '<=': LESSEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 68, - 8 - ], - "end": [ - 68, - 9 - ], - "line": " '<=': LESSEQUAL,\n" - }, - { - "typ": "NAME", - "string": "LESSEQUAL", - "start": [ - 68, - 11 - ], - "end": [ - 68, - 20 - ], - "line": " '<=': LESSEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 68, - 20 - ], - "end": [ - 68, - 21 - ], - "line": " '<=': LESSEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 68, - 21 - ], - "end": [ - 69, - 0 - ], - "line": " '<=': LESSEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'>='", - "start": [ - 69, - 4 - ], - "end": [ - 69, - 8 - ], - "line": " '>=': GREATEREQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 69, - 8 - ], - "end": [ - 69, - 9 - ], - "line": " '>=': GREATEREQUAL,\n" - }, - { - "typ": "NAME", - "string": "GREATEREQUAL", - "start": [ - 69, - 11 - ], - "end": [ - 69, - 23 - ], - "line": " '>=': GREATEREQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 69, - 23 - ], - "end": [ - 69, - 24 - ], - "line": " '>=': GREATEREQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 69, - 24 - ], - "end": [ - 70, - 0 - ], - "line": " '>=': GREATEREQUAL,\n" - }, - { - "typ": "STRING", - "string": "'~'", - "start": [ - 70, - 4 - ], - "end": [ - 70, - 7 - ], - "line": " '~': TILDE,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 70, - 7 - ], - "end": [ - 70, - 8 - ], - "line": " '~': TILDE,\n" - }, - { - "typ": "NAME", - "string": "TILDE", - "start": [ - 70, - 11 - ], - "end": [ - 70, - 16 - ], - "line": " '~': TILDE,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 70, - 16 - ], - "end": [ - 70, - 17 - ], - "line": " '~': TILDE,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 70, - 17 - ], - "end": [ - 71, - 0 - ], - "line": " '~': TILDE,\n" - }, - { - "typ": "STRING", - "string": "'^'", - "start": [ - 71, - 4 - ], - "end": [ - 71, - 7 - ], - "line": " '^': CIRCUMFLEX,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 71, - 7 - ], - "end": [ - 71, - 8 - ], - "line": " '^': CIRCUMFLEX,\n" - }, - { - "typ": "NAME", - "string": "CIRCUMFLEX", - "start": [ - 71, - 11 - ], - "end": [ - 71, - 21 - ], - "line": " '^': CIRCUMFLEX,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 71, - 21 - ], - "end": [ - 71, - 22 - ], - "line": " '^': CIRCUMFLEX,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 71, - 22 - ], - "end": [ - 72, - 0 - ], - "line": " '^': CIRCUMFLEX,\n" - }, - { - "typ": "STRING", - "string": "'<<'", - "start": [ - 72, - 4 - ], - "end": [ - 72, - 8 - ], - "line": " '<<': LEFTSHIFT,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 72, - 8 - ], - "end": [ - 72, - 9 - ], - "line": " '<<': LEFTSHIFT,\n" - }, - { - "typ": "NAME", - "string": "LEFTSHIFT", - "start": [ - 72, - 11 - ], - "end": [ - 72, - 20 - ], - "line": " '<<': LEFTSHIFT,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 72, - 20 - ], - "end": [ - 72, - 21 - ], - "line": " '<<': LEFTSHIFT,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 72, - 21 - ], - "end": [ - 73, - 0 - ], - "line": " '<<': LEFTSHIFT,\n" - }, - { - "typ": "STRING", - "string": "'>>'", - "start": [ - 73, - 4 - ], - "end": [ - 73, - 8 - ], - "line": " '>>': RIGHTSHIFT,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 73, - 8 - ], - "end": [ - 73, - 9 - ], - "line": " '>>': RIGHTSHIFT,\n" - }, - { - "typ": "NAME", - "string": "RIGHTSHIFT", - "start": [ - 73, - 11 - ], - "end": [ - 73, - 21 - ], - "line": " '>>': RIGHTSHIFT,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 73, - 21 - ], - "end": [ - 73, - 22 - ], - "line": " '>>': RIGHTSHIFT,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 73, - 22 - ], - "end": [ - 74, - 0 - ], - "line": " '>>': RIGHTSHIFT,\n" - }, - { - "typ": "STRING", - "string": "'**'", - "start": [ - 74, - 4 - ], - "end": [ - 74, - 8 - ], - "line": " '**': DOUBLESTAR,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 74, - 8 - ], - "end": [ - 74, - 9 - ], - "line": " '**': DOUBLESTAR,\n" - }, - { - "typ": "NAME", - "string": "DOUBLESTAR", - "start": [ - 74, - 11 - ], - "end": [ - 74, - 21 - ], - "line": " '**': DOUBLESTAR,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 74, - 21 - ], - "end": [ - 74, - 22 - ], - "line": " '**': DOUBLESTAR,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 74, - 22 - ], - "end": [ - 75, - 0 - ], - "line": " '**': DOUBLESTAR,\n" - }, - { - "typ": "STRING", - "string": "'+='", - "start": [ - 75, - 4 - ], - "end": [ - 75, - 8 - ], - "line": " '+=': PLUSEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 75, - 8 - ], - "end": [ - 75, - 9 - ], - "line": " '+=': PLUSEQUAL,\n" - }, - { - "typ": "NAME", - "string": "PLUSEQUAL", - "start": [ - 75, - 11 - ], - "end": [ - 75, - 20 - ], - "line": " '+=': PLUSEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 75, - 20 - ], - "end": [ - 75, - 21 - ], - "line": " '+=': PLUSEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 75, - 21 - ], - "end": [ - 76, - 0 - ], - "line": " '+=': PLUSEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'-='", - "start": [ - 76, - 4 - ], - "end": [ - 76, - 8 - ], - "line": " '-=': MINEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 76, - 8 - ], - "end": [ - 76, - 9 - ], - "line": " '-=': MINEQUAL,\n" - }, - { - "typ": "NAME", - "string": "MINEQUAL", - "start": [ - 76, - 11 - ], - "end": [ - 76, - 19 - ], - "line": " '-=': MINEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 76, - 19 - ], - "end": [ - 76, - 20 - ], - "line": " '-=': MINEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 76, - 20 - ], - "end": [ - 77, - 0 - ], - "line": " '-=': MINEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'*='", - "start": [ - 77, - 4 - ], - "end": [ - 77, - 8 - ], - "line": " '*=': STAREQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 77, - 8 - ], - "end": [ - 77, - 9 - ], - "line": " '*=': STAREQUAL,\n" - }, - { - "typ": "NAME", - "string": "STAREQUAL", - "start": [ - 77, - 11 - ], - "end": [ - 77, - 20 - ], - "line": " '*=': STAREQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 77, - 20 - ], - "end": [ - 77, - 21 - ], - "line": " '*=': STAREQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 77, - 21 - ], - "end": [ - 78, - 0 - ], - "line": " '*=': STAREQUAL,\n" - }, - { - "typ": "STRING", - "string": "'/='", - "start": [ - 78, - 4 - ], - "end": [ - 78, - 8 - ], - "line": " '/=': SLASHEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 78, - 8 - ], - "end": [ - 78, - 9 - ], - "line": " '/=': SLASHEQUAL,\n" - }, - { - "typ": "NAME", - "string": "SLASHEQUAL", - "start": [ - 78, - 11 - ], - "end": [ - 78, - 21 - ], - "line": " '/=': SLASHEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 78, - 21 - ], - "end": [ - 78, - 22 - ], - "line": " '/=': SLASHEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 78, - 22 - ], - "end": [ - 79, - 0 - ], - "line": " '/=': SLASHEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'%='", - "start": [ - 79, - 4 - ], - "end": [ - 79, - 8 - ], - "line": " '%=': PERCENTEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 79, - 8 - ], - "end": [ - 79, - 9 - ], - "line": " '%=': PERCENTEQUAL,\n" - }, - { - "typ": "NAME", - "string": "PERCENTEQUAL", - "start": [ - 79, - 11 - ], - "end": [ - 79, - 23 - ], - "line": " '%=': PERCENTEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 79, - 23 - ], - "end": [ - 79, - 24 - ], - "line": " '%=': PERCENTEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 79, - 24 - ], - "end": [ - 80, - 0 - ], - "line": " '%=': PERCENTEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'&='", - "start": [ - 80, - 4 - ], - "end": [ - 80, - 8 - ], - "line": " '&=': AMPEREQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 80, - 8 - ], - "end": [ - 80, - 9 - ], - "line": " '&=': AMPEREQUAL,\n" - }, - { - "typ": "NAME", - "string": "AMPEREQUAL", - "start": [ - 80, - 11 - ], - "end": [ - 80, - 21 - ], - "line": " '&=': AMPEREQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 80, - 21 - ], - "end": [ - 80, - 22 - ], - "line": " '&=': AMPEREQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 80, - 22 - ], - "end": [ - 81, - 0 - ], - "line": " '&=': AMPEREQUAL,\n" - }, - { - "typ": "STRING", - "string": "'|='", - "start": [ - 81, - 4 - ], - "end": [ - 81, - 8 - ], - "line": " '|=': VBAREQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 81, - 8 - ], - "end": [ - 81, - 9 - ], - "line": " '|=': VBAREQUAL,\n" - }, - { - "typ": "NAME", - "string": "VBAREQUAL", - "start": [ - 81, - 11 - ], - "end": [ - 81, - 20 - ], - "line": " '|=': VBAREQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 81, - 20 - ], - "end": [ - 81, - 21 - ], - "line": " '|=': VBAREQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 81, - 21 - ], - "end": [ - 82, - 0 - ], - "line": " '|=': VBAREQUAL,\n" - }, - { - "typ": "STRING", - "string": "'^='", - "start": [ - 82, - 4 - ], - "end": [ - 82, - 8 - ], - "line": " '^=': CIRCUMFLEXEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 82, - 8 - ], - "end": [ - 82, - 9 - ], - "line": " '^=': CIRCUMFLEXEQUAL,\n" - }, - { - "typ": "NAME", - "string": "CIRCUMFLEXEQUAL", - "start": [ - 82, - 11 - ], - "end": [ - 82, - 26 - ], - "line": " '^=': CIRCUMFLEXEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 82, - 26 - ], - "end": [ - 82, - 27 - ], - "line": " '^=': CIRCUMFLEXEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 82, - 27 - ], - "end": [ - 83, - 0 - ], - "line": " '^=': CIRCUMFLEXEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'<<='", - "start": [ - 83, - 4 - ], - "end": [ - 83, - 9 - ], - "line": " '<<=': LEFTSHIFTEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 83, - 9 - ], - "end": [ - 83, - 10 - ], - "line": " '<<=': LEFTSHIFTEQUAL,\n" - }, - { - "typ": "NAME", - "string": "LEFTSHIFTEQUAL", - "start": [ - 83, - 11 - ], - "end": [ - 83, - 25 - ], - "line": " '<<=': LEFTSHIFTEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 83, - 25 - ], - "end": [ - 83, - 26 - ], - "line": " '<<=': LEFTSHIFTEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 83, - 26 - ], - "end": [ - 84, - 0 - ], - "line": " '<<=': LEFTSHIFTEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'>>='", - "start": [ - 84, - 4 - ], - "end": [ - 84, - 9 - ], - "line": " '>>=': RIGHTSHIFTEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 84, - 9 - ], - "end": [ - 84, - 10 - ], - "line": " '>>=': RIGHTSHIFTEQUAL,\n" - }, - { - "typ": "NAME", - "string": "RIGHTSHIFTEQUAL", - "start": [ - 84, - 11 - ], - "end": [ - 84, - 26 - ], - "line": " '>>=': RIGHTSHIFTEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 84, - 26 - ], - "end": [ - 84, - 27 - ], - "line": " '>>=': RIGHTSHIFTEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 84, - 27 - ], - "end": [ - 85, - 0 - ], - "line": " '>>=': RIGHTSHIFTEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'**='", - "start": [ - 85, - 4 - ], - "end": [ - 85, - 9 - ], - "line": " '**=': DOUBLESTAREQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 85, - 9 - ], - "end": [ - 85, - 10 - ], - "line": " '**=': DOUBLESTAREQUAL,\n" - }, - { - "typ": "NAME", - "string": "DOUBLESTAREQUAL", - "start": [ - 85, - 11 - ], - "end": [ - 85, - 26 - ], - "line": " '**=': DOUBLESTAREQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 85, - 26 - ], - "end": [ - 85, - 27 - ], - "line": " '**=': DOUBLESTAREQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 85, - 27 - ], - "end": [ - 86, - 0 - ], - "line": " '**=': DOUBLESTAREQUAL,\n" - }, - { - "typ": "STRING", - "string": "'//'", - "start": [ - 86, - 4 - ], - "end": [ - 86, - 8 - ], - "line": " '//': DOUBLESLASH,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 86, - 8 - ], - "end": [ - 86, - 9 - ], - "line": " '//': DOUBLESLASH,\n" - }, - { - "typ": "NAME", - "string": "DOUBLESLASH", - "start": [ - 86, - 11 - ], - "end": [ - 86, - 22 - ], - "line": " '//': DOUBLESLASH,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 86, - 22 - ], - "end": [ - 86, - 23 - ], - "line": " '//': DOUBLESLASH,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 86, - 23 - ], - "end": [ - 87, - 0 - ], - "line": " '//': DOUBLESLASH,\n" - }, - { - "typ": "STRING", - "string": "'//='", - "start": [ - 87, - 4 - ], - "end": [ - 87, - 9 - ], - "line": " '//=': DOUBLESLASHEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 87, - 9 - ], - "end": [ - 87, - 10 - ], - "line": " '//=': DOUBLESLASHEQUAL,\n" - }, - { - "typ": "NAME", - "string": "DOUBLESLASHEQUAL", - "start": [ - 87, - 11 - ], - "end": [ - 87, - 27 - ], - "line": " '//=': DOUBLESLASHEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 87, - 27 - ], - "end": [ - 87, - 28 - ], - "line": " '//=': DOUBLESLASHEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 87, - 28 - ], - "end": [ - 88, - 0 - ], - "line": " '//=': DOUBLESLASHEQUAL,\n" - }, - { - "typ": "STRING", - "string": "'...'", - "start": [ - 88, - 4 - ], - "end": [ - 88, - 9 - ], - "line": " '...': ELLIPSIS,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 88, - 9 - ], - "end": [ - 88, - 10 - ], - "line": " '...': ELLIPSIS,\n" - }, - { - "typ": "NAME", - "string": "ELLIPSIS", - "start": [ - 88, - 11 - ], - "end": [ - 88, - 19 - ], - "line": " '...': ELLIPSIS,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 88, - 19 - ], - "end": [ - 88, - 20 - ], - "line": " '...': ELLIPSIS,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 88, - 20 - ], - "end": [ - 89, - 0 - ], - "line": " '...': ELLIPSIS,\n" - }, - { - "typ": "STRING", - "string": "'->'", - "start": [ - 89, - 4 - ], - "end": [ - 89, - 8 - ], - "line": " '->': RARROW,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 89, - 8 - ], - "end": [ - 89, - 9 - ], - "line": " '->': RARROW,\n" - }, - { - "typ": "NAME", - "string": "RARROW", - "start": [ - 89, - 11 - ], - "end": [ - 89, - 17 - ], - "line": " '->': RARROW,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 89, - 17 - ], - "end": [ - 89, - 18 - ], - "line": " '->': RARROW,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 89, - 18 - ], - "end": [ - 90, - 0 - ], - "line": " '->': RARROW,\n" - }, - { - "typ": "STRING", - "string": "'@'", - "start": [ - 90, - 4 - ], - "end": [ - 90, - 7 - ], - "line": " '@': AT,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 90, - 7 - ], - "end": [ - 90, - 8 - ], - "line": " '@': AT,\n" - }, - { - "typ": "NAME", - "string": "AT", - "start": [ - 90, - 11 - ], - "end": [ - 90, - 13 - ], - "line": " '@': AT,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 90, - 13 - ], - "end": [ - 90, - 14 - ], - "line": " '@': AT,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 90, - 14 - ], - "end": [ - 91, - 0 - ], - "line": " '@': AT,\n" - }, - { - "typ": "STRING", - "string": "'@='", - "start": [ - 91, - 4 - ], - "end": [ - 91, - 8 - ], - "line": " '@=': ATEQUAL,\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 91, - 8 - ], - "end": [ - 91, - 9 - ], - "line": " '@=': ATEQUAL,\n" - }, - { - "typ": "NAME", - "string": "ATEQUAL", - "start": [ - 91, - 11 - ], - "end": [ - 91, - 18 - ], - "line": " '@=': ATEQUAL,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 91, - 18 - ], - "end": [ - 91, - 19 - ], - "line": " '@=': ATEQUAL,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 91, - 19 - ], - "end": [ - 92, - 0 - ], - "line": " '@=': ATEQUAL,\n" - }, - { - "typ": "OP", - "string": "}", - "start": [ - 92, - 0 - ], - "end": [ - 92, - 1 - ], - "line": "}\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 92, - 1 - ], - "end": [ - 93, - 0 - ], - "line": "}\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 93, - 0 - ], - "end": [ - 94, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "class", - "start": [ - 94, - 0 - ], - "end": [ - 94, - 5 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 94, - 6 - ], - "end": [ - 94, - 15 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 94, - 15 - ], - "end": [ - 94, - 16 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "NAME", - "string": "collections", - "start": [ - 94, - 16 - ], - "end": [ - 94, - 27 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 94, - 27 - ], - "end": [ - 94, - 28 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "NAME", - "string": "namedtuple", - "start": [ - 94, - 28 - ], - "end": [ - 94, - 38 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 94, - 38 - ], - "end": [ - 94, - 39 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "STRING", - "string": "'TokenInfo'", - "start": [ - 94, - 39 - ], - "end": [ - 94, - 50 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 94, - 50 - ], - "end": [ - 94, - 51 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "STRING", - "string": "'type string start end line'", - "start": [ - 94, - 52 - ], - "end": [ - 94, - 80 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 94, - 80 - ], - "end": [ - 94, - 81 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 94, - 81 - ], - "end": [ - 94, - 82 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 94, - 82 - ], - "end": [ - 94, - 83 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 94, - 83 - ], - "end": [ - 95, - 0 - ], - "line": "class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 95, - 0 - ], - "end": [ - 95, - 4 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 95, - 4 - ], - "end": [ - 95, - 7 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "NAME", - "string": "__repr__", - "start": [ - 95, - 8 - ], - "end": [ - 95, - 16 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 95, - 16 - ], - "end": [ - 95, - 17 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 95, - 17 - ], - "end": [ - 95, - 21 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 95, - 21 - ], - "end": [ - 95, - 22 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 95, - 22 - ], - "end": [ - 95, - 23 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 95, - 23 - ], - "end": [ - 96, - 0 - ], - "line": " def __repr__(self):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 96, - 0 - ], - "end": [ - 96, - 8 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NAME", - "string": "annotated_type", - "start": [ - 96, - 8 - ], - "end": [ - 96, - 22 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 96, - 23 - ], - "end": [ - 96, - 24 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "STRING", - "string": "'%d (%s)'", - "start": [ - 96, - 25 - ], - "end": [ - 96, - 34 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 96, - 35 - ], - "end": [ - 96, - 36 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 96, - 37 - ], - "end": [ - 96, - 38 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 96, - 38 - ], - "end": [ - 96, - 42 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 96, - 42 - ], - "end": [ - 96, - 43 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NAME", - "string": "type", - "start": [ - 96, - 43 - ], - "end": [ - 96, - 47 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 96, - 47 - ], - "end": [ - 96, - 48 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NAME", - "string": "tok_name", - "start": [ - 96, - 49 - ], - "end": [ - 96, - 57 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 96, - 57 - ], - "end": [ - 96, - 58 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 96, - 58 - ], - "end": [ - 96, - 62 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 96, - 62 - ], - "end": [ - 96, - 63 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NAME", - "string": "type", - "start": [ - 96, - 63 - ], - "end": [ - 96, - 67 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 96, - 67 - ], - "end": [ - 96, - 68 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 96, - 68 - ], - "end": [ - 96, - 69 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 96, - 69 - ], - "end": [ - 97, - 0 - ], - "line": " annotated_type = '%d (%s)' % (self.type, tok_name[self.type])\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 97, - 8 - ], - "end": [ - 97, - 14 - ], - "line": " return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 97, - 15 - ], - "end": [ - 97, - 16 - ], - "line": " return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %\n" - }, - { - "typ": "STRING", - "string": "'TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)'", - "start": [ - 97, - 16 - ], - "end": [ - 97, - 74 - ], - "line": " return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 97, - 75 - ], - "end": [ - 97, - 76 - ], - "line": " return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 97, - 76 - ], - "end": [ - 98, - 0 - ], - "line": " return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 98, - 16 - ], - "end": [ - 98, - 20 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 98, - 20 - ], - "end": [ - 98, - 21 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "NAME", - "string": "_replace", - "start": [ - 98, - 21 - ], - "end": [ - 98, - 29 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 98, - 29 - ], - "end": [ - 98, - 30 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "NAME", - "string": "type", - "start": [ - 98, - 30 - ], - "end": [ - 98, - 34 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 98, - 34 - ], - "end": [ - 98, - 35 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "NAME", - "string": "annotated_type", - "start": [ - 98, - 35 - ], - "end": [ - 98, - 49 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 98, - 49 - ], - "end": [ - 98, - 50 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 98, - 50 - ], - "end": [ - 98, - 51 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 98, - 51 - ], - "end": [ - 99, - 0 - ], - "line": " self._replace(type=annotated_type))\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 99, - 0 - ], - "end": [ - 100, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 100, - 4 - ], - "end": [ - 100, - 4 - ], - "line": " @property\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 100, - 4 - ], - "end": [ - 100, - 5 - ], - "line": " @property\n" - }, - { - "typ": "NAME", - "string": "property", - "start": [ - 100, - 5 - ], - "end": [ - 100, - 13 - ], - "line": " @property\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 100, - 13 - ], - "end": [ - 101, - 0 - ], - "line": " @property\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 101, - 4 - ], - "end": [ - 101, - 7 - ], - "line": " def exact_type(self):\n" - }, - { - "typ": "NAME", - "string": "exact_type", - "start": [ - 101, - 8 - ], - "end": [ - 101, - 18 - ], - "line": " def exact_type(self):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 101, - 18 - ], - "end": [ - 101, - 19 - ], - "line": " def exact_type(self):\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 101, - 19 - ], - "end": [ - 101, - 23 - ], - "line": " def exact_type(self):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 101, - 23 - ], - "end": [ - 101, - 24 - ], - "line": " def exact_type(self):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 101, - 24 - ], - "end": [ - 101, - 25 - ], - "line": " def exact_type(self):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 101, - 25 - ], - "end": [ - 102, - 0 - ], - "line": " def exact_type(self):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 102, - 0 - ], - "end": [ - 102, - 8 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 102, - 8 - ], - "end": [ - 102, - 10 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 102, - 11 - ], - "end": [ - 102, - 15 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 102, - 15 - ], - "end": [ - 102, - 16 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "type", - "start": [ - 102, - 16 - ], - "end": [ - 102, - 20 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 102, - 21 - ], - "end": [ - 102, - 23 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "OP", - "start": [ - 102, - 24 - ], - "end": [ - 102, - 26 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 102, - 27 - ], - "end": [ - 102, - 30 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 102, - 31 - ], - "end": [ - 102, - 35 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 102, - 35 - ], - "end": [ - 102, - 36 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "string", - "start": [ - 102, - 36 - ], - "end": [ - 102, - 42 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 102, - 43 - ], - "end": [ - 102, - 45 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NAME", - "string": "EXACT_TOKEN_TYPES", - "start": [ - 102, - 46 - ], - "end": [ - 102, - 63 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 102, - 63 - ], - "end": [ - 102, - 64 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 102, - 64 - ], - "end": [ - 103, - 0 - ], - "line": " if self.type == OP and self.string in EXACT_TOKEN_TYPES:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 103, - 0 - ], - "end": [ - 103, - 12 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 103, - 12 - ], - "end": [ - 103, - 18 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "NAME", - "string": "EXACT_TOKEN_TYPES", - "start": [ - 103, - 19 - ], - "end": [ - 103, - 36 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 103, - 36 - ], - "end": [ - 103, - 37 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 103, - 37 - ], - "end": [ - 103, - 41 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 103, - 41 - ], - "end": [ - 103, - 42 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "NAME", - "string": "string", - "start": [ - 103, - 42 - ], - "end": [ - 103, - 48 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 103, - 48 - ], - "end": [ - 103, - 49 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 103, - 49 - ], - "end": [ - 104, - 0 - ], - "line": " return EXACT_TOKEN_TYPES[self.string]\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 104, - 8 - ], - "end": [ - 104, - 8 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 104, - 8 - ], - "end": [ - 104, - 12 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 104, - 12 - ], - "end": [ - 104, - 13 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 104, - 13 - ], - "end": [ - 105, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 105, - 0 - ], - "end": [ - 105, - 12 - ], - "line": " return self.type\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 105, - 12 - ], - "end": [ - 105, - 18 - ], - "line": " return self.type\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 105, - 19 - ], - "end": [ - 105, - 23 - ], - "line": " return self.type\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 105, - 23 - ], - "end": [ - 105, - 24 - ], - "line": " return self.type\n" - }, - { - "typ": "NAME", - "string": "type", - "start": [ - 105, - 24 - ], - "end": [ - 105, - 28 - ], - "line": " return self.type\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 105, - 28 - ], - "end": [ - 106, - 0 - ], - "line": " return self.type\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 106, - 0 - ], - "end": [ - 107, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 107, - 0 - ], - "end": [ - 107, - 0 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 107, - 0 - ], - "end": [ - 107, - 0 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 107, - 0 - ], - "end": [ - 107, - 0 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 107, - 0 - ], - "end": [ - 107, - 3 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 107, - 4 - ], - "end": [ - 107, - 9 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 107, - 9 - ], - "end": [ - 107, - 10 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 107, - 10 - ], - "end": [ - 107, - 11 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NAME", - "string": "choices", - "start": [ - 107, - 11 - ], - "end": [ - 107, - 18 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 107, - 18 - ], - "end": [ - 107, - 19 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 107, - 19 - ], - "end": [ - 107, - 20 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 107, - 21 - ], - "end": [ - 107, - 27 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "STRING", - "string": "'('", - "start": [ - 107, - 28 - ], - "end": [ - 107, - 31 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 107, - 32 - ], - "end": [ - 107, - 33 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "STRING", - "string": "'|'", - "start": [ - 107, - 34 - ], - "end": [ - 107, - 37 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 107, - 37 - ], - "end": [ - 107, - 38 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NAME", - "string": "join", - "start": [ - 107, - 38 - ], - "end": [ - 107, - 42 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 107, - 42 - ], - "end": [ - 107, - 43 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NAME", - "string": "choices", - "start": [ - 107, - 43 - ], - "end": [ - 107, - 50 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 107, - 50 - ], - "end": [ - 107, - 51 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 107, - 52 - ], - "end": [ - 107, - 53 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "STRING", - "string": "')'", - "start": [ - 107, - 54 - ], - "end": [ - 107, - 57 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 107, - 57 - ], - "end": [ - 108, - 0 - ], - "line": "def group(*choices): return '(' + '|'.join(choices) + ')'\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 108, - 0 - ], - "end": [ - 108, - 3 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "NAME", - "string": "any", - "start": [ - 108, - 4 - ], - "end": [ - 108, - 7 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 108, - 7 - ], - "end": [ - 108, - 8 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 108, - 8 - ], - "end": [ - 108, - 9 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "NAME", - "string": "choices", - "start": [ - 108, - 9 - ], - "end": [ - 108, - 16 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 108, - 16 - ], - "end": [ - 108, - 17 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 108, - 17 - ], - "end": [ - 108, - 18 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 108, - 19 - ], - "end": [ - 108, - 25 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 108, - 26 - ], - "end": [ - 108, - 31 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 108, - 31 - ], - "end": [ - 108, - 32 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 108, - 32 - ], - "end": [ - 108, - 33 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "NAME", - "string": "choices", - "start": [ - 108, - 33 - ], - "end": [ - 108, - 40 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 108, - 40 - ], - "end": [ - 108, - 41 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 108, - 42 - ], - "end": [ - 108, - 43 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "STRING", - "string": "'*'", - "start": [ - 108, - 44 - ], - "end": [ - 108, - 47 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 108, - 47 - ], - "end": [ - 109, - 0 - ], - "line": "def any(*choices): return group(*choices) + '*'\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 109, - 0 - ], - "end": [ - 109, - 3 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "NAME", - "string": "maybe", - "start": [ - 109, - 4 - ], - "end": [ - 109, - 9 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 109, - 9 - ], - "end": [ - 109, - 10 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 109, - 10 - ], - "end": [ - 109, - 11 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "NAME", - "string": "choices", - "start": [ - 109, - 11 - ], - "end": [ - 109, - 18 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 109, - 18 - ], - "end": [ - 109, - 19 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 109, - 19 - ], - "end": [ - 109, - 20 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 109, - 21 - ], - "end": [ - 109, - 27 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 109, - 28 - ], - "end": [ - 109, - 33 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 109, - 33 - ], - "end": [ - 109, - 34 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 109, - 34 - ], - "end": [ - 109, - 35 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "NAME", - "string": "choices", - "start": [ - 109, - 35 - ], - "end": [ - 109, - 42 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 109, - 42 - ], - "end": [ - 109, - 43 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 109, - 44 - ], - "end": [ - 109, - 45 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "STRING", - "string": "'?'", - "start": [ - 109, - 46 - ], - "end": [ - 109, - 49 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 109, - 49 - ], - "end": [ - 110, - 0 - ], - "line": "def maybe(*choices): return group(*choices) + '?'\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 110, - 0 - ], - "end": [ - 111, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Note: we use unicode matching for names (\"\\w\") but ascii matching for", - "start": [ - 111, - 0 - ], - "end": [ - 111, - 71 - ], - "line": "# Note: we use unicode matching for names (\"\\w\") but ascii matching for\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 111, - 71 - ], - "end": [ - 112, - 0 - ], - "line": "# Note: we use unicode matching for names (\"\\w\") but ascii matching for\n" - }, - { - "typ": "COMMENT", - "string": "# number literals.", - "start": [ - 112, - 0 - ], - "end": [ - 112, - 18 - ], - "line": "# number literals.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 112, - 18 - ], - "end": [ - 113, - 0 - ], - "line": "# number literals.\n" - }, - { - "typ": "NAME", - "string": "Whitespace", - "start": [ - 113, - 0 - ], - "end": [ - 113, - 10 - ], - "line": "Whitespace = r'[ \\f\\t]*'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 113, - 11 - ], - "end": [ - 113, - 12 - ], - "line": "Whitespace = r'[ \\f\\t]*'\n" - }, - { - "typ": "STRING", - "string": "r'[ \\f\\t]*'", - "start": [ - 113, - 13 - ], - "end": [ - 113, - 24 - ], - "line": "Whitespace = r'[ \\f\\t]*'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 113, - 24 - ], - "end": [ - 114, - 0 - ], - "line": "Whitespace = r'[ \\f\\t]*'\n" - }, - { - "typ": "NAME", - "string": "Comment", - "start": [ - 114, - 0 - ], - "end": [ - 114, - 7 - ], - "line": "Comment = r'#[^\\r\\n]*'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 114, - 8 - ], - "end": [ - 114, - 9 - ], - "line": "Comment = r'#[^\\r\\n]*'\n" - }, - { - "typ": "STRING", - "string": "r'#[^\\r\\n]*'", - "start": [ - 114, - 10 - ], - "end": [ - 114, - 22 - ], - "line": "Comment = r'#[^\\r\\n]*'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 114, - 22 - ], - "end": [ - 115, - 0 - ], - "line": "Comment = r'#[^\\r\\n]*'\n" - }, - { - "typ": "NAME", - "string": "Ignore", - "start": [ - 115, - 0 - ], - "end": [ - 115, - 6 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 115, - 7 - ], - "end": [ - 115, - 8 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "NAME", - "string": "Whitespace", - "start": [ - 115, - 9 - ], - "end": [ - 115, - 19 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 115, - 20 - ], - "end": [ - 115, - 21 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "NAME", - "string": "any", - "start": [ - 115, - 22 - ], - "end": [ - 115, - 25 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 115, - 25 - ], - "end": [ - 115, - 26 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "STRING", - "string": "r'\\\\\\r?\\n'", - "start": [ - 115, - 26 - ], - "end": [ - 115, - 36 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 115, - 37 - ], - "end": [ - 115, - 38 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "NAME", - "string": "Whitespace", - "start": [ - 115, - 39 - ], - "end": [ - 115, - 49 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 115, - 49 - ], - "end": [ - 115, - 50 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 115, - 51 - ], - "end": [ - 115, - 52 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "NAME", - "string": "maybe", - "start": [ - 115, - 53 - ], - "end": [ - 115, - 58 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 115, - 58 - ], - "end": [ - 115, - 59 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "NAME", - "string": "Comment", - "start": [ - 115, - 59 - ], - "end": [ - 115, - 66 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 115, - 66 - ], - "end": [ - 115, - 67 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 115, - 67 - ], - "end": [ - 116, - 0 - ], - "line": "Ignore = Whitespace + any(r'\\\\\\r?\\n' + Whitespace) + maybe(Comment)\n" - }, - { - "typ": "NAME", - "string": "Name", - "start": [ - 116, - 0 - ], - "end": [ - 116, - 4 - ], - "line": "Name = r'\\w+'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 116, - 5 - ], - "end": [ - 116, - 6 - ], - "line": "Name = r'\\w+'\n" - }, - { - "typ": "STRING", - "string": "r'\\w+'", - "start": [ - 116, - 7 - ], - "end": [ - 116, - 13 - ], - "line": "Name = r'\\w+'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 116, - 13 - ], - "end": [ - 117, - 0 - ], - "line": "Name = r'\\w+'\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 117, - 0 - ], - "end": [ - 118, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "Hexnumber", - "start": [ - 118, - 0 - ], - "end": [ - 118, - 9 - ], - "line": "Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 118, - 10 - ], - "end": [ - 118, - 11 - ], - "line": "Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+'\n" - }, - { - "typ": "STRING", - "string": "r'0[xX](?:_?[0-9a-fA-F])+'", - "start": [ - 118, - 12 - ], - "end": [ - 118, - 38 - ], - "line": "Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 118, - 38 - ], - "end": [ - 119, - 0 - ], - "line": "Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+'\n" - }, - { - "typ": "NAME", - "string": "Binnumber", - "start": [ - 119, - 0 - ], - "end": [ - 119, - 9 - ], - "line": "Binnumber = r'0[bB](?:_?[01])+'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 119, - 10 - ], - "end": [ - 119, - 11 - ], - "line": "Binnumber = r'0[bB](?:_?[01])+'\n" - }, - { - "typ": "STRING", - "string": "r'0[bB](?:_?[01])+'", - "start": [ - 119, - 12 - ], - "end": [ - 119, - 31 - ], - "line": "Binnumber = r'0[bB](?:_?[01])+'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 119, - 31 - ], - "end": [ - 120, - 0 - ], - "line": "Binnumber = r'0[bB](?:_?[01])+'\n" - }, - { - "typ": "NAME", - "string": "Octnumber", - "start": [ - 120, - 0 - ], - "end": [ - 120, - 9 - ], - "line": "Octnumber = r'0[oO](?:_?[0-7])+'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 120, - 10 - ], - "end": [ - 120, - 11 - ], - "line": "Octnumber = r'0[oO](?:_?[0-7])+'\n" - }, - { - "typ": "STRING", - "string": "r'0[oO](?:_?[0-7])+'", - "start": [ - 120, - 12 - ], - "end": [ - 120, - 32 - ], - "line": "Octnumber = r'0[oO](?:_?[0-7])+'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 120, - 32 - ], - "end": [ - 121, - 0 - ], - "line": "Octnumber = r'0[oO](?:_?[0-7])+'\n" - }, - { - "typ": "NAME", - "string": "Decnumber", - "start": [ - 121, - 0 - ], - "end": [ - 121, - 9 - ], - "line": "Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 121, - 10 - ], - "end": [ - 121, - 11 - ], - "line": "Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)'\n" - }, - { - "typ": "STRING", - "string": "r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)'", - "start": [ - 121, - 12 - ], - "end": [ - 121, - 46 - ], - "line": "Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 121, - 46 - ], - "end": [ - 122, - 0 - ], - "line": "Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)'\n" - }, - { - "typ": "NAME", - "string": "Intnumber", - "start": [ - 122, - 0 - ], - "end": [ - 122, - 9 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 122, - 10 - ], - "end": [ - 122, - 11 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 122, - 12 - ], - "end": [ - 122, - 17 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 122, - 17 - ], - "end": [ - 122, - 18 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "NAME", - "string": "Hexnumber", - "start": [ - 122, - 18 - ], - "end": [ - 122, - 27 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 122, - 27 - ], - "end": [ - 122, - 28 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "NAME", - "string": "Binnumber", - "start": [ - 122, - 29 - ], - "end": [ - 122, - 38 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 122, - 38 - ], - "end": [ - 122, - 39 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "NAME", - "string": "Octnumber", - "start": [ - 122, - 40 - ], - "end": [ - 122, - 49 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 122, - 49 - ], - "end": [ - 122, - 50 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "NAME", - "string": "Decnumber", - "start": [ - 122, - 51 - ], - "end": [ - 122, - 60 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 122, - 60 - ], - "end": [ - 122, - 61 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 122, - 61 - ], - "end": [ - 123, - 0 - ], - "line": "Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)\n" - }, - { - "typ": "NAME", - "string": "Exponent", - "start": [ - 123, - 0 - ], - "end": [ - 123, - 8 - ], - "line": "Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 123, - 9 - ], - "end": [ - 123, - 10 - ], - "line": "Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*'\n" - }, - { - "typ": "STRING", - "string": "r'[eE][-+]?[0-9](?:_?[0-9])*'", - "start": [ - 123, - 11 - ], - "end": [ - 123, - 40 - ], - "line": "Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 123, - 40 - ], - "end": [ - 124, - 0 - ], - "line": "Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*'\n" - }, - { - "typ": "NAME", - "string": "Pointfloat", - "start": [ - 124, - 0 - ], - "end": [ - 124, - 10 - ], - "line": "Pointfloat = group(r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?',\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 124, - 11 - ], - "end": [ - 124, - 12 - ], - "line": "Pointfloat = group(r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?',\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 124, - 13 - ], - "end": [ - 124, - 18 - ], - "line": "Pointfloat = group(r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?',\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 124, - 18 - ], - "end": [ - 124, - 19 - ], - "line": "Pointfloat = group(r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?',\n" - }, - { - "typ": "STRING", - "string": "r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?'", - "start": [ - 124, - 19 - ], - "end": [ - 124, - 63 - ], - "line": "Pointfloat = group(r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 124, - 63 - ], - "end": [ - 124, - 64 - ], - "line": "Pointfloat = group(r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?',\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 124, - 64 - ], - "end": [ - 125, - 0 - ], - "line": "Pointfloat = group(r'[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?',\n" - }, - { - "typ": "STRING", - "string": "r'\\.[0-9](?:_?[0-9])*'", - "start": [ - 125, - 19 - ], - "end": [ - 125, - 41 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 125, - 41 - ], - "end": [ - 125, - 42 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 125, - 43 - ], - "end": [ - 125, - 44 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "NAME", - "string": "maybe", - "start": [ - 125, - 45 - ], - "end": [ - 125, - 50 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 125, - 50 - ], - "end": [ - 125, - 51 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "NAME", - "string": "Exponent", - "start": [ - 125, - 51 - ], - "end": [ - 125, - 59 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 125, - 59 - ], - "end": [ - 125, - 60 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 125, - 60 - ], - "end": [ - 126, - 0 - ], - "line": " r'\\.[0-9](?:_?[0-9])*') + maybe(Exponent)\n" - }, - { - "typ": "NAME", - "string": "Expfloat", - "start": [ - 126, - 0 - ], - "end": [ - 126, - 8 - ], - "line": "Expfloat = r'[0-9](?:_?[0-9])*' + Exponent\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 126, - 9 - ], - "end": [ - 126, - 10 - ], - "line": "Expfloat = r'[0-9](?:_?[0-9])*' + Exponent\n" - }, - { - "typ": "STRING", - "string": "r'[0-9](?:_?[0-9])*'", - "start": [ - 126, - 11 - ], - "end": [ - 126, - 31 - ], - "line": "Expfloat = r'[0-9](?:_?[0-9])*' + Exponent\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 126, - 32 - ], - "end": [ - 126, - 33 - ], - "line": "Expfloat = r'[0-9](?:_?[0-9])*' + Exponent\n" - }, - { - "typ": "NAME", - "string": "Exponent", - "start": [ - 126, - 34 - ], - "end": [ - 126, - 42 - ], - "line": "Expfloat = r'[0-9](?:_?[0-9])*' + Exponent\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 126, - 42 - ], - "end": [ - 127, - 0 - ], - "line": "Expfloat = r'[0-9](?:_?[0-9])*' + Exponent\n" - }, - { - "typ": "NAME", - "string": "Floatnumber", - "start": [ - 127, - 0 - ], - "end": [ - 127, - 11 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 127, - 12 - ], - "end": [ - 127, - 13 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 127, - 14 - ], - "end": [ - 127, - 19 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 127, - 19 - ], - "end": [ - 127, - 20 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "NAME", - "string": "Pointfloat", - "start": [ - 127, - 20 - ], - "end": [ - 127, - 30 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 127, - 30 - ], - "end": [ - 127, - 31 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "NAME", - "string": "Expfloat", - "start": [ - 127, - 32 - ], - "end": [ - 127, - 40 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 127, - 40 - ], - "end": [ - 127, - 41 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 127, - 41 - ], - "end": [ - 128, - 0 - ], - "line": "Floatnumber = group(Pointfloat, Expfloat)\n" - }, - { - "typ": "NAME", - "string": "Imagnumber", - "start": [ - 128, - 0 - ], - "end": [ - 128, - 10 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 128, - 11 - ], - "end": [ - 128, - 12 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 128, - 13 - ], - "end": [ - 128, - 18 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 128, - 18 - ], - "end": [ - 128, - 19 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "STRING", - "string": "r'[0-9](?:_?[0-9])*[jJ]'", - "start": [ - 128, - 19 - ], - "end": [ - 128, - 43 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 128, - 43 - ], - "end": [ - 128, - 44 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "NAME", - "string": "Floatnumber", - "start": [ - 128, - 45 - ], - "end": [ - 128, - 56 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 128, - 57 - ], - "end": [ - 128, - 58 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "STRING", - "string": "r'[jJ]'", - "start": [ - 128, - 59 - ], - "end": [ - 128, - 66 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 128, - 66 - ], - "end": [ - 128, - 67 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 128, - 67 - ], - "end": [ - 129, - 0 - ], - "line": "Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')\n" - }, - { - "typ": "NAME", - "string": "Number", - "start": [ - 129, - 0 - ], - "end": [ - 129, - 6 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 129, - 7 - ], - "end": [ - 129, - 8 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 129, - 9 - ], - "end": [ - 129, - 14 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 129, - 14 - ], - "end": [ - 129, - 15 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "NAME", - "string": "Imagnumber", - "start": [ - 129, - 15 - ], - "end": [ - 129, - 25 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 129, - 25 - ], - "end": [ - 129, - 26 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "NAME", - "string": "Floatnumber", - "start": [ - 129, - 27 - ], - "end": [ - 129, - 38 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 129, - 38 - ], - "end": [ - 129, - 39 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "NAME", - "string": "Intnumber", - "start": [ - 129, - 40 - ], - "end": [ - 129, - 49 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 129, - 49 - ], - "end": [ - 129, - 50 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 129, - 50 - ], - "end": [ - 130, - 0 - ], - "line": "Number = group(Imagnumber, Floatnumber, Intnumber)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 130, - 0 - ], - "end": [ - 131, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Return the empty string, plus all of the valid string prefixes.", - "start": [ - 131, - 0 - ], - "end": [ - 131, - 65 - ], - "line": "# Return the empty string, plus all of the valid string prefixes.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 131, - 65 - ], - "end": [ - 132, - 0 - ], - "line": "# Return the empty string, plus all of the valid string prefixes.\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 132, - 0 - ], - "end": [ - 132, - 3 - ], - "line": "def _all_string_prefixes():\n" - }, - { - "typ": "NAME", - "string": "_all_string_prefixes", - "start": [ - 132, - 4 - ], - "end": [ - 132, - 24 - ], - "line": "def _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 132, - 24 - ], - "end": [ - 132, - 25 - ], - "line": "def _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 132, - 25 - ], - "end": [ - 132, - 26 - ], - "line": "def _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 132, - 26 - ], - "end": [ - 132, - 27 - ], - "line": "def _all_string_prefixes():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 132, - 27 - ], - "end": [ - 133, - 0 - ], - "line": "def _all_string_prefixes():\n" - }, - { - "typ": "COMMENT", - "string": "# The valid string prefixes. Only contain the lower case versions,", - "start": [ - 133, - 4 - ], - "end": [ - 133, - 70 - ], - "line": " # The valid string prefixes. Only contain the lower case versions,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 133, - 70 - ], - "end": [ - 134, - 0 - ], - "line": " # The valid string prefixes. Only contain the lower case versions,\n" - }, - { - "typ": "COMMENT", - "string": "# and don't contain any permutations (include 'fr', but not", - "start": [ - 134, - 4 - ], - "end": [ - 134, - 64 - ], - "line": " # and don't contain any permutations (include 'fr', but not\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 134, - 64 - ], - "end": [ - 135, - 0 - ], - "line": " # and don't contain any permutations (include 'fr', but not\n" - }, - { - "typ": "COMMENT", - "string": "# 'rf'). The various permutations will be generated.", - "start": [ - 135, - 4 - ], - "end": [ - 135, - 57 - ], - "line": " # 'rf'). The various permutations will be generated.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 135, - 57 - ], - "end": [ - 136, - 0 - ], - "line": " # 'rf'). The various permutations will be generated.\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 136, - 0 - ], - "end": [ - 136, - 4 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "NAME", - "string": "_valid_string_prefixes", - "start": [ - 136, - 4 - ], - "end": [ - 136, - 26 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 136, - 27 - ], - "end": [ - 136, - 28 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 136, - 29 - ], - "end": [ - 136, - 30 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "STRING", - "string": "'b'", - "start": [ - 136, - 30 - ], - "end": [ - 136, - 33 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 136, - 33 - ], - "end": [ - 136, - 34 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "STRING", - "string": "'r'", - "start": [ - 136, - 35 - ], - "end": [ - 136, - 38 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 136, - 38 - ], - "end": [ - 136, - 39 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "STRING", - "string": "'u'", - "start": [ - 136, - 40 - ], - "end": [ - 136, - 43 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 136, - 43 - ], - "end": [ - 136, - 44 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "STRING", - "string": "'f'", - "start": [ - 136, - 45 - ], - "end": [ - 136, - 48 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 136, - 48 - ], - "end": [ - 136, - 49 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "STRING", - "string": "'br'", - "start": [ - 136, - 50 - ], - "end": [ - 136, - 54 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 136, - 54 - ], - "end": [ - 136, - 55 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "STRING", - "string": "'fr'", - "start": [ - 136, - 56 - ], - "end": [ - 136, - 60 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 136, - 60 - ], - "end": [ - 136, - 61 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 136, - 61 - ], - "end": [ - 137, - 0 - ], - "line": " _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']\n" - }, - { - "typ": "COMMENT", - "string": "# if we add binary f-strings, add: ['fb', 'fbr']", - "start": [ - 137, - 4 - ], - "end": [ - 137, - 52 - ], - "line": " # if we add binary f-strings, add: ['fb', 'fbr']\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 137, - 52 - ], - "end": [ - 138, - 0 - ], - "line": " # if we add binary f-strings, add: ['fb', 'fbr']\n" - }, - { - "typ": "NAME", - "string": "result", - "start": [ - 138, - 4 - ], - "end": [ - 138, - 10 - ], - "line": " result = {''}\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 138, - 11 - ], - "end": [ - 138, - 12 - ], - "line": " result = {''}\n" - }, - { - "typ": "OP", - "string": "{", - "start": [ - 138, - 13 - ], - "end": [ - 138, - 14 - ], - "line": " result = {''}\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 138, - 14 - ], - "end": [ - 138, - 16 - ], - "line": " result = {''}\n" - }, - { - "typ": "OP", - "string": "}", - "start": [ - 138, - 16 - ], - "end": [ - 138, - 17 - ], - "line": " result = {''}\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 138, - 17 - ], - "end": [ - 139, - 0 - ], - "line": " result = {''}\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 139, - 4 - ], - "end": [ - 139, - 7 - ], - "line": " for prefix in _valid_string_prefixes:\n" - }, - { - "typ": "NAME", - "string": "prefix", - "start": [ - 139, - 8 - ], - "end": [ - 139, - 14 - ], - "line": " for prefix in _valid_string_prefixes:\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 139, - 15 - ], - "end": [ - 139, - 17 - ], - "line": " for prefix in _valid_string_prefixes:\n" - }, - { - "typ": "NAME", - "string": "_valid_string_prefixes", - "start": [ - 139, - 18 - ], - "end": [ - 139, - 40 - ], - "line": " for prefix in _valid_string_prefixes:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 139, - 40 - ], - "end": [ - 139, - 41 - ], - "line": " for prefix in _valid_string_prefixes:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 139, - 41 - ], - "end": [ - 140, - 0 - ], - "line": " for prefix in _valid_string_prefixes:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 140, - 0 - ], - "end": [ - 140, - 8 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 140, - 8 - ], - "end": [ - 140, - 11 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 140, - 12 - ], - "end": [ - 140, - 13 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 140, - 14 - ], - "end": [ - 140, - 16 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "NAME", - "string": "_itertools", - "start": [ - 140, - 17 - ], - "end": [ - 140, - 27 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 140, - 27 - ], - "end": [ - 140, - 28 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "NAME", - "string": "permutations", - "start": [ - 140, - 28 - ], - "end": [ - 140, - 40 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 140, - 40 - ], - "end": [ - 140, - 41 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "NAME", - "string": "prefix", - "start": [ - 140, - 41 - ], - "end": [ - 140, - 47 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 140, - 47 - ], - "end": [ - 140, - 48 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 140, - 48 - ], - "end": [ - 140, - 49 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 140, - 49 - ], - "end": [ - 141, - 0 - ], - "line": " for t in _itertools.permutations(prefix):\n" - }, - { - "typ": "COMMENT", - "string": "# create a list with upper and lower versions of each", - "start": [ - 141, - 12 - ], - "end": [ - 141, - 65 - ], - "line": " # create a list with upper and lower versions of each\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 141, - 65 - ], - "end": [ - 142, - 0 - ], - "line": " # create a list with upper and lower versions of each\n" - }, - { - "typ": "COMMENT", - "string": "# character", - "start": [ - 142, - 12 - ], - "end": [ - 142, - 24 - ], - "line": " # character\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 142, - 24 - ], - "end": [ - 143, - 0 - ], - "line": " # character\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 143, - 0 - ], - "end": [ - 143, - 12 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 143, - 12 - ], - "end": [ - 143, - 15 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "u", - "start": [ - 143, - 16 - ], - "end": [ - 143, - 17 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 143, - 18 - ], - "end": [ - 143, - 20 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "_itertools", - "start": [ - 143, - 21 - ], - "end": [ - 143, - 31 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 143, - 31 - ], - "end": [ - 143, - 32 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "product", - "start": [ - 143, - 32 - ], - "end": [ - 143, - 39 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 143, - 39 - ], - "end": [ - 143, - 40 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 143, - 40 - ], - "end": [ - 143, - 41 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 143, - 41 - ], - "end": [ - 143, - 42 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 143, - 42 - ], - "end": [ - 143, - 43 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "c", - "start": [ - 143, - 43 - ], - "end": [ - 143, - 44 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 143, - 44 - ], - "end": [ - 143, - 45 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "c", - "start": [ - 143, - 46 - ], - "end": [ - 143, - 47 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 143, - 47 - ], - "end": [ - 143, - 48 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "upper", - "start": [ - 143, - 48 - ], - "end": [ - 143, - 53 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 143, - 53 - ], - "end": [ - 143, - 54 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 143, - 54 - ], - "end": [ - 143, - 55 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 143, - 55 - ], - "end": [ - 143, - 56 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 143, - 57 - ], - "end": [ - 143, - 60 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "c", - "start": [ - 143, - 61 - ], - "end": [ - 143, - 62 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 143, - 63 - ], - "end": [ - 143, - 65 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 143, - 66 - ], - "end": [ - 143, - 67 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 143, - 67 - ], - "end": [ - 143, - 68 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 143, - 68 - ], - "end": [ - 143, - 69 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 143, - 69 - ], - "end": [ - 143, - 70 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 143, - 70 - ], - "end": [ - 144, - 0 - ], - "line": " for u in _itertools.product(*[(c, c.upper()) for c in t]):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 144, - 0 - ], - "end": [ - 144, - 16 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "NAME", - "string": "result", - "start": [ - 144, - 16 - ], - "end": [ - 144, - 22 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 144, - 22 - ], - "end": [ - 144, - 23 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "NAME", - "string": "add", - "start": [ - 144, - 23 - ], - "end": [ - 144, - 26 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 144, - 26 - ], - "end": [ - 144, - 27 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 144, - 27 - ], - "end": [ - 144, - 29 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 144, - 29 - ], - "end": [ - 144, - 30 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "NAME", - "string": "join", - "start": [ - 144, - 30 - ], - "end": [ - 144, - 34 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 144, - 34 - ], - "end": [ - 144, - 35 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "NAME", - "string": "u", - "start": [ - 144, - 35 - ], - "end": [ - 144, - 36 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 144, - 36 - ], - "end": [ - 144, - 37 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 144, - 37 - ], - "end": [ - 144, - 38 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 144, - 38 - ], - "end": [ - 145, - 0 - ], - "line": " result.add(''.join(u))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 145, - 4 - ], - "end": [ - 145, - 4 - ], - "line": " return result\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 145, - 4 - ], - "end": [ - 145, - 4 - ], - "line": " return result\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 145, - 4 - ], - "end": [ - 145, - 4 - ], - "line": " return result\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 145, - 4 - ], - "end": [ - 145, - 10 - ], - "line": " return result\n" - }, - { - "typ": "NAME", - "string": "result", - "start": [ - 145, - 11 - ], - "end": [ - 145, - 17 - ], - "line": " return result\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 145, - 17 - ], - "end": [ - 146, - 0 - ], - "line": " return result\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 146, - 0 - ], - "end": [ - 147, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 147, - 0 - ], - "end": [ - 147, - 0 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 147, - 0 - ], - "end": [ - 147, - 3 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "NAME", - "string": "_compile", - "start": [ - 147, - 4 - ], - "end": [ - 147, - 12 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 147, - 12 - ], - "end": [ - 147, - 13 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "NAME", - "string": "expr", - "start": [ - 147, - 13 - ], - "end": [ - 147, - 17 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 147, - 17 - ], - "end": [ - 147, - 18 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 147, - 18 - ], - "end": [ - 147, - 19 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 147, - 19 - ], - "end": [ - 148, - 0 - ], - "line": "def _compile(expr):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 148, - 0 - ], - "end": [ - 148, - 4 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 148, - 4 - ], - "end": [ - 148, - 10 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NAME", - "string": "re", - "start": [ - 148, - 11 - ], - "end": [ - 148, - 13 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 148, - 13 - ], - "end": [ - 148, - 14 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NAME", - "string": "compile", - "start": [ - 148, - 14 - ], - "end": [ - 148, - 21 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 148, - 21 - ], - "end": [ - 148, - 22 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NAME", - "string": "expr", - "start": [ - 148, - 22 - ], - "end": [ - 148, - 26 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 148, - 26 - ], - "end": [ - 148, - 27 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NAME", - "string": "re", - "start": [ - 148, - 28 - ], - "end": [ - 148, - 30 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 148, - 30 - ], - "end": [ - 148, - 31 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NAME", - "string": "UNICODE", - "start": [ - 148, - 31 - ], - "end": [ - 148, - 38 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 148, - 38 - ], - "end": [ - 148, - 39 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 148, - 39 - ], - "end": [ - 149, - 0 - ], - "line": " return re.compile(expr, re.UNICODE)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 149, - 0 - ], - "end": [ - 150, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Note that since _all_string_prefixes includes the empty string,", - "start": [ - 150, - 0 - ], - "end": [ - 150, - 65 - ], - "line": "# Note that since _all_string_prefixes includes the empty string,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 150, - 65 - ], - "end": [ - 151, - 0 - ], - "line": "# Note that since _all_string_prefixes includes the empty string,\n" - }, - { - "typ": "COMMENT", - "string": "# StringPrefix can be the empty string (making it optional).", - "start": [ - 151, - 0 - ], - "end": [ - 151, - 61 - ], - "line": "# StringPrefix can be the empty string (making it optional).\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 151, - 61 - ], - "end": [ - 152, - 0 - ], - "line": "# StringPrefix can be the empty string (making it optional).\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 152, - 0 - ], - "end": [ - 152, - 0 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "NAME", - "string": "StringPrefix", - "start": [ - 152, - 0 - ], - "end": [ - 152, - 12 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 152, - 13 - ], - "end": [ - 152, - 14 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 152, - 15 - ], - "end": [ - 152, - 20 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 152, - 20 - ], - "end": [ - 152, - 21 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 152, - 21 - ], - "end": [ - 152, - 22 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "NAME", - "string": "_all_string_prefixes", - "start": [ - 152, - 22 - ], - "end": [ - 152, - 42 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 152, - 42 - ], - "end": [ - 152, - 43 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 152, - 43 - ], - "end": [ - 152, - 44 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 152, - 44 - ], - "end": [ - 152, - 45 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 152, - 45 - ], - "end": [ - 153, - 0 - ], - "line": "StringPrefix = group(*_all_string_prefixes())\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 153, - 0 - ], - "end": [ - 154, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Tail end of ' string.", - "start": [ - 154, - 0 - ], - "end": [ - 154, - 23 - ], - "line": "# Tail end of ' string.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 154, - 23 - ], - "end": [ - 155, - 0 - ], - "line": "# Tail end of ' string.\n" - }, - { - "typ": "NAME", - "string": "Single", - "start": [ - 155, - 0 - ], - "end": [ - 155, - 6 - ], - "line": "Single = r\"[^'\\\\]*(?:\\\\.[^'\\\\]*)*'\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 155, - 7 - ], - "end": [ - 155, - 8 - ], - "line": "Single = r\"[^'\\\\]*(?:\\\\.[^'\\\\]*)*'\"\n" - }, - { - "typ": "STRING", - "string": "r\"[^'\\\\]*(?:\\\\.[^'\\\\]*)*'\"", - "start": [ - 155, - 9 - ], - "end": [ - 155, - 35 - ], - "line": "Single = r\"[^'\\\\]*(?:\\\\.[^'\\\\]*)*'\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 155, - 35 - ], - "end": [ - 156, - 0 - ], - "line": "Single = r\"[^'\\\\]*(?:\\\\.[^'\\\\]*)*'\"\n" - }, - { - "typ": "COMMENT", - "string": "# Tail end of \" string.", - "start": [ - 156, - 0 - ], - "end": [ - 156, - 23 - ], - "line": "# Tail end of \" string.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 156, - 23 - ], - "end": [ - 157, - 0 - ], - "line": "# Tail end of \" string.\n" - }, - { - "typ": "NAME", - "string": "Double", - "start": [ - 157, - 0 - ], - "end": [ - 157, - 6 - ], - "line": "Double = r'[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 157, - 7 - ], - "end": [ - 157, - 8 - ], - "line": "Double = r'[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"'\n" - }, - { - "typ": "STRING", - "string": "r'[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"'", - "start": [ - 157, - 9 - ], - "end": [ - 157, - 35 - ], - "line": "Double = r'[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 157, - 35 - ], - "end": [ - 158, - 0 - ], - "line": "Double = r'[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"'\n" - }, - { - "typ": "COMMENT", - "string": "# Tail end of ''' string.", - "start": [ - 158, - 0 - ], - "end": [ - 158, - 25 - ], - "line": "# Tail end of ''' string.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 158, - 25 - ], - "end": [ - 159, - 0 - ], - "line": "# Tail end of ''' string.\n" - }, - { - "typ": "NAME", - "string": "Single3", - "start": [ - 159, - 0 - ], - "end": [ - 159, - 7 - ], - "line": "Single3 = r\"[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 159, - 8 - ], - "end": [ - 159, - 9 - ], - "line": "Single3 = r\"[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''\"\n" - }, - { - "typ": "STRING", - "string": "r\"[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''\"", - "start": [ - 159, - 10 - ], - "end": [ - 159, - 50 - ], - "line": "Single3 = r\"[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 159, - 50 - ], - "end": [ - 160, - 0 - ], - "line": "Single3 = r\"[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''\"\n" - }, - { - "typ": "COMMENT", - "string": "# Tail end of \"\"\" string.", - "start": [ - 160, - 0 - ], - "end": [ - 160, - 25 - ], - "line": "# Tail end of \"\"\" string.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 160, - 25 - ], - "end": [ - 161, - 0 - ], - "line": "# Tail end of \"\"\" string.\n" - }, - { - "typ": "NAME", - "string": "Double3", - "start": [ - 161, - 0 - ], - "end": [ - 161, - 7 - ], - "line": "Double3 = r'[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\"'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 161, - 8 - ], - "end": [ - 161, - 9 - ], - "line": "Double3 = r'[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\"'\n" - }, - { - "typ": "STRING", - "string": "r'[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\"'", - "start": [ - 161, - 10 - ], - "end": [ - 161, - 50 - ], - "line": "Double3 = r'[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\"'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 161, - 50 - ], - "end": [ - 162, - 0 - ], - "line": "Double3 = r'[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\"'\n" - }, - { - "typ": "NAME", - "string": "Triple", - "start": [ - 162, - 0 - ], - "end": [ - 162, - 6 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 162, - 7 - ], - "end": [ - 162, - 8 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 162, - 9 - ], - "end": [ - 162, - 14 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 162, - 14 - ], - "end": [ - 162, - 15 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "NAME", - "string": "StringPrefix", - "start": [ - 162, - 15 - ], - "end": [ - 162, - 27 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 162, - 28 - ], - "end": [ - 162, - 29 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "STRING", - "string": "\"'''\"", - "start": [ - 162, - 30 - ], - "end": [ - 162, - 35 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 162, - 35 - ], - "end": [ - 162, - 36 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "NAME", - "string": "StringPrefix", - "start": [ - 162, - 37 - ], - "end": [ - 162, - 49 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 162, - 50 - ], - "end": [ - 162, - 51 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "STRING", - "string": "'\"\"\"'", - "start": [ - 162, - 52 - ], - "end": [ - 162, - 57 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 162, - 57 - ], - "end": [ - 162, - 58 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 162, - 58 - ], - "end": [ - 163, - 0 - ], - "line": "Triple = group(StringPrefix + \"'''\", StringPrefix + '\"\"\"')\n" - }, - { - "typ": "COMMENT", - "string": "# Single-line ' or \" string.", - "start": [ - 163, - 0 - ], - "end": [ - 163, - 28 - ], - "line": "# Single-line ' or \" string.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 163, - 28 - ], - "end": [ - 164, - 0 - ], - "line": "# Single-line ' or \" string.\n" - }, - { - "typ": "NAME", - "string": "String", - "start": [ - 164, - 0 - ], - "end": [ - 164, - 6 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 164, - 7 - ], - "end": [ - 164, - 8 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 164, - 9 - ], - "end": [ - 164, - 14 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 164, - 14 - ], - "end": [ - 164, - 15 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "NAME", - "string": "StringPrefix", - "start": [ - 164, - 15 - ], - "end": [ - 164, - 27 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 164, - 28 - ], - "end": [ - 164, - 29 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "STRING", - "string": "r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\"", - "start": [ - 164, - 30 - ], - "end": [ - 164, - 61 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 164, - 61 - ], - "end": [ - 164, - 62 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 164, - 62 - ], - "end": [ - 165, - 0 - ], - "line": "String = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'\",\n" - }, - { - "typ": "NAME", - "string": "StringPrefix", - "start": [ - 165, - 15 - ], - "end": [ - 165, - 27 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*\"')\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 165, - 28 - ], - "end": [ - 165, - 29 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*\"')\n" - }, - { - "typ": "STRING", - "string": "r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*\"'", - "start": [ - 165, - 30 - ], - "end": [ - 165, - 61 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*\"')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 165, - 61 - ], - "end": [ - 165, - 62 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*\"')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 165, - 62 - ], - "end": [ - 166, - 0 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*\"')\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 166, - 0 - ], - "end": [ - 167, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Because of leftmost-then-longest match semantics, be sure to put the", - "start": [ - 167, - 0 - ], - "end": [ - 167, - 70 - ], - "line": "# Because of leftmost-then-longest match semantics, be sure to put the\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 167, - 70 - ], - "end": [ - 168, - 0 - ], - "line": "# Because of leftmost-then-longest match semantics, be sure to put the\n" - }, - { - "typ": "COMMENT", - "string": "# longest operators first (e.g., if = came before ==, == would get", - "start": [ - 168, - 0 - ], - "end": [ - 168, - 66 - ], - "line": "# longest operators first (e.g., if = came before ==, == would get\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 168, - 66 - ], - "end": [ - 169, - 0 - ], - "line": "# longest operators first (e.g., if = came before ==, == would get\n" - }, - { - "typ": "COMMENT", - "string": "# recognized as two instances of =).", - "start": [ - 169, - 0 - ], - "end": [ - 169, - 36 - ], - "line": "# recognized as two instances of =).\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 169, - 36 - ], - "end": [ - 170, - 0 - ], - "line": "# recognized as two instances of =).\n" - }, - { - "typ": "NAME", - "string": "Operator", - "start": [ - 170, - 0 - ], - "end": [ - 170, - 8 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 170, - 9 - ], - "end": [ - 170, - 10 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 170, - 11 - ], - "end": [ - 170, - 16 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 170, - 16 - ], - "end": [ - 170, - 17 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "STRING", - "string": "r\"\\*\\*=?\"", - "start": [ - 170, - 17 - ], - "end": [ - 170, - 26 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 170, - 26 - ], - "end": [ - 170, - 27 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "STRING", - "string": "r\">>=?\"", - "start": [ - 170, - 28 - ], - "end": [ - 170, - 35 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 170, - 35 - ], - "end": [ - 170, - 36 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "STRING", - "string": "r\"<<=?\"", - "start": [ - 170, - 37 - ], - "end": [ - 170, - 44 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 170, - 44 - ], - "end": [ - 170, - 45 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "STRING", - "string": "r\"!=\"", - "start": [ - 170, - 46 - ], - "end": [ - 170, - 51 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 170, - 51 - ], - "end": [ - 170, - 52 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 170, - 52 - ], - "end": [ - 171, - 0 - ], - "line": "Operator = group(r\"\\*\\*=?\", r\">>=?\", r\"<<=?\", r\"!=\",\n" - }, - { - "typ": "STRING", - "string": "r\"//=?\"", - "start": [ - 171, - 17 - ], - "end": [ - 171, - 24 - ], - "line": " r\"//=?\", r\"->\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 171, - 24 - ], - "end": [ - 171, - 25 - ], - "line": " r\"//=?\", r\"->\",\n" - }, - { - "typ": "STRING", - "string": "r\"->\"", - "start": [ - 171, - 26 - ], - "end": [ - 171, - 31 - ], - "line": " r\"//=?\", r\"->\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 171, - 31 - ], - "end": [ - 171, - 32 - ], - "line": " r\"//=?\", r\"->\",\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 171, - 32 - ], - "end": [ - 172, - 0 - ], - "line": " r\"//=?\", r\"->\",\n" - }, - { - "typ": "STRING", - "string": "r\"[+\\-*/%&@|^=<>]=?\"", - "start": [ - 172, - 17 - ], - "end": [ - 172, - 37 - ], - "line": " r\"[+\\-*/%&@|^=<>]=?\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 172, - 37 - ], - "end": [ - 172, - 38 - ], - "line": " r\"[+\\-*/%&@|^=<>]=?\",\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 172, - 38 - ], - "end": [ - 173, - 0 - ], - "line": " r\"[+\\-*/%&@|^=<>]=?\",\n" - }, - { - "typ": "STRING", - "string": "r\"~\"", - "start": [ - 173, - 17 - ], - "end": [ - 173, - 21 - ], - "line": " r\"~\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 173, - 21 - ], - "end": [ - 173, - 22 - ], - "line": " r\"~\")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 173, - 22 - ], - "end": [ - 174, - 0 - ], - "line": " r\"~\")\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 174, - 0 - ], - "end": [ - 175, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "Bracket", - "start": [ - 175, - 0 - ], - "end": [ - 175, - 7 - ], - "line": "Bracket = '[][(){}]'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 175, - 8 - ], - "end": [ - 175, - 9 - ], - "line": "Bracket = '[][(){}]'\n" - }, - { - "typ": "STRING", - "string": "'[][(){}]'", - "start": [ - 175, - 10 - ], - "end": [ - 175, - 20 - ], - "line": "Bracket = '[][(){}]'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 175, - 20 - ], - "end": [ - 176, - 0 - ], - "line": "Bracket = '[][(){}]'\n" - }, - { - "typ": "NAME", - "string": "Special", - "start": [ - 176, - 0 - ], - "end": [ - 176, - 7 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 176, - 8 - ], - "end": [ - 176, - 9 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 176, - 10 - ], - "end": [ - 176, - 15 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 176, - 15 - ], - "end": [ - 176, - 16 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "STRING", - "string": "r'\\r?\\n'", - "start": [ - 176, - 16 - ], - "end": [ - 176, - 24 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 176, - 24 - ], - "end": [ - 176, - 25 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "STRING", - "string": "r'\\.\\.\\.'", - "start": [ - 176, - 26 - ], - "end": [ - 176, - 35 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 176, - 35 - ], - "end": [ - 176, - 36 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "STRING", - "string": "r'[:;.,@]'", - "start": [ - 176, - 37 - ], - "end": [ - 176, - 47 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 176, - 47 - ], - "end": [ - 176, - 48 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 176, - 48 - ], - "end": [ - 177, - 0 - ], - "line": "Special = group(r'\\r?\\n', r'\\.\\.\\.', r'[:;.,@]')\n" - }, - { - "typ": "NAME", - "string": "Funny", - "start": [ - 177, - 0 - ], - "end": [ - 177, - 5 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 177, - 6 - ], - "end": [ - 177, - 7 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 177, - 8 - ], - "end": [ - 177, - 13 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 177, - 13 - ], - "end": [ - 177, - 14 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "NAME", - "string": "Operator", - "start": [ - 177, - 14 - ], - "end": [ - 177, - 22 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 177, - 22 - ], - "end": [ - 177, - 23 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "NAME", - "string": "Bracket", - "start": [ - 177, - 24 - ], - "end": [ - 177, - 31 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 177, - 31 - ], - "end": [ - 177, - 32 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "NAME", - "string": "Special", - "start": [ - 177, - 33 - ], - "end": [ - 177, - 40 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 177, - 40 - ], - "end": [ - 177, - 41 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 177, - 41 - ], - "end": [ - 178, - 0 - ], - "line": "Funny = group(Operator, Bracket, Special)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 178, - 0 - ], - "end": [ - 179, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "PlainToken", - "start": [ - 179, - 0 - ], - "end": [ - 179, - 10 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 179, - 11 - ], - "end": [ - 179, - 12 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 179, - 13 - ], - "end": [ - 179, - 18 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 179, - 18 - ], - "end": [ - 179, - 19 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "NAME", - "string": "Number", - "start": [ - 179, - 19 - ], - "end": [ - 179, - 25 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 179, - 25 - ], - "end": [ - 179, - 26 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "NAME", - "string": "Funny", - "start": [ - 179, - 27 - ], - "end": [ - 179, - 32 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 179, - 32 - ], - "end": [ - 179, - 33 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "NAME", - "string": "String", - "start": [ - 179, - 34 - ], - "end": [ - 179, - 40 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 179, - 40 - ], - "end": [ - 179, - 41 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "NAME", - "string": "Name", - "start": [ - 179, - 42 - ], - "end": [ - 179, - 46 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 179, - 46 - ], - "end": [ - 179, - 47 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 179, - 47 - ], - "end": [ - 180, - 0 - ], - "line": "PlainToken = group(Number, Funny, String, Name)\n" - }, - { - "typ": "NAME", - "string": "Token", - "start": [ - 180, - 0 - ], - "end": [ - 180, - 5 - ], - "line": "Token = Ignore + PlainToken\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 180, - 6 - ], - "end": [ - 180, - 7 - ], - "line": "Token = Ignore + PlainToken\n" - }, - { - "typ": "NAME", - "string": "Ignore", - "start": [ - 180, - 8 - ], - "end": [ - 180, - 14 - ], - "line": "Token = Ignore + PlainToken\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 180, - 15 - ], - "end": [ - 180, - 16 - ], - "line": "Token = Ignore + PlainToken\n" - }, - { - "typ": "NAME", - "string": "PlainToken", - "start": [ - 180, - 17 - ], - "end": [ - 180, - 27 - ], - "line": "Token = Ignore + PlainToken\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 180, - 27 - ], - "end": [ - 181, - 0 - ], - "line": "Token = Ignore + PlainToken\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 181, - 0 - ], - "end": [ - 182, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# First (or only) line of ' or \" string.", - "start": [ - 182, - 0 - ], - "end": [ - 182, - 40 - ], - "line": "# First (or only) line of ' or \" string.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 182, - 40 - ], - "end": [ - 183, - 0 - ], - "line": "# First (or only) line of ' or \" string.\n" - }, - { - "typ": "NAME", - "string": "ContStr", - "start": [ - 183, - 0 - ], - "end": [ - 183, - 7 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 183, - 8 - ], - "end": [ - 183, - 9 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 183, - 10 - ], - "end": [ - 183, - 15 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 183, - 15 - ], - "end": [ - 183, - 16 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "NAME", - "string": "StringPrefix", - "start": [ - 183, - 16 - ], - "end": [ - 183, - 28 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 183, - 29 - ], - "end": [ - 183, - 30 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "STRING", - "string": "r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\"", - "start": [ - 183, - 31 - ], - "end": [ - 183, - 61 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 183, - 62 - ], - "end": [ - 183, - 63 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 183, - 63 - ], - "end": [ - 184, - 0 - ], - "line": "ContStr = group(StringPrefix + r\"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*\" +\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 184, - 16 - ], - "end": [ - 184, - 21 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 184, - 21 - ], - "end": [ - 184, - 22 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "STRING", - "string": "\"'\"", - "start": [ - 184, - 22 - ], - "end": [ - 184, - 25 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 184, - 25 - ], - "end": [ - 184, - 26 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "STRING", - "string": "r'\\\\\\r?\\n'", - "start": [ - 184, - 27 - ], - "end": [ - 184, - 37 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 184, - 37 - ], - "end": [ - 184, - 38 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 184, - 38 - ], - "end": [ - 184, - 39 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 184, - 39 - ], - "end": [ - 185, - 0 - ], - "line": " group(\"'\", r'\\\\\\r?\\n'),\n" - }, - { - "typ": "NAME", - "string": "StringPrefix", - "start": [ - 185, - 16 - ], - "end": [ - 185, - 28 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*' +\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 185, - 29 - ], - "end": [ - 185, - 30 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*' +\n" - }, - { - "typ": "STRING", - "string": "r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*'", - "start": [ - 185, - 31 - ], - "end": [ - 185, - 61 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*' +\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 185, - 62 - ], - "end": [ - 185, - 63 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*' +\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 185, - 63 - ], - "end": [ - 186, - 0 - ], - "line": " StringPrefix + r'\"[^\\n\"\\\\]*(?:\\\\.[^\\n\"\\\\]*)*' +\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 186, - 16 - ], - "end": [ - 186, - 21 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 186, - 21 - ], - "end": [ - 186, - 22 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "STRING", - "string": "'\"'", - "start": [ - 186, - 22 - ], - "end": [ - 186, - 25 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 186, - 25 - ], - "end": [ - 186, - 26 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "STRING", - "string": "r'\\\\\\r?\\n'", - "start": [ - 186, - 27 - ], - "end": [ - 186, - 37 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 186, - 37 - ], - "end": [ - 186, - 38 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 186, - 38 - ], - "end": [ - 186, - 39 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 186, - 39 - ], - "end": [ - 187, - 0 - ], - "line": " group('\"', r'\\\\\\r?\\n'))\n" - }, - { - "typ": "NAME", - "string": "PseudoExtras", - "start": [ - 187, - 0 - ], - "end": [ - 187, - 12 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 187, - 13 - ], - "end": [ - 187, - 14 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 187, - 15 - ], - "end": [ - 187, - 20 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 187, - 20 - ], - "end": [ - 187, - 21 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "STRING", - "string": "r'\\\\\\r?\\n|\\Z'", - "start": [ - 187, - 21 - ], - "end": [ - 187, - 34 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 187, - 34 - ], - "end": [ - 187, - 35 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "NAME", - "string": "Comment", - "start": [ - 187, - 36 - ], - "end": [ - 187, - 43 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 187, - 43 - ], - "end": [ - 187, - 44 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "NAME", - "string": "Triple", - "start": [ - 187, - 45 - ], - "end": [ - 187, - 51 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 187, - 51 - ], - "end": [ - 187, - 52 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 187, - 52 - ], - "end": [ - 188, - 0 - ], - "line": "PseudoExtras = group(r'\\\\\\r?\\n|\\Z', Comment, Triple)\n" - }, - { - "typ": "NAME", - "string": "PseudoToken", - "start": [ - 188, - 0 - ], - "end": [ - 188, - 11 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 188, - 12 - ], - "end": [ - 188, - 13 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NAME", - "string": "Whitespace", - "start": [ - 188, - 14 - ], - "end": [ - 188, - 24 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 188, - 25 - ], - "end": [ - 188, - 26 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 188, - 27 - ], - "end": [ - 188, - 32 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 188, - 32 - ], - "end": [ - 188, - 33 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NAME", - "string": "PseudoExtras", - "start": [ - 188, - 33 - ], - "end": [ - 188, - 45 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 188, - 45 - ], - "end": [ - 188, - 46 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NAME", - "string": "Number", - "start": [ - 188, - 47 - ], - "end": [ - 188, - 53 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 188, - 53 - ], - "end": [ - 188, - 54 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NAME", - "string": "Funny", - "start": [ - 188, - 55 - ], - "end": [ - 188, - 60 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 188, - 60 - ], - "end": [ - 188, - 61 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NAME", - "string": "ContStr", - "start": [ - 188, - 62 - ], - "end": [ - 188, - 69 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 188, - 69 - ], - "end": [ - 188, - 70 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NAME", - "string": "Name", - "start": [ - 188, - 71 - ], - "end": [ - 188, - 75 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 188, - 75 - ], - "end": [ - 188, - 76 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 188, - 76 - ], - "end": [ - 189, - 0 - ], - "line": "PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 189, - 0 - ], - "end": [ - 190, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# For a given string prefix plus quotes, endpats maps it to a regex", - "start": [ - 190, - 0 - ], - "end": [ - 190, - 67 - ], - "line": "# For a given string prefix plus quotes, endpats maps it to a regex\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 190, - 67 - ], - "end": [ - 191, - 0 - ], - "line": "# For a given string prefix plus quotes, endpats maps it to a regex\n" - }, - { - "typ": "COMMENT", - "string": "# to match the remainder of that string. _prefix can be empty, for", - "start": [ - 191, - 0 - ], - "end": [ - 191, - 67 - ], - "line": "# to match the remainder of that string. _prefix can be empty, for\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 191, - 67 - ], - "end": [ - 192, - 0 - ], - "line": "# to match the remainder of that string. _prefix can be empty, for\n" - }, - { - "typ": "COMMENT", - "string": "# a normal single or triple quoted string (with no prefix).", - "start": [ - 192, - 0 - ], - "end": [ - 192, - 60 - ], - "line": "# a normal single or triple quoted string (with no prefix).\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 192, - 60 - ], - "end": [ - 193, - 0 - ], - "line": "# a normal single or triple quoted string (with no prefix).\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 193, - 0 - ], - "end": [ - 193, - 7 - ], - "line": "endpats = {}\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 193, - 8 - ], - "end": [ - 193, - 9 - ], - "line": "endpats = {}\n" - }, - { - "typ": "OP", - "string": "{", - "start": [ - 193, - 10 - ], - "end": [ - 193, - 11 - ], - "line": "endpats = {}\n" - }, - { - "typ": "OP", - "string": "}", - "start": [ - 193, - 11 - ], - "end": [ - 193, - 12 - ], - "line": "endpats = {}\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 193, - 12 - ], - "end": [ - 194, - 0 - ], - "line": "endpats = {}\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 194, - 0 - ], - "end": [ - 194, - 3 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "NAME", - "string": "_prefix", - "start": [ - 194, - 4 - ], - "end": [ - 194, - 11 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 194, - 12 - ], - "end": [ - 194, - 14 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "NAME", - "string": "_all_string_prefixes", - "start": [ - 194, - 15 - ], - "end": [ - 194, - 35 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 194, - 35 - ], - "end": [ - 194, - 36 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 194, - 36 - ], - "end": [ - 194, - 37 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 194, - 37 - ], - "end": [ - 194, - 38 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 194, - 38 - ], - "end": [ - 195, - 0 - ], - "line": "for _prefix in _all_string_prefixes():\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 195, - 0 - ], - "end": [ - 195, - 4 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 195, - 4 - ], - "end": [ - 195, - 11 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 195, - 11 - ], - "end": [ - 195, - 12 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "NAME", - "string": "_prefix", - "start": [ - 195, - 12 - ], - "end": [ - 195, - 19 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 195, - 20 - ], - "end": [ - 195, - 21 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "STRING", - "string": "\"'\"", - "start": [ - 195, - 22 - ], - "end": [ - 195, - 25 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 195, - 25 - ], - "end": [ - 195, - 26 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 195, - 27 - ], - "end": [ - 195, - 28 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "NAME", - "string": "Single", - "start": [ - 195, - 29 - ], - "end": [ - 195, - 35 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 195, - 35 - ], - "end": [ - 196, - 0 - ], - "line": " endpats[_prefix + \"'\"] = Single\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 196, - 4 - ], - "end": [ - 196, - 11 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 196, - 11 - ], - "end": [ - 196, - 12 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "NAME", - "string": "_prefix", - "start": [ - 196, - 12 - ], - "end": [ - 196, - 19 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 196, - 20 - ], - "end": [ - 196, - 21 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "STRING", - "string": "'\"'", - "start": [ - 196, - 22 - ], - "end": [ - 196, - 25 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 196, - 25 - ], - "end": [ - 196, - 26 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 196, - 27 - ], - "end": [ - 196, - 28 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "NAME", - "string": "Double", - "start": [ - 196, - 29 - ], - "end": [ - 196, - 35 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 196, - 35 - ], - "end": [ - 197, - 0 - ], - "line": " endpats[_prefix + '\"'] = Double\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 197, - 4 - ], - "end": [ - 197, - 11 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 197, - 11 - ], - "end": [ - 197, - 12 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "NAME", - "string": "_prefix", - "start": [ - 197, - 12 - ], - "end": [ - 197, - 19 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 197, - 20 - ], - "end": [ - 197, - 21 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "STRING", - "string": "\"'''\"", - "start": [ - 197, - 22 - ], - "end": [ - 197, - 27 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 197, - 27 - ], - "end": [ - 197, - 28 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 197, - 29 - ], - "end": [ - 197, - 30 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "NAME", - "string": "Single3", - "start": [ - 197, - 31 - ], - "end": [ - 197, - 38 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 197, - 38 - ], - "end": [ - 198, - 0 - ], - "line": " endpats[_prefix + \"'''\"] = Single3\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 198, - 4 - ], - "end": [ - 198, - 11 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 198, - 11 - ], - "end": [ - 198, - 12 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "NAME", - "string": "_prefix", - "start": [ - 198, - 12 - ], - "end": [ - 198, - 19 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 198, - 20 - ], - "end": [ - 198, - 21 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "STRING", - "string": "'\"\"\"'", - "start": [ - 198, - 22 - ], - "end": [ - 198, - 27 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 198, - 27 - ], - "end": [ - 198, - 28 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 198, - 29 - ], - "end": [ - 198, - 30 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "NAME", - "string": "Double3", - "start": [ - 198, - 31 - ], - "end": [ - 198, - 38 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 198, - 38 - ], - "end": [ - 199, - 0 - ], - "line": " endpats[_prefix + '\"\"\"'] = Double3\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 199, - 0 - ], - "end": [ - 200, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# A set of all of the single and triple quoted string prefixes,", - "start": [ - 200, - 0 - ], - "end": [ - 200, - 63 - ], - "line": "# A set of all of the single and triple quoted string prefixes,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 200, - 63 - ], - "end": [ - 201, - 0 - ], - "line": "# A set of all of the single and triple quoted string prefixes,\n" - }, - { - "typ": "COMMENT", - "string": "# including the opening quotes.", - "start": [ - 201, - 0 - ], - "end": [ - 201, - 32 - ], - "line": "# including the opening quotes.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 201, - 32 - ], - "end": [ - 202, - 0 - ], - "line": "# including the opening quotes.\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 202, - 0 - ], - "end": [ - 202, - 0 - ], - "line": "single_quoted = set()\n" - }, - { - "typ": "NAME", - "string": "single_quoted", - "start": [ - 202, - 0 - ], - "end": [ - 202, - 13 - ], - "line": "single_quoted = set()\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 202, - 14 - ], - "end": [ - 202, - 15 - ], - "line": "single_quoted = set()\n" - }, - { - "typ": "NAME", - "string": "set", - "start": [ - 202, - 16 - ], - "end": [ - 202, - 19 - ], - "line": "single_quoted = set()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 202, - 19 - ], - "end": [ - 202, - 20 - ], - "line": "single_quoted = set()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 202, - 20 - ], - "end": [ - 202, - 21 - ], - "line": "single_quoted = set()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 202, - 21 - ], - "end": [ - 203, - 0 - ], - "line": "single_quoted = set()\n" - }, - { - "typ": "NAME", - "string": "triple_quoted", - "start": [ - 203, - 0 - ], - "end": [ - 203, - 13 - ], - "line": "triple_quoted = set()\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 203, - 14 - ], - "end": [ - 203, - 15 - ], - "line": "triple_quoted = set()\n" - }, - { - "typ": "NAME", - "string": "set", - "start": [ - 203, - 16 - ], - "end": [ - 203, - 19 - ], - "line": "triple_quoted = set()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 203, - 19 - ], - "end": [ - 203, - 20 - ], - "line": "triple_quoted = set()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 203, - 20 - ], - "end": [ - 203, - 21 - ], - "line": "triple_quoted = set()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 203, - 21 - ], - "end": [ - 204, - 0 - ], - "line": "triple_quoted = set()\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 204, - 0 - ], - "end": [ - 204, - 3 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 204, - 4 - ], - "end": [ - 204, - 5 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 204, - 6 - ], - "end": [ - 204, - 8 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "NAME", - "string": "_all_string_prefixes", - "start": [ - 204, - 9 - ], - "end": [ - 204, - 29 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 204, - 29 - ], - "end": [ - 204, - 30 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 204, - 30 - ], - "end": [ - 204, - 31 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 204, - 31 - ], - "end": [ - 204, - 32 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 204, - 32 - ], - "end": [ - 205, - 0 - ], - "line": "for t in _all_string_prefixes():\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 205, - 0 - ], - "end": [ - 205, - 4 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 205, - 4 - ], - "end": [ - 205, - 7 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "NAME", - "string": "u", - "start": [ - 205, - 8 - ], - "end": [ - 205, - 9 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 205, - 10 - ], - "end": [ - 205, - 12 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 205, - 13 - ], - "end": [ - 205, - 14 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 205, - 14 - ], - "end": [ - 205, - 15 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 205, - 16 - ], - "end": [ - 205, - 17 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "STRING", - "string": "'\"'", - "start": [ - 205, - 18 - ], - "end": [ - 205, - 21 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 205, - 21 - ], - "end": [ - 205, - 22 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 205, - 23 - ], - "end": [ - 205, - 24 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 205, - 25 - ], - "end": [ - 205, - 26 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "STRING", - "string": "\"'\"", - "start": [ - 205, - 27 - ], - "end": [ - 205, - 30 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 205, - 30 - ], - "end": [ - 205, - 31 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 205, - 31 - ], - "end": [ - 205, - 32 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 205, - 32 - ], - "end": [ - 206, - 0 - ], - "line": " for u in (t + '\"', t + \"'\"):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 206, - 0 - ], - "end": [ - 206, - 8 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "NAME", - "string": "single_quoted", - "start": [ - 206, - 8 - ], - "end": [ - 206, - 21 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 206, - 21 - ], - "end": [ - 206, - 22 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "NAME", - "string": "add", - "start": [ - 206, - 22 - ], - "end": [ - 206, - 25 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 206, - 25 - ], - "end": [ - 206, - 26 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "NAME", - "string": "u", - "start": [ - 206, - 26 - ], - "end": [ - 206, - 27 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 206, - 27 - ], - "end": [ - 206, - 28 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 206, - 28 - ], - "end": [ - 207, - 0 - ], - "line": " single_quoted.add(u)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 207, - 4 - ], - "end": [ - 207, - 4 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 207, - 4 - ], - "end": [ - 207, - 7 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "NAME", - "string": "u", - "start": [ - 207, - 8 - ], - "end": [ - 207, - 9 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 207, - 10 - ], - "end": [ - 207, - 12 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 207, - 13 - ], - "end": [ - 207, - 14 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 207, - 14 - ], - "end": [ - 207, - 15 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 207, - 16 - ], - "end": [ - 207, - 17 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "STRING", - "string": "'\"\"\"'", - "start": [ - 207, - 18 - ], - "end": [ - 207, - 23 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 207, - 23 - ], - "end": [ - 207, - 24 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 207, - 25 - ], - "end": [ - 207, - 26 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 207, - 27 - ], - "end": [ - 207, - 28 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "STRING", - "string": "\"'''\"", - "start": [ - 207, - 29 - ], - "end": [ - 207, - 34 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 207, - 34 - ], - "end": [ - 207, - 35 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 207, - 35 - ], - "end": [ - 207, - 36 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 207, - 36 - ], - "end": [ - 208, - 0 - ], - "line": " for u in (t + '\"\"\"', t + \"'''\"):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 208, - 0 - ], - "end": [ - 208, - 8 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "NAME", - "string": "triple_quoted", - "start": [ - 208, - 8 - ], - "end": [ - 208, - 21 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 208, - 21 - ], - "end": [ - 208, - 22 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "NAME", - "string": "add", - "start": [ - 208, - 22 - ], - "end": [ - 208, - 25 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 208, - 25 - ], - "end": [ - 208, - 26 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "NAME", - "string": "u", - "start": [ - 208, - 26 - ], - "end": [ - 208, - 27 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 208, - 27 - ], - "end": [ - 208, - 28 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 208, - 28 - ], - "end": [ - 209, - 0 - ], - "line": " triple_quoted.add(u)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 209, - 0 - ], - "end": [ - 210, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 210, - 0 - ], - "end": [ - 210, - 0 - ], - "line": "tabsize = 8\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 210, - 0 - ], - "end": [ - 210, - 0 - ], - "line": "tabsize = 8\n" - }, - { - "typ": "NAME", - "string": "tabsize", - "start": [ - 210, - 0 - ], - "end": [ - 210, - 7 - ], - "line": "tabsize = 8\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 210, - 8 - ], - "end": [ - 210, - 9 - ], - "line": "tabsize = 8\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 210, - 10 - ], - "end": [ - 210, - 11 - ], - "line": "tabsize = 8\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 210, - 11 - ], - "end": [ - 211, - 0 - ], - "line": "tabsize = 8\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 211, - 0 - ], - "end": [ - 212, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "class", - "start": [ - 212, - 0 - ], - "end": [ - 212, - 5 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "NAME", - "string": "TokenError", - "start": [ - 212, - 6 - ], - "end": [ - 212, - 16 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 212, - 16 - ], - "end": [ - 212, - 17 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "NAME", - "string": "Exception", - "start": [ - 212, - 17 - ], - "end": [ - 212, - 26 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 212, - 26 - ], - "end": [ - 212, - 27 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 212, - 27 - ], - "end": [ - 212, - 28 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "NAME", - "string": "pass", - "start": [ - 212, - 29 - ], - "end": [ - 212, - 33 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 212, - 33 - ], - "end": [ - 213, - 0 - ], - "line": "class TokenError(Exception): pass\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 213, - 0 - ], - "end": [ - 214, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "class", - "start": [ - 214, - 0 - ], - "end": [ - 214, - 5 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "NAME", - "string": "StopTokenizing", - "start": [ - 214, - 6 - ], - "end": [ - 214, - 20 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 214, - 20 - ], - "end": [ - 214, - 21 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "NAME", - "string": "Exception", - "start": [ - 214, - 21 - ], - "end": [ - 214, - 30 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 214, - 30 - ], - "end": [ - 214, - 31 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 214, - 31 - ], - "end": [ - 214, - 32 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "NAME", - "string": "pass", - "start": [ - 214, - 33 - ], - "end": [ - 214, - 37 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 214, - 37 - ], - "end": [ - 215, - 0 - ], - "line": "class StopTokenizing(Exception): pass\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 215, - 0 - ], - "end": [ - 216, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 216, - 0 - ], - "end": [ - 217, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "class", - "start": [ - 217, - 0 - ], - "end": [ - 217, - 5 - ], - "line": "class Untokenizer:\n" - }, - { - "typ": "NAME", - "string": "Untokenizer", - "start": [ - 217, - 6 - ], - "end": [ - 217, - 17 - ], - "line": "class Untokenizer:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 217, - 17 - ], - "end": [ - 217, - 18 - ], - "line": "class Untokenizer:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 217, - 18 - ], - "end": [ - 218, - 0 - ], - "line": "class Untokenizer:\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 218, - 0 - ], - "end": [ - 219, - 0 - ], - "line": "\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 219, - 0 - ], - "end": [ - 219, - 4 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 219, - 4 - ], - "end": [ - 219, - 7 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "NAME", - "string": "__init__", - "start": [ - 219, - 8 - ], - "end": [ - 219, - 16 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 219, - 16 - ], - "end": [ - 219, - 17 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 219, - 17 - ], - "end": [ - 219, - 21 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 219, - 21 - ], - "end": [ - 219, - 22 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 219, - 22 - ], - "end": [ - 219, - 23 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 219, - 23 - ], - "end": [ - 220, - 0 - ], - "line": " def __init__(self):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 220, - 0 - ], - "end": [ - 220, - 8 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 220, - 8 - ], - "end": [ - 220, - 12 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 220, - 12 - ], - "end": [ - 220, - 13 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 220, - 13 - ], - "end": [ - 220, - 19 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 220, - 20 - ], - "end": [ - 220, - 21 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 220, - 22 - ], - "end": [ - 220, - 23 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 220, - 23 - ], - "end": [ - 220, - 24 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 220, - 24 - ], - "end": [ - 221, - 0 - ], - "line": " self.tokens = []\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 221, - 8 - ], - "end": [ - 221, - 12 - ], - "line": " self.prev_row = 1\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 221, - 12 - ], - "end": [ - 221, - 13 - ], - "line": " self.prev_row = 1\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 221, - 13 - ], - "end": [ - 221, - 21 - ], - "line": " self.prev_row = 1\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 221, - 22 - ], - "end": [ - 221, - 23 - ], - "line": " self.prev_row = 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 221, - 24 - ], - "end": [ - 221, - 25 - ], - "line": " self.prev_row = 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 221, - 25 - ], - "end": [ - 222, - 0 - ], - "line": " self.prev_row = 1\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 222, - 8 - ], - "end": [ - 222, - 12 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 222, - 12 - ], - "end": [ - 222, - 13 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 222, - 13 - ], - "end": [ - 222, - 21 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 222, - 22 - ], - "end": [ - 222, - 23 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 222, - 24 - ], - "end": [ - 222, - 25 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 222, - 25 - ], - "end": [ - 223, - 0 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 223, - 8 - ], - "end": [ - 223, - 12 - ], - "line": " self.encoding = None\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 223, - 12 - ], - "end": [ - 223, - 13 - ], - "line": " self.encoding = None\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 223, - 13 - ], - "end": [ - 223, - 21 - ], - "line": " self.encoding = None\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 223, - 22 - ], - "end": [ - 223, - 23 - ], - "line": " self.encoding = None\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 223, - 24 - ], - "end": [ - 223, - 28 - ], - "line": " self.encoding = None\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 223, - 28 - ], - "end": [ - 224, - 0 - ], - "line": " self.encoding = None\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 224, - 0 - ], - "end": [ - 225, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 225, - 4 - ], - "end": [ - 225, - 4 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 225, - 4 - ], - "end": [ - 225, - 7 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "NAME", - "string": "add_whitespace", - "start": [ - 225, - 8 - ], - "end": [ - 225, - 22 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 225, - 22 - ], - "end": [ - 225, - 23 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 225, - 23 - ], - "end": [ - 225, - 27 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 225, - 27 - ], - "end": [ - 225, - 28 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 225, - 29 - ], - "end": [ - 225, - 34 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 225, - 34 - ], - "end": [ - 225, - 35 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 225, - 35 - ], - "end": [ - 225, - 36 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 225, - 36 - ], - "end": [ - 226, - 0 - ], - "line": " def add_whitespace(self, start):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 226, - 0 - ], - "end": [ - 226, - 8 - ], - "line": " row, col = start\n" - }, - { - "typ": "NAME", - "string": "row", - "start": [ - 226, - 8 - ], - "end": [ - 226, - 11 - ], - "line": " row, col = start\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 226, - 11 - ], - "end": [ - 226, - 12 - ], - "line": " row, col = start\n" - }, - { - "typ": "NAME", - "string": "col", - "start": [ - 226, - 13 - ], - "end": [ - 226, - 16 - ], - "line": " row, col = start\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 226, - 17 - ], - "end": [ - 226, - 18 - ], - "line": " row, col = start\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 226, - 19 - ], - "end": [ - 226, - 24 - ], - "line": " row, col = start\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 226, - 24 - ], - "end": [ - 227, - 0 - ], - "line": " row, col = start\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 227, - 8 - ], - "end": [ - 227, - 10 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "row", - "start": [ - 227, - 11 - ], - "end": [ - 227, - 14 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "OP", - "string": "<", - "start": [ - 227, - 15 - ], - "end": [ - 227, - 16 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 227, - 17 - ], - "end": [ - 227, - 21 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 227, - 21 - ], - "end": [ - 227, - 22 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 227, - 22 - ], - "end": [ - 227, - 30 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 227, - 31 - ], - "end": [ - 227, - 33 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "row", - "start": [ - 227, - 34 - ], - "end": [ - 227, - 37 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 227, - 38 - ], - "end": [ - 227, - 40 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 227, - 41 - ], - "end": [ - 227, - 45 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 227, - 45 - ], - "end": [ - 227, - 46 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 227, - 46 - ], - "end": [ - 227, - 54 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 227, - 55 - ], - "end": [ - 227, - 58 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "col", - "start": [ - 227, - 59 - ], - "end": [ - 227, - 62 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "OP", - "string": "<", - "start": [ - 227, - 63 - ], - "end": [ - 227, - 64 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 227, - 65 - ], - "end": [ - 227, - 69 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 227, - 69 - ], - "end": [ - 227, - 70 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 227, - 70 - ], - "end": [ - 227, - 78 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 227, - 78 - ], - "end": [ - 227, - 79 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 227, - 79 - ], - "end": [ - 228, - 0 - ], - "line": " if row < self.prev_row or row == self.prev_row and col < self.prev_col:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 228, - 0 - ], - "end": [ - 228, - 12 - ], - "line": " raise ValueError(\"start ({},{}) precedes previous end ({},{})\"\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 228, - 12 - ], - "end": [ - 228, - 17 - ], - "line": " raise ValueError(\"start ({},{}) precedes previous end ({},{})\"\n" - }, - { - "typ": "NAME", - "string": "ValueError", - "start": [ - 228, - 18 - ], - "end": [ - 228, - 28 - ], - "line": " raise ValueError(\"start ({},{}) precedes previous end ({},{})\"\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 228, - 28 - ], - "end": [ - 228, - 29 - ], - "line": " raise ValueError(\"start ({},{}) precedes previous end ({},{})\"\n" - }, - { - "typ": "STRING", - "string": "\"start ({},{}) precedes previous end ({},{})\"", - "start": [ - 228, - 29 - ], - "end": [ - 228, - 74 - ], - "line": " raise ValueError(\"start ({},{}) precedes previous end ({},{})\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 228, - 74 - ], - "end": [ - 229, - 0 - ], - "line": " raise ValueError(\"start ({},{}) precedes previous end ({},{})\"\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 229, - 29 - ], - "end": [ - 229, - 30 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NAME", - "string": "format", - "start": [ - 229, - 30 - ], - "end": [ - 229, - 36 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 229, - 36 - ], - "end": [ - 229, - 37 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NAME", - "string": "row", - "start": [ - 229, - 37 - ], - "end": [ - 229, - 40 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 229, - 40 - ], - "end": [ - 229, - 41 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NAME", - "string": "col", - "start": [ - 229, - 42 - ], - "end": [ - 229, - 45 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 229, - 45 - ], - "end": [ - 229, - 46 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 229, - 47 - ], - "end": [ - 229, - 51 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 229, - 51 - ], - "end": [ - 229, - 52 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 229, - 52 - ], - "end": [ - 229, - 60 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 229, - 60 - ], - "end": [ - 229, - 61 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 229, - 62 - ], - "end": [ - 229, - 66 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 229, - 66 - ], - "end": [ - 229, - 67 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 229, - 67 - ], - "end": [ - 229, - 75 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 229, - 75 - ], - "end": [ - 229, - 76 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 229, - 76 - ], - "end": [ - 229, - 77 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 229, - 77 - ], - "end": [ - 230, - 0 - ], - "line": " .format(row, col, self.prev_row, self.prev_col))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 230, - 8 - ], - "end": [ - 230, - 8 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "NAME", - "string": "row_offset", - "start": [ - 230, - 8 - ], - "end": [ - 230, - 18 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 230, - 19 - ], - "end": [ - 230, - 20 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "NAME", - "string": "row", - "start": [ - 230, - 21 - ], - "end": [ - 230, - 24 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 230, - 25 - ], - "end": [ - 230, - 26 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 230, - 27 - ], - "end": [ - 230, - 31 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 230, - 31 - ], - "end": [ - 230, - 32 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 230, - 32 - ], - "end": [ - 230, - 40 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 230, - 40 - ], - "end": [ - 231, - 0 - ], - "line": " row_offset = row - self.prev_row\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 231, - 8 - ], - "end": [ - 231, - 10 - ], - "line": " if row_offset:\n" - }, - { - "typ": "NAME", - "string": "row_offset", - "start": [ - 231, - 11 - ], - "end": [ - 231, - 21 - ], - "line": " if row_offset:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 231, - 21 - ], - "end": [ - 231, - 22 - ], - "line": " if row_offset:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 231, - 22 - ], - "end": [ - 232, - 0 - ], - "line": " if row_offset:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 232, - 0 - ], - "end": [ - 232, - 12 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 232, - 12 - ], - "end": [ - 232, - 16 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 232, - 16 - ], - "end": [ - 232, - 17 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 232, - 17 - ], - "end": [ - 232, - 23 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 232, - 23 - ], - "end": [ - 232, - 24 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 232, - 24 - ], - "end": [ - 232, - 30 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 232, - 30 - ], - "end": [ - 232, - 31 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "STRING", - "string": "\"\\\\\\n\"", - "start": [ - 232, - 31 - ], - "end": [ - 232, - 37 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 232, - 38 - ], - "end": [ - 232, - 39 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "NAME", - "string": "row_offset", - "start": [ - 232, - 40 - ], - "end": [ - 232, - 50 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 232, - 50 - ], - "end": [ - 232, - 51 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 232, - 51 - ], - "end": [ - 233, - 0 - ], - "line": " self.tokens.append(\"\\\\\\n\" * row_offset)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 233, - 12 - ], - "end": [ - 233, - 16 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 233, - 16 - ], - "end": [ - 233, - 17 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 233, - 17 - ], - "end": [ - 233, - 25 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 233, - 26 - ], - "end": [ - 233, - 27 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 233, - 28 - ], - "end": [ - 233, - 29 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 233, - 29 - ], - "end": [ - 234, - 0 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 234, - 8 - ], - "end": [ - 234, - 8 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "NAME", - "string": "col_offset", - "start": [ - 234, - 8 - ], - "end": [ - 234, - 18 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 234, - 19 - ], - "end": [ - 234, - 20 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "NAME", - "string": "col", - "start": [ - 234, - 21 - ], - "end": [ - 234, - 24 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 234, - 25 - ], - "end": [ - 234, - 26 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 234, - 27 - ], - "end": [ - 234, - 31 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 234, - 31 - ], - "end": [ - 234, - 32 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 234, - 32 - ], - "end": [ - 234, - 40 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 234, - 40 - ], - "end": [ - 235, - 0 - ], - "line": " col_offset = col - self.prev_col\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 235, - 8 - ], - "end": [ - 235, - 10 - ], - "line": " if col_offset:\n" - }, - { - "typ": "NAME", - "string": "col_offset", - "start": [ - 235, - 11 - ], - "end": [ - 235, - 21 - ], - "line": " if col_offset:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 235, - 21 - ], - "end": [ - 235, - 22 - ], - "line": " if col_offset:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 235, - 22 - ], - "end": [ - 236, - 0 - ], - "line": " if col_offset:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 236, - 0 - ], - "end": [ - 236, - 12 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 236, - 12 - ], - "end": [ - 236, - 16 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 236, - 16 - ], - "end": [ - 236, - 17 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 236, - 17 - ], - "end": [ - 236, - 23 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 236, - 23 - ], - "end": [ - 236, - 24 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 236, - 24 - ], - "end": [ - 236, - 30 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 236, - 30 - ], - "end": [ - 236, - 31 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "STRING", - "string": "\" \"", - "start": [ - 236, - 31 - ], - "end": [ - 236, - 34 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 236, - 35 - ], - "end": [ - 236, - 36 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "NAME", - "string": "col_offset", - "start": [ - 236, - 37 - ], - "end": [ - 236, - 47 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 236, - 47 - ], - "end": [ - 236, - 48 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 236, - 48 - ], - "end": [ - 237, - 0 - ], - "line": " self.tokens.append(\" \" * col_offset)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 237, - 0 - ], - "end": [ - 238, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 238, - 4 - ], - "end": [ - 238, - 4 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 238, - 4 - ], - "end": [ - 238, - 4 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 238, - 4 - ], - "end": [ - 238, - 7 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "NAME", - "string": "untokenize", - "start": [ - 238, - 8 - ], - "end": [ - 238, - 18 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 238, - 18 - ], - "end": [ - 238, - 19 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 238, - 19 - ], - "end": [ - 238, - 23 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 238, - 23 - ], - "end": [ - 238, - 24 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "NAME", - "string": "iterable", - "start": [ - 238, - 25 - ], - "end": [ - 238, - 33 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 238, - 33 - ], - "end": [ - 238, - 34 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 238, - 34 - ], - "end": [ - 238, - 35 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 238, - 35 - ], - "end": [ - 239, - 0 - ], - "line": " def untokenize(self, iterable):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 239, - 0 - ], - "end": [ - 239, - 8 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "NAME", - "string": "it", - "start": [ - 239, - 8 - ], - "end": [ - 239, - 10 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 239, - 11 - ], - "end": [ - 239, - 12 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "NAME", - "string": "iter", - "start": [ - 239, - 13 - ], - "end": [ - 239, - 17 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 239, - 17 - ], - "end": [ - 239, - 18 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "NAME", - "string": "iterable", - "start": [ - 239, - 18 - ], - "end": [ - 239, - 26 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 239, - 26 - ], - "end": [ - 239, - 27 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 239, - 27 - ], - "end": [ - 240, - 0 - ], - "line": " it = iter(iterable)\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 240, - 8 - ], - "end": [ - 240, - 15 - ], - "line": " indents = []\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 240, - 16 - ], - "end": [ - 240, - 17 - ], - "line": " indents = []\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 240, - 18 - ], - "end": [ - 240, - 19 - ], - "line": " indents = []\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 240, - 19 - ], - "end": [ - 240, - 20 - ], - "line": " indents = []\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 240, - 20 - ], - "end": [ - 241, - 0 - ], - "line": " indents = []\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 241, - 8 - ], - "end": [ - 241, - 17 - ], - "line": " startline = False\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 241, - 18 - ], - "end": [ - 241, - 19 - ], - "line": " startline = False\n" - }, - { - "typ": "NAME", - "string": "False", - "start": [ - 241, - 20 - ], - "end": [ - 241, - 25 - ], - "line": " startline = False\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 241, - 25 - ], - "end": [ - 242, - 0 - ], - "line": " startline = False\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 242, - 8 - ], - "end": [ - 242, - 11 - ], - "line": " for t in it:\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 242, - 12 - ], - "end": [ - 242, - 13 - ], - "line": " for t in it:\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 242, - 14 - ], - "end": [ - 242, - 16 - ], - "line": " for t in it:\n" - }, - { - "typ": "NAME", - "string": "it", - "start": [ - 242, - 17 - ], - "end": [ - 242, - 19 - ], - "line": " for t in it:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 242, - 19 - ], - "end": [ - 242, - 20 - ], - "line": " for t in it:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 242, - 20 - ], - "end": [ - 243, - 0 - ], - "line": " for t in it:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 243, - 0 - ], - "end": [ - 243, - 12 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 243, - 12 - ], - "end": [ - 243, - 14 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 243, - 15 - ], - "end": [ - 243, - 18 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 243, - 18 - ], - "end": [ - 243, - 19 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 243, - 19 - ], - "end": [ - 243, - 20 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 243, - 20 - ], - "end": [ - 243, - 21 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 243, - 22 - ], - "end": [ - 243, - 24 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "NUMBER", - "string": "2", - "start": [ - 243, - 25 - ], - "end": [ - 243, - 26 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 243, - 26 - ], - "end": [ - 243, - 27 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 243, - 27 - ], - "end": [ - 244, - 0 - ], - "line": " if len(t) == 2:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 244, - 0 - ], - "end": [ - 244, - 16 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 244, - 16 - ], - "end": [ - 244, - 20 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 244, - 20 - ], - "end": [ - 244, - 21 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "NAME", - "string": "compat", - "start": [ - 244, - 21 - ], - "end": [ - 244, - 27 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 244, - 27 - ], - "end": [ - 244, - 28 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 244, - 28 - ], - "end": [ - 244, - 29 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 244, - 29 - ], - "end": [ - 244, - 30 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "NAME", - "string": "it", - "start": [ - 244, - 31 - ], - "end": [ - 244, - 33 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 244, - 33 - ], - "end": [ - 244, - 34 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 244, - 34 - ], - "end": [ - 245, - 0 - ], - "line": " self.compat(t, it)\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 245, - 16 - ], - "end": [ - 245, - 21 - ], - "line": " break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 245, - 21 - ], - "end": [ - 246, - 0 - ], - "line": " break\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 246, - 12 - ], - "end": [ - 246, - 12 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NAME", - "string": "tok_type", - "start": [ - 246, - 12 - ], - "end": [ - 246, - 20 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 246, - 20 - ], - "end": [ - 246, - 21 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 246, - 22 - ], - "end": [ - 246, - 27 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 246, - 27 - ], - "end": [ - 246, - 28 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 246, - 29 - ], - "end": [ - 246, - 34 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 246, - 34 - ], - "end": [ - 246, - 35 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 246, - 36 - ], - "end": [ - 246, - 39 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 246, - 39 - ], - "end": [ - 246, - 40 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 246, - 41 - ], - "end": [ - 246, - 45 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 246, - 46 - ], - "end": [ - 246, - 47 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NAME", - "string": "t", - "start": [ - 246, - 48 - ], - "end": [ - 246, - 49 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 246, - 49 - ], - "end": [ - 247, - 0 - ], - "line": " tok_type, token, start, end, line = t\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 247, - 12 - ], - "end": [ - 247, - 14 - ], - "line": " if tok_type == ENCODING:\n" - }, - { - "typ": "NAME", - "string": "tok_type", - "start": [ - 247, - 15 - ], - "end": [ - 247, - 23 - ], - "line": " if tok_type == ENCODING:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 247, - 24 - ], - "end": [ - 247, - 26 - ], - "line": " if tok_type == ENCODING:\n" - }, - { - "typ": "NAME", - "string": "ENCODING", - "start": [ - 247, - 27 - ], - "end": [ - 247, - 35 - ], - "line": " if tok_type == ENCODING:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 247, - 35 - ], - "end": [ - 247, - 36 - ], - "line": " if tok_type == ENCODING:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 247, - 36 - ], - "end": [ - 248, - 0 - ], - "line": " if tok_type == ENCODING:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 248, - 0 - ], - "end": [ - 248, - 16 - ], - "line": " self.encoding = token\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 248, - 16 - ], - "end": [ - 248, - 20 - ], - "line": " self.encoding = token\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 248, - 20 - ], - "end": [ - 248, - 21 - ], - "line": " self.encoding = token\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 248, - 21 - ], - "end": [ - 248, - 29 - ], - "line": " self.encoding = token\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 248, - 30 - ], - "end": [ - 248, - 31 - ], - "line": " self.encoding = token\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 248, - 32 - ], - "end": [ - 248, - 37 - ], - "line": " self.encoding = token\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 248, - 37 - ], - "end": [ - 249, - 0 - ], - "line": " self.encoding = token\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 249, - 16 - ], - "end": [ - 249, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 249, - 24 - ], - "end": [ - 250, - 0 - ], - "line": " continue\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 250, - 12 - ], - "end": [ - 250, - 12 - ], - "line": " if tok_type == ENDMARKER:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 250, - 12 - ], - "end": [ - 250, - 14 - ], - "line": " if tok_type == ENDMARKER:\n" - }, - { - "typ": "NAME", - "string": "tok_type", - "start": [ - 250, - 15 - ], - "end": [ - 250, - 23 - ], - "line": " if tok_type == ENDMARKER:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 250, - 24 - ], - "end": [ - 250, - 26 - ], - "line": " if tok_type == ENDMARKER:\n" - }, - { - "typ": "NAME", - "string": "ENDMARKER", - "start": [ - 250, - 27 - ], - "end": [ - 250, - 36 - ], - "line": " if tok_type == ENDMARKER:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 250, - 36 - ], - "end": [ - 250, - 37 - ], - "line": " if tok_type == ENDMARKER:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 250, - 37 - ], - "end": [ - 251, - 0 - ], - "line": " if tok_type == ENDMARKER:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 251, - 0 - ], - "end": [ - 251, - 16 - ], - "line": " break\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 251, - 16 - ], - "end": [ - 251, - 21 - ], - "line": " break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 251, - 21 - ], - "end": [ - 252, - 0 - ], - "line": " break\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 252, - 12 - ], - "end": [ - 252, - 12 - ], - "line": " if tok_type == INDENT:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 252, - 12 - ], - "end": [ - 252, - 14 - ], - "line": " if tok_type == INDENT:\n" - }, - { - "typ": "NAME", - "string": "tok_type", - "start": [ - 252, - 15 - ], - "end": [ - 252, - 23 - ], - "line": " if tok_type == INDENT:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 252, - 24 - ], - "end": [ - 252, - 26 - ], - "line": " if tok_type == INDENT:\n" - }, - { - "typ": "NAME", - "string": "INDENT", - "start": [ - 252, - 27 - ], - "end": [ - 252, - 33 - ], - "line": " if tok_type == INDENT:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 252, - 33 - ], - "end": [ - 252, - 34 - ], - "line": " if tok_type == INDENT:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 252, - 34 - ], - "end": [ - 253, - 0 - ], - "line": " if tok_type == INDENT:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 253, - 0 - ], - "end": [ - 253, - 16 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 253, - 16 - ], - "end": [ - 253, - 23 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 253, - 23 - ], - "end": [ - 253, - 24 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 253, - 24 - ], - "end": [ - 253, - 30 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 253, - 30 - ], - "end": [ - 253, - 31 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 253, - 31 - ], - "end": [ - 253, - 36 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 253, - 36 - ], - "end": [ - 253, - 37 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 253, - 37 - ], - "end": [ - 254, - 0 - ], - "line": " indents.append(token)\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 254, - 16 - ], - "end": [ - 254, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 254, - 24 - ], - "end": [ - 255, - 0 - ], - "line": " continue\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 255, - 12 - ], - "end": [ - 255, - 12 - ], - "line": " elif tok_type == DEDENT:\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 255, - 12 - ], - "end": [ - 255, - 16 - ], - "line": " elif tok_type == DEDENT:\n" - }, - { - "typ": "NAME", - "string": "tok_type", - "start": [ - 255, - 17 - ], - "end": [ - 255, - 25 - ], - "line": " elif tok_type == DEDENT:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 255, - 26 - ], - "end": [ - 255, - 28 - ], - "line": " elif tok_type == DEDENT:\n" - }, - { - "typ": "NAME", - "string": "DEDENT", - "start": [ - 255, - 29 - ], - "end": [ - 255, - 35 - ], - "line": " elif tok_type == DEDENT:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 255, - 35 - ], - "end": [ - 255, - 36 - ], - "line": " elif tok_type == DEDENT:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 255, - 36 - ], - "end": [ - 256, - 0 - ], - "line": " elif tok_type == DEDENT:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 256, - 0 - ], - "end": [ - 256, - 16 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 256, - 16 - ], - "end": [ - 256, - 23 - ], - "line": " indents.pop()\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 256, - 23 - ], - "end": [ - 256, - 24 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NAME", - "string": "pop", - "start": [ - 256, - 24 - ], - "end": [ - 256, - 27 - ], - "line": " indents.pop()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 256, - 27 - ], - "end": [ - 256, - 28 - ], - "line": " indents.pop()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 256, - 28 - ], - "end": [ - 256, - 29 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 256, - 29 - ], - "end": [ - 257, - 0 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 257, - 16 - ], - "end": [ - 257, - 20 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 257, - 20 - ], - "end": [ - 257, - 21 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 257, - 21 - ], - "end": [ - 257, - 29 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 257, - 29 - ], - "end": [ - 257, - 30 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 257, - 31 - ], - "end": [ - 257, - 35 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 257, - 35 - ], - "end": [ - 257, - 36 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 257, - 36 - ], - "end": [ - 257, - 44 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 257, - 45 - ], - "end": [ - 257, - 46 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 257, - 47 - ], - "end": [ - 257, - 50 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 257, - 50 - ], - "end": [ - 258, - 0 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 258, - 16 - ], - "end": [ - 258, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 258, - 24 - ], - "end": [ - 259, - 0 - ], - "line": " continue\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 259, - 12 - ], - "end": [ - 259, - 12 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 259, - 12 - ], - "end": [ - 259, - 16 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "tok_type", - "start": [ - 259, - 17 - ], - "end": [ - 259, - 25 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 259, - 26 - ], - "end": [ - 259, - 28 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 259, - 29 - ], - "end": [ - 259, - 30 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "NEWLINE", - "start": [ - 259, - 30 - ], - "end": [ - 259, - 37 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 259, - 37 - ], - "end": [ - 259, - 38 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "NL", - "start": [ - 259, - 39 - ], - "end": [ - 259, - 41 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 259, - 41 - ], - "end": [ - 259, - 42 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 259, - 42 - ], - "end": [ - 259, - 43 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 259, - 43 - ], - "end": [ - 260, - 0 - ], - "line": " elif tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 260, - 0 - ], - "end": [ - 260, - 16 - ], - "line": " startline = True\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 260, - 16 - ], - "end": [ - 260, - 25 - ], - "line": " startline = True\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 260, - 26 - ], - "end": [ - 260, - 27 - ], - "line": " startline = True\n" - }, - { - "typ": "NAME", - "string": "True", - "start": [ - 260, - 28 - ], - "end": [ - 260, - 32 - ], - "line": " startline = True\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 260, - 32 - ], - "end": [ - 261, - 0 - ], - "line": " startline = True\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 261, - 12 - ], - "end": [ - 261, - 12 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 261, - 12 - ], - "end": [ - 261, - 16 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 261, - 17 - ], - "end": [ - 261, - 26 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 261, - 27 - ], - "end": [ - 261, - 30 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 261, - 31 - ], - "end": [ - 261, - 38 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 261, - 38 - ], - "end": [ - 261, - 39 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 261, - 39 - ], - "end": [ - 262, - 0 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 262, - 0 - ], - "end": [ - 262, - 16 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "NAME", - "string": "indent", - "start": [ - 262, - 16 - ], - "end": [ - 262, - 22 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 262, - 23 - ], - "end": [ - 262, - 24 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 262, - 25 - ], - "end": [ - 262, - 32 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 262, - 32 - ], - "end": [ - 262, - 33 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 262, - 33 - ], - "end": [ - 262, - 34 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 262, - 34 - ], - "end": [ - 262, - 35 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 262, - 35 - ], - "end": [ - 262, - 36 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 262, - 36 - ], - "end": [ - 263, - 0 - ], - "line": " indent = indents[-1]\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 263, - 16 - ], - "end": [ - 263, - 18 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 263, - 19 - ], - "end": [ - 263, - 24 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 263, - 24 - ], - "end": [ - 263, - 25 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 263, - 25 - ], - "end": [ - 263, - 26 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 263, - 26 - ], - "end": [ - 263, - 27 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "OP", - "string": ">=", - "start": [ - 263, - 28 - ], - "end": [ - 263, - 30 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 263, - 31 - ], - "end": [ - 263, - 34 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 263, - 34 - ], - "end": [ - 263, - 35 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "NAME", - "string": "indent", - "start": [ - 263, - 35 - ], - "end": [ - 263, - 41 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 263, - 41 - ], - "end": [ - 263, - 42 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 263, - 42 - ], - "end": [ - 263, - 43 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 263, - 43 - ], - "end": [ - 264, - 0 - ], - "line": " if start[1] >= len(indent):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 264, - 0 - ], - "end": [ - 264, - 20 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 264, - 20 - ], - "end": [ - 264, - 24 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 264, - 24 - ], - "end": [ - 264, - 25 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 264, - 25 - ], - "end": [ - 264, - 31 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 264, - 31 - ], - "end": [ - 264, - 32 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 264, - 32 - ], - "end": [ - 264, - 38 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 264, - 38 - ], - "end": [ - 264, - 39 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "NAME", - "string": "indent", - "start": [ - 264, - 39 - ], - "end": [ - 264, - 45 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 264, - 45 - ], - "end": [ - 264, - 46 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 264, - 46 - ], - "end": [ - 265, - 0 - ], - "line": " self.tokens.append(indent)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 265, - 20 - ], - "end": [ - 265, - 24 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 265, - 24 - ], - "end": [ - 265, - 25 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 265, - 25 - ], - "end": [ - 265, - 33 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 265, - 34 - ], - "end": [ - 265, - 35 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 265, - 36 - ], - "end": [ - 265, - 39 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 265, - 39 - ], - "end": [ - 265, - 40 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "NAME", - "string": "indent", - "start": [ - 265, - 40 - ], - "end": [ - 265, - 46 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 265, - 46 - ], - "end": [ - 265, - 47 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 265, - 47 - ], - "end": [ - 266, - 0 - ], - "line": " self.prev_col = len(indent)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 266, - 16 - ], - "end": [ - 266, - 16 - ], - "line": " startline = False\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 266, - 16 - ], - "end": [ - 266, - 25 - ], - "line": " startline = False\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 266, - 26 - ], - "end": [ - 266, - 27 - ], - "line": " startline = False\n" - }, - { - "typ": "NAME", - "string": "False", - "start": [ - 266, - 28 - ], - "end": [ - 266, - 33 - ], - "line": " startline = False\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 266, - 33 - ], - "end": [ - 267, - 0 - ], - "line": " startline = False\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 267, - 12 - ], - "end": [ - 267, - 12 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 267, - 12 - ], - "end": [ - 267, - 16 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 267, - 16 - ], - "end": [ - 267, - 17 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "NAME", - "string": "add_whitespace", - "start": [ - 267, - 17 - ], - "end": [ - 267, - 31 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 267, - 31 - ], - "end": [ - 267, - 32 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 267, - 32 - ], - "end": [ - 267, - 37 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 267, - 37 - ], - "end": [ - 267, - 38 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 267, - 38 - ], - "end": [ - 268, - 0 - ], - "line": " self.add_whitespace(start)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 268, - 12 - ], - "end": [ - 268, - 16 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 268, - 16 - ], - "end": [ - 268, - 17 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 268, - 17 - ], - "end": [ - 268, - 23 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 268, - 23 - ], - "end": [ - 268, - 24 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 268, - 24 - ], - "end": [ - 268, - 30 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 268, - 30 - ], - "end": [ - 268, - 31 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 268, - 31 - ], - "end": [ - 268, - 36 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 268, - 36 - ], - "end": [ - 268, - 37 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 268, - 37 - ], - "end": [ - 269, - 0 - ], - "line": " self.tokens.append(token)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 269, - 12 - ], - "end": [ - 269, - 16 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 269, - 16 - ], - "end": [ - 269, - 17 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 269, - 17 - ], - "end": [ - 269, - 25 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 269, - 25 - ], - "end": [ - 269, - 26 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 269, - 27 - ], - "end": [ - 269, - 31 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 269, - 31 - ], - "end": [ - 269, - 32 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 269, - 32 - ], - "end": [ - 269, - 40 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 269, - 41 - ], - "end": [ - 269, - 42 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 269, - 43 - ], - "end": [ - 269, - 46 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 269, - 46 - ], - "end": [ - 270, - 0 - ], - "line": " self.prev_row, self.prev_col = end\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 270, - 12 - ], - "end": [ - 270, - 14 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "tok_type", - "start": [ - 270, - 15 - ], - "end": [ - 270, - 23 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 270, - 24 - ], - "end": [ - 270, - 26 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 270, - 27 - ], - "end": [ - 270, - 28 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "NEWLINE", - "start": [ - 270, - 28 - ], - "end": [ - 270, - 35 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 270, - 35 - ], - "end": [ - 270, - 36 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "NL", - "start": [ - 270, - 37 - ], - "end": [ - 270, - 39 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 270, - 39 - ], - "end": [ - 270, - 40 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 270, - 40 - ], - "end": [ - 270, - 41 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 270, - 41 - ], - "end": [ - 271, - 0 - ], - "line": " if tok_type in (NEWLINE, NL):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 271, - 0 - ], - "end": [ - 271, - 16 - ], - "line": " self.prev_row += 1\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 271, - 16 - ], - "end": [ - 271, - 20 - ], - "line": " self.prev_row += 1\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 271, - 20 - ], - "end": [ - 271, - 21 - ], - "line": " self.prev_row += 1\n" - }, - { - "typ": "NAME", - "string": "prev_row", - "start": [ - 271, - 21 - ], - "end": [ - 271, - 29 - ], - "line": " self.prev_row += 1\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 271, - 30 - ], - "end": [ - 271, - 32 - ], - "line": " self.prev_row += 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 271, - 33 - ], - "end": [ - 271, - 34 - ], - "line": " self.prev_row += 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 271, - 34 - ], - "end": [ - 272, - 0 - ], - "line": " self.prev_row += 1\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 272, - 16 - ], - "end": [ - 272, - 20 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 272, - 20 - ], - "end": [ - 272, - 21 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NAME", - "string": "prev_col", - "start": [ - 272, - 21 - ], - "end": [ - 272, - 29 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 272, - 30 - ], - "end": [ - 272, - 31 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 272, - 32 - ], - "end": [ - 272, - 33 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 272, - 33 - ], - "end": [ - 273, - 0 - ], - "line": " self.prev_col = 0\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 273, - 8 - ], - "end": [ - 273, - 8 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 273, - 8 - ], - "end": [ - 273, - 8 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 273, - 8 - ], - "end": [ - 273, - 14 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "STRING", - "string": "\"\"", - "start": [ - 273, - 15 - ], - "end": [ - 273, - 17 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 273, - 17 - ], - "end": [ - 273, - 18 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "NAME", - "string": "join", - "start": [ - 273, - 18 - ], - "end": [ - 273, - 22 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 273, - 22 - ], - "end": [ - 273, - 23 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 273, - 23 - ], - "end": [ - 273, - 27 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 273, - 27 - ], - "end": [ - 273, - 28 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 273, - 28 - ], - "end": [ - 273, - 34 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 273, - 34 - ], - "end": [ - 273, - 35 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 273, - 35 - ], - "end": [ - 274, - 0 - ], - "line": " return \"\".join(self.tokens)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 274, - 0 - ], - "end": [ - 275, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 275, - 4 - ], - "end": [ - 275, - 4 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 275, - 4 - ], - "end": [ - 275, - 7 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "NAME", - "string": "compat", - "start": [ - 275, - 8 - ], - "end": [ - 275, - 14 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 275, - 14 - ], - "end": [ - 275, - 15 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 275, - 15 - ], - "end": [ - 275, - 19 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 275, - 19 - ], - "end": [ - 275, - 20 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 275, - 21 - ], - "end": [ - 275, - 26 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 275, - 26 - ], - "end": [ - 275, - 27 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "NAME", - "string": "iterable", - "start": [ - 275, - 28 - ], - "end": [ - 275, - 36 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 275, - 36 - ], - "end": [ - 275, - 37 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 275, - 37 - ], - "end": [ - 275, - 38 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 275, - 38 - ], - "end": [ - 276, - 0 - ], - "line": " def compat(self, token, iterable):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 276, - 0 - ], - "end": [ - 276, - 8 - ], - "line": " indents = []\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 276, - 8 - ], - "end": [ - 276, - 15 - ], - "line": " indents = []\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 276, - 16 - ], - "end": [ - 276, - 17 - ], - "line": " indents = []\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 276, - 18 - ], - "end": [ - 276, - 19 - ], - "line": " indents = []\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 276, - 19 - ], - "end": [ - 276, - 20 - ], - "line": " indents = []\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 276, - 20 - ], - "end": [ - 277, - 0 - ], - "line": " indents = []\n" - }, - { - "typ": "NAME", - "string": "toks_append", - "start": [ - 277, - 8 - ], - "end": [ - 277, - 19 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 277, - 20 - ], - "end": [ - 277, - 21 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 277, - 22 - ], - "end": [ - 277, - 26 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 277, - 26 - ], - "end": [ - 277, - 27 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 277, - 27 - ], - "end": [ - 277, - 33 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 277, - 33 - ], - "end": [ - 277, - 34 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 277, - 34 - ], - "end": [ - 277, - 40 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 277, - 40 - ], - "end": [ - 278, - 0 - ], - "line": " toks_append = self.tokens.append\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 278, - 8 - ], - "end": [ - 278, - 17 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 278, - 18 - ], - "end": [ - 278, - 19 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 278, - 20 - ], - "end": [ - 278, - 25 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 278, - 25 - ], - "end": [ - 278, - 26 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 278, - 26 - ], - "end": [ - 278, - 27 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 278, - 27 - ], - "end": [ - 278, - 28 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 278, - 29 - ], - "end": [ - 278, - 31 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 278, - 32 - ], - "end": [ - 278, - 33 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "NAME", - "string": "NEWLINE", - "start": [ - 278, - 33 - ], - "end": [ - 278, - 40 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 278, - 40 - ], - "end": [ - 278, - 41 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "NAME", - "string": "NL", - "start": [ - 278, - 42 - ], - "end": [ - 278, - 44 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 278, - 44 - ], - "end": [ - 278, - 45 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 278, - 45 - ], - "end": [ - 279, - 0 - ], - "line": " startline = token[0] in (NEWLINE, NL)\n" - }, - { - "typ": "NAME", - "string": "prevstring", - "start": [ - 279, - 8 - ], - "end": [ - 279, - 18 - ], - "line": " prevstring = False\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 279, - 19 - ], - "end": [ - 279, - 20 - ], - "line": " prevstring = False\n" - }, - { - "typ": "NAME", - "string": "False", - "start": [ - 279, - 21 - ], - "end": [ - 279, - 26 - ], - "line": " prevstring = False\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 279, - 26 - ], - "end": [ - 280, - 0 - ], - "line": " prevstring = False\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 280, - 0 - ], - "end": [ - 281, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 281, - 8 - ], - "end": [ - 281, - 11 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "NAME", - "string": "tok", - "start": [ - 281, - 12 - ], - "end": [ - 281, - 15 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 281, - 16 - ], - "end": [ - 281, - 18 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "NAME", - "string": "chain", - "start": [ - 281, - 19 - ], - "end": [ - 281, - 24 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 281, - 24 - ], - "end": [ - 281, - 25 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 281, - 25 - ], - "end": [ - 281, - 26 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 281, - 26 - ], - "end": [ - 281, - 31 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 281, - 31 - ], - "end": [ - 281, - 32 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 281, - 32 - ], - "end": [ - 281, - 33 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "NAME", - "string": "iterable", - "start": [ - 281, - 34 - ], - "end": [ - 281, - 42 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 281, - 42 - ], - "end": [ - 281, - 43 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 281, - 43 - ], - "end": [ - 281, - 44 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 281, - 44 - ], - "end": [ - 282, - 0 - ], - "line": " for tok in chain([token], iterable):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 282, - 0 - ], - "end": [ - 282, - 12 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "NAME", - "string": "toknum", - "start": [ - 282, - 12 - ], - "end": [ - 282, - 18 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 282, - 18 - ], - "end": [ - 282, - 19 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "NAME", - "string": "tokval", - "start": [ - 282, - 20 - ], - "end": [ - 282, - 26 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 282, - 27 - ], - "end": [ - 282, - 28 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "NAME", - "string": "tok", - "start": [ - 282, - 29 - ], - "end": [ - 282, - 32 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 282, - 32 - ], - "end": [ - 282, - 33 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 282, - 33 - ], - "end": [ - 282, - 34 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "NUMBER", - "string": "2", - "start": [ - 282, - 34 - ], - "end": [ - 282, - 35 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 282, - 35 - ], - "end": [ - 282, - 36 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 282, - 36 - ], - "end": [ - 283, - 0 - ], - "line": " toknum, tokval = tok[:2]\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 283, - 12 - ], - "end": [ - 283, - 14 - ], - "line": " if toknum == ENCODING:\n" - }, - { - "typ": "NAME", - "string": "toknum", - "start": [ - 283, - 15 - ], - "end": [ - 283, - 21 - ], - "line": " if toknum == ENCODING:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 283, - 22 - ], - "end": [ - 283, - 24 - ], - "line": " if toknum == ENCODING:\n" - }, - { - "typ": "NAME", - "string": "ENCODING", - "start": [ - 283, - 25 - ], - "end": [ - 283, - 33 - ], - "line": " if toknum == ENCODING:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 283, - 33 - ], - "end": [ - 283, - 34 - ], - "line": " if toknum == ENCODING:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 283, - 34 - ], - "end": [ - 284, - 0 - ], - "line": " if toknum == ENCODING:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 284, - 0 - ], - "end": [ - 284, - 16 - ], - "line": " self.encoding = tokval\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 284, - 16 - ], - "end": [ - 284, - 20 - ], - "line": " self.encoding = tokval\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 284, - 20 - ], - "end": [ - 284, - 21 - ], - "line": " self.encoding = tokval\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 284, - 21 - ], - "end": [ - 284, - 29 - ], - "line": " self.encoding = tokval\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 284, - 30 - ], - "end": [ - 284, - 31 - ], - "line": " self.encoding = tokval\n" - }, - { - "typ": "NAME", - "string": "tokval", - "start": [ - 284, - 32 - ], - "end": [ - 284, - 38 - ], - "line": " self.encoding = tokval\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 284, - 38 - ], - "end": [ - 285, - 0 - ], - "line": " self.encoding = tokval\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 285, - 16 - ], - "end": [ - 285, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 285, - 24 - ], - "end": [ - 286, - 0 - ], - "line": " continue\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 286, - 0 - ], - "end": [ - 287, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 287, - 12 - ], - "end": [ - 287, - 12 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 287, - 12 - ], - "end": [ - 287, - 14 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "NAME", - "string": "toknum", - "start": [ - 287, - 15 - ], - "end": [ - 287, - 21 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 287, - 22 - ], - "end": [ - 287, - 24 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 287, - 25 - ], - "end": [ - 287, - 26 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "NAME", - "string": "NAME", - "start": [ - 287, - 26 - ], - "end": [ - 287, - 30 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 287, - 30 - ], - "end": [ - 287, - 31 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "NAME", - "string": "NUMBER", - "start": [ - 287, - 32 - ], - "end": [ - 287, - 38 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 287, - 38 - ], - "end": [ - 287, - 39 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 287, - 39 - ], - "end": [ - 287, - 40 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 287, - 40 - ], - "end": [ - 288, - 0 - ], - "line": " if toknum in (NAME, NUMBER):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 288, - 0 - ], - "end": [ - 288, - 16 - ], - "line": " tokval += ' '\n" - }, - { - "typ": "NAME", - "string": "tokval", - "start": [ - 288, - 16 - ], - "end": [ - 288, - 22 - ], - "line": " tokval += ' '\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 288, - 23 - ], - "end": [ - 288, - 25 - ], - "line": " tokval += ' '\n" - }, - { - "typ": "STRING", - "string": "' '", - "start": [ - 288, - 26 - ], - "end": [ - 288, - 29 - ], - "line": " tokval += ' '\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 288, - 29 - ], - "end": [ - 289, - 0 - ], - "line": " tokval += ' '\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 289, - 0 - ], - "end": [ - 290, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Insert a space between two consecutive strings", - "start": [ - 290, - 12 - ], - "end": [ - 290, - 60 - ], - "line": " # Insert a space between two consecutive strings\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 290, - 60 - ], - "end": [ - 291, - 0 - ], - "line": " # Insert a space between two consecutive strings\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 291, - 12 - ], - "end": [ - 291, - 12 - ], - "line": " if toknum == STRING:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 291, - 12 - ], - "end": [ - 291, - 14 - ], - "line": " if toknum == STRING:\n" - }, - { - "typ": "NAME", - "string": "toknum", - "start": [ - 291, - 15 - ], - "end": [ - 291, - 21 - ], - "line": " if toknum == STRING:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 291, - 22 - ], - "end": [ - 291, - 24 - ], - "line": " if toknum == STRING:\n" - }, - { - "typ": "NAME", - "string": "STRING", - "start": [ - 291, - 25 - ], - "end": [ - 291, - 31 - ], - "line": " if toknum == STRING:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 291, - 31 - ], - "end": [ - 291, - 32 - ], - "line": " if toknum == STRING:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 291, - 32 - ], - "end": [ - 292, - 0 - ], - "line": " if toknum == STRING:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 292, - 0 - ], - "end": [ - 292, - 16 - ], - "line": " if prevstring:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 292, - 16 - ], - "end": [ - 292, - 18 - ], - "line": " if prevstring:\n" - }, - { - "typ": "NAME", - "string": "prevstring", - "start": [ - 292, - 19 - ], - "end": [ - 292, - 29 - ], - "line": " if prevstring:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 292, - 29 - ], - "end": [ - 292, - 30 - ], - "line": " if prevstring:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 292, - 30 - ], - "end": [ - 293, - 0 - ], - "line": " if prevstring:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 293, - 0 - ], - "end": [ - 293, - 20 - ], - "line": " tokval = ' ' + tokval\n" - }, - { - "typ": "NAME", - "string": "tokval", - "start": [ - 293, - 20 - ], - "end": [ - 293, - 26 - ], - "line": " tokval = ' ' + tokval\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 293, - 27 - ], - "end": [ - 293, - 28 - ], - "line": " tokval = ' ' + tokval\n" - }, - { - "typ": "STRING", - "string": "' '", - "start": [ - 293, - 29 - ], - "end": [ - 293, - 32 - ], - "line": " tokval = ' ' + tokval\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 293, - 33 - ], - "end": [ - 293, - 34 - ], - "line": " tokval = ' ' + tokval\n" - }, - { - "typ": "NAME", - "string": "tokval", - "start": [ - 293, - 35 - ], - "end": [ - 293, - 41 - ], - "line": " tokval = ' ' + tokval\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 293, - 41 - ], - "end": [ - 294, - 0 - ], - "line": " tokval = ' ' + tokval\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 294, - 16 - ], - "end": [ - 294, - 16 - ], - "line": " prevstring = True\n" - }, - { - "typ": "NAME", - "string": "prevstring", - "start": [ - 294, - 16 - ], - "end": [ - 294, - 26 - ], - "line": " prevstring = True\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 294, - 27 - ], - "end": [ - 294, - 28 - ], - "line": " prevstring = True\n" - }, - { - "typ": "NAME", - "string": "True", - "start": [ - 294, - 29 - ], - "end": [ - 294, - 33 - ], - "line": " prevstring = True\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 294, - 33 - ], - "end": [ - 295, - 0 - ], - "line": " prevstring = True\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 295, - 12 - ], - "end": [ - 295, - 12 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 295, - 12 - ], - "end": [ - 295, - 16 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 295, - 16 - ], - "end": [ - 295, - 17 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 295, - 17 - ], - "end": [ - 296, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 296, - 0 - ], - "end": [ - 296, - 16 - ], - "line": " prevstring = False\n" - }, - { - "typ": "NAME", - "string": "prevstring", - "start": [ - 296, - 16 - ], - "end": [ - 296, - 26 - ], - "line": " prevstring = False\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 296, - 27 - ], - "end": [ - 296, - 28 - ], - "line": " prevstring = False\n" - }, - { - "typ": "NAME", - "string": "False", - "start": [ - 296, - 29 - ], - "end": [ - 296, - 34 - ], - "line": " prevstring = False\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 296, - 34 - ], - "end": [ - 297, - 0 - ], - "line": " prevstring = False\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 297, - 0 - ], - "end": [ - 298, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 298, - 12 - ], - "end": [ - 298, - 12 - ], - "line": " if toknum == INDENT:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 298, - 12 - ], - "end": [ - 298, - 14 - ], - "line": " if toknum == INDENT:\n" - }, - { - "typ": "NAME", - "string": "toknum", - "start": [ - 298, - 15 - ], - "end": [ - 298, - 21 - ], - "line": " if toknum == INDENT:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 298, - 22 - ], - "end": [ - 298, - 24 - ], - "line": " if toknum == INDENT:\n" - }, - { - "typ": "NAME", - "string": "INDENT", - "start": [ - 298, - 25 - ], - "end": [ - 298, - 31 - ], - "line": " if toknum == INDENT:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 298, - 31 - ], - "end": [ - 298, - 32 - ], - "line": " if toknum == INDENT:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 298, - 32 - ], - "end": [ - 299, - 0 - ], - "line": " if toknum == INDENT:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 299, - 0 - ], - "end": [ - 299, - 16 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 299, - 16 - ], - "end": [ - 299, - 23 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 299, - 23 - ], - "end": [ - 299, - 24 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 299, - 24 - ], - "end": [ - 299, - 30 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 299, - 30 - ], - "end": [ - 299, - 31 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "NAME", - "string": "tokval", - "start": [ - 299, - 31 - ], - "end": [ - 299, - 37 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 299, - 37 - ], - "end": [ - 299, - 38 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 299, - 38 - ], - "end": [ - 300, - 0 - ], - "line": " indents.append(tokval)\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 300, - 16 - ], - "end": [ - 300, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 300, - 24 - ], - "end": [ - 301, - 0 - ], - "line": " continue\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 301, - 12 - ], - "end": [ - 301, - 12 - ], - "line": " elif toknum == DEDENT:\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 301, - 12 - ], - "end": [ - 301, - 16 - ], - "line": " elif toknum == DEDENT:\n" - }, - { - "typ": "NAME", - "string": "toknum", - "start": [ - 301, - 17 - ], - "end": [ - 301, - 23 - ], - "line": " elif toknum == DEDENT:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 301, - 24 - ], - "end": [ - 301, - 26 - ], - "line": " elif toknum == DEDENT:\n" - }, - { - "typ": "NAME", - "string": "DEDENT", - "start": [ - 301, - 27 - ], - "end": [ - 301, - 33 - ], - "line": " elif toknum == DEDENT:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 301, - 33 - ], - "end": [ - 301, - 34 - ], - "line": " elif toknum == DEDENT:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 301, - 34 - ], - "end": [ - 302, - 0 - ], - "line": " elif toknum == DEDENT:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 302, - 0 - ], - "end": [ - 302, - 16 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 302, - 16 - ], - "end": [ - 302, - 23 - ], - "line": " indents.pop()\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 302, - 23 - ], - "end": [ - 302, - 24 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NAME", - "string": "pop", - "start": [ - 302, - 24 - ], - "end": [ - 302, - 27 - ], - "line": " indents.pop()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 302, - 27 - ], - "end": [ - 302, - 28 - ], - "line": " indents.pop()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 302, - 28 - ], - "end": [ - 302, - 29 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 302, - 29 - ], - "end": [ - 303, - 0 - ], - "line": " indents.pop()\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 303, - 16 - ], - "end": [ - 303, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 303, - 24 - ], - "end": [ - 304, - 0 - ], - "line": " continue\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 304, - 12 - ], - "end": [ - 304, - 12 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 304, - 12 - ], - "end": [ - 304, - 16 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "toknum", - "start": [ - 304, - 17 - ], - "end": [ - 304, - 23 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 304, - 24 - ], - "end": [ - 304, - 26 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 304, - 27 - ], - "end": [ - 304, - 28 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "NEWLINE", - "start": [ - 304, - 28 - ], - "end": [ - 304, - 35 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 304, - 35 - ], - "end": [ - 304, - 36 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "NAME", - "string": "NL", - "start": [ - 304, - 37 - ], - "end": [ - 304, - 39 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 304, - 39 - ], - "end": [ - 304, - 40 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 304, - 40 - ], - "end": [ - 304, - 41 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 304, - 41 - ], - "end": [ - 305, - 0 - ], - "line": " elif toknum in (NEWLINE, NL):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 305, - 0 - ], - "end": [ - 305, - 16 - ], - "line": " startline = True\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 305, - 16 - ], - "end": [ - 305, - 25 - ], - "line": " startline = True\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 305, - 26 - ], - "end": [ - 305, - 27 - ], - "line": " startline = True\n" - }, - { - "typ": "NAME", - "string": "True", - "start": [ - 305, - 28 - ], - "end": [ - 305, - 32 - ], - "line": " startline = True\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 305, - 32 - ], - "end": [ - 306, - 0 - ], - "line": " startline = True\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 306, - 12 - ], - "end": [ - 306, - 12 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 306, - 12 - ], - "end": [ - 306, - 16 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 306, - 17 - ], - "end": [ - 306, - 26 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 306, - 27 - ], - "end": [ - 306, - 30 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 306, - 31 - ], - "end": [ - 306, - 38 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 306, - 38 - ], - "end": [ - 306, - 39 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 306, - 39 - ], - "end": [ - 307, - 0 - ], - "line": " elif startline and indents:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 307, - 0 - ], - "end": [ - 307, - 16 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "NAME", - "string": "toks_append", - "start": [ - 307, - 16 - ], - "end": [ - 307, - 27 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 307, - 27 - ], - "end": [ - 307, - 28 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 307, - 28 - ], - "end": [ - 307, - 35 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 307, - 35 - ], - "end": [ - 307, - 36 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 307, - 36 - ], - "end": [ - 307, - 37 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 307, - 37 - ], - "end": [ - 307, - 38 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 307, - 38 - ], - "end": [ - 307, - 39 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 307, - 39 - ], - "end": [ - 307, - 40 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 307, - 40 - ], - "end": [ - 308, - 0 - ], - "line": " toks_append(indents[-1])\n" - }, - { - "typ": "NAME", - "string": "startline", - "start": [ - 308, - 16 - ], - "end": [ - 308, - 25 - ], - "line": " startline = False\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 308, - 26 - ], - "end": [ - 308, - 27 - ], - "line": " startline = False\n" - }, - { - "typ": "NAME", - "string": "False", - "start": [ - 308, - 28 - ], - "end": [ - 308, - 33 - ], - "line": " startline = False\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 308, - 33 - ], - "end": [ - 309, - 0 - ], - "line": " startline = False\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 309, - 12 - ], - "end": [ - 309, - 12 - ], - "line": " toks_append(tokval)\n" - }, - { - "typ": "NAME", - "string": "toks_append", - "start": [ - 309, - 12 - ], - "end": [ - 309, - 23 - ], - "line": " toks_append(tokval)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 309, - 23 - ], - "end": [ - 309, - 24 - ], - "line": " toks_append(tokval)\n" - }, - { - "typ": "NAME", - "string": "tokval", - "start": [ - 309, - 24 - ], - "end": [ - 309, - 30 - ], - "line": " toks_append(tokval)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 309, - 30 - ], - "end": [ - 309, - 31 - ], - "line": " toks_append(tokval)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 309, - 31 - ], - "end": [ - 310, - 0 - ], - "line": " toks_append(tokval)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 310, - 0 - ], - "end": [ - 311, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 311, - 0 - ], - "end": [ - 312, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 312, - 0 - ], - "end": [ - 312, - 0 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 312, - 0 - ], - "end": [ - 312, - 0 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 312, - 0 - ], - "end": [ - 312, - 0 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 312, - 0 - ], - "end": [ - 312, - 3 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "NAME", - "string": "untokenize", - "start": [ - 312, - 4 - ], - "end": [ - 312, - 14 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 312, - 14 - ], - "end": [ - 312, - 15 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "NAME", - "string": "iterable", - "start": [ - 312, - 15 - ], - "end": [ - 312, - 23 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 312, - 23 - ], - "end": [ - 312, - 24 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 312, - 24 - ], - "end": [ - 312, - 25 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 312, - 25 - ], - "end": [ - 313, - 0 - ], - "line": "def untokenize(iterable):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 313, - 0 - ], - "end": [ - 313, - 4 - ], - "line": " \"\"\"Transform tokens back into Python source code.\n" - }, - { - "typ": "STRING", - "string": "\"\"\"Transform tokens back into Python source code.\n It returns a bytes object, encoded using the ENCODING\n token, which is the first token sequence output by tokenize.\n\n Each element returned by the iterable must be a token sequence\n with at least two elements, a token number and token value. If\n only two tokens are passed, the resulting output is poor.\n\n Round-trip invariant for full input:\n Untokenized source will match input source exactly\n\n Round-trip invariant for limited input:\n # Output bytes will tokenize back to the input\n t1 = [tok[:2] for tok in tokenize(f.readline)]\n newcode = untokenize(t1)\n readline = BytesIO(newcode).readline\n t2 = [tok[:2] for tok in tokenize(readline)]\n assert t1 == t2\n \"\"\"", - "start": [ - 313, - 4 - ], - "end": [ - 331, - 7 - ], - "line": " \"\"\"Transform tokens back into Python source code.\n It returns a bytes object, encoded using the ENCODING\n token, which is the first token sequence output by tokenize.\n\n Each element returned by the iterable must be a token sequence\n with at least two elements, a token number and token value. If\n only two tokens are passed, the resulting output is poor.\n\n Round-trip invariant for full input:\n Untokenized source will match input source exactly\n\n Round-trip invariant for limited input:\n # Output bytes will tokenize back to the input\n t1 = [tok[:2] for tok in tokenize(f.readline)]\n newcode = untokenize(t1)\n readline = BytesIO(newcode).readline\n t2 = [tok[:2] for tok in tokenize(readline)]\n assert t1 == t2\n \"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 331, - 7 - ], - "end": [ - 332, - 0 - ], - "line": " \"\"\"\n" - }, - { - "typ": "NAME", - "string": "ut", - "start": [ - 332, - 4 - ], - "end": [ - 332, - 6 - ], - "line": " ut = Untokenizer()\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 332, - 7 - ], - "end": [ - 332, - 8 - ], - "line": " ut = Untokenizer()\n" - }, - { - "typ": "NAME", - "string": "Untokenizer", - "start": [ - 332, - 9 - ], - "end": [ - 332, - 20 - ], - "line": " ut = Untokenizer()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 332, - 20 - ], - "end": [ - 332, - 21 - ], - "line": " ut = Untokenizer()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 332, - 21 - ], - "end": [ - 332, - 22 - ], - "line": " ut = Untokenizer()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 332, - 22 - ], - "end": [ - 333, - 0 - ], - "line": " ut = Untokenizer()\n" - }, - { - "typ": "NAME", - "string": "out", - "start": [ - 333, - 4 - ], - "end": [ - 333, - 7 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 333, - 8 - ], - "end": [ - 333, - 9 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "NAME", - "string": "ut", - "start": [ - 333, - 10 - ], - "end": [ - 333, - 12 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 333, - 12 - ], - "end": [ - 333, - 13 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "NAME", - "string": "untokenize", - "start": [ - 333, - 13 - ], - "end": [ - 333, - 23 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 333, - 23 - ], - "end": [ - 333, - 24 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "NAME", - "string": "iterable", - "start": [ - 333, - 24 - ], - "end": [ - 333, - 32 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 333, - 32 - ], - "end": [ - 333, - 33 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 333, - 33 - ], - "end": [ - 334, - 0 - ], - "line": " out = ut.untokenize(iterable)\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 334, - 4 - ], - "end": [ - 334, - 6 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "ut", - "start": [ - 334, - 7 - ], - "end": [ - 334, - 9 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 334, - 9 - ], - "end": [ - 334, - 10 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 334, - 10 - ], - "end": [ - 334, - 18 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "is", - "start": [ - 334, - 19 - ], - "end": [ - 334, - 21 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 334, - 22 - ], - "end": [ - 334, - 25 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 334, - 26 - ], - "end": [ - 334, - 30 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 334, - 30 - ], - "end": [ - 334, - 31 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 334, - 31 - ], - "end": [ - 335, - 0 - ], - "line": " if ut.encoding is not None:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 335, - 0 - ], - "end": [ - 335, - 8 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "NAME", - "string": "out", - "start": [ - 335, - 8 - ], - "end": [ - 335, - 11 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 335, - 12 - ], - "end": [ - 335, - 13 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "NAME", - "string": "out", - "start": [ - 335, - 14 - ], - "end": [ - 335, - 17 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 335, - 17 - ], - "end": [ - 335, - 18 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "NAME", - "string": "encode", - "start": [ - 335, - 18 - ], - "end": [ - 335, - 24 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 335, - 24 - ], - "end": [ - 335, - 25 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "NAME", - "string": "ut", - "start": [ - 335, - 25 - ], - "end": [ - 335, - 27 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 335, - 27 - ], - "end": [ - 335, - 28 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 335, - 28 - ], - "end": [ - 335, - 36 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 335, - 36 - ], - "end": [ - 335, - 37 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 335, - 37 - ], - "end": [ - 336, - 0 - ], - "line": " out = out.encode(ut.encoding)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 336, - 4 - ], - "end": [ - 336, - 4 - ], - "line": " return out\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 336, - 4 - ], - "end": [ - 336, - 10 - ], - "line": " return out\n" - }, - { - "typ": "NAME", - "string": "out", - "start": [ - 336, - 11 - ], - "end": [ - 336, - 14 - ], - "line": " return out\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 336, - 14 - ], - "end": [ - 337, - 0 - ], - "line": " return out\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 337, - 0 - ], - "end": [ - 338, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 338, - 0 - ], - "end": [ - 339, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 339, - 0 - ], - "end": [ - 339, - 0 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 339, - 0 - ], - "end": [ - 339, - 3 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "NAME", - "string": "_get_normal_name", - "start": [ - 339, - 4 - ], - "end": [ - 339, - 20 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 339, - 20 - ], - "end": [ - 339, - 21 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "NAME", - "string": "orig_enc", - "start": [ - 339, - 21 - ], - "end": [ - 339, - 29 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 339, - 29 - ], - "end": [ - 339, - 30 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 339, - 30 - ], - "end": [ - 339, - 31 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 339, - 31 - ], - "end": [ - 340, - 0 - ], - "line": "def _get_normal_name(orig_enc):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 340, - 0 - ], - "end": [ - 340, - 4 - ], - "line": " \"\"\"Imitates get_normal_name in tokenizer.c.\"\"\"\n" - }, - { - "typ": "STRING", - "string": "\"\"\"Imitates get_normal_name in tokenizer.c.\"\"\"", - "start": [ - 340, - 4 - ], - "end": [ - 340, - 50 - ], - "line": " \"\"\"Imitates get_normal_name in tokenizer.c.\"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 340, - 50 - ], - "end": [ - 341, - 0 - ], - "line": " \"\"\"Imitates get_normal_name in tokenizer.c.\"\"\"\n" - }, - { - "typ": "COMMENT", - "string": "# Only care about the first 12 characters.", - "start": [ - 341, - 4 - ], - "end": [ - 341, - 46 - ], - "line": " # Only care about the first 12 characters.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 341, - 46 - ], - "end": [ - 342, - 0 - ], - "line": " # Only care about the first 12 characters.\n" - }, - { - "typ": "NAME", - "string": "enc", - "start": [ - 342, - 4 - ], - "end": [ - 342, - 7 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 342, - 8 - ], - "end": [ - 342, - 9 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "NAME", - "string": "orig_enc", - "start": [ - 342, - 10 - ], - "end": [ - 342, - 18 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 342, - 18 - ], - "end": [ - 342, - 19 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 342, - 19 - ], - "end": [ - 342, - 20 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "NUMBER", - "string": "12", - "start": [ - 342, - 20 - ], - "end": [ - 342, - 22 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 342, - 22 - ], - "end": [ - 342, - 23 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 342, - 23 - ], - "end": [ - 342, - 24 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "NAME", - "string": "lower", - "start": [ - 342, - 24 - ], - "end": [ - 342, - 29 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 342, - 29 - ], - "end": [ - 342, - 30 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 342, - 30 - ], - "end": [ - 342, - 31 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 342, - 31 - ], - "end": [ - 342, - 32 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "NAME", - "string": "replace", - "start": [ - 342, - 32 - ], - "end": [ - 342, - 39 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 342, - 39 - ], - "end": [ - 342, - 40 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "STRING", - "string": "\"_\"", - "start": [ - 342, - 40 - ], - "end": [ - 342, - 43 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 342, - 43 - ], - "end": [ - 342, - 44 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "STRING", - "string": "\"-\"", - "start": [ - 342, - 45 - ], - "end": [ - 342, - 48 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 342, - 48 - ], - "end": [ - 342, - 49 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 342, - 49 - ], - "end": [ - 343, - 0 - ], - "line": " enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 343, - 4 - ], - "end": [ - 343, - 6 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "NAME", - "string": "enc", - "start": [ - 343, - 7 - ], - "end": [ - 343, - 10 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 343, - 11 - ], - "end": [ - 343, - 13 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "STRING", - "string": "\"utf-8\"", - "start": [ - 343, - 14 - ], - "end": [ - 343, - 21 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 343, - 22 - ], - "end": [ - 343, - 24 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "NAME", - "string": "enc", - "start": [ - 343, - 25 - ], - "end": [ - 343, - 28 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 343, - 28 - ], - "end": [ - 343, - 29 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "NAME", - "string": "startswith", - "start": [ - 343, - 29 - ], - "end": [ - 343, - 39 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 343, - 39 - ], - "end": [ - 343, - 40 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "STRING", - "string": "\"utf-8-\"", - "start": [ - 343, - 40 - ], - "end": [ - 343, - 48 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 343, - 48 - ], - "end": [ - 343, - 49 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 343, - 49 - ], - "end": [ - 343, - 50 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 343, - 50 - ], - "end": [ - 344, - 0 - ], - "line": " if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 344, - 0 - ], - "end": [ - 344, - 8 - ], - "line": " return \"utf-8\"\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 344, - 8 - ], - "end": [ - 344, - 14 - ], - "line": " return \"utf-8\"\n" - }, - { - "typ": "STRING", - "string": "\"utf-8\"", - "start": [ - 344, - 15 - ], - "end": [ - 344, - 22 - ], - "line": " return \"utf-8\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 344, - 22 - ], - "end": [ - 345, - 0 - ], - "line": " return \"utf-8\"\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 345, - 4 - ], - "end": [ - 345, - 4 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 345, - 4 - ], - "end": [ - 345, - 6 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "NAME", - "string": "enc", - "start": [ - 345, - 7 - ], - "end": [ - 345, - 10 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 345, - 11 - ], - "end": [ - 345, - 13 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 345, - 14 - ], - "end": [ - 345, - 15 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "STRING", - "string": "\"latin-1\"", - "start": [ - 345, - 15 - ], - "end": [ - 345, - 24 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 345, - 24 - ], - "end": [ - 345, - 25 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "STRING", - "string": "\"iso-8859-1\"", - "start": [ - 345, - 26 - ], - "end": [ - 345, - 38 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 345, - 38 - ], - "end": [ - 345, - 39 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "STRING", - "string": "\"iso-latin-1\"", - "start": [ - 345, - 40 - ], - "end": [ - 345, - 53 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 345, - 53 - ], - "end": [ - 345, - 54 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 345, - 55 - ], - "end": [ - 345, - 57 - ], - "line": " if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n" - }, - { - "typ": "NAME", - "string": "enc", - "start": [ - 346, - 7 - ], - "end": [ - 346, - 10 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 346, - 10 - ], - "end": [ - 346, - 11 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "NAME", - "string": "startswith", - "start": [ - 346, - 11 - ], - "end": [ - 346, - 21 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 346, - 21 - ], - "end": [ - 346, - 22 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 346, - 22 - ], - "end": [ - 346, - 23 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "STRING", - "string": "\"latin-1-\"", - "start": [ - 346, - 23 - ], - "end": [ - 346, - 33 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 346, - 33 - ], - "end": [ - 346, - 34 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "STRING", - "string": "\"iso-8859-1-\"", - "start": [ - 346, - 35 - ], - "end": [ - 346, - 48 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 346, - 48 - ], - "end": [ - 346, - 49 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "STRING", - "string": "\"iso-latin-1-\"", - "start": [ - 346, - 50 - ], - "end": [ - 346, - 64 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 346, - 64 - ], - "end": [ - 346, - 65 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 346, - 65 - ], - "end": [ - 346, - 66 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 346, - 66 - ], - "end": [ - 346, - 67 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 346, - 67 - ], - "end": [ - 347, - 0 - ], - "line": " enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 347, - 0 - ], - "end": [ - 347, - 8 - ], - "line": " return \"iso-8859-1\"\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 347, - 8 - ], - "end": [ - 347, - 14 - ], - "line": " return \"iso-8859-1\"\n" - }, - { - "typ": "STRING", - "string": "\"iso-8859-1\"", - "start": [ - 347, - 15 - ], - "end": [ - 347, - 27 - ], - "line": " return \"iso-8859-1\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 347, - 27 - ], - "end": [ - 348, - 0 - ], - "line": " return \"iso-8859-1\"\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 348, - 4 - ], - "end": [ - 348, - 4 - ], - "line": " return orig_enc\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 348, - 4 - ], - "end": [ - 348, - 10 - ], - "line": " return orig_enc\n" - }, - { - "typ": "NAME", - "string": "orig_enc", - "start": [ - 348, - 11 - ], - "end": [ - 348, - 19 - ], - "line": " return orig_enc\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 348, - 19 - ], - "end": [ - 349, - 0 - ], - "line": " return orig_enc\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 349, - 0 - ], - "end": [ - 350, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 350, - 0 - ], - "end": [ - 350, - 0 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 350, - 0 - ], - "end": [ - 350, - 3 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "NAME", - "string": "detect_encoding", - "start": [ - 350, - 4 - ], - "end": [ - 350, - 19 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 350, - 19 - ], - "end": [ - 350, - 20 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 350, - 20 - ], - "end": [ - 350, - 28 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 350, - 28 - ], - "end": [ - 350, - 29 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 350, - 29 - ], - "end": [ - 350, - 30 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 350, - 30 - ], - "end": [ - 351, - 0 - ], - "line": "def detect_encoding(readline):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 351, - 0 - ], - "end": [ - 351, - 4 - ], - "line": " \"\"\"\n" - }, - { - "typ": "STRING", - "string": "\"\"\"\n The detect_encoding() function is used to detect the encoding that should\n be used to decode a Python source file. It requires one argument, readline,\n in the same way as the tokenize() generator.\n\n It will call readline a maximum of twice, and return the encoding used\n (as a string) and a list of any lines (left as bytes) it has read in.\n\n It detects the encoding from the presence of a utf-8 bom or an encoding\n cookie as specified in pep-0263. If both a bom and a cookie are present,\n but disagree, a SyntaxError will be raised. If the encoding cookie is an\n invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found,\n 'utf-8-sig' is returned.\n\n If no encoding is specified, then the default of 'utf-8' will be returned.\n \"\"\"", - "start": [ - 351, - 4 - ], - "end": [ - 366, - 7 - ], - "line": " \"\"\"\n The detect_encoding() function is used to detect the encoding that should\n be used to decode a Python source file. It requires one argument, readline,\n in the same way as the tokenize() generator.\n\n It will call readline a maximum of twice, and return the encoding used\n (as a string) and a list of any lines (left as bytes) it has read in.\n\n It detects the encoding from the presence of a utf-8 bom or an encoding\n cookie as specified in pep-0263. If both a bom and a cookie are present,\n but disagree, a SyntaxError will be raised. If the encoding cookie is an\n invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found,\n 'utf-8-sig' is returned.\n\n If no encoding is specified, then the default of 'utf-8' will be returned.\n \"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 366, - 7 - ], - "end": [ - 367, - 0 - ], - "line": " \"\"\"\n" - }, - { - "typ": "NAME", - "string": "try", - "start": [ - 367, - 4 - ], - "end": [ - 367, - 7 - ], - "line": " try:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 367, - 7 - ], - "end": [ - 367, - 8 - ], - "line": " try:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 367, - 8 - ], - "end": [ - 368, - 0 - ], - "line": " try:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 368, - 0 - ], - "end": [ - 368, - 8 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 368, - 8 - ], - "end": [ - 368, - 16 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 368, - 17 - ], - "end": [ - 368, - 18 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 368, - 19 - ], - "end": [ - 368, - 27 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 368, - 27 - ], - "end": [ - 368, - 28 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "NAME", - "string": "__self__", - "start": [ - 368, - 28 - ], - "end": [ - 368, - 36 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 368, - 36 - ], - "end": [ - 368, - 37 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "NAME", - "string": "name", - "start": [ - 368, - 37 - ], - "end": [ - 368, - 41 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 368, - 41 - ], - "end": [ - 369, - 0 - ], - "line": " filename = readline.__self__.name\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 369, - 4 - ], - "end": [ - 369, - 4 - ], - "line": " except AttributeError:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 369, - 4 - ], - "end": [ - 369, - 10 - ], - "line": " except AttributeError:\n" - }, - { - "typ": "NAME", - "string": "AttributeError", - "start": [ - 369, - 11 - ], - "end": [ - 369, - 25 - ], - "line": " except AttributeError:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 369, - 25 - ], - "end": [ - 369, - 26 - ], - "line": " except AttributeError:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 369, - 26 - ], - "end": [ - 370, - 0 - ], - "line": " except AttributeError:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 370, - 0 - ], - "end": [ - 370, - 8 - ], - "line": " filename = None\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 370, - 8 - ], - "end": [ - 370, - 16 - ], - "line": " filename = None\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 370, - 17 - ], - "end": [ - 370, - 18 - ], - "line": " filename = None\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 370, - 19 - ], - "end": [ - 370, - 23 - ], - "line": " filename = None\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 370, - 23 - ], - "end": [ - 371, - 0 - ], - "line": " filename = None\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 371, - 4 - ], - "end": [ - 371, - 4 - ], - "line": " bom_found = False\n" - }, - { - "typ": "NAME", - "string": "bom_found", - "start": [ - 371, - 4 - ], - "end": [ - 371, - 13 - ], - "line": " bom_found = False\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 371, - 14 - ], - "end": [ - 371, - 15 - ], - "line": " bom_found = False\n" - }, - { - "typ": "NAME", - "string": "False", - "start": [ - 371, - 16 - ], - "end": [ - 371, - 21 - ], - "line": " bom_found = False\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 371, - 21 - ], - "end": [ - 372, - 0 - ], - "line": " bom_found = False\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 372, - 4 - ], - "end": [ - 372, - 12 - ], - "line": " encoding = None\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 372, - 13 - ], - "end": [ - 372, - 14 - ], - "line": " encoding = None\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 372, - 15 - ], - "end": [ - 372, - 19 - ], - "line": " encoding = None\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 372, - 19 - ], - "end": [ - 373, - 0 - ], - "line": " encoding = None\n" - }, - { - "typ": "NAME", - "string": "default", - "start": [ - 373, - 4 - ], - "end": [ - 373, - 11 - ], - "line": " default = 'utf-8'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 373, - 12 - ], - "end": [ - 373, - 13 - ], - "line": " default = 'utf-8'\n" - }, - { - "typ": "STRING", - "string": "'utf-8'", - "start": [ - 373, - 14 - ], - "end": [ - 373, - 21 - ], - "line": " default = 'utf-8'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 373, - 21 - ], - "end": [ - 374, - 0 - ], - "line": " default = 'utf-8'\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 374, - 4 - ], - "end": [ - 374, - 7 - ], - "line": " def read_or_stop():\n" - }, - { - "typ": "NAME", - "string": "read_or_stop", - "start": [ - 374, - 8 - ], - "end": [ - 374, - 20 - ], - "line": " def read_or_stop():\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 374, - 20 - ], - "end": [ - 374, - 21 - ], - "line": " def read_or_stop():\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 374, - 21 - ], - "end": [ - 374, - 22 - ], - "line": " def read_or_stop():\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 374, - 22 - ], - "end": [ - 374, - 23 - ], - "line": " def read_or_stop():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 374, - 23 - ], - "end": [ - 375, - 0 - ], - "line": " def read_or_stop():\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 375, - 0 - ], - "end": [ - 375, - 8 - ], - "line": " try:\n" - }, - { - "typ": "NAME", - "string": "try", - "start": [ - 375, - 8 - ], - "end": [ - 375, - 11 - ], - "line": " try:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 375, - 11 - ], - "end": [ - 375, - 12 - ], - "line": " try:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 375, - 12 - ], - "end": [ - 376, - 0 - ], - "line": " try:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 376, - 0 - ], - "end": [ - 376, - 12 - ], - "line": " return readline()\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 376, - 12 - ], - "end": [ - 376, - 18 - ], - "line": " return readline()\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 376, - 19 - ], - "end": [ - 376, - 27 - ], - "line": " return readline()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 376, - 27 - ], - "end": [ - 376, - 28 - ], - "line": " return readline()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 376, - 28 - ], - "end": [ - 376, - 29 - ], - "line": " return readline()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 376, - 29 - ], - "end": [ - 377, - 0 - ], - "line": " return readline()\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 377, - 8 - ], - "end": [ - 377, - 8 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 377, - 8 - ], - "end": [ - 377, - 14 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "NAME", - "string": "StopIteration", - "start": [ - 377, - 15 - ], - "end": [ - 377, - 28 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 377, - 28 - ], - "end": [ - 377, - 29 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 377, - 29 - ], - "end": [ - 378, - 0 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 378, - 0 - ], - "end": [ - 378, - 12 - ], - "line": " return b''\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 378, - 12 - ], - "end": [ - 378, - 18 - ], - "line": " return b''\n" - }, - { - "typ": "STRING", - "string": "b''", - "start": [ - 378, - 19 - ], - "end": [ - 378, - 22 - ], - "line": " return b''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 378, - 22 - ], - "end": [ - 379, - 0 - ], - "line": " return b''\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 379, - 0 - ], - "end": [ - 380, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 380, - 4 - ], - "end": [ - 380, - 4 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 380, - 4 - ], - "end": [ - 380, - 4 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 380, - 4 - ], - "end": [ - 380, - 7 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "NAME", - "string": "find_cookie", - "start": [ - 380, - 8 - ], - "end": [ - 380, - 19 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 380, - 19 - ], - "end": [ - 380, - 20 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 380, - 20 - ], - "end": [ - 380, - 24 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 380, - 24 - ], - "end": [ - 380, - 25 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 380, - 25 - ], - "end": [ - 380, - 26 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 380, - 26 - ], - "end": [ - 381, - 0 - ], - "line": " def find_cookie(line):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 381, - 0 - ], - "end": [ - 381, - 8 - ], - "line": " try:\n" - }, - { - "typ": "NAME", - "string": "try", - "start": [ - 381, - 8 - ], - "end": [ - 381, - 11 - ], - "line": " try:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 381, - 11 - ], - "end": [ - 381, - 12 - ], - "line": " try:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 381, - 12 - ], - "end": [ - 382, - 0 - ], - "line": " try:\n" - }, - { - "typ": "COMMENT", - "string": "# Decode as UTF-8. Either the line is an encoding declaration,", - "start": [ - 382, - 12 - ], - "end": [ - 382, - 74 - ], - "line": " # Decode as UTF-8. Either the line is an encoding declaration,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 382, - 74 - ], - "end": [ - 383, - 0 - ], - "line": " # Decode as UTF-8. Either the line is an encoding declaration,\n" - }, - { - "typ": "COMMENT", - "string": "# in which case it should be pure ASCII, or it must be UTF-8", - "start": [ - 383, - 12 - ], - "end": [ - 383, - 72 - ], - "line": " # in which case it should be pure ASCII, or it must be UTF-8\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 383, - 72 - ], - "end": [ - 384, - 0 - ], - "line": " # in which case it should be pure ASCII, or it must be UTF-8\n" - }, - { - "typ": "COMMENT", - "string": "# per default encoding.", - "start": [ - 384, - 12 - ], - "end": [ - 384, - 35 - ], - "line": " # per default encoding.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 384, - 35 - ], - "end": [ - 385, - 0 - ], - "line": " # per default encoding.\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 385, - 0 - ], - "end": [ - 385, - 12 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "NAME", - "string": "line_string", - "start": [ - 385, - 12 - ], - "end": [ - 385, - 23 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 385, - 24 - ], - "end": [ - 385, - 25 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 385, - 26 - ], - "end": [ - 385, - 30 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 385, - 30 - ], - "end": [ - 385, - 31 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "NAME", - "string": "decode", - "start": [ - 385, - 31 - ], - "end": [ - 385, - 37 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 385, - 37 - ], - "end": [ - 385, - 38 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "STRING", - "string": "'utf-8'", - "start": [ - 385, - 38 - ], - "end": [ - 385, - 45 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 385, - 45 - ], - "end": [ - 385, - 46 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 385, - 46 - ], - "end": [ - 386, - 0 - ], - "line": " line_string = line.decode('utf-8')\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 386, - 8 - ], - "end": [ - 386, - 8 - ], - "line": " except UnicodeDecodeError:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 386, - 8 - ], - "end": [ - 386, - 14 - ], - "line": " except UnicodeDecodeError:\n" - }, - { - "typ": "NAME", - "string": "UnicodeDecodeError", - "start": [ - 386, - 15 - ], - "end": [ - 386, - 33 - ], - "line": " except UnicodeDecodeError:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 386, - 33 - ], - "end": [ - 386, - 34 - ], - "line": " except UnicodeDecodeError:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 386, - 34 - ], - "end": [ - 387, - 0 - ], - "line": " except UnicodeDecodeError:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 387, - 0 - ], - "end": [ - 387, - 12 - ], - "line": " msg = \"invalid or missing encoding declaration\"\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 387, - 12 - ], - "end": [ - 387, - 15 - ], - "line": " msg = \"invalid or missing encoding declaration\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 387, - 16 - ], - "end": [ - 387, - 17 - ], - "line": " msg = \"invalid or missing encoding declaration\"\n" - }, - { - "typ": "STRING", - "string": "\"invalid or missing encoding declaration\"", - "start": [ - 387, - 18 - ], - "end": [ - 387, - 59 - ], - "line": " msg = \"invalid or missing encoding declaration\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 387, - 59 - ], - "end": [ - 388, - 0 - ], - "line": " msg = \"invalid or missing encoding declaration\"\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 388, - 12 - ], - "end": [ - 388, - 14 - ], - "line": " if filename is not None:\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 388, - 15 - ], - "end": [ - 388, - 23 - ], - "line": " if filename is not None:\n" - }, - { - "typ": "NAME", - "string": "is", - "start": [ - 388, - 24 - ], - "end": [ - 388, - 26 - ], - "line": " if filename is not None:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 388, - 27 - ], - "end": [ - 388, - 30 - ], - "line": " if filename is not None:\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 388, - 31 - ], - "end": [ - 388, - 35 - ], - "line": " if filename is not None:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 388, - 35 - ], - "end": [ - 388, - 36 - ], - "line": " if filename is not None:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 388, - 36 - ], - "end": [ - 389, - 0 - ], - "line": " if filename is not None:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 389, - 0 - ], - "end": [ - 389, - 16 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 389, - 16 - ], - "end": [ - 389, - 19 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 389, - 20 - ], - "end": [ - 389, - 21 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "STRING", - "string": "'{} for {!r}'", - "start": [ - 389, - 22 - ], - "end": [ - 389, - 35 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 389, - 35 - ], - "end": [ - 389, - 36 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "NAME", - "string": "format", - "start": [ - 389, - 36 - ], - "end": [ - 389, - 42 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 389, - 42 - ], - "end": [ - 389, - 43 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 389, - 43 - ], - "end": [ - 389, - 46 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 389, - 46 - ], - "end": [ - 389, - 47 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 389, - 48 - ], - "end": [ - 389, - 56 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 389, - 56 - ], - "end": [ - 389, - 57 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 389, - 57 - ], - "end": [ - 390, - 0 - ], - "line": " msg = '{} for {!r}'.format(msg, filename)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 390, - 12 - ], - "end": [ - 390, - 12 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 390, - 12 - ], - "end": [ - 390, - 17 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "SyntaxError", - "start": [ - 390, - 18 - ], - "end": [ - 390, - 29 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 390, - 29 - ], - "end": [ - 390, - 30 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 390, - 30 - ], - "end": [ - 390, - 33 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 390, - 33 - ], - "end": [ - 390, - 34 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 390, - 34 - ], - "end": [ - 391, - 0 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 391, - 0 - ], - "end": [ - 392, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 392, - 8 - ], - "end": [ - 392, - 8 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 392, - 8 - ], - "end": [ - 392, - 13 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 392, - 14 - ], - "end": [ - 392, - 15 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "NAME", - "string": "cookie_re", - "start": [ - 392, - 16 - ], - "end": [ - 392, - 25 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 392, - 25 - ], - "end": [ - 392, - 26 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 392, - 26 - ], - "end": [ - 392, - 31 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 392, - 31 - ], - "end": [ - 392, - 32 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "NAME", - "string": "line_string", - "start": [ - 392, - 32 - ], - "end": [ - 392, - 43 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 392, - 43 - ], - "end": [ - 392, - 44 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 392, - 44 - ], - "end": [ - 393, - 0 - ], - "line": " match = cookie_re.match(line_string)\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 393, - 8 - ], - "end": [ - 393, - 10 - ], - "line": " if not match:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 393, - 11 - ], - "end": [ - 393, - 14 - ], - "line": " if not match:\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 393, - 15 - ], - "end": [ - 393, - 20 - ], - "line": " if not match:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 393, - 20 - ], - "end": [ - 393, - 21 - ], - "line": " if not match:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 393, - 21 - ], - "end": [ - 394, - 0 - ], - "line": " if not match:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 394, - 0 - ], - "end": [ - 394, - 12 - ], - "line": " return None\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 394, - 12 - ], - "end": [ - 394, - 18 - ], - "line": " return None\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 394, - 19 - ], - "end": [ - 394, - 23 - ], - "line": " return None\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 394, - 23 - ], - "end": [ - 395, - 0 - ], - "line": " return None\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 395, - 8 - ], - "end": [ - 395, - 8 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 395, - 8 - ], - "end": [ - 395, - 16 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 395, - 17 - ], - "end": [ - 395, - 18 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "NAME", - "string": "_get_normal_name", - "start": [ - 395, - 19 - ], - "end": [ - 395, - 35 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 395, - 35 - ], - "end": [ - 395, - 36 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 395, - 36 - ], - "end": [ - 395, - 41 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 395, - 41 - ], - "end": [ - 395, - 42 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "NAME", - "string": "group", - "start": [ - 395, - 42 - ], - "end": [ - 395, - 47 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 395, - 47 - ], - "end": [ - 395, - 48 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 395, - 48 - ], - "end": [ - 395, - 49 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 395, - 49 - ], - "end": [ - 395, - 50 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 395, - 50 - ], - "end": [ - 395, - 51 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 395, - 51 - ], - "end": [ - 396, - 0 - ], - "line": " encoding = _get_normal_name(match.group(1))\n" - }, - { - "typ": "NAME", - "string": "try", - "start": [ - 396, - 8 - ], - "end": [ - 396, - 11 - ], - "line": " try:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 396, - 11 - ], - "end": [ - 396, - 12 - ], - "line": " try:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 396, - 12 - ], - "end": [ - 397, - 0 - ], - "line": " try:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 397, - 0 - ], - "end": [ - 397, - 12 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "NAME", - "string": "codec", - "start": [ - 397, - 12 - ], - "end": [ - 397, - 17 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 397, - 18 - ], - "end": [ - 397, - 19 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "NAME", - "string": "lookup", - "start": [ - 397, - 20 - ], - "end": [ - 397, - 26 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 397, - 26 - ], - "end": [ - 397, - 27 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 397, - 27 - ], - "end": [ - 397, - 35 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 397, - 35 - ], - "end": [ - 397, - 36 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 397, - 36 - ], - "end": [ - 398, - 0 - ], - "line": " codec = lookup(encoding)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 398, - 8 - ], - "end": [ - 398, - 8 - ], - "line": " except LookupError:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 398, - 8 - ], - "end": [ - 398, - 14 - ], - "line": " except LookupError:\n" - }, - { - "typ": "NAME", - "string": "LookupError", - "start": [ - 398, - 15 - ], - "end": [ - 398, - 26 - ], - "line": " except LookupError:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 398, - 26 - ], - "end": [ - 398, - 27 - ], - "line": " except LookupError:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 398, - 27 - ], - "end": [ - 399, - 0 - ], - "line": " except LookupError:\n" - }, - { - "typ": "COMMENT", - "string": "# This behaviour mimics the Python interpreter", - "start": [ - 399, - 12 - ], - "end": [ - 399, - 58 - ], - "line": " # This behaviour mimics the Python interpreter\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 399, - 58 - ], - "end": [ - 400, - 0 - ], - "line": " # This behaviour mimics the Python interpreter\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 400, - 0 - ], - "end": [ - 400, - 12 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 400, - 12 - ], - "end": [ - 400, - 14 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 400, - 15 - ], - "end": [ - 400, - 23 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "is", - "start": [ - 400, - 24 - ], - "end": [ - 400, - 26 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 400, - 27 - ], - "end": [ - 400, - 31 - ], - "line": " if filename is None:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 400, - 31 - ], - "end": [ - 400, - 32 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 400, - 32 - ], - "end": [ - 401, - 0 - ], - "line": " if filename is None:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 401, - 0 - ], - "end": [ - 401, - 16 - ], - "line": " msg = \"unknown encoding: \" + encoding\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 401, - 16 - ], - "end": [ - 401, - 19 - ], - "line": " msg = \"unknown encoding: \" + encoding\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 401, - 20 - ], - "end": [ - 401, - 21 - ], - "line": " msg = \"unknown encoding: \" + encoding\n" - }, - { - "typ": "STRING", - "string": "\"unknown encoding: \"", - "start": [ - 401, - 22 - ], - "end": [ - 401, - 42 - ], - "line": " msg = \"unknown encoding: \" + encoding\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 401, - 43 - ], - "end": [ - 401, - 44 - ], - "line": " msg = \"unknown encoding: \" + encoding\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 401, - 45 - ], - "end": [ - 401, - 53 - ], - "line": " msg = \"unknown encoding: \" + encoding\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 401, - 53 - ], - "end": [ - 402, - 0 - ], - "line": " msg = \"unknown encoding: \" + encoding\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 402, - 12 - ], - "end": [ - 402, - 12 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 402, - 12 - ], - "end": [ - 402, - 16 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 402, - 16 - ], - "end": [ - 402, - 17 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 402, - 17 - ], - "end": [ - 403, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 403, - 0 - ], - "end": [ - 403, - 16 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 403, - 16 - ], - "end": [ - 403, - 19 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 403, - 20 - ], - "end": [ - 403, - 21 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "STRING", - "string": "\"unknown encoding for {!r}: {}\"", - "start": [ - 403, - 22 - ], - "end": [ - 403, - 53 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 403, - 53 - ], - "end": [ - 403, - 54 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "NAME", - "string": "format", - "start": [ - 403, - 54 - ], - "end": [ - 403, - 60 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 403, - 60 - ], - "end": [ - 403, - 61 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 403, - 61 - ], - "end": [ - 403, - 69 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 403, - 69 - ], - "end": [ - 403, - 70 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 403, - 70 - ], - "end": [ - 404, - 0 - ], - "line": " msg = \"unknown encoding for {!r}: {}\".format(filename,\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 404, - 24 - ], - "end": [ - 404, - 32 - ], - "line": " encoding)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 404, - 32 - ], - "end": [ - 404, - 33 - ], - "line": " encoding)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 404, - 33 - ], - "end": [ - 405, - 0 - ], - "line": " encoding)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 405, - 12 - ], - "end": [ - 405, - 12 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 405, - 12 - ], - "end": [ - 405, - 17 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "SyntaxError", - "start": [ - 405, - 18 - ], - "end": [ - 405, - 29 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 405, - 29 - ], - "end": [ - 405, - 30 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 405, - 30 - ], - "end": [ - 405, - 33 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 405, - 33 - ], - "end": [ - 405, - 34 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 405, - 34 - ], - "end": [ - 406, - 0 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 406, - 0 - ], - "end": [ - 407, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 407, - 8 - ], - "end": [ - 407, - 8 - ], - "line": " if bom_found:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 407, - 8 - ], - "end": [ - 407, - 10 - ], - "line": " if bom_found:\n" - }, - { - "typ": "NAME", - "string": "bom_found", - "start": [ - 407, - 11 - ], - "end": [ - 407, - 20 - ], - "line": " if bom_found:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 407, - 20 - ], - "end": [ - 407, - 21 - ], - "line": " if bom_found:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 407, - 21 - ], - "end": [ - 408, - 0 - ], - "line": " if bom_found:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 408, - 0 - ], - "end": [ - 408, - 12 - ], - "line": " if encoding != 'utf-8':\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 408, - 12 - ], - "end": [ - 408, - 14 - ], - "line": " if encoding != 'utf-8':\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 408, - 15 - ], - "end": [ - 408, - 23 - ], - "line": " if encoding != 'utf-8':\n" - }, - { - "typ": "OP", - "string": "!=", - "start": [ - 408, - 24 - ], - "end": [ - 408, - 26 - ], - "line": " if encoding != 'utf-8':\n" - }, - { - "typ": "STRING", - "string": "'utf-8'", - "start": [ - 408, - 27 - ], - "end": [ - 408, - 34 - ], - "line": " if encoding != 'utf-8':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 408, - 34 - ], - "end": [ - 408, - 35 - ], - "line": " if encoding != 'utf-8':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 408, - 35 - ], - "end": [ - 409, - 0 - ], - "line": " if encoding != 'utf-8':\n" - }, - { - "typ": "COMMENT", - "string": "# This behaviour mimics the Python interpreter", - "start": [ - 409, - 16 - ], - "end": [ - 409, - 62 - ], - "line": " # This behaviour mimics the Python interpreter\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 409, - 62 - ], - "end": [ - 410, - 0 - ], - "line": " # This behaviour mimics the Python interpreter\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 410, - 0 - ], - "end": [ - 410, - 16 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 410, - 16 - ], - "end": [ - 410, - 18 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 410, - 19 - ], - "end": [ - 410, - 27 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "is", - "start": [ - 410, - 28 - ], - "end": [ - 410, - 30 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 410, - 31 - ], - "end": [ - 410, - 35 - ], - "line": " if filename is None:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 410, - 35 - ], - "end": [ - 410, - 36 - ], - "line": " if filename is None:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 410, - 36 - ], - "end": [ - 411, - 0 - ], - "line": " if filename is None:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 411, - 0 - ], - "end": [ - 411, - 20 - ], - "line": " msg = 'encoding problem: utf-8'\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 411, - 20 - ], - "end": [ - 411, - 23 - ], - "line": " msg = 'encoding problem: utf-8'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 411, - 24 - ], - "end": [ - 411, - 25 - ], - "line": " msg = 'encoding problem: utf-8'\n" - }, - { - "typ": "STRING", - "string": "'encoding problem: utf-8'", - "start": [ - 411, - 26 - ], - "end": [ - 411, - 51 - ], - "line": " msg = 'encoding problem: utf-8'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 411, - 51 - ], - "end": [ - 412, - 0 - ], - "line": " msg = 'encoding problem: utf-8'\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 412, - 16 - ], - "end": [ - 412, - 16 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 412, - 16 - ], - "end": [ - 412, - 20 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 412, - 20 - ], - "end": [ - 412, - 21 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 412, - 21 - ], - "end": [ - 413, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 413, - 0 - ], - "end": [ - 413, - 20 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 413, - 20 - ], - "end": [ - 413, - 23 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 413, - 24 - ], - "end": [ - 413, - 25 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "STRING", - "string": "'encoding problem for {!r}: utf-8'", - "start": [ - 413, - 26 - ], - "end": [ - 413, - 60 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 413, - 60 - ], - "end": [ - 413, - 61 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "NAME", - "string": "format", - "start": [ - 413, - 61 - ], - "end": [ - 413, - 67 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 413, - 67 - ], - "end": [ - 413, - 68 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 413, - 68 - ], - "end": [ - 413, - 76 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 413, - 76 - ], - "end": [ - 413, - 77 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 413, - 77 - ], - "end": [ - 414, - 0 - ], - "line": " msg = 'encoding problem for {!r}: utf-8'.format(filename)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 414, - 16 - ], - "end": [ - 414, - 16 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 414, - 16 - ], - "end": [ - 414, - 21 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "SyntaxError", - "start": [ - 414, - 22 - ], - "end": [ - 414, - 33 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 414, - 33 - ], - "end": [ - 414, - 34 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 414, - 34 - ], - "end": [ - 414, - 37 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 414, - 37 - ], - "end": [ - 414, - 38 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 414, - 38 - ], - "end": [ - 415, - 0 - ], - "line": " raise SyntaxError(msg)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 415, - 12 - ], - "end": [ - 415, - 12 - ], - "line": " encoding += '-sig'\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 415, - 12 - ], - "end": [ - 415, - 20 - ], - "line": " encoding += '-sig'\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 415, - 21 - ], - "end": [ - 415, - 23 - ], - "line": " encoding += '-sig'\n" - }, - { - "typ": "STRING", - "string": "'-sig'", - "start": [ - 415, - 24 - ], - "end": [ - 415, - 30 - ], - "line": " encoding += '-sig'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 415, - 30 - ], - "end": [ - 416, - 0 - ], - "line": " encoding += '-sig'\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 416, - 8 - ], - "end": [ - 416, - 8 - ], - "line": " return encoding\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 416, - 8 - ], - "end": [ - 416, - 14 - ], - "line": " return encoding\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 416, - 15 - ], - "end": [ - 416, - 23 - ], - "line": " return encoding\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 416, - 23 - ], - "end": [ - 417, - 0 - ], - "line": " return encoding\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 417, - 0 - ], - "end": [ - 418, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 418, - 4 - ], - "end": [ - 418, - 4 - ], - "line": " first = read_or_stop()\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 418, - 4 - ], - "end": [ - 418, - 9 - ], - "line": " first = read_or_stop()\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 418, - 10 - ], - "end": [ - 418, - 11 - ], - "line": " first = read_or_stop()\n" - }, - { - "typ": "NAME", - "string": "read_or_stop", - "start": [ - 418, - 12 - ], - "end": [ - 418, - 24 - ], - "line": " first = read_or_stop()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 418, - 24 - ], - "end": [ - 418, - 25 - ], - "line": " first = read_or_stop()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 418, - 25 - ], - "end": [ - 418, - 26 - ], - "line": " first = read_or_stop()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 418, - 26 - ], - "end": [ - 419, - 0 - ], - "line": " first = read_or_stop()\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 419, - 4 - ], - "end": [ - 419, - 6 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 419, - 7 - ], - "end": [ - 419, - 12 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 419, - 12 - ], - "end": [ - 419, - 13 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "NAME", - "string": "startswith", - "start": [ - 419, - 13 - ], - "end": [ - 419, - 23 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 419, - 23 - ], - "end": [ - 419, - 24 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "NAME", - "string": "BOM_UTF8", - "start": [ - 419, - 24 - ], - "end": [ - 419, - 32 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 419, - 32 - ], - "end": [ - 419, - 33 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 419, - 33 - ], - "end": [ - 419, - 34 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 419, - 34 - ], - "end": [ - 420, - 0 - ], - "line": " if first.startswith(BOM_UTF8):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 420, - 0 - ], - "end": [ - 420, - 8 - ], - "line": " bom_found = True\n" - }, - { - "typ": "NAME", - "string": "bom_found", - "start": [ - 420, - 8 - ], - "end": [ - 420, - 17 - ], - "line": " bom_found = True\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 420, - 18 - ], - "end": [ - 420, - 19 - ], - "line": " bom_found = True\n" - }, - { - "typ": "NAME", - "string": "True", - "start": [ - 420, - 20 - ], - "end": [ - 420, - 24 - ], - "line": " bom_found = True\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 420, - 24 - ], - "end": [ - 421, - 0 - ], - "line": " bom_found = True\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 421, - 8 - ], - "end": [ - 421, - 13 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 421, - 14 - ], - "end": [ - 421, - 15 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 421, - 16 - ], - "end": [ - 421, - 21 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 421, - 21 - ], - "end": [ - 421, - 22 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "NUMBER", - "string": "3", - "start": [ - 421, - 22 - ], - "end": [ - 421, - 23 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 421, - 23 - ], - "end": [ - 421, - 24 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 421, - 24 - ], - "end": [ - 421, - 25 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 421, - 25 - ], - "end": [ - 422, - 0 - ], - "line": " first = first[3:]\n" - }, - { - "typ": "NAME", - "string": "default", - "start": [ - 422, - 8 - ], - "end": [ - 422, - 15 - ], - "line": " default = 'utf-8-sig'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 422, - 16 - ], - "end": [ - 422, - 17 - ], - "line": " default = 'utf-8-sig'\n" - }, - { - "typ": "STRING", - "string": "'utf-8-sig'", - "start": [ - 422, - 18 - ], - "end": [ - 422, - 29 - ], - "line": " default = 'utf-8-sig'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 422, - 29 - ], - "end": [ - 423, - 0 - ], - "line": " default = 'utf-8-sig'\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 423, - 4 - ], - "end": [ - 423, - 4 - ], - "line": " if not first:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 423, - 4 - ], - "end": [ - 423, - 6 - ], - "line": " if not first:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 423, - 7 - ], - "end": [ - 423, - 10 - ], - "line": " if not first:\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 423, - 11 - ], - "end": [ - 423, - 16 - ], - "line": " if not first:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 423, - 16 - ], - "end": [ - 423, - 17 - ], - "line": " if not first:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 423, - 17 - ], - "end": [ - 424, - 0 - ], - "line": " if not first:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 424, - 0 - ], - "end": [ - 424, - 8 - ], - "line": " return default, []\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 424, - 8 - ], - "end": [ - 424, - 14 - ], - "line": " return default, []\n" - }, - { - "typ": "NAME", - "string": "default", - "start": [ - 424, - 15 - ], - "end": [ - 424, - 22 - ], - "line": " return default, []\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 424, - 22 - ], - "end": [ - 424, - 23 - ], - "line": " return default, []\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 424, - 24 - ], - "end": [ - 424, - 25 - ], - "line": " return default, []\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 424, - 25 - ], - "end": [ - 424, - 26 - ], - "line": " return default, []\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 424, - 26 - ], - "end": [ - 425, - 0 - ], - "line": " return default, []\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 425, - 0 - ], - "end": [ - 426, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 426, - 4 - ], - "end": [ - 426, - 4 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 426, - 4 - ], - "end": [ - 426, - 12 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 426, - 13 - ], - "end": [ - 426, - 14 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "NAME", - "string": "find_cookie", - "start": [ - 426, - 15 - ], - "end": [ - 426, - 26 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 426, - 26 - ], - "end": [ - 426, - 27 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 426, - 27 - ], - "end": [ - 426, - 32 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 426, - 32 - ], - "end": [ - 426, - 33 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 426, - 33 - ], - "end": [ - 427, - 0 - ], - "line": " encoding = find_cookie(first)\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 427, - 4 - ], - "end": [ - 427, - 6 - ], - "line": " if encoding:\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 427, - 7 - ], - "end": [ - 427, - 15 - ], - "line": " if encoding:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 427, - 15 - ], - "end": [ - 427, - 16 - ], - "line": " if encoding:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 427, - 16 - ], - "end": [ - 428, - 0 - ], - "line": " if encoding:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 428, - 0 - ], - "end": [ - 428, - 8 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 428, - 8 - ], - "end": [ - 428, - 14 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 428, - 15 - ], - "end": [ - 428, - 23 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 428, - 23 - ], - "end": [ - 428, - 24 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 428, - 25 - ], - "end": [ - 428, - 26 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 428, - 26 - ], - "end": [ - 428, - 31 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 428, - 31 - ], - "end": [ - 428, - 32 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 428, - 32 - ], - "end": [ - 429, - 0 - ], - "line": " return encoding, [first]\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 429, - 4 - ], - "end": [ - 429, - 4 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 429, - 4 - ], - "end": [ - 429, - 6 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 429, - 7 - ], - "end": [ - 429, - 10 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "NAME", - "string": "blank_re", - "start": [ - 429, - 11 - ], - "end": [ - 429, - 19 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 429, - 19 - ], - "end": [ - 429, - 20 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 429, - 20 - ], - "end": [ - 429, - 25 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 429, - 25 - ], - "end": [ - 429, - 26 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 429, - 26 - ], - "end": [ - 429, - 31 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 429, - 31 - ], - "end": [ - 429, - 32 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 429, - 32 - ], - "end": [ - 429, - 33 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 429, - 33 - ], - "end": [ - 430, - 0 - ], - "line": " if not blank_re.match(first):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 430, - 0 - ], - "end": [ - 430, - 8 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 430, - 8 - ], - "end": [ - 430, - 14 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NAME", - "string": "default", - "start": [ - 430, - 15 - ], - "end": [ - 430, - 22 - ], - "line": " return default, [first]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 430, - 22 - ], - "end": [ - 430, - 23 - ], - "line": " return default, [first]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 430, - 24 - ], - "end": [ - 430, - 25 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 430, - 25 - ], - "end": [ - 430, - 30 - ], - "line": " return default, [first]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 430, - 30 - ], - "end": [ - 430, - 31 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 430, - 31 - ], - "end": [ - 431, - 0 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 431, - 0 - ], - "end": [ - 432, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 432, - 4 - ], - "end": [ - 432, - 4 - ], - "line": " second = read_or_stop()\n" - }, - { - "typ": "NAME", - "string": "second", - "start": [ - 432, - 4 - ], - "end": [ - 432, - 10 - ], - "line": " second = read_or_stop()\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 432, - 11 - ], - "end": [ - 432, - 12 - ], - "line": " second = read_or_stop()\n" - }, - { - "typ": "NAME", - "string": "read_or_stop", - "start": [ - 432, - 13 - ], - "end": [ - 432, - 25 - ], - "line": " second = read_or_stop()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 432, - 25 - ], - "end": [ - 432, - 26 - ], - "line": " second = read_or_stop()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 432, - 26 - ], - "end": [ - 432, - 27 - ], - "line": " second = read_or_stop()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 432, - 27 - ], - "end": [ - 433, - 0 - ], - "line": " second = read_or_stop()\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 433, - 4 - ], - "end": [ - 433, - 6 - ], - "line": " if not second:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 433, - 7 - ], - "end": [ - 433, - 10 - ], - "line": " if not second:\n" - }, - { - "typ": "NAME", - "string": "second", - "start": [ - 433, - 11 - ], - "end": [ - 433, - 17 - ], - "line": " if not second:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 433, - 17 - ], - "end": [ - 433, - 18 - ], - "line": " if not second:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 433, - 18 - ], - "end": [ - 434, - 0 - ], - "line": " if not second:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 434, - 0 - ], - "end": [ - 434, - 8 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 434, - 8 - ], - "end": [ - 434, - 14 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NAME", - "string": "default", - "start": [ - 434, - 15 - ], - "end": [ - 434, - 22 - ], - "line": " return default, [first]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 434, - 22 - ], - "end": [ - 434, - 23 - ], - "line": " return default, [first]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 434, - 24 - ], - "end": [ - 434, - 25 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 434, - 25 - ], - "end": [ - 434, - 30 - ], - "line": " return default, [first]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 434, - 30 - ], - "end": [ - 434, - 31 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 434, - 31 - ], - "end": [ - 435, - 0 - ], - "line": " return default, [first]\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 435, - 0 - ], - "end": [ - 436, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 436, - 4 - ], - "end": [ - 436, - 4 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 436, - 4 - ], - "end": [ - 436, - 12 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 436, - 13 - ], - "end": [ - 436, - 14 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "NAME", - "string": "find_cookie", - "start": [ - 436, - 15 - ], - "end": [ - 436, - 26 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 436, - 26 - ], - "end": [ - 436, - 27 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "NAME", - "string": "second", - "start": [ - 436, - 27 - ], - "end": [ - 436, - 33 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 436, - 33 - ], - "end": [ - 436, - 34 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 436, - 34 - ], - "end": [ - 437, - 0 - ], - "line": " encoding = find_cookie(second)\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 437, - 4 - ], - "end": [ - 437, - 6 - ], - "line": " if encoding:\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 437, - 7 - ], - "end": [ - 437, - 15 - ], - "line": " if encoding:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 437, - 15 - ], - "end": [ - 437, - 16 - ], - "line": " if encoding:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 437, - 16 - ], - "end": [ - 438, - 0 - ], - "line": " if encoding:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 438, - 0 - ], - "end": [ - 438, - 8 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 438, - 8 - ], - "end": [ - 438, - 14 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 438, - 15 - ], - "end": [ - 438, - 23 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 438, - 23 - ], - "end": [ - 438, - 24 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 438, - 25 - ], - "end": [ - 438, - 26 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 438, - 26 - ], - "end": [ - 438, - 31 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 438, - 31 - ], - "end": [ - 438, - 32 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "NAME", - "string": "second", - "start": [ - 438, - 33 - ], - "end": [ - 438, - 39 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 438, - 39 - ], - "end": [ - 438, - 40 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 438, - 40 - ], - "end": [ - 439, - 0 - ], - "line": " return encoding, [first, second]\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 439, - 0 - ], - "end": [ - 440, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 440, - 4 - ], - "end": [ - 440, - 4 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 440, - 4 - ], - "end": [ - 440, - 10 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "NAME", - "string": "default", - "start": [ - 440, - 11 - ], - "end": [ - 440, - 18 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 440, - 18 - ], - "end": [ - 440, - 19 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 440, - 20 - ], - "end": [ - 440, - 21 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "NAME", - "string": "first", - "start": [ - 440, - 21 - ], - "end": [ - 440, - 26 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 440, - 26 - ], - "end": [ - 440, - 27 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "NAME", - "string": "second", - "start": [ - 440, - 28 - ], - "end": [ - 440, - 34 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 440, - 34 - ], - "end": [ - 440, - 35 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 440, - 35 - ], - "end": [ - 441, - 0 - ], - "line": " return default, [first, second]\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 441, - 0 - ], - "end": [ - 442, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 442, - 0 - ], - "end": [ - 443, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 443, - 0 - ], - "end": [ - 443, - 0 - ], - "line": "def open(filename):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 443, - 0 - ], - "end": [ - 443, - 3 - ], - "line": "def open(filename):\n" - }, - { - "typ": "NAME", - "string": "open", - "start": [ - 443, - 4 - ], - "end": [ - 443, - 8 - ], - "line": "def open(filename):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 443, - 8 - ], - "end": [ - 443, - 9 - ], - "line": "def open(filename):\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 443, - 9 - ], - "end": [ - 443, - 17 - ], - "line": "def open(filename):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 443, - 17 - ], - "end": [ - 443, - 18 - ], - "line": "def open(filename):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 443, - 18 - ], - "end": [ - 443, - 19 - ], - "line": "def open(filename):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 443, - 19 - ], - "end": [ - 444, - 0 - ], - "line": "def open(filename):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 444, - 0 - ], - "end": [ - 444, - 4 - ], - "line": " \"\"\"Open a file in read only mode using the encoding detected by\n" - }, - { - "typ": "STRING", - "string": "\"\"\"Open a file in read only mode using the encoding detected by\n detect_encoding().\n \"\"\"", - "start": [ - 444, - 4 - ], - "end": [ - 446, - 7 - ], - "line": " \"\"\"Open a file in read only mode using the encoding detected by\n detect_encoding().\n \"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 446, - 7 - ], - "end": [ - 447, - 0 - ], - "line": " \"\"\"\n" - }, - { - "typ": "NAME", - "string": "buffer", - "start": [ - 447, - 4 - ], - "end": [ - 447, - 10 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 447, - 11 - ], - "end": [ - 447, - 12 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "NAME", - "string": "_builtin_open", - "start": [ - 447, - 13 - ], - "end": [ - 447, - 26 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 447, - 26 - ], - "end": [ - 447, - 27 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 447, - 27 - ], - "end": [ - 447, - 35 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 447, - 35 - ], - "end": [ - 447, - 36 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "STRING", - "string": "'rb'", - "start": [ - 447, - 37 - ], - "end": [ - 447, - 41 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 447, - 41 - ], - "end": [ - 447, - 42 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 447, - 42 - ], - "end": [ - 448, - 0 - ], - "line": " buffer = _builtin_open(filename, 'rb')\n" - }, - { - "typ": "NAME", - "string": "try", - "start": [ - 448, - 4 - ], - "end": [ - 448, - 7 - ], - "line": " try:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 448, - 7 - ], - "end": [ - 448, - 8 - ], - "line": " try:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 448, - 8 - ], - "end": [ - 449, - 0 - ], - "line": " try:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 449, - 0 - ], - "end": [ - 449, - 8 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 449, - 8 - ], - "end": [ - 449, - 16 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 449, - 16 - ], - "end": [ - 449, - 17 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "NAME", - "string": "lines", - "start": [ - 449, - 18 - ], - "end": [ - 449, - 23 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 449, - 24 - ], - "end": [ - 449, - 25 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "NAME", - "string": "detect_encoding", - "start": [ - 449, - 26 - ], - "end": [ - 449, - 41 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 449, - 41 - ], - "end": [ - 449, - 42 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "NAME", - "string": "buffer", - "start": [ - 449, - 42 - ], - "end": [ - 449, - 48 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 449, - 48 - ], - "end": [ - 449, - 49 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 449, - 49 - ], - "end": [ - 449, - 57 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 449, - 57 - ], - "end": [ - 449, - 58 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 449, - 58 - ], - "end": [ - 450, - 0 - ], - "line": " encoding, lines = detect_encoding(buffer.readline)\n" - }, - { - "typ": "NAME", - "string": "buffer", - "start": [ - 450, - 8 - ], - "end": [ - 450, - 14 - ], - "line": " buffer.seek(0)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 450, - 14 - ], - "end": [ - 450, - 15 - ], - "line": " buffer.seek(0)\n" - }, - { - "typ": "NAME", - "string": "seek", - "start": [ - 450, - 15 - ], - "end": [ - 450, - 19 - ], - "line": " buffer.seek(0)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 450, - 19 - ], - "end": [ - 450, - 20 - ], - "line": " buffer.seek(0)\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 450, - 20 - ], - "end": [ - 450, - 21 - ], - "line": " buffer.seek(0)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 450, - 21 - ], - "end": [ - 450, - 22 - ], - "line": " buffer.seek(0)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 450, - 22 - ], - "end": [ - 451, - 0 - ], - "line": " buffer.seek(0)\n" - }, - { - "typ": "NAME", - "string": "text", - "start": [ - 451, - 8 - ], - "end": [ - 451, - 12 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 451, - 13 - ], - "end": [ - 451, - 14 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "NAME", - "string": "TextIOWrapper", - "start": [ - 451, - 15 - ], - "end": [ - 451, - 28 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 451, - 28 - ], - "end": [ - 451, - 29 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "NAME", - "string": "buffer", - "start": [ - 451, - 29 - ], - "end": [ - 451, - 35 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 451, - 35 - ], - "end": [ - 451, - 36 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 451, - 37 - ], - "end": [ - 451, - 45 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 451, - 45 - ], - "end": [ - 451, - 46 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "NAME", - "string": "line_buffering", - "start": [ - 451, - 47 - ], - "end": [ - 451, - 61 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 451, - 61 - ], - "end": [ - 451, - 62 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "NAME", - "string": "True", - "start": [ - 451, - 62 - ], - "end": [ - 451, - 66 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 451, - 66 - ], - "end": [ - 451, - 67 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 451, - 67 - ], - "end": [ - 452, - 0 - ], - "line": " text = TextIOWrapper(buffer, encoding, line_buffering=True)\n" - }, - { - "typ": "NAME", - "string": "text", - "start": [ - 452, - 8 - ], - "end": [ - 452, - 12 - ], - "line": " text.mode = 'r'\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 452, - 12 - ], - "end": [ - 452, - 13 - ], - "line": " text.mode = 'r'\n" - }, - { - "typ": "NAME", - "string": "mode", - "start": [ - 452, - 13 - ], - "end": [ - 452, - 17 - ], - "line": " text.mode = 'r'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 452, - 18 - ], - "end": [ - 452, - 19 - ], - "line": " text.mode = 'r'\n" - }, - { - "typ": "STRING", - "string": "'r'", - "start": [ - 452, - 20 - ], - "end": [ - 452, - 23 - ], - "line": " text.mode = 'r'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 452, - 23 - ], - "end": [ - 453, - 0 - ], - "line": " text.mode = 'r'\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 453, - 8 - ], - "end": [ - 453, - 14 - ], - "line": " return text\n" - }, - { - "typ": "NAME", - "string": "text", - "start": [ - 453, - 15 - ], - "end": [ - 453, - 19 - ], - "line": " return text\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 453, - 19 - ], - "end": [ - 454, - 0 - ], - "line": " return text\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 454, - 4 - ], - "end": [ - 454, - 4 - ], - "line": " except:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 454, - 4 - ], - "end": [ - 454, - 10 - ], - "line": " except:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 454, - 10 - ], - "end": [ - 454, - 11 - ], - "line": " except:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 454, - 11 - ], - "end": [ - 455, - 0 - ], - "line": " except:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 455, - 0 - ], - "end": [ - 455, - 8 - ], - "line": " buffer.close()\n" - }, - { - "typ": "NAME", - "string": "buffer", - "start": [ - 455, - 8 - ], - "end": [ - 455, - 14 - ], - "line": " buffer.close()\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 455, - 14 - ], - "end": [ - 455, - 15 - ], - "line": " buffer.close()\n" - }, - { - "typ": "NAME", - "string": "close", - "start": [ - 455, - 15 - ], - "end": [ - 455, - 20 - ], - "line": " buffer.close()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 455, - 20 - ], - "end": [ - 455, - 21 - ], - "line": " buffer.close()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 455, - 21 - ], - "end": [ - 455, - 22 - ], - "line": " buffer.close()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 455, - 22 - ], - "end": [ - 456, - 0 - ], - "line": " buffer.close()\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 456, - 8 - ], - "end": [ - 456, - 13 - ], - "line": " raise\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 456, - 13 - ], - "end": [ - 457, - 0 - ], - "line": " raise\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 457, - 0 - ], - "end": [ - 458, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 458, - 0 - ], - "end": [ - 459, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 459, - 0 - ], - "end": [ - 459, - 0 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 459, - 0 - ], - "end": [ - 459, - 0 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 459, - 0 - ], - "end": [ - 459, - 3 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "NAME", - "string": "tokenize", - "start": [ - 459, - 4 - ], - "end": [ - 459, - 12 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 459, - 12 - ], - "end": [ - 459, - 13 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 459, - 13 - ], - "end": [ - 459, - 21 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 459, - 21 - ], - "end": [ - 459, - 22 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 459, - 22 - ], - "end": [ - 459, - 23 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 459, - 23 - ], - "end": [ - 460, - 0 - ], - "line": "def tokenize(readline):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 460, - 0 - ], - "end": [ - 460, - 4 - ], - "line": " \"\"\"\n" - }, - { - "typ": "STRING", - "string": "\"\"\"\n The tokenize() generator requires one argument, readline, which\n must be a callable object which provides the same interface as the\n readline() method of built-in file objects. Each call to the function\n should return one line of input as bytes. Alternatively, readline\n can be a callable function terminating with StopIteration:\n readline = open(myfile, 'rb').__next__ # Example of alternate readline\n\n The generator produces 5-tuples with these members: the token type; the\n token string; a 2-tuple (srow, scol) of ints specifying the row and\n column where the token begins in the source; a 2-tuple (erow, ecol) of\n ints specifying the row and column where the token ends in the source;\n and the line on which the token was found. The line passed is the\n logical line; continuation lines are included.\n\n The first token sequence will always be an ENCODING token\n which tells you which encoding was used to decode the bytes stream.\n \"\"\"", - "start": [ - 460, - 4 - ], - "end": [ - 477, - 7 - ], - "line": " \"\"\"\n The tokenize() generator requires one argument, readline, which\n must be a callable object which provides the same interface as the\n readline() method of built-in file objects. Each call to the function\n should return one line of input as bytes. Alternatively, readline\n can be a callable function terminating with StopIteration:\n readline = open(myfile, 'rb').__next__ # Example of alternate readline\n\n The generator produces 5-tuples with these members: the token type; the\n token string; a 2-tuple (srow, scol) of ints specifying the row and\n column where the token begins in the source; a 2-tuple (erow, ecol) of\n ints specifying the row and column where the token ends in the source;\n and the line on which the token was found. The line passed is the\n logical line; continuation lines are included.\n\n The first token sequence will always be an ENCODING token\n which tells you which encoding was used to decode the bytes stream.\n \"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 477, - 7 - ], - "end": [ - 478, - 0 - ], - "line": " \"\"\"\n" - }, - { - "typ": "COMMENT", - "string": "# This import is here to avoid problems when the itertools module is not", - "start": [ - 478, - 4 - ], - "end": [ - 478, - 76 - ], - "line": " # This import is here to avoid problems when the itertools module is not\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 478, - 76 - ], - "end": [ - 479, - 0 - ], - "line": " # This import is here to avoid problems when the itertools module is not\n" - }, - { - "typ": "COMMENT", - "string": "# built yet and tokenize is imported.", - "start": [ - 479, - 4 - ], - "end": [ - 479, - 41 - ], - "line": " # built yet and tokenize is imported.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 479, - 41 - ], - "end": [ - 480, - 0 - ], - "line": " # built yet and tokenize is imported.\n" - }, - { - "typ": "NAME", - "string": "from", - "start": [ - 480, - 4 - ], - "end": [ - 480, - 8 - ], - "line": " from itertools import chain, repeat\n" - }, - { - "typ": "NAME", - "string": "itertools", - "start": [ - 480, - 9 - ], - "end": [ - 480, - 18 - ], - "line": " from itertools import chain, repeat\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 480, - 19 - ], - "end": [ - 480, - 25 - ], - "line": " from itertools import chain, repeat\n" - }, - { - "typ": "NAME", - "string": "chain", - "start": [ - 480, - 26 - ], - "end": [ - 480, - 31 - ], - "line": " from itertools import chain, repeat\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 480, - 31 - ], - "end": [ - 480, - 32 - ], - "line": " from itertools import chain, repeat\n" - }, - { - "typ": "NAME", - "string": "repeat", - "start": [ - 480, - 33 - ], - "end": [ - 480, - 39 - ], - "line": " from itertools import chain, repeat\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 480, - 39 - ], - "end": [ - 481, - 0 - ], - "line": " from itertools import chain, repeat\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 481, - 4 - ], - "end": [ - 481, - 12 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 481, - 12 - ], - "end": [ - 481, - 13 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "NAME", - "string": "consumed", - "start": [ - 481, - 14 - ], - "end": [ - 481, - 22 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 481, - 23 - ], - "end": [ - 481, - 24 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "NAME", - "string": "detect_encoding", - "start": [ - 481, - 25 - ], - "end": [ - 481, - 40 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 481, - 40 - ], - "end": [ - 481, - 41 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 481, - 41 - ], - "end": [ - 481, - 49 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 481, - 49 - ], - "end": [ - 481, - 50 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 481, - 50 - ], - "end": [ - 482, - 0 - ], - "line": " encoding, consumed = detect_encoding(readline)\n" - }, - { - "typ": "NAME", - "string": "rl_gen", - "start": [ - 482, - 4 - ], - "end": [ - 482, - 10 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 482, - 11 - ], - "end": [ - 482, - 12 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "NAME", - "string": "iter", - "start": [ - 482, - 13 - ], - "end": [ - 482, - 17 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 482, - 17 - ], - "end": [ - 482, - 18 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 482, - 18 - ], - "end": [ - 482, - 26 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 482, - 26 - ], - "end": [ - 482, - 27 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "STRING", - "string": "b\"\"", - "start": [ - 482, - 28 - ], - "end": [ - 482, - 31 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 482, - 31 - ], - "end": [ - 482, - 32 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 482, - 32 - ], - "end": [ - 483, - 0 - ], - "line": " rl_gen = iter(readline, b\"\")\n" - }, - { - "typ": "NAME", - "string": "empty", - "start": [ - 483, - 4 - ], - "end": [ - 483, - 9 - ], - "line": " empty = repeat(b\"\")\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 483, - 10 - ], - "end": [ - 483, - 11 - ], - "line": " empty = repeat(b\"\")\n" - }, - { - "typ": "NAME", - "string": "repeat", - "start": [ - 483, - 12 - ], - "end": [ - 483, - 18 - ], - "line": " empty = repeat(b\"\")\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 483, - 18 - ], - "end": [ - 483, - 19 - ], - "line": " empty = repeat(b\"\")\n" - }, - { - "typ": "STRING", - "string": "b\"\"", - "start": [ - 483, - 19 - ], - "end": [ - 483, - 22 - ], - "line": " empty = repeat(b\"\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 483, - 22 - ], - "end": [ - 483, - 23 - ], - "line": " empty = repeat(b\"\")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 483, - 23 - ], - "end": [ - 484, - 0 - ], - "line": " empty = repeat(b\"\")\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 484, - 4 - ], - "end": [ - 484, - 10 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NAME", - "string": "_tokenize", - "start": [ - 484, - 11 - ], - "end": [ - 484, - 20 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 484, - 20 - ], - "end": [ - 484, - 21 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NAME", - "string": "chain", - "start": [ - 484, - 21 - ], - "end": [ - 484, - 26 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 484, - 26 - ], - "end": [ - 484, - 27 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NAME", - "string": "consumed", - "start": [ - 484, - 27 - ], - "end": [ - 484, - 35 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 484, - 35 - ], - "end": [ - 484, - 36 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NAME", - "string": "rl_gen", - "start": [ - 484, - 37 - ], - "end": [ - 484, - 43 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 484, - 43 - ], - "end": [ - 484, - 44 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NAME", - "string": "empty", - "start": [ - 484, - 45 - ], - "end": [ - 484, - 50 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 484, - 50 - ], - "end": [ - 484, - 51 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 484, - 51 - ], - "end": [ - 484, - 52 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NAME", - "string": "__next__", - "start": [ - 484, - 52 - ], - "end": [ - 484, - 60 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 484, - 60 - ], - "end": [ - 484, - 61 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 484, - 62 - ], - "end": [ - 484, - 70 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 484, - 70 - ], - "end": [ - 484, - 71 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 484, - 71 - ], - "end": [ - 485, - 0 - ], - "line": " return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 485, - 0 - ], - "end": [ - 486, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 486, - 0 - ], - "end": [ - 487, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 487, - 0 - ], - "end": [ - 487, - 0 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 487, - 0 - ], - "end": [ - 487, - 3 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "NAME", - "string": "_tokenize", - "start": [ - 487, - 4 - ], - "end": [ - 487, - 13 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 487, - 13 - ], - "end": [ - 487, - 14 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 487, - 14 - ], - "end": [ - 487, - 22 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 487, - 22 - ], - "end": [ - 487, - 23 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 487, - 24 - ], - "end": [ - 487, - 32 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 487, - 32 - ], - "end": [ - 487, - 33 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 487, - 33 - ], - "end": [ - 487, - 34 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 487, - 34 - ], - "end": [ - 488, - 0 - ], - "line": "def _tokenize(readline, encoding):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 488, - 0 - ], - "end": [ - 488, - 4 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 488, - 4 - ], - "end": [ - 488, - 8 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 488, - 9 - ], - "end": [ - 488, - 10 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "NAME", - "string": "parenlev", - "start": [ - 488, - 11 - ], - "end": [ - 488, - 19 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 488, - 20 - ], - "end": [ - 488, - 21 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "NAME", - "string": "continued", - "start": [ - 488, - 22 - ], - "end": [ - 488, - 31 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 488, - 32 - ], - "end": [ - 488, - 33 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 488, - 34 - ], - "end": [ - 488, - 35 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 488, - 35 - ], - "end": [ - 489, - 0 - ], - "line": " lnum = parenlev = continued = 0\n" - }, - { - "typ": "NAME", - "string": "numchars", - "start": [ - 489, - 4 - ], - "end": [ - 489, - 12 - ], - "line": " numchars = '0123456789'\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 489, - 13 - ], - "end": [ - 489, - 14 - ], - "line": " numchars = '0123456789'\n" - }, - { - "typ": "STRING", - "string": "'0123456789'", - "start": [ - 489, - 15 - ], - "end": [ - 489, - 27 - ], - "line": " numchars = '0123456789'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 489, - 27 - ], - "end": [ - 490, - 0 - ], - "line": " numchars = '0123456789'\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 490, - 4 - ], - "end": [ - 490, - 11 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 490, - 11 - ], - "end": [ - 490, - 12 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NAME", - "string": "needcont", - "start": [ - 490, - 13 - ], - "end": [ - 490, - 21 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 490, - 22 - ], - "end": [ - 490, - 23 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 490, - 24 - ], - "end": [ - 490, - 26 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 490, - 26 - ], - "end": [ - 490, - 27 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 490, - 28 - ], - "end": [ - 490, - 29 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 490, - 29 - ], - "end": [ - 491, - 0 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 491, - 4 - ], - "end": [ - 491, - 12 - ], - "line": " contline = None\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 491, - 13 - ], - "end": [ - 491, - 14 - ], - "line": " contline = None\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 491, - 15 - ], - "end": [ - 491, - 19 - ], - "line": " contline = None\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 491, - 19 - ], - "end": [ - 492, - 0 - ], - "line": " contline = None\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 492, - 4 - ], - "end": [ - 492, - 11 - ], - "line": " indents = [0]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 492, - 12 - ], - "end": [ - 492, - 13 - ], - "line": " indents = [0]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 492, - 14 - ], - "end": [ - 492, - 15 - ], - "line": " indents = [0]\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 492, - 15 - ], - "end": [ - 492, - 16 - ], - "line": " indents = [0]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 492, - 16 - ], - "end": [ - 492, - 17 - ], - "line": " indents = [0]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 492, - 17 - ], - "end": [ - 493, - 0 - ], - "line": " indents = [0]\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 493, - 0 - ], - "end": [ - 494, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 494, - 4 - ], - "end": [ - 494, - 6 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 494, - 7 - ], - "end": [ - 494, - 15 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "is", - "start": [ - 494, - 16 - ], - "end": [ - 494, - 18 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 494, - 19 - ], - "end": [ - 494, - 22 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 494, - 23 - ], - "end": [ - 494, - 27 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 494, - 27 - ], - "end": [ - 494, - 28 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 494, - 28 - ], - "end": [ - 495, - 0 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 495, - 0 - ], - "end": [ - 495, - 8 - ], - "line": " if encoding == \"utf-8-sig\":\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 495, - 8 - ], - "end": [ - 495, - 10 - ], - "line": " if encoding == \"utf-8-sig\":\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 495, - 11 - ], - "end": [ - 495, - 19 - ], - "line": " if encoding == \"utf-8-sig\":\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 495, - 20 - ], - "end": [ - 495, - 22 - ], - "line": " if encoding == \"utf-8-sig\":\n" - }, - { - "typ": "STRING", - "string": "\"utf-8-sig\"", - "start": [ - 495, - 23 - ], - "end": [ - 495, - 34 - ], - "line": " if encoding == \"utf-8-sig\":\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 495, - 34 - ], - "end": [ - 495, - 35 - ], - "line": " if encoding == \"utf-8-sig\":\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 495, - 35 - ], - "end": [ - 496, - 0 - ], - "line": " if encoding == \"utf-8-sig\":\n" - }, - { - "typ": "COMMENT", - "string": "# BOM will already have been stripped.", - "start": [ - 496, - 12 - ], - "end": [ - 496, - 50 - ], - "line": " # BOM will already have been stripped.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 496, - 50 - ], - "end": [ - 497, - 0 - ], - "line": " # BOM will already have been stripped.\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 497, - 0 - ], - "end": [ - 497, - 12 - ], - "line": " encoding = \"utf-8\"\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 497, - 12 - ], - "end": [ - 497, - 20 - ], - "line": " encoding = \"utf-8\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 497, - 21 - ], - "end": [ - 497, - 22 - ], - "line": " encoding = \"utf-8\"\n" - }, - { - "typ": "STRING", - "string": "\"utf-8\"", - "start": [ - 497, - 23 - ], - "end": [ - 497, - 30 - ], - "line": " encoding = \"utf-8\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 497, - 30 - ], - "end": [ - 498, - 0 - ], - "line": " encoding = \"utf-8\"\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 498, - 8 - ], - "end": [ - 498, - 8 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 498, - 8 - ], - "end": [ - 498, - 13 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 498, - 14 - ], - "end": [ - 498, - 23 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 498, - 23 - ], - "end": [ - 498, - 24 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NAME", - "string": "ENCODING", - "start": [ - 498, - 24 - ], - "end": [ - 498, - 32 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 498, - 32 - ], - "end": [ - 498, - 33 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 498, - 34 - ], - "end": [ - 498, - 42 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 498, - 42 - ], - "end": [ - 498, - 43 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 498, - 44 - ], - "end": [ - 498, - 45 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 498, - 45 - ], - "end": [ - 498, - 46 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 498, - 46 - ], - "end": [ - 498, - 47 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 498, - 48 - ], - "end": [ - 498, - 49 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 498, - 49 - ], - "end": [ - 498, - 50 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 498, - 50 - ], - "end": [ - 498, - 51 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 498, - 52 - ], - "end": [ - 498, - 53 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 498, - 53 - ], - "end": [ - 498, - 54 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 498, - 54 - ], - "end": [ - 498, - 55 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 498, - 56 - ], - "end": [ - 498, - 57 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 498, - 57 - ], - "end": [ - 498, - 58 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 498, - 58 - ], - "end": [ - 498, - 59 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 498, - 60 - ], - "end": [ - 498, - 62 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 498, - 62 - ], - "end": [ - 498, - 63 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 498, - 63 - ], - "end": [ - 499, - 0 - ], - "line": " yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 499, - 4 - ], - "end": [ - 499, - 4 - ], - "line": " last_line = b''\n" - }, - { - "typ": "NAME", - "string": "last_line", - "start": [ - 499, - 4 - ], - "end": [ - 499, - 13 - ], - "line": " last_line = b''\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 499, - 14 - ], - "end": [ - 499, - 15 - ], - "line": " last_line = b''\n" - }, - { - "typ": "STRING", - "string": "b''", - "start": [ - 499, - 16 - ], - "end": [ - 499, - 19 - ], - "line": " last_line = b''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 499, - 19 - ], - "end": [ - 500, - 0 - ], - "line": " last_line = b''\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 500, - 4 - ], - "end": [ - 500, - 8 - ], - "line": " line = b''\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 500, - 9 - ], - "end": [ - 500, - 10 - ], - "line": " line = b''\n" - }, - { - "typ": "STRING", - "string": "b''", - "start": [ - 500, - 11 - ], - "end": [ - 500, - 14 - ], - "line": " line = b''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 500, - 14 - ], - "end": [ - 501, - 0 - ], - "line": " line = b''\n" - }, - { - "typ": "NAME", - "string": "while", - "start": [ - 501, - 4 - ], - "end": [ - 501, - 9 - ], - "line": " while True: # loop over lines in stream\n" - }, - { - "typ": "NAME", - "string": "True", - "start": [ - 501, - 10 - ], - "end": [ - 501, - 14 - ], - "line": " while True: # loop over lines in stream\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 501, - 14 - ], - "end": [ - 501, - 15 - ], - "line": " while True: # loop over lines in stream\n" - }, - { - "typ": "COMMENT", - "string": "# loop over lines in stream", - "start": [ - 501, - 47 - ], - "end": [ - 501, - 74 - ], - "line": " while True: # loop over lines in stream\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 501, - 74 - ], - "end": [ - 502, - 0 - ], - "line": " while True: # loop over lines in stream\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 502, - 0 - ], - "end": [ - 502, - 8 - ], - "line": " try:\n" - }, - { - "typ": "NAME", - "string": "try", - "start": [ - 502, - 8 - ], - "end": [ - 502, - 11 - ], - "line": " try:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 502, - 11 - ], - "end": [ - 502, - 12 - ], - "line": " try:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 502, - 12 - ], - "end": [ - 503, - 0 - ], - "line": " try:\n" - }, - { - "typ": "COMMENT", - "string": "# We capture the value of the line variable here because", - "start": [ - 503, - 12 - ], - "end": [ - 503, - 68 - ], - "line": " # We capture the value of the line variable here because\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 503, - 68 - ], - "end": [ - 504, - 0 - ], - "line": " # We capture the value of the line variable here because\n" - }, - { - "typ": "COMMENT", - "string": "# readline uses the empty string '' to signal end of input,", - "start": [ - 504, - 12 - ], - "end": [ - 504, - 71 - ], - "line": " # readline uses the empty string '' to signal end of input,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 504, - 71 - ], - "end": [ - 505, - 0 - ], - "line": " # readline uses the empty string '' to signal end of input,\n" - }, - { - "typ": "COMMENT", - "string": "# hence `line` itself will always be overwritten at the end", - "start": [ - 505, - 12 - ], - "end": [ - 505, - 71 - ], - "line": " # hence `line` itself will always be overwritten at the end\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 505, - 71 - ], - "end": [ - 506, - 0 - ], - "line": " # hence `line` itself will always be overwritten at the end\n" - }, - { - "typ": "COMMENT", - "string": "# of this loop.", - "start": [ - 506, - 12 - ], - "end": [ - 506, - 27 - ], - "line": " # of this loop.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 506, - 27 - ], - "end": [ - 507, - 0 - ], - "line": " # of this loop.\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 507, - 0 - ], - "end": [ - 507, - 12 - ], - "line": " last_line = line\n" - }, - { - "typ": "NAME", - "string": "last_line", - "start": [ - 507, - 12 - ], - "end": [ - 507, - 21 - ], - "line": " last_line = line\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 507, - 22 - ], - "end": [ - 507, - 23 - ], - "line": " last_line = line\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 507, - 24 - ], - "end": [ - 507, - 28 - ], - "line": " last_line = line\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 507, - 28 - ], - "end": [ - 508, - 0 - ], - "line": " last_line = line\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 508, - 12 - ], - "end": [ - 508, - 16 - ], - "line": " line = readline()\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 508, - 17 - ], - "end": [ - 508, - 18 - ], - "line": " line = readline()\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 508, - 19 - ], - "end": [ - 508, - 27 - ], - "line": " line = readline()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 508, - 27 - ], - "end": [ - 508, - 28 - ], - "line": " line = readline()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 508, - 28 - ], - "end": [ - 508, - 29 - ], - "line": " line = readline()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 508, - 29 - ], - "end": [ - 509, - 0 - ], - "line": " line = readline()\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 509, - 8 - ], - "end": [ - 509, - 8 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 509, - 8 - ], - "end": [ - 509, - 14 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "NAME", - "string": "StopIteration", - "start": [ - 509, - 15 - ], - "end": [ - 509, - 28 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 509, - 28 - ], - "end": [ - 509, - 29 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 509, - 29 - ], - "end": [ - 510, - 0 - ], - "line": " except StopIteration:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 510, - 0 - ], - "end": [ - 510, - 12 - ], - "line": " line = b''\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 510, - 12 - ], - "end": [ - 510, - 16 - ], - "line": " line = b''\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 510, - 17 - ], - "end": [ - 510, - 18 - ], - "line": " line = b''\n" - }, - { - "typ": "STRING", - "string": "b''", - "start": [ - 510, - 19 - ], - "end": [ - 510, - 22 - ], - "line": " line = b''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 510, - 22 - ], - "end": [ - 511, - 0 - ], - "line": " line = b''\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 511, - 0 - ], - "end": [ - 512, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 512, - 8 - ], - "end": [ - 512, - 8 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 512, - 8 - ], - "end": [ - 512, - 10 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 512, - 11 - ], - "end": [ - 512, - 19 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "is", - "start": [ - 512, - 20 - ], - "end": [ - 512, - 22 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 512, - 23 - ], - "end": [ - 512, - 26 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 512, - 27 - ], - "end": [ - 512, - 31 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 512, - 31 - ], - "end": [ - 512, - 32 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 512, - 32 - ], - "end": [ - 513, - 0 - ], - "line": " if encoding is not None:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 513, - 0 - ], - "end": [ - 513, - 12 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 513, - 12 - ], - "end": [ - 513, - 16 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 513, - 17 - ], - "end": [ - 513, - 18 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 513, - 19 - ], - "end": [ - 513, - 23 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 513, - 23 - ], - "end": [ - 513, - 24 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "NAME", - "string": "decode", - "start": [ - 513, - 24 - ], - "end": [ - 513, - 30 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 513, - 30 - ], - "end": [ - 513, - 31 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "NAME", - "string": "encoding", - "start": [ - 513, - 31 - ], - "end": [ - 513, - 39 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 513, - 39 - ], - "end": [ - 513, - 40 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 513, - 40 - ], - "end": [ - 514, - 0 - ], - "line": " line = line.decode(encoding)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 514, - 8 - ], - "end": [ - 514, - 8 - ], - "line": " lnum += 1\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 514, - 8 - ], - "end": [ - 514, - 12 - ], - "line": " lnum += 1\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 514, - 13 - ], - "end": [ - 514, - 15 - ], - "line": " lnum += 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 514, - 16 - ], - "end": [ - 514, - 17 - ], - "line": " lnum += 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 514, - 17 - ], - "end": [ - 515, - 0 - ], - "line": " lnum += 1\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 515, - 8 - ], - "end": [ - 515, - 11 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 515, - 11 - ], - "end": [ - 515, - 12 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "NAME", - "string": "max", - "start": [ - 515, - 13 - ], - "end": [ - 515, - 16 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 515, - 17 - ], - "end": [ - 515, - 18 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 515, - 19 - ], - "end": [ - 515, - 20 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 515, - 20 - ], - "end": [ - 515, - 21 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 515, - 22 - ], - "end": [ - 515, - 25 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 515, - 25 - ], - "end": [ - 515, - 26 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 515, - 26 - ], - "end": [ - 515, - 30 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 515, - 30 - ], - "end": [ - 515, - 31 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 515, - 31 - ], - "end": [ - 516, - 0 - ], - "line": " pos, max = 0, len(line)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 516, - 0 - ], - "end": [ - 517, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 517, - 8 - ], - "end": [ - 517, - 10 - ], - "line": " if contstr: # continued string\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 517, - 11 - ], - "end": [ - 517, - 18 - ], - "line": " if contstr: # continued string\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 517, - 18 - ], - "end": [ - 517, - 19 - ], - "line": " if contstr: # continued string\n" - }, - { - "typ": "COMMENT", - "string": "# continued string", - "start": [ - 517, - 47 - ], - "end": [ - 517, - 65 - ], - "line": " if contstr: # continued string\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 517, - 65 - ], - "end": [ - 518, - 0 - ], - "line": " if contstr: # continued string\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 518, - 0 - ], - "end": [ - 518, - 12 - ], - "line": " if not line:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 518, - 12 - ], - "end": [ - 518, - 14 - ], - "line": " if not line:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 518, - 15 - ], - "end": [ - 518, - 18 - ], - "line": " if not line:\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 518, - 19 - ], - "end": [ - 518, - 23 - ], - "line": " if not line:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 518, - 23 - ], - "end": [ - 518, - 24 - ], - "line": " if not line:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 518, - 24 - ], - "end": [ - 519, - 0 - ], - "line": " if not line:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 519, - 0 - ], - "end": [ - 519, - 16 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 519, - 16 - ], - "end": [ - 519, - 21 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "NAME", - "string": "TokenError", - "start": [ - 519, - 22 - ], - "end": [ - 519, - 32 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 519, - 32 - ], - "end": [ - 519, - 33 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "STRING", - "string": "\"EOF in multi-line string\"", - "start": [ - 519, - 33 - ], - "end": [ - 519, - 59 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 519, - 59 - ], - "end": [ - 519, - 60 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "NAME", - "string": "strstart", - "start": [ - 519, - 61 - ], - "end": [ - 519, - 69 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 519, - 69 - ], - "end": [ - 519, - 70 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 519, - 70 - ], - "end": [ - 520, - 0 - ], - "line": " raise TokenError(\"EOF in multi-line string\", strstart)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 520, - 12 - ], - "end": [ - 520, - 12 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "NAME", - "string": "endmatch", - "start": [ - 520, - 12 - ], - "end": [ - 520, - 20 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 520, - 21 - ], - "end": [ - 520, - 22 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "NAME", - "string": "endprog", - "start": [ - 520, - 23 - ], - "end": [ - 520, - 30 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 520, - 30 - ], - "end": [ - 520, - 31 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 520, - 31 - ], - "end": [ - 520, - 36 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 520, - 36 - ], - "end": [ - 520, - 37 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 520, - 37 - ], - "end": [ - 520, - 41 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 520, - 41 - ], - "end": [ - 520, - 42 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 520, - 42 - ], - "end": [ - 521, - 0 - ], - "line": " endmatch = endprog.match(line)\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 521, - 12 - ], - "end": [ - 521, - 14 - ], - "line": " if endmatch:\n" - }, - { - "typ": "NAME", - "string": "endmatch", - "start": [ - 521, - 15 - ], - "end": [ - 521, - 23 - ], - "line": " if endmatch:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 521, - 23 - ], - "end": [ - 521, - 24 - ], - "line": " if endmatch:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 521, - 24 - ], - "end": [ - 522, - 0 - ], - "line": " if endmatch:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 522, - 0 - ], - "end": [ - 522, - 16 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 522, - 16 - ], - "end": [ - 522, - 19 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 522, - 20 - ], - "end": [ - 522, - 21 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 522, - 22 - ], - "end": [ - 522, - 25 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 522, - 26 - ], - "end": [ - 522, - 27 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "endmatch", - "start": [ - 522, - 28 - ], - "end": [ - 522, - 36 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 522, - 36 - ], - "end": [ - 522, - 37 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 522, - 37 - ], - "end": [ - 522, - 40 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 522, - 40 - ], - "end": [ - 522, - 41 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 522, - 41 - ], - "end": [ - 522, - 42 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 522, - 42 - ], - "end": [ - 522, - 43 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 522, - 43 - ], - "end": [ - 523, - 0 - ], - "line": " pos = end = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 523, - 16 - ], - "end": [ - 523, - 21 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 523, - 22 - ], - "end": [ - 523, - 31 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 523, - 31 - ], - "end": [ - 523, - 32 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "NAME", - "string": "STRING", - "start": [ - 523, - 32 - ], - "end": [ - 523, - 38 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 523, - 38 - ], - "end": [ - 523, - 39 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 523, - 40 - ], - "end": [ - 523, - 47 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 523, - 48 - ], - "end": [ - 523, - 49 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 523, - 50 - ], - "end": [ - 523, - 54 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 523, - 54 - ], - "end": [ - 523, - 55 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 523, - 55 - ], - "end": [ - 523, - 56 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 523, - 56 - ], - "end": [ - 523, - 59 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 523, - 59 - ], - "end": [ - 523, - 60 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 523, - 60 - ], - "end": [ - 523, - 61 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 523, - 61 - ], - "end": [ - 524, - 0 - ], - "line": " yield TokenInfo(STRING, contstr + line[:end],\n" - }, - { - "typ": "NAME", - "string": "strstart", - "start": [ - 524, - 23 - ], - "end": [ - 524, - 31 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 524, - 31 - ], - "end": [ - 524, - 32 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 524, - 33 - ], - "end": [ - 524, - 34 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 524, - 34 - ], - "end": [ - 524, - 38 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 524, - 38 - ], - "end": [ - 524, - 39 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 524, - 40 - ], - "end": [ - 524, - 43 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 524, - 43 - ], - "end": [ - 524, - 44 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 524, - 44 - ], - "end": [ - 524, - 45 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 524, - 46 - ], - "end": [ - 524, - 54 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 524, - 55 - ], - "end": [ - 524, - 56 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 524, - 57 - ], - "end": [ - 524, - 61 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 524, - 61 - ], - "end": [ - 524, - 62 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 524, - 62 - ], - "end": [ - 525, - 0 - ], - "line": " strstart, (lnum, end), contline + line)\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 525, - 16 - ], - "end": [ - 525, - 23 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 525, - 23 - ], - "end": [ - 525, - 24 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NAME", - "string": "needcont", - "start": [ - 525, - 25 - ], - "end": [ - 525, - 33 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 525, - 34 - ], - "end": [ - 525, - 35 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 525, - 36 - ], - "end": [ - 525, - 38 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 525, - 38 - ], - "end": [ - 525, - 39 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 525, - 40 - ], - "end": [ - 525, - 41 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 525, - 41 - ], - "end": [ - 526, - 0 - ], - "line": " contstr, needcont = '', 0\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 526, - 16 - ], - "end": [ - 526, - 24 - ], - "line": " contline = None\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 526, - 25 - ], - "end": [ - 526, - 26 - ], - "line": " contline = None\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 526, - 27 - ], - "end": [ - 526, - 31 - ], - "line": " contline = None\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 526, - 31 - ], - "end": [ - 527, - 0 - ], - "line": " contline = None\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 527, - 12 - ], - "end": [ - 527, - 12 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 527, - 12 - ], - "end": [ - 527, - 16 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "needcont", - "start": [ - 527, - 17 - ], - "end": [ - 527, - 25 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 527, - 26 - ], - "end": [ - 527, - 29 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 527, - 30 - ], - "end": [ - 527, - 34 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 527, - 34 - ], - "end": [ - 527, - 35 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 527, - 35 - ], - "end": [ - 527, - 36 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NUMBER", - "string": "2", - "start": [ - 527, - 36 - ], - "end": [ - 527, - 37 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 527, - 37 - ], - "end": [ - 527, - 38 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 527, - 38 - ], - "end": [ - 527, - 39 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "!=", - "start": [ - 527, - 40 - ], - "end": [ - 527, - 42 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "STRING", - "string": "'\\\\\\n'", - "start": [ - 527, - 43 - ], - "end": [ - 527, - 49 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 527, - 50 - ], - "end": [ - 527, - 53 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 527, - 54 - ], - "end": [ - 527, - 58 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 527, - 58 - ], - "end": [ - 527, - 59 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 527, - 59 - ], - "end": [ - 527, - 60 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NUMBER", - "string": "3", - "start": [ - 527, - 60 - ], - "end": [ - 527, - 61 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 527, - 61 - ], - "end": [ - 527, - 62 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 527, - 62 - ], - "end": [ - 527, - 63 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": "!=", - "start": [ - 527, - 64 - ], - "end": [ - 527, - 66 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "STRING", - "string": "'\\\\\\r\\n'", - "start": [ - 527, - 67 - ], - "end": [ - 527, - 75 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 527, - 75 - ], - "end": [ - 527, - 76 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 527, - 76 - ], - "end": [ - 528, - 0 - ], - "line": " elif needcont and line[-2:] != '\\\\\\n' and line[-3:] != '\\\\\\r\\n':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 528, - 0 - ], - "end": [ - 528, - 16 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 528, - 16 - ], - "end": [ - 528, - 21 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 528, - 22 - ], - "end": [ - 528, - 31 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 528, - 31 - ], - "end": [ - 528, - 32 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "NAME", - "string": "ERRORTOKEN", - "start": [ - 528, - 32 - ], - "end": [ - 528, - 42 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 528, - 42 - ], - "end": [ - 528, - 43 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 528, - 44 - ], - "end": [ - 528, - 51 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 528, - 52 - ], - "end": [ - 528, - 53 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 528, - 54 - ], - "end": [ - 528, - 58 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 528, - 58 - ], - "end": [ - 528, - 59 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 528, - 59 - ], - "end": [ - 529, - 0 - ], - "line": " yield TokenInfo(ERRORTOKEN, contstr + line,\n" - }, - { - "typ": "NAME", - "string": "strstart", - "start": [ - 529, - 27 - ], - "end": [ - 529, - 35 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 529, - 35 - ], - "end": [ - 529, - 36 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 529, - 37 - ], - "end": [ - 529, - 38 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 529, - 38 - ], - "end": [ - 529, - 42 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 529, - 42 - ], - "end": [ - 529, - 43 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 529, - 44 - ], - "end": [ - 529, - 47 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 529, - 47 - ], - "end": [ - 529, - 48 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 529, - 48 - ], - "end": [ - 529, - 52 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 529, - 52 - ], - "end": [ - 529, - 53 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 529, - 53 - ], - "end": [ - 529, - 54 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 529, - 54 - ], - "end": [ - 529, - 55 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 529, - 56 - ], - "end": [ - 529, - 64 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 529, - 64 - ], - "end": [ - 529, - 65 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 529, - 65 - ], - "end": [ - 530, - 0 - ], - "line": " strstart, (lnum, len(line)), contline)\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 530, - 16 - ], - "end": [ - 530, - 23 - ], - "line": " contstr = ''\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 530, - 24 - ], - "end": [ - 530, - 25 - ], - "line": " contstr = ''\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 530, - 26 - ], - "end": [ - 530, - 28 - ], - "line": " contstr = ''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 530, - 28 - ], - "end": [ - 531, - 0 - ], - "line": " contstr = ''\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 531, - 16 - ], - "end": [ - 531, - 24 - ], - "line": " contline = None\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 531, - 25 - ], - "end": [ - 531, - 26 - ], - "line": " contline = None\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 531, - 27 - ], - "end": [ - 531, - 31 - ], - "line": " contline = None\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 531, - 31 - ], - "end": [ - 532, - 0 - ], - "line": " contline = None\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 532, - 16 - ], - "end": [ - 532, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 532, - 24 - ], - "end": [ - 533, - 0 - ], - "line": " continue\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 533, - 12 - ], - "end": [ - 533, - 12 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 533, - 12 - ], - "end": [ - 533, - 16 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 533, - 16 - ], - "end": [ - 533, - 17 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 533, - 17 - ], - "end": [ - 534, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 534, - 0 - ], - "end": [ - 534, - 16 - ], - "line": " contstr = contstr + line\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 534, - 16 - ], - "end": [ - 534, - 23 - ], - "line": " contstr = contstr + line\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 534, - 24 - ], - "end": [ - 534, - 25 - ], - "line": " contstr = contstr + line\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 534, - 26 - ], - "end": [ - 534, - 33 - ], - "line": " contstr = contstr + line\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 534, - 34 - ], - "end": [ - 534, - 35 - ], - "line": " contstr = contstr + line\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 534, - 36 - ], - "end": [ - 534, - 40 - ], - "line": " contstr = contstr + line\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 534, - 40 - ], - "end": [ - 535, - 0 - ], - "line": " contstr = contstr + line\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 535, - 16 - ], - "end": [ - 535, - 24 - ], - "line": " contline = contline + line\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 535, - 25 - ], - "end": [ - 535, - 26 - ], - "line": " contline = contline + line\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 535, - 27 - ], - "end": [ - 535, - 35 - ], - "line": " contline = contline + line\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 535, - 36 - ], - "end": [ - 535, - 37 - ], - "line": " contline = contline + line\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 535, - 38 - ], - "end": [ - 535, - 42 - ], - "line": " contline = contline + line\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 535, - 42 - ], - "end": [ - 536, - 0 - ], - "line": " contline = contline + line\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 536, - 16 - ], - "end": [ - 536, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 536, - 24 - ], - "end": [ - 537, - 0 - ], - "line": " continue\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 537, - 0 - ], - "end": [ - 538, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 538, - 8 - ], - "end": [ - 538, - 8 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 538, - 8 - ], - "end": [ - 538, - 8 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 538, - 8 - ], - "end": [ - 538, - 12 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "NAME", - "string": "parenlev", - "start": [ - 538, - 13 - ], - "end": [ - 538, - 21 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 538, - 22 - ], - "end": [ - 538, - 24 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 538, - 25 - ], - "end": [ - 538, - 26 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 538, - 27 - ], - "end": [ - 538, - 30 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 538, - 31 - ], - "end": [ - 538, - 34 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "NAME", - "string": "continued", - "start": [ - 538, - 35 - ], - "end": [ - 538, - 44 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 538, - 44 - ], - "end": [ - 538, - 45 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "COMMENT", - "string": "# new statement", - "start": [ - 538, - 47 - ], - "end": [ - 538, - 62 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 538, - 62 - ], - "end": [ - 539, - 0 - ], - "line": " elif parenlev == 0 and not continued: # new statement\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 539, - 0 - ], - "end": [ - 539, - 12 - ], - "line": " if not line: break\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 539, - 12 - ], - "end": [ - 539, - 14 - ], - "line": " if not line: break\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 539, - 15 - ], - "end": [ - 539, - 18 - ], - "line": " if not line: break\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 539, - 19 - ], - "end": [ - 539, - 23 - ], - "line": " if not line: break\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 539, - 23 - ], - "end": [ - 539, - 24 - ], - "line": " if not line: break\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 539, - 25 - ], - "end": [ - 539, - 30 - ], - "line": " if not line: break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 539, - 30 - ], - "end": [ - 540, - 0 - ], - "line": " if not line: break\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 540, - 12 - ], - "end": [ - 540, - 18 - ], - "line": " column = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 540, - 19 - ], - "end": [ - 540, - 20 - ], - "line": " column = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 540, - 21 - ], - "end": [ - 540, - 22 - ], - "line": " column = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 540, - 22 - ], - "end": [ - 541, - 0 - ], - "line": " column = 0\n" - }, - { - "typ": "NAME", - "string": "while", - "start": [ - 541, - 12 - ], - "end": [ - 541, - 17 - ], - "line": " while pos < max: # measure leading whitespace\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 541, - 18 - ], - "end": [ - 541, - 21 - ], - "line": " while pos < max: # measure leading whitespace\n" - }, - { - "typ": "OP", - "string": "<", - "start": [ - 541, - 22 - ], - "end": [ - 541, - 23 - ], - "line": " while pos < max: # measure leading whitespace\n" - }, - { - "typ": "NAME", - "string": "max", - "start": [ - 541, - 24 - ], - "end": [ - 541, - 27 - ], - "line": " while pos < max: # measure leading whitespace\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 541, - 27 - ], - "end": [ - 541, - 28 - ], - "line": " while pos < max: # measure leading whitespace\n" - }, - { - "typ": "COMMENT", - "string": "# measure leading whitespace", - "start": [ - 541, - 47 - ], - "end": [ - 541, - 75 - ], - "line": " while pos < max: # measure leading whitespace\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 541, - 75 - ], - "end": [ - 542, - 0 - ], - "line": " while pos < max: # measure leading whitespace\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 542, - 0 - ], - "end": [ - 542, - 16 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 542, - 16 - ], - "end": [ - 542, - 18 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 542, - 19 - ], - "end": [ - 542, - 23 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 542, - 23 - ], - "end": [ - 542, - 24 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 542, - 24 - ], - "end": [ - 542, - 27 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 542, - 27 - ], - "end": [ - 542, - 28 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 542, - 29 - ], - "end": [ - 542, - 31 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "STRING", - "string": "' '", - "start": [ - 542, - 32 - ], - "end": [ - 542, - 35 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 542, - 35 - ], - "end": [ - 542, - 36 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 542, - 36 - ], - "end": [ - 543, - 0 - ], - "line": " if line[pos] == ' ':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 543, - 0 - ], - "end": [ - 543, - 20 - ], - "line": " column += 1\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 543, - 20 - ], - "end": [ - 543, - 26 - ], - "line": " column += 1\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 543, - 27 - ], - "end": [ - 543, - 29 - ], - "line": " column += 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 543, - 30 - ], - "end": [ - 543, - 31 - ], - "line": " column += 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 543, - 31 - ], - "end": [ - 544, - 0 - ], - "line": " column += 1\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 544, - 16 - ], - "end": [ - 544, - 16 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 544, - 16 - ], - "end": [ - 544, - 20 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 544, - 21 - ], - "end": [ - 544, - 25 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 544, - 25 - ], - "end": [ - 544, - 26 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 544, - 26 - ], - "end": [ - 544, - 29 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 544, - 29 - ], - "end": [ - 544, - 30 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 544, - 31 - ], - "end": [ - 544, - 33 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "STRING", - "string": "'\\t'", - "start": [ - 544, - 34 - ], - "end": [ - 544, - 38 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 544, - 38 - ], - "end": [ - 544, - 39 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 544, - 39 - ], - "end": [ - 545, - 0 - ], - "line": " elif line[pos] == '\\t':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 545, - 0 - ], - "end": [ - 545, - 20 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 545, - 20 - ], - "end": [ - 545, - 26 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 545, - 27 - ], - "end": [ - 545, - 28 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 545, - 29 - ], - "end": [ - 545, - 30 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 545, - 30 - ], - "end": [ - 545, - 36 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "OP", - "string": "//", - "start": [ - 545, - 36 - ], - "end": [ - 545, - 38 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "NAME", - "string": "tabsize", - "start": [ - 545, - 38 - ], - "end": [ - 545, - 45 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 545, - 46 - ], - "end": [ - 545, - 47 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 545, - 48 - ], - "end": [ - 545, - 49 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 545, - 49 - ], - "end": [ - 545, - 50 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "OP", - "string": "*", - "start": [ - 545, - 50 - ], - "end": [ - 545, - 51 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "NAME", - "string": "tabsize", - "start": [ - 545, - 51 - ], - "end": [ - 545, - 58 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 545, - 58 - ], - "end": [ - 546, - 0 - ], - "line": " column = (column//tabsize + 1)*tabsize\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 546, - 16 - ], - "end": [ - 546, - 16 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 546, - 16 - ], - "end": [ - 546, - 20 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 546, - 21 - ], - "end": [ - 546, - 25 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 546, - 25 - ], - "end": [ - 546, - 26 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 546, - 26 - ], - "end": [ - 546, - 29 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 546, - 29 - ], - "end": [ - 546, - 30 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 546, - 31 - ], - "end": [ - 546, - 33 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "STRING", - "string": "'\\f'", - "start": [ - 546, - 34 - ], - "end": [ - 546, - 38 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 546, - 38 - ], - "end": [ - 546, - 39 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 546, - 39 - ], - "end": [ - 547, - 0 - ], - "line": " elif line[pos] == '\\f':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 547, - 0 - ], - "end": [ - 547, - 20 - ], - "line": " column = 0\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 547, - 20 - ], - "end": [ - 547, - 26 - ], - "line": " column = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 547, - 27 - ], - "end": [ - 547, - 28 - ], - "line": " column = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 547, - 29 - ], - "end": [ - 547, - 30 - ], - "line": " column = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 547, - 30 - ], - "end": [ - 548, - 0 - ], - "line": " column = 0\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 548, - 16 - ], - "end": [ - 548, - 16 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 548, - 16 - ], - "end": [ - 548, - 20 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 548, - 20 - ], - "end": [ - 548, - 21 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 548, - 21 - ], - "end": [ - 549, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 549, - 0 - ], - "end": [ - 549, - 20 - ], - "line": " break\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 549, - 20 - ], - "end": [ - 549, - 25 - ], - "line": " break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 549, - 25 - ], - "end": [ - 550, - 0 - ], - "line": " break\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 550, - 16 - ], - "end": [ - 550, - 16 - ], - "line": " pos += 1\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 550, - 16 - ], - "end": [ - 550, - 19 - ], - "line": " pos += 1\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 550, - 20 - ], - "end": [ - 550, - 22 - ], - "line": " pos += 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 550, - 23 - ], - "end": [ - 550, - 24 - ], - "line": " pos += 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 550, - 24 - ], - "end": [ - 551, - 0 - ], - "line": " pos += 1\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 551, - 12 - ], - "end": [ - 551, - 12 - ], - "line": " if pos == max:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 551, - 12 - ], - "end": [ - 551, - 14 - ], - "line": " if pos == max:\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 551, - 15 - ], - "end": [ - 551, - 18 - ], - "line": " if pos == max:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 551, - 19 - ], - "end": [ - 551, - 21 - ], - "line": " if pos == max:\n" - }, - { - "typ": "NAME", - "string": "max", - "start": [ - 551, - 22 - ], - "end": [ - 551, - 25 - ], - "line": " if pos == max:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 551, - 25 - ], - "end": [ - 551, - 26 - ], - "line": " if pos == max:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 551, - 26 - ], - "end": [ - 552, - 0 - ], - "line": " if pos == max:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 552, - 0 - ], - "end": [ - 552, - 16 - ], - "line": " break\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 552, - 16 - ], - "end": [ - 552, - 21 - ], - "line": " break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 552, - 21 - ], - "end": [ - 553, - 0 - ], - "line": " break\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 553, - 0 - ], - "end": [ - 554, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 554, - 12 - ], - "end": [ - 554, - 12 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 554, - 12 - ], - "end": [ - 554, - 14 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 554, - 15 - ], - "end": [ - 554, - 19 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 554, - 19 - ], - "end": [ - 554, - 20 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 554, - 20 - ], - "end": [ - 554, - 23 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 554, - 23 - ], - "end": [ - 554, - 24 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 554, - 25 - ], - "end": [ - 554, - 27 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "STRING", - "string": "'#\\r\\n'", - "start": [ - 554, - 28 - ], - "end": [ - 554, - 35 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 554, - 35 - ], - "end": [ - 554, - 36 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "COMMENT", - "string": "# skip comments or blank lines", - "start": [ - 554, - 47 - ], - "end": [ - 554, - 77 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 554, - 77 - ], - "end": [ - 555, - 0 - ], - "line": " if line[pos] in '#\\r\\n': # skip comments or blank lines\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 555, - 0 - ], - "end": [ - 555, - 16 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 555, - 16 - ], - "end": [ - 555, - 18 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 555, - 19 - ], - "end": [ - 555, - 23 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 555, - 23 - ], - "end": [ - 555, - 24 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 555, - 24 - ], - "end": [ - 555, - 27 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 555, - 27 - ], - "end": [ - 555, - 28 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 555, - 29 - ], - "end": [ - 555, - 31 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "STRING", - "string": "'#'", - "start": [ - 555, - 32 - ], - "end": [ - 555, - 35 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 555, - 35 - ], - "end": [ - 555, - 36 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 555, - 36 - ], - "end": [ - 556, - 0 - ], - "line": " if line[pos] == '#':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 556, - 0 - ], - "end": [ - 556, - 20 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "NAME", - "string": "comment_token", - "start": [ - 556, - 20 - ], - "end": [ - 556, - 33 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 556, - 34 - ], - "end": [ - 556, - 35 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 556, - 36 - ], - "end": [ - 556, - 40 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 556, - 40 - ], - "end": [ - 556, - 41 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 556, - 41 - ], - "end": [ - 556, - 44 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 556, - 44 - ], - "end": [ - 556, - 45 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 556, - 45 - ], - "end": [ - 556, - 46 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 556, - 46 - ], - "end": [ - 556, - 47 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "NAME", - "string": "rstrip", - "start": [ - 556, - 47 - ], - "end": [ - 556, - 53 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 556, - 53 - ], - "end": [ - 556, - 54 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "STRING", - "string": "'\\r\\n'", - "start": [ - 556, - 54 - ], - "end": [ - 556, - 60 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 556, - 60 - ], - "end": [ - 556, - 61 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 556, - 61 - ], - "end": [ - 557, - 0 - ], - "line": " comment_token = line[pos:].rstrip('\\r\\n')\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 557, - 20 - ], - "end": [ - 557, - 25 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 557, - 26 - ], - "end": [ - 557, - 35 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 557, - 35 - ], - "end": [ - 557, - 36 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "NAME", - "string": "COMMENT", - "start": [ - 557, - 36 - ], - "end": [ - 557, - 43 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 557, - 43 - ], - "end": [ - 557, - 44 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "NAME", - "string": "comment_token", - "start": [ - 557, - 45 - ], - "end": [ - 557, - 58 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 557, - 58 - ], - "end": [ - 557, - 59 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 557, - 59 - ], - "end": [ - 558, - 0 - ], - "line": " yield TokenInfo(COMMENT, comment_token,\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 558, - 27 - ], - "end": [ - 558, - 28 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 558, - 28 - ], - "end": [ - 558, - 32 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 558, - 32 - ], - "end": [ - 558, - 33 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 558, - 34 - ], - "end": [ - 558, - 37 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 558, - 37 - ], - "end": [ - 558, - 38 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 558, - 38 - ], - "end": [ - 558, - 39 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 558, - 40 - ], - "end": [ - 558, - 41 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 558, - 41 - ], - "end": [ - 558, - 45 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 558, - 45 - ], - "end": [ - 558, - 46 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 558, - 47 - ], - "end": [ - 558, - 50 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 558, - 51 - ], - "end": [ - 558, - 52 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 558, - 53 - ], - "end": [ - 558, - 56 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 558, - 56 - ], - "end": [ - 558, - 57 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "comment_token", - "start": [ - 558, - 57 - ], - "end": [ - 558, - 70 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 558, - 70 - ], - "end": [ - 558, - 71 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 558, - 71 - ], - "end": [ - 558, - 72 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 558, - 72 - ], - "end": [ - 558, - 73 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 558, - 74 - ], - "end": [ - 558, - 78 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 558, - 78 - ], - "end": [ - 558, - 79 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 558, - 79 - ], - "end": [ - 559, - 0 - ], - "line": " (lnum, pos), (lnum, pos + len(comment_token)), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 559, - 20 - ], - "end": [ - 559, - 23 - ], - "line": " pos += len(comment_token)\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 559, - 24 - ], - "end": [ - 559, - 26 - ], - "line": " pos += len(comment_token)\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 559, - 27 - ], - "end": [ - 559, - 30 - ], - "line": " pos += len(comment_token)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 559, - 30 - ], - "end": [ - 559, - 31 - ], - "line": " pos += len(comment_token)\n" - }, - { - "typ": "NAME", - "string": "comment_token", - "start": [ - 559, - 31 - ], - "end": [ - 559, - 44 - ], - "line": " pos += len(comment_token)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 559, - 44 - ], - "end": [ - 559, - 45 - ], - "line": " pos += len(comment_token)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 559, - 45 - ], - "end": [ - 560, - 0 - ], - "line": " pos += len(comment_token)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 560, - 0 - ], - "end": [ - 561, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 561, - 16 - ], - "end": [ - 561, - 16 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 561, - 16 - ], - "end": [ - 561, - 21 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 561, - 22 - ], - "end": [ - 561, - 31 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 561, - 31 - ], - "end": [ - 561, - 32 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "NAME", - "string": "NL", - "start": [ - 561, - 32 - ], - "end": [ - 561, - 34 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 561, - 34 - ], - "end": [ - 561, - 35 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 561, - 36 - ], - "end": [ - 561, - 40 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 561, - 40 - ], - "end": [ - 561, - 41 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 561, - 41 - ], - "end": [ - 561, - 44 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 561, - 44 - ], - "end": [ - 561, - 45 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 561, - 45 - ], - "end": [ - 561, - 46 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 561, - 46 - ], - "end": [ - 561, - 47 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 561, - 47 - ], - "end": [ - 562, - 0 - ], - "line": " yield TokenInfo(NL, line[pos:],\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 562, - 27 - ], - "end": [ - 562, - 28 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 562, - 28 - ], - "end": [ - 562, - 32 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 562, - 32 - ], - "end": [ - 562, - 33 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 562, - 34 - ], - "end": [ - 562, - 37 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 562, - 37 - ], - "end": [ - 562, - 38 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 562, - 38 - ], - "end": [ - 562, - 39 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 562, - 40 - ], - "end": [ - 562, - 41 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 562, - 41 - ], - "end": [ - 562, - 45 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 562, - 45 - ], - "end": [ - 562, - 46 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 562, - 47 - ], - "end": [ - 562, - 50 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 562, - 50 - ], - "end": [ - 562, - 51 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 562, - 51 - ], - "end": [ - 562, - 55 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 562, - 55 - ], - "end": [ - 562, - 56 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 562, - 56 - ], - "end": [ - 562, - 57 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 562, - 57 - ], - "end": [ - 562, - 58 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 562, - 59 - ], - "end": [ - 562, - 63 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 562, - 63 - ], - "end": [ - 562, - 64 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 562, - 64 - ], - "end": [ - 563, - 0 - ], - "line": " (lnum, pos), (lnum, len(line)), line)\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 563, - 16 - ], - "end": [ - 563, - 24 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 563, - 24 - ], - "end": [ - 564, - 0 - ], - "line": " continue\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 564, - 0 - ], - "end": [ - 565, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 565, - 12 - ], - "end": [ - 565, - 12 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 565, - 12 - ], - "end": [ - 565, - 14 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 565, - 15 - ], - "end": [ - 565, - 21 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "OP", - "string": ">", - "start": [ - 565, - 22 - ], - "end": [ - 565, - 23 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 565, - 24 - ], - "end": [ - 565, - 31 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 565, - 31 - ], - "end": [ - 565, - 32 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 565, - 32 - ], - "end": [ - 565, - 33 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 565, - 33 - ], - "end": [ - 565, - 34 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 565, - 34 - ], - "end": [ - 565, - 35 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 565, - 35 - ], - "end": [ - 565, - 36 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "COMMENT", - "string": "# count indents or dedents", - "start": [ - 565, - 47 - ], - "end": [ - 565, - 73 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 565, - 73 - ], - "end": [ - 566, - 0 - ], - "line": " if column > indents[-1]: # count indents or dedents\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 566, - 0 - ], - "end": [ - 566, - 16 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 566, - 16 - ], - "end": [ - 566, - 23 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 566, - 23 - ], - "end": [ - 566, - 24 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "NAME", - "string": "append", - "start": [ - 566, - 24 - ], - "end": [ - 566, - 30 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 566, - 30 - ], - "end": [ - 566, - 31 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 566, - 31 - ], - "end": [ - 566, - 37 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 566, - 37 - ], - "end": [ - 566, - 38 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 566, - 38 - ], - "end": [ - 567, - 0 - ], - "line": " indents.append(column)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 567, - 16 - ], - "end": [ - 567, - 21 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 567, - 22 - ], - "end": [ - 567, - 31 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 567, - 31 - ], - "end": [ - 567, - 32 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "INDENT", - "start": [ - 567, - 32 - ], - "end": [ - 567, - 38 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 567, - 38 - ], - "end": [ - 567, - 39 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 567, - 40 - ], - "end": [ - 567, - 44 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 567, - 44 - ], - "end": [ - 567, - 45 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 567, - 45 - ], - "end": [ - 567, - 46 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 567, - 46 - ], - "end": [ - 567, - 49 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 567, - 49 - ], - "end": [ - 567, - 50 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 567, - 50 - ], - "end": [ - 567, - 51 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 567, - 52 - ], - "end": [ - 567, - 53 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 567, - 53 - ], - "end": [ - 567, - 57 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 567, - 57 - ], - "end": [ - 567, - 58 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 567, - 59 - ], - "end": [ - 567, - 60 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 567, - 60 - ], - "end": [ - 567, - 61 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 567, - 61 - ], - "end": [ - 567, - 62 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 567, - 63 - ], - "end": [ - 567, - 64 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 567, - 64 - ], - "end": [ - 567, - 68 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 567, - 68 - ], - "end": [ - 567, - 69 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 567, - 70 - ], - "end": [ - 567, - 73 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 567, - 73 - ], - "end": [ - 567, - 74 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 567, - 74 - ], - "end": [ - 567, - 75 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 567, - 76 - ], - "end": [ - 567, - 80 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 567, - 80 - ], - "end": [ - 567, - 81 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 567, - 81 - ], - "end": [ - 568, - 0 - ], - "line": " yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 568, - 12 - ], - "end": [ - 568, - 12 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "NAME", - "string": "while", - "start": [ - 568, - 12 - ], - "end": [ - 568, - 17 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 568, - 18 - ], - "end": [ - 568, - 24 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "OP", - "string": "<", - "start": [ - 568, - 25 - ], - "end": [ - 568, - 26 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 568, - 27 - ], - "end": [ - 568, - 34 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 568, - 34 - ], - "end": [ - 568, - 35 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 568, - 35 - ], - "end": [ - 568, - 36 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 568, - 36 - ], - "end": [ - 568, - 37 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 568, - 37 - ], - "end": [ - 568, - 38 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 568, - 38 - ], - "end": [ - 568, - 39 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 568, - 39 - ], - "end": [ - 569, - 0 - ], - "line": " while column < indents[-1]:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 569, - 0 - ], - "end": [ - 569, - 16 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 569, - 16 - ], - "end": [ - 569, - 18 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 569, - 19 - ], - "end": [ - 569, - 25 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 569, - 26 - ], - "end": [ - 569, - 29 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 569, - 30 - ], - "end": [ - 569, - 32 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 569, - 33 - ], - "end": [ - 569, - 40 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 569, - 40 - ], - "end": [ - 569, - 41 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 569, - 41 - ], - "end": [ - 570, - 0 - ], - "line": " if column not in indents:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 570, - 0 - ], - "end": [ - 570, - 20 - ], - "line": " raise IndentationError(\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 570, - 20 - ], - "end": [ - 570, - 25 - ], - "line": " raise IndentationError(\n" - }, - { - "typ": "NAME", - "string": "IndentationError", - "start": [ - 570, - 26 - ], - "end": [ - 570, - 42 - ], - "line": " raise IndentationError(\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 570, - 42 - ], - "end": [ - 570, - 43 - ], - "line": " raise IndentationError(\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 570, - 43 - ], - "end": [ - 571, - 0 - ], - "line": " raise IndentationError(\n" - }, - { - "typ": "STRING", - "string": "\"unindent does not match any outer indentation level\"", - "start": [ - 571, - 24 - ], - "end": [ - 571, - 77 - ], - "line": " \"unindent does not match any outer indentation level\",\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 571, - 77 - ], - "end": [ - 571, - 78 - ], - "line": " \"unindent does not match any outer indentation level\",\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 571, - 78 - ], - "end": [ - 572, - 0 - ], - "line": " \"unindent does not match any outer indentation level\",\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 572, - 24 - ], - "end": [ - 572, - 25 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "STRING", - "string": "\"\"", - "start": [ - 572, - 25 - ], - "end": [ - 572, - 37 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 572, - 37 - ], - "end": [ - 572, - 38 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 572, - 39 - ], - "end": [ - 572, - 43 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 572, - 43 - ], - "end": [ - 572, - 44 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 572, - 45 - ], - "end": [ - 572, - 48 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 572, - 48 - ], - "end": [ - 572, - 49 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 572, - 50 - ], - "end": [ - 572, - 54 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 572, - 54 - ], - "end": [ - 572, - 55 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 572, - 55 - ], - "end": [ - 572, - 56 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 572, - 56 - ], - "end": [ - 573, - 0 - ], - "line": " (\"\", lnum, pos, line))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 573, - 16 - ], - "end": [ - 573, - 16 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 573, - 16 - ], - "end": [ - 573, - 23 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 573, - 24 - ], - "end": [ - 573, - 25 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 573, - 26 - ], - "end": [ - 573, - 33 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 573, - 33 - ], - "end": [ - 573, - 34 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 573, - 34 - ], - "end": [ - 573, - 35 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 573, - 35 - ], - "end": [ - 573, - 36 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 573, - 36 - ], - "end": [ - 573, - 37 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 573, - 37 - ], - "end": [ - 573, - 38 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 573, - 38 - ], - "end": [ - 574, - 0 - ], - "line": " indents = indents[:-1]\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 574, - 0 - ], - "end": [ - 575, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 575, - 16 - ], - "end": [ - 575, - 21 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 575, - 22 - ], - "end": [ - 575, - 31 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 575, - 31 - ], - "end": [ - 575, - 32 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "DEDENT", - "start": [ - 575, - 32 - ], - "end": [ - 575, - 38 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 575, - 38 - ], - "end": [ - 575, - 39 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 575, - 40 - ], - "end": [ - 575, - 42 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 575, - 42 - ], - "end": [ - 575, - 43 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 575, - 44 - ], - "end": [ - 575, - 45 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 575, - 45 - ], - "end": [ - 575, - 49 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 575, - 49 - ], - "end": [ - 575, - 50 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 575, - 51 - ], - "end": [ - 575, - 54 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 575, - 54 - ], - "end": [ - 575, - 55 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 575, - 55 - ], - "end": [ - 575, - 56 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 575, - 57 - ], - "end": [ - 575, - 58 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 575, - 58 - ], - "end": [ - 575, - 62 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 575, - 62 - ], - "end": [ - 575, - 63 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 575, - 64 - ], - "end": [ - 575, - 67 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 575, - 67 - ], - "end": [ - 575, - 68 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 575, - 68 - ], - "end": [ - 575, - 69 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 575, - 70 - ], - "end": [ - 575, - 74 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 575, - 74 - ], - "end": [ - 575, - 75 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 575, - 75 - ], - "end": [ - 576, - 0 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 576, - 0 - ], - "end": [ - 577, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 577, - 8 - ], - "end": [ - 577, - 8 - ], - "line": " else: # continued statement\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 577, - 8 - ], - "end": [ - 577, - 8 - ], - "line": " else: # continued statement\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 577, - 8 - ], - "end": [ - 577, - 12 - ], - "line": " else: # continued statement\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 577, - 12 - ], - "end": [ - 577, - 13 - ], - "line": " else: # continued statement\n" - }, - { - "typ": "COMMENT", - "string": "# continued statement", - "start": [ - 577, - 47 - ], - "end": [ - 577, - 68 - ], - "line": " else: # continued statement\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 577, - 68 - ], - "end": [ - 578, - 0 - ], - "line": " else: # continued statement\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 578, - 0 - ], - "end": [ - 578, - 12 - ], - "line": " if not line:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 578, - 12 - ], - "end": [ - 578, - 14 - ], - "line": " if not line:\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 578, - 15 - ], - "end": [ - 578, - 18 - ], - "line": " if not line:\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 578, - 19 - ], - "end": [ - 578, - 23 - ], - "line": " if not line:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 578, - 23 - ], - "end": [ - 578, - 24 - ], - "line": " if not line:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 578, - 24 - ], - "end": [ - 579, - 0 - ], - "line": " if not line:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 579, - 0 - ], - "end": [ - 579, - 16 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 579, - 16 - ], - "end": [ - 579, - 21 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "NAME", - "string": "TokenError", - "start": [ - 579, - 22 - ], - "end": [ - 579, - 32 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 579, - 32 - ], - "end": [ - 579, - 33 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "STRING", - "string": "\"EOF in multi-line statement\"", - "start": [ - 579, - 33 - ], - "end": [ - 579, - 62 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 579, - 62 - ], - "end": [ - 579, - 63 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 579, - 64 - ], - "end": [ - 579, - 65 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 579, - 65 - ], - "end": [ - 579, - 69 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 579, - 69 - ], - "end": [ - 579, - 70 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 579, - 71 - ], - "end": [ - 579, - 72 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 579, - 72 - ], - "end": [ - 579, - 73 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 579, - 73 - ], - "end": [ - 579, - 74 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 579, - 74 - ], - "end": [ - 580, - 0 - ], - "line": " raise TokenError(\"EOF in multi-line statement\", (lnum, 0))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 580, - 12 - ], - "end": [ - 580, - 12 - ], - "line": " continued = 0\n" - }, - { - "typ": "NAME", - "string": "continued", - "start": [ - 580, - 12 - ], - "end": [ - 580, - 21 - ], - "line": " continued = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 580, - 22 - ], - "end": [ - 580, - 23 - ], - "line": " continued = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 580, - 24 - ], - "end": [ - 580, - 25 - ], - "line": " continued = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 580, - 25 - ], - "end": [ - 581, - 0 - ], - "line": " continued = 0\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 581, - 0 - ], - "end": [ - 582, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 582, - 8 - ], - "end": [ - 582, - 8 - ], - "line": " while pos < max:\n" - }, - { - "typ": "NAME", - "string": "while", - "start": [ - 582, - 8 - ], - "end": [ - 582, - 13 - ], - "line": " while pos < max:\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 582, - 14 - ], - "end": [ - 582, - 17 - ], - "line": " while pos < max:\n" - }, - { - "typ": "OP", - "string": "<", - "start": [ - 582, - 18 - ], - "end": [ - 582, - 19 - ], - "line": " while pos < max:\n" - }, - { - "typ": "NAME", - "string": "max", - "start": [ - 582, - 20 - ], - "end": [ - 582, - 23 - ], - "line": " while pos < max:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 582, - 23 - ], - "end": [ - 582, - 24 - ], - "line": " while pos < max:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 582, - 24 - ], - "end": [ - 583, - 0 - ], - "line": " while pos < max:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 583, - 0 - ], - "end": [ - 583, - 12 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "pseudomatch", - "start": [ - 583, - 12 - ], - "end": [ - 583, - 23 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 583, - 24 - ], - "end": [ - 583, - 25 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "_compile", - "start": [ - 583, - 26 - ], - "end": [ - 583, - 34 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 583, - 34 - ], - "end": [ - 583, - 35 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "PseudoToken", - "start": [ - 583, - 35 - ], - "end": [ - 583, - 46 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 583, - 46 - ], - "end": [ - 583, - 47 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 583, - 47 - ], - "end": [ - 583, - 48 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 583, - 48 - ], - "end": [ - 583, - 53 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 583, - 53 - ], - "end": [ - 583, - 54 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 583, - 54 - ], - "end": [ - 583, - 58 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 583, - 58 - ], - "end": [ - 583, - 59 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 583, - 60 - ], - "end": [ - 583, - 63 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 583, - 63 - ], - "end": [ - 583, - 64 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 583, - 64 - ], - "end": [ - 584, - 0 - ], - "line": " pseudomatch = _compile(PseudoToken).match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 584, - 12 - ], - "end": [ - 584, - 14 - ], - "line": " if pseudomatch: # scan for tokens\n" - }, - { - "typ": "NAME", - "string": "pseudomatch", - "start": [ - 584, - 15 - ], - "end": [ - 584, - 26 - ], - "line": " if pseudomatch: # scan for tokens\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 584, - 26 - ], - "end": [ - 584, - 27 - ], - "line": " if pseudomatch: # scan for tokens\n" - }, - { - "typ": "COMMENT", - "string": "# scan for tokens", - "start": [ - 584, - 59 - ], - "end": [ - 584, - 76 - ], - "line": " if pseudomatch: # scan for tokens\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 584, - 76 - ], - "end": [ - 585, - 0 - ], - "line": " if pseudomatch: # scan for tokens\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 585, - 0 - ], - "end": [ - 585, - 16 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 585, - 16 - ], - "end": [ - 585, - 21 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 585, - 21 - ], - "end": [ - 585, - 22 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 585, - 23 - ], - "end": [ - 585, - 26 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 585, - 27 - ], - "end": [ - 585, - 28 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "NAME", - "string": "pseudomatch", - "start": [ - 585, - 29 - ], - "end": [ - 585, - 40 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 585, - 40 - ], - "end": [ - 585, - 41 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "NAME", - "string": "span", - "start": [ - 585, - 41 - ], - "end": [ - 585, - 45 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 585, - 45 - ], - "end": [ - 585, - 46 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 585, - 46 - ], - "end": [ - 585, - 47 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 585, - 47 - ], - "end": [ - 585, - 48 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 585, - 48 - ], - "end": [ - 586, - 0 - ], - "line": " start, end = pseudomatch.span(1)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 586, - 16 - ], - "end": [ - 586, - 20 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 586, - 20 - ], - "end": [ - 586, - 21 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 586, - 22 - ], - "end": [ - 586, - 26 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 586, - 26 - ], - "end": [ - 586, - 27 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 586, - 28 - ], - "end": [ - 586, - 31 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 586, - 32 - ], - "end": [ - 586, - 33 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 586, - 34 - ], - "end": [ - 586, - 35 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 586, - 35 - ], - "end": [ - 586, - 39 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 586, - 39 - ], - "end": [ - 586, - 40 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 586, - 41 - ], - "end": [ - 586, - 46 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 586, - 46 - ], - "end": [ - 586, - 47 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 586, - 47 - ], - "end": [ - 586, - 48 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 586, - 49 - ], - "end": [ - 586, - 50 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 586, - 50 - ], - "end": [ - 586, - 54 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 586, - 54 - ], - "end": [ - 586, - 55 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 586, - 56 - ], - "end": [ - 586, - 59 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 586, - 59 - ], - "end": [ - 586, - 60 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 586, - 60 - ], - "end": [ - 586, - 61 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 586, - 62 - ], - "end": [ - 586, - 65 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 586, - 65 - ], - "end": [ - 587, - 0 - ], - "line": " spos, epos, pos = (lnum, start), (lnum, end), end\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 587, - 16 - ], - "end": [ - 587, - 18 - ], - "line": " if start == end:\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 587, - 19 - ], - "end": [ - 587, - 24 - ], - "line": " if start == end:\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 587, - 25 - ], - "end": [ - 587, - 27 - ], - "line": " if start == end:\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 587, - 28 - ], - "end": [ - 587, - 31 - ], - "line": " if start == end:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 587, - 31 - ], - "end": [ - 587, - 32 - ], - "line": " if start == end:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 587, - 32 - ], - "end": [ - 588, - 0 - ], - "line": " if start == end:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 588, - 0 - ], - "end": [ - 588, - 20 - ], - "line": " continue\n" - }, - { - "typ": "NAME", - "string": "continue", - "start": [ - 588, - 20 - ], - "end": [ - 588, - 28 - ], - "line": " continue\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 588, - 28 - ], - "end": [ - 589, - 0 - ], - "line": " continue\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 589, - 16 - ], - "end": [ - 589, - 16 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 589, - 16 - ], - "end": [ - 589, - 21 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 589, - 21 - ], - "end": [ - 589, - 22 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 589, - 23 - ], - "end": [ - 589, - 30 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 589, - 31 - ], - "end": [ - 589, - 32 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 589, - 33 - ], - "end": [ - 589, - 37 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 589, - 37 - ], - "end": [ - 589, - 38 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 589, - 38 - ], - "end": [ - 589, - 43 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 589, - 43 - ], - "end": [ - 589, - 44 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 589, - 44 - ], - "end": [ - 589, - 47 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 589, - 47 - ], - "end": [ - 589, - 48 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 589, - 48 - ], - "end": [ - 589, - 49 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 589, - 50 - ], - "end": [ - 589, - 54 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 589, - 54 - ], - "end": [ - 589, - 55 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 589, - 55 - ], - "end": [ - 589, - 60 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 589, - 60 - ], - "end": [ - 589, - 61 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 589, - 61 - ], - "end": [ - 590, - 0 - ], - "line": " token, initial = line[start:end], line[start]\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 590, - 0 - ], - "end": [ - 591, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 591, - 16 - ], - "end": [ - 591, - 18 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 591, - 19 - ], - "end": [ - 591, - 20 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 591, - 20 - ], - "end": [ - 591, - 27 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 591, - 28 - ], - "end": [ - 591, - 30 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "NAME", - "string": "numchars", - "start": [ - 591, - 31 - ], - "end": [ - 591, - 39 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 591, - 40 - ], - "end": [ - 591, - 42 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "COMMENT", - "string": "# ordinary number", - "start": [ - 591, - 60 - ], - "end": [ - 591, - 77 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 591, - 77 - ], - "end": [ - 592, - 0 - ], - "line": " if (initial in numchars or # ordinary number\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 592, - 20 - ], - "end": [ - 592, - 21 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 592, - 21 - ], - "end": [ - 592, - 28 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 592, - 29 - ], - "end": [ - 592, - 31 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "STRING", - "string": "'.'", - "start": [ - 592, - 32 - ], - "end": [ - 592, - 35 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 592, - 36 - ], - "end": [ - 592, - 39 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 592, - 40 - ], - "end": [ - 592, - 45 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "OP", - "string": "!=", - "start": [ - 592, - 46 - ], - "end": [ - 592, - 48 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "STRING", - "string": "'.'", - "start": [ - 592, - 49 - ], - "end": [ - 592, - 52 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 592, - 53 - ], - "end": [ - 592, - 56 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 592, - 57 - ], - "end": [ - 592, - 62 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "OP", - "string": "!=", - "start": [ - 592, - 63 - ], - "end": [ - 592, - 65 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "STRING", - "string": "'...'", - "start": [ - 592, - 66 - ], - "end": [ - 592, - 71 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 592, - 71 - ], - "end": [ - 592, - 72 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 592, - 72 - ], - "end": [ - 592, - 73 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 592, - 73 - ], - "end": [ - 592, - 74 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 592, - 74 - ], - "end": [ - 593, - 0 - ], - "line": " (initial == '.' and token != '.' and token != '...')):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 593, - 0 - ], - "end": [ - 593, - 20 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 593, - 20 - ], - "end": [ - 593, - 25 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 593, - 26 - ], - "end": [ - 593, - 35 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 593, - 35 - ], - "end": [ - 593, - 36 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "NUMBER", - "start": [ - 593, - 36 - ], - "end": [ - 593, - 42 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 593, - 42 - ], - "end": [ - 593, - 43 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 593, - 44 - ], - "end": [ - 593, - 49 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 593, - 49 - ], - "end": [ - 593, - 50 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 593, - 51 - ], - "end": [ - 593, - 55 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 593, - 55 - ], - "end": [ - 593, - 56 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 593, - 57 - ], - "end": [ - 593, - 61 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 593, - 61 - ], - "end": [ - 593, - 62 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 593, - 63 - ], - "end": [ - 593, - 67 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 593, - 67 - ], - "end": [ - 593, - 68 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 593, - 68 - ], - "end": [ - 594, - 0 - ], - "line": " yield TokenInfo(NUMBER, token, spos, epos, line)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 594, - 16 - ], - "end": [ - 594, - 16 - ], - "line": " elif initial in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 594, - 16 - ], - "end": [ - 594, - 20 - ], - "line": " elif initial in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 594, - 21 - ], - "end": [ - 594, - 28 - ], - "line": " elif initial in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 594, - 29 - ], - "end": [ - 594, - 31 - ], - "line": " elif initial in '\\r\\n':\n" - }, - { - "typ": "STRING", - "string": "'\\r\\n'", - "start": [ - 594, - 32 - ], - "end": [ - 594, - 38 - ], - "line": " elif initial in '\\r\\n':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 594, - 38 - ], - "end": [ - 594, - 39 - ], - "line": " elif initial in '\\r\\n':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 594, - 39 - ], - "end": [ - 595, - 0 - ], - "line": " elif initial in '\\r\\n':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 595, - 0 - ], - "end": [ - 595, - 20 - ], - "line": " if parenlev > 0:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 595, - 20 - ], - "end": [ - 595, - 22 - ], - "line": " if parenlev > 0:\n" - }, - { - "typ": "NAME", - "string": "parenlev", - "start": [ - 595, - 23 - ], - "end": [ - 595, - 31 - ], - "line": " if parenlev > 0:\n" - }, - { - "typ": "OP", - "string": ">", - "start": [ - 595, - 32 - ], - "end": [ - 595, - 33 - ], - "line": " if parenlev > 0:\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 595, - 34 - ], - "end": [ - 595, - 35 - ], - "line": " if parenlev > 0:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 595, - 35 - ], - "end": [ - 595, - 36 - ], - "line": " if parenlev > 0:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 595, - 36 - ], - "end": [ - 596, - 0 - ], - "line": " if parenlev > 0:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 596, - 0 - ], - "end": [ - 596, - 24 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 596, - 24 - ], - "end": [ - 596, - 29 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 596, - 30 - ], - "end": [ - 596, - 39 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 596, - 39 - ], - "end": [ - 596, - 40 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "NL", - "start": [ - 596, - 40 - ], - "end": [ - 596, - 42 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 596, - 42 - ], - "end": [ - 596, - 43 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 596, - 44 - ], - "end": [ - 596, - 49 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 596, - 49 - ], - "end": [ - 596, - 50 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 596, - 51 - ], - "end": [ - 596, - 55 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 596, - 55 - ], - "end": [ - 596, - 56 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 596, - 57 - ], - "end": [ - 596, - 61 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 596, - 61 - ], - "end": [ - 596, - 62 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 596, - 63 - ], - "end": [ - 596, - 67 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 596, - 67 - ], - "end": [ - 596, - 68 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 596, - 68 - ], - "end": [ - 597, - 0 - ], - "line": " yield TokenInfo(NL, token, spos, epos, line)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 597, - 20 - ], - "end": [ - 597, - 20 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 597, - 20 - ], - "end": [ - 597, - 24 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 597, - 24 - ], - "end": [ - 597, - 25 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 597, - 25 - ], - "end": [ - 598, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 598, - 0 - ], - "end": [ - 598, - 24 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 598, - 24 - ], - "end": [ - 598, - 29 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 598, - 30 - ], - "end": [ - 598, - 39 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 598, - 39 - ], - "end": [ - 598, - 40 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "NEWLINE", - "start": [ - 598, - 40 - ], - "end": [ - 598, - 47 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 598, - 47 - ], - "end": [ - 598, - 48 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 598, - 49 - ], - "end": [ - 598, - 54 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 598, - 54 - ], - "end": [ - 598, - 55 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 598, - 56 - ], - "end": [ - 598, - 60 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 598, - 60 - ], - "end": [ - 598, - 61 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 598, - 62 - ], - "end": [ - 598, - 66 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 598, - 66 - ], - "end": [ - 598, - 67 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 598, - 68 - ], - "end": [ - 598, - 72 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 598, - 72 - ], - "end": [ - 598, - 73 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 598, - 73 - ], - "end": [ - 599, - 0 - ], - "line": " yield TokenInfo(NEWLINE, token, spos, epos, line)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 599, - 0 - ], - "end": [ - 600, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 600, - 16 - ], - "end": [ - 600, - 16 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 600, - 16 - ], - "end": [ - 600, - 16 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 600, - 16 - ], - "end": [ - 600, - 20 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 600, - 21 - ], - "end": [ - 600, - 28 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 600, - 29 - ], - "end": [ - 600, - 31 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "STRING", - "string": "'#'", - "start": [ - 600, - 32 - ], - "end": [ - 600, - 35 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 600, - 35 - ], - "end": [ - 600, - 36 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 600, - 36 - ], - "end": [ - 601, - 0 - ], - "line": " elif initial == '#':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 601, - 0 - ], - "end": [ - 601, - 20 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "NAME", - "string": "assert", - "start": [ - 601, - 20 - ], - "end": [ - 601, - 26 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 601, - 27 - ], - "end": [ - 601, - 30 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 601, - 31 - ], - "end": [ - 601, - 36 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 601, - 36 - ], - "end": [ - 601, - 37 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "NAME", - "string": "endswith", - "start": [ - 601, - 37 - ], - "end": [ - 601, - 45 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 601, - 45 - ], - "end": [ - 601, - 46 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "STRING", - "string": "\"\\n\"", - "start": [ - 601, - 46 - ], - "end": [ - 601, - 50 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 601, - 50 - ], - "end": [ - 601, - 51 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 601, - 51 - ], - "end": [ - 602, - 0 - ], - "line": " assert not token.endswith(\"\\n\")\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 602, - 20 - ], - "end": [ - 602, - 25 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 602, - 26 - ], - "end": [ - 602, - 35 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 602, - 35 - ], - "end": [ - 602, - 36 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "COMMENT", - "start": [ - 602, - 36 - ], - "end": [ - 602, - 43 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 602, - 43 - ], - "end": [ - 602, - 44 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 602, - 45 - ], - "end": [ - 602, - 50 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 602, - 50 - ], - "end": [ - 602, - 51 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 602, - 52 - ], - "end": [ - 602, - 56 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 602, - 56 - ], - "end": [ - 602, - 57 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 602, - 58 - ], - "end": [ - 602, - 62 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 602, - 62 - ], - "end": [ - 602, - 63 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 602, - 64 - ], - "end": [ - 602, - 68 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 602, - 68 - ], - "end": [ - 602, - 69 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 602, - 69 - ], - "end": [ - 603, - 0 - ], - "line": " yield TokenInfo(COMMENT, token, spos, epos, line)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 603, - 0 - ], - "end": [ - 604, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 604, - 16 - ], - "end": [ - 604, - 16 - ], - "line": " elif token in triple_quoted:\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 604, - 16 - ], - "end": [ - 604, - 20 - ], - "line": " elif token in triple_quoted:\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 604, - 21 - ], - "end": [ - 604, - 26 - ], - "line": " elif token in triple_quoted:\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 604, - 27 - ], - "end": [ - 604, - 29 - ], - "line": " elif token in triple_quoted:\n" - }, - { - "typ": "NAME", - "string": "triple_quoted", - "start": [ - 604, - 30 - ], - "end": [ - 604, - 43 - ], - "line": " elif token in triple_quoted:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 604, - 43 - ], - "end": [ - 604, - 44 - ], - "line": " elif token in triple_quoted:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 604, - 44 - ], - "end": [ - 605, - 0 - ], - "line": " elif token in triple_quoted:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 605, - 0 - ], - "end": [ - 605, - 20 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "NAME", - "string": "endprog", - "start": [ - 605, - 20 - ], - "end": [ - 605, - 27 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 605, - 28 - ], - "end": [ - 605, - 29 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "NAME", - "string": "_compile", - "start": [ - 605, - 30 - ], - "end": [ - 605, - 38 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 605, - 38 - ], - "end": [ - 605, - 39 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 605, - 39 - ], - "end": [ - 605, - 46 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 605, - 46 - ], - "end": [ - 605, - 47 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 605, - 47 - ], - "end": [ - 605, - 52 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 605, - 52 - ], - "end": [ - 605, - 53 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 605, - 53 - ], - "end": [ - 605, - 54 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 605, - 54 - ], - "end": [ - 606, - 0 - ], - "line": " endprog = _compile(endpats[token])\n" - }, - { - "typ": "NAME", - "string": "endmatch", - "start": [ - 606, - 20 - ], - "end": [ - 606, - 28 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 606, - 29 - ], - "end": [ - 606, - 30 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "endprog", - "start": [ - 606, - 31 - ], - "end": [ - 606, - 38 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 606, - 38 - ], - "end": [ - 606, - 39 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "match", - "start": [ - 606, - 39 - ], - "end": [ - 606, - 44 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 606, - 44 - ], - "end": [ - 606, - 45 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 606, - 45 - ], - "end": [ - 606, - 49 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 606, - 49 - ], - "end": [ - 606, - 50 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 606, - 51 - ], - "end": [ - 606, - 54 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 606, - 54 - ], - "end": [ - 606, - 55 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 606, - 55 - ], - "end": [ - 607, - 0 - ], - "line": " endmatch = endprog.match(line, pos)\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 607, - 20 - ], - "end": [ - 607, - 22 - ], - "line": " if endmatch: # all on one line\n" - }, - { - "typ": "NAME", - "string": "endmatch", - "start": [ - 607, - 23 - ], - "end": [ - 607, - 31 - ], - "line": " if endmatch: # all on one line\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 607, - 31 - ], - "end": [ - 607, - 32 - ], - "line": " if endmatch: # all on one line\n" - }, - { - "typ": "COMMENT", - "string": "# all on one line", - "start": [ - 607, - 59 - ], - "end": [ - 607, - 76 - ], - "line": " if endmatch: # all on one line\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 607, - 76 - ], - "end": [ - 608, - 0 - ], - "line": " if endmatch: # all on one line\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 608, - 0 - ], - "end": [ - 608, - 24 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 608, - 24 - ], - "end": [ - 608, - 27 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 608, - 28 - ], - "end": [ - 608, - 29 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "endmatch", - "start": [ - 608, - 30 - ], - "end": [ - 608, - 38 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 608, - 38 - ], - "end": [ - 608, - 39 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 608, - 39 - ], - "end": [ - 608, - 42 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 608, - 42 - ], - "end": [ - 608, - 43 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 608, - 43 - ], - "end": [ - 608, - 44 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 608, - 44 - ], - "end": [ - 608, - 45 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 608, - 45 - ], - "end": [ - 609, - 0 - ], - "line": " pos = endmatch.end(0)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 609, - 24 - ], - "end": [ - 609, - 29 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 609, - 30 - ], - "end": [ - 609, - 31 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 609, - 32 - ], - "end": [ - 609, - 36 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 609, - 36 - ], - "end": [ - 609, - 37 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 609, - 37 - ], - "end": [ - 609, - 42 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 609, - 42 - ], - "end": [ - 609, - 43 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 609, - 43 - ], - "end": [ - 609, - 46 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 609, - 46 - ], - "end": [ - 609, - 47 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 609, - 47 - ], - "end": [ - 610, - 0 - ], - "line": " token = line[start:pos]\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 610, - 24 - ], - "end": [ - 610, - 29 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 610, - 30 - ], - "end": [ - 610, - 39 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 610, - 39 - ], - "end": [ - 610, - 40 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "STRING", - "start": [ - 610, - 40 - ], - "end": [ - 610, - 46 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 610, - 46 - ], - "end": [ - 610, - 47 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 610, - 48 - ], - "end": [ - 610, - 53 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 610, - 53 - ], - "end": [ - 610, - 54 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 610, - 55 - ], - "end": [ - 610, - 59 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 610, - 59 - ], - "end": [ - 610, - 60 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 610, - 61 - ], - "end": [ - 610, - 62 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 610, - 62 - ], - "end": [ - 610, - 66 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 610, - 66 - ], - "end": [ - 610, - 67 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 610, - 68 - ], - "end": [ - 610, - 71 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 610, - 71 - ], - "end": [ - 610, - 72 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 610, - 72 - ], - "end": [ - 610, - 73 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 610, - 74 - ], - "end": [ - 610, - 78 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 610, - 78 - ], - "end": [ - 610, - 79 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 610, - 79 - ], - "end": [ - 611, - 0 - ], - "line": " yield TokenInfo(STRING, token, spos, (lnum, pos), line)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 611, - 20 - ], - "end": [ - 611, - 20 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 611, - 20 - ], - "end": [ - 611, - 24 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 611, - 24 - ], - "end": [ - 611, - 25 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 611, - 25 - ], - "end": [ - 612, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 612, - 0 - ], - "end": [ - 612, - 24 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "NAME", - "string": "strstart", - "start": [ - 612, - 24 - ], - "end": [ - 612, - 32 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 612, - 33 - ], - "end": [ - 612, - 34 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 612, - 35 - ], - "end": [ - 612, - 36 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 612, - 36 - ], - "end": [ - 612, - 40 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 612, - 40 - ], - "end": [ - 612, - 41 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 612, - 42 - ], - "end": [ - 612, - 47 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 612, - 47 - ], - "end": [ - 612, - 48 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "COMMENT", - "string": "# multiple lines", - "start": [ - 612, - 59 - ], - "end": [ - 612, - 75 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 612, - 75 - ], - "end": [ - 613, - 0 - ], - "line": " strstart = (lnum, start) # multiple lines\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 613, - 24 - ], - "end": [ - 613, - 31 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 613, - 32 - ], - "end": [ - 613, - 33 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 613, - 34 - ], - "end": [ - 613, - 38 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 613, - 38 - ], - "end": [ - 613, - 39 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 613, - 39 - ], - "end": [ - 613, - 44 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 613, - 44 - ], - "end": [ - 613, - 45 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 613, - 45 - ], - "end": [ - 613, - 46 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 613, - 46 - ], - "end": [ - 614, - 0 - ], - "line": " contstr = line[start:]\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 614, - 24 - ], - "end": [ - 614, - 32 - ], - "line": " contline = line\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 614, - 33 - ], - "end": [ - 614, - 34 - ], - "line": " contline = line\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 614, - 35 - ], - "end": [ - 614, - 39 - ], - "line": " contline = line\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 614, - 39 - ], - "end": [ - 615, - 0 - ], - "line": " contline = line\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 615, - 24 - ], - "end": [ - 615, - 29 - ], - "line": " break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 615, - 29 - ], - "end": [ - 616, - 0 - ], - "line": " break\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 616, - 0 - ], - "end": [ - 617, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Check up to the first 3 chars of the token to see if", - "start": [ - 617, - 16 - ], - "end": [ - 617, - 70 - ], - "line": " # Check up to the first 3 chars of the token to see if\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 617, - 70 - ], - "end": [ - 618, - 0 - ], - "line": " # Check up to the first 3 chars of the token to see if\n" - }, - { - "typ": "COMMENT", - "string": "# they're in the single_quoted set. If so, they start", - "start": [ - 618, - 16 - ], - "end": [ - 618, - 70 - ], - "line": " # they're in the single_quoted set. If so, they start\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 618, - 70 - ], - "end": [ - 619, - 0 - ], - "line": " # they're in the single_quoted set. If so, they start\n" - }, - { - "typ": "COMMENT", - "string": "# a string.", - "start": [ - 619, - 16 - ], - "end": [ - 619, - 28 - ], - "line": " # a string.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 619, - 28 - ], - "end": [ - 620, - 0 - ], - "line": " # a string.\n" - }, - { - "typ": "COMMENT", - "string": "# We're using the first 3, because we're looking for", - "start": [ - 620, - 16 - ], - "end": [ - 620, - 68 - ], - "line": " # We're using the first 3, because we're looking for\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 620, - 68 - ], - "end": [ - 621, - 0 - ], - "line": " # We're using the first 3, because we're looking for\n" - }, - { - "typ": "COMMENT", - "string": "# \"rb'\" (for example) at the start of the token. If", - "start": [ - 621, - 16 - ], - "end": [ - 621, - 68 - ], - "line": " # \"rb'\" (for example) at the start of the token. If\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 621, - 68 - ], - "end": [ - 622, - 0 - ], - "line": " # \"rb'\" (for example) at the start of the token. If\n" - }, - { - "typ": "COMMENT", - "string": "# we switch to longer prefixes, this needs to be", - "start": [ - 622, - 16 - ], - "end": [ - 622, - 65 - ], - "line": " # we switch to longer prefixes, this needs to be\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 622, - 65 - ], - "end": [ - 623, - 0 - ], - "line": " # we switch to longer prefixes, this needs to be\n" - }, - { - "typ": "COMMENT", - "string": "# adjusted.", - "start": [ - 623, - 16 - ], - "end": [ - 623, - 28 - ], - "line": " # adjusted.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 623, - 28 - ], - "end": [ - 624, - 0 - ], - "line": " # adjusted.\n" - }, - { - "typ": "COMMENT", - "string": "# Note that initial == token[:1].", - "start": [ - 624, - 16 - ], - "end": [ - 624, - 49 - ], - "line": " # Note that initial == token[:1].\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 624, - 49 - ], - "end": [ - 625, - 0 - ], - "line": " # Note that initial == token[:1].\n" - }, - { - "typ": "COMMENT", - "string": "# Also note that single quote checking must come after", - "start": [ - 625, - 16 - ], - "end": [ - 625, - 70 - ], - "line": " # Also note that single quote checking must come after\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 625, - 70 - ], - "end": [ - 626, - 0 - ], - "line": " # Also note that single quote checking must come after\n" - }, - { - "typ": "COMMENT", - "string": "# triple quote checking (above).", - "start": [ - 626, - 16 - ], - "end": [ - 626, - 49 - ], - "line": " # triple quote checking (above).\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 626, - 49 - ], - "end": [ - 627, - 0 - ], - "line": " # triple quote checking (above).\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 627, - 16 - ], - "end": [ - 627, - 16 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 627, - 16 - ], - "end": [ - 627, - 16 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 627, - 16 - ], - "end": [ - 627, - 20 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 627, - 21 - ], - "end": [ - 627, - 22 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 627, - 22 - ], - "end": [ - 627, - 29 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 627, - 30 - ], - "end": [ - 627, - 32 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "single_quoted", - "start": [ - 627, - 33 - ], - "end": [ - 627, - 46 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 627, - 47 - ], - "end": [ - 627, - 49 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 627, - 49 - ], - "end": [ - 628, - 0 - ], - "line": " elif (initial in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 628, - 22 - ], - "end": [ - 628, - 27 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 628, - 27 - ], - "end": [ - 628, - 28 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 628, - 28 - ], - "end": [ - 628, - 29 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "NUMBER", - "string": "2", - "start": [ - 628, - 29 - ], - "end": [ - 628, - 30 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 628, - 30 - ], - "end": [ - 628, - 31 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 628, - 32 - ], - "end": [ - 628, - 34 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "single_quoted", - "start": [ - 628, - 35 - ], - "end": [ - 628, - 48 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 628, - 49 - ], - "end": [ - 628, - 51 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 628, - 51 - ], - "end": [ - 629, - 0 - ], - "line": " token[:2] in single_quoted or\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 629, - 22 - ], - "end": [ - 629, - 27 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 629, - 27 - ], - "end": [ - 629, - 28 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 629, - 28 - ], - "end": [ - 629, - 29 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "NUMBER", - "string": "3", - "start": [ - 629, - 29 - ], - "end": [ - 629, - 30 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 629, - 30 - ], - "end": [ - 629, - 31 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 629, - 32 - ], - "end": [ - 629, - 34 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "NAME", - "string": "single_quoted", - "start": [ - 629, - 35 - ], - "end": [ - 629, - 48 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 629, - 48 - ], - "end": [ - 629, - 49 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 629, - 49 - ], - "end": [ - 629, - 50 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 629, - 50 - ], - "end": [ - 630, - 0 - ], - "line": " token[:3] in single_quoted):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 630, - 0 - ], - "end": [ - 630, - 20 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 630, - 20 - ], - "end": [ - 630, - 22 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 630, - 23 - ], - "end": [ - 630, - 28 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 630, - 28 - ], - "end": [ - 630, - 29 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 630, - 29 - ], - "end": [ - 630, - 30 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 630, - 30 - ], - "end": [ - 630, - 31 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 630, - 31 - ], - "end": [ - 630, - 32 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 630, - 33 - ], - "end": [ - 630, - 35 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "STRING", - "string": "'\\n'", - "start": [ - 630, - 36 - ], - "end": [ - 630, - 40 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 630, - 40 - ], - "end": [ - 630, - 41 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "COMMENT", - "string": "# continued string", - "start": [ - 630, - 59 - ], - "end": [ - 630, - 77 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 630, - 77 - ], - "end": [ - 631, - 0 - ], - "line": " if token[-1] == '\\n': # continued string\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 631, - 0 - ], - "end": [ - 631, - 24 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "NAME", - "string": "strstart", - "start": [ - 631, - 24 - ], - "end": [ - 631, - 32 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 631, - 33 - ], - "end": [ - 631, - 34 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 631, - 35 - ], - "end": [ - 631, - 36 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 631, - 36 - ], - "end": [ - 631, - 40 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 631, - 40 - ], - "end": [ - 631, - 41 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 631, - 42 - ], - "end": [ - 631, - 47 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 631, - 47 - ], - "end": [ - 631, - 48 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 631, - 48 - ], - "end": [ - 632, - 0 - ], - "line": " strstart = (lnum, start)\n" - }, - { - "typ": "COMMENT", - "string": "# Again, using the first 3 chars of the", - "start": [ - 632, - 24 - ], - "end": [ - 632, - 63 - ], - "line": " # Again, using the first 3 chars of the\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 632, - 63 - ], - "end": [ - 633, - 0 - ], - "line": " # Again, using the first 3 chars of the\n" - }, - { - "typ": "COMMENT", - "string": "# token. This is looking for the matching end", - "start": [ - 633, - 24 - ], - "end": [ - 633, - 70 - ], - "line": " # token. This is looking for the matching end\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 633, - 70 - ], - "end": [ - 634, - 0 - ], - "line": " # token. This is looking for the matching end\n" - }, - { - "typ": "COMMENT", - "string": "# regex for the correct type of quote", - "start": [ - 634, - 24 - ], - "end": [ - 634, - 62 - ], - "line": " # regex for the correct type of quote\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 634, - 62 - ], - "end": [ - 635, - 0 - ], - "line": " # regex for the correct type of quote\n" - }, - { - "typ": "COMMENT", - "string": "# character. So it's really looking for", - "start": [ - 635, - 24 - ], - "end": [ - 635, - 64 - ], - "line": " # character. So it's really looking for\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 635, - 64 - ], - "end": [ - 636, - 0 - ], - "line": " # character. So it's really looking for\n" - }, - { - "typ": "COMMENT", - "string": "# endpats[\"'\"] or endpats['\"'], by trying to", - "start": [ - 636, - 24 - ], - "end": [ - 636, - 69 - ], - "line": " # endpats[\"'\"] or endpats['\"'], by trying to\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 636, - 69 - ], - "end": [ - 637, - 0 - ], - "line": " # endpats[\"'\"] or endpats['\"'], by trying to\n" - }, - { - "typ": "COMMENT", - "string": "# skip string prefix characters, if any.", - "start": [ - 637, - 24 - ], - "end": [ - 637, - 65 - ], - "line": " # skip string prefix characters, if any.\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 637, - 65 - ], - "end": [ - 638, - 0 - ], - "line": " # skip string prefix characters, if any.\n" - }, - { - "typ": "NAME", - "string": "endprog", - "start": [ - 638, - 24 - ], - "end": [ - 638, - 31 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 638, - 32 - ], - "end": [ - 638, - 33 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "NAME", - "string": "_compile", - "start": [ - 638, - 34 - ], - "end": [ - 638, - 42 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 638, - 42 - ], - "end": [ - 638, - 43 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 638, - 43 - ], - "end": [ - 638, - 50 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 638, - 50 - ], - "end": [ - 638, - 51 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "NAME", - "string": "get", - "start": [ - 638, - 51 - ], - "end": [ - 638, - 54 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 638, - 54 - ], - "end": [ - 638, - 55 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 638, - 55 - ], - "end": [ - 638, - 62 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 638, - 62 - ], - "end": [ - 638, - 63 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 638, - 64 - ], - "end": [ - 638, - 66 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 638, - 66 - ], - "end": [ - 639, - 0 - ], - "line": " endprog = _compile(endpats.get(initial) or\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 639, - 43 - ], - "end": [ - 639, - 50 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 639, - 50 - ], - "end": [ - 639, - 51 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "NAME", - "string": "get", - "start": [ - 639, - 51 - ], - "end": [ - 639, - 54 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 639, - 54 - ], - "end": [ - 639, - 55 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 639, - 55 - ], - "end": [ - 639, - 60 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 639, - 60 - ], - "end": [ - 639, - 61 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 639, - 61 - ], - "end": [ - 639, - 62 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 639, - 62 - ], - "end": [ - 639, - 63 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 639, - 63 - ], - "end": [ - 639, - 64 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "NAME", - "string": "or", - "start": [ - 639, - 65 - ], - "end": [ - 639, - 67 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 639, - 67 - ], - "end": [ - 640, - 0 - ], - "line": " endpats.get(token[1]) or\n" - }, - { - "typ": "NAME", - "string": "endpats", - "start": [ - 640, - 43 - ], - "end": [ - 640, - 50 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 640, - 50 - ], - "end": [ - 640, - 51 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "NAME", - "string": "get", - "start": [ - 640, - 51 - ], - "end": [ - 640, - 54 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 640, - 54 - ], - "end": [ - 640, - 55 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 640, - 55 - ], - "end": [ - 640, - 60 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 640, - 60 - ], - "end": [ - 640, - 61 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "NUMBER", - "string": "2", - "start": [ - 640, - 61 - ], - "end": [ - 640, - 62 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 640, - 62 - ], - "end": [ - 640, - 63 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 640, - 63 - ], - "end": [ - 640, - 64 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 640, - 64 - ], - "end": [ - 640, - 65 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 640, - 65 - ], - "end": [ - 641, - 0 - ], - "line": " endpats.get(token[2]))\n" - }, - { - "typ": "NAME", - "string": "contstr", - "start": [ - 641, - 24 - ], - "end": [ - 641, - 31 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 641, - 31 - ], - "end": [ - 641, - 32 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "NAME", - "string": "needcont", - "start": [ - 641, - 33 - ], - "end": [ - 641, - 41 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 641, - 42 - ], - "end": [ - 641, - 43 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 641, - 44 - ], - "end": [ - 641, - 48 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 641, - 48 - ], - "end": [ - 641, - 49 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 641, - 49 - ], - "end": [ - 641, - 54 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 641, - 54 - ], - "end": [ - 641, - 55 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 641, - 55 - ], - "end": [ - 641, - 56 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 641, - 56 - ], - "end": [ - 641, - 57 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 641, - 58 - ], - "end": [ - 641, - 59 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 641, - 59 - ], - "end": [ - 642, - 0 - ], - "line": " contstr, needcont = line[start:], 1\n" - }, - { - "typ": "NAME", - "string": "contline", - "start": [ - 642, - 24 - ], - "end": [ - 642, - 32 - ], - "line": " contline = line\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 642, - 33 - ], - "end": [ - 642, - 34 - ], - "line": " contline = line\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 642, - 35 - ], - "end": [ - 642, - 39 - ], - "line": " contline = line\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 642, - 39 - ], - "end": [ - 643, - 0 - ], - "line": " contline = line\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 643, - 24 - ], - "end": [ - 643, - 29 - ], - "line": " break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 643, - 29 - ], - "end": [ - 644, - 0 - ], - "line": " break\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 644, - 20 - ], - "end": [ - 644, - 20 - ], - "line": " else: # ordinary string\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 644, - 20 - ], - "end": [ - 644, - 24 - ], - "line": " else: # ordinary string\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 644, - 24 - ], - "end": [ - 644, - 25 - ], - "line": " else: # ordinary string\n" - }, - { - "typ": "COMMENT", - "string": "# ordinary string", - "start": [ - 644, - 59 - ], - "end": [ - 644, - 76 - ], - "line": " else: # ordinary string\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 644, - 76 - ], - "end": [ - 645, - 0 - ], - "line": " else: # ordinary string\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 645, - 0 - ], - "end": [ - 645, - 24 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 645, - 24 - ], - "end": [ - 645, - 29 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 645, - 30 - ], - "end": [ - 645, - 39 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 645, - 39 - ], - "end": [ - 645, - 40 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "STRING", - "start": [ - 645, - 40 - ], - "end": [ - 645, - 46 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 645, - 46 - ], - "end": [ - 645, - 47 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 645, - 48 - ], - "end": [ - 645, - 53 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 645, - 53 - ], - "end": [ - 645, - 54 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 645, - 55 - ], - "end": [ - 645, - 59 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 645, - 59 - ], - "end": [ - 645, - 60 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 645, - 61 - ], - "end": [ - 645, - 65 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 645, - 65 - ], - "end": [ - 645, - 66 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 645, - 67 - ], - "end": [ - 645, - 71 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 645, - 71 - ], - "end": [ - 645, - 72 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 645, - 72 - ], - "end": [ - 646, - 0 - ], - "line": " yield TokenInfo(STRING, token, spos, epos, line)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 646, - 0 - ], - "end": [ - 647, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 647, - 16 - ], - "end": [ - 647, - 16 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 647, - 16 - ], - "end": [ - 647, - 16 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 647, - 16 - ], - "end": [ - 647, - 20 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 647, - 21 - ], - "end": [ - 647, - 28 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 647, - 28 - ], - "end": [ - 647, - 29 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "NAME", - "string": "isidentifier", - "start": [ - 647, - 29 - ], - "end": [ - 647, - 41 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 647, - 41 - ], - "end": [ - 647, - 42 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 647, - 42 - ], - "end": [ - 647, - 43 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 647, - 43 - ], - "end": [ - 647, - 44 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "COMMENT", - "string": "# ordinary name", - "start": [ - 647, - 59 - ], - "end": [ - 647, - 74 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 647, - 74 - ], - "end": [ - 648, - 0 - ], - "line": " elif initial.isidentifier(): # ordinary name\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 648, - 0 - ], - "end": [ - 648, - 20 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 648, - 20 - ], - "end": [ - 648, - 25 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 648, - 26 - ], - "end": [ - 648, - 35 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 648, - 35 - ], - "end": [ - 648, - 36 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "NAME", - "start": [ - 648, - 36 - ], - "end": [ - 648, - 40 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 648, - 40 - ], - "end": [ - 648, - 41 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 648, - 42 - ], - "end": [ - 648, - 47 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 648, - 47 - ], - "end": [ - 648, - 48 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 648, - 49 - ], - "end": [ - 648, - 53 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 648, - 53 - ], - "end": [ - 648, - 54 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 648, - 55 - ], - "end": [ - 648, - 59 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 648, - 59 - ], - "end": [ - 648, - 60 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 648, - 61 - ], - "end": [ - 648, - 65 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 648, - 65 - ], - "end": [ - 648, - 66 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 648, - 66 - ], - "end": [ - 649, - 0 - ], - "line": " yield TokenInfo(NAME, token, spos, epos, line)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 649, - 16 - ], - "end": [ - 649, - 16 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 649, - 16 - ], - "end": [ - 649, - 20 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 649, - 21 - ], - "end": [ - 649, - 28 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 649, - 29 - ], - "end": [ - 649, - 31 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "STRING", - "string": "'\\\\'", - "start": [ - 649, - 32 - ], - "end": [ - 649, - 36 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 649, - 36 - ], - "end": [ - 649, - 37 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "COMMENT", - "string": "# continued stmt", - "start": [ - 649, - 59 - ], - "end": [ - 649, - 75 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 649, - 75 - ], - "end": [ - 650, - 0 - ], - "line": " elif initial == '\\\\': # continued stmt\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 650, - 0 - ], - "end": [ - 650, - 20 - ], - "line": " continued = 1\n" - }, - { - "typ": "NAME", - "string": "continued", - "start": [ - 650, - 20 - ], - "end": [ - 650, - 29 - ], - "line": " continued = 1\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 650, - 30 - ], - "end": [ - 650, - 31 - ], - "line": " continued = 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 650, - 32 - ], - "end": [ - 650, - 33 - ], - "line": " continued = 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 650, - 33 - ], - "end": [ - 651, - 0 - ], - "line": " continued = 1\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 651, - 16 - ], - "end": [ - 651, - 16 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 651, - 16 - ], - "end": [ - 651, - 20 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 651, - 20 - ], - "end": [ - 651, - 21 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 651, - 21 - ], - "end": [ - 652, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 652, - 0 - ], - "end": [ - 652, - 20 - ], - "line": " if initial in '([{':\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 652, - 20 - ], - "end": [ - 652, - 22 - ], - "line": " if initial in '([{':\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 652, - 23 - ], - "end": [ - 652, - 30 - ], - "line": " if initial in '([{':\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 652, - 31 - ], - "end": [ - 652, - 33 - ], - "line": " if initial in '([{':\n" - }, - { - "typ": "STRING", - "string": "'([{'", - "start": [ - 652, - 34 - ], - "end": [ - 652, - 39 - ], - "line": " if initial in '([{':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 652, - 39 - ], - "end": [ - 652, - 40 - ], - "line": " if initial in '([{':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 652, - 40 - ], - "end": [ - 653, - 0 - ], - "line": " if initial in '([{':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 653, - 0 - ], - "end": [ - 653, - 24 - ], - "line": " parenlev += 1\n" - }, - { - "typ": "NAME", - "string": "parenlev", - "start": [ - 653, - 24 - ], - "end": [ - 653, - 32 - ], - "line": " parenlev += 1\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 653, - 33 - ], - "end": [ - 653, - 35 - ], - "line": " parenlev += 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 653, - 36 - ], - "end": [ - 653, - 37 - ], - "line": " parenlev += 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 653, - 37 - ], - "end": [ - 654, - 0 - ], - "line": " parenlev += 1\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 654, - 20 - ], - "end": [ - 654, - 20 - ], - "line": " elif initial in ')]}':\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 654, - 20 - ], - "end": [ - 654, - 24 - ], - "line": " elif initial in ')]}':\n" - }, - { - "typ": "NAME", - "string": "initial", - "start": [ - 654, - 25 - ], - "end": [ - 654, - 32 - ], - "line": " elif initial in ')]}':\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 654, - 33 - ], - "end": [ - 654, - 35 - ], - "line": " elif initial in ')]}':\n" - }, - { - "typ": "STRING", - "string": "')]}'", - "start": [ - 654, - 36 - ], - "end": [ - 654, - 41 - ], - "line": " elif initial in ')]}':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 654, - 41 - ], - "end": [ - 654, - 42 - ], - "line": " elif initial in ')]}':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 654, - 42 - ], - "end": [ - 655, - 0 - ], - "line": " elif initial in ')]}':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 655, - 0 - ], - "end": [ - 655, - 24 - ], - "line": " parenlev -= 1\n" - }, - { - "typ": "NAME", - "string": "parenlev", - "start": [ - 655, - 24 - ], - "end": [ - 655, - 32 - ], - "line": " parenlev -= 1\n" - }, - { - "typ": "OP", - "string": "-=", - "start": [ - 655, - 33 - ], - "end": [ - 655, - 35 - ], - "line": " parenlev -= 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 655, - 36 - ], - "end": [ - 655, - 37 - ], - "line": " parenlev -= 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 655, - 37 - ], - "end": [ - 656, - 0 - ], - "line": " parenlev -= 1\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 656, - 20 - ], - "end": [ - 656, - 20 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 656, - 20 - ], - "end": [ - 656, - 25 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 656, - 26 - ], - "end": [ - 656, - 35 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 656, - 35 - ], - "end": [ - 656, - 36 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "OP", - "start": [ - 656, - 36 - ], - "end": [ - 656, - 38 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 656, - 38 - ], - "end": [ - 656, - 39 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 656, - 40 - ], - "end": [ - 656, - 45 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 656, - 45 - ], - "end": [ - 656, - 46 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "spos", - "start": [ - 656, - 47 - ], - "end": [ - 656, - 51 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 656, - 51 - ], - "end": [ - 656, - 52 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "epos", - "start": [ - 656, - 53 - ], - "end": [ - 656, - 57 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 656, - 57 - ], - "end": [ - 656, - 58 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 656, - 59 - ], - "end": [ - 656, - 63 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 656, - 63 - ], - "end": [ - 656, - 64 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 656, - 64 - ], - "end": [ - 657, - 0 - ], - "line": " yield TokenInfo(OP, token, spos, epos, line)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 657, - 12 - ], - "end": [ - 657, - 12 - ], - "line": " else:\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 657, - 12 - ], - "end": [ - 657, - 12 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 657, - 12 - ], - "end": [ - 657, - 16 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 657, - 16 - ], - "end": [ - 657, - 17 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 657, - 17 - ], - "end": [ - 658, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 658, - 0 - ], - "end": [ - 658, - 16 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 658, - 16 - ], - "end": [ - 658, - 21 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 658, - 22 - ], - "end": [ - 658, - 31 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 658, - 31 - ], - "end": [ - 658, - 32 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "NAME", - "string": "ERRORTOKEN", - "start": [ - 658, - 32 - ], - "end": [ - 658, - 42 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 658, - 42 - ], - "end": [ - 658, - 43 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 658, - 44 - ], - "end": [ - 658, - 48 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 658, - 48 - ], - "end": [ - 658, - 49 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 658, - 49 - ], - "end": [ - 658, - 52 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 658, - 52 - ], - "end": [ - 658, - 53 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 658, - 53 - ], - "end": [ - 658, - 54 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 658, - 54 - ], - "end": [ - 659, - 0 - ], - "line": " yield TokenInfo(ERRORTOKEN, line[pos],\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 659, - 27 - ], - "end": [ - 659, - 28 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 659, - 28 - ], - "end": [ - 659, - 32 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 659, - 32 - ], - "end": [ - 659, - 33 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 659, - 34 - ], - "end": [ - 659, - 37 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 659, - 37 - ], - "end": [ - 659, - 38 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 659, - 38 - ], - "end": [ - 659, - 39 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 659, - 40 - ], - "end": [ - 659, - 41 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 659, - 41 - ], - "end": [ - 659, - 45 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 659, - 45 - ], - "end": [ - 659, - 46 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 659, - 47 - ], - "end": [ - 659, - 50 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 659, - 50 - ], - "end": [ - 659, - 51 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 659, - 51 - ], - "end": [ - 659, - 52 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 659, - 52 - ], - "end": [ - 659, - 53 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 659, - 53 - ], - "end": [ - 659, - 54 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 659, - 55 - ], - "end": [ - 659, - 59 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 659, - 59 - ], - "end": [ - 659, - 60 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 659, - 60 - ], - "end": [ - 660, - 0 - ], - "line": " (lnum, pos), (lnum, pos+1), line)\n" - }, - { - "typ": "NAME", - "string": "pos", - "start": [ - 660, - 16 - ], - "end": [ - 660, - 19 - ], - "line": " pos += 1\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 660, - 20 - ], - "end": [ - 660, - 22 - ], - "line": " pos += 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 660, - 23 - ], - "end": [ - 660, - 24 - ], - "line": " pos += 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 660, - 24 - ], - "end": [ - 661, - 0 - ], - "line": " pos += 1\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 661, - 0 - ], - "end": [ - 662, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Add an implicit NEWLINE if the input doesn't end in one", - "start": [ - 662, - 4 - ], - "end": [ - 662, - 61 - ], - "line": " # Add an implicit NEWLINE if the input doesn't end in one\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 662, - 61 - ], - "end": [ - 663, - 0 - ], - "line": " # Add an implicit NEWLINE if the input doesn't end in one\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 663, - 4 - ], - "end": [ - 663, - 4 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 663, - 4 - ], - "end": [ - 663, - 4 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 663, - 4 - ], - "end": [ - 663, - 4 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 663, - 4 - ], - "end": [ - 663, - 6 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "last_line", - "start": [ - 663, - 7 - ], - "end": [ - 663, - 16 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "and", - "start": [ - 663, - 17 - ], - "end": [ - 663, - 20 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "last_line", - "start": [ - 663, - 21 - ], - "end": [ - 663, - 30 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 663, - 30 - ], - "end": [ - 663, - 31 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 663, - 31 - ], - "end": [ - 663, - 32 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 663, - 32 - ], - "end": [ - 663, - 33 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 663, - 33 - ], - "end": [ - 663, - 34 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "not", - "start": [ - 663, - 35 - ], - "end": [ - 663, - 38 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 663, - 39 - ], - "end": [ - 663, - 41 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "STRING", - "string": "'\\r\\n'", - "start": [ - 663, - 42 - ], - "end": [ - 663, - 48 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 663, - 48 - ], - "end": [ - 663, - 49 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 663, - 49 - ], - "end": [ - 664, - 0 - ], - "line": " if last_line and last_line[-1] not in '\\r\\n':\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 664, - 0 - ], - "end": [ - 664, - 8 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 664, - 8 - ], - "end": [ - 664, - 13 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 664, - 14 - ], - "end": [ - 664, - 23 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 664, - 23 - ], - "end": [ - 664, - 24 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "NEWLINE", - "start": [ - 664, - 24 - ], - "end": [ - 664, - 31 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 664, - 31 - ], - "end": [ - 664, - 32 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 664, - 33 - ], - "end": [ - 664, - 35 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 664, - 35 - ], - "end": [ - 664, - 36 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 664, - 37 - ], - "end": [ - 664, - 38 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 664, - 38 - ], - "end": [ - 664, - 42 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 664, - 43 - ], - "end": [ - 664, - 44 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 664, - 45 - ], - "end": [ - 664, - 46 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 664, - 46 - ], - "end": [ - 664, - 47 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 664, - 48 - ], - "end": [ - 664, - 51 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 664, - 51 - ], - "end": [ - 664, - 52 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "last_line", - "start": [ - 664, - 52 - ], - "end": [ - 664, - 61 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 664, - 61 - ], - "end": [ - 664, - 62 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 664, - 62 - ], - "end": [ - 664, - 63 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 664, - 63 - ], - "end": [ - 664, - 64 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 664, - 65 - ], - "end": [ - 664, - 66 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 664, - 66 - ], - "end": [ - 664, - 70 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 664, - 71 - ], - "end": [ - 664, - 72 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 664, - 73 - ], - "end": [ - 664, - 74 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 664, - 74 - ], - "end": [ - 664, - 75 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 664, - 76 - ], - "end": [ - 664, - 79 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 664, - 79 - ], - "end": [ - 664, - 80 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NAME", - "string": "last_line", - "start": [ - 664, - 80 - ], - "end": [ - 664, - 89 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 664, - 89 - ], - "end": [ - 664, - 90 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 664, - 91 - ], - "end": [ - 664, - 92 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 664, - 93 - ], - "end": [ - 664, - 94 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 664, - 94 - ], - "end": [ - 664, - 95 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 664, - 95 - ], - "end": [ - 664, - 96 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 664, - 97 - ], - "end": [ - 664, - 99 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 664, - 99 - ], - "end": [ - 664, - 100 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 664, - 100 - ], - "end": [ - 665, - 0 - ], - "line": " yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 665, - 4 - ], - "end": [ - 665, - 4 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 665, - 4 - ], - "end": [ - 665, - 7 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "NAME", - "string": "indent", - "start": [ - 665, - 8 - ], - "end": [ - 665, - 14 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 665, - 15 - ], - "end": [ - 665, - 17 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "NAME", - "string": "indents", - "start": [ - 665, - 18 - ], - "end": [ - 665, - 25 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 665, - 25 - ], - "end": [ - 665, - 26 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 665, - 26 - ], - "end": [ - 665, - 27 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 665, - 27 - ], - "end": [ - 665, - 28 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 665, - 28 - ], - "end": [ - 665, - 29 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 665, - 29 - ], - "end": [ - 665, - 30 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "COMMENT", - "string": "# pop remaining indent levels", - "start": [ - 665, - 47 - ], - "end": [ - 665, - 76 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 665, - 76 - ], - "end": [ - 666, - 0 - ], - "line": " for indent in indents[1:]: # pop remaining indent levels\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 666, - 0 - ], - "end": [ - 666, - 8 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 666, - 8 - ], - "end": [ - 666, - 13 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 666, - 14 - ], - "end": [ - 666, - 23 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 666, - 23 - ], - "end": [ - 666, - 24 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "DEDENT", - "start": [ - 666, - 24 - ], - "end": [ - 666, - 30 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 666, - 30 - ], - "end": [ - 666, - 31 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 666, - 32 - ], - "end": [ - 666, - 34 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 666, - 34 - ], - "end": [ - 666, - 35 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 666, - 36 - ], - "end": [ - 666, - 37 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 666, - 37 - ], - "end": [ - 666, - 41 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 666, - 41 - ], - "end": [ - 666, - 42 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 666, - 43 - ], - "end": [ - 666, - 44 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 666, - 44 - ], - "end": [ - 666, - 45 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 666, - 45 - ], - "end": [ - 666, - 46 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 666, - 47 - ], - "end": [ - 666, - 48 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 666, - 48 - ], - "end": [ - 666, - 52 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 666, - 52 - ], - "end": [ - 666, - 53 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 666, - 54 - ], - "end": [ - 666, - 55 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 666, - 55 - ], - "end": [ - 666, - 56 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 666, - 56 - ], - "end": [ - 666, - 57 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 666, - 58 - ], - "end": [ - 666, - 60 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 666, - 60 - ], - "end": [ - 666, - 61 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 666, - 61 - ], - "end": [ - 667, - 0 - ], - "line": " yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 667, - 4 - ], - "end": [ - 667, - 4 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "yield", - "start": [ - 667, - 4 - ], - "end": [ - 667, - 9 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "TokenInfo", - "start": [ - 667, - 10 - ], - "end": [ - 667, - 19 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 667, - 19 - ], - "end": [ - 667, - 20 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "ENDMARKER", - "start": [ - 667, - 20 - ], - "end": [ - 667, - 29 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 667, - 29 - ], - "end": [ - 667, - 30 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 667, - 31 - ], - "end": [ - 667, - 33 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 667, - 33 - ], - "end": [ - 667, - 34 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 667, - 35 - ], - "end": [ - 667, - 36 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 667, - 36 - ], - "end": [ - 667, - 40 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 667, - 40 - ], - "end": [ - 667, - 41 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 667, - 42 - ], - "end": [ - 667, - 43 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 667, - 43 - ], - "end": [ - 667, - 44 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 667, - 44 - ], - "end": [ - 667, - 45 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 667, - 46 - ], - "end": [ - 667, - 47 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NAME", - "string": "lnum", - "start": [ - 667, - 47 - ], - "end": [ - 667, - 51 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 667, - 51 - ], - "end": [ - 667, - 52 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 667, - 53 - ], - "end": [ - 667, - 54 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 667, - 54 - ], - "end": [ - 667, - 55 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 667, - 55 - ], - "end": [ - 667, - 56 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "STRING", - "string": "''", - "start": [ - 667, - 57 - ], - "end": [ - 667, - 59 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 667, - 59 - ], - "end": [ - 667, - 60 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 667, - 60 - ], - "end": [ - 668, - 0 - ], - "line": " yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 668, - 0 - ], - "end": [ - 669, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 669, - 0 - ], - "end": [ - 670, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# An undocumented, backwards compatible, API for all the places in the standard", - "start": [ - 670, - 0 - ], - "end": [ - 670, - 79 - ], - "line": "# An undocumented, backwards compatible, API for all the places in the standard\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 670, - 79 - ], - "end": [ - 671, - 0 - ], - "line": "# An undocumented, backwards compatible, API for all the places in the standard\n" - }, - { - "typ": "COMMENT", - "string": "# library that expect to be able to use tokenize with strings", - "start": [ - 671, - 0 - ], - "end": [ - 671, - 61 - ], - "line": "# library that expect to be able to use tokenize with strings\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 671, - 61 - ], - "end": [ - 672, - 0 - ], - "line": "# library that expect to be able to use tokenize with strings\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 672, - 0 - ], - "end": [ - 672, - 0 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 672, - 0 - ], - "end": [ - 672, - 3 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "NAME", - "string": "generate_tokens", - "start": [ - 672, - 4 - ], - "end": [ - 672, - 19 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 672, - 19 - ], - "end": [ - 672, - 20 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 672, - 20 - ], - "end": [ - 672, - 28 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 672, - 28 - ], - "end": [ - 672, - 29 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 672, - 29 - ], - "end": [ - 672, - 30 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 672, - 30 - ], - "end": [ - 673, - 0 - ], - "line": "def generate_tokens(readline):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 673, - 0 - ], - "end": [ - 673, - 4 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 673, - 4 - ], - "end": [ - 673, - 10 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "NAME", - "string": "_tokenize", - "start": [ - 673, - 11 - ], - "end": [ - 673, - 20 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 673, - 20 - ], - "end": [ - 673, - 21 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 673, - 21 - ], - "end": [ - 673, - 29 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 673, - 29 - ], - "end": [ - 673, - 30 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 673, - 31 - ], - "end": [ - 673, - 35 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 673, - 35 - ], - "end": [ - 673, - 36 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 673, - 36 - ], - "end": [ - 674, - 0 - ], - "line": " return _tokenize(readline, None)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 674, - 0 - ], - "end": [ - 675, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 675, - 0 - ], - "end": [ - 675, - 0 - ], - "line": "def main():\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 675, - 0 - ], - "end": [ - 675, - 3 - ], - "line": "def main():\n" - }, - { - "typ": "NAME", - "string": "main", - "start": [ - 675, - 4 - ], - "end": [ - 675, - 8 - ], - "line": "def main():\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 675, - 8 - ], - "end": [ - 675, - 9 - ], - "line": "def main():\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 675, - 9 - ], - "end": [ - 675, - 10 - ], - "line": "def main():\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 675, - 10 - ], - "end": [ - 675, - 11 - ], - "line": "def main():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 675, - 11 - ], - "end": [ - 676, - 0 - ], - "line": "def main():\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 676, - 0 - ], - "end": [ - 676, - 4 - ], - "line": " import argparse\n" - }, - { - "typ": "NAME", - "string": "import", - "start": [ - 676, - 4 - ], - "end": [ - 676, - 10 - ], - "line": " import argparse\n" - }, - { - "typ": "NAME", - "string": "argparse", - "start": [ - 676, - 11 - ], - "end": [ - 676, - 19 - ], - "line": " import argparse\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 676, - 19 - ], - "end": [ - 677, - 0 - ], - "line": " import argparse\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 677, - 0 - ], - "end": [ - 678, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Helper error handling routines", - "start": [ - 678, - 4 - ], - "end": [ - 678, - 36 - ], - "line": " # Helper error handling routines\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 678, - 36 - ], - "end": [ - 679, - 0 - ], - "line": " # Helper error handling routines\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 679, - 4 - ], - "end": [ - 679, - 7 - ], - "line": " def perror(message):\n" - }, - { - "typ": "NAME", - "string": "perror", - "start": [ - 679, - 8 - ], - "end": [ - 679, - 14 - ], - "line": " def perror(message):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 679, - 14 - ], - "end": [ - 679, - 15 - ], - "line": " def perror(message):\n" - }, - { - "typ": "NAME", - "string": "message", - "start": [ - 679, - 15 - ], - "end": [ - 679, - 22 - ], - "line": " def perror(message):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 679, - 22 - ], - "end": [ - 679, - 23 - ], - "line": " def perror(message):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 679, - 23 - ], - "end": [ - 679, - 24 - ], - "line": " def perror(message):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 679, - 24 - ], - "end": [ - 680, - 0 - ], - "line": " def perror(message):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 680, - 0 - ], - "end": [ - 680, - 8 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "NAME", - "string": "print", - "start": [ - 680, - 8 - ], - "end": [ - 680, - 13 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 680, - 13 - ], - "end": [ - 680, - 14 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "NAME", - "string": "message", - "start": [ - 680, - 14 - ], - "end": [ - 680, - 21 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 680, - 21 - ], - "end": [ - 680, - 22 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "NAME", - "string": "file", - "start": [ - 680, - 23 - ], - "end": [ - 680, - 27 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 680, - 27 - ], - "end": [ - 680, - 28 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "NAME", - "string": "sys", - "start": [ - 680, - 28 - ], - "end": [ - 680, - 31 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 680, - 31 - ], - "end": [ - 680, - 32 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "NAME", - "string": "stderr", - "start": [ - 680, - 32 - ], - "end": [ - 680, - 38 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 680, - 38 - ], - "end": [ - 680, - 39 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 680, - 39 - ], - "end": [ - 681, - 0 - ], - "line": " print(message, file=sys.stderr)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 681, - 0 - ], - "end": [ - 682, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 682, - 4 - ], - "end": [ - 682, - 4 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 682, - 4 - ], - "end": [ - 682, - 7 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NAME", - "string": "error", - "start": [ - 682, - 8 - ], - "end": [ - 682, - 13 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 682, - 13 - ], - "end": [ - 682, - 14 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NAME", - "string": "message", - "start": [ - 682, - 14 - ], - "end": [ - 682, - 21 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 682, - 21 - ], - "end": [ - 682, - 22 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 682, - 23 - ], - "end": [ - 682, - 31 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 682, - 31 - ], - "end": [ - 682, - 32 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 682, - 32 - ], - "end": [ - 682, - 36 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 682, - 36 - ], - "end": [ - 682, - 37 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NAME", - "string": "location", - "start": [ - 682, - 38 - ], - "end": [ - 682, - 46 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 682, - 46 - ], - "end": [ - 682, - 47 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 682, - 47 - ], - "end": [ - 682, - 51 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 682, - 51 - ], - "end": [ - 682, - 52 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 682, - 52 - ], - "end": [ - 682, - 53 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 682, - 53 - ], - "end": [ - 683, - 0 - ], - "line": " def error(message, filename=None, location=None):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 683, - 0 - ], - "end": [ - 683, - 8 - ], - "line": " if location:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 683, - 8 - ], - "end": [ - 683, - 10 - ], - "line": " if location:\n" - }, - { - "typ": "NAME", - "string": "location", - "start": [ - 683, - 11 - ], - "end": [ - 683, - 19 - ], - "line": " if location:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 683, - 19 - ], - "end": [ - 683, - 20 - ], - "line": " if location:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 683, - 20 - ], - "end": [ - 684, - 0 - ], - "line": " if location:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 684, - 0 - ], - "end": [ - 684, - 12 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 684, - 12 - ], - "end": [ - 684, - 16 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 684, - 17 - ], - "end": [ - 684, - 18 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 684, - 19 - ], - "end": [ - 684, - 20 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 684, - 20 - ], - "end": [ - 684, - 28 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 684, - 28 - ], - "end": [ - 684, - 29 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 684, - 29 - ], - "end": [ - 684, - 30 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 684, - 31 - ], - "end": [ - 684, - 32 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "NAME", - "string": "location", - "start": [ - 684, - 33 - ], - "end": [ - 684, - 41 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 684, - 42 - ], - "end": [ - 684, - 43 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 684, - 44 - ], - "end": [ - 684, - 45 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "NAME", - "string": "message", - "start": [ - 684, - 45 - ], - "end": [ - 684, - 52 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 684, - 52 - ], - "end": [ - 684, - 53 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 684, - 53 - ], - "end": [ - 684, - 54 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 684, - 54 - ], - "end": [ - 685, - 0 - ], - "line": " args = (filename,) + location + (message,)\n" - }, - { - "typ": "NAME", - "string": "perror", - "start": [ - 685, - 12 - ], - "end": [ - 685, - 18 - ], - "line": " perror(\"%s:%d:%d: error: %s\" % args)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 685, - 18 - ], - "end": [ - 685, - 19 - ], - "line": " perror(\"%s:%d:%d: error: %s\" % args)\n" - }, - { - "typ": "STRING", - "string": "\"%s:%d:%d: error: %s\"", - "start": [ - 685, - 19 - ], - "end": [ - 685, - 40 - ], - "line": " perror(\"%s:%d:%d: error: %s\" % args)\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 685, - 41 - ], - "end": [ - 685, - 42 - ], - "line": " perror(\"%s:%d:%d: error: %s\" % args)\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 685, - 43 - ], - "end": [ - 685, - 47 - ], - "line": " perror(\"%s:%d:%d: error: %s\" % args)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 685, - 47 - ], - "end": [ - 685, - 48 - ], - "line": " perror(\"%s:%d:%d: error: %s\" % args)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 685, - 48 - ], - "end": [ - 686, - 0 - ], - "line": " perror(\"%s:%d:%d: error: %s\" % args)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 686, - 8 - ], - "end": [ - 686, - 8 - ], - "line": " elif filename:\n" - }, - { - "typ": "NAME", - "string": "elif", - "start": [ - 686, - 8 - ], - "end": [ - 686, - 12 - ], - "line": " elif filename:\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 686, - 13 - ], - "end": [ - 686, - 21 - ], - "line": " elif filename:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 686, - 21 - ], - "end": [ - 686, - 22 - ], - "line": " elif filename:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 686, - 22 - ], - "end": [ - 687, - 0 - ], - "line": " elif filename:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 687, - 0 - ], - "end": [ - 687, - 12 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "NAME", - "string": "perror", - "start": [ - 687, - 12 - ], - "end": [ - 687, - 18 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 687, - 18 - ], - "end": [ - 687, - 19 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "STRING", - "string": "\"%s: error: %s\"", - "start": [ - 687, - 19 - ], - "end": [ - 687, - 34 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 687, - 35 - ], - "end": [ - 687, - 36 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 687, - 37 - ], - "end": [ - 687, - 38 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 687, - 38 - ], - "end": [ - 687, - 46 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 687, - 46 - ], - "end": [ - 687, - 47 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "NAME", - "string": "message", - "start": [ - 687, - 48 - ], - "end": [ - 687, - 55 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 687, - 55 - ], - "end": [ - 687, - 56 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 687, - 56 - ], - "end": [ - 687, - 57 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 687, - 57 - ], - "end": [ - 688, - 0 - ], - "line": " perror(\"%s: error: %s\" % (filename, message))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 688, - 8 - ], - "end": [ - 688, - 8 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 688, - 8 - ], - "end": [ - 688, - 12 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 688, - 12 - ], - "end": [ - 688, - 13 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 688, - 13 - ], - "end": [ - 689, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 689, - 0 - ], - "end": [ - 689, - 12 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "NAME", - "string": "perror", - "start": [ - 689, - 12 - ], - "end": [ - 689, - 18 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 689, - 18 - ], - "end": [ - 689, - 19 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "STRING", - "string": "\"error: %s\"", - "start": [ - 689, - 19 - ], - "end": [ - 689, - 30 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 689, - 31 - ], - "end": [ - 689, - 32 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "NAME", - "string": "message", - "start": [ - 689, - 33 - ], - "end": [ - 689, - 40 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 689, - 40 - ], - "end": [ - 689, - 41 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 689, - 41 - ], - "end": [ - 690, - 0 - ], - "line": " perror(\"error: %s\" % message)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 690, - 8 - ], - "end": [ - 690, - 8 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "NAME", - "string": "sys", - "start": [ - 690, - 8 - ], - "end": [ - 690, - 11 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 690, - 11 - ], - "end": [ - 690, - 12 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "NAME", - "string": "exit", - "start": [ - 690, - 12 - ], - "end": [ - 690, - 16 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 690, - 16 - ], - "end": [ - 690, - 17 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 690, - 17 - ], - "end": [ - 690, - 18 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 690, - 18 - ], - "end": [ - 690, - 19 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 690, - 19 - ], - "end": [ - 691, - 0 - ], - "line": " sys.exit(1)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 691, - 0 - ], - "end": [ - 692, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Parse the arguments and options", - "start": [ - 692, - 4 - ], - "end": [ - 692, - 37 - ], - "line": " # Parse the arguments and options\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 692, - 37 - ], - "end": [ - 693, - 0 - ], - "line": " # Parse the arguments and options\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 693, - 4 - ], - "end": [ - 693, - 4 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "NAME", - "string": "parser", - "start": [ - 693, - 4 - ], - "end": [ - 693, - 10 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 693, - 11 - ], - "end": [ - 693, - 12 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "NAME", - "string": "argparse", - "start": [ - 693, - 13 - ], - "end": [ - 693, - 21 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 693, - 21 - ], - "end": [ - 693, - 22 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "NAME", - "string": "ArgumentParser", - "start": [ - 693, - 22 - ], - "end": [ - 693, - 36 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 693, - 36 - ], - "end": [ - 693, - 37 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "NAME", - "string": "prog", - "start": [ - 693, - 37 - ], - "end": [ - 693, - 41 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 693, - 41 - ], - "end": [ - 693, - 42 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "STRING", - "string": "'python -m tokenize'", - "start": [ - 693, - 42 - ], - "end": [ - 693, - 62 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 693, - 62 - ], - "end": [ - 693, - 63 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 693, - 63 - ], - "end": [ - 694, - 0 - ], - "line": " parser = argparse.ArgumentParser(prog='python -m tokenize')\n" - }, - { - "typ": "NAME", - "string": "parser", - "start": [ - 694, - 4 - ], - "end": [ - 694, - 10 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 694, - 10 - ], - "end": [ - 694, - 11 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "NAME", - "string": "add_argument", - "start": [ - 694, - 11 - ], - "end": [ - 694, - 23 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 694, - 23 - ], - "end": [ - 694, - 24 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "NAME", - "string": "dest", - "start": [ - 694, - 24 - ], - "end": [ - 694, - 28 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 694, - 28 - ], - "end": [ - 694, - 29 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "STRING", - "string": "'filename'", - "start": [ - 694, - 29 - ], - "end": [ - 694, - 39 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 694, - 39 - ], - "end": [ - 694, - 40 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "NAME", - "string": "nargs", - "start": [ - 694, - 41 - ], - "end": [ - 694, - 46 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 694, - 46 - ], - "end": [ - 694, - 47 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "STRING", - "string": "'?'", - "start": [ - 694, - 47 - ], - "end": [ - 694, - 50 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 694, - 50 - ], - "end": [ - 694, - 51 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 694, - 51 - ], - "end": [ - 695, - 0 - ], - "line": " parser.add_argument(dest='filename', nargs='?',\n" - }, - { - "typ": "NAME", - "string": "metavar", - "start": [ - 695, - 24 - ], - "end": [ - 695, - 31 - ], - "line": " metavar='filename.py',\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 695, - 31 - ], - "end": [ - 695, - 32 - ], - "line": " metavar='filename.py',\n" - }, - { - "typ": "STRING", - "string": "'filename.py'", - "start": [ - 695, - 32 - ], - "end": [ - 695, - 45 - ], - "line": " metavar='filename.py',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 695, - 45 - ], - "end": [ - 695, - 46 - ], - "line": " metavar='filename.py',\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 695, - 46 - ], - "end": [ - 696, - 0 - ], - "line": " metavar='filename.py',\n" - }, - { - "typ": "NAME", - "string": "help", - "start": [ - 696, - 24 - ], - "end": [ - 696, - 28 - ], - "line": " help='the file to tokenize; defaults to stdin')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 696, - 28 - ], - "end": [ - 696, - 29 - ], - "line": " help='the file to tokenize; defaults to stdin')\n" - }, - { - "typ": "STRING", - "string": "'the file to tokenize; defaults to stdin'", - "start": [ - 696, - 29 - ], - "end": [ - 696, - 70 - ], - "line": " help='the file to tokenize; defaults to stdin')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 696, - 70 - ], - "end": [ - 696, - 71 - ], - "line": " help='the file to tokenize; defaults to stdin')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 696, - 71 - ], - "end": [ - 697, - 0 - ], - "line": " help='the file to tokenize; defaults to stdin')\n" - }, - { - "typ": "NAME", - "string": "parser", - "start": [ - 697, - 4 - ], - "end": [ - 697, - 10 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 697, - 10 - ], - "end": [ - 697, - 11 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "NAME", - "string": "add_argument", - "start": [ - 697, - 11 - ], - "end": [ - 697, - 23 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 697, - 23 - ], - "end": [ - 697, - 24 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "STRING", - "string": "'-e'", - "start": [ - 697, - 24 - ], - "end": [ - 697, - 28 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 697, - 28 - ], - "end": [ - 697, - 29 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "STRING", - "string": "'--exact'", - "start": [ - 697, - 30 - ], - "end": [ - 697, - 39 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 697, - 39 - ], - "end": [ - 697, - 40 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "NAME", - "string": "dest", - "start": [ - 697, - 41 - ], - "end": [ - 697, - 45 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 697, - 45 - ], - "end": [ - 697, - 46 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "STRING", - "string": "'exact'", - "start": [ - 697, - 46 - ], - "end": [ - 697, - 53 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 697, - 53 - ], - "end": [ - 697, - 54 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "NAME", - "string": "action", - "start": [ - 697, - 55 - ], - "end": [ - 697, - 61 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 697, - 61 - ], - "end": [ - 697, - 62 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "STRING", - "string": "'store_true'", - "start": [ - 697, - 62 - ], - "end": [ - 697, - 74 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 697, - 74 - ], - "end": [ - 697, - 75 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 697, - 75 - ], - "end": [ - 698, - 0 - ], - "line": " parser.add_argument('-e', '--exact', dest='exact', action='store_true',\n" - }, - { - "typ": "NAME", - "string": "help", - "start": [ - 698, - 24 - ], - "end": [ - 698, - 28 - ], - "line": " help='display token names using the exact type')\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 698, - 28 - ], - "end": [ - 698, - 29 - ], - "line": " help='display token names using the exact type')\n" - }, - { - "typ": "STRING", - "string": "'display token names using the exact type'", - "start": [ - 698, - 29 - ], - "end": [ - 698, - 71 - ], - "line": " help='display token names using the exact type')\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 698, - 71 - ], - "end": [ - 698, - 72 - ], - "line": " help='display token names using the exact type')\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 698, - 72 - ], - "end": [ - 699, - 0 - ], - "line": " help='display token names using the exact type')\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 699, - 4 - ], - "end": [ - 699, - 8 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 699, - 9 - ], - "end": [ - 699, - 10 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "NAME", - "string": "parser", - "start": [ - 699, - 11 - ], - "end": [ - 699, - 17 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 699, - 17 - ], - "end": [ - 699, - 18 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "NAME", - "string": "parse_args", - "start": [ - 699, - 18 - ], - "end": [ - 699, - 28 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 699, - 28 - ], - "end": [ - 699, - 29 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 699, - 29 - ], - "end": [ - 699, - 30 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 699, - 30 - ], - "end": [ - 700, - 0 - ], - "line": " args = parser.parse_args()\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 700, - 0 - ], - "end": [ - 701, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "try", - "start": [ - 701, - 4 - ], - "end": [ - 701, - 7 - ], - "line": " try:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 701, - 7 - ], - "end": [ - 701, - 8 - ], - "line": " try:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 701, - 8 - ], - "end": [ - 702, - 0 - ], - "line": " try:\n" - }, - { - "typ": "COMMENT", - "string": "# Tokenize the input", - "start": [ - 702, - 8 - ], - "end": [ - 702, - 28 - ], - "line": " # Tokenize the input\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 702, - 28 - ], - "end": [ - 703, - 0 - ], - "line": " # Tokenize the input\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 703, - 0 - ], - "end": [ - 703, - 8 - ], - "line": " if args.filename:\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 703, - 8 - ], - "end": [ - 703, - 10 - ], - "line": " if args.filename:\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 703, - 11 - ], - "end": [ - 703, - 15 - ], - "line": " if args.filename:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 703, - 15 - ], - "end": [ - 703, - 16 - ], - "line": " if args.filename:\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 703, - 16 - ], - "end": [ - 703, - 24 - ], - "line": " if args.filename:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 703, - 24 - ], - "end": [ - 703, - 25 - ], - "line": " if args.filename:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 703, - 25 - ], - "end": [ - 704, - 0 - ], - "line": " if args.filename:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 704, - 0 - ], - "end": [ - 704, - 12 - ], - "line": " filename = args.filename\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 704, - 12 - ], - "end": [ - 704, - 20 - ], - "line": " filename = args.filename\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 704, - 21 - ], - "end": [ - 704, - 22 - ], - "line": " filename = args.filename\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 704, - 23 - ], - "end": [ - 704, - 27 - ], - "line": " filename = args.filename\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 704, - 27 - ], - "end": [ - 704, - 28 - ], - "line": " filename = args.filename\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 704, - 28 - ], - "end": [ - 704, - 36 - ], - "line": " filename = args.filename\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 704, - 36 - ], - "end": [ - 705, - 0 - ], - "line": " filename = args.filename\n" - }, - { - "typ": "NAME", - "string": "with", - "start": [ - 705, - 12 - ], - "end": [ - 705, - 16 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "NAME", - "string": "_builtin_open", - "start": [ - 705, - 17 - ], - "end": [ - 705, - 30 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 705, - 30 - ], - "end": [ - 705, - 31 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 705, - 31 - ], - "end": [ - 705, - 39 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 705, - 39 - ], - "end": [ - 705, - 40 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "STRING", - "string": "'rb'", - "start": [ - 705, - 41 - ], - "end": [ - 705, - 45 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 705, - 45 - ], - "end": [ - 705, - 46 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 705, - 47 - ], - "end": [ - 705, - 49 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "NAME", - "string": "f", - "start": [ - 705, - 50 - ], - "end": [ - 705, - 51 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 705, - 51 - ], - "end": [ - 705, - 52 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 705, - 52 - ], - "end": [ - 706, - 0 - ], - "line": " with _builtin_open(filename, 'rb') as f:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 706, - 0 - ], - "end": [ - 706, - 16 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 706, - 16 - ], - "end": [ - 706, - 22 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 706, - 23 - ], - "end": [ - 706, - 24 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "NAME", - "string": "list", - "start": [ - 706, - 25 - ], - "end": [ - 706, - 29 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 706, - 29 - ], - "end": [ - 706, - 30 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "NAME", - "string": "tokenize", - "start": [ - 706, - 30 - ], - "end": [ - 706, - 38 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 706, - 38 - ], - "end": [ - 706, - 39 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "NAME", - "string": "f", - "start": [ - 706, - 39 - ], - "end": [ - 706, - 40 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 706, - 40 - ], - "end": [ - 706, - 41 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 706, - 41 - ], - "end": [ - 706, - 49 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 706, - 49 - ], - "end": [ - 706, - 50 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 706, - 50 - ], - "end": [ - 706, - 51 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 706, - 51 - ], - "end": [ - 707, - 0 - ], - "line": " tokens = list(tokenize(f.readline))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 707, - 8 - ], - "end": [ - 707, - 8 - ], - "line": " else:\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 707, - 8 - ], - "end": [ - 707, - 8 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 707, - 8 - ], - "end": [ - 707, - 12 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 707, - 12 - ], - "end": [ - 707, - 13 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 707, - 13 - ], - "end": [ - 708, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 708, - 0 - ], - "end": [ - 708, - 12 - ], - "line": " filename = \"\"\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 708, - 12 - ], - "end": [ - 708, - 20 - ], - "line": " filename = \"\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 708, - 21 - ], - "end": [ - 708, - 22 - ], - "line": " filename = \"\"\n" - }, - { - "typ": "STRING", - "string": "\"\"", - "start": [ - 708, - 23 - ], - "end": [ - 708, - 32 - ], - "line": " filename = \"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 708, - 32 - ], - "end": [ - 709, - 0 - ], - "line": " filename = \"\"\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 709, - 12 - ], - "end": [ - 709, - 18 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 709, - 19 - ], - "end": [ - 709, - 20 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "NAME", - "string": "_tokenize", - "start": [ - 709, - 21 - ], - "end": [ - 709, - 30 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 709, - 30 - ], - "end": [ - 709, - 31 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "NAME", - "string": "sys", - "start": [ - 709, - 31 - ], - "end": [ - 709, - 34 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 709, - 34 - ], - "end": [ - 709, - 35 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "NAME", - "string": "stdin", - "start": [ - 709, - 35 - ], - "end": [ - 709, - 40 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 709, - 40 - ], - "end": [ - 709, - 41 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "NAME", - "string": "readline", - "start": [ - 709, - 41 - ], - "end": [ - 709, - 49 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 709, - 49 - ], - "end": [ - 709, - 50 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "NAME", - "string": "None", - "start": [ - 709, - 51 - ], - "end": [ - 709, - 55 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 709, - 55 - ], - "end": [ - 709, - 56 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 709, - 56 - ], - "end": [ - 710, - 0 - ], - "line": " tokens = _tokenize(sys.stdin.readline, None)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 710, - 0 - ], - "end": [ - 711, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Output the tokenization", - "start": [ - 711, - 8 - ], - "end": [ - 711, - 33 - ], - "line": " # Output the tokenization\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 711, - 33 - ], - "end": [ - 712, - 0 - ], - "line": " # Output the tokenization\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 712, - 8 - ], - "end": [ - 712, - 8 - ], - "line": " for token in tokens:\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 712, - 8 - ], - "end": [ - 712, - 11 - ], - "line": " for token in tokens:\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 712, - 12 - ], - "end": [ - 712, - 17 - ], - "line": " for token in tokens:\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 712, - 18 - ], - "end": [ - 712, - 20 - ], - "line": " for token in tokens:\n" - }, - { - "typ": "NAME", - "string": "tokens", - "start": [ - 712, - 21 - ], - "end": [ - 712, - 27 - ], - "line": " for token in tokens:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 712, - 27 - ], - "end": [ - 712, - 28 - ], - "line": " for token in tokens:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 712, - 28 - ], - "end": [ - 713, - 0 - ], - "line": " for token in tokens:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 713, - 0 - ], - "end": [ - 713, - 12 - ], - "line": " token_type = token.type\n" - }, - { - "typ": "NAME", - "string": "token_type", - "start": [ - 713, - 12 - ], - "end": [ - 713, - 22 - ], - "line": " token_type = token.type\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 713, - 23 - ], - "end": [ - 713, - 24 - ], - "line": " token_type = token.type\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 713, - 25 - ], - "end": [ - 713, - 30 - ], - "line": " token_type = token.type\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 713, - 30 - ], - "end": [ - 713, - 31 - ], - "line": " token_type = token.type\n" - }, - { - "typ": "NAME", - "string": "type", - "start": [ - 713, - 31 - ], - "end": [ - 713, - 35 - ], - "line": " token_type = token.type\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 713, - 35 - ], - "end": [ - 714, - 0 - ], - "line": " token_type = token.type\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 714, - 12 - ], - "end": [ - 714, - 14 - ], - "line": " if args.exact:\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 714, - 15 - ], - "end": [ - 714, - 19 - ], - "line": " if args.exact:\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 714, - 19 - ], - "end": [ - 714, - 20 - ], - "line": " if args.exact:\n" - }, - { - "typ": "NAME", - "string": "exact", - "start": [ - 714, - 20 - ], - "end": [ - 714, - 25 - ], - "line": " if args.exact:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 714, - 25 - ], - "end": [ - 714, - 26 - ], - "line": " if args.exact:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 714, - 26 - ], - "end": [ - 715, - 0 - ], - "line": " if args.exact:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 715, - 0 - ], - "end": [ - 715, - 16 - ], - "line": " token_type = token.exact_type\n" - }, - { - "typ": "NAME", - "string": "token_type", - "start": [ - 715, - 16 - ], - "end": [ - 715, - 26 - ], - "line": " token_type = token.exact_type\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 715, - 27 - ], - "end": [ - 715, - 28 - ], - "line": " token_type = token.exact_type\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 715, - 29 - ], - "end": [ - 715, - 34 - ], - "line": " token_type = token.exact_type\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 715, - 34 - ], - "end": [ - 715, - 35 - ], - "line": " token_type = token.exact_type\n" - }, - { - "typ": "NAME", - "string": "exact_type", - "start": [ - 715, - 35 - ], - "end": [ - 715, - 45 - ], - "line": " token_type = token.exact_type\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 715, - 45 - ], - "end": [ - 716, - 0 - ], - "line": " token_type = token.exact_type\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 716, - 12 - ], - "end": [ - 716, - 12 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "NAME", - "string": "token_range", - "start": [ - 716, - 12 - ], - "end": [ - 716, - 23 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 716, - 24 - ], - "end": [ - 716, - 25 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "STRING", - "string": "\"%d,%d-%d,%d:\"", - "start": [ - 716, - 26 - ], - "end": [ - 716, - 40 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 716, - 41 - ], - "end": [ - 716, - 42 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 716, - 43 - ], - "end": [ - 716, - 44 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 716, - 44 - ], - "end": [ - 716, - 49 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 716, - 49 - ], - "end": [ - 716, - 50 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 716, - 50 - ], - "end": [ - 716, - 55 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 716, - 56 - ], - "end": [ - 716, - 57 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 716, - 58 - ], - "end": [ - 716, - 63 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 716, - 63 - ], - "end": [ - 716, - 64 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "NAME", - "string": "end", - "start": [ - 716, - 64 - ], - "end": [ - 716, - 67 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 716, - 67 - ], - "end": [ - 716, - 68 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 716, - 68 - ], - "end": [ - 717, - 0 - ], - "line": " token_range = \"%d,%d-%d,%d:\" % (token.start + token.end)\n" - }, - { - "typ": "NAME", - "string": "print", - "start": [ - 717, - 12 - ], - "end": [ - 717, - 17 - ], - "line": " print(\"%-20s%-15s%-15r\" %\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 717, - 17 - ], - "end": [ - 717, - 18 - ], - "line": " print(\"%-20s%-15s%-15r\" %\n" - }, - { - "typ": "STRING", - "string": "\"%-20s%-15s%-15r\"", - "start": [ - 717, - 18 - ], - "end": [ - 717, - 35 - ], - "line": " print(\"%-20s%-15s%-15r\" %\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 717, - 36 - ], - "end": [ - 717, - 37 - ], - "line": " print(\"%-20s%-15s%-15r\" %\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 717, - 37 - ], - "end": [ - 718, - 0 - ], - "line": " print(\"%-20s%-15s%-15r\" %\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 718, - 18 - ], - "end": [ - 718, - 19 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "NAME", - "string": "token_range", - "start": [ - 718, - 19 - ], - "end": [ - 718, - 30 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 718, - 30 - ], - "end": [ - 718, - 31 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "NAME", - "string": "tok_name", - "start": [ - 718, - 32 - ], - "end": [ - 718, - 40 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 718, - 40 - ], - "end": [ - 718, - 41 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "NAME", - "string": "token_type", - "start": [ - 718, - 41 - ], - "end": [ - 718, - 51 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 718, - 51 - ], - "end": [ - 718, - 52 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 718, - 52 - ], - "end": [ - 718, - 53 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "NAME", - "string": "token", - "start": [ - 718, - 54 - ], - "end": [ - 718, - 59 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 718, - 59 - ], - "end": [ - 718, - 60 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "NAME", - "string": "string", - "start": [ - 718, - 60 - ], - "end": [ - 718, - 66 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 718, - 66 - ], - "end": [ - 718, - 67 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 718, - 67 - ], - "end": [ - 718, - 68 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 718, - 68 - ], - "end": [ - 719, - 0 - ], - "line": " (token_range, tok_name[token_type], token.string))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 719, - 4 - ], - "end": [ - 719, - 4 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 719, - 4 - ], - "end": [ - 719, - 4 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 719, - 4 - ], - "end": [ - 719, - 10 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "NAME", - "string": "IndentationError", - "start": [ - 719, - 11 - ], - "end": [ - 719, - 27 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 719, - 28 - ], - "end": [ - 719, - 30 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 719, - 31 - ], - "end": [ - 719, - 34 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 719, - 34 - ], - "end": [ - 719, - 35 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 719, - 35 - ], - "end": [ - 720, - 0 - ], - "line": " except IndentationError as err:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 720, - 0 - ], - "end": [ - 720, - 8 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 720, - 8 - ], - "end": [ - 720, - 12 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 720, - 12 - ], - "end": [ - 720, - 13 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 720, - 14 - ], - "end": [ - 720, - 20 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 720, - 21 - ], - "end": [ - 720, - 22 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 720, - 23 - ], - "end": [ - 720, - 26 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 720, - 26 - ], - "end": [ - 720, - 27 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 720, - 27 - ], - "end": [ - 720, - 31 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 720, - 31 - ], - "end": [ - 720, - 32 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 720, - 32 - ], - "end": [ - 720, - 33 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 720, - 33 - ], - "end": [ - 720, - 34 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 720, - 34 - ], - "end": [ - 720, - 35 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 720, - 35 - ], - "end": [ - 720, - 36 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 720, - 36 - ], - "end": [ - 720, - 37 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NUMBER", - "string": "3", - "start": [ - 720, - 37 - ], - "end": [ - 720, - 38 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 720, - 38 - ], - "end": [ - 720, - 39 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 720, - 39 - ], - "end": [ - 721, - 0 - ], - "line": " line, column = err.args[1][1:3]\n" - }, - { - "typ": "NAME", - "string": "error", - "start": [ - 721, - 8 - ], - "end": [ - 721, - 13 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 721, - 13 - ], - "end": [ - 721, - 14 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 721, - 14 - ], - "end": [ - 721, - 17 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 721, - 17 - ], - "end": [ - 721, - 18 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 721, - 18 - ], - "end": [ - 721, - 22 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 721, - 22 - ], - "end": [ - 721, - 23 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 721, - 23 - ], - "end": [ - 721, - 24 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 721, - 24 - ], - "end": [ - 721, - 25 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 721, - 25 - ], - "end": [ - 721, - 26 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 721, - 27 - ], - "end": [ - 721, - 35 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 721, - 35 - ], - "end": [ - 721, - 36 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 721, - 37 - ], - "end": [ - 721, - 38 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 721, - 38 - ], - "end": [ - 721, - 42 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 721, - 42 - ], - "end": [ - 721, - 43 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 721, - 44 - ], - "end": [ - 721, - 50 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 721, - 50 - ], - "end": [ - 721, - 51 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 721, - 51 - ], - "end": [ - 721, - 52 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 721, - 52 - ], - "end": [ - 722, - 0 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 722, - 4 - ], - "end": [ - 722, - 4 - ], - "line": " except TokenError as err:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 722, - 4 - ], - "end": [ - 722, - 10 - ], - "line": " except TokenError as err:\n" - }, - { - "typ": "NAME", - "string": "TokenError", - "start": [ - 722, - 11 - ], - "end": [ - 722, - 21 - ], - "line": " except TokenError as err:\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 722, - 22 - ], - "end": [ - 722, - 24 - ], - "line": " except TokenError as err:\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 722, - 25 - ], - "end": [ - 722, - 28 - ], - "line": " except TokenError as err:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 722, - 28 - ], - "end": [ - 722, - 29 - ], - "line": " except TokenError as err:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 722, - 29 - ], - "end": [ - 723, - 0 - ], - "line": " except TokenError as err:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 723, - 0 - ], - "end": [ - 723, - 8 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 723, - 8 - ], - "end": [ - 723, - 12 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 723, - 12 - ], - "end": [ - 723, - 13 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 723, - 14 - ], - "end": [ - 723, - 20 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 723, - 21 - ], - "end": [ - 723, - 22 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 723, - 23 - ], - "end": [ - 723, - 26 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 723, - 26 - ], - "end": [ - 723, - 27 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 723, - 27 - ], - "end": [ - 723, - 31 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 723, - 31 - ], - "end": [ - 723, - 32 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 723, - 32 - ], - "end": [ - 723, - 33 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 723, - 33 - ], - "end": [ - 723, - 34 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 723, - 34 - ], - "end": [ - 724, - 0 - ], - "line": " line, column = err.args[1]\n" - }, - { - "typ": "NAME", - "string": "error", - "start": [ - 724, - 8 - ], - "end": [ - 724, - 13 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 724, - 13 - ], - "end": [ - 724, - 14 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 724, - 14 - ], - "end": [ - 724, - 17 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 724, - 17 - ], - "end": [ - 724, - 18 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "args", - "start": [ - 724, - 18 - ], - "end": [ - 724, - 22 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 724, - 22 - ], - "end": [ - 724, - 23 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 724, - 23 - ], - "end": [ - 724, - 24 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 724, - 24 - ], - "end": [ - 724, - 25 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 724, - 25 - ], - "end": [ - 724, - 26 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 724, - 27 - ], - "end": [ - 724, - 35 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 724, - 35 - ], - "end": [ - 724, - 36 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 724, - 37 - ], - "end": [ - 724, - 38 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "line", - "start": [ - 724, - 38 - ], - "end": [ - 724, - 42 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 724, - 42 - ], - "end": [ - 724, - 43 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NAME", - "string": "column", - "start": [ - 724, - 44 - ], - "end": [ - 724, - 50 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 724, - 50 - ], - "end": [ - 724, - 51 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 724, - 51 - ], - "end": [ - 724, - 52 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 724, - 52 - ], - "end": [ - 725, - 0 - ], - "line": " error(err.args[0], filename, (line, column))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 725, - 4 - ], - "end": [ - 725, - 4 - ], - "line": " except SyntaxError as err:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 725, - 4 - ], - "end": [ - 725, - 10 - ], - "line": " except SyntaxError as err:\n" - }, - { - "typ": "NAME", - "string": "SyntaxError", - "start": [ - 725, - 11 - ], - "end": [ - 725, - 22 - ], - "line": " except SyntaxError as err:\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 725, - 23 - ], - "end": [ - 725, - 25 - ], - "line": " except SyntaxError as err:\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 725, - 26 - ], - "end": [ - 725, - 29 - ], - "line": " except SyntaxError as err:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 725, - 29 - ], - "end": [ - 725, - 30 - ], - "line": " except SyntaxError as err:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 725, - 30 - ], - "end": [ - 726, - 0 - ], - "line": " except SyntaxError as err:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 726, - 0 - ], - "end": [ - 726, - 8 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "NAME", - "string": "error", - "start": [ - 726, - 8 - ], - "end": [ - 726, - 13 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 726, - 13 - ], - "end": [ - 726, - 14 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 726, - 14 - ], - "end": [ - 726, - 17 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 726, - 17 - ], - "end": [ - 726, - 18 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "NAME", - "string": "filename", - "start": [ - 726, - 19 - ], - "end": [ - 726, - 27 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 726, - 27 - ], - "end": [ - 726, - 28 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 726, - 28 - ], - "end": [ - 727, - 0 - ], - "line": " error(err, filename)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 727, - 4 - ], - "end": [ - 727, - 4 - ], - "line": " except OSError as err:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 727, - 4 - ], - "end": [ - 727, - 10 - ], - "line": " except OSError as err:\n" - }, - { - "typ": "NAME", - "string": "OSError", - "start": [ - 727, - 11 - ], - "end": [ - 727, - 18 - ], - "line": " except OSError as err:\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 727, - 19 - ], - "end": [ - 727, - 21 - ], - "line": " except OSError as err:\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 727, - 22 - ], - "end": [ - 727, - 25 - ], - "line": " except OSError as err:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 727, - 25 - ], - "end": [ - 727, - 26 - ], - "line": " except OSError as err:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 727, - 26 - ], - "end": [ - 728, - 0 - ], - "line": " except OSError as err:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 728, - 0 - ], - "end": [ - 728, - 8 - ], - "line": " error(err)\n" - }, - { - "typ": "NAME", - "string": "error", - "start": [ - 728, - 8 - ], - "end": [ - 728, - 13 - ], - "line": " error(err)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 728, - 13 - ], - "end": [ - 728, - 14 - ], - "line": " error(err)\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 728, - 14 - ], - "end": [ - 728, - 17 - ], - "line": " error(err)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 728, - 17 - ], - "end": [ - 728, - 18 - ], - "line": " error(err)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 728, - 18 - ], - "end": [ - 729, - 0 - ], - "line": " error(err)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 729, - 4 - ], - "end": [ - 729, - 4 - ], - "line": " except KeyboardInterrupt:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 729, - 4 - ], - "end": [ - 729, - 10 - ], - "line": " except KeyboardInterrupt:\n" - }, - { - "typ": "NAME", - "string": "KeyboardInterrupt", - "start": [ - 729, - 11 - ], - "end": [ - 729, - 28 - ], - "line": " except KeyboardInterrupt:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 729, - 28 - ], - "end": [ - 729, - 29 - ], - "line": " except KeyboardInterrupt:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 729, - 29 - ], - "end": [ - 730, - 0 - ], - "line": " except KeyboardInterrupt:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 730, - 0 - ], - "end": [ - 730, - 8 - ], - "line": " print(\"interrupted\\n\")\n" - }, - { - "typ": "NAME", - "string": "print", - "start": [ - 730, - 8 - ], - "end": [ - 730, - 13 - ], - "line": " print(\"interrupted\\n\")\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 730, - 13 - ], - "end": [ - 730, - 14 - ], - "line": " print(\"interrupted\\n\")\n" - }, - { - "typ": "STRING", - "string": "\"interrupted\\n\"", - "start": [ - 730, - 14 - ], - "end": [ - 730, - 29 - ], - "line": " print(\"interrupted\\n\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 730, - 29 - ], - "end": [ - 730, - 30 - ], - "line": " print(\"interrupted\\n\")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 730, - 30 - ], - "end": [ - 731, - 0 - ], - "line": " print(\"interrupted\\n\")\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 731, - 4 - ], - "end": [ - 731, - 4 - ], - "line": " except Exception as err:\n" - }, - { - "typ": "NAME", - "string": "except", - "start": [ - 731, - 4 - ], - "end": [ - 731, - 10 - ], - "line": " except Exception as err:\n" - }, - { - "typ": "NAME", - "string": "Exception", - "start": [ - 731, - 11 - ], - "end": [ - 731, - 20 - ], - "line": " except Exception as err:\n" - }, - { - "typ": "NAME", - "string": "as", - "start": [ - 731, - 21 - ], - "end": [ - 731, - 23 - ], - "line": " except Exception as err:\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 731, - 24 - ], - "end": [ - 731, - 27 - ], - "line": " except Exception as err:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 731, - 27 - ], - "end": [ - 731, - 28 - ], - "line": " except Exception as err:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 731, - 28 - ], - "end": [ - 732, - 0 - ], - "line": " except Exception as err:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 732, - 0 - ], - "end": [ - 732, - 8 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "NAME", - "string": "perror", - "start": [ - 732, - 8 - ], - "end": [ - 732, - 14 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 732, - 14 - ], - "end": [ - 732, - 15 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "STRING", - "string": "\"unexpected error: %s\"", - "start": [ - 732, - 15 - ], - "end": [ - 732, - 37 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "OP", - "string": "%", - "start": [ - 732, - 38 - ], - "end": [ - 732, - 39 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "NAME", - "string": "err", - "start": [ - 732, - 40 - ], - "end": [ - 732, - 43 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 732, - 43 - ], - "end": [ - 732, - 44 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 732, - 44 - ], - "end": [ - 733, - 0 - ], - "line": " perror(\"unexpected error: %s\" % err)\n" - }, - { - "typ": "NAME", - "string": "raise", - "start": [ - 733, - 8 - ], - "end": [ - 733, - 13 - ], - "line": " raise\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 733, - 13 - ], - "end": [ - 734, - 0 - ], - "line": " raise\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 734, - 0 - ], - "end": [ - 735, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 735, - 0 - ], - "end": [ - 735, - 0 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 735, - 0 - ], - "end": [ - 735, - 0 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 735, - 0 - ], - "end": [ - 735, - 2 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "NAME", - "string": "__name__", - "start": [ - 735, - 3 - ], - "end": [ - 735, - 11 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 735, - 12 - ], - "end": [ - 735, - 14 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "STRING", - "string": "\"__main__\"", - "start": [ - 735, - 15 - ], - "end": [ - 735, - 25 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 735, - 25 - ], - "end": [ - 735, - 26 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 735, - 26 - ], - "end": [ - 736, - 0 - ], - "line": "if __name__ == \"__main__\":\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 736, - 0 - ], - "end": [ - 736, - 4 - ], - "line": " main()" - }, - { - "typ": "NAME", - "string": "main", - "start": [ - 736, - 4 - ], - "end": [ - 736, - 8 - ], - "line": " main()" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 736, - 8 - ], - "end": [ - 736, - 9 - ], - "line": " main()" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 736, - 9 - ], - "end": [ - 736, - 10 - ], - "line": " main()" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 736, - 10 - ], - "end": [ - 736, - 10 - ], - "line": "" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 736, - 10 - ], - "end": [ - 736, - 10 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 736, - 10 - ], - "end": [ - 736, - 10 - ], - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/triple_quote_strings.py.json b/parser/tests/fixtures/tokenizer/triple_quote_strings.py.json deleted file mode 100644 index 379a374bd6..0000000000 --- a/parser/tests/fixtures/tokenizer/triple_quote_strings.py.json +++ /dev/null @@ -1,547 +0,0 @@ -foo = """bar""" - -foo = '''bar''' - -foo = """ "bar" """ - -foo = ''' \n'bar' ''' - -foo = """ -"bar" -""" - -foo = ''' -'bar' -''' - -foo = ''' \ -'bar' \ -''' - -foo = ''' \n -'bar' \r -lkjasdkfas \ -''' ---- -[ - { - "typ": "NAME", - "string": "foo", - "start": [ - 1, - 0 - ], - "end": [ - 1, - 3 - ], - "line": "foo = \"\"\"bar\"\"\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 1, - 4 - ], - "end": [ - 1, - 5 - ], - "line": "foo = \"\"\"bar\"\"\"\n" - }, - { - "typ": "STRING", - "string": "\"\"\"bar\"\"\"", - "start": [ - 1, - 6 - ], - "end": [ - 1, - 15 - ], - "line": "foo = \"\"\"bar\"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 1, - 15 - ], - "end": [ - 2, - 0 - ], - "line": "foo = \"\"\"bar\"\"\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 2, - 0 - ], - "end": [ - 3, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 3, - 0 - ], - "end": [ - 3, - 3 - ], - "line": "foo = '''bar'''\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 3, - 4 - ], - "end": [ - 3, - 5 - ], - "line": "foo = '''bar'''\n" - }, - { - "typ": "STRING", - "string": "'''bar'''", - "start": [ - 3, - 6 - ], - "end": [ - 3, - 15 - ], - "line": "foo = '''bar'''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 3, - 15 - ], - "end": [ - 4, - 0 - ], - "line": "foo = '''bar'''\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 4, - 0 - ], - "end": [ - 5, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 5, - 0 - ], - "end": [ - 5, - 3 - ], - "line": "foo = \"\"\" \"bar\" \"\"\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 5, - 4 - ], - "end": [ - 5, - 5 - ], - "line": "foo = \"\"\" \"bar\" \"\"\"\n" - }, - { - "typ": "STRING", - "string": "\"\"\" \"bar\" \"\"\"", - "start": [ - 5, - 6 - ], - "end": [ - 5, - 19 - ], - "line": "foo = \"\"\" \"bar\" \"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 5, - 19 - ], - "end": [ - 6, - 0 - ], - "line": "foo = \"\"\" \"bar\" \"\"\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 6, - 0 - ], - "end": [ - 7, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 7, - 0 - ], - "end": [ - 7, - 3 - ], - "line": "foo = ''' \\n'bar' '''\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 7, - 4 - ], - "end": [ - 7, - 5 - ], - "line": "foo = ''' \\n'bar' '''\n" - }, - { - "typ": "STRING", - "string": "''' \\n'bar' '''", - "start": [ - 7, - 6 - ], - "end": [ - 7, - 21 - ], - "line": "foo = ''' \\n'bar' '''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 7, - 21 - ], - "end": [ - 8, - 0 - ], - "line": "foo = ''' \\n'bar' '''\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 8, - 0 - ], - "end": [ - 9, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 9, - 0 - ], - "end": [ - 9, - 3 - ], - "line": "foo = \"\"\"\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 9, - 4 - ], - "end": [ - 9, - 5 - ], - "line": "foo = \"\"\"\n" - }, - { - "typ": "STRING", - "string": "\"\"\"\n\"bar\"\n\"\"\"", - "start": [ - 9, - 6 - ], - "end": [ - 11, - 3 - ], - "line": "foo = \"\"\"\n\"bar\"\n\"\"\"\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 11, - 3 - ], - "end": [ - 12, - 0 - ], - "line": "\"\"\"\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 12, - 0 - ], - "end": [ - 13, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 13, - 0 - ], - "end": [ - 13, - 3 - ], - "line": "foo = '''\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 13, - 4 - ], - "end": [ - 13, - 5 - ], - "line": "foo = '''\n" - }, - { - "typ": "STRING", - "string": "'''\n'bar'\n'''", - "start": [ - 13, - 6 - ], - "end": [ - 15, - 3 - ], - "line": "foo = '''\n'bar'\n'''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 15, - 3 - ], - "end": [ - 16, - 0 - ], - "line": "'''\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 16, - 0 - ], - "end": [ - 17, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 17, - 0 - ], - "end": [ - 17, - 3 - ], - "line": "foo = ''' \\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 17, - 4 - ], - "end": [ - 17, - 5 - ], - "line": "foo = ''' \\\n" - }, - { - "typ": "STRING", - "string": "''' \\\n'bar' \\\n'''", - "start": [ - 17, - 6 - ], - "end": [ - 19, - 3 - ], - "line": "foo = ''' \\\n'bar' \\\n'''\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 19, - 3 - ], - "end": [ - 20, - 0 - ], - "line": "'''\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 20, - 0 - ], - "end": [ - 21, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "foo", - "start": [ - 21, - 0 - ], - "end": [ - 21, - 3 - ], - "line": "foo = ''' \\n\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 21, - 4 - ], - "end": [ - 21, - 5 - ], - "line": "foo = ''' \\n\n" - }, - { - "typ": "STRING", - "string": "''' \\n\n'bar' \\r\nlkjasdkfas \\\n'''", - "start": [ - 21, - 6 - ], - "end": [ - 24, - 3 - ], - "line": "foo = ''' \\n\n'bar' \\r\nlkjasdkfas \\\n'''" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 24, - 3 - ], - "end": [ - 24, - 3 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 24, - 3 - ], - "end": [ - 24, - 3 - ], - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/validator_registration.v.py.json b/parser/tests/fixtures/tokenizer/validator_registration.v.py.json deleted file mode 100644 index 5b03de50fc..0000000000 --- a/parser/tests/fixtures/tokenizer/validator_registration.v.py.json +++ /dev/null @@ -1,10636 +0,0 @@ -MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei -DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32 -MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1 -PUBKEY_LENGTH: constant(u256) = 48 # bytes -WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes -AMOUNT_LENGTH: constant(u256) = 8 # bytes -SIGNATURE_LENGTH: constant(u256) = 96 # bytes - -DepositEvent: event({ - pubkey: bytes[48], - withdrawal_credentials: bytes[32], - amount: bytes[8], - signature: bytes[96], - index: bytes[8], -}) - -branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH] -deposit_count: u256 - -# Compute hashes in empty sparse Merkle tree -zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH] -@public -def __init__(): - for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1): - self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i])) - - -@private -@constant -def to_little_endian_64(value: u256) -> bytes[8]: - # Reversing bytes using bitwise u256 manipulations - # Note: array accesses of bytes[] are not currently supported in Vyper - # Note: this function is only called when `value < 2**64` - y: u256 = 0 - x: u256 = value - for _ in range(8): - y = shift(y, 8) - y = y + bitwise_and(x, 255) - x = shift(x, -8) - return slice(convert(y, bytes32), start=24, len=8) - - -@public -@constant -def get_hash_tree_root() -> bytes32: - zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000 - node: bytes32 = zero_bytes32 - size: u256 = self.deposit_count - for height in range(DEPOSIT_CONTRACT_TREE_DEPTH): - if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1` - node = sha256(concat(self.branch[height], node)) - else: - node = sha256(concat(node, self.zero_hashes[height])) - size /= 2 - return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24))) - - -@public -@constant -def get_deposit_count() -> bytes[8]: - return self.to_little_endian_64(self.deposit_count) - - -@payable -@public -def deposit(pubkey: bytes[PUBKEY_LENGTH], - withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH], - signature: bytes[SIGNATURE_LENGTH]): - # Avoid overflowing the Merkle tree (and prevent edge case in computing `self.branch`) - assert self.deposit_count < MAX_DEPOSIT_COUNT - - # Validate deposit data - deposit_amount: u256 = msg.value / as_wei_value(1, "gwei") - assert deposit_amount >= MIN_DEPOSIT_AMOUNT - assert len(pubkey) == PUBKEY_LENGTH - assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH - assert len(signature) == SIGNATURE_LENGTH - - # Emit `DepositEvent` log - amount: bytes[8] = self.to_little_endian_64(deposit_amount) - log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count)) - - # Compute `DepositData` hash tree root - zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000 - pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH))) - signature_root: bytes32 = sha256(concat( - sha256(slice(signature, start=0, len=64)), - sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)), - )) - node: bytes32 = sha256(concat( - sha256(concat(pubkey_root, withdrawal_credentials)), - sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)), - )) - - # Add `DepositData` hash tree root to Merkle tree (update a single `branch` node) - self.deposit_count += 1 - size: u256 = self.deposit_count - for height in range(DEPOSIT_CONTRACT_TREE_DEPTH): - if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1` - self.branch[height] = node - break - node = sha256(concat(self.branch[height], node)) - size /= 2 ---- -[ - { - "typ": "NAME", - "string": "MIN_DEPOSIT_AMOUNT", - "start": [ - 1, - 0 - ], - "end": [ - 1, - 18 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 1, - 18 - ], - "end": [ - 1, - 19 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 1, - 20 - ], - "end": [ - 1, - 28 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 1, - 28 - ], - "end": [ - 1, - 29 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 1, - 29 - ], - "end": [ - 1, - 33 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 1, - 33 - ], - "end": [ - 1, - 34 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 1, - 35 - ], - "end": [ - 1, - 36 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "NUMBER", - "string": "1000000000", - "start": [ - 1, - 37 - ], - "end": [ - 1, - 47 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "COMMENT", - "string": "# Gwei", - "start": [ - 1, - 49 - ], - "end": [ - 1, - 55 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 1, - 55 - ], - "end": [ - 2, - 0 - ], - "line": "MIN_DEPOSIT_AMOUNT: constant(u256) = 1000000000 # Gwei\n" - }, - { - "typ": "NAME", - "string": "DEPOSIT_CONTRACT_TREE_DEPTH", - "start": [ - 2, - 0 - ], - "end": [ - 2, - 27 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 2, - 27 - ], - "end": [ - 2, - 28 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 2, - 29 - ], - "end": [ - 2, - 37 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 2, - 37 - ], - "end": [ - 2, - 38 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 2, - 38 - ], - "end": [ - 2, - 42 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 2, - 42 - ], - "end": [ - 2, - 43 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 2, - 44 - ], - "end": [ - 2, - 45 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "NUMBER", - "string": "32", - "start": [ - 2, - 46 - ], - "end": [ - 2, - 48 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 2, - 48 - ], - "end": [ - 3, - 0 - ], - "line": "DEPOSIT_CONTRACT_TREE_DEPTH: constant(u256) = 32\n" - }, - { - "typ": "NAME", - "string": "MAX_DEPOSIT_COUNT", - "start": [ - 3, - 0 - ], - "end": [ - 3, - 17 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 3, - 17 - ], - "end": [ - 3, - 18 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 3, - 19 - ], - "end": [ - 3, - 27 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 3, - 27 - ], - "end": [ - 3, - 28 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 3, - 28 - ], - "end": [ - 3, - 32 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 3, - 32 - ], - "end": [ - 3, - 33 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 3, - 34 - ], - "end": [ - 3, - 35 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "NUMBER", - "string": "4294967295", - "start": [ - 3, - 36 - ], - "end": [ - 3, - 46 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "COMMENT", - "string": "# 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1", - "start": [ - 3, - 47 - ], - "end": [ - 3, - 83 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 3, - 83 - ], - "end": [ - 4, - 0 - ], - "line": "MAX_DEPOSIT_COUNT: constant(u256) = 4294967295 # 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1\n" - }, - { - "typ": "NAME", - "string": "PUBKEY_LENGTH", - "start": [ - 4, - 0 - ], - "end": [ - 4, - 13 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 4, - 13 - ], - "end": [ - 4, - 14 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 4, - 15 - ], - "end": [ - 4, - 23 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 4, - 23 - ], - "end": [ - 4, - 24 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 4, - 24 - ], - "end": [ - 4, - 28 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 4, - 28 - ], - "end": [ - 4, - 29 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 4, - 30 - ], - "end": [ - 4, - 31 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "NUMBER", - "string": "48", - "start": [ - 4, - 32 - ], - "end": [ - 4, - 34 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "COMMENT", - "string": "# bytes", - "start": [ - 4, - 36 - ], - "end": [ - 4, - 43 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 4, - 43 - ], - "end": [ - 5, - 0 - ], - "line": "PUBKEY_LENGTH: constant(u256) = 48 # bytes\n" - }, - { - "typ": "NAME", - "string": "WITHDRAWAL_CREDENTIALS_LENGTH", - "start": [ - 5, - 0 - ], - "end": [ - 5, - 29 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 5, - 29 - ], - "end": [ - 5, - 30 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 5, - 31 - ], - "end": [ - 5, - 39 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 5, - 39 - ], - "end": [ - 5, - 40 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 5, - 40 - ], - "end": [ - 5, - 44 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 5, - 44 - ], - "end": [ - 5, - 45 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 5, - 46 - ], - "end": [ - 5, - 47 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "NUMBER", - "string": "32", - "start": [ - 5, - 48 - ], - "end": [ - 5, - 50 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "COMMENT", - "string": "# bytes", - "start": [ - 5, - 52 - ], - "end": [ - 5, - 59 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 5, - 59 - ], - "end": [ - 6, - 0 - ], - "line": "WITHDRAWAL_CREDENTIALS_LENGTH: constant(u256) = 32 # bytes\n" - }, - { - "typ": "NAME", - "string": "AMOUNT_LENGTH", - "start": [ - 6, - 0 - ], - "end": [ - 6, - 13 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 6, - 13 - ], - "end": [ - 6, - 14 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 6, - 15 - ], - "end": [ - 6, - 23 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 6, - 23 - ], - "end": [ - 6, - 24 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 6, - 24 - ], - "end": [ - 6, - 28 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 6, - 28 - ], - "end": [ - 6, - 29 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 6, - 30 - ], - "end": [ - 6, - 31 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 6, - 32 - ], - "end": [ - 6, - 33 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "COMMENT", - "string": "# bytes", - "start": [ - 6, - 35 - ], - "end": [ - 6, - 42 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 6, - 42 - ], - "end": [ - 7, - 0 - ], - "line": "AMOUNT_LENGTH: constant(u256) = 8 # bytes\n" - }, - { - "typ": "NAME", - "string": "SIGNATURE_LENGTH", - "start": [ - 7, - 0 - ], - "end": [ - 7, - 16 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 7, - 16 - ], - "end": [ - 7, - 17 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 7, - 18 - ], - "end": [ - 7, - 26 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 7, - 26 - ], - "end": [ - 7, - 27 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 7, - 27 - ], - "end": [ - 7, - 31 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 7, - 31 - ], - "end": [ - 7, - 32 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 7, - 33 - ], - "end": [ - 7, - 34 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "NUMBER", - "string": "96", - "start": [ - 7, - 35 - ], - "end": [ - 7, - 37 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "COMMENT", - "string": "# bytes", - "start": [ - 7, - 39 - ], - "end": [ - 7, - 46 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 7, - 46 - ], - "end": [ - 8, - 0 - ], - "line": "SIGNATURE_LENGTH: constant(u256) = 96 # bytes\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 8, - 0 - ], - "end": [ - 9, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "DepositEvent", - "start": [ - 9, - 0 - ], - "end": [ - 9, - 12 - ], - "line": "DepositEvent: event({\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 9, - 12 - ], - "end": [ - 9, - 13 - ], - "line": "DepositEvent: event({\n" - }, - { - "typ": "NAME", - "string": "event", - "start": [ - 9, - 14 - ], - "end": [ - 9, - 19 - ], - "line": "DepositEvent: event({\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 9, - 19 - ], - "end": [ - 9, - 20 - ], - "line": "DepositEvent: event({\n" - }, - { - "typ": "OP", - "string": "{", - "start": [ - 9, - 20 - ], - "end": [ - 9, - 21 - ], - "line": "DepositEvent: event({\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 9, - 21 - ], - "end": [ - 10, - 0 - ], - "line": "DepositEvent: event({\n" - }, - { - "typ": "NAME", - "string": "pubkey", - "start": [ - 10, - 4 - ], - "end": [ - 10, - 10 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 10, - 10 - ], - "end": [ - 10, - 11 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 10, - 12 - ], - "end": [ - 10, - 17 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 10, - 17 - ], - "end": [ - 10, - 18 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "NUMBER", - "string": "48", - "start": [ - 10, - 18 - ], - "end": [ - 10, - 20 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 10, - 20 - ], - "end": [ - 10, - 21 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 10, - 21 - ], - "end": [ - 10, - 22 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 10, - 22 - ], - "end": [ - 11, - 0 - ], - "line": " pubkey: bytes[48],\n" - }, - { - "typ": "NAME", - "string": "withdrawal_credentials", - "start": [ - 11, - 4 - ], - "end": [ - 11, - 26 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 11, - 26 - ], - "end": [ - 11, - 27 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 11, - 28 - ], - "end": [ - 11, - 33 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 11, - 33 - ], - "end": [ - 11, - 34 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "NUMBER", - "string": "32", - "start": [ - 11, - 34 - ], - "end": [ - 11, - 36 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 11, - 36 - ], - "end": [ - 11, - 37 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 11, - 37 - ], - "end": [ - 11, - 38 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 11, - 38 - ], - "end": [ - 12, - 0 - ], - "line": " withdrawal_credentials: bytes[32],\n" - }, - { - "typ": "NAME", - "string": "amount", - "start": [ - 12, - 4 - ], - "end": [ - 12, - 10 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 12, - 10 - ], - "end": [ - 12, - 11 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 12, - 12 - ], - "end": [ - 12, - 17 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 12, - 17 - ], - "end": [ - 12, - 18 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 12, - 18 - ], - "end": [ - 12, - 19 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 12, - 19 - ], - "end": [ - 12, - 20 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 12, - 20 - ], - "end": [ - 12, - 21 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 12, - 21 - ], - "end": [ - 13, - 0 - ], - "line": " amount: bytes[8],\n" - }, - { - "typ": "NAME", - "string": "signature", - "start": [ - 13, - 4 - ], - "end": [ - 13, - 13 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 13, - 13 - ], - "end": [ - 13, - 14 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 13, - 15 - ], - "end": [ - 13, - 20 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 13, - 20 - ], - "end": [ - 13, - 21 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "NUMBER", - "string": "96", - "start": [ - 13, - 21 - ], - "end": [ - 13, - 23 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 13, - 23 - ], - "end": [ - 13, - 24 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 13, - 24 - ], - "end": [ - 13, - 25 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 13, - 25 - ], - "end": [ - 14, - 0 - ], - "line": " signature: bytes[96],\n" - }, - { - "typ": "NAME", - "string": "index", - "start": [ - 14, - 4 - ], - "end": [ - 14, - 9 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 14, - 9 - ], - "end": [ - 14, - 10 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 14, - 11 - ], - "end": [ - 14, - 16 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 14, - 16 - ], - "end": [ - 14, - 17 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 14, - 17 - ], - "end": [ - 14, - 18 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 14, - 18 - ], - "end": [ - 14, - 19 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 14, - 19 - ], - "end": [ - 14, - 20 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 14, - 20 - ], - "end": [ - 15, - 0 - ], - "line": " index: bytes[8],\n" - }, - { - "typ": "OP", - "string": "}", - "start": [ - 15, - 0 - ], - "end": [ - 15, - 1 - ], - "line": "})\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 15, - 1 - ], - "end": [ - 15, - 2 - ], - "line": "})\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 15, - 2 - ], - "end": [ - 16, - 0 - ], - "line": "})\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 16, - 0 - ], - "end": [ - 17, - 0 - ], - "line": "\n" - }, - { - "typ": "NAME", - "string": "branch", - "start": [ - 17, - 0 - ], - "end": [ - 17, - 6 - ], - "line": "branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 17, - 6 - ], - "end": [ - 17, - 7 - ], - "line": "branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 17, - 8 - ], - "end": [ - 17, - 15 - ], - "line": "branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 17, - 15 - ], - "end": [ - 17, - 16 - ], - "line": "branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "NAME", - "string": "DEPOSIT_CONTRACT_TREE_DEPTH", - "start": [ - 17, - 16 - ], - "end": [ - 17, - 43 - ], - "line": "branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 17, - 43 - ], - "end": [ - 17, - 44 - ], - "line": "branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 17, - 44 - ], - "end": [ - 18, - 0 - ], - "line": "branch: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 18, - 0 - ], - "end": [ - 18, - 13 - ], - "line": "deposit_count: u256\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 18, - 13 - ], - "end": [ - 18, - 14 - ], - "line": "deposit_count: u256\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 18, - 15 - ], - "end": [ - 18, - 19 - ], - "line": "deposit_count: u256\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 18, - 19 - ], - "end": [ - 19, - 0 - ], - "line": "deposit_count: u256\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 19, - 0 - ], - "end": [ - 20, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Compute hashes in empty sparse Merkle tree", - "start": [ - 20, - 0 - ], - "end": [ - 20, - 44 - ], - "line": "# Compute hashes in empty sparse Merkle tree\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 20, - 44 - ], - "end": [ - 21, - 0 - ], - "line": "# Compute hashes in empty sparse Merkle tree\n" - }, - { - "typ": "NAME", - "string": "zero_hashes", - "start": [ - 21, - 0 - ], - "end": [ - 21, - 11 - ], - "line": "zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 21, - 11 - ], - "end": [ - 21, - 12 - ], - "line": "zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 21, - 13 - ], - "end": [ - 21, - 20 - ], - "line": "zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 21, - 20 - ], - "end": [ - 21, - 21 - ], - "line": "zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "NAME", - "string": "DEPOSIT_CONTRACT_TREE_DEPTH", - "start": [ - 21, - 21 - ], - "end": [ - 21, - 48 - ], - "line": "zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 21, - 48 - ], - "end": [ - 21, - 49 - ], - "line": "zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 21, - 49 - ], - "end": [ - 22, - 0 - ], - "line": "zero_hashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH]\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 22, - 0 - ], - "end": [ - 22, - 1 - ], - "line": "@public\n" - }, - { - "typ": "NAME", - "string": "public", - "start": [ - 22, - 1 - ], - "end": [ - 22, - 7 - ], - "line": "@public\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 22, - 7 - ], - "end": [ - 23, - 0 - ], - "line": "@public\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 23, - 0 - ], - "end": [ - 23, - 3 - ], - "line": "def __init__():\n" - }, - { - "typ": "NAME", - "string": "__init__", - "start": [ - 23, - 4 - ], - "end": [ - 23, - 12 - ], - "line": "def __init__():\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 23, - 12 - ], - "end": [ - 23, - 13 - ], - "line": "def __init__():\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 23, - 13 - ], - "end": [ - 23, - 14 - ], - "line": "def __init__():\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 23, - 14 - ], - "end": [ - 23, - 15 - ], - "line": "def __init__():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 23, - 15 - ], - "end": [ - 24, - 0 - ], - "line": "def __init__():\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 24, - 0 - ], - "end": [ - 24, - 4 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 24, - 4 - ], - "end": [ - 24, - 7 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "NAME", - "string": "i", - "start": [ - 24, - 8 - ], - "end": [ - 24, - 9 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 24, - 10 - ], - "end": [ - 24, - 12 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "NAME", - "string": "range", - "start": [ - 24, - 13 - ], - "end": [ - 24, - 18 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 24, - 18 - ], - "end": [ - 24, - 19 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "NAME", - "string": "DEPOSIT_CONTRACT_TREE_DEPTH", - "start": [ - 24, - 19 - ], - "end": [ - 24, - 46 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 24, - 47 - ], - "end": [ - 24, - 48 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 24, - 49 - ], - "end": [ - 24, - 50 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 24, - 50 - ], - "end": [ - 24, - 51 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 24, - 51 - ], - "end": [ - 24, - 52 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 24, - 52 - ], - "end": [ - 25, - 0 - ], - "line": " for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 25, - 0 - ], - "end": [ - 25, - 8 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 25, - 8 - ], - "end": [ - 25, - 12 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 25, - 12 - ], - "end": [ - 25, - 13 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "zero_hashes", - "start": [ - 25, - 13 - ], - "end": [ - 25, - 24 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 25, - 24 - ], - "end": [ - 25, - 25 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "i", - "start": [ - 25, - 25 - ], - "end": [ - 25, - 26 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 25, - 27 - ], - "end": [ - 25, - 28 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 25, - 29 - ], - "end": [ - 25, - 30 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 25, - 30 - ], - "end": [ - 25, - 31 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 25, - 32 - ], - "end": [ - 25, - 33 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 25, - 34 - ], - "end": [ - 25, - 40 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 25, - 40 - ], - "end": [ - 25, - 41 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 25, - 41 - ], - "end": [ - 25, - 47 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 25, - 47 - ], - "end": [ - 25, - 48 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 25, - 48 - ], - "end": [ - 25, - 52 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 25, - 52 - ], - "end": [ - 25, - 53 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "zero_hashes", - "start": [ - 25, - 53 - ], - "end": [ - 25, - 64 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 25, - 64 - ], - "end": [ - 25, - 65 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "i", - "start": [ - 25, - 65 - ], - "end": [ - 25, - 66 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 25, - 66 - ], - "end": [ - 25, - 67 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 25, - 67 - ], - "end": [ - 25, - 68 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 25, - 69 - ], - "end": [ - 25, - 73 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 25, - 73 - ], - "end": [ - 25, - 74 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "zero_hashes", - "start": [ - 25, - 74 - ], - "end": [ - 25, - 85 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 25, - 85 - ], - "end": [ - 25, - 86 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NAME", - "string": "i", - "start": [ - 25, - 86 - ], - "end": [ - 25, - 87 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 25, - 87 - ], - "end": [ - 25, - 88 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 25, - 88 - ], - "end": [ - 25, - 89 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 25, - 89 - ], - "end": [ - 25, - 90 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 25, - 90 - ], - "end": [ - 26, - 0 - ], - "line": " self.zero_hashes[i + 1] = sha256(concat(self.zero_hashes[i], self.zero_hashes[i]))\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 26, - 0 - ], - "end": [ - 27, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 27, - 0 - ], - "end": [ - 28, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 28, - 0 - ], - "end": [ - 28, - 0 - ], - "line": "@private\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 28, - 0 - ], - "end": [ - 28, - 0 - ], - "line": "@private\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 28, - 0 - ], - "end": [ - 28, - 1 - ], - "line": "@private\n" - }, - { - "typ": "NAME", - "string": "private", - "start": [ - 28, - 1 - ], - "end": [ - 28, - 8 - ], - "line": "@private\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 28, - 8 - ], - "end": [ - 29, - 0 - ], - "line": "@private\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 29, - 0 - ], - "end": [ - 29, - 1 - ], - "line": "@constant\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 29, - 1 - ], - "end": [ - 29, - 9 - ], - "line": "@constant\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 29, - 9 - ], - "end": [ - 30, - 0 - ], - "line": "@constant\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 30, - 0 - ], - "end": [ - 30, - 3 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "NAME", - "string": "to_little_endian_64", - "start": [ - 30, - 4 - ], - "end": [ - 30, - 23 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 30, - 23 - ], - "end": [ - 30, - 24 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "NAME", - "string": "value", - "start": [ - 30, - 24 - ], - "end": [ - 30, - 29 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 30, - 29 - ], - "end": [ - 30, - 30 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 30, - 31 - ], - "end": [ - 30, - 35 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 30, - 35 - ], - "end": [ - 30, - 36 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "->", - "start": [ - 30, - 37 - ], - "end": [ - 30, - 39 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 30, - 40 - ], - "end": [ - 30, - 45 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 30, - 45 - ], - "end": [ - 30, - 46 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 30, - 46 - ], - "end": [ - 30, - 47 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 30, - 47 - ], - "end": [ - 30, - 48 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 30, - 48 - ], - "end": [ - 30, - 49 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 30, - 49 - ], - "end": [ - 31, - 0 - ], - "line": "def to_little_endian_64(value: u256) -> bytes[8]:\n" - }, - { - "typ": "COMMENT", - "string": "# Reversing bytes using bitwise u256 manipulations", - "start": [ - 31, - 4 - ], - "end": [ - 31, - 54 - ], - "line": " # Reversing bytes using bitwise u256 manipulations\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 31, - 54 - ], - "end": [ - 32, - 0 - ], - "line": " # Reversing bytes using bitwise u256 manipulations\n" - }, - { - "typ": "COMMENT", - "string": "# Note: array accesses of bytes[] are not currently supported in Vyper", - "start": [ - 32, - 4 - ], - "end": [ - 32, - 74 - ], - "line": " # Note: array accesses of bytes[] are not currently supported in Vyper\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 32, - 74 - ], - "end": [ - 33, - 0 - ], - "line": " # Note: array accesses of bytes[] are not currently supported in Vyper\n" - }, - { - "typ": "COMMENT", - "string": "# Note: this function is only called when `value < 2**64`", - "start": [ - 33, - 4 - ], - "end": [ - 33, - 61 - ], - "line": " # Note: this function is only called when `value < 2**64`\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 33, - 61 - ], - "end": [ - 34, - 0 - ], - "line": " # Note: this function is only called when `value < 2**64`\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 34, - 0 - ], - "end": [ - 34, - 4 - ], - "line": " y: u256 = 0\n" - }, - { - "typ": "NAME", - "string": "y", - "start": [ - 34, - 4 - ], - "end": [ - 34, - 5 - ], - "line": " y: u256 = 0\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 34, - 5 - ], - "end": [ - 34, - 6 - ], - "line": " y: u256 = 0\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 34, - 7 - ], - "end": [ - 34, - 11 - ], - "line": " y: u256 = 0\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 34, - 12 - ], - "end": [ - 34, - 13 - ], - "line": " y: u256 = 0\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 34, - 14 - ], - "end": [ - 34, - 15 - ], - "line": " y: u256 = 0\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 34, - 15 - ], - "end": [ - 35, - 0 - ], - "line": " y: u256 = 0\n" - }, - { - "typ": "NAME", - "string": "x", - "start": [ - 35, - 4 - ], - "end": [ - 35, - 5 - ], - "line": " x: u256 = value\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 35, - 5 - ], - "end": [ - 35, - 6 - ], - "line": " x: u256 = value\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 35, - 7 - ], - "end": [ - 35, - 11 - ], - "line": " x: u256 = value\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 35, - 12 - ], - "end": [ - 35, - 13 - ], - "line": " x: u256 = value\n" - }, - { - "typ": "NAME", - "string": "value", - "start": [ - 35, - 14 - ], - "end": [ - 35, - 19 - ], - "line": " x: u256 = value\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 35, - 19 - ], - "end": [ - 36, - 0 - ], - "line": " x: u256 = value\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 36, - 4 - ], - "end": [ - 36, - 7 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "NAME", - "string": "_", - "start": [ - 36, - 8 - ], - "end": [ - 36, - 9 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 36, - 10 - ], - "end": [ - 36, - 12 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "NAME", - "string": "range", - "start": [ - 36, - 13 - ], - "end": [ - 36, - 18 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 36, - 18 - ], - "end": [ - 36, - 19 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 36, - 19 - ], - "end": [ - 36, - 20 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 36, - 20 - ], - "end": [ - 36, - 21 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 36, - 21 - ], - "end": [ - 36, - 22 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 36, - 22 - ], - "end": [ - 37, - 0 - ], - "line": " for _ in range(8):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 37, - 0 - ], - "end": [ - 37, - 8 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "NAME", - "string": "y", - "start": [ - 37, - 8 - ], - "end": [ - 37, - 9 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 37, - 10 - ], - "end": [ - 37, - 11 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "NAME", - "string": "shift", - "start": [ - 37, - 12 - ], - "end": [ - 37, - 17 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 37, - 17 - ], - "end": [ - 37, - 18 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "NAME", - "string": "y", - "start": [ - 37, - 18 - ], - "end": [ - 37, - 19 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 37, - 19 - ], - "end": [ - 37, - 20 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 37, - 21 - ], - "end": [ - 37, - 22 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 37, - 22 - ], - "end": [ - 37, - 23 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 37, - 23 - ], - "end": [ - 38, - 0 - ], - "line": " y = shift(y, 8)\n" - }, - { - "typ": "NAME", - "string": "y", - "start": [ - 38, - 8 - ], - "end": [ - 38, - 9 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 38, - 10 - ], - "end": [ - 38, - 11 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "NAME", - "string": "y", - "start": [ - 38, - 12 - ], - "end": [ - 38, - 13 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 38, - 14 - ], - "end": [ - 38, - 15 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "NAME", - "string": "bitwise_and", - "start": [ - 38, - 16 - ], - "end": [ - 38, - 27 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 38, - 27 - ], - "end": [ - 38, - 28 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "NAME", - "string": "x", - "start": [ - 38, - 28 - ], - "end": [ - 38, - 29 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 38, - 29 - ], - "end": [ - 38, - 30 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "NUMBER", - "string": "255", - "start": [ - 38, - 31 - ], - "end": [ - 38, - 34 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 38, - 34 - ], - "end": [ - 38, - 35 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 38, - 35 - ], - "end": [ - 39, - 0 - ], - "line": " y = y + bitwise_and(x, 255)\n" - }, - { - "typ": "NAME", - "string": "x", - "start": [ - 39, - 8 - ], - "end": [ - 39, - 9 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 39, - 10 - ], - "end": [ - 39, - 11 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "NAME", - "string": "shift", - "start": [ - 39, - 12 - ], - "end": [ - 39, - 17 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 39, - 17 - ], - "end": [ - 39, - 18 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "NAME", - "string": "x", - "start": [ - 39, - 18 - ], - "end": [ - 39, - 19 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 39, - 19 - ], - "end": [ - 39, - 20 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 39, - 21 - ], - "end": [ - 39, - 22 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 39, - 22 - ], - "end": [ - 39, - 23 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 39, - 23 - ], - "end": [ - 39, - 24 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 39, - 24 - ], - "end": [ - 40, - 0 - ], - "line": " x = shift(x, -8)\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 40, - 4 - ], - "end": [ - 40, - 4 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 40, - 4 - ], - "end": [ - 40, - 10 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NAME", - "string": "slice", - "start": [ - 40, - 11 - ], - "end": [ - 40, - 16 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 40, - 16 - ], - "end": [ - 40, - 17 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NAME", - "string": "convert", - "start": [ - 40, - 17 - ], - "end": [ - 40, - 24 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 40, - 24 - ], - "end": [ - 40, - 25 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NAME", - "string": "y", - "start": [ - 40, - 25 - ], - "end": [ - 40, - 26 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 40, - 26 - ], - "end": [ - 40, - 27 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 40, - 28 - ], - "end": [ - 40, - 35 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 40, - 35 - ], - "end": [ - 40, - 36 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 40, - 36 - ], - "end": [ - 40, - 37 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 40, - 38 - ], - "end": [ - 40, - 43 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 40, - 43 - ], - "end": [ - 40, - 44 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NUMBER", - "string": "24", - "start": [ - 40, - 44 - ], - "end": [ - 40, - 46 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 40, - 46 - ], - "end": [ - 40, - 47 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 40, - 48 - ], - "end": [ - 40, - 51 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 40, - 51 - ], - "end": [ - 40, - 52 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 40, - 52 - ], - "end": [ - 40, - 53 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 40, - 53 - ], - "end": [ - 40, - 54 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 40, - 54 - ], - "end": [ - 41, - 0 - ], - "line": " return slice(convert(y, bytes32), start=24, len=8)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 41, - 0 - ], - "end": [ - 42, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 42, - 0 - ], - "end": [ - 43, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 43, - 0 - ], - "end": [ - 43, - 0 - ], - "line": "@public\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 43, - 0 - ], - "end": [ - 43, - 1 - ], - "line": "@public\n" - }, - { - "typ": "NAME", - "string": "public", - "start": [ - 43, - 1 - ], - "end": [ - 43, - 7 - ], - "line": "@public\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 43, - 7 - ], - "end": [ - 44, - 0 - ], - "line": "@public\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 44, - 0 - ], - "end": [ - 44, - 1 - ], - "line": "@constant\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 44, - 1 - ], - "end": [ - 44, - 9 - ], - "line": "@constant\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 44, - 9 - ], - "end": [ - 45, - 0 - ], - "line": "@constant\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 45, - 0 - ], - "end": [ - 45, - 3 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "NAME", - "string": "get_hash_tree_root", - "start": [ - 45, - 4 - ], - "end": [ - 45, - 22 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 45, - 22 - ], - "end": [ - 45, - 23 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 45, - 23 - ], - "end": [ - 45, - 24 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "OP", - "string": "->", - "start": [ - 45, - 25 - ], - "end": [ - 45, - 27 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 45, - 28 - ], - "end": [ - 45, - 35 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 45, - 35 - ], - "end": [ - 45, - 36 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 45, - 36 - ], - "end": [ - 46, - 0 - ], - "line": "def get_hash_tree_root() -> bytes32:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 46, - 0 - ], - "end": [ - 46, - 4 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NAME", - "string": "zero_bytes32", - "start": [ - 46, - 4 - ], - "end": [ - 46, - 16 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 46, - 16 - ], - "end": [ - 46, - 17 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 46, - 18 - ], - "end": [ - 46, - 25 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 46, - 26 - ], - "end": [ - 46, - 27 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NUMBER", - "string": "0x0000000000000000000000000000000000000000000000000000000000000000", - "start": [ - 46, - 28 - ], - "end": [ - 46, - 94 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 46, - 94 - ], - "end": [ - 47, - 0 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 47, - 4 - ], - "end": [ - 47, - 8 - ], - "line": " node: bytes32 = zero_bytes32\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 47, - 8 - ], - "end": [ - 47, - 9 - ], - "line": " node: bytes32 = zero_bytes32\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 47, - 10 - ], - "end": [ - 47, - 17 - ], - "line": " node: bytes32 = zero_bytes32\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 47, - 18 - ], - "end": [ - 47, - 19 - ], - "line": " node: bytes32 = zero_bytes32\n" - }, - { - "typ": "NAME", - "string": "zero_bytes32", - "start": [ - 47, - 20 - ], - "end": [ - 47, - 32 - ], - "line": " node: bytes32 = zero_bytes32\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 47, - 32 - ], - "end": [ - 48, - 0 - ], - "line": " node: bytes32 = zero_bytes32\n" - }, - { - "typ": "NAME", - "string": "size", - "start": [ - 48, - 4 - ], - "end": [ - 48, - 8 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 48, - 8 - ], - "end": [ - 48, - 9 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 48, - 10 - ], - "end": [ - 48, - 14 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 48, - 15 - ], - "end": [ - 48, - 16 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 48, - 17 - ], - "end": [ - 48, - 21 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 48, - 21 - ], - "end": [ - 48, - 22 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 48, - 22 - ], - "end": [ - 48, - 35 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 48, - 35 - ], - "end": [ - 49, - 0 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 49, - 4 - ], - "end": [ - 49, - 7 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "height", - "start": [ - 49, - 8 - ], - "end": [ - 49, - 14 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 49, - 15 - ], - "end": [ - 49, - 17 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "range", - "start": [ - 49, - 18 - ], - "end": [ - 49, - 23 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 49, - 23 - ], - "end": [ - 49, - 24 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "DEPOSIT_CONTRACT_TREE_DEPTH", - "start": [ - 49, - 24 - ], - "end": [ - 49, - 51 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 49, - 51 - ], - "end": [ - 49, - 52 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 49, - 52 - ], - "end": [ - 49, - 53 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 49, - 53 - ], - "end": [ - 50, - 0 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 50, - 0 - ], - "end": [ - 50, - 8 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 50, - 8 - ], - "end": [ - 50, - 10 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NAME", - "string": "bitwise_and", - "start": [ - 50, - 11 - ], - "end": [ - 50, - 22 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 50, - 22 - ], - "end": [ - 50, - 23 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NAME", - "string": "size", - "start": [ - 50, - 23 - ], - "end": [ - 50, - 27 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 50, - 27 - ], - "end": [ - 50, - 28 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 50, - 29 - ], - "end": [ - 50, - 30 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 50, - 30 - ], - "end": [ - 50, - 31 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 50, - 32 - ], - "end": [ - 50, - 34 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 50, - 35 - ], - "end": [ - 50, - 36 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 50, - 36 - ], - "end": [ - 50, - 37 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "COMMENT", - "string": "# More gas efficient than `size % 2 == 1`", - "start": [ - 50, - 39 - ], - "end": [ - 50, - 80 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 50, - 80 - ], - "end": [ - 51, - 0 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 51, - 0 - ], - "end": [ - 51, - 12 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 51, - 12 - ], - "end": [ - 51, - 16 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 51, - 17 - ], - "end": [ - 51, - 18 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 51, - 19 - ], - "end": [ - 51, - 25 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 51, - 25 - ], - "end": [ - 51, - 26 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 51, - 26 - ], - "end": [ - 51, - 32 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 51, - 32 - ], - "end": [ - 51, - 33 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 51, - 33 - ], - "end": [ - 51, - 37 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 51, - 37 - ], - "end": [ - 51, - 38 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "branch", - "start": [ - 51, - 38 - ], - "end": [ - 51, - 44 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 51, - 44 - ], - "end": [ - 51, - 45 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "height", - "start": [ - 51, - 45 - ], - "end": [ - 51, - 51 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 51, - 51 - ], - "end": [ - 51, - 52 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 51, - 52 - ], - "end": [ - 51, - 53 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 51, - 54 - ], - "end": [ - 51, - 58 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 51, - 58 - ], - "end": [ - 51, - 59 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 51, - 59 - ], - "end": [ - 51, - 60 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 51, - 60 - ], - "end": [ - 52, - 0 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 52, - 8 - ], - "end": [ - 52, - 8 - ], - "line": " else:\n" - }, - { - "typ": "NAME", - "string": "else", - "start": [ - 52, - 8 - ], - "end": [ - 52, - 12 - ], - "line": " else:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 52, - 12 - ], - "end": [ - 52, - 13 - ], - "line": " else:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 52, - 13 - ], - "end": [ - 53, - 0 - ], - "line": " else:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 53, - 0 - ], - "end": [ - 53, - 12 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 53, - 12 - ], - "end": [ - 53, - 16 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 53, - 17 - ], - "end": [ - 53, - 18 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 53, - 19 - ], - "end": [ - 53, - 25 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 53, - 25 - ], - "end": [ - 53, - 26 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 53, - 26 - ], - "end": [ - 53, - 32 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 53, - 32 - ], - "end": [ - 53, - 33 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 53, - 33 - ], - "end": [ - 53, - 37 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 53, - 37 - ], - "end": [ - 53, - 38 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 53, - 39 - ], - "end": [ - 53, - 43 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 53, - 43 - ], - "end": [ - 53, - 44 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NAME", - "string": "zero_hashes", - "start": [ - 53, - 44 - ], - "end": [ - 53, - 55 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 53, - 55 - ], - "end": [ - 53, - 56 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NAME", - "string": "height", - "start": [ - 53, - 56 - ], - "end": [ - 53, - 62 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 53, - 62 - ], - "end": [ - 53, - 63 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 53, - 63 - ], - "end": [ - 53, - 64 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 53, - 64 - ], - "end": [ - 53, - 65 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 53, - 65 - ], - "end": [ - 54, - 0 - ], - "line": " node = sha256(concat(node, self.zero_hashes[height]))\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 54, - 8 - ], - "end": [ - 54, - 8 - ], - "line": " size /= 2\n" - }, - { - "typ": "NAME", - "string": "size", - "start": [ - 54, - 8 - ], - "end": [ - 54, - 12 - ], - "line": " size /= 2\n" - }, - { - "typ": "OP", - "string": "/=", - "start": [ - 54, - 13 - ], - "end": [ - 54, - 15 - ], - "line": " size /= 2\n" - }, - { - "typ": "NUMBER", - "string": "2", - "start": [ - 54, - 16 - ], - "end": [ - 54, - 17 - ], - "line": " size /= 2\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 54, - 17 - ], - "end": [ - 55, - 0 - ], - "line": " size /= 2\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 55, - 4 - ], - "end": [ - 55, - 4 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 55, - 4 - ], - "end": [ - 55, - 10 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 55, - 11 - ], - "end": [ - 55, - 17 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 55, - 17 - ], - "end": [ - 55, - 18 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 55, - 18 - ], - "end": [ - 55, - 24 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 55, - 24 - ], - "end": [ - 55, - 25 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 55, - 25 - ], - "end": [ - 55, - 29 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 55, - 29 - ], - "end": [ - 55, - 30 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 55, - 31 - ], - "end": [ - 55, - 35 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 55, - 35 - ], - "end": [ - 55, - 36 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "to_little_endian_64", - "start": [ - 55, - 36 - ], - "end": [ - 55, - 55 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 55, - 55 - ], - "end": [ - 55, - 56 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 55, - 56 - ], - "end": [ - 55, - 60 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 55, - 60 - ], - "end": [ - 55, - 61 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 55, - 61 - ], - "end": [ - 55, - 74 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 55, - 74 - ], - "end": [ - 55, - 75 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 55, - 75 - ], - "end": [ - 55, - 76 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "slice", - "start": [ - 55, - 77 - ], - "end": [ - 55, - 82 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 55, - 82 - ], - "end": [ - 55, - 83 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "zero_bytes32", - "start": [ - 55, - 83 - ], - "end": [ - 55, - 95 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 55, - 95 - ], - "end": [ - 55, - 96 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 55, - 97 - ], - "end": [ - 55, - 102 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 55, - 102 - ], - "end": [ - 55, - 103 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 55, - 103 - ], - "end": [ - 55, - 104 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 55, - 104 - ], - "end": [ - 55, - 105 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 55, - 106 - ], - "end": [ - 55, - 109 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 55, - 109 - ], - "end": [ - 55, - 110 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NUMBER", - "string": "24", - "start": [ - 55, - 110 - ], - "end": [ - 55, - 112 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 55, - 112 - ], - "end": [ - 55, - 113 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 55, - 113 - ], - "end": [ - 55, - 114 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 55, - 114 - ], - "end": [ - 55, - 115 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 55, - 115 - ], - "end": [ - 56, - 0 - ], - "line": " return sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 56, - 0 - ], - "end": [ - 57, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 57, - 0 - ], - "end": [ - 58, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 58, - 0 - ], - "end": [ - 58, - 0 - ], - "line": "@public\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 58, - 0 - ], - "end": [ - 58, - 1 - ], - "line": "@public\n" - }, - { - "typ": "NAME", - "string": "public", - "start": [ - 58, - 1 - ], - "end": [ - 58, - 7 - ], - "line": "@public\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 58, - 7 - ], - "end": [ - 59, - 0 - ], - "line": "@public\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 59, - 0 - ], - "end": [ - 59, - 1 - ], - "line": "@constant\n" - }, - { - "typ": "NAME", - "string": "constant", - "start": [ - 59, - 1 - ], - "end": [ - 59, - 9 - ], - "line": "@constant\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 59, - 9 - ], - "end": [ - 60, - 0 - ], - "line": "@constant\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 60, - 0 - ], - "end": [ - 60, - 3 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "NAME", - "string": "get_deposit_count", - "start": [ - 60, - 4 - ], - "end": [ - 60, - 21 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 60, - 21 - ], - "end": [ - 60, - 22 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 60, - 22 - ], - "end": [ - 60, - 23 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "->", - "start": [ - 60, - 24 - ], - "end": [ - 60, - 26 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 60, - 27 - ], - "end": [ - 60, - 32 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 60, - 32 - ], - "end": [ - 60, - 33 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 60, - 33 - ], - "end": [ - 60, - 34 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 60, - 34 - ], - "end": [ - 60, - 35 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 60, - 35 - ], - "end": [ - 60, - 36 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 60, - 36 - ], - "end": [ - 61, - 0 - ], - "line": "def get_deposit_count() -> bytes[8]:\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 61, - 0 - ], - "end": [ - 61, - 4 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "NAME", - "string": "return", - "start": [ - 61, - 4 - ], - "end": [ - 61, - 10 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 61, - 11 - ], - "end": [ - 61, - 15 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 61, - 15 - ], - "end": [ - 61, - 16 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "NAME", - "string": "to_little_endian_64", - "start": [ - 61, - 16 - ], - "end": [ - 61, - 35 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 61, - 35 - ], - "end": [ - 61, - 36 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 61, - 36 - ], - "end": [ - 61, - 40 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 61, - 40 - ], - "end": [ - 61, - 41 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 61, - 41 - ], - "end": [ - 61, - 54 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 61, - 54 - ], - "end": [ - 61, - 55 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 61, - 55 - ], - "end": [ - 62, - 0 - ], - "line": " return self.to_little_endian_64(self.deposit_count)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 62, - 0 - ], - "end": [ - 63, - 0 - ], - "line": "\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 63, - 0 - ], - "end": [ - 64, - 0 - ], - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 64, - 0 - ], - "end": [ - 64, - 0 - ], - "line": "@payable\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 64, - 0 - ], - "end": [ - 64, - 1 - ], - "line": "@payable\n" - }, - { - "typ": "NAME", - "string": "payable", - "start": [ - 64, - 1 - ], - "end": [ - 64, - 8 - ], - "line": "@payable\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 64, - 8 - ], - "end": [ - 65, - 0 - ], - "line": "@payable\n" - }, - { - "typ": "OP", - "string": "@", - "start": [ - 65, - 0 - ], - "end": [ - 65, - 1 - ], - "line": "@public\n" - }, - { - "typ": "NAME", - "string": "public", - "start": [ - 65, - 1 - ], - "end": [ - 65, - 7 - ], - "line": "@public\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 65, - 7 - ], - "end": [ - 66, - 0 - ], - "line": "@public\n" - }, - { - "typ": "NAME", - "string": "def", - "start": [ - 66, - 0 - ], - "end": [ - 66, - 3 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "deposit", - "start": [ - 66, - 4 - ], - "end": [ - 66, - 11 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 66, - 11 - ], - "end": [ - 66, - 12 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "pubkey", - "start": [ - 66, - 12 - ], - "end": [ - 66, - 18 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 66, - 18 - ], - "end": [ - 66, - 19 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 66, - 20 - ], - "end": [ - 66, - 25 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 66, - 25 - ], - "end": [ - 66, - 26 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "PUBKEY_LENGTH", - "start": [ - 66, - 26 - ], - "end": [ - 66, - 39 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 66, - 39 - ], - "end": [ - 66, - 40 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 66, - 40 - ], - "end": [ - 66, - 41 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 66, - 41 - ], - "end": [ - 67, - 0 - ], - "line": "def deposit(pubkey: bytes[PUBKEY_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "withdrawal_credentials", - "start": [ - 67, - 12 - ], - "end": [ - 67, - 34 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 67, - 34 - ], - "end": [ - 67, - 35 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 67, - 36 - ], - "end": [ - 67, - 41 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 67, - 41 - ], - "end": [ - 67, - 42 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "WITHDRAWAL_CREDENTIALS_LENGTH", - "start": [ - 67, - 42 - ], - "end": [ - 67, - 71 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 67, - 71 - ], - "end": [ - 67, - 72 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 67, - 72 - ], - "end": [ - 67, - 73 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 67, - 73 - ], - "end": [ - 68, - 0 - ], - "line": " withdrawal_credentials: bytes[WITHDRAWAL_CREDENTIALS_LENGTH],\n" - }, - { - "typ": "NAME", - "string": "signature", - "start": [ - 68, - 12 - ], - "end": [ - 68, - 21 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 68, - 21 - ], - "end": [ - 68, - 22 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 68, - 23 - ], - "end": [ - 68, - 28 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 68, - 28 - ], - "end": [ - 68, - 29 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "NAME", - "string": "SIGNATURE_LENGTH", - "start": [ - 68, - 29 - ], - "end": [ - 68, - 45 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 68, - 45 - ], - "end": [ - 68, - 46 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 68, - 46 - ], - "end": [ - 68, - 47 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 68, - 47 - ], - "end": [ - 68, - 48 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 68, - 48 - ], - "end": [ - 69, - 0 - ], - "line": " signature: bytes[SIGNATURE_LENGTH]):\n" - }, - { - "typ": "COMMENT", - "string": "# Avoid overflowing the Merkle tree (and prevent edge case in computing `self.branch`)", - "start": [ - 69, - 4 - ], - "end": [ - 69, - 90 - ], - "line": " # Avoid overflowing the Merkle tree (and prevent edge case in computing `self.branch`)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 69, - 90 - ], - "end": [ - 70, - 0 - ], - "line": " # Avoid overflowing the Merkle tree (and prevent edge case in computing `self.branch`)\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 70, - 0 - ], - "end": [ - 70, - 4 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "NAME", - "string": "assert", - "start": [ - 70, - 4 - ], - "end": [ - 70, - 10 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 70, - 11 - ], - "end": [ - 70, - 15 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 70, - 15 - ], - "end": [ - 70, - 16 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 70, - 16 - ], - "end": [ - 70, - 29 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "OP", - "string": "<", - "start": [ - 70, - 30 - ], - "end": [ - 70, - 31 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "NAME", - "string": "MAX_DEPOSIT_COUNT", - "start": [ - 70, - 32 - ], - "end": [ - 70, - 49 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 70, - 49 - ], - "end": [ - 71, - 0 - ], - "line": " assert self.deposit_count < MAX_DEPOSIT_COUNT\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 71, - 0 - ], - "end": [ - 72, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Validate deposit data", - "start": [ - 72, - 4 - ], - "end": [ - 72, - 27 - ], - "line": " # Validate deposit data\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 72, - 27 - ], - "end": [ - 73, - 0 - ], - "line": " # Validate deposit data\n" - }, - { - "typ": "NAME", - "string": "deposit_amount", - "start": [ - 73, - 4 - ], - "end": [ - 73, - 18 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 73, - 18 - ], - "end": [ - 73, - 19 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 73, - 20 - ], - "end": [ - 73, - 24 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 73, - 25 - ], - "end": [ - 73, - 26 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "NAME", - "string": "msg", - "start": [ - 73, - 27 - ], - "end": [ - 73, - 30 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 73, - 30 - ], - "end": [ - 73, - 31 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "NAME", - "string": "value", - "start": [ - 73, - 31 - ], - "end": [ - 73, - 36 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "OP", - "string": "/", - "start": [ - 73, - 37 - ], - "end": [ - 73, - 38 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "NAME", - "string": "as_wei_value", - "start": [ - 73, - 39 - ], - "end": [ - 73, - 51 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 73, - 51 - ], - "end": [ - 73, - 52 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 73, - 52 - ], - "end": [ - 73, - 53 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 73, - 53 - ], - "end": [ - 73, - 54 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "STRING", - "string": "\"gwei\"", - "start": [ - 73, - 55 - ], - "end": [ - 73, - 61 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 73, - 61 - ], - "end": [ - 73, - 62 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 73, - 62 - ], - "end": [ - 74, - 0 - ], - "line": " deposit_amount: u256 = msg.value / as_wei_value(1, \"gwei\")\n" - }, - { - "typ": "NAME", - "string": "assert", - "start": [ - 74, - 4 - ], - "end": [ - 74, - 10 - ], - "line": " assert deposit_amount >= MIN_DEPOSIT_AMOUNT\n" - }, - { - "typ": "NAME", - "string": "deposit_amount", - "start": [ - 74, - 11 - ], - "end": [ - 74, - 25 - ], - "line": " assert deposit_amount >= MIN_DEPOSIT_AMOUNT\n" - }, - { - "typ": "OP", - "string": ">=", - "start": [ - 74, - 26 - ], - "end": [ - 74, - 28 - ], - "line": " assert deposit_amount >= MIN_DEPOSIT_AMOUNT\n" - }, - { - "typ": "NAME", - "string": "MIN_DEPOSIT_AMOUNT", - "start": [ - 74, - 29 - ], - "end": [ - 74, - 47 - ], - "line": " assert deposit_amount >= MIN_DEPOSIT_AMOUNT\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 74, - 47 - ], - "end": [ - 75, - 0 - ], - "line": " assert deposit_amount >= MIN_DEPOSIT_AMOUNT\n" - }, - { - "typ": "NAME", - "string": "assert", - "start": [ - 75, - 4 - ], - "end": [ - 75, - 10 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 75, - 11 - ], - "end": [ - 75, - 14 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 75, - 14 - ], - "end": [ - 75, - 15 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "NAME", - "string": "pubkey", - "start": [ - 75, - 15 - ], - "end": [ - 75, - 21 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 75, - 21 - ], - "end": [ - 75, - 22 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 75, - 23 - ], - "end": [ - 75, - 25 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "NAME", - "string": "PUBKEY_LENGTH", - "start": [ - 75, - 26 - ], - "end": [ - 75, - 39 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 75, - 39 - ], - "end": [ - 76, - 0 - ], - "line": " assert len(pubkey) == PUBKEY_LENGTH\n" - }, - { - "typ": "NAME", - "string": "assert", - "start": [ - 76, - 4 - ], - "end": [ - 76, - 10 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 76, - 11 - ], - "end": [ - 76, - 14 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 76, - 14 - ], - "end": [ - 76, - 15 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "NAME", - "string": "withdrawal_credentials", - "start": [ - 76, - 15 - ], - "end": [ - 76, - 37 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 76, - 37 - ], - "end": [ - 76, - 38 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 76, - 39 - ], - "end": [ - 76, - 41 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "NAME", - "string": "WITHDRAWAL_CREDENTIALS_LENGTH", - "start": [ - 76, - 42 - ], - "end": [ - 76, - 71 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 76, - 71 - ], - "end": [ - 77, - 0 - ], - "line": " assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH\n" - }, - { - "typ": "NAME", - "string": "assert", - "start": [ - 77, - 4 - ], - "end": [ - 77, - 10 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 77, - 11 - ], - "end": [ - 77, - 14 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 77, - 14 - ], - "end": [ - 77, - 15 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "NAME", - "string": "signature", - "start": [ - 77, - 15 - ], - "end": [ - 77, - 24 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 77, - 24 - ], - "end": [ - 77, - 25 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 77, - 26 - ], - "end": [ - 77, - 28 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "NAME", - "string": "SIGNATURE_LENGTH", - "start": [ - 77, - 29 - ], - "end": [ - 77, - 45 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 77, - 45 - ], - "end": [ - 78, - 0 - ], - "line": " assert len(signature) == SIGNATURE_LENGTH\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 78, - 0 - ], - "end": [ - 79, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Emit `DepositEvent` log", - "start": [ - 79, - 4 - ], - "end": [ - 79, - 29 - ], - "line": " # Emit `DepositEvent` log\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 79, - 29 - ], - "end": [ - 80, - 0 - ], - "line": " # Emit `DepositEvent` log\n" - }, - { - "typ": "NAME", - "string": "amount", - "start": [ - 80, - 4 - ], - "end": [ - 80, - 10 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 80, - 10 - ], - "end": [ - 80, - 11 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "NAME", - "string": "bytes", - "start": [ - 80, - 12 - ], - "end": [ - 80, - 17 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 80, - 17 - ], - "end": [ - 80, - 18 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "NUMBER", - "string": "8", - "start": [ - 80, - 18 - ], - "end": [ - 80, - 19 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 80, - 19 - ], - "end": [ - 80, - 20 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 80, - 21 - ], - "end": [ - 80, - 22 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 80, - 23 - ], - "end": [ - 80, - 27 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 80, - 27 - ], - "end": [ - 80, - 28 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "NAME", - "string": "to_little_endian_64", - "start": [ - 80, - 28 - ], - "end": [ - 80, - 47 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 80, - 47 - ], - "end": [ - 80, - 48 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "NAME", - "string": "deposit_amount", - "start": [ - 80, - 48 - ], - "end": [ - 80, - 62 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 80, - 62 - ], - "end": [ - 80, - 63 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 80, - 63 - ], - "end": [ - 81, - 0 - ], - "line": " amount: bytes[8] = self.to_little_endian_64(deposit_amount)\n" - }, - { - "typ": "NAME", - "string": "log", - "start": [ - 81, - 4 - ], - "end": [ - 81, - 7 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 81, - 7 - ], - "end": [ - 81, - 8 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "DepositEvent", - "start": [ - 81, - 8 - ], - "end": [ - 81, - 20 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 81, - 20 - ], - "end": [ - 81, - 21 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "pubkey", - "start": [ - 81, - 21 - ], - "end": [ - 81, - 27 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 81, - 27 - ], - "end": [ - 81, - 28 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "withdrawal_credentials", - "start": [ - 81, - 29 - ], - "end": [ - 81, - 51 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 81, - 51 - ], - "end": [ - 81, - 52 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "amount", - "start": [ - 81, - 53 - ], - "end": [ - 81, - 59 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 81, - 59 - ], - "end": [ - 81, - 60 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "signature", - "start": [ - 81, - 61 - ], - "end": [ - 81, - 70 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 81, - 70 - ], - "end": [ - 81, - 71 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 81, - 72 - ], - "end": [ - 81, - 76 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 81, - 76 - ], - "end": [ - 81, - 77 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "to_little_endian_64", - "start": [ - 81, - 77 - ], - "end": [ - 81, - 96 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 81, - 96 - ], - "end": [ - 81, - 97 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 81, - 97 - ], - "end": [ - 81, - 101 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 81, - 101 - ], - "end": [ - 81, - 102 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 81, - 102 - ], - "end": [ - 81, - 115 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 81, - 115 - ], - "end": [ - 81, - 116 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 81, - 116 - ], - "end": [ - 81, - 117 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 81, - 117 - ], - "end": [ - 82, - 0 - ], - "line": " log.DepositEvent(pubkey, withdrawal_credentials, amount, signature, self.to_little_endian_64(self.deposit_count))\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 82, - 0 - ], - "end": [ - 83, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Compute `DepositData` hash tree root", - "start": [ - 83, - 4 - ], - "end": [ - 83, - 42 - ], - "line": " # Compute `DepositData` hash tree root\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 83, - 42 - ], - "end": [ - 84, - 0 - ], - "line": " # Compute `DepositData` hash tree root\n" - }, - { - "typ": "NAME", - "string": "zero_bytes32", - "start": [ - 84, - 4 - ], - "end": [ - 84, - 16 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 84, - 16 - ], - "end": [ - 84, - 17 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 84, - 18 - ], - "end": [ - 84, - 25 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 84, - 26 - ], - "end": [ - 84, - 27 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NUMBER", - "string": "0x0000000000000000000000000000000000000000000000000000000000000000", - "start": [ - 84, - 28 - ], - "end": [ - 84, - 94 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 84, - 94 - ], - "end": [ - 85, - 0 - ], - "line": " zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000\n" - }, - { - "typ": "NAME", - "string": "pubkey_root", - "start": [ - 85, - 4 - ], - "end": [ - 85, - 15 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 85, - 15 - ], - "end": [ - 85, - 16 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 85, - 17 - ], - "end": [ - 85, - 24 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 85, - 25 - ], - "end": [ - 85, - 26 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 85, - 27 - ], - "end": [ - 85, - 33 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 85, - 33 - ], - "end": [ - 85, - 34 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 85, - 34 - ], - "end": [ - 85, - 40 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 85, - 40 - ], - "end": [ - 85, - 41 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "pubkey", - "start": [ - 85, - 41 - ], - "end": [ - 85, - 47 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 85, - 47 - ], - "end": [ - 85, - 48 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "slice", - "start": [ - 85, - 49 - ], - "end": [ - 85, - 54 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 85, - 54 - ], - "end": [ - 85, - 55 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "zero_bytes32", - "start": [ - 85, - 55 - ], - "end": [ - 85, - 67 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 85, - 67 - ], - "end": [ - 85, - 68 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 85, - 69 - ], - "end": [ - 85, - 74 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 85, - 74 - ], - "end": [ - 85, - 75 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 85, - 75 - ], - "end": [ - 85, - 76 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 85, - 76 - ], - "end": [ - 85, - 77 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 85, - 78 - ], - "end": [ - 85, - 81 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 85, - 81 - ], - "end": [ - 85, - 82 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NUMBER", - "string": "64", - "start": [ - 85, - 82 - ], - "end": [ - 85, - 84 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 85, - 85 - ], - "end": [ - 85, - 86 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "PUBKEY_LENGTH", - "start": [ - 85, - 87 - ], - "end": [ - 85, - 100 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 85, - 100 - ], - "end": [ - 85, - 101 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 85, - 101 - ], - "end": [ - 85, - 102 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 85, - 102 - ], - "end": [ - 85, - 103 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 85, - 103 - ], - "end": [ - 86, - 0 - ], - "line": " pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))\n" - }, - { - "typ": "NAME", - "string": "signature_root", - "start": [ - 86, - 4 - ], - "end": [ - 86, - 18 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 86, - 18 - ], - "end": [ - 86, - 19 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 86, - 20 - ], - "end": [ - 86, - 27 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 86, - 28 - ], - "end": [ - 86, - 29 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 86, - 30 - ], - "end": [ - 86, - 36 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 86, - 36 - ], - "end": [ - 86, - 37 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 86, - 37 - ], - "end": [ - 86, - 43 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 86, - 43 - ], - "end": [ - 86, - 44 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 86, - 44 - ], - "end": [ - 87, - 0 - ], - "line": " signature_root: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 87, - 8 - ], - "end": [ - 87, - 14 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 87, - 14 - ], - "end": [ - 87, - 15 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NAME", - "string": "slice", - "start": [ - 87, - 15 - ], - "end": [ - 87, - 20 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 87, - 20 - ], - "end": [ - 87, - 21 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NAME", - "string": "signature", - "start": [ - 87, - 21 - ], - "end": [ - 87, - 30 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 87, - 30 - ], - "end": [ - 87, - 31 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 87, - 32 - ], - "end": [ - 87, - 37 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 87, - 37 - ], - "end": [ - 87, - 38 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 87, - 38 - ], - "end": [ - 87, - 39 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 87, - 39 - ], - "end": [ - 87, - 40 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 87, - 41 - ], - "end": [ - 87, - 44 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 87, - 44 - ], - "end": [ - 87, - 45 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NUMBER", - "string": "64", - "start": [ - 87, - 45 - ], - "end": [ - 87, - 47 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 87, - 47 - ], - "end": [ - 87, - 48 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 87, - 48 - ], - "end": [ - 87, - 49 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 87, - 49 - ], - "end": [ - 87, - 50 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 87, - 50 - ], - "end": [ - 88, - 0 - ], - "line": " sha256(slice(signature, start=0, len=64)),\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 88, - 8 - ], - "end": [ - 88, - 14 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 88, - 14 - ], - "end": [ - 88, - 15 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 88, - 15 - ], - "end": [ - 88, - 21 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 88, - 21 - ], - "end": [ - 88, - 22 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NAME", - "string": "slice", - "start": [ - 88, - 22 - ], - "end": [ - 88, - 27 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 88, - 27 - ], - "end": [ - 88, - 28 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NAME", - "string": "signature", - "start": [ - 88, - 28 - ], - "end": [ - 88, - 37 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 88, - 37 - ], - "end": [ - 88, - 38 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 88, - 39 - ], - "end": [ - 88, - 44 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 88, - 44 - ], - "end": [ - 88, - 45 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NUMBER", - "string": "64", - "start": [ - 88, - 45 - ], - "end": [ - 88, - 47 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 88, - 47 - ], - "end": [ - 88, - 48 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 88, - 49 - ], - "end": [ - 88, - 52 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 88, - 52 - ], - "end": [ - 88, - 53 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NAME", - "string": "SIGNATURE_LENGTH", - "start": [ - 88, - 53 - ], - "end": [ - 88, - 69 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 88, - 70 - ], - "end": [ - 88, - 71 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NUMBER", - "string": "64", - "start": [ - 88, - 72 - ], - "end": [ - 88, - 74 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 88, - 74 - ], - "end": [ - 88, - 75 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 88, - 75 - ], - "end": [ - 88, - 76 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NAME", - "string": "zero_bytes32", - "start": [ - 88, - 77 - ], - "end": [ - 88, - 89 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 88, - 89 - ], - "end": [ - 88, - 90 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 88, - 90 - ], - "end": [ - 88, - 91 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 88, - 91 - ], - "end": [ - 88, - 92 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 88, - 92 - ], - "end": [ - 89, - 0 - ], - "line": " sha256(concat(slice(signature, start=64, len=SIGNATURE_LENGTH - 64), zero_bytes32)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 89, - 4 - ], - "end": [ - 89, - 5 - ], - "line": " ))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 89, - 5 - ], - "end": [ - 89, - 6 - ], - "line": " ))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 89, - 6 - ], - "end": [ - 90, - 0 - ], - "line": " ))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 90, - 4 - ], - "end": [ - 90, - 8 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 90, - 8 - ], - "end": [ - 90, - 9 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "bytes32", - "start": [ - 90, - 10 - ], - "end": [ - 90, - 17 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 90, - 18 - ], - "end": [ - 90, - 19 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 90, - 20 - ], - "end": [ - 90, - 26 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 90, - 26 - ], - "end": [ - 90, - 27 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 90, - 27 - ], - "end": [ - 90, - 33 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 90, - 33 - ], - "end": [ - 90, - 34 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 90, - 34 - ], - "end": [ - 91, - 0 - ], - "line": " node: bytes32 = sha256(concat(\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 91, - 8 - ], - "end": [ - 91, - 14 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 91, - 14 - ], - "end": [ - 91, - 15 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 91, - 15 - ], - "end": [ - 91, - 21 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 91, - 21 - ], - "end": [ - 91, - 22 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "NAME", - "string": "pubkey_root", - "start": [ - 91, - 22 - ], - "end": [ - 91, - 33 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 91, - 33 - ], - "end": [ - 91, - 34 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "NAME", - "string": "withdrawal_credentials", - "start": [ - 91, - 35 - ], - "end": [ - 91, - 57 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 91, - 57 - ], - "end": [ - 91, - 58 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 91, - 58 - ], - "end": [ - 91, - 59 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 91, - 59 - ], - "end": [ - 91, - 60 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 91, - 60 - ], - "end": [ - 92, - 0 - ], - "line": " sha256(concat(pubkey_root, withdrawal_credentials)),\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 92, - 8 - ], - "end": [ - 92, - 14 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 92, - 14 - ], - "end": [ - 92, - 15 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 92, - 15 - ], - "end": [ - 92, - 21 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 92, - 21 - ], - "end": [ - 92, - 22 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "amount", - "start": [ - 92, - 22 - ], - "end": [ - 92, - 28 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 92, - 28 - ], - "end": [ - 92, - 29 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "slice", - "start": [ - 92, - 30 - ], - "end": [ - 92, - 35 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 92, - 35 - ], - "end": [ - 92, - 36 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "zero_bytes32", - "start": [ - 92, - 36 - ], - "end": [ - 92, - 48 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 92, - 48 - ], - "end": [ - 92, - 49 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "start", - "start": [ - 92, - 50 - ], - "end": [ - 92, - 55 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 92, - 55 - ], - "end": [ - 92, - 56 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NUMBER", - "string": "0", - "start": [ - 92, - 56 - ], - "end": [ - 92, - 57 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 92, - 57 - ], - "end": [ - 92, - 58 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "len", - "start": [ - 92, - 59 - ], - "end": [ - 92, - 62 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 92, - 62 - ], - "end": [ - 92, - 63 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NUMBER", - "string": "32", - "start": [ - 92, - 63 - ], - "end": [ - 92, - 65 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": "-", - "start": [ - 92, - 66 - ], - "end": [ - 92, - 67 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "AMOUNT_LENGTH", - "start": [ - 92, - 68 - ], - "end": [ - 92, - 81 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 92, - 81 - ], - "end": [ - 92, - 82 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 92, - 82 - ], - "end": [ - 92, - 83 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NAME", - "string": "signature_root", - "start": [ - 92, - 84 - ], - "end": [ - 92, - 98 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 92, - 98 - ], - "end": [ - 92, - 99 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 92, - 99 - ], - "end": [ - 92, - 100 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 92, - 100 - ], - "end": [ - 92, - 101 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 92, - 101 - ], - "end": [ - 93, - 0 - ], - "line": " sha256(concat(amount, slice(zero_bytes32, start=0, len=32 - AMOUNT_LENGTH), signature_root)),\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 93, - 4 - ], - "end": [ - 93, - 5 - ], - "line": " ))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 93, - 5 - ], - "end": [ - 93, - 6 - ], - "line": " ))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 93, - 6 - ], - "end": [ - 94, - 0 - ], - "line": " ))\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 94, - 0 - ], - "end": [ - 95, - 0 - ], - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Add `DepositData` hash tree root to Merkle tree (update a single `branch` node)", - "start": [ - 95, - 4 - ], - "end": [ - 95, - 85 - ], - "line": " # Add `DepositData` hash tree root to Merkle tree (update a single `branch` node)\n" - }, - { - "typ": "NL", - "string": "\n", - "start": [ - 95, - 85 - ], - "end": [ - 96, - 0 - ], - "line": " # Add `DepositData` hash tree root to Merkle tree (update a single `branch` node)\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 96, - 4 - ], - "end": [ - 96, - 8 - ], - "line": " self.deposit_count += 1\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 96, - 8 - ], - "end": [ - 96, - 9 - ], - "line": " self.deposit_count += 1\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 96, - 9 - ], - "end": [ - 96, - 22 - ], - "line": " self.deposit_count += 1\n" - }, - { - "typ": "OP", - "string": "+=", - "start": [ - 96, - 23 - ], - "end": [ - 96, - 25 - ], - "line": " self.deposit_count += 1\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 96, - 26 - ], - "end": [ - 96, - 27 - ], - "line": " self.deposit_count += 1\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 96, - 27 - ], - "end": [ - 97, - 0 - ], - "line": " self.deposit_count += 1\n" - }, - { - "typ": "NAME", - "string": "size", - "start": [ - 97, - 4 - ], - "end": [ - 97, - 8 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 97, - 8 - ], - "end": [ - 97, - 9 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "u256", - "start": [ - 97, - 10 - ], - "end": [ - 97, - 14 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 97, - 15 - ], - "end": [ - 97, - 16 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 97, - 17 - ], - "end": [ - 97, - 21 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 97, - 21 - ], - "end": [ - 97, - 22 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "deposit_count", - "start": [ - 97, - 22 - ], - "end": [ - 97, - 35 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 97, - 35 - ], - "end": [ - 98, - 0 - ], - "line": " size: u256 = self.deposit_count\n" - }, - { - "typ": "NAME", - "string": "for", - "start": [ - 98, - 4 - ], - "end": [ - 98, - 7 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "height", - "start": [ - 98, - 8 - ], - "end": [ - 98, - 14 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "in", - "start": [ - 98, - 15 - ], - "end": [ - 98, - 17 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "range", - "start": [ - 98, - 18 - ], - "end": [ - 98, - 23 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 98, - 23 - ], - "end": [ - 98, - 24 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NAME", - "string": "DEPOSIT_CONTRACT_TREE_DEPTH", - "start": [ - 98, - 24 - ], - "end": [ - 98, - 51 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 98, - 51 - ], - "end": [ - 98, - 52 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 98, - 52 - ], - "end": [ - 98, - 53 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 98, - 53 - ], - "end": [ - 99, - 0 - ], - "line": " for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 99, - 0 - ], - "end": [ - 99, - 8 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NAME", - "string": "if", - "start": [ - 99, - 8 - ], - "end": [ - 99, - 10 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NAME", - "string": "bitwise_and", - "start": [ - 99, - 11 - ], - "end": [ - 99, - 22 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 99, - 22 - ], - "end": [ - 99, - 23 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NAME", - "string": "size", - "start": [ - 99, - 23 - ], - "end": [ - 99, - 27 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 99, - 27 - ], - "end": [ - 99, - 28 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 99, - 29 - ], - "end": [ - 99, - 30 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 99, - 30 - ], - "end": [ - 99, - 31 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": "==", - "start": [ - 99, - 32 - ], - "end": [ - 99, - 34 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NUMBER", - "string": "1", - "start": [ - 99, - 35 - ], - "end": [ - 99, - 36 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "OP", - "string": ":", - "start": [ - 99, - 36 - ], - "end": [ - 99, - 37 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "COMMENT", - "string": "# More gas efficient than `size % 2 == 1`", - "start": [ - 99, - 39 - ], - "end": [ - 99, - 80 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 99, - 80 - ], - "end": [ - 100, - 0 - ], - "line": " if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`\n" - }, - { - "typ": "INDENT", - "string": " ", - "start": [ - 100, - 0 - ], - "end": [ - 100, - 12 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 100, - 12 - ], - "end": [ - 100, - 16 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 100, - 16 - ], - "end": [ - 100, - 17 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "NAME", - "string": "branch", - "start": [ - 100, - 17 - ], - "end": [ - 100, - 23 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 100, - 23 - ], - "end": [ - 100, - 24 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "NAME", - "string": "height", - "start": [ - 100, - 24 - ], - "end": [ - 100, - 30 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 100, - 30 - ], - "end": [ - 100, - 31 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 100, - 32 - ], - "end": [ - 100, - 33 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 100, - 34 - ], - "end": [ - 100, - 38 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 100, - 38 - ], - "end": [ - 101, - 0 - ], - "line": " self.branch[height] = node\n" - }, - { - "typ": "NAME", - "string": "break", - "start": [ - 101, - 12 - ], - "end": [ - 101, - 17 - ], - "line": " break\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 101, - 17 - ], - "end": [ - 102, - 0 - ], - "line": " break\n" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 102, - 8 - ], - "end": [ - 102, - 8 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 102, - 8 - ], - "end": [ - 102, - 12 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 102, - 13 - ], - "end": [ - 102, - 14 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "sha256", - "start": [ - 102, - 15 - ], - "end": [ - 102, - 21 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 102, - 21 - ], - "end": [ - 102, - 22 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "concat", - "start": [ - 102, - 22 - ], - "end": [ - 102, - 28 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "(", - "start": [ - 102, - 28 - ], - "end": [ - 102, - 29 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "self", - "start": [ - 102, - 29 - ], - "end": [ - 102, - 33 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ".", - "start": [ - 102, - 33 - ], - "end": [ - 102, - 34 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "branch", - "start": [ - 102, - 34 - ], - "end": [ - 102, - 40 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "[", - "start": [ - 102, - 40 - ], - "end": [ - 102, - 41 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "height", - "start": [ - 102, - 41 - ], - "end": [ - 102, - 47 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": "]", - "start": [ - 102, - 47 - ], - "end": [ - 102, - 48 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ",", - "start": [ - 102, - 48 - ], - "end": [ - 102, - 49 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "node", - "start": [ - 102, - 50 - ], - "end": [ - 102, - 54 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 102, - 54 - ], - "end": [ - 102, - 55 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "OP", - "string": ")", - "start": [ - 102, - 55 - ], - "end": [ - 102, - 56 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "start": [ - 102, - 56 - ], - "end": [ - 103, - 0 - ], - "line": " node = sha256(concat(self.branch[height], node))\n" - }, - { - "typ": "NAME", - "string": "size", - "start": [ - 103, - 8 - ], - "end": [ - 103, - 12 - ], - "line": " size /= 2" - }, - { - "typ": "OP", - "string": "/=", - "start": [ - 103, - 13 - ], - "end": [ - 103, - 15 - ], - "line": " size /= 2" - }, - { - "typ": "NUMBER", - "string": "2", - "start": [ - 103, - 16 - ], - "end": [ - 103, - 17 - ], - "line": " size /= 2" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 103, - 17 - ], - "end": [ - 103, - 17 - ], - "line": "" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 103, - 17 - ], - "end": [ - 103, - 17 - ], - "line": "" - }, - { - "typ": "DEDENT", - "string": "", - "start": [ - 103, - 17 - ], - "end": [ - 103, - 17 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 103, - 17 - ], - "end": [ - 103, - 17 - ], - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/wasm/basic.py.json b/parser/tests/fixtures/tokenizer/wasm/basic.py.json deleted file mode 100644 index e8de7c9d70..0000000000 --- a/parser/tests/fixtures/tokenizer/wasm/basic.py.json +++ /dev/null @@ -1,336 +0,0 @@ - -# Test comment -class TestClassDefinition(WithParent1, WithParent2): - foo = 'bar' - - def foo(): - return 'bar' - -test = 'foo' ---- -[ - { - "typ": "NL", - "string": "\n", - "span": { - "start": 0, - "end": 1 - }, - "line": "\n" - }, - { - "typ": "COMMENT", - "string": "# Test comment", - "span": { - "start": 1, - "end": 15 - }, - "line": "# Test comment\n" - }, - { - "typ": "NL", - "string": "\n", - "span": { - "start": 15, - "end": 16 - }, - "line": "# Test comment\n" - }, - { - "typ": "NAME", - "string": "class", - "span": { - "start": 16, - "end": 21 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NAME", - "string": "TestClassDefinition", - "span": { - "start": 22, - "end": 41 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": "(", - "span": { - "start": 41, - "end": 42 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NAME", - "string": "WithParent1", - "span": { - "start": 42, - "end": 53 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": ",", - "span": { - "start": 53, - "end": 54 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NAME", - "string": "WithParent2", - "span": { - "start": 55, - "end": 66 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": ")", - "span": { - "start": 66, - "end": 67 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "OP", - "string": ":", - "span": { - "start": 67, - "end": 68 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "span": { - "start": 68, - "end": 69 - }, - "line": "class TestClassDefinition(WithParent1, WithParent2):\n" - }, - { - "typ": "INDENT", - "string": " ", - "span": { - "start": 69, - "end": 73 - }, - "line": " foo = 'bar'\n" - }, - { - "typ": "NAME", - "string": "foo", - "span": { - "start": 73, - "end": 76 - }, - "line": " foo = 'bar'\n" - }, - { - "typ": "OP", - "string": "=", - "span": { - "start": 77, - "end": 78 - }, - "line": " foo = 'bar'\n" - }, - { - "typ": "STRING", - "string": "'bar'", - "span": { - "start": 79, - "end": 84 - }, - "line": " foo = 'bar'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "span": { - "start": 84, - "end": 85 - }, - "line": " foo = 'bar'\n" - }, - { - "typ": "NL", - "string": "\n", - "span": { - "start": 85, - "end": 86 - }, - "line": "\n" - }, - { - "typ": "NAME", - "string": "def", - "span": { - "start": 90, - "end": 93 - }, - "line": " def foo():\n" - }, - { - "typ": "NAME", - "string": "foo", - "span": { - "start": 94, - "end": 97 - }, - "line": " def foo():\n" - }, - { - "typ": "OP", - "string": "(", - "span": { - "start": 97, - "end": 98 - }, - "line": " def foo():\n" - }, - { - "typ": "OP", - "string": ")", - "span": { - "start": 98, - "end": 99 - }, - "line": " def foo():\n" - }, - { - "typ": "OP", - "string": ":", - "span": { - "start": 99, - "end": 100 - }, - "line": " def foo():\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "span": { - "start": 100, - "end": 101 - }, - "line": " def foo():\n" - }, - { - "typ": "INDENT", - "string": " ", - "span": { - "start": 101, - "end": 109 - }, - "line": " return 'bar'\n" - }, - { - "typ": "NAME", - "string": "return", - "span": { - "start": 109, - "end": 115 - }, - "line": " return 'bar'\n" - }, - { - "typ": "STRING", - "string": "'bar'", - "span": { - "start": 116, - "end": 121 - }, - "line": " return 'bar'\n" - }, - { - "typ": "NEWLINE", - "string": "\n", - "span": { - "start": 121, - "end": 122 - }, - "line": " return 'bar'\n" - }, - { - "typ": "NL", - "string": "\n", - "span": { - "start": 122, - "end": 123 - }, - "line": "\n" - }, - { - "typ": "DEDENT", - "string": "", - "span": { - "start": 123, - "end": 123 - }, - "line": "test = 'foo'" - }, - { - "typ": "DEDENT", - "string": "", - "span": { - "start": 123, - "end": 123 - }, - "line": "test = 'foo'" - }, - { - "typ": "NAME", - "string": "test", - "span": { - "start": 123, - "end": 127 - }, - "line": "test = 'foo'" - }, - { - "typ": "OP", - "string": "=", - "span": { - "start": 128, - "end": 129 - }, - "line": "test = 'foo'" - }, - { - "typ": "STRING", - "string": "'foo'", - "span": { - "start": 130, - "end": 135 - }, - "line": "test = 'foo'" - }, - { - "typ": "NEWLINE", - "string": "", - "span": { - "start": 135, - "end": 135 - }, - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "span": { - "start": 135, - "end": 135 - }, - "line": "" - } -] diff --git a/parser/tests/fixtures/tokenizer/zero_length_pseudotoken.py.json b/parser/tests/fixtures/tokenizer/zero_length_pseudotoken.py.json deleted file mode 100644 index 6de661ced3..0000000000 --- a/parser/tests/fixtures/tokenizer/zero_length_pseudotoken.py.json +++ /dev/null @@ -1,83 +0,0 @@ -x = 3 + \ - ---- -[ - { - "typ": "NAME", - "string": "x", - "start": [ - 1, - 0 - ], - "end": [ - 1, - 1 - ], - "line": "x = 3 + \\\n" - }, - { - "typ": "OP", - "string": "=", - "start": [ - 1, - 2 - ], - "end": [ - 1, - 3 - ], - "line": "x = 3 + \\\n" - }, - { - "typ": "NUMBER", - "string": "3", - "start": [ - 1, - 4 - ], - "end": [ - 1, - 5 - ], - "line": "x = 3 + \\\n" - }, - { - "typ": "OP", - "string": "+", - "start": [ - 1, - 6 - ], - "end": [ - 1, - 7 - ], - "line": "x = 3 + \\\n" - }, - { - "typ": "NEWLINE", - "string": "", - "start": [ - 2, - 2 - ], - "end": [ - 2, - 2 - ], - "line": "" - }, - { - "typ": "ENDMARKER", - "string": "", - "start": [ - 2, - 2 - ], - "end": [ - 2, - 2 - ], - "line": "" - } -] diff --git a/parser/tests/snapshots/errors__contract_bad_name.snap b/parser/tests/snapshots/errors__contract_bad_name.snap index d2c33159f8..93ecfc7849 100644 --- a/parser/tests/snapshots/errors__contract_bad_name.snap +++ b/parser/tests/snapshots/errors__contract_bad_name.snap @@ -4,7 +4,7 @@ expression: err --- error: failed to parse contract definition - ┌─ [test snippet]:1:10 + ┌─ contract_bad_name:1:10 │ 1 │ contract 1X: │ ^ Unexpected token. Expected a name diff --git a/parser/tests/snapshots/errors__contract_const_fn.snap b/parser/tests/snapshots/errors__contract_const_fn.snap index bc3b729c9d..5bcf02d5b6 100644 --- a/parser/tests/snapshots/errors__contract_const_fn.snap +++ b/parser/tests/snapshots/errors__contract_const_fn.snap @@ -4,7 +4,7 @@ expression: err --- error: `const` qualifier can't be used with function definitions - ┌─ [test snippet]:2:2 + ┌─ contract_const_fn:2:2 │ 2 │ const def f(): │ ^^^^^ diff --git a/parser/tests/snapshots/errors__contract_const_pub.snap b/parser/tests/snapshots/errors__contract_const_pub.snap index 740af03981..0628f0cafa 100644 --- a/parser/tests/snapshots/errors__contract_const_pub.snap +++ b/parser/tests/snapshots/errors__contract_const_pub.snap @@ -4,7 +4,7 @@ expression: err --- error: `const pub` should be written `pub const` - ┌─ [test snippet]:2:2 + ┌─ contract_const_pub:2:2 │ 2 │ const pub x: u8 │ ^^^^^^^^^ diff --git a/parser/tests/snapshots/errors__contract_empty_body.snap b/parser/tests/snapshots/errors__contract_empty_body.snap index a8b2d9b18c..341a23247e 100644 --- a/parser/tests/snapshots/errors__contract_empty_body.snap +++ b/parser/tests/snapshots/errors__contract_empty_body.snap @@ -4,7 +4,7 @@ expression: err --- error: failed to parse contract definition body - ┌─ [test snippet]:1:1 + ┌─ contract_empty_body:1:1 │ 1 │ contract X: │ ^^^^^^^^^^^ the body of this contract definition must be indented and non-empty diff --git a/parser/tests/snapshots/errors__contract_field_after_def.snap b/parser/tests/snapshots/errors__contract_field_after_def.snap index be1a859d09..771525e9df 100644 --- a/parser/tests/snapshots/errors__contract_field_after_def.snap +++ b/parser/tests/snapshots/errors__contract_field_after_def.snap @@ -4,7 +4,7 @@ expression: err --- error: contract field definitions must come before any function or event definitions - ┌─ [test snippet]:5:3 + ┌─ contract_field_after_def:5:3 │ 5 │ x: u8 │ ^^^^^ diff --git a/parser/tests/snapshots/errors__contract_pub_event.snap b/parser/tests/snapshots/errors__contract_pub_event.snap index 29d074127b..5000bf351f 100644 --- a/parser/tests/snapshots/errors__contract_pub_event.snap +++ b/parser/tests/snapshots/errors__contract_pub_event.snap @@ -4,7 +4,7 @@ expression: err --- error: `pub` qualifier can't be used with event definitions - ┌─ [test snippet]:2:2 + ┌─ contract_pub_event:2:2 │ 2 │ pub event E: │ ^^^ diff --git a/parser/tests/snapshots/errors__emit_bad_call.snap b/parser/tests/snapshots/errors__emit_bad_call.snap index 80800d8b4c..03347006dd 100644 --- a/parser/tests/snapshots/errors__emit_bad_call.snap +++ b/parser/tests/snapshots/errors__emit_bad_call.snap @@ -1,10 +1,10 @@ --- source: parser/tests/errors.rs -expression: "err_string(parse_emit_statement, true, \"emit MyEvent(1)()\")" +expression: err --- error: unexpected token while parsing emit statement - ┌─ [test snippet]:1:16 + ┌─ emit_bad_call:1:16 │ 1 │ emit MyEvent(1)() │ ^ unexpected token diff --git a/parser/tests/snapshots/errors__emit_expr.snap b/parser/tests/snapshots/errors__emit_expr.snap index 82baddb2eb..bab589b772 100644 --- a/parser/tests/snapshots/errors__emit_expr.snap +++ b/parser/tests/snapshots/errors__emit_expr.snap @@ -1,10 +1,10 @@ --- source: parser/tests/errors.rs -expression: "err_string(parse_emit_statement, true, \"emit x + 1\")" +expression: err --- error: failed to parse event invocation parameter list - ┌─ [test snippet]:1:8 + ┌─ emit_expr:1:8 │ 1 │ emit x + 1 │ ^ Unexpected token. Expected `(` diff --git a/parser/tests/snapshots/errors__emit_no_args.snap b/parser/tests/snapshots/errors__emit_no_args.snap index 767e5f1ba3..49323b826b 100644 --- a/parser/tests/snapshots/errors__emit_no_args.snap +++ b/parser/tests/snapshots/errors__emit_no_args.snap @@ -1,10 +1,10 @@ --- source: parser/tests/errors.rs -expression: "err_string(parse_emit_statement, true, \"emit x\")" +expression: err --- error: unexpected end of file - ┌─ [test snippet]:1:7 + ┌─ emit_no_args:1:7 │ 1 │ emit x │ ^ diff --git a/parser/tests/snapshots/errors__expr_bad_prefix.snap b/parser/tests/snapshots/errors__expr_bad_prefix.snap index 0c604cb383..90b8488174 100644 --- a/parser/tests/snapshots/errors__expr_bad_prefix.snap +++ b/parser/tests/snapshots/errors__expr_bad_prefix.snap @@ -4,7 +4,7 @@ expression: err --- error: Unexpected token while parsing expression: `*` - ┌─ [test snippet]:1:1 + ┌─ expr_bad_prefix:1:1 │ 1 │ *x + 1 │ ^ unexpected token diff --git a/parser/tests/snapshots/errors__fn_no_args.snap b/parser/tests/snapshots/errors__fn_no_args.snap index 68425e40f2..619e66c4ab 100644 --- a/parser/tests/snapshots/errors__fn_no_args.snap +++ b/parser/tests/snapshots/errors__fn_no_args.snap @@ -1,10 +1,10 @@ --- source: parser/tests/errors.rs -expression: "err_string(|par| functions::parse_fn_def(par, None), false,\n \"def f:\\n return 5\")" +expression: err --- error: function definition requires a list of parameters - ┌─ [test snippet]:1:5 + ┌─ fn_no_args:1:5 │ 1 │ def f: │ ^ function name must be followed by `(` diff --git a/parser/tests/snapshots/errors__for_no_in.snap b/parser/tests/snapshots/errors__for_no_in.snap index f0096a9179..5b2328a469 100644 --- a/parser/tests/snapshots/errors__for_no_in.snap +++ b/parser/tests/snapshots/errors__for_no_in.snap @@ -4,7 +4,7 @@ expression: err --- error: failed to parse `for` statement - ┌─ [test snippet]:1:6 + ┌─ for_no_in:1:6 │ 1 │ for x: │ ^ Unexpected token. Expected `in` diff --git a/parser/tests/snapshots/errors__if_no_body.snap b/parser/tests/snapshots/errors__if_no_body.snap index 0162fcd9c4..a4136fd1a3 100644 --- a/parser/tests/snapshots/errors__if_no_body.snap +++ b/parser/tests/snapshots/errors__if_no_body.snap @@ -4,7 +4,7 @@ expression: err --- error: failed to parse `if` statement body - ┌─ [test snippet]:1:1 + ┌─ if_no_body:1:1 │ 1 │ if x: │ ^^^^^ the body of this `if` statement must be indented and non-empty diff --git a/parser/tests/snapshots/errors__import_bad_name.snap b/parser/tests/snapshots/errors__import_bad_name.snap index e7bc44b175..c88a3b34cd 100644 --- a/parser/tests/snapshots/errors__import_bad_name.snap +++ b/parser/tests/snapshots/errors__import_bad_name.snap @@ -4,7 +4,7 @@ expression: err --- error: failed to parse import statement - ┌─ [test snippet]:1:13 + ┌─ import_bad_name:1:13 │ 1 │ import x as 123 │ ^^^ Unexpected token. Expected a name diff --git a/parser/tests/snapshots/errors__module_bad_stmt.snap b/parser/tests/snapshots/errors__module_bad_stmt.snap index 69d138deb7..67d04f5616 100644 --- a/parser/tests/snapshots/errors__module_bad_stmt.snap +++ b/parser/tests/snapshots/errors__module_bad_stmt.snap @@ -4,7 +4,7 @@ expression: err --- error: failed to parse module - ┌─ [test snippet]:1:1 + ┌─ module_bad_stmt:1:1 │ 1 │ if x: │ ^^ unexpected token diff --git a/parser/tests/snapshots/errors__module_nonsense.snap b/parser/tests/snapshots/errors__module_nonsense.snap index 0d38bcdf9c..e62d84e068 100644 --- a/parser/tests/snapshots/errors__module_nonsense.snap +++ b/parser/tests/snapshots/errors__module_nonsense.snap @@ -4,7 +4,7 @@ expression: err --- error: Unmatched right parenthesis - ┌─ [test snippet]:1:1 + ┌─ module_nonsense:1:1 │ 1 │ )) │ ^ diff --git a/parser/tests/snapshots/errors__string_invalid_escape.snap b/parser/tests/snapshots/errors__string_invalid_escape.snap index b2c363011e..939510286a 100644 --- a/parser/tests/snapshots/errors__string_invalid_escape.snap +++ b/parser/tests/snapshots/errors__string_invalid_escape.snap @@ -4,7 +4,7 @@ expression: err --- error: String contains an invalid escape sequence - ┌─ [test snippet]:1:1 + ┌─ string_invalid_escape:1:1 │ 1 │ "a string \c " │ ^^^^^^^^^^^^^^ diff --git a/parser/tests/snapshots/errors__struct_bad_field_name.snap b/parser/tests/snapshots/errors__struct_bad_field_name.snap index 08d2ac50ba..0d031b7031 100644 --- a/parser/tests/snapshots/errors__struct_bad_field_name.snap +++ b/parser/tests/snapshots/errors__struct_bad_field_name.snap @@ -4,7 +4,7 @@ expression: err --- error: failed to parse field definition - ┌─ [test snippet]:2:6 + ┌─ struct_bad_field_name:2:6 │ 2 │ pub def │ ^^^ Unexpected token. Expected a name diff --git a/parser/tests/snapshots/test_parser__contract_def.snap b/parser/tests/snapshots/test_parser__contract_def.snap new file mode 100644 index 0000000000..bec227da19 --- /dev/null +++ b/parser/tests/snapshots/test_parser__contract_def.snap @@ -0,0 +1,237 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(contract_def), contracts::parse_contract_def,\n r#\"contract Foo:\n x: address\n pub y: u8\n pub const z: map\n pub def foo() -> u8:\n return 10\n event Bar:\n idx from: address\n\"#)" + +--- +Node( + kind: ContractDef( + name: Node( + kind: "Foo", + span: Span( + start: 9, + end: 12, + ), + ), + fields: [ + Node( + kind: Field( + pub_qual: None, + const_qual: None, + name: Node( + kind: "x", + span: Span( + start: 16, + end: 17, + ), + ), + typ: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 19, + end: 26, + ), + ), + value: None, + ), + span: Span( + start: 16, + end: 26, + ), + ), + Node( + kind: Field( + pub_qual: Some(Node( + kind: PubQualifier(), + span: Span( + start: 29, + end: 32, + ), + )), + const_qual: None, + name: Node( + kind: "y", + span: Span( + start: 33, + end: 34, + ), + ), + typ: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 36, + end: 38, + ), + ), + value: None, + ), + span: Span( + start: 29, + end: 38, + ), + ), + Node( + kind: Field( + pub_qual: Some(Node( + kind: PubQualifier(), + span: Span( + start: 41, + end: 44, + ), + )), + const_qual: Some(Node( + kind: ConstQualifier(), + span: Span( + start: 45, + end: 50, + ), + )), + name: Node( + kind: "z", + span: Span( + start: 51, + end: 52, + ), + ), + typ: Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 58, + end: 60, + ), + ), + to: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 62, + end: 69, + ), + ), + ), + span: Span( + start: 54, + end: 70, + ), + ), + value: None, + ), + span: Span( + start: 41, + end: 70, + ), + ), + ], + body: [ + Node( + kind: FuncDef( + pub_qual: Some(Node( + kind: PubQualifier(), + span: Span( + start: 73, + end: 76, + ), + )), + name: Node( + kind: "foo", + span: Span( + start: 81, + end: 84, + ), + ), + args: [], + return_type: Some(Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 90, + end: 92, + ), + )), + body: [ + Node( + kind: Return( + value: Some(Node( + kind: Num("10"), + span: Span( + start: 105, + end: 107, + ), + )), + ), + span: Span( + start: 98, + end: 107, + ), + ), + ], + ), + span: Span( + start: 73, + end: 107, + ), + ), + Node( + kind: EventDef( + name: Node( + kind: "Bar", + span: Span( + start: 116, + end: 119, + ), + ), + fields: [ + Node( + kind: EventField( + idx_qual: Some(Node( + kind: IdxQualifier(), + span: Span( + start: 125, + end: 128, + ), + )), + name: Node( + kind: "from", + span: Span( + start: 129, + end: 133, + ), + ), + typ: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 135, + end: 142, + ), + ), + ), + span: Span( + start: 125, + end: 142, + ), + ), + ], + ), + span: Span( + start: 110, + end: 142, + ), + ), + ], + ), + span: Span( + start: 0, + end: 142, + ), +) diff --git a/parser/tests/snapshots/test_parser__event_def.snap b/parser/tests/snapshots/test_parser__event_def.snap new file mode 100644 index 0000000000..6e503d2409 --- /dev/null +++ b/parser/tests/snapshots/test_parser__event_def.snap @@ -0,0 +1,78 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(event_def), types::parse_event_def,\n \"event Foo:\\n x: address\\n idx y: u8\")" + +--- +Node( + kind: EventDef( + name: Node( + kind: "Foo", + span: Span( + start: 6, + end: 9, + ), + ), + fields: [ + Node( + kind: EventField( + idx_qual: None, + name: Node( + kind: "x", + span: Span( + start: 13, + end: 14, + ), + ), + typ: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 16, + end: 23, + ), + ), + ), + span: Span( + start: 13, + end: 23, + ), + ), + Node( + kind: EventField( + idx_qual: Some(Node( + kind: IdxQualifier(), + span: Span( + start: 26, + end: 29, + ), + )), + name: Node( + kind: "y", + span: Span( + start: 30, + end: 31, + ), + ), + typ: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 33, + end: 35, + ), + ), + ), + span: Span( + start: 26, + end: 35, + ), + ), + ], + ), + span: Span( + start: 0, + end: 35, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_attr1.snap b/parser/tests/snapshots/test_parser__expr_attr1.snap new file mode 100644 index 0000000000..56caf1dd50 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_attr1.snap @@ -0,0 +1,85 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_attr1), expressions::parse_expr, \"foo.bar[0][y]\")" + +--- +Node( + kind: Subscript( + value: Node( + kind: Subscript( + value: Node( + kind: Attribute( + value: Node( + kind: Name("foo"), + span: Span( + start: 0, + end: 3, + ), + ), + attr: Node( + kind: "bar", + span: Span( + start: 4, + end: 7, + ), + ), + ), + span: Span( + start: 0, + end: 7, + ), + ), + slices: Node( + kind: [ + Node( + kind: Index(Node( + kind: Num("0"), + span: Span( + start: 8, + end: 9, + ), + )), + span: Span( + start: 8, + end: 9, + ), + ), + ], + span: Span( + start: 7, + end: 10, + ), + ), + ), + span: Span( + start: 0, + end: 10, + ), + ), + slices: Node( + kind: [ + Node( + kind: Index(Node( + kind: Name("y"), + span: Span( + start: 11, + end: 12, + ), + )), + span: Span( + start: 11, + end: 12, + ), + ), + ], + span: Span( + start: 10, + end: 13, + ), + ), + ), + span: Span( + start: 0, + end: 13, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_attr2.snap b/parser/tests/snapshots/test_parser__expr_attr2.snap new file mode 100644 index 0000000000..5161ab15e5 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_attr2.snap @@ -0,0 +1,114 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_attr2), expressions::parse_expr, \"a[x].b[y](1)\")" + +--- +Node( + kind: Call( + func: Node( + kind: Subscript( + value: Node( + kind: Attribute( + value: Node( + kind: Subscript( + value: Node( + kind: Name("a"), + span: Span( + start: 0, + end: 1, + ), + ), + slices: Node( + kind: [ + Node( + kind: Index(Node( + kind: Name("x"), + span: Span( + start: 2, + end: 3, + ), + )), + span: Span( + start: 2, + end: 3, + ), + ), + ], + span: Span( + start: 1, + end: 4, + ), + ), + ), + span: Span( + start: 0, + end: 4, + ), + ), + attr: Node( + kind: "b", + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), + ), + slices: Node( + kind: [ + Node( + kind: Index(Node( + kind: Name("y"), + span: Span( + start: 7, + end: 8, + ), + )), + span: Span( + start: 7, + end: 8, + ), + ), + ], + span: Span( + start: 6, + end: 9, + ), + ), + ), + span: Span( + start: 0, + end: 9, + ), + ), + args: Node( + kind: [ + Node( + kind: Arg(Node( + kind: Num("1"), + span: Span( + start: 10, + end: 11, + ), + )), + span: Span( + start: 10, + end: 11, + ), + ), + ], + span: Span( + start: 9, + end: 12, + ), + ), + ), + span: Span( + start: 0, + end: 12, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_call1.snap b/parser/tests/snapshots/test_parser__expr_call1.snap new file mode 100644 index 0000000000..ad0f11d26a --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_call1.snap @@ -0,0 +1,27 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_call1), expressions::parse_expr, \"foo()\")" + +--- +Node( + kind: Call( + func: Node( + kind: Name("foo"), + span: Span( + start: 0, + end: 3, + ), + ), + args: Node( + kind: [], + span: Span( + start: 3, + end: 5, + ), + ), + ), + span: Span( + start: 0, + end: 5, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_call2.snap b/parser/tests/snapshots/test_parser__expr_call2.snap new file mode 100644 index 0000000000..01a773d215 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_call2.snap @@ -0,0 +1,76 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_call2), expressions::parse_expr, \"foo(1,2,x=3)\")" + +--- +Node( + kind: Call( + func: Node( + kind: Name("foo"), + span: Span( + start: 0, + end: 3, + ), + ), + args: Node( + kind: [ + Node( + kind: Arg(Node( + kind: Num("1"), + span: Span( + start: 4, + end: 5, + ), + )), + span: Span( + start: 4, + end: 5, + ), + ), + Node( + kind: Arg(Node( + kind: Num("2"), + span: Span( + start: 6, + end: 7, + ), + )), + span: Span( + start: 6, + end: 7, + ), + ), + Node( + kind: Kwarg(Kwarg( + name: Node( + kind: "x", + span: Span( + start: 8, + end: 9, + ), + ), + value: Node( + kind: Num("3"), + span: Span( + start: 10, + end: 11, + ), + ), + )), + span: Span( + start: 8, + end: 11, + ), + ), + ], + span: Span( + start: 3, + end: 12, + ), + ), + ), + span: Span( + start: 0, + end: 12, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_group.snap b/parser/tests/snapshots/test_parser__expr_group.snap new file mode 100644 index 0000000000..cd66fd3d73 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_group.snap @@ -0,0 +1,56 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_group), expressions::parse_expr, \"(1 + 2) * 3\")" + +--- +Node( + kind: BinOperation( + left: Node( + kind: BinOperation( + left: Node( + kind: Num("1"), + span: Span( + start: 1, + end: 2, + ), + ), + op: Node( + kind: Add, + span: Span( + start: 3, + end: 4, + ), + ), + right: Node( + kind: Num("2"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 7, + ), + ), + op: Node( + kind: Mult, + span: Span( + start: 8, + end: 9, + ), + ), + right: Node( + kind: Num("3"), + span: Span( + start: 10, + end: 11, + ), + ), + ), + span: Span( + start: 0, + end: 11, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_hex1.snap b/parser/tests/snapshots/test_parser__expr_hex1.snap new file mode 100644 index 0000000000..9cb9745088 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_hex1.snap @@ -0,0 +1,12 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_hex1), expressions::parse_expr, \"0xbeefbeef\")" + +--- +Node( + kind: Num("0xbeefbeef"), + span: Span( + start: 0, + end: 10, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_hex2.snap b/parser/tests/snapshots/test_parser__expr_hex2.snap new file mode 100644 index 0000000000..4746ac041a --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_hex2.snap @@ -0,0 +1,12 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_hex2), expressions::parse_expr, \"0xFEED1234\")" + +--- +Node( + kind: Num("0xFEED1234"), + span: Span( + start: 0, + end: 10, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_list.snap b/parser/tests/snapshots/test_parser__expr_list.snap new file mode 100644 index 0000000000..312c84ad17 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_list.snap @@ -0,0 +1,14 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_list), expressions::parse_expr, \"[]\")" + +--- +Node( + kind: List( + elts: [], + ), + span: Span( + start: 0, + end: 2, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_list2.snap b/parser/tests/snapshots/test_parser__expr_list2.snap new file mode 100644 index 0000000000..1a1e1905a9 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_list2.snap @@ -0,0 +1,36 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_list2), expressions::parse_expr, \"[x, y, z,]\")" + +--- +Node( + kind: List( + elts: [ + Node( + kind: Name("x"), + span: Span( + start: 1, + end: 2, + ), + ), + Node( + kind: Name("y"), + span: Span( + start: 4, + end: 5, + ), + ), + Node( + kind: Name("z"), + span: Span( + start: 7, + end: 8, + ), + ), + ], + ), + span: Span( + start: 0, + end: 10, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_num1.snap b/parser/tests/snapshots/test_parser__expr_num1.snap new file mode 100644 index 0000000000..3928b054de --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_num1.snap @@ -0,0 +1,12 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_num1), expressions::parse_expr, \"12345\")" + +--- +Node( + kind: Num("12345"), + span: Span( + start: 0, + end: 5, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_num2.snap b/parser/tests/snapshots/test_parser__expr_num2.snap new file mode 100644 index 0000000000..13085d9071 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_num2.snap @@ -0,0 +1,12 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_num2), expressions::parse_expr, \"00001\")" + +--- +Node( + kind: Num("00001"), + span: Span( + start: 0, + end: 5, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_string.snap b/parser/tests/snapshots/test_parser__expr_string.snap new file mode 100644 index 0000000000..fa2b24e07d --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_string.snap @@ -0,0 +1,14 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_string), expressions::parse_expr,\n r#\"\"hi \\tmom\\n\"\"#)" + +--- +Node( + kind: Str([ + "hi \tmom\n", + ]), + span: Span( + start: 0, + end: 12, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_ternary.snap b/parser/tests/snapshots/test_parser__expr_ternary.snap new file mode 100644 index 0000000000..19df25bc2a --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_ternary.snap @@ -0,0 +1,100 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_ternary), expressions::parse_expr,\n \"x + 1 if y + 2 else z + 3\")" + +--- +Node( + kind: Ternary( + if_expr: Node( + kind: BinOperation( + left: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Add, + span: Span( + start: 2, + end: 3, + ), + ), + right: Node( + kind: Num("1"), + span: Span( + start: 4, + end: 5, + ), + ), + ), + span: Span( + start: 0, + end: 5, + ), + ), + test: Node( + kind: BinOperation( + left: Node( + kind: Name("y"), + span: Span( + start: 9, + end: 10, + ), + ), + op: Node( + kind: Add, + span: Span( + start: 11, + end: 12, + ), + ), + right: Node( + kind: Num("2"), + span: Span( + start: 13, + end: 14, + ), + ), + ), + span: Span( + start: 9, + end: 14, + ), + ), + else_expr: Node( + kind: BinOperation( + left: Node( + kind: Name("z"), + span: Span( + start: 20, + end: 21, + ), + ), + op: Node( + kind: Add, + span: Span( + start: 22, + end: 23, + ), + ), + right: Node( + kind: Num("3"), + span: Span( + start: 24, + end: 25, + ), + ), + ), + span: Span( + start: 20, + end: 25, + ), + ), + ), + span: Span( + start: 0, + end: 25, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_tuple1.snap b/parser/tests/snapshots/test_parser__expr_tuple1.snap new file mode 100644 index 0000000000..55fb978431 --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_tuple1.snap @@ -0,0 +1,22 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_tuple1), expressions::parse_expr, \"(1,)\")" + +--- +Node( + kind: Tuple( + elts: [ + Node( + kind: Num("1"), + span: Span( + start: 1, + end: 2, + ), + ), + ], + ), + span: Span( + start: 0, + end: 4, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_tuple2.snap b/parser/tests/snapshots/test_parser__expr_tuple2.snap new file mode 100644 index 0000000000..57901e1bab --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_tuple2.snap @@ -0,0 +1,36 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_tuple2), expressions::parse_expr, \"(1, 2, \\n 3)\")" + +--- +Node( + kind: Tuple( + elts: [ + Node( + kind: Num("1"), + span: Span( + start: 1, + end: 2, + ), + ), + Node( + kind: Num("2"), + span: Span( + start: 4, + end: 5, + ), + ), + Node( + kind: Num("3"), + span: Span( + start: 9, + end: 10, + ), + ), + ], + ), + span: Span( + start: 0, + end: 11, + ), +) diff --git a/parser/tests/snapshots/test_parser__expr_tuple3.snap b/parser/tests/snapshots/test_parser__expr_tuple3.snap new file mode 100644 index 0000000000..2845ebd77a --- /dev/null +++ b/parser/tests/snapshots/test_parser__expr_tuple3.snap @@ -0,0 +1,97 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(expr_tuple3), expressions::parse_expr,\n \"(1, (2 + 3), (3 * 4, 5))\")" + +--- +Node( + kind: Tuple( + elts: [ + Node( + kind: Num("1"), + span: Span( + start: 1, + end: 2, + ), + ), + Node( + kind: BinOperation( + left: Node( + kind: Num("2"), + span: Span( + start: 5, + end: 6, + ), + ), + op: Node( + kind: Add, + span: Span( + start: 7, + end: 8, + ), + ), + right: Node( + kind: Num("3"), + span: Span( + start: 9, + end: 10, + ), + ), + ), + span: Span( + start: 4, + end: 11, + ), + ), + Node( + kind: Tuple( + elts: [ + Node( + kind: BinOperation( + left: Node( + kind: Num("3"), + span: Span( + start: 14, + end: 15, + ), + ), + op: Node( + kind: Mult, + span: Span( + start: 16, + end: 17, + ), + ), + right: Node( + kind: Num("4"), + span: Span( + start: 18, + end: 19, + ), + ), + ), + span: Span( + start: 14, + end: 19, + ), + ), + Node( + kind: Num("5"), + span: Span( + start: 21, + end: 22, + ), + ), + ], + ), + span: Span( + start: 13, + end: 23, + ), + ), + ], + ), + span: Span( + start: 0, + end: 24, + ), +) diff --git a/parser/tests/snapshots/test_parser__fn_def.snap b/parser/tests/snapshots/test_parser__fn_def.snap new file mode 100644 index 0000000000..bf20884fdd --- /dev/null +++ b/parser/tests/snapshots/test_parser__fn_def.snap @@ -0,0 +1,97 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(fn_def), |par| functions::parse_fn_def(par, None),\n \"def foo21(x: bool, y: address,) -> bool:\\n x\")" + +--- +Node( + kind: FuncDef( + pub_qual: None, + name: Node( + kind: "foo21", + span: Span( + start: 4, + end: 9, + ), + ), + args: [ + Node( + kind: FuncDefArg( + name: Node( + kind: "x", + span: Span( + start: 10, + end: 11, + ), + ), + typ: Node( + kind: Base( + base: "bool", + ), + span: Span( + start: 13, + end: 17, + ), + ), + ), + span: Span( + start: 10, + end: 17, + ), + ), + Node( + kind: FuncDefArg( + name: Node( + kind: "y", + span: Span( + start: 19, + end: 20, + ), + ), + typ: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 22, + end: 29, + ), + ), + ), + span: Span( + start: 19, + end: 29, + ), + ), + ], + return_type: Some(Node( + kind: Base( + base: "bool", + ), + span: Span( + start: 35, + end: 39, + ), + )), + body: [ + Node( + kind: Expr( + value: Node( + kind: Name("x"), + span: Span( + start: 42, + end: 43, + ), + ), + ), + span: Span( + start: 42, + end: 43, + ), + ), + ], + ), + span: Span( + start: 0, + end: 43, + ), +) diff --git a/parser/tests/fixtures/parsers/guest_book.ron b/parser/tests/snapshots/test_parser__guest_book.snap similarity index 69% rename from parser/tests/fixtures/parsers/guest_book.ron rename to parser/tests/snapshots/test_parser__guest_book.snap index 53d2d13033..640cd4bd23 100644 --- a/parser/tests/fixtures/parsers/guest_book.ron +++ b/parser/tests/snapshots/test_parser__guest_book.snap @@ -1,18 +1,7 @@ -type BookMsg = bytes[100] - -contract GuestBook: - pub guest_book: map - - event Signed: - idx book_msg: BookMsg - - pub def sign(book_msg: BookMsg): - self.guest_book[msg.sender] = book_msg - - emit Signed(book_msg=book_msg) +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(guest_book), module::parse_module,\n r#\"\ntype BookMsg = bytes[100]\n\ncontract GuestBook:\n pub guest_book: map\n\n event Signed:\n idx book_msg: BookMsg\n\n pub def sign(book_msg: BookMsg):\n self.guest_book[msg.sender] = book_msg\n\n emit Signed(book_msg=book_msg)\n\n pub def get_msg(addr: address) -> BookMsg:\n return self.guest_book[addr]\n\"#)" - pub def get_msg(addr: address) -> BookMsg: - return self.guest_book[addr] --- Node( kind: Module( @@ -22,8 +11,8 @@ Node( name: Node( kind: "BookMsg", span: Span( - start: 5, - end: 12, + start: 6, + end: 13, ), ), typ: Node( @@ -33,21 +22,21 @@ Node( base: "bytes", ), span: Span( - start: 15, - end: 20, + start: 16, + end: 21, ), ), dimension: 100, ), span: Span( - start: 15, - end: 25, + start: 16, + end: 26, ), ), ), span: Span( - start: 0, - end: 25, + start: 1, + end: 26, ), ), Node( @@ -55,8 +44,8 @@ Node( name: Node( kind: "GuestBook", span: Span( - start: 36, - end: 45, + start: 37, + end: 46, ), ), fields: [ @@ -65,16 +54,16 @@ Node( pub_qual: Some(Node( kind: PubQualifier(), span: Span( - start: 51, - end: 54, + start: 52, + end: 55, ), )), const_qual: None, name: Node( kind: "guest_book", span: Span( - start: 55, - end: 65, + start: 56, + end: 66, ), ), typ: Node( @@ -84,8 +73,8 @@ Node( base: "address", ), span: Span( - start: 71, - end: 78, + start: 72, + end: 79, ), ), to: Node( @@ -93,21 +82,21 @@ Node( base: "BookMsg", ), span: Span( - start: 80, - end: 87, + start: 81, + end: 88, ), ), ), span: Span( - start: 67, - end: 88, + start: 68, + end: 89, ), ), value: None, ), span: Span( - start: 51, - end: 88, + start: 52, + end: 89, ), ), ], @@ -117,8 +106,8 @@ Node( name: Node( kind: "Signed", span: Span( - start: 100, - end: 106, + start: 101, + end: 107, ), ), fields: [ @@ -127,15 +116,15 @@ Node( idx_qual: Some(Node( kind: IdxQualifier(), span: Span( - start: 116, - end: 119, + start: 117, + end: 120, ), )), name: Node( kind: "book_msg", span: Span( - start: 120, - end: 128, + start: 121, + end: 129, ), ), typ: Node( @@ -143,21 +132,21 @@ Node( base: "BookMsg", ), span: Span( - start: 130, - end: 137, + start: 131, + end: 138, ), ), ), span: Span( - start: 116, - end: 137, + start: 117, + end: 138, ), ), ], ), span: Span( - start: 94, - end: 137, + start: 95, + end: 138, ), ), Node( @@ -165,15 +154,15 @@ Node( pub_qual: Some(Node( kind: PubQualifier(), span: Span( - start: 143, - end: 146, + start: 144, + end: 147, ), )), name: Node( kind: "sign", span: Span( - start: 151, - end: 155, + start: 152, + end: 156, ), ), args: [ @@ -182,8 +171,8 @@ Node( name: Node( kind: "book_msg", span: Span( - start: 156, - end: 164, + start: 157, + end: 165, ), ), typ: Node( @@ -191,14 +180,14 @@ Node( base: "BookMsg", ), span: Span( - start: 166, - end: 173, + start: 167, + end: 174, ), ), ), span: Span( - start: 156, - end: 173, + start: 157, + end: 174, ), ), ], @@ -214,21 +203,21 @@ Node( value: Node( kind: Name("self"), span: Span( - start: 184, - end: 188, + start: 185, + end: 189, ), ), attr: Node( kind: "guest_book", span: Span( - start: 189, - end: 199, + start: 190, + end: 200, ), ), ), span: Span( - start: 184, - end: 199, + start: 185, + end: 200, ), ), slices: Node( @@ -239,52 +228,52 @@ Node( value: Node( kind: Name("msg"), span: Span( - start: 200, - end: 203, + start: 201, + end: 204, ), ), attr: Node( kind: "sender", span: Span( - start: 204, - end: 210, + start: 205, + end: 211, ), ), ), span: Span( - start: 200, - end: 210, + start: 201, + end: 211, ), )), span: Span( - start: 200, - end: 210, + start: 201, + end: 211, ), ), ], span: Span( - start: 199, - end: 211, + start: 200, + end: 212, ), ), ), span: Span( - start: 184, - end: 211, + start: 185, + end: 212, ), ), ], value: Node( kind: Name("book_msg"), span: Span( - start: 214, - end: 222, + start: 215, + end: 223, ), ), ), span: Span( - start: 184, - end: 222, + start: 185, + end: 223, ), ), Node( @@ -292,8 +281,8 @@ Node( name: Node( kind: "Signed", span: Span( - start: 237, - end: 243, + start: 238, + end: 244, ), ), args: Node( @@ -303,40 +292,40 @@ Node( name: Node( kind: "book_msg", span: Span( - start: 244, - end: 252, + start: 245, + end: 253, ), ), value: Node( kind: Name("book_msg"), span: Span( - start: 253, - end: 261, + start: 254, + end: 262, ), ), )), span: Span( - start: 244, - end: 261, + start: 245, + end: 262, ), ), ], span: Span( - start: 243, - end: 262, + start: 244, + end: 263, ), ), ), span: Span( - start: 232, - end: 262, + start: 233, + end: 263, ), ), ], ), span: Span( - start: 143, - end: 262, + start: 144, + end: 263, ), ), Node( @@ -344,15 +333,15 @@ Node( pub_qual: Some(Node( kind: PubQualifier(), span: Span( - start: 268, - end: 271, + start: 269, + end: 272, ), )), name: Node( kind: "get_msg", span: Span( - start: 276, - end: 283, + start: 277, + end: 284, ), ), args: [ @@ -361,8 +350,8 @@ Node( name: Node( kind: "addr", span: Span( - start: 284, - end: 288, + start: 285, + end: 289, ), ), typ: Node( @@ -370,14 +359,14 @@ Node( base: "address", ), span: Span( - start: 290, - end: 297, + start: 291, + end: 298, ), ), ), span: Span( - start: 284, - end: 297, + start: 285, + end: 298, ), ), ], @@ -386,8 +375,8 @@ Node( base: "BookMsg", ), span: Span( - start: 302, - end: 309, + start: 303, + end: 310, ), )), body: [ @@ -400,21 +389,21 @@ Node( value: Node( kind: Name("self"), span: Span( - start: 326, - end: 330, + start: 327, + end: 331, ), ), attr: Node( kind: "guest_book", span: Span( - start: 331, - end: 341, + start: 332, + end: 342, ), ), ), span: Span( - start: 326, - end: 341, + start: 327, + end: 342, ), ), slices: Node( @@ -423,51 +412,51 @@ Node( kind: Index(Node( kind: Name("addr"), span: Span( - start: 342, - end: 346, + start: 343, + end: 347, ), )), span: Span( - start: 342, - end: 346, + start: 343, + end: 347, ), ), ], span: Span( - start: 341, - end: 347, + start: 342, + end: 348, ), ), ), span: Span( - start: 326, - end: 347, + start: 327, + end: 348, ), )), ), span: Span( - start: 319, - end: 347, + start: 320, + end: 348, ), ), ], ), span: Span( - start: 268, - end: 347, + start: 269, + end: 348, ), ), ], ), span: Span( - start: 27, - end: 347, + start: 28, + end: 348, ), ), ], ), span: Span( - start: 0, - end: 347, + start: 1, + end: 348, ), ) diff --git a/parser/tests/snapshots/test_parser__import_simple.snap b/parser/tests/snapshots/test_parser__import_simple.snap new file mode 100644 index 0000000000..1f85e1dc46 --- /dev/null +++ b/parser/tests/snapshots/test_parser__import_simple.snap @@ -0,0 +1,81 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(import_simple), module::parse_simple_import,\n \"import foo as bar, baz, bing as bop\")" + +--- +Node( + kind: SimpleImport( + names: [ + Node( + kind: SimpleImportName( + path: [ + Node( + kind: "foo", + span: Span( + start: 7, + end: 10, + ), + ), + ], + alias: Some(Node( + kind: "bar", + span: Span( + start: 14, + end: 17, + ), + )), + ), + span: Span( + start: 7, + end: 17, + ), + ), + Node( + kind: SimpleImportName( + path: [ + Node( + kind: "baz", + span: Span( + start: 19, + end: 22, + ), + ), + ], + alias: None, + ), + span: Span( + start: 19, + end: 22, + ), + ), + Node( + kind: SimpleImportName( + path: [ + Node( + kind: "bing", + span: Span( + start: 24, + end: 28, + ), + ), + ], + alias: Some(Node( + kind: "bop", + span: Span( + start: 32, + end: 35, + ), + )), + ), + span: Span( + start: 24, + end: 35, + ), + ), + ], + ), + span: Span( + start: 0, + end: 35, + ), +) diff --git a/parser/tests/snapshots/test_parser__module_stmts.snap b/parser/tests/snapshots/test_parser__module_stmts.snap new file mode 100644 index 0000000000..766c15fde5 --- /dev/null +++ b/parser/tests/snapshots/test_parser__module_stmts.snap @@ -0,0 +1,228 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(module_stmts), module::parse_module,\n r#\"\nimport foo as bar, baz as bum\n\ntype X = map\n\ncontract A:\n pub const x: u256 = 10\n\ncontract B:\n pub x: X\n\"#)" + +--- +Node( + kind: Module( + body: [ + Node( + kind: SimpleImport( + names: [ + Node( + kind: SimpleImportName( + path: [ + Node( + kind: "foo", + span: Span( + start: 8, + end: 11, + ), + ), + ], + alias: Some(Node( + kind: "bar", + span: Span( + start: 15, + end: 18, + ), + )), + ), + span: Span( + start: 8, + end: 18, + ), + ), + Node( + kind: SimpleImportName( + path: [ + Node( + kind: "baz", + span: Span( + start: 20, + end: 23, + ), + ), + ], + alias: Some(Node( + kind: "bum", + span: Span( + start: 27, + end: 30, + ), + )), + ), + span: Span( + start: 20, + end: 30, + ), + ), + ], + ), + span: Span( + start: 1, + end: 30, + ), + ), + Node( + kind: TypeDef( + name: Node( + kind: "X", + span: Span( + start: 37, + end: 38, + ), + ), + typ: Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 45, + end: 47, + ), + ), + to: Node( + kind: Base( + base: "u16", + ), + span: Span( + start: 49, + end: 52, + ), + ), + ), + span: Span( + start: 41, + end: 53, + ), + ), + ), + span: Span( + start: 32, + end: 53, + ), + ), + Node( + kind: ContractDef( + name: Node( + kind: "A", + span: Span( + start: 64, + end: 65, + ), + ), + fields: [ + Node( + kind: Field( + pub_qual: Some(Node( + kind: PubQualifier(), + span: Span( + start: 71, + end: 74, + ), + )), + const_qual: Some(Node( + kind: ConstQualifier(), + span: Span( + start: 75, + end: 80, + ), + )), + name: Node( + kind: "x", + span: Span( + start: 81, + end: 82, + ), + ), + typ: Node( + kind: Base( + base: "u256", + ), + span: Span( + start: 84, + end: 88, + ), + ), + value: Some(Node( + kind: Num("10"), + span: Span( + start: 91, + end: 93, + ), + )), + ), + span: Span( + start: 71, + end: 88, + ), + ), + ], + body: [], + ), + span: Span( + start: 55, + end: 88, + ), + ), + Node( + kind: ContractDef( + name: Node( + kind: "B", + span: Span( + start: 104, + end: 105, + ), + ), + fields: [ + Node( + kind: Field( + pub_qual: Some(Node( + kind: PubQualifier(), + span: Span( + start: 111, + end: 114, + ), + )), + const_qual: None, + name: Node( + kind: "x", + span: Span( + start: 115, + end: 116, + ), + ), + typ: Node( + kind: Base( + base: "X", + ), + span: Span( + start: 118, + end: 119, + ), + ), + value: None, + ), + span: Span( + start: 111, + end: 119, + ), + ), + ], + body: [], + ), + span: Span( + start: 95, + end: 119, + ), + ), + ], + ), + span: Span( + start: 1, + end: 119, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_bit1.snap b/parser/tests/snapshots/test_parser__ops_bit1.snap new file mode 100644 index 0000000000..8fd9819340 --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_bit1.snap @@ -0,0 +1,56 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_bit1), expressions::parse_expr, \"a & b >> c\")" + +--- +Node( + kind: BinOperation( + left: Node( + kind: Name("a"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: BitAnd, + span: Span( + start: 2, + end: 3, + ), + ), + right: Node( + kind: BinOperation( + left: Node( + kind: Name("b"), + span: Span( + start: 4, + end: 5, + ), + ), + op: Node( + kind: RShift, + span: Span( + start: 6, + end: 8, + ), + ), + right: Node( + kind: Name("c"), + span: Span( + start: 9, + end: 10, + ), + ), + ), + span: Span( + start: 4, + end: 10, + ), + ), + ), + span: Span( + start: 0, + end: 10, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_bit2.snap b/parser/tests/snapshots/test_parser__ops_bit2.snap new file mode 100644 index 0000000000..a4cf973e46 --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_bit2.snap @@ -0,0 +1,56 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_bit2), expressions::parse_expr, \"a ^ b & c\")" + +--- +Node( + kind: BinOperation( + left: Node( + kind: Name("a"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: BitXor, + span: Span( + start: 2, + end: 3, + ), + ), + right: Node( + kind: BinOperation( + left: Node( + kind: Name("b"), + span: Span( + start: 4, + end: 5, + ), + ), + op: Node( + kind: BitAnd, + span: Span( + start: 6, + end: 7, + ), + ), + right: Node( + kind: Name("c"), + span: Span( + start: 8, + end: 9, + ), + ), + ), + span: Span( + start: 4, + end: 9, + ), + ), + ), + span: Span( + start: 0, + end: 9, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_bit3.snap b/parser/tests/snapshots/test_parser__ops_bit3.snap new file mode 100644 index 0000000000..a0b25f44eb --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_bit3.snap @@ -0,0 +1,56 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_bit3), expressions::parse_expr, \"a | b ^ c\")" + +--- +Node( + kind: BinOperation( + left: Node( + kind: Name("a"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: BitOr, + span: Span( + start: 2, + end: 3, + ), + ), + right: Node( + kind: BinOperation( + left: Node( + kind: Name("b"), + span: Span( + start: 4, + end: 5, + ), + ), + op: Node( + kind: BitXor, + span: Span( + start: 6, + end: 7, + ), + ), + right: Node( + kind: Name("c"), + span: Span( + start: 8, + end: 9, + ), + ), + ), + span: Span( + start: 4, + end: 9, + ), + ), + ), + span: Span( + start: 0, + end: 9, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_bnot.snap b/parser/tests/snapshots/test_parser__ops_bnot.snap new file mode 100644 index 0000000000..7c684f7705 --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_bnot.snap @@ -0,0 +1,27 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_bnot), expressions::parse_expr, \"~x\")" + +--- +Node( + kind: UnaryOperation( + op: Node( + kind: Invert, + span: Span( + start: 0, + end: 1, + ), + ), + operand: Node( + kind: Name("x"), + span: Span( + start: 1, + end: 2, + ), + ), + ), + span: Span( + start: 0, + end: 2, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_bool.snap b/parser/tests/snapshots/test_parser__ops_bool.snap new file mode 100644 index 0000000000..9945d86cbe --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_bool.snap @@ -0,0 +1,56 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_bool), expressions::parse_expr, \"a or b and c\")" + +--- +Node( + kind: BoolOperation( + left: Node( + kind: Name("a"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Or, + span: Span( + start: 2, + end: 4, + ), + ), + right: Node( + kind: BoolOperation( + left: Node( + kind: Name("b"), + span: Span( + start: 5, + end: 6, + ), + ), + op: Node( + kind: And, + span: Span( + start: 7, + end: 10, + ), + ), + right: Node( + kind: Name("c"), + span: Span( + start: 11, + end: 12, + ), + ), + ), + span: Span( + start: 5, + end: 12, + ), + ), + ), + span: Span( + start: 0, + end: 12, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_math.snap b/parser/tests/snapshots/test_parser__ops_math.snap new file mode 100644 index 0000000000..e082ab0b42 --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_math.snap @@ -0,0 +1,137 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_math), expressions::parse_expr,\n \"a + b * -c ** d / e % f\")" + +--- +Node( + kind: BinOperation( + left: Node( + kind: Name("a"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Add, + span: Span( + start: 2, + end: 3, + ), + ), + right: Node( + kind: BinOperation( + left: Node( + kind: BinOperation( + left: Node( + kind: BinOperation( + left: Node( + kind: Name("b"), + span: Span( + start: 4, + end: 5, + ), + ), + op: Node( + kind: Mult, + span: Span( + start: 6, + end: 7, + ), + ), + right: Node( + kind: UnaryOperation( + op: Node( + kind: USub, + span: Span( + start: 8, + end: 9, + ), + ), + operand: Node( + kind: BinOperation( + left: Node( + kind: Name("c"), + span: Span( + start: 9, + end: 10, + ), + ), + op: Node( + kind: Pow, + span: Span( + start: 11, + end: 13, + ), + ), + right: Node( + kind: Name("d"), + span: Span( + start: 14, + end: 15, + ), + ), + ), + span: Span( + start: 9, + end: 15, + ), + ), + ), + span: Span( + start: 8, + end: 15, + ), + ), + ), + span: Span( + start: 4, + end: 15, + ), + ), + op: Node( + kind: Div, + span: Span( + start: 16, + end: 17, + ), + ), + right: Node( + kind: Name("e"), + span: Span( + start: 18, + end: 19, + ), + ), + ), + span: Span( + start: 4, + end: 19, + ), + ), + op: Node( + kind: Mod, + span: Span( + start: 20, + end: 21, + ), + ), + right: Node( + kind: Name("f"), + span: Span( + start: 22, + end: 23, + ), + ), + ), + span: Span( + start: 4, + end: 23, + ), + ), + ), + span: Span( + start: 0, + end: 23, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_neg.snap b/parser/tests/snapshots/test_parser__ops_neg.snap new file mode 100644 index 0000000000..da6fa909cf --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_neg.snap @@ -0,0 +1,27 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_neg), expressions::parse_expr, \"-x\")" + +--- +Node( + kind: UnaryOperation( + op: Node( + kind: USub, + span: Span( + start: 0, + end: 1, + ), + ), + operand: Node( + kind: Name("x"), + span: Span( + start: 1, + end: 2, + ), + ), + ), + span: Span( + start: 0, + end: 2, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_not.snap b/parser/tests/snapshots/test_parser__ops_not.snap new file mode 100644 index 0000000000..0b681e55e9 --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_not.snap @@ -0,0 +1,49 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_not), expressions::parse_expr, \"x and not y\")" + +--- +Node( + kind: BoolOperation( + left: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: And, + span: Span( + start: 2, + end: 5, + ), + ), + right: Node( + kind: UnaryOperation( + op: Node( + kind: Not, + span: Span( + start: 6, + end: 9, + ), + ), + operand: Node( + kind: Name("y"), + span: Span( + start: 10, + end: 11, + ), + ), + ), + span: Span( + start: 6, + end: 11, + ), + ), + ), + span: Span( + start: 0, + end: 11, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_pos.snap b/parser/tests/snapshots/test_parser__ops_pos.snap new file mode 100644 index 0000000000..7f3f6e5321 --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_pos.snap @@ -0,0 +1,27 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_pos), expressions::parse_expr, \"+x\")" + +--- +Node( + kind: UnaryOperation( + op: Node( + kind: UAdd, + span: Span( + start: 0, + end: 1, + ), + ), + operand: Node( + kind: Name("x"), + span: Span( + start: 1, + end: 2, + ), + ), + ), + span: Span( + start: 0, + end: 2, + ), +) diff --git a/parser/tests/snapshots/test_parser__ops_shift.snap b/parser/tests/snapshots/test_parser__ops_shift.snap new file mode 100644 index 0000000000..1efb6259c2 --- /dev/null +++ b/parser/tests/snapshots/test_parser__ops_shift.snap @@ -0,0 +1,56 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(ops_shift), expressions::parse_expr, \"a << b >> c\")" + +--- +Node( + kind: BinOperation( + left: Node( + kind: BinOperation( + left: Node( + kind: Name("a"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: LShift, + span: Span( + start: 2, + end: 4, + ), + ), + right: Node( + kind: Name("b"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), + ), + op: Node( + kind: RShift, + span: Span( + start: 7, + end: 9, + ), + ), + right: Node( + kind: Name("c"), + span: Span( + start: 10, + end: 11, + ), + ), + ), + span: Span( + start: 0, + end: 11, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_assert_msg.snap b/parser/tests/snapshots/test_parser__stmt_assert_msg.snap new file mode 100644 index 0000000000..91efb3c88d --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_assert_msg.snap @@ -0,0 +1,49 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_assert_msg), functions::parse_stmt,\n \"assert x == y, z\")" + +--- +Node( + kind: Assert( + test: Node( + kind: CompOperation( + left: Node( + kind: Name("x"), + span: Span( + start: 7, + end: 8, + ), + ), + op: Node( + kind: Eq, + span: Span( + start: 9, + end: 11, + ), + ), + right: Node( + kind: Name("y"), + span: Span( + start: 12, + end: 13, + ), + ), + ), + span: Span( + start: 7, + end: 13, + ), + ), + msg: Some(Node( + kind: Name("z"), + span: Span( + start: 15, + end: 16, + ), + )), + ), + span: Span( + start: 0, + end: 16, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_assert_no_msg.snap b/parser/tests/snapshots/test_parser__stmt_assert_no_msg.snap new file mode 100644 index 0000000000..4a6135b495 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_assert_no_msg.snap @@ -0,0 +1,43 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_assert_no_msg), functions::parse_stmt,\n \"assert x == y\")" + +--- +Node( + kind: Assert( + test: Node( + kind: CompOperation( + left: Node( + kind: Name("x"), + span: Span( + start: 7, + end: 8, + ), + ), + op: Node( + kind: Eq, + span: Span( + start: 9, + end: 11, + ), + ), + right: Node( + kind: Name("y"), + span: Span( + start: 12, + end: 13, + ), + ), + ), + span: Span( + start: 7, + end: 13, + ), + ), + msg: None, + ), + span: Span( + start: 0, + end: 13, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_add.snap b/parser/tests/snapshots/test_parser__stmt_aug_add.snap new file mode 100644 index 0000000000..4e7667722d --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_add.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_add), functions::parse_stmt, \"x += y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Add, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_and.snap b/parser/tests/snapshots/test_parser__stmt_aug_and.snap new file mode 100644 index 0000000000..2354155f56 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_and.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_and), functions::parse_stmt, \"x &= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: BitAnd, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_div.snap b/parser/tests/snapshots/test_parser__stmt_aug_div.snap new file mode 100644 index 0000000000..e86f3e9621 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_div.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_div), functions::parse_stmt, \"x /= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Div, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_exp.snap b/parser/tests/snapshots/test_parser__stmt_aug_exp.snap new file mode 100644 index 0000000000..a954d0402a --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_exp.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_exp), functions::parse_stmt, \"x **= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Pow, + span: Span( + start: 2, + end: 5, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 6, + end: 7, + ), + ), + ), + span: Span( + start: 0, + end: 7, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_lsh.snap b/parser/tests/snapshots/test_parser__stmt_aug_lsh.snap new file mode 100644 index 0000000000..0fe11a772b --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_lsh.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_lsh), functions::parse_stmt, \"x <<= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: LShift, + span: Span( + start: 2, + end: 5, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 6, + end: 7, + ), + ), + ), + span: Span( + start: 0, + end: 7, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_mod.snap b/parser/tests/snapshots/test_parser__stmt_aug_mod.snap new file mode 100644 index 0000000000..49f6efa7bd --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_mod.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_mod), functions::parse_stmt, \"x %= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Mod, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_mul.snap b/parser/tests/snapshots/test_parser__stmt_aug_mul.snap new file mode 100644 index 0000000000..7a1cd03f91 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_mul.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_mul), functions::parse_stmt, \"x *= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Mult, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_or.snap b/parser/tests/snapshots/test_parser__stmt_aug_or.snap new file mode 100644 index 0000000000..7891f4f9f8 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_or.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_or), functions::parse_stmt, \"x |= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: BitOr, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_rsh.snap b/parser/tests/snapshots/test_parser__stmt_aug_rsh.snap new file mode 100644 index 0000000000..092924bac7 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_rsh.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_rsh), functions::parse_stmt, \"x >>= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: RShift, + span: Span( + start: 2, + end: 5, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 6, + end: 7, + ), + ), + ), + span: Span( + start: 0, + end: 7, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_sub.snap b/parser/tests/snapshots/test_parser__stmt_aug_sub.snap new file mode 100644 index 0000000000..eedbfa6a66 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_sub.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_sub), functions::parse_stmt, \"x -= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: Sub, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_aug_xor.snap b/parser/tests/snapshots/test_parser__stmt_aug_xor.snap new file mode 100644 index 0000000000..f73477f6a7 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_aug_xor.snap @@ -0,0 +1,34 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_aug_xor), functions::parse_stmt, \"x ^= y\")" + +--- +Node( + kind: AugAssign( + target: Node( + kind: Name("x"), + span: Span( + start: 0, + end: 1, + ), + ), + op: Node( + kind: BitXor, + span: Span( + start: 2, + end: 4, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 5, + end: 6, + ), + ), + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_emit1.snap b/parser/tests/snapshots/test_parser__stmt_emit1.snap new file mode 100644 index 0000000000..7da2e1ce81 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_emit1.snap @@ -0,0 +1,27 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_emit1), functions::parse_stmt, \"emit Foo()\")" + +--- +Node( + kind: Emit( + name: Node( + kind: "Foo", + span: Span( + start: 5, + end: 8, + ), + ), + args: Node( + kind: [], + span: Span( + start: 8, + end: 10, + ), + ), + ), + span: Span( + start: 0, + end: 10, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_emit2.snap b/parser/tests/snapshots/test_parser__stmt_emit2.snap new file mode 100644 index 0000000000..06fb617783 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_emit2.snap @@ -0,0 +1,76 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_emit2), functions::parse_stmt,\n \"emit Foo(1, 2, x=y)\")" + +--- +Node( + kind: Emit( + name: Node( + kind: "Foo", + span: Span( + start: 5, + end: 8, + ), + ), + args: Node( + kind: [ + Node( + kind: Arg(Node( + kind: Num("1"), + span: Span( + start: 9, + end: 10, + ), + )), + span: Span( + start: 9, + end: 10, + ), + ), + Node( + kind: Arg(Node( + kind: Num("2"), + span: Span( + start: 12, + end: 13, + ), + )), + span: Span( + start: 12, + end: 13, + ), + ), + Node( + kind: Kwarg(Kwarg( + name: Node( + kind: "x", + span: Span( + start: 15, + end: 16, + ), + ), + value: Node( + kind: Name("y"), + span: Span( + start: 17, + end: 18, + ), + ), + )), + span: Span( + start: 15, + end: 18, + ), + ), + ], + span: Span( + start: 8, + end: 19, + ), + ), + ), + span: Span( + start: 0, + end: 19, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_for.snap b/parser/tests/snapshots/test_parser__stmt_for.snap new file mode 100644 index 0000000000..403b59d229 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_for.snap @@ -0,0 +1,66 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_for), functions::parse_stmt,\n \"for a in b[0]:\\n pass\")" + +--- +Node( + kind: For( + target: Node( + kind: Name("a"), + span: Span( + start: 4, + end: 5, + ), + ), + iter: Node( + kind: Subscript( + value: Node( + kind: Name("b"), + span: Span( + start: 9, + end: 10, + ), + ), + slices: Node( + kind: [ + Node( + kind: Index(Node( + kind: Num("0"), + span: Span( + start: 11, + end: 12, + ), + )), + span: Span( + start: 11, + end: 12, + ), + ), + ], + span: Span( + start: 10, + end: 13, + ), + ), + ), + span: Span( + start: 9, + end: 13, + ), + ), + body: [ + Node( + kind: Pass, + span: Span( + start: 16, + end: 20, + ), + ), + ], + or_else: [], + ), + span: Span( + start: 0, + end: 20, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_for_else.snap b/parser/tests/snapshots/test_parser__stmt_for_else.snap new file mode 100644 index 0000000000..94fd311c42 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_for_else.snap @@ -0,0 +1,61 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_for_else), functions::parse_stmt,\n \"for a in b:\\n c\\nelse:\\n d\")" + +--- +Node( + kind: For( + target: Node( + kind: Name("a"), + span: Span( + start: 4, + end: 5, + ), + ), + iter: Node( + kind: Name("b"), + span: Span( + start: 9, + end: 10, + ), + ), + body: [ + Node( + kind: Expr( + value: Node( + kind: Name("c"), + span: Span( + start: 13, + end: 14, + ), + ), + ), + span: Span( + start: 13, + end: 14, + ), + ), + ], + or_else: [ + Node( + kind: Expr( + value: Node( + kind: Name("d"), + span: Span( + start: 22, + end: 23, + ), + ), + ), + span: Span( + start: 22, + end: 23, + ), + ), + ], + ), + span: Span( + start: 0, + end: 23, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_if.snap b/parser/tests/snapshots/test_parser__stmt_if.snap new file mode 100644 index 0000000000..c83d055845 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_if.snap @@ -0,0 +1,38 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_if), functions::parse_stmt, \"if a:\\n b\")" + +--- +Node( + kind: If( + test: Node( + kind: Name("a"), + span: Span( + start: 3, + end: 4, + ), + ), + body: [ + Node( + kind: Expr( + value: Node( + kind: Name("b"), + span: Span( + start: 7, + end: 8, + ), + ), + ), + span: Span( + start: 7, + end: 8, + ), + ), + ], + or_else: [], + ), + span: Span( + start: 0, + end: 8, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_if2.snap b/parser/tests/snapshots/test_parser__stmt_if2.snap new file mode 100644 index 0000000000..2cc3d1d3b6 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_if2.snap @@ -0,0 +1,122 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_if2), functions::parse_stmt,\n \"if a:\\n b \\nelif c:\\n d \\nelif e: \\n f \\nelse:\\n g\")" + +--- +Node( + kind: If( + test: Node( + kind: Name("a"), + span: Span( + start: 3, + end: 4, + ), + ), + body: [ + Node( + kind: Expr( + value: Node( + kind: Name("b"), + span: Span( + start: 7, + end: 8, + ), + ), + ), + span: Span( + start: 7, + end: 8, + ), + ), + ], + or_else: [ + Node( + kind: If( + test: Node( + kind: Name("c"), + span: Span( + start: 15, + end: 16, + ), + ), + body: [ + Node( + kind: Expr( + value: Node( + kind: Name("d"), + span: Span( + start: 19, + end: 20, + ), + ), + ), + span: Span( + start: 19, + end: 20, + ), + ), + ], + or_else: [ + Node( + kind: If( + test: Node( + kind: Name("e"), + span: Span( + start: 27, + end: 28, + ), + ), + body: [ + Node( + kind: Expr( + value: Node( + kind: Name("f"), + span: Span( + start: 32, + end: 33, + ), + ), + ), + span: Span( + start: 32, + end: 33, + ), + ), + ], + or_else: [ + Node( + kind: Expr( + value: Node( + kind: Name("g"), + span: Span( + start: 42, + end: 43, + ), + ), + ), + span: Span( + start: 42, + end: 43, + ), + ), + ], + ), + span: Span( + start: 22, + end: 43, + ), + ), + ], + ), + span: Span( + start: 10, + end: 43, + ), + ), + ], + ), + span: Span( + start: 0, + end: 43, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_return1.snap b/parser/tests/snapshots/test_parser__stmt_return1.snap new file mode 100644 index 0000000000..239649a87b --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_return1.snap @@ -0,0 +1,14 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_return1), functions::parse_stmt, \"return\")" + +--- +Node( + kind: Return( + value: None, + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_return2.snap b/parser/tests/snapshots/test_parser__stmt_return2.snap new file mode 100644 index 0000000000..c0656bfe4c --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_return2.snap @@ -0,0 +1,20 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_return2), functions::parse_stmt, \"return x\")" + +--- +Node( + kind: Return( + value: Some(Node( + kind: Name("x"), + span: Span( + start: 7, + end: 8, + ), + )), + ), + span: Span( + start: 0, + end: 8, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_return3.snap b/parser/tests/snapshots/test_parser__stmt_return3.snap new file mode 100644 index 0000000000..e97c7a2af2 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_return3.snap @@ -0,0 +1,35 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_return3), functions::parse_stmt, \"return not x\")" + +--- +Node( + kind: Return( + value: Some(Node( + kind: UnaryOperation( + op: Node( + kind: Not, + span: Span( + start: 7, + end: 10, + ), + ), + operand: Node( + kind: Name("x"), + span: Span( + start: 11, + end: 12, + ), + ), + ), + span: Span( + start: 7, + end: 12, + ), + )), + ), + span: Span( + start: 0, + end: 12, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_revert.snap b/parser/tests/snapshots/test_parser__stmt_revert.snap new file mode 100644 index 0000000000..c30271cc79 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_revert.snap @@ -0,0 +1,12 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_revert), functions::parse_stmt, \"revert\")" + +--- +Node( + kind: Revert, + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__stmt_while.snap b/parser/tests/snapshots/test_parser__stmt_while.snap new file mode 100644 index 0000000000..7885de2d02 --- /dev/null +++ b/parser/tests/snapshots/test_parser__stmt_while.snap @@ -0,0 +1,74 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(stmt_while), functions::parse_stmt,\n \"while a > 5:\\n a -= 1\")" + +--- +Node( + kind: While( + test: Node( + kind: CompOperation( + left: Node( + kind: Name("a"), + span: Span( + start: 6, + end: 7, + ), + ), + op: Node( + kind: Gt, + span: Span( + start: 8, + end: 9, + ), + ), + right: Node( + kind: Num("5"), + span: Span( + start: 10, + end: 11, + ), + ), + ), + span: Span( + start: 6, + end: 11, + ), + ), + body: [ + Node( + kind: AugAssign( + target: Node( + kind: Name("a"), + span: Span( + start: 14, + end: 15, + ), + ), + op: Node( + kind: Sub, + span: Span( + start: 16, + end: 18, + ), + ), + value: Node( + kind: Num("1"), + span: Span( + start: 19, + end: 20, + ), + ), + ), + span: Span( + start: 14, + end: 20, + ), + ), + ], + or_else: [], + ), + span: Span( + start: 0, + end: 20, + ), +) diff --git a/parser/tests/snapshots/test_parser__struct_def.snap b/parser/tests/snapshots/test_parser__struct_def.snap new file mode 100644 index 0000000000..561d7a0ee8 --- /dev/null +++ b/parser/tests/snapshots/test_parser__struct_def.snap @@ -0,0 +1,171 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(struct_def), types::parse_struct_def,\n r#\"struct S:\n x: address\n pub y: u8\n const z: u8\n pub const a: map\n\"#)" + +--- +Node( + kind: StructDef( + name: Node( + kind: "S", + span: Span( + start: 7, + end: 8, + ), + ), + fields: [ + Node( + kind: Field( + pub_qual: None, + const_qual: None, + name: Node( + kind: "x", + span: Span( + start: 12, + end: 13, + ), + ), + typ: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 15, + end: 22, + ), + ), + value: None, + ), + span: Span( + start: 12, + end: 22, + ), + ), + Node( + kind: Field( + pub_qual: Some(Node( + kind: PubQualifier(), + span: Span( + start: 25, + end: 28, + ), + )), + const_qual: None, + name: Node( + kind: "y", + span: Span( + start: 29, + end: 30, + ), + ), + typ: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 32, + end: 34, + ), + ), + value: None, + ), + span: Span( + start: 25, + end: 34, + ), + ), + Node( + kind: Field( + pub_qual: None, + const_qual: Some(Node( + kind: ConstQualifier(), + span: Span( + start: 37, + end: 42, + ), + )), + name: Node( + kind: "z", + span: Span( + start: 43, + end: 44, + ), + ), + typ: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 46, + end: 48, + ), + ), + value: None, + ), + span: Span( + start: 37, + end: 48, + ), + ), + Node( + kind: Field( + pub_qual: Some(Node( + kind: PubQualifier(), + span: Span( + start: 51, + end: 54, + ), + )), + const_qual: Some(Node( + kind: ConstQualifier(), + span: Span( + start: 55, + end: 60, + ), + )), + name: Node( + kind: "a", + span: Span( + start: 61, + end: 62, + ), + ), + typ: Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 68, + end: 70, + ), + ), + to: Node( + kind: Base( + base: "foo", + ), + span: Span( + start: 72, + end: 75, + ), + ), + ), + span: Span( + start: 64, + end: 76, + ), + ), + value: None, + ), + span: Span( + start: 51, + end: 76, + ), + ), + ], + ), + span: Span( + start: 0, + end: 76, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_3d.snap b/parser/tests/snapshots/test_parser__type_3d.snap new file mode 100644 index 0000000000..37fa22d1a6 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_3d.snap @@ -0,0 +1,41 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_3d), types::parse_type_desc, \"u256[4][4][4]\")" + +--- +Node( + kind: Array( + typ: Node( + kind: Array( + typ: Node( + kind: Array( + typ: Node( + kind: Base( + base: "u256", + ), + span: Span( + start: 0, + end: 4, + ), + ), + dimension: 4, + ), + span: Span( + start: 0, + end: 7, + ), + ), + dimension: 4, + ), + span: Span( + start: 0, + end: 10, + ), + ), + dimension: 4, + ), + span: Span( + start: 0, + end: 13, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_array.snap b/parser/tests/snapshots/test_parser__type_array.snap new file mode 100644 index 0000000000..0b4ff634b4 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_array.snap @@ -0,0 +1,23 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_array), types::parse_type_desc, \"address[25]\")" + +--- +Node( + kind: Array( + typ: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 0, + end: 7, + ), + ), + dimension: 25, + ), + span: Span( + start: 0, + end: 11, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_def.snap b/parser/tests/snapshots/test_parser__type_def.snap new file mode 100644 index 0000000000..a4275447dc --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_def.snap @@ -0,0 +1,46 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_def), types::parse_type_def,\n \"type X = map\")" + +--- +Node( + kind: TypeDef( + name: Node( + kind: "X", + span: Span( + start: 5, + end: 6, + ), + ), + typ: Node( + kind: Map( + from: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 13, + end: 20, + ), + ), + to: Node( + kind: Base( + base: "u256", + ), + span: Span( + start: 22, + end: 26, + ), + ), + ), + span: Span( + start: 9, + end: 27, + ), + ), + ), + span: Span( + start: 0, + end: 27, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_generic.snap b/parser/tests/snapshots/test_parser__type_generic.snap new file mode 100644 index 0000000000..3813d6e66a --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_generic.snap @@ -0,0 +1,75 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_generic), types::parse_type_desc,\n \"foo, d[10]>\")" + +--- +Node( + kind: Generic( + base: Node( + kind: "foo", + span: Span( + start: 0, + end: 3, + ), + ), + args: [ + Node( + kind: TypeDesc(Base( + base: "a", + )), + span: Span( + start: 4, + end: 5, + ), + ), + Node( + kind: TypeDesc(Generic( + base: Node( + kind: "b", + span: Span( + start: 7, + end: 8, + ), + ), + args: [ + Node( + kind: TypeDesc(Base( + base: "c", + )), + span: Span( + start: 9, + end: 10, + ), + ), + ], + )), + span: Span( + start: 7, + end: 11, + ), + ), + Node( + kind: TypeDesc(Array( + typ: Node( + kind: Base( + base: "d", + ), + span: Span( + start: 13, + end: 14, + ), + ), + dimension: 10, + )), + span: Span( + start: 13, + end: 18, + ), + ), + ], + ), + span: Span( + start: 0, + end: 19, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_map1.snap b/parser/tests/snapshots/test_parser__type_map1.snap new file mode 100644 index 0000000000..894e6219c7 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_map1.snap @@ -0,0 +1,31 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_map1), types::parse_type_desc,\n \"map\")" + +--- +Node( + kind: Map( + from: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 4, + end: 11, + ), + ), + to: Node( + kind: Base( + base: "u256", + ), + span: Span( + start: 13, + end: 17, + ), + ), + ), + span: Span( + start: 0, + end: 18, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_map2.snap b/parser/tests/snapshots/test_parser__type_map2.snap new file mode 100644 index 0000000000..9bb2a16151 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_map2.snap @@ -0,0 +1,48 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_map2), types::parse_type_desc,\n \"map>\")" + +--- +Node( + kind: Map( + from: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 4, + end: 11, + ), + ), + to: Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 17, + end: 19, + ), + ), + to: Node( + kind: Base( + base: "u256", + ), + span: Span( + start: 21, + end: 25, + ), + ), + ), + span: Span( + start: 13, + end: 26, + ), + ), + ), + span: Span( + start: 0, + end: 27, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_map3.snap b/parser/tests/snapshots/test_parser__type_map3.snap new file mode 100644 index 0000000000..d2df1a2243 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_map3.snap @@ -0,0 +1,65 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_map3), types::parse_type_desc,\n \"map>>\")" + +--- +Node( + kind: Map( + from: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 4, + end: 11, + ), + ), + to: Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 17, + end: 19, + ), + ), + to: Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 25, + end: 27, + ), + ), + to: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 29, + end: 31, + ), + ), + ), + span: Span( + start: 21, + end: 32, + ), + ), + ), + span: Span( + start: 13, + end: 33, + ), + ), + ), + span: Span( + start: 0, + end: 34, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_map4.snap b/parser/tests/snapshots/test_parser__type_map4.snap new file mode 100644 index 0000000000..04648a0bc3 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_map4.snap @@ -0,0 +1,48 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_map4), types::parse_type_desc,\n \"map < address , map < u8, u256 > >\")" + +--- +Node( + kind: Map( + from: Node( + kind: Base( + base: "address", + ), + span: Span( + start: 6, + end: 13, + ), + ), + to: Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 22, + end: 24, + ), + ), + to: Node( + kind: Base( + base: "u256", + ), + span: Span( + start: 26, + end: 30, + ), + ), + ), + span: Span( + start: 16, + end: 32, + ), + ), + ), + span: Span( + start: 0, + end: 34, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_name.snap b/parser/tests/snapshots/test_parser__type_name.snap new file mode 100644 index 0000000000..fbf29d2874 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_name.snap @@ -0,0 +1,14 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_name), types::parse_type_desc, \"MyType\")" + +--- +Node( + kind: Base( + base: "MyType", + ), + span: Span( + start: 0, + end: 6, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_string.snap b/parser/tests/snapshots/test_parser__type_string.snap new file mode 100644 index 0000000000..ab9ee6eb39 --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_string.snap @@ -0,0 +1,29 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_string), types::parse_type_desc, \"string<100>\")" + +--- +Node( + kind: Generic( + base: Node( + kind: "string", + span: Span( + start: 0, + end: 6, + ), + ), + args: [ + Node( + kind: Int(100), + span: Span( + start: 7, + end: 10, + ), + ), + ], + ), + span: Span( + start: 0, + end: 11, + ), +) diff --git a/parser/tests/snapshots/test_parser__type_tuple.snap b/parser/tests/snapshots/test_parser__type_tuple.snap new file mode 100644 index 0000000000..c35de8ba1b --- /dev/null +++ b/parser/tests/snapshots/test_parser__type_tuple.snap @@ -0,0 +1,68 @@ +--- +source: parser/tests/test_parser.rs +expression: "ast_string(stringify!(type_tuple), types::parse_type_desc,\n \"(u8, u16, address, map)\")" + +--- +Node( + kind: Tuple( + items: [ + Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 1, + end: 3, + ), + ), + Node( + kind: Base( + base: "u16", + ), + span: Span( + start: 5, + end: 8, + ), + ), + Node( + kind: Base( + base: "address", + ), + span: Span( + start: 10, + end: 17, + ), + ), + Node( + kind: Map( + from: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 23, + end: 25, + ), + ), + to: Node( + kind: Base( + base: "u8", + ), + span: Span( + start: 27, + end: 29, + ), + ), + ), + span: Span( + start: 19, + end: 30, + ), + ), + ], + ), + span: Span( + start: 0, + end: 31, + ), +) diff --git a/parser/tests/test_parser.rs b/parser/tests/test_parser.rs index eb33c3e49e..7955325407 100644 --- a/parser/tests/test_parser.rs +++ b/parser/tests/test_parser.rs @@ -1,153 +1,167 @@ -use fe_common::{diagnostics::print_diagnostics, files::FileStore}; - -use fe_common::assert_strings_eq; -use fe_common::utils::ron::{to_ron_string_pretty, Diff}; -use fe_parser::ast; +use fe_common::diagnostics::print_diagnostics; +use fe_common::utils::ron::to_ron_string_pretty; use fe_parser::grammar::{contracts, expressions, functions, module, types}; -use fe_parser::{ParseResult, Parser, TokenKind}; +use fe_parser::{ParseResult, Parser}; +use insta::assert_snapshot; use serde::Serialize; -mod utils; - -#[derive(PartialEq)] -enum Repeat { - No, - Yes, -} - -fn run_parser_test(fixture_name: &str, content: &str, mut parse_fn: F, repeat: Repeat) +pub fn ast_string(test_name: &str, mut parse_fn: F, src: &str) -> String where F: FnMut(&mut Parser) -> ParseResult, T: Serialize, { - let (input, expected_ser) = utils::parse_fixture(content) - .expect(&format!("Test example has wrong format {}", fixture_name)); - - let mut file_store = FileStore::new(); - let id = file_store.add_file(fixture_name, input); - let mut parser = Parser::new(input, id); - - let mut parser_err = false; - let actual_ser = if repeat == Repeat::Yes { - let mut results = vec![]; - while !parser.done() { - if let Ok(res) = parse_fn(&mut parser) { - results.push(res); - } else { - parser_err = true; - break; - } - // consume newline that separates test cases - if parser.peek() == Some(TokenKind::Newline) { - parser.next().unwrap(); - } + let mut files = fe_common::files::FileStore::new(); + let id = files.add_file(test_name, src); + let mut parser = Parser::new(src, id); + + if let Ok(ast) = parse_fn(&mut parser) { + if !parser.diagnostics.is_empty() { + print_diagnostics(&parser.diagnostics, &files); + panic!("parse error"); } - to_ron_string_pretty(&results).unwrap() + to_ron_string_pretty(&ast).unwrap() } else { - if let Ok(res) = parse_fn(&mut parser) { - to_ron_string_pretty(&res).unwrap() - } else { - parser_err = true; - String::new() - } - }; - print_diagnostics(&parser.diagnostics, &file_store); - assert!(parser.diagnostics.is_empty()); - if parser_err { - eprintln!("parsing failed, but no diagnostics were generated. this should be fixed."); - let next = parser.next(); - if next.is_err() { - eprintln!("parser is at end of file"); + if parser.diagnostics.is_empty() { + eprintln!("parsing failed, but no diagnostics were generated. this should be fixed."); + let next = parser.next(); + if next.is_err() { + eprintln!("parser is at end of file"); + } else { + parser.error( + next.unwrap().span, + "this is the next token at time of parsing failure", + ); + print_diagnostics(&parser.diagnostics, &files); + } } else { - parser.error( - next.unwrap().span, - "this is the next token at time of parsing failure", - ); - print_diagnostics(&parser.diagnostics, &file_store); + print_diagnostics(&parser.diagnostics, &files); } - assert!(!parser_err); + panic!("parse failed"); } - - eprintln!("{}", &actual_ser); - assert_strings_eq!( - expected_ser, - actual_ser, - "\nParsing results did not match for {}", - fixture_name, - ); } -/// Include a test example file and parse it. -#[allow(unused_macros)] -macro_rules! test_fn { - ($name:ident, $parse_fn:expr) => { - test_fn! { $name, $parse_fn, Repeat::Yes } - }; - ($name:ident, $parse_fn:expr, $repeat:expr) => { +macro_rules! test_parse { + ($name:ident, $parse_fn:expr, $src:expr) => { #[test] fn $name() { - run_parser_test( - stringify!($name), - include_str!(concat!("fixtures/parsers/", stringify!($name), ".ron"),), - $parse_fn, - $repeat, - ) + assert_snapshot!(ast_string(stringify!($name), $parse_fn, $src)); } }; } -test_fn! {assert_stmt, functions::parse_stmt} -test_fn! {augassign_stmt, functions::parse_stmt} -test_fn! {base_type, types::parse_type_desc} -test_fn! {bitwise_and, expressions::parse_expr} -test_fn! {bitwise_or, expressions::parse_expr} -test_fn! {bitwise_xor, expressions::parse_expr} -// test_fn! {comparison, expressions::parse_expr} // TODO: `x in y` -test_fn! {compound_stmt, functions::parse_stmt} -test_fn! {conjunct, expressions::parse_expr} -test_fn! {contract_def, contracts::parse_contract_def} -test_fn! {disjunct, expressions::parse_expr} -test_fn! {emit_stmt, functions::parse_stmt} -test_fn! {event_def, types::parse_event_def} -test_fn! {event_field, types::parse_event_field} -test_fn! {expr, expressions::parse_expr} -test_fn! {factor, expressions::parse_expr} -test_fn! {for_stmt, functions::parse_for_stmt} -test_fn! {func_def, |par| { - let pub_qual = types::parse_opt_qualifier(par, TokenKind::Pub, - ast::PubQualifier {}); - functions::parse_fn_def(par, pub_qual) -}} - -test_fn! {func_stmt, |par| { - // to match old parser output - Ok(vec![functions::parse_stmt(par)?]) -}} -test_fn! {guest_book, module::parse_module, Repeat::No} -test_fn! {generic_type_desc, types::parse_type_desc} -test_fn! {if_stmt, functions::parse_if_stmt} -test_fn! {list, expressions::parse_expr} -test_fn! {map_type, types::parse_type_desc} -test_fn! {module_stmt, module::parse_module_stmt} -test_fn! {numbers, expressions::parse_expr} -test_fn! {op_precedence, expressions::parse_expr} -test_fn! {power, expressions::parse_expr} -test_fn! {primary, expressions::parse_expr} -test_fn! {return_stmt, functions::parse_stmt} -test_fn! {revert_stmt, functions::parse_stmt} -test_fn! {shift_expr, expressions::parse_expr} -test_fn! {simple_import, module::parse_simple_import} - -// TODO: import a.b (as c) -// test_fn! {simple_import_name, module::parse_simple_import} -test_fn! {small_stmt, functions::parse_stmt} - -test_fn! {struct_def, types::parse_struct_def} -test_fn! {sum, expressions::parse_expr} -test_fn! {target, expressions::parse_expr} -test_fn! {term, expressions::parse_expr} -test_fn! {tuple, expressions::parse_expr} -test_fn! {type_def, types::parse_type_def} -test_fn! {type_desc, types::parse_type_desc} -test_fn! {vardecl_stmt, functions::parse_stmt} -test_fn! {while_stmt, functions::parse_while_stmt} +test_parse! { expr_call1, expressions::parse_expr, "foo()" } +test_parse! { expr_call2, expressions::parse_expr, "foo(1,2,x=3)" } +test_parse! { expr_attr1, expressions::parse_expr, "foo.bar[0][y]" } +test_parse! { expr_attr2, expressions::parse_expr, "a[x].b[y](1)" } +test_parse! { expr_num1, expressions::parse_expr, "12345" } +test_parse! { expr_num2, expressions::parse_expr, "00001" } +test_parse! { expr_hex1, expressions::parse_expr, "0xbeefbeef" } +test_parse! { expr_hex2, expressions::parse_expr, "0xFEED1234" } +test_parse! { expr_string, expressions::parse_expr, r#""hi \tmom\n""# } +test_parse! { expr_list, expressions::parse_expr, "[]" } +test_parse! { expr_list2, expressions::parse_expr, "[x, y, z,]" } +test_parse! { expr_ternary, expressions::parse_expr, "x + 1 if y + 2 else z + 3" } +test_parse! { expr_group, expressions::parse_expr, "(1 + 2) * 3" } +test_parse! { expr_tuple1, expressions::parse_expr, "(1,)" } +test_parse! { expr_tuple2, expressions::parse_expr, "(1, 2, \n 3)" } +test_parse! { expr_tuple3, expressions::parse_expr, "(1, (2 + 3), (3 * 4, 5))" } + +test_parse! { ops_not, expressions::parse_expr, "x and not y" } +test_parse! { ops_math, expressions::parse_expr, "a + b * -c ** d / e % f" } +test_parse! { ops_pos, expressions::parse_expr, "+x" } +test_parse! { ops_neg, expressions::parse_expr, "-x" } +test_parse! { ops_bnot, expressions::parse_expr, "~x" } +// bitwise op precedence: shift > and > xor > or +test_parse! { ops_bit1, expressions::parse_expr, "a & b >> c" } +test_parse! { ops_bit2, expressions::parse_expr, "a ^ b & c" } +test_parse! { ops_bit3, expressions::parse_expr, "a | b ^ c" } +test_parse! { ops_shift, expressions::parse_expr, "a << b >> c" } +test_parse! { ops_bool, expressions::parse_expr, "a or b and c" } + +test_parse! { stmt_assert_no_msg, functions::parse_stmt, "assert x == y" } +test_parse! { stmt_assert_msg, functions::parse_stmt, "assert x == y, z" } +test_parse! { stmt_aug_add, functions::parse_stmt, "x += y" } +test_parse! { stmt_aug_sub, functions::parse_stmt, "x -= y" } +test_parse! { stmt_aug_mul, functions::parse_stmt, "x *= y" } +test_parse! { stmt_aug_div, functions::parse_stmt, "x /= y" } +test_parse! { stmt_aug_mod, functions::parse_stmt, "x %= y" } +test_parse! { stmt_aug_and, functions::parse_stmt, "x &= y" } +test_parse! { stmt_aug_or, functions::parse_stmt, "x |= y" } +test_parse! { stmt_aug_xor, functions::parse_stmt, "x ^= y" } +test_parse! { stmt_aug_lsh, functions::parse_stmt, "x <<= y" } +test_parse! { stmt_aug_rsh, functions::parse_stmt, "x >>= y" } +test_parse! { stmt_aug_exp, functions::parse_stmt, "x **= y" } +test_parse! { stmt_emit1, functions::parse_stmt, "emit Foo()" } +test_parse! { stmt_emit2, functions::parse_stmt, "emit Foo(1, 2, x=y)" } +test_parse! { stmt_return1, functions::parse_stmt, "return" } +test_parse! { stmt_return2, functions::parse_stmt, "return x" } +test_parse! { stmt_return3, functions::parse_stmt, "return not x" } +test_parse! { stmt_revert, functions::parse_stmt, "revert" } +test_parse! { stmt_if, functions::parse_stmt, "if a:\n b" } +test_parse! { stmt_if2, functions::parse_stmt, "if a:\n b \nelif c:\n d \nelif e: \n f \nelse:\n g" } +test_parse! { stmt_while, functions::parse_stmt, "while a > 5:\n a -= 1" } +test_parse! { stmt_for, functions::parse_stmt, "for a in b[0]:\n pass" } +test_parse! { stmt_for_else, functions::parse_stmt, "for a in b:\n c\nelse:\n d" } + +test_parse! { type_def, types::parse_type_def, "type X = map" } +test_parse! { type_name, types::parse_type_desc, "MyType" } +test_parse! { type_array, types::parse_type_desc, "address[25]" } +test_parse! { type_3d, types::parse_type_desc, "u256[4][4][4]" } +test_parse! { type_string, types::parse_type_desc, "string<100>" } +test_parse! { type_generic, types::parse_type_desc, "foo, d[10]>" } +test_parse! { type_map1, types::parse_type_desc, "map" } +test_parse! { type_map2, types::parse_type_desc, "map>" } +test_parse! { type_map3, types::parse_type_desc, "map>>" } +test_parse! { type_map4, types::parse_type_desc, "map < address , map < u8, u256 > >" } +test_parse! { type_tuple, types::parse_type_desc, "(u8, u16, address, map)" } + +test_parse! { fn_def, |par| functions::parse_fn_def(par, None), "def foo21(x: bool, y: address,) -> bool:\n x"} +test_parse! { event_def, types::parse_event_def, "event Foo:\n x: address\n idx y: u8" } + +test_parse! { import_simple, module::parse_simple_import, "import foo as bar, baz, bing as bop" } +test_parse! { struct_def, types::parse_struct_def, r#"struct S: + x: address + pub y: u8 + const z: u8 + pub const a: map +"# } + +test_parse! { contract_def, contracts::parse_contract_def, r#"contract Foo: + x: address + pub y: u8 + pub const z: map + pub def foo() -> u8: + return 10 + event Bar: + idx from: address +"# } + +test_parse! { module_stmts, module::parse_module, r#" +import foo as bar, baz as bum + +type X = map + +contract A: + pub const x: u256 = 10 + +contract B: + pub x: X +"# } + +test_parse! { guest_book, module::parse_module, r#" +type BookMsg = bytes[100] + +contract GuestBook: + pub guest_book: map + + event Signed: + idx book_msg: BookMsg + + pub def sign(book_msg: BookMsg): + self.guest_book[msg.sender] = book_msg + + emit Signed(book_msg=book_msg) + + pub def get_msg(addr: address) -> BookMsg: + return self.guest_book[addr] +"# } diff --git a/parser/tests/utils/mod.rs b/parser/tests/utils/mod.rs deleted file mode 100644 index 2fdd9b7e7c..0000000000 --- a/parser/tests/utils/mod.rs +++ /dev/null @@ -1,72 +0,0 @@ -use std::path::PathBuf; - -#[allow(dead_code)] -pub fn get_fixture_content(fixture_name: &str) -> (String, PathBuf) { - let fe_fixtures_path = std::env::var("FE_FIXTURES_PATH") - .expect("must set FE_FIXTURES_PATH env var to write fixtures"); - - let mut path = PathBuf::from(fe_fixtures_path); - path.push(fixture_name); - - let content = std::fs::read_to_string(&path).expect(&format!( - "could not read content from fixture path {}", - path.to_str().unwrap(), - )); - - (content, path) -} - -/// Parse file content containing a test example into a tuple of input text and -/// expected serialization. Input text and expected serialization are separated -/// by a line that only contains the string "---". -pub fn parse_fixture(input: &str) -> Result<(&str, &str), String> { - let parts: Vec<_> = input.split("\n---\n").collect(); - - if parts.len() != 2 { - Err(format!("expected 2 parts, got {}", parts.len())) - } else { - let input = parts[0]; - let parsed = parts[1]; - - // If single trailing newline is present, clip off - Ok(match parsed.chars().last() { - Some(c) if c == '\n' => (input, &parsed[..parsed.len() - 1]), - _ => (input, parsed), - }) - } -} - -/// Empty slice syntax is so ugly :/ -#[allow(unused_macros)] -macro_rules! empty_slice { - () => { - &[][..] - }; -} - -/// Include a test example file and parse it. -#[allow(unused_macros)] -macro_rules! include_test_example { - ($path:expr) => { - $crate::utils::parse_fixture(include_str!($path)) - .expect(&format!("Test example has wrong format {}", $path)) - }; -} - -/// Apply the function identified by `$func` to the fixture content in the files -/// given in `$($path),+`. -#[allow(unused_macros)] -macro_rules! do_with_fixtures { - ($func:expr, $($path:expr),+,) => {{ - do_with_fixtures!($func, $($path),+) - }}; - ($func:expr, $($path:expr),+) => {{ - let fixtures = vec![ - $(($path, include_test_example!($path))),+ - ]; - - for (filename, (input, expected_ser)) in fixtures { - $func(filename, input, expected_ser); - } - }}; -}