syntax-checking

Can Visual Studio target earlier C# syntax in addition to earlier .NET framework versions?

不打扰是莪最后的温柔 提交于 2019-12-03 14:27:18
The easy part: Targeting the .NET 2.0 framework in a Visual Studio 2010 project using the dropdown. The hard part: Is it possible to target a specific syntax version - for example var s = "hello world" is valid syntactic sugar in VS2008 and above, but would not compile in VS2005. Can VS2010 be configured to flag this at compile time? This can be done by specifying the language version in the project settings. To set the language version to C# 2.0 do the following Right Click on the project and select "Properties" Go to the "Build" Tab Click the "Advanced" Button Change the "Language Version"

PHP Syntax checking pre-source control

China☆狼群 提交于 2019-12-03 10:32:08
问题 Referring to Is there a static code analyzer [like Lint] for PHP files? -- I am looking at how to assess the content of PHP files before they are committed by developers. Whichever solution(s) are appropriate will be triggered via SVN hooks similar to the answer: Is it possible to check PHP file syntax from PHP? I came across this Automatic Syntax checking of PHP files when checking into SVN which is the angle I'm going for, however ... php -l isn't quite sufficient. For example, given the

Online PHP syntax checker / validator [closed]

巧了我就是萌 提交于 2019-12-03 06:53:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Could someone refer me to an online PHP validator? It would be of much help. Thanks in advance! 回答1: To expand on my comment. You can validate on the command line using php -l [filename] , which does a syntax check only (lint). This will depend on your php.ini error settings, so you can edit you php.ini or set

How can I check (My)SQL statements for syntactical correctness

你离开我真会死。 提交于 2019-12-03 05:03:56
we're currently setting up out integration server and during that process we've set up pre-commit hooks on the SVN so that our developers can't check in files that are syntactically invalid (primarily PHP and XML). We also have a bunch of .sql files (for MySQL) which I'd like to lint as well. Unfortunately, Google didn't turn up anything useful for this task. Any ideas? The commercial version of MySQL Workbench has a syntax checker for MySQL statements, but of course that would only cover the database aspects. See http://mysql.com/products/workbench/ (though I found the factoid in the help

Compile (but do not run) a Python script [duplicate]

人盡茶涼 提交于 2019-12-02 13:54:59
Possible Duplicate: How can I check the syntax of Python script without executing it? How do I compile a Python script without running it? I just want to check the script for syntax errors. I was hoping for a simple command line switch, but I didn't see anything in python --help . I'd like an answer for both Python 2 and Python 3. yurymik py_compile — Compile Python source files import py_compile py_compile.compile('my_script.py') python -m py_compile script.py pafcu You can use pylint to find syntax errors as well as more subtle errors, such as accessing undefined variables in some rarely

Syntax Checking in Java [closed]

妖精的绣舞 提交于 2019-11-28 19:38:50
I am currently working on a program that has an embedded text editor. The users are supposed to type java code in the editor. The code typed into the editor is then made into a string. I just want something that would check for missing parenthesis or a try without a catch, etc. It doesn't need to be compiled. I've looked around quite a bit, but I'm still new to programming and can't implement some of the harder stuff. So to make it shorter: I'm looking for some java package that will analyze code for syntax errors. As of Java 6 you can use JavaCompiler to compile the text and get back

cin.get() not working

淺唱寂寞╮ 提交于 2019-11-27 16:11:17
I wrote this simple program today, but I found that cin.get() refuses to work unless there are 2 of them. Any ideas? #include <iostream> using namespace std; int main(){ int base; while ((base < 2) || (base > 36)){ cout << "Base (2-36):" << endl; cin >> base; } string base_str = "0123456789abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < base; i++){ for (int j = 0; j < base; j++){ for (int k = 0; k < base; k++){ cout << base_str[i] << base_str[j] << base_str[k] << endl; } } } cin.get(); cin.get(); } if i move a cin.get() to before the nested loops, the loops run then pause. if i take one cin

How can I check the syntax of Python script without executing it?

旧时模样 提交于 2019-11-27 02:21:17
I used to use perl -c programfile to check the syntax of a Perl program and then exit without executing it. Is there an equivalent way to do this for a Python script? Mark Johnson You can check the syntax by compiling it: python -m py_compile script.py user225312 You can use these tools: PyChecker Pyflakes Pylint Rosh Oxymoron import sys filename = sys.argv[1] source = open(filename, 'r').read() + '\n' compile(source, filename, 'exec') Save this as checker.py and run python checker.py yourpyfile.py . Perhaps useful online checker PEP8 : http://pep8online.com/ for some reason ( I am a py newbie

cin.get() not working

旧时模样 提交于 2019-11-26 23:37:06
问题 I wrote this simple program today, but I found that cin.get() refuses to work unless there are 2 of them. Any ideas? #include <iostream> using namespace std; int main(){ int base; while ((base < 2) || (base > 36)){ cout << "Base (2-36):" << endl; cin >> base; } string base_str = "0123456789abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < base; i++){ for (int j = 0; j < base; j++){ for (int k = 0; k < base; k++){ cout << base_str[i] << base_str[j] << base_str[k] << endl; } } } cin.get(); cin