Class: Ibex::Runtime::SyntaxSessionLimits

Inherits:
Object
  • Object
show all
Defined in:
lib/json5/generated_parser.rb

Overview

Immutable syntax-service bounds layered over parser ResourceLimits.

Constant Summary collapse

DEFAULT_MAX_SOURCE_BYTES =

Signature:

  • Integer

16 * 1024 * 1024
DEFAULT_MAX_EDITS_PER_OPERATION =

Signature:

  • Integer

1_024
DEFAULT_MAX_INSERTED_BYTES =

Signature:

  • Integer

4 * 1024 * 1024

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_source_bytes: DEFAULT_MAX_SOURCE_BYTES, max_edits_per_operation: DEFAULT_MAX_EDITS_PER_OPERATION, max_inserted_bytes: DEFAULT_MAX_INSERTED_BYTES) ⇒ SyntaxSessionLimits

Returns a new instance of SyntaxSessionLimits.

RBS:

  • (?max_source_bytes: Integer, ?max_edits_per_operation: Integer, ?max_inserted_bytes: Integer) -> void



4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
# File 'lib/json5/generated_parser.rb', line 4000

def initialize(
  max_source_bytes: DEFAULT_MAX_SOURCE_BYTES,
  max_edits_per_operation: DEFAULT_MAX_EDITS_PER_OPERATION,
  max_inserted_bytes: DEFAULT_MAX_INSERTED_BYTES
)
  validate_positive_integer(max_source_bytes, :max_source_bytes)
  validate_positive_integer(max_edits_per_operation, :max_edits_per_operation)
  validate_nonnegative_integer(max_inserted_bytes, :max_inserted_bytes)
  @max_source_bytes = max_source_bytes
  @max_edits_per_operation = max_edits_per_operation
  @max_inserted_bytes = max_inserted_bytes
  freeze
end

Instance Attribute Details

#max_edits_per_operationObject (readonly)

Signature:

  • Integer



3995
3996
3997
# File 'lib/json5/generated_parser.rb', line 3995

def max_edits_per_operation
  @max_edits_per_operation
end

#max_inserted_bytesObject (readonly)

Signature:

  • Integer



3996
3997
3998
# File 'lib/json5/generated_parser.rb', line 3996

def max_inserted_bytes
  @max_inserted_bytes
end

#max_source_bytesObject (readonly)

Signature:

  • Integer



3994
3995
3996
# File 'lib/json5/generated_parser.rb', line 3994

def max_source_bytes
  @max_source_bytes
end