File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: PMPL-1.0-or-later
2+ // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+ //
4+ // panic-attack V-lang API — Static analysis scanner client.
5+ module panic_attack
6+
7+ pub enum Severity {
8+ info
9+ warning
10+ @error
11+ critical
12+ }
13+
14+ pub enum ScanOp {
15+ assail
16+ ambush
17+ abduct
18+ adjudicate
19+ axial
20+ }
21+
22+ pub struct Finding {
23+ pub :
24+ file string
25+ line int
26+ severity Severity
27+ message string
28+ rule_id string
29+ }
30+
31+ fn C.panic_severity_compare (a int , b int ) int
32+ fn C.panic_severity_meets (severity int , threshold int ) int
33+ fn C.panic_valid_lang (lang_id int ) int
34+
35+ // severity_meets checks if a finding meets a minimum severity threshold.
36+ pub fn severity_meets (severity Severity, threshold Severity) bool {
37+ return C.panic_severity_meets (int (severity), int (threshold)) == 1
38+ }
39+
40+ // is_supported_lang checks if a language ID is supported (0-46).
41+ pub fn is_supported_lang (lang_id int ) bool {
42+ return C.panic_valid_lang (lang_id) == 1
43+ }
You can’t perform that action at this time.
0 commit comments