Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d32cf62
Introduce BalanceHeuristicExpand
schneems Jan 12, 2022
7324ef1
New direction BlockNode and IndentTree
schneems Jan 17, 2022
ddcc646
Initial tree building
schneems Jan 26, 2022
3682b6b
Handle invalid nodes
schneems Jan 26, 2022
a7d0fe2
Tree building perf commit
schneems Jan 26, 2022
6fd4e36
Reintroduce and fix InsertionSort for performance
schneems Jan 26, 2022
24cde0f
Fix missing deleted logic
schneems Jan 26, 2022
32eb0b3
Build tree recording
schneems Jan 27, 2022
20656d7
Slightly faster initial sorting
schneems Jan 27, 2022
b1acaf5
Tiny perf change to CodeLine#initialize
schneems Jan 27, 2022
763dec4
Remove unused code
schneems Jan 27, 2022
4ab2b70
Pull out inner/outer nodes
schneems Jan 27, 2022
5ba79c0
Rename @inner to @parents
schneems Jan 27, 2022
60d796e
Figure out search algorithm
schneems Jan 27, 2022
083e733
REXE test case
schneems Jan 28, 2022
c260450
Add more test cases
schneems Jan 28, 2022
22f9fc0
Add another test
schneems Jan 28, 2022
f2b8878
Fix problem with my logic for "inner/outer" check
schneems Jan 28, 2022
b7a6c65
Add misindentation test
schneems Jan 29, 2022
01c2b8c
Refactor decision logic into node
schneems Jan 29, 2022
1fa20e1
Initial idea to search by "diagnosing" a node
schneems Jan 31, 2022
16a109b
Fix BlockNode.from_parents above/below
schneems Feb 1, 2022
72cd93e
Fix BlockNode.from_parents that have 1 parent
schneems Feb 1, 2022
c5dbd27
Handle multiple case
schneems Feb 1, 2022
db85b5b
First indent tree search
schneems Feb 2, 2022
1a34697
Standardrb --fix
schneems Feb 3, 2022
6185b90
More search cases
schneems Feb 3, 2022
036373b
Follow multiple errors with IndentSearch
schneems Feb 5, 2022
f977054
Implement tracing on new search
schneems Feb 6, 2022
62bff09
Move IndentSearch to a proper file
schneems Feb 7, 2022
b8a1549
Add missing frozen string magic comment
schneems Feb 7, 2022
4301fab
Move BlockRecorder to proper file
schneems Feb 7, 2022
53eb266
Document IndentSearch
schneems Feb 7, 2022
ea6986e
Move journey to proper file
schneems Feb 7, 2022
ccd9816
Document and refactor IndentTree
schneems Feb 7, 2022
93bab24
Document BlockNode and update BlockDocument docs
schneems Feb 8, 2022
f3a83a5
Refactor logic to Diagnose class
schneems Feb 8, 2022
e06af0c
Fix problem with one bad internal node
schneems Feb 8, 2022
a666da7
Fix block reporter
schneems Feb 8, 2022
011e8a0
Diagnose docs, rename problems & fix one edge case
schneems Feb 8, 2022
70087ed
Refactor Diagnose into smaller methods & rename
schneems Feb 8, 2022
745dc3b
Move diagnose node to its own file
schneems Feb 8, 2022
194ee1b
standardrb --fix
schneems Feb 8, 2022
e0256d1
Finish extraction of Diagnose logic
schneems Feb 8, 2022
c0d8625
Remove unused BalanceHueristicExpand
schneems Feb 9, 2022
e5a70a9
WIP Integration with One failing test
schneems Feb 9, 2022
fc872fb
WIP 8 total failing tests
schneems Feb 9, 2022
026aa1b
WIP Initial BlockNodeContext
schneems Feb 10, 2022
60b4ed3
Update block building
schneems Feb 15, 2022
ee2c9fd
WIP WIP WIP????
schneems Feb 16, 2022
2303179
WIPPPPPPPPPPPPPPPPPPPPPPPPPP
schneems Feb 16, 2022
be9b4c4
WIP
schneems May 20, 2022
02285d2
Fix nested pseudo pair case
schneems Jun 4, 2022
ef535d5
192 examples, 2 failures, 1 pending
schneems Jun 7, 2022
fc7a62c
Check if one node can be pruned from multiple
schneems Jun 7, 2022
91b94a4
Move test out of ruby CLI
schneems Jun 8, 2022
c3b30da
Porting examples from existing tests
schneems Jun 8, 2022
4dfa1b2
This is a difficult problem
schneems Jul 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Finish extraction of Diagnose logic
  • Loading branch information
schneems committed May 20, 2022
commit e0256d111623542001241f2f3fa24ea44d26c18c
35 changes: 0 additions & 35 deletions lib/dead_end/block_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ module DeadEnd
# they're expanded. To be calculated a nodes above and below blocks must
# be accurately assigned. So this property cannot be calculated at creation
# time.
#
# Beyond these core capabilities blocks also know how to `diagnose` what
# is wrong with them. And then they can take an action based on that
# diagnosis. For example `node.diagnose == :invalid_inside_split_pair` indicates that
# it contains parents invalid parents that likey represent an invalid node
# sandwitched between a left and right leaning node. This will happen with
# code. For example `[`, `bad &*$@&^ code`, `]`. Then the inside invalid node
# can be grabbed via calling `node.split_leaning`.
#
# In the long term it likely makes sense to move diagnosis and extraction
# to a separate class as this class already is a bit of a "false god object"
# however a lot of tests depend on it currently and it's not really getting
# in the way.
class BlockNode
# Helper to create a block from other blocks
#
Expand Down Expand Up @@ -140,28 +127,6 @@ def leaf?
parents.empty?
end

def next_invalid
@diagnose.next.first
end

def diagnose
@diagnose ||= DiagnoseNode.new(self).call
@diagnose.problem
end

def fork_invalid
@diagnose.next
end

def handle_multiple
@diagnose.next.first
end
alias_method :remove_pseudo_pair, :handle_multiple

def split_leaning
@diagnose.next.first
end

# Given a node, it's above and below links
# returns the next indentation.
#
Expand Down
Loading