Skip to content

Match case support #4

@NOTMEE12

Description

@NOTMEE12

For a while python has a match-case statements When I ran the web version and tried to transpile this code to js:

# write your Python code...

print("hello world")

x = 1
match x:
    case 1:
        print("x is equal to 1")
    case 2:
        print("X is equal to 2")
        
if x == 1:
    print("x = 1")
elif x == 2:
    print("x = 2")

It transpiles to:

console.log("hello world");
let x = 1;

if (x === 1) {
    console.log("x = 1");
} else if (x === 2) {
    console.log("x = 2");
} 

As you can see in the javascript code, there is nothing similiar to match case statements presented there, which could break some logic.

also screenshoot:
screenshot shows that match case is not present in js code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions