0.0.8 • Published 7 years ago

concrete-parse v0.0.8

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
7 years ago

concrete

Languages tend to look pretty similar. Pretty much all of them use quotes and non-alphanumeric operators and braces for grouping things. import {parse} from 'concrete' to parse this structure out of your language. Then just map a standard AST (more aptly, Concrete Syntax Tree) to yours.

The concrete syntax tree is as follows.

tree : [expr]
expr : group | string | number | punctuation | linebreak | symbol
group : {type: 'group', value : [expr], delim: '(' | '[' | '{'}
string : {type: 'string', value : string}
number : {type: 'number', value : string}
punctuation : {type: 'punctuation', value : string}
linebreak : {type: 'punctuation', value : string}
symbol : {type: 'string', value : string}

See the test/ directory for an example of parsing lisp.

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago