GithubHelp home page GithubHelp logo

jcalero / kerbal-parser Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 356 KB

A library for parsing .cfg files made for Kerbal Space Program. Include in your KSP tools for easy parsing to and from KSP's config syntax.

License: GNU Lesser General Public License v3.0

C# 100.00%

kerbal-parser's People

Contributors

jcalero avatar

Watchers

 avatar  avatar

Forkers

mrlyceist

kerbal-parser's Issues

Detect ModuleManager Nodes and ignore or store separately

At the moment modulemanager config nodes (e.g. @PART { ... } ) will be treated like normal nodes and added to the models (e.g. with name @PART, etc).

Need to detect if a node is a module manager node and ignore it or deal with it independently.

Deal with } bracket before NODE

E.g. ... } NODE { ... }

Annoying to deal with it in the current "line by line", sequential design. Should be easier in a "token by token" design.

Validate node name (name should be single, no-ops string)

E.g.

broken ¬! = node --- name
{
   property = value
   ....
}

Node name here becomes broken ¬! = node --- name and the file parses fine. Need to validate node name and catch parse errors like this.

  • Single string
  • No special characters

Deal with "file name is top node"

Apparently files can have loose properties outside a node or no top node at all. In which case the filename is considered a top node.

E.g. part.cfg that contains name = mk1pod and nothing else will be considered as a file with

PART {
  name = mk1pod
}

in it.

ESSENTIAL: Allow for duplicates of values...

Verify how KSP deals with this.. But all in all, we need to be able to store multiple values with the same name. Essential for Tech Tree parser that stores parts lists.

One solution: Store values as lists.
Other solution: Store property/value pairs in a Lookup

Make sure of matching brackets

E.g.

NODE {
  property = value
  SUBNODE {
    property = value
  }

This tree parses just fine. Need to make sure opening brackets always have a matching close bracket.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.