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

initial version of INI file parser #1858

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

initial version of INI file parser #1858

wants to merge 4 commits into from

Conversation

maximiliankaul
Copy link
Contributor

@maximiliankaul maximiliankaul commented Nov 20, 2024

Initial version of an INI file parser.

  • check license compatibility
  • write README.md? do we want to support more ini file formats?

@maximiliankaul maximiliankaul self-assigned this Nov 20, 2024
@maximiliankaul maximiliankaul linked an issue Nov 20, 2024 that may be closed by this pull request
* - the file is accepted by the [ini4j library](https://ini4j.sourceforge.net/)
*/
class IniFilesLanguage : Language<IniFilesFrontend>() {
override val fileExtensions = listOf("ini")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

".conf" extension, too

*/
class IniFilesLanguage : Language<IniFilesFrontend>() {
override val fileExtensions = listOf("ini")
override val namespaceDelimiter: String = "" // no such thing
Copy link
Contributor Author

Choose a reason for hiding this comment

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

path separator .

}

override fun locationOf(astNode: Any): PhysicalLocation? {
return null // currently, the line number / column cannot be accessed given an Ini object
Copy link
Contributor Author

Choose a reason for hiding this comment

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

return entire file first line number to last line number

it.registerLanguage<IniFilesLanguage>()
}
assertIs<TranslationUnitDeclaration>(tu)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add namespace test

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.

Represent configuration files, e.g. INI file
1 participant