Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/laconalabs/elliptical
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonhorst committed Feb 22, 2017
2 parents 4255c08 + d13e295 commit 6c305e7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/basics/es2015andjsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ code will throw lots of `React is not defined` errors.

You can specify this pragma it in each of your
files with a `@jsx` pragma comment. You will need to put this comment
at the top of every file that imports `element`.
at the top of every file that imports `createElement`.

```js
/** @jsx createElement */
Expand Down
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build:browser": "mkdir -p build; cross-env BABEL_ENV=browser babel src --out-dir lib-browser",
"build:node": "mkdir -p build; cross-env BABEL_ENV=node babel src --out-dir lib-node",
"clean": "rimraf lib-browser lib-node lib-es",
"prepublish": "npm run clean && npm run build"
"prepare": "npm run clean && npm run build"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -44,16 +44,15 @@
"babel-plugin-transform-react-jsx": "^6.6.5",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-es2015-native-modules": "^6.6.0",
"babel-preset-es2015-node": "^4.0.0",
"babel-register": "^6.6.5",
"chai": "^3.5.0",
"cross-env": "^1.0.7",
"mocha": "^2.4.5",
"cross-env": "^3.1.4",
"mocha": "^3.2.0",
"rimraf": "^2.5.2",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"standard": "^7.1.2"
"standard": "^8.6.0"
},
"dependencies": {
"babel-runtime": "^6.9.2",
Expand Down Expand Up @@ -84,7 +83,12 @@
},
"es": {
"presets": [
"es2015-native-modules"
[
"es2015",
{
"modules": false
}
]
],
"plugins": [
"transform-react-jsx",
Expand Down
7 changes: 4 additions & 3 deletions src/phrases/sequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import {limitIterator} from '../utils'
function * visit (option, {props: {unique = false}, children}, traverse) {
const mods = {result: {}, score: 1}
const trueOption = _.assign({}, option, mods)
const iterator = parseChildControl(0, trueOption, unique, children, traverse)

yield * iterator
if (children.length) {
const iterator = parseChildControl(0, trueOption, unique, children, traverse)
yield * iterator
}
}

function shouldDoEllipsis (index, option, children) {
Expand Down
7 changes: 7 additions & 0 deletions test/sequence.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1105,4 +1105,11 @@ describe('sequence', () => {
options = compileAndTraverse(grammar, 'testatest')
expect(options).to.eql([])
})

it('does not emit if empty', () => {
const grammar = <sequence></sequence>

const options = compileAndTraverse(grammar, '')
expect(options).to.eql([])
})
})

0 comments on commit 6c305e7

Please sign in to comment.