Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 133 lines (86 sloc) 4.105 kB
f33ec13 @mjackson Version 3.0.1
authored
1 = 3.0.1 / 2014-03-14
820fc27 @blambeau Updated CHANGES
blambeau authored
2
f33ec13 @mjackson Version 3.0.1
authored
3 * Fixed bad 3.0.0 release.
820fc27 @blambeau Updated CHANGES
blambeau authored
4
f33ec13 @mjackson Version 3.0.1
authored
5 = 3.0.0 / 2014-03-14
f760599 @mjackson Updated CHANGES
authored
6
44cc6f7 @blambeau Updated CHANGES
blambeau authored
7 * Moved Object#grammar to citrus/core_ext.rb. Citrus no longer installs core
8 extensions by default. Use "require 'citrus/core_ext.rb'" instead of
9 "require 'citrus'" to keep the previous behavior.
10
b77f558 @blambeau Enhance Match#captures and test both #capture and #captures
blambeau authored
11 * Removed Match#method_missing, added #capture(name) and #captures(name)
1a194c0 @blambeau Remove Match#method_missing, add Match#capture(name)
blambeau authored
12
8360cc4 @blambeau Rephrase CHANGES.
blambeau authored
13 Match#method_missing is unsafe as illustrated in Github issue #41. In
14 particular, it makes composing a grammar with aribitrary gems unsafe (e.g.
15 when the latter make core extensions), leads to unexpected results with
16 labels match existing Kernel methods (e.g. `p`), and prevents Match from
17 getting new methods in a backward compatible way. This commit therefore
18 removes it.
1a194c0 @blambeau Remove Match#method_missing, add Match#capture(name)
blambeau authored
19
8360cc4 @blambeau Rephrase CHANGES.
blambeau authored
20 In Citrus 2.x, method_missing allowed rule productions to denote captured
21 matches by label name:
1a194c0 @blambeau Remove Match#method_missing, add Match#capture(name)
blambeau authored
22
23 rule pair
24 (foo ':' bar) {
25 [foo.value, bar.value]
26 }
27 end
28
29 Also, it allowed invoking String operators on the Match's text:
30
31 rule int
32 [0-9]+ { to_i }
33 end
34
8360cc4 @blambeau Rephrase CHANGES.
blambeau authored
35 Those two scenarios no longer work out of the box in Citrus 3.0. You must
36 use capture(label) for the former, and to_str for the latter:
1a194c0 @blambeau Remove Match#method_missing, add Match#capture(name)
blambeau authored
37
38 rule pair
39 (foo ':' bar) {
40 [capture(:foo).value, capture(:bar).value]
41 }
42 end
43
44 rule int
45 [0-9]+ { to_str.to_i }
46 end
47
b77f558 @blambeau Enhance Match#captures and test both #capture and #captures
blambeau authored
48 Match#captures now accepts an optional label name as first argument and
49 returns the corresponding array of matches for that label (useful in case
50 the label belongs to a repetition).
51
baae819 @blambeau Releasing 2.5.0
blambeau authored
52 = 2.5.0 / 2014-03-13
f760599 @mjackson Updated CHANGES
authored
53
54 * Inputs may be generated from many different sources, including Pathname and
55 IO objects (thanks blambeau).
56
57 * Matches keep track of their offset in the original source (thanks
58 blambeau).
59
0edd8e6 @mjackson Don't hide Errno::ENOENT behind Citrus::Error
authored
60 * Citrus.load no longer raises Citrus::LoadError for files that can't be found
61 or are not readable. Users must rescue Errno::ENOENT instead, for example.
62
a3b0276 @blambeau Updated CHANGES
blambeau authored
63 * Removed a few ruby warnings (thanks tbuehlmann)
64
e362e8a @mjackson Version 2.4.1
authored
65 = 2.4.1 / 2011-11-04
0ce521c @mjackson Updated CHANGES
authored
66
67 * Fixed a bug that prevented rule names from starting with "super".
68
307c410 @mjackson Updated CHANGES
authored
69 * Several minor bug fixes.
70
a9ba0b6 @mjackson Bumped to version 2.4.0
authored
71 = 2.4.0 / 2011-05-11
0b9844e @mjackson Updated CHANGES
authored
72
73 * Fixed a bug that prevented parsing nested blocks correctly (issue #21).
74
75 * Added URI example.
76
77 * Moved example grammars inside lib/citrus/grammars and added
78 lib/citrus/grammars.rb for easily requiring Citrus example grammars.
79
bb7179b @mjackson Bumped version to 2.3.7
authored
80 = 2.3.7 / 2011-02-20
81
82 * Fixed a bug that prevented forward slashes from being used inside character
83 class literals.
84
85 * Added email address example.
86
87 = 2.3.6 / 2011-02-19
9f178b5 @mjackson Updated CHANGES for 2.3.6
authored
88
89 * Fixed a bug that prevented memoization from advancing the input's pointer
90 properly (thanks joachimm).
91
92 * Several additions to the TextMate bundle (thanks joachimm).
93
0bb4595 @mjackson Bumped version to 2.3.5
authored
94 = 2.3.5 / 2011-02-07
95
96 * Fixed a bug that prevented Match objects from being printed properly using
97 Kernel#puts (thanks joachimm).
98
99 * Fixed a bug that prevented using rules with names that begin with "end"
100 (thanks Mark Wilden).
101
102 * Citrus#require accepts relative file paths, in addition to absolute ones.
103
104 * Simplified/cleaned up some example files.
105
28604ab @mjackson Bumped version to 2.3.4
authored
106 = 2.3.4 / 2011-01-17
107
108 * Added CHANGES file.
109
ea358d0 @mjackson Added CHANGES file
authored
110 = 2.3.3 / 2011-01-17
111
112 * Added self to Match#captures hash. This means that a Match may retrieve a
113 reference to itself by using its own label, proxy name, or index 0 in the
114 hash.
115
116 * Match#captures returns an empty array for unknown Symbol keys, coerces
117 String keys to Symbols, and returns nil for unknown Numeric keys.
118
119 * Moved Citrus::VERSION to its own file.
120
121 * Citrus::LoadError is raised when Citrus is unable to load a file from the
122 file system because it cannot be found or it is not readable.
123
124 * Citrus::SyntaxError is raised when Citrus::File is unable to parse some
125 Citrus syntax.
126
127 * Added Citrus.require for requiring .citrus grammar files in a similar way
128 to Ruby's Kernel.require. Also, overloaded the require operator in Citrus
129 grammar files to failover to Citrus.require when Kernel.require raises a
130 LoadError.
131
132 * Improved UTF-8 support.
Something went wrong with that request. Please try again.