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
Add Turing support #710
Add Turing support #710
Conversation
Does anything else need to be done for this to get merged? @gfx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I'm trying to help triage pull requests for Rouge so we can work down the backlog. Can you please have a look at the feedback?
rule %r(%.*?$), Comment::Single | ||
rule %r(/\*.*?\*/)m, Comment::Multiline | ||
|
||
rule /(?:#{constants.join('|')})\b/, Keyword::Constant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see how this is done in other lexers, with a Set constructed separately, combined with a single rule and set lookups. This is done because Rouge matches each regex in turn, so reducing the number of regex matches is preferable so that a string can be excluded quickly. E.g. search for "rule id" in the C lexer.
@@ -0,0 +1,14 @@ | |||
# -*- coding: utf-8 -*- # | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add '# frozen_string_literal: true'
@@ -0,0 +1,38 @@ | |||
var myStr : string := "hello" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please trim this down a bit. It's meant to be a small visual demo of what the lexer does, not of the language per se, for use e.g. on http://rouge.jneen.net/ - Most are 10-25 lines or so.
@@ -0,0 +1,164 @@ | |||
# -*- coding: utf-8 -*- # | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add '# frozen_string_literal: true'
Thanks for the feedback, I thought this was never going to get merged. I'm a lot busier now than I was when I made this pull request, but I'll try and implement your requested changes in the next several weeks/couple months, whenever I have time (hopefully sooner rather than later). |
I no longer have time to work on this, and don't think it's needed anymore as a lot of schools here in Ontario have been moving away from Turing in the past few years and they were the only organizations still using it. If nobody else wants to take on this pull request, feel free to close it @vidarh . |
Turing is an educational language. While not very popular, it is used in many high schools in Ontario, Canada.