Issues in extended mode snippet extractor docs

Since I thoroughly looked through the snippet extractor docs recently (see this forum thread), I noticed a few errors in the extended mode docs.

I might just be misunderstanding the syntax somehow, but I double-checked and I think there’s some issues with the examples:

  • The example on lines 55-58 has Some in the result, but wouldn’t 10 + 20 remain instead after the # rule is applied?
  • The examples in the multiline modifier section seem to be missing the closing / for the multiline comment rules. The first example still works without it, but in the second example, the result would have a slash at the beginning: “/ const n = 15;”.
  • The first example in the examples section does have the closing /, but it seems to have some stray characters (?\) after the multiline modifier (-->>).
  • For the last example, wouldn’t the rule need the \p modifier to match ###[More Doc]###?

There also seems to be a few typos:

  • The ellipsis on line 19 has two dots (..) instead of three (...).
  • On line 28, “forces the parse to” seems like it should be “forces the parser to”.
  • On line 45, “Unlike the basic version rules apply to” is missing a comma: “Unlike the basic version, rules apply to”.
1 Like

Yeah, that looks right for the examples.

I think (Edit - making) the typo fixes are okay. Per Rules for Using Commas, With Examples | Grammarly commas often follow introductory clauses but don’t always especially for short ones. However, in this case I think adding a comma makes practical sense since someone might read “basic version rules” separate from “apply” and then get taken out of the text trying to figure it.

A couple of other typos

L067 “seperated” → “separated”
L169 “modifer” → “modifier”
L171 “modifer” → “modifier”
L186 “mutliline” → “multiline”
L191 “th” → “the”
L191 “rule rule” → “rule”
L202 “mutliline” → “multiline”
L221 “Ouput” → “Output”
L310 “asses” → “assess”

Grammar fix

L190 “By combining with the \j flag, This works great for lines that have trailing characters too.” → “Combining this with the \j flag works great for lines that have trailing characters too.”

2 Likes

Does that mean the current examples are correct, or that my suggested fixes are correct?

That’s exactly what happened to me the first time I read that sentence :sweat_smile:.

1 Like

Oh sorry, I meant your fixes made sense to me.