Skip to content

Commit e1f6a82

Browse files
authored
Merge pull request #1130 from jaytaph/removal
removed em-dashes from most of the comments and texts
2 parents c746ec5 + 2ba3290 commit e1f6a82

114 files changed

Lines changed: 489 additions & 489 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/gosub-screenshot/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Headless screenshot tool: loads a URL through the full gosub render pipeline and
22
//! saves the result as a PNG without opening a window.
33
//!
4-
//! Uses the Skia backend for **CPU** rasterization no GPU, no wgpu adapter, and no
4+
//! Uses the Skia backend for **CPU** rasterization - no GPU, no wgpu adapter, and no
55
//! system libraries (skia-safe is statically linked). The page is rasterized into small
66
//! cached tiles (`ExternalHandle::TileCache`) which we composite here, so there is no
77
//! GPU texture-size limit and pages of any height can be captured.
@@ -104,7 +104,7 @@ fn main() {
104104

105105
let url = Url::parse(&url_str).expect("invalid URL");
106106

107-
// ── Engine setup (CPU backend no GPU) ───────────────────────────────────
107+
// ── Engine setup (CPU backend - no GPU) ───────────────────────────────────
108108
#[cfg(all(feature = "backend_skia", not(feature = "backend_cairo")))]
109109
let backend = SkiaBackend::new();
110110
#[cfg(feature = "backend_cairo")]
@@ -320,7 +320,7 @@ fn main() {
320320
// Premultiplied source-over the *existing* buffer (initialised to white), not a
321321
// fixed white background: result = src_rgb + (255 - src_a)/255 * dst_rgb. Blending
322322
// over the buffer (rather than overwriting) lets an upper layer's transparent
323-
// regions reveal content from layers already composited beneath it e.g. a
323+
// regions reveal content from layers already composited beneath it - e.g. a
324324
// promoted `position: fixed` navbar tile must not erase the rows behind it.
325325
let inv_a = 255u32 - a;
326326
let (d0, d1, d2) = (

crates/gosub_config/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct Subscription {
6464

6565
/// A shareable handle to a configuration store. Cloning is cheap (an `Arc` bump); all clones refer
6666
/// to the same underlying store, so subscriptions and writes made through one clone are visible to
67-
/// the others. This is the per-engine entry point to configuration construct one and hand clones
67+
/// the others. This is the per-engine entry point to configuration - construct one and hand clones
6868
/// to whichever components need it.
6969
#[derive(Clone)]
7070
pub struct Config(Arc<RwLock<ConfigStore>>);
@@ -73,7 +73,7 @@ impl Config {
7373
/// Creates a config from the given settings schema, backed by a volatile in-memory store.
7474
///
7575
/// `gosub_config` is agnostic of which settings exist: the caller (e.g. the engine) supplies
76-
/// the schema the set of known keys with their defaults and constraints. Only keys present
76+
/// the schema - the set of known keys with their defaults and constraints. Only keys present
7777
/// in the schema can be read or written.
7878
#[must_use]
7979
pub fn new(schema: impl IntoIterator<Item = SettingInfo>) -> Self {
@@ -106,7 +106,7 @@ impl Config {
106106
/// `set`. Returns the number of settings actually merged.
107107
pub fn merge(&self, other: &Config, namespace: &str) -> usize {
108108
// Snapshot `other` first (its read guard is released at the end of this statement) so that
109-
// acquiring our own write lock can never overlap with it safe even if `other` is a clone
109+
// acquiring our own write lock can never overlap with it - safe even if `other` is a clone
110110
// of `self`.
111111
let entries = other.0.read().snapshot();
112112
self.0.write().absorb(entries, namespace)

crates/gosub_css3/examples/css_corpus_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! Real-world validation harness for the CSS value-syntax matcher.
66
//!
77
//! Runs a directory of `.css` files through the property-definition matcher and reports
8-
//! how much real-world CSS it accepts, plus a ranked breakdown of what it rejects the
8+
//! how much real-world CSS it accepts, plus a ranked breakdown of what it rejects - the
99
//! rejections are the interesting output, since they point at the next matcher gaps.
1010
//!
1111
//! Note: normal parsing does NOT run the matcher (`ParserConfig::match_values` is inert),

crates/gosub_css3/src/colors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl From<&str> for RgbColor {
6868
return RgbColor::new(rgb.get_red(), rgb.get_green(), rgb.get_blue(), 255.0);
6969
}
7070
if value.starts_with("rgba(") {
71-
// Rgba function alpha from colors_transform is in 0..1 range; scale to 0..255
71+
// Rgba function - alpha from colors_transform is in 0..1 range; scale to 0..255
7272
let Ok(rgb) = Rgb::from_str(value) else {
7373
return RgbColor::default();
7474
};
@@ -82,7 +82,7 @@ impl From<&str> for RgbColor {
8282
return RgbColor::new(rgb.get_red(), rgb.get_green(), rgb.get_blue(), 255.0);
8383
}
8484
if value.starts_with("hsla(") {
85-
// hsla() alpha from colors_transform is in 0..1 range; scale to 0..255
85+
// hsla() - alpha from colors_transform is in 0..1 range; scale to 0..255
8686
let Ok(hsl) = Hsl::from_str(value) else {
8787
return RgbColor::default();
8888
};

crates/gosub_css3/src/functions/math.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use crate::stylesheet::CssValue;
99
/// returned as a `Unit(_, "px")`.
1010
///
1111
/// Returns `None` (leaving the function unresolved) when any operand is not a plain
12-
/// length we can compare e.g. a percentage (no containing block here) or a nested
13-
/// function so callers can fall back to the original token.
12+
/// length we can compare - e.g. a percentage (no containing block here) or a nested
13+
/// function - so callers can fall back to the original token.
1414
pub fn resolve_math(func: &str, values: &[CssValue]) -> Option<CssValue> {
1515
// Drop the comma separators that the parser keeps between arguments.
1616
let operands: Option<Vec<f32>> = values

crates/gosub_css3/src/functions/var.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn resolve_var(values: &[CssValue], custom_props: &HashMap<String, CssValue>
1010
return vec![value.clone()];
1111
}
1212

13-
// Variable not found use the fallback if provided
13+
// Variable not found - use the fallback if provided
1414
if let Some(fallback) = values.get(1).cloned() {
1515
return vec![fallback];
1616
}

crates/gosub_css3/src/matcher/property_definitions.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl CssDefinitions {
316316
} => {
317317
// A quoted reference (`<'name'>`) denotes a PROPERTY per the CSS value
318318
// definition syntax, so resolve it from the property grammar before
319-
// anything else a same-named value type (e.g. the `<top>` used by
319+
// anything else - a same-named value type (e.g. the `<top>` used by
320320
// `<shape>`) must not shadow the property reference in `inset: <'top'>{1,4}`.
321321
if *quoted && datatype != prop_name {
322322
if let Some(resolved) = self.resolve_property_reference(datatype, multipliers) {
@@ -904,7 +904,7 @@ mod tests {
904904
],
905905
),
906906
(
907-
// `<'margin-top'>{1,4}` the 1-to-4 value box shorthand (ranged multiplier).
907+
// `<'margin-top'>{1,4}` - the 1-to-4 value box shorthand (ranged multiplier).
908908
"margin",
909909
&[
910910
("10px", true),
@@ -924,7 +924,7 @@ mod tests {
924924
&[("10px", true), ("1px 2px 3px 4px", true), ("auto", false)],
925925
),
926926
(
927-
// `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` a `||`
927+
// `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` - a `||`
928928
// any-order group with an embedded optional operand.
929929
"flex",
930930
&[
@@ -954,7 +954,7 @@ mod tests {
954954
),
955955
(
956956
// `[ ... <'font-size'> [ / <'line-height'> ]? <'font-family'># ] | ...`
957-
// exercises the `/` line-height separator inside a shorthand.
957+
// - exercises the `/` line-height separator inside a shorthand.
958958
"font",
959959
&[
960960
("12px serif", true),
@@ -977,7 +977,7 @@ mod tests {
977977
],
978978
),
979979
(
980-
// `[ <bg-layer> , ]* <final-bg-layer>` a single layer needs no comma, and
980+
// `[ <bg-layer> , ]* <final-bg-layer>` - a single layer needs no comma, and
981981
// additional layers are comma-separated. The generator rewrites the
982982
// linearized `<bg-layer>#? , <final-bg-layer>` idiom into this spec form.
983983
"background",
@@ -1016,7 +1016,7 @@ mod tests {
10161016
}
10171017

10181018
/// Coverage for the multipliers not exercised by the combinator regression test
1019-
/// (`*` zero-or-more, `!` at-least-one-in-group, and the ranged `{min,max}` form
1019+
/// (`*` zero-or-more, `!` at-least-one-in-group, and the ranged `{min,max}` form -
10201020
/// as opposed to the fixed `{2}` count tested elsewhere).
10211021
#[test]
10221022
fn test_multiplier_coverage() {
@@ -1025,19 +1025,19 @@ mod tests {
10251025
}
10261026
let (a, b) = (|| str!("a"), || str!("b"));
10271027

1028-
// `*` zero or more, so the empty input is valid.
1028+
// `*` - zero or more, so the empty input is valid.
10291029
assert!(m("a*", &[]));
10301030
assert!(m("a*", &[a()]));
10311031
assert!(m("a*", &[a(), a(), a()]));
10321032

1033-
// `!` the group must produce at least one value even though every operand
1033+
// `!` - the group must produce at least one value even though every operand
10341034
// inside it is individually optional.
10351035
assert!(!m("[ a? b? ]!", &[]));
10361036
assert!(m("[ a? b? ]!", &[a()]));
10371037
assert!(m("[ a? b? ]!", &[b()]));
10381038
assert!(m("[ a? b? ]!", &[a(), b()]));
10391039

1040-
// `{min,max}` a genuine range (not the fixed `{2}` count): 1..=3 here.
1040+
// `{min,max}` - a genuine range (not the fixed `{2}` count): 1..=3 here.
10411041
assert!(!m("a{1,3}", &[]));
10421042
assert!(m("a{1,3}", &[a()]));
10431043
assert!(m("a{1,3}", &[a(), a(), a()]));
@@ -1134,7 +1134,7 @@ mod tests {
11341134
}
11351135

11361136
/// The `/` separating two `<grid-line>`s (and font-size/line-height etc.) is a
1137-
/// structural delimiter. The `<custom-ident>` catch-all used to consume it the
1137+
/// structural delimiter. The `<custom-ident>` catch-all used to consume it - the
11381138
/// optional ident tail in `[ <integer> && <custom-ident>? ]` ate the slash, so any
11391139
/// `grid-column` with a numeric or span left side and a second grid-line failed.
11401140
/// calc() bodies are preserved as raw text (the old stream-slice approach returned
@@ -1146,10 +1146,10 @@ mod tests {
11461146
/// the easing before the property name), and vendor-prefixed math functions.
11471147
/// Micro-gaps surfaced by the 66k-file external corpus: `background-clip: text`
11481148
/// (webref's <visual-box> misses it; use MDN's <bg-clip>), case-insensitive color
1149-
/// keywords, and percentage scale() the bare legacy `scale()` value def shadowed
1149+
/// keywords, and percentage scale() - the bare legacy `scale()` value def shadowed
11501150
/// the modern bracketed `<scale()>` under one loader key (Definition-typed entries
11511151
/// now win). The corpus's `margin-top: 0 \9` rejections are the IE hack, whose whole
1152-
/// point is that modern parsers reject it correct behavior, not a gap.
1152+
/// point is that modern parsers reject it - correct behavior, not a gap.
11531153
#[test]
11541154
fn test_external_corpus_micro_gaps() {
11551155
let defs = get_css_definitions();
@@ -1259,7 +1259,7 @@ mod tests {
12591259
assert!(ok("clip", "auto"));
12601260
assert!(!ok("clip", "banana"));
12611261
// <'top'> property references keep resolving to the property grammar, which
1262-
// accepts percentages the <top> value type (`<length> | auto`) does not.
1262+
// accepts percentages - the <top> value type (`<length> | auto`) does not.
12631263
assert!(ok("inset", "10% 20%"));
12641264
assert!(ok("inset", "auto"));
12651265
}
@@ -1354,7 +1354,7 @@ mod tests {
13541354

13551355
/// `<alpha()>` in `<color-function>` denotes a function named `alpha`, not a bare
13561356
/// numeric. When its builtin arm matched Zero/Number/Percentage, any bare `0` matched
1357-
/// `<color>` so box-shadow's `&&` group let a leading `0` offset claim the
1357+
/// `<color>` - so box-shadow's `&&` group let a leading `0` offset claim the
13581358
/// shadow-color slot, rejecting every zero-offset shadow.
13591359
#[test]
13601360
fn test_zero_offset_shadows_and_alpha_function() {
@@ -1435,7 +1435,7 @@ mod tests {
14351435
}
14361436

14371437
/// A value containing a `var()`/`env()` substitution is valid at parse time for any
1438-
/// property, wherever the substitution appears its grammar cannot be checked until
1438+
/// property, wherever the substitution appears - its grammar cannot be checked until
14391439
/// substitution happens (CSS Variables L1 §3).
14401440
#[test]
14411441
fn test_var_substitution() {

crates/gosub_css3/src/matcher/shorthands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ impl CssDefinitions {
556556
}
557557
}
558558

559-
// `border-radius` is `<lp>{1,4} [ / <lp>{1,4} ]?`, so unlike margin/padding
560-
// whose `{1,4}` sits on the top-level component the top-level component is a
559+
// `border-radius` is `<lp>{1,4} [ / <lp>{1,4} ]?`, so - unlike margin/padding
560+
// whose `{1,4}` sits on the top-level component - the top-level component is a
561561
// Juxtaposition group whose FIRST child carries the `{1,4}` multiplier (the second
562562
// child is the optional `/ <vertical-radii>` part). Detect that shape and drive the
563563
// same {1,4}-value box expansion.
@@ -578,7 +578,7 @@ impl CssDefinitions {
578578
});
579579

580580
if nested_quad {
581-
// [BR, BL, TR, TL] see comment above.
581+
// [BR, BL, TR, TL] - see comment above.
582582
for i in [2usize, 3, 1, 0] {
583583
shorthands.push(Shorthand {
584584
name: computed[i].clone(),

crates/gosub_css3/src/matcher/styling.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use crate::system::Css3System;
1818
// Matches a complete selector (all parts) against the given node(id).
1919
//
2020
// `pseudo` selects what we are matching against:
21-
// * `None` match the element itself. Any selector containing a `::pseudo-element`
21+
// * `None` - match the element itself. Any selector containing a `::pseudo-element`
2222
// part never matches (pseudo-elements are not the element).
23-
// * `Some("before")` match the `::before` pseudo-element of `node_id`. Only selectors that
23+
// * `Some("before")` - match the `::before` pseudo-element of `node_id`. Only selectors that
2424
// explicitly carry the matching `::before` part match; the rest of the
2525
// compound is matched against the originating element as usual.
2626
pub(crate) fn match_selector<C: HasDocument>(
@@ -512,7 +512,7 @@ impl CssProperty {
512512
// Bare numbers and percentages are ratios/multipliers and must keep their fractional
513513
// value: rounding `opacity: 0.15` to 0 makes an element vanish, `line-height: 1.7`
514514
// to 2.0 inflates every paragraph, `flex-grow: 0.5` to 1 doubles an item's share.
515-
// Relative units (em, rem, vw, vh) must not be rounded either 1.5em rounded to
515+
// Relative units (em, rem, vw, vh) must not be rounded either - 1.5em rounded to
516516
// 2.0em would make h2 render at h1 size. Only absolute lengths (px, pt, in, cm, mm)
517517
// are snapped to whole values here.
518518
match &self.used {

crates/gosub_css3/src/matcher/syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ fn parse_component(input: &str) -> IResult<&str, SyntaxComponent> {
870870
// Only apply an explicit multiplier suffix (one that actually consumed input).
871871
// `parse_multipliers` returns a default `[Once]` when no suffix is present; applying
872872
// that would clobber a component's own multipliers. This matters for single-element
873-
// groups such as `[ b{2} ]`, which unwrap to their inner component (`b{2}`) that
873+
// groups such as `[ b{2} ]`, which unwrap to their inner component (`b{2}`) - that
874874
// inner multiplier must survive.
875875
if rest.len() != input.len() {
876876
component.update_multipliers(multipliers.clone());

0 commit comments

Comments
 (0)