Skip to content

Commit

Permalink
Correct grammar for colorizing class factories on the web.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbracha committed Apr 21, 2019
1 parent 3d080e8 commit 7f340dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions NewspeakGrammar.ns
Expand Up @@ -240,9 +240,9 @@ AS YET UNTESTED.

classReservedWord = tokenFromSymbol: #class.

className = identifier.
classId = identifier.

classPrefix = classReservedWord, className, optionalFactorySection, superclassClause opt.
classPrefix = classReservedWord, classId, optionalFactorySection, superclassClause opt.

mixinApplication = classPrefix, inverseMixinOperator, sendExpression.

Expand All @@ -260,10 +260,10 @@ AS YET UNTESTED.
(tokenFromSymbol: #super).

public classHeader =
(accessModifier opt, classReservedWord, className, messagePattern, equalSign,
(accessModifier opt, classReservedWord, classId, messagePattern, equalSign,
superclassClause opt, lparen, classComment opt,
slotDecls opt, initExprs, rparen) |
(accessModifier opt, classReservedWord, className, empty, equalSign,
(accessModifier opt, classReservedWord, classId, empty, equalSign,
superclassClause opt, lparen, classComment opt,
slotDecls opt, initExprs, rparen).
(* A gross hack to allow for a default constructor pattern. This should at least be refactored (note the awful use of empty to keep the arity the same for the wrappearr in the parser. Ugh).
Expand All @@ -288,8 +288,8 @@ It would be nice to just say messagePattern opt]. Alas, because the '|' operator
inheritanceListAndOrBody = defaultSuperclassAndBody | explicitInheritanceListAndOrBody.
public classDecl =
(accessModifier opt, classReservedWord, className, messagePattern, equalSign, inheritanceListAndOrBody) |
(accessModifier opt, classReservedWord, className, empty, equalSign, inheritanceListAndOrBody).
(accessModifier opt, classReservedWord, classId, messagePattern, equalSign, inheritanceListAndOrBody) |
(accessModifier opt, classReservedWord, classId, empty, equalSign, inheritanceListAndOrBody).
toplevelClass = classCategory, classDecl.
compilationUnit = languageId, toplevelClass, eoi.
Expand Down

0 comments on commit 7f340dd

Please sign in to comment.