Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pl.pretty: fix table write with symbol as key #319

Merged
merged 1 commit into from Jul 29, 2020

Conversation

BuBuaBu
Copy link
Contributor

@BuBuaBu BuBuaBu commented Jun 10, 2020

Table keys ordering has been introduce with commit 9aecd3f. Unfortunately
a table sort is apply on all keys, but sort with default comparator is
unable to sort table containing different value types like boolean or table.

A solution is to introduce a custom comparator.
With it keys are now in the following order:

  • ordered number
  • symbols
  • sorted strings
  • unorder numbers

Table keys ordering has been introduce with commit 9aecd3f. Unfortunately
a table sort is apply on all keys, but sort with default comparator is
unable to sort table containing different value types like boolean or table.

A solution is to introduce a custom comparator.
With it keys are now in the following order:
- ordered number
- symbols
- sorted strings
- unorder numbers
@Tieske Tieske merged commit 2d5c885 into lunarmodules:master Jul 29, 2020
@Tieske
Copy link
Member

Tieske commented Jul 29, 2020

thank you!

Tieske pushed a commit that referenced this pull request Jul 29, 2020
Table keys ordering has been introduce with commit 9aecd3f. Unfortunately
a table sort is apply on all keys, but sort with default comparator is
unable to sort table containing different value types like boolean or table.

A solution is to introduce a custom comparator.
With it keys are now in the following order:
- ordered number
- symbols
- sorted strings
- unorder numbers
bungle added a commit to Kong/kong that referenced this pull request Aug 6, 2020
### Summary

#### New features

  - `pretty.debug` quickly dumps a set of values to stdout for debug purposes

#### Changes

  - `pretty.write`: now also sorts non-string keys [#319](lunarmodules/Penlight#319)
  - `stringx.count` has an extra option to allow overlapping matches
    [#326](lunarmodules/Penlight#326)
  - added an extra changelog entry for `types.is_empty` on the 1.6.0 changelog, due
    to additional fixed behaviour not called out appropriately [#313](lunarmodules/Penlight#313)
  - `path.packagepath` now returns a proper error message with names tried if
    it fails

#### Fixes

  - Fix: `stringx.rfind` now properly works with overlapping matches
    [#314](lunarmodules/Penlight#314)
  - Fix: `package.searchpath` (in module `pl.compat`)
    [#328](lunarmodules/Penlight#328)
  - Fix: `path.isabs` now reports drive + relative-path as `false`, eg. "c:some/path" (Windows only)
  - Fix: OpenResty coroutines, used by `dir.dirtree`, `pl.lexer`, `pl.permute`. If
    available the original coroutine functions are now used [#329](lunarmodules/Penlight#329)
  - Fix: in `pl.strict` also predefine global `_PROMPT2`
  - Fix: in `pl.strict` apply `tostring` to the given name, in case it is not a string.
  - Fix: the lexer would not recognize numbers without leading zero; "-.123".
    See [#315](lunarmodules/Penlight#315)
dndx pushed a commit to Kong/kong that referenced this pull request Aug 12, 2020
### Summary

#### New features

  - `pretty.debug` quickly dumps a set of values to stdout for debug purposes

#### Changes

  - `pretty.write`: now also sorts non-string keys [#319](lunarmodules/Penlight#319)
  - `stringx.count` has an extra option to allow overlapping matches
    [#326](lunarmodules/Penlight#326)
  - added an extra changelog entry for `types.is_empty` on the 1.6.0 changelog, due
    to additional fixed behaviour not called out appropriately [#313](lunarmodules/Penlight#313)
  - `path.packagepath` now returns a proper error message with names tried if
    it fails

#### Fixes

  - Fix: `stringx.rfind` now properly works with overlapping matches
    [#314](lunarmodules/Penlight#314)
  - Fix: `package.searchpath` (in module `pl.compat`)
    [#328](lunarmodules/Penlight#328)
  - Fix: `path.isabs` now reports drive + relative-path as `false`, eg. "c:some/path" (Windows only)
  - Fix: OpenResty coroutines, used by `dir.dirtree`, `pl.lexer`, `pl.permute`. If
    available the original coroutine functions are now used [#329](lunarmodules/Penlight#329)
  - Fix: in `pl.strict` also predefine global `_PROMPT2`
  - Fix: in `pl.strict` apply `tostring` to the given name, in case it is not a string.
  - Fix: the lexer would not recognize numbers without leading zero; "-.123".
    See [#315](lunarmodules/Penlight#315)
Tieske pushed a commit to Kong/kong that referenced this pull request Sep 22, 2020
### Summary

#### New features

  - `pretty.debug` quickly dumps a set of values to stdout for debug purposes

#### Changes

  - `pretty.write`: now also sorts non-string keys [#319](lunarmodules/Penlight#319)
  - `stringx.count` has an extra option to allow overlapping matches
    [#326](lunarmodules/Penlight#326)
  - added an extra changelog entry for `types.is_empty` on the 1.6.0 changelog, due
    to additional fixed behaviour not called out appropriately [#313](lunarmodules/Penlight#313)
  - `path.packagepath` now returns a proper error message with names tried if
    it fails

#### Fixes

  - Fix: `stringx.rfind` now properly works with overlapping matches
    [#314](lunarmodules/Penlight#314)
  - Fix: `package.searchpath` (in module `pl.compat`)
    [#328](lunarmodules/Penlight#328)
  - Fix: `path.isabs` now reports drive + relative-path as `false`, eg. "c:some/path" (Windows only)
  - Fix: OpenResty coroutines, used by `dir.dirtree`, `pl.lexer`, `pl.permute`. If
    available the original coroutine functions are now used [#329](lunarmodules/Penlight#329)
  - Fix: in `pl.strict` also predefine global `_PROMPT2`
  - Fix: in `pl.strict` apply `tostring` to the given name, in case it is not a string.
  - Fix: the lexer would not recognize numbers without leading zero; "-.123".
    See [#315](lunarmodules/Penlight#315)
bungle added a commit to Kong/kong that referenced this pull request Sep 23, 2020
### Summary

#### New features

  - `pretty.debug` quickly dumps a set of values to stdout for debug purposes

#### Changes

  - `pretty.write`: now also sorts non-string keys [#319](lunarmodules/Penlight#319)
  - `stringx.count` has an extra option to allow overlapping matches
    [#326](lunarmodules/Penlight#326)
  - added an extra changelog entry for `types.is_empty` on the 1.6.0 changelog, due
    to additional fixed behaviour not called out appropriately [#313](lunarmodules/Penlight#313)
  - `path.packagepath` now returns a proper error message with names tried if
    it fails

#### Fixes

  - Fix: `stringx.rfind` now properly works with overlapping matches
    [#314](lunarmodules/Penlight#314)
  - Fix: `package.searchpath` (in module `pl.compat`)
    [#328](lunarmodules/Penlight#328)
  - Fix: `path.isabs` now reports drive + relative-path as `false`, eg. "c:some/path" (Windows only)
  - Fix: OpenResty coroutines, used by `dir.dirtree`, `pl.lexer`, `pl.permute`. If
    available the original coroutine functions are now used [#329](lunarmodules/Penlight#329)
  - Fix: in `pl.strict` also predefine global `_PROMPT2`
  - Fix: in `pl.strict` apply `tostring` to the given name, in case it is not a string.
  - Fix: the lexer would not recognize numbers without leading zero; "-.123".
    See [#315](lunarmodules/Penlight#315)
bungle added a commit to Kong/kong that referenced this pull request Sep 24, 2020
### Summary

#### New features

  - `pretty.debug` quickly dumps a set of values to stdout for debug purposes

#### Changes

  - `pretty.write`: now also sorts non-string keys [#319](lunarmodules/Penlight#319)
  - `stringx.count` has an extra option to allow overlapping matches
    [#326](lunarmodules/Penlight#326)
  - added an extra changelog entry for `types.is_empty` on the 1.6.0 changelog, due
    to additional fixed behaviour not called out appropriately [#313](lunarmodules/Penlight#313)
  - `path.packagepath` now returns a proper error message with names tried if
    it fails

#### Fixes

  - Fix: `stringx.rfind` now properly works with overlapping matches
    [#314](lunarmodules/Penlight#314)
  - Fix: `package.searchpath` (in module `pl.compat`)
    [#328](lunarmodules/Penlight#328)
  - Fix: `path.isabs` now reports drive + relative-path as `false`, eg. "c:some/path" (Windows only)
  - Fix: OpenResty coroutines, used by `dir.dirtree`, `pl.lexer`, `pl.permute`. If
    available the original coroutine functions are now used [#329](lunarmodules/Penlight#329)
  - Fix: in `pl.strict` also predefine global `_PROMPT2`
  - Fix: in `pl.strict` apply `tostring` to the given name, in case it is not a string.
  - Fix: the lexer would not recognize numbers without leading zero; "-.123".
    See [#315](lunarmodules/Penlight#315)
bungle added a commit to Kong/kong that referenced this pull request Sep 27, 2020
### Summary

#### New features

  - `pretty.debug` quickly dumps a set of values to stdout for debug purposes

#### Changes

  - `pretty.write`: now also sorts non-string keys [#319](lunarmodules/Penlight#319)
  - `stringx.count` has an extra option to allow overlapping matches
    [#326](lunarmodules/Penlight#326)
  - added an extra changelog entry for `types.is_empty` on the 1.6.0 changelog, due
    to additional fixed behaviour not called out appropriately [#313](lunarmodules/Penlight#313)
  - `path.packagepath` now returns a proper error message with names tried if
    it fails

#### Fixes

  - Fix: `stringx.rfind` now properly works with overlapping matches
    [#314](lunarmodules/Penlight#314)
  - Fix: `package.searchpath` (in module `pl.compat`)
    [#328](lunarmodules/Penlight#328)
  - Fix: `path.isabs` now reports drive + relative-path as `false`, eg. "c:some/path" (Windows only)
  - Fix: OpenResty coroutines, used by `dir.dirtree`, `pl.lexer`, `pl.permute`. If
    available the original coroutine functions are now used [#329](lunarmodules/Penlight#329)
  - Fix: in `pl.strict` also predefine global `_PROMPT2`
  - Fix: in `pl.strict` apply `tostring` to the given name, in case it is not a string.
  - Fix: the lexer would not recognize numbers without leading zero; "-.123".
    See [#315](lunarmodules/Penlight#315)
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 23, 2020
## 1.9.1 (2020-09-27)

 - fix: dir.walk [#350](lunarmodules/Penlight#350)


## 1.9.1 (2020-09-24)

 - released to superseed the 1.9.0 version which was retagged in git after some
   distro's already had picked it up. This version is identical to 1.8.1.

## 1.8.1 (2020-09-24) (replacing a briefly released but broken 1.9.0 version)

## Fixes

  - In `pl.class`, `_init` can now be inherited from grandparent (or older ancestor) classes. [#289](lunarmodules/Penlight#289)
  - Fixes `dir`, `lexer`, and `permute` to no longer use coroutines. [#344](lunarmodules/Penlight#344)

## 1.8.0 (2020-08-05)

### New features

  - `pretty.debug` quickly dumps a set of values to stdout for debug purposes

### Changes

  - `pretty.write`: now also sorts non-string keys [#319](lunarmodules/Penlight#319)
  - `stringx.count` has an extra option to allow overlapping matches
    [#326](lunarmodules/Penlight#326)
  - added an extra changelog entry for `types.is_empty` on the 1.6.0 changelog, due
    to additional fixed behaviour not called out appropriately [#313](lunarmodules/Penlight#313)
  - `path.packagepath` now returns a proper error message with names tried if
    it fails

### Fixes

  - Fix: `stringx.rfind` now properly works with overlapping matches
    [#314](lunarmodules/Penlight#314)
  - Fix: `package.searchpath` (in module `pl.compat`)
    [#328](lunarmodules/Penlight#328)
  - Fix: `path.isabs` now reports drive + relative-path as `false`, eg. "c:some/path" (Windows only)
  - Fix: OpenResty coroutines, used by `dir.dirtree`, `pl.lexer`, `pl.permute`. If
    available the original coroutine functions are now used [#329](lunarmodules/Penlight#329)
  - Fix: in `pl.strict` also predefine global `_PROMPT2`
  - Fix: in `pl.strict` apply `tostring` to the given name, in case it is not a string.
  - Fix: the lexer would not recognize numbers without leading zero; "-.123".
    See [#315](lunarmodules/Penlight#315)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants