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

xtao-org/tao-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TAO Stream module

This module provides a TAO Stream creator function which wraps a TAO parse tree into a stream which can be analyzed one element at a time.

Usage

To use the module, import it into your code, for example like this:

import {parse} from "https://raw.githubusercontent.com/tree-annotation/tao/v1.0-beta/parser.js"
import {Stream} from "https://raw.githubusercontent.com/tree-annotation/tao-stream/v1.0-beta/stream.js"

// ...

console.log(Stream(parse("hello, world!")).next()) // prints `hello, world!`

Stream patterns module

This module provides utility functions to work with TAO streams.

Usage

import {either} from "https://raw.githubusercontent.com/tree-annotation/tao-stream/v1.0-beta/modules.js"

// ...

either(stream, a, b, c) // returns the value of the first pattern that matches the `stream`: `a`, `b`, or `c` or `undefined` if none matches

About

TAO Stream module

Resources

Stars

Watchers

Forks

Packages

No packages published