1. 26 Mar, 2021 6 commits
  2. 04 Feb, 2018 3 commits
    • Jo-Philipp Wich's avatar
      implement POSIX regexp support · c7e938d6
      Jo-Philipp Wich authored
      
      
      Introduce a new operator `~` and new `/.../eis` regular expression syntax.
      
      This allows filtering by regular expression, e.g.
      
         jsonfilter -s '[ "foo", "bar", "baz" ]' -e '$[@ ~ /^b/]'
      
      ... would yield the values `bar` and `baz`.
      
      Possible regular expression modifiers are:
      
        - `e` ... enable extended POSIX regular expressions
        - `i` ... perform case insensitive matches
        - `s` ... let ranges and `.` match the newline character
      
      A regular expression literal may occur on the left or the right side of
      the `~` operator, but not on both.
      
      In case neither side of the `~` operator is a regular expression, the right
      side will be treated as regular expression pattern. Non-string values are
      converted to their string representation before performing matching.
      Signed-off-by: default avatarJo-Philipp Wich <jo@mein.io>
      c7e938d6
    • Jo-Philipp Wich's avatar
      lexer: fix encoding 7 bit escape sequences · cd6629fc
      Jo-Philipp Wich authored
      
      
      A misplaced paren caused escape sequences in the ranges \x00..\x7f,
      \u0000..\u007f and \0..\177 to get improperly encoded into the
      string buffer.
      Signed-off-by: default avatarJo-Philipp Wich <jo@mein.io>
      cd6629fc
    • Jo-Philipp Wich's avatar
      main: implement array mode · 86144704
      Jo-Philipp Wich authored
      
      
      Implement a new option "-a" which turns on array mode, meaning that
      the program will attempt to parse multiple consecutive JSON objects
      from the source data and merge them into a JSON array.
      
      This is mainly useful for operating on JSON log files with one object
      per line.
      Signed-off-by: default avatarJo-Philipp Wich <jo@mein.io>
      86144704
  3. 02 Jul, 2016 3 commits
  4. 07 Jun, 2016 1 commit
  5. 01 Jun, 2016 1 commit
  6. 24 May, 2016 1 commit
  7. 03 Feb, 2016 3 commits
  8. 27 Oct, 2015 1 commit
  9. 19 Jun, 2014 3 commits
  10. 18 Jun, 2014 2 commits
    • Jo-Philipp Wich's avatar
      Improve error reporting · afa3a100
      Jo-Philipp Wich authored
      
      
      Keep track of the exact location the error occured in and switch
      the internal error description from a dynamic string buffer to an
      integer which either holds negative values for lexer errors or
      positives values for grammer violations.
      
      In case of grammer violations the "error_code" member will hold
      a bitfield describing the expected tokens.
      
      Also rework the error messages emitted by the cli to be more
      precise.
      
      Examples:
      
      $ jsonfilter -s '{}' -e '@.foo bar'
      Syntax error: Expecting End of file
      In expression @.foo bar
      Near here ----------^
      
      $ jsonfilter -s '{}' -e '@.foo\bar'
      Syntax error: Unexpected character
      In expression @.foo\bar
      Near here ---------^
      
      $ jsonfilter -s '{}' -e '@.foo..bar'
      Syntax error: Expecting Label or '*'
      In expression @.foo..bar
      Near here ----------^
      Signed-off-by: default avatarJo-Philipp Wich <jow@openwrt.org>
      afa3a100
    • Jo-Philipp Wich's avatar
      cli: minor whitespace fix · c0e1d449
      Jo-Philipp Wich authored
      
      Signed-off-by: default avatarJo-Philipp Wich <jow@openwrt.org>
      c0e1d449
  11. 15 Jun, 2014 1 commit
  12. 13 Jun, 2014 1 commit
  13. 06 Jan, 2014 1 commit
  14. 02 Jan, 2014 1 commit
  15. 01 Jan, 2014 4 commits
  16. 31 Dec, 2013 1 commit
  17. 29 Dec, 2013 7 commits