Skip to content
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

Language Grammar #41

Open
sawyernovak opened this issue Sep 20, 2016 · 3 comments
Open

Language Grammar #41

sawyernovak opened this issue Sep 20, 2016 · 3 comments

Comments

@sawyernovak
Copy link
Collaborator

Tree and code need to be updated.

@sawyernovak
Copy link
Collaborator Author

I finished everything but the grammar chart and table updates.

Could you read through it and see if I got it right?

@dgp1130

@dgp1130
Copy link
Member

dgp1130 commented Sep 24, 2016

  • Added lexical component descriptions.
  • Updated file grammar to match how it works in parser.js.
  • Removed file example, as we haven't yet explained the other grammatical elements and there's nothing to really explain about the file anyways.
  • Removed the line "Blocks in Uniform are similar to creating objects in JavaScript." We have objects which are distinct from blocks, so I wouldn't want to confuse readers between the two. Especially since they can only use tags inside blocks, not arbitrary keys like they can in objects.
  • Reworked the block example. You can't do @var.@var2, you can only reference @var1's tags. I also added HTML to make it more clear what it was working with.
  • Reworded variable explanation to say that variables are bound to the expressions they are given.
  • is valid is no longer a thing either. You also tried to use a variable as an lvalue, which we don't support. You did:
@var: identifier;
valid: @var.valid; // @var holds identifier's rvalue, not its lvalue.
  • I also removed the line @!@#$%^*: "You probably shouldn't name your var this"; simply because we will probably have restrictions on variable names eventually, so I wouldn't bring it up here. No reason to explicitly tell people that they can mess with the naming convention.
  • Updated section headers to be more consistent with each other.
  • Moved variable above block as I think its better to explain that first so it makes block a little less confusing.
  • Removed line about accessing tag's with $("[name='element']").ufm().*() as that plugin does not exist.
  • Updated return -> result
  • Added explanations of each tag and their required data types.
  • Updated the Identifier section to explicitly mention the DOT operation on identifiers.
  • Fixed some errors in expression grammar. You used <addSub_> instead of <op_> at one point. I also renamed <op> to <comparator> as that's what the code uses and it's a bit more clear name. I tried to unify the spacing as best I could. I removed the is operator and the <state> grammar because we haven't clearly defined those atm. Added this and <object> to the grammar as well.
  • The expression table is also out-of-date because it does not have the DOT operator.
  • The grammar tree at the beginning is also missing some tags.
  • We may also want to add some expression examples involving the dot operator, parentheses, or objects, since that might help clarify how they work.

@sawyernovak
Copy link
Collaborator Author

I agree with your edits. The grammar tree still needs to be updated. I will work on it when I get the chance.

@dgp1130 dgp1130 added this to the 0.2.0 Documentation Update milestone Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants