Skip to content

Commit

Permalink
Align parser and ast crates to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nekevss committed Dec 1, 2022
1 parent 2e74dc6 commit 12320a9
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 35 deletions.
2 changes: 1 addition & 1 deletion boa_ast/src/declaration/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The [`Declaration`] Parse Node, as defined by the [spec].
//!
//! Javascript declarations include:
//! ECMAScript declarations include:
//! - [Lexical][lex] declarations (`let`, `const`).
//! - [Function][fun] declarations (`function`, `async function`).
//! - [Class][class] declarations.
Expand Down
2 changes: 1 addition & 1 deletion boa_ast/src/declaration/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use super::Declaration;
///
/// The scope of a variable declared with `var` is its current execution context, which is either
/// the enclosing function or, for variables declared outside any function, global. If you
/// re-declare a JavaScript variable, it will not lose its value.
/// re-declare a ECMAScript variable, it will not lose its value.
///
/// Although a bit confusing, `VarDeclaration`s are not considered [`Declaration`]s by the spec.
/// This is partly because it has very different semantics from `let` and `const` declarations, but
Expand Down
2 changes: 1 addition & 1 deletion boa_ast/src/expression/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub const RESERVED_IDENTIFIERS_STRICT: [Sym; 9] = [
/// An `identifier` is a sequence of characters in the code that identifies a variable,
/// function, or property.
///
/// In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and
/// In ECMAScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and
/// digits (0-9), but may not start with a digit.
///
/// An identifier differs from a string in that a string is data, while an identifier is part
Expand Down
8 changes: 4 additions & 4 deletions boa_ast/src/expression/literal/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module contains all literal expressions, which represents the primitive values in JavaScript.
//! This module contains all literal expressions, which represents the primitive values in ECMAScript.
//!
//! More information:
//! - [ECMAScript reference][spec]
Expand All @@ -22,7 +22,7 @@ use num_bigint::BigInt;

use super::Expression;

/// Literals represent values in JavaScript.
/// Literals represent values in ECMAScript.
///
/// These are fixed values **not variables** that you literally provide in your script.
///
Expand All @@ -40,7 +40,7 @@ pub enum Literal {
///
/// A string must be delimited by quotation marks of the same type (that is, either both single quotation marks, or both double quotation marks).
/// You can call any of the String object's methods on a string literal value.
/// JavaScript automatically converts the string literal to a temporary String object,
/// ECMAScript automatically converts the string literal to a temporary String object,
/// calls the method, then discards the temporary String object.
///
/// More information:
Expand Down Expand Up @@ -74,7 +74,7 @@ pub enum Literal {
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Numeric_literals
Int(i32),

/// BigInt provides a way to represent whole numbers larger than the largest number JavaScript
/// BigInt provides a way to represent whole numbers larger than the largest number ECMAScript
/// can reliably represent with the `Number` primitive.
///
/// More information:
Expand Down
2 changes: 1 addition & 1 deletion boa_ast/src/expression/literal/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
use boa_interner::{Interner, Sym, ToIndentedString, ToInternedString};
use core::ops::ControlFlow;

/// Objects in JavaScript may be defined as an unordered collection of related data, of
/// Objects in ECMAScript may be defined as an unordered collection of related data, of
/// primitive or reference types, in the form of “key: value” pairs.
///
/// Objects can be initialized using `new Object()`, `Object.create()`, or using the literal
Expand Down
4 changes: 2 additions & 2 deletions boa_ast/src/expression/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The [`Expression`] Parse Node, as defined by the [spec].
//!
//! Javascript expressions include:
//! ECMAScript expressions include:
//! - [Primary][primary] expressions (`this`, function expressions, literals).
//! - [Left hand side][lhs] expressions (accessors, `new` operator, `super`).
//! - [operator] expressions.
Expand Down Expand Up @@ -54,7 +54,7 @@ pub mod operator;
#[cfg_attr(feature = "fuzz", derive(arbitrary::Arbitrary))]
#[derive(Debug, Clone, PartialEq)]
pub enum Expression {
/// The JavaScript `this` keyword refers to the object it belongs to.
/// The ECMAScript `this` keyword refers to the object it belongs to.
///
/// A property of an execution context (global, function or eval) that,
/// in non–strict mode, is always a reference to an object and in strict
Expand Down
2 changes: 1 addition & 1 deletion boa_ast/src/expression/operator/conditional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
use boa_interner::{Interner, ToInternedString};
use core::ops::ControlFlow;

/// The `conditional` (ternary) operation is the only JavaScript operation that takes three
/// The `conditional` (ternary) operation is the only ECMAScript operation that takes three
/// operands.
///
/// This operation takes three operands: a condition followed by a question mark (`?`),
Expand Down
4 changes: 2 additions & 2 deletions boa_ast/src/keyword.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! The `Keyword` AST node, which represents reserved words of the JavaScript language.
//! The `Keyword` AST node, which represents reserved words of the ECMAScript language.
//!
//! The [specification][spec] defines keywords as tokens that match an `IdentifierName`, but also
//! have special meaning in JavaScript. In JavaScript you cannot use these reserved words as variables,
//! have special meaning in ECMAScript. In ECMAScript, you cannot use these reserved words as variables,
//! labels, or function names.
//!
//! The [MDN documentation][mdn] contains a more extensive explanation about keywords.
Expand Down
4 changes: 2 additions & 2 deletions boa_ast/src/position.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{cmp::Ordering, fmt, num::NonZeroU32};

/// A position in the JavaScript source code.
/// A position in the ECMAScript source code.
///
/// Stores both the column number and the line number.
///
Expand Down Expand Up @@ -48,7 +48,7 @@ impl fmt::Display for Position {
}
}

/// A span in the JavaScript source code.
/// A span in the ECMAScript source code.
///
/// Stores a start position and an end position.
///
Expand Down
4 changes: 2 additions & 2 deletions boa_ast/src/punctuator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! The `Punctuator` enum, which contains all punctuators used in JavaScript.
//! The `Punctuator` enum, which contains all punctuators used in ECMAScript.
//!
//! More information:
//! - [ECMAScript Reference][spec]
Expand All @@ -14,7 +14,7 @@ use std::{
fmt::{Display, Error, Formatter},
};

/// All of the punctuators used in JavaScript.
/// All of the punctuators used in ECMAScript.
///
/// More information:
/// - [ECMAScript Reference][spec]
Expand Down
4 changes: 2 additions & 2 deletions boa_ast/src/statement/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use core::ops::ControlFlow;
/// more statements.
///
/// The block statement is often called compound statement in other languages.
/// It allows you to use multiple statements where JavaScript expects only one statement.
/// Combining statements into blocks is a common practice in JavaScript. The opposite behavior
/// It allows you to use multiple statements where ECMAScript expects only one statement.
/// Combining statements into blocks is a common practice in ECMAScript. The opposite behavior
/// is possible using an empty statement, where you provide no statement, although one is
/// required.
///
Expand Down
2 changes: 1 addition & 1 deletion boa_ast/src/statement/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The [`Statement`] Parse Node, as defined by the [spec].
//!
//! Javascript [statements] are mainly composed of control flow operations, such as [`If`],
//! ECMAScript [statements] are mainly composed of control flow operations, such as [`If`],
//! [`WhileLoop`], and [`Break`]. However, it also contains statements such as [`VarDeclaration`],
//! [`Block`] or [`Expression`] which are not strictly used for control flow.
//!
Expand Down
2 changes: 1 addition & 1 deletion boa_ast/src/visitor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Javascript Abstract Syntax Tree visitors.
//! ECMAScript Abstract Syntax Tree visitors.
//!
//! This module contains visitors which can be used to inspect or modify AST nodes. This allows for
//! fine-grained manipulation of ASTs for analysis, rewriting, or instrumentation.
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/comment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for comments used in the JavaScript programing language.
//! Boa's lexing for ECMAScript comments.
use crate::lexer::{Cursor, Error, Token, TokenKind, Tokenizer};
use boa_ast::{Position, Span};
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/cursor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Module implementing the lexer cursor. This is used for managing the input byte stream.
//! Boa's lexer cursor that manages the input byte stream.
use boa_ast::Position;
use boa_profiler::Profiler;
use std::io::{self, Bytes, Error, ErrorKind, Read};
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/identifier.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for identifiers (foo, myvar, etc.) used in the JavaScript programing language.
//! This module implements lexing for identifiers (foo, myvar, etc.) used in ECMAScript.
use crate::lexer::{Cursor, Error, StringLiteral, Token, TokenKind, Tokenizer};
use boa_ast::{Keyword, Position, Span};
Expand Down
4 changes: 1 addition & 3 deletions boa_parser/src/lexer/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! A lexical analyzer for JavaScript source code.
//!
//! This module contains the Boa lexer or tokenizer implementation.
//! Boa's lexical analyzer(Lexer) for ECMAScript source code.
//!
//! The Lexer splits its input source code into a sequence of input elements called tokens,
//! represented by the [Token] structure. It also removes
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/number.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for number literals (123, 787) used in the JavaScript programing language.
//! This module implements lexing for number literals (123, 787) used in ECMAScript.
use crate::lexer::{token::Numeric, Cursor, Error, Token, TokenKind, Tokenizer};
use boa_ast::{Position, Span};
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/operator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for operators (+, - etc.) used in the JavaScript programing language.
//! Boa's lexing for ECMAScript operators (+, - etc.).
use crate::lexer::{Cursor, Error, Token, TokenKind, Tokenizer};
use boa_ast::{Position, Punctuator, Span};
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/private_identifier.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for private identifiers (#foo, #myvar, etc.) used in the JavaScript programing language.
//! Boa's lexing for ECMAScript private identifiers (#foo, #myvar, etc.).
use crate::lexer::{identifier::Identifier, Cursor, Error, Token, TokenKind, Tokenizer};
use boa_ast::{Position, Span};
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/regex.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for regex literals used in the JavaScript programing language.
//! Boa's lexing for ECMAScript regex literals.
use crate::lexer::{Cursor, Error, Span, Token, TokenKind, Tokenizer};
use bitflags::bitflags;
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/spread.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for spread (...) literals used in the JavaScript programing language.
//! Boa's lexing for ECMAScript spread (...) literals.
use crate::lexer::{Cursor, Error, Token, Tokenizer};
use boa_ast::{Position, Punctuator, Span};
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/string.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for string literals used in the JavaScript programing language.
//! Boa's lexing for ECMAScript string literals.
use crate::lexer::{Cursor, Error, Token, TokenKind, Tokenizer};
use boa_ast::{Position, Span};
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/template.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements lexing for template literals used in the JavaScript programing language.
//! Boa's lexing for ECMAScript template literals.
use crate::lexer::{
string::{StringLiteral, UTF16CodeUnitsBuffer},
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/token.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This module implements all of the [Token]s used in the JavaScript programing language.
//! Boa's implementation of all ECMAScript [Token]s.
//!
//! More information:
//! - [ECMAScript reference][spec]
Expand Down

0 comments on commit 12320a9

Please sign in to comment.