Skip to content

Commit

Permalink
Can't use ${field_name} if it contains UTF-8 characters also encodeab…
Browse files Browse the repository at this point in the history
…le as Latin-1 (#1363)

* unit-test data

* docgen

* windows unit-test accommodations
  • Loading branch information
johnkerl committed Aug 20, 2023
1 parent 9d1d2e0 commit 2107d52
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/src/manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3470,5 +3470,5 @@ MILLER(1) MILLER(1)



2023-08-19 MILLER(1)
2023-08-20 MILLER(1)
</pre>
2 changes: 1 addition & 1 deletion docs/src/manpage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3449,4 +3449,4 @@ MILLER(1) MILLER(1)



2023-08-19 MILLER(1)
2023-08-20 MILLER(1)
7 changes: 4 additions & 3 deletions internal/pkg/parsing/lexer/lexer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions internal/pkg/parsing/lexer/transitiontable.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/pkg/parsing/mlr.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ _braced_char
| ':' | ';' | '<' | '=' | '>' | '?' | '@' | '['
| ']' | '^' | '_' | '`' | '|' | '~'
| ( '\\' '{' ) | ( '\\' '}' )
| '\u00a0'-'\u00ff'
| '\u0100'-'\U0010FFFF'
;
braced_field_name: '$' '{' _braced_char { _braced_char } '}' ;
Expand Down
2 changes: 1 addition & 1 deletion man/manpage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3449,4 +3449,4 @@ MILLER(1) MILLER(1)



2023-08-19 MILLER(1)
2023-08-20 MILLER(1)
4 changes: 2 additions & 2 deletions man/mlr.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: mlr
.\" Author: [see the "AUTHOR" section]
.\" Generator: ./mkman.rb
.\" Date: 2023-08-19
.\" Date: 2023-08-20
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "MILLER" "1" "2023-08-19" "\ \&" "\ \&"
.TH "MILLER" "1" "2023-08-20" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Portability definitions
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0001/cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mlr --c2p filter -f ${CASEDIR}/mlr test/input/datos-plurilingües.csv
Empty file.
3 changes: 3 additions & 0 deletions test/cases/dsl-utf8-field-names/0001/expout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
año ποσότητα
2021 130
2022 145
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0001/mlr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$año > 2020
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0002/cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mlr --c2p filter -f ${CASEDIR}/mlr test/input/datos-plurilingües.csv
Empty file.
3 changes: 3 additions & 0 deletions test/cases/dsl-utf8-field-names/0002/expout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
año ποσότητα
2021 130
2022 145
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0002/mlr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${año} > 2020
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0003/cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mlr --c2p filter -f ${CASEDIR}/mlr test/input/datos-plurilingües.csv
Empty file.
3 changes: 3 additions & 0 deletions test/cases/dsl-utf8-field-names/0003/expout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
año ποσότητα
2021 130
2022 145
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0003/mlr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$ποσότητα > 100
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0004/cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mlr --c2p filter -f ${CASEDIR}/mlr test/input/datos-plurilingües.csv
Empty file.
3 changes: 3 additions & 0 deletions test/cases/dsl-utf8-field-names/0004/expout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
año ποσότητα
2021 130
2022 145
1 change: 1 addition & 0 deletions test/cases/dsl-utf8-field-names/0004/mlr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${ποσότητα} > 100
4 changes: 4 additions & 0 deletions test/input/datos-plurilingües.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
año,ποσότητα
2020,100
2021,130
2022,145

0 comments on commit 2107d52

Please sign in to comment.