Commit graph

441 commits

Author SHA1 Message Date
Cameron Ross fd50e2cefc
refactor portions of Node to allow const Nodes to be more useful 2018-04-10 03:36:09 -03:00
Cameron Ross 1e88dc5074
immutable byte arrays aren't quite @safe yet with D-YAML, so test mutable instead 2018-04-10 03:27:38 -03:00
Cameron Ross 9b7c882a03
remove blank line at EOF errors 2018-04-09 22:57:26 -03:00
Cameron Ross e411fad92f
remove trailing whitespace 2018-04-09 22:57:14 -03:00
Cameron Ross cd505b5fb9
fix missing yaml file for a resolver example 2018-04-09 21:43:07 -03:00
Cameron Ross 9d35b773b4
convert examples to doc'd unittests, fix some parameter errors, remove some redundancy 2018-04-09 21:14:51 -03:00
Cameron Ross 3ef3240a4c
remove misleading Error = ___Exception aliases 2018-04-09 19:34:45 -03:00
Cameron Ross 8074792fb3
remove redundant BOM definitions 2018-04-08 04:14:03 -03:00
Cameron Ross 3b7033d046 allow dyaml.test.reader.testStreamError to be @safe 2018-04-07 20:05:39 +02:00
Cameron Ross 3cfdd7ba56 allow dyaml.test.representer.testRepresenterTypes to be @safe 2018-04-07 20:05:39 +02:00
Cameron Ross c1165b976e mark dyaml.parser.Parser.parseNode.get as @safe 2018-04-07 20:05:39 +02:00
Cameron Ross 6088f0b632 major attribute fixing 2018-04-07 20:05:39 +02:00
Cameron Ross 683335aa3e remove zerostring (#94)
remove zerostring
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-03-01 04:20:43 +01:00
Cameron Ross 72995df864 remove deprecated yaml/dyaml.all modules (#93)
remove deprecated yaml/dyaml.all modules
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-03-01 01:01:00 +01:00
The Dlang Bot 0784ca63ec
Merge pull request #92 from Herringway/bmp-fix
Fix issue #79: Support for non-BMP Unicode characters
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-02-28 01:24:54 +01:00
Cameron Ross 5ad4c3c435 minor refactor: move tests to dyaml.test.*, remove spaces at ends of lines (#91)
minor refactor: move tests to dyaml.test.*, remove spaces at ends of lines
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-02-28 01:24:05 +01:00
Cameron Ross 4a106181dd
Add support for unicode chars in the 0x10000 - 0x10FFFF range as required by spec 2018-02-27 14:15:47 -04:00
majiang e7ea38652b Do not emit BOM for UTF-8 (Solve #88) (#89)
Do not emit BOM for UTF-8 (Solve #88)
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
2018-02-24 11:45:36 +01:00
Sebastian Wilzbach e4591f5847 Fix imports 2018-01-18 02:08:38 +01:00
Michail Pevnev 6a381528a3 Added 'enforce' checks on ranges' emptiness. 2017-08-01 18:31:34 +03:00
Michail Pevnev c123e6afee Fixed new ranges not being random-access ranges.
Forgot to add 'length' property.
2017-08-01 14:37:28 +03:00
Michail Pevnev 2b6c417006 Added ranges-iterators to the Node struct.
Added methods: sequence, mapping (iterates over pairs), mappingKeys,
mappingValues.
2017-08-01 14:13:35 +03:00
Basile Burg a2c0c60884
fix issue #73 - Failure to compile when assigning a const(bool) to a node 2017-08-01 01:12:35 +02:00
Basile Burg 86079840f0 fix #71 - Unittests of package fails when calling as dependency 2017-07-19 17:00:40 +03:00
Basile Burg 5e47223b4a
Remove a deprecation message + add sub selections file to gitignore 2017-06-30 05:06:54 +02:00
Sebastian Wilzbach aab0953e31 Fix deprecations: remove the old std.string.removechars 2017-06-15 00:55:50 +02:00
Basile Burg aab7c7aabe fix #63 (#64)
* fix #63

* rather patch the context in case of corruption
2017-05-31 09:59:27 +02:00
Mihails Strasuns 93edffaab5 Fix .ptr + @safe deprecation
Deprecation: str ~ '\x00'.ptr cannot be used in @safe code, use &str ~ '\x00'[0]
2017-05-25 22:15:21 +02:00
Basile Burg 4b175acc7f Merge pull request #39 from Herringway/master
add package.d, deprecate yaml/dyaml.all
2017-05-17 04:41:51 +02:00
ZombineDev 38f1ba3900 Add support for writing strings to existing files through YFile stream 2016-12-10 20:33:43 +02:00
ZombineDev b01e99d8e6 Update source/dyaml/stream.d to conform to the existing coding style 2016-12-10 20:07:14 +02:00
ZombineDev 655a0aadd2 Add test for file dumping 2016-12-10 19:56:44 +02:00
forbjok 6e0ef1aae0 Fix dumping to file producing garbage (#3)
* Fix dumping to file producing garbage

* Use rawWrite instead of casting to char[]
2016-12-10 19:45:43 +02:00
Forb.Jok 22c432fb52 Make Node type identification properties public 2016-12-08 18:01:08 +01:00
ZombineDev 503357e3ea Stop using implicit string literal concatenation in one more place
Implicit string litaral concatenation was deprecated with
this DMD PR: dlang/dmd/pull/6155.
2016-11-15 20:07:48 +02:00
ZombineDev bc1a2c2d0f Stop using implicit string literal concatenation
Implicit string litaral concatenation was deprecated with
this DMD PR: dlang/dmd/pull/6155.
2016-11-04 02:50:32 +02:00
ZombineDev 8d5b75b879 Fix compilation with DMD 2.072.0
The following DMD PRs added more rigorous safety checks directly
affecting this project:
* dlang/dmd#5852 (fix Issue 15399 - unaligned pointers are not
  `@safe`) - triggered at line:
  https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/emitter.d#L1011

* dlang/dmd#5940 (Unions may break immutability / unions with
  pointers are un-`@safe` ) - triggered at line:
  https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/event.d#L230

* dlang/dmd#5876 (Casting from `void[]` to `T[]` is erroneously
  considered `@safe`) - triggered at line:
  https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/loader.d#L186

* dlang/dmd#5860 (array.ptr in @safe code may point past end
  of array) - triggered at line:
  https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/zerostring.d#L35
2016-11-04 02:37:29 +02:00
Robert burner Schadek 14ae4e6b06 removed dead code 2016-03-17 22:10:32 +01:00
Robert burner Schadek b739ade285 no more stream!? 2016-03-17 01:00:54 +01:00
Robert burner Schadek 41133e3b0d it compiles at the tests run without segfault
I call this a first step
2016-03-17 00:55:57 +01:00
Robert burner Schadek daf1a0064f trying to rip the std.stream out 2016-03-17 00:43:58 +01:00
Martin Nowak 23f16cfbf2 fix for lookup change in 2.071.0
- local symbols are preferred over imported symbols making the mixed in
  canFind hide std.algorithm.canFind
2016-02-21 22:05:36 +01:00
Cameron Ross be0f967c6c add package.d, deprecate yaml/dyaml.all 2015-11-10 01:54:54 -04:00
Cameron Ross af724ddcf4 use systime's duration overload instead of deprecated fracsec overload 2015-11-05 20:28:12 -04:00
Cameron Ross 989e1b3375 avoid use of a static constructor in parser
this makes usage in module constructors more reliable and improves
consistency with the emitter
2015-10-03 21:52:44 -03:00
Cameron Ross 91cdb9a6f4 fix emitting of unicode characters >0xFFFF 2015-09-25 03:18:37 -03:00
Ferdinand Majerech 2f3d782c84 Fixed compilation with DMD 2.068
Had to use a lot of @trusted as std.variant.VariantN is again less safe.
Will need to change that back once it gets safer, or at least isolate
code using it so that half of Node API doesn't need to be @trusted.
2015-08-23 09:09:24 +02:00
Ferdinand Majerech b5e028d239 Commit missing weOwnStream_ 2015-06-05 13:31:54 +02:00
Ferdinand Majerech 385cfd5420 If we create a File instance, be sure to destroy it. 2015-06-03 21:04:15 +02:00
Ferdinand Majerech 96f64eb221 Merge pull request #29 from soarqin/dmd2067_fix
Fixed compilation for dmd 2.067
2015-06-03 20:33:39 +02:00
Ferdinand Majerech 6d706dd3dc nothrow Node constructors where possible (at the moment) 2015-06-03 20:30:19 +02:00
Soar Qin bfd8654816 Fixed compilation for dmd 2.067 2015-03-17 14:08:40 +08:00
Ferdinand Majerech 05270e5f60 Doc fixes 2015-02-21 14:31:55 +01:00
Colden Cullen df0624fa1f Changed exceptions to take line as a size_t
`Exception` takes `line` as a `size_t`, so this is for consistency.
2014-09-19 12:58:16 -04:00
Ferdinand Majerech 494dcd30d9 tinyendian is now a DUB package. 2014-08-06 16:15:02 +02:00
Ferdinand Majerech 510065b111 Style. 2014-08-06 14:17:32 +02:00
Ferdinand Majerech b254e35762 Unittest build now works with 'dub test' 2014-08-06 14:17:07 +02:00
Ferdinand Majerech 0268a1ea39 Refactored func attribs in Reader. 2014-08-05 23:00:23 +02:00
Ferdinand Majerech ada8335504 Compound pure nothrow @nogc in Scanner. 2014-08-05 22:52:51 +02:00
Ferdinand Majerech cd879c05d3 Spaces. 2014-08-05 22:41:40 +02:00
Ferdinand Majerech 1916b1953a Loader doc fix. 2014-08-05 22:07:35 +02:00
Ferdinand Majerech 893b43edee Style. 2014-08-05 21:31:42 +02:00
Ferdinand Majerech fd93830243 Using the Scanner FastCharSearches wherever they apply. 2014-08-05 21:31:36 +02:00
Ferdinand Majerech 755eb4e468 Moved common FastCharSearch instantiations to Scanner body to minimize bloat. 2014-08-05 21:30:59 +02:00
Ferdinand Majerech d505728824 Moved a branch outside of aloop in scanPlain() to improve performance. 2014-08-05 20:58:05 +02:00
Ferdinand Majerech 57d936ed0f Scanner using prefixBytes() for optimization. 2014-08-05 20:57:30 +02:00
Ferdinand Majerech 3b303f6e82 An ASCII (bytes) version of prefix(). 2014-08-05 20:56:59 +02:00
Ferdinand Majerech 8f94a40730 Doc fixes. 2014-08-05 20:56:30 +02:00
Ferdinand Majerech 568e75d3de Removed decodeCount_, as it's no longer used. 2014-08-05 20:53:04 +02:00
Ferdinand Majerech 2b7ea42199 Removed the old (obsolete) Reader decoding method. 2014-08-05 20:52:43 +02:00
Ferdinand Majerech 92396b4cae An optimized version of forward() with length == 1. 2014-08-05 20:52:05 +02:00
Ferdinand Majerech 34e6f55bd9 forward() now uses upcomingASCII_ 2014-08-05 20:46:00 +02:00
Ferdinand Majerech c828c6b132 peek()/slice() now use upcomingASCII() 2014-08-05 20:44:15 +02:00
Ferdinand Majerech d9079de427 get() now calls slice() directly instead of through prefix(). 2014-08-05 20:42:51 +02:00
Ferdinand Majerech bfa2f1bd5c Using checkASCII in Reader. 2014-08-05 20:42:22 +02:00
Ferdinand Majerech e01c40ede5 Func to count consecutive ASCII chars starting at current Reader position. 2014-08-05 20:36:33 +02:00
Ferdinand Majerech 7409f3bbd9 ASCII optimizations for isPrintableValidUTF8. 2014-08-05 19:34:28 +02:00
Ferdinand Majerech 1c0702f3cd Func to count the num of ASCII chars in string before the first UTF-8 sequence 2014-08-05 19:12:54 +02:00
Ferdinand Majerech 8902ea8806 Minor optimization. 2014-08-05 18:21:42 +02:00
Ferdinand Majerech b2d0c74e56 Minor style fix. 2014-08-05 18:21:29 +02:00
Ferdinand Majerech a89f9e93f7 Removed unnecessary memory allocations in Queue. 2014-08-05 18:20:57 +02:00
Ferdinand Majerech a9333e3dd3 Fixed another 'in' parameter. 2014-08-05 18:15:07 +02:00
Ferdinand Majerech 9ea269de87 Removed obsolete 'final' from Reader methods. 2014-08-05 13:14:42 +02:00
Ferdinand Majerech 3d8de67771 Using peekByte() where possible in Scanner. 2014-08-05 13:14:15 +02:00
Ferdinand Majerech 078269be36 Queue no longer supports types with destructors. 2014-08-05 13:12:07 +02:00
Ferdinand Majerech 7539b40d3d (optimization) Mark ctor now doesn't check file column for overflow. 2014-08-05 13:10:52 +02:00
Ferdinand Majerech 57afd47bb5 Doc fixes. 2014-08-05 01:53:17 +02:00
Ferdinand Majerech fb9525bb00 Obsoleting decodeCount_. 2014-08-05 01:52:21 +02:00
Ferdinand Majerech 75ed314dd6 More FastCharSearch. 2014-08-05 01:51:32 +02:00
Ferdinand Majerech 0424ff5e77 Style. 2014-08-05 01:51:20 +02:00
Ferdinand Majerech 44885cde4e Optimized fetchToken() 2014-08-04 02:26:14 +02:00
Ferdinand Majerech 7360e85a3a More FastCharSearch based on profiling results. 2014-08-04 02:24:26 +02:00
Ferdinand Majerech 5a1e6e994d Fixed a nasty rare bug caused by an assumption that 32 chars take 32 bytes. 2014-08-04 02:23:08 +02:00
Ferdinand Majerech 20048ea995 Using peekByte() in heavily used Scanner methods. 2014-08-04 02:22:09 +02:00
Ferdinand Majerech 8e63f62d7e An optimized version of peek() that reads a byte, without decoding. 2014-08-04 02:20:13 +02:00
Ferdinand Majerech a4befdd866 An optimized version of Reader.peek() with index == 0. 2014-08-04 02:19:34 +02:00
Ferdinand Majerech 063d9754d7 Queue now uses a freelist to minimize allocations. 2014-08-04 02:16:34 +02:00
Ferdinand Majerech 97e717df1b Loader creates Constructor/Resolver lazily to avoid garbage when user-provided 2014-08-04 02:14:01 +02:00
Ferdinand Majerech 6aa50b8898 A benchmark Loader method that scans a file but throws away the tokens. 2014-08-02 23:26:46 +02:00
Ferdinand Majerech c160156346 Fixed the string->char[] Token value move. 2014-08-02 23:25:56 +02:00