Skip to content

"cup cakes" (and other strings with spaces) no longer working #36

@oliversturm

Description

@oliversturm

The readme, albeit broken, still states this:

quotes are optional, even with spaces: {a: cup cake }{"a": "cup cake"}

However, that is not actually true - this renders an error now (using 2.16.0). For instance using a CLI test (but also from code, before you ask):

-> ./node_modules/.bin/jsonic "{a: cup cake }"
[jsonic/unexpected]: unexpected character(s): cake
  --> <no-file>:1:9
  1 | {a: cup cake }
              ^^^^ unexpected character(s): cake
  2 | 
  3 | 

  The character(s) cake were not expected at this point as they do not
  match the expected syntax, even under the relaxed jsonic rules. If it
  is not obviously wrong, the actual syntax error may be elsewhere. Try
  commenting out larger areas around this point until you get no errors,
  then remove the comments in small sections until you find the
  offending syntax. NOTE: Also check if any plugins you are using
  expect different syntax in this case.

  https://jsonic.senecajs.org
  --internal: tag=-; rule=pair~o; token=#TX; plugins=--

I suspect that the Hoover plugin is perhaps meant to help with this scenario, since it is described in some places (though not everywhere) like this:

This plugin allows the Jsonic JSON parser to support string hoovering (unquoted internal spaces).

I have activated the plugin successfully, but unfortunately it doesn't do anything I can see for the support of unquoted internal spaces. Perhaps it needs options, but I don't know what they are. Tests also don't give anything away.

So... any hints in this matter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions