[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt b56d3b6cdb 245/323: Merge branch 'improve-sta
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt b56d3b6cdb 245/323: Merge branch 'improve-starters' into 'master' |
Date: |
Thu, 9 Mar 2023 10:58:35 -0500 (EST) |
branch: externals/beardbolt
commit b56d3b6cdbfa828144d3d8e559472064b0908d0e
Merge: 3fe322e573 d257e51fce
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Merge branch 'improve-starters' into 'master'
Improve starters
See merge request jgkamat/rmsbolt!15
---
starters/rmsbolt-starter.el | 3 +--
starters/rmsbolt.zig | 25 +++++++++++++++++++------
2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/starters/rmsbolt-starter.el b/starters/rmsbolt-starter.el
index 230ef2fa13..0ed5c54c8f 100644
--- a/starters/rmsbolt-starter.el
+++ b/starters/rmsbolt-starter.el
@@ -13,8 +13,7 @@
"Check to see if a LETTER is RMS."
(pcase letter
((or "R" "M" "S") t)
- (_ nil)
- (_ "I will never run!")))
+ (_ nil)))
(defun main ()
"Main entrypoint."
diff --git a/starters/rmsbolt.zig b/starters/rmsbolt.zig
index ace2786ec6..4f4ad1c52e 100644
--- a/starters/rmsbolt.zig
+++ b/starters/rmsbolt.zig
@@ -16,20 +16,33 @@ export fn isRMS(a: u8) u8 {
};
}
-// Functions marked with `export` use the C calling convention, so its
parameters and
-// return value can only have C types.
-// To export a native Zig fn, use the following pattern:
-fn zigFn(xs: []u8) []u8 {
+// Exported by `exportFns` below
+pub fn zigFn(xs: []u8) []u8 {
for (xs) |*x| {
x.* *= 2;
}
return xs;
}
-export fn exportZigFn() usize {
- return @ptrToInt(zigFn);
+// Export all public, non-generic functions in this file.
+// This is needed because functions that accept or return Zig-specific types
can't be marked
+// with `export`.
+// `export` is limited to functions that only accept or return C types, which
makes them
+// compatible with the C calling convention.
+export fn exportPubFns() usize {
+ var fns: usize = 0;
+ inline for (@typeInfo((@This())).Struct.decls) |decl| {
+ if (!decl.is_pub) continue;
+ const field = @field(@This(), decl.name);
+ const info = @typeInfo(@TypeOf(field));
+ if (info == .Fn and !info.Fn.is_generic) {
+ fns += @ptrToInt(field);
+ }
+ }
+ return fns;
}
+
// In some cases, Zig embeds a panic handler that prints stack traces, causing
a
// disassembly much larger than normal.
// You can optionally place this function in files you disassemble to make
them easier to digest.
- [elpa] externals/beardbolt b47b9b4d74 175/323: Add support for Go, (continued)
- [elpa] externals/beardbolt b47b9b4d74 175/323: Add support for Go, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a717d49879 198/323: Clear out default variables after post processing is finished, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a06c8d9fc6 210/323: Add command `rmsbolt`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 54bdd5090e 209/323: Add rustic-mode to default rust definitions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 7c735240b0 192/323: Clean up buffer overlays explicitly on output buffer kill, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 1267509ab4 220/323: Move `rmsbolt-with-display-buffer-no-window`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 8544df3e9d 222/323: Use `rmsbolt--cleanup-overlays`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 42b0ab4239 225/323: Make it clear that we're operating on a list of asm regions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4f4a7f85ac 223/323: Simplify visibility check logic, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3a1e068bb8 228/323: Don't update overlays if the src buffer is no longer current, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b56d3b6cdb 245/323: Merge branch 'improve-starters' into 'master',
ELPA Syncer <=
- [elpa] externals/beardbolt 16f887917b 252/323: Improve rainbow color selection algorithm, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9bc7e8aeb8 236/323: Remove `rmsbolt--post-command-hook` when mode is deactivated, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 660739681c 254/323: Rename every rms* file to beard*, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f846655a35 250/323: Rework rmsbolt-rainbowize to reuse more code, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 78eed53af1 260/323: Don't hang a "[Compiling]" forever in the mode-line, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b71d1bd763 265/323: * beardbolt.el (bb-compile): Fix handling of bb-asm-format., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4cbe58f834 279/323: Add -g1 instead of -g to speed it up massively, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2542f24813 285/323: Tweak, rework, speed up main algorithm again, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 85bc714336 295/323: Simplify source file tracking, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c5086ea624 294/323: bb--output-mode now a major mode, ELPA Syncer, 2023/03/09