Exception: Synthra::Errors::IndentationError
- Inherits:
-
ParseError
- Object
- StandardError
- Error
- ParseError
- Synthra::Errors::IndentationError
- Defined in:
- lib/synthra/errors.rb
Overview
Indentation error in DSL file
Raised when indentation doesn't match the expected pattern. Synthra uses 2-space indentation consistently.
Constant Summary collapse
- ERROR_CODE =
"INDENTATION_ERROR"
Instance Attribute Summary collapse
-
#actual ⇒ Integer
readonly
The actual number of spaces found.
-
#expected ⇒ Integer
readonly
The expected number of spaces.
Instance Method Summary collapse
-
#initialize(expected:, actual:, **kwargs) ⇒ IndentationError
constructor
Create a new IndentationError.
Constructor Details
#initialize(expected:, actual:, **kwargs) ⇒ IndentationError
Create a new IndentationError
448 449 450 451 452 |
# File 'lib/synthra/errors.rb', line 448 def initialize(expected:, actual:, **kwargs) @expected = expected @actual = actual super("Invalid indentation: expected #{expected} spaces, got #{actual}", **kwargs) end |
Instance Attribute Details
#actual ⇒ Integer (readonly)
Returns the actual number of spaces found.
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'lib/synthra/errors.rb', line 436 class IndentationError < ParseError ERROR_CODE = "INDENTATION_ERROR" attr_reader :expected, :actual # Create a new IndentationError # # @param expected [Integer] expected number of spaces # @param actual [Integer] actual number of spaces found # @param kwargs [Hash] location information (line, column, source_line) # def initialize(expected:, actual:, **kwargs) @expected = expected @actual = actual super("Invalid indentation: expected #{expected} spaces, got #{actual}", **kwargs) end end |
#expected ⇒ Integer (readonly)
Returns the expected number of spaces.
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'lib/synthra/errors.rb', line 436 class IndentationError < ParseError ERROR_CODE = "INDENTATION_ERROR" attr_reader :expected, :actual # Create a new IndentationError # # @param expected [Integer] expected number of spaces # @param actual [Integer] actual number of spaces found # @param kwargs [Hash] location information (line, column, source_line) # def initialize(expected:, actual:, **kwargs) @expected = expected @actual = actual super("Invalid indentation: expected #{expected} spaces, got #{actual}", **kwargs) end end |