language-ruby 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: 182d0456a2c73bdf225a70c643eb2c96feaf24dd0ffb11505d06f92536f39613
4
- data.tar.gz: 9b0a7f5d97a9a076b711e7bf8872722d46a2906f98e988f9b661a150a5dcec00
3
+ metadata.gz: fbcabd97a0c1b082163275a40c722149ddb952b07040f317323e709c2dc16ece
4
+ data.tar.gz: 181ba7ec09d0776375c536bbf0ee1b8790233fb739e9760970519190b611ba2f
5
5
  SHA512:
6
- metadata.gz: f362c37edd49bbe9e34b5e62d8911d859a0bef58c68adc891db682a74f7b53de6153dccfb1acc163450e376eef0b66a07f11d398cc21e966486954d5d1fb8b2a
7
- data.tar.gz: 36e9c2247fa179763e091499d2c4315e45bb302308e7460ac4b9fca3513bfad0ae7bfe4fbf95ea2071295b3d892874bc5b26248a2f19762c3a3d6e66a0f48812
6
+ metadata.gz: 44dcd09119cae37706897743ffcbf32ee591b424bd18f00fbb68d769fac350dcd89a8734c0c3606697293b0c29ff097d43a27f23c51c01163fba9228a8513a6d
7
+ data.tar.gz: 33ddd0fbf8a42a2cb69dc3ecbe63301d51b329ac646de70c2699ab4bddfeae9ebd0e1c283ecdd024719cac010017e325e16c41e448a51d621a9ace037f905e7a
data/bin/publish ADDED
@@ -0,0 +1,19 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ rm *.gem
6
+ git pull
7
+ git push
8
+
9
+ for file in *.gemspec
10
+ do
11
+ gem build $file
12
+ done
13
+
14
+ for file in *.gem
15
+ do
16
+ gem push $file
17
+ done
18
+
19
+ rm *.gem
@@ -3,9 +3,8 @@ require_relative "lib/template/version"
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "language-ruby"
5
5
  s.version = ::Template::Version
6
- s.summary = "A Parsing Expression Grammar (PEG)"
7
- s.description =
8
- 'A Parsing Expression Grammar (PEG) for making parsers'
6
+ s.summary = "A Parsing Expression Grammar (PEG) for making parsers"
7
+ s.description = s.summary
9
8
  s.authors = ["Dorian Marié"]
10
9
  s.email = "dorian@dorianmarie.fr"
11
10
  s.files = `git ls-files`.split($/)
@@ -55,6 +55,9 @@ class Code
55
55
  elsif operator == "<<"
56
56
  sig(arguments) { ::Code::Object }
57
57
  append(value)
58
+ elsif operator == "include?"
59
+ sig(arguments) { ::Code::Object }
60
+ include?(value)
58
61
  else
59
62
  super
60
63
  end
@@ -180,6 +183,10 @@ class Code
180
183
  self
181
184
  end
182
185
 
186
+ def include?(other)
187
+ ::Code::Object::Boolean.new(raw.include?(other))
188
+ end
189
+
183
190
  def first
184
191
  raw.first || ::Code::Object::Nothing.new
185
192
  end
data/lib/language/atom.rb CHANGED
@@ -194,7 +194,6 @@ class Language
194
194
  clone =
195
195
  Parser.new(root: self, input: parser.input, cursor: parser.cursor)
196
196
 
197
- require "colorize"
198
197
  @parent.parse(clone)
199
198
 
200
199
  if clone.output?
@@ -1,3 +1,3 @@
1
1
  require_relative "../template"
2
2
 
3
- Template::Version = Gem::Version.new("0.5.0")
3
+ Template::Version = Gem::Version.new("0.5.1")
@@ -7,6 +7,8 @@ RSpec.describe "list" do
7
7
  [
8
8
  ["[]", "[]"],
9
9
  ["[1, 2, 3]", "[1, 2, 3]"],
10
+ ["[1, 2, 3].include?(2)", "true"],
11
+ ["[1, 2, 3].include?(4)", "false"],
10
12
  ["[[true]]", "[[true]]"]
11
13
  ].each do |input, output|
12
14
  context input do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: language-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-28 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -43,6 +43,7 @@ files:
43
43
  - TODO
44
44
  - bin/code
45
45
  - bin/format
46
+ - bin/publish
46
47
  - bin/template
47
48
  - bin/test
48
49
  - code-ruby.gemspec
@@ -234,10 +235,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
235
  - !ruby/object:Gem::Version
235
236
  version: '0'
236
237
  requirements: []
237
- rubygems_version: 3.3.7
238
+ rubygems_version: 3.3.26
238
239
  signing_key:
239
240
  specification_version: 4
240
- summary: A Parsing Expression Grammar (PEG)
241
+ summary: A Parsing Expression Grammar (PEG) for making parsers
241
242
  test_files:
242
243
  - spec/code/addition_spec.rb
243
244
  - spec/code/and_operator_spec.rb