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

Add Line Mapping to Code #44

Merged
merged 1 commit into from
May 8, 2024
Merged

Conversation

alonalbert
Copy link
Contributor

  • Map source lines to code lines
  • Map code lines to source lines

* Map source lines to code lines
* Map code lines to source lines
private val jumps: Map<Int, Int>
class Code(
val text: String,
private val jumps: Map<Int, Int>,
Copy link
Owner

Choose a reason for hiding this comment

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

Since we already use androidx.collection here, you should use https://developer.android.com/reference/kotlin/androidx/collection/MutableIntIntMap instead.

@@ -30,12 +30,13 @@ class CodeBuilder(private val codeStyle: CodeStyle) {
private var line = 0
private val sb = StringBuilder()
private val jumps = mutableMapOf<Int, Int>()
private val sourceToCodeLine = mutableMapOf<Int, Int>()
Copy link
Owner

Choose a reason for hiding this comment

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

See above (MutableIntIntMap)

@romainguy romainguy merged commit 168be46 into romainguy:main May 8, 2024
1 check passed
@alonalbert alonalbert deleted the line-maps branch May 9, 2024 12:15
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