Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of syntax highlighting #13

Closed
wants to merge 2 commits into from

Conversation

flongo
Copy link
Collaborator

@flongo flongo commented Dec 18, 2013

The first commit introduces a new package (poc.highlight) that handles syntax highlighting for templates.

  • Document partitioner:
    A change was necessary in order to have all the document parsed again on source update.
  • Source viewer configuration:
    The new scanner had to be provided to the DefaultDamagerRepairer
  • Highlight:
    canners, rules and tokens have been added

The second commit introduces a fix to the error that was raised as soon as a newly created file was edited.

  • Document partitioner:
    The typed region was not correctly initialized

@ghost ghost assigned flongo Jan 6, 2014
## Rules

Rules are provided by the singleton [`POCRulesStore.java`](./POCRulesStore.java). There are a set of rules that can be retrieved. In particular, two predefined sets of rules is available:
* the default rules to parse the whole document,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please insert a blank line before, because it seems that only GitHub's Markdown parser treats it as a list. You need to write something like this:

List: 

* item 1
* item 2

Also, please remove the trailing comma and period at the end of each item, this is the role of a list to separate items, not the punctuation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that. Bulleted lists and punctuation are quite controversial, but I'll follow your suggestion

@ymeine
Copy link
Contributor

ymeine commented Jan 6, 2014

Don't prefix file names with POC: we'd like to remove that (please see #6 for more information), so let's start right now instead of introducing ineluctable future file renames in log history.

public IToken evaluate(ICharacterScanner initialScanner) {
super.evaluate(initialScanner);

this.read(8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put the string "function" in a static String constant, and read its length here (and use it for the comparison below).

(In general it's good to reduce constants dependencies, if it doesn't cost for performances here...)

flongo added 2 commits January 8, 2014 10:21
This commit introduces a new package (poc.highlight) that handles syntax highlighting for templates.

* Document partitioner
A change was necessary in order to have all the document parsed again on source update.

* Source viewer configuration
The new scanner had to be provided to the DefaultDamagerRepairer

* Highlight
Scanners, rules and tokens have been added
The region property was not correctly initialized in the constructor of the document partitioner.
@flongo
Copy link
Collaborator Author

flongo commented Jan 8, 2014

Integrated with fd2bd0f and cd2d04e

@flongo flongo closed this Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants