Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wish] loc API #99

Open
gares opened this issue Apr 20, 2021 · 0 comments
Open

[wish] loc API #99

gares opened this issue Apr 20, 2021 · 0 comments

Comments

@gares
Copy link
Contributor

gares commented Apr 20, 2021

the loc datatype is opaque, it would be nice to have

  • a predicate to get file, line, chars... out of a loc (HB prints the loc to a string and then chops it with regexp)
  • a gadget type located loc -> A -> A
    • have the parser optionally insert it
      • use it in the type checker to report errors more precisely
    • utility predicate to copy any term and remove it

at the API level, smart constructors could take an optional ?loc and put the located wrapper

to be understood if there are other uses of this located, maybe it could become info B -> A -> A and then (info (loc L) T) or (info [loc L, typ Ty] T) the way it is used to attach a loc and a type to T, and eventually info list prop -> A ->A to let one write

p (info Info T) :- Info => p-rec T.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant