Lively Kernel canvas
// this script is evaluated on world load= 0) {
if (string[lineStart] == nl)
startFound = true;
else
lineStart--
}
while (!endFound && lineEnd < string.length) {
if (string[lineEnd] == nl)
endFound = true;
else
lineEnd++
}
var before = string.substring(0, lineStart + 1);
var after = string.substring(lineEnd, string.length);
this.updateTextString(before + replacement + after)
},
})]]>
savefalsenull
true
hmmmmmhmmmmmmmmmm14
Wikicontroltruetrue
http://www.lively-kernel.org/repository/webwerkstatt/ometa/truetruetruetruetrue
falsetruetruefalse
false00.11truefalsetruetruefalse
codebasefalsenulltruefalsefalsetrue
falsenull
localfalsenulltruefalsefalsetrue
false
bs-ometa-compiler.js(notparsed)falsetruefalsetrue0false
bs-ometa-js-compiler.js(notparsed)falsetruefalsetrue0false
bs-ometa-optimizer.js(notparsed)falsetruefalsetrue0false
lk-parser-extensions.ometa(notparsed)falsetruefalsetrue0false
ometa-base.jsfalsetruefalsetrue0false2054nullnullnulltruefalsefalsenullnulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
-----falsetruefalsetrue0false205
-1nullnullnulltruefalsetruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
-----falsetruefalsetrue0false205
-1nullnullnulltruefalsetruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
-----falsetruefalsetrue0false205
-1nullnullnulltruefalsetruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
20nullfalse
truetrue2000000
falsenulltruetruefalse
false00.11truefalsetruetruefalse
20nullfalse
truetruefalsetruetruefalse
false00.11truefalsetruetruefalse
Addmodulefalsenulltruefalsefalsetrue
false
Loadallfalsenulltruefalsefalsetrue
false
LineNofalsenulltruefalsefalsetrue
false
Refreshfalsenulltruefalsefalsetrue
false
Evalonfalsenulltruefalsefalsetrue
false
Sortfalsenulltruefalsefalsetrue
false
Viewas...falsenulltruefalsefalse
false
classesfalsenulltruefalsetruetruetrue
functionsfalsenulltruefalsetruetruetrue
objectsfalsenulltruefalsetruetruetrue
truetrue
nullnull
nullfalsetruenullfalse
ometa-base.jsfalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
http://www.lively-kernel.org/repository/webwerkstatt/lively/truetruetruetruetrue
falsetruetruefalse
false00.11truefalsetruetruefalse
codebasefalsenulltruefalsefalsetrue
falsenull
localfalsenulltruefalsefalsetrue
false
FileUploadWidget.js(notparsed)falsetruefalsetrue0false
Widgets.jsfalsetruefalsetrue0false
WikiWidget.js(notparsed)falsetruefalsetrue0false2051nullnullnulltruefalsefalsenullnulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
ButtonMorphfalsetruefalsetrue0false
ButtonBehaviorMorphfalsetruefalsetrue0false
ScriptableButtonMorphfalsetruefalsetrue0false
ImageMorphfalsetruefalsetrue0false
ImageButtonMorphfalsetruefalsetrue0false
ClipMorphfalsetruefalsetrue0false
HandleMorphfalsetruefalsetrue0false
SelectionMorphfalsetruefalsetrue0false
PanelMorphfalsetruefalsetrue0false
PanelMorph(extension)falsetruefalsetrue0false
CheapListMorphfalsetruefalsetrue0false
TextListMorphfalsetruefalsetrue0false
ListMorphfalsetruefalsetrue0false
Array.prototype(extension)falsetruefalsetrue0false
DragWrapperfalsetruefalsetrue0false
DragnDropListMorphfalsetruefalsetrue0false
Morph(extension)falsetruefalsetrue0false
FilterableListMorphfalsetruefalsetrue0false
MenuItemfalsetruefalsetrue0false
SubMenuItemfalsetruefalsetrue0false
MenuMorphfalsetruefalsetrue0false
SliderMorphfalsetruefalsetrue0false
ScrollPanefalsetruefalsetrue0false
ColorPickerMorphfalsetruefalsetrue0false
XenoMorphfalsetruefalsetrue0false
VideoMorphfalsetruefalsetrue0false
VideoMorph(extension)falsetruefalsetrue0false
WidgetModelfalsetruefalsetrue0false
Widgetfalsetruefalsetrue0false
Dialogfalsetruefalsetrue0false
ConfirmDialogfalsetruefalsetrue0false
PromptDialogfalsetruefalsetrue0false
ConsoleWidgetfalsetruefalsetrue0false
XenoBrowserWidgetfalsetruefalsetrue0false
TitleBarMorphfalsetruefalsetrue0false
TitleTabMorphfalsetruefalsetrue0false
WindowControlMorphfalsetruefalsetrue0false
StatusBarMorphfalsetruefalsetrue0false
WindowMorphfalsetruefalsetrue0false
Morph(extension)falsetruefalsetrue0false
TabbedPanelMorphfalsetruefalsetrue0false
PieMenuMorphfalsetruefalsetrue0false
PieMenuMorph(extension)falsetruefalsetrue0false
ArrowHeadMorphfalsetruefalsetrue0false
ConnectorMorphfalsetruefalsetrue0false
NodeMorphfalsetruefalsetrue0false
NodeMorph(extension)falsetruefalsetrue0false
NodeEnergySliderfalsetruefalsetrue0false
MarkerMorphMouseHandlerfalsetruefalsetrue0false
MarkerMorphfalsetruefalsetrue0false
ProgressBarMorphfalsetruefalsetrue0false
PromptDialogMorphfalsetruefalsetrue0false
PromptDialogMorphExampleClientMorphfalsetruefalsetrue0false
PromptDialogMorph(extension)falsetruefalsetrue0false
HorizontalDividerfalsetruefalsetrue0false
StatusMessageContainerfalsetruefalsetrue0false
ScaleMorphfalsetruefalsetrue0false
ColorChooserWidgetfalsetruefalsetrue0false
CheckBoxMorphfalsetruefalsetrue0false
MiniMapEntryMorphfalsetruefalsetrue0false
MiniMapWindowMorphfalsetruefalsetrue0false
MiniMapMorphfalsetruefalsetrue0false20522nullnullnulltruefalsenullfalsenulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
--all--falsetruefalsetrue0false
defaultcategoryfalsetruefalsetrue0false2050nullnullnulltruefalsetruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
description(proto)falsetruefalsetrue0false
style(proto)falsetruefalsetrue0false
scrollBarWidth(proto)falsetruefalsetrue0false
ScrollBarFormalRelay(proto)falsetruefalsetrue0false
openForDragAndDrop(proto)falsetruefalsetrue0false
initialize(proto)falsetruefalsetrue0false
calcClipR(proto)falsetruefalsetrue0false
initializeScrollBar(proto)falsetruefalsetrue0false
getScrollBar(proto)falsetruefalsetrue0false
disableScrollBar(proto)falsetruefalsetrue0false
enableScrollBar(proto)falsetruefalsetrue0false
onDeserialize(proto)falsetruefalsetrue0false
submorphBounds(proto)falsetruefalsetrue0false
innerMorph(proto)falsetruefalsetrue0false
connectModel(proto)falsetruefalsetrue0false
disconnectModel(proto)falsetruefalsetrue0false
getModel(proto)falsetruefalsetrue0false
getModelPlug(proto)falsetruefalsetrue0false
updateView(proto)falsetruefalsetrue0false
addMenuButton(proto)falsetruefalsetrue0false
menuButtonPressed(proto)falsetruefalsetrue0false
slideRoom(proto)falsetruefalsetrue0false
getScrollPosition(proto)falsetruefalsetrue0false
setScrollPosition(proto)falsetruefalsetrue0false
getVisibleExtent(proto)falsetruefalsetrue0false
scrollToTop(proto)falsetruefalsetrue0false
scrollToBottom(proto)falsetruefalsetrue0false
scrollRectIntoView(proto)falsetruefalsetrue0false
adjustForNewBounds(proto)falsetruefalsetrue0false2052nullnullnulltruefalsefalsenullnulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
20nullfalse
scrollBarWidth:14,truetrue2000000
falsetruetruefalse
false00.11truefalsetruetruefalse
20nullfalse
truetruefalsetruetruefalse
false00.11truefalsetruetruefalse
Addmodulefalsenulltruefalsefalsetrue
false
Loadallfalsenulltruefalsefalsetrue
false
LineNofalsenulltruefalsefalsetrue
false
Refreshfalsenulltruefalsefalsetrue
false
Evalonfalsenulltruefalsefalsetrue
false
Sortfalsenulltruefalsefalsetrue
false
Viewas...falsenulltruefalsefalsetrue
false
classesfalsenulltruefalsetruetruetrue
functionsfalsenulltruefalsetruetruetrue
objectsfalsenulltruefalsetruetruetrue
truetrue
null
nullfalsetruenullfalse
Widgets.js:ScrollPane:--all--:scrollBarWidth(proto)falsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
t=$morph('text2')tt.addOrRemoveCommentt.replaceCurrentLine('hmmmmm')t.constructor.functionNames()space'\r'.charCodeAt(0)truetruefalse7truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
http://www.lively-kernel.org/repository/webwerkstatt/lively/truetruetruetruetrue
falsetruetruefalse
false00.11truefalsetruetruefalse
codebasefalsenulltruefalsefalsetrue
falsenull
localfalsenulltruefalsefalsetrue
false
LKFileParser.js(notparsed)falsetruefalsetrue0false
LKFileParser.ometafalsetruefalsetrue0false2051nullnullnulltruefalsefalsenullnulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
LKFileParserfalsetruefalsetrue0false2050nullnullnulltruefalsefalsenullnulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
isLKParserfalsetruefalsetrue0false
logfalsetruefalsetrue0false
logPosfalsetruefalsetrue0false
whereAreYoufalsetruefalsetrue0false
fromTofalsetruefalsetrue0false
stackSizefalsetruefalsetrue0false
numfalsetruefalsetrue0false
getStackfalsetruefalsetrue0false
assignStackfalsetruefalsetrue0false
startTimefalsetruefalsetrue0false
stopTimefalsetruefalsetrue0false
openfalsetruefalsetrue0false
closefalsetruefalsetrue0false
addfalsetruefalsetrue0false
removefalsetruefalsetrue0false
everythingButfalsetruefalsetrue0false
nonRecursivefalsetruefalsetrue0false
recursivefalsetruefalsetrue0false
chunkfalsetruefalsetrue0false
somethingRelatedfalsetruefalsetrue0false
somethingBigRelatedfalsetruefalsetrue0false
defEndfalsetruefalsetrue0false
classElemDefEndfalsetruefalsetrue0false
spacefalsetruefalsetrue0false
nlfalsetruefalsetrue0false
spacesNoNlfalsetruefalsetrue0false
nameFirstfalsetruefalsetrue0false
nameRestfalsetruefalsetrue0false
iNamefalsetruefalsetrue0false
isKeywordfalsetruefalsetrue0false
namefalsetruefalsetrue0false
keywordfalsetruefalsetrue0false
namespaceIdSplittedfalsetruefalsetrue0false
namespaceIdfalsetruefalsetrue0false
nsFollowedByfalsetruefalsetrue0false
nsWithfalsetruefalsetrue0false
basicFunctionfalsetruefalsetrue0false
funcfalsetruefalsetrue0false
functionDeffalsetruefalsetrue0false
staticPropertyfalsetruefalsetrue0false
methodModificationDeffalsetruefalsetrue0false
protoDeffalsetruefalsetrue0false
getterOrSetterfalsetruefalsetrue0false
propertyDeffalsetruefalsetrue0false
classElemsfalsetruefalsetrue0false
categoryDeffalsetruefalsetrue0false
categoryfalsetruefalsetrue0false
categoryNamefalsetruefalsetrue0false
classElemsInCategoryfalsetruefalsetrue0false
restKlassDeffalsetruefalsetrue0false
klassfalsetruefalsetrue0false
klassNamefalsetruefalsetrue0false
klassDeffalsetruefalsetrue0false
basicKlassExtfalsetruefalsetrue0false
klassExtensionDeffalsetruefalsetrue0false
restObjDeffalsetruefalsetrue0false
objectDeffalsetruefalsetrue0false
ometaParameterfalsetruefalsetrue0false
ometaParametersfalsetruefalsetrue0false
ometaRuleDeffalsetruefalsetrue0false
ometaInheritfalsetruefalsetrue0false
ometaDeffalsetruefalsetrue0false
commentfalsetruefalsetrue0false
blankLinefalsetruefalsetrue0false
copDeffalsetruefalsetrue0false
copSubElementfalsetruefalsetrue0false
copRefinementfalsetruefalsetrue0false
unknownfalsetruefalsetrue0false205-1nullnullnulltruefalsefalsenullnulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
-----falsetruefalsetrue0false205
-1nullnullnulltruefalsefalsenullnulltruetruefalse
false00.11truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
20nullfalse
/**Copyright(c)2006-2009SunMicrosystems,Inc.**Permissionisherebygranted,freeofcharge,toanypersonobtainingacopy*ofthissoftwareandassociateddocumentationfiles(the"Software"),todeal*intheSoftwarewithoutrestriction,includingwithoutlimitationtherights*touse,copy,modify,merge,publish,distribute,sublicense,and/orsell*copiesoftheSoftware,andtopermitpersonstowhomtheSoftwareis*furnishedtodoso,subjecttothefollowingconditions:**Theabovecopyrightnoticeandthispermissionnoticeshallbeincludedin*allcopiesorsubstantialportionsoftheSoftware.*THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND,EXPRESSOR*IMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOFMERCHANTABILITY,*FITNESSFORAPARTICULARPURPOSEANDNONINFRINGEMENT.INNOEVENTSHALLTHE*AUTHORSORCOPYRIGHTHOLDERSBELIABLEFORANYCLAIM,DAMAGESOROTHER*LIABILITY,WHETHERINANACTIONOFCONTRACT,TORTOROTHERWISE,ARISINGFROM,*OUTOFORINCONNECTIONWITHTHESOFTWAREORTHEUSEOROTHERDEALINGSIN*THESOFTWARE.*/ometaLKFileParser<:Parser{isLKParser->true,/*helperproductions*/log:msg->{console.log(msg);true},logPos->{console.log(this.pos());true},whereAreYou->{varcharsBefore=120;varcharsAfter=120;varsrc=this._originalInput.arr;varstartIndex=Math.max(0,this.pos()-charsBefore);varstopIndex=Math.min(src.length,this.pos()+charsAfter);console.log(src.substring(startIndex,this.pos())+'<--Iamhere-->'+src.substring(this.pos(),stopIndex));console.log('Rules:'+this._ruleStack);console.log('Stack:'+this.stack);true},fromTo:x:y=seq(x)(~seq(y)char)*:csseq(y)->cs,stackSize->{this.stack.length},num:x->{this.stack.select(function(ea){returnea===x}).length},getStack->{this.stack.clone()},assignStack:s->{this.stack=s},startTime->{/*console.log('startmeasuringtime');newDate().getTime()*/},stopTime:t->{/*console.log('time:'+(newDate().getTime()-t)+'ms');*/true},open:x=add(x)->{x},close:x:y=add(y)remove(y)remove(x)->{y},add:x=exactly(x)->{this.stack.push(x)},remove:x->{if(this.stack.length==0){this.whereAreYou();thrownewError('Stackisempty,cannotremove'+x);};varrem=this.stack.pop();if(rem!==x){this.whereAreYou();thrownewError('Unmatched'+x+'at:'+this.pos()+'insteadfound'+rem+';stack:'+this.stack);};true},everythingBut:x:y=~exactly(x)~exactly(y)anything:a->a,nonRecursive:x:y=getStack:sopen(x)everythingBut(x,y)*:aclose(x,y)->{x+a.join('')+y}|assignStack(s)->{this._manualFail()},recursive:x:y=getStack:sopen(x)(everythingBut(x,y)|recursive(x,y))*:aclose(x,y)->{x+a.join('')+y}|assignStack(s)->{this._manualFail()},chunk:x:y=basicChunk(x,y):a/*~~exactly(x)(nonRecursive(x,y)|recursive(x,y)):a*/->a,/*chunkWith:x:y:p=~~exactly(x)(open(x)num(x):n(apply(p,'a'))*:aclose(x,y)->{x+a.join('')+y}|remove(x)),*/somethingRelated=~end(~'\n'~'\r'~';'anything)*,somethingBigRelated=~end(chunk('(',')')|chunk('{','}')|chunk('[',']')|chunk('\'','\'')|chunk('"','"')|spaces'+'spaces|~','~';'~'('~'{'~'['~'\''~'"'~nlanything)*,defEnd=';''\n'|';'spaces|"",classElemDefEnd=","|"",/*basicstringprocessing*/space=super(#space)|fromTo('//','\n')|fromTo('/*','*/'),nl='\n'|'\r'->'\n',spacesNoNl=(~nlspace)*:spcs->spcs,nameFirst=letter|'$'|'_',nameRest=nameFirst|digit,iName=firstAndRest(#nameFirst,#nameRest):r->r.join(''),isKeyword:x=?BSJSParser._isKeyword(x),name=iName:n/*~isKeyword(n)*/->n,keyword=iName:kisKeyword(k)->k,namespaceIdSplitted=name:n'.'namespaceIdSplitted:r->{[n].concat(r)}|name:n->{[n]},namespaceId=namespaceIdSplitted:nArr->nArr.join('.'),nsFollowedBy:x=namespaceIdSplitted:nArr?(nArr.last()===x)->nArr.slice(0,nArr.length-1).join('.'),nsWith:x=namespaceIdSplitted:nArr?nArr.include(x)->{vari=nArr.indexOf(x);{before:nArr.slice(0,i).join('.'),after:nArr.slice(i+1,nArr.length).join('.')}},/*functions*/basicFunction="function"spaces(name:n|empty)chunk('(',')')spaceschunk('{','}')->n,func=basicFunction:fn|"var"(space)+name:fnspaces'='spacesbasicFunction->fn,functionDef=pos:p(func:fn|'('func:fn')')somethingRelateddefEnd->{this._fragment(fn,'functionDef',p,this.pos()-1)},staticProperty=pos:pspacesNoNlnamespaceIdSplitted:nsArr?(nsArr.length>1)spaces'='somethingBigRelateddefEnd->{this._fragment(nsArr.last(),'staticProperty',p,this.pos()-1,null,{className:nsArr.slice(0,nsArr.length-1).join('.'),_isStatic:true})},/*methods*/methodModificationDef=pos:pspacesNoNlnsWith('prototype'):specspaces'='spacessomethingBigRelateddefEnd->{this._fragment(spec.after,'methodModificationDef',p,this.pos()-1,null,{className:spec.before,_isStatic:false})},/*properties*/protoDef=pos:pspacesNoNlname:pName':'spaces(basicFunction(somethingBigRelated|empty)|somethingBigRelated)classElemDefEnd->{this._fragment(pName,'protoDef',p,this.pos()-1,null,{_isStatic:false})},getterOrSetter=pos:pspacesNoNl("get"|"set")spacesname:pNamechunk('(',')')spaceschunk('{','}')classElemDefEnd->{this._fragment(pName,'protoDef',p,this.pos()-1,null,{_isStatic:false})},propertyDef=(protoDef|methodModificationDef|staticProperty|getterOrSetter):spec->{spec.type='propertyDef';spec},/*classstuff*/classElems=(categoryDef:defsclassElemDefEnd->defs)+:allDefs->allDefs.invoke('subElements').flatten(),categoryDef=spacespos:pcategory:catName(classElemsInCategory:defsclassElemDefEnd->defs)+:allDefs->{varclassElemDefs=allDefs.flatten();varcatDef=this._fragment(catName,'categoryDef',p,this.pos()-1,classElemDefs);classElemDefs.collect(function(def){def.category=catDef;returndef});catDef},category=(categoryName:namespaces','->name|empty->{Function.defaultCategoryName}),categoryName=(fromTo('\'','\'')|fromTo('"','"')):name->name.join(''),classElemsInCategory=spaces'{'(spacespropertyDef:pDspaces->pD)*:defsspaces'}'->defs,restKlassDef=','spacesclassElems:descriptors->{{classElems:descriptors}}|(','spacesklass)+:traits','spacesclassElems:descriptors->{{traits:traits,classElems:descriptors}}|(','spacesklass)+:traits->{{traits:traits,classElems:[]}}|','token('{')spacestoken('}')->{{classElems:[]}}|spaces->{{classElems:[]}},klass=namespaceId,klassName=spaces('\''|'"')klass:n('\''|'"')spaces->n,klassDef=pos:pnsFollowedBy("subclass"):sName'('klassName:kNamerestKlassDef:spec')'defEnd->{varcategories=[];spec.classElems.forEach(function(ea){ea.className=kName;if(ea.category)categories.push(ea.category);});categories=categories.uniq()this._fragment(kName,'klassDef',p,this.pos()-1,spec.classElems,{traits:spec.traits,superclassName:sName,categories:categories})},basicKlassExt="Object.extend"'('klass:nrestKlassDef:spectoken(')')->{spec.classElems.forEach(function(ea){ea.className=n;ea._isStatic=true});{name:n,traits:spec.traits,subElements:spec.classElems}}|(nsFollowedBy("addMethods"):n|nsFollowedBy("addProperties"):n)'('classElems:clElemsspaces')'->{clElems.forEach(function(ea){ea.className=n;ea._isStatic=false});{name:n,subElements:clElems}}|"layerClass"'('namespaceId:layerNamespaces','spacesklass:nrestKlassDef:spectoken(')')->{spec.classElems.forEach(function(ea){ea.layerName=layerName;ea.className=n;ea._isStatic=false});{name:n,layerName:layerName,subElements:spec.classElems}}|"layerObject"'('namespaceId:layerNamespaces','spacesklass:nrestKlassDef:spectoken(')')->{spec.classElems.forEach(function(ea){ea.layerName=layerName;ea.className=n;ea._isStatic=true});{name:n,layerName:layerName,subElements:spec.classElems}},klassExtensionDef=pos:pbasicKlassExt:specdefEnd->{this._fragment(spec.name,'klassExtensionDef',p,this.pos()-1,spec.subElements,{traits:spec.traits})},/*'object'stuff*/restObjDef=classElems:propsAndMethodDescrsspaces->{propsAndMethodDescrs.forEach(function(ea){ea._isStatic=true});propsAndMethodDescrs},objectDef=pos:p("var"spacesnamespaceId:o|namespaceId:o)spaces'='spacesrestObjDef:propsAndMethodDescrsdefEnd->{this._fragment(o,'objectDef',p,this.pos()-1,propsAndMethodDescrs)},/*ometastuff*/ometaParameter=':'name:nspaces->n,ometaParameters=ometaParameter*,ometaRuleDef=pos:pname:nspacesometaParameters:a('='|"->")(~','(chunk('(',')')|chunk('{','}')|chunk('\'','\'')|chunk('"','"')|~'}'anything))*:body(','|empty)->{this._fragment(n,'ometaRuleDef',p,this.pos()-1,[],{parameters:a})},ometaInherit="<:"spacesname:sn->sn|empty->{null},ometaDef=pos:p"ometa"spacesname:nspaceometaInherit:snspaces'{'spaces(ometaRuleDef:dspaces->d)*:defsspaces'}'defEnd->{this._fragment(n,'ometaDef',p,this.pos()-1,defs,{superclassName:sn})},/*otherStuff*///comment=descriptor:dspacesNoNl/*(fromTo('//','\n')|fromTo('/*','*/'))spacesNoNl*/->{d.stopIndex=this.pos()-1;d.type='comment';d},comment=pos:pspace+->{this._fragment(null,'comment',p,this.pos()-1)},blankLine=pos:p(nl|(char:c?(c.charCodeAt(0)===32))*nl)->{this._fragment(null,'blankLine',p,this.pos()-1)},copDef=pos:p"cop.create("klassName:n")"spacesNoNlnl*copSubElement*:subsspacesdefEnd->{this._fragment(n,'copDef',p,this.pos()-1,subs)},copSubElement=pos:pspaces'.'(copRefinement|somethingBigRelated:blob->{name:blob.flatten().join('').replace('\n',''),subElementSpec:{}}):spec->{this._fragment(spec.name,'copSubElement',p,this.pos()-1,spec.subElementSpec.classElems,{traits:spec.subElementSpec.traits,refineSelector:spec.refineSelector})},copRefinement=("refineClass"|"refineObject"):sel'('klass:nrestKlassDef:spec')'->{{name:n,refineSelector:sel,subElementSpec:spec}},unknown=pos:psomethingBigRelateddefEnd->{this._fragment(null,'unknown',p,this.pos()-1)}}; true,\n \n /* helper productions */\n log :msg -> { console.log(msg); true },\n logPos -> { console.log(this.pos()); true },\n whereAreYou -> {\n\tvar charsBefore = 120; var charsAfter = 120; var src = this._originalInput.arr;\n\tvar startIndex = Math.max(0, this.pos() - charsBefore);\n\tvar stopIndex = Math.min(src.length, this.pos() + charsAfter);\n\tconsole.log(src.substring(startIndex, this.pos()) + '<--I am here-->' + src.substring(this.pos(), stopIndex));\n console.log('Rules: ' + this._ruleStack);\n console.log('Stack: ' + this.stack);\n true\n\t},\n fromTo :x :y =\n\tseq(x) (~seq(y) char)*:cs seq(y) -> cs,\n stackSize -> { this.stack.length },\n\tnum :x -> { this.stack.select(function(ea) { return ea === x }).length },\n\tgetStack -> { this.stack.clone() },\n\tassignStack :s -> { this.stack = s },\n\tstartTime -> { /*console.log('start measuring time'); new Date().getTime()*/ },\n\tstopTime :t -> { /*console.log('time: ' + (new Date().getTime()-t) + ' ms');*/ true},\n\topen :x = add(x) -> { x},\n\tclose :x :y =\n\tadd(y) remove(y) remove(x) -> { y},\n\tadd :x = exactly(x) -> { this.stack.push(x) },\n\tremove :x -> {\n\tif (this.stack.length == 0) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Stack is empty, cannot remove ' + x);\n\t};\n\tvar rem = this.stack.pop();\n\tif (rem !== x) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Unmatched ' + x + 'at: ' + this.pos() + ' instead found ' + rem + '; stack: ' + this.stack);\n\t};\n\ttrue\n},\n\teverythingBut :x :y =\n\t~exactly(x) ~exactly(y) anything:a -> a,\n\tnonRecursive :x :y =\n\tgetStack:s open(x) everythingBut(x,y)*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\trecursive :x :y =\n\tgetStack:s open(x) ( everythingBut(x,y) | recursive(x,y) )*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\tchunk :x :y =\n\tbasicChunk(x,y):a\n\t/*~~exactly(x) (nonRecursive(x,y) | recursive(x,y)):a*/\n\t-> a,\n\t\n/*\tchunkWith :x :y :p = ~~exactly(x) ( open(x) num(x):n ( apply(p, 'a') )*:a close(x,y) -> { x+ a.join('') + y }\n\t | remove(x) ),*/\n\tsomethingRelated =\n\t~end (~'\\n' ~'\\r' ~';' anything)*,\n\tsomethingBigRelated =\n\t~end (\n\t\tchunk('(', ')')\n\t\t| chunk('{', '}')\n\t\t| chunk('[', ']')\n\t\t| chunk('\\'', '\\'')\n\t\t| chunk('\"', '\"')\n\t\t| spaces '+' spaces\n\t\t| ~',' ~';' ~'(' ~'{' ~'[' ~'\\'' ~'\"' ~nl anything )*,\n\tdefEnd = ';' '\\n' | ';' spaces | \"\",\n\tclassElemDefEnd = \",\" | \"\",\n\t\n\t/* basic string processing */\n\tspace =\n\tsuper(#space) | fromTo('//', '\\n') | fromTo('/*', '*/'),\n nl = '\\n' | '\\r' -> '\\n',\n\tspacesNoNl = (~nl space)*:spcs -> spcs,\n\tnameFirst = letter | '$' | '_',\n \tnameRest = nameFirst | digit,\n \tiName = firstAndRest(#nameFirst, #nameRest):r -> r.join(''),\n \tisKeyword :x = ?BSJSParser._isKeyword(x),\n \tname = iName:n /*~isKeyword(n)*/ -> n,\n \tkeyword = iName:k isKeyword(k) -> k,\n\tnamespaceIdSplitted = name:n '.' namespaceIdSplitted:r -> { [n].concat(r) }\n\t | name:n -> { [n] },\n\tnamespaceId =\n\tnamespaceIdSplitted:nArr\n\t-> nArr.join('.'),\n\tnsFollowedBy :x =\n\tnamespaceIdSplitted:nArr ?(nArr.last() === x)\n\t-> nArr.slice(0,nArr.length-1).join('.'),\n\tnsWith :x =\n\tnamespaceIdSplitted:nArr ?nArr.include(x)\n\t-> {\n\t\tvar i = nArr.indexOf(x);\n\t\t{\n\t\t\tbefore: nArr.slice(0,i).join('.'),\n\t\t\tafter: nArr.slice(i+1,nArr.length).join('.')\n\t\t}\n\t},\n \n /* functions */\n basicFunction =\n\t\"function\" spaces\n\t(name:n | empty)\n\tchunk('(', ')') spaces chunk('{', '}')\n\t-> n,\n func =\n\tbasicFunction:fn\n\t| \"var\" (space)+ name:fn spaces '=' spaces basicFunction\n\t-> fn,\n functionDef =\n\tpos:p ( func:fn | '(' func:fn ')' ) somethingRelated defEnd\n\t-> { this._fragment(fn, 'functionDef', p, this.pos()-1) },\n \n staticProperty =\n\tpos:p spacesNoNl\n\tnamespaceIdSplitted:nsArr ?(nsArr.length > 1) spaces '='\n\tsomethingBigRelated defEnd\n\t-> {\n\t\tthis._fragment(\n\t\t\tnsArr.last(),\n\t\t\t'staticProperty',\n\t\t\tp, this.pos()-1,\n\t\t\tnull,\n\t\t\t{ className: nsArr.slice(0,nsArr.length-1).join('.'), _isStatic: true }\n\t\t)},\n \n\t/* methods */\n methodModificationDef =\n\t\tpos:p spacesNoNl\n\t\tnsWith('prototype'):spec spaces '='\n\t\tspaces somethingBigRelated defEnd\n\t\t-> {this._fragment(\n\t\t\tspec.after,\n\t\t\t'methodModificationDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tnull,\n\t\t\t{className: spec.before, _isStatic: false})},\n \n /* properties */ \n protoDef =\n\t\tpos:p spacesNoNl name:pName ':' spaces\n\t\t(basicFunction (somethingBigRelated | empty )\n\t\t| somethingBigRelated\n\t\t) classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\ngetterOrSetter =\n\t\tpos:p spacesNoNl (\"get\" | \"set\") spaces name:pName chunk('(', ')') spaces chunk('{', '}') classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\n\n\n\tpropertyDef =\n\t\t(protoDef | methodModificationDef | staticProperty | getterOrSetter):spec\n\t\t-> {spec.type = 'propertyDef'; spec},\n\n \n /* class stuff */\n\tclassElems =\n\t(categoryDef:defs classElemDefEnd ->defs)+:allDefs\n\t-> allDefs.invoke('subElements').flatten(),\ncategoryDef =\n\tspaces pos:p category:catName \n\t(classElemsInCategory:defs classElemDefEnd -> defs)+:allDefs\n\t-> {\n\t\tvar classElemDefs = allDefs.flatten();\n\t\tvar catDef = this._fragment(catName, 'categoryDef', p, this.pos()-1, classElemDefs);\n\t\tclassElemDefs.collect(function(def) { def.category = catDef; return def });\n\t\tcatDef\n\t},\n\ncategory =\n\t(\n\t categoryName:name spaces ',' -> name\n\t| empty -> { Function.defaultCategoryName }\n\t),\n\ncategoryName =\n\t( fromTo('\\'', '\\'') | fromTo('\"', '\"') ):name -> name.join(''),\n\nclassElemsInCategory =\n\tspaces '{' ( spaces propertyDef:pD spaces -> pD)*:defs spaces '}'\n\t-> defs,\n\n\trestKlassDef =\n\t',' spaces classElems:descriptors\t\t\t\t\t\t\t\t-> { {classElems: descriptors} }\n\t| (',' spaces klass)+:traits ',' spaces classElems:descriptors\t-> { {traits: traits, classElems: descriptors} }\n\t| (',' spaces klass)+:traits\t\t\t\t\t\t\t\t\t-> { {traits: traits, classElems: []} }\n\t| ',' token('{') spaces token('}')\t\t\t\t\t\t\t\t-> { {classElems: []} }\n\t| spaces\t\t\t\t\t\t\t\t\t\t\t\t\t\t-> { {classElems: []} },\n\tklass \t = namespaceId,\n\tklassName = spaces ( '\\'' | '\"') klass:n ( '\\'' | '\"') spaces\t-> n,\n klassDef =\n\tpos:p nsFollowedBy(\"subclass\"):sName '(' klassName:kName restKlassDef:spec ')' defEnd\n\t-> {\n\t\tvar categories = [];\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.className = kName;\n\t\t\tif (ea.category) categories.push(ea.category);\n\t\t});\n\t\tcategories = categories.uniq()\n\t\tthis._fragment(\n\t\t\tkName,\n\t\t\t'klassDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tspec.classElems,\n\t\t\t{traits: spec.traits, superclassName: sName, categories: categories})\n\t},\n basicKlassExt =\n\t\"Object.extend\" '(' klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) { ea.className = n; ea._isStatic = true });\n\t\t{name: n, traits: spec.traits, subElements: spec.classElems } }\n|\t(nsFollowedBy(\"addMethods\"):n | nsFollowedBy(\"addProperties\"):n) '(' classElems:clElems spaces ')'\n\t-> {\n\t\tclElems.forEach(function(ea) { ea.className = n; ea._isStatic = false });\n\t\t{name: n, subElements: clElems } }\n|\t\"layerClass\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = false });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } }\n|\t\"layerObject\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = true });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } },\n klassExtensionDef\n\t= pos:p basicKlassExt:spec defEnd\n\t-> { this._fragment(spec.name, 'klassExtensionDef', p, this.pos()-1, spec.subElements, {traits: spec.traits}) },\n \n /* 'object' stuff */\n restObjDef = classElems:propsAndMethodDescrs spaces\n-> { propsAndMethodDescrs.forEach(function(ea) { ea._isStatic = true }); propsAndMethodDescrs },\n objectDef = pos:p ( \"var\" spaces namespaceId:o | namespaceId:o) spaces '=' spaces restObjDef:propsAndMethodDescrs defEnd\n-> { this._fragment(o, 'objectDef', p, this.pos()-1, propsAndMethodDescrs) },\n \n /* ometa stuff */\n ometaParameter = ':' name:n spaces -> n,\n ometaParameters = ometaParameter*,\n ometaRuleDef = pos:p name:n spaces ometaParameters:a ('=' | \"->\") (~',' (chunk('(', ')') | chunk('{', '}') | chunk('\\'', '\\'') | chunk('\"', '\"') | ~'}' anything))*:body ( ',' | empty )\n-> { this._fragment(n, 'ometaRuleDef', p, this.pos()-1, [], {parameters: a}) },\n ometaInherit = \"<:\" spaces name:sn -> sn\n\t\t\t\t\t\t| empty -> { null },\n ometaDef = pos:p \"ometa\" spaces name:n space ometaInherit:sn spaces '{' spaces (ometaRuleDef:d spaces -> d)*:defs spaces '}' defEnd\n-> { this._fragment(n, 'ometaDef', p, this.pos()-1, defs, {superclassName: sn}) },\n \n \n /* otherStuff */\n // comment = descriptor:d spacesNoNl /*(fromTo('//', '\\n') | fromTo('/*', '*/')) spacesNoNl*/ -> { d.stopIndex = this.pos()-1; d.type = 'comment'; d },\n comment = pos:p space+ -> { this._fragment(null, 'comment', p, this.pos()-1) },\n \n blankLine = pos:p (nl | (char:c ?(c.charCodeAt(0) === 32))* nl) -> { this._fragment(null, 'blankLine', p, this.pos()-1) },\ncopDef =\n\tpos:p \"cop.create(\" klassName:n \")\" spacesNoNl nl* copSubElement*:subs spaces defEnd\n\t-> { this._fragment(n, 'copDef', p, this.pos()-1, subs) },\ncopSubElement =\n\tpos:p spaces '.'\n\t( copRefinement\n\t| somethingBigRelated:blob -> {name: blob.flatten().join('').replace('\\n', ''), subElementSpec: {}}\n\t):spec\n\t-> { this._fragment(spec.name, 'copSubElement', p, this.pos()-1, spec.subElementSpec.classElems,\n\t\t{traits: spec.subElementSpec.traits, refineSelector: spec.refineSelector}) },\ncopRefinement = \n\t( \"refineClass\" | \"refineObject\" ):sel '(' klass:n restKlassDef:spec ')'\n\t-> { {name: n, refineSelector: sel, subElementSpec: spec} },\n\n\n\n unknown = pos:p somethingBigRelated defEnd -> { this._fragment(null, 'unknown', p, this.pos()-1) }\n \n};\n"]]>290truetrue2000000
false true,\n \n /* helper productions */\n log :msg -> { console.log(msg); true },\n logPos -> { console.log(this.pos()); true },\n whereAreYou -> {\n\tvar charsBefore = 120; var charsAfter = 120; var src = this._originalInput.arr;\n\tvar startIndex = Math.max(0, this.pos() - charsBefore);\n\tvar stopIndex = Math.min(src.length, this.pos() + charsAfter);\n\tconsole.log(src.substring(startIndex, this.pos()) + '<--I am here-->' + src.substring(this.pos(), stopIndex));\n console.log('Rules: ' + this._ruleStack);\n console.log('Stack: ' + this.stack);\n true\n\t},\n fromTo :x :y =\n\tseq(x) (~seq(y) char)*:cs seq(y) -> cs,\n stackSize -> { this.stack.length },\n\tnum :x -> { this.stack.select(function(ea) { return ea === x }).length },\n\tgetStack -> { this.stack.clone() },\n\tassignStack :s -> { this.stack = s },\n\tstartTime -> { /*console.log('start measuring time'); new Date().getTime()*/ },\n\tstopTime :t -> { /*console.log('time: ' + (new Date().getTime()-t) + ' ms');*/ true},\n\topen :x = add(x) -> { x},\n\tclose :x :y =\n\tadd(y) remove(y) remove(x) -> { y},\n\tadd :x = exactly(x) -> { this.stack.push(x) },\n\tremove :x -> {\n\tif (this.stack.length == 0) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Stack is empty, cannot remove ' + x);\n\t};\n\tvar rem = this.stack.pop();\n\tif (rem !== x) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Unmatched ' + x + 'at: ' + this.pos() + ' instead found ' + rem + '; stack: ' + this.stack);\n\t};\n\ttrue\n},\n\teverythingBut :x :y =\n\t~exactly(x) ~exactly(y) anything:a -> a,\n\tnonRecursive :x :y =\n\tgetStack:s open(x) everythingBut(x,y)*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\trecursive :x :y =\n\tgetStack:s open(x) ( everythingBut(x,y) | recursive(x,y) )*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\tchunk :x :y =\n\tbasicChunk(x,y):a\n\t/*~~exactly(x) (nonRecursive(x,y) | recursive(x,y)):a*/\n\t-> a,\n\t\n/*\tchunkWith :x :y :p = ~~exactly(x) ( open(x) num(x):n ( apply(p, 'a') )*:a close(x,y) -> { x+ a.join('') + y }\n\t | remove(x) ),*/\n\tsomethingRelated =\n\t~end (~'\\n' ~'\\r' ~';' anything)*,\n\tsomethingBigRelated =\n\t~end (\n\t\tchunk('(', ')')\n\t\t| chunk('{', '}')\n\t\t| chunk('[', ']')\n\t\t| chunk('\\'', '\\'')\n\t\t| chunk('\"', '\"')\n\t\t| spaces '+' spaces\n\t\t| ~',' ~';' ~'(' ~'{' ~'[' ~'\\'' ~'\"' ~nl anything )*,\n\tdefEnd = ';' '\\n' | ';' spaces | \"\",\n\tclassElemDefEnd = \",\" | \"\",\n\t\n\t/* basic string processing */\n\tspace =\n\tsuper(#space) | fromTo('//', '\\n') | fromTo('/*', '*/'),\n nl = '\\n' | '\\r' -> '\\n',\n\tspacesNoNl = (~nl space)*:spcs -> spcs,\n\tnameFirst = letter | '$' | '_',\n \tnameRest = nameFirst | digit,\n \tiName = firstAndRest(#nameFirst, #nameRest):r -> r.join(''),\n \tisKeyword :x = ?BSJSParser._isKeyword(x),\n \tname = iName:n /*~isKeyword(n)*/ -> n,\n \tkeyword = iName:k isKeyword(k) -> k,\n\tnamespaceIdSplitted = name:n '.' namespaceIdSplitted:r -> { [n].concat(r) }\n\t | name:n -> { [n] },\n\tnamespaceId =\n\tnamespaceIdSplitted:nArr\n\t-> nArr.join('.'),\n\tnsFollowedBy :x =\n\tnamespaceIdSplitted:nArr ?(nArr.last() === x)\n\t-> nArr.slice(0,nArr.length-1).join('.'),\n\tnsWith :x =\n\tnamespaceIdSplitted:nArr ?nArr.include(x)\n\t-> {\n\t\tvar i = nArr.indexOf(x);\n\t\t{\n\t\t\tbefore: nArr.slice(0,i).join('.'),\n\t\t\tafter: nArr.slice(i+1,nArr.length).join('.')\n\t\t}\n\t},\n \n /* functions */\n basicFunction =\n\t\"function\" spaces\n\t(name:n | empty)\n\tchunk('(', ')') spaces chunk('{', '}')\n\t-> n,\n func =\n\tbasicFunction:fn\n\t| \"var\" (space)+ name:fn spaces '=' spaces basicFunction\n\t-> fn,\n functionDef =\n\tpos:p ( func:fn | '(' func:fn ')' ) somethingRelated defEnd\n\t-> { this._fragment(fn, 'functionDef', p, this.pos()-1) },\n \n staticProperty =\n\tpos:p spacesNoNl\n\tnamespaceIdSplitted:nsArr ?(nsArr.length > 1) spaces '='\n\tsomethingBigRelated defEnd\n\t-> {\n\t\tthis._fragment(\n\t\t\tnsArr.last(),\n\t\t\t'staticProperty',\n\t\t\tp, this.pos()-1,\n\t\t\tnull,\n\t\t\t{ className: nsArr.slice(0,nsArr.length-1).join('.'), _isStatic: true }\n\t\t)},\n \n\t/* methods */\n methodModificationDef =\n\t\tpos:p spacesNoNl\n\t\tnsWith('prototype'):spec spaces '='\n\t\tspaces somethingBigRelated defEnd\n\t\t-> {this._fragment(\n\t\t\tspec.after,\n\t\t\t'methodModificationDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tnull,\n\t\t\t{className: spec.before, _isStatic: false})},\n \n /* properties */ \n protoDef =\n\t\tpos:p spacesNoNl name:pName ':' spaces\n\t\t(basicFunction (somethingBigRelated | empty )\n\t\t| somethingBigRelated\n\t\t) classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\ngetterOrSetter =\n\t\tpos:p spacesNoNl (\"get\" | \"set\") spaces name:pName chunk('(', ')') spaces chunk('{', '}') classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\n\n\n\tpropertyDef =\n\t\t(protoDef | methodModificationDef | staticProperty | getterOrSetter):spec\n\t\t-> {spec.type = 'propertyDef'; spec},\n\n \n /* class stuff */\n\tclassElems =\n\t(categoryDef:defs classElemDefEnd ->defs)+:allDefs\n\t-> allDefs.invoke('subElements').flatten(),\ncategoryDef =\n\tspaces pos:p category:catName \n\t(classElemsInCategory:defs classElemDefEnd -> defs)+:allDefs\n\t-> {\n\t\tvar classElemDefs = allDefs.flatten();\n\t\tvar catDef = this._fragment(catName, 'categoryDef', p, this.pos()-1, classElemDefs);\n\t\tclassElemDefs.collect(function(def) { def.category = catDef; return def });\n\t\tcatDef\n\t},\n\ncategory =\n\t(\n\t categoryName:name spaces ',' -> name\n\t| empty -> { Function.defaultCategoryName }\n\t),\n\ncategoryName =\n\t( fromTo('\\'', '\\'') | fromTo('\"', '\"') ):name -> name.join(''),\n\nclassElemsInCategory =\n\tspaces '{' ( spaces propertyDef:pD spaces -> pD)*:defs spaces '}'\n\t-> defs,\n\n\trestKlassDef =\n\t',' spaces classElems:descriptors\t\t\t\t\t\t\t\t-> { {classElems: descriptors} }\n\t| (',' spaces klass)+:traits ',' spaces classElems:descriptors\t-> { {traits: traits, classElems: descriptors} }\n\t| (',' spaces klass)+:traits\t\t\t\t\t\t\t\t\t-> { {traits: traits, classElems: []} }\n\t| ',' token('{') spaces token('}')\t\t\t\t\t\t\t\t-> { {classElems: []} }\n\t| spaces\t\t\t\t\t\t\t\t\t\t\t\t\t\t-> { {classElems: []} },\n\tklass \t = namespaceId,\n\tklassName = spaces ( '\\'' | '\"') klass:n ( '\\'' | '\"') spaces\t-> n,\n klassDef =\n\tpos:p nsFollowedBy(\"subclass\"):sName '(' klassName:kName restKlassDef:spec ')' defEnd\n\t-> {\n\t\tvar categories = [];\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.className = kName;\n\t\t\tif (ea.category) categories.push(ea.category);\n\t\t});\n\t\tcategories = categories.uniq()\n\t\tthis._fragment(\n\t\t\tkName,\n\t\t\t'klassDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tspec.classElems,\n\t\t\t{traits: spec.traits, superclassName: sName, categories: categories})\n\t},\n basicKlassExt =\n\t\"Object.extend\" '(' klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) { ea.className = n; ea._isStatic = true });\n\t\t{name: n, traits: spec.traits, subElements: spec.classElems } }\n|\t(nsFollowedBy(\"addMethods\"):n | nsFollowedBy(\"addProperties\"):n) '(' classElems:clElems spaces ')'\n\t-> {\n\t\tclElems.forEach(function(ea) { ea.className = n; ea._isStatic = false });\n\t\t{name: n, subElements: clElems } }\n|\t\"layerClass\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = false });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } }\n|\t\"layerObject\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = true });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } },\n klassExtensionDef\n\t= pos:p basicKlassExt:spec defEnd\n\t-> { this._fragment(spec.name, 'klassExtensionDef', p, this.pos()-1, spec.subElements, {traits: spec.traits}) },\n \n /* 'object' stuff */\n restObjDef = classElems:propsAndMethodDescrs spaces\n-> { propsAndMethodDescrs.forEach(function(ea) { ea._isStatic = true }); propsAndMethodDescrs },\n objectDef = pos:p ( \"var\" spaces namespaceId:o | namespaceId:o) spaces '=' spaces restObjDef:propsAndMethodDescrs defEnd\n-> { this._fragment(o, 'objectDef', p, this.pos()-1, propsAndMethodDescrs) },\n \n /* ometa stuff */\n ometaParameter = ':' name:n spaces -> n,\n ometaParameters = ometaParameter*,\n ometaRuleDef = pos:p name:n spaces ometaParameters:a ('=' | \"->\") (~',' (chunk('(', ')') | chunk('{', '}') | chunk('\\'', '\\'') | chunk('\"', '\"') | ~'}' anything))*:body ( ',' | empty )\n-> { this._fragment(n, 'ometaRuleDef', p, this.pos()-1, [], {parameters: a}) },\n ometaInherit = \"<:\" spaces name:sn -> sn\n\t\t\t\t\t\t| empty -> { null },\n ometaDef = pos:p \"ometa\" spaces name:n space ometaInherit:sn spaces '{' spaces (ometaRuleDef:d spaces -> d)*:defs spaces '}' defEnd\n-> { this._fragment(n, 'ometaDef', p, this.pos()-1, defs, {superclassName: sn}) },\n \n \n /* otherStuff */\n // comment = descriptor:d spacesNoNl /*(fromTo('//', '\\n') | fromTo('/*', '*/')) spacesNoNl*/ -> { d.stopIndex = this.pos()-1; d.type = 'comment'; d },\n comment = pos:p space+ -> { this._fragment(null, 'comment', p, this.pos()-1) },\n \n blankLine = pos:p (nl | (char:c ?(c.charCodeAt(0) === 32))* nl) -> { this._fragment(null, 'blankLine', p, this.pos()-1) },\ncopDef =\n\tpos:p \"cop.create(\" klassName:n \")\" spacesNoNl nl* copSubElement*:subs spaces defEnd\n\t-> { this._fragment(n, 'copDef', p, this.pos()-1, subs) },\ncopSubElement =\n\tpos:p spaces '.'\n\t( copRefinement\n\t| somethingBigRelated:blob -> {name: blob.flatten().join('').replace('\\n', ''), subElementSpec: {}}\n\t):spec\n\t-> { this._fragment(spec.name, 'copSubElement', p, this.pos()-1, spec.subElementSpec.classElems,\n\t\t{traits: spec.subElementSpec.traits, refineSelector: spec.refineSelector}) },\ncopRefinement = \n\t( \"refineClass\" | \"refineObject\" ):sel '(' klass:n restKlassDef:spec ')'\n\t-> { {name: n, refineSelector: sel, subElementSpec: spec} },\n\n\n\n unknown = pos:p somethingBigRelated defEnd -> { this._fragment(null, 'unknown', p, this.pos()-1) }\n \n};\n"]]> true,\n \n /* helper productions */\n log :msg -> { console.log(msg); true },\n logPos -> { console.log(this.pos()); true },\n whereAreYou -> {\n\tvar charsBefore = 120; var charsAfter = 120; var src = this._originalInput.arr;\n\tvar startIndex = Math.max(0, this.pos() - charsBefore);\n\tvar stopIndex = Math.min(src.length, this.pos() + charsAfter);\n\tconsole.log(src.substring(startIndex, this.pos()) + '<--I am here-->' + src.substring(this.pos(), stopIndex));\n console.log('Rules: ' + this._ruleStack);\n console.log('Stack: ' + this.stack);\n true\n\t},\n fromTo :x :y =\n\tseq(x) (~seq(y) char)*:cs seq(y) -> cs,\n stackSize -> { this.stack.length },\n\tnum :x -> { this.stack.select(function(ea) { return ea === x }).length },\n\tgetStack -> { this.stack.clone() },\n\tassignStack :s -> { this.stack = s },\n\tstartTime -> { /*console.log('start measuring time'); new Date().getTime()*/ },\n\tstopTime :t -> { /*console.log('time: ' + (new Date().getTime()-t) + ' ms');*/ true},\n\topen :x = add(x) -> { x},\n\tclose :x :y =\n\tadd(y) remove(y) remove(x) -> { y},\n\tadd :x = exactly(x) -> { this.stack.push(x) },\n\tremove :x -> {\n\tif (this.stack.length == 0) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Stack is empty, cannot remove ' + x);\n\t};\n\tvar rem = this.stack.pop();\n\tif (rem !== x) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Unmatched ' + x + 'at: ' + this.pos() + ' instead found ' + rem + '; stack: ' + this.stack);\n\t};\n\ttrue\n},\n\teverythingBut :x :y =\n\t~exactly(x) ~exactly(y) anything:a -> a,\n\tnonRecursive :x :y =\n\tgetStack:s open(x) everythingBut(x,y)*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\trecursive :x :y =\n\tgetStack:s open(x) ( everythingBut(x,y) | recursive(x,y) )*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\tchunk :x :y =\n\tbasicChunk(x,y):a\n\t/*~~exactly(x) (nonRecursive(x,y) | recursive(x,y)):a*/\n\t-> a,\n\t\n/*\tchunkWith :x :y :p = ~~exactly(x) ( open(x) num(x):n ( apply(p, 'a') )*:a close(x,y) -> { x+ a.join('') + y }\n\t | remove(x) ),*/\n\tsomethingRelated =\n\t~end (~'\\n' ~'\\r' ~';' anything)*,\n\tsomethingBigRelated =\n\t~end (\n\t\tchunk('(', ')')\n\t\t| chunk('{', '}')\n\t\t| chunk('[', ']')\n\t\t| chunk('\\'', '\\'')\n\t\t| chunk('\"', '\"')\n\t\t| spaces '+' spaces\n\t\t| ~',' ~';' ~'(' ~'{' ~'[' ~'\\'' ~'\"' ~nl anything )*,\n\tdefEnd = ';' '\\n' | ';' spaces | \"\",\n\tclassElemDefEnd = \",\" | \"\",\n\t\n\t/* basic string processing */\n\tspace =\n\tsuper(#space) | fromTo('//', '\\n') | fromTo('/*', '*/'),\n nl = '\\n' | '\\r' -> '\\n',\n\tspacesNoNl = (~nl space)*:spcs -> spcs,\n\tnameFirst = letter | '$' | '_',\n \tnameRest = nameFirst | digit,\n \tiName = firstAndRest(#nameFirst, #nameRest):r -> r.join(''),\n \tisKeyword :x = ?BSJSParser._isKeyword(x),\n \tname = iName:n /*~isKeyword(n)*/ -> n,\n \tkeyword = iName:k isKeyword(k) -> k,\n\tnamespaceIdSplitted = name:n '.' namespaceIdSplitted:r -> { [n].concat(r) }\n\t | name:n -> { [n] },\n\tnamespaceId =\n\tnamespaceIdSplitted:nArr\n\t-> nArr.join('.'),\n\tnsFollowedBy :x =\n\tnamespaceIdSplitted:nArr ?(nArr.last() === x)\n\t-> nArr.slice(0,nArr.length-1).join('.'),\n\tnsWith :x =\n\tnamespaceIdSplitted:nArr ?nArr.include(x)\n\t-> {\n\t\tvar i = nArr.indexOf(x);\n\t\t{\n\t\t\tbefore: nArr.slice(0,i).join('.'),\n\t\t\tafter: nArr.slice(i+1,nArr.length).join('.')\n\t\t}\n\t},\n \n /* functions */\n basicFunction =\n\t\"function\" spaces\n\t(name:n | empty)\n\tchunk('(', ')') spaces chunk('{', '}')\n\t-> n,\n func =\n\tbasicFunction:fn\n\t| \"var\" (space)+ name:fn spaces '=' spaces basicFunction\n\t-> fn,\n functionDef =\n\tpos:p ( func:fn | '(' func:fn ')' ) somethingRelated defEnd\n\t-> { this._fragment(fn, 'functionDef', p, this.pos()-1) },\n \n staticProperty =\n\tpos:p spacesNoNl\n\tnamespaceIdSplitted:nsArr ?(nsArr.length > 1) spaces '='\n\tsomethingBigRelated defEnd\n\t-> {\n\t\tthis._fragment(\n\t\t\tnsArr.last(),\n\t\t\t'staticProperty',\n\t\t\tp, this.pos()-1,\n\t\t\tnull,\n\t\t\t{ className: nsArr.slice(0,nsArr.length-1).join('.'), _isStatic: true }\n\t\t)},\n \n\t/* methods */\n methodModificationDef =\n\t\tpos:p spacesNoNl\n\t\tnsWith('prototype'):spec spaces '='\n\t\tspaces somethingBigRelated defEnd\n\t\t-> {this._fragment(\n\t\t\tspec.after,\n\t\t\t'methodModificationDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tnull,\n\t\t\t{className: spec.before, _isStatic: false})},\n \n /* properties */ \n protoDef =\n\t\tpos:p spacesNoNl name:pName ':' spaces\n\t\t(basicFunction (somethingBigRelated | empty )\n\t\t| somethingBigRelated\n\t\t) classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\ngetterOrSetter =\n\t\tpos:p spacesNoNl (\"get\" | \"set\") spaces name:pName chunk('(', ')') spaces chunk('{', '}') classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\n\n\n\tpropertyDef =\n\t\t(protoDef | methodModificationDef | staticProperty | getterOrSetter):spec\n\t\t-> {spec.type = 'propertyDef'; spec},\n\n \n /* class stuff */\n\tclassElems =\n\t(categoryDef:defs classElemDefEnd ->defs)+:allDefs\n\t-> allDefs.invoke('subElements').flatten(),\ncategoryDef =\n\tspaces pos:p category:catName \n\t(classElemsInCategory:defs classElemDefEnd -> defs)+:allDefs\n\t-> {\n\t\tvar classElemDefs = allDefs.flatten();\n\t\tvar catDef = this._fragment(catName, 'categoryDef', p, this.pos()-1, classElemDefs);\n\t\tclassElemDefs.collect(function(def) { def.category = catDef; return def });\n\t\tcatDef\n\t},\n\ncategory =\n\t(\n\t categoryName:name spaces ',' -> name\n\t| empty -> { Function.defaultCategoryName }\n\t),\n\ncategoryName =\n\t( fromTo('\\'', '\\'') | fromTo('\"', '\"') ):name -> name.join(''),\n\nclassElemsInCategory =\n\tspaces '{' ( spaces propertyDef:pD spaces -> pD)*:defs spaces '}'\n\t-> defs,\n\n\trestKlassDef =\n\t',' spaces classElems:descriptors\t\t\t\t\t\t\t\t-> { {classElems: descriptors} }\n\t| (',' spaces klass)+:traits ',' spaces classElems:descriptors\t-> { {traits: traits, classElems: descriptors} }\n\t| (',' spaces klass)+:traits\t\t\t\t\t\t\t\t\t-> { {traits: traits, classElems: []} }\n\t| ',' token('{') spaces token('}')\t\t\t\t\t\t\t\t-> { {classElems: []} }\n\t| spaces\t\t\t\t\t\t\t\t\t\t\t\t\t\t-> { {classElems: []} },\n\tklass \t = namespaceId,\n\tklassName = spaces ( '\\'' | '\"') klass:n ( '\\'' | '\"') spaces\t-> n,\n klassDef =\n\tpos:p nsFollowedBy(\"subclass\"):sName '(' klassName:kName restKlassDef:spec ')' defEnd\n\t-> {\n\t\tvar categories = [];\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.className = kName;\n\t\t\tif (ea.category) categories.push(ea.category);\n\t\t});\n\t\tcategories = categories.uniq()\n\t\tthis._fragment(\n\t\t\tkName,\n\t\t\t'klassDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tspec.classElems,\n\t\t\t{traits: spec.traits, superclassName: sName, categories: categories})\n\t},\n basicKlassExt =\n\t\"Object.extend\" '(' klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) { ea.className = n; ea._isStatic = true });\n\t\t{name: n, traits: spec.traits, subElements: spec.classElems } }\n|\t(nsFollowedBy(\"addMethods\"):n | nsFollowedBy(\"addProperties\"):n) '(' classElems:clElems spaces ')'\n\t-> {\n\t\tclElems.forEach(function(ea) { ea.className = n; ea._isStatic = false });\n\t\t{name: n, subElements: clElems } }\n|\t\"layerClass\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = false });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } }\n|\t\"layerObject\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = true });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } },\n klassExtensionDef\n\t= pos:p basicKlassExt:spec defEnd\n\t-> { this._fragment(spec.name, 'klassExtensionDef', p, this.pos()-1, spec.subElements, {traits: spec.traits}) },\n \n /* 'object' stuff */\n restObjDef = classElems:propsAndMethodDescrs spaces\n-> { propsAndMethodDescrs.forEach(function(ea) { ea._isStatic = true }); propsAndMethodDescrs },\n objectDef = pos:p ( \"var\" spaces namespaceId:o | namespaceId:o) spaces '=' spaces restObjDef:propsAndMethodDescrs defEnd\n-> { this._fragment(o, 'objectDef', p, this.pos()-1, propsAndMethodDescrs) },\n \n /* ometa stuff */\n ometaParameter = ':' name:n spaces -> n,\n ometaParameters = ometaParameter*,\n ometaRuleDef = pos:p name:n spaces ometaParameters:a ('=' | \"->\") (~',' (chunk('(', ')') | chunk('{', '}') | chunk('\\'', '\\'') | chunk('\"', '\"') | ~'}' anything))*:body ( ',' | empty )\n-> { this._fragment(n, 'ometaRuleDef', p, this.pos()-1, [], {parameters: a}) },\n ometaInherit = \"<:\" spaces name:sn -> sn\n\t\t\t\t\t\t| empty -> { null },\n ometaDef = pos:p \"ometa\" spaces name:n space ometaInherit:sn spaces '{' spaces (ometaRuleDef:d spaces -> d)*:defs spaces '}' defEnd\n-> { this._fragment(n, 'ometaDef', p, this.pos()-1, defs, {superclassName: sn}) },\n \n \n /* otherStuff */\n // comment = descriptor:d spacesNoNl /*(fromTo('//', '\\n') | fromTo('/*', '*/')) spacesNoNl*/ -> { d.stopIndex = this.pos()-1; d.type = 'comment'; d },\n comment = pos:p space+ -> { this._fragment(null, 'comment', p, this.pos()-1) },\n \n blankLine = pos:p (nl | (char:c ?(c.charCodeAt(0) === 32))* nl) -> { this._fragment(null, 'blankLine', p, this.pos()-1) },\ncopDef =\n\tpos:p \"cop.create(\" klassName:n \")\" spacesNoNl nl* copSubElement*:subs spaces defEnd\n\t-> { this._fragment(n, 'copDef', p, this.pos()-1, subs) },\ncopSubElement =\n\tpos:p spaces '.'\n\t( copRefinement\n\t| somethingBigRelated:blob -> {name: blob.flatten().join('').replace('\\n', ''), subElementSpec: {}}\n\t):spec\n\t-> { this._fragment(spec.name, 'copSubElement', p, this.pos()-1, spec.subElementSpec.classElems,\n\t\t{traits: spec.subElementSpec.traits, refineSelector: spec.refineSelector}) },\ncopRefinement = \n\t( \"refineClass\" | \"refineObject\" ):sel '(' klass:n restKlassDef:spec ')'\n\t-> { {name: n, refineSelector: sel, subElementSpec: spec} },\n\n\n\n unknown = pos:p somethingBigRelated defEnd -> { this._fragment(null, 'unknown', p, this.pos()-1) }\n \n};\n"]]>truetruefalse
false00.11truefalsetruetruefalse
20nullfalse
truetruefalsetruetruefalse
false00.11truefalsetruetruefalse
Addmodulefalsenulltruefalsefalsetrue
false
Loadallfalsenulltruefalsefalsetrue
false
LineNofalsenulltruefalsefalsetrue
false
Refreshfalsenulltruefalsefalsetrue
false
Evalonfalsenulltruefalsefalsetrue
false
Sortfalsenulltruefalsefalsetrue
false
Viewas...falsenulltruefalsefalse
false
classesfalsenulltruefalsetruetruetrue
functionsfalsenulltruefalsetruetruetrue
objectsfalsenulltruefalsetruetruetrue
truetrue
true,\n \n /* helper productions */\n log :msg -> { console.log(msg); true },\n logPos -> { console.log(this.pos()); true },\n whereAreYou -> {\n\tvar charsBefore = 120; var charsAfter = 120; var src = this._originalInput.arr;\n\tvar startIndex = Math.max(0, this.pos() - charsBefore);\n\tvar stopIndex = Math.min(src.length, this.pos() + charsAfter);\n\tconsole.log(src.substring(startIndex, this.pos()) + '<--I am here-->' + src.substring(this.pos(), stopIndex));\n console.log('Rules: ' + this._ruleStack);\n console.log('Stack: ' + this.stack);\n true\n\t},\n fromTo :x :y =\n\tseq(x) (~seq(y) char)*:cs seq(y) -> cs,\n stackSize -> { this.stack.length },\n\tnum :x -> { this.stack.select(function(ea) { return ea === x }).length },\n\tgetStack -> { this.stack.clone() },\n\tassignStack :s -> { this.stack = s },\n\tstartTime -> { /*console.log('start measuring time'); new Date().getTime()*/ },\n\tstopTime :t -> { /*console.log('time: ' + (new Date().getTime()-t) + ' ms');*/ true},\n\topen :x = add(x) -> { x},\n\tclose :x :y =\n\tadd(y) remove(y) remove(x) -> { y},\n\tadd :x = exactly(x) -> { this.stack.push(x) },\n\tremove :x -> {\n\tif (this.stack.length == 0) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Stack is empty, cannot remove ' + x);\n\t};\n\tvar rem = this.stack.pop();\n\tif (rem !== x) {\n\t\tthis.whereAreYou();\n\t\tthrow new Error('Unmatched ' + x + 'at: ' + this.pos() + ' instead found ' + rem + '; stack: ' + this.stack);\n\t};\n\ttrue\n},\n\teverythingBut :x :y =\n\t~exactly(x) ~exactly(y) anything:a -> a,\n\tnonRecursive :x :y =\n\tgetStack:s open(x) everythingBut(x,y)*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\trecursive :x :y =\n\tgetStack:s open(x) ( everythingBut(x,y) | recursive(x,y) )*:a close(x, y) -> { x+ a.join('') + y }\n\t| assignStack(s) -> { this._manualFail() },\n\tchunk :x :y =\n\tbasicChunk(x,y):a\n\t/*~~exactly(x) (nonRecursive(x,y) | recursive(x,y)):a*/\n\t-> a,\n\t\n/*\tchunkWith :x :y :p = ~~exactly(x) ( open(x) num(x):n ( apply(p, 'a') )*:a close(x,y) -> { x+ a.join('') + y }\n\t | remove(x) ),*/\n\tsomethingRelated =\n\t~end (~'\\n' ~'\\r' ~';' anything)*,\n\tsomethingBigRelated =\n\t~end (\n\t\tchunk('(', ')')\n\t\t| chunk('{', '}')\n\t\t| chunk('[', ']')\n\t\t| chunk('\\'', '\\'')\n\t\t| chunk('\"', '\"')\n\t\t| spaces '+' spaces\n\t\t| ~',' ~';' ~'(' ~'{' ~'[' ~'\\'' ~'\"' ~nl anything )*,\n\tdefEnd = ';' '\\n' | ';' spaces | \"\",\n\tclassElemDefEnd = \",\" | \"\",\n\t\n\t/* basic string processing */\n\tspace =\n\tsuper(#space) | fromTo('//', '\\n') | fromTo('/*', '*/'),\n nl = '\\n' | '\\r' -> '\\n',\n\tspacesNoNl = (~nl space)*:spcs -> spcs,\n\tnameFirst = letter | '$' | '_',\n \tnameRest = nameFirst | digit,\n \tiName = firstAndRest(#nameFirst, #nameRest):r -> r.join(''),\n \tisKeyword :x = ?BSJSParser._isKeyword(x),\n \tname = iName:n /*~isKeyword(n)*/ -> n,\n \tkeyword = iName:k isKeyword(k) -> k,\n\tnamespaceIdSplitted = name:n '.' namespaceIdSplitted:r -> { [n].concat(r) }\n\t | name:n -> { [n] },\n\tnamespaceId =\n\tnamespaceIdSplitted:nArr\n\t-> nArr.join('.'),\n\tnsFollowedBy :x =\n\tnamespaceIdSplitted:nArr ?(nArr.last() === x)\n\t-> nArr.slice(0,nArr.length-1).join('.'),\n\tnsWith :x =\n\tnamespaceIdSplitted:nArr ?nArr.include(x)\n\t-> {\n\t\tvar i = nArr.indexOf(x);\n\t\t{\n\t\t\tbefore: nArr.slice(0,i).join('.'),\n\t\t\tafter: nArr.slice(i+1,nArr.length).join('.')\n\t\t}\n\t},\n \n /* functions */\n basicFunction =\n\t\"function\" spaces\n\t(name:n | empty)\n\tchunk('(', ')') spaces chunk('{', '}')\n\t-> n,\n func =\n\tbasicFunction:fn\n\t| \"var\" (space)+ name:fn spaces '=' spaces basicFunction\n\t-> fn,\n functionDef =\n\tpos:p ( func:fn | '(' func:fn ')' ) somethingRelated defEnd\n\t-> { this._fragment(fn, 'functionDef', p, this.pos()-1) },\n \n staticProperty =\n\tpos:p spacesNoNl\n\tnamespaceIdSplitted:nsArr ?(nsArr.length > 1) spaces '='\n\tsomethingBigRelated defEnd\n\t-> {\n\t\tthis._fragment(\n\t\t\tnsArr.last(),\n\t\t\t'staticProperty',\n\t\t\tp, this.pos()-1,\n\t\t\tnull,\n\t\t\t{ className: nsArr.slice(0,nsArr.length-1).join('.'), _isStatic: true }\n\t\t)},\n \n\t/* methods */\n methodModificationDef =\n\t\tpos:p spacesNoNl\n\t\tnsWith('prototype'):spec spaces '='\n\t\tspaces somethingBigRelated defEnd\n\t\t-> {this._fragment(\n\t\t\tspec.after,\n\t\t\t'methodModificationDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tnull,\n\t\t\t{className: spec.before, _isStatic: false})},\n \n /* properties */ \n protoDef =\n\t\tpos:p spacesNoNl name:pName ':' spaces\n\t\t(basicFunction (somethingBigRelated | empty )\n\t\t| somethingBigRelated\n\t\t) classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\ngetterOrSetter =\n\t\tpos:p spacesNoNl (\"get\" | \"set\") spaces name:pName chunk('(', ')') spaces chunk('{', '}') classElemDefEnd\n\t\t-> {\n\t\t\tthis._fragment(pName, 'protoDef', p, this.pos()-1, null, {_isStatic: false})\n\t\t},\n\n\n\tpropertyDef =\n\t\t(protoDef | methodModificationDef | staticProperty | getterOrSetter):spec\n\t\t-> {spec.type = 'propertyDef'; spec},\n\n \n /* class stuff */\n\tclassElems =\n\t(categoryDef:defs classElemDefEnd ->defs)+:allDefs\n\t-> allDefs.invoke('subElements').flatten(),\ncategoryDef =\n\tspaces pos:p category:catName \n\t(classElemsInCategory:defs classElemDefEnd -> defs)+:allDefs\n\t-> {\n\t\tvar classElemDefs = allDefs.flatten();\n\t\tvar catDef = this._fragment(catName, 'categoryDef', p, this.pos()-1, classElemDefs);\n\t\tclassElemDefs.collect(function(def) { def.category = catDef; return def });\n\t\tcatDef\n\t},\n\ncategory =\n\t(\n\t categoryName:name spaces ',' -> name\n\t| empty -> { Function.defaultCategoryName }\n\t),\n\ncategoryName =\n\t( fromTo('\\'', '\\'') | fromTo('\"', '\"') ):name -> name.join(''),\n\nclassElemsInCategory =\n\tspaces '{' ( spaces propertyDef:pD spaces -> pD)*:defs spaces '}'\n\t-> defs,\n\n\trestKlassDef =\n\t',' spaces classElems:descriptors\t\t\t\t\t\t\t\t-> { {classElems: descriptors} }\n\t| (',' spaces klass)+:traits ',' spaces classElems:descriptors\t-> { {traits: traits, classElems: descriptors} }\n\t| (',' spaces klass)+:traits\t\t\t\t\t\t\t\t\t-> { {traits: traits, classElems: []} }\n\t| ',' token('{') spaces token('}')\t\t\t\t\t\t\t\t-> { {classElems: []} }\n\t| spaces\t\t\t\t\t\t\t\t\t\t\t\t\t\t-> { {classElems: []} },\n\tklass \t = namespaceId,\n\tklassName = spaces ( '\\'' | '\"') klass:n ( '\\'' | '\"') spaces\t-> n,\n klassDef =\n\tpos:p nsFollowedBy(\"subclass\"):sName '(' klassName:kName restKlassDef:spec ')' defEnd\n\t-> {\n\t\tvar categories = [];\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.className = kName;\n\t\t\tif (ea.category) categories.push(ea.category);\n\t\t});\n\t\tcategories = categories.uniq()\n\t\tthis._fragment(\n\t\t\tkName,\n\t\t\t'klassDef',\n\t\t\tp,\n\t\t\tthis.pos()-1,\n\t\t\tspec.classElems,\n\t\t\t{traits: spec.traits, superclassName: sName, categories: categories})\n\t},\n basicKlassExt =\n\t\"Object.extend\" '(' klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) { ea.className = n; ea._isStatic = true });\n\t\t{name: n, traits: spec.traits, subElements: spec.classElems } }\n|\t(nsFollowedBy(\"addMethods\"):n | nsFollowedBy(\"addProperties\"):n) '(' classElems:clElems spaces ')'\n\t-> {\n\t\tclElems.forEach(function(ea) { ea.className = n; ea._isStatic = false });\n\t\t{name: n, subElements: clElems } }\n|\t\"layerClass\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = false });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } }\n|\t\"layerObject\" '(' namespaceId:layerName spaces ',' spaces klass:n restKlassDef:spec token(')')\n\t-> {\n\t\tspec.classElems.forEach(function(ea) {\n\t\t\tea.layerName = layerName;\n\t\t\tea.className = n;\n\t\t\tea._isStatic = true });\n\t\t{name: n, layerName: layerName, subElements: spec.classElems } },\n klassExtensionDef\n\t= pos:p basicKlassExt:spec defEnd\n\t-> { this._fragment(spec.name, 'klassExtensionDef', p, this.pos()-1, spec.subElements, {traits: spec.traits}) },\n \n /* 'object' stuff */\n restObjDef = classElems:propsAndMethodDescrs spaces\n-> { propsAndMethodDescrs.forEach(function(ea) { ea._isStatic = true }); propsAndMethodDescrs },\n objectDef = pos:p ( \"var\" spaces namespaceId:o | namespaceId:o) spaces '=' spaces restObjDef:propsAndMethodDescrs defEnd\n-> { this._fragment(o, 'objectDef', p, this.pos()-1, propsAndMethodDescrs) },\n \n /* ometa stuff */\n ometaParameter = ':' name:n spaces -> n,\n ometaParameters = ometaParameter*,\n ometaRuleDef = pos:p name:n spaces ometaParameters:a ('=' | \"->\") (~',' (chunk('(', ')') | chunk('{', '}') | chunk('\\'', '\\'') | chunk('\"', '\"') | ~'}' anything))*:body ( ',' | empty )\n-> { this._fragment(n, 'ometaRuleDef', p, this.pos()-1, [], {parameters: a}) },\n ometaInherit = \"<:\" spaces name:sn -> sn\n\t\t\t\t\t\t| empty -> { null },\n ometaDef = pos:p \"ometa\" spaces name:n space ometaInherit:sn spaces '{' spaces (ometaRuleDef:d spaces -> d)*:defs spaces '}' defEnd\n-> { this._fragment(n, 'ometaDef', p, this.pos()-1, defs, {superclassName: sn}) },\n \n \n /* otherStuff */\n // comment = descriptor:d spacesNoNl /*(fromTo('//', '\\n') | fromTo('/*', '*/')) spacesNoNl*/ -> { d.stopIndex = this.pos()-1; d.type = 'comment'; d },\n comment = pos:p space+ -> { this._fragment(null, 'comment', p, this.pos()-1) },\n \n blankLine = pos:p (nl | (char:c ?(c.charCodeAt(0) === 32))* nl) -> { this._fragment(null, 'blankLine', p, this.pos()-1) },\ncopDef =\n\tpos:p \"cop.create(\" klassName:n \")\" spacesNoNl nl* copSubElement*:subs spaces defEnd\n\t-> { this._fragment(n, 'copDef', p, this.pos()-1, subs) },\ncopSubElement =\n\tpos:p spaces '.'\n\t( copRefinement\n\t| somethingBigRelated:blob -> {name: blob.flatten().join('').replace('\\n', ''), subElementSpec: {}}\n\t):spec\n\t-> { this._fragment(spec.name, 'copSubElement', p, this.pos()-1, spec.subElementSpec.classElems,\n\t\t{traits: spec.subElementSpec.traits, refineSelector: spec.refineSelector}) },\ncopRefinement = \n\t( \"refineClass\" | \"refineObject\" ):sel '(' klass:n restKlassDef:spec ')'\n\t-> { {name: n, refineSelector: sel, subElementSpec: spec} },\n\n\n\n unknown = pos:p somethingBigRelated defEnd -> { this._fragment(null, 'unknown', p, this.pos()-1) }\n \n};\n"]]>nullnullnull
nullfalsetruenullfalse
LKFileParser.ometa:LKFileParserfalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
null43