Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (27 sloc) 1.571 kB
var K = require('../krasota'),
KrasotaJSIdentity = K.KrasotaJSIdentity;
ometa KrasotaJS <: KrasotaJSIdentity {
varItemInd = ([#varItemAsgn varItemInd:s t t t t] | [#varItemName t:s t t]) -> s,
varItemOutd = ([#varItemAsgn t t t t t:s] | [#varItemName t t t:s]) -> s,
splitVarItems :s1 :se :s2 = [t:v1_ splitVarItem1(s1, se, s2, v1_):v1 varItemInd(v1_):v1Ind
splitVarItem(s1, se, s2, v1Ind)*:vs] -> [v1].concat(vs),
splitVarItem1 :s1 :se :s2 = t:v varItemOutd(v):stmtOutd -> [#stmt, s1, [#varStmt, [v]], se, stmtOutd],
splitVarItem :s1 :se :s2 :v1Ind = t:v_
splitVarItem_(v1Ind, v_):v
varItemInd(v_):stmtInd_ splitVarItemInd(stmtInd_):stmtInd
varItemOutd(v_):stmtOutd -> [#stmt, stmtInd, [#varStmt, [v]], se, stmtOutd],
splitVarItem_ :v1Ind = [#varItemAsgn splitVarItem_(v1Ind):n t:s1 t:s2 t:e t:s3] -> [#varItemAsgn, n, s1, s2, e, s3]
| [#varItemName t t:n t:s2] -> [#varItemName, v1Ind, n, s2],
splitVarItemInd = [#spacesAndComments [splitVarItemIndSpaces*:sc]] -> [#spacesAndComments, sc],
splitVarItemIndSpaces = [#spaces :s] -> [#spaces, s.replace(/ {4}$/, '')]
| t,
splitVarStmtLast :s = [#stmt t:s1 t:v t:se t:s2] -> [#stmt, s1, v, se, s],
splitVarStmt = t:s1 [#varStmt :vs_ ?(vs_.length > 1)] t:se t:s2 splitVarItems(s1, se, s2, vs_):vs -> {
vs[vs.length - 1] = KrasotaJS.match(
vs[vs.length - 1],
'splitVarStmtLast',
[s2]);
[#stmts].concat(vs)
},
stmt = splitVarStmt | ^stmt
}
Jump to Line
Something went wrong with that request. Please try again.