Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler fails to error #load() #3603

Closed
susrn opened this issue May 18, 2024 · 0 comments
Closed

Compiler fails to error #load() #3603

susrn opened this issue May 18, 2024 · 0 comments

Comments

@susrn
Copy link

susrn commented May 18, 2024

Context

There is a range of special characters that the compiler just does not error on and exits when parsing #load()

    Odin:    dev-2024-05-nightly:f8581537e
    OS:      Windows 10 Pro for Workstations (000000a1) (version: 22H2), build 19045.4239
    CPU:     AMD Ryzen 9 7900X3D 12-Core Processor
    RAM:     31965 MiB
    Backend: LLVM 17.0.1

Expected Behavior

package main

import "base:runtime"
import "core:fmt"
import "core:log"
import "core:slice"
import "core:strings"
import "vendor:glfw"
import vk "vendor:vulkan"

SHADER_VERT :: #load("shaders/vert.spv")
SHADER_FRAG :: #load("shaders/frag,spv")   // Accidentally entered a comma

The compiler should have returned

main.odin(22:16) Error: Failed to `#load` file: <src dir>/shaders/frag,spv; file cannot be found 
        SHADER_FRAG :: #load("shaders/frag,spv") 
                       ^ 

Current Behavior

Exits, returns nothing.

Steps to Reproduce

  1. Accidentally enter any of these characters in your filepath # $ % ^ * ( ) = ; : ' < > ? \ | { } [ ] ,
  2. run the compiler
KotzaBoss pushed a commit to KotzaBoss/Odin that referenced this issue May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant