diff --git a/codegen_scripts/cleangenerated.sh b/codegen_scripts/cleangenerated.sh index 9f2651c..e1d951a 100755 --- a/codegen_scripts/cleangenerated.sh +++ b/codegen_scripts/cleangenerated.sh @@ -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. diff --git a/codegen_scripts/cpgenerated.sh b/codegen_scripts/cpgenerated.sh index c12f454..f159912 100755 --- a/codegen_scripts/cpgenerated.sh +++ b/codegen_scripts/cpgenerated.sh @@ -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 diff --git a/codegen_scripts/cpnodes.sh b/codegen_scripts/cpnodes.sh index e43bac4..0176714 100755 --- a/codegen_scripts/cpnodes.sh +++ b/codegen_scripts/cpnodes.sh @@ -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 diff --git a/codegen_scripts/mk_nodes.sh b/codegen_scripts/mk_nodes.sh index ced2420..838d155 100755 --- a/codegen_scripts/mk_nodes.sh +++ b/codegen_scripts/mk_nodes.sh @@ -1,6 +1,7 @@ #!/bin/env sh # Copyright contributors to the openqasm-parser project +# SPDX-License-Identifier: Apache-2.0 # See mkgenerated.sh diff --git a/codegen_scripts/mk_syntax_kinds.sh b/codegen_scripts/mk_syntax_kinds.sh index 56f2915..e3b2764 100755 --- a/codegen_scripts/mk_syntax_kinds.sh +++ b/codegen_scripts/mk_syntax_kinds.sh @@ -1,6 +1,7 @@ #!/bin/env sh # Copyright contributors to the openqasm-parser project +# SPDX-License-Identifier: Apache-2.0 # See mkgenerated.sh diff --git a/codegen_scripts/mk_syntax_tokens.sh b/codegen_scripts/mk_syntax_tokens.sh index 0b17b8c..34baee7 100755 --- a/codegen_scripts/mk_syntax_tokens.sh +++ b/codegen_scripts/mk_syntax_tokens.sh @@ -1,6 +1,7 @@ #!/bin/env sh # Copyright contributors to the openqasm-parser project +# SPDX-License-Identifier: Apache-2.0 # See mkgenerated.sh diff --git a/codegen_scripts/mkgenerated.sh b/codegen_scripts/mkgenerated.sh index 8f4ca2f..1fd603d 100755 --- a/codegen_scripts/mkgenerated.sh +++ b/codegen_scripts/mkgenerated.sh @@ -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. diff --git a/crates/lexer/src/cursor.rs b/crates/lexer/src/cursor.rs index 3c52dca..5530b07 100644 --- a/crates/lexer/src/cursor.rs +++ b/crates/lexer/src/cursor.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use std::str::Chars; diff --git a/crates/lexer/src/lib.rs b/crates/lexer/src/lib.rs index 5dab052..fdf3359 100644 --- a/crates/lexer/src/lib.rs +++ b/crates/lexer/src/lib.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! Low-level OpenQASM3 lexer. //! diff --git a/crates/lexer/src/tests.rs b/crates/lexer/src/tests.rs index b2670a7..2f9b094 100644 --- a/crates/lexer/src/tests.rs +++ b/crates/lexer/src/tests.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use super::*; diff --git a/crates/lexer/src/unescape.rs b/crates/lexer/src/unescape.rs index cb834c6..c45d0b9 100644 --- a/crates/lexer/src/unescape.rs +++ b/crates/lexer/src/unescape.rs @@ -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. diff --git a/crates/lexer/src/unescape/tests.rs b/crates/lexer/src/unescape/tests.rs index 39189fe..50e4fa1 100644 --- a/crates/lexer/src/unescape/tests.rs +++ b/crates/lexer/src/unescape/tests.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use super::*; diff --git a/crates/oq3_syntax/examples/demotest.rs b/crates/oq3_syntax/examples/demotest.rs index 3709336..697afd0 100644 --- a/crates/oq3_syntax/examples/demotest.rs +++ b/crates/oq3_syntax/examples/demotest.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use clap::{Parser, Subcommand}; use std::fs; diff --git a/crates/oq3_syntax/examples/itemparse.rs b/crates/oq3_syntax/examples/itemparse.rs index 1e3113d..b223b0d 100644 --- a/crates/oq3_syntax/examples/itemparse.rs +++ b/crates/oq3_syntax/examples/itemparse.rs @@ -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; diff --git a/crates/oq3_syntax/examples/promote.rs b/crates/oq3_syntax/examples/promote.rs index dacc863..7f26181 100644 --- a/crates/oq3_syntax/examples/promote.rs +++ b/crates/oq3_syntax/examples/promote.rs @@ -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. diff --git a/crates/oq3_syntax/src/ast.rs b/crates/oq3_syntax/src/ast.rs index 3b58881..55931e2 100644 --- a/crates/oq3_syntax/src/ast.rs +++ b/crates/oq3_syntax/src/ast.rs @@ -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 diff --git a/crates/oq3_syntax/src/ast/edit.rs b/crates/oq3_syntax/src/ast/edit.rs index b783c22..5a71d91 100644 --- a/crates/oq3_syntax/src/ast/edit.rs +++ b/crates/oq3_syntax/src/ast/edit.rs @@ -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 diff --git a/crates/oq3_syntax/src/ast/expr_ext.rs b/crates/oq3_syntax/src/ast/expr_ext.rs index 577bb54..f805c47 100644 --- a/crates/oq3_syntax/src/ast/expr_ext.rs +++ b/crates/oq3_syntax/src/ast/expr_ext.rs @@ -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. //! diff --git a/crates/oq3_syntax/src/ast/generated.rs b/crates/oq3_syntax/src/ast/generated.rs index 0b29601..647f557 100644 --- a/crates/oq3_syntax/src/ast/generated.rs +++ b/crates/oq3_syntax/src/ast/generated.rs @@ -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] diff --git a/crates/oq3_syntax/src/ast/generated/nodes.rs b/crates/oq3_syntax/src/ast/generated/nodes.rs index 59926e5..636a3e2 100644 --- a/crates/oq3_syntax/src/ast/generated/nodes.rs +++ b/crates/oq3_syntax/src/ast/generated/nodes.rs @@ -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. diff --git a/crates/oq3_syntax/src/ast/generated/tokens.rs b/crates/oq3_syntax/src/ast/generated/tokens.rs index 7f6c13d..d117999 100644 --- a/crates/oq3_syntax/src/ast/generated/tokens.rs +++ b/crates/oq3_syntax/src/ast/generated/tokens.rs @@ -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. diff --git a/crates/oq3_syntax/src/ast/make.rs b/crates/oq3_syntax/src/ast/make.rs index ebe48a3..160b54a 100644 --- a/crates/oq3_syntax/src/ast/make.rs +++ b/crates/oq3_syntax/src/ast/make.rs @@ -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. diff --git a/crates/oq3_syntax/src/ast/node_ext.rs b/crates/oq3_syntax/src/ast/node_ext.rs index 81e2c6e..e0299b0 100644 --- a/crates/oq3_syntax/src/ast/node_ext.rs +++ b/crates/oq3_syntax/src/ast/node_ext.rs @@ -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. diff --git a/crates/oq3_syntax/src/ast/operators.rs b/crates/oq3_syntax/src/ast/operators.rs index 135bb91..f42e28b 100644 --- a/crates/oq3_syntax/src/ast/operators.rs +++ b/crates/oq3_syntax/src/ast/operators.rs @@ -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. //! diff --git a/crates/oq3_syntax/src/ast/prec.rs b/crates/oq3_syntax/src/ast/prec.rs index f7a2dc8..75ce18b 100644 --- a/crates/oq3_syntax/src/ast/prec.rs +++ b/crates/oq3_syntax/src/ast/prec.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! Precedence representation. diff --git a/crates/oq3_syntax/src/ast/token_ext.rs b/crates/oq3_syntax/src/ast/token_ext.rs index 4930858..5bf4e97 100644 --- a/crates/oq3_syntax/src/ast/token_ext.rs +++ b/crates/oq3_syntax/src/ast/token_ext.rs @@ -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) diff --git a/crates/oq3_syntax/src/ast/traits.rs b/crates/oq3_syntax/src/ast/traits.rs index 4c4518b..2604c8d 100644 --- a/crates/oq3_syntax/src/ast/traits.rs +++ b/crates/oq3_syntax/src/ast/traits.rs @@ -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. //! diff --git a/crates/oq3_syntax/src/ast/type_ext.rs b/crates/oq3_syntax/src/ast/type_ext.rs index 454b1bc..c527aac 100644 --- a/crates/oq3_syntax/src/ast/type_ext.rs +++ b/crates/oq3_syntax/src/ast/type_ext.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use crate::{ast, SyntaxToken, T}; diff --git a/crates/oq3_syntax/src/lib.rs b/crates/oq3_syntax/src/lib.rs index 566f25e..d949834 100644 --- a/crates/oq3_syntax/src/lib.rs +++ b/crates/oq3_syntax/src/lib.rs @@ -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. //! diff --git a/crates/oq3_syntax/src/parsing.rs b/crates/oq3_syntax/src/parsing.rs index 42b42e4..d4f77f5 100644 --- a/crates/oq3_syntax/src/parsing.rs +++ b/crates/oq3_syntax/src/parsing.rs @@ -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. diff --git a/crates/oq3_syntax/src/ptr.rs b/crates/oq3_syntax/src/ptr.rs index 94aeb1a..5da617d 100644 --- a/crates/oq3_syntax/src/ptr.rs +++ b/crates/oq3_syntax/src/ptr.rs @@ -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. //! diff --git a/crates/oq3_syntax/src/syntax_error.rs b/crates/oq3_syntax/src/syntax_error.rs index 8901bf1..b3699c1 100644 --- a/crates/oq3_syntax/src/syntax_error.rs +++ b/crates/oq3_syntax/src/syntax_error.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! See docs for `SyntaxError`. diff --git a/crates/oq3_syntax/src/syntax_node.rs b/crates/oq3_syntax/src/syntax_node.rs index f8b4c46..2c38f02 100644 --- a/crates/oq3_syntax/src/syntax_node.rs +++ b/crates/oq3_syntax/src/syntax_node.rs @@ -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. //! diff --git a/crates/oq3_syntax/src/ted.rs b/crates/oq3_syntax/src/ted.rs index ff08846..fbe000e 100644 --- a/crates/oq3_syntax/src/ted.rs +++ b/crates/oq3_syntax/src/ted.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! Primitive tree editor, ed for trees. //! diff --git a/crates/oq3_syntax/src/tests.rs b/crates/oq3_syntax/src/tests.rs index da9bd83..4f6c017 100644 --- a/crates/oq3_syntax/src/tests.rs +++ b/crates/oq3_syntax/src/tests.rs @@ -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; diff --git a/crates/oq3_syntax/src/tests/ast_src.rs b/crates/oq3_syntax/src/tests/ast_src.rs index 8c74425..0d14ad8 100644 --- a/crates/oq3_syntax/src/tests/ast_src.rs +++ b/crates/oq3_syntax/src/tests/ast_src.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! Defines input for code generation process. diff --git a/crates/oq3_syntax/src/tests/sourcegen_ast.rs b/crates/oq3_syntax/src/tests/sourcegen_ast.rs index 7350956..b3d4179 100644 --- a/crates/oq3_syntax/src/tests/sourcegen_ast.rs +++ b/crates/oq3_syntax/src/tests/sourcegen_ast.rs @@ -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 //! diff --git a/crates/oq3_syntax/src/token_text.rs b/crates/oq3_syntax/src/token_text.rs index 6b8e8ff..0577db7 100644 --- a/crates/oq3_syntax/src/token_text.rs +++ b/crates/oq3_syntax/src/token_text.rs @@ -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. diff --git a/crates/oq3_syntax/src/validation.rs b/crates/oq3_syntax/src/validation.rs index dd60a71..60b6782 100644 --- a/crates/oq3_syntax/src/validation.rs +++ b/crates/oq3_syntax/src/validation.rs @@ -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. //! diff --git a/crates/oq3_syntax/src/validation/block.rs b/crates/oq3_syntax/src/validation/block.rs index 8b788d4..32e5e8c 100644 --- a/crates/oq3_syntax/src/validation/block.rs +++ b/crates/oq3_syntax/src/validation/block.rs @@ -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`. diff --git a/crates/parser/src/event.rs b/crates/parser/src/event.rs index b5a441f..3c6378b 100644 --- a/crates/parser/src/event.rs +++ b/crates/parser/src/event.rs @@ -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 diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index b4ef204..42464c3 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs @@ -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. //! diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index 79da403..fe51dfd 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 pub mod atom; diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 4bf3878..cf2b604 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use super::*; diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index eac989e..718b0bc 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs @@ -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; diff --git a/crates/parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs index 239b4b8..1a11d33 100644 --- a/crates/parser/src/grammar/params.rs +++ b/crates/parser/src/grammar/params.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use super::*; diff --git a/crates/parser/src/input.rs b/crates/parser/src/input.rs index 11a0e02..7d0cd0e 100644 --- a/crates/parser/src/input.rs +++ b/crates/parser/src/input.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! See [`Input`]. diff --git a/crates/parser/src/lexed_str.rs b/crates/parser/src/lexed_str.rs index d87e052..4245527 100644 --- a/crates/parser/src/lexed_str.rs +++ b/crates/parser/src/lexed_str.rs @@ -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. //! diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index f78d722..3d1a3cf 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! Parser for OpenQASM 3 diff --git a/crates/parser/src/output.rs b/crates/parser/src/output.rs index 20ba869..d446c5c 100644 --- a/crates/parser/src/output.rs +++ b/crates/parser/src/output.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! See [`Output`] diff --git a/crates/parser/src/parser.rs b/crates/parser/src/parser.rs index 194342a..b98063c 100644 --- a/crates/parser/src/parser.rs +++ b/crates/parser/src/parser.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! See [`Parser`]. diff --git a/crates/parser/src/shortcuts.rs b/crates/parser/src/shortcuts.rs index ad53319..7a09501 100644 --- a/crates/parser/src/shortcuts.rs +++ b/crates/parser/src/shortcuts.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! Shortcuts that span lexer/parser abstraction. //! diff --git a/crates/parser/src/syntax_kind.rs b/crates/parser/src/syntax_kind.rs index 9865a50..8cd3934 100644 --- a/crates/parser/src/syntax_kind.rs +++ b/crates/parser/src/syntax_kind.rs @@ -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. diff --git a/crates/parser/src/syntax_kind/syntax_kind_enum.rs b/crates/parser/src/syntax_kind/syntax_kind_enum.rs index c78381f..02e19c3 100644 --- a/crates/parser/src/syntax_kind/syntax_kind_enum.rs +++ b/crates/parser/src/syntax_kind/syntax_kind_enum.rs @@ -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. diff --git a/crates/parser/src/token_set.rs b/crates/parser/src/token_set.rs index c0fb463..c28fac7 100644 --- a/crates/parser/src/token_set.rs +++ b/crates/parser/src/token_set.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! A bit-set of `SyntaxKind`s. diff --git a/crates/semantics/examples/semdemo.rs b/crates/semantics/examples/semdemo.rs index 3c99a68..3afa3b4 100644 --- a/crates/semantics/examples/semdemo.rs +++ b/crates/semantics/examples/semdemo.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use clap::{Parser, Subcommand}; use std::fs; diff --git a/crates/semantics/src/asg.rs b/crates/semantics/src/asg.rs index 7371f1c..66e0c92 100644 --- a/crates/semantics/src/asg.rs +++ b/crates/semantics/src/asg.rs @@ -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. diff --git a/crates/semantics/src/context.rs b/crates/semantics/src/context.rs index e68cd4d..792a728 100644 --- a/crates/semantics/src/context.rs +++ b/crates/semantics/src/context.rs @@ -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::*; diff --git a/crates/semantics/src/display.rs b/crates/semantics/src/display.rs index 2ad6fd4..62c29d0 100644 --- a/crates/semantics/src/display.rs +++ b/crates/semantics/src/display.rs @@ -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. diff --git a/crates/semantics/src/initialize_ast.rs b/crates/semantics/src/initialize_ast.rs index 2355299..3289bae 100644 --- a/crates/semantics/src/initialize_ast.rs +++ b/crates/semantics/src/initialize_ast.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use crate::asg; use crate::symbols; diff --git a/crates/semantics/src/lib.rs b/crates/semantics/src/lib.rs index f6184ce..3a538e0 100644 --- a/crates/semantics/src/lib.rs +++ b/crates/semantics/src/lib.rs @@ -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. diff --git a/crates/semantics/src/semantic_error.rs b/crates/semantics/src/semantic_error.rs index 18279f2..0caac08 100644 --- a/crates/semantics/src/semantic_error.rs +++ b/crates/semantics/src/semantic_error.rs @@ -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; diff --git a/crates/semantics/src/symbols.rs b/crates/semantics/src/symbols.rs index c7af62d..e4615be 100644 --- a/crates/semantics/src/symbols.rs +++ b/crates/semantics/src/symbols.rs @@ -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. diff --git a/crates/semantics/src/syntax_to_semantics.rs b/crates/semantics/src/syntax_to_semantics.rs index b54f2ab..582174e 100644 --- a/crates/semantics/src/syntax_to_semantics.rs +++ b/crates/semantics/src/syntax_to_semantics.rs @@ -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. diff --git a/crates/semantics/src/types.rs b/crates/semantics/src/types.rs index dee48d5..bae069b 100644 --- a/crates/semantics/src/types.rs +++ b/crates/semantics/src/types.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 // Defines the data structures representing the types used to annotate types of expressions in // the typed ASG. diff --git a/crates/semantics/src/utils.rs b/crates/semantics/src/utils.rs index 5ca7bba..8623b52 100644 --- a/crates/semantics/src/utils.rs +++ b/crates/semantics/src/utils.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 /// Return the name of the type of a value. pub fn type_name_of(_: T) -> &'static str { diff --git a/crates/semantics/src/validate.rs b/crates/semantics/src/validate.rs index 7bd4214..2d23cda 100644 --- a/crates/semantics/src/validate.rs +++ b/crates/semantics/src/validate.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use crate::asg::{Expr, Program, Stmt, TExpr}; use crate::symbols::{SymbolIdResult, SymbolTable}; diff --git a/crates/semantics/tests/ast_tests.rs b/crates/semantics/tests/ast_tests.rs index edb60ea..a94841c 100644 --- a/crates/semantics/tests/ast_tests.rs +++ b/crates/semantics/tests/ast_tests.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use semantics; use semantics::asg; diff --git a/crates/semantics/tests/from_string_tests.rs b/crates/semantics/tests/from_string_tests.rs index 937d482..39cf0ab 100644 --- a/crates/semantics/tests/from_string_tests.rs +++ b/crates/semantics/tests/from_string_tests.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use semantics::asg; use semantics::semantic_error::SemanticErrorList; diff --git a/crates/semantics/tests/symbol_tests.rs b/crates/semantics/tests/symbol_tests.rs index 2f611ed..189c6c7 100644 --- a/crates/semantics/tests/symbol_tests.rs +++ b/crates/semantics/tests/symbol_tests.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use semantics::symbols; use semantics::types; diff --git a/crates/semantics/tests/types_test.rs b/crates/semantics/tests/types_test.rs index e6be300..bb82fcd 100644 --- a/crates/semantics/tests/types_test.rs +++ b/crates/semantics/tests/types_test.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use semantics::types; diff --git a/crates/source_file/src/api.rs b/crates/source_file/src/api.rs index 2f178ac..acbc191 100644 --- a/crates/source_file/src/api.rs +++ b/crates/source_file/src/api.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 // It might be nice to put these functions in lib.rs. // But they are also used in this crate, so we put them here. diff --git a/crates/source_file/src/lib.rs b/crates/source_file/src/lib.rs index 1f8c2fb..3c4491b 100644 --- a/crates/source_file/src/lib.rs +++ b/crates/source_file/src/lib.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! Management of source files for OpenQASM 3 parsing and semantic analysis. The main `struct` here //! is `SourceFile` which contains the path to a source file and the AST produced by the parser. It diff --git a/crates/source_file/src/source_file.rs b/crates/source_file/src/source_file.rs index 3552ec7..393cc08 100644 --- a/crates/source_file/src/source_file.rs +++ b/crates/source_file/src/source_file.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 use oq3_syntax::ast as synast; // Syntactic AST use oq3_syntax::Parse; diff --git a/crates/sourcegen/src/lib.rs b/crates/sourcegen/src/lib.rs index d48fbbc..1916bc8 100644 --- a/crates/sourcegen/src/lib.rs +++ b/crates/sourcegen/src/lib.rs @@ -1,4 +1,5 @@ // Copyright contributors to the openqasm-parser project +// SPDX-License-Identifier: Apache-2.0 //! This was copied from an external crate. It would be better to use the //! external crate. But it has a bug-- a hard coded path that requires the diff --git a/run_rustfmt.sh b/run_rustfmt.sh index a68a57d..fedf107 100755 --- a/run_rustfmt.sh +++ b/run_rustfmt.sh @@ -1,6 +1,7 @@ #!/bin/env sh # Copyright contributors to the openqasm-parser project +# SPDX-License-Identifier: Apache-2.0 # Ideally we want to run rustfmt on all crates cd crates/source_file && cargo fmt && cd ../.. diff --git a/run_tests.sh b/run_tests.sh index 9be8ec0..d8fb249 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,7 @@ #!/bin/env sh # Copyright contributors to the openqasm-parser project +# SPDX-License-Identifier: Apache-2.0 # Run the tests, but skip the tests that do codegen. They currently # are breaking the source. Or may break it. diff --git a/run_tests_less.sh b/run_tests_less.sh index 25edaf1..d9eef64 100755 --- a/run_tests_less.sh +++ b/run_tests_less.sh @@ -1,6 +1,7 @@ #!/bin/env sh # Copyright contributors to the openqasm-parser project +# SPDX-License-Identifier: Apache-2.0 # Same as run_tests.sh, but pipe stderr to less