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

Problem on default sample code of weedle #53

Open
ccrashes opened this issue Aug 8, 2022 · 0 comments
Open

Problem on default sample code of weedle #53

ccrashes opened this issue Aug 8, 2022 · 0 comments
Labels
question Further information is requested

Comments

@ccrashes
Copy link

ccrashes commented Aug 8, 2022

Hi .

I've added a new rust project and used in test directory and the code looks like this (webgpu webidl):

use std::fs;
use std::io::Read;


fn read_file(path: &str) -> String {
    let mut file = fs::File::open(path).unwrap();
    let mut file_content = String::new();
    file.read_to_string(&mut file_content).unwrap();
    file_content
}

fn should_parse_webgpu_webidl() {
    let content = read_file("C:/weedle/tests/defs/webgpu.webidl");
    let parsed = weedle::parse(&content).unwrap();
    println!("{:?}", parsed);


    //// assert_eq!(parsed.len(), 201);
}

fn main() {
    should_parse_webgpu_webidl();    
}

I'm running this on windows but after cargo run command I'm getting this error :

Compiling testweedle v0.1.0 (C:\weedle\testweedle\testweedle)
    Finished dev [unoptimized + debuginfo] target(s) in 1.27s
     Running `target\debug\testweedle.exe`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure(Code(CompleteStr("[Exposed=(Window, DedicatedWorker), SecureContext]\r\ninterface GPU {\r\n    Promise<GPUAdapter?> 

...
...
...

  GPUIntegerCoordinate x = 0;\r\n    GPUIntegerCoordinate y = 0;\r\n};\r\ntypedef (sequence<GPUIntegerCoordinate> or GPUOrigin2DDict) GPUOrigin2D;\r\n\r\ndictionary GPUOrigin3DDict {\r\n    GPUIntegerCoordinate x = 0;\r\n    GPUIntegerCoordinate y = 0;\r\n    GPUIntegerCoordinate z = 0;\r\n};\r\ntypedef (sequence<GPUIntegerCoordinate> or GPUOrigin3DDict) GPUOrigin3D;\r\n\r\ndictionary GPUExtent3DDict {\r\n    required GPUIntegerCoordinate width;\r\n    GPUIntegerCoordinate height = 1;\r\n    GPUIntegerCoordinate depthOrArrayLayers = 1;\r\n};\r\ntypedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D;\r\n"), Custom(0)))', src\main.rs:15:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\testweedle.exe` (exit code: 101)

What's the problem with this code? (I have installed Rust nightly on my system) .

Thanks .

@ccrashes ccrashes added the question Further information is requested label Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant