1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! What the two shell dialects share: the tag tables of issue #150, and — since
//! issue #151 — their string-based *host* half.
//!
//! `tree-sitter-zsh` is a fork of `tree-sitter-bash`, and `concrete-languages.md`
//! documents the two Quilt languages as near-equivalent — "a separate target with
//! Bash-specific quoting semantics". Tag sets maintained as two independent
//! `match` arms in two files therefore drift, silently, and that is what issue
//! #150 found.
//!
//! The `arity` half of that drift is no longer answered here. Issue #202 derives
//! each language's variadic tags from its own vendored `grammar.json`
//! (`quilt/src/langs/arity.rs`, written by `bin/gen-arity`), which fixes the
//! drift at its source rather than by asking two dialects to share one
//! hand-written answer: a construct the two grammars spell the same way now
//! classifies the same way because the *grammars* agree, and where they genuinely
//! differ — zsh's `function_definition` is `repeat1(field('name', …))`, so
//! `function a b c { … }` defines three functions at once — the tables differ
//! too, truthfully. `bash_and_zsh_agree_on_shared_kinds` in
//! `quilt-conformance/tests/grammar_tags.rs` guards that weaker claim and pins
//! each exception with its reason.
//!
//! What stays here is the part no grammar rule answers: which tags name an
//! *expression* rather than a statement. That is a Quilt-level judgement about
//! how to label a squashed fragment, so it has no derivation to fall back on and
//! is shared for exactly the reason #150 gives.
//!
//! [`meta`] and [`ops`] are the host half (#151): the shells are no longer
//! target-only. They are shared for the same reason once more — the two
//! dialects double-quote identically, so one implementation carrying a
//! [`meta::ShellDialect`] marker is a single place to fix rather than two copies
//! to keep in step.
/// Tags that are shell "expressions" rather than statements.
///
/// Used only to label a squashed single-fragment quote (`TSProvider::unwrap`),
/// so the label is advisory — but it was drifting the same way the arity tables
/// were, and for the same reason, so it is shared for the same reason.