summary refs log tree commit diff stats
path: root/compiler/parser.nim
Commit message (Collapse)AuthorAgeFilesLines
* Parser: Inline expr pragmas with parenthesisAdam Strzelecki2015-06-021-0/+4
| | | | | | | | | | | Previously pragmas could be attached only to whole statements, this change allows attaching pragmas to inline statements, eg.: template rewriteAdd{a + b}(a: expr, b: expr): expr = ({.noRewrite.}: a + b) + 1 Code above will cause a + b to be rewritten once, because rewriteAdd attaches {.noRewrite.} to resulting a + b expr.
* Parser: Properly represent parsePar in grammarAdam Strzelecki2015-06-021-4/+6
|
* fixes #2533Araq2015-04-241-1/+1
|
* Merge pull request #2566 from nanoant/parser-diagnostic-locationAndreas Rumpf2015-04-241-3/+3
|\ | | | | Parser: Fix location (line, col) for diagnostics
| * Parser: Fix location (line, col) for diagnosticsAdam Strzelecki2015-04-211-3/+3
| | | | | | | | | | | | | | | | | | | | Previously parser was using lexMessage which was taking location from current buffer position which was pointing after recently consumed token. But since parser shows diagnostics about that token it should point to the location where token starts. This makes diagnostics like: `test.nim(2, 2) Error: ':' expected` point properly at the beginning of the wrong token.
* | Parser: Make exprList() not comsume endTokenAdam Strzelecki2015-04-201-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes use single comcol or eat for multiple cases. Also this makes exprList responsible for consuming only list of expressions, nothing else which is more logical. As a side-effect compiler is now more consistent about errors, eg.: try # <- missing something echo "try" finally: echo "finally" Triggers: test.nim(2, 6) Error: ':' expected try: echo "try" finally # <- missing something echo "finally" Previously triggered: test.nim(4, 6) Error: invalid indentation But now we got: Error: ':' expected - same as in 1st case
* | Parser: Use colcom(...) when possibleAdam Strzelecki2015-04-201-8/+4
|/ | | | This make parsing obligatory colon more consistent across the parser's code.
* Merge branch 'devel' of https://github.com/Araq/Nim into develAraq2015-04-201-1/+2
|\
| * Merge pull request #2503 from ReneSac/arrowLikeAndreas Rumpf2015-04-151-1/+2
| |\ | | | | | | Restrict arrow-like operators to those ending with `->`, `~>` or `=>`
| | * Minor fixes for arrow like change patchReneSac2015-04-111-2/+2
| | | | | | | | | | | | | | | | | | Don't use ^ operator yet for compatibility with older compilers. Moved arrow like explanation, and fix precedence description on the text in the manual. Fixed typo in news.
| | * Changing the rule for arrow like operators again.ReneSac2015-04-101-1/+1
| | |
| | * Restrict arrow-like operators to start with - or =ReneSac2015-04-091-1/+2
| | |
* | | parse 'of' branches for macros properlyAraq2015-04-191-2/+9
|/ /
* / minor lexer cleanups; fixes #2504Araq2015-04-101-1/+1
|/
* Refactored getPrecedence() after last changeReneSac2015-04-081-11/+11
| | | | The considerStrongSpaces() is now applied to almost all results, so it is better to do it at the end.
* Consider #!strongSpaces for keyword operators too.ReneSac2015-04-081-4/+5
| | | | | When #!strongSpaces is on, every operator affected by it gains priority higher than any operator not affected by it. This includes comparison operators, addition, etc. It seems that counting spaces for keywords operators don't break anything in the parser. Of course, they can't have 0 spaces between their operands, but at least their precedence will work accordingly to their 1+ spaces.
* preparations for dealing with the 'echo $foo' gotchaAraq2015-03-271-3/+9
|
* fixes #2405Araq2015-03-251-2/+4
|
* breaking change: 'concept' is now a keyword and used instead of 'generic'Araq2015-03-231-2/+4
|
* fixes long standing parsing issue with command syntaxAraq2015-03-221-15/+26
|
* fixes #1805Araq2015-03-211-201/+185
|
* interpret `tuple` as a class and `tuple[]` as the empty tupleMax Zerzouri2015-03-061-0/+3
| | | | | | | | When the indentation syntax is allowed it is always interpreted as a tuple: type Unit = tuple
* fixes #2123Araq2015-02-141-0/+1
|
* fixes #2073; language spec change: arrow like operators are not right ↵Araq2015-02-081-2/+2
| | | | associative anymore
* nimsuggest improvementsAraq2015-01-301-1/+4
|
* nimsuggest: first versionAraq2015-01-271-6/+11
|
* 'discard' can be used instead of 'nil' for empty case object branchesAraq2015-01-121-3/+3
|
* Happy new year!Guillaume Gelin2015-01-061-1/+1
|
* fixes #1120Araq2014-12-251-2/+6
|
* fixes #1742Araq2014-12-241-1/+1
|
* fixes a small bug concerning semicolons for top level statementsAraq2014-12-231-2/+4
|
* implemented arrow like operatorsAraq2014-12-081-23/+22
|
* implements 'defer'Araq2014-12-041-4/+6
|
* fixes #1473Araq2014-11-121-4/+5
|
* Nimrod renamed to NimAraq2014-08-281-2/+2
|
* renamefestAraq2014-08-231-1/+1
|
* fixes #1161Araq2014-07-011-9/+12
|
* fix tokenizing bugflaviut2014-06-081-8/+13
|
* fix overlooked grammer commentflaviut2014-06-081-0/+1
|
* updated grammer, fixed oversightflaviut2014-06-041-1/+1
|
* fix bug with unexpected tkInvalid,tkEof,tkCommentflaviut2014-06-041-0/+2
|
* Clean up codeflaviut2014-06-031-12/+7
|
* Fix accents in enumsflaviut2014-06-031-3/+5
|
* Generalize accent parsingflaviut2014-06-031-20/+9
|
* Document parser structures and procedures.Clay Sweetser2014-05-251-20/+39
|
* new concurrency model: first steps; shared is not a keyword anymoreAraq2014-04-141-2/+1
|
* implemented 'R ptr T' syntaxAraq2014-04-131-1/+1
|
* fixes #992Araq2014-03-261-0/+2
|
* implements ``distinct with/without X, Y``Zahary Karadjov2014-03-201-16/+28
| | | | | | This still doesn't work quite right, because some common operations like array indexing lay completely outside the scope/symbol lookup system - they are not even magics.
* allow multi-line expressions using the dot operatorZahary Karadjov2014-03-161-6/+10
| | | | | | | | | | | | this enables parsing of expressions like: ``` Nimrod s.items .map(proc (x): auto = x * 2) .filter do (x) -> auto: return x % 2 == 0 .group_by((x) => x.length) ```