Minor changes.
[egate.git] / fml / marc3.fml
1 # FML marc rutines - with passing of code and regular expressions
2 #
3 # $Id: marc3.fml,v 1.1 1995/02/27 09:01:21 adam Exp $
4 \func case tag indicator identifier \code {
5         \if {\match \tag {\line\index 1}} {
6         \if {\match \indicator {\line\index 2}} {
7                 \foreach field {\line \index 3} {
8                         \if{\match \identifier \field\index 1} {
9                                 \set info {\field \index 2}
10                                 \code
11                         }
12                 }
13         } }
14 }
15
16 \func marc rec \code {
17         \foreach line {\rec} {\code}
18 }
19         
20 \func testfmt record {
21         \marc {\record} {
22                 \case 245 00 a { 245 00 a: \info\n }
23                 \case 100 00 [bc] { 100 00 [bc]: \info\n }
24                 \case 101 00 x { }
25                 \case 102 00 x { }
26                 \case 103 00 x { }
27                 \case 104 00 x { }
28                 \case 105 00 x { }
29                 \case 106 00 x { }
30         }
31 }
32
33 \foreach i {1 2 3 4 5 6 7 8 9 10}
34 {
35 \testfmt \list {     
36         { 008 00 {
37                 { b {a b c d e f} } 
38                 { c {a b c d e f} } 
39         } }
40         { 100 00 {
41                 { b {Felt 100-b} } 
42                 { c {felt 100-c} } 
43         } }
44         { 245 00 {
45                 { a {Felt 245-x} } 
46         } }
47         { 260 00 {
48                 { b {Felt 100-b} } 
49                 { c {felt 100-c} } 
50         } }
51         { 970 00 {
52                 { b {Felt 100-b} } 
53                 { c {felt 100-c} } 
54         } }
55         { 971 00 {
56                 { b {Felt 100-b} } 
57                 { c {felt 100-c} } 
58         } }
59         { 972 00 {
60                 { b {Felt 100-b} } 
61                 { c {felt 100-c} } 
62         } }
63         { 973 00 {
64                 { b {Felt 100-b} } 
65                 { c {felt 100-c} } 
66         } }
67         { 974 00 {
68                 { b {Felt 100-b} } 
69                 { c {felt 100-c} } 
70         } }
71 }
72 }