Skip to content

C# Scanner #54

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

Open
nathany opened this issue Oct 27, 2012 · 11 comments
Open

C# Scanner #54

nathany opened this issue Oct 27, 2012 · 11 comments
Labels
Milestone

Comments

@nathany
Copy link
Contributor

nathany commented Oct 27, 2012

Someone has written a start to c# support here: http://www.redmine.org/boards/3/topics/11616 - Joshua Galvez


Thanks Joshua! The C# scanner Joshua mentioned was created and posted by me.

For I don't have enough knowledge on Ruby, I only made small modifications on the Java scanner carefully to make it work with C#.

Because I don't know how to set up a standalone environment for developing for the latest version Coderay, I just worked in the Redmine environment. As a result, I could only use an old version of the Java scanner to start with, but not the latest version.

The version of Coderay in Redmine current trunk is now 0.7.6.227, quite an old version, lacking of quite a lot of new features.

  • percy li

From Redmine: http://odd-eyed-code.org/issues/78

@sloncho
Copy link

sloncho commented Jan 21, 2013

I have tried this scanner, and it works ok, but unfortunately it breaks with a simple case:

public void TestCode()
{
   Console.WriteLine("breaks here");
}
It produces this error:
***ERROR in scanner.rb:200:in `tokenize': Unknown token content type: :open, kind = :string (after 0 tokens)
tokens:
current line: 3  column: 23  pos: 47
matched: "\""  state: "Error in CodeRay::Scanners::CSharp#scan_tokens, initial state was: nil"
bol? = false,  eos? = false
surrounding code:
"ode()\n{\n   Console.WriteLine(\""  ~~  "breaks here\");\n}\n"
***ERROR***

Unfortunately, I'm not a Ruby dev, so I could not really locate the problem. Any help will be highly appreciated.

@korny
Copy link
Member

korny commented Jan 21, 2013

So, a bug report for a pull request ^^ Does Joshua Galvez have a GitHub account so we can inform him?

@sloncho
Copy link

sloncho commented Jan 21, 2013

Hmmm, I just read the "current" java scanner. It's a lot different than this old code. I guess it'll need a total rewrite in order to be used with the current coderay.

@korny
Copy link
Member

korny commented Jan 21, 2013

You're right, the error does seem to result from incompatiblity.

@sloncho
Copy link

sloncho commented Jan 21, 2013

As I'm not ruby dev, but have very good knowledge of c#, how can I help modifying the existing java scanner to create a new c# one?

@emperor-ming
Copy link

Ey, dudes! It will be great to have a scanner of C# (we use it intensively in Redmine environment).
Thanks for trying sloncho!

@thegcat
Copy link

thegcat commented Jul 4, 2013

There's a scanner for C# attached to http://www.redmine.org/boards/3/topics/11616#message-37780 that should work with Coderay 1.0.x, I haven't tried it though.

@ganaware
Copy link

I have wrote another C# scanner: #186

@matee911
Copy link

👍

@emperador-ming
Copy link

Great news!

@ganaware
Copy link

There are some bugs, so I withdraw this request #186 .

I'm now fixing bugs in https://github.com/ganaware/coderay/tree/csharp-scanner ,
and testing in https://github.com/ganaware/coderay-scanner-tests/tree/csharp-scanner .

Please try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants