Comments (14)
I'm totally guilty of laziness on this one. fredreichbier was implementing namespaced imports in j/ooc, and I did the same in rock, following his tests that he wrote progressively, and I just bailed out on the 'namespaced types' issue, I only did the 'namespaced variables / functions' thingy.
I can fix it pretty easily, but if someone else wanna do it, I suggest you read the 'rock/middle/NamespaceDecl.ooc' class, and how it's used in 'rock/middle/FunctionCall' / 'rock/middle/VariableAccess'
from rock.
Has this been fixed yet?
from rock.
Related to #97
from rock.
Yes, #97 was a duplicate and has been closed
from rock.
Please tell me this has been fixed. If we're missing features j/ooc had.... :(
from rock.
Not been fixed afaict
On Mon, Sep 5, 2011 at 4:48 AM, duckinator <
[email protected]>wrote:
Please tell me this has been fixed. If we're missing features j/ooc had....
:(Reply to this email directly or view it on GitHub:
#46 (comment)
Amos Wenger
Crafting the future of Web Audio at ofmlabs.org
I'm @nddrylliog https://github.com/nddrylliog on GitHub
from rock.
NOOOOOOOOOOOOOOOOOOOOOOOOOOoooooooooooooooooooooooooooooooooooooooooooooooooo dies
from rock.
Sssshh. Nobody knows named imports exist anyway!
from rock.
yajl does!
On Tue, Sep 6, 2011 at 10:49 PM, Friedrich Weber <
[email protected]>wrote:
Sssshh. Nobody knows named imports exist anyway!
Reply to this email directly or view it on GitHub:
#46 (comment)
Amos Wenger
Crafting the future of Web Audio at ofmlabs.org
I'm @nddrylliog https://github.com/nddrylliog on GitHub
from rock.
I'll work on this, possibly this weekend, perhaps earlier if it is easy to do, I will use namespace imports in gooc-gen :P
from rock.
Ok I tried some stuff but it doesn't really work...
These are my changes at the moment:
Nagaqueen
TypeBase = FuncType | (< { tokenPos; core->typeBuffer[0]='\0'; type=NULL;} (CONST_KW -)? ( ( "unsigned" { strcat(core->typeBuffer, "unsigned "); } - | "signed" { strcat(core->typeBuffer, "signed "); } - | "long" &(- ("long" | "double" | "int")) { strcat(core->typeBuffer, "long "); } - | "struct" { strcat(core->typeBuffer, "struct "); } - | "union" { strcat(core->typeBuffer, "union "); } - ) - )* rest:IDENT (type:IDENT)? > { if(!type) { strcat(core->typeBuffer, rest); $$=nq_onTypeNew(core->this, core->typeBuffer); } else { strcat(core->typeBuffer, type); $$=nq_onTypeNew(core->this, core->typeBuffer); $$=nq_onTypeNamespace(core->this, $$, rest); } })
And in AstBuilder.ooc
onTypeNamespace: unmangled(nq_onTypeNamespace) func (type: BaseType, ident: CString) -> Type {
"yay for %s with %s" format(type toString(), ident) println()
token() formatMessage("","","") println()
}
However, there are a couple of issues. This is my test file:
import structs/ArrayList into AL
f: func -> AL ArrayList {
null as AL ArrayList
}
And rock prints:
yay for ArrayList with ArrayList f: func -> AL ArrayList { yay for ArrayList with ArrayList null as AL ArrayList ~~~~~~~~~~~~ yay for toString with toString argc times(|i| result add(argv[i] as CString toString()))
The issues here are that for some reason, the first IDENT in the type rule is getting overwritten by the second IDENT and that there is ambiguity in statements like the last one. How are we supposed to know where the type stops and where the statement continues? I think making the use of parenthesis to access namespace types should be mandatory, as @fredreichbier had suggested in issue #97 a long time ago. This would make parsing easier and would clear out ambiguity as in the last statement.
from rock.
Okay, let's make parenthesis mandatory then.
(Otherwise, here's how it was done in j/ooc: I think it was parsed as a VariableAccess, and the access was resolved at tinkering time, and it was turned into a TypeAccess)
from rock.
Still, if we have for example the casting rule accept a variableaccess, in the last statement wouldn't CString toString() be parsed as a VariableAccess? Anyway, I'll work on the parenthesis for now and if I think of a clever way to make it work without them I will implement it.
from rock.
Closed by #380
from rock.
Related Issues (20)
- pkg-config/CustomPkg flags aren't passed to additionals HOT 2
- Rock cannot find sdk when run from make HOT 2
- Weird behaviour with setters calling associated getter HOT 7
- The way rock constructs class information can lead to data races in seemingly unrelated code HOT 3
- Unexpectedly "good" behaviour from ooc arrays HOT 4
- So, is OOC development still onging? HOT 5
- Rock aborts with interfaces HOT 1
- Problems making after cloning repo HOT 4
- Problem installing: GC_jmp_buf multiple definition HOT 2
- The top 5 bugs? HOT 3
- Template type instances generated in separate modules do not generate include statements in C code HOT 1
- Wrong cast to non scalar type, and some other problems. HOT 3
- Rock parses function arguments with default values incorrectly HOT 1
- 'this' as default parameter value in a function refers to the wrong object HOT 2
- Static variables are not maintained correctly HOT 4
- Add newcomer label to issues HOT 1
- Allow implementing interfaces after type declaration HOT 1
- rock generates invalid C code when trying to access an interface's generic type HOT 2
- Funcs should behave as Closures with extra type information. HOT 7
- rock sometimes segfaults when classes try to implement interfaces
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 rock.