raabro 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGELOG.txt +6 -0
  2. data/Makefile +23 -0
  3. data/lib/raabro.rb +15 -3
  4. data/raabro.gemspec +2 -2
  5. metadata +4 -3
data/CHANGELOG.txt CHANGED
@@ -2,6 +2,12 @@
2
2
  = raabro CHANGELOG.txt
3
3
 
4
4
 
5
+ == raabro 1.1.3 released 2016-07-11
6
+
7
+ - display >nonstring(14)< in Raabro.pp
8
+ - add "tears" to Raabro.pp
9
+
10
+
5
11
  == raabro 1.1.2 released 2016-04-04
6
12
 
7
13
  - add Raabro.pp(tree)
data/Makefile ADDED
@@ -0,0 +1,23 @@
1
+
2
+ NAME = \
3
+ $(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.name")
4
+ VERSION = \
5
+ $(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.version")
6
+
7
+
8
+ gemspec_validate:
9
+ @echo "---"
10
+ ruby -e "s = eval(File.read(Dir['*.gemspec'].first)); p s.validate"
11
+ @echo "---"
12
+
13
+ name: gemspec_validate
14
+ @echo "$(NAME) $(VERSION)"
15
+
16
+ build: gemspec_validate
17
+ gem build $(NAME).gemspec
18
+ mkdir -p pkg
19
+ mv $(NAME)-$(VERSION).gem pkg/
20
+
21
+ push: build
22
+ gem push pkg/$(NAME)-$(VERSION).gem
23
+
data/lib/raabro.rb CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  module Raabro
27
27
 
28
- VERSION = '1.1.2'
28
+ VERSION = '1.1.3'
29
29
 
30
30
  class Input
31
31
 
@@ -102,6 +102,11 @@ module Raabro
102
102
  @input.string[@offset, @length]
103
103
  end
104
104
 
105
+ def nonstring(l=7)
106
+
107
+ @input.string[@offset, l]
108
+ end
109
+
105
110
  def lookup(name)
106
111
 
107
112
  name = name ? name.to_s : nil
@@ -529,14 +534,21 @@ module Raabro
529
534
 
530
535
  str =
531
536
  if tree.children.size == 0
532
- " #{sc}#{tree.string.length == 0 ? "''" : tree.string.inspect}"
537
+ " #{sc}#{tree.string.length == 0 ?
538
+ "#{_dg} >#{tree.nonstring(14).inspect[1..-2]}<" :
539
+ tree.string.inspect}"
533
540
  else
534
541
  ''
535
542
  end
536
543
 
537
544
  print "#{_dg}t---\n" if depth == 0
538
545
 
539
- print "#{' ' * depth}"
546
+ #print "#{' ' * depth}"
547
+ depth.times do |i|
548
+ pipe = i % 3 == 0 ? ': ' : '| '
549
+ print i.even? ? "#{_dg}#{pipe} " : ' '
550
+ end
551
+
540
552
  print "#{lc}#{tree.result}"
541
553
  print " #{nc}#{tree.name.inspect} #{lc}#{tree.offset},#{tree.length}"
542
554
  print str
data/raabro.gemspec CHANGED
@@ -16,12 +16,12 @@ Gem::Specification.new do |s|
16
16
  s.summary = 'a very dumb PEG parser library'
17
17
 
18
18
  s.description = %{
19
- a very dumb PEG parser library
19
+ A very dumb PEG parser library, with a horrible interface.
20
20
  }.strip
21
21
 
22
22
  #s.files = `git ls-files`.split("\n")
23
23
  s.files = Dir[
24
- 'Rakefile',
24
+ 'Makefile',
25
25
  'lib/**/*.rb',# 'spec/**/*.rb', 'test/**/*.rb',
26
26
  '*.gemspec', '*.txt', '*.rdoc', '*.md'
27
27
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raabro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-03 00:00:00.000000000 Z
12
+ date: 2016-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -27,13 +27,14 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 2.13.0
30
- description: a very dumb PEG parser library
30
+ description: A very dumb PEG parser library, with a horrible interface.
31
31
  email:
32
32
  - jmettraux@gmail.com
33
33
  executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
+ - Makefile
37
38
  - lib/raabro.rb
38
39
  - raabro.gemspec
39
40
  - CHANGELOG.txt