tylerlong / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Wiki pages doesn't color AspectJ keywords... #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a new Wiki page, by adding the following AspectJ code snippet... 

{{{
package edu.sfsu.cs.csc867.msales.voctopus.aspect.loggin;

import java.util.logging.Logger;
import java.util.logging.Level;
import org.aspectj.lang.Signature;

/**
 * Aspect responsible for the loggin of the entire application.
 * @author marcello
 * Feb 16, 2008 8:26:02 AM
 */
public aspect VOctopusExecutionLoggin {

    private Logger vologger = Logger.getLogger("tracer");

    private VOctopusExecutionLoggin() {
        this.vologger.setLevel(Level.ALL);
    }

    pointcut aspects() : within(VOctopusExecutionLoggin);

    pointcut vOcotpusPackage() : execution(*
edu.sfsu.cs.csc867.msales.voctopus..public(..)) ||
execution(edu.sfsu.cs.csc867.msales.voctopus..new(..));

    pointcut excludedObjectCalls() : execution(* Logger.*(..));

    pointcut loggableCalls() : vOcotpusPackage() && !aspects() &&
!excludedObjectCalls();

    before() : loggableCalls() {

        if (this.vologger.isLoggable(Level.INFO)) {
            Signature sig = thisJoinPointStaticPart.getSignature();
            this.vologger.logp(Level.INFO,
sig.getDeclaringType().getName(), sig.getName(), "Entering");
        }
    }
}
}}}

What is the expected output? What do you see instead?

The keywords related to AspectJ grammar are not rendered in blue, as it is
for Java keywords... 

What version of the product are you using? On what operating system?

The current version of Google Code... ;)

Keywords in the example:
In this example, the keywords are as follows:

 * pointcut
 * execution
 * before

Live demo at http://code.google.com/p/v-octopus/wiki/VOctopusAspects

Thanks...

Original issue reported on code.google.com by marcello.sales on 28 Feb 2008 at 3:53

GoogleCodeExporter commented 9 years ago
Grammar at http://www.sable.mcgill.ca/~hendren/AspectJ.html

Original comment by mikesamuel@gmail.com on 23 Apr 2008 at 5:46

GoogleCodeExporter commented 9 years ago
Thanks a lot to incorporate that!!!

Original comment by marcello.sales on 23 Apr 2008 at 8:04

GoogleCodeExporter commented 9 years ago
According to the grammar at http://abc.comlab.ox.ac.uk/documents/scanparse.pdf 
the
extra keywords are:
adviceexecution, after, args, around, aspect, before, call, cflow, cflowbelow,
declare, error, execution, get, handler, if, initialization, issingleton, 
parents,
percflow, percflowbelow, pertarget, perthis, pointcut, precedence, 
preinitialization,
privileged, proceed, returning, set, soft, staticinitialization, target, 
warning,
within, withincode

Of those, the reserved keywords are
    ⟨aspectj reserved identifier ⟩ ::= ’aspect’ | ’privileged’ 
    | ’adviceexecution’ | ’args’ | ’call’ | ’cflow’ | ’cflowbelow’ | ’error’ 
    | ’execution’ | ’get’ | ’handler’ | ’initialization’ | ’parents’ 
    | ’precedence’ | ’preinitialization’ | ’returning’ | ’set’ 
    | ’soft’ | ’staticinitialization’ | ’target’ | ’throwing’ 
    | ’warning’ | ’withincode’ 

Both the full set and the reserved set contain words like (call, error, get, 
handler,
set, target, warning) that are likely to be used in C/java programs as 
identifiers.

So I think it would be a bad idea to add these to the C-like language keywords 
set
which is what code-highlighting in wiki content uses since there is no way for 
code
sections in wiki pages to specify the language.

Original comment by mikesamuel@gmail.com on 7 Jan 2009 at 5:11