nanaimo 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab09d023dcf3bf46a332312b87629f53d883dfaa
4
- data.tar.gz: 9cba913511d07afdac303014a0800c80ec69e71b
3
+ metadata.gz: 090d05915f386fcbf6f5324805f7bd16f873678e
4
+ data.tar.gz: baa8d42469bd66dc1f7b0a6eae353698d6fe99e3
5
5
  SHA512:
6
- metadata.gz: 465b4541004574d0436c34009cdf83929287c8d23ec88dc86f7968c43d0055c47439305f61c7c472211b9a9f0ddb6633564e4d5afa21b45adde9490bb287ea13
7
- data.tar.gz: c5c73509cc97dd7b2dd6fe63ff8cdd420480190972bf2964cc4b5f870b96bac9cfd1dda43a48e5a584fd8ebd99ca7216fc079e214c93160a3fc989cf47d436f7
6
+ metadata.gz: 2833cad61d387df8c5ac6e45118d109333484c0555a307ac566cd0d6bd50925ae5a5003191645e96d523f0d9d6e171aca7a7f3891a95f42f3119b516d77ac081
7
+ data.tar.gz: 7faf48d2d57caa6076f13f8d10c1b1dbac3895f7a54d2e217609574fa48316dde4f12a6e2f1054741e3982ad0a4489b0aaca5767165f53d848921663f8e3db21
@@ -1,5 +1,21 @@
1
1
  # Nanaimo Changelog
2
2
 
3
+ ## 0.2.2 (2016-11-04)
4
+
5
+ ##### Enhancements
6
+
7
+ * None.
8
+
9
+ ##### Bug Fixes
10
+
11
+ * Fix extraneously escaping single quotes when writing quoted strings.
12
+ [Samuel Giddins](https://github.com/segiddins)
13
+
14
+ * Properly align the `^` in parse error messages when the line with the syntax
15
+ error contains tabs.
16
+ [Samuel Giddins](https://github.com/segiddins)
17
+
18
+
3
19
  ## 0.2.1 (2016-11-03)
4
20
 
5
21
  ##### Enhancements
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nanaimo (0.2.1)
4
+ nanaimo (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/Rakefile CHANGED
@@ -48,6 +48,7 @@ task :generate_quote_maps do
48
48
  map[escaped[1..-1]] = value
49
49
  map
50
50
  end
51
+ quote_map.delete("'")
51
52
 
52
53
  0.upto(31) { |i| quote_map[[i].pack('U')] ||= format('\\U%04x', i) }
53
54
  quote_regexp = Regexp.union(quote_map.keys)
@@ -47,12 +47,19 @@ module Nanaimo
47
47
  indicator = "#{line_number.succ}> "
48
48
 
49
49
  m = ::String.new("\n")
50
+
50
51
  m << "#{indent}-------------------------------------------\n"
51
52
  m << lines[[line_number - n, 0].max...line_number].map do |l|
52
53
  "#{indent}#{l}\n"
53
54
  end.join
54
- m << "#{indicator}#{lines[line_number]}\n"
55
- m << ' ' * (column + s + 2) << "^\n"
55
+
56
+ line = lines[line_number].to_s
57
+ m << "#{indicator}#{line}\n"
58
+
59
+ m << ' ' * indent.size
60
+ m << line[0, column.pred].gsub(/[^\t]/, ' ')
61
+ m << "^\n"
62
+
56
63
  m << Array(lines[line_number.succ..[lines.count.pred, line_number + n].min]).map do |l|
57
64
  l.strip.empty? ? '' : "#{indent}#{l}\n"
58
65
  end.join
@@ -9,7 +9,6 @@ module Nanaimo
9
9
  "\t" => "\\t",
10
10
  "\v" => "\\v",
11
11
  "\n" => "\\n",
12
- "'" => "\\'",
13
12
  "\"" => "\\\"",
14
13
  "\\" => "\\\\",
15
14
  "\x00" => "\\U0000",
@@ -53,6 +52,6 @@ module Nanaimo
53
52
  "\\" => "\\",
54
53
  }.freeze
55
54
 
56
- QUOTE_REGEXP = /\x07|\x08|\f|\r|\t|\v|\n|'|"|\\|\x00|\x01|\x02|\x03|\x04|\x05|\x06|\x0E|\x0F|\x10|\x11|\x12|\x13|\x14|\x15|\x16|\x17|\x18|\x19|\x1A|\x1B|\x1C|\x1D|\x1E|\x1F/
55
+ QUOTE_REGEXP = /\x07|\x08|\f|\r|\t|\v|\n|"|\\|\x00|\x01|\x02|\x03|\x04|\x05|\x06|\x0E|\x0F|\x10|\x11|\x12|\x13|\x14|\x15|\x16|\x17|\x18|\x19|\x1A|\x1B|\x1C|\x1D|\x1E|\x1F/
57
56
  end
58
57
  end
@@ -1,3 +1,3 @@
1
1
  module Nanaimo
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanaimo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danielle Tomlinson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-11-03 00:00:00.000000000 Z
12
+ date: 2016-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler