summaryrefslogtreecommitdiff
path: root/guix/scripts/pack.scm
diff options
context:
space:
mode:
authorSarah Morgensen <iskarian@mgsn.dev>2021-07-16 21:01:28 -0700
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-07-18 01:57:17 -0400
commit793ba333c6039545684e8af7e384704e76bc0f2f (patch)
tree2705d7a6da51a129ff441820199a485b1cce852b /guix/scripts/pack.scm
parent3217a04b0352c2dd13323257b369604eeabfccc3 (diff)
downloadguix-patches-793ba333c6039545684e8af7e384704e76bc0f2f.tar
guix-patches-793ba333c6039545684e8af7e384704e76bc0f2f.tar.gz
import: go: Upgrade go.mod parser.
Upgrade the go.mod parser to handle the full go.mod spec, and to gracefully handle unexpected/malformed syntax. Restructure parser usage, making the parse tree available for other uses. guix/import/go.scm (parse-go.mod): Parse using (ice-9 peg) instead of regex matching for more robustness. Return a list of directives. (go.mod-directives): New procedure. (go.mod-requirements): Likewise. (go-module->guix-package): Use it. (%go.mod-replace-directive-rx): Remove unused variable. tests/go.scm (testing-parse-mod): Adjust accordingly. (go.mod-requirements) (fixture-go-mod-unparseable) (fixture-go-mod-retract) (fixture-go-mod-strings): New variables. ("parse-go.mod: simple") ("parse-go.mod: comments and unparseable lines") ("parse-go.mod: retract") ("parse-go.mod: raw strings and quoted strings") ("parse-go.mod: complete"): New tests. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'guix/scripts/pack.scm')
0 files changed, 0 insertions, 0 deletions