flooph 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/flooph.rb +9 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bbaa8ffa34166f4b7e2625290c0331686b66feb
4
- data.tar.gz: '0695ad679a3e96ca0f187feb0f7566e525d84e17'
3
+ metadata.gz: f718ff84dd25dade90072186cde278b586f39657
4
+ data.tar.gz: 689471893e0b67601c5a7041c81ac89c109e17dc
5
5
  SHA512:
6
- metadata.gz: 6a4991747c65622a13552643ff85d94b7d4607b44e90685044b574bbf75bcaf74235e285317236b57026d105c364893469a5d179dcb8f9e3cd62056147ed34ad
7
- data.tar.gz: d13459d785cf508c13e874da0b7ac69d6ced467f5ceacddd0992c6b6c1c3429d52868c40d5683168c27c222dc2351c142155576f6ac71a08b1b9d1e8e13a0eb7
6
+ metadata.gz: a67d8d7e1b85e23d0a0fb066a64e7e5d051c2ee5eb39e19fcadf5f331580d7aac034ec8d3e252a69f77cf73af3313e8529cb561bfa79435e1cb929499f781acf
7
+ data.tar.gz: b959cabe0b642938216d70c474a787f4cab09ee1932e45e3521bbb12391ccde69667995e9a9312eb6d144fd8c6144c680370152b5e80ad408e5fb09456abc4eb
@@ -1,7 +1,7 @@
1
1
  require 'parslet'
2
2
 
3
3
  class Flooph < Parslet::Parser
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
 
6
6
  # The current values used when evaluating templates and conditionals.
7
7
  # Can also be updated by user input using #update_variables.
@@ -61,13 +61,13 @@ class Flooph < Parslet::Parser
61
61
  # cats = 42 # variable `cats` equals 42
62
62
  # cats>0 & dogs>0 # if both variables are numbers greater than zero
63
63
  #
64
- # * Numeric and string comparisons, using < > = == <= >= !=
64
+ # * Numeric and string comparisons, using any of `< > = == <= >= !=`
65
65
  # * Non-present variables or invalid comparisons always result in false
66
66
  # * Variable presence/truthiness using just name (isDead) or with optional trailing question mark (isDead?).
67
- # * Boolean composition using a | b & c & (d | !e) || !(f && g)
68
- # * !foo means "not foo", inverting the meaning
69
- # * & has higher precedence than |
70
- # * | is the same as ||; & is the same as &&
67
+ # * Boolean composition, e.g. `a | b & c & (d | !e) || !(f && g)`
68
+ # * `!foo` means "not foo", inverting the meaning
69
+ # * `&` has higher precedence than `|`
70
+ # * `|` is the same as `||`; `&` is the same as `&&`
71
71
  #
72
72
  # @param vars [Hash] variable values to use for this and future evaluations.
73
73
  # If omitted, existing variable values will be used.
@@ -179,6 +179,9 @@ class Flooph < Parslet::Parser
179
179
  rule(:var) { match['a-zA-Z'] >> match('\w').repeat }
180
180
  rule(:sp) { match[' \t'].repeat }
181
181
 
182
+ # Workaround parslet bug that requires a root for inspection
183
+ root :mkup
184
+
182
185
  class Transform < Parslet::Transform
183
186
  rule(proz:simple(:s)){ s.to_s }
184
187
  rule(test:simple(:test), out:simple(:out), elifs:subtree(:elifs), else:subtree(:elseout)) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flooph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Kistner