diff options
author | Sarah Morgensen <iskarian@mgsn.dev> | 2021-07-16 21:01:28 -0700 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-07-18 01:57:17 -0400 |
commit | 793ba333c6039545684e8af7e384704e76bc0f2f (patch) | |
tree | 2705d7a6da51a129ff441820199a485b1cce852b /guix/d3.v3.js | |
parent | 3217a04b0352c2dd13323257b369604eeabfccc3 (diff) | |
download | guix-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/d3.v3.js')
0 files changed, 0 insertions, 0 deletions