This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
373 B

  1. from lark import Transformer, v_args
  2. class JsonTreeToJson(Transformer):
  3. @v_args(inline=True)
  4. def string(self, s):
  5. return s[1:-1].replace('\\"', '"')
  6. array = list
  7. pair = tuple
  8. object = dict
  9. number = v_args(inline=True)(float)
  10. null = lambda self, _: None
  11. true = lambda self, _: True
  12. false = lambda self, _: False