private String validateUrl(String url) { url = stripQuotes(url); // Validate URL... try { new URL(url); } catch (MalformedURLException e) { parseException("Invalid URL: " + url, e); } return url; }
String prop = idFragment(); if (prop == null) parseException("Expected a property expression after ${"); parseException("Expected '}' after property expression");
List<Token> aMatch = match(Token.Kind.IDENT); if (aMatch == null) { parseException("Expected 'src' or 'test'"); if ("src".equals(aMatch.get(0).value)) { if (null == match(Token.Kind.COLON)) { parseException("Expected : after src"); parseException("Expected string after src:"); if (null != aMatch && "test".equals(aMatch.get(0).value)) { if (null == match(Token.Kind.COLON)) { parseException("Expected : after test"); parseException("Expected string after test:"); parseException("Expected ] after srcs list");
parseException("Expected : after label"); parseException("Expected String after :"); parseException("Expected ] after srcs list");
private List<Property> properties(Token.Kind kind) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no properties. } List<Property> properties = new ArrayList<Property>(); chewEols(); chewIndents(); Property p; while ((p = property()) != null) { chewEols(); chewIndents(); properties.add(p); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return properties; }
private List<String> modules() { indent(); if (match(Token.Kind.MODULES, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no properties. } List<String> modules = new ArrayList<String>(); chewEols(); chewIndents(); String module; while ((module = idFragment()) != null) { chewEols(); chewIndents(); modules.add(module); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return modules; }
if (repositories == null) { parseException("Error: expected URL string after 'respositories");
chewIndents(); if (match(Kind.RBRACKET) == null && match(Kind.RBRACE) == null) parseException("Expected ']' after configuration properties");
/** * Dependencies of a project. The real meat of it. */ private List<Id> dependencies(Token.Kind kind, boolean allowNullVersion) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no deps. } List<Id> deps = new ArrayList<Id>(); chewEols(); chewIndents(); // Slurp up the dep ids. Id id; while ((id = id(allowNullVersion)) != null) { // Optional additional params at the end. String classifier = classifier(); if (null != classifier) { id.setClassifier(classifier); } chewEols(); chewIndents(); deps.add(id); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return deps; }
parseException("Expected newline after 'plugin' keyword");
private String validateUrl(String url) { url = stripQuotes(url); // Validate URL... try { new URL(url); } catch (MalformedURLException e) { parseException("Invalid URL: " + url, e); } return url; }
private String validateUrl(String url) { url = stripQuotes(url); // Validate URL... try { new URL(url); } catch (MalformedURLException e) { parseException("Invalid URL: " + url, e); } return url; }
private List<String> modules() { indent(); if (match(Token.Kind.MODULES, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no properties. } List<String> modules = new ArrayList<String>(); chewEols(); chewIndents(); String module; while ((module = idFragment()) != null) { chewEols(); chewIndents(); modules.add(module); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return modules; }
private List<Property> properties(Token.Kind kind) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no properties. } List<Property> properties = new ArrayList<Property>(); chewEols(); chewIndents(); Property p; while ((p = property()) != null) { chewEols(); chewIndents(); properties.add(p); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return properties; }
private List<String> modules() { indent(); if (match(Token.Kind.MODULES, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no properties. } List<String> modules = new ArrayList<String>(); chewEols(); chewIndents(); String module; while ((module = idFragment()) != null) { chewEols(); chewIndents(); modules.add(module); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return modules; }
private List<Property> properties(Token.Kind kind) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no properties. } List<Property> properties = new ArrayList<Property>(); chewEols(); chewIndents(); Property p; while ((p = property()) != null) { chewEols(); chewIndents(); properties.add(p); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return properties; }
/** * Dependencies of a project. The real meat of it. */ private List<Id> dependencies(Token.Kind kind, boolean allowNullVersion) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no deps. } List<Id> deps = new ArrayList<Id>(); chewEols(); chewIndents(); // Slurp up the dep ids. Id id; while ((id = id(allowNullVersion)) != null) { // Optional additional params at the end. String classifier = classifier(); if (null != classifier) { id.setClassifier(classifier); } chewEols(); chewIndents(); deps.add(id); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return deps; }
/** * Dependencies of a project. The real meat of it. */ private List<Id> dependencies(Token.Kind kind, boolean allowNullVersion) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no deps. } List<Id> deps = new ArrayList<Id>(); chewEols(); chewIndents(); // Slurp up the dep ids. Id id; while ((id = id(allowNullVersion)) != null) { // Optional additional params at the end. String classifier = classifier(); if (null != classifier) { id.setClassifier(classifier); } chewEols(); chewIndents(); deps.add(id); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return deps; }
parseException("Expected newline after 'plugin' keyword");
parseException("Expected newline after 'plugin' keyword");