Comments (5)
Could you please advise whether we need to change the grammar files
The comments in the parser.nim
file starting with #|
are turned into the grammar documentation file when executing the parser file as the main module, i.e. nim r compiler/parser.nim
. So to change the wrong line in the grammar, one would change the comment in this line:
Line 2208 in 9648d97
to say ('var' | 'out' | 'ptr' | 'ref' | 'static' | 'type')
, then run nim r compiler/parser.nim
.
A separate issue exists where this line:
Line 2192 in 9648d97
needs to be split into of tkVar: nkVarTy
and of tkOut: nkOutTy
(nkOutTy
is new).
from nim.
well, the grammar, parser and AST for concepts is .. experimental as a whole at best - its indentation rules generally deviate from the language, keywords such as type
are used in an irregular way compared to the rest of the language etc.
I think there are deeper questions to resolve than this grammar quirk before venturing further.
from nim.
Also the concept parameter out x
seems to parse the same as var x
(this line predates the new out type):
Line 2192 in 9648d97
from nim.
I'd like to try to solve this issue. But as I can see from the codebase, other symbols other than var
& out
are also supported, e.g., ptr
, ref
, static
, type
.
But I can see from this link (https://nim-lang.org/docs/manual_experimental.html#concepts):
You can apply any of the standard type modifiers such as var, ref, ptr and static to denote a more specific type of instance
It seems that those symbols are supported as described in the doc listed above, just the grammar files need to be updated.
Could you please advise whether we need to change the grammar files (to add more symbols like ptr
, ref
, static
, type
. IMHO, this is more feasible),
or to change the codebase(to remove support of ptr
, ref
, static
, type
)?
from nim.
from nim.
Related Issues (20)
- osproc.startProcess should support "not following symlinks" HOT 2
- When `move` meets` sink`, `= sink` hook function is not called HOT 4
- [ignore] bisect HOT 7
- Error: type mismatch: got <typedesc[A]>, but expected one of: A = proc (){.closure.}
- Default object values silently override generic types
- Enum Overloading Regression? HOT 4
- async `and` swallows errors
- Async `finally` swallows errors when it contains an `await` wrapped by `try/except`
- The `when nimvm` statement fails to compile when in a file called nimvm.nim HOT 4
- Regression from 2.0 to `devel` with `dirty` template HOT 3
- Async memory leak when raising exception on ORC HOT 1
- unicode.splitWhitespace() and strutils.splitWhitespace() have different results for ASCII string
- Wrong stack trace when exception is raised in template HOT 1
- Error: cannot evaluate at compile time: foo HOT 4
- nim check crashes
- Any differnece between value types and reference types for `=sink` ? HOT 1
- Simple destructor code gives invalid C HOT 4
- Compiler crashes with infinite recursion for nested generic instantiation with static[int]
- The stdout.write doesn't print to terminal until new line symbol is sent HOT 3
- Gc_ref(x: string) and Gc_ref[T](x: seq[T]) doesn't exists anymore ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nim.