-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax too strict #28
Comments
Yeah I agree that restricting newlines there is a bit too strict. A lot of restrictions are there so implementing all the cool stuff is easier, but the restrictions you mention serve no purpose. It seems that there is a bug with arrays, thanks for bringing it to my attention! I'll have a closer look at that. Registering with an existing account would be brilliant, but I don't have time for implementing that right now... :( Thanks a lot for your detailed list! JP |
Forgot to tell you thanks for the great site. I'm making my wife use it. On Thu, Jan 10, 2013 at 5:02 PM, Jan Paul Posma [email protected]:
:: http://thinsoldier.com |
Perhaps you could use Esprima to parse the code and compare the parse trees? |
@jergason That would definitely be the way to go. It would take a bit of effort though to make all the interactions work with full Javascript support. |
I just noticed that you can't use a lot of core js methods. Trying using Math. You get an error saying the variable name cannot be found. |
@dawnerd: Not quite: this can be configured per dare. In the first couple of dares |
Can you allow code to be entered in any valid syntax, but reformat it (on line feed, perhaps) to the required syntax for your code augmentation / visualisations? |
The #1 thing people just starting out ask me is if it matters exactly where the ; and { and ( are placed.
In reality it doesn't. But in jsdares If I say
function foo()
{
stuff;
}
instead of
function foo() {
stuff;
}
it fails to run.
That is too strict in my opinion.
Also it doesn't seem to allow for loops inside of functions:
function automate (command) {
for( var i=0; i<command.length; i++) {
robot.drive( command[i] );
}
}
and doesn't seem to accept any kind of array syntax:
automate( [1,6] );
Is there a list of what is and isn't allowed?
And it would be nice if people could register with an existing account:
Google
Facebook
Twitter
BrowserID
OpenID
Other
The text was updated successfully, but these errors were encountered: