GithubHelp home page GithubHelp logo

yaml-grammar's Introduction

yaml-grammar's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yaml-grammar's Issues

Names for Rules Variables are difficult to understand in context

The spec describes 4 rule variables, n, m, c, and t.

I find a terse, single letter, variable in the spec difficult for two reasons:

  1. When looking at the rules, it is difficult to remember what each letter means. If the variables were named with a brief summary of the actual value, it would be easier to remember the actual meaning.
  2. The short names make searching for usages impossible. If the names were distinct, then it would be possible to quickly find usages and the definition.

I would find the spec easier to understand if the names were more descriptive. For example:

  • ncurrentIndent
  • madditionalIndent
  • ccurrentContext
  • twhitespaceTrim

Rule prefix length - 1 or 2 characters, or more?

The spec says each rule name has a "1 or 2 character prefix".

# Each rule name has a 1 or 2 character prefix indicating the rule type.

However, some rules have more than 2 characters. For example, rule 062 c-ns-esc-char has 4 chars: c-ns.

Rule 201 seq-spaces appears to have no prefix.

Updating the rule names seems difficult. Perhaps the description should be updated to describe the possible prefixes?

Description for rule prefixes mentions, but does not define, `n`

The description for some of the rule prefixes mention an n variable.

# And also (where X and Y are each one of the above prefixes):
#
# X-Y -- Match starting with an X- match and ending with a Y- match
# X+ -- Match X where indentation is greater than n
# X-Y+ -- Match X-Y where indentation is greater than n

However, it is not clear what n is.

Is n supposed to be the current indentation level? So the rule could be read as "where indentation is greater than the current indentation level"? In which case, isn't this always false?

It would be helpful if n was explicitly defined, with an example (or a link to an example).

Dangling rules

Hi,

Thank you for this effort. Having this extracted grammar is much more convenient for processing.

Would you please clarify why are there "dangling rules" in the grammar - the rules that are defined but not referred from anywhere.
For example rule [008] "c-sequence-start" is never used.

Thank you,
Serge

Duplicated description for `<` and `<=` comparator rule functions

The rules for both < and <= both say First argument is less than the second.

# * (<)
# First argument is less than the second.
#
# * (<=)
# First argument is less than the second.

I presume this is a mistake, and it should be:

  #   * (<)
  #     First argument is less than the second.
  #
  #   * (<=)
-  #     First argument is less than the second.
+  #     First argument is less than or equal to the second.

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.