This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

18 righe
415 B

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