-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of ArrayOfTables
### What's done: - Small refactoring related to sealed classes limitations - Initial test impplemetation of array of tables - Kotlin update to 1.6.10
- Loading branch information
Showing
15 changed files
with
87 additions
and
56 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
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
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
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
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
30 changes: 22 additions & 8 deletions
30
ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/TomlTable.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
/** | ||
* Common class for tables | ||
*/ | ||
|
||
package com.akuleshov7.ktoml.tree | ||
|
||
import com.akuleshov7.ktoml.TomlConfig | ||
import com.akuleshov7.ktoml.exceptions.ParseException | ||
|
||
/** | ||
* Interface that contains all common methods that are used in KeyValue nodes | ||
* Abstract class to represent all types of tables: primitive/arrays/etc. | ||
* @property content - raw string name of the table | ||
* @property lineNo - line number | ||
* @property config - toml configuration | ||
*/ | ||
public abstract class TomlTable ( | ||
public abstract class TomlTable( | ||
override val content: String, | ||
override val lineNo: Int, | ||
override val config: TomlConfig = TomlConfig() | ||
): TomlNode(content, lineNo, config) { | ||
abstract public var fullTableName: String | ||
abstract public var tablesList: List<String> | ||
abstract public val type: TableType | ||
) : TomlNode( | ||
content, | ||
lineNo, | ||
config | ||
) { | ||
public abstract var fullTableName: String | ||
public abstract var tablesList: List<String> | ||
public abstract val type: TableType | ||
} | ||
|
||
/** | ||
* Special Enum that is used in a logic related to insertion of tables to AST | ||
*/ | ||
public enum class TableType { | ||
ARRAY, | ||
PRIMITIVE | ||
PRIMITIVE, | ||
; | ||
} |
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
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