Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Parse asterisks as nodes

This might need some refinement in order to satisfy #18, since sometimes
asterisks are used to represent "more history happened here, but we
don't care what exactly".
  • Loading branch information...
commit 5de626534c6c23f242843fabf289d16f5ab5242a 1 parent edaaf66
@aroben authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  lib/asciidag.rb
  2. +6 −0 test/parser_test.rb
View
2  lib/asciidag.rb
@@ -176,7 +176,7 @@ def self.find_parents(position, nodes_by_position, lines)
continue_search.call(:initial, position, :either).flatten
end
- NODE_REGEXP = /\w(?:\d)?['*]?/
+ NODE_REGEXP = /\w(?:\d)?['*]?|\*/
BRANCH_LABEL_REGEXP = /(?:(\w{3,}.*?)|"(.+?)"|(\(.+?\)))\s*$/
ARROW_REGEXP = /\s+(<--)\s+$/
PIXELS_PER_CHARACTER_X = 25
View
6 test/parser_test.rb
@@ -350,4 +350,10 @@
label = find_branch_label graph, '(pretend merge)'
assert_not_nil label
end
+
+ test 'should parse asterisk as node label' do
+ graph = AsciiDag.parse @graph5
+ star = find_node graph, '*'
+ assert_not_nil star
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.