Skip to content

Commit

Permalink
Fixing bad describe parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Dec 14, 2017
1 parent 3b8b34c commit 3e65db0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ import static org.uqbar.project.wollok.wollokDsl.WollokDslPackage.Literals.*
*/
class WollokDslDescriptionLabelProvider extends DefaultDescriptionLabelProvider {

// override text(IEObjectDescription ele) {
// ele.name.toString
// }
//
override image(IEObjectDescription ele) {
switch (ele.EClass) {
case WCLASS: 'wollok-icon-class_16.png'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class WollokDslLabelProvider extends DefaultEObjectLabelProvider {
labelExtensionResolved = true
}

if (labelExtension != null) {
if (labelExtension !== null) {
val type = labelExtension.resolvedType(obj)
if(type != null) (separator + type) else ""
if(type !== null) (separator + type) else ""
} else
""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ class WollokSyntaxErrorMessageProvider extends SyntaxErrorMessageProvider {
}

// Now automatic rules
var specificMessage = syntaxDiagnosis.findFirst[ msg| exception.isApplicable(msg, context)]
var specificMessage = syntaxDiagnosis.findFirst[ msg|
exception !== null && exception.isApplicable(msg, context)
]
if (specificMessage === null && context.currentContext !== null) {
// Last chance to detect rule
specificMessage = changeParserMessage(context.currentContext, exception)
Expand Down Expand Up @@ -139,7 +141,7 @@ class WollokSyntaxErrorMessageProvider extends SyntaxErrorMessageProvider {
}

def dispatch isApplicable(EarlyExitException exception, SpecialMessage msg, IParserErrorContext context) {
exception.token.text.equalsIgnoreCase(msg.token) && msg.condition.apply(context, exception)
exception.token !== null && exception.token.text !== null && exception.token.text.equalsIgnoreCase(msg.token) && msg.condition !== null && msg.condition.apply(context, exception)
}

def dispatch isApplicable(MismatchedTokenException exception, SpecialMessage msg, IParserErrorContext context) {
Expand Down

0 comments on commit 3e65db0

Please sign in to comment.