Skip to content

Is switch supported? #16

@pengyu

Description

@pengyu

I see the following error. Is it because switch is not supported?

$ cat a.awk
function f(x) {
  switch(x) {
  case "a": return 1;
  default: return 0;
  }
}
{ print $0, f($0) }
$ gawk -f ./a.awk  <<< a
a 1
$ awka -f ./a.awk
awka: ./a.awk: line 2:   switch(x) {
awka: ./a.awk: line 2:             ^ syntax error at or near {
awka: ./a.awk: line 4:   default: return 0;
awka: ./a.awk: line 4:          ^ syntax error at or near :
awka: ./a.awk: line 6: }
awka: ./a.awk: line 6: ^ syntax error at or near }

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