Class: Strling::Core::IRLook
Overview
Represents a lookaround assertion in the IR.
Asserts that a pattern does (or does not) match ahead of or behind the current position.
Instance Attribute Summary collapse
-
#body ⇒ IROp
The body of the assertion.
-
#dir ⇒ String
The direction: “Ahead” or “Behind”.
-
#neg ⇒ Boolean
Whether the assertion is negative.
Instance Method Summary collapse
-
#initialize(dir, neg, body) ⇒ IRLook
constructor
A new instance of IRLook.
- #to_dict ⇒ Object
Constructor Details
#initialize(dir, neg, body) ⇒ IRLook
Returns a new instance of IRLook.
332 333 334 335 336 |
# File 'lib/strling/core/ir.rb', line 332 def initialize(dir, neg, body) @dir = dir @neg = neg @body = body end |
Instance Attribute Details
#body ⇒ IROp
Returns The body of the assertion.
327 328 329 |
# File 'lib/strling/core/ir.rb', line 327 def body @body end |
#dir ⇒ String
Returns The direction: “Ahead” or “Behind”.
321 322 323 |
# File 'lib/strling/core/ir.rb', line 321 def dir @dir end |
#neg ⇒ Boolean
Returns Whether the assertion is negative.
324 325 326 |
# File 'lib/strling/core/ir.rb', line 324 def neg @neg end |
Instance Method Details
#to_dict ⇒ Object
338 339 340 341 342 343 344 345 |
# File 'lib/strling/core/ir.rb', line 338 def to_dict { 'ir' => 'Look', 'dir' => dir, 'neg' => neg, 'body' => body.to_dict } end |