Skip to content

Commit

Permalink
Remove json_parser cr state
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 15, 2024
1 parent 226110f commit 26d6cf7
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions include/jsoncons/json_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ enum class json_parse_state : uint8_t
expect_value,
array,
member_name,
cr,
done
};

Expand Down Expand Up @@ -620,9 +619,6 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
case json_parse_state::done:
more_ = false;
break;
case json_parse_state::cr:
state_ = pop_state();
break;
default:
err_handler_(json_errc::unexpected_eof, *this);
ec = json_errc::unexpected_eof;
Expand Down Expand Up @@ -650,21 +646,6 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
state_ = json_parse_state::done;
more_ = false;
break;
case json_parse_state::cr:
++line_;
mark_position_ = position_;
switch (*input_ptr_)
{
case '\n':
++input_ptr_;
++position_;
state_ = pop_state();
break;
default:
state_ = pop_state();
break;
}
break;
case json_parse_state::start:
{
switch (*input_ptr_)
Expand Down Expand Up @@ -1280,17 +1261,8 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
{
switch (*input_ptr_)
{
case '\r':
push_state(state_);
++input_ptr_;
++position_;
state_ = json_parse_state::cr;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
case '\r': case '\n':
skip_space(ec);
break;
case '*':
++input_ptr_;
Expand Down

0 comments on commit 26d6cf7

Please sign in to comment.