digital-preservation / csv-schema

CSV Schema
http://digital-preservation.github.io/csv-schema
Mozilla Public License 2.0
98 stars 33 forks source link

Slash or backslash in case expression? #20

Closed marhop closed 6 years ago

marhop commented 6 years ago

Hi,

I think there's a typo in the schema documentation:

The examples for the switch case expression (lines 1943-1954 in version 1.1, lines 1964-1975 in version 1.2) use a backslash to separate the column reference and the conditional expression, like switch(($a_column\is("true"), ....

When playing around with the csv-validator tool however, it yelled at me demanding that I use a slash character as separator. When I changed the expression to something like switch(($a_column/is("true"), ... it worked.

Thanks, Martin

adamretter commented 6 years ago

Indeed. The ExplicitContextExpr specifies a / and not a \ in the EBNF: http://digital-preservation.github.io/csv-schema/csv-schema-1.1.html#dfn-explicitcontextexpr

I can see some other examples where a \ has slipped in too.

Perhaps you would like to send a PR, or maybe @DavidUnderdown has some comments?

DavidUnderdown commented 6 years ago

Thanks. I think that last commit should have caught them all, but I'll give this a couple of days before closing in case either of you spot more.

marhop commented 6 years ago

Wow, that was fast, thank you!

I just scanned the 1.1 document and encountered no suspicious backslashes.

DavidUnderdown commented 6 years ago

Great, I'll close then.