Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added length function (#1542). Added scalar value handling for extract and length (#1576). #1577

Merged
merged 1 commit into from
Oct 4, 2013
Merged

Conversation

seven-phases-max
Copy link
Member

I hope it's not too bad idea to merge two features in the single pull request since both functions are heavily related (should work in conjunction, handle arguments in the same way and share same tests)...

Notes:

  • See Handling scalar values with extract and length functions. #1576 for "scalar value handling".
  • Values like @var: a b c, 1 2 3 (see add a function to return the number of items in a list #1542) are interpreted as a "multidimensional" array/list - this is current extract behaviour and length just follows the same pattern (see included tests for details).
  • Interpolated list values like ~"@{var-1}, @{var-2}, @{var-3}, etc" are treated as a scalar value (i.e. length = 1). This functionality is somewhat beyond both functions scope and needs some further discussion/decision anyway...
  • While escaped empty value ~"" is interpreted as an array of length 1, "true empty value" (you can get it via ... arguments) works as a zero-length-array (see test/css/extract-and-length.css:38 and test/less/extract-and-length.less:39)
  • See included tests for more examples/details...

@lukeapage
Copy link
Member

that is some comprehensive tests you have there!

I like it.

@lukeapage lukeapage merged commit 278ca96 into less:master Oct 4, 2013
@lukeapage
Copy link
Member

pulled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants