{"size": 508, "ext": "js", "max_stars_repo_path": "src/parser/pipes/parseWord.js", "max_stars_repo_name": "JakeHedman/firetree", "max_stars_repo_stars_event_min_datetime": "2020-11-02T16:16:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-15T20:55:31.000Z", "max_issues_repo_path": "src/parser/pipes/parseWord.js", "max_issues_repo_name": "JakeHedman/firetree", "max_issues_repo_issues_event_min_datetime": "2021-03-26T05:56:43.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-16T14:26:07.000Z", "max_forks_repo_path": "src/parser/pipes/parseWord.js", "max_forks_repo_name": "JakeHedman/firetree", "max_forks_repo_forks_event_min_datetime": "2021-07-15T17:50:40.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-05T20:52:04.000Z"}
{"max_stars_count": 5, "max_issues_count": 12, "max_forks_count": 2, "avg_line_length": 26.7368421053, "max_line_length": 70, "alphanum_fraction": 0.7047244094}
import { append, slice } from 'ramda'

import generateTokenList from '../../generator/generateTokenList'
import Word from '../nodes/Word'

const parseWord = (props) => {
  const { children, context, tokenList } = props
  const word = Word.parse(context, tokenList)
  const parsedTokenList = generateTokenList(context, { ast: word })
  return {
    ...props,
    children: append(word, children),
    tokenList: slice(parsedTokenList.size, tokenList.size, tokenList),
    word
  }
}

export default parseWord
