20 Commits

Author SHA1 Message Date
xuyong
2ecaf6cedb Upgrade verion of PyYAML from 5.4.1 to 6.0
Signed-off-by: xuyong <xuyong59@huawei.com>
2022-06-17 16:30:40 +08:00
xuyong
3b30a99471 backup pyyaml from 6.0 to 5.4.1
Signed-off-by: xuyong <xuyong59@huawei.com>
2022-03-16 17:10:07 +08:00
Tina Müller
8f27932796 Fix float resolver for '.' and '._'
A single dot matches the official YAML 1.1 int regex.
This was probably unintended. The regex now requires at least
a digit before or after the dot.
2021-09-23 14:42:00 -07:00
Thom Smith
f20947ae25 Move code from lib3 to lib 2021-09-22 15:52:05 +02:00
Thom Smith
dc0c4c1441 Remove 2.7 support 2021-09-22 15:52:05 +02:00
Phil Sphicas
fc914d52c4 Avoid repeatedly appending to yaml_implicit_resolvers
Repeated calls to `resolve` can experience performance degredation, if
`add_implicit_resolver` has been called with `first=None` (to add an
implicit resolver with an unspecified first character).

For example, every time `foo` is encountered, the "wildcard implicit
resolvers" (with `first=None`) will be appended to the list of implicit
resolvers for strings starting with `f`, which will normally be the
resolver for booleans. The list `yaml_implicit_resolvers['f']` will keep
getting longer. The same behavior applies for any first-letter matches
with existing implicit resolvers.

This change avoids unintentionally mutating the lists in the class-level
dict `yaml_implicit_resolvers` by looping through a temporary copy.

Fixes: #439
2021-01-13 16:58:40 -05:00
Kirill Simonov
153a194e86 Adding an implicit resolver to a derived loader should not affect the base loader (fixes issue #57). 2016-08-25 17:42:41 -05:00
Kirill Simonov
235ab98c2c Added basic support for Python 3 (Thanks idadesub(at)users(dot)sourceforge(dot)net). 2008-12-29 17:24:05 +00:00
Kirill Simonov
073f08e9d9 A single dot is not a float value (fixes #62). 2007-11-18 00:47:32 +00:00
Kirill Simonov
04ff8e6fa1 Fix the bug when the path in add_path_resolver contains boolean values. Fix #43 (thanks to jstroud(at)mbi.ucla.edu for reporting and pointing to the cause). 2007-02-23 20:45:35 +00:00
Kirill Simonov
8f9b8bed40 The 'N' plain scalar was still recognized as `!!bool`. Fix it (close #26). 2006-08-16 21:07:47 +00:00
Kirill Simonov
17fa129ada Completely rewrite the libyaml bindings. 2006-08-13 13:46:20 +00:00
Kirill Simonov
8b083c6a96 Subclass all base classes from object.
Hold references to the objects being represented (should fix #22).

The value of a mapping node is represented as a list of pairs `(key, value)`
now.

Sort dictionary items (fix #23).

Recursive structures are now loaded and dumped correctly, including complex
structures like recursive tuples (fix #5). Thanks Peter Murphy for the patches.
To make it possible, representer functions are allowed to be generators.
In this case, the first generated value is an object. Other values produced
by the representer are ignored.

Make Representer not try to guess `!!pairs` when a list is represented.
You need to construct a `!!pairs` node explicitly now.

Do not check for duplicate mapping keys as it didn't work correctly anyway.
2006-08-03 16:07:29 +00:00
Kirill Simonov
9bd0b4e531 Fix a bug in add_path_resolver: map -> dict. 2006-05-11 21:27:20 +00:00
Kirill Simonov
43ffedd470 Allow first=None for add_implicit_resolver. 2006-05-07 14:02:42 +00:00
Kirill Simonov
b12e7fea10 Refactor resolver. 2006-04-16 23:45:21 +00:00
Kirill Simonov
6a97abb4c7 Major refactoring. 2006-04-15 23:54:52 +00:00
Kirill Simonov
cc316a4699 Implement yaml.dump(). 2006-04-11 00:34:16 +00:00
Kirill Simonov
2d457ba718 Emitter is done!!! 2006-04-09 19:51:02 +00:00
Kirill Simonov
4c570faa8b Move pyyaml3000 to a separate directory. 2006-03-04 22:43:48 +00:00