]> gitweb.factorcode.org Git - factor.git/blob - extra/xmode/marker/context/context.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / xmode / marker / context / context.factor
1 USING: accessors kernel ;
2 IN: xmode.marker.context
3
4 ! Based on org.gjt.sp.jedit.syntax.TokenMarker.LineContext
5 TUPLE: line-context
6 parent
7 in-rule
8 in-rule-set
9 end
10 ;
11
12 : <line-context> ( ruleset parent -- line-context )
13     over [ "no context" throw ] unless
14     line-context new
15         swap >>parent
16         swap >>in-rule-set ;
17
18 M: line-context clone
19     call-next-method [ clone ] change-parent ;