Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ngallagher committed May 28, 2018
1 parent 060473c commit 1ea7e00
Show file tree
Hide file tree
Showing 17 changed files with 193 additions and 183 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.snapscript.studio.agent.debug;

import static org.snapscript.core.ModifierType.CLASS;
import static org.snapscript.studio.agent.debug.ValueData.DEPTH_KEY;
import static org.snapscript.studio.agent.debug.ValueData.EXPANDABLE_KEY;
import static org.snapscript.studio.agent.debug.ValueData.NAME_KEY;
Expand All @@ -19,6 +20,9 @@
import org.snapscript.common.store.ClassPathStore;
import org.snapscript.compile.StoreContext;
import org.snapscript.core.Context;
import org.snapscript.core.ModifierType;
import org.snapscript.core.function.AccessorProperty;
import org.snapscript.core.property.Property;
import org.snapscript.core.scope.MapModel;
import org.snapscript.core.scope.Model;
import org.snapscript.core.scope.ModelScope;
Expand All @@ -27,11 +31,8 @@
import org.snapscript.core.scope.instance.Instance;
import org.snapscript.core.scope.instance.PrimitiveInstance;
import org.snapscript.core.type.Type;
import org.snapscript.core.function.AccessorProperty;
import org.snapscript.core.property.Property;
import org.snapscript.core.type.index.ScopeType;
import org.snapscript.core.variable.Reference;
import org.snapscript.studio.agent.debug.ScopeNodeTraverser;

public class ScopeNodeTraverserTest extends TestCase {

Expand Down Expand Up @@ -145,7 +146,7 @@ private static Scope createRootScope(Map<String, Object> values) {
private static Instance createInstanceScope(Map<String, Object> values, String name) {
Model model = new MapModel(Collections.EMPTY_MAP);
Scope scope = new ModelScope(model, null);
Type type = new ScopeType(null, null, null, name, 0);
Type type = new ScopeType(null, null, name, CLASS.mask, 0);
Instance instance = new PrimitiveInstance(null, scope, type);
List<Property> properties = type.getProperties();
State state = instance.getState();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.snapscript.studio.index.tree;

import static org.snapscript.core.type.Category.CLASS;
import static org.snapscript.core.ModifierType.CLASS;

import org.snapscript.core.Compilation;
import org.snapscript.core.Evaluation;
Expand Down Expand Up @@ -60,7 +60,7 @@ public Type getType(Scope scope) {
private static class IndexType extends ScopeType {

public IndexType(Module module, String name) {
super(module,null, CLASS, name, 0);
super(module,null, name, CLASS.mask, 0);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.snapscript.tree.constraint.ClassConstraint;
import org.snapscript.tree.constraint.TraitConstraint;
import org.snapscript.tree.define.ClassHierarchy;
import org.snapscript.tree.define.TypeHierarchy;

public class TypeHierarchyIndex implements Compilation {

Expand All @@ -29,16 +28,14 @@ public TypeHierarchyIndex(ClassConstraint name, TraitConstraint... traits) {

@Override
public Object compile(Module module, Path path, int line) throws Exception {
TypeHierarchy result = hierarchy.compile(module, path, line);

if(name != null) {
Scope scope = module.getScope();
Type constraint = name.getType(scope);
String type = String.valueOf(constraint);
String prefix = module.getName();

return new IndexResult(SUPER, result, null, prefix, type, path, line);
return new IndexResult(SUPER, hierarchy, null, prefix, type, path, line);
}
return result;
return hierarchy;
}
}
1 change: 1 addition & 0 deletions snap-studio/src/main/resources/resource/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ define(["require", "exports", "jquery", "md5", "ace", "w2ui", "common", "socket"
editor.setReadOnly(false);
editor.setAutoScrollEditorIntoView(true);
editor.getSession().setUseSoftTabs(true);
//editor.setKeyboardHandler("ace/keyboard/vim");
editor.commands.removeCommand("replace"); // Ctrl-H
editor.commands.removeCommand("find"); // Ctrl-F
editor.commands.removeCommand("expandToMatching"); // Ctrl-Shift-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var ActionScriptHighlightRules = function() {
//{ token: 'support.constant.snapscript.2',
// regex: '\\b(?:__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\\b' },
{ token: 'keyword.control.snapscript.2',
regex: '\\b(?:trait|this|try|catch|finally|match|function|synchronized|debug|enum|module|with|throw|yield|async|override|abstract|loop|assert|extends|as|import|implements|interface|const|public|private|new|static|super|var|for|in|break|continue|while|return|if|else|case|default|switch)\\b' },
regex: '\\b(?:trait|this|try|catch|finally|match|function|synchronized|debug|enum|module|with|throw|yield|async|override|abstract|loop|assert|extends|as|import|implements|interface|const|public|private|new|static|super|var|let|for|in|break|continue|while|return|if|else|case|default|switch)\\b' },
{ token: 'constant.language.snapscript.2',
regex: '\\b(?:null|undefined|true|false)\\b' },
{ token: 'constant.numeric.snapscript.2',
Expand Down
1 change: 1 addition & 0 deletions snap-studio/src/main/resources/resource/ts/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ export module FileEditor {
editor.setReadOnly(false);
editor.setAutoScrollEditorIntoView(true);
editor.getSession().setUseSoftTabs(true);
//editor.setKeyboardHandler("ace/keyboard/vim");

editor.commands.removeCommand("replace"); // Ctrl-H
editor.commands.removeCommand("find"); // Ctrl-F
Expand Down
2 changes: 1 addition & 1 deletion snap-studio/work/demo/games/src/mario/MarioGame.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function start(scale) {

try {
g.start();
sleep(Integer.MAX_VALUE);
sleep(MAX_VALUE);
} catch(e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import awt.Graphics;
* an Animation.
*/

class Animatible {
abstract class Animatible {

private var currAnim: Animation;
private var offsetX: Integer = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
format.
@see FilteredSoundStream
*/
class SoundFilter{
abstract class SoundFilter{

/**
Resets this SoundFilter. Does nothing by default.
Expand Down
15 changes: 12 additions & 3 deletions snap-studio/work/demo/misc/src/text_test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
class Foo<A: String>{
// class Foo<X: Integer>{}
// class Bar<T: String> extends Foo<T>{}


function list(x: Map<String, ?>){
return x.keySet()
.stream()
.findFirst()
.get()
.substring(1);
}
class Bar<A: Integer> extends Foo<A>{
}

println(list({'xxx':1}));
Loading

0 comments on commit 1ea7e00

Please sign in to comment.