From 246dcc6f4094797dde15cf14408e653323c04d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20=C3=96qvist?= <jesper.oqvist@cs.lth.se> Date: Mon, 18 May 2020 17:38:49 +0200 Subject: [PATCH] Replace "can not" with "cannot" --- src/jastadd/ast/Attributes.jrag | 23 ++++++++++++----------- src/jastadd/ast/Grammar.jrag | 4 ++-- src/jastadd/ast/NameBinding.jrag | 2 +- src/java/org/jastadd/JastAdd.java | 10 +++++----- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/jastadd/ast/Attributes.jrag b/src/jastadd/ast/Attributes.jrag index 86ed10fb..dbedfee1 100644 --- a/src/jastadd/ast/Attributes.jrag +++ b/src/jastadd/ast/Attributes.jrag @@ -76,7 +76,7 @@ public aspect Attributes { } public void ASTNode.refineError(String what, String file, int line) { - grammar().error("can not find " + what + " to refine\n" + grammar().error("cannot find " + what + " to refine\n" + "Warning: implicitly generated methods and equations must be refined" + " without an explicit aspect name", file, line); } @@ -98,7 +98,7 @@ public aspect Attributes { String aspectName) { if (!config().rewriteEnabled()) { - error("can not use rewrites while rewrites are disabled (enable with --rewrite=cnta)", + error("cannot use rewrites while rewrites are disabled (enable with --rewrite=cnta)", fileName, startLine); return; } @@ -115,9 +115,9 @@ public aspect Attributes { r.setAspectName(aspectName); ((ASTDecl)c).addRewrite(r); } else if (c != null) { - error("can not rewrite to non AST class '" + className + "'", fileName, startLine); + error("cannot rewrite to non AST class '" + className + "'", fileName, startLine); } else { - error("can not rewrite to unknown class '" + className + "'", fileName, startLine); + error("cannot rewrite to unknown class '" + className + "'", fileName, startLine); } } @@ -164,7 +164,7 @@ public aspect Attributes { TypeDecl type = lookup(decl.hostName); if (type == null) { problems.add(Problem.builder() - .message("can not find attribute %s in unknown class %s", decl.attrName, decl.hostName) + .message("cannot find attribute %s in unknown class %s", decl.attrName, decl.hostName) .sourceFile(decl.fileName) .sourceLine(decl.startLine) .buildError()); @@ -175,7 +175,7 @@ public aspect Attributes { if ((attr = type.lookupSynDecl(decl.signature)) == null && (attr = type.lookupInhDecl(decl.signature)) == null) { problems.add(Problem.builder() - .message("can not find attribute %s.%s", decl.hostName, decl.attrName) + .message("cannot find attribute %s.%s", decl.hostName, decl.attrName) .sourceFile(decl.fileName) .sourceLine(decl.startLine) .buildError()); @@ -361,7 +361,7 @@ public aspect Attributes { obj.modifiers = modifiers; c.classBodyDecls.add(obj); } else { - error("can not add member to unknown class " + className, fileName, n.firstToken.beginLine); + error("cannot add member to unknown class " + className, fileName, n.firstToken.beginLine); } } @@ -451,7 +451,7 @@ public aspect Attributes { c.refinedSynEqs.add(equ); c.numRefinedSynEqs += 1; } else { - error("can not add equation for synthesized attribute " + name + " to unknown class " + error("cannot add equation for synthesized attribute " + name + " to unknown class " + className, fileName, startLine); } } @@ -593,7 +593,7 @@ public aspect Attributes { c.refinedInhEqs.add(equ); // Sort in alphabetical order, then non-NTAs first. c.numRefinedInhEqs += 1; } else { - error("can not add equation for inherited attribute " + name + " to unknown class " + error("cannot add equation for inherited attribute " + name + " to unknown class " + className, fileName, startLine); } } @@ -709,7 +709,7 @@ public aspect Attributes { c.refinedClassBodyDecls.add(o); c.numRefinedCBDecls += 1; } else { - error("can not add member to unknown class " + className + " in " + fileName); + error("cannot add member to unknown class " + className + " in " + fileName); } } @@ -869,7 +869,8 @@ public aspect Attributes { buf.append("\\b)"); pattern = buf.toString(); } - String newContents = "refined_" + original.aspectName() + "_" + name() + "_" + methodName; + String newContents = String.format("refined_%s_%s_%s", + original.aspectName(), name(), methodName); // TODO: update keep to false if no strings are replaced. Matcher matcher = Pattern.compile(pattern).matcher(s); diff --git a/src/jastadd/ast/Grammar.jrag b/src/jastadd/ast/Grammar.jrag index 5ef93d54..41ec4653 100644 --- a/src/jastadd/ast/Grammar.jrag +++ b/src/jastadd/ast/Grammar.jrag @@ -71,7 +71,7 @@ aspect Grammar { c.implementsList.add(nameList); } else { int line = nameList.firstToken.beginLine; - error("can not add interface to unknown class " + className, fileName, line); + error("cannot add interface to unknown class " + className, fileName, line); } } } @@ -90,7 +90,7 @@ aspect Grammar { error(className + " is not an interface and can therefore not be extended", fileName, line); } else { int line = nameList.firstToken.beginLine; - error("can not add interface to unknown interface " + className, fileName, line); + error("cannot add interface to unknown interface " + className, fileName, line); } } } diff --git a/src/jastadd/ast/NameBinding.jrag b/src/jastadd/ast/NameBinding.jrag index 71250d8f..2cdf8912 100644 --- a/src/jastadd/ast/NameBinding.jrag +++ b/src/jastadd/ast/NameBinding.jrag @@ -163,7 +163,7 @@ aspect BindSynEquations { } aspect LookupDecls { - // This can not be lazy because we remove duplicate InhDecls, + // This cannot be lazy because we remove duplicate InhDecls, // so if this were lazy it could point to removed nodes! syn AttrDecl AttrEq.decl(); diff --git a/src/java/org/jastadd/JastAdd.java b/src/java/org/jastadd/JastAdd.java index ce550654..125543e4 100644 --- a/src/java/org/jastadd/JastAdd.java +++ b/src/java/org/jastadd/JastAdd.java @@ -306,7 +306,7 @@ public class JastAdd { clazz.classBodyDecls.add(decl); } else { problems.add(Problem.builder() - .message("can not add member to unknown class %s", className) + .message("cannot add member to unknown class %s", className) .sourceFile(decl.fileName) .sourceLine(decl.line) .buildError()); @@ -325,7 +325,7 @@ public class JastAdd { TypeDecl clazz = grammar.lookup(className); if (clazz == null) { problems.add(decl.errorf( - "can not add synthesized attribute %s %s to unknown class %s", + "cannot add synthesized attribute %s %s to unknown class %s", decl.getType(), decl.getName(), className)); } } @@ -336,7 +336,7 @@ public class JastAdd { clazz.addSynEq(equ); } else { problems.add(equ.errorf( - "can not add equation for synthesized attribute %s to unknown class %s", + "cannot add equation for synthesized attribute %s to unknown class %s", equ.getName(), className)); } } @@ -348,7 +348,7 @@ public class JastAdd { clazz.addInhDecl(decl); } else { problems.add(decl.errorf( - "can not add inherited attribute %s %s to unknown class %s", + "cannot add inherited attribute %s %s to unknown class %s", decl.getType(), decl.getName(), className)); } } @@ -360,7 +360,7 @@ public class JastAdd { clazz.addInhEq(equ); } else { problems.add(equ.errorf( - "can not add equation for inhertied attribute %s to unknown class %s", + "cannot add equation for inhertied attribute %s to unknown class %s", equ.getName(), className)); } } -- GitLab