Commit Graph

9669 Commits

Author SHA1 Message Date
Tim Schaub 36d10bef11 Custom error for unexpected token
This makes it clearer to the compiler where we are throwing.
2013-06-25 12:11:49 -06:00
Tim Schaub 62eb0dd72b Give token an index and throw unexpected token from a common place 2013-06-25 12:11:49 -06:00
Tim Schaub bb1b0cba95 Getter for not expression argument 2013-06-25 12:11:49 -06:00
Tim Schaub c05fb8c61b Getters for member expression properties 2013-06-25 12:11:49 -06:00
Tim Schaub 2528581642 Getters for math expression properties 2013-06-25 12:11:49 -06:00
Tim Schaub 4a617871da Getters for logical expression properties 2013-06-25 12:11:49 -06:00
Tim Schaub 3de330eb99 Getter for literal expression value 2013-06-25 12:11:49 -06:00
Tim Schaub 6d6ec357e1 Getter for identifier expression name 2013-06-25 12:11:48 -06:00
Tim Schaub 582a52849c Getters for comparison expression properties 2013-06-25 12:11:48 -06:00
Tim Schaub be636d7f46 Getters for call expression properties 2013-06-25 12:11:48 -06:00
Tim Schaub 6458f98996 Describing the extent of support for ES-5 expressions 2013-06-25 12:11:48 -06:00
Tim Schaub 2fd8f4cb00 Integration testing for binary logical operators 2013-06-25 12:11:48 -06:00
Tim Schaub 973606e67a Integration tests for equality operators 2013-06-25 12:11:48 -06:00
Tim Schaub d5e133b7d8 Satisfy the build/check-requires-timestamp task (see #785)
I think this line should not be required, as `ol.expression.Char` is only used internally in this file.
2013-06-25 12:11:48 -06:00
Tim Schaub 3a3f9bc20b Integration testing for relational operators
No `instanceof` or `in` operator support.
2013-06-25 12:11:47 -06:00
Tim Schaub 9d5424236c Integration testing for additive operators 2013-06-25 12:11:47 -06:00
Tim Schaub 7c2550fefa Integration testing for multiplicative operators 2013-06-25 12:11:47 -06:00
Tim Schaub 2492515e8f Integration testing for unary operators
Only supporting ! at the moment.
2013-06-25 12:11:47 -06:00
Tim Schaub e6f03c8f22 Confirm whitespace is consumed as expected 2013-06-25 12:11:47 -06:00
Tim Schaub 26a7d907a2 Test unary expression parsing 2013-06-25 12:11:47 -06:00
Tim Schaub a0bd736948 Left-hand-side expression parsing 2013-06-25 12:11:47 -06:00
Tim Schaub 803b3a3f7d Binary expression parsing 2013-06-25 12:11:46 -06:00
Tim Schaub 40b12410f0 Increment after scanning >= and <= (and expect EOF in tests) 2013-06-25 12:11:46 -06:00
Tim Schaub 379ac82688 Test argument parsing 2013-06-25 12:11:46 -06:00
Tim Schaub 38c8927ae2 Doc and method reorg 2013-06-25 12:11:46 -06:00
Tim Schaub 6d0badcf2a Optional scope (works for expressions without identifiers) 2013-06-25 12:11:46 -06:00
Tim Schaub d920d8e578 Test left-hand-side expression parsing 2013-06-25 12:11:46 -06:00
Tim Schaub 13d0b8b084 Provide ol.expression.parse method
This is the only method needed in the API.
2013-06-25 12:11:46 -06:00
Tim Schaub 3643ea164f Cast boolean and null before creating literal expression 2013-06-25 12:11:46 -06:00
Tim Schaub ce67aa2617 Make way for convenience functions in ol.expression package 2013-06-25 12:11:45 -06:00
Tim Schaub 737d669e4a Correct types 2013-06-25 12:11:45 -06:00
Tim Schaub 7a1e69e288 Initial parsing tests 2013-06-25 12:11:45 -06:00
Tim Schaub cb9725bdfb Provide static method to check for valid operators 2013-06-25 12:11:45 -06:00
Tim Schaub 29b77a2dac Member expressions 2013-06-25 12:11:45 -06:00
Tim Schaub fbb028e15e Call expressions 2013-06-25 12:11:45 -06:00
Tim Schaub 2f7e74ab35 Create binary expressions when parsing 2013-06-25 12:11:45 -06:00
Tim Schaub f050546fe2 Logical expressions 2013-06-25 12:11:44 -06:00
Tim Schaub 153df45f95 Math expressions
Just simple binary type expressions supported here.  These can be serialized in a variety of formats.  More complex operations to be supported by call expressions.
2013-06-25 12:11:44 -06:00
Tim Schaub b2ff793ea1 Comparison expressions 2013-06-25 12:11:44 -06:00
Tim Schaub c4867bafec Smaller subset of binary operators 2013-06-25 12:11:44 -06:00
Tim Schaub 7800e9b0cc Comments, links, copyrights 2013-06-25 12:11:44 -06:00
Tim Schaub 052b973b39 Reduce to a single literal 2013-06-25 12:11:44 -06:00
Tim Schaub 20b66fc447 Proper specs 2013-06-25 12:11:43 -06:00
Tim Schaub 0abcbb9854 Stray not 2013-06-25 12:11:43 -06:00
Tim Schaub ed2e21dffa Parsing 2013-06-25 12:11:43 -06:00
Tim Schaub 1f68522837 Utility methods on the lexer 2013-06-25 12:11:43 -06:00
Tim Schaub a87ebfe97b Specific expression types 2013-06-25 12:11:43 -06:00
Tim Schaub d7e0d043f3 Consistently number 2013-06-25 12:11:43 -06:00
Tim Schaub 063b461ffd Fewer calls to charCodeAt 2013-06-25 12:11:43 -06:00
Tim Schaub 9edc9ebcc5 Use next instead 2013-06-25 12:11:42 -06:00