是否有适用于无括号 C# 的 IDE 或 Visual Studio/Mono/SharpDevelop 插件?

发布于 2024-07-13 19:54:19 字数 153 浏览 13 评论 0原文

当我看到这篇文章关于使用类似Python的sintax(基于缩进,没有花括号,语法)对于C#,我开始想:我可以有一个解析和编译它的IDE吗?

When I saw this article about using a python-like sintax (indentation based, without curly braces, syntax) for C#, I begun to wonder: can I have an IDE that parses and compiles it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情归归情 2024-07-20 19:54:19

Iron Python 怎么样? 它是 dotnet 的 python。

您还可以查看 Delphi Prism(作为 Visual Studio 的插件运行),如果您不喜欢带牙套。 它可以做 C# 能做的一切,还有一些额外的事情。

What about Iron Python? It's python for dotnet.

You can also check out Delphi Prism (runs as a plugin for Visual Studio) if you don't like braces. It can do everything that C# does, plus a few extra things.

与往事干杯 2024-07-20 19:54:19

:我可以有一个可以解析和编译它的 IDE 吗?

首先,有点迂腐。 IDE既不解析也不编译。

我建议使用 Iron Python 或 Delphi Prism (正如 Wouter 建议的更快)或者这样:
你使用Notepad++作为IDE,编写一个小工具,在代码编译之前根据意图自动添加括号。 我认为这可以在一个代码“搜索和替换遍历”中完成:

例如:

if true
   for each a in b
       foo();
 foo();

代码简单地扫描每一行并添加一个左括号,如果:当前行中的代码比前一行中的代码更进一步:

if true
   {for each a in b
       {foo();
 foo();

并且只要下一行的代码不如当前行的代码,就添加一个右括号。 - 存储压痕深度(我推荐基于堆栈的系统)!

if true
   {for each a in b
       {foo();}
   }
 foo();

等等...命名空间和“使用”的问题也可以这样解决。

: can I have an IDE that parses and compiles it?

First off, a bit of pedantry. An IDE neither parses nor compiles.

I would either suggest to use Iron Python or Delphi Prism (as Wouter suggested faster) or what about this:
You use Notepad++ as an IDE and write a small tool that automatically adds the brackets based on the intention before the code is compiled. I think that this can be done within one code "search and replace traversal":

For example:

if true
   for each a in b
       foo();
 foo();

The code simply scans each line and adds an opening bracket if: The code in the currentline is further intended than the code in the previous line:

if true
   {for each a in b
       {foo();
 foo();

And adds a closing bracket wherever the code of the next line is less intended than in the current line. - Store the indentation depth (I would recommend a stackbased system)!

if true
   {for each a in b
       {foo();}
   }
 foo();

And so on... The problems with Namespaces and "Using" can also be solved that way.

谈下烟灰 2024-07-20 19:54:19

抱歉回复延迟。 我发布了一篇文章 这里讨论结构化编辑器。 不幸的是,它仍处于早期原型阶段,但可以让您了解如何构建这样的编辑器。 我还在此处发布了源代码和二进制文件。

如果您有任何疑问,请告诉我。

sorry for the delayed reply. I posted an article here that talks about structured editors. Unfortunately it's still in early prototype stages, but can give you an idea of how to build such an editor. I've also published the sources and binaries here.

Let me know if you have any questions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文