Skip to content

Commit

Permalink
Simplify lf handling
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 15, 2024
1 parent 91f385e commit 226110f
Showing 1 changed file with 11 additions and 148 deletions.
159 changes: 11 additions & 148 deletions include/jsoncons/json_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,18 +677,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
return;
}
break;
case '\r':
push_state(state_);
++input_ptr_;
++position_;
state_ = json_parse_state::cr;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
break;
case '\r': case '\n':
case ' ':case '\t':
skip_space(ec);
break;
Expand Down Expand Up @@ -786,18 +775,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
++input_ptr_;
++position_;
break;
case '\r':
++input_ptr_;
++position_;
push_state(state_);
state_ = json_parse_state::cr;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
break;
case '\r': case '\n':
case ' ':case '\t':
skip_space(ec);
break;
Expand Down Expand Up @@ -866,18 +844,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
++input_ptr_;
++position_;
break;
case '\r':
++input_ptr_;
++position_;
push_state(state_);
state_ = json_parse_state::cr;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
break;
case '\r': case '\n':
case ' ':case '\t':
skip_space(ec);
break;
Expand Down Expand Up @@ -940,18 +907,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
++input_ptr_;
++position_;
break;
case '\r':
++input_ptr_;
++position_;
push_state(state_);
state_ = json_parse_state::cr;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
break;
case '\r': case '\n':
case ' ':case '\t':
skip_space(ec);
break;
Expand Down Expand Up @@ -1020,18 +976,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
++input_ptr_;
++position_;
break;
case '\r':
push_state(state_);
state_ = json_parse_state::cr;
++input_ptr_;
++position_;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
break;
case '\r': case '\n':
case ' ':case '\t':
skip_space(ec);
break;
Expand Down Expand Up @@ -1074,18 +1019,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
++input_ptr_;
++position_;
break;
case '\r':
push_state(state_);
++input_ptr_;
++position_;
state_ = json_parse_state::cr;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
break;
case '\r': case '\n':
case ' ':case '\t':
skip_space(ec);
break;
Expand Down Expand Up @@ -1212,18 +1146,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
++input_ptr_;
++position_;
break;
case '\r':
++input_ptr_;
++position_;
push_state(state_);
state_ = json_parse_state::cr;
break;
case '\n':
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
break;
case '\r': case '\n':
case ' ':case '\t':
skip_space(ec);
break;
Expand Down Expand Up @@ -1695,22 +1618,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
}
switch (*input_ptr_)
{
case '\r':
end_integer_value(visitor, ec);
if (ec) return;
++input_ptr_;
++position_;
push_state(state_);
state_ = json_parse_state::cr;
return;
case '\n':
end_integer_value(visitor, ec);
if (ec) return;
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
return;
case '\r':case '\n':
case ' ':case '\t':
end_integer_value(visitor, ec);
if (ec) return;
Expand Down Expand Up @@ -1775,22 +1683,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
}
switch (*input_ptr_)
{
case '\r':
end_integer_value(visitor, ec);
if (ec) return;
push_state(state_);
++input_ptr_;
++position_;
state_ = json_parse_state::cr;
return;
case '\n':
end_integer_value(visitor, ec);
if (ec) return;
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
return;
case '\r':case '\n':
case ' ':case '\t':
end_integer_value(visitor, ec);
if (ec) return;
Expand Down Expand Up @@ -1877,22 +1770,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
}
switch (*input_ptr_)
{
case '\r':
end_fraction_value(visitor, ec);
if (ec) return;
push_state(state_);
++input_ptr_;
++position_;
state_ = json_parse_state::cr;
return;
case '\n':
end_fraction_value(visitor, ec);
if (ec) return;
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
return;
case '\r':case '\n':
case ' ':case '\t':
end_fraction_value(visitor, ec);
if (ec) return;
Expand Down Expand Up @@ -2010,22 +1888,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
}
switch (*input_ptr_)
{
case '\r':
end_fraction_value(visitor, ec);
if (ec) return;
++input_ptr_;
++position_;
push_state(state_);
state_ = json_parse_state::cr;
return;
case '\n':
end_fraction_value(visitor, ec);
if (ec) return;
++input_ptr_;
++line_;
++position_;
mark_position_ = position_;
return;
case '\r':case '\n':
case ' ':case '\t':
end_fraction_value(visitor, ec);
if (ec) return;
Expand Down

0 comments on commit 226110f

Please sign in to comment.