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

core: constructing a record in head can give different results in calling rule vs when it's bound as one var #160

Open
vilterp opened this issue May 3, 2022 · 0 comments
Labels
area:core bug Something isn't working

Comments

@vilterp
Copy link
Owner

vilterp commented May 3, 2022

Calling rule:

hl.Segment{type: T, id: I, span: S, highlight: H} :-
  hl.segmentInt{type: T, id: I, span: S, highlight: H} |
  hl.segmentString{type: T, id: I, span: S, highlight: H} |
  hl.segmentBool{type: T, id: I, span: S, highlight: H} |
  hl.keyword{type: T, id: I, span: S, highlight: H} |
  hl.segmentIdent{type: T, id: I, span: S, highlight: H} |
  hl.segmentSpecialVar{type: T, id: I, span: S, highlight: H} |
  hl.segmentIdentDefnHL{type: T, id: I, span: S, highlight: H} |
  hl.segmentIdentUsageHL{type: T, id: I, span: S, highlight: H} |
  hl.segmentComment{type: T, id: I, span: S, highlight: H}.

Works:

hl.segmentIdentDefnHL{type: "defn", span: S, highlight: true} :-
  ide.CurrentDefnOrDefnOfCurrentVar{span: S}.

Doesn't work:
inlining ide.CurrentDefnOrDefnOfCurrentVar:

hl.segmentIdentDefnHL{type: "defn", span: span{from: F, to: T}, highlight: true} :-
  scope.Defn{span: span{from: F, to: T}} &
  ide.Cursor{idx: CIdx} &
  F <= CIdx & CIdx <= T.

These should work the same. Something's going wrong with bindings in the simple interpreter.

@vilterp vilterp added bug Something isn't working area:core labels May 3, 2022
@vilterp vilterp changed the title constructing a record in head can give different results in calling rule vs when it's bound as one var core: constructing a record in head can give different results in calling rule vs when it's bound as one var Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant