| 1 |
# Purpose: valid STAR/CIF file with potential traps for lazy parsers |
| 2 |
# Added by JRH: comments in any and every valid position |
| 3 |
# The first data block is the model block of ciftest4 |
| 4 |
|
| 5 |
data_model #this is the datablock name |
| 6 |
|
| 7 |
# now begins the datanames |
| 8 |
_d1 # an internal comment |
| 9 |
char |
| 10 |
# a pre-dataname comment |
| 11 |
_d2 'model file' #a post-datavalue comment |
| 12 |
_d3 "with various types of field" |
| 13 |
_d4 # Comment |
| 14 |
#random comment |
| 15 |
; all conforming to valid STAR syntax |
| 16 |
rules |
| 17 |
; |
| 18 |
|
| 19 |
# pre-loop comment |
| 20 |
loop_ #post loop-token comment |
| 21 |
|
| 22 |
_d5 |
| 23 |
_d6 #random loop dataname comment |
| 24 |
_d7 |
| 25 |
_d8 |
| 26 |
|
| 27 |
A B C D |
| 28 |
E F G H # Comment within the body of a loop |
| 29 |
I J K L |
| 30 |
|
| 31 |
# The second block is valid, but has (potential) traps |
| 32 |
|
| 33 |
data_test # Not at the beginning of a line! |
| 34 |
|
| 35 |
# Data items can occur anywhere in a line, not just at the |
| 36 |
# beginning; and several can appear on one line (if they fit). |
| 37 |
# Also, some values may appear on the next or subsequent lines. |
| 38 |
_t1 char |
| 39 |
_t2 ' model file ' |
| 40 |
_t2a 'some aren't half tricky' _t2b ' some aren't easy ' |
| 41 |
_t3 "with various types of field" # Comment |
| 42 |
_t4 |
| 43 |
; |
| 44 |
all conforming to valid STAR syntax rules |
| 45 |
; |
| 46 |
_t5 |
| 47 |
|
| 48 |
'beware of intervening line endings and blank lines' |
| 49 |
|
| 50 |
# Beware also of other non-white-space token separators (especially TAB) |
| 51 |
|
| 52 |
_t6 'there was a TAB character just after the data name' |
| 53 |
|
| 54 |
|
| 55 |
# Loops can be nicely laid out, but don't have to be! |
| 56 |
loop_ _t7 _t8 _t9 _t10 A B C D E F G H I J K L |
| 57 |
loop_ _t11 |
| 58 |
_t12 _t13 _t14 a b c d e f |
| 59 |
g h i j |
| 60 |
k l |
| 61 |
|
| 62 |
# Degenerate loop |
| 63 |
loop_ _t15 0 1 2 3 4 5 6 7 8 9 |
| 64 |
|
| 65 |
# Loops can contain various data types and with intermingled comments |
| 66 |
loop_ |
| 67 |
_t16 |
| 68 |
_t17 |
| 69 |
_t18 |
| 70 |
_t19 |
| 71 |
|
| 72 |
1 2 3 4 |
| 73 |
the quick brown fox # four different values here! |
| 74 |
'jumps over' the lazy style |
| 75 |
5 6 7 |
| 76 |
; and they all went home to tea |
| 77 |
; |
| 78 |
9 10 11 12 |
| 79 |
|
| 80 |
# A few miscellaneous gotchas |
| 81 |
|
| 82 |
_t20 |
| 83 |
; An embedded ' _dataname' within quotes in a text block was once flagged as |
| 84 |
an error. |
| 85 |
; |
| 86 |
|
| 87 |
_t21 |
| 88 |
; So was an instance where a valid |
| 89 |
_dataname was the first word on the |
| 90 |
line within a text block. |
| 91 |
; data_test2 # Note that data_ tags can be within a line! |
| 92 |
|
| 93 |
|
| 94 |
# Here are a few valid datanames with non-alphanumeric characters |
| 95 |
|
| 96 |
_funny_dataname__1 OK |
| 97 |
_funny_dataname_#2 OK |
| 98 |
_funny_!"#$%^&*()_+-={}[]:@~;'#<>?,./_dataname_3 OK |
| 99 |
|
| 100 |
data_test3 |
| 101 |
# A harsh test of white-space parsing |
| 102 |
|
| 103 |
# In this loop there is a control-K (ASCII decimal 11, vertical tab) |
| 104 |
# between A and B, a control-L (ASCII decimal 12, page throw) |
| 105 |
# between E and F, and a control-M (ASCII decimal 13, carriage |
| 106 |
# return between I and J) |
| 107 |
loop_ |
| 108 |
|
| 109 |
_d5 |
| 110 |
_d6 |
| 111 |
_d7 |
| 112 |
_d8 |
| 113 |
|
| 114 |
A B C D |
| 115 |
E F G H # Comment |
| 116 |
I
J K L |