mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 08:54:25 +00:00
OpenGL and Vulkan examples; ptr(int)/int(ptr); trailing commas in calls; drop .fn hint
- examples/opengl.fch: OpenGL 3.3 core, shaders, VAO/VBO, a spinning triangle (checked offscreen) - examples/vulkan.fch: instance, GPUs with properties/memory/queues, logical device and queue - ptr(n) and int(p) conversions for C APIs that pass offsets as pointers - .ptr works on string literals; a comma after the last call argument is allowed - a missing header included by an imported header is now named in the error - the old .fn extension hint is gone (Finch is new, there are no old files) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f897fb3140
commit
8497251dc5
22 changed files with 357 additions and 26 deletions
|
|
@ -42,11 +42,6 @@ struct Loader {
|
|||
fn load(ptr[Loader] l, str path, str module) {
|
||||
if !file_exists(path) {
|
||||
if module.len > 0 {
|
||||
old := path.sub(0, path.len - 4) + ".fn"
|
||||
if file_exists(old) {
|
||||
print("error: found " + old + ", but Finch files now end in .fch: rename it to " + path)
|
||||
exit(1)
|
||||
}
|
||||
print("error: can't find the module '" + module + "' (looked for " + path + ")")
|
||||
} else {
|
||||
print("error: can't open '" + path + "'")
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ fn parseArgs(ptr[Parser] p, ptr[ast.Node] call) {
|
|||
expect(p, "(", "'('")
|
||||
p.depth += 1
|
||||
if !at(p, ")") {
|
||||
while true {
|
||||
while !at(p, ")") {
|
||||
name := ""
|
||||
if at(p, "ident") && peekKind(p, 1) == ":" {
|
||||
name = next(p).text
|
||||
|
|
|
|||
Loading…
Reference in a new issue