Search Results

Search found 11178 results on 448 pages for 'syntax checking'.

Page 4/448 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Modifying a gedit syntax highlighting file

    - by Oscar Saleta Reig
    I am trying to change a highlighting file from Gedit. I have modified the file /usr/share/gtksourceview-3.0/language-specs/fortran.lang because I want to change the cases in which the editor takes a statement as a comment. The problem I have is that when I choose the new highlighting scheme nothing highlights, it just remains as plain text. The file fortran.lang was opened with su permissions and I just copy-pasted everything into a new Gedit file and later saved it as fortran_enhanced.lang in the same folder. The changes I've done to the original file are these: Original fortran.lang file: <language id="fortran" _name="Fortran 95" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-fortran</property> <property name="globs">*.f;*.f90;*.f95;*.for</property> <property name="line-comment-start">!</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="intrinsic" _name="Intrinsic function" map-to="def:builtin"/> <style id="boz-literal" _name="BOZ Literal" map-to="def:base-n-integer"/> <style id="decimal" _name="Decimal" map-to="def:decimal"/> <style id="type" _name="Data Type" map-to="def:type"/> </styles> <default-regex-options case-sensitive="false"/> <definitions> <!-- Note: contains an hack to avoid considering ^COMMON a comment --> <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>!|(^[Cc](\b|[^OoAaYy]))</start> <include> <context ref="def:escape"/> <context ref="def:in-line-comment"/> </include> </context> (...) Modified fortran_enhanced.lang file: <!-- Note: changed language id and name --> <language id="fortran_enhanced" _name="Fortran 95 2.0" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-fortran</property> <!-- Note: removed *.f and *.for from file extensions --> <property name="globs">*.f90;*.f95;</property> <property name="line-comment-start">!</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="intrinsic" _name="Intrinsic function" map-to="def:builtin"/> <style id="boz-literal" _name="BOZ Literal" map-to="def:base-n-integer"/> <style id="decimal" _name="Decimal" map-to="def:decimal"/> <style id="type" _name="Data Type" map-to="def:type"/> </styles> <default-regex-options case-sensitive="false"/> <definitions> <!-- Note: I want comments only beginning with !, not C --> <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>!</start> <include> <context ref="def:escape"/> <context ref="def:in-line-comment"/> </include> </context> (...) I have read this question [ Custom gedit Syntax Highlighting for Dummies? ] and I tried to make the new fortran_enhanced.lang file readable with $ cd /usr/share/gtksourceview-3.0/language-specs $ sudo chmod 0644 fortran_enhanced.lang but it doesn't seem that made some difference. I have to say that I have never done a thing like this before and I don't even understand most of the language file, so I am open to every criticism, as I have been guided purely by intuition. Thank you in advanced!

    Read the article

  • Running SQL script through psql gives syntax errors that don't occur in PgAdmin

    - by Peter
    Hi I have the following script to create a table: -- Create State table. DROP TABLE IF EXISTS "State" CASCADE; CREATE TABLE "State" ( StateID SERIAL PRIMARY KEY NOT NULL, StateName VARCHAR(50) ); It runs fine in the query tool of PgAdmin. But when I try to run it from the command line using psql: psql -U postgres -d dbname -f 00101-CreateStateTable.sql I get a syntax error as shown below. 2: ERROR: syntax error at or near "" LINE 1: ^ psql:00101-CreateStateTable.sql:6: NOTICE: CREATE TABLE will create implicit sequence "State_stateid_seq" for serial column "State.stateid" psql:00101-CreateStateTable.sql:6: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "State_pkey" for table "State" CREATE TABLE Why do I get a syntax error using psql and not with PGAdmin? Kind regards Peter

    Read the article

  • FreeRTOS, Eclipse IDE, and Syntax Errors

    - by MSumulong
    I have a slight annoyance when dealing with FreeRTOS code in Eclipse and I'm not sure if it's just me or if other people have this issue too but I see a lot of syntax errors highlighted in my code but it compiles/executes fine. The syntax errors seem to be caused by FreeRTOS specific code like: signed portCHAR *x; or vSemaphoreCreateBinary (semaphore); or signed portBASE_TYPE gpsTaskStart (void) { return xTaskCreate (vGPSTask, (const signed portCHAR * const) "GPS", configMINIMAL_STACK_SIZE, NULL, (tskIDLE_PRIORITY + 1), &taskHandles [TASKHANDLE_GPS]); } I was wondering if there was a way to configure Eclipse to parse this syntax properly.

    Read the article

  • Symfony2 Syntax Errors (in vendor files)

    - by user1665246
    To maintain code integrity across our servers we'd like to keep the /vendor/* directory under source control, rather than use composer to download files each time we roll out onto another server - i.e. we can be certain that the /vendor/* files are identical. We run a syntax checker against all files committed to source control and run across the following error: File '/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php' failed the PHP syntax check with the following error: PHP Parse error: syntax error, unexpected '}', expecting T_NS_SEPARATOR in /vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php on line 3 Is the "error" in this file intentional ? Any help appreciated. File contents below: <?php namespace {{ namespace }}; use Symfony\Component\HttpKernel\Bundle\Bundle; class {{ bundle }} extends Bundle { }

    Read the article

  • Universal syntax file format?

    - by Isaiah
    Hey as a project to improve my programing skills I've begun programing a nice code editor in python to teach myself project management, version control, and gui programming. I was wanting to utilize syntax files made for other programs so I could have a large collection already. I was wondering if there was any kind of universal syntax file format much in the same sense as .odt files. I heard of one once in a forum, it had a website, but I can't remember it now. If not I may just try to use gedit syntax files or geany. thanks

    Read the article

  • Getting mysql syntax error and cant find source

    - by eGGzy
    I have function that updates log table. function wslog($userID, $log, $where) { safe_query("INSERT INTO ".PREFIX."log ( time, userID, log, where ) values( '".time()."', '".$userID."', '".$log."', '".$where."' ) "); } And I have this php code: wslog($userID, 'server|'.mysql_insert_id().'', 'servers'); But I keep getting syntax error: Query failed: errorno=1064 error=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where ) values( '1269208030', '1', 'server|14', 'servers' )' at line 1 query=INSERT INTO ws_DII_log ( time, userID, log, where ) values( '1269208030', '1', 'server|14', 'servers' )

    Read the article

  • Syntax for find on Mac OS X

    - by hekevintran
    I have a project directory that contains source code and subdirectories of source code. I want to use the Unix program find to search recursively for the names of files of certain extensions. The versions of find on Linux and Mac OS X behave differently. # Works in Linux find . -type f -regex ".*\.\(py\|html\)$" # Neither of these works in Mac OS X find . -type f -regex ".*\.\(py\|html\)$" find . -type f -regex ".*\.(py|html)$" How do I write this command so that it will run on Mac OS X (and hopefully on Linux too)?

    Read the article

  • How to interpret the bash command "usage" syntax?

    - by raoulsson
    How exactly do you have to interpret the output of a commands "usage" output, in bash for example. For example, on my OS X, cp gives me usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory What does the nested options, like -H within -R, indicate? Does upper and lower case have any meaning? When is an argument optional, required? I need to implement a telnet command line against a program of mine and I would like to get this straight.

    Read the article

  • Making custom syntax highlighting in TextMate

    - by Andrei
    Hi, I am trying to highlight custom language in TextMate. However, the following definition does not highlight PHP insertions: { scopeName = 'source.serpent'; fileTypes = ( 'serpent' ); patterns = ( { begin = '<\?'; end = '\?>'; patterns = ( { include = 'source.php'; } ); }, ); } What can be the reason?

    Read the article

  • Beyond Syntax Highlighting - What other code representations are possible today?

    - by Mathieu Hélie
    Despite GUI applications having been around for 30ish years, software is still written as lines of text instructions, for various valid reasons. But we've also found that manipulating these text instructions is mind-blowingly difficult unless we apply a layer of coloring on different words to represent their syntax, thus allowing us to quickly parse through these text files without having to read the whole words. But besides the Sublime Text minimap feature, I've yet to see any innovation in visual representation of code since colors came around on CRT monitors. I can think of one obviously essential representation that modern graphics technology allows: visual hierarchies for nested structures. If we make nested text slightly smaller than its outer context, and zoom on it when the cursor is focused on the line, then we will be able to browse huge files of nested statements very quickly. This becomes even more essential as languages based on closures and anonymous functions become filled with deep statements. Has anyone attempted to implement this in a text editor? Do you know of any otherwise useful improvements in representing code text graphically?

    Read the article

  • Why isn't functional language syntax more close to human language?

    - by JohnDoDo
    I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it... I have one curiosity though, why is the syntax so cryptic (in lack of another word)? Is there a reason why it isn't more expressive, more close to human language? I understand that FP is good at modelling mathematical concepts and it borrowed some of it's concise means of expression, but still it's not math... it's a language.

    Read the article

  • Transform XAML syntax from Shorthand to full syntax

    - by Emad
    Is there a tool or a simple way to transform XAML code from the shorthand syntax to the full syntax? For example: moving from something like: <_TextBox Text="{Binding Path=Formula.Production, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" to <_TextBox <_TextBox.Text <Binding Path="Formula.NumCloses" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" </Binding </TextBox.Text </TextBox ? Thanks

    Read the article

  • Better C# Syntax Coloring for Visual Studio 2010?

    - by Oak
    Coming from Eclipse, I'm disappointed with the very limited syntax coloring capabilities offered for C# by Visual Studio (all versions, up to 2010). In particular, I'm interesting in distinct coloring for methods / fields / locals / static stuff. I'm aware Visual Assist can enhance the coloring, but I've failed to find any free alternative capable of doing that, so I'm turning to SO (I hope it's programming-related enough). Is there any free (or at least cheaper than Visual Assist) solution capable of enhancing the syntax coloring for C#?

    Read the article

  • Problem with list slice syntax in python

    - by Dingle
    The extended indexing syntax is mentioned in python's doc. slice([start], stop[, step]) Slice objects are also generated when extended indexing syntax is used. For example: a[start:stop:step] or a[start:stop, i]. See itertools.islice() for an alternate version that returns an iterator. a[start:stop:step] works as described. But what about the second one? How is it used?

    Read the article

  • "OR" Operator must be placed at end of previous line? (unexpected tOROP)

    - by akonsu
    I am running Ruby 1.9. This is a valid syntax: items = (data['DELETE'] || data['delete'] || data['GET'] || data['get'] || data['POST'] || data['post']) But this gives me an error: items = (data['DELETE'] || data['delete'] || data['GET'] || data['get'] || data['POST'] || data['post']) t.rb:8: syntax error, unexpected tOROP, expecting ')' || data['GET'] || data['get'] |... ^ Why?!

    Read the article

  • What is the Microsoft Query Syntax for Subqueries?

    - by Kuyenda
    I am trying to do a simple subquery join in Microsoft Query, but I cannot figure out the syntax. I also cannot find any documentation for the syntax. How would I write the following query in Microsoft Query? SELECT * FROM ( SELECT Col1, Col2 FROM `C:\Book1.xlsx`.`Sheet1$` ) AS a JOIN ( SELECT Col1, Col3 FROM `C:\Book1.xlsx`.`Sheet1$` ) AS b ON a.Col1 = b.Col1 Is there official documentation for Microsoft Query? Thanks!

    Read the article

  • Java syntax of +

    - by Pindatjuh
    Why is the following syntax correct: x = y+++y; (Where it means y++ + y or y + ++y which both mean y * 2 + 1) But this is not valid syntax: x = y+++++y; (Which should mean y++ + ++y, which must mean y and increase y and then add ++y which increases y thus y * 2 + 2) Is there a reason for this?

    Read the article

  • How to use vim's syntax files in emacs to color the text

    - by Vijayender
    Are there any snippets to make emacs use the .vim syntax files found in /usr/share/vim/vimfiles/ for coloring text. Many applications like conky have the vim syntax files like "conkyrc.vim" for vim but not for emacs. So is there an easy way to use those files rather than rewriting a new language-mode for each of those available in vimfiles directory.

    Read the article

  • Should the syntax for disabling code differ from that of normal comments?

    - by deltreme
    For several reasons during development I sometimes comment out code. As I am chaotic and sometimes in a hurry, some of these make it to source control. I also use comments to clarify blocks of code. For instance: MyClass MyFunction() { (...) // return null; // TODO: dummy for now return obj; } Even though it "works" and alot of people do it this way, it annoys me that you cannot automatically distinguish commented-out code from "real" comments that clarify code: it adds noise when trying to read code you cannot search for commented-out code for for instance an on-commit hook in source control. Some languages support multiple single-line comment styles - for instance in PHP you can either use // or # for a single-line comment - and developers can agree on using one of these for commented-out code: # return null; // TODO: dummy for now return obj; Other languages - like C# which I am using today - have one style for single-line comments (right? I wish I was wrong). I have also seen examples of "commenting-out" code using compiler directives, which is great for large blocks of code, but a bit overkill for single lines as two new lines are required for the directive: #if compile_commented_out return null; // TODO: dummy for now #endif return obj; So as commenting-out code happens in every(?) language, shouldn't "disabled code" get its own syntax in language specifications? Are the pro's (separation of comments / disabled code, editors / source control acting on them) good enough and the cons ("shouldn't do commenting-out anyway", not a functional part of a language, potential IDE lag (thanks Thomas)) worth sacrificing? Edit I realise the example I used is silly; the dummy code could easily be removed as it is replaced by the actual code.

    Read the article

  • using an alternative string quotation syntax in python

    - by Cawas
    Just wondering... I find using escape characters too distracting. I'd rather do something like this: print ^'Let's begin and end with sets of unlikely 2 chars and bingo!'^ Let's begin and end with sets of unlikely 2 chars and bingo! Note the ' inside the string, and how this syntax would have no issue with it, or whatever else inside for basically all cases. Too bad markdown can't properly colorize it (yet), so I decided to <pre> it. Sure, the ^ could be any other char, I'm not sure what would look/work better. That sounds good enough to me, tho. Probably some other language already have a similar solution. And, just maybe, Python already have such a feature and I overlooked it. I hope this is the case. But if it isn't, would it be too hard to, somehow, change Python's interpreter and be able to select an arbitrary (or even standardized) syntax for notating the strings? I realize there are many ways to change statements and the whole syntax in general by using pre-compilators, but this is far more specific. And going any of those routes is what I call "too hard". I'm not really needing to do this so, again, I'm just wondering.

    Read the article

  • PHP Object Access Syntax Question with the $

    - by ImperialLion
    I've been having trouble searching for this answer because I am not quite sure how to phrase it. I am new to PHP and still getting my feet on the ground. I was writing a page with a class in it that had the property name. When I originally wrote the page there was no class so I just had a variable called $name. When I went to encapsulate it in a class I accidental changed it to be $myClass->$name. It tool me a while to realize that the syntax I needed was $myClass->name. The reason it took so long was the error I kept getting was "Attempt to access a null property" or something along those lines. The error lead me to believe it was a data population error. My question is does $myClass->$name have a valid meaning? In other words is there a time you would use this and a reason why it doesn't create a syntax error? If so what is the semantic meaning of that code? When would I use it if it is valid? If its not valid, is there a reason that it doesn't create a syntax error?

    Read the article

  • Absence of property syntax in Java

    - by Vojislav Stojkovic
    C# has syntax for declaring and using properties. For example, one can declare a simple property, like this: public int Size { get; set; } One can also put a bit of logic into the property, like this: public string SizeHex { get { return String.Format("{0:X}", Size); } set { Size = int.Parse(value, NumberStyles.HexNumber); } } Regardless of whether it has logic or not, a property is used in the same way as a field: int fileSize = myFile.Size; I'm no stranger to either Java or C# -- I've used both quite a lot and I've always missed having property syntax in Java. I've read in this question that "it's highly unlikely that property support will be added in Java 7 or perhaps ever", but frankly I find it too much work to dig around in discussions, forums, blogs, comments and JSRs to find out why. So my question is: can anyone sum up why Java isn't likely to get property syntax? Is it because it's not deemed important enough when compared to other possible improvements? Are there technical (e.g. JVM-related) limitations? Is it a matter of politics? (e.g. "I've been coding in Java for 50 years now and I say we don't need no steenkin' properties!") Is it a case of bikeshedding?

    Read the article

  • Using runtime checking of code contracts in Visual Studio 2010

    - by DigiMortal
    In my last posting about code contracts I introduced how to check input parameters of randomizer using static contracts checking. But you can also compile code contracts to your assemblies and use them also in runtime. In this posting I will show you simple example about runtime checking of code contracts. NB! If you want to play with code and try out things described here feel free to download example solution. if you are speaker and want to use this solution as a part of your sessions then feel free to do so, but don’t forget to refer me and this blog as source of this solution. And please let me know about your session. As a speaker I am very interested about it. :) To see how code contracts are checked at runtime we have to enable runtime checking from project properties. Make sure you have checked the box “Perform Runtime Contract Checking” and make sure you select “Full” from dropdown. These parts are in red box on the screenshot below. Visual Studio 2010 settings for code contracts. Runtime Checking is turned on and checks are made only in public surface. Click on image to see it at original size.  Save project settings. Then compile code and run it. As soon as code execution hits the call to GetRandomFromRangeContracted() exception is thrown. If you are not currently playing with solution referred above take a look at the following screenshot. Visual Studio 2010 runtime checking of code contracts. Exception of type ContractException is thrown when contract is violated. Click on image to see it at original size.  The exact type of exception is ContractException and it is defined in System.Diagnostics.Contracts.__ContractsRuntime namespace. In our example the message of exception is following: "Precondition failed: min < max  Min must be less than max" Besides the description we inserted for the case contract violation the message also contains violated contract type. In this case the type of contract is Precondition. Conclusion Using runtime checking of code contracts enables you to take code contracts with your code and have them checked every time when your methods are called. This way you can assure that all conditions are met to run method or exception is thrown and calling system has to handle the situation.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >