Literals¶
Strings¶
A Part 21 string is single-quoted; a doubled quote '' inserts a quote into the
string (clause 6.3.3, numbered 6.4.3 in the third edition).
strings
#1= A('a simple string');
#2= A('it''s quoted');
#3= A('a string with a \X2\00E5\X0\ rune');
#4= A('');
Binary literals¶
A double-quoted hex literal is a binary value. Its first hexadecimal digit records
how many zero bits were filled in to reach a whole number of octets, so it is 0
to 3, and the rest of the digits are the value; the empty binary is "0"
(clause 6.3.6, which the third edition numbers 6.4.6):
binary literals
#5= BINARY_HOLDER("0F3A");
#6= BINARY_HOLDER("00FF");
#7= BINARY_HOLDER("00000000");
#8= BINARY_HOLDER("0");
In context:
literals in context
#1= PROPERTY_SINGLE_VALUE('Name',$,STRING('value'));
#2= BINARY_HOLDER("0F3A");
#3= A('name','');
The '' escape and the binary "..." hex form are handled by the same literal
rules as the fixture sample.p21.