From a782a57a3f221a1a124aa7f51cbc67c406a73bd7 Mon Sep 17 00:00:00 2001 From: Zsolt Dollenstein Date: Tue, 28 Dec 2021 10:33:13 +0000 Subject: [PATCH] rebase and update rust files too --- libcst/_parser/parso/python/token.py | 2 +- libcst/_parser/py_whitespace_parser.py | 2 +- libcst/_parser/types/py_config.py | 2 +- libcst/_parser/types/py_token.py | 2 +- libcst/_parser/types/py_whitespace_state.py | 2 +- native/libcst/Cargo.toml | 2 +- native/libcst/benches/parser_benchmark.rs | 5 +++++ native/libcst/src/bin.rs | 5 +++++ native/libcst/src/lib.rs | 2 +- native/libcst/src/nodes/codegen.rs | 2 +- native/libcst/src/nodes/expression.rs | 2 +- native/libcst/src/nodes/inflate_helpers.rs | 5 +++++ native/libcst/src/nodes/macros.rs | 2 +- native/libcst/src/nodes/mod.rs | 5 +++++ native/libcst/src/nodes/module.rs | 2 +- native/libcst/src/nodes/op.rs | 2 +- native/libcst/src/nodes/parser_config.rs | 2 +- native/libcst/src/nodes/py_cached.rs | 2 +- native/libcst/src/nodes/statement.rs | 2 +- native/libcst/src/nodes/test_utils.rs | 2 +- native/libcst/src/nodes/traits.rs | 6 ++++++ native/libcst/src/nodes/whitespace.rs | 2 +- native/libcst/src/parser/errors.rs | 6 ++++++ native/libcst/src/parser/grammar.rs | 2 +- native/libcst/src/parser/mod.rs | 6 ++++++ native/libcst/src/parser/numbers.rs | 6 ++++++ native/libcst/src/py.rs | 5 +++++ native/libcst/src/tokenizer/core/mod.rs | 2 +- native/libcst/src/tokenizer/core/string_types.rs | 2 +- native/libcst/src/tokenizer/debug_utils.rs | 2 +- native/libcst/src/tokenizer/mod.rs | 2 +- native/libcst/src/tokenizer/operators.rs | 2 +- native/libcst/src/tokenizer/tests.rs | 2 +- native/libcst/src/tokenizer/text_position/char_width.rs | 2 +- native/libcst/src/tokenizer/text_position/mod.rs | 2 +- native/libcst/src/tokenizer/whitespace_parser.rs | 6 ++++++ native/libcst/tests/parser_roundtrip.rs | 6 ++++++ native/libcst_derive/src/codegen.rs | 6 ++++++ native/libcst_derive/src/inflate.rs | 5 +++++ native/libcst_derive/src/into_py.rs | 6 ++++++ native/libcst_derive/src/lib.rs | 6 ++++++ native/libcst_derive/src/parenthesized_node.rs | 6 ++++++ stubs/libcst_native/parser_config.pyi | 6 +----- stubs/libcst_native/token_type.pyi | 2 +- stubs/libcst_native/tokenize.pyi | 2 +- stubs/libcst_native/whitespace_parser.pyi | 2 +- stubs/libcst_native/whitespace_state.pyi | 3 +-- 47 files changed, 121 insertions(+), 36 deletions(-) diff --git a/libcst/_parser/parso/python/token.py b/libcst/_parser/parso/python/token.py index e4798f10e..de8837193 100644 --- a/libcst/_parser/parso/python/token.py +++ b/libcst/_parser/parso/python/token.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/libcst/_parser/py_whitespace_parser.py b/libcst/_parser/py_whitespace_parser.py index 25b4c9847..a3c53a97f 100644 --- a/libcst/_parser/py_whitespace_parser.py +++ b/libcst/_parser/py_whitespace_parser.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/libcst/_parser/types/py_config.py b/libcst/_parser/types/py_config.py index 6722a9eae..cb91d5580 100644 --- a/libcst/_parser/types/py_config.py +++ b/libcst/_parser/types/py_config.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/libcst/_parser/types/py_token.py b/libcst/_parser/types/py_token.py index 60ddb2a2e..7fac5eb8c 100644 --- a/libcst/_parser/types/py_token.py +++ b/libcst/_parser/types/py_token.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/libcst/_parser/types/py_whitespace_state.py b/libcst/_parser/types/py_whitespace_state.py index 41244b98a..99047590d 100644 --- a/libcst/_parser/types/py_whitespace_state.py +++ b/libcst/_parser/types/py_whitespace_state.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/native/libcst/Cargo.toml b/native/libcst/Cargo.toml index f009e9189..04b8013c2 100644 --- a/native/libcst/Cargo.toml +++ b/native/libcst/Cargo.toml @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/native/libcst/benches/parser_benchmark.rs b/native/libcst/benches/parser_benchmark.rs index 92f518839..7a12ebb32 100644 --- a/native/libcst/benches/parser_benchmark.rs +++ b/native/libcst/benches/parser_benchmark.rs @@ -1,3 +1,8 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + use std::{ path::{Component, PathBuf}, time::Duration, diff --git a/native/libcst/src/bin.rs b/native/libcst/src/bin.rs index 234b90178..1b42859a2 100644 --- a/native/libcst/src/bin.rs +++ b/native/libcst/src/bin.rs @@ -1,3 +1,8 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + use libcst_native::*; use std::{ env, diff --git a/native/libcst/src/lib.rs b/native/libcst/src/lib.rs index 6c809768f..e4355997d 100644 --- a/native/libcst/src/lib.rs +++ b/native/libcst/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/codegen.rs b/native/libcst/src/nodes/codegen.rs index 3b4f3e7a7..99cc377a9 100644 --- a/native/libcst/src/nodes/codegen.rs +++ b/native/libcst/src/nodes/codegen.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/expression.rs b/native/libcst/src/nodes/expression.rs index cb70d5722..c55e327d2 100644 --- a/native/libcst/src/nodes/expression.rs +++ b/native/libcst/src/nodes/expression.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/inflate_helpers.rs b/native/libcst/src/nodes/inflate_helpers.rs index 902ad0320..262de5acd 100644 --- a/native/libcst/src/nodes/inflate_helpers.rs +++ b/native/libcst/src/nodes/inflate_helpers.rs @@ -1,3 +1,8 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + use crate::{ nodes::traits::Result, tokenizer::{ diff --git a/native/libcst/src/nodes/macros.rs b/native/libcst/src/nodes/macros.rs index 1c47e3fad..76498b8e5 100644 --- a/native/libcst/src/nodes/macros.rs +++ b/native/libcst/src/nodes/macros.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/mod.rs b/native/libcst/src/nodes/mod.rs index 43981e874..f39cf6079 100644 --- a/native/libcst/src/nodes/mod.rs +++ b/native/libcst/src/nodes/mod.rs @@ -1,3 +1,8 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + mod whitespace; pub use whitespace::{ Comment, EmptyLine, Fakeness, Newline, ParenthesizableWhitespace, ParenthesizedWhitespace, diff --git a/native/libcst/src/nodes/module.rs b/native/libcst/src/nodes/module.rs index 8040be64b..03c6afb5b 100644 --- a/native/libcst/src/nodes/module.rs +++ b/native/libcst/src/nodes/module.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/op.rs b/native/libcst/src/nodes/op.rs index ef09e0a08..fa031d4c5 100644 --- a/native/libcst/src/nodes/op.rs +++ b/native/libcst/src/nodes/op.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/parser_config.rs b/native/libcst/src/nodes/parser_config.rs index 3b85eae28..acf140ee6 100644 --- a/native/libcst/src/nodes/parser_config.rs +++ b/native/libcst/src/nodes/parser_config.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/py_cached.rs b/native/libcst/src/nodes/py_cached.rs index e8a4dfd4a..0a7fe6914 100644 --- a/native/libcst/src/nodes/py_cached.rs +++ b/native/libcst/src/nodes/py_cached.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/statement.rs b/native/libcst/src/nodes/statement.rs index 63c8ab8ae..2247045b9 100644 --- a/native/libcst/src/nodes/statement.rs +++ b/native/libcst/src/nodes/statement.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/test_utils.rs b/native/libcst/src/nodes/test_utils.rs index 6a462c8df..109d471d8 100644 --- a/native/libcst/src/nodes/test_utils.rs +++ b/native/libcst/src/nodes/test_utils.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/nodes/traits.rs b/native/libcst/src/nodes/traits.rs index 155ae17aa..6c02c79ba 100644 --- a/native/libcst/src/nodes/traits.rs +++ b/native/libcst/src/nodes/traits.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use crate::{ tokenizer::whitespace_parser::{Config, WhitespaceError}, Codegen, CodegenState, Comma, EmptyLine, LeftParen, RightParen, diff --git a/native/libcst/src/nodes/whitespace.rs b/native/libcst/src/nodes/whitespace.rs index 89f2800e2..2c99a0489 100644 --- a/native/libcst/src/nodes/whitespace.rs +++ b/native/libcst/src/nodes/whitespace.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/parser/errors.rs b/native/libcst/src/parser/errors.rs index 641d96309..311c8339a 100644 --- a/native/libcst/src/parser/errors.rs +++ b/native/libcst/src/parser/errors.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use pyo3::types::{IntoPyDict, PyModule}; use pyo3::{IntoPy, PyErr, PyErrArguments, Python}; diff --git a/native/libcst/src/parser/grammar.rs b/native/libcst/src/parser/grammar.rs index f79594f21..a291e132d 100644 --- a/native/libcst/src/parser/grammar.rs +++ b/native/libcst/src/parser/grammar.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/parser/mod.rs b/native/libcst/src/parser/mod.rs index 76094afb9..9c2ac22f3 100644 --- a/native/libcst/src/parser/mod.rs +++ b/native/libcst/src/parser/mod.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + mod errors; mod grammar; mod numbers; diff --git a/native/libcst/src/parser/numbers.rs b/native/libcst/src/parser/numbers.rs index abe230657..1523750e4 100644 --- a/native/libcst/src/parser/numbers.rs +++ b/native/libcst/src/parser/numbers.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use once_cell::sync::Lazy; use regex::Regex; diff --git a/native/libcst/src/py.rs b/native/libcst/src/py.rs index 827e6b2d6..b938b691d 100644 --- a/native/libcst/src/py.rs +++ b/native/libcst/src/py.rs @@ -1,3 +1,8 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + use pyo3::prelude::*; #[pymodule] diff --git a/native/libcst/src/tokenizer/core/mod.rs b/native/libcst/src/tokenizer/core/mod.rs index 7c9f06841..5e8c29a15 100644 --- a/native/libcst/src/tokenizer/core/mod.rs +++ b/native/libcst/src/tokenizer/core/mod.rs @@ -1,4 +1,4 @@ -// This implementation is Copyright (c) Facebook, Inc. and its affiliates. +// This implementation is Copyright (c) Meta Platforms, Inc. and its affiliates. // // CPython 3.10.0a5 and the original C code this is based on is // Copyright (c) 2001-2021 Python Software Foundation; All Rights Reserved diff --git a/native/libcst/src/tokenizer/core/string_types.rs b/native/libcst/src/tokenizer/core/string_types.rs index 0d14d1e83..27f0be362 100644 --- a/native/libcst/src/tokenizer/core/string_types.rs +++ b/native/libcst/src/tokenizer/core/string_types.rs @@ -1,4 +1,4 @@ -// This implementation is Copyright (c) Facebook, Inc. and its affiliates. +// This implementation is Copyright (c) Meta Platforms, Inc. and its affiliates. // // CPython 3.10.0a5 and the original C code this is based on is // Copyright (c) 2001-2021 Python Software Foundation; All Rights Reserved diff --git a/native/libcst/src/tokenizer/debug_utils.rs b/native/libcst/src/tokenizer/debug_utils.rs index 8e646f8d9..543258a10 100644 --- a/native/libcst/src/tokenizer/debug_utils.rs +++ b/native/libcst/src/tokenizer/debug_utils.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/tokenizer/mod.rs b/native/libcst/src/tokenizer/mod.rs index e900f511d..60f1a20dc 100644 --- a/native/libcst/src/tokenizer/mod.rs +++ b/native/libcst/src/tokenizer/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/tokenizer/operators.rs b/native/libcst/src/tokenizer/operators.rs index e3098cfa1..94f708050 100644 --- a/native/libcst/src/tokenizer/operators.rs +++ b/native/libcst/src/tokenizer/operators.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/tokenizer/tests.rs b/native/libcst/src/tokenizer/tests.rs index d839e815a..6b4dfbb1a 100644 --- a/native/libcst/src/tokenizer/tests.rs +++ b/native/libcst/src/tokenizer/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/tokenizer/text_position/char_width.rs b/native/libcst/src/tokenizer/text_position/char_width.rs index 84f364052..879e12834 100644 --- a/native/libcst/src/tokenizer/text_position/char_width.rs +++ b/native/libcst/src/tokenizer/text_position/char_width.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/tokenizer/text_position/mod.rs b/native/libcst/src/tokenizer/text_position/mod.rs index b69054849..f94d73110 100644 --- a/native/libcst/src/tokenizer/text_position/mod.rs +++ b/native/libcst/src/tokenizer/text_position/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) Facebook, Inc. and its affiliates. +// Copyright (c) Meta Platforms, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/native/libcst/src/tokenizer/whitespace_parser.rs b/native/libcst/src/tokenizer/whitespace_parser.rs index e624bc3df..c3eedd02b 100644 --- a/native/libcst/src/tokenizer/whitespace_parser.rs +++ b/native/libcst/src/tokenizer/whitespace_parser.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use crate::nodes::{ Comment, EmptyLine, Fakeness, Newline, ParenthesizableWhitespace, ParenthesizedWhitespace, SimpleWhitespace, TrailingWhitespace, diff --git a/native/libcst/tests/parser_roundtrip.rs b/native/libcst/tests/parser_roundtrip.rs index 2b8c79dd8..a00fa835c 100644 --- a/native/libcst/tests/parser_roundtrip.rs +++ b/native/libcst/tests/parser_roundtrip.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use difference::assert_diff; use itertools::Itertools; use libcst_native::{parse_module, prettify_error, Codegen}; diff --git a/native/libcst_derive/src/codegen.rs b/native/libcst_derive/src/codegen.rs index 208d5104f..0f895296f 100644 --- a/native/libcst_derive/src/codegen.rs +++ b/native/libcst_derive/src/codegen.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use proc_macro::TokenStream; use quote::{quote, quote_spanned}; use syn::{self, spanned::Spanned, Data, DataEnum, DeriveInput, Fields, FieldsUnnamed}; diff --git a/native/libcst_derive/src/inflate.rs b/native/libcst_derive/src/inflate.rs index 6223a2565..323160c11 100644 --- a/native/libcst_derive/src/inflate.rs +++ b/native/libcst_derive/src/inflate.rs @@ -1,3 +1,8 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + use proc_macro::TokenStream; use quote::{quote, quote_spanned}; use syn::{self, spanned::Spanned, Data, DataEnum, DeriveInput, Fields, FieldsUnnamed}; diff --git a/native/libcst_derive/src/into_py.rs b/native/libcst_derive/src/into_py.rs index 26da5fca6..5b7dad7c2 100644 --- a/native/libcst_derive/src/into_py.rs +++ b/native/libcst_derive/src/into_py.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use proc_macro::TokenStream; use quote::{format_ident, quote, quote_spanned, ToTokens}; use syn::{ diff --git a/native/libcst_derive/src/lib.rs b/native/libcst_derive/src/lib.rs index 4a687becf..679311d2d 100644 --- a/native/libcst_derive/src/lib.rs +++ b/native/libcst_derive/src/lib.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + mod inflate; use inflate::impl_inflate; mod parenthesized_node; diff --git a/native/libcst_derive/src/parenthesized_node.rs b/native/libcst_derive/src/parenthesized_node.rs index 52d2aab45..a0285e27c 100644 --- a/native/libcst_derive/src/parenthesized_node.rs +++ b/native/libcst_derive/src/parenthesized_node.rs @@ -1,3 +1,9 @@ +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree + + use proc_macro::TokenStream; use quote::{quote, quote_spanned}; use syn::{spanned::Spanned, Data, DataEnum, DeriveInput, Fields, FieldsUnnamed}; diff --git a/stubs/libcst_native/parser_config.pyi b/stubs/libcst_native/parser_config.pyi index 0165df79e..412da05ef 100644 --- a/stubs/libcst_native/parser_config.pyi +++ b/stubs/libcst_native/parser_config.pyi @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. @@ -14,11 +14,9 @@ class BaseWhitespaceParserConfig: lines: Sequence[str], default_newline: str, ) -> BaseWhitespaceParserConfig: ... - lines: Sequence[str] default_newline: str - class ParserConfig(BaseWhitespaceParserConfig): def __new__( cls, @@ -31,7 +29,6 @@ class ParserConfig(BaseWhitespaceParserConfig): version: PythonVersionInfo, future_imports: FrozenSet[str], ) -> BaseWhitespaceParserConfig: ... - # lines is inherited encoding: str default_indent: str @@ -40,5 +37,4 @@ class ParserConfig(BaseWhitespaceParserConfig): version: PythonVersionInfo future_imports: FrozenSet[str] - def parser_config_asdict(config: ParserConfig) -> Mapping[str, Any]: ... diff --git a/stubs/libcst_native/token_type.pyi b/stubs/libcst_native/token_type.pyi index a0dd81790..4dacfad7e 100644 --- a/stubs/libcst_native/token_type.pyi +++ b/stubs/libcst_native/token_type.pyi @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/stubs/libcst_native/tokenize.pyi b/stubs/libcst_native/tokenize.pyi index bbcbeab01..91c6d2e9b 100644 --- a/stubs/libcst_native/tokenize.pyi +++ b/stubs/libcst_native/tokenize.pyi @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/stubs/libcst_native/whitespace_parser.pyi b/stubs/libcst_native/whitespace_parser.pyi index 291f6dc6f..b2b51b54f 100644 --- a/stubs/libcst_native/whitespace_parser.pyi +++ b/stubs/libcst_native/whitespace_parser.pyi @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. diff --git a/stubs/libcst_native/whitespace_state.pyi b/stubs/libcst_native/whitespace_state.pyi index da43bd542..82db95278 100644 --- a/stubs/libcst_native/whitespace_state.pyi +++ b/stubs/libcst_native/whitespace_state.pyi @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. @@ -7,7 +7,6 @@ class WhitespaceState: def __new__( cls, line: int, column: int, absolute_indent: str, is_parenthesized: bool ) -> WhitespaceState: ... - line: int # one-indexed (to match parso's behavior) column: int # zero-indexed (to match parso's behavior) # What to look for when executing `_parse_indent`.