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

Add SPDX-License-Identifer line to all source files #17

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codegen_scripts/cleangenerated.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/env sh

# Copyright contributors to the openqasm-parser project
# SPDX-License-Identifier: Apache-2.0

# Remove backups of generated code.
# Also remove the temporary file that generated code is written to.
Expand Down
1 change: 1 addition & 0 deletions codegen_scripts/cpgenerated.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/env sh

# Copyright contributors to the openqasm-parser project
# SPDX-License-Identifier: Apache-2.0

# For generated.rs
# Copy the generated code from the temporary files to which it is written
Expand Down
1 change: 1 addition & 0 deletions codegen_scripts/cpnodes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/env sh

# Copyright contributors to the openqasm-parser project
# SPDX-License-Identifier: Apache-2.0

# For nodes.rs
# Copy the generated code from the temporary files to which it is written
Expand Down
1 change: 1 addition & 0 deletions codegen_scripts/mk_nodes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/env sh

# Copyright contributors to the openqasm-parser project
# SPDX-License-Identifier: Apache-2.0

# See mkgenerated.sh

Expand Down
1 change: 1 addition & 0 deletions codegen_scripts/mk_syntax_kinds.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/env sh

# Copyright contributors to the openqasm-parser project
# SPDX-License-Identifier: Apache-2.0

# See mkgenerated.sh

Expand Down
1 change: 1 addition & 0 deletions codegen_scripts/mk_syntax_tokens.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/env sh

# Copyright contributors to the openqasm-parser project
# SPDX-License-Identifier: Apache-2.0

# See mkgenerated.sh

Expand Down
1 change: 1 addition & 0 deletions codegen_scripts/mkgenerated.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/env sh

# Copyright contributors to the openqasm-parser project
# SPDX-License-Identifier: Apache-2.0

# This is not how r-a does generation.
# But I find a boot strapping problem.
Expand Down
1 change: 1 addition & 0 deletions crates/lexer/src/cursor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use std::str::Chars;

Expand Down
1 change: 1 addition & 0 deletions crates/lexer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Low-level OpenQASM3 lexer.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/lexer/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use super::*;

Expand Down
1 change: 1 addition & 0 deletions crates/lexer/src/unescape.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Utilities for validating string and char literals and turning them into
//! values they represent.
Expand Down
1 change: 1 addition & 0 deletions crates/lexer/src/unescape/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use super::*;

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/examples/demotest.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use clap::{Parser, Subcommand};
use std::fs;
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/examples/itemparse.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use ast::{HasModuleItem, HasName};
use oq3_syntax::ast;
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/examples/promote.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

// Test validating types of arguments to binary ops. That is test if they are legal.
// And compute the common type that they must be promoted to.
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Abstract Syntax Tree, layered on top of untyped `SyntaxNode`s

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/edit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This module contains functions for editing syntax trees. As the trees are
//! immutable, all function here return a fresh copy of the tree, instead of
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/expr_ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Various extension methods to ast Expr Nodes, which are hard to code-generate.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/generated.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This file is actually hand-written, but the submodules are indeed generated.
#[rustfmt::skip]
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/generated/nodes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Generated by `sourcegen_ast`, do not edit by hand.

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/generated/tokens.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Generated by `sourcegen_ast`, do not edit by hand.

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/make.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This module contains free-standing functions for creating AST fragments out
//! of smaller pieces.
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/node_ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Various extension methods to ast Nodes, which are hard to code-generate.
//! Extensions for various expressions live in a sibling `expr_extensions` module.
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/operators.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Defines a bunch of data-less enums for unary and binary operators.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/prec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Precedence representation.

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/token_ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! There are many AstNodes, but only a few tokens, so we hand-write them here.
//! I assume "them" refers to tokens (GJL AUG 2023)
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/traits.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Various traits that are implemented by ast nodes.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ast/type_ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use crate::{ast, SyntaxToken, T};

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Syntax Tree library used throughout the rust-analyzer.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/parsing.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Lexing, bridging to parser (which does the actual parsing) and
//! incremental reparsing.
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ptr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! In rust-analyzer, syntax trees are transient objects.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/syntax_error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! See docs for `SyntaxError`.

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/syntax_node.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This module defines Concrete Syntax Tree (CST), used by rust-analyzer.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/ted.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Primitive tree editor, ed for trees.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

#[cfg(not(feature = "in-rust-tree"))]
mod ast_src;
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/tests/ast_src.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Defines input for code generation process.

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/tests/sourcegen_ast.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This module generates AST datatype used by rust-analyzer. FIXME
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/token_text.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Yet another version of owned string, backed by a syntax tree token.

Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/validation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This module implements syntax validation that the parser doesn't handle.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/oq3_syntax/src/validation/block.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Logic for validating block expressions i.e. `ast::BlockExpr`.

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This module provides a way to construct a `File`.
//! It is intended to be completely decoupled from the
Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/grammar.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! This is the actual "grammar" of the OpenQASM 3 language.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/grammar/expressions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

pub mod atom;

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/grammar/expressions/atom.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use super::*;

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/grammar/items.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use super::*;
use crate::grammar::expressions::expr_block_contents;
Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/grammar/params.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use super::*;

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/input.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! See [`Input`].

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/lexed_str.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Lexing `&str` into a sequence of OpenQASM 3 tokens.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Parser for OpenQASM 3

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/output.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! See [`Output`]

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! See [`Parser`].

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/shortcuts.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Shortcuts that span lexer/parser abstraction.
//!
Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/syntax_kind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Defines [`SyntaxKind`] -- a fieldless enum of all possible syntactic
//! constructs of the OpenQASM 3 language.
Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/syntax_kind/syntax_kind_enum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Generated by `sourcegen_ast`, do not edit by hand.

Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/token_set.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! A bit-set of `SyntaxKind`s.

Expand Down
1 change: 1 addition & 0 deletions crates/semantics/examples/semdemo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use clap::{Parser, Subcommand};
use std::fs;
Expand Down
1 change: 1 addition & 0 deletions crates/semantics/src/asg.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

// The definition of the abstract semantic graph (ASG) as well as the API for using it.
// Construction of this typed ASG from syntactic AST is in string_to_semantic.rs.
Expand Down
1 change: 1 addition & 0 deletions crates/semantics/src/context.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use crate::asg;
use crate::semantic_error::SemanticErrorKind::*;
Expand Down
1 change: 1 addition & 0 deletions crates/semantics/src/display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

// Unused at the moment.
// This intent here is to print something like source code.
Expand Down
1 change: 1 addition & 0 deletions crates/semantics/src/initialize_ast.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

use crate::asg;
use crate::symbols;
1 change: 1 addition & 0 deletions crates/semantics/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

//! Abstract Semantic Graph (ASG)
//! This crate implements an abstract semantic graph (ASG) for the OpenQASM 3 language.
Expand Down
1 change: 1 addition & 0 deletions crates/semantics/src/semantic_error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

// This is copied and modified from rust-analyzer syntax_error.rs
use oq3_syntax::AstNode;
Expand Down
1 change: 1 addition & 0 deletions crates/semantics/src/symbols.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

// Defines data structures and api for symbols, scope, and symbol tables.

Expand Down
1 change: 1 addition & 0 deletions crates/semantics/src/syntax_to_semantics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright contributors to the openqasm-parser project
// SPDX-License-Identifier: Apache-2.0

// Build the ASG defined in asg.rs from the syntactic AST
// constructed in the crate oq3_syntax.
Expand Down
Loading