syntax-checking

Parentheses pairing ({}[]()<>) issue

人走茶凉 提交于 2019-12-20 12:32:59
问题 I want to be able to pair up all parentheses in a string, if they aren't paired then then they get their index number and False. It seems like it is repeating some values over and over, i.e cl == pop[1]. I have tried to see where the problem is but I can't see it no matter how hard I try. So I'm asking if anyone help me to locate the error and maybe even improve my code ;) def check_parentheses(string): pending = 0 brackets = [] '''Checks if parens are paired, otherwise they are bad.'''

Syntax Checking in Java [closed]

若如初见. 提交于 2019-12-17 23:24:53
问题 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 3 years ago . 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

Alternative to system('php -l')?

微笑、不失礼 提交于 2019-12-10 17:14:58
问题 In a project I'm currently working for, we're considering putting system() into php.ini's disable_functions declaration. Now, one meta-module of ours which would ultimately also fall victim to this restriction is syntax-checking files with system("php -l"); calls - prompting me to hunt for alternatives. Turns out there used to be a php_check_syntax() , but not only did that not restrict itself to merely checking syntax and went on to include the file if it was syntactically valid, but it's

JavaScript syntax check in eclipse

隐身守侯 提交于 2019-12-09 17:14:41
问题 I am developing a RIA application with JavaScript in Eclipse. How can I enable JavaScript syntax check in eclipse? 回答1: Both the Web Tools Platform (WTP) and Aptana offer a quite good JavaScript editor with syntax checking. I use the later myself. 回答2: Have you looked at JSEclipse or JavaScript Editor PlugIn for Eclipse? If you are developing using ExtJS you can get even intellisense along with syntax check using spket. 来源: https://stackoverflow.com/questions/2375122/javascript-syntax-check

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

时光毁灭记忆、已成空白 提交于 2019-12-09 04:02:10
问题 This question already has answers here : Closed 8 years ago . 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. 回答1: py_compile — Compile Python source files import py_compile py_compile.compile('my_script.py') 回答2

Is it possible to check PHP file syntax from PHP?

a 夏天 提交于 2019-12-05 01:37:31
I load dynamically PHP class files with autoload. And those files could be missing or corrupted by some reason. Autoload will successfully report missing files so application logic could handle that. But if those files are corrupted, then the whole processing halts with blank screen for the user and "PHP Parse error: syntax error" in error log. Is it possible to check syntax of PHP file from PHP code? I've looked here: http://us.php.net/manual/en/function.php-check-syntax.php - it's deprecated. And exec("php -l $file"); seems to be a wrong way ( http://bugs.php.net/bug.php?id=46339 ) Thoughts?

PHP Syntax Check in Sublime Text Editor

∥☆過路亽.° 提交于 2019-12-04 23:43:30
问题 In Gedit, I can add an External Tool of "php -l" on the current document, and if I have PHP command line installed, it will syntax check the document. Is there a way to do this with Sublime Text Editor? (Note, I have a Mac and it has PHP CLI installed.) I imagine I'll have to paste a code snippet into Sublime plugin, right? 回答1: The action you are referring to is called "linting" and there are a number of plugins for Sublime that lint PHP files. As mentioned by Len_D, PHP Syntax Checker is

PHP Sanity Check

萝らか妹 提交于 2019-12-04 18:15:44
I am looking for applications or methods for performing sanity checks of php code. I hope to to avoid finding out about the coding mistakes the hard way, but instead find them before publishing the website. display_errors = on and similar run-time methods find the problems too late. So far I have found the following ways, which I think are not thorough enough: php_check_syntax() from within php php -l from the command line ioncube php encoder netbeans and eclipse as editors What better way is there to find problems in PHP code early? PHP Code Sniffer can help ensure you're writing code to a

Can't get “Syntastic” vim plugin to work

喜你入骨 提交于 2019-12-04 17:04:26
问题 I've installed Syntastic plugin in vim. I can't get it to work. I've tried :SyntasticEnable but no luck. SyntasticEnable python in my vimrc doesn't work either (in fact, it doesn't even parse the command, an error is shown when I try to add it to my .vimrc : Not an editor command: SyntasticEnable python ). How can I know what's going on? Syntastic isn't showing errors when I call it from vim. Does the first error ( not and editor command in my .vimrc ) indicates something I'm unaware of? I

PHP Syntax Check in Sublime Text Editor

霸气de小男生 提交于 2019-12-03 16:02:17
In Gedit, I can add an External Tool of "php -l" on the current document, and if I have PHP command line installed, it will syntax check the document. Is there a way to do this with Sublime Text Editor? (Note, I have a Mac and it has PHP CLI installed.) I imagine I'll have to paste a code snippet into Sublime plugin, right? MattDMo The action you are referring to is called "linting" and there are a number of plugins for Sublime that lint PHP files. As mentioned by Len_D, PHP Syntax Checker is one, but I'd actually recommend SublimeLinter for Sublime Text 2 instead. (There is a different