atom / language-yaml

YAML package for Atom
Other
24 stars 39 forks source link

Allow spaces inside of unquoted keys #87

Closed deckar01 closed 7 years ago

deckar01 commented 7 years ago

Requirements

Description of the Change

The YAML spec allows spaces and tabs inside of a unquoted block key, but this grammar is checking for \S (non-whitespace). Checking for . instead allows tabs and spaces while continuing to exclude line breaking whitespace.

Alternate Designs

I considered using the more explicit [^\n\r\f], but . is more concise and widely understood to not match line breaking escape codes.

Benefits

Better compliance with the YAML spec and correct syntax highlighting.

Possible Drawbacks

None

Applicable Issues

Closes #86

50Wliu commented 7 years ago

Can there be one extra test to ensure that in something like Ghost in the Shell : | the whitespace between Shell and : is not tokenized as entity.name.tag.yaml?

deckar01 commented 7 years ago

Good catch. It was incorrectly capturing trailing spaces.

50Wliu commented 7 years ago

Thanks!