diff --git a/src/ol/expression/expression.js b/src/ol/expression/expression.js index cee19e79c3..c8f008a0b7 100644 --- a/src/ol/expression/expression.js +++ b/src/ol/expression/expression.js @@ -4,17 +4,15 @@ goog.provide('ol.expression.Literal'); goog.provide('ol.expression.Not'); + /** - * Support an extremely limited subset of ECMAScript 5.1 - * http://www.ecma-international.org/ecma-262/5.1/ + * Base class for all expressions. Instances of ol.Expression correspond to + * a limited set of ECMAScript 5.1 expressions. + * http://www.ecma-international.org/ecma-262/5.1/#sec-11 + * + * This base class should not be constructed directly. Instead, use one of + * the subclass constructors. * - * Inspired by Esprima (https://github.com/ariya/esprima) - * BSD Licensed - */ - - - -/** * @constructor */ ol.expression.Expression = function() {}; diff --git a/src/ol/expression/lexer.js b/src/ol/expression/lexer.js index 0eef619bc5..cefb950cff 100644 --- a/src/ol/expression/lexer.js +++ b/src/ol/expression/lexer.js @@ -1,3 +1,18 @@ +/** + * The logic and naming of methods here are inspired by Esprima (BSD Licensed). + * Esprima (http://esprima.org) includes the following copyright notices: + * + * Copyright (C) 2013 Ariya Hidayat + * Copyright (C) 2013 Thaddee Tyl + * Copyright (C) 2012 Ariya Hidayat + * Copyright (C) 2012 Mathias Bynens + * Copyright (C) 2012 Joost-Wim Boekesteijn + * Copyright (C) 2012 Kris Kowal + * Copyright (C) 2012 Yusuke Suzuki + * Copyright (C) 2012 Arpad Borsos + * Copyright (C) 2011 Ariya Hidayat + */ + goog.provide('ol.expression.Lexer'); goog.provide('ol.expression.Token'); goog.provide('ol.expression.TokenType'); @@ -79,7 +94,8 @@ ol.expression.Token; /** - * Lexer constructor. + * Lexer constructor. Provides a tokenizer for a limited subset of ECMAScript + * 5.1 expressions (http://www.ecma-international.org/ecma-262/5.1/#sec-11). * * @constructor * @param {string} source Source code. @@ -226,9 +242,10 @@ ol.expression.Lexer.prototype.isIdentifierStart_ = function(code) { /** * Determine if the given identifier is an ECMAScript keyword. These cannot * be used as identifiers in programs. There is no real reason these could not - * be used in ol expressions - so it might be worth allowing them. + * be used in ol expressions - but they are reserved for future use. * * http://www.ecma-international.org/ecma-262/5.1/#sec-7.6.1.1 + * * @param {string} id Identifier. * @return {boolean} The identifier is a keyword. * @private diff --git a/src/ol/expression/parser.js b/src/ol/expression/parser.js index 33de610eb0..ceb53d7f21 100644 --- a/src/ol/expression/parser.js +++ b/src/ol/expression/parser.js @@ -1,3 +1,18 @@ +/** + * The logic and naming of methods here are inspired by Esprima (BSD Licensed). + * Esprima (http://esprima.org) includes the following copyright notices: + * + * Copyright (C) 2013 Ariya Hidayat + * Copyright (C) 2013 Thaddee Tyl + * Copyright (C) 2012 Ariya Hidayat + * Copyright (C) 2012 Mathias Bynens + * Copyright (C) 2012 Joost-Wim Boekesteijn + * Copyright (C) 2012 Kris Kowal + * Copyright (C) 2012 Yusuke Suzuki + * Copyright (C) 2012 Arpad Borsos + * Copyright (C) 2011 Ariya Hidayat + */ + goog.provide('ol.expression.Parser'); goog.require('goog.asserts');