Skip to content

Commit

Permalink
gs1: Prepare for "?" flag to denote valid GS1 DL URI data attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
terryburton committed May 21, 2024
1 parent e5f45a2 commit 867bea5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions contrib/development/build-gs1-syntax-dict.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@

my $ai_rng_rx = qr/${ai_rx}(-${ai_rx})?/;

my $flags_rx = qr/[\*]+/;
my $flags_rx = qr/
[
*?!"%&'()+,.:;<=>@[_`{|}~
\$ \- \/ \\ \] \^
]+
/x;

my $type_mand_rx = qr/
[XNYZ]
Expand Down Expand Up @@ -102,7 +107,7 @@
$_ =~ $entry_rx or die "Bad entry: $_";

my $ais = $+{ais};
# my $flags = $+{flags} || ''; # ignored
my $flags = $+{flags} || '';
my $spec = $+{spec};
my $keyvals = $+{keyvals} || '';
# my $title = $+{title} || ''; # ignored
Expand Down Expand Up @@ -154,6 +159,9 @@
$specstr .= " /dlpkey [ $dlpkeyspec]\n";
}

# dlattr defaults to true since most AIs are valid DL URI attributes
$specstr .= " /dlattr false\n" if $flags !~ /\?/;

$specstr .= " >>\n";

$ais = "$ais-$ais" if $ais !~ /-/;
Expand Down
Binary file modified src/gs1process.ps
Binary file not shown.

0 comments on commit 867bea5

Please sign in to comment.