Open lancejpollard opened 10 years ago
var grammar = new Grammar;
grammar.use(semver());
var rule = grammar.rule;
rule('statement')
.match(
'require',
':ws',
'(',
':ws',
':statement.path',
':ws',
')');
rule('statement.path')
.match(
':statement.organization',
':punctuation.slash',
':statement.repository',
':statement.version?');
rule('statement.organization')
.match(/\w+/);
rule('statement.repository')
.match(/\w+/);
rule('statement.version')
.match(
':punctuation.at',
':semver');
grammars for
require
, and@import
and es6 import. maybe this is possible.