Commit 0f08ba4
committed
feat(languages): add F5 iRules language support
Add the `Irules` language (an F5 iRules / Tcl-scripting dialect) via the
crates.io-pinned `tree-sitter-irules` =0.1.1 grammar, gated behind a new
`irules` Cargo feature (enabled by `all-languages`). `.irule` / `.irules`.
Wiring & public API:
- enums codegen (Cargo.toml, languages.rs, macros.rs) plus the generated
src/languages/language_irules.rs; dispatch-coverage guard bumped to 22.
- Re-export IrulesCode / IrulesParser from lib.rs (additive new language,
minor bump per STABILITY.md); exhaustive big-code-analysis-py LANG arm.
Behaviour:
- Checker / Getter / Alterator impls. `when` / `on` / `trap` event
handlers and `proc` definitions are function spaces, so per-handler
metrics are reported (handlers count as functions in nom).
- Real metric impls: ABC, Cognitive, Cyclomatic (dedicated switch/arm
plus the `and`/`or` keyword operators), Exit (return-by-command-name,
iRules has no return node), Halstead, LoC, NArgs. The remaining metrics
use the shared defaults.
Tests & docs:
- Rust-parity per-metric tests, a malformed-input synthetic-Unit-root
test, a self-contained end-to-end integration test
(tests/irules_test.rs driving the public analyze() API), and
cross-language cyclomatic/cognitive parity entries vs Rust/Java/Tcl.
- Supported-languages list, cargo-features table, and CHANGELOG entry.
- HTML report gains an `irules` colour palette entry.
Halstead operand double-count fix: iRules' variable_substitution inner
leaf is the named `Id` (not Tcl's anonymous `Id2`), so every `$var` was
counted twice. get_op_type now excludes `Id` whose parent is a
VariableSubstitution; affected Halstead test values corrected.
.bca-baseline.toml refreshed for the added code's file-level metric
growth (per-function complexity stays within thresholds).1 parent 9787682 commit 0f08ba4
40 files changed
Lines changed: 2266 additions & 128 deletions
File tree
- big-code-analysis-book/src
- library
- big-code-analysis-cli/src
- snapshots
- big-code-analysis-py/src
- enums
- src
- tests
- src
- languages
- macros
- metrics
- tests
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
26 | 40 | | |
27 | 41 | | |
28 | 42 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
| |||
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| 224 | + | |
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments