Git Product home page Git Product logo

rascal-syntax-highlighting's People

Contributors

davylandman avatar pchaigno avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rascal-syntax-highlighting's Issues

Distinguish between lexical character sets and list literals

Currently all elements between two brackets [] are treated naïvely as lexical character set, which results in issues with highlighting list literals. Particularly, we must ensure that only things between brackets inside lexical or syntax scopes are treated as character sets, and those outside are treated as list literals.

Note that removing the support for lexical character sets ruins the highlighting of the rest of the programs since \" and "/", and other similar characters can appear freely in character set expressions.

Examples of mis-highlighted terms:

// comment 1

n = 1;  // comment 2
l = [1, // comment 3: non highlighted
     2, 
     3];
list[int] n
private MuExp translateStringLiteral(s: (StringLiteral) `<PreStringChars pre> <Expression expression> <StringTail tail>`) {
    preIndent = computeIndent(pre);
    return muBlock( [ muCallPrim3("template_open", translatePreChars(pre), pre@\loc),
    				  *translateExpInStringLiteral(preIndent, expression),
    				  *translateTail(preIndent, tail),
    				  muCallPrim3("template_close", [], tail@\loc)
					]   );
}

Implement syntax highlighting URL literals

Currently, URL literals, e.g. |http://google.com| are not highlighted as they optimally should be.
It is not possible to just use begin: | end: | since operators like || exist and concrete and abstract syntax uses them, so one should be careful in the way they are recognized.

The best approach would be to follow the URL grammar, albeit it's a bit complex since it can contain interpolations as well as having various different parts.

Using Textmate rules for highlighting Rascal code in Asciiidoctor-based documentation?

This is a question rather than an issue.

At the moment we are working on new infrastructure for our Rascal documentation that is based on Asciidoctor (see http://asciidoctor.org). Asciidoctor supports highlighting in various ways (see http://asciidoctor.org/docs/user-manual/#source-code-blocks). Now the question is: can we convert the nice Textmate rules under development by @ahmadsalim to input for any of the supported systems by Asciidoctor:

I would prefer to have less Ruby/Python and more Javascript in the solution we will adopt.

Any thoughts?

Problems with highlighting of regular expression literals and division

I discovered the issue while I was doing something else.
First of all there is a small bug in the grammar which was unnoticed:

Which is that in the regex: rule we should replace

begin: "/(?!/|*)"

with

begin: "/(?!/|\\*)"

Without fixing this issue the Atom highlighter breaks on certain files, but the TM/Sublime highlighter is also wrong.

Fixing this issue brings another issue with regards to division being accidentally seen as regex literals by the highlighter.

[TextMate] treat tag annotations as comments

Most files contain a license header, and a lot of standard functions contain documentation tags.
The body of them should be marked as comments.

@license{
  BSD-2 License
}
module A

@doc{
   Textile markup for the documentation
}
@javaClass{org.rascalmpl.library.X}
public java str doStuff(int x);

they should be marked as comments instead of normal text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.