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

Make lightyear track position information. #55

Merged
merged 3 commits into from
Jul 18, 2017
Merged

Make lightyear track position information. #55

merged 3 commits into from
Jul 18, 2017

Conversation

jfdm
Copy link
Contributor

@jfdm jfdm commented Mar 31, 2017

  • Added tracking of parser state to include positioning information.
  • Updated error message output using new state.
  • Deprecated old error messages.
  • Updated the test suite.

+ Added tracking of parser state to include positioning information.
+ Updated error message output using new state.
+ Deprecated old error messages.
+ Updated the test suite.
Copy link
Owner

@ziman ziman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good to me, there's one very last thing about tab stops.

where
partial
nextTab : Nat
nextTab = ((c + 7) `div` twidth) * twidth + 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be ((c-1 + twidth) `div` twidth) * twidth + 1?

  1. c-1 converts to 0-based units
  2. + twidth shifts one tab width
  3. div, * rounds down to the closest tab stop to the left
  4. + 1 converts back to 1-based units

This is the same as your code if twidth = 8 but not otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, will change on monday when next at a dev machine.

@ziman ziman merged commit dbcd847 into ziman:master Jul 18, 2017
@jfdm jfdm deleted the positioning branch July 20, 2017 10:25
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

Successfully merging this pull request may close these issues.

2 participants