Giter Club home page Giter Club logo

caml's People

Contributors

asgoth avatar bgotink avatar kevin-smets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

asgoth

caml's Issues

Error when parsing values in lists

Constructs like the following:

arr: [
  'one',
  'http://two'
]

Causes parsing errors: throw new Error('Key contains incomplete quoted section: "' + line + '"');

Inline comments cause loss of properties

Oriniginally submitted by @asgoth - the sanitise step is too eager. Using comments after a property causes the property to disappear, e.g.

path:
  to:
    some: "value" # some explanation what this does
    other: "value"

Results in

{
  path: {
    to: {
      other: "value"
    }
  }
}

Property some is gone.

Workaround: Keep your comments on a dedicated line

Improvement: provide a syntax to merge arrays

Sometimes it is needed to merge arrays, e.g. when you want to expand a default list of types.

Maybe the following syntax could be used:

files:
  +: *baseFiles
  - "path/to/file1"
  - "path/to/file2"

Help statement

Error output is not really helpful:

$ caml
Flag '-i' or '--input' is mandatory. e.g. --input a b c, cascades a.yml, b.yml and c.yml.

The -i flag doesn't exist anymore, should be -f or --files

regex for sanitising is invalid

Regex /[",'].*\..*[",']:/ matches stuff like the following yaml file incorrectly:

'"this is": a': test

In yaml:

> require('js-yaml').safeLoad(require('fs').readFileSync('test.yml'))
{ '"this.is": a': 'test' }

In caml:

$ caml -f test

/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/scanner.js:504
            throw new exports.ScannerError(null, null, 'mapping values are not allowed here', this.get_mark());
            ^
mapping values are not allowed here
  on line 1, column 15
    at ScannerError.YAMLError [as constructor] (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/errors.js:70:46)
    at ScannerError.MarkedYAMLError [as constructor] (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/errors.js:90:45)
    at new ScannerError (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/scanner.js:23:49)
    at Constructor.__dirname.Scanner.Scanner.fetch_value (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/scanner.js:504:19)
    at Constructor.__dirname.Scanner.Scanner.fetch_more_tokens (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/scanner.js:214:21)
    at Constructor.__dirname.Scanner.Scanner.check_token (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/scanner.js:115:14)
    at Constructor.__dirname.Parser.Parser.parse_block_mapping_key (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/parser.js:421:16)
    at Constructor.__dirname.Parser.Parser.check_event (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/parser.js:61:48)
    at Constructor.__dirname.Composer.Composer.compose_mapping_node (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/composer.js:143:20)
    at Constructor.__dirname.Composer.Composer.compose_node (/usr/local/lib/node_modules/caml/node_modules/yaml-js/lib/composer.js:91:21)

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.