parser 2.5.1.0 → 2.5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d4445244332537a2a91b8b6f6a2d35b750ffb1dbc3869c91f1a4de840a89600
4
- data.tar.gz: 800b3adeae6c64459f2b604c3c4b935eb728018bfe4136debae16c96df0384bf
3
+ metadata.gz: 999565504b59c7ad12546445a92d20f6ff6235ed29d76c8c52eb73513c23d9e7
4
+ data.tar.gz: e04475df2071b10e772259cc6697875067432121122541a5ef5a5092eeee4e1f
5
5
  SHA512:
6
- metadata.gz: 99138e99f88e016a3da7cac3fe45c492068fe5fa5ecb6df640ade2f6890c05fdc2aff096d255e0fd57f75f4e5c3300c15f16fa9be177e9fdc56711c6e6ea29ac
7
- data.tar.gz: 71504873b9c22a3adfd0d0ee304e69e3317b93d52a7e2506c6225e2c768cea2ddd9bf1a874a04c8b0706047f78dc97f49b7841307f64198678f03a3336ad2675
6
+ metadata.gz: ef4a0c50b91ba31b62c2274a6d442589fa277e0a606811800e9590ae73e7f6236d80fbc01c1d180adf2d64532d87dc99fcfa4953a28fa272dcce2fb195e8b224
7
+ data.tar.gz: 88e285335392b9269787035fe5dccc073758157496bcade661be8acbb912ec134e86fa75e8a2e3fbc0a62f7fa8a38c9f581cbecd9059bbddfe03812f958002cd
data/CHANGELOG.md CHANGED
@@ -1,9 +1,27 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- Not released (2018-04-12)
4
+ Not released (2018-07-10)
5
5
  -------------------------
6
6
 
7
+ Bugs fixed:
8
+ * lexer.rl: Partially revert 5ba072d and properly handle 'm = -> *args do end'. (Ilya Bylich)
9
+
10
+ v2.5.1.1 (2018-07-10)
11
+ ---------------------
12
+
13
+ Features implemented:
14
+ * ruby26.y: Endless ranges support. (Ilya Bylich)
15
+
16
+ Bugs fixed:
17
+ * lexer.rl: Fix parsing of 'm = -> *args do end'. (Ilya Bylich)
18
+ * AST::Processor: Properly recurse into "kwsplat" nodes (Nelson Elhage)
19
+ * ruby24, ruby25, ruby26: Fix cmdargs after command_args followed by tLBRACE_ARG. This commit tracks upstream commit ruby/ruby@f168dbd. (Ilya Bylich)
20
+ * lexer.rl: Fix parsing of `let (:a) { m do; end }`. (Ilya Bylich)
21
+
22
+ v2.5.1.0 (2018-04-12)
23
+ ---------------------
24
+
7
25
  API modifications:
8
26
  * Parser::Current: bump latest 2.2 branch to 2.2.10. (Ilya Bylich)
9
27
 
data/README.md CHANGED
@@ -217,7 +217,7 @@ at some point.
217
217
  Sometimes it is necessary to modify the format of AST nodes that are already being emitted
218
218
  in a way that would break existing applications. To avoid such breakage, applications
219
219
  must opt-in to these modifications; without explicit opt-in, Parser will continue to emit
220
- the old AST node format. The most recent set of opt-ins is speified in
220
+ the old AST node format. The most recent set of opt-ins is specified in
221
221
  the [usage section](#usage) of this README.
222
222
 
223
223
  ## Compatibility with Ruby MRI
data/doc/AST_FORMAT.md CHANGED
@@ -322,6 +322,23 @@ Format:
322
322
  ~~~~~ expression
323
323
  ~~~
324
324
 
325
+
326
+ ### Endless (2.6)
327
+
328
+ Format:
329
+
330
+ ~~~
331
+ (irange (int 1) nil)
332
+ "1.."
333
+ ~~ operator
334
+ ~~~ expression
335
+
336
+ (erange (int 1) nil)
337
+ "1..."
338
+ ~~~ operator
339
+ ~~~~ expression
340
+ ~~~
341
+
325
342
  ## Access
326
343
 
327
344
  ### Self
@@ -1293,8 +1310,8 @@ Format:
1293
1310
  ~~~~~~ keyword
1294
1311
  ~~~~ begin
1295
1312
  ~~~~ else
1296
- ~~~ end
1297
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression
1313
+ ~~~ end
1314
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression
1298
1315
 
1299
1316
  "unless cond; iftrue; else; iffalse; end"
1300
1317
  ~~~~~~ keyword
@@ -16,6 +16,7 @@ module Parser
16
16
  alias on_regexp process_regular_node
17
17
  alias on_xstr process_regular_node
18
18
  alias on_splat process_regular_node
19
+ alias on_kwsplat process_regular_node
19
20
  alias on_array process_regular_node
20
21
  alias on_pair process_regular_node
21
22
  alias on_hash process_regular_node
@@ -400,12 +400,12 @@ module Parser
400
400
 
401
401
  def range_inclusive(lhs, dot2_t, rhs)
402
402
  n(:irange, [ lhs, rhs ],
403
- binary_op_map(lhs, dot2_t, rhs))
403
+ range_map(lhs, dot2_t, rhs))
404
404
  end
405
405
 
406
406
  def range_exclusive(lhs, dot3_t, rhs)
407
407
  n(:erange, [ lhs, rhs ],
408
- binary_op_map(lhs, dot3_t, rhs))
408
+ range_map(lhs, dot3_t, rhs))
409
409
  end
410
410
 
411
411
  #
@@ -1388,6 +1388,16 @@ module Parser
1388
1388
  Source::Map::Operator.new(loc(op_t), expr_l)
1389
1389
  end
1390
1390
 
1391
+ def range_map(start_e, op_t, end_e)
1392
+ if end_e
1393
+ expr_l = join_exprs(start_e, end_e)
1394
+ else
1395
+ expr_l = start_e.loc.expression.join(loc(op_t))
1396
+ end
1397
+
1398
+ Source::Map::Operator.new(loc(op_t), expr_l)
1399
+ end
1400
+
1391
1401
  def arg_prefix_map(op_t, name_t=nil)
1392
1402
  if name_t.nil?
1393
1403
  expr_l = loc(op_t)
@@ -35,6 +35,10 @@ module Parser
35
35
  @stack[0] == 1
36
36
  end
37
37
 
38
+ def empty?
39
+ @stack == 0
40
+ end
41
+
38
42
  def to_s
39
43
  "[#{@stack.to_s(2)} <= #{@name}]"
40
44
  end