Package com.redhat.ceylon.compiler.js

Examples of com.redhat.ceylon.compiler.js.CompilerErrorException


                    }
                } else {
                    rp = getModule().getPackage(pname);
                }
                if (rp == null) {
                    throw new CompilerErrorException("Package not found: " + pname);
                }
                if (rp != this && rp instanceof JsonPackage && !((JsonPackage)rp).loaded) {
                    ((JsonPackage) rp).loadDeclarations();
                }
                final boolean nested = tname.indexOf('.') > 0;
View Full Code Here


    /** Read the metamodel declaration from a js file, check it's the right version and return the model as a Map. */
    public static Map<String,Object> loadJsonModel(File jsFile) {
        try {
            Map<String,Object> model = JSUtils.readJsonModel(jsFile);
            if (model == null) {
                throw new CompilerErrorException("Can't find metamodel definition in " + jsFile.getAbsolutePath());
            }
            if (!model.containsKey("$mod-bin")) {
                throw new CeylonRunJsException("The JavaScript module " + jsFile +
                        " is not compatible with the current version of ceylon-js");
            } else if (!model.get("$mod-bin").toString().equals(BIN_VERSION)) {
                throw new CompilerErrorException(String.format("This Ceylon-JS module has binary version %s is incompatible with the compiler version %s",
                        model.get("$mod-bin"), BIN_VERSION));
            }
            return model;
        } catch (IOException ex) {
            throw new CompilerErrorException("Error loading model from " + jsFile);
        }
    }
View Full Code Here

                if (p != null) {
                    return p;
                }
            }
        }
        throw new CompilerErrorException("Package " + name + " not available in module " + this);
    }
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.js.CompilerErrorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.