Class: Ibex::Runtime::SyntaxSessionLimits
- Inherits:
-
Object
- Object
- Ibex::Runtime::SyntaxSessionLimits
- Defined in:
- lib/json5/generated_parser.rb
Overview
Immutable syntax-service bounds layered over parser ResourceLimits.
Constant Summary collapse
- DEFAULT_MAX_SOURCE_BYTES =
16 * 1024 * 1024
- DEFAULT_MAX_EDITS_PER_OPERATION =
1_024- DEFAULT_MAX_INSERTED_BYTES =
4 * 1024 * 1024
Instance Attribute Summary collapse
- #max_edits_per_operation ⇒ Object readonly
- #max_inserted_bytes ⇒ Object readonly
- #max_source_bytes ⇒ Object readonly
Instance Method Summary collapse
-
#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
constructor
A new instance of SyntaxSessionLimits.
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.
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_operation ⇒ Object (readonly)
3995 3996 3997 |
# File 'lib/json5/generated_parser.rb', line 3995 def max_edits_per_operation @max_edits_per_operation end |
#max_inserted_bytes ⇒ Object (readonly)
3996 3997 3998 |
# File 'lib/json5/generated_parser.rb', line 3996 def max_inserted_bytes @max_inserted_bytes end |
#max_source_bytes ⇒ Object (readonly)
3994 3995 3996 |
# File 'lib/json5/generated_parser.rb', line 3994 def max_source_bytes @max_source_bytes end |