-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ChAoSUnItY/master
More implmentation
- Loading branch information
Showing
14 changed files
with
73 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
commonVersion=1.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package chaos.unity.nengao | ||
|
||
import chaos.unity.nenggao.AbstractLabel | ||
import chaos.unity.nenggao.AbstractSpan | ||
|
||
@Suppress("unused") | ||
data class KtLabel(val span: AbstractSpan, val message: String) : AbstractLabel(span, message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package chaos.unity.nengao | ||
|
||
import chaos.unity.nenggao.AbstractPosition | ||
|
||
@Suppress("unused") | ||
data class KtPosition(val line: Int, val pos: Int) : AbstractPosition(line, pos) |
5 changes: 3 additions & 2 deletions
5
.../kotlin/chaos/unity/nengao/kotlin/Span.kt → .../main/kotlin/chaos/unity/nengao/KtSpan.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
kotlinImpl/src/main/kotlin/chaos/unity/nengao/kotlin/Label.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
kotlinImpl/src/main/kotlin/chaos/unity/nengao/kotlin/Position.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
plugins { | ||
scala | ||
} | ||
|
||
val commonVersion: String by properties | ||
|
||
group = "chaos.unity.nenggao" | ||
version = commonVersion | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(project(":")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package chaos.unity.nenggao | ||
|
||
import scala.annotation.unused | ||
|
||
@unused | ||
case class ScLabel(span: AbstractSpan, message: String) extends AbstractLabel(span, message) |
6 changes: 6 additions & 0 deletions
6
scalaImpl/src/main/scala/chaos/unity/nenggao/ScPosition.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package chaos.unity.nenggao | ||
|
||
import scala.annotation.unused | ||
|
||
@unused | ||
case class ScPosition(line: Int, pos: Int) extends AbstractPosition(line, pos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package chaos.unity.nenggao | ||
|
||
case class ScSpan(startPosition: AbstractPosition, endPosition: AbstractPosition) extends AbstractSpan(startPosition, endPosition) { | ||
override def expand(endSpan: AbstractSpan): AbstractSpan = { | ||
val copied = copy() | ||
|
||
if (endSpan == null) copied | ||
else if (endSpan.endPosition.line < startPosition.line) copied | ||
else if (endSpan.endPosition.line == startPosition.line && endSpan.endPosition.pos < startPosition.pos) copied | ||
else { | ||
val startPosition = startPosition | ||
val endPosition = endSpan.endPosition | ||
|
||
ScSpan(startPosition, endPosition) | ||
} | ||
} | ||
|
||
override def copy(): AbstractSpan = | ||
ScSpan(startPosition, endPosition) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
rootProject.name = "Nenggao" | ||
|
||
include("kotlinImpl") | ||
include("scalaImpl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +0,0 @@ | ||
start | ||
post-start | ||
|
||
|
||
|
||
|
||
|
||
|
||
pre-end | ||
end | ||