brackets not right

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Brackets recognition
e.Pattern-B (LeftPtr s.Num s.FixCount e.FixedCommands) (TkOpenBracket s.Inner)
e.Pattern-M (TkCloseBracket s.Inner) e.Pattern-E
(e.Vars) (e.Commands) =
<WriteLine 'brackets left'>
<WriteLine s.FixCount>
<GenPattern
e.Pattern-B
(LeftPtr s.Num <inc s.FixCount> e.FixedCommands (TkBrackets s.Num s.Inner (LeftPtr s.Inner) e.Pattern-M (RightPtr s.Inner)))
e.Pattern-E
(e.Vars) (e.Commands (CmdBrackets AlgLeft s.Num s.Inner))
>;
e.Pattern-B (TkOpenBracket s.Inner) e.Pattern-M (TkCloseBracket s.Inner)
(RightPtr s.Num s.FixCount e.FixedCommands) e.Pattern-E
(e.Vars) (e.Commands) =
<WriteLine 'brackets right'>
<WriteLine s.FixCount>
<GenPattern
e.Pattern-B
(RightPtr s.Num <inc s.FixCount> e.FixedCommands s.Num s.Inner (TkBrackets (LeftPtr s.Inner) e.Pattern-M (RightPtr s.Inner)))
e.Pattern-E
(e.Vars) (e.Commands (CmdBrackets AlgRight s.Num s.Inner))
>;
//ADT scopes recognition
e.Pattern-B (LeftPtr s.Num s.FixCount e.FixedCommands) (TkOpenADT s.Inner)
(TkName e.Name) e.Pattern-M (TkCloseADT s.Inner) e.Pattern-E
(e.Vars) (e.Commands) =
<WriteLine 'adt left'>
<WriteLine s.FixCount>
<GenPattern
e.Pattern-B
(LeftPtr s.Num <Inc s.FixCount> e.FixedCommands (TkADT s.Inner (TkName e.Name) (LeftPtr s.Inner) e.Pattern-M (RightPtr s.Inner)))
e.Pattern-E
(e.Vars)
(e.Commands (CmdADT AlgLeft s.Num s.Inner e.Name))
>;
e.Pattern-B (TkOpenADT s.Inner) (TkName e.Name) e.Pattern-M
(TkCloseADT s.Inner) (RightPtr s.Num s.FixCount e.FixedCommands) e.Pattern-E
(e.Vars) (e.Commands) =
<WriteLine 'adt right'>
<WriteLine s.FixCount>
<GenPattern
e.Pattern-B
(RightPtr s.Num <Inc s.FixCount> e.FixedCommands (TkADT s.Inner (TkName e.Name) (LeftPtr s.Inner) e.Pattern-M (RightPtr s.Inner)))
e.Pattern-E
(e.Vars)
(e.Commands (CmdADT AlgRight s.Num s.Inner e.Name))
>;