Giter VIP home page Giter VIP logo

cddl's Introduction

Hi , I'm Christian

Open Source & Open Standards Advocate.

  • 🔭 I’m currently working at OutSystems on @stenciljs

  • 🤝 I’m automating things with WebdriverIO

  • 📝 I regulary write articles in my blog

  • 🧠 I'm learning Video Editing with Final Cut Pro

  • 💬 Ask me about WebdriverIO / Test Automation / VSCode Extension Development / Node.js / TypeScript

  • ⚡ Fun fact I grew up on the country side in Germany next to 🐮 and 🐔

Skills

JavaScript TypeScript Python Go Git HTML5 React NextJs TailwindCSS Vite NodeJS Express Firebase Photoshop

Socials

Blogs posts

christian-bromann

  christian-bromann

bromann https://www.linkedin.com/in/christian-bromann/ christian-bromann

christian-bromann

cddl's People

Contributors

christian-bromann avatar dependabot[bot] avatar diemol avatar jkva avatar zcorpan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cddl's Issues

Support nested groups

It should be possible to define groups like this:

foobar = {
  foo: { bar: text }
}

Support 3.8 control operators

See 3.8 of the spec: https://datatracker.ietf.org/doc/rfc8610/

Once implemented the following error should be gone:

/examples/webdriver/remote.cddl:186:33 - error: Expected ":" or "=>"

  ?background: bool .default false,
                                 ^
                                 |

Initial entries in this registry are as follows:

                   +----------+---------------+
                   | Name     | Documentation |
                   +----------+---------------+
                   | .size    | RFC 8610      |
                   | .bits    | RFC 8610      |
                   | .regexp  | RFC 8610      |
                   | .cbor    | RFC 8610      |
                   | .cborseq | RFC 8610      |
                   | .within  | RFC 8610      |
                   | .and     | RFC 8610      |
                   | .lt      | RFC 8610      |
                   | .le      | RFC 8610      |
                   | .gt      | RFC 8610      |
                   | .ge      | RFC 8610      |
                   | .eq      | RFC 8610      |
                   | .ne      | RFC 8610      |
                   | .default | RFC 8610      |
                   +----------+---------------+

Expected property name, received [([), ((()

The WebDriver example currently still is not parseable due to:

/examples/webdriver/local.cddl:444:29 - error: Expected property name, received [([), ((()

script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]];
                             ^
                             |

and

/examples/webdriver/local.cddl:604:30 - error: Expected property name, received [([), ((()

script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]];
                              ^
                              |

I am not completely sure whether this is valid CDDL but if so it should be parsed.

Support 3.9. Socket/Plug

See https://datatracker.ietf.org/doc/rfc8610/

3.9. Socket/Plug

For both type choices and group choices, a mechanism is defined that
facilitates starting out with empty choices and assembling them
later, potentially in separate files that are concatenated to build
the full specification.

Per convention, CDDL extension points are marked with a leading
dollar sign (types) or two leading dollar signs (groups). Tools
honor that convention by not raising an error if such a type or group
is not defined at all; the symbol is then taken to be an empty type
choice (group choice), i.e., no choice is available.

        tcp-header = {seq: uint, ack: uint, * $$tcp-option}

        ; later, in a different file

        $$tcp-option //= (
        sack: [+(left: uint, right: uint)]
        )

        ; and, maybe in another file

        $$tcp-option //= (
        sack-permitted: true
        )

Fails to parse syntax for object in array `[1* {} ]`

See w3c/at-driver#26 (comment)

This fails to parse:

   ActionsPerformActions = {
     method: "actions.perform",
    params: ActionsPerformActionsParameters
   }
 
  ActionsPerformActionsParameters = [1* {
     type: "key",
     id: text,
    actions: ActionItems,
     *text => any
  }]
 
  ActionItems = [1* {
     type: "keyUp" / "keyDown",
     value: text,
     *text => any
  }]

but this works ok

ActionsPerformActions = {
  method: "actions.perform",
  params: [1* ActionsPerformActionsParameter ]
}

ActionsPerformActionsParameter = {
  type: "key",
  id: text,
  actions: [1* ActionItem ],
  *text => any
}

ActionItem = {
  type: "keyUp" / "keyDown",
  value: text,
  *text => any
}

From my reading of the spec they should be equivalent.

package.json points to nonexistent index.js file

Trying to run the sample code in the README as a node script, I get this error:

% node test.js

internal/modules/cjs/loader.js:311
      throw err;
      ^

Error: Cannot find module '<path>/node_modules/cddl/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:303:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (<path>/test.js:1:14)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32) {
  code: 'MODULE_NOT_FOUND',
  path: '<path>/node_modules/cddl/package.json',
  requestPath: 'cddl'
}

The package.json file in this repo says

  "main": "index.js",

But there is no index.js file.

Am I holding it wrong, or is it a bug?

Support token locations

In order to provide information on where parsing errors occured we need to attach location information to each token.

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.