From 39984b27db8358f7b5bdcaed2526fc1d2b543007 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Sat, 3 Jul 2021 15:04:52 +0200 Subject: [PATCH] Janitor: Fix spelling in comments --- api/sixtyfps-cpp/docs/intro.md | 2 +- api/sixtyfps-cpp/include/sixtyfps_interpreter.h | 4 ++-- api/sixtyfps-cpp/include/sixtyfps_sharedvector.h | 6 +++--- docs/building.md | 4 ++-- sixtyfps_compiler/generator/cpp.rs | 2 +- sixtyfps_compiler/parser.rs | 10 +++++----- sixtyfps_runtime/corelib/input.rs | 4 ++-- sixtyfps_runtime/corelib/window.rs | 4 ++-- tools/fmt/main.rs | 10 +++++----- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/api/sixtyfps-cpp/docs/intro.md b/api/sixtyfps-cpp/docs/intro.md index eab7abb43..9870a713f 100644 --- a/api/sixtyfps-cpp/docs/intro.md +++ b/api/sixtyfps-cpp/docs/intro.md @@ -11,4 +11,4 @@ which features syntax highlighting and live design preview. For a quick edit and preview cycle, you can also use the `sixtyfps-viewer` command line tool, which can be installed using `cargo install sixtyfps-viewer`, if you have [Cargo](https://marketplace.visualstudio.com/items?itemName=SixtyFPS.sixtyfps-vscode) installed. -In the next section you will learn how to install the SixtyFPS C++ library and the CMake build system integration. \ No newline at end of file +In the next section you will learn how to install the SixtyFPS C++ library and the CMake build system integration. diff --git a/api/sixtyfps-cpp/include/sixtyfps_interpreter.h b/api/sixtyfps-cpp/include/sixtyfps_interpreter.h index cf6f52dbb..13fa4f96e 100644 --- a/api/sixtyfps-cpp/include/sixtyfps_interpreter.h +++ b/api/sixtyfps-cpp/include/sixtyfps_interpreter.h @@ -181,7 +181,7 @@ public: cbindgen_private::sixtyfps_interpreter_struct_iterator_destructor(&inner); } } - // FIXME i believe iterator are supposed to be copy constructible + // FIXME I believe iterators are supposed to be copy constructible iterator(const iterator &) = delete; iterator &operator=(const iterator &) = delete; /// Move-constructs a new iterator from \a other. @@ -244,7 +244,7 @@ private: /// Note that models are only represented in one direction: You can create a sixtyfps::Model /// in C++, store it in a std::shared_ptr and construct Value from it. Then you can set it on a /// property in your .60 code that was declared to be either an array (`property <[sometype]> foo;`) -/// or an object literal (`property <{foo: string, bar: int}> myprop;`). Such properties are dynamic +/// or an object literal (`property <{foo: string, bar: int}> my_prop;`). Such properties are dynamic /// and accept models implemented in C++. /// /// ``` diff --git a/api/sixtyfps-cpp/include/sixtyfps_sharedvector.h b/api/sixtyfps-cpp/include/sixtyfps_sharedvector.h index dfc5967bc..1adbcde2d 100644 --- a/api/sixtyfps-cpp/include/sixtyfps_sharedvector.h +++ b/api/sixtyfps-cpp/include/sixtyfps_sharedvector.h @@ -104,12 +104,12 @@ struct SharedVector /// Returns true if there are no elements on this vector; false otherwise. bool empty() const { return inner->size == 0; } - /// This indexing operator returns a reference to the \a index'th element of this vector. + /// This indexing operator returns a reference to the \a `index`th element of this vector. T &operator[](std::size_t index) { return begin()[index]; } - /// This indexing operator returns a const reference to the \a index'th element of this vector. + /// This indexing operator returns a const reference to the \a `index`th element of this vector. const T &operator[](std::size_t index) const { return begin()[index]; } - /// Returns a reference to the \a index'th element of this vector. + /// Returns a reference to the \a `index`th element of this vector. const T &at(std::size_t index) const { return begin()[index]; } /// Appends the \a value as a new element to the end of this vector. diff --git a/docs/building.md b/docs/building.md index 5cfea6a07..171ca9b1b 100644 --- a/docs/building.md +++ b/docs/building.md @@ -15,8 +15,8 @@ Once this is done, you should have the ```rustc``` compiler and the ```cargo``` For Linux a few additional packages beyond the usual build essentials are needed for development and running apps: - * xcb (`libxcb-shape0-dev` `libxcb-xfixes0-dev` on debian based distros) - * xkbcommon (`libxkbcommon-dev` on debian based distros) + * xcb (`libxcb-shape0-dev` `libxcb-xfixes0-dev` on debian based distributions) + * xkbcommon (`libxkbcommon-dev` on debian based distributions) ### macOS diff --git a/sixtyfps_compiler/generator/cpp.rs b/sixtyfps_compiler/generator/cpp.rs index d70be7cc8..ba01754dc 100644 --- a/sixtyfps_compiler/generator/cpp.rs +++ b/sixtyfps_compiler/generator/cpp.rs @@ -150,7 +150,7 @@ mod cpp_ast { if self.is_friend { write!(f, "friend ")?; } - // all functions are inlines because we are in a header + // all functions are `inline` because we are in a header write!(f, "inline ")?; if !self.is_constructor_or_destructor { write!(f, "auto ")?; diff --git a/sixtyfps_compiler/parser.rs b/sixtyfps_compiler/parser.rs index fd74f8fff..230b5bad8 100644 --- a/sixtyfps_compiler/parser.rs +++ b/sixtyfps_compiler/parser.rs @@ -330,7 +330,7 @@ declare_syntax! { /// `-> type` (but without the ->) ReturnType -> [Type], CallbackConnection -> [ *DeclaredIdentifier, CodeBlock ], - /// Declaration of a propery. + /// Declaration of a property. PropertyDeclaration-> [ ?Type , DeclaredIdentifier, ?BindingExpression, ?TwoWayBinding ], /// QualifiedName are the properties name PropertyAnimation-> [ *QualifiedName, *Binding ], @@ -351,7 +351,7 @@ declare_syntax! { Expression-> [ ?Expression, ?FunctionCallExpression, ?SelfAssignment, ?ConditionalExpression, ?QualifiedName, ?BinaryExpression, ?Array, ?ObjectLiteral, ?UnaryOpExpression, ?CodeBlock, ?StringTemplate, ?AtImageUrl, ?AtLinearGradient], - /// Concetenate the Expressions to make a string (usually expended from a template string) + /// Concatenate the Expressions to make a string (usually expended from a template string) StringTemplate -> [*Expression], /// `@image-url("foo.png")` AtImageUrl -> [], @@ -381,7 +381,7 @@ declare_syntax! { StatePropertyChange -> [ QualifiedName, BindingExpression ], /// `transitions: [...]` Transitions -> [*Transition], - /// There is an idientfier "in" or "out", the DeclaredIdentifier is the state name + /// There is an identifier "in" or "out", the DeclaredIdentifier is the state name Transition -> [DeclaredIdentifier, *PropertyAnimation], /// Export a set of declared components by name ExportsList -> [ *ExportSpecifier, ?Component, *StructDeclaration ], @@ -487,7 +487,7 @@ mod parser_trait { fn peek(&mut self) -> Token { self.nth(0) } - /// Peek the n'th token, not including whitespace and comments + /// Peek the `n`th token, not including whitespace and comments fn nth(&mut self, n: usize) -> Token; fn consume(&mut self); fn error(&mut self, e: impl Into); @@ -601,7 +601,7 @@ impl Parser for DefaultParser<'_> { self.builder.finish_node(); } - /// Peek the n'th token, not including whitespace and comments + /// Peek the `n`th token, not including whitespace and comments fn nth(&mut self, mut n: usize) -> Token { self.consume_ws(); let mut c = self.cursor; diff --git a/sixtyfps_runtime/corelib/input.rs b/sixtyfps_runtime/corelib/input.rs index c2d24867f..f5fee1e6a 100644 --- a/sixtyfps_runtime/corelib/input.rs +++ b/sixtyfps_runtime/corelib/input.rs @@ -28,7 +28,7 @@ use std::rc::Rc; pub enum MouseEvent { /// The mouse was pressed MousePressed { pos: Point }, - /// The mouse was relased + /// The mouse was released MouseReleased { pos: Point }, /// The mouse position has changed MouseMoved { pos: Point }, @@ -267,7 +267,7 @@ pub struct MouseInputState { grabbed: bool, } -/// Process the `mouse_event` on the `component`, the `mouse_grabber_stack` is the prebious stack +/// Process the `mouse_event` on the `component`, the `mouse_grabber_stack` is the previous stack /// of mouse grabber. /// Returns a new mouse grabber stack. pub fn process_mouse_input( diff --git a/sixtyfps_runtime/corelib/window.rs b/sixtyfps_runtime/corelib/window.rs index c9f288891..a9dd09180 100644 --- a/sixtyfps_runtime/corelib/window.rs +++ b/sixtyfps_runtime/corelib/window.rs @@ -30,7 +30,7 @@ use std::rc::{Rc, Weak}; pub trait PlatformWindow { /// Registers the window with the windowing system. fn show(self: Rc); - /// Deregisters the window from the windowing system. + /// De-registers the window from the windowing system. fn hide(self: Rc); /// Issue a request to the windowing system to re-render the contents of the window. This is typically an asynchronous /// request. @@ -311,7 +311,7 @@ impl core::ops::Deref for Window { pub struct ComponentWindow(pub std::rc::Rc); impl ComponentWindow { - /// Creates a new instance of a CompomentWindow based on the given window implementation. Only used + /// Creates a new instance of a ComponentWindow based on the given window implementation. Only used /// internally. pub fn new(window_impl: std::rc::Rc) -> Self { Self(window_impl) diff --git a/tools/fmt/main.rs b/tools/fmt/main.rs index 0c1c30e2c..3ba08a4d3 100644 --- a/tools/fmt/main.rs +++ b/tools/fmt/main.rs @@ -8,13 +8,13 @@ Please contact info@sixtyfps.io for more information. LICENSE END */ /*! - Work in progress for a formater. + Work in progress for a formatter. Use like this to format a file: ```sh cargo run sixtyfps-fmt -- -i some_file.60 ``` - Some code in this main.rs file is duplicated with the syntax_updator, i guess it could + Some code in this main.rs file is duplicated with the syntax_updater, i guess it could be refactored in a separate utility crate or module or something. The [`TokenWriter`] trait is meant to be able to support the LSP later as the @@ -33,7 +33,7 @@ struct Cli { #[structopt(name = "path to .60 file(s)", parse(from_os_str))] paths: Vec, - /// modify the file inline instead of outputing to stdout + /// modify the file inline instead of printing to stdout #[structopt(short, long)] inline: bool, } @@ -54,7 +54,7 @@ fn main() -> std::io::Result<()> { Ok(()) } -/// FIXME! this is duplicated with the updator +/// FIXME! this is duplicated with the updater fn process_rust_file(source: String, mut file: impl Write) -> std::io::Result<()> { let mut source_slice = &source[..]; let sixtyfps_macro = format!("{}!", "sixtyfps"); // in a variable so it does not appear as is @@ -109,7 +109,7 @@ fn process_rust_file(source: String, mut file: impl Write) -> std::io::Result<() return file.write_all(source_slice.as_bytes()); } -/// FIXME! this is duplicated with the updator +/// FIXME! this is duplicated with the updater fn process_markdown_file(source: String, mut file: impl Write) -> std::io::Result<()> { let mut source_slice = &source[..]; const CODE_FENCE_START: &'static str = "```60\n";