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

Infer span information #13

Closed
ptal opened this Issue Jul 7, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@ptal
Owner

ptal commented Jul 7, 2014

No description provided.

@ptal ptal changed the title from Use Span for user rules to Use Span for runtime user input and improve error messages. Jul 7, 2014

@ptal ptal added the utilities label Jul 10, 2014

@ptal ptal changed the title from Use Span for runtime user input and improve error messages. to Infer span information Nov 25, 2015

@ptal

This comment has been minimized.

Show comment
Hide comment
@ptal

ptal Nov 25, 2015

Owner

We can infer span information when needed by the user using the knowledge conveyed by the semantic rules.

Let's say we have an expression e > f, if the type signature of f is T -> U we can inspect the type T. If T = Span<T'> and if e = T' then we can conclude the semantic action expect the data to be englobed inside a span. We can recursively inspect the type of the semantic action and add span when needed along the way.

We thus need to rely on a type Span proper to Oak but the user is still allowed to convert Oak-span into its own version inside the semantic action.

Owner

ptal commented Nov 25, 2015

We can infer span information when needed by the user using the knowledge conveyed by the semantic rules.

Let's say we have an expression e > f, if the type signature of f is T -> U we can inspect the type T. If T = Span<T'> and if e = T' then we can conclude the semantic action expect the data to be englobed inside a span. We can recursively inspect the type of the semantic action and add span when needed along the way.

We thus need to rely on a type Span proper to Oak but the user is still allowed to convert Oak-span into its own version inside the semantic action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment