Class: JsonCompleter::ParsingState

Inherits:
Struct
  • Object
show all
Defined in:
lib/json_completer.rb

Overview

Parsing state for incremental processing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output_tokens: [], context_stack: [], last_index: 0, input_length: 0, incomplete_string_start: nil, incomplete_string_buffer: nil, incomplete_string_escape_state: nil) ⇒ ParsingState

Returns a new instance of ParsingState.



18
19
20
21
22
23
24
# File 'lib/json_completer.rb', line 18

def initialize(
  output_tokens: [], context_stack: [], last_index: 0, input_length: 0,
  incomplete_string_start: nil, incomplete_string_buffer: nil,
  incomplete_string_escape_state: nil
)
  super
end

Instance Attribute Details

#context_stackObject

Returns the value of attribute context_stack

Returns:

  • (Object)

    the current value of context_stack



13
14
15
# File 'lib/json_completer.rb', line 13

def context_stack
  @context_stack
end

#incomplete_string_bufferObject

Returns the value of attribute incomplete_string_buffer

Returns:

  • (Object)

    the current value of incomplete_string_buffer



13
14
15
# File 'lib/json_completer.rb', line 13

def incomplete_string_buffer
  @incomplete_string_buffer
end

#incomplete_string_escape_stateObject

Returns the value of attribute incomplete_string_escape_state

Returns:

  • (Object)

    the current value of incomplete_string_escape_state



13
14
15
# File 'lib/json_completer.rb', line 13

def incomplete_string_escape_state
  @incomplete_string_escape_state
end

#incomplete_string_startObject

Returns the value of attribute incomplete_string_start

Returns:

  • (Object)

    the current value of incomplete_string_start



13
14
15
# File 'lib/json_completer.rb', line 13

def incomplete_string_start
  @incomplete_string_start
end

#input_lengthObject

Returns the value of attribute input_length

Returns:

  • (Object)

    the current value of input_length



13
14
15
# File 'lib/json_completer.rb', line 13

def input_length
  @input_length
end

#last_indexObject

Returns the value of attribute last_index

Returns:

  • (Object)

    the current value of last_index



13
14
15
# File 'lib/json_completer.rb', line 13

def last_index
  @last_index
end

#output_tokensObject

Returns the value of attribute output_tokens

Returns:

  • (Object)

    the current value of output_tokens



13
14
15
# File 'lib/json_completer.rb', line 13

def output_tokens
  @output_tokens
end