calyx 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +7 -5
- data/lib/calyx/production/choices.rb +1 -1
- data/lib/calyx/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27169df4f2bd509b5032e94a52faf2a66caac896
|
4
|
+
data.tar.gz: de708f687c780fb782d9dee7857afabc1fd64e92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a4a39f5d884dbec68f98dd861196b877139398c95549a3c01892c199f26e698680d028128fe6a009192851dba2be636ada636aec2a3b5acac3409b73c8c0e92
|
7
|
+
data.tar.gz: 3a31249994903e00bb8ec895eed7929a7343e1736e5d2750d400ed69a4980ff6be7f5b100ff051ceb64820a5f51295729debc9a0bc0d87b514b8eaafcbfa0318
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -333,12 +333,14 @@ end
|
|
333
333
|
|
334
334
|
### Modifier Mixins
|
335
335
|
|
336
|
-
In order to use more intricate
|
336
|
+
In order to use more intricate rewriting and formatting methods in a modifier chain, you can add methods to a module and embed it in a grammar using the `modifier` classmethod.
|
337
|
+
|
338
|
+
Modifier methods accept a single argument representing the input string from the previous step in the expression chain and must return a string, representing the modified output.
|
337
339
|
|
338
340
|
```ruby
|
339
341
|
module FullStop
|
340
|
-
def full_stop
|
341
|
-
|
342
|
+
def full_stop(input)
|
343
|
+
input << '.'
|
342
344
|
end
|
343
345
|
end
|
344
346
|
|
@@ -355,8 +357,8 @@ To share custom modifiers across multiple grammars, you can include the module i
|
|
355
357
|
|
356
358
|
```ruby
|
357
359
|
module FullStop
|
358
|
-
def full_stop
|
359
|
-
|
360
|
+
def full_stop(input)
|
361
|
+
input << '.'
|
360
362
|
end
|
361
363
|
end
|
362
364
|
|
@@ -12,7 +12,7 @@ module Calyx
|
|
12
12
|
choices = productions.map do |choice|
|
13
13
|
if choice.is_a?(String)
|
14
14
|
Concat.parse(choice, registry)
|
15
|
-
elsif choice.is_a?(
|
15
|
+
elsif choice.is_a?(Integer)
|
16
16
|
Terminal.new(choice.to_s)
|
17
17
|
elsif choice.is_a?(Symbol)
|
18
18
|
if choice[0] == Memo::SIGIL
|
data/lib/calyx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calyx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickerby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,8 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.6.11
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Generate text with declarative recursive grammars
|
113
113
|
test_files: []
|
114
|
+
has_rdoc:
|