Skip to content

Commit

Permalink
change isConstructor to asCOnstructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo60 committed Mar 17, 2016
1 parent c577a07 commit 529111f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion META-INF/MANIFEST.MF
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: FregIDE
Bundle-SymbolicName: frege.ide;singleton:=true
Bundle-Version: 3.23.900
Bundle-Version: 3.24.6
Bundle-Vendor: Ingo Wechsung
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: impulse;bundle-version="0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/frege/imp/builders/FregeBuilder.java
Expand Up @@ -116,7 +116,7 @@ public TList<String> getDeps(String content, String fromPath) {
// packs = Utilities.correctDependenciesFor(packs, fromPath);

while (true) {
final DCons<String> cons = packs.isCons();
final DCons<String> cons = packs.asCons();
if (cons == null) break;
packs = cons.mem2.call();
final String pack = cons.mem1.call();
Expand Down
2 changes: 1 addition & 1 deletion src/frege/imp/contentProposer/ContentProposer.java
Expand Up @@ -153,7 +153,7 @@ public ICompletionProposal[] getContentProposals(IParseController ctlr,
else */ {
ps = Utilities.proposeContent(g, parser.ourRoot(), offset, tokens, inx);
while (true) {
final TList.DCons<TProposal> node = ps.isCons();
final TList.DCons<TProposal> node = ps.asCons();
if (node == null) break;
TProposal p = node.mem1.call();
if (first) {
Expand Down
6 changes: 3 additions & 3 deletions src/frege/imp/parser/FregeParseController.java
Expand Up @@ -725,7 +725,7 @@ public Lazy<Boolean> apply(Lazy<RealWorld> realworld) {
index = 0;

while (!monitor.isCanceled()
&& (pass = passes.isCons()) != null
&& (pass = passes.asCons()) != null
&& errors(global) == 0
&& index < 2) { // do lexer and parser synchronized
t1 = System.nanoTime();
Expand Down Expand Up @@ -774,7 +774,7 @@ && errors(global) == 0

while (!monitor.isCanceled()
&& errors(global) == 0
&& (pass = passes.isCons()) != null) { // do the rest unsynchronized
&& (pass = passes.asCons()) != null) { // do the rest unsynchronized
t1 = System.nanoTime();
passes = pass.mem2.call();
index++;
Expand Down Expand Up @@ -901,7 +901,7 @@ else if (!ourJar.equals(frege.FregePlugin.fregeLib)) {
}

while (!monitor.isCanceled() && maxmsgs > 0) {
DCons<TMessage> node = msgs.isCons();
DCons<TMessage> node = msgs.asCons();
if (node == null) break;
msgs = node.mem2.call();
TMessage msg = node.mem1.call();
Expand Down
12 changes: 6 additions & 6 deletions src/frege/imp/referenceResolvers/FregeReferenceResolver.java
Expand Up @@ -95,37 +95,37 @@ public Object getLinkTarget(Object node, IParseController controller) {
&& !isMinus
) return null;
TMaybe<TEither<Short, TQName>> mb = TGlobal.resolved(g, tok);
DJust<TEither<Short, TQName>> just = mb.isJust();
DJust<TEither<Short, TQName>> just = mb.asJust();
if (just == null) {
if (isMinus) {
TToken neg = TToken.upd$value(
TToken.upd$tokid(tok, TTokenID.VARID),
"negate");
mb = TGlobal.resolved(g, neg);
just = mb.isJust();
just = mb.asJust();
if (just == null) return null;
}
else return null;
}
final TEither<Short, TQName> lr = just.mem1.call();
final DRight<Short, TQName> right = lr.isRight();
final DRight<Short, TQName> right = lr.asRight();
if (right != null) {
// this is a QName
TQName q = right.mem1.call();
final TMaybe<TSymbolT<TGlobal>> mbsym = TGlobal.findit(g, q).call();
final DJust<TSymbolT<TGlobal>> jsym = mbsym.isJust();
final DJust<TSymbolT<TGlobal>> jsym = mbsym.asJust();
if (jsym == null) return null; // not found?
final TSymbolT<TGlobal> sym = jsym.mem1.call();
System.err.println("getLinkTarget: " + QNames.IShow_QName.show(q));
return new Symbol(g, sym);
}
final DLeft<Short, TQName> left = lr.isLeft();
final DLeft<Short, TQName> left = lr.asLeft();
if (left != null) {
// this is a namespace
String ns = TToken.value(tok);
final TTreeMap<String, String> tree = TGlobal.namespaces(g);
final TMaybe<String> mbpack = TTreeMap.lookupS(tree, ns);
final DJust<String> jpack = mbpack.isJust();
final DJust<String> jpack = mbpack.asJust();
if (jpack == null) return null;
String pack = jpack.mem1.call();
return new Namespace(g, ns, pack);
Expand Down
10 changes: 5 additions & 5 deletions src/frege/imp/tokenColorer/FregeTokenColorer.java
Expand Up @@ -102,18 +102,18 @@ public FregeTokenColorer() {
public TextAttribute getKind(FregeParseController controller, TToken tok, TextAttribute normalAttribute) {
TGlobal g = controller.getCurrentAst();
final TMaybe<TEither<Short, TQName>> mb = TGlobal.resolved(g, tok);
final DJust<TEither<Short, TQName>> just = mb.isJust();
final DJust<TEither<Short, TQName>> just = mb.asJust();
if (just == null) return normalAttribute;
final TEither<Short, TQName> et = just.mem1.call();
final DRight<Short, TQName> right = et.isRight();
final DRight<Short, TQName> right = et.asRight();
if (right == null) return nsAttribute; // since it is Left ()
final TQName qname = right.mem1.call();
final DLocal local = qname.isLocal();
final DLocal local = qname.asLocal();
if (local != null) return normalAttribute; // local var
final boolean our = TGlobal.our(g, qname);
final TQName.DTName tname = qname.isTName();
final TQName.DTName tname = qname.asTName();
if (tname != null) return our? typeAttribute : itypeAttribute;
final TQName.DMName mname = qname.isMName();
final TQName.DMName mname = qname.asMName();
if (mname != null && TToken.tokid(tok) == TTokenID.CONID)
return our ? conAttribute : iconAttribute;
final String b = TQName.base(qname);
Expand Down
14 changes: 7 additions & 7 deletions src/frege/imp/tree/FregeTreeModelBuilder.java
Expand Up @@ -64,11 +64,11 @@ public boolean visit(TGlobal g, TTreeMap<String, TSymbolT<TGlobal>> env, boolean
else if (cat == dcon) continue;

// go through the list of symbols and do the ones that equal the current category
DCons<TSymbolT<TGlobal>> elem = syms.isCons();
DCons<TSymbolT<TGlobal>> elem = syms.asCons();
boolean found = false;
while (elem != null) {
final TSymbolT<TGlobal> sym = elem.mem1.call();
elem = (elem.mem2.call()).isCons();
elem = (elem.mem2.call()).asCons();
if (sym.constructor() != cat) continue;
if (sym.constructor() == link && TGlobal.our(g, TSymbolT.alias(sym))) continue;
if (top) { // category labels at the top only before first item
Expand All @@ -90,7 +90,7 @@ public boolean visit(TGlobal g, TSymbolT<TGlobal> sym) {
if (TSymbolT.has$env(sym)) visit(g, TSymbolT.env(sym), false);
else if (TSymbolT.has$expr(sym)) {
final TMaybe<TState<TGlobal, TExprT>> mbex = TSymbolT.expr(sym);
final DJust<TState<TGlobal, TExprT>> just = mbex.isJust();
final DJust<TState<TGlobal, TExprT>> just = mbex.asJust();
if (just != null) {
TState<TGlobal, TExprT> lam = just.mem1.call();
final TExprT expr = State.evalState(lam, g);
Expand All @@ -105,11 +105,11 @@ public boolean visit(TGlobal g, TExprT expr) {
// System.err.println("visiting: " + g.toString() + ", " + expr.toString());
TList<TSymbolT<TGlobal>> symbols = FregeParseController.funSTG(
Utilities.exprSymbols(expr), g);
DCons<TSymbolT<TGlobal>> node = symbols.isCons();
DCons<TSymbolT<TGlobal>> node = symbols.asCons();
while (node != null) {
TSymbolT<TGlobal> sym = node.mem1.call();
visit(g, sym);
node = node.mem2.call().isCons();
node = node.mem2.call().asCons();
}
return true;
}
Expand All @@ -121,10 +121,10 @@ public boolean visit(TGlobal g) {
pushSubItem(new PackageItem(pack, TSubSt.thisPos(sub)));
if (! "".equals(pack)) {
final TList<TTuple3<TPosition, String, String>> pnps = Utilities.imports(g);
DCons<TTuple3<TPosition, String, String>> elem = pnps.isCons();
DCons<TTuple3<TPosition, String, String>> elem = pnps.asCons();
while (elem != null) {
final TTuple3<TPosition, String, String> tuple = elem.mem1.call();
elem = elem.mem2.call().isCons();
elem = elem.mem2.call().asCons();
final TPosition pos = tuple.mem1.call();
final String ns = tuple.mem2.call();
final String p = tuple.mem3.call();
Expand Down

0 comments on commit 529111f

Please sign in to comment.