Skip to content

Commit 45970b6

Browse files
committed
alternate row's color
1 parent 348f950 commit 45970b6

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

repository/EarleyParser-InspectorExtensions/JEDottedRule.extension.st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ JEDottedRule >> inspectionPureIn: aBuilder [
55

66
<inspectorPresentationOrder: 1 title: 'Pure'>
77
^ aBuilder newTable
8+
alternateRowsColor;
89
addColumn: (SpStringTableColumn new
910
title: 'Name';
1011
evaluated: [ :each | each key ];
@@ -14,14 +15,14 @@ JEDottedRule >> inspectionPureIn: aBuilder [
1415
(SpStringTableColumn
1516
title: 'Value'
1617
evaluated: [ :each | each value ]);
17-
items: ({
18+
items: ({
1819
('rule' -> self rule).
1920
('dotIndex' -> self dotIndex).
2021
('symbolAtDot' -> self symbolAtDot).
2122
('predicted' -> self isPredicted).
2223
('active' -> self isActive).
2324
('final' -> self isFinal).
24-
('next Dotted Rule' -> next) } collect: [ :each |
25+
('next Dotted Rule' -> next) } collect: [ :each |
2526
StInspectorAssociationNode hostObject: each ]);
2627
yourself
2728
]

repository/EarleyParser-InspectorExtensions/JEGrammar.extension.st

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ JEGrammar >> inspectionNonterminalsIn: aBuilder [
55

66
<inspectorPresentationOrder: 2 title: 'nonterminals'>
77
^ aBuilder newTable
8+
alternateRowsColor;
89
addColumn: (SpStringTableColumn new
910
title: 'Nonterminal';
10-
evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each key ];
11+
evaluated: [ :each |
12+
StObjectPrinter asTruncatedTextFrom: each key ];
1113
yourself);
12-
items: (productionRules keys collect: [ :nonterminal |
13-
StInspectorAssociationNode hostObject: nonterminal -> (productionRules at: nonterminal) ]);
14+
items: (productionRules keys collect: [ :nonterminal |
15+
StInspectorAssociationNode hostObject:
16+
nonterminal -> (productionRules at: nonterminal) ]);
1417
yourself
1518
]
1619

@@ -19,6 +22,7 @@ JEGrammar >> inspectionProductionRulesIn: aBuilder [
1922

2023
<inspectorPresentationOrder: 1 title: 'production rules'>
2124
^ aBuilder newTable
25+
alternateRowsColor;
2226
addColumn: (SpStringTableColumn new
2327
title: 'Production Rule';
2428
evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each ]);
@@ -31,17 +35,22 @@ JEGrammar >> inspectionRulesIn: aBuilder [
3135

3236
<inspectorPresentationOrder: 0 title: 'rules'>
3337
^ aBuilder newTable
38+
alternateRowsColor;
3439
addColumn: (SpStringTableColumn new
3540
title: 'Key';
36-
evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each key ];
41+
evaluated: [ :each |
42+
StObjectPrinter asTruncatedTextFrom: each key ];
3743
yourself);
38-
addColumn: (SpStringTableColumn new
44+
addColumn: (SpStringTableColumn new
3945
title: 'Rule';
40-
evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each value ];
46+
evaluated: [ :each |
47+
StObjectPrinter asTruncatedTextFrom: each value ];
4148
yourself);
42-
items: (productionRules keys flatCollect: [ :nonterminal |
43-
(productionRules at: nonterminal) collectWithIndex: [
44-
:each
45-
:index | StInspectorAssociationNode hostObject: (nonterminal -> index -> each) ] ]);
49+
items: (productionRules keys flatCollect: [ :nonterminal |
50+
(productionRules at: nonterminal) collectWithIndex: [
51+
:each
52+
:index |
53+
StInspectorAssociationNode hostObject:
54+
nonterminal -> index -> each ] ]);
4655
yourself
4756
]

repository/EarleyParser-InspectorExtensions/JERule.extension.st

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ JERule >> inspectionDottedRulesIn: aBuilder [
55

66
<inspectorPresentationOrder: 2 title: 'Dotted Rules'>
77
^ aBuilder newTable
8+
alternateRowsColor;
89
addColumn: (SpStringTableColumn new
910
title: 'Dot Index';
1011
evaluated: [ :each | each dotIndex ];
@@ -23,6 +24,7 @@ JERule >> inspectionPureIn: aBuilder [
2324

2425
<inspectorPresentationOrder: 1 title: 'Pure'>
2526
^ aBuilder newTable
27+
alternateRowsColor;
2628
addColumn: (SpStringTableColumn new
2729
title: 'Name';
2830
evaluated: [ :each | each key ];
@@ -33,8 +35,8 @@ JERule >> inspectionPureIn: aBuilder [
3335
title: 'Value'
3436
evaluated: [ :each | each value ]);
3537
items: ({ ('head' -> self head) }
36-
, (self body withIndexCollect: [ :each :index |
37-
'body at: ' , index asString -> each ]) collect: [ :each |
38+
, (self body withIndexCollect: [ :each :index |
39+
'body at: ' , index asString -> each ]) collect: [ :each |
3840
StInspectorAssociationNode hostObject: each ]);
3941
yourself
4042
]

0 commit comments

Comments
 (0)