Coverage report: /home/ellis/comp/core/lib/syn/gen/rs/pkg.lisp
Kind | Covered | All | % |
expression | 0 | 25 | 0.0 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; rs/pkg.lisp --- Rust Code Generator
7
;; This code is bootstrapped from a tiny DSL I made for working with cbindgen
8
;; a few years back. Here's the header comment in that file:
11
;; So basically, this was born out of personal frustration with how
12
;; cbindgen and Rust macros work (they don't). Rust macros in general
13
;; are something of a pain in my opinion, so I thought why not just
14
;; generate Rust code from Lisp instead?
18
;; ref: https://rust-lang.github.io/rfcs/3424-cargo-script.html
19
;; ref: https://github.com/rust-analyzer/ungrammar/blob/master/rust.ungram
22
(defpackage :syn/gen/rs
24
(:use :cl :syn/gen :cli/tools/rust :ast :id :std/pipe :std/meta :syn/gen/c)
25
(:import-from :std :in-readtable :eval-always)
26
(:import-from :doc :file-header)
27
(:import-from :syn/gen/c :c-type)
28
(:shadow :cl-reader :else :body)
44
(in-package :syn/gen/rs)
47
(append *cl-symbols* '()))
51
(defparameter *rs-symbols*
53
for while return break continue if type let loop))
55
(defparameter *rs-syntax*
56
'(|| && == != % << >> ^ | & += /= *= %= >>= <<= -= |= &= ^=
57
pub crate enum struct mod fn extern else super as
58
const impl in match move mut ref self static safe unsafe use where
64
(defparameter *rs-reserved*
65
'(abstract become do final macro override priv typeof unsized virtual yield
69
(defparameter *rs-exports* (append *rs-symbols* *rs-syntax* *cl-symbols*))
71
(defparameter *rs-swap* (append *rs-symbols* *rs-syntax*))
73
(pkg:defpackage* :syn/gen/rs/swap
74
(:shadow-symbols *rs-swap*))
76
(pkg:defpackage* :syn/gen/rs/sym
77
(:shadow-symbols *rs-swap* :export-symbols *rs-exports*)
80
(:import-from :syn/gen :gen-package)
81
(:import-from :syn/gen/c :cl-reader :switch-reader :decompose-declaration))