1. 18 May, 2020 2 commits
  2. 27 Apr, 2019 13 commits
    • Charles Ferguson's avatar
      Added 'safe_load' function. · 90fcfc0c
      Charles Ferguson authored
      The PyYAML module recommends the use of safe_load if not parsing any
      constructor tags. We don't support them, so our load function is actually
      the same as the safe_load function. Consequently, we may as well define
      the safe_load function to be the same thing, for compatibility with
      anyone who might try to replace PyYAML with this module.
    • Charles Ferguson's avatar
      Made the YAML version a state variable. · b6d0aaf3
      Charles Ferguson authored
      We may as well record the version we have decoded, as this means that
      we may - in the future - support varying the behaviour of the parser
      based on the YAML version.
    • Charles Ferguson's avatar
      Lint: Annotated parser to remove lint warning; fixed overlong line. · af226f0b
      Charles Ferguson authored
      The load() function is a little long and lint complains about the
      number of blocks. I don't see an obvious way to fix that at this
      moment, so I'm just annotating it to quiet the warning.
      The key_value_re was overlong, so the string has been split into
      multiple lines to make it tidier.
    • Charles Ferguson's avatar
      Move directive parsing out to a method. · 7337696e
      Charles Ferguson authored
      Rather than parsing the directives inline, they are now parsed as a
      separate function. This reduces the complexity of the load function
      a little.
    • Charles Ferguson's avatar
      Created a parser state class to encapsulate the processing state. · 0205e071
      Charles Ferguson authored
      In order that we can simplify the operations of the parser, I've
      created a parser state which encapsulates the current state of
      the parsing of the document. This will allow some of the parsing
      operations to move into functions. It should also allow better
      handling of some state-like processing, like knowing about
      the YAML version, or references, if they were to be implemented
      in the future.
    • Charles Ferguson's avatar
      Moved the CloudFormation to tests_unused, as it doesn't load. · 38d1832a
      Charles Ferguson authored
      The constructor handling for the YAML reading doesn't work with the
      regular YAML parser, so I've moved it out of the way for now.
    • Charles Ferguson's avatar
      Remove the 'profile' option from pylintrc. · 1d1b2ca4
      Charles Ferguson authored
      It's no longer used by pylint and generates warnings.
    • Charles Ferguson's avatar
    • Charles Ferguson's avatar
      Add some real-world examples. · 63d5198f
      Charles Ferguson authored
      The examples have been taken from descriptions of the YAML formats
      taken by a few programs. These are not especially complex, although
      the appveyor example has been modified to make the `on` key into a
      string, so that it is not parsed as a boolean.
    • Charles Ferguson's avatar
      Upgraded PyYAML to 5.1; added handling for non-multi-documents. · 8fb5f3f6
      Charles Ferguson authored
      PyYAML has been upgraded to 5.1, which may help some of the cases
      we will introduce.
      Documentation updated to note the behaviour of the parser with respect
      to YAML versions.
      When the PyYAML parser reports there are no documents at all (it
      reports StopIteration immediately), we now fall back to trying to load
      just the one document. I'm not sure if that's a PyYAML bug, but it's
      relatively easy to work around.
    • Charles Ferguson's avatar
      Fix keys with dots in not being parsed. · 75d3e2d1
      Charles Ferguson authored
      Keys with dots in were not being processed, and were actually completely
      ignored - the parser would not report an error. Errors due to unparseable
      lines are now reported as such, rather than being silently dropped.
      When the changes went in for floating point fixes, the dots were
      incorrectly inserted into the 'not allowed' characters in the bare
      key strings. These are now processed properly, and a test has been
      added for that.
    • Charles Ferguson's avatar
      Report exceptions as YAMLErrors; add support for quoted keys. · 714149d3
      Charles Ferguson authored
      Exceptions were just being thrown out of the parser, which made it a
      little harder to process. These are now captured into a YAMLError
      exception, which will report the line the error occurred at.
      Keys were being processed verbatim, so any quoting was ignored in the
      key names. This has been improved, and the strings are now interpreted
      as such. However, escapes aren't processed within those strings - they
      might be handled in the future, but right now they're just passed
    • Charles Ferguson's avatar
      Move all the tests to 3-digit filename format. · 599aa602
      Charles Ferguson authored
      I'm going to add some YAML files from public sources, so to do so,
      I'm going to need a bit of space in the numbering sequence for the
      tests. Easiest thing to do - increase to 3 digits.
  3. 26 Apr, 2019 1 commit
    • Charles Ferguson's avatar
      Fix for '.' being interpreted as a floating point number. · 82a07bd3
      Charles Ferguson authored
      A bare '.' matched the floating point number regex, which isn't right,
      so I've added tests, and updated the code to ensure that it doesn't
      A few special cases have been added to try to ensure that we can
      keep from regressing with some special text that is valid but hasn't
      been tested till now.
  4. 21 Apr, 2019 2 commits
    • Charles Ferguson's avatar
      Improved the implicit key specification to include more valid chars. · a366b526
      Charles Ferguson authored
      The implicit key specification is a hard part to read within the
      specification, but I think I've captured most of the 1.1 behaviour,
      with sensible parsing for 1.2. My reading of the specification is
      that the implicit keys should not have braces embedded in them,
      but the YAML parser I use to validate against appears to allow
      them (as does the http://www.yamllint.com/ validator). I'm unsure
      why they're acceptable, so I've left them out right now.
      New test 07_dict_keys.yaml includes checks for the keys being read
      properly. This appears to be working, albeit with the numeric key
      being left off the list - although it's processed, we generate the
      key as a string, not as a number (which is what the comparison
      parser does). Consequently, I'm leaving it out of the tests (it might
      be sensible to introduce a special case in the test code to make
      it acceptable to have differences of the number).
    • Charles Ferguson's avatar
      Add handling of comments trailing the value. · d0e1a9ef
      Charles Ferguson authored
      The values can be followed by comments. This was not supported, and as
      it's a very common thing to want, I've added support for this.
  5. 23 Mar, 2019 4 commits
  6. 10 Feb, 2019 10 commits
  7. 09 Feb, 2019 8 commits