diff --git a/Cargo.lock b/Cargo.lock index 80417917020d..83ecc3a31b64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -405,6 +405,7 @@ dependencies = [ "lazy_static", "rayon", "regex", + "serde_json", "tracing", "tracing-subscriber", "tree-sitter", diff --git a/config/add-overlay-annotations.py b/config/add-overlay-annotations.py new file mode 100644 index 000000000000..f93929d41c60 --- /dev/null +++ b/config/add-overlay-annotations.py @@ -0,0 +1,273 @@ +# This script is used to annotate .qll files without any existing overlay annotations +# with overlay[local?] and overlay[caller] annotations. Maintenance of overlay annotations +# in annotated files will be handled by QL-for-QL queries. + +# It will walk the directory tree and annotate most .qll files, skipping only +# some specific cases (e.g., empty files, files that configure dataflow for queries). + +# The script takes a list of languages and processes the corresponding directories. +# If the optional --check argument is provided, the script checks for missing annotations, +# but does not modify any files. + +# Usage: python3 add-overlay-annotations.py [--check] ... + +# The script will modify the files in place and print the changes made. +# The script is designed to be run from the root of the repository. + +#!/usr/bin/python3 +import sys +import os +from difflib import * + + +def has_overlay_annotations(lines): + ''' + Check whether the given lines contain any overlay[...] annotations. + ''' + overlays = ["local", "local?", "global", "caller"] + annotations = [f"overlay[{t}]" for t in overlays] + return any(ann in line for ann in annotations for line in lines) + + +def is_line_comment(line): + return line.startswith("//") or (line.startswith("/*") and line.endswith("*/")) + + +def find_file_level_module_declaration(lines): + ''' + Returns the index of the existing file-level module declaration if one + exists. Returns None otherwise. + ''' + comment = False + for i, line in enumerate(lines): + trimmed = line.strip() + + if is_line_comment(trimmed): + continue + elif trimmed.startswith("/*"): + comment = True + elif comment and trimmed.endswith("*/"): + comment = False + elif not comment and trimmed.endswith("module;"): + return i + + return None + + +def is_file_module_qldoc(i, lines): + ''' + Assuming a qldoc ended on line i, determine if it belongs to the implicit + file-level module. If it is followed by another qldoc or imports, then it + does and if it is followed by any other non-empty, non-comment lines, then + we assume that is a declaration of some kind and the qldoc is attached to + that declaration. + ''' + comment = False + + for line in lines[i+1:]: + trimmed = line.strip() + + if trimmed.startswith("import ") or trimmed.startswith("private import ") or trimmed.startswith("/**"): + return True + elif is_line_comment(trimmed) or not trimmed: + continue + elif trimmed.startswith("/*"): + comment = True + elif comment and trimmed.endswith("*/"): + comment = False + elif not comment and trimmed: + return False + + return True + + +def find_file_module_qldoc_declaration(lines): + ''' + Returns the index of last line of the implicit file module qldoc if one + exists. Returns None otherwise. + ''' + + qldoc = False + comment = False + for i, line in enumerate(lines): + trimmed = line.strip() + + if trimmed.startswith("//"): + continue + elif (qldoc or trimmed.startswith("/**")) and trimmed.endswith("*/"): + # a qldoc just ended; determine if it belongs to the implicit file module + if is_file_module_qldoc(i, lines): + return i + else: + return None + elif trimmed.startswith("/**"): + qldoc = True + elif trimmed.startswith("/*"): + comment = True + elif comment and trimmed.endswith("*/"): + comment = False + elif (not qldoc and not comment) and trimmed: + return None + + return None + + +def only_comments(lines): + ''' + Returns true if the lines contain only comments and empty lines. + ''' + comment = False + + for line in lines: + trimmed = line.strip() + + if not trimmed or is_line_comment(trimmed): + continue + elif trimmed.startswith("/*"): + comment = True + elif comment and trimmed.endswith("*/"): + comment = False + elif comment: + continue + elif trimmed: + return False + + return True + + +def insert_toplevel_maybe_local_annotation(filename, lines): + ''' + Find a suitable place to insert an overlay[local?] annotation at the top of the file. + Returns a pair consisting of description and the modified lines or None if no overlay + annotation is necessary (e.g., for files that only contain comments). + ''' + if only_comments(lines): + return None + + i = find_file_level_module_declaration(lines) + if not i == None: + out_lines = lines[:i] + out_lines.append("overlay[local?]\n") + out_lines.extend(lines[i:]) + return (f"Annotating \"{filename}\" via existing file-level module statement", out_lines) + + i = find_file_module_qldoc_declaration(lines) + if not i == None: + out_lines = lines[:i+1] + out_lines.append("overlay[local?]\n") + out_lines.append("module;\n") + out_lines.extend(lines[i+1:]) + return (f"Annotating \"{filename}\" which has a file-level module qldoc", out_lines) + + out_lines = ["overlay[local?]\n", "module;\n", "\n"] + lines + return (f"Annotating \"{filename}\" without file-level module qldoc", out_lines) + + +def insert_overlay_caller_annotations(lines): + ''' + Mark pragma[inline] predicates as overlay[caller] if they are not declared private. + ''' + out_lines = [] + for i, line in enumerate(lines): + trimmed = line.strip() + if trimmed == "pragma[inline]": + if i + 1 < len(lines) and not "private" in lines[i+1]: + whitespace = line[0: line.find(trimmed)] + out_lines.append(f"{whitespace}overlay[caller]\n") + out_lines.append(line) + return out_lines + + +def annotate_as_appropriate(filename, lines): + ''' + Insert new overlay[...] annotations according to heuristics in files without existing + overlay annotations. + + Returns None if no annotations are needed. Otherwise, returns a pair consisting of a + string describing the action taken and the modified content as a list of lines. + ''' + if has_overlay_annotations(lines): + return None + + # These simple heuristics filter out those .qll files that we no _not_ want to annotate + # as overlay[local?]. It is not clear that these heuristics are exactly what we want, + # but they seem to work well enough for now (as determined by speed and accuracy numbers). + if (filename.endswith("Test.qll") or + ((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and + any("implements DataFlow::ConfigSig" in line for line in lines))): + return None + elif not any(line for line in lines if line.strip()): + return None + + lines = insert_overlay_caller_annotations(lines) + return insert_toplevel_maybe_local_annotation(filename, lines) + + +def process_single_file(write, filename): + ''' + Process a single file, annotating it as appropriate. + If write is set, the changes are written back to the file. + Returns True if the file requires changes. + ''' + old = [line for line in open(filename)] + + annotate_result = annotate_as_appropriate(filename, old) + if annotate_result is None: + return False + + if not write: + return True + + new = annotate_result[1] + + diff = context_diff(old, new, fromfile=filename, tofile=filename) + diff = [line for line in diff] + if diff: + print(annotate_result[0]) + for line in diff: + print(line.rstrip()) + with open(filename, "w") as out_file: + for line in new: + out_file.write(line) + + return True + + +if len(sys.argv) > 1 and sys.argv[1] == "--check": + check = True + langs = sys.argv[2:] +else: + check = False + langs = sys.argv[1:] + +dirs = [] +for lang in langs: + if lang in ["cpp", "go", "csharp", "java", "javascript", "python", "ruby", "rust", "swift"]: + dirs.append(f"{lang}/ql/lib") + else: + raise Exception(f"Unknown language \"{lang}\".") + +if dirs: + dirs.append("shared") + +missingAnnotations = [] + +for roots in dirs: + for dirpath, dirnames, filenames in os.walk(roots): + for filename in filenames: + if filename.endswith(".qll") and not dirpath.endswith("tutorial"): + path = os.path.join(dirpath, filename) + res = process_single_file(not check, path) + if check and res: + missingAnnotations.append(path) + + +if len(missingAnnotations) > 0: + print("The following files have no overlay annotations:") + for path in missingAnnotations[:10]: + print("- " + path) + if len(missingAnnotations) > 10: + print("and " + str(len(missingAnnotations) - 10) + " additional files.") + print() + print("Please manually add overlay annotations or use the config/add-overlay-annotations.py script to automatically add sensible default overlay annotations.") + exit(-1) diff --git a/config/dbscheme-fragments.json b/config/dbscheme-fragments.json index c56289ff1716..b8c79fc8f3ab 100644 --- a/config/dbscheme-fragments.json +++ b/config/dbscheme-fragments.json @@ -11,6 +11,7 @@ "/*- Diagnostic messages -*/", "/*- Diagnostic messages: severity -*/", "/*- Source location prefix -*/", + "/*- Database metadata -*/", "/*- Lines of code -*/", "/*- Configuration files with key value pairs -*/", "/*- YAML -*/", @@ -31,4 +32,4 @@ "/*- Python dbscheme -*/", "/*- Empty location -*/" ] -} \ No newline at end of file +} diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll index 08826b7ae8f1..65af6fb13a81 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll @@ -1,6 +1,8 @@ /** * Provides classes for representing abstract bounds for use in, for example, range analysis. */ +overlay[local?] +module; private import internal.rangeanalysis.BoundSpecific diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll index 3e5a45da247d..1451a605cdb0 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll @@ -3,6 +3,8 @@ * an expression, `b` is a `Bound` (typically zero or the value of an SSA * variable), and `v` is an integer in the range `[0 .. m-1]`. */ +overlay[local?] +module; private import internal.rangeanalysis.ModulusAnalysisSpecific::Private private import Bound diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll index 30cc089f30bb..a8b715648321 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + newtype TSign = TNeg() or TZero() or diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll index 6f0067517f90..8f8d884c9566 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll @@ -5,6 +5,8 @@ * The analysis is implemented as an abstract interpretation over the * three-valued domain `{negative, zero, positive}`. */ +overlay[local?] +module; private import SignAnalysisSpecific::Private private import SsaReadPositionCommon diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll index 08335f6680dd..1e3c4db95bed 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll @@ -1,6 +1,8 @@ /** * Provides classes for representing a position at which an SSA variable is read. */ +overlay[local?] +module; private import SsaReadPositionSpecific import SsaReadPositionSpecific::Public diff --git a/java/ql/lib/Customizations.qll b/java/ql/lib/Customizations.qll index 1f5716726e30..f083e0864507 100644 --- a/java/ql/lib/Customizations.qll +++ b/java/ql/lib/Customizations.qll @@ -8,5 +8,7 @@ * the `RemoteFlowSource` and `AdditionalTaintStep` classes associated with the security queries * to model frameworks that are not covered by the standard library. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/IDEContextual.qll b/java/ql/lib/IDEContextual.qll index f26956bcca01..e74d51898e8d 100644 --- a/java/ql/lib/IDEContextual.qll +++ b/java/ql/lib/IDEContextual.qll @@ -1,6 +1,8 @@ /** * Provides shared predicates related to contextual queries in the code viewer. */ +overlay[local?] +module; import semmle.files.FileSystem private import codeql.util.FileSystem diff --git a/java/ql/lib/default.qll b/java/ql/lib/default.qll index 79ed05a7c378..66060273e966 100644 --- a/java/ql/lib/default.qll +++ b/java/ql/lib/default.qll @@ -1,3 +1,5 @@ /** DEPRECATED: use `java.qll` instead. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/definitions.qll b/java/ql/lib/definitions.qll index aa5de3eb4019..f0a4e859b08e 100644 --- a/java/ql/lib/definitions.qll +++ b/java/ql/lib/definitions.qll @@ -2,6 +2,8 @@ * Provides classes and predicates related to jump-to-definition links * in the code viewer. */ +overlay[local?] +module; import java import IDEContextual diff --git a/java/ql/lib/experimental/quantum/JCA.qll b/java/ql/lib/experimental/quantum/JCA.qll index 16afa26347fe..113f031f55bc 100644 --- a/java/ql/lib/experimental/quantum/JCA.qll +++ b/java/ql/lib/experimental/quantum/JCA.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.dataflow.DataFlow import semmle.code.java.dataflow.TaintTracking diff --git a/java/ql/lib/experimental/quantum/Language.qll b/java/ql/lib/experimental/quantum/Language.qll index 59164901c10c..975a8ad8e1fe 100644 --- a/java/ql/lib/experimental/quantum/Language.qll +++ b/java/ql/lib/experimental/quantum/Language.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import java as Language private import semmle.code.java.security.InsecureRandomnessQuery private import semmle.code.java.security.RandomQuery diff --git a/java/ql/lib/external/ExternalArtifact.qll b/java/ql/lib/external/ExternalArtifact.qll index 2e782a6a4da1..cdba653062ad 100644 --- a/java/ql/lib/external/ExternalArtifact.qll +++ b/java/ql/lib/external/ExternalArtifact.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java class ExternalData extends @externalDataElement { diff --git a/java/ql/lib/java.qll b/java/ql/lib/java.qll index ce0905184f40..9644343e93b6 100644 --- a/java/ql/lib/java.qll +++ b/java/ql/lib/java.qll @@ -1,4 +1,6 @@ /** Provides all default Java QL imports. */ +overlay[local?] +module; import Customizations import semmle.code.FileSystem diff --git a/java/ql/lib/semmle/code/FileSystem.qll b/java/ql/lib/semmle/code/FileSystem.qll index a7c38b41ca54..92c888304ff6 100644 --- a/java/ql/lib/semmle/code/FileSystem.qll +++ b/java/ql/lib/semmle/code/FileSystem.qll @@ -1,4 +1,6 @@ /** Provides classes for working with files and folders. */ +overlay[local?] +module; import Location private import codeql.util.FileSystem diff --git a/java/ql/lib/semmle/code/Location.qll b/java/ql/lib/semmle/code/Location.qll index abc1d19d0f89..14fc7a995328 100644 --- a/java/ql/lib/semmle/code/Location.qll +++ b/java/ql/lib/semmle/code/Location.qll @@ -3,6 +3,8 @@ * * Locations represent parts of files and are used to map elements to their source location. */ +overlay[local?] +module; import FileSystem import semmle.code.java.Element diff --git a/java/ql/lib/semmle/code/SMAP.qll b/java/ql/lib/semmle/code/SMAP.qll index 575d54f92de1..96243a78d7b4 100644 --- a/java/ql/lib/semmle/code/SMAP.qll +++ b/java/ql/lib/semmle/code/SMAP.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with SMAP files (see JSR-045). */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/Unit.qll b/java/ql/lib/semmle/code/Unit.qll index 83a4a03321d9..e31457eae1aa 100644 --- a/java/ql/lib/semmle/code/Unit.qll +++ b/java/ql/lib/semmle/code/Unit.qll @@ -1,3 +1,5 @@ /** Provides the `Unit` class. */ +overlay[local?] +module; import codeql.util.Unit diff --git a/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll b/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll index 282f1c1228a3..0c69f45c56fa 100644 --- a/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll +++ b/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with configuration files, such * as Java `.properties` or `.ini` files. */ +overlay[local?] +module; import semmle.code.Location diff --git a/java/ql/lib/semmle/code/java/Annotation.qll b/java/ql/lib/semmle/code/java/Annotation.qll index f39b1f3420a5..ba5ce65daac8 100644 --- a/java/ql/lib/semmle/code/java/Annotation.qll +++ b/java/ql/lib/semmle/code/java/Annotation.qll @@ -8,6 +8,8 @@ * Each annotation type has zero or more annotation elements that contain a * name and possibly a value. */ +overlay[local?] +module; import Element import Expr diff --git a/java/ql/lib/semmle/code/java/Collections.qll b/java/ql/lib/semmle/code/java/Collections.qll index 9fd64dc60ee3..d121512c3196 100644 --- a/java/ql/lib/semmle/code/java/Collections.qll +++ b/java/ql/lib/semmle/code/java/Collections.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for reasoning about instances of * `java.util.Collection` and their methods. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/Compilation.qll b/java/ql/lib/semmle/code/java/Compilation.qll index c52f308e8e33..835505390468 100644 --- a/java/ql/lib/semmle/code/java/Compilation.qll +++ b/java/ql/lib/semmle/code/java/Compilation.qll @@ -1,6 +1,8 @@ /** * Provides a class representing individual compiler invocations that occurred during the build. */ +overlay[local?] +module; import semmle.code.FileSystem diff --git a/java/ql/lib/semmle/code/java/CompilationUnit.qll b/java/ql/lib/semmle/code/java/CompilationUnit.qll index 9b4b58e9a9bd..546c3d26ea39 100644 --- a/java/ql/lib/semmle/code/java/CompilationUnit.qll +++ b/java/ql/lib/semmle/code/java/CompilationUnit.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java compilation units. */ +overlay[local?] +module; import Element import Package diff --git a/java/ql/lib/semmle/code/java/Completion.qll b/java/ql/lib/semmle/code/java/Completion.qll index 6ccdb16df725..35d3c83e2ee9 100644 --- a/java/ql/lib/semmle/code/java/Completion.qll +++ b/java/ql/lib/semmle/code/java/Completion.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for representing completions. */ +overlay[local?] +module; /* * A completion represents how a statement or expression terminates. diff --git a/java/ql/lib/semmle/code/java/Concurrency.qll b/java/ql/lib/semmle/code/java/Concurrency.qll index 61e76525ec87..0e510db3443b 100644 --- a/java/ql/lib/semmle/code/java/Concurrency.qll +++ b/java/ql/lib/semmle/code/java/Concurrency.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/Constants.qll b/java/ql/lib/semmle/code/java/Constants.qll index 9e35a925be33..0cad92b7fc6d 100644 --- a/java/ql/lib/semmle/code/java/Constants.qll +++ b/java/ql/lib/semmle/code/java/Constants.qll @@ -1,6 +1,8 @@ /** * Provdides a module to calculate constant integer and boolean values. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/ControlFlowGraph.qll b/java/ql/lib/semmle/code/java/ControlFlowGraph.qll index 0d9d685cc716..25ec9dc9ef4a 100644 --- a/java/ql/lib/semmle/code/java/ControlFlowGraph.qll +++ b/java/ql/lib/semmle/code/java/ControlFlowGraph.qll @@ -7,6 +7,8 @@ * statement, an expression, or an exit node for a callable, indicating that * execution of the callable terminates. */ +overlay[local?] +module; /* * The implementation is centered around the concept of a _completion_, which diff --git a/java/ql/lib/semmle/code/java/Conversions.qll b/java/ql/lib/semmle/code/java/Conversions.qll index f3deb311a3df..76b74fd1eb7c 100644 --- a/java/ql/lib/semmle/code/java/Conversions.qll +++ b/java/ql/lib/semmle/code/java/Conversions.qll @@ -4,6 +4,8 @@ * * See the Java Language Specification, Section 5, for details. */ +overlay[local?] +module; import java import semmle.code.java.arithmetic.Overflow diff --git a/java/ql/lib/semmle/code/java/Dependency.qll b/java/ql/lib/semmle/code/java/Dependency.qll index 8514bcb466a1..138ab7523a4d 100644 --- a/java/ql/lib/semmle/code/java/Dependency.qll +++ b/java/ql/lib/semmle/code/java/Dependency.qll @@ -1,6 +1,8 @@ /** * Provides utility predicates for representing dependencies between types. */ +overlay[local?] +module; import Type import Generics diff --git a/java/ql/lib/semmle/code/java/DependencyCounts.qll b/java/ql/lib/semmle/code/java/DependencyCounts.qll index 4cb958373a93..13709ebaf291 100644 --- a/java/ql/lib/semmle/code/java/DependencyCounts.qll +++ b/java/ql/lib/semmle/code/java/DependencyCounts.qll @@ -1,6 +1,8 @@ /** * This library provides utility predicates for representing the number of dependencies between types. */ +overlay[local?] +module; import Type import Generics diff --git a/java/ql/lib/semmle/code/java/Diagnostics.qll b/java/ql/lib/semmle/code/java/Diagnostics.qll index 0134b32c5c0e..c93e6850b3de 100644 --- a/java/ql/lib/semmle/code/java/Diagnostics.qll +++ b/java/ql/lib/semmle/code/java/Diagnostics.qll @@ -1,6 +1,8 @@ /** * Provides classes representing warnings generated during compilation. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/Element.qll b/java/ql/lib/semmle/code/java/Element.qll index 2032d72ee5f9..dca3c8d91eb6 100644 --- a/java/ql/lib/semmle/code/java/Element.qll +++ b/java/ql/lib/semmle/code/java/Element.qll @@ -1,6 +1,8 @@ /** * Provides a class that represents named elements in Java programs. */ +overlay[local?] +module; import CompilationUnit import semmle.code.Location diff --git a/java/ql/lib/semmle/code/java/Exception.qll b/java/ql/lib/semmle/code/java/Exception.qll index 0b92975a580d..abd934994626 100644 --- a/java/ql/lib/semmle/code/java/Exception.qll +++ b/java/ql/lib/semmle/code/java/Exception.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java exceptions. */ +overlay[local?] +module; import Element import Type diff --git a/java/ql/lib/semmle/code/java/Expr.qll b/java/ql/lib/semmle/code/java/Expr.qll index e7dd817cecd9..182bf5b7001f 100644 --- a/java/ql/lib/semmle/code/java/Expr.qll +++ b/java/ql/lib/semmle/code/java/Expr.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with Java expressions. */ +overlay[local?] +module; import java private import semmle.code.java.frameworks.android.Compose diff --git a/java/ql/lib/semmle/code/java/GeneratedFiles.qll b/java/ql/lib/semmle/code/java/GeneratedFiles.qll index 31a229f507f2..7c4a6d4cbb5a 100644 --- a/java/ql/lib/semmle/code/java/GeneratedFiles.qll +++ b/java/ql/lib/semmle/code/java/GeneratedFiles.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the most common types of generated files. */ +overlay[local?] +module; import Type private import semmle.code.java.frameworks.JavaxAnnotations diff --git a/java/ql/lib/semmle/code/java/Generics.qll b/java/ql/lib/semmle/code/java/Generics.qll index a50dcabe2245..e0204b1beace 100644 --- a/java/ql/lib/semmle/code/java/Generics.qll +++ b/java/ql/lib/semmle/code/java/Generics.qll @@ -30,6 +30,8 @@ * * The terminology for generic methods is analogous. */ +overlay[local?] +module; import Type diff --git a/java/ql/lib/semmle/code/java/Import.qll b/java/ql/lib/semmle/code/java/Import.qll index cef66c34ae15..aed041155555 100644 --- a/java/ql/lib/semmle/code/java/Import.qll +++ b/java/ql/lib/semmle/code/java/Import.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java imports. */ +overlay[local?] +module; import semmle.code.Location import CompilationUnit diff --git a/java/ql/lib/semmle/code/java/J2EE.qll b/java/ql/lib/semmle/code/java/J2EE.qll index 70c207a35794..4412b3715e34 100644 --- a/java/ql/lib/semmle/code/java/J2EE.qll +++ b/java/ql/lib/semmle/code/java/J2EE.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with J2EE bean types. */ +overlay[local?] +module; import Type diff --git a/java/ql/lib/semmle/code/java/JDK.qll b/java/ql/lib/semmle/code/java/JDK.qll index 27a8b2a9ca73..897e857ba108 100644 --- a/java/ql/lib/semmle/code/java/JDK.qll +++ b/java/ql/lib/semmle/code/java/JDK.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with standard classes and methods from the JDK. */ +overlay[local?] +module; import Member import semmle.code.java.security.ExternalProcess diff --git a/java/ql/lib/semmle/code/java/JDKAnnotations.qll b/java/ql/lib/semmle/code/java/JDKAnnotations.qll index 5f3e70688558..aac7242ad4f1 100644 --- a/java/ql/lib/semmle/code/java/JDKAnnotations.qll +++ b/java/ql/lib/semmle/code/java/JDKAnnotations.qll @@ -1,6 +1,8 @@ /** * Provides classes that represent standard annotations from the JDK. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/JMX.qll b/java/ql/lib/semmle/code/java/JMX.qll index 11849be0beee..3f18e0ecf3d3 100644 --- a/java/ql/lib/semmle/code/java/JMX.qll +++ b/java/ql/lib/semmle/code/java/JMX.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with JMX bean types. */ +overlay[local?] +module; import Type diff --git a/java/ql/lib/semmle/code/java/Javadoc.qll b/java/ql/lib/semmle/code/java/Javadoc.qll index f14d8776ddc4..ef8f77bf9baf 100644 --- a/java/ql/lib/semmle/code/java/Javadoc.qll +++ b/java/ql/lib/semmle/code/java/Javadoc.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Javadoc documentation. */ +overlay[local?] +module; import semmle.code.Location diff --git a/java/ql/lib/semmle/code/java/KotlinType.qll b/java/ql/lib/semmle/code/java/KotlinType.qll index 3e5597c5579d..9d29f3b441ef 100644 --- a/java/ql/lib/semmle/code/java/KotlinType.qll +++ b/java/ql/lib/semmle/code/java/KotlinType.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Kotlin types. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/Maps.qll b/java/ql/lib/semmle/code/java/Maps.qll index 1089e8924156..25c8659f2c9e 100644 --- a/java/ql/lib/semmle/code/java/Maps.qll +++ b/java/ql/lib/semmle/code/java/Maps.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for reasoning about instances of * `java.util.Map` and their methods. */ +overlay[local?] +module; import java import Collections diff --git a/java/ql/lib/semmle/code/java/Member.qll b/java/ql/lib/semmle/code/java/Member.qll index f6f4ca56f92d..662eab06bd1e 100644 --- a/java/ql/lib/semmle/code/java/Member.qll +++ b/java/ql/lib/semmle/code/java/Member.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with members of Java classes and interfaces, * that is, methods, constructors, fields and nested types. */ +overlay[local?] +module; import Element import Type diff --git a/java/ql/lib/semmle/code/java/Modifier.qll b/java/ql/lib/semmle/code/java/Modifier.qll index 150b65be6716..864691bf835b 100644 --- a/java/ql/lib/semmle/code/java/Modifier.qll +++ b/java/ql/lib/semmle/code/java/Modifier.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java modifiers. */ +overlay[local?] +module; import Element diff --git a/java/ql/lib/semmle/code/java/Modules.qll b/java/ql/lib/semmle/code/java/Modules.qll index c8aed33a0fc3..a1bceb72e0bb 100644 --- a/java/ql/lib/semmle/code/java/Modules.qll +++ b/java/ql/lib/semmle/code/java/Modules.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with Java modules. */ +overlay[local?] +module; import CompilationUnit diff --git a/java/ql/lib/semmle/code/java/NumberFormatException.qll b/java/ql/lib/semmle/code/java/NumberFormatException.qll index 841d64b0098d..83f66d1a709d 100644 --- a/java/ql/lib/semmle/code/java/NumberFormatException.qll +++ b/java/ql/lib/semmle/code/java/NumberFormatException.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for reasoning about `java.lang.NumberFormatException`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/Package.qll b/java/ql/lib/semmle/code/java/Package.qll index 466c97e561d6..e0621f4de541 100644 --- a/java/ql/lib/semmle/code/java/Package.qll +++ b/java/ql/lib/semmle/code/java/Package.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java packages. */ +overlay[local?] +module; import Element import Type diff --git a/java/ql/lib/semmle/code/java/PrettyPrintAst.qll b/java/ql/lib/semmle/code/java/PrettyPrintAst.qll index de1bf3100a37..3d907a5a0991 100644 --- a/java/ql/lib/semmle/code/java/PrettyPrintAst.qll +++ b/java/ql/lib/semmle/code/java/PrettyPrintAst.qll @@ -2,6 +2,8 @@ * Provides pretty-printed representations of the AST, in particular top-level * classes and interfaces. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/PrintAst.qll b/java/ql/lib/semmle/code/java/PrintAst.qll index 0af012234bb2..52d344401d70 100644 --- a/java/ql/lib/semmle/code/java/PrintAst.qll +++ b/java/ql/lib/semmle/code/java/PrintAst.qll @@ -5,6 +5,8 @@ * extend `PrintAstConfiguration` and override `shouldPrint` to hold for only the elements * you wish to view the AST for. */ +overlay[local?] +module; import java import semmle.code.java.regex.RegexTreeView as RegexTreeView diff --git a/java/ql/lib/semmle/code/java/Reflection.qll b/java/ql/lib/semmle/code/java/Reflection.qll index da287387e173..e37187231b93 100644 --- a/java/ql/lib/semmle/code/java/Reflection.qll +++ b/java/ql/lib/semmle/code/java/Reflection.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java Reflection. */ +overlay[local?] +module; import java import JDKAnnotations diff --git a/java/ql/lib/semmle/code/java/Serializability.qll b/java/ql/lib/semmle/code/java/Serializability.qll index 479d1d8cdb01..639cc0c18eba 100644 --- a/java/ql/lib/semmle/code/java/Serializability.qll +++ b/java/ql/lib/semmle/code/java/Serializability.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java Serialization. */ +overlay[local?] +module; import java private import frameworks.jackson.JacksonSerializability diff --git a/java/ql/lib/semmle/code/java/Statement.qll b/java/ql/lib/semmle/code/java/Statement.qll index da9621f9ce3a..73b0aac5cbdd 100644 --- a/java/ql/lib/semmle/code/java/Statement.qll +++ b/java/ql/lib/semmle/code/java/Statement.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java statements. */ +overlay[local?] +module; import Expr import metrics.MetricStmt diff --git a/java/ql/lib/semmle/code/java/StringFormat.qll b/java/ql/lib/semmle/code/java/StringFormat.qll index 4ed39c02a841..da69a5b9b8ff 100644 --- a/java/ql/lib/semmle/code/java/StringFormat.qll +++ b/java/ql/lib/semmle/code/java/StringFormat.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for reasoning about string formatting. */ +overlay[local?] +module; import java import dataflow.DefUse diff --git a/java/ql/lib/semmle/code/java/Type.qll b/java/ql/lib/semmle/code/java/Type.qll index 5036bbea6224..95e4ecc7ff7a 100644 --- a/java/ql/lib/semmle/code/java/Type.qll +++ b/java/ql/lib/semmle/code/java/Type.qll @@ -9,6 +9,8 @@ * Classes and interfaces can also be local (`LocalClassOrInterface`, `LocalClass`) or anonymous (`AnonymousClass`). * Enumerated types (`EnumType`) and records (`Record`) are special kinds of classes. */ +overlay[local?] +module; import Member import Modifier @@ -668,6 +670,7 @@ class RefType extends Type, Annotatable, Modifiable, @reftype { * * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure). */ + overlay[caller] pragma[inline] RefType commonSubtype(RefType other) { result.getASourceSupertype*() = erase(this) and @@ -1257,6 +1260,7 @@ private Type erase(Type t) { * * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure). */ +overlay[caller] pragma[inline] predicate haveIntersection(RefType t1, RefType t2) { exists(RefType e1, RefType e2 | e1 = erase(t1) and e2 = erase(t2) | diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index f229440e4eed..6c05fecab01c 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with test classes and methods. */ +overlay[local?] +module; import Type import Member diff --git a/java/ql/lib/semmle/code/java/Variable.qll b/java/ql/lib/semmle/code/java/Variable.qll index a4cf09df055d..50fd7a064846 100644 --- a/java/ql/lib/semmle/code/java/Variable.qll +++ b/java/ql/lib/semmle/code/java/Variable.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Java variables and their declarations. */ +overlay[local?] +module; import Element diff --git a/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll b/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll index e92d8352fe9b..471f271eb866 100644 --- a/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll +++ b/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** A subclass of `PrimitiveType` with width-based ordering methods. */ diff --git a/java/ql/lib/semmle/code/java/comparison/Comparison.qll b/java/ql/lib/semmle/code/java/comparison/Comparison.qll index 27ed9271e999..7aea0f6fb258 100644 --- a/java/ql/lib/semmle/code/java/comparison/Comparison.qll +++ b/java/ql/lib/semmle/code/java/comparison/Comparison.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll b/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll index 284ee1dad0ce..4e65001d7f29 100644 --- a/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll +++ b/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with basic blocks in Java. */ +overlay[local?] +module; import java import Dominance diff --git a/java/ql/lib/semmle/code/java/controlflow/Dominance.qll b/java/ql/lib/semmle/code/java/controlflow/Dominance.qll index 6f0cb3d255c5..8f53a554d485 100644 --- a/java/ql/lib/semmle/code/java/controlflow/Dominance.qll +++ b/java/ql/lib/semmle/code/java/controlflow/Dominance.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for control-flow graph dominance. */ +overlay[local?] +module; import java @@ -93,6 +95,7 @@ predicate iDominates(ControlFlowNode dominator, ControlFlowNode node) { } /** Holds if `dom` strictly dominates `node`. */ +overlay[caller] pragma[inline] predicate strictlyDominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. @@ -102,6 +105,7 @@ predicate strictlyDominates(ControlFlowNode dom, ControlFlowNode node) { } /** Holds if `dom` dominates `node`. (This is reflexive.) */ +overlay[caller] pragma[inline] predicate dominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. @@ -111,6 +115,7 @@ predicate dominates(ControlFlowNode dom, ControlFlowNode node) { } /** Holds if `dom` strictly post-dominates `node`. */ +overlay[caller] pragma[inline] predicate strictlyPostDominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. @@ -120,6 +125,7 @@ predicate strictlyPostDominates(ControlFlowNode dom, ControlFlowNode node) { } /** Holds if `dom` post-dominates `node`. (This is reflexive.) */ +overlay[caller] pragma[inline] predicate postDominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. diff --git a/java/ql/lib/semmle/code/java/controlflow/Guards.qll b/java/ql/lib/semmle/code/java/controlflow/Guards.qll index 4042e7b29624..9395e6dd8cce 100644 --- a/java/ql/lib/semmle/code/java/controlflow/Guards.qll +++ b/java/ql/lib/semmle/code/java/controlflow/Guards.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for reasoning about guards and the control * flow elements controlled by those guards. */ +overlay[local?] +module; import java private import semmle.code.java.controlflow.Dominance diff --git a/java/ql/lib/semmle/code/java/controlflow/Paths.qll b/java/ql/lib/semmle/code/java/controlflow/Paths.qll index 8f87e19404a6..fb14c226484d 100644 --- a/java/ql/lib/semmle/code/java/controlflow/Paths.qll +++ b/java/ql/lib/semmle/code/java/controlflow/Paths.qll @@ -2,6 +2,8 @@ * This library provides predicates for reasoning about the set of all paths * through a callable. */ +overlay[local?] +module; import java import semmle.code.java.dispatch.VirtualDispatch diff --git a/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll b/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll index f03e4690a95a..feabc47552f3 100644 --- a/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll +++ b/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll @@ -1,6 +1,8 @@ /** * Provides different types of control flow successor types. */ +overlay[local?] +module; import java private import codeql.util.Boolean diff --git a/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll b/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll index 0ade780bc00c..0247417c6bb6 100644 --- a/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll +++ b/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for identifying unreachable blocks under a "closed-world" assumption. */ +overlay[local?] +module; import java import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll b/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll index 4cb3bc74f97f..d5dc39d9e141 100644 --- a/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll +++ b/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll @@ -2,6 +2,8 @@ * Provides predicates for working with the internal logic of the `Guards` * library. */ +overlay[local?] +module; import java import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll b/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll index 6e6c5ec47f9c..a0d2e4ef03ec 100644 --- a/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll +++ b/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll @@ -3,6 +3,8 @@ * `com.google.common.base.Preconditions` and * `org.apache.commons.lang3.Validate`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll b/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll index 1d94f075abbe..5366fa78a539 100644 --- a/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll +++ b/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll @@ -1,4 +1,6 @@ /** Provides utility predicates relating to switch cases. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll b/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll index 7b7a5943f6c6..bda7f9bee740 100644 --- a/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll +++ b/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.controlflow.UnreachableBlocks diff --git a/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll b/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll index c600bb1672d8..56027a4507c8 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll @@ -1,4 +1,6 @@ /** Provides classes representing various flow sinks for data flow / taint tracking. */ +overlay[local?] +module; private import semmle.code.java.dataflow.FlowSinks as FlowSinks diff --git a/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll b/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll index 8649b5cf830d..add0ec0d9a5b 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll @@ -1,4 +1,6 @@ /** Provides classes representing various flow sources for data flow / taint tracking. */ +overlay[local?] +module; private import semmle.code.java.dataflow.FlowSources as FlowSources diff --git a/java/ql/lib/semmle/code/java/dataflow/Bound.qll b/java/ql/lib/semmle/code/java/dataflow/Bound.qll index 08826b7ae8f1..65af6fb13a81 100644 --- a/java/ql/lib/semmle/code/java/dataflow/Bound.qll +++ b/java/ql/lib/semmle/code/java/dataflow/Bound.qll @@ -1,6 +1,8 @@ /** * Provides classes for representing abstract bounds for use in, for example, range analysis. */ +overlay[local?] +module; private import internal.rangeanalysis.BoundSpecific diff --git a/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll b/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll index ab48577c02e7..54eb809c7b97 100644 --- a/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll @@ -2,6 +2,8 @@ * Provides classes for performing local (intra-procedural) and * global (inter-procedural) data flow analyses. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/dataflow/DefUse.qll b/java/ql/lib/semmle/code/java/dataflow/DefUse.qll index 9fa08d62c27f..a93f2e30b462 100644 --- a/java/ql/lib/semmle/code/java/dataflow/DefUse.qll +++ b/java/ql/lib/semmle/code/java/dataflow/DefUse.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for def-use and use-use pairs. Built on top of the SSA library for * maximal precision. */ +overlay[local?] +module; import java private import SSA diff --git a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll index a38e54f05134..d1849df0f3ec 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll @@ -86,6 +86,8 @@ * This information is used in a heuristic for dataflow analysis to determine, if a * model or source code should be used for determining flow. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow::DataFlow diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll index 72cd96f6745c..61066774e52b 100644 --- a/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll +++ b/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll @@ -1,4 +1,6 @@ /** Provides classes representing various flow sinks for data flow / taint tracking. */ +overlay[local?] +module; private import java private import semmle.code.java.dataflow.ExternalFlow diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll index f63eae183c49..8c6ac60eb24f 100644 --- a/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll +++ b/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll @@ -1,6 +1,8 @@ /** * Provides classes representing various flow sources for taint tracking. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll index d081a6289ecd..8bf2a4683926 100644 --- a/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll +++ b/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll @@ -1,6 +1,8 @@ /** * Provides classes representing various flow steps for taint tracking. */ +overlay[local?] +module; private import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll index acea2a10784f..d038851d8374 100644 --- a/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll +++ b/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for defining flow summaries. */ +overlay[local?] +module; import java private import internal.FlowSummaryImpl as Impl diff --git a/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll b/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll index 0bae1b5e9c10..feeb0d100c64 100644 --- a/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll +++ b/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for reasoning about explicit and implicit * instance accesses. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll b/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll index 58d77b649788..817fa17d6a60 100644 --- a/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll +++ b/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for integer guards. */ +overlay[local?] +module; import java private import SSA diff --git a/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll b/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll index 3e5a45da247d..1451a605cdb0 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll @@ -3,6 +3,8 @@ * an expression, `b` is a `Bound` (typically zero or the value of an SSA * variable), and `v` is an integer in the range `[0 .. m-1]`. */ +overlay[local?] +module; private import internal.rangeanalysis.ModulusAnalysisSpecific::Private private import Bound diff --git a/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll b/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll index 2dd72d78a2ea..5c6cdb919ef3 100644 --- a/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll +++ b/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for null guards. */ +overlay[local?] +module; import java import SSA diff --git a/java/ql/lib/semmle/code/java/dataflow/Nullness.qll b/java/ql/lib/semmle/code/java/dataflow/Nullness.qll index 36ad96c497f0..f3912277b338 100644 --- a/java/ql/lib/semmle/code/java/dataflow/Nullness.qll +++ b/java/ql/lib/semmle/code/java/dataflow/Nullness.qll @@ -6,6 +6,8 @@ * hold, so results guarded by, for example, `assert x != null;` or * `if (x == null) { assert false; }` are excluded. */ +overlay[local?] +module; /* * Implementation details: diff --git a/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll b/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll index 64f68b9c075a..49ce242e4a43 100644 --- a/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll +++ b/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll @@ -8,6 +8,8 @@ * If an inferred bound relies directly on a condition, then this condition is * reported as the reason for the bound. */ +overlay[local?] +module; /* * This library tackles range analysis as a flow problem. Consider e.g.: diff --git a/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll b/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll index 444fec8f8659..7d38d83b0967 100644 --- a/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll +++ b/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll @@ -1,6 +1,8 @@ /** * Provides utility predicates for range analysis. */ +overlay[local?] +module; import java private import SSA diff --git a/java/ql/lib/semmle/code/java/dataflow/SSA.qll b/java/ql/lib/semmle/code/java/dataflow/SSA.qll index 680088b7c554..dd902b70e35a 100644 --- a/java/ql/lib/semmle/code/java/dataflow/SSA.qll +++ b/java/ql/lib/semmle/code/java/dataflow/SSA.qll @@ -10,6 +10,8 @@ * of the field in case the field is not amenable to a non-trivial SSA * representation. */ +overlay[local?] +module; import java private import internal.SsaImpl diff --git a/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll b/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll index 9cd629f4ef97..568bc8b6d580 100644 --- a/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll +++ b/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll @@ -5,5 +5,7 @@ * The analysis is implemented as an abstract interpretation over the * three-valued domain `{negative, zero, positive}`. */ +overlay[local?] +module; import semmle.code.java.dataflow.internal.rangeanalysis.SignAnalysisCommon diff --git a/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll b/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll index ed10d8aa4bb8..4b1bd0131bd4 100644 --- a/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll +++ b/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll @@ -25,6 +25,8 @@ * String.format("%sfoo:%s", notSuffix, suffix4); * ``` */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.TaintTracking diff --git a/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll b/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll index e62850fbc389..159604a95bd6 100644 --- a/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll +++ b/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll @@ -2,6 +2,8 @@ * Provides classes for performing local (intra-procedural) and * global (inter-procedural) taint-tracking analyses. */ +overlay[local?] +module; import semmle.code.java.dataflow.DataFlow import semmle.code.java.dataflow.internal.TaintTrackingUtil::StringBuilderVarModule diff --git a/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll b/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll index f2fcbc5951d4..8ce9b1b91202 100644 --- a/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll @@ -7,6 +7,8 @@ * type has a subtype or if an inferred upper bound passed through at least one * explicit or implicit cast that lost type information. */ +overlay[local?] +module; import java as J private import semmle.code.java.dispatch.VirtualDispatch diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll b/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll index 874aca871832..e01525eda8c6 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll @@ -10,6 +10,8 @@ * This is a restricted version of SSA.qll that only handles `LocalScopeVariable`s * in order to not depend on virtual dispatch. */ +overlay[local?] +module; import java private import codeql.ssa.Ssa as SsaImplCommon diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll index e007ecd85ae5..f93139592269 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.Collections import semmle.code.java.Maps diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll index 2c9b12170440..ec14f494dd95 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import java private import DataFlowImplSpecific private import codeql.dataflow.internal.ContentDataFlowImpl diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll index f63df6ad09ec..9a1be72209ab 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import java private import DataFlowPrivate private import DataFlowUtil @@ -210,6 +213,7 @@ private module DispatchImpl { } /** Holds if arguments at position `apos` match parameters at position `ppos`. */ + overlay[caller] pragma[inline] predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos } } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll index 689e58daab89..1917c2007fe1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import DataFlowImplSpecific private import codeql.dataflow.internal.DataFlowImpl private import semmle.code.Location diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll index 00f388dfdf3a..d9a6a98b4598 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import DataFlowImplSpecific private import semmle.code.Location private import codeql.dataflow.internal.DataFlowImplCommon diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll index 0272af417ace..164bc9abbbdb 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll @@ -2,6 +2,8 @@ * Provides consistency queries for checking invariants in the language-specific * data-flow classes and predicates. */ +overlay[local?] +module; private import java private import DataFlowImplSpecific diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll index 95b2baeab1ce..65034ee08b93 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll @@ -1,6 +1,8 @@ /** * Provides Java-specific definitions for use in the data flow library. */ +overlay[local?] +module; private import semmle.code.Location private import codeql.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll index 7778f6ebc353..61063498b9e0 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import java private import semmle.code.java.dataflow.InstanceAccess private import semmle.code.java.dataflow.ExternalFlow diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll index 9e924df12780..164e2d8aa262 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import java private import DataFlowUtil private import DataFlowImplCommon diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll index 6000c37c6cdd..27cbefa80929 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll @@ -1,6 +1,8 @@ /** * Basic definitions for use in the data flow library. */ +overlay[local?] +module; private import java private import DataFlowPrivate @@ -77,6 +79,7 @@ private module ThisFlow { * Holds if data can flow from `node1` to `node2` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localFlow(Node node1, Node node2) { node1 = node2 or localFlowStepPlus(node1, node2) } @@ -86,6 +89,7 @@ private predicate localFlowStepPlus(Node node1, Node node2) = fastTC(localFlowSt * Holds if data can flow from `e1` to `e2` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localExprFlow(Expr e1, Expr e2) { localFlow(exprNode(e1), exprNode(e2)) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll index ff931cbc5cee..32b5d289e28c 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll @@ -1,6 +1,8 @@ /** * This module provides extensible predicates for defining MaD models. */ +overlay[local?] +module; /** * Holds if a source model exists for the given parameters. diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll index bbb40785d6b4..a2d25cadd883 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for defining flow summaries. */ +overlay[local?] +module; private import java private import codeql.dataflow.internal.FlowSummaryImpl diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll index cc95a2b5c1ff..9635592476fa 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for exclusions related to MaD models. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll index 2a1ea8b0e068..45ad9d0a73b7 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java private import codeql.ssa.Ssa as SsaImplCommon private import semmle.code.java.dataflow.SSA diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll index 0f756200abeb..1ac2c7c60fe8 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll @@ -1,6 +1,8 @@ /** * Provides Java-specific definitions for use in the taint tracking library. */ +overlay[local?] +module; private import codeql.dataflow.TaintTracking private import DataFlowImplSpecific diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll index d4890b96f8e8..ed0163d13a78 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import java private import semmle.code.java.dataflow.DataFlow private import semmle.code.java.Collections @@ -20,6 +23,7 @@ private import semmle.code.java.frameworks.JaxWS * Holds if taint can flow from `src` to `sink` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localTaint(DataFlow::Node src, DataFlow::Node sink) { localTaintStep*(src, sink) } @@ -27,6 +31,7 @@ predicate localTaint(DataFlow::Node src, DataFlow::Node sink) { localTaintStep*( * Holds if taint can flow from `src` to `sink` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localExprTaint(Expr src, Expr sink) { localTaint(DataFlow::exprNode(src), DataFlow::exprNode(sink)) @@ -69,6 +74,7 @@ module LocalTaintFlow { * (intra-procedural) steps that are restricted to be part of a path between * `source` and `sink`. */ + overlay[caller] pragma[inline] predicate hasFlow(DataFlow::Node n1, DataFlow::Node n2) { step*(n1, n2) } @@ -77,6 +83,7 @@ module LocalTaintFlow { * (intra-procedural) steps that are restricted to be part of a path between * `source` and `sink`. */ + overlay[caller] pragma[inline] predicate hasExprFlow(Expr n1, Expr n2) { hasFlow(DataFlow::exprNode(n1), DataFlow::exprNode(n2)) diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll index 0af549f1f7ee..a1c690b7df4c 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll @@ -1,6 +1,8 @@ /** * Provides Java-specific definitions for bounds. */ +overlay[local?] +module; private import java as J private import semmle.code.java.dataflow.SSA as Ssa diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll index b639947793b5..ae77ab7ea01f 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + module Private { private import java as J private import semmle.code.java.dataflow.SSA as Ssa diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll index 30cc089f30bb..a8b715648321 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + newtype TSign = TNeg() or TZero() or diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll index 6f0067517f90..8f8d884c9566 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll @@ -5,6 +5,8 @@ * The analysis is implemented as an abstract interpretation over the * three-valued domain `{negative, zero, positive}`. */ +overlay[local?] +module; private import SignAnalysisSpecific::Private private import SsaReadPositionCommon diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll index 04e896b26011..10026e0a53d2 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + /** * Provides Java-specific definitions for use in sign analysis. */ diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll index 08335f6680dd..1e3c4db95bed 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll @@ -1,6 +1,8 @@ /** * Provides classes for representing a position at which an SSA variable is read. */ +overlay[local?] +module; private import SsaReadPositionSpecific import SsaReadPositionSpecific::Public diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll index 9b081150e893..dbd7736acde4 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll @@ -1,6 +1,8 @@ /** * Provides Java-specific definitions for use in the `SsaReadPosition`. */ +overlay[local?] +module; private import semmle.code.java.dataflow.SSA as Ssa private import semmle.code.java.controlflow.BasicBlocks as BB diff --git a/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll b/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll index cab159b18043..140d5e9e2c81 100644 --- a/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll +++ b/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.deadcode.DeadEnumConstant import semmle.code.java.deadcode.DeadCodeCustomizations diff --git a/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll b/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll index e87671dba714..3a8491b8428e 100644 --- a/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll +++ b/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/deadcode/DeadField.qll b/java/ql/lib/semmle/code/java/deadcode/DeadField.qll index 2dcbb96f3b59..016350f23ec2 100644 --- a/java/ql/lib/semmle/code/java/deadcode/DeadField.qll +++ b/java/ql/lib/semmle/code/java/deadcode/DeadField.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.deadcode.DeadCode import semmle.code.java.frameworks.javaee.Persistence diff --git a/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll index 7c0a2fdc2d37..ec8ad6e2d4ff 100644 --- a/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.deadcode.DeadCode import semmle.code.java.deadcode.frameworks.CamelEntryPoints diff --git a/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll index f280d9bf8285..7ee7416cecc4 100644 --- a/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.deadcode.DeadCode import semmle.code.java.frameworks.spring.Spring diff --git a/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll index 86910a921f8a..a40417debcb5 100644 --- a/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.deadcode.DeadCode import semmle.code.java.frameworks.struts.StrutsActions diff --git a/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll index b8013d2947a8..d8674817b17c 100644 --- a/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.deadcode.DeadCode import semmle.code.java.frameworks.Cucumber diff --git a/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll index fc2d5f69df9a..df9ef0a7b7c5 100644 --- a/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.deadcode.DeadCode import semmle.code.java.frameworks.gwt.GWT diff --git a/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll index a96565c606e4..453d75e179b5 100644 --- a/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll @@ -1,6 +1,8 @@ /** * Apache Camel is a messaging framework, which can integrate with Spring. */ +overlay[local?] +module; import java import semmle.code.java.deadcode.DeadCode diff --git a/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll index a829ccef7d27..c817a9b7dac9 100644 --- a/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import default import semmle.code.java.deadcode.DeadCode import external.ExternalArtifact diff --git a/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll index 39cb18db80a7..3e231e23fc31 100644 --- a/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll @@ -1,6 +1,8 @@ /** * GigaSpaces XAP (eXtreme Application Platform) is a distributed in-memory "datagrid". */ +overlay[local?] +module; import java import semmle.code.java.deadcode.DeadCode diff --git a/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll b/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll index bd293eed6b3a..a9988e920c62 100644 --- a/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll +++ b/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll @@ -5,6 +5,8 @@ * data flow check for lambdas, anonymous classes, and other sufficiently * private classes where all object instantiations are accounted for. */ +overlay[local?] +module; import java private import VirtualDispatch diff --git a/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll b/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll index 293ba894fdfb..12fe1cba5e99 100644 --- a/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll +++ b/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll @@ -6,6 +6,8 @@ * The set of dispatch targets for `Object.toString()` calls are reduced based * on possible data flow from objects of more specific types to the qualifier. */ +overlay[local?] +module; import java private import VirtualDispatch diff --git a/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll b/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll index 78bf1ad0bdc1..877a62fb9455 100644 --- a/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll +++ b/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll @@ -2,6 +2,8 @@ * Provides predicates for reasoning about runtime call targets through virtual * dispatch. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.TypeFlow diff --git a/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll b/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll index f7840f197853..e76c252662a3 100644 --- a/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll +++ b/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for reasoning about calls that may invoke one * of their arguments. */ +overlay[local?] +module; import java import VirtualDispatch diff --git a/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll b/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll index 6c92f7298d92..cd585de58e4e 100644 --- a/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll +++ b/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll @@ -1,6 +1,8 @@ /** * Provides a module to check whether two `ParameterizedType`s are unifiable. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/environment/SystemProperty.qll b/java/ql/lib/semmle/code/java/environment/SystemProperty.qll index bee91d7c6b7f..add93ee56c39 100644 --- a/java/ql/lib/semmle/code/java/environment/SystemProperty.qll +++ b/java/ql/lib/semmle/code/java/environment/SystemProperty.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with java system properties. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll b/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll index 61f6aa9a34ea..73078c1da83c 100644 --- a/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll +++ b/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates related to `org.apache.http.*` and `org.apache.hc.*`. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSteps diff --git a/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll b/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll index 8bcba2f044eb..6d76caf36d55 100644 --- a/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll +++ b/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Apache LDAP API. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Assertions.qll b/java/ql/lib/semmle/code/java/frameworks/Assertions.qll index e1601c854e4e..9849be5f3603 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Assertions.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Assertions.qll @@ -5,6 +5,8 @@ * `org.junit.jupiter.api.Assertions`, `com.google.common.base.Preconditions`, * and `java.util.Objects`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Camel.qll b/java/ql/lib/semmle/code/java/frameworks/Camel.qll index 381ee3cb28e2..137855b5fa1a 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Camel.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Camel.qll @@ -1,6 +1,8 @@ /** * Apache Camel messaging framework. */ +overlay[local?] +module; import java import semmle.code.java.frameworks.spring.SpringCamel diff --git a/java/ql/lib/semmle/code/java/frameworks/Castor.qll b/java/ql/lib/semmle/code/java/frameworks/Castor.qll index f1e1b8257252..2becb2fbf178 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Castor.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Castor.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Castor framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll b/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll index 9bcfb24bae5a..15e71a25f890 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll @@ -1,6 +1,8 @@ /** * Cucumber is an open-source project for writing executable acceptance tests in human-readable `.feature` files. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/FastJson.qll b/java/ql/lib/semmle/code/java/frameworks/FastJson.qll index c9f7d9e8b89d..305f795017a6 100644 --- a/java/ql/lib/semmle/code/java/frameworks/FastJson.qll +++ b/java/ql/lib/semmle/code/java/frameworks/FastJson.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the FastJson framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll b/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll index 55a8e2624386..2e5cb2ce9593 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with the Flexjson framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Guice.qll b/java/ql/lib/semmle/code/java/frameworks/Guice.qll index 8dfb63983982..bf6a3d5467cc 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Guice.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Guice.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Guice framework. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.FlowSteps diff --git a/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll b/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll index e3c5269e5b20..3a10b75a2a69 100644 --- a/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll +++ b/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the HessianBurlap framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll b/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll index 28b281014547..4e5050b412ca 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Hibernate framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/InputStream.qll b/java/ql/lib/semmle/code/java/frameworks/InputStream.qll index 8f37ecc24ea0..f6097e8c4492 100644 --- a/java/ql/lib/semmle/code/java/frameworks/InputStream.qll +++ b/java/ql/lib/semmle/code/java/frameworks/InputStream.qll @@ -1,4 +1,6 @@ /** Provides definitions related to `java.io.InputStream`. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll b/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll index 3da90bb7e67a..b4573013295b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll +++ b/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll @@ -1,4 +1,6 @@ /** Predicates and classes to reason about the `io.jsonwebtoken` library. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/JAXB.qll b/java/ql/lib/semmle/code/java/frameworks/JAXB.qll index e25add17ccb1..96075bbccf3c 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JAXB.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JAXB.qll @@ -1,4 +1,6 @@ /** Definitions related to JAXB. */ +overlay[local?] +module; import semmle.code.java.Type diff --git a/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll index d74fe683f063..ad58cd486e16 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with annotations from the `JUnit` framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/JYaml.qll b/java/ql/lib/semmle/code/java/frameworks/JYaml.qll index 9d77b86f6c1d..cd9414521c4e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JYaml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JYaml.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the JYaml framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll b/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll index eede97b411cb..e8bb82f156fe 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with the Jabsorb JSON-RPC ORB framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Jackson.qll b/java/ql/lib/semmle/code/java/frameworks/Jackson.qll index 605370ec594f..5c1d02759231 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Jackson.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Jackson.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Jackson serialization framework. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll index 0f5da6c39eac..22f33d346df0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with annotations in the `javax` package. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll b/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll index a0f891fd36ea..62289f737c02 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll @@ -2,6 +2,8 @@ * Definitions relating to JAX-WS (Java/Jakarta API for XML Web Services) and JAX-RS * (Java/Jakarta API for RESTful Web Services). */ +overlay[local?] +module; import java private import semmle.code.java.frameworks.Networking diff --git a/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll b/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll index 37be7dcf09a7..c7172527d1fe 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Java JDBC API. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Jms.qll b/java/ql/lib/semmle/code/java/frameworks/Jms.qll index 653582100bdb..3cc76771a776 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Jms.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Jms.qll @@ -1,4 +1,6 @@ /** Provides definitions for working with the JMS library. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Jndi.qll b/java/ql/lib/semmle/code/java/frameworks/Jndi.qll index 267cdcd59dc8..0d7d481dc1d0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Jndi.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Jndi.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Java JNDI API. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll b/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll index d92b80ca32b5..3f28b2e8c7e4 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Jodd JSON framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll b/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll index 85f3a5ef06bb..433277a64728 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Json-io framework. */ +overlay[local?] +module; import java import semmle.code.java.Maps diff --git a/java/ql/lib/semmle/code/java/frameworks/Kryo.qll b/java/ql/lib/semmle/code/java/frameworks/Kryo.qll index 7dde62c4ba4b..77a423a8a9ef 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Kryo.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Kryo.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Kryo serialization framework. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/Lombok.qll b/java/ql/lib/semmle/code/java/frameworks/Lombok.qll index 39ee7c5393d5..84a890c498f8 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Lombok.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Lombok.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for identifying use of the Lombok framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Mail.qll b/java/ql/lib/semmle/code/java/frameworks/Mail.qll index eeb9665dc2ed..c61e5ae34f99 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Mail.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Mail.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to work with email */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Mockito.qll b/java/ql/lib/semmle/code/java/frameworks/Mockito.qll index 0f5971a68ace..1a8d987a38e4 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Mockito.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Mockito.qll @@ -3,6 +3,8 @@ * * QL classes are provided for detecting uses of Mockito annotations on fields. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll b/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll index c7fc09a33b4d..e3f89186821b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll +++ b/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the MyBatis framework. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/Netty.qll b/java/ql/lib/semmle/code/java/frameworks/Netty.qll index 9a72c7f64043..caaa429d69ec 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Netty.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Netty.qll @@ -1,4 +1,6 @@ /** Provides definitions related to the Netty framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Networking.qll b/java/ql/lib/semmle/code/java/frameworks/Networking.qll index 1139d0d00621..6eeb5aa90241 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Networking.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Networking.qll @@ -1,6 +1,8 @@ /** * Definitions related to `java.net.*`. */ +overlay[local?] +module; import semmle.code.java.Type private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll b/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll index c8b9a320ec1b..5327db3af865 100644 --- a/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the OpenSAML libraries. */ +overlay[local?] +module; import java private import semmle.code.java.security.InsecureRandomnessQuery diff --git a/java/ql/lib/semmle/code/java/frameworks/Properties.qll b/java/ql/lib/semmle/code/java/frameworks/Properties.qll index 15e7b6878858..50a13c236744 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Properties.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Properties.qll @@ -1,4 +1,6 @@ /** Definitions related to `java.util.Properties`. */ +overlay[local?] +module; import semmle.code.java.Type private import semmle.code.java.dataflow.FlowSteps diff --git a/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll b/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll index 14224bc148de..bbaa56f46119 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Protobuf framework. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.FlowSteps diff --git a/java/ql/lib/semmle/code/java/frameworks/Regex.qll b/java/ql/lib/semmle/code/java/frameworks/Regex.qll index 780dec48b923..f63f46c38780 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Regex.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Regex.qll @@ -1,4 +1,6 @@ /** Definitions related to `java.util.regex`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Rmi.qll b/java/ql/lib/semmle/code/java/frameworks/Rmi.qll index 922f90bccb62..03ea238982d6 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Rmi.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Rmi.qll @@ -1,4 +1,6 @@ /** Remote Method Invocation. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/Selenium.qll b/java/ql/lib/semmle/code/java/frameworks/Selenium.qll index 0ea61ae0ecfe..6a85d5b09159 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Selenium.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Selenium.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for identifying classes reflectively constructed by Selenium using the * `PageFactory.initElements(...)` method. */ +overlay[local?] +module; import default import semmle.code.java.Reflection diff --git a/java/ql/lib/semmle/code/java/frameworks/Servlets.qll b/java/ql/lib/semmle/code/java/frameworks/Servlets.qll index 80e80c019b0a..7d7beb74fc30 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Servlets.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Servlets.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Java Servlet API. */ +overlay[local?] +module; import semmle.code.java.Type diff --git a/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll b/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll index 3bde32912180..0edbad2196e1 100644 --- a/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the SnakeYaml serialization framework. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll b/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll index 82eedca44e88..192e579a4f6b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll +++ b/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Spring JDBC framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll b/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll index da40caf37445..79c3739dde4f 100644 --- a/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll +++ b/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Spring LDAP API. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll b/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll index a011af98cd5c..9bb856e22604 100644 --- a/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll +++ b/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import spring.SpringController import spring.SpringWeb diff --git a/java/ql/lib/semmle/code/java/frameworks/Stream.qll b/java/ql/lib/semmle/code/java/frameworks/Stream.qll index a449f8bd99a6..8927355d6377 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Stream.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Stream.qll @@ -1,4 +1,6 @@ /** Definitions related to `java.util.stream`. */ +overlay[local?] +module; private import semmle.code.java.dataflow.FlowSummary diff --git a/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll b/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll index 826eed8dffcc..c813c0383eb6 100644 --- a/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll +++ b/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll @@ -1,4 +1,6 @@ /** Definitions related to `java.lang.ThreadLocal`. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/Thrift.qll b/java/ql/lib/semmle/code/java/frameworks/Thrift.qll index 4e07a2730dc2..5272745b4e97 100644 --- a/java/ql/lib/semmle/code/java/frameworks/Thrift.qll +++ b/java/ql/lib/semmle/code/java/frameworks/Thrift.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Apache Thrift framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll b/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll index bfb7a6604246..6359fbf2afbc 100644 --- a/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll +++ b/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the UnboundID API. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/XStream.qll b/java/ql/lib/semmle/code/java/frameworks/XStream.qll index 0e62459e13d8..aca6117023ee 100644 --- a/java/ql/lib/semmle/code/java/frameworks/XStream.qll +++ b/java/ql/lib/semmle/code/java/frameworks/XStream.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the XStream XML serialization framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll b/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll index b5db59926be4..040ae60fc710 100644 --- a/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll +++ b/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the YamlBeans framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Android.qll b/java/ql/lib/semmle/code/java/frameworks/android/Android.qll index befcc036205e..85df4366ec27 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Android.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Android.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Android components. */ +overlay[local?] +module; import java private import semmle.code.xml.AndroidManifest diff --git a/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll b/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll index 226a80709456..1aba64a4c7e0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about `AsyncTask`s in Android. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll b/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll index 0e6399cba1f0..9123600d4e48 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with components generated by the Android's Jetpack Compose compiler. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll b/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll index 7bcd4baa3e50..f344377b9cd8 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Content Providers. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll b/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll index 7eb088a9514f..c07ddea6dbab 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll @@ -1,4 +1,6 @@ /** Provides definitions for working with uses of Android external storage */ +overlay[local?] +module; import java private import semmle.code.java.security.FileReadWrite diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll b/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll index debdd69e1944..64c92955ee7b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to track Android fragments. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll b/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll index 6e321b0ad900..c3b58873d1f0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java private import semmle.code.java.frameworks.android.Android private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll index ee430b62d577..0f6f5d845b86 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with Android layouts and UI elements. */ +overlay[local?] +module; import java import semmle.code.xml.AndroidManifest diff --git a/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll b/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll index 5253526f0fd1..5a1a9bf8c7a0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll @@ -1,4 +1,6 @@ /** Provides a remote flow source for Android's `Activity.onActivityResult` method. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll b/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll index 1c17d3c9b8df..720be6dce03a 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to the class `PendingIntent`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll b/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll index 2898b6aee54f..f46f4e0e51d6 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with SQLite databases. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSteps diff --git a/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll b/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll index a3298fd70d87..a11857e9f1f4 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll @@ -1,4 +1,6 @@ /** Provides classes related to `android.content.SharedPreferences`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll b/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll index 96ccb2a4401e..60811d9bc2d6 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to `androidx.slice`. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll b/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll index 78eeae4bdf22..8fa804f52797 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** The class `android.webkit.WebView`. */ diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll b/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll index 9a2729f5b794..7b277a797f90 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with Android widgets. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.ExternalFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll b/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll index 4e6c39f25757..2235bc5eaecc 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java class XmlPullParser extends Interface { diff --git a/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll b/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll index 24030e35045d..97d51fc2cbc4 100644 --- a/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll +++ b/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll @@ -1,4 +1,6 @@ /** Definitions related to the Apache Commons Collections library. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSteps diff --git a/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll b/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll index 5e72b26e009b..163bd773dad0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll @@ -1,4 +1,6 @@ /** Provides XML definitions related to the `org.apache.commons` package. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.RangeUtils diff --git a/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll b/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll index 9ea2400b8718..27c7f9530ad1 100644 --- a/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll +++ b/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll @@ -1,4 +1,6 @@ /** Definitions related to the Apache Commons Lang library. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSteps diff --git a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll index 1d42bd4c94b4..b1637038b99a 100644 --- a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll +++ b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll @@ -14,6 +14,8 @@ * * This creates a route to the `ConsumeMdb` class for messages sent to "activemq:queue:sayhello". */ +overlay[local?] +module; import java import semmle.code.java.Reflection diff --git a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll index ed09baf8ead2..df8903266592 100644 --- a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll +++ b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll @@ -13,6 +13,8 @@ * * This creates a route to the `TargetBean` class for messages sent to "direct.start". */ +overlay[local?] +module; import java import semmle.code.java.Reflection diff --git a/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll b/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll index 2b99e0fcff0b..a03ed1c5266e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll +++ b/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll @@ -1,6 +1,8 @@ /** * GigaSpaces XAP (eXtreme Application Platform) is a distributed in-memory "datagrid". */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll b/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll index db8bc2574c13..5e0304ca7b2a 100644 --- a/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll +++ b/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.Serializability import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll b/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll index 9dc38a529415..7185c87b09f2 100644 --- a/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll +++ b/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with the Gson framework. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll b/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll index 6abaee8ff720..bd8973b0adb8 100644 --- a/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll +++ b/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with Java Serialization in the context of * the `com.google.gson` JSON processing framework. */ +overlay[local?] +module; import java private import semmle.code.java.Serializability diff --git a/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll b/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll index 94dd356f62d7..aebdb22f42ac 100644 --- a/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll +++ b/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll @@ -1,4 +1,6 @@ /** Definitions of flow steps through the collection types in the Guava framework */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll b/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll index 5dd8aaa18eeb..545aae763d55 100644 --- a/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll +++ b/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll @@ -1,6 +1,8 @@ /** * Definitions for tracking taint steps through the Guava framework. */ +overlay[local?] +module; import java import Collections diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll index 6780a9261b9b..a58e49aa76f0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll +++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with the GWT framework. */ +overlay[local?] +module; import java import GwtXml diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll index 8532cc81bb30..d692740f40e6 100644 --- a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll +++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll @@ -4,6 +4,8 @@ * The UiBinder framework allows the specification of user interfaces in XML template files. These * can then be interacted with programmatically by writing an associated owner class. */ +overlay[local?] +module; import java import GwtUiBinderXml diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll index 0fb8ed3cd70d..fef34f1bc44d 100644 --- a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for identifying GWT UiBinder framework XML templates. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll index e143d06cccbc..b36824543005 100644 --- a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with `*.gwt.xml` files. */ +overlay[local?] +module; import semmle.code.xml.XML diff --git a/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll b/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll index ae316cf649e5..44752f94576b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll +++ b/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to the Hudson framework. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSources diff --git a/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll b/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll index 2e9b04d6a8ce..abb24b909e97 100644 --- a/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll +++ b/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with OCNI (Objective-C Native Interface). */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll b/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll index 2aa78e9425da..e5bad7435d58 100644 --- a/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll +++ b/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the jOOQ framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll b/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll index 8e1077d8bc01..aa7da753f434 100644 --- a/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll +++ b/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with Java Serialization in the context of * the `com.fasterxml.jackson` JSON processing framework. */ +overlay[local?] +module; import java import semmle.code.java.Serializability diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll index b4ae1b1c19cb..2f749962e94d 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with Java Server Faces. */ +overlay[local?] +module; import default import semmle.code.java.frameworks.javaee.jsf.JSFAnnotations diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll index b38cba889e00..b5031d7dff08 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the JavaEE Persistence API. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll index 7564dafa37e0..e6ada894fc6f 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with JavaEE * persistence configuration XML files (`persistence.xml`). */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll index c1a0b08d8e7c..222b778ba588 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll @@ -1,4 +1,6 @@ /** Provides definitions related to the `javax.xml` package. */ +overlay[local?] +module; import java private import semmle.code.java.security.XmlParsers diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll index d165370d1391..2b003b3c94e7 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with Enterprise Java Beans. */ +overlay[local?] +module; import java import EJBJarXML diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll index f44d77d89bd3..dc465ddc4c62 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with * EJB deployment descriptor XML files (`ejb-jar.xml`). */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll index f5a52490768c..2f5a88ba5c81 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for modeling * EJB Programming Restrictions (see EJB 3.0 specification, section 21.1.2). */ +overlay[local?] +module; import java import EJB diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll index 1db82875ad94..3338fa840ab0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with Java Server Faces annotations. */ +overlay[local?] +module; import default diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll index 13ed765638d9..060398f648c1 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll @@ -1,6 +1,8 @@ /** * Provides classes for JSF "Application Configuration Resources File", usually called `faces-config.xml`. */ +overlay[local?] +module; import default diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll index 546d3be69833..df646e8a9a2c 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with JavaServer Faces renderer. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll b/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll index dbdaf6960f31..1aa39c638286 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll @@ -1,4 +1,6 @@ /** Provides definitions related to the `java.beans` package. */ +overlay[local?] +module; import java private import semmle.code.java.security.XmlParsers diff --git a/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll b/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll index 5f03c0b190fd..addc4a576bdc 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates related to `java.net.http.*`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll b/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll index 17d3d4579d2a..2ea26630619b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll +++ b/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll @@ -1,6 +1,8 @@ /** * Provides classes for identifying methods called by the Java SE WebSocket package. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll index 38af34bc6900..1c8181206f54 100644 --- a/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll +++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to `kotlin.io`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll index 206996af321d..3f4d0e04c691 100644 --- a/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll +++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to `kotlin`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll index c0269266a59e..1dc22be1a8b9 100644 --- a/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll +++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the `kotlinx.serialization` plugin. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll index 8521b2847848..1b576251f873 100644 --- a/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll +++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to `kotlin.text`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll b/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll index b762fbcc8639..dc5ea6809948 100644 --- a/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll @@ -1,4 +1,6 @@ /** Provides definitions related to XML parsing in Model-Driven Health Tools. */ +overlay[local?] +module; import java private import semmle.code.java.security.XmlParsers diff --git a/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll b/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll index 19cabda7073f..fe95cd0d39d3 100644 --- a/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll +++ b/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll @@ -1,4 +1,6 @@ /** Classes and predicates for reasoning about the `owasp.easpi` package. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/play/Play.qll b/java/ql/lib/semmle/code/java/frameworks/play/Play.qll index 7b99b23704e3..bbf6385fc0ad 100644 --- a/java/ql/lib/semmle/code/java/frameworks/play/Play.qll +++ b/java/ql/lib/semmle/code/java/frameworks/play/Play.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with the Play framework. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll b/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll index 7efa72c3164a..f8259e95a2ee 100644 --- a/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll +++ b/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates related to `ratpack.exec.*`. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll b/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll index 0f271e073e6e..78e7fbf30a9b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll +++ b/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll @@ -1,4 +1,6 @@ /** Provides definitions related to XML parsing in Rundeck. */ +overlay[local?] +module; import java private import semmle.code.java.security.XmlParsers diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll b/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll index 2b09288610e4..1c9c67838d48 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringAbstractRef import semmle.code.java.frameworks.spring.SpringAlias diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll index 4dd4b0ab9478..23ea64bd898e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll index cbc4f025dacd..aab0bba6be2b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll index bddf5f01f9ea..37a162cc8901 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll index a20eef4d0d75..d99a28c56181 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll index 966db95afce6..e758811b368e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for identifying methods and constructors called by Spring injection. */ +overlay[local?] +module; import java import SpringComponentScan diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll index a53cbf67090f..ec06e9f28905 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBeanRefType diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll index d96f264b91f5..810182d8f1f0 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll index 4d85a56ab2bf..490fe3e05610 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll index d77e4549e4e7..155afd41ba5e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll @@ -2,6 +2,8 @@ * Provides classes for working with Spring classes and interfaces from * `org.springframework.boot.*`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll index 6fec620ccd55..28108865af41 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for identifying Spring integration for the Apache Camel messaging framework. */ +overlay[local?] +module; import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll index d285e9d0e6a5..b5b3e9834c05 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringAutowire import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll index e434e53ca3dd..3f0cc6a25af2 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll index c93993336d95..ee00433da129 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.Maps import SpringWeb diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll index 34cf13a95716..5bcc2e896eb1 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll index e2ce38ea44e0..a568a6ee8c77 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll index 49ec6e1fd8a5..aa02643d698e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with the Spring Expression Language (SpEL). */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll index af0afa91f4c3..a7b1b655693b 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for the Spring BlazeDS integration. BlazeDS allows Java applications to integrate with * Apache Flex applications, which are ultimately deployed as Adobe Flash applications. */ +overlay[local?] +module; import java import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll index e12e2b2643a0..5f9271c01490 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll @@ -2,6 +2,8 @@ * Provides classes for working with Spring classes and interfaces from * `org.springframework.http`. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll index 0b8b3e3a87b4..6dc2b313841a 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringAbstractRef diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll index 688a14da32e2..1081b157d224 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll index 216333da38ae..2766df0b8bc9 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll index 5f07b2277067..b48834dc738e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll index 455fb956eb19..7e9b3423f888 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringListOrSet diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll index 521795d8b221..075cf7b7d8b4 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringMergable diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll index 4b17c23612a6..7371991cdaa6 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll index 19b2cfffdac7..a5766d7c7111 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringMergable diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll index baef7d3b91af..94402918b8ee 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll index 640305b313a2..d4a524c3502f 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll index c3f2c00a2b72..f08746dae5a3 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll index 48a2b3679901..2d8a4577e567 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringComponentScan diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll index 771370a3e7a1..96da7fa271c5 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll index a83eeed13fab..aec85de58d4e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll index 59a094f67612..00e7e8e52536 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringMergable diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll index eb57b37efe0a..ad927f48cbbc 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll index 89d58ff47fcd..8b799d632c23 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringAbstractRef diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll index 47e8d182898a..cf32c940f864 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll index 835b679d50a6..694dae05773a 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll @@ -2,6 +2,8 @@ * Provides classes for working with Spring classes and interfaces from * `org.springframework.security.*`. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll index 21aca5ff54eb..4f75d08401b7 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringListOrSet diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll index 55854d60f9c7..68cdfa7efcc2 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringXMLElement diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll index 88db87e7e21e..362d4b323648 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with Spring web requests. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll index e84108394704..0580415a3448 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll @@ -1,6 +1,8 @@ /** * Provides classes for working with Spring web clients. */ +overlay[local?] +module; import java import SpringHttp diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll index 312cd659b398..21bea51cd223 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.spring.SpringBeanFile import semmle.code.java.frameworks.spring.SpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll index ffbc5c9e5ecc..7624d4665719 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import semmle.code.java.frameworks.spring.SpringBean import semmle.code.java.frameworks.spring.SpringBeanFile import semmle.code.java.frameworks.spring.SpringEntry diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll index 999e34d1cea3..45d432848838 100644 --- a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll +++ b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import semmle.code.java.frameworks.spring.SpringBean import semmle.code.java.frameworks.spring.SpringBeanFile import semmle.code.java.frameworks.spring.metrics.MetricSpringBean diff --git a/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll b/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll index 599a08094dd4..28ca95b55413 100644 --- a/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll +++ b/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to the Stapler framework. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll b/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll index cb8b876be7ad..f9981a30393e 100644 --- a/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll +++ b/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with objects bound from Http requests in the context of * the Struts2 web framework. */ +overlay[local?] +module; import java private import semmle.code.java.Serializability diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll index 4200e83d4db2..6c5799d02750 100644 --- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll +++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.struts.StrutsConventions import semmle.code.java.frameworks.struts.StrutsXML diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll index d97415354b35..823951b1d3c5 100644 --- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll +++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll index 17ff35371945..3e2fd5c0b974 100644 --- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll +++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java import semmle.code.java.frameworks.struts.StrutsAnnotations import semmle.code.java.frameworks.struts.StrutsXML diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll index 273034978d17..33131a1641da 100644 --- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll +++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll b/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll index d3dca781e54b..e6fa5d9e5c26 100644 --- a/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll +++ b/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for computing metrics on Java methods and constructors. */ +overlay[local?] +module; import semmle.code.java.Member diff --git a/java/ql/lib/semmle/code/java/metrics/MetricElement.qll b/java/ql/lib/semmle/code/java/metrics/MetricElement.qll index 086389e143cd..f9d57df7f800 100644 --- a/java/ql/lib/semmle/code/java/metrics/MetricElement.qll +++ b/java/ql/lib/semmle/code/java/metrics/MetricElement.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for computing metrics on Java elements. */ +overlay[local?] +module; import semmle.code.java.Element import semmle.code.java.Type diff --git a/java/ql/lib/semmle/code/java/metrics/MetricField.qll b/java/ql/lib/semmle/code/java/metrics/MetricField.qll index ef8e692ba5f8..32e3b263c282 100644 --- a/java/ql/lib/semmle/code/java/metrics/MetricField.qll +++ b/java/ql/lib/semmle/code/java/metrics/MetricField.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for computing metrics on Java fields. */ +overlay[local?] +module; import semmle.code.java.Member diff --git a/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll b/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll index eafdd57dd8ac..fa7556316429 100644 --- a/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll +++ b/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for computing metrics on Java packages. */ +overlay[local?] +module; import semmle.code.java.Package import MetricElement diff --git a/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll b/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll index 17271394b2e6..1652a1200708 100644 --- a/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll +++ b/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for computing metrics on Java classes and interfaces. */ +overlay[local?] +module; import semmle.code.java.Type import MetricElement diff --git a/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll b/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll index b818c30edf6f..bc2cf5ae1072 100644 --- a/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll +++ b/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for computing metrics on Java statements. */ +overlay[local?] +module; import semmle.code.java.Statement diff --git a/java/ql/lib/semmle/code/java/os/OSCheck.qll b/java/ql/lib/semmle/code/java/os/OSCheck.qll index e3b3e56f72ce..97ad27c83dfb 100644 --- a/java/ql/lib/semmle/code/java/os/OSCheck.qll +++ b/java/ql/lib/semmle/code/java/os/OSCheck.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for guards that check for the current OS. */ +overlay[local?] +module; import java import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll b/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll index 763b96f5a02d..6a934bdd5785 100644 --- a/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll +++ b/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll @@ -1,6 +1,8 @@ /** * Defines configurations and steps for handling regexes */ +overlay[local?] +module; import java import semmle.code.java.dataflow.ExternalFlow diff --git a/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll b/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll index a07d7c741faa..0fe4b47ec485 100644 --- a/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll +++ b/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll @@ -1,4 +1,6 @@ /** Provides a class hierarchy corresponding to a parse tree of regular expressions. */ +overlay[local?] +module; private import semmle.code.java.regex.regex as RE // importing under a namescape to avoid naming conflict for `Top`. private import codeql.regex.nfa.NfaUtils as NfaUtils diff --git a/java/ql/lib/semmle/code/java/regex/regex.qll b/java/ql/lib/semmle/code/java/regex/regex.qll index f0336c2d0235..13f398699663 100644 --- a/java/ql/lib/semmle/code/java/regex/regex.qll +++ b/java/ql/lib/semmle/code/java/regex/regex.qll @@ -1,6 +1,8 @@ /** * Definitions for parsing regular expressions. */ +overlay[local?] +module; import java private import RegexFlowConfigs diff --git a/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll b/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll index 56c45611b142..08a86092afbb 100644 --- a/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll +++ b/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about Android Intent redirect vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll b/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll index 4a31dc2568d1..aaa7dbc562b8 100644 --- a/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll +++ b/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll @@ -1,4 +1,6 @@ /** Definitions for the insecure local authentication query. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll b/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll index 8d53766e0080..728eca0eaf10 100644 --- a/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll +++ b/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll @@ -1,4 +1,6 @@ /** Definitions for the web view certificate validation query */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll b/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll index 0402aca69872..8600ecda7ad1 100644 --- a/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll +++ b/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll @@ -1,4 +1,6 @@ /** Provide classes to reason about Android Intents that can install APKs. */ +overlay[local?] +module; import java import semmle.code.java.frameworks.android.Intent diff --git a/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll b/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll index 785dce3da7ed..5a8b5e975085 100644 --- a/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll +++ b/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll @@ -1,4 +1,6 @@ /** Provides guards and predicates to reason about arithmetic. */ +overlay[local?] +module; import semmle.code.java.arithmetic.Overflow import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/CommandArguments.qll b/java/ql/lib/semmle/code/java/security/CommandArguments.qll index eb4f589ac7f7..f161a83d17b0 100644 --- a/java/ql/lib/semmle/code/java/security/CommandArguments.qll +++ b/java/ql/lib/semmle/code/java/security/CommandArguments.qll @@ -1,6 +1,8 @@ /** * Definitions for reasoning about lists and arrays that are to be used as arguments to an external process. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.SSA diff --git a/java/ql/lib/semmle/code/java/security/ControlledString.qll b/java/ql/lib/semmle/code/java/security/ControlledString.qll index c760bf14e855..fa201b2e8b6f 100644 --- a/java/ql/lib/semmle/code/java/security/ControlledString.qll +++ b/java/ql/lib/semmle/code/java/security/ControlledString.qll @@ -3,6 +3,8 @@ * There is positive evidence that they are fully controlled by * the program source code. */ +overlay[local?] +module; import semmle.code.java.Expr import semmle.code.java.security.Validation diff --git a/java/ql/lib/semmle/code/java/security/Cookies.qll b/java/ql/lib/semmle/code/java/security/Cookies.qll index 202f18921ca6..b4db1b8fe467 100644 --- a/java/ql/lib/semmle/code/java/security/Cookies.qll +++ b/java/ql/lib/semmle/code/java/security/Cookies.qll @@ -1,4 +1,6 @@ /** Provides definitions to reason about HTTP cookies. */ +overlay[local?] +module; import java private import semmle.code.java.frameworks.Netty diff --git a/java/ql/lib/semmle/code/java/security/Encryption.qll b/java/ql/lib/semmle/code/java/security/Encryption.qll index ee8c1f5fbedc..b948a94962c7 100644 --- a/java/ql/lib/semmle/code/java/security/Encryption.qll +++ b/java/ql/lib/semmle/code/java/security/Encryption.qll @@ -1,6 +1,8 @@ /** * Provides predicates and classes relating to encryption in Java. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll b/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll index 360493e26356..809f45aa45a3 100644 --- a/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll +++ b/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll @@ -2,6 +2,8 @@ * Definitions for reasoning about untrusted data used in APIs defined outside the * database. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.FlowSources diff --git a/java/ql/lib/semmle/code/java/security/ExternalProcess.qll b/java/ql/lib/semmle/code/java/security/ExternalProcess.qll index 58f7457e9e30..600a45e509a0 100644 --- a/java/ql/lib/semmle/code/java/security/ExternalProcess.qll +++ b/java/ql/lib/semmle/code/java/security/ExternalProcess.qll @@ -1,4 +1,6 @@ /** Definitions related to external processes. */ +overlay[local?] +module; import semmle.code.java.Member private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/FileReadWrite.qll b/java/ql/lib/semmle/code/java/security/FileReadWrite.qll index 34d7ca1f2014..ae1b3f025a1a 100644 --- a/java/ql/lib/semmle/code/java/security/FileReadWrite.qll +++ b/java/ql/lib/semmle/code/java/security/FileReadWrite.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/security/FileWritable.qll b/java/ql/lib/semmle/code/java/security/FileWritable.qll index bb5d952802d1..d1833bf64d4d 100644 --- a/java/ql/lib/semmle/code/java/security/FileWritable.qll +++ b/java/ql/lib/semmle/code/java/security/FileWritable.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/java/security/FragmentInjection.qll b/java/ql/lib/semmle/code/java/security/FragmentInjection.qll index a22fad4d85e7..8cd5e32a5ecd 100644 --- a/java/ql/lib/semmle/code/java/security/FragmentInjection.qll +++ b/java/ql/lib/semmle/code/java/security/FragmentInjection.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about Android Fragment injection vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.TaintTracking diff --git a/java/ql/lib/semmle/code/java/security/GroovyInjection.qll b/java/ql/lib/semmle/code/java/security/GroovyInjection.qll index ea688a26f6ec..45d664897775 100644 --- a/java/ql/lib/semmle/code/java/security/GroovyInjection.qll +++ b/java/ql/lib/semmle/code/java/security/GroovyInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about Groovy code injection attacks. */ +overlay[local?] +module; private import semmle.code.java.dataflow.DataFlow private import semmle.code.java.dataflow.ExternalFlow diff --git a/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll b/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll index 0b373fa27f80..f7e0b9954858 100644 --- a/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll +++ b/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates relating to hardcoded credentials. */ +overlay[local?] +module; import java import SensitiveApi diff --git a/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll b/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll index d15d9d05d301..c6ad9458ba91 100644 --- a/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll +++ b/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates to detect comparing a parameter to a hard-coded credential. */ +overlay[local?] +module; import java import HardcodedCredentials diff --git a/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll b/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll index 995428b8e94f..03b3f7500809 100644 --- a/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll +++ b/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll @@ -1,6 +1,8 @@ /** * Provides a predicate identifying assignments of harcoded values to password fields. */ +overlay[local?] +module; import java import HardcodedCredentials diff --git a/java/ql/lib/semmle/code/java/security/HttpsUrls.qll b/java/ql/lib/semmle/code/java/security/HttpsUrls.qll index b56b8ba9c9f5..071f95b49902 100644 --- a/java/ql/lib/semmle/code/java/security/HttpsUrls.qll +++ b/java/ql/lib/semmle/code/java/security/HttpsUrls.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about plaintext HTTP vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll index 650527e88e45..94951c10c532 100644 --- a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll +++ b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for working with implicit `PendingIntent`s. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.ExternalFlow diff --git a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll index a57f643d8176..f66309c97bec 100644 --- a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll +++ b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll @@ -1,4 +1,6 @@ /** Provides taint tracking configurations to be used in queries related to implicit `PendingIntent`s. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.TaintTracking diff --git a/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll b/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll index 4aa21c4a260b..11cfcb1c6e57 100644 --- a/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll +++ b/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll @@ -1,4 +1,6 @@ /** Provides a class to identify implicitly exported Android components. */ +overlay[local?] +module; private import semmle.code.xml.AndroidManifest diff --git a/java/ql/lib/semmle/code/java/security/InformationLeak.qll b/java/ql/lib/semmle/code/java/security/InformationLeak.qll index 8fe7d2151650..ba7a7a52a707 100644 --- a/java/ql/lib/semmle/code/java/security/InformationLeak.qll +++ b/java/ql/lib/semmle/code/java/security/InformationLeak.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about System Information Leak vulnerabilities. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll b/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll index b21492406adf..9d26077396bf 100644 --- a/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll +++ b/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about Insecure Basic Authentication vulnerabilities. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll b/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll index 52d58afc9e76..117484b0241e 100644 --- a/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll +++ b/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about insecure LDAP authentication. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll b/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll index 41d8f28573ca..54e2b00b8f4b 100644 --- a/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll +++ b/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about insecure `TrustManager`s. */ +overlay[local?] +module; import java private import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll b/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll index 1f80136fdf19..6d28a124b854 100644 --- a/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll +++ b/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to insufficient key sizes in Java. */ +overlay[local?] +module; private import semmle.code.java.security.Encryption private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll b/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll index 876b2efd8409..d105db336101 100644 --- a/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll +++ b/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll @@ -1,4 +1,6 @@ /** Provides data flow configurations to be used in queries related to insufficient key sizes. */ +overlay[local?] +module; import semmle.code.java.dataflow.DataFlow import semmle.code.java.security.InsufficientKeySize diff --git a/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll b/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll index 2f9470f2bb9a..5ba3a6723467 100644 --- a/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll +++ b/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll @@ -2,6 +2,8 @@ * Provides classes and predicates to reason about Intent URI permission manipulation * vulnerabilities on Android. */ +overlay[local?] +module; import java private import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/JWT.qll b/java/ql/lib/semmle/code/java/security/JWT.qll index c282d32ea099..3f546d4edc05 100644 --- a/java/ql/lib/semmle/code/java/security/JWT.qll +++ b/java/ql/lib/semmle/code/java/security/JWT.qll @@ -1,4 +1,6 @@ /** Provides classes for working with JSON Web Token (JWT) libraries. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSinks diff --git a/java/ql/lib/semmle/code/java/security/JndiInjection.qll b/java/ql/lib/semmle/code/java/security/JndiInjection.qll index 3df8d6df378e..0e61a53c0ab0 100644 --- a/java/ql/lib/semmle/code/java/security/JndiInjection.qll +++ b/java/ql/lib/semmle/code/java/security/JndiInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about JNDI injection vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/LdapInjection.qll b/java/ql/lib/semmle/code/java/security/LdapInjection.qll index 54c8e28ba63d..ff92d40cf556 100644 --- a/java/ql/lib/semmle/code/java/security/LdapInjection.qll +++ b/java/ql/lib/semmle/code/java/security/LdapInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about LDAP injection attacks. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.TaintTracking diff --git a/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll b/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll index cc57fbce648d..4294ac84f687 100644 --- a/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll +++ b/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll @@ -2,6 +2,8 @@ * Provides a default taint sanitizer identifying comparisons against lists of * compile-time constants. */ +overlay[local?] +module; import java private import codeql.typeflow.UniversalFlow as UniversalFlow diff --git a/java/ql/lib/semmle/code/java/security/LogInjection.qll b/java/ql/lib/semmle/code/java/security/LogInjection.qll index 554aa8e4ebc9..da5a1dc73a0c 100644 --- a/java/ql/lib/semmle/code/java/security/LogInjection.qll +++ b/java/ql/lib/semmle/code/java/security/LogInjection.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to Log Injection vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/Mail.qll b/java/ql/lib/semmle/code/java/security/Mail.qll index 64bc22e4622f..5c68355ec3ee 100644 --- a/java/ql/lib/semmle/code/java/security/Mail.qll +++ b/java/ql/lib/semmle/code/java/security/Mail.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about email vulnerabilities. */ +overlay[local?] +module; import java import semmle.code.java.frameworks.Mail diff --git a/java/ql/lib/semmle/code/java/security/MvelInjection.qll b/java/ql/lib/semmle/code/java/security/MvelInjection.qll index a9773ffe1860..dc804d4a1854 100644 --- a/java/ql/lib/semmle/code/java/security/MvelInjection.qll +++ b/java/ql/lib/semmle/code/java/security/MvelInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about MVEL injection attacks. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/OgnlInjection.qll b/java/ql/lib/semmle/code/java/security/OgnlInjection.qll index 37f31618fc32..e3f93b39ece1 100644 --- a/java/ql/lib/semmle/code/java/security/OgnlInjection.qll +++ b/java/ql/lib/semmle/code/java/security/OgnlInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about OGNL injection vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll b/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll index aaf578a6225f..63ffb62ef63b 100644 --- a/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll +++ b/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about partial path traversal vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/PathSanitizer.qll b/java/ql/lib/semmle/code/java/security/PathSanitizer.qll index f3385c94646b..ed0761f6869e 100644 --- a/java/ql/lib/semmle/code/java/security/PathSanitizer.qll +++ b/java/ql/lib/semmle/code/java/security/PathSanitizer.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about sanitization of path injection vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/QueryInjection.qll b/java/ql/lib/semmle/code/java/security/QueryInjection.qll index df316155ba1a..583a41ce9335 100644 --- a/java/ql/lib/semmle/code/java/security/QueryInjection.qll +++ b/java/ql/lib/semmle/code/java/security/QueryInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about database query language injection vulnerabilities. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/RandomDataSource.qll b/java/ql/lib/semmle/code/java/security/RandomDataSource.qll index b44bcc07efe2..f040c858d9ce 100644 --- a/java/ql/lib/semmle/code/java/security/RandomDataSource.qll +++ b/java/ql/lib/semmle/code/java/security/RandomDataSource.qll @@ -1,6 +1,8 @@ /** * Defines classes representing random data sources. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.TypeFlow diff --git a/java/ql/lib/semmle/code/java/security/RelativePaths.qll b/java/ql/lib/semmle/code/java/security/RelativePaths.qll index 458bb7aea5d4..0c9e145268b6 100644 --- a/java/ql/lib/semmle/code/java/security/RelativePaths.qll +++ b/java/ql/lib/semmle/code/java/security/RelativePaths.qll @@ -1,4 +1,6 @@ /** Detection of strings and arrays of strings containing relative paths. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/security/RequestForgery.qll b/java/ql/lib/semmle/code/java/security/RequestForgery.qll index 1f3ce61406f7..5eb35c05cd47 100644 --- a/java/ql/lib/semmle/code/java/security/RequestForgery.qll +++ b/java/ql/lib/semmle/code/java/security/RequestForgery.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about server-side request forgery (SSRF) attacks. */ +overlay[local?] +module; import java import semmle.code.java.frameworks.Networking diff --git a/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll b/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll index 340f696db622..1238793ffd70 100644 --- a/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll +++ b/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about header splitting attacks. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/Sanitizers.qll b/java/ql/lib/semmle/code/java/security/Sanitizers.qll index 5340ba344823..21e7ccf264f9 100644 --- a/java/ql/lib/semmle/code/java/security/Sanitizers.qll +++ b/java/ql/lib/semmle/code/java/security/Sanitizers.qll @@ -1,4 +1,6 @@ /** Classes to represent sanitizers commonly used in dataflow and taint tracking configurations. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/SecurityFlag.qll b/java/ql/lib/semmle/code/java/security/SecurityFlag.qll index dab5d52bcb20..30718e3300fb 100644 --- a/java/ql/lib/semmle/code/java/security/SecurityFlag.qll +++ b/java/ql/lib/semmle/code/java/security/SecurityFlag.qll @@ -1,6 +1,8 @@ /** * Provides utility predicates to spot variable names, parameter names, and string literals that suggest deliberately insecure settings. */ +overlay[local?] +module; import java import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/SecurityTests.qll b/java/ql/lib/semmle/code/java/security/SecurityTests.qll index d2260de22a19..d8b714c18a1e 100644 --- a/java/ql/lib/semmle/code/java/security/SecurityTests.qll +++ b/java/ql/lib/semmle/code/java/security/SecurityTests.qll @@ -1,4 +1,6 @@ /** Test detection for the security pack. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/security/SensitiveActions.qll b/java/ql/lib/semmle/code/java/security/SensitiveActions.qll index 2320afb8eef0..6733219a8d5f 100644 --- a/java/ql/lib/semmle/code/java/security/SensitiveActions.qll +++ b/java/ql/lib/semmle/code/java/security/SensitiveActions.qll @@ -10,6 +10,8 @@ * in a fashion that the user can control. This includes authorization * methods such as logins, and sending of data, etc. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/security/SensitiveApi.qll b/java/ql/lib/semmle/code/java/security/SensitiveApi.qll index 559919f792ec..408fe73f904b 100644 --- a/java/ql/lib/semmle/code/java/security/SensitiveApi.qll +++ b/java/ql/lib/semmle/code/java/security/SensitiveApi.qll @@ -1,6 +1,8 @@ /** * Provides predicates defining methods that consume sensitive data, such as usernames and passwords. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/SpelInjection.qll b/java/ql/lib/semmle/code/java/security/SpelInjection.qll index 13eb195eae46..3c36b207ac03 100644 --- a/java/ql/lib/semmle/code/java/security/SpelInjection.qll +++ b/java/ql/lib/semmle/code/java/security/SpelInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about SpEL injection attacks. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll b/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll index 68c20adabdd1..9fb4e753aab5 100644 --- a/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll +++ b/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about exposed actuators in Spring Boot. */ +overlay[local?] +module; import java private import semmle.code.java.frameworks.spring.SpringSecurity diff --git a/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll b/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll index c4259ee5b9de..88a53ef13e75 100644 --- a/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll +++ b/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll @@ -1,4 +1,6 @@ /** Provides predicates to reason about disabling CSRF protection in Spring. */ +overlay[local?] +module; import java diff --git a/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll b/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll index 5d3b1c803d22..2d59b18fa90e 100644 --- a/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll +++ b/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll @@ -1,4 +1,6 @@ /** Definitions used by `SqlConcatenated.ql`. */ +overlay[local?] +module; import semmle.code.java.security.ControlledString import semmle.code.java.dataflow.TaintTracking diff --git a/java/ql/lib/semmle/code/java/security/TempDirUtils.qll b/java/ql/lib/semmle/code/java/security/TempDirUtils.qll index 33b6c46b916c..3d1623fa334c 100644 --- a/java/ql/lib/semmle/code/java/security/TempDirUtils.qll +++ b/java/ql/lib/semmle/code/java/security/TempDirUtils.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for reasoning about temporary file/directory creations. */ +overlay[local?] +module; import java private import semmle.code.java.environment.SystemProperty diff --git a/java/ql/lib/semmle/code/java/security/TemplateInjection.qll b/java/ql/lib/semmle/code/java/security/TemplateInjection.qll index 0b703780a035..58c48bb7f224 100644 --- a/java/ql/lib/semmle/code/java/security/TemplateInjection.qll +++ b/java/ql/lib/semmle/code/java/security/TemplateInjection.qll @@ -1,4 +1,6 @@ /** Definitions related to the server-side template injection (SST) query. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSources diff --git a/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll b/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll index afd3af221bed..3137ad423e0e 100644 --- a/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll +++ b/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll @@ -1,6 +1,8 @@ /** * Provides classes to reason about Unsafe Resource Fetching vulnerabilities in Android. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll b/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll index 60f0cef83847..61a76afecc8d 100644 --- a/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll +++ b/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates to reason about unsafe certificate trust vulnerablities. */ +overlay[local?] +module; import java private import semmle.code.java.frameworks.Networking diff --git a/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll b/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll index b19d06bbf88c..7cd10142a1e5 100644 --- a/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll +++ b/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about vulnerabilites related to content URIs. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.FlowSinks diff --git a/java/ql/lib/semmle/code/java/security/UrlRedirect.qll b/java/ql/lib/semmle/code/java/security/UrlRedirect.qll index 02f66e3f0e95..be6addfa2529 100644 --- a/java/ql/lib/semmle/code/java/security/UrlRedirect.qll +++ b/java/ql/lib/semmle/code/java/security/UrlRedirect.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about URL redirect attacks. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/Validation.qll b/java/ql/lib/semmle/code/java/security/Validation.qll index 664c55e70d82..69f57474317f 100644 --- a/java/ql/lib/semmle/code/java/security/Validation.qll +++ b/java/ql/lib/semmle/code/java/security/Validation.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import semmle.code.java.Expr import semmle.code.java.dataflow.SSA import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/XPath.qll b/java/ql/lib/semmle/code/java/security/XPath.qll index c2992fdc272a..cc3fde30091b 100644 --- a/java/ql/lib/semmle/code/java/security/XPath.qll +++ b/java/ql/lib/semmle/code/java/security/XPath.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about XPath vulnerabilities. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/XSS.qll b/java/ql/lib/semmle/code/java/security/XSS.qll index 9aafcd15f683..990371cc8cfe 100644 --- a/java/ql/lib/semmle/code/java/security/XSS.qll +++ b/java/ql/lib/semmle/code/java/security/XSS.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about Cross-site scripting (XSS) vulnerabilities. */ +overlay[local?] +module; import java import semmle.code.java.frameworks.Servlets diff --git a/java/ql/lib/semmle/code/java/security/XmlParsers.qll b/java/ql/lib/semmle/code/java/security/XmlParsers.qll index 5ca1dd95f99e..8bb2a015a14d 100644 --- a/java/ql/lib/semmle/code/java/security/XmlParsers.qll +++ b/java/ql/lib/semmle/code/java/security/XmlParsers.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates for modeling XML parsers in Java. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/XsltInjection.qll b/java/ql/lib/semmle/code/java/security/XsltInjection.qll index 56affafa2029..d54e92066443 100644 --- a/java/ql/lib/semmle/code/java/security/XsltInjection.qll +++ b/java/ql/lib/semmle/code/java/security/XsltInjection.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about XSLT injection vulnerabilities. */ +overlay[local?] +module; import java import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/Xxe.qll b/java/ql/lib/semmle/code/java/security/Xxe.qll index cf30b3c19c0d..5c3d075bfb1c 100644 --- a/java/ql/lib/semmle/code/java/security/Xxe.qll +++ b/java/ql/lib/semmle/code/java/security/Xxe.qll @@ -1,4 +1,6 @@ /** Provides classes to reason about XML eXternal Entity (XXE) vulnerabilities. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll b/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll index 29c4d0e5e3df..185b1b8a46e2 100644 --- a/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll +++ b/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll @@ -1,4 +1,6 @@ /** Provides predicates and classes to reason about the sizing and indexing of arrays. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll b/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll index 88dec6c2bb78..81bf8727e4fd 100644 --- a/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll +++ b/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for determining upper and lower bounds on a value determined by bounding checks that * have been made on dominant paths. */ +overlay[local?] +module; import java private import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll b/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll index 46df3a3ca7bb..f42e31b2d7e5 100644 --- a/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll +++ b/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll @@ -4,6 +4,8 @@ * Provides predicates for recommended encryption key sizes. * Such that we can share this logic across our CodeQL analysis of different languages. */ +overlay[local?] +module; /** Returns the minimum recommended key size for RSA. */ int minSecureKeySizeRsa() { result = 2048 } diff --git a/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll b/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll index 92d5dab5289a..eb27ec873752 100644 --- a/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll +++ b/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll @@ -1,4 +1,6 @@ /** Provides classes and predicates related to regex injection in Java. */ +overlay[local?] +module; import java private import semmle.code.java.dataflow.DataFlow diff --git a/java/ql/lib/semmle/code/xml/AndroidManifest.qll b/java/ql/lib/semmle/code/xml/AndroidManifest.qll index ad69546a4140..d20165a031ff 100644 --- a/java/ql/lib/semmle/code/xml/AndroidManifest.qll +++ b/java/ql/lib/semmle/code/xml/AndroidManifest.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Android manifest files. */ +overlay[local?] +module; import XML diff --git a/java/ql/lib/semmle/code/xml/Ant.qll b/java/ql/lib/semmle/code/xml/Ant.qll index 59cd2889096a..84d6ea927f72 100644 --- a/java/ql/lib/semmle/code/xml/Ant.qll +++ b/java/ql/lib/semmle/code/xml/Ant.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with targets in Apache Ant build files. */ +overlay[local?] +module; import XML diff --git a/java/ql/lib/semmle/code/xml/MavenPom.qll b/java/ql/lib/semmle/code/xml/MavenPom.qll index 313a0e08bd83..68c81c4ab905 100644 --- a/java/ql/lib/semmle/code/xml/MavenPom.qll +++ b/java/ql/lib/semmle/code/xml/MavenPom.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with Maven POM files and their content. */ +overlay[local?] +module; import XML diff --git a/java/ql/lib/semmle/code/xml/WebXML.qll b/java/ql/lib/semmle/code/xml/WebXML.qll index c356081c95f6..c741ce7c66b0 100644 --- a/java/ql/lib/semmle/code/xml/WebXML.qll +++ b/java/ql/lib/semmle/code/xml/WebXML.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + import java /** diff --git a/java/ql/lib/semmle/code/xml/XML.qll b/java/ql/lib/semmle/code/xml/XML.qll index 54157809260b..e4073362fc6f 100644 --- a/java/ql/lib/semmle/code/xml/XML.qll +++ b/java/ql/lib/semmle/code/xml/XML.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with XML files and their content. */ +overlay[local?] +module; import semmle.files.FileSystem private import codeql.xml.Xml diff --git a/java/ql/lib/semmle/files/FileSystem.qll b/java/ql/lib/semmle/files/FileSystem.qll index f56d54866140..bb55214dcd3b 100644 --- a/java/ql/lib/semmle/files/FileSystem.qll +++ b/java/ql/lib/semmle/files/FileSystem.qll @@ -1,3 +1,5 @@ /** Provides classes for working with files and folders. */ +overlay[local?] +module; import semmle.code.FileSystem diff --git a/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll b/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll index cd62fdb757e0..446b6a544c34 100644 --- a/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll +++ b/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import java as J private import codeql.util.test.InlineExpectationsTest diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl index 547a1e476069..985d7c701820 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl @@ -301,6 +301,7 @@ _NORMAL_DEPENDENCIES = { "lazy_static": Label("@vendor_ts__lazy_static-1.5.0//:lazy_static"), "rayon": Label("@vendor_ts__rayon-1.10.0//:rayon"), "regex": Label("@vendor_ts__regex-1.11.1//:regex"), + "serde_json": Label("@vendor_ts__serde_json-1.0.140//:serde_json"), "tracing": Label("@vendor_ts__tracing-0.1.41//:tracing"), "tracing-subscriber": Label("@vendor_ts__tracing-subscriber-0.3.19//:tracing_subscriber"), "tree-sitter": Label("@vendor_ts__tree-sitter-0.24.6//:tree_sitter"), diff --git a/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll b/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll index 46df3a3ca7bb..f42e31b2d7e5 100644 --- a/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll +++ b/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll @@ -4,6 +4,8 @@ * Provides predicates for recommended encryption key sizes. * Such that we can share this logic across our CodeQL analysis of different languages. */ +overlay[local?] +module; /** Returns the minimum recommended key size for RSA. */ int minSecureKeySizeRsa() { result = 2048 } diff --git a/ql/extractor/src/generator.rs b/ql/extractor/src/generator.rs index 1dca6969f348..ea663896e640 100644 --- a/ql/extractor/src/generator.rs +++ b/ql/extractor/src/generator.rs @@ -36,5 +36,5 @@ pub fn run(options: Options) -> std::io::Result<()> { }, ]; - generate(languages, options.dbscheme, options.library) + generate(languages, options.dbscheme, options.library, false) } diff --git a/ruby/codeql-extractor.yml b/ruby/codeql-extractor.yml index abb50db2a295..a832b0c10654 100644 --- a/ruby/codeql-extractor.yml +++ b/ruby/codeql-extractor.yml @@ -3,6 +3,7 @@ display_name: "Ruby" version: 0.1.0 column_kind: "utf8" legacy_qltest_extraction: true +overlay_support_version: 20250108 build_modes: - none github_api_languages: diff --git a/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/old.dbscheme b/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/old.dbscheme new file mode 100644 index 000000000000..dc51d416301d --- /dev/null +++ b/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/old.dbscheme @@ -0,0 +1,1532 @@ +// CodeQL database schema for Ruby +// Automatically generated from the tree-sitter grammar; do not edit + +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + +/*- Database metadata -*/ +databaseMetadata( + string metadataKey: string ref, + string value: string ref +); + +/*- Ruby dbscheme -*/ +@ruby_underscore_arg = @ruby_assignment | @ruby_binary | @ruby_conditional | @ruby_operator_assignment | @ruby_range | @ruby_unary | @ruby_underscore_primary + +@ruby_underscore_call_operator = @ruby_reserved_word + +@ruby_underscore_expression = @ruby_assignment | @ruby_binary | @ruby_break | @ruby_call | @ruby_match_pattern | @ruby_next | @ruby_operator_assignment | @ruby_return | @ruby_test_pattern | @ruby_unary | @ruby_underscore_arg | @ruby_yield + +@ruby_underscore_lhs = @ruby_call | @ruby_element_reference | @ruby_scope_resolution | @ruby_token_false | @ruby_token_nil | @ruby_token_true | @ruby_underscore_variable + +@ruby_underscore_method_name = @ruby_delimited_symbol | @ruby_setter | @ruby_token_constant | @ruby_token_identifier | @ruby_token_operator | @ruby_token_simple_symbol | @ruby_underscore_nonlocal_variable + +@ruby_underscore_nonlocal_variable = @ruby_token_class_variable | @ruby_token_global_variable | @ruby_token_instance_variable + +@ruby_underscore_pattern_constant = @ruby_scope_resolution | @ruby_token_constant + +@ruby_underscore_pattern_expr = @ruby_alternative_pattern | @ruby_as_pattern | @ruby_underscore_pattern_expr_basic + +@ruby_underscore_pattern_expr_basic = @ruby_array_pattern | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_parenthesized_pattern | @ruby_range | @ruby_token_identifier | @ruby_underscore_pattern_constant | @ruby_underscore_pattern_primitive | @ruby_variable_reference_pattern + +@ruby_underscore_pattern_primitive = @ruby_delimited_symbol | @ruby_lambda | @ruby_regex | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_encoding | @ruby_token_false | @ruby_token_file | @ruby_token_heredoc_beginning | @ruby_token_line | @ruby_token_nil | @ruby_token_self | @ruby_token_simple_symbol | @ruby_token_true | @ruby_unary | @ruby_underscore_simple_numeric + +@ruby_underscore_pattern_top_expr_body = @ruby_array_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_underscore_pattern_expr + +@ruby_underscore_primary = @ruby_array | @ruby_begin | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_delimited_symbol | @ruby_for | @ruby_hash | @ruby_if | @ruby_lambda | @ruby_method | @ruby_module | @ruby_next | @ruby_parenthesized_statements | @ruby_redo | @ruby_regex | @ruby_retry | @ruby_return | @ruby_singleton_class | @ruby_singleton_method | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_character | @ruby_token_heredoc_beginning | @ruby_token_simple_symbol | @ruby_unary | @ruby_underscore_lhs | @ruby_underscore_simple_numeric | @ruby_unless | @ruby_until | @ruby_while | @ruby_yield + +@ruby_underscore_simple_numeric = @ruby_complex | @ruby_rational | @ruby_token_float | @ruby_token_integer + +@ruby_underscore_statement = @ruby_alias | @ruby_begin_block | @ruby_end_block | @ruby_if_modifier | @ruby_rescue_modifier | @ruby_undef | @ruby_underscore_expression | @ruby_unless_modifier | @ruby_until_modifier | @ruby_while_modifier + +@ruby_underscore_variable = @ruby_token_constant | @ruby_token_identifier | @ruby_token_self | @ruby_token_super | @ruby_underscore_nonlocal_variable + +ruby_alias_def( + unique int id: @ruby_alias, + int alias: @ruby_underscore_method_name ref, + int name: @ruby_underscore_method_name ref +); + +#keyset[ruby_alternative_pattern, index] +ruby_alternative_pattern_alternatives( + int ruby_alternative_pattern: @ruby_alternative_pattern ref, + int index: int ref, + unique int alternatives: @ruby_underscore_pattern_expr_basic ref +); + +ruby_alternative_pattern_def( + unique int id: @ruby_alternative_pattern +); + +@ruby_argument_list_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_argument_list, index] +ruby_argument_list_child( + int ruby_argument_list: @ruby_argument_list ref, + int index: int ref, + unique int child: @ruby_argument_list_child_type ref +); + +ruby_argument_list_def( + unique int id: @ruby_argument_list +); + +@ruby_array_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_array, index] +ruby_array_child( + int ruby_array: @ruby_array ref, + int index: int ref, + unique int child: @ruby_array_child_type ref +); + +ruby_array_def( + unique int id: @ruby_array +); + +ruby_array_pattern_class( + unique int ruby_array_pattern: @ruby_array_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_array_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_array_pattern, index] +ruby_array_pattern_child( + int ruby_array_pattern: @ruby_array_pattern ref, + int index: int ref, + unique int child: @ruby_array_pattern_child_type ref +); + +ruby_array_pattern_def( + unique int id: @ruby_array_pattern +); + +ruby_as_pattern_def( + unique int id: @ruby_as_pattern, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_pattern_expr ref +); + +@ruby_assignment_left_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +@ruby_assignment_right_type = @ruby_rescue_modifier | @ruby_right_assignment_list | @ruby_splat_argument | @ruby_underscore_expression + +ruby_assignment_def( + unique int id: @ruby_assignment, + int left: @ruby_assignment_left_type ref, + int right: @ruby_assignment_right_type ref +); + +@ruby_bare_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_string, index] +ruby_bare_string_child( + int ruby_bare_string: @ruby_bare_string ref, + int index: int ref, + unique int child: @ruby_bare_string_child_type ref +); + +ruby_bare_string_def( + unique int id: @ruby_bare_string +); + +@ruby_bare_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_symbol, index] +ruby_bare_symbol_child( + int ruby_bare_symbol: @ruby_bare_symbol ref, + int index: int ref, + unique int child: @ruby_bare_symbol_child_type ref +); + +ruby_bare_symbol_def( + unique int id: @ruby_bare_symbol +); + +@ruby_begin_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin, index] +ruby_begin_child( + int ruby_begin: @ruby_begin ref, + int index: int ref, + unique int child: @ruby_begin_child_type ref +); + +ruby_begin_def( + unique int id: @ruby_begin +); + +@ruby_begin_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin_block, index] +ruby_begin_block_child( + int ruby_begin_block: @ruby_begin_block ref, + int index: int ref, + unique int child: @ruby_begin_block_child_type ref +); + +ruby_begin_block_def( + unique int id: @ruby_begin_block +); + +@ruby_binary_left_type = @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_binary.operator of + 0 = @ruby_binary_bangequal +| 1 = @ruby_binary_bangtilde +| 2 = @ruby_binary_percent +| 3 = @ruby_binary_ampersand +| 4 = @ruby_binary_ampersandampersand +| 5 = @ruby_binary_star +| 6 = @ruby_binary_starstar +| 7 = @ruby_binary_plus +| 8 = @ruby_binary_minus +| 9 = @ruby_binary_slash +| 10 = @ruby_binary_langle +| 11 = @ruby_binary_langlelangle +| 12 = @ruby_binary_langleequal +| 13 = @ruby_binary_langleequalrangle +| 14 = @ruby_binary_equalequal +| 15 = @ruby_binary_equalequalequal +| 16 = @ruby_binary_equaltilde +| 17 = @ruby_binary_rangle +| 18 = @ruby_binary_rangleequal +| 19 = @ruby_binary_ranglerangle +| 20 = @ruby_binary_caret +| 21 = @ruby_binary_and +| 22 = @ruby_binary_or +| 23 = @ruby_binary_pipe +| 24 = @ruby_binary_pipepipe +; + + +ruby_binary_def( + unique int id: @ruby_binary, + int left: @ruby_binary_left_type ref, + int operator: int ref, + int right: @ruby_underscore_expression ref +); + +ruby_block_body( + unique int ruby_block: @ruby_block ref, + unique int body: @ruby_block_body ref +); + +ruby_block_parameters( + unique int ruby_block: @ruby_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_block_def( + unique int id: @ruby_block +); + +ruby_block_argument_child( + unique int ruby_block_argument: @ruby_block_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_block_argument_def( + unique int id: @ruby_block_argument +); + +@ruby_block_body_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_block_body, index] +ruby_block_body_child( + int ruby_block_body: @ruby_block_body ref, + int index: int ref, + unique int child: @ruby_block_body_child_type ref +); + +ruby_block_body_def( + unique int id: @ruby_block_body +); + +ruby_block_parameter_name( + unique int ruby_block_parameter: @ruby_block_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_block_parameter_def( + unique int id: @ruby_block_parameter +); + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_locals( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int locals: @ruby_token_identifier ref +); + +@ruby_block_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_child( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int child: @ruby_block_parameters_child_type ref +); + +ruby_block_parameters_def( + unique int id: @ruby_block_parameters +); + +@ruby_body_statement_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_body_statement, index] +ruby_body_statement_child( + int ruby_body_statement: @ruby_body_statement ref, + int index: int ref, + unique int child: @ruby_body_statement_child_type ref +); + +ruby_body_statement_def( + unique int id: @ruby_body_statement +); + +ruby_break_child( + unique int ruby_break: @ruby_break ref, + unique int child: @ruby_argument_list ref +); + +ruby_break_def( + unique int id: @ruby_break +); + +ruby_call_arguments( + unique int ruby_call: @ruby_call ref, + unique int arguments: @ruby_argument_list ref +); + +@ruby_call_block_type = @ruby_block | @ruby_do_block + +ruby_call_block( + unique int ruby_call: @ruby_call ref, + unique int block: @ruby_call_block_type ref +); + +@ruby_call_method_type = @ruby_token_operator | @ruby_underscore_variable + +ruby_call_method( + unique int ruby_call: @ruby_call ref, + unique int method: @ruby_call_method_type ref +); + +ruby_call_operator( + unique int ruby_call: @ruby_call ref, + unique int operator: @ruby_underscore_call_operator ref +); + +ruby_call_receiver( + unique int ruby_call: @ruby_call ref, + unique int receiver: @ruby_underscore_primary ref +); + +ruby_call_def( + unique int id: @ruby_call +); + +ruby_case_value( + unique int ruby_case__: @ruby_case__ ref, + unique int value: @ruby_underscore_statement ref +); + +@ruby_case_child_type = @ruby_else | @ruby_when + +#keyset[ruby_case__, index] +ruby_case_child( + int ruby_case__: @ruby_case__ ref, + int index: int ref, + unique int child: @ruby_case_child_type ref +); + +ruby_case_def( + unique int id: @ruby_case__ +); + +#keyset[ruby_case_match, index] +ruby_case_match_clauses( + int ruby_case_match: @ruby_case_match ref, + int index: int ref, + unique int clauses: @ruby_in_clause ref +); + +ruby_case_match_else( + unique int ruby_case_match: @ruby_case_match ref, + unique int else: @ruby_else ref +); + +ruby_case_match_def( + unique int id: @ruby_case_match, + int value: @ruby_underscore_statement ref +); + +#keyset[ruby_chained_string, index] +ruby_chained_string_child( + int ruby_chained_string: @ruby_chained_string ref, + int index: int ref, + unique int child: @ruby_string__ ref +); + +ruby_chained_string_def( + unique int id: @ruby_chained_string +); + +ruby_class_body( + unique int ruby_class: @ruby_class ref, + unique int body: @ruby_body_statement ref +); + +@ruby_class_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_class_superclass( + unique int ruby_class: @ruby_class ref, + unique int superclass: @ruby_superclass ref +); + +ruby_class_def( + unique int id: @ruby_class, + int name: @ruby_class_name_type ref +); + +@ruby_complex_child_type = @ruby_rational | @ruby_token_float | @ruby_token_integer + +ruby_complex_def( + unique int id: @ruby_complex, + int child: @ruby_complex_child_type ref +); + +ruby_conditional_def( + unique int id: @ruby_conditional, + int alternative: @ruby_underscore_arg ref, + int condition: @ruby_underscore_arg ref, + int consequence: @ruby_underscore_arg ref +); + +@ruby_delimited_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_delimited_symbol, index] +ruby_delimited_symbol_child( + int ruby_delimited_symbol: @ruby_delimited_symbol ref, + int index: int ref, + unique int child: @ruby_delimited_symbol_child_type ref +); + +ruby_delimited_symbol_def( + unique int id: @ruby_delimited_symbol +); + +@ruby_destructured_left_assignment_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_destructured_left_assignment, index] +ruby_destructured_left_assignment_child( + int ruby_destructured_left_assignment: @ruby_destructured_left_assignment ref, + int index: int ref, + unique int child: @ruby_destructured_left_assignment_child_type ref +); + +ruby_destructured_left_assignment_def( + unique int id: @ruby_destructured_left_assignment +); + +@ruby_destructured_parameter_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_destructured_parameter, index] +ruby_destructured_parameter_child( + int ruby_destructured_parameter: @ruby_destructured_parameter ref, + int index: int ref, + unique int child: @ruby_destructured_parameter_child_type ref +); + +ruby_destructured_parameter_def( + unique int id: @ruby_destructured_parameter +); + +@ruby_do_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_do, index] +ruby_do_child( + int ruby_do: @ruby_do ref, + int index: int ref, + unique int child: @ruby_do_child_type ref +); + +ruby_do_def( + unique int id: @ruby_do +); + +ruby_do_block_body( + unique int ruby_do_block: @ruby_do_block ref, + unique int body: @ruby_body_statement ref +); + +ruby_do_block_parameters( + unique int ruby_do_block: @ruby_do_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_do_block_def( + unique int id: @ruby_do_block +); + +@ruby_element_reference_block_type = @ruby_block | @ruby_do_block + +ruby_element_reference_block( + unique int ruby_element_reference: @ruby_element_reference ref, + unique int block: @ruby_element_reference_block_type ref +); + +@ruby_element_reference_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_element_reference, index] +ruby_element_reference_child( + int ruby_element_reference: @ruby_element_reference ref, + int index: int ref, + unique int child: @ruby_element_reference_child_type ref +); + +ruby_element_reference_def( + unique int id: @ruby_element_reference, + int object: @ruby_underscore_primary ref +); + +@ruby_else_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_else, index] +ruby_else_child( + int ruby_else: @ruby_else ref, + int index: int ref, + unique int child: @ruby_else_child_type ref +); + +ruby_else_def( + unique int id: @ruby_else +); + +@ruby_elsif_alternative_type = @ruby_else | @ruby_elsif + +ruby_elsif_alternative( + unique int ruby_elsif: @ruby_elsif ref, + unique int alternative: @ruby_elsif_alternative_type ref +); + +ruby_elsif_consequence( + unique int ruby_elsif: @ruby_elsif ref, + unique int consequence: @ruby_then ref +); + +ruby_elsif_def( + unique int id: @ruby_elsif, + int condition: @ruby_underscore_statement ref +); + +@ruby_end_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_end_block, index] +ruby_end_block_child( + int ruby_end_block: @ruby_end_block ref, + int index: int ref, + unique int child: @ruby_end_block_child_type ref +); + +ruby_end_block_def( + unique int id: @ruby_end_block +); + +@ruby_ensure_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_ensure, index] +ruby_ensure_child( + int ruby_ensure: @ruby_ensure ref, + int index: int ref, + unique int child: @ruby_ensure_child_type ref +); + +ruby_ensure_def( + unique int id: @ruby_ensure +); + +ruby_exception_variable_def( + unique int id: @ruby_exception_variable, + int child: @ruby_underscore_lhs ref +); + +@ruby_exceptions_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_exceptions, index] +ruby_exceptions_child( + int ruby_exceptions: @ruby_exceptions ref, + int index: int ref, + unique int child: @ruby_exceptions_child_type ref +); + +ruby_exceptions_def( + unique int id: @ruby_exceptions +); + +ruby_expression_reference_pattern_def( + unique int id: @ruby_expression_reference_pattern, + int value: @ruby_underscore_expression ref +); + +ruby_find_pattern_class( + unique int ruby_find_pattern: @ruby_find_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_find_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_find_pattern, index] +ruby_find_pattern_child( + int ruby_find_pattern: @ruby_find_pattern ref, + int index: int ref, + unique int child: @ruby_find_pattern_child_type ref +); + +ruby_find_pattern_def( + unique int id: @ruby_find_pattern +); + +@ruby_for_pattern_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +ruby_for_def( + unique int id: @ruby_for, + int body: @ruby_do ref, + int pattern: @ruby_for_pattern_type ref, + int value: @ruby_in ref +); + +@ruby_hash_child_type = @ruby_hash_splat_argument | @ruby_pair + +#keyset[ruby_hash, index] +ruby_hash_child( + int ruby_hash: @ruby_hash ref, + int index: int ref, + unique int child: @ruby_hash_child_type ref +); + +ruby_hash_def( + unique int id: @ruby_hash +); + +ruby_hash_pattern_class( + unique int ruby_hash_pattern: @ruby_hash_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_hash_pattern_child_type = @ruby_hash_splat_parameter | @ruby_keyword_pattern | @ruby_token_hash_splat_nil + +#keyset[ruby_hash_pattern, index] +ruby_hash_pattern_child( + int ruby_hash_pattern: @ruby_hash_pattern ref, + int index: int ref, + unique int child: @ruby_hash_pattern_child_type ref +); + +ruby_hash_pattern_def( + unique int id: @ruby_hash_pattern +); + +ruby_hash_splat_argument_child( + unique int ruby_hash_splat_argument: @ruby_hash_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_hash_splat_argument_def( + unique int id: @ruby_hash_splat_argument +); + +ruby_hash_splat_parameter_name( + unique int ruby_hash_splat_parameter: @ruby_hash_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_hash_splat_parameter_def( + unique int id: @ruby_hash_splat_parameter +); + +@ruby_heredoc_body_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_heredoc_content | @ruby_token_heredoc_end + +#keyset[ruby_heredoc_body, index] +ruby_heredoc_body_child( + int ruby_heredoc_body: @ruby_heredoc_body ref, + int index: int ref, + unique int child: @ruby_heredoc_body_child_type ref +); + +ruby_heredoc_body_def( + unique int id: @ruby_heredoc_body +); + +@ruby_if_alternative_type = @ruby_else | @ruby_elsif + +ruby_if_alternative( + unique int ruby_if: @ruby_if ref, + unique int alternative: @ruby_if_alternative_type ref +); + +ruby_if_consequence( + unique int ruby_if: @ruby_if ref, + unique int consequence: @ruby_then ref +); + +ruby_if_def( + unique int id: @ruby_if, + int condition: @ruby_underscore_statement ref +); + +ruby_if_guard_def( + unique int id: @ruby_if_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_if_modifier_def( + unique int id: @ruby_if_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_in_def( + unique int id: @ruby_in, + int child: @ruby_underscore_arg ref +); + +ruby_in_clause_body( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int body: @ruby_then ref +); + +@ruby_in_clause_guard_type = @ruby_if_guard | @ruby_unless_guard + +ruby_in_clause_guard( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int guard: @ruby_in_clause_guard_type ref +); + +ruby_in_clause_def( + unique int id: @ruby_in_clause, + int pattern: @ruby_underscore_pattern_top_expr_body ref +); + +@ruby_interpolation_child_type = @ruby_token_empty_statement | @ruby_underscore_nonlocal_variable | @ruby_underscore_statement + +#keyset[ruby_interpolation, index] +ruby_interpolation_child( + int ruby_interpolation: @ruby_interpolation ref, + int index: int ref, + unique int child: @ruby_interpolation_child_type ref +); + +ruby_interpolation_def( + unique int id: @ruby_interpolation +); + +ruby_keyword_parameter_value( + unique int ruby_keyword_parameter: @ruby_keyword_parameter ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_keyword_parameter_def( + unique int id: @ruby_keyword_parameter, + int name: @ruby_token_identifier ref +); + +@ruby_keyword_pattern_key_type = @ruby_string__ | @ruby_token_hash_key_symbol + +ruby_keyword_pattern_value( + unique int ruby_keyword_pattern: @ruby_keyword_pattern ref, + unique int value: @ruby_underscore_pattern_expr ref +); + +ruby_keyword_pattern_def( + unique int id: @ruby_keyword_pattern, + int key__: @ruby_keyword_pattern_key_type ref +); + +@ruby_lambda_body_type = @ruby_block | @ruby_do_block + +ruby_lambda_parameters( + unique int ruby_lambda: @ruby_lambda ref, + unique int parameters: @ruby_lambda_parameters ref +); + +ruby_lambda_def( + unique int id: @ruby_lambda, + int body: @ruby_lambda_body_type ref +); + +@ruby_lambda_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_lambda_parameters, index] +ruby_lambda_parameters_child( + int ruby_lambda_parameters: @ruby_lambda_parameters ref, + int index: int ref, + unique int child: @ruby_lambda_parameters_child_type ref +); + +ruby_lambda_parameters_def( + unique int id: @ruby_lambda_parameters +); + +@ruby_left_assignment_list_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_left_assignment_list, index] +ruby_left_assignment_list_child( + int ruby_left_assignment_list: @ruby_left_assignment_list ref, + int index: int ref, + unique int child: @ruby_left_assignment_list_child_type ref +); + +ruby_left_assignment_list_def( + unique int id: @ruby_left_assignment_list +); + +ruby_match_pattern_def( + unique int id: @ruby_match_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_method_body( + unique int ruby_method: @ruby_method ref, + unique int body: @ruby_method_body_type ref +); + +ruby_method_parameters( + unique int ruby_method: @ruby_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_method_def( + unique int id: @ruby_method, + int name: @ruby_underscore_method_name ref +); + +@ruby_method_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_method_parameters, index] +ruby_method_parameters_child( + int ruby_method_parameters: @ruby_method_parameters ref, + int index: int ref, + unique int child: @ruby_method_parameters_child_type ref +); + +ruby_method_parameters_def( + unique int id: @ruby_method_parameters +); + +ruby_module_body( + unique int ruby_module: @ruby_module ref, + unique int body: @ruby_body_statement ref +); + +@ruby_module_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_module_def( + unique int id: @ruby_module, + int name: @ruby_module_name_type ref +); + +ruby_next_child( + unique int ruby_next: @ruby_next ref, + unique int child: @ruby_argument_list ref +); + +ruby_next_def( + unique int id: @ruby_next +); + +case @ruby_operator_assignment.operator of + 0 = @ruby_operator_assignment_percentequal +| 1 = @ruby_operator_assignment_ampersandampersandequal +| 2 = @ruby_operator_assignment_ampersandequal +| 3 = @ruby_operator_assignment_starstarequal +| 4 = @ruby_operator_assignment_starequal +| 5 = @ruby_operator_assignment_plusequal +| 6 = @ruby_operator_assignment_minusequal +| 7 = @ruby_operator_assignment_slashequal +| 8 = @ruby_operator_assignment_langlelangleequal +| 9 = @ruby_operator_assignment_ranglerangleequal +| 10 = @ruby_operator_assignment_caretequal +| 11 = @ruby_operator_assignment_pipeequal +| 12 = @ruby_operator_assignment_pipepipeequal +; + + +@ruby_operator_assignment_right_type = @ruby_rescue_modifier | @ruby_underscore_expression + +ruby_operator_assignment_def( + unique int id: @ruby_operator_assignment, + int left: @ruby_underscore_lhs ref, + int operator: int ref, + int right: @ruby_operator_assignment_right_type ref +); + +ruby_optional_parameter_def( + unique int id: @ruby_optional_parameter, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_arg ref +); + +@ruby_pair_key_type = @ruby_string__ | @ruby_token_hash_key_symbol | @ruby_underscore_arg + +ruby_pair_value( + unique int ruby_pair: @ruby_pair ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_pair_def( + unique int id: @ruby_pair, + int key__: @ruby_pair_key_type ref +); + +ruby_parenthesized_pattern_def( + unique int id: @ruby_parenthesized_pattern, + int child: @ruby_underscore_pattern_expr ref +); + +@ruby_parenthesized_statements_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_parenthesized_statements, index] +ruby_parenthesized_statements_child( + int ruby_parenthesized_statements: @ruby_parenthesized_statements ref, + int index: int ref, + unique int child: @ruby_parenthesized_statements_child_type ref +); + +ruby_parenthesized_statements_def( + unique int id: @ruby_parenthesized_statements +); + +@ruby_pattern_child_type = @ruby_splat_argument | @ruby_underscore_arg + +ruby_pattern_def( + unique int id: @ruby_pattern, + int child: @ruby_pattern_child_type ref +); + +@ruby_program_child_type = @ruby_token_empty_statement | @ruby_token_uninterpreted | @ruby_underscore_statement + +#keyset[ruby_program, index] +ruby_program_child( + int ruby_program: @ruby_program ref, + int index: int ref, + unique int child: @ruby_program_child_type ref +); + +ruby_program_def( + unique int id: @ruby_program +); + +@ruby_range_begin_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_begin( + unique int ruby_range: @ruby_range ref, + unique int begin: @ruby_range_begin_type ref +); + +@ruby_range_end_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_end( + unique int ruby_range: @ruby_range ref, + unique int end: @ruby_range_end_type ref +); + +case @ruby_range.operator of + 0 = @ruby_range_dotdot +| 1 = @ruby_range_dotdotdot +; + + +ruby_range_def( + unique int id: @ruby_range, + int operator: int ref +); + +@ruby_rational_child_type = @ruby_token_float | @ruby_token_integer + +ruby_rational_def( + unique int id: @ruby_rational, + int child: @ruby_rational_child_type ref +); + +ruby_redo_child( + unique int ruby_redo: @ruby_redo ref, + unique int child: @ruby_argument_list ref +); + +ruby_redo_def( + unique int id: @ruby_redo +); + +@ruby_regex_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_regex, index] +ruby_regex_child( + int ruby_regex: @ruby_regex ref, + int index: int ref, + unique int child: @ruby_regex_child_type ref +); + +ruby_regex_def( + unique int id: @ruby_regex +); + +ruby_rescue_body( + unique int ruby_rescue: @ruby_rescue ref, + unique int body: @ruby_then ref +); + +ruby_rescue_exceptions( + unique int ruby_rescue: @ruby_rescue ref, + unique int exceptions: @ruby_exceptions ref +); + +ruby_rescue_variable( + unique int ruby_rescue: @ruby_rescue ref, + unique int variable: @ruby_exception_variable ref +); + +ruby_rescue_def( + unique int id: @ruby_rescue +); + +@ruby_rescue_modifier_body_type = @ruby_underscore_arg | @ruby_underscore_statement + +ruby_rescue_modifier_def( + unique int id: @ruby_rescue_modifier, + int body: @ruby_rescue_modifier_body_type ref, + int handler: @ruby_underscore_expression ref +); + +ruby_rest_assignment_child( + unique int ruby_rest_assignment: @ruby_rest_assignment ref, + unique int child: @ruby_underscore_lhs ref +); + +ruby_rest_assignment_def( + unique int id: @ruby_rest_assignment +); + +ruby_retry_child( + unique int ruby_retry: @ruby_retry ref, + unique int child: @ruby_argument_list ref +); + +ruby_retry_def( + unique int id: @ruby_retry +); + +ruby_return_child( + unique int ruby_return: @ruby_return ref, + unique int child: @ruby_argument_list ref +); + +ruby_return_def( + unique int id: @ruby_return +); + +@ruby_right_assignment_list_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_right_assignment_list, index] +ruby_right_assignment_list_child( + int ruby_right_assignment_list: @ruby_right_assignment_list ref, + int index: int ref, + unique int child: @ruby_right_assignment_list_child_type ref +); + +ruby_right_assignment_list_def( + unique int id: @ruby_right_assignment_list +); + +@ruby_scope_resolution_scope_type = @ruby_underscore_pattern_constant | @ruby_underscore_primary + +ruby_scope_resolution_scope( + unique int ruby_scope_resolution: @ruby_scope_resolution ref, + unique int scope: @ruby_scope_resolution_scope_type ref +); + +ruby_scope_resolution_def( + unique int id: @ruby_scope_resolution, + int name: @ruby_token_constant ref +); + +ruby_setter_def( + unique int id: @ruby_setter, + int name: @ruby_token_identifier ref +); + +ruby_singleton_class_body( + unique int ruby_singleton_class: @ruby_singleton_class ref, + unique int body: @ruby_body_statement ref +); + +ruby_singleton_class_def( + unique int id: @ruby_singleton_class, + int value: @ruby_underscore_arg ref +); + +@ruby_singleton_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_singleton_method_body( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int body: @ruby_singleton_method_body_type ref +); + +@ruby_singleton_method_object_type = @ruby_underscore_arg | @ruby_underscore_variable + +ruby_singleton_method_parameters( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_singleton_method_def( + unique int id: @ruby_singleton_method, + int name: @ruby_underscore_method_name ref, + int object: @ruby_singleton_method_object_type ref +); + +ruby_splat_argument_child( + unique int ruby_splat_argument: @ruby_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_splat_argument_def( + unique int id: @ruby_splat_argument +); + +ruby_splat_parameter_name( + unique int ruby_splat_parameter: @ruby_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_splat_parameter_def( + unique int id: @ruby_splat_parameter +); + +@ruby_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_string__, index] +ruby_string_child( + int ruby_string__: @ruby_string__ ref, + int index: int ref, + unique int child: @ruby_string_child_type ref +); + +ruby_string_def( + unique int id: @ruby_string__ +); + +#keyset[ruby_string_array, index] +ruby_string_array_child( + int ruby_string_array: @ruby_string_array ref, + int index: int ref, + unique int child: @ruby_bare_string ref +); + +ruby_string_array_def( + unique int id: @ruby_string_array +); + +@ruby_subshell_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_subshell, index] +ruby_subshell_child( + int ruby_subshell: @ruby_subshell ref, + int index: int ref, + unique int child: @ruby_subshell_child_type ref +); + +ruby_subshell_def( + unique int id: @ruby_subshell +); + +ruby_superclass_def( + unique int id: @ruby_superclass, + int child: @ruby_underscore_expression ref +); + +#keyset[ruby_symbol_array, index] +ruby_symbol_array_child( + int ruby_symbol_array: @ruby_symbol_array ref, + int index: int ref, + unique int child: @ruby_bare_symbol ref +); + +ruby_symbol_array_def( + unique int id: @ruby_symbol_array +); + +ruby_test_pattern_def( + unique int id: @ruby_test_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_then_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_then, index] +ruby_then_child( + int ruby_then: @ruby_then ref, + int index: int ref, + unique int child: @ruby_then_child_type ref +); + +ruby_then_def( + unique int id: @ruby_then +); + +@ruby_unary_operand_type = @ruby_parenthesized_statements | @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_unary.operator of + 0 = @ruby_unary_bang +| 1 = @ruby_unary_plus +| 2 = @ruby_unary_minus +| 3 = @ruby_unary_definedquestion +| 4 = @ruby_unary_not +| 5 = @ruby_unary_tilde +; + + +ruby_unary_def( + unique int id: @ruby_unary, + int operand: @ruby_unary_operand_type ref, + int operator: int ref +); + +#keyset[ruby_undef, index] +ruby_undef_child( + int ruby_undef: @ruby_undef ref, + int index: int ref, + unique int child: @ruby_underscore_method_name ref +); + +ruby_undef_def( + unique int id: @ruby_undef +); + +@ruby_unless_alternative_type = @ruby_else | @ruby_elsif + +ruby_unless_alternative( + unique int ruby_unless: @ruby_unless ref, + unique int alternative: @ruby_unless_alternative_type ref +); + +ruby_unless_consequence( + unique int ruby_unless: @ruby_unless ref, + unique int consequence: @ruby_then ref +); + +ruby_unless_def( + unique int id: @ruby_unless, + int condition: @ruby_underscore_statement ref +); + +ruby_unless_guard_def( + unique int id: @ruby_unless_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_unless_modifier_def( + unique int id: @ruby_unless_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_until_def( + unique int id: @ruby_until, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_until_modifier_def( + unique int id: @ruby_until_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +@ruby_variable_reference_pattern_name_type = @ruby_token_identifier | @ruby_underscore_nonlocal_variable + +ruby_variable_reference_pattern_def( + unique int id: @ruby_variable_reference_pattern, + int name: @ruby_variable_reference_pattern_name_type ref +); + +ruby_when_body( + unique int ruby_when: @ruby_when ref, + unique int body: @ruby_then ref +); + +#keyset[ruby_when, index] +ruby_when_pattern( + int ruby_when: @ruby_when ref, + int index: int ref, + unique int pattern: @ruby_pattern ref +); + +ruby_when_def( + unique int id: @ruby_when +); + +ruby_while_def( + unique int id: @ruby_while, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_while_modifier_def( + unique int id: @ruby_while_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_yield_child( + unique int ruby_yield: @ruby_yield ref, + unique int child: @ruby_argument_list ref +); + +ruby_yield_def( + unique int id: @ruby_yield +); + +ruby_tokeninfo( + unique int id: @ruby_token, + int kind: int ref, + string value: string ref +); + +case @ruby_token.kind of + 0 = @ruby_reserved_word +| 1 = @ruby_token_character +| 2 = @ruby_token_class_variable +| 3 = @ruby_token_comment +| 4 = @ruby_token_constant +| 5 = @ruby_token_empty_statement +| 6 = @ruby_token_encoding +| 7 = @ruby_token_escape_sequence +| 8 = @ruby_token_false +| 9 = @ruby_token_file +| 10 = @ruby_token_float +| 11 = @ruby_token_forward_argument +| 12 = @ruby_token_forward_parameter +| 13 = @ruby_token_global_variable +| 14 = @ruby_token_hash_key_symbol +| 15 = @ruby_token_hash_splat_nil +| 16 = @ruby_token_heredoc_beginning +| 17 = @ruby_token_heredoc_content +| 18 = @ruby_token_heredoc_end +| 19 = @ruby_token_identifier +| 20 = @ruby_token_instance_variable +| 21 = @ruby_token_integer +| 22 = @ruby_token_line +| 23 = @ruby_token_nil +| 24 = @ruby_token_operator +| 25 = @ruby_token_self +| 26 = @ruby_token_simple_symbol +| 27 = @ruby_token_string_content +| 28 = @ruby_token_super +| 29 = @ruby_token_true +| 30 = @ruby_token_uninterpreted +; + + +@ruby_ast_node = @ruby_alias | @ruby_alternative_pattern | @ruby_argument_list | @ruby_array | @ruby_array_pattern | @ruby_as_pattern | @ruby_assignment | @ruby_bare_string | @ruby_bare_symbol | @ruby_begin | @ruby_begin_block | @ruby_binary | @ruby_block | @ruby_block_argument | @ruby_block_body | @ruby_block_parameter | @ruby_block_parameters | @ruby_body_statement | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_complex | @ruby_conditional | @ruby_delimited_symbol | @ruby_destructured_left_assignment | @ruby_destructured_parameter | @ruby_do | @ruby_do_block | @ruby_element_reference | @ruby_else | @ruby_elsif | @ruby_end_block | @ruby_ensure | @ruby_exception_variable | @ruby_exceptions | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_for | @ruby_hash | @ruby_hash_pattern | @ruby_hash_splat_argument | @ruby_hash_splat_parameter | @ruby_heredoc_body | @ruby_if | @ruby_if_guard | @ruby_if_modifier | @ruby_in | @ruby_in_clause | @ruby_interpolation | @ruby_keyword_parameter | @ruby_keyword_pattern | @ruby_lambda | @ruby_lambda_parameters | @ruby_left_assignment_list | @ruby_match_pattern | @ruby_method | @ruby_method_parameters | @ruby_module | @ruby_next | @ruby_operator_assignment | @ruby_optional_parameter | @ruby_pair | @ruby_parenthesized_pattern | @ruby_parenthesized_statements | @ruby_pattern | @ruby_program | @ruby_range | @ruby_rational | @ruby_redo | @ruby_regex | @ruby_rescue | @ruby_rescue_modifier | @ruby_rest_assignment | @ruby_retry | @ruby_return | @ruby_right_assignment_list | @ruby_scope_resolution | @ruby_setter | @ruby_singleton_class | @ruby_singleton_method | @ruby_splat_argument | @ruby_splat_parameter | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_superclass | @ruby_symbol_array | @ruby_test_pattern | @ruby_then | @ruby_token | @ruby_unary | @ruby_undef | @ruby_unless | @ruby_unless_guard | @ruby_unless_modifier | @ruby_until | @ruby_until_modifier | @ruby_variable_reference_pattern | @ruby_when | @ruby_while | @ruby_while_modifier | @ruby_yield + +ruby_ast_node_location( + unique int node: @ruby_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +ruby_ast_node_parent( + unique int node: @ruby_ast_node ref, + int parent: @ruby_ast_node ref, + int parent_index: int ref +); + +/*- Erb dbscheme -*/ +erb_comment_directive_child( + unique int erb_comment_directive: @erb_comment_directive ref, + unique int child: @erb_token_comment ref +); + +erb_comment_directive_def( + unique int id: @erb_comment_directive +); + +erb_directive_child( + unique int erb_directive: @erb_directive ref, + unique int child: @erb_token_code ref +); + +erb_directive_def( + unique int id: @erb_directive +); + +erb_graphql_directive_child( + unique int erb_graphql_directive: @erb_graphql_directive ref, + unique int child: @erb_token_code ref +); + +erb_graphql_directive_def( + unique int id: @erb_graphql_directive +); + +erb_output_directive_child( + unique int erb_output_directive: @erb_output_directive ref, + unique int child: @erb_token_code ref +); + +erb_output_directive_def( + unique int id: @erb_output_directive +); + +@erb_template_child_type = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_token_content + +#keyset[erb_template, index] +erb_template_child( + int erb_template: @erb_template ref, + int index: int ref, + unique int child: @erb_template_child_type ref +); + +erb_template_def( + unique int id: @erb_template +); + +erb_tokeninfo( + unique int id: @erb_token, + int kind: int ref, + string value: string ref +); + +case @erb_token.kind of + 0 = @erb_reserved_word +| 1 = @erb_token_code +| 2 = @erb_token_comment +| 3 = @erb_token_content +; + + +@erb_ast_node = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_template | @erb_token + +erb_ast_node_location( + unique int node: @erb_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +erb_ast_node_parent( + unique int node: @erb_ast_node ref, + int parent: @erb_ast_node ref, + int parent_index: int ref +); + diff --git a/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/ruby.dbscheme b/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/ruby.dbscheme new file mode 100644 index 000000000000..40a6b0a5e811 --- /dev/null +++ b/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/ruby.dbscheme @@ -0,0 +1,1526 @@ +// CodeQL database schema for Ruby +// Automatically generated from the tree-sitter grammar; do not edit + +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + +/*- Ruby dbscheme -*/ +@ruby_underscore_arg = @ruby_assignment | @ruby_binary | @ruby_conditional | @ruby_operator_assignment | @ruby_range | @ruby_unary | @ruby_underscore_primary + +@ruby_underscore_call_operator = @ruby_reserved_word + +@ruby_underscore_expression = @ruby_assignment | @ruby_binary | @ruby_break | @ruby_call | @ruby_match_pattern | @ruby_next | @ruby_operator_assignment | @ruby_return | @ruby_test_pattern | @ruby_unary | @ruby_underscore_arg | @ruby_yield + +@ruby_underscore_lhs = @ruby_call | @ruby_element_reference | @ruby_scope_resolution | @ruby_token_false | @ruby_token_nil | @ruby_token_true | @ruby_underscore_variable + +@ruby_underscore_method_name = @ruby_delimited_symbol | @ruby_setter | @ruby_token_constant | @ruby_token_identifier | @ruby_token_operator | @ruby_token_simple_symbol | @ruby_underscore_nonlocal_variable + +@ruby_underscore_nonlocal_variable = @ruby_token_class_variable | @ruby_token_global_variable | @ruby_token_instance_variable + +@ruby_underscore_pattern_constant = @ruby_scope_resolution | @ruby_token_constant + +@ruby_underscore_pattern_expr = @ruby_alternative_pattern | @ruby_as_pattern | @ruby_underscore_pattern_expr_basic + +@ruby_underscore_pattern_expr_basic = @ruby_array_pattern | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_parenthesized_pattern | @ruby_range | @ruby_token_identifier | @ruby_underscore_pattern_constant | @ruby_underscore_pattern_primitive | @ruby_variable_reference_pattern + +@ruby_underscore_pattern_primitive = @ruby_delimited_symbol | @ruby_lambda | @ruby_regex | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_encoding | @ruby_token_false | @ruby_token_file | @ruby_token_heredoc_beginning | @ruby_token_line | @ruby_token_nil | @ruby_token_self | @ruby_token_simple_symbol | @ruby_token_true | @ruby_unary | @ruby_underscore_simple_numeric + +@ruby_underscore_pattern_top_expr_body = @ruby_array_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_underscore_pattern_expr + +@ruby_underscore_primary = @ruby_array | @ruby_begin | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_delimited_symbol | @ruby_for | @ruby_hash | @ruby_if | @ruby_lambda | @ruby_method | @ruby_module | @ruby_next | @ruby_parenthesized_statements | @ruby_redo | @ruby_regex | @ruby_retry | @ruby_return | @ruby_singleton_class | @ruby_singleton_method | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_character | @ruby_token_heredoc_beginning | @ruby_token_simple_symbol | @ruby_unary | @ruby_underscore_lhs | @ruby_underscore_simple_numeric | @ruby_unless | @ruby_until | @ruby_while | @ruby_yield + +@ruby_underscore_simple_numeric = @ruby_complex | @ruby_rational | @ruby_token_float | @ruby_token_integer + +@ruby_underscore_statement = @ruby_alias | @ruby_begin_block | @ruby_end_block | @ruby_if_modifier | @ruby_rescue_modifier | @ruby_undef | @ruby_underscore_expression | @ruby_unless_modifier | @ruby_until_modifier | @ruby_while_modifier + +@ruby_underscore_variable = @ruby_token_constant | @ruby_token_identifier | @ruby_token_self | @ruby_token_super | @ruby_underscore_nonlocal_variable + +ruby_alias_def( + unique int id: @ruby_alias, + int alias: @ruby_underscore_method_name ref, + int name: @ruby_underscore_method_name ref +); + +#keyset[ruby_alternative_pattern, index] +ruby_alternative_pattern_alternatives( + int ruby_alternative_pattern: @ruby_alternative_pattern ref, + int index: int ref, + unique int alternatives: @ruby_underscore_pattern_expr_basic ref +); + +ruby_alternative_pattern_def( + unique int id: @ruby_alternative_pattern +); + +@ruby_argument_list_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_argument_list, index] +ruby_argument_list_child( + int ruby_argument_list: @ruby_argument_list ref, + int index: int ref, + unique int child: @ruby_argument_list_child_type ref +); + +ruby_argument_list_def( + unique int id: @ruby_argument_list +); + +@ruby_array_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_array, index] +ruby_array_child( + int ruby_array: @ruby_array ref, + int index: int ref, + unique int child: @ruby_array_child_type ref +); + +ruby_array_def( + unique int id: @ruby_array +); + +ruby_array_pattern_class( + unique int ruby_array_pattern: @ruby_array_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_array_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_array_pattern, index] +ruby_array_pattern_child( + int ruby_array_pattern: @ruby_array_pattern ref, + int index: int ref, + unique int child: @ruby_array_pattern_child_type ref +); + +ruby_array_pattern_def( + unique int id: @ruby_array_pattern +); + +ruby_as_pattern_def( + unique int id: @ruby_as_pattern, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_pattern_expr ref +); + +@ruby_assignment_left_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +@ruby_assignment_right_type = @ruby_rescue_modifier | @ruby_right_assignment_list | @ruby_splat_argument | @ruby_underscore_expression + +ruby_assignment_def( + unique int id: @ruby_assignment, + int left: @ruby_assignment_left_type ref, + int right: @ruby_assignment_right_type ref +); + +@ruby_bare_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_string, index] +ruby_bare_string_child( + int ruby_bare_string: @ruby_bare_string ref, + int index: int ref, + unique int child: @ruby_bare_string_child_type ref +); + +ruby_bare_string_def( + unique int id: @ruby_bare_string +); + +@ruby_bare_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_symbol, index] +ruby_bare_symbol_child( + int ruby_bare_symbol: @ruby_bare_symbol ref, + int index: int ref, + unique int child: @ruby_bare_symbol_child_type ref +); + +ruby_bare_symbol_def( + unique int id: @ruby_bare_symbol +); + +@ruby_begin_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin, index] +ruby_begin_child( + int ruby_begin: @ruby_begin ref, + int index: int ref, + unique int child: @ruby_begin_child_type ref +); + +ruby_begin_def( + unique int id: @ruby_begin +); + +@ruby_begin_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin_block, index] +ruby_begin_block_child( + int ruby_begin_block: @ruby_begin_block ref, + int index: int ref, + unique int child: @ruby_begin_block_child_type ref +); + +ruby_begin_block_def( + unique int id: @ruby_begin_block +); + +@ruby_binary_left_type = @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_binary.operator of + 0 = @ruby_binary_bangequal +| 1 = @ruby_binary_bangtilde +| 2 = @ruby_binary_percent +| 3 = @ruby_binary_ampersand +| 4 = @ruby_binary_ampersandampersand +| 5 = @ruby_binary_star +| 6 = @ruby_binary_starstar +| 7 = @ruby_binary_plus +| 8 = @ruby_binary_minus +| 9 = @ruby_binary_slash +| 10 = @ruby_binary_langle +| 11 = @ruby_binary_langlelangle +| 12 = @ruby_binary_langleequal +| 13 = @ruby_binary_langleequalrangle +| 14 = @ruby_binary_equalequal +| 15 = @ruby_binary_equalequalequal +| 16 = @ruby_binary_equaltilde +| 17 = @ruby_binary_rangle +| 18 = @ruby_binary_rangleequal +| 19 = @ruby_binary_ranglerangle +| 20 = @ruby_binary_caret +| 21 = @ruby_binary_and +| 22 = @ruby_binary_or +| 23 = @ruby_binary_pipe +| 24 = @ruby_binary_pipepipe +; + + +ruby_binary_def( + unique int id: @ruby_binary, + int left: @ruby_binary_left_type ref, + int operator: int ref, + int right: @ruby_underscore_expression ref +); + +ruby_block_body( + unique int ruby_block: @ruby_block ref, + unique int body: @ruby_block_body ref +); + +ruby_block_parameters( + unique int ruby_block: @ruby_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_block_def( + unique int id: @ruby_block +); + +ruby_block_argument_child( + unique int ruby_block_argument: @ruby_block_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_block_argument_def( + unique int id: @ruby_block_argument +); + +@ruby_block_body_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_block_body, index] +ruby_block_body_child( + int ruby_block_body: @ruby_block_body ref, + int index: int ref, + unique int child: @ruby_block_body_child_type ref +); + +ruby_block_body_def( + unique int id: @ruby_block_body +); + +ruby_block_parameter_name( + unique int ruby_block_parameter: @ruby_block_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_block_parameter_def( + unique int id: @ruby_block_parameter +); + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_locals( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int locals: @ruby_token_identifier ref +); + +@ruby_block_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_child( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int child: @ruby_block_parameters_child_type ref +); + +ruby_block_parameters_def( + unique int id: @ruby_block_parameters +); + +@ruby_body_statement_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_body_statement, index] +ruby_body_statement_child( + int ruby_body_statement: @ruby_body_statement ref, + int index: int ref, + unique int child: @ruby_body_statement_child_type ref +); + +ruby_body_statement_def( + unique int id: @ruby_body_statement +); + +ruby_break_child( + unique int ruby_break: @ruby_break ref, + unique int child: @ruby_argument_list ref +); + +ruby_break_def( + unique int id: @ruby_break +); + +ruby_call_arguments( + unique int ruby_call: @ruby_call ref, + unique int arguments: @ruby_argument_list ref +); + +@ruby_call_block_type = @ruby_block | @ruby_do_block + +ruby_call_block( + unique int ruby_call: @ruby_call ref, + unique int block: @ruby_call_block_type ref +); + +@ruby_call_method_type = @ruby_token_operator | @ruby_underscore_variable + +ruby_call_method( + unique int ruby_call: @ruby_call ref, + unique int method: @ruby_call_method_type ref +); + +ruby_call_operator( + unique int ruby_call: @ruby_call ref, + unique int operator: @ruby_underscore_call_operator ref +); + +ruby_call_receiver( + unique int ruby_call: @ruby_call ref, + unique int receiver: @ruby_underscore_primary ref +); + +ruby_call_def( + unique int id: @ruby_call +); + +ruby_case_value( + unique int ruby_case__: @ruby_case__ ref, + unique int value: @ruby_underscore_statement ref +); + +@ruby_case_child_type = @ruby_else | @ruby_when + +#keyset[ruby_case__, index] +ruby_case_child( + int ruby_case__: @ruby_case__ ref, + int index: int ref, + unique int child: @ruby_case_child_type ref +); + +ruby_case_def( + unique int id: @ruby_case__ +); + +#keyset[ruby_case_match, index] +ruby_case_match_clauses( + int ruby_case_match: @ruby_case_match ref, + int index: int ref, + unique int clauses: @ruby_in_clause ref +); + +ruby_case_match_else( + unique int ruby_case_match: @ruby_case_match ref, + unique int else: @ruby_else ref +); + +ruby_case_match_def( + unique int id: @ruby_case_match, + int value: @ruby_underscore_statement ref +); + +#keyset[ruby_chained_string, index] +ruby_chained_string_child( + int ruby_chained_string: @ruby_chained_string ref, + int index: int ref, + unique int child: @ruby_string__ ref +); + +ruby_chained_string_def( + unique int id: @ruby_chained_string +); + +ruby_class_body( + unique int ruby_class: @ruby_class ref, + unique int body: @ruby_body_statement ref +); + +@ruby_class_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_class_superclass( + unique int ruby_class: @ruby_class ref, + unique int superclass: @ruby_superclass ref +); + +ruby_class_def( + unique int id: @ruby_class, + int name: @ruby_class_name_type ref +); + +@ruby_complex_child_type = @ruby_rational | @ruby_token_float | @ruby_token_integer + +ruby_complex_def( + unique int id: @ruby_complex, + int child: @ruby_complex_child_type ref +); + +ruby_conditional_def( + unique int id: @ruby_conditional, + int alternative: @ruby_underscore_arg ref, + int condition: @ruby_underscore_arg ref, + int consequence: @ruby_underscore_arg ref +); + +@ruby_delimited_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_delimited_symbol, index] +ruby_delimited_symbol_child( + int ruby_delimited_symbol: @ruby_delimited_symbol ref, + int index: int ref, + unique int child: @ruby_delimited_symbol_child_type ref +); + +ruby_delimited_symbol_def( + unique int id: @ruby_delimited_symbol +); + +@ruby_destructured_left_assignment_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_destructured_left_assignment, index] +ruby_destructured_left_assignment_child( + int ruby_destructured_left_assignment: @ruby_destructured_left_assignment ref, + int index: int ref, + unique int child: @ruby_destructured_left_assignment_child_type ref +); + +ruby_destructured_left_assignment_def( + unique int id: @ruby_destructured_left_assignment +); + +@ruby_destructured_parameter_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_destructured_parameter, index] +ruby_destructured_parameter_child( + int ruby_destructured_parameter: @ruby_destructured_parameter ref, + int index: int ref, + unique int child: @ruby_destructured_parameter_child_type ref +); + +ruby_destructured_parameter_def( + unique int id: @ruby_destructured_parameter +); + +@ruby_do_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_do, index] +ruby_do_child( + int ruby_do: @ruby_do ref, + int index: int ref, + unique int child: @ruby_do_child_type ref +); + +ruby_do_def( + unique int id: @ruby_do +); + +ruby_do_block_body( + unique int ruby_do_block: @ruby_do_block ref, + unique int body: @ruby_body_statement ref +); + +ruby_do_block_parameters( + unique int ruby_do_block: @ruby_do_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_do_block_def( + unique int id: @ruby_do_block +); + +@ruby_element_reference_block_type = @ruby_block | @ruby_do_block + +ruby_element_reference_block( + unique int ruby_element_reference: @ruby_element_reference ref, + unique int block: @ruby_element_reference_block_type ref +); + +@ruby_element_reference_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_element_reference, index] +ruby_element_reference_child( + int ruby_element_reference: @ruby_element_reference ref, + int index: int ref, + unique int child: @ruby_element_reference_child_type ref +); + +ruby_element_reference_def( + unique int id: @ruby_element_reference, + int object: @ruby_underscore_primary ref +); + +@ruby_else_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_else, index] +ruby_else_child( + int ruby_else: @ruby_else ref, + int index: int ref, + unique int child: @ruby_else_child_type ref +); + +ruby_else_def( + unique int id: @ruby_else +); + +@ruby_elsif_alternative_type = @ruby_else | @ruby_elsif + +ruby_elsif_alternative( + unique int ruby_elsif: @ruby_elsif ref, + unique int alternative: @ruby_elsif_alternative_type ref +); + +ruby_elsif_consequence( + unique int ruby_elsif: @ruby_elsif ref, + unique int consequence: @ruby_then ref +); + +ruby_elsif_def( + unique int id: @ruby_elsif, + int condition: @ruby_underscore_statement ref +); + +@ruby_end_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_end_block, index] +ruby_end_block_child( + int ruby_end_block: @ruby_end_block ref, + int index: int ref, + unique int child: @ruby_end_block_child_type ref +); + +ruby_end_block_def( + unique int id: @ruby_end_block +); + +@ruby_ensure_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_ensure, index] +ruby_ensure_child( + int ruby_ensure: @ruby_ensure ref, + int index: int ref, + unique int child: @ruby_ensure_child_type ref +); + +ruby_ensure_def( + unique int id: @ruby_ensure +); + +ruby_exception_variable_def( + unique int id: @ruby_exception_variable, + int child: @ruby_underscore_lhs ref +); + +@ruby_exceptions_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_exceptions, index] +ruby_exceptions_child( + int ruby_exceptions: @ruby_exceptions ref, + int index: int ref, + unique int child: @ruby_exceptions_child_type ref +); + +ruby_exceptions_def( + unique int id: @ruby_exceptions +); + +ruby_expression_reference_pattern_def( + unique int id: @ruby_expression_reference_pattern, + int value: @ruby_underscore_expression ref +); + +ruby_find_pattern_class( + unique int ruby_find_pattern: @ruby_find_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_find_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_find_pattern, index] +ruby_find_pattern_child( + int ruby_find_pattern: @ruby_find_pattern ref, + int index: int ref, + unique int child: @ruby_find_pattern_child_type ref +); + +ruby_find_pattern_def( + unique int id: @ruby_find_pattern +); + +@ruby_for_pattern_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +ruby_for_def( + unique int id: @ruby_for, + int body: @ruby_do ref, + int pattern: @ruby_for_pattern_type ref, + int value: @ruby_in ref +); + +@ruby_hash_child_type = @ruby_hash_splat_argument | @ruby_pair + +#keyset[ruby_hash, index] +ruby_hash_child( + int ruby_hash: @ruby_hash ref, + int index: int ref, + unique int child: @ruby_hash_child_type ref +); + +ruby_hash_def( + unique int id: @ruby_hash +); + +ruby_hash_pattern_class( + unique int ruby_hash_pattern: @ruby_hash_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_hash_pattern_child_type = @ruby_hash_splat_parameter | @ruby_keyword_pattern | @ruby_token_hash_splat_nil + +#keyset[ruby_hash_pattern, index] +ruby_hash_pattern_child( + int ruby_hash_pattern: @ruby_hash_pattern ref, + int index: int ref, + unique int child: @ruby_hash_pattern_child_type ref +); + +ruby_hash_pattern_def( + unique int id: @ruby_hash_pattern +); + +ruby_hash_splat_argument_child( + unique int ruby_hash_splat_argument: @ruby_hash_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_hash_splat_argument_def( + unique int id: @ruby_hash_splat_argument +); + +ruby_hash_splat_parameter_name( + unique int ruby_hash_splat_parameter: @ruby_hash_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_hash_splat_parameter_def( + unique int id: @ruby_hash_splat_parameter +); + +@ruby_heredoc_body_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_heredoc_content | @ruby_token_heredoc_end + +#keyset[ruby_heredoc_body, index] +ruby_heredoc_body_child( + int ruby_heredoc_body: @ruby_heredoc_body ref, + int index: int ref, + unique int child: @ruby_heredoc_body_child_type ref +); + +ruby_heredoc_body_def( + unique int id: @ruby_heredoc_body +); + +@ruby_if_alternative_type = @ruby_else | @ruby_elsif + +ruby_if_alternative( + unique int ruby_if: @ruby_if ref, + unique int alternative: @ruby_if_alternative_type ref +); + +ruby_if_consequence( + unique int ruby_if: @ruby_if ref, + unique int consequence: @ruby_then ref +); + +ruby_if_def( + unique int id: @ruby_if, + int condition: @ruby_underscore_statement ref +); + +ruby_if_guard_def( + unique int id: @ruby_if_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_if_modifier_def( + unique int id: @ruby_if_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_in_def( + unique int id: @ruby_in, + int child: @ruby_underscore_arg ref +); + +ruby_in_clause_body( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int body: @ruby_then ref +); + +@ruby_in_clause_guard_type = @ruby_if_guard | @ruby_unless_guard + +ruby_in_clause_guard( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int guard: @ruby_in_clause_guard_type ref +); + +ruby_in_clause_def( + unique int id: @ruby_in_clause, + int pattern: @ruby_underscore_pattern_top_expr_body ref +); + +@ruby_interpolation_child_type = @ruby_token_empty_statement | @ruby_underscore_nonlocal_variable | @ruby_underscore_statement + +#keyset[ruby_interpolation, index] +ruby_interpolation_child( + int ruby_interpolation: @ruby_interpolation ref, + int index: int ref, + unique int child: @ruby_interpolation_child_type ref +); + +ruby_interpolation_def( + unique int id: @ruby_interpolation +); + +ruby_keyword_parameter_value( + unique int ruby_keyword_parameter: @ruby_keyword_parameter ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_keyword_parameter_def( + unique int id: @ruby_keyword_parameter, + int name: @ruby_token_identifier ref +); + +@ruby_keyword_pattern_key_type = @ruby_string__ | @ruby_token_hash_key_symbol + +ruby_keyword_pattern_value( + unique int ruby_keyword_pattern: @ruby_keyword_pattern ref, + unique int value: @ruby_underscore_pattern_expr ref +); + +ruby_keyword_pattern_def( + unique int id: @ruby_keyword_pattern, + int key__: @ruby_keyword_pattern_key_type ref +); + +@ruby_lambda_body_type = @ruby_block | @ruby_do_block + +ruby_lambda_parameters( + unique int ruby_lambda: @ruby_lambda ref, + unique int parameters: @ruby_lambda_parameters ref +); + +ruby_lambda_def( + unique int id: @ruby_lambda, + int body: @ruby_lambda_body_type ref +); + +@ruby_lambda_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_lambda_parameters, index] +ruby_lambda_parameters_child( + int ruby_lambda_parameters: @ruby_lambda_parameters ref, + int index: int ref, + unique int child: @ruby_lambda_parameters_child_type ref +); + +ruby_lambda_parameters_def( + unique int id: @ruby_lambda_parameters +); + +@ruby_left_assignment_list_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_left_assignment_list, index] +ruby_left_assignment_list_child( + int ruby_left_assignment_list: @ruby_left_assignment_list ref, + int index: int ref, + unique int child: @ruby_left_assignment_list_child_type ref +); + +ruby_left_assignment_list_def( + unique int id: @ruby_left_assignment_list +); + +ruby_match_pattern_def( + unique int id: @ruby_match_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_method_body( + unique int ruby_method: @ruby_method ref, + unique int body: @ruby_method_body_type ref +); + +ruby_method_parameters( + unique int ruby_method: @ruby_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_method_def( + unique int id: @ruby_method, + int name: @ruby_underscore_method_name ref +); + +@ruby_method_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_method_parameters, index] +ruby_method_parameters_child( + int ruby_method_parameters: @ruby_method_parameters ref, + int index: int ref, + unique int child: @ruby_method_parameters_child_type ref +); + +ruby_method_parameters_def( + unique int id: @ruby_method_parameters +); + +ruby_module_body( + unique int ruby_module: @ruby_module ref, + unique int body: @ruby_body_statement ref +); + +@ruby_module_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_module_def( + unique int id: @ruby_module, + int name: @ruby_module_name_type ref +); + +ruby_next_child( + unique int ruby_next: @ruby_next ref, + unique int child: @ruby_argument_list ref +); + +ruby_next_def( + unique int id: @ruby_next +); + +case @ruby_operator_assignment.operator of + 0 = @ruby_operator_assignment_percentequal +| 1 = @ruby_operator_assignment_ampersandampersandequal +| 2 = @ruby_operator_assignment_ampersandequal +| 3 = @ruby_operator_assignment_starstarequal +| 4 = @ruby_operator_assignment_starequal +| 5 = @ruby_operator_assignment_plusequal +| 6 = @ruby_operator_assignment_minusequal +| 7 = @ruby_operator_assignment_slashequal +| 8 = @ruby_operator_assignment_langlelangleequal +| 9 = @ruby_operator_assignment_ranglerangleequal +| 10 = @ruby_operator_assignment_caretequal +| 11 = @ruby_operator_assignment_pipeequal +| 12 = @ruby_operator_assignment_pipepipeequal +; + + +@ruby_operator_assignment_right_type = @ruby_rescue_modifier | @ruby_underscore_expression + +ruby_operator_assignment_def( + unique int id: @ruby_operator_assignment, + int left: @ruby_underscore_lhs ref, + int operator: int ref, + int right: @ruby_operator_assignment_right_type ref +); + +ruby_optional_parameter_def( + unique int id: @ruby_optional_parameter, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_arg ref +); + +@ruby_pair_key_type = @ruby_string__ | @ruby_token_hash_key_symbol | @ruby_underscore_arg + +ruby_pair_value( + unique int ruby_pair: @ruby_pair ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_pair_def( + unique int id: @ruby_pair, + int key__: @ruby_pair_key_type ref +); + +ruby_parenthesized_pattern_def( + unique int id: @ruby_parenthesized_pattern, + int child: @ruby_underscore_pattern_expr ref +); + +@ruby_parenthesized_statements_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_parenthesized_statements, index] +ruby_parenthesized_statements_child( + int ruby_parenthesized_statements: @ruby_parenthesized_statements ref, + int index: int ref, + unique int child: @ruby_parenthesized_statements_child_type ref +); + +ruby_parenthesized_statements_def( + unique int id: @ruby_parenthesized_statements +); + +@ruby_pattern_child_type = @ruby_splat_argument | @ruby_underscore_arg + +ruby_pattern_def( + unique int id: @ruby_pattern, + int child: @ruby_pattern_child_type ref +); + +@ruby_program_child_type = @ruby_token_empty_statement | @ruby_token_uninterpreted | @ruby_underscore_statement + +#keyset[ruby_program, index] +ruby_program_child( + int ruby_program: @ruby_program ref, + int index: int ref, + unique int child: @ruby_program_child_type ref +); + +ruby_program_def( + unique int id: @ruby_program +); + +@ruby_range_begin_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_begin( + unique int ruby_range: @ruby_range ref, + unique int begin: @ruby_range_begin_type ref +); + +@ruby_range_end_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_end( + unique int ruby_range: @ruby_range ref, + unique int end: @ruby_range_end_type ref +); + +case @ruby_range.operator of + 0 = @ruby_range_dotdot +| 1 = @ruby_range_dotdotdot +; + + +ruby_range_def( + unique int id: @ruby_range, + int operator: int ref +); + +@ruby_rational_child_type = @ruby_token_float | @ruby_token_integer + +ruby_rational_def( + unique int id: @ruby_rational, + int child: @ruby_rational_child_type ref +); + +ruby_redo_child( + unique int ruby_redo: @ruby_redo ref, + unique int child: @ruby_argument_list ref +); + +ruby_redo_def( + unique int id: @ruby_redo +); + +@ruby_regex_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_regex, index] +ruby_regex_child( + int ruby_regex: @ruby_regex ref, + int index: int ref, + unique int child: @ruby_regex_child_type ref +); + +ruby_regex_def( + unique int id: @ruby_regex +); + +ruby_rescue_body( + unique int ruby_rescue: @ruby_rescue ref, + unique int body: @ruby_then ref +); + +ruby_rescue_exceptions( + unique int ruby_rescue: @ruby_rescue ref, + unique int exceptions: @ruby_exceptions ref +); + +ruby_rescue_variable( + unique int ruby_rescue: @ruby_rescue ref, + unique int variable: @ruby_exception_variable ref +); + +ruby_rescue_def( + unique int id: @ruby_rescue +); + +@ruby_rescue_modifier_body_type = @ruby_underscore_arg | @ruby_underscore_statement + +ruby_rescue_modifier_def( + unique int id: @ruby_rescue_modifier, + int body: @ruby_rescue_modifier_body_type ref, + int handler: @ruby_underscore_expression ref +); + +ruby_rest_assignment_child( + unique int ruby_rest_assignment: @ruby_rest_assignment ref, + unique int child: @ruby_underscore_lhs ref +); + +ruby_rest_assignment_def( + unique int id: @ruby_rest_assignment +); + +ruby_retry_child( + unique int ruby_retry: @ruby_retry ref, + unique int child: @ruby_argument_list ref +); + +ruby_retry_def( + unique int id: @ruby_retry +); + +ruby_return_child( + unique int ruby_return: @ruby_return ref, + unique int child: @ruby_argument_list ref +); + +ruby_return_def( + unique int id: @ruby_return +); + +@ruby_right_assignment_list_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_right_assignment_list, index] +ruby_right_assignment_list_child( + int ruby_right_assignment_list: @ruby_right_assignment_list ref, + int index: int ref, + unique int child: @ruby_right_assignment_list_child_type ref +); + +ruby_right_assignment_list_def( + unique int id: @ruby_right_assignment_list +); + +@ruby_scope_resolution_scope_type = @ruby_underscore_pattern_constant | @ruby_underscore_primary + +ruby_scope_resolution_scope( + unique int ruby_scope_resolution: @ruby_scope_resolution ref, + unique int scope: @ruby_scope_resolution_scope_type ref +); + +ruby_scope_resolution_def( + unique int id: @ruby_scope_resolution, + int name: @ruby_token_constant ref +); + +ruby_setter_def( + unique int id: @ruby_setter, + int name: @ruby_token_identifier ref +); + +ruby_singleton_class_body( + unique int ruby_singleton_class: @ruby_singleton_class ref, + unique int body: @ruby_body_statement ref +); + +ruby_singleton_class_def( + unique int id: @ruby_singleton_class, + int value: @ruby_underscore_arg ref +); + +@ruby_singleton_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_singleton_method_body( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int body: @ruby_singleton_method_body_type ref +); + +@ruby_singleton_method_object_type = @ruby_underscore_arg | @ruby_underscore_variable + +ruby_singleton_method_parameters( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_singleton_method_def( + unique int id: @ruby_singleton_method, + int name: @ruby_underscore_method_name ref, + int object: @ruby_singleton_method_object_type ref +); + +ruby_splat_argument_child( + unique int ruby_splat_argument: @ruby_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_splat_argument_def( + unique int id: @ruby_splat_argument +); + +ruby_splat_parameter_name( + unique int ruby_splat_parameter: @ruby_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_splat_parameter_def( + unique int id: @ruby_splat_parameter +); + +@ruby_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_string__, index] +ruby_string_child( + int ruby_string__: @ruby_string__ ref, + int index: int ref, + unique int child: @ruby_string_child_type ref +); + +ruby_string_def( + unique int id: @ruby_string__ +); + +#keyset[ruby_string_array, index] +ruby_string_array_child( + int ruby_string_array: @ruby_string_array ref, + int index: int ref, + unique int child: @ruby_bare_string ref +); + +ruby_string_array_def( + unique int id: @ruby_string_array +); + +@ruby_subshell_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_subshell, index] +ruby_subshell_child( + int ruby_subshell: @ruby_subshell ref, + int index: int ref, + unique int child: @ruby_subshell_child_type ref +); + +ruby_subshell_def( + unique int id: @ruby_subshell +); + +ruby_superclass_def( + unique int id: @ruby_superclass, + int child: @ruby_underscore_expression ref +); + +#keyset[ruby_symbol_array, index] +ruby_symbol_array_child( + int ruby_symbol_array: @ruby_symbol_array ref, + int index: int ref, + unique int child: @ruby_bare_symbol ref +); + +ruby_symbol_array_def( + unique int id: @ruby_symbol_array +); + +ruby_test_pattern_def( + unique int id: @ruby_test_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_then_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_then, index] +ruby_then_child( + int ruby_then: @ruby_then ref, + int index: int ref, + unique int child: @ruby_then_child_type ref +); + +ruby_then_def( + unique int id: @ruby_then +); + +@ruby_unary_operand_type = @ruby_parenthesized_statements | @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_unary.operator of + 0 = @ruby_unary_bang +| 1 = @ruby_unary_plus +| 2 = @ruby_unary_minus +| 3 = @ruby_unary_definedquestion +| 4 = @ruby_unary_not +| 5 = @ruby_unary_tilde +; + + +ruby_unary_def( + unique int id: @ruby_unary, + int operand: @ruby_unary_operand_type ref, + int operator: int ref +); + +#keyset[ruby_undef, index] +ruby_undef_child( + int ruby_undef: @ruby_undef ref, + int index: int ref, + unique int child: @ruby_underscore_method_name ref +); + +ruby_undef_def( + unique int id: @ruby_undef +); + +@ruby_unless_alternative_type = @ruby_else | @ruby_elsif + +ruby_unless_alternative( + unique int ruby_unless: @ruby_unless ref, + unique int alternative: @ruby_unless_alternative_type ref +); + +ruby_unless_consequence( + unique int ruby_unless: @ruby_unless ref, + unique int consequence: @ruby_then ref +); + +ruby_unless_def( + unique int id: @ruby_unless, + int condition: @ruby_underscore_statement ref +); + +ruby_unless_guard_def( + unique int id: @ruby_unless_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_unless_modifier_def( + unique int id: @ruby_unless_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_until_def( + unique int id: @ruby_until, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_until_modifier_def( + unique int id: @ruby_until_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +@ruby_variable_reference_pattern_name_type = @ruby_token_identifier | @ruby_underscore_nonlocal_variable + +ruby_variable_reference_pattern_def( + unique int id: @ruby_variable_reference_pattern, + int name: @ruby_variable_reference_pattern_name_type ref +); + +ruby_when_body( + unique int ruby_when: @ruby_when ref, + unique int body: @ruby_then ref +); + +#keyset[ruby_when, index] +ruby_when_pattern( + int ruby_when: @ruby_when ref, + int index: int ref, + unique int pattern: @ruby_pattern ref +); + +ruby_when_def( + unique int id: @ruby_when +); + +ruby_while_def( + unique int id: @ruby_while, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_while_modifier_def( + unique int id: @ruby_while_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_yield_child( + unique int ruby_yield: @ruby_yield ref, + unique int child: @ruby_argument_list ref +); + +ruby_yield_def( + unique int id: @ruby_yield +); + +ruby_tokeninfo( + unique int id: @ruby_token, + int kind: int ref, + string value: string ref +); + +case @ruby_token.kind of + 0 = @ruby_reserved_word +| 1 = @ruby_token_character +| 2 = @ruby_token_class_variable +| 3 = @ruby_token_comment +| 4 = @ruby_token_constant +| 5 = @ruby_token_empty_statement +| 6 = @ruby_token_encoding +| 7 = @ruby_token_escape_sequence +| 8 = @ruby_token_false +| 9 = @ruby_token_file +| 10 = @ruby_token_float +| 11 = @ruby_token_forward_argument +| 12 = @ruby_token_forward_parameter +| 13 = @ruby_token_global_variable +| 14 = @ruby_token_hash_key_symbol +| 15 = @ruby_token_hash_splat_nil +| 16 = @ruby_token_heredoc_beginning +| 17 = @ruby_token_heredoc_content +| 18 = @ruby_token_heredoc_end +| 19 = @ruby_token_identifier +| 20 = @ruby_token_instance_variable +| 21 = @ruby_token_integer +| 22 = @ruby_token_line +| 23 = @ruby_token_nil +| 24 = @ruby_token_operator +| 25 = @ruby_token_self +| 26 = @ruby_token_simple_symbol +| 27 = @ruby_token_string_content +| 28 = @ruby_token_super +| 29 = @ruby_token_true +| 30 = @ruby_token_uninterpreted +; + + +@ruby_ast_node = @ruby_alias | @ruby_alternative_pattern | @ruby_argument_list | @ruby_array | @ruby_array_pattern | @ruby_as_pattern | @ruby_assignment | @ruby_bare_string | @ruby_bare_symbol | @ruby_begin | @ruby_begin_block | @ruby_binary | @ruby_block | @ruby_block_argument | @ruby_block_body | @ruby_block_parameter | @ruby_block_parameters | @ruby_body_statement | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_complex | @ruby_conditional | @ruby_delimited_symbol | @ruby_destructured_left_assignment | @ruby_destructured_parameter | @ruby_do | @ruby_do_block | @ruby_element_reference | @ruby_else | @ruby_elsif | @ruby_end_block | @ruby_ensure | @ruby_exception_variable | @ruby_exceptions | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_for | @ruby_hash | @ruby_hash_pattern | @ruby_hash_splat_argument | @ruby_hash_splat_parameter | @ruby_heredoc_body | @ruby_if | @ruby_if_guard | @ruby_if_modifier | @ruby_in | @ruby_in_clause | @ruby_interpolation | @ruby_keyword_parameter | @ruby_keyword_pattern | @ruby_lambda | @ruby_lambda_parameters | @ruby_left_assignment_list | @ruby_match_pattern | @ruby_method | @ruby_method_parameters | @ruby_module | @ruby_next | @ruby_operator_assignment | @ruby_optional_parameter | @ruby_pair | @ruby_parenthesized_pattern | @ruby_parenthesized_statements | @ruby_pattern | @ruby_program | @ruby_range | @ruby_rational | @ruby_redo | @ruby_regex | @ruby_rescue | @ruby_rescue_modifier | @ruby_rest_assignment | @ruby_retry | @ruby_return | @ruby_right_assignment_list | @ruby_scope_resolution | @ruby_setter | @ruby_singleton_class | @ruby_singleton_method | @ruby_splat_argument | @ruby_splat_parameter | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_superclass | @ruby_symbol_array | @ruby_test_pattern | @ruby_then | @ruby_token | @ruby_unary | @ruby_undef | @ruby_unless | @ruby_unless_guard | @ruby_unless_modifier | @ruby_until | @ruby_until_modifier | @ruby_variable_reference_pattern | @ruby_when | @ruby_while | @ruby_while_modifier | @ruby_yield + +ruby_ast_node_location( + unique int node: @ruby_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +ruby_ast_node_parent( + unique int node: @ruby_ast_node ref, + int parent: @ruby_ast_node ref, + int parent_index: int ref +); + +/*- Erb dbscheme -*/ +erb_comment_directive_child( + unique int erb_comment_directive: @erb_comment_directive ref, + unique int child: @erb_token_comment ref +); + +erb_comment_directive_def( + unique int id: @erb_comment_directive +); + +erb_directive_child( + unique int erb_directive: @erb_directive ref, + unique int child: @erb_token_code ref +); + +erb_directive_def( + unique int id: @erb_directive +); + +erb_graphql_directive_child( + unique int erb_graphql_directive: @erb_graphql_directive ref, + unique int child: @erb_token_code ref +); + +erb_graphql_directive_def( + unique int id: @erb_graphql_directive +); + +erb_output_directive_child( + unique int erb_output_directive: @erb_output_directive ref, + unique int child: @erb_token_code ref +); + +erb_output_directive_def( + unique int id: @erb_output_directive +); + +@erb_template_child_type = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_token_content + +#keyset[erb_template, index] +erb_template_child( + int erb_template: @erb_template ref, + int index: int ref, + unique int child: @erb_template_child_type ref +); + +erb_template_def( + unique int id: @erb_template +); + +erb_tokeninfo( + unique int id: @erb_token, + int kind: int ref, + string value: string ref +); + +case @erb_token.kind of + 0 = @erb_reserved_word +| 1 = @erb_token_code +| 2 = @erb_token_comment +| 3 = @erb_token_content +; + + +@erb_ast_node = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_template | @erb_token + +erb_ast_node_location( + unique int node: @erb_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +erb_ast_node_parent( + unique int node: @erb_ast_node ref, + int parent: @erb_ast_node ref, + int parent_index: int ref +); + diff --git a/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/upgrade.properties b/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/upgrade.properties new file mode 100644 index 000000000000..1d437ec8ac6b --- /dev/null +++ b/ruby/downgrades/dc51d416301df12df5b70fbc4338de6cc1f82bfd/upgrade.properties @@ -0,0 +1,3 @@ +description: Add databaseMetadata relation +compatibility: full +databaseMetadata.rel: delete diff --git a/ruby/extractor/Cargo.toml b/ruby/extractor/Cargo.toml index 8d3a94113fa2..16cdcca246c2 100644 --- a/ruby/extractor/Cargo.toml +++ b/ruby/extractor/Cargo.toml @@ -17,5 +17,6 @@ rayon = "1.10.0" regex = "1.11.1" encoding = "0.2" lazy_static = "1.5.0" +serde_json = "1.0.140" codeql-extractor = { path = "../../shared/tree-sitter-extractor" } diff --git a/ruby/extractor/src/extractor.rs b/ruby/extractor/src/extractor.rs index d42713122263..7a78bbdd1aea 100644 --- a/ruby/extractor/src/extractor.rs +++ b/ruby/extractor/src/extractor.rs @@ -1,7 +1,10 @@ use clap::Args; +use codeql_extractor::file_paths::PathTransformer; use lazy_static::lazy_static; use rayon::prelude::*; +use serde_json; use std::borrow::Cow; +use std::collections::HashSet; use std::fs; use std::io::BufRead; use std::path::{Path, PathBuf}; @@ -78,6 +81,9 @@ pub fn run(options: Options) -> std::io::Result<()> { let file_list = fs::File::open(file_paths::path_from_string(&options.file_list))?; + let overlay_changed_files: Option> = get_overlay_changed_files(); + let path_transformer = file_paths::load_path_transformer()?; + let language: Language = tree_sitter_ruby::LANGUAGE.into(); let erb: Language = tree_sitter_embedded_template::LANGUAGE.into(); // Look up tree-sitter kind ids now, to avoid string comparisons when scanning ERB files. @@ -94,7 +100,14 @@ pub fn run(options: Options) -> std::io::Result<()> { .try_for_each(|line| { let mut diagnostics_writer = diagnostics.logger(); let path = PathBuf::from(line).canonicalize()?; - let src_archive_file = file_paths::path_for(&src_archive_dir, &path, ""); + match &overlay_changed_files { + Some(changed_files) if !changed_files.contains(&path) => { + // We are extracting an overlay and this file is not in the list of changes files, so we should skip it. + return Result::Ok(()); + } + _ => {}, + } + let src_archive_file = file_paths::path_for(&src_archive_dir, &path, "", path_transformer.as_ref()); let mut source = std::fs::read(&path)?; let mut needs_conversion = false; let code_ranges; @@ -107,6 +120,7 @@ pub fn run(options: Options) -> std::io::Result<()> { &erb_schema, &mut diagnostics_writer, &mut trap_writer, + path_transformer.as_ref(), &path, &source, &[], @@ -151,7 +165,7 @@ pub fn run(options: Options) -> std::io::Result<()> { "character-decoding-error", "Character decoding error", ) - .file(&file_paths::normalize_path(&path)) + .file(&file_paths::normalize_and_transform_path(&path, path_transformer.as_ref())) .message( "Could not decode the file contents as {}: {}. The contents of the file must match the character encoding specified in the {} {}.", &[ @@ -171,7 +185,7 @@ pub fn run(options: Options) -> std::io::Result<()> { diagnostics_writer.write( diagnostics_writer .new_entry("unknown-character-encoding", "Could not process some files due to an unknown character encoding") - .file(&file_paths::normalize_path(&path)) + .file(&file_paths::normalize_and_transform_path(&path, path_transformer.as_ref())) .message( "Unknown character encoding {} in {} {}.", &[ @@ -194,6 +208,7 @@ pub fn run(options: Options) -> std::io::Result<()> { &schema, &mut diagnostics_writer, &mut trap_writer, + path_transformer.as_ref(), &path, &source, &code_ranges, @@ -204,14 +219,26 @@ pub fn run(options: Options) -> std::io::Result<()> { } else { std::fs::copy(&path, &src_archive_file)?; } - write_trap(&trap_dir, path, &trap_writer, trap_compression) + write_trap(&trap_dir, path, &trap_writer, trap_compression, path_transformer.as_ref()) }) .expect("failed to extract files"); let path = PathBuf::from("extras"); let mut trap_writer = trap::Writer::new(); extractor::populate_empty_location(&mut trap_writer); - let res = write_trap(&trap_dir, path, &trap_writer, trap_compression); + let res = write_trap( + &trap_dir, + path, + &trap_writer, + trap_compression, + path_transformer.as_ref(), + ); + if let Ok(output_path) = std::env::var("CODEQL_EXTRACTOR_RUBY_OVERLAY_BASE_METADATA_OUT") { + // We're extracting an overlay base. For now, we don't have any metadata we need to store + // that would get read when extracting the overlay, but the CLI expects us to write + // *something*. An empty file will do. + std::fs::write(output_path, b"")?; + } tracing::info!("Extraction complete"); res } @@ -237,8 +264,14 @@ fn write_trap( path: PathBuf, trap_writer: &trap::Writer, trap_compression: trap::Compression, + path_transformer: Option<&PathTransformer>, ) -> std::io::Result<()> { - let trap_file = file_paths::path_for(trap_dir, &path, trap_compression.extension()); + let trap_file = file_paths::path_for( + trap_dir, + &path, + trap_compression.extension(), + path_transformer, + ); std::fs::create_dir_all(trap_file.parent().unwrap())?; trap_writer.write_to_file(&trap_file, trap_compression) } @@ -302,6 +335,39 @@ fn skip_space(content: &[u8], index: usize) -> usize { } index } + +/** +* If the relevant environment variable has been set by the CLI, indicating that we are extracting +* an overlay, this function reads the JSON file at the path given by its value, and returns a set +* of canonicalized paths of source files that have changed and should therefore be extracted. +* +* If the environment variable is not set (i.e. we're not extracting an overlay), or if the file +* cannot be read, this function returns `None`. In that case, all files should be extracted. +*/ +fn get_overlay_changed_files() -> Option> { + let path = std::env::var("CODEQL_EXTRACTOR_RUBY_OVERLAY_CHANGES").ok()?; + let file_content = fs::read_to_string(path).ok()?; + let json_value: serde_json::Value = serde_json::from_str(&file_content).ok()?; + + // The JSON file is expected to have the following structure: + // { + // "changes": [ + // "relative/path/to/changed/file1.rb", + // "relative/path/to/changed/file2.rb", + // ... + // ] + // } + Some( + json_value + .get("changes")? + .as_array()? + .iter() + .filter_map(|change| change.as_str()) + .filter_map(|s| PathBuf::from(s).canonicalize().ok()) + .collect(), + ) +} + fn scan_coding_comment(content: &[u8]) -> std::option::Option> { let mut index = 0; // skip UTF-8 BOM marker if there is one diff --git a/ruby/extractor/src/generator.rs b/ruby/extractor/src/generator.rs index 00d878243aee..1601d2edda68 100644 --- a/ruby/extractor/src/generator.rs +++ b/ruby/extractor/src/generator.rs @@ -28,5 +28,5 @@ pub fn run(options: Options) -> std::io::Result<()> { }, ]; - generate(languages, options.dbscheme, options.library) + generate(languages, options.dbscheme, options.library, true) } diff --git a/ruby/ql/lib/codeql/Locations.qll b/ruby/ql/lib/codeql/Locations.qll index 148c6b01f2d9..df52d6822a2e 100644 --- a/ruby/ql/lib/codeql/Locations.qll +++ b/ruby/ql/lib/codeql/Locations.qll @@ -1,4 +1,6 @@ /** Provides classes for working with locations. */ +overlay[local] +module; import files.FileSystem diff --git a/ruby/ql/lib/codeql/files/FileSystem.qll b/ruby/ql/lib/codeql/files/FileSystem.qll index 528dde52fd91..6cc771fad9d2 100644 --- a/ruby/ql/lib/codeql/files/FileSystem.qll +++ b/ruby/ql/lib/codeql/files/FileSystem.qll @@ -1,4 +1,6 @@ /** Provides classes for working with files and folders. */ +overlay[local] +module; private import codeql.Locations private import codeql.util.FileSystem diff --git a/ruby/ql/lib/codeql/ruby/AST.qll b/ruby/ql/lib/codeql/ruby/AST.qll index bd42696a8dbe..2c2dbdfa5322 100644 --- a/ruby/ql/lib/codeql/ruby/AST.qll +++ b/ruby/ql/lib/codeql/ruby/AST.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + import codeql.Locations import ast.Call import ast.Control diff --git a/ruby/ql/lib/codeql/ruby/Diagnostics.qll b/ruby/ql/lib/codeql/ruby/Diagnostics.qll index 58de14b8fcf5..5b55eec38098 100644 --- a/ruby/ql/lib/codeql/ruby/Diagnostics.qll +++ b/ruby/ql/lib/codeql/ruby/Diagnostics.qll @@ -1,4 +1,6 @@ /** Provides classes relating to extraction diagnostics. */ +overlay[local] +module; private import codeql.Locations diff --git a/ruby/ql/lib/codeql/ruby/ast/Call.qll b/ruby/ql/lib/codeql/ruby/ast/Call.qll index 8a69ebd36fbb..3a82d0d39b38 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Call.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Call.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Call @@ -52,6 +55,7 @@ class Call extends Expr instanceof CallImpl { final int getNumberOfArguments() { result = super.getNumberOfArgumentsImpl() } /** Gets a potential target of this call, if any. */ + overlay[global] final Callable getATarget() { exists(DataFlowCall c | this = c.asCall().getExpr() and @@ -153,6 +157,7 @@ class MethodCall extends Call instanceof MethodCallImpl { * TODO: When API Graphs is able to resolve calls to methods like `Kernel.send` * this class is no longer necessary and should be removed. */ +overlay[global] class UnknownMethodCall extends MethodCall { UnknownMethodCall() { not exists(this.(Call).getATarget()) } } diff --git a/ruby/ql/lib/codeql/ruby/ast/Constant.qll b/ruby/ql/lib/codeql/ruby/ast/Constant.qll index fef057bc88ee..9c7ac62e542a 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Constant.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Constant.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Constant diff --git a/ruby/ql/lib/codeql/ruby/ast/Control.qll b/ruby/ql/lib/codeql/ruby/ast/Control.qll index 18182d8268ac..5d83e7a62fd2 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Control.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Control.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Control diff --git a/ruby/ql/lib/codeql/ruby/ast/Erb.qll b/ruby/ql/lib/codeql/ruby/ast/Erb.qll index 4dbcca734254..4def19f7ceb5 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Erb.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Erb.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.Erb private import internal.TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/Expr.qll b/ruby/ql/lib/codeql/ruby/ast/Expr.qll index 5f916fbec5cf..8ab203aed874 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Expr.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Expr.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Literal.qll b/ruby/ql/lib/codeql/ruby/ast/Literal.qll index cdeae9e64a6e..a32ca16e24c7 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Literal.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Literal.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.Regexp as RE private import internal.AST @@ -387,6 +390,7 @@ class RegExpLiteral extends StringlikeLiteral instanceof RegExpLiteralImpl { final predicate hasFreeSpacingFlag() { this.getFlagString().charAt(_) = "x" } /** Returns the root node of the parse tree of this regular expression. */ + overlay[global] final RE::RegExpTerm getParsed() { result = RE::getParsedRegExp(this) } } diff --git a/ruby/ql/lib/codeql/ruby/ast/Method.qll b/ruby/ql/lib/codeql/ruby/ast/Method.qll index 61ee58019d1e..60c0c705b311 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Method.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Method.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.controlflow.ControlFlowGraph private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Module.qll b/ruby/ql/lib/codeql/ruby/ast/Module.qll index 9e2ca31ee61e..671910bfaefe 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Module.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Module.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Operation.qll b/ruby/ql/lib/codeql/ruby/ast/Operation.qll index 2e005a207e3f..b9046a930b31 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Operation.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Operation.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/Parameter.qll b/ruby/ql/lib/codeql/ruby/ast/Parameter.qll index c4b233b62b6e..5b3994378c16 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Parameter.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Parameter.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Variable diff --git a/ruby/ql/lib/codeql/ruby/ast/Pattern.qll b/ruby/ql/lib/codeql/ruby/ast/Pattern.qll index ef7786640313..f705bf28301f 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Pattern.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Pattern.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Pattern diff --git a/ruby/ql/lib/codeql/ruby/ast/Scope.qll b/ruby/ql/lib/codeql/ruby/ast/Scope.qll index 3e8437f79b35..334b36b583f3 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Scope.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Scope.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Scope diff --git a/ruby/ql/lib/codeql/ruby/ast/Statement.qll b/ruby/ql/lib/codeql/ruby/ast/Statement.qll index 24e18fe4c362..dcd51dbb3272 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Statement.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Statement.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Variable.qll b/ruby/ql/lib/codeql/ruby/ast/Variable.qll index fa00cfb4cc7c..f5fb4b606046 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Variable.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Variable.qll @@ -1,4 +1,6 @@ /** Provides classes for modeling program variables. */ +overlay[local] +module; private import codeql.ruby.AST private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll b/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll index badcf1d6c6ff..ee46fbe8b66a 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + import codeql.Locations private import TreeSitter private import codeql.ruby.ast.internal.Call diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll index 5bb34989a904..4f3c236f1024 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import Variable private import codeql.ruby.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll index a04efc1ec94f..133cea315c3d 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST private import codeql.ruby.ast.internal.Literal diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll index 7b95d67efc45..dd57a0d197de 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll index 7a69bf5b783d..29960486907b 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + import codeql.Locations private import TreeSitter private import codeql.ruby.ast.Erb diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll index ba4f9e51f4e9..fdeec446a937 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll index a82256a0162a..cae76a145f57 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import Constant diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll index 075ac5fb8fa9..c4dd1abbee02 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll index 6905dd5ff2d1..d222316bf26b 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import Scope as Scope diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll index 54c763e24d39..eeec2198b625 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll index dc7fb8c7695e..8f07554fb0c1 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll index c59898d88eeb..a30cce32c7c6 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.ast.internal.Expr private import codeql.ruby.ast.internal.Parameter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll index 8f5bde5aeecb..9ec237012bc2 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll index 5d1ee81c0139..f2be91a63e51 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll @@ -1,4 +1,6 @@ /** Provides predicates for synthesizing AST nodes. */ +overlay[local] +module; private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll b/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll index e339b07d35b9..ca0b139a977a 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll @@ -5,6 +5,11 @@ import codeql.Locations as L +/** Holds if the database is an overlay. */ +overlay[local] +private predicate isOverlay() { databaseMetadata("isOverlay", "true") } + +overlay[local] module Ruby { /** The base class for all AST nodes */ class AstNode extends @ruby_ast_node { @@ -48,6 +53,27 @@ module Ruby { final override string getAPrimaryQlClass() { result = "ReservedWord" } } + /** Gets the file containing the given `node`. */ + private @file getNodeFile(@ruby_ast_node node) { + exists(@location_default loc | ruby_ast_node_location(node, loc) | + locations_default(loc, result, _, _, _, _) + ) + } + + /** Holds if `file` was extracted as part of the overlay database. */ + private predicate discardFile(@file file) { isOverlay() and file = getNodeFile(_) } + + /** Holds if `node` is in the `file` and is part of the overlay base database. */ + private predicate discardableAstNode(@file file, @ruby_ast_node node) { + not isOverlay() and file = getNodeFile(node) + } + + /** Holds if `node` should be discarded, because it is part of the overlay base and is in a file that was also extracted as part of the overlay database. */ + overlay[discard_entity] + private predicate discardAstNode(@ruby_ast_node node) { + exists(@file file | discardableAstNode(file, node) and discardFile(file)) + } + class UnderscoreArg extends @ruby_underscore_arg, AstNode { } class UnderscoreCallOperator extends @ruby_underscore_call_operator, AstNode { } @@ -1927,6 +1953,7 @@ module Ruby { } } +overlay[local] module Erb { /** The base class for all AST nodes */ class AstNode extends @erb_ast_node { @@ -1970,6 +1997,27 @@ module Erb { final override string getAPrimaryQlClass() { result = "ReservedWord" } } + /** Gets the file containing the given `node`. */ + private @file getNodeFile(@erb_ast_node node) { + exists(@location_default loc | erb_ast_node_location(node, loc) | + locations_default(loc, result, _, _, _, _) + ) + } + + /** Holds if `file` was extracted as part of the overlay database. */ + private predicate discardFile(@file file) { isOverlay() and file = getNodeFile(_) } + + /** Holds if `node` is in the `file` and is part of the overlay base database. */ + private predicate discardableAstNode(@file file, @erb_ast_node node) { + not isOverlay() and file = getNodeFile(node) + } + + /** Holds if `node` should be discarded, because it is part of the overlay base and is in a file that was also extracted as part of the overlay database. */ + overlay[discard_entity] + private predicate discardAstNode(@erb_ast_node node) { + exists(@file file | discardableAstNode(file, node) and discardFile(file)) + } + /** A class representing `code` tokens. */ class Code extends @erb_token_code, Token { /** Gets the name of the primary QL class for this element. */ diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll index bea1ddadbfb3..7c130220a86b 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import codeql.ruby.AST private import codeql.ruby.CFG diff --git a/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll b/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll index f70062ad24f3..932533711984 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll @@ -1,4 +1,6 @@ /** Provides classes representing basic blocks. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll b/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll index c822450bf89c..16d0a69fcc3c 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll @@ -1,4 +1,6 @@ /** Provides classes representing nodes in a control flow graph. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.controlflow.BasicBlocks diff --git a/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll b/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll index dee31d8e901b..f3c5dcd08f33 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll @@ -1,4 +1,6 @@ /** Provides classes representing the control flow graph. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.controlflow.BasicBlocks diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll index 83ea11e9d230..b8edf83c20df 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll @@ -3,6 +3,8 @@ * * A completion represents how a statement or expression terminates. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll index dd672ba982d7..d0d418a839f6 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll @@ -2,6 +2,8 @@ * Provides an implementation for constructing control-flow graphs (CFGs) from * abstract syntax trees (ASTs), using the shared library from `codeql.controlflow.Cfg`. */ +overlay[local] +module; private import codeql.controlflow.Cfg as CfgShared private import codeql.ruby.AST diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll index 1161a061581c..a60102e017c6 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.CFG /** Holds if the guard `guard` controls block `bb` upon evaluating to `branch`. */ diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll index e1927a0b1c97..45b299a5d2b7 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll @@ -1,4 +1,6 @@ /** Provides a simple analysis for identifying calls that will not return. */ +overlay[local] +module; private import codeql.ruby.AST private import Completion diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll index 5331a3d26b64..146d5927479d 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates relevant for splitting the control flow graph. */ +overlay[local] +module; private import codeql.ruby.AST as Ast private import Completion as Comp diff --git a/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll b/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll index 07721d333341..1478d9ed9d6b 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll @@ -1,6 +1,8 @@ /** * Provides the module `Ssa` for working with static single assignment (SSA) form. */ +overlay[local] +module; /** * Provides classes for working with static single assignment (SSA) form. diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll index adbec18be640..5d69810ed9a1 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ssa.Ssa as SsaImplCommon private import codeql.ruby.AST private import codeql.ruby.CFG as Cfg @@ -375,10 +378,12 @@ private module Cached { Impl::uncertainWriteDefinitionInput(def, result) } + overlay[global] cached module DataFlowIntegration { import DataFlowIntegrationImpl + overlay[local] cached predicate localFlowStep( SsaInput::SourceVariable v, Node nodeFrom, Node nodeTo, boolean isUseStep @@ -469,19 +474,24 @@ class ParameterExt extends TParameterExt { } } +overlay[global] private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInputSig { private import codeql.ruby.controlflow.internal.Guards as Guards + overlay[local] class Expr extends Cfg::CfgNodes::ExprCfgNode { predicate hasCfgNode(SsaInput::BasicBlock bb, int i) { this = bb.getNode(i) } } + overlay[local] Expr getARead(Definition def) { result = Cached::getARead(def) } + overlay[local] predicate ssaDefHasSource(WriteDefinition def) { any(ParameterExt p).isInitializedBy(def) or def.(Ssa::WriteDefinition).assigns(_) } + overlay[local] class Guard extends Cfg::CfgNodes::AstCfgNode { /** * Holds if the evaluation of this guard to `branch` corresponds to the edge @@ -506,6 +516,7 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu } /** Holds if the guard `guard` controls block `bb` upon evaluating to `branch`. */ + overlay[local] predicate guardDirectlyControlsBlock(Guard guard, SsaInput::BasicBlock bb, boolean branch) { Guards::guardControlsBlock(guard, bb, branch) } diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index ab4215ced208..556b07a49f8b 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -17,3 +17,4 @@ dataExtensions: - codeql/ruby/frameworks/**/model.yml - codeql/ruby/frameworks/**/*.model.yml warnOnImplicitThis: true +compileForOverlayEval: true diff --git a/ruby/ql/lib/ruby.dbscheme b/ruby/ql/lib/ruby.dbscheme index 40a6b0a5e811..dc51d416301d 100644 --- a/ruby/ql/lib/ruby.dbscheme +++ b/ruby/ql/lib/ruby.dbscheme @@ -108,6 +108,12 @@ yaml_locations(unique int locatable: @yaml_locatable ref, @yaml_locatable = @yaml_node | @yaml_error; +/*- Database metadata -*/ +databaseMetadata( + string metadataKey: string ref, + string value: string ref +); + /*- Ruby dbscheme -*/ @ruby_underscore_arg = @ruby_assignment | @ruby_binary | @ruby_conditional | @ruby_operator_assignment | @ruby_range | @ruby_unary | @ruby_underscore_primary diff --git a/ruby/ql/lib/ruby.dbscheme.stats b/ruby/ql/lib/ruby.dbscheme.stats index fd8850293b49..74a9e97f4bd4 100644 --- a/ruby/ql/lib/ruby.dbscheme.stats +++ b/ruby/ql/lib/ruby.dbscheme.stats @@ -21521,6 +21521,42 @@ + + databaseMetadata + 1 + + + metadataKey + 1 + + + value + 1 + + + + + metadataKey + value + + + 12 + + + + + + value + metadataKey + + + 12 + + + + + + yaml_aliases 0 diff --git a/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/old.dbscheme b/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/old.dbscheme new file mode 100644 index 000000000000..40a6b0a5e811 --- /dev/null +++ b/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/old.dbscheme @@ -0,0 +1,1526 @@ +// CodeQL database schema for Ruby +// Automatically generated from the tree-sitter grammar; do not edit + +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + +/*- Ruby dbscheme -*/ +@ruby_underscore_arg = @ruby_assignment | @ruby_binary | @ruby_conditional | @ruby_operator_assignment | @ruby_range | @ruby_unary | @ruby_underscore_primary + +@ruby_underscore_call_operator = @ruby_reserved_word + +@ruby_underscore_expression = @ruby_assignment | @ruby_binary | @ruby_break | @ruby_call | @ruby_match_pattern | @ruby_next | @ruby_operator_assignment | @ruby_return | @ruby_test_pattern | @ruby_unary | @ruby_underscore_arg | @ruby_yield + +@ruby_underscore_lhs = @ruby_call | @ruby_element_reference | @ruby_scope_resolution | @ruby_token_false | @ruby_token_nil | @ruby_token_true | @ruby_underscore_variable + +@ruby_underscore_method_name = @ruby_delimited_symbol | @ruby_setter | @ruby_token_constant | @ruby_token_identifier | @ruby_token_operator | @ruby_token_simple_symbol | @ruby_underscore_nonlocal_variable + +@ruby_underscore_nonlocal_variable = @ruby_token_class_variable | @ruby_token_global_variable | @ruby_token_instance_variable + +@ruby_underscore_pattern_constant = @ruby_scope_resolution | @ruby_token_constant + +@ruby_underscore_pattern_expr = @ruby_alternative_pattern | @ruby_as_pattern | @ruby_underscore_pattern_expr_basic + +@ruby_underscore_pattern_expr_basic = @ruby_array_pattern | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_parenthesized_pattern | @ruby_range | @ruby_token_identifier | @ruby_underscore_pattern_constant | @ruby_underscore_pattern_primitive | @ruby_variable_reference_pattern + +@ruby_underscore_pattern_primitive = @ruby_delimited_symbol | @ruby_lambda | @ruby_regex | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_encoding | @ruby_token_false | @ruby_token_file | @ruby_token_heredoc_beginning | @ruby_token_line | @ruby_token_nil | @ruby_token_self | @ruby_token_simple_symbol | @ruby_token_true | @ruby_unary | @ruby_underscore_simple_numeric + +@ruby_underscore_pattern_top_expr_body = @ruby_array_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_underscore_pattern_expr + +@ruby_underscore_primary = @ruby_array | @ruby_begin | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_delimited_symbol | @ruby_for | @ruby_hash | @ruby_if | @ruby_lambda | @ruby_method | @ruby_module | @ruby_next | @ruby_parenthesized_statements | @ruby_redo | @ruby_regex | @ruby_retry | @ruby_return | @ruby_singleton_class | @ruby_singleton_method | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_character | @ruby_token_heredoc_beginning | @ruby_token_simple_symbol | @ruby_unary | @ruby_underscore_lhs | @ruby_underscore_simple_numeric | @ruby_unless | @ruby_until | @ruby_while | @ruby_yield + +@ruby_underscore_simple_numeric = @ruby_complex | @ruby_rational | @ruby_token_float | @ruby_token_integer + +@ruby_underscore_statement = @ruby_alias | @ruby_begin_block | @ruby_end_block | @ruby_if_modifier | @ruby_rescue_modifier | @ruby_undef | @ruby_underscore_expression | @ruby_unless_modifier | @ruby_until_modifier | @ruby_while_modifier + +@ruby_underscore_variable = @ruby_token_constant | @ruby_token_identifier | @ruby_token_self | @ruby_token_super | @ruby_underscore_nonlocal_variable + +ruby_alias_def( + unique int id: @ruby_alias, + int alias: @ruby_underscore_method_name ref, + int name: @ruby_underscore_method_name ref +); + +#keyset[ruby_alternative_pattern, index] +ruby_alternative_pattern_alternatives( + int ruby_alternative_pattern: @ruby_alternative_pattern ref, + int index: int ref, + unique int alternatives: @ruby_underscore_pattern_expr_basic ref +); + +ruby_alternative_pattern_def( + unique int id: @ruby_alternative_pattern +); + +@ruby_argument_list_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_argument_list, index] +ruby_argument_list_child( + int ruby_argument_list: @ruby_argument_list ref, + int index: int ref, + unique int child: @ruby_argument_list_child_type ref +); + +ruby_argument_list_def( + unique int id: @ruby_argument_list +); + +@ruby_array_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_array, index] +ruby_array_child( + int ruby_array: @ruby_array ref, + int index: int ref, + unique int child: @ruby_array_child_type ref +); + +ruby_array_def( + unique int id: @ruby_array +); + +ruby_array_pattern_class( + unique int ruby_array_pattern: @ruby_array_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_array_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_array_pattern, index] +ruby_array_pattern_child( + int ruby_array_pattern: @ruby_array_pattern ref, + int index: int ref, + unique int child: @ruby_array_pattern_child_type ref +); + +ruby_array_pattern_def( + unique int id: @ruby_array_pattern +); + +ruby_as_pattern_def( + unique int id: @ruby_as_pattern, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_pattern_expr ref +); + +@ruby_assignment_left_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +@ruby_assignment_right_type = @ruby_rescue_modifier | @ruby_right_assignment_list | @ruby_splat_argument | @ruby_underscore_expression + +ruby_assignment_def( + unique int id: @ruby_assignment, + int left: @ruby_assignment_left_type ref, + int right: @ruby_assignment_right_type ref +); + +@ruby_bare_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_string, index] +ruby_bare_string_child( + int ruby_bare_string: @ruby_bare_string ref, + int index: int ref, + unique int child: @ruby_bare_string_child_type ref +); + +ruby_bare_string_def( + unique int id: @ruby_bare_string +); + +@ruby_bare_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_symbol, index] +ruby_bare_symbol_child( + int ruby_bare_symbol: @ruby_bare_symbol ref, + int index: int ref, + unique int child: @ruby_bare_symbol_child_type ref +); + +ruby_bare_symbol_def( + unique int id: @ruby_bare_symbol +); + +@ruby_begin_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin, index] +ruby_begin_child( + int ruby_begin: @ruby_begin ref, + int index: int ref, + unique int child: @ruby_begin_child_type ref +); + +ruby_begin_def( + unique int id: @ruby_begin +); + +@ruby_begin_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin_block, index] +ruby_begin_block_child( + int ruby_begin_block: @ruby_begin_block ref, + int index: int ref, + unique int child: @ruby_begin_block_child_type ref +); + +ruby_begin_block_def( + unique int id: @ruby_begin_block +); + +@ruby_binary_left_type = @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_binary.operator of + 0 = @ruby_binary_bangequal +| 1 = @ruby_binary_bangtilde +| 2 = @ruby_binary_percent +| 3 = @ruby_binary_ampersand +| 4 = @ruby_binary_ampersandampersand +| 5 = @ruby_binary_star +| 6 = @ruby_binary_starstar +| 7 = @ruby_binary_plus +| 8 = @ruby_binary_minus +| 9 = @ruby_binary_slash +| 10 = @ruby_binary_langle +| 11 = @ruby_binary_langlelangle +| 12 = @ruby_binary_langleequal +| 13 = @ruby_binary_langleequalrangle +| 14 = @ruby_binary_equalequal +| 15 = @ruby_binary_equalequalequal +| 16 = @ruby_binary_equaltilde +| 17 = @ruby_binary_rangle +| 18 = @ruby_binary_rangleequal +| 19 = @ruby_binary_ranglerangle +| 20 = @ruby_binary_caret +| 21 = @ruby_binary_and +| 22 = @ruby_binary_or +| 23 = @ruby_binary_pipe +| 24 = @ruby_binary_pipepipe +; + + +ruby_binary_def( + unique int id: @ruby_binary, + int left: @ruby_binary_left_type ref, + int operator: int ref, + int right: @ruby_underscore_expression ref +); + +ruby_block_body( + unique int ruby_block: @ruby_block ref, + unique int body: @ruby_block_body ref +); + +ruby_block_parameters( + unique int ruby_block: @ruby_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_block_def( + unique int id: @ruby_block +); + +ruby_block_argument_child( + unique int ruby_block_argument: @ruby_block_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_block_argument_def( + unique int id: @ruby_block_argument +); + +@ruby_block_body_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_block_body, index] +ruby_block_body_child( + int ruby_block_body: @ruby_block_body ref, + int index: int ref, + unique int child: @ruby_block_body_child_type ref +); + +ruby_block_body_def( + unique int id: @ruby_block_body +); + +ruby_block_parameter_name( + unique int ruby_block_parameter: @ruby_block_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_block_parameter_def( + unique int id: @ruby_block_parameter +); + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_locals( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int locals: @ruby_token_identifier ref +); + +@ruby_block_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_child( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int child: @ruby_block_parameters_child_type ref +); + +ruby_block_parameters_def( + unique int id: @ruby_block_parameters +); + +@ruby_body_statement_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_body_statement, index] +ruby_body_statement_child( + int ruby_body_statement: @ruby_body_statement ref, + int index: int ref, + unique int child: @ruby_body_statement_child_type ref +); + +ruby_body_statement_def( + unique int id: @ruby_body_statement +); + +ruby_break_child( + unique int ruby_break: @ruby_break ref, + unique int child: @ruby_argument_list ref +); + +ruby_break_def( + unique int id: @ruby_break +); + +ruby_call_arguments( + unique int ruby_call: @ruby_call ref, + unique int arguments: @ruby_argument_list ref +); + +@ruby_call_block_type = @ruby_block | @ruby_do_block + +ruby_call_block( + unique int ruby_call: @ruby_call ref, + unique int block: @ruby_call_block_type ref +); + +@ruby_call_method_type = @ruby_token_operator | @ruby_underscore_variable + +ruby_call_method( + unique int ruby_call: @ruby_call ref, + unique int method: @ruby_call_method_type ref +); + +ruby_call_operator( + unique int ruby_call: @ruby_call ref, + unique int operator: @ruby_underscore_call_operator ref +); + +ruby_call_receiver( + unique int ruby_call: @ruby_call ref, + unique int receiver: @ruby_underscore_primary ref +); + +ruby_call_def( + unique int id: @ruby_call +); + +ruby_case_value( + unique int ruby_case__: @ruby_case__ ref, + unique int value: @ruby_underscore_statement ref +); + +@ruby_case_child_type = @ruby_else | @ruby_when + +#keyset[ruby_case__, index] +ruby_case_child( + int ruby_case__: @ruby_case__ ref, + int index: int ref, + unique int child: @ruby_case_child_type ref +); + +ruby_case_def( + unique int id: @ruby_case__ +); + +#keyset[ruby_case_match, index] +ruby_case_match_clauses( + int ruby_case_match: @ruby_case_match ref, + int index: int ref, + unique int clauses: @ruby_in_clause ref +); + +ruby_case_match_else( + unique int ruby_case_match: @ruby_case_match ref, + unique int else: @ruby_else ref +); + +ruby_case_match_def( + unique int id: @ruby_case_match, + int value: @ruby_underscore_statement ref +); + +#keyset[ruby_chained_string, index] +ruby_chained_string_child( + int ruby_chained_string: @ruby_chained_string ref, + int index: int ref, + unique int child: @ruby_string__ ref +); + +ruby_chained_string_def( + unique int id: @ruby_chained_string +); + +ruby_class_body( + unique int ruby_class: @ruby_class ref, + unique int body: @ruby_body_statement ref +); + +@ruby_class_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_class_superclass( + unique int ruby_class: @ruby_class ref, + unique int superclass: @ruby_superclass ref +); + +ruby_class_def( + unique int id: @ruby_class, + int name: @ruby_class_name_type ref +); + +@ruby_complex_child_type = @ruby_rational | @ruby_token_float | @ruby_token_integer + +ruby_complex_def( + unique int id: @ruby_complex, + int child: @ruby_complex_child_type ref +); + +ruby_conditional_def( + unique int id: @ruby_conditional, + int alternative: @ruby_underscore_arg ref, + int condition: @ruby_underscore_arg ref, + int consequence: @ruby_underscore_arg ref +); + +@ruby_delimited_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_delimited_symbol, index] +ruby_delimited_symbol_child( + int ruby_delimited_symbol: @ruby_delimited_symbol ref, + int index: int ref, + unique int child: @ruby_delimited_symbol_child_type ref +); + +ruby_delimited_symbol_def( + unique int id: @ruby_delimited_symbol +); + +@ruby_destructured_left_assignment_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_destructured_left_assignment, index] +ruby_destructured_left_assignment_child( + int ruby_destructured_left_assignment: @ruby_destructured_left_assignment ref, + int index: int ref, + unique int child: @ruby_destructured_left_assignment_child_type ref +); + +ruby_destructured_left_assignment_def( + unique int id: @ruby_destructured_left_assignment +); + +@ruby_destructured_parameter_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_destructured_parameter, index] +ruby_destructured_parameter_child( + int ruby_destructured_parameter: @ruby_destructured_parameter ref, + int index: int ref, + unique int child: @ruby_destructured_parameter_child_type ref +); + +ruby_destructured_parameter_def( + unique int id: @ruby_destructured_parameter +); + +@ruby_do_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_do, index] +ruby_do_child( + int ruby_do: @ruby_do ref, + int index: int ref, + unique int child: @ruby_do_child_type ref +); + +ruby_do_def( + unique int id: @ruby_do +); + +ruby_do_block_body( + unique int ruby_do_block: @ruby_do_block ref, + unique int body: @ruby_body_statement ref +); + +ruby_do_block_parameters( + unique int ruby_do_block: @ruby_do_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_do_block_def( + unique int id: @ruby_do_block +); + +@ruby_element_reference_block_type = @ruby_block | @ruby_do_block + +ruby_element_reference_block( + unique int ruby_element_reference: @ruby_element_reference ref, + unique int block: @ruby_element_reference_block_type ref +); + +@ruby_element_reference_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_element_reference, index] +ruby_element_reference_child( + int ruby_element_reference: @ruby_element_reference ref, + int index: int ref, + unique int child: @ruby_element_reference_child_type ref +); + +ruby_element_reference_def( + unique int id: @ruby_element_reference, + int object: @ruby_underscore_primary ref +); + +@ruby_else_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_else, index] +ruby_else_child( + int ruby_else: @ruby_else ref, + int index: int ref, + unique int child: @ruby_else_child_type ref +); + +ruby_else_def( + unique int id: @ruby_else +); + +@ruby_elsif_alternative_type = @ruby_else | @ruby_elsif + +ruby_elsif_alternative( + unique int ruby_elsif: @ruby_elsif ref, + unique int alternative: @ruby_elsif_alternative_type ref +); + +ruby_elsif_consequence( + unique int ruby_elsif: @ruby_elsif ref, + unique int consequence: @ruby_then ref +); + +ruby_elsif_def( + unique int id: @ruby_elsif, + int condition: @ruby_underscore_statement ref +); + +@ruby_end_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_end_block, index] +ruby_end_block_child( + int ruby_end_block: @ruby_end_block ref, + int index: int ref, + unique int child: @ruby_end_block_child_type ref +); + +ruby_end_block_def( + unique int id: @ruby_end_block +); + +@ruby_ensure_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_ensure, index] +ruby_ensure_child( + int ruby_ensure: @ruby_ensure ref, + int index: int ref, + unique int child: @ruby_ensure_child_type ref +); + +ruby_ensure_def( + unique int id: @ruby_ensure +); + +ruby_exception_variable_def( + unique int id: @ruby_exception_variable, + int child: @ruby_underscore_lhs ref +); + +@ruby_exceptions_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_exceptions, index] +ruby_exceptions_child( + int ruby_exceptions: @ruby_exceptions ref, + int index: int ref, + unique int child: @ruby_exceptions_child_type ref +); + +ruby_exceptions_def( + unique int id: @ruby_exceptions +); + +ruby_expression_reference_pattern_def( + unique int id: @ruby_expression_reference_pattern, + int value: @ruby_underscore_expression ref +); + +ruby_find_pattern_class( + unique int ruby_find_pattern: @ruby_find_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_find_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_find_pattern, index] +ruby_find_pattern_child( + int ruby_find_pattern: @ruby_find_pattern ref, + int index: int ref, + unique int child: @ruby_find_pattern_child_type ref +); + +ruby_find_pattern_def( + unique int id: @ruby_find_pattern +); + +@ruby_for_pattern_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +ruby_for_def( + unique int id: @ruby_for, + int body: @ruby_do ref, + int pattern: @ruby_for_pattern_type ref, + int value: @ruby_in ref +); + +@ruby_hash_child_type = @ruby_hash_splat_argument | @ruby_pair + +#keyset[ruby_hash, index] +ruby_hash_child( + int ruby_hash: @ruby_hash ref, + int index: int ref, + unique int child: @ruby_hash_child_type ref +); + +ruby_hash_def( + unique int id: @ruby_hash +); + +ruby_hash_pattern_class( + unique int ruby_hash_pattern: @ruby_hash_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_hash_pattern_child_type = @ruby_hash_splat_parameter | @ruby_keyword_pattern | @ruby_token_hash_splat_nil + +#keyset[ruby_hash_pattern, index] +ruby_hash_pattern_child( + int ruby_hash_pattern: @ruby_hash_pattern ref, + int index: int ref, + unique int child: @ruby_hash_pattern_child_type ref +); + +ruby_hash_pattern_def( + unique int id: @ruby_hash_pattern +); + +ruby_hash_splat_argument_child( + unique int ruby_hash_splat_argument: @ruby_hash_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_hash_splat_argument_def( + unique int id: @ruby_hash_splat_argument +); + +ruby_hash_splat_parameter_name( + unique int ruby_hash_splat_parameter: @ruby_hash_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_hash_splat_parameter_def( + unique int id: @ruby_hash_splat_parameter +); + +@ruby_heredoc_body_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_heredoc_content | @ruby_token_heredoc_end + +#keyset[ruby_heredoc_body, index] +ruby_heredoc_body_child( + int ruby_heredoc_body: @ruby_heredoc_body ref, + int index: int ref, + unique int child: @ruby_heredoc_body_child_type ref +); + +ruby_heredoc_body_def( + unique int id: @ruby_heredoc_body +); + +@ruby_if_alternative_type = @ruby_else | @ruby_elsif + +ruby_if_alternative( + unique int ruby_if: @ruby_if ref, + unique int alternative: @ruby_if_alternative_type ref +); + +ruby_if_consequence( + unique int ruby_if: @ruby_if ref, + unique int consequence: @ruby_then ref +); + +ruby_if_def( + unique int id: @ruby_if, + int condition: @ruby_underscore_statement ref +); + +ruby_if_guard_def( + unique int id: @ruby_if_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_if_modifier_def( + unique int id: @ruby_if_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_in_def( + unique int id: @ruby_in, + int child: @ruby_underscore_arg ref +); + +ruby_in_clause_body( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int body: @ruby_then ref +); + +@ruby_in_clause_guard_type = @ruby_if_guard | @ruby_unless_guard + +ruby_in_clause_guard( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int guard: @ruby_in_clause_guard_type ref +); + +ruby_in_clause_def( + unique int id: @ruby_in_clause, + int pattern: @ruby_underscore_pattern_top_expr_body ref +); + +@ruby_interpolation_child_type = @ruby_token_empty_statement | @ruby_underscore_nonlocal_variable | @ruby_underscore_statement + +#keyset[ruby_interpolation, index] +ruby_interpolation_child( + int ruby_interpolation: @ruby_interpolation ref, + int index: int ref, + unique int child: @ruby_interpolation_child_type ref +); + +ruby_interpolation_def( + unique int id: @ruby_interpolation +); + +ruby_keyword_parameter_value( + unique int ruby_keyword_parameter: @ruby_keyword_parameter ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_keyword_parameter_def( + unique int id: @ruby_keyword_parameter, + int name: @ruby_token_identifier ref +); + +@ruby_keyword_pattern_key_type = @ruby_string__ | @ruby_token_hash_key_symbol + +ruby_keyword_pattern_value( + unique int ruby_keyword_pattern: @ruby_keyword_pattern ref, + unique int value: @ruby_underscore_pattern_expr ref +); + +ruby_keyword_pattern_def( + unique int id: @ruby_keyword_pattern, + int key__: @ruby_keyword_pattern_key_type ref +); + +@ruby_lambda_body_type = @ruby_block | @ruby_do_block + +ruby_lambda_parameters( + unique int ruby_lambda: @ruby_lambda ref, + unique int parameters: @ruby_lambda_parameters ref +); + +ruby_lambda_def( + unique int id: @ruby_lambda, + int body: @ruby_lambda_body_type ref +); + +@ruby_lambda_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_lambda_parameters, index] +ruby_lambda_parameters_child( + int ruby_lambda_parameters: @ruby_lambda_parameters ref, + int index: int ref, + unique int child: @ruby_lambda_parameters_child_type ref +); + +ruby_lambda_parameters_def( + unique int id: @ruby_lambda_parameters +); + +@ruby_left_assignment_list_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_left_assignment_list, index] +ruby_left_assignment_list_child( + int ruby_left_assignment_list: @ruby_left_assignment_list ref, + int index: int ref, + unique int child: @ruby_left_assignment_list_child_type ref +); + +ruby_left_assignment_list_def( + unique int id: @ruby_left_assignment_list +); + +ruby_match_pattern_def( + unique int id: @ruby_match_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_method_body( + unique int ruby_method: @ruby_method ref, + unique int body: @ruby_method_body_type ref +); + +ruby_method_parameters( + unique int ruby_method: @ruby_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_method_def( + unique int id: @ruby_method, + int name: @ruby_underscore_method_name ref +); + +@ruby_method_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_method_parameters, index] +ruby_method_parameters_child( + int ruby_method_parameters: @ruby_method_parameters ref, + int index: int ref, + unique int child: @ruby_method_parameters_child_type ref +); + +ruby_method_parameters_def( + unique int id: @ruby_method_parameters +); + +ruby_module_body( + unique int ruby_module: @ruby_module ref, + unique int body: @ruby_body_statement ref +); + +@ruby_module_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_module_def( + unique int id: @ruby_module, + int name: @ruby_module_name_type ref +); + +ruby_next_child( + unique int ruby_next: @ruby_next ref, + unique int child: @ruby_argument_list ref +); + +ruby_next_def( + unique int id: @ruby_next +); + +case @ruby_operator_assignment.operator of + 0 = @ruby_operator_assignment_percentequal +| 1 = @ruby_operator_assignment_ampersandampersandequal +| 2 = @ruby_operator_assignment_ampersandequal +| 3 = @ruby_operator_assignment_starstarequal +| 4 = @ruby_operator_assignment_starequal +| 5 = @ruby_operator_assignment_plusequal +| 6 = @ruby_operator_assignment_minusequal +| 7 = @ruby_operator_assignment_slashequal +| 8 = @ruby_operator_assignment_langlelangleequal +| 9 = @ruby_operator_assignment_ranglerangleequal +| 10 = @ruby_operator_assignment_caretequal +| 11 = @ruby_operator_assignment_pipeequal +| 12 = @ruby_operator_assignment_pipepipeequal +; + + +@ruby_operator_assignment_right_type = @ruby_rescue_modifier | @ruby_underscore_expression + +ruby_operator_assignment_def( + unique int id: @ruby_operator_assignment, + int left: @ruby_underscore_lhs ref, + int operator: int ref, + int right: @ruby_operator_assignment_right_type ref +); + +ruby_optional_parameter_def( + unique int id: @ruby_optional_parameter, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_arg ref +); + +@ruby_pair_key_type = @ruby_string__ | @ruby_token_hash_key_symbol | @ruby_underscore_arg + +ruby_pair_value( + unique int ruby_pair: @ruby_pair ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_pair_def( + unique int id: @ruby_pair, + int key__: @ruby_pair_key_type ref +); + +ruby_parenthesized_pattern_def( + unique int id: @ruby_parenthesized_pattern, + int child: @ruby_underscore_pattern_expr ref +); + +@ruby_parenthesized_statements_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_parenthesized_statements, index] +ruby_parenthesized_statements_child( + int ruby_parenthesized_statements: @ruby_parenthesized_statements ref, + int index: int ref, + unique int child: @ruby_parenthesized_statements_child_type ref +); + +ruby_parenthesized_statements_def( + unique int id: @ruby_parenthesized_statements +); + +@ruby_pattern_child_type = @ruby_splat_argument | @ruby_underscore_arg + +ruby_pattern_def( + unique int id: @ruby_pattern, + int child: @ruby_pattern_child_type ref +); + +@ruby_program_child_type = @ruby_token_empty_statement | @ruby_token_uninterpreted | @ruby_underscore_statement + +#keyset[ruby_program, index] +ruby_program_child( + int ruby_program: @ruby_program ref, + int index: int ref, + unique int child: @ruby_program_child_type ref +); + +ruby_program_def( + unique int id: @ruby_program +); + +@ruby_range_begin_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_begin( + unique int ruby_range: @ruby_range ref, + unique int begin: @ruby_range_begin_type ref +); + +@ruby_range_end_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_end( + unique int ruby_range: @ruby_range ref, + unique int end: @ruby_range_end_type ref +); + +case @ruby_range.operator of + 0 = @ruby_range_dotdot +| 1 = @ruby_range_dotdotdot +; + + +ruby_range_def( + unique int id: @ruby_range, + int operator: int ref +); + +@ruby_rational_child_type = @ruby_token_float | @ruby_token_integer + +ruby_rational_def( + unique int id: @ruby_rational, + int child: @ruby_rational_child_type ref +); + +ruby_redo_child( + unique int ruby_redo: @ruby_redo ref, + unique int child: @ruby_argument_list ref +); + +ruby_redo_def( + unique int id: @ruby_redo +); + +@ruby_regex_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_regex, index] +ruby_regex_child( + int ruby_regex: @ruby_regex ref, + int index: int ref, + unique int child: @ruby_regex_child_type ref +); + +ruby_regex_def( + unique int id: @ruby_regex +); + +ruby_rescue_body( + unique int ruby_rescue: @ruby_rescue ref, + unique int body: @ruby_then ref +); + +ruby_rescue_exceptions( + unique int ruby_rescue: @ruby_rescue ref, + unique int exceptions: @ruby_exceptions ref +); + +ruby_rescue_variable( + unique int ruby_rescue: @ruby_rescue ref, + unique int variable: @ruby_exception_variable ref +); + +ruby_rescue_def( + unique int id: @ruby_rescue +); + +@ruby_rescue_modifier_body_type = @ruby_underscore_arg | @ruby_underscore_statement + +ruby_rescue_modifier_def( + unique int id: @ruby_rescue_modifier, + int body: @ruby_rescue_modifier_body_type ref, + int handler: @ruby_underscore_expression ref +); + +ruby_rest_assignment_child( + unique int ruby_rest_assignment: @ruby_rest_assignment ref, + unique int child: @ruby_underscore_lhs ref +); + +ruby_rest_assignment_def( + unique int id: @ruby_rest_assignment +); + +ruby_retry_child( + unique int ruby_retry: @ruby_retry ref, + unique int child: @ruby_argument_list ref +); + +ruby_retry_def( + unique int id: @ruby_retry +); + +ruby_return_child( + unique int ruby_return: @ruby_return ref, + unique int child: @ruby_argument_list ref +); + +ruby_return_def( + unique int id: @ruby_return +); + +@ruby_right_assignment_list_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_right_assignment_list, index] +ruby_right_assignment_list_child( + int ruby_right_assignment_list: @ruby_right_assignment_list ref, + int index: int ref, + unique int child: @ruby_right_assignment_list_child_type ref +); + +ruby_right_assignment_list_def( + unique int id: @ruby_right_assignment_list +); + +@ruby_scope_resolution_scope_type = @ruby_underscore_pattern_constant | @ruby_underscore_primary + +ruby_scope_resolution_scope( + unique int ruby_scope_resolution: @ruby_scope_resolution ref, + unique int scope: @ruby_scope_resolution_scope_type ref +); + +ruby_scope_resolution_def( + unique int id: @ruby_scope_resolution, + int name: @ruby_token_constant ref +); + +ruby_setter_def( + unique int id: @ruby_setter, + int name: @ruby_token_identifier ref +); + +ruby_singleton_class_body( + unique int ruby_singleton_class: @ruby_singleton_class ref, + unique int body: @ruby_body_statement ref +); + +ruby_singleton_class_def( + unique int id: @ruby_singleton_class, + int value: @ruby_underscore_arg ref +); + +@ruby_singleton_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_singleton_method_body( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int body: @ruby_singleton_method_body_type ref +); + +@ruby_singleton_method_object_type = @ruby_underscore_arg | @ruby_underscore_variable + +ruby_singleton_method_parameters( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_singleton_method_def( + unique int id: @ruby_singleton_method, + int name: @ruby_underscore_method_name ref, + int object: @ruby_singleton_method_object_type ref +); + +ruby_splat_argument_child( + unique int ruby_splat_argument: @ruby_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_splat_argument_def( + unique int id: @ruby_splat_argument +); + +ruby_splat_parameter_name( + unique int ruby_splat_parameter: @ruby_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_splat_parameter_def( + unique int id: @ruby_splat_parameter +); + +@ruby_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_string__, index] +ruby_string_child( + int ruby_string__: @ruby_string__ ref, + int index: int ref, + unique int child: @ruby_string_child_type ref +); + +ruby_string_def( + unique int id: @ruby_string__ +); + +#keyset[ruby_string_array, index] +ruby_string_array_child( + int ruby_string_array: @ruby_string_array ref, + int index: int ref, + unique int child: @ruby_bare_string ref +); + +ruby_string_array_def( + unique int id: @ruby_string_array +); + +@ruby_subshell_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_subshell, index] +ruby_subshell_child( + int ruby_subshell: @ruby_subshell ref, + int index: int ref, + unique int child: @ruby_subshell_child_type ref +); + +ruby_subshell_def( + unique int id: @ruby_subshell +); + +ruby_superclass_def( + unique int id: @ruby_superclass, + int child: @ruby_underscore_expression ref +); + +#keyset[ruby_symbol_array, index] +ruby_symbol_array_child( + int ruby_symbol_array: @ruby_symbol_array ref, + int index: int ref, + unique int child: @ruby_bare_symbol ref +); + +ruby_symbol_array_def( + unique int id: @ruby_symbol_array +); + +ruby_test_pattern_def( + unique int id: @ruby_test_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_then_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_then, index] +ruby_then_child( + int ruby_then: @ruby_then ref, + int index: int ref, + unique int child: @ruby_then_child_type ref +); + +ruby_then_def( + unique int id: @ruby_then +); + +@ruby_unary_operand_type = @ruby_parenthesized_statements | @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_unary.operator of + 0 = @ruby_unary_bang +| 1 = @ruby_unary_plus +| 2 = @ruby_unary_minus +| 3 = @ruby_unary_definedquestion +| 4 = @ruby_unary_not +| 5 = @ruby_unary_tilde +; + + +ruby_unary_def( + unique int id: @ruby_unary, + int operand: @ruby_unary_operand_type ref, + int operator: int ref +); + +#keyset[ruby_undef, index] +ruby_undef_child( + int ruby_undef: @ruby_undef ref, + int index: int ref, + unique int child: @ruby_underscore_method_name ref +); + +ruby_undef_def( + unique int id: @ruby_undef +); + +@ruby_unless_alternative_type = @ruby_else | @ruby_elsif + +ruby_unless_alternative( + unique int ruby_unless: @ruby_unless ref, + unique int alternative: @ruby_unless_alternative_type ref +); + +ruby_unless_consequence( + unique int ruby_unless: @ruby_unless ref, + unique int consequence: @ruby_then ref +); + +ruby_unless_def( + unique int id: @ruby_unless, + int condition: @ruby_underscore_statement ref +); + +ruby_unless_guard_def( + unique int id: @ruby_unless_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_unless_modifier_def( + unique int id: @ruby_unless_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_until_def( + unique int id: @ruby_until, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_until_modifier_def( + unique int id: @ruby_until_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +@ruby_variable_reference_pattern_name_type = @ruby_token_identifier | @ruby_underscore_nonlocal_variable + +ruby_variable_reference_pattern_def( + unique int id: @ruby_variable_reference_pattern, + int name: @ruby_variable_reference_pattern_name_type ref +); + +ruby_when_body( + unique int ruby_when: @ruby_when ref, + unique int body: @ruby_then ref +); + +#keyset[ruby_when, index] +ruby_when_pattern( + int ruby_when: @ruby_when ref, + int index: int ref, + unique int pattern: @ruby_pattern ref +); + +ruby_when_def( + unique int id: @ruby_when +); + +ruby_while_def( + unique int id: @ruby_while, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_while_modifier_def( + unique int id: @ruby_while_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_yield_child( + unique int ruby_yield: @ruby_yield ref, + unique int child: @ruby_argument_list ref +); + +ruby_yield_def( + unique int id: @ruby_yield +); + +ruby_tokeninfo( + unique int id: @ruby_token, + int kind: int ref, + string value: string ref +); + +case @ruby_token.kind of + 0 = @ruby_reserved_word +| 1 = @ruby_token_character +| 2 = @ruby_token_class_variable +| 3 = @ruby_token_comment +| 4 = @ruby_token_constant +| 5 = @ruby_token_empty_statement +| 6 = @ruby_token_encoding +| 7 = @ruby_token_escape_sequence +| 8 = @ruby_token_false +| 9 = @ruby_token_file +| 10 = @ruby_token_float +| 11 = @ruby_token_forward_argument +| 12 = @ruby_token_forward_parameter +| 13 = @ruby_token_global_variable +| 14 = @ruby_token_hash_key_symbol +| 15 = @ruby_token_hash_splat_nil +| 16 = @ruby_token_heredoc_beginning +| 17 = @ruby_token_heredoc_content +| 18 = @ruby_token_heredoc_end +| 19 = @ruby_token_identifier +| 20 = @ruby_token_instance_variable +| 21 = @ruby_token_integer +| 22 = @ruby_token_line +| 23 = @ruby_token_nil +| 24 = @ruby_token_operator +| 25 = @ruby_token_self +| 26 = @ruby_token_simple_symbol +| 27 = @ruby_token_string_content +| 28 = @ruby_token_super +| 29 = @ruby_token_true +| 30 = @ruby_token_uninterpreted +; + + +@ruby_ast_node = @ruby_alias | @ruby_alternative_pattern | @ruby_argument_list | @ruby_array | @ruby_array_pattern | @ruby_as_pattern | @ruby_assignment | @ruby_bare_string | @ruby_bare_symbol | @ruby_begin | @ruby_begin_block | @ruby_binary | @ruby_block | @ruby_block_argument | @ruby_block_body | @ruby_block_parameter | @ruby_block_parameters | @ruby_body_statement | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_complex | @ruby_conditional | @ruby_delimited_symbol | @ruby_destructured_left_assignment | @ruby_destructured_parameter | @ruby_do | @ruby_do_block | @ruby_element_reference | @ruby_else | @ruby_elsif | @ruby_end_block | @ruby_ensure | @ruby_exception_variable | @ruby_exceptions | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_for | @ruby_hash | @ruby_hash_pattern | @ruby_hash_splat_argument | @ruby_hash_splat_parameter | @ruby_heredoc_body | @ruby_if | @ruby_if_guard | @ruby_if_modifier | @ruby_in | @ruby_in_clause | @ruby_interpolation | @ruby_keyword_parameter | @ruby_keyword_pattern | @ruby_lambda | @ruby_lambda_parameters | @ruby_left_assignment_list | @ruby_match_pattern | @ruby_method | @ruby_method_parameters | @ruby_module | @ruby_next | @ruby_operator_assignment | @ruby_optional_parameter | @ruby_pair | @ruby_parenthesized_pattern | @ruby_parenthesized_statements | @ruby_pattern | @ruby_program | @ruby_range | @ruby_rational | @ruby_redo | @ruby_regex | @ruby_rescue | @ruby_rescue_modifier | @ruby_rest_assignment | @ruby_retry | @ruby_return | @ruby_right_assignment_list | @ruby_scope_resolution | @ruby_setter | @ruby_singleton_class | @ruby_singleton_method | @ruby_splat_argument | @ruby_splat_parameter | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_superclass | @ruby_symbol_array | @ruby_test_pattern | @ruby_then | @ruby_token | @ruby_unary | @ruby_undef | @ruby_unless | @ruby_unless_guard | @ruby_unless_modifier | @ruby_until | @ruby_until_modifier | @ruby_variable_reference_pattern | @ruby_when | @ruby_while | @ruby_while_modifier | @ruby_yield + +ruby_ast_node_location( + unique int node: @ruby_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +ruby_ast_node_parent( + unique int node: @ruby_ast_node ref, + int parent: @ruby_ast_node ref, + int parent_index: int ref +); + +/*- Erb dbscheme -*/ +erb_comment_directive_child( + unique int erb_comment_directive: @erb_comment_directive ref, + unique int child: @erb_token_comment ref +); + +erb_comment_directive_def( + unique int id: @erb_comment_directive +); + +erb_directive_child( + unique int erb_directive: @erb_directive ref, + unique int child: @erb_token_code ref +); + +erb_directive_def( + unique int id: @erb_directive +); + +erb_graphql_directive_child( + unique int erb_graphql_directive: @erb_graphql_directive ref, + unique int child: @erb_token_code ref +); + +erb_graphql_directive_def( + unique int id: @erb_graphql_directive +); + +erb_output_directive_child( + unique int erb_output_directive: @erb_output_directive ref, + unique int child: @erb_token_code ref +); + +erb_output_directive_def( + unique int id: @erb_output_directive +); + +@erb_template_child_type = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_token_content + +#keyset[erb_template, index] +erb_template_child( + int erb_template: @erb_template ref, + int index: int ref, + unique int child: @erb_template_child_type ref +); + +erb_template_def( + unique int id: @erb_template +); + +erb_tokeninfo( + unique int id: @erb_token, + int kind: int ref, + string value: string ref +); + +case @erb_token.kind of + 0 = @erb_reserved_word +| 1 = @erb_token_code +| 2 = @erb_token_comment +| 3 = @erb_token_content +; + + +@erb_ast_node = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_template | @erb_token + +erb_ast_node_location( + unique int node: @erb_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +erb_ast_node_parent( + unique int node: @erb_ast_node ref, + int parent: @erb_ast_node ref, + int parent_index: int ref +); + diff --git a/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/ruby.dbscheme b/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/ruby.dbscheme new file mode 100644 index 000000000000..dc51d416301d --- /dev/null +++ b/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/ruby.dbscheme @@ -0,0 +1,1532 @@ +// CodeQL database schema for Ruby +// Automatically generated from the tree-sitter grammar; do not edit + +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + +/*- Database metadata -*/ +databaseMetadata( + string metadataKey: string ref, + string value: string ref +); + +/*- Ruby dbscheme -*/ +@ruby_underscore_arg = @ruby_assignment | @ruby_binary | @ruby_conditional | @ruby_operator_assignment | @ruby_range | @ruby_unary | @ruby_underscore_primary + +@ruby_underscore_call_operator = @ruby_reserved_word + +@ruby_underscore_expression = @ruby_assignment | @ruby_binary | @ruby_break | @ruby_call | @ruby_match_pattern | @ruby_next | @ruby_operator_assignment | @ruby_return | @ruby_test_pattern | @ruby_unary | @ruby_underscore_arg | @ruby_yield + +@ruby_underscore_lhs = @ruby_call | @ruby_element_reference | @ruby_scope_resolution | @ruby_token_false | @ruby_token_nil | @ruby_token_true | @ruby_underscore_variable + +@ruby_underscore_method_name = @ruby_delimited_symbol | @ruby_setter | @ruby_token_constant | @ruby_token_identifier | @ruby_token_operator | @ruby_token_simple_symbol | @ruby_underscore_nonlocal_variable + +@ruby_underscore_nonlocal_variable = @ruby_token_class_variable | @ruby_token_global_variable | @ruby_token_instance_variable + +@ruby_underscore_pattern_constant = @ruby_scope_resolution | @ruby_token_constant + +@ruby_underscore_pattern_expr = @ruby_alternative_pattern | @ruby_as_pattern | @ruby_underscore_pattern_expr_basic + +@ruby_underscore_pattern_expr_basic = @ruby_array_pattern | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_parenthesized_pattern | @ruby_range | @ruby_token_identifier | @ruby_underscore_pattern_constant | @ruby_underscore_pattern_primitive | @ruby_variable_reference_pattern + +@ruby_underscore_pattern_primitive = @ruby_delimited_symbol | @ruby_lambda | @ruby_regex | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_encoding | @ruby_token_false | @ruby_token_file | @ruby_token_heredoc_beginning | @ruby_token_line | @ruby_token_nil | @ruby_token_self | @ruby_token_simple_symbol | @ruby_token_true | @ruby_unary | @ruby_underscore_simple_numeric + +@ruby_underscore_pattern_top_expr_body = @ruby_array_pattern | @ruby_find_pattern | @ruby_hash_pattern | @ruby_underscore_pattern_expr + +@ruby_underscore_primary = @ruby_array | @ruby_begin | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_delimited_symbol | @ruby_for | @ruby_hash | @ruby_if | @ruby_lambda | @ruby_method | @ruby_module | @ruby_next | @ruby_parenthesized_statements | @ruby_redo | @ruby_regex | @ruby_retry | @ruby_return | @ruby_singleton_class | @ruby_singleton_method | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_symbol_array | @ruby_token_character | @ruby_token_heredoc_beginning | @ruby_token_simple_symbol | @ruby_unary | @ruby_underscore_lhs | @ruby_underscore_simple_numeric | @ruby_unless | @ruby_until | @ruby_while | @ruby_yield + +@ruby_underscore_simple_numeric = @ruby_complex | @ruby_rational | @ruby_token_float | @ruby_token_integer + +@ruby_underscore_statement = @ruby_alias | @ruby_begin_block | @ruby_end_block | @ruby_if_modifier | @ruby_rescue_modifier | @ruby_undef | @ruby_underscore_expression | @ruby_unless_modifier | @ruby_until_modifier | @ruby_while_modifier + +@ruby_underscore_variable = @ruby_token_constant | @ruby_token_identifier | @ruby_token_self | @ruby_token_super | @ruby_underscore_nonlocal_variable + +ruby_alias_def( + unique int id: @ruby_alias, + int alias: @ruby_underscore_method_name ref, + int name: @ruby_underscore_method_name ref +); + +#keyset[ruby_alternative_pattern, index] +ruby_alternative_pattern_alternatives( + int ruby_alternative_pattern: @ruby_alternative_pattern ref, + int index: int ref, + unique int alternatives: @ruby_underscore_pattern_expr_basic ref +); + +ruby_alternative_pattern_def( + unique int id: @ruby_alternative_pattern +); + +@ruby_argument_list_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_argument_list, index] +ruby_argument_list_child( + int ruby_argument_list: @ruby_argument_list ref, + int index: int ref, + unique int child: @ruby_argument_list_child_type ref +); + +ruby_argument_list_def( + unique int id: @ruby_argument_list +); + +@ruby_array_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_array, index] +ruby_array_child( + int ruby_array: @ruby_array ref, + int index: int ref, + unique int child: @ruby_array_child_type ref +); + +ruby_array_def( + unique int id: @ruby_array +); + +ruby_array_pattern_class( + unique int ruby_array_pattern: @ruby_array_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_array_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_array_pattern, index] +ruby_array_pattern_child( + int ruby_array_pattern: @ruby_array_pattern ref, + int index: int ref, + unique int child: @ruby_array_pattern_child_type ref +); + +ruby_array_pattern_def( + unique int id: @ruby_array_pattern +); + +ruby_as_pattern_def( + unique int id: @ruby_as_pattern, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_pattern_expr ref +); + +@ruby_assignment_left_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +@ruby_assignment_right_type = @ruby_rescue_modifier | @ruby_right_assignment_list | @ruby_splat_argument | @ruby_underscore_expression + +ruby_assignment_def( + unique int id: @ruby_assignment, + int left: @ruby_assignment_left_type ref, + int right: @ruby_assignment_right_type ref +); + +@ruby_bare_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_string, index] +ruby_bare_string_child( + int ruby_bare_string: @ruby_bare_string ref, + int index: int ref, + unique int child: @ruby_bare_string_child_type ref +); + +ruby_bare_string_def( + unique int id: @ruby_bare_string +); + +@ruby_bare_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_bare_symbol, index] +ruby_bare_symbol_child( + int ruby_bare_symbol: @ruby_bare_symbol ref, + int index: int ref, + unique int child: @ruby_bare_symbol_child_type ref +); + +ruby_bare_symbol_def( + unique int id: @ruby_bare_symbol +); + +@ruby_begin_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin, index] +ruby_begin_child( + int ruby_begin: @ruby_begin ref, + int index: int ref, + unique int child: @ruby_begin_child_type ref +); + +ruby_begin_def( + unique int id: @ruby_begin +); + +@ruby_begin_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_begin_block, index] +ruby_begin_block_child( + int ruby_begin_block: @ruby_begin_block ref, + int index: int ref, + unique int child: @ruby_begin_block_child_type ref +); + +ruby_begin_block_def( + unique int id: @ruby_begin_block +); + +@ruby_binary_left_type = @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_binary.operator of + 0 = @ruby_binary_bangequal +| 1 = @ruby_binary_bangtilde +| 2 = @ruby_binary_percent +| 3 = @ruby_binary_ampersand +| 4 = @ruby_binary_ampersandampersand +| 5 = @ruby_binary_star +| 6 = @ruby_binary_starstar +| 7 = @ruby_binary_plus +| 8 = @ruby_binary_minus +| 9 = @ruby_binary_slash +| 10 = @ruby_binary_langle +| 11 = @ruby_binary_langlelangle +| 12 = @ruby_binary_langleequal +| 13 = @ruby_binary_langleequalrangle +| 14 = @ruby_binary_equalequal +| 15 = @ruby_binary_equalequalequal +| 16 = @ruby_binary_equaltilde +| 17 = @ruby_binary_rangle +| 18 = @ruby_binary_rangleequal +| 19 = @ruby_binary_ranglerangle +| 20 = @ruby_binary_caret +| 21 = @ruby_binary_and +| 22 = @ruby_binary_or +| 23 = @ruby_binary_pipe +| 24 = @ruby_binary_pipepipe +; + + +ruby_binary_def( + unique int id: @ruby_binary, + int left: @ruby_binary_left_type ref, + int operator: int ref, + int right: @ruby_underscore_expression ref +); + +ruby_block_body( + unique int ruby_block: @ruby_block ref, + unique int body: @ruby_block_body ref +); + +ruby_block_parameters( + unique int ruby_block: @ruby_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_block_def( + unique int id: @ruby_block +); + +ruby_block_argument_child( + unique int ruby_block_argument: @ruby_block_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_block_argument_def( + unique int id: @ruby_block_argument +); + +@ruby_block_body_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_block_body, index] +ruby_block_body_child( + int ruby_block_body: @ruby_block_body ref, + int index: int ref, + unique int child: @ruby_block_body_child_type ref +); + +ruby_block_body_def( + unique int id: @ruby_block_body +); + +ruby_block_parameter_name( + unique int ruby_block_parameter: @ruby_block_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_block_parameter_def( + unique int id: @ruby_block_parameter +); + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_locals( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int locals: @ruby_token_identifier ref +); + +@ruby_block_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_block_parameters, index] +ruby_block_parameters_child( + int ruby_block_parameters: @ruby_block_parameters ref, + int index: int ref, + unique int child: @ruby_block_parameters_child_type ref +); + +ruby_block_parameters_def( + unique int id: @ruby_block_parameters +); + +@ruby_body_statement_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_body_statement, index] +ruby_body_statement_child( + int ruby_body_statement: @ruby_body_statement ref, + int index: int ref, + unique int child: @ruby_body_statement_child_type ref +); + +ruby_body_statement_def( + unique int id: @ruby_body_statement +); + +ruby_break_child( + unique int ruby_break: @ruby_break ref, + unique int child: @ruby_argument_list ref +); + +ruby_break_def( + unique int id: @ruby_break +); + +ruby_call_arguments( + unique int ruby_call: @ruby_call ref, + unique int arguments: @ruby_argument_list ref +); + +@ruby_call_block_type = @ruby_block | @ruby_do_block + +ruby_call_block( + unique int ruby_call: @ruby_call ref, + unique int block: @ruby_call_block_type ref +); + +@ruby_call_method_type = @ruby_token_operator | @ruby_underscore_variable + +ruby_call_method( + unique int ruby_call: @ruby_call ref, + unique int method: @ruby_call_method_type ref +); + +ruby_call_operator( + unique int ruby_call: @ruby_call ref, + unique int operator: @ruby_underscore_call_operator ref +); + +ruby_call_receiver( + unique int ruby_call: @ruby_call ref, + unique int receiver: @ruby_underscore_primary ref +); + +ruby_call_def( + unique int id: @ruby_call +); + +ruby_case_value( + unique int ruby_case__: @ruby_case__ ref, + unique int value: @ruby_underscore_statement ref +); + +@ruby_case_child_type = @ruby_else | @ruby_when + +#keyset[ruby_case__, index] +ruby_case_child( + int ruby_case__: @ruby_case__ ref, + int index: int ref, + unique int child: @ruby_case_child_type ref +); + +ruby_case_def( + unique int id: @ruby_case__ +); + +#keyset[ruby_case_match, index] +ruby_case_match_clauses( + int ruby_case_match: @ruby_case_match ref, + int index: int ref, + unique int clauses: @ruby_in_clause ref +); + +ruby_case_match_else( + unique int ruby_case_match: @ruby_case_match ref, + unique int else: @ruby_else ref +); + +ruby_case_match_def( + unique int id: @ruby_case_match, + int value: @ruby_underscore_statement ref +); + +#keyset[ruby_chained_string, index] +ruby_chained_string_child( + int ruby_chained_string: @ruby_chained_string ref, + int index: int ref, + unique int child: @ruby_string__ ref +); + +ruby_chained_string_def( + unique int id: @ruby_chained_string +); + +ruby_class_body( + unique int ruby_class: @ruby_class ref, + unique int body: @ruby_body_statement ref +); + +@ruby_class_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_class_superclass( + unique int ruby_class: @ruby_class ref, + unique int superclass: @ruby_superclass ref +); + +ruby_class_def( + unique int id: @ruby_class, + int name: @ruby_class_name_type ref +); + +@ruby_complex_child_type = @ruby_rational | @ruby_token_float | @ruby_token_integer + +ruby_complex_def( + unique int id: @ruby_complex, + int child: @ruby_complex_child_type ref +); + +ruby_conditional_def( + unique int id: @ruby_conditional, + int alternative: @ruby_underscore_arg ref, + int condition: @ruby_underscore_arg ref, + int consequence: @ruby_underscore_arg ref +); + +@ruby_delimited_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_delimited_symbol, index] +ruby_delimited_symbol_child( + int ruby_delimited_symbol: @ruby_delimited_symbol ref, + int index: int ref, + unique int child: @ruby_delimited_symbol_child_type ref +); + +ruby_delimited_symbol_def( + unique int id: @ruby_delimited_symbol +); + +@ruby_destructured_left_assignment_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_destructured_left_assignment, index] +ruby_destructured_left_assignment_child( + int ruby_destructured_left_assignment: @ruby_destructured_left_assignment ref, + int index: int ref, + unique int child: @ruby_destructured_left_assignment_child_type ref +); + +ruby_destructured_left_assignment_def( + unique int id: @ruby_destructured_left_assignment +); + +@ruby_destructured_parameter_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_destructured_parameter, index] +ruby_destructured_parameter_child( + int ruby_destructured_parameter: @ruby_destructured_parameter ref, + int index: int ref, + unique int child: @ruby_destructured_parameter_child_type ref +); + +ruby_destructured_parameter_def( + unique int id: @ruby_destructured_parameter +); + +@ruby_do_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_do, index] +ruby_do_child( + int ruby_do: @ruby_do ref, + int index: int ref, + unique int child: @ruby_do_child_type ref +); + +ruby_do_def( + unique int id: @ruby_do +); + +ruby_do_block_body( + unique int ruby_do_block: @ruby_do_block ref, + unique int body: @ruby_body_statement ref +); + +ruby_do_block_parameters( + unique int ruby_do_block: @ruby_do_block ref, + unique int parameters: @ruby_block_parameters ref +); + +ruby_do_block_def( + unique int id: @ruby_do_block +); + +@ruby_element_reference_block_type = @ruby_block | @ruby_do_block + +ruby_element_reference_block( + unique int ruby_element_reference: @ruby_element_reference ref, + unique int block: @ruby_element_reference_block_type ref +); + +@ruby_element_reference_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression + +#keyset[ruby_element_reference, index] +ruby_element_reference_child( + int ruby_element_reference: @ruby_element_reference ref, + int index: int ref, + unique int child: @ruby_element_reference_child_type ref +); + +ruby_element_reference_def( + unique int id: @ruby_element_reference, + int object: @ruby_underscore_primary ref +); + +@ruby_else_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_else, index] +ruby_else_child( + int ruby_else: @ruby_else ref, + int index: int ref, + unique int child: @ruby_else_child_type ref +); + +ruby_else_def( + unique int id: @ruby_else +); + +@ruby_elsif_alternative_type = @ruby_else | @ruby_elsif + +ruby_elsif_alternative( + unique int ruby_elsif: @ruby_elsif ref, + unique int alternative: @ruby_elsif_alternative_type ref +); + +ruby_elsif_consequence( + unique int ruby_elsif: @ruby_elsif ref, + unique int consequence: @ruby_then ref +); + +ruby_elsif_def( + unique int id: @ruby_elsif, + int condition: @ruby_underscore_statement ref +); + +@ruby_end_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_end_block, index] +ruby_end_block_child( + int ruby_end_block: @ruby_end_block ref, + int index: int ref, + unique int child: @ruby_end_block_child_type ref +); + +ruby_end_block_def( + unique int id: @ruby_end_block +); + +@ruby_ensure_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_ensure, index] +ruby_ensure_child( + int ruby_ensure: @ruby_ensure ref, + int index: int ref, + unique int child: @ruby_ensure_child_type ref +); + +ruby_ensure_def( + unique int id: @ruby_ensure +); + +ruby_exception_variable_def( + unique int id: @ruby_exception_variable, + int child: @ruby_underscore_lhs ref +); + +@ruby_exceptions_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_exceptions, index] +ruby_exceptions_child( + int ruby_exceptions: @ruby_exceptions ref, + int index: int ref, + unique int child: @ruby_exceptions_child_type ref +); + +ruby_exceptions_def( + unique int id: @ruby_exceptions +); + +ruby_expression_reference_pattern_def( + unique int id: @ruby_expression_reference_pattern, + int value: @ruby_underscore_expression ref +); + +ruby_find_pattern_class( + unique int ruby_find_pattern: @ruby_find_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_find_pattern_child_type = @ruby_splat_parameter | @ruby_underscore_pattern_expr + +#keyset[ruby_find_pattern, index] +ruby_find_pattern_child( + int ruby_find_pattern: @ruby_find_pattern ref, + int index: int ref, + unique int child: @ruby_find_pattern_child_type ref +); + +ruby_find_pattern_def( + unique int id: @ruby_find_pattern +); + +@ruby_for_pattern_type = @ruby_left_assignment_list | @ruby_underscore_lhs + +ruby_for_def( + unique int id: @ruby_for, + int body: @ruby_do ref, + int pattern: @ruby_for_pattern_type ref, + int value: @ruby_in ref +); + +@ruby_hash_child_type = @ruby_hash_splat_argument | @ruby_pair + +#keyset[ruby_hash, index] +ruby_hash_child( + int ruby_hash: @ruby_hash ref, + int index: int ref, + unique int child: @ruby_hash_child_type ref +); + +ruby_hash_def( + unique int id: @ruby_hash +); + +ruby_hash_pattern_class( + unique int ruby_hash_pattern: @ruby_hash_pattern ref, + unique int class: @ruby_underscore_pattern_constant ref +); + +@ruby_hash_pattern_child_type = @ruby_hash_splat_parameter | @ruby_keyword_pattern | @ruby_token_hash_splat_nil + +#keyset[ruby_hash_pattern, index] +ruby_hash_pattern_child( + int ruby_hash_pattern: @ruby_hash_pattern ref, + int index: int ref, + unique int child: @ruby_hash_pattern_child_type ref +); + +ruby_hash_pattern_def( + unique int id: @ruby_hash_pattern +); + +ruby_hash_splat_argument_child( + unique int ruby_hash_splat_argument: @ruby_hash_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_hash_splat_argument_def( + unique int id: @ruby_hash_splat_argument +); + +ruby_hash_splat_parameter_name( + unique int ruby_hash_splat_parameter: @ruby_hash_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_hash_splat_parameter_def( + unique int id: @ruby_hash_splat_parameter +); + +@ruby_heredoc_body_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_heredoc_content | @ruby_token_heredoc_end + +#keyset[ruby_heredoc_body, index] +ruby_heredoc_body_child( + int ruby_heredoc_body: @ruby_heredoc_body ref, + int index: int ref, + unique int child: @ruby_heredoc_body_child_type ref +); + +ruby_heredoc_body_def( + unique int id: @ruby_heredoc_body +); + +@ruby_if_alternative_type = @ruby_else | @ruby_elsif + +ruby_if_alternative( + unique int ruby_if: @ruby_if ref, + unique int alternative: @ruby_if_alternative_type ref +); + +ruby_if_consequence( + unique int ruby_if: @ruby_if ref, + unique int consequence: @ruby_then ref +); + +ruby_if_def( + unique int id: @ruby_if, + int condition: @ruby_underscore_statement ref +); + +ruby_if_guard_def( + unique int id: @ruby_if_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_if_modifier_def( + unique int id: @ruby_if_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_in_def( + unique int id: @ruby_in, + int child: @ruby_underscore_arg ref +); + +ruby_in_clause_body( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int body: @ruby_then ref +); + +@ruby_in_clause_guard_type = @ruby_if_guard | @ruby_unless_guard + +ruby_in_clause_guard( + unique int ruby_in_clause: @ruby_in_clause ref, + unique int guard: @ruby_in_clause_guard_type ref +); + +ruby_in_clause_def( + unique int id: @ruby_in_clause, + int pattern: @ruby_underscore_pattern_top_expr_body ref +); + +@ruby_interpolation_child_type = @ruby_token_empty_statement | @ruby_underscore_nonlocal_variable | @ruby_underscore_statement + +#keyset[ruby_interpolation, index] +ruby_interpolation_child( + int ruby_interpolation: @ruby_interpolation ref, + int index: int ref, + unique int child: @ruby_interpolation_child_type ref +); + +ruby_interpolation_def( + unique int id: @ruby_interpolation +); + +ruby_keyword_parameter_value( + unique int ruby_keyword_parameter: @ruby_keyword_parameter ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_keyword_parameter_def( + unique int id: @ruby_keyword_parameter, + int name: @ruby_token_identifier ref +); + +@ruby_keyword_pattern_key_type = @ruby_string__ | @ruby_token_hash_key_symbol + +ruby_keyword_pattern_value( + unique int ruby_keyword_pattern: @ruby_keyword_pattern ref, + unique int value: @ruby_underscore_pattern_expr ref +); + +ruby_keyword_pattern_def( + unique int id: @ruby_keyword_pattern, + int key__: @ruby_keyword_pattern_key_type ref +); + +@ruby_lambda_body_type = @ruby_block | @ruby_do_block + +ruby_lambda_parameters( + unique int ruby_lambda: @ruby_lambda ref, + unique int parameters: @ruby_lambda_parameters ref +); + +ruby_lambda_def( + unique int id: @ruby_lambda, + int body: @ruby_lambda_body_type ref +); + +@ruby_lambda_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_lambda_parameters, index] +ruby_lambda_parameters_child( + int ruby_lambda_parameters: @ruby_lambda_parameters ref, + int index: int ref, + unique int child: @ruby_lambda_parameters_child_type ref +); + +ruby_lambda_parameters_def( + unique int id: @ruby_lambda_parameters +); + +@ruby_left_assignment_list_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs + +#keyset[ruby_left_assignment_list, index] +ruby_left_assignment_list_child( + int ruby_left_assignment_list: @ruby_left_assignment_list ref, + int index: int ref, + unique int child: @ruby_left_assignment_list_child_type ref +); + +ruby_left_assignment_list_def( + unique int id: @ruby_left_assignment_list +); + +ruby_match_pattern_def( + unique int id: @ruby_match_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_method_body( + unique int ruby_method: @ruby_method ref, + unique int body: @ruby_method_body_type ref +); + +ruby_method_parameters( + unique int ruby_method: @ruby_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_method_def( + unique int id: @ruby_method, + int name: @ruby_underscore_method_name ref +); + +@ruby_method_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier + +#keyset[ruby_method_parameters, index] +ruby_method_parameters_child( + int ruby_method_parameters: @ruby_method_parameters ref, + int index: int ref, + unique int child: @ruby_method_parameters_child_type ref +); + +ruby_method_parameters_def( + unique int id: @ruby_method_parameters +); + +ruby_module_body( + unique int ruby_module: @ruby_module ref, + unique int body: @ruby_body_statement ref +); + +@ruby_module_name_type = @ruby_scope_resolution | @ruby_token_constant + +ruby_module_def( + unique int id: @ruby_module, + int name: @ruby_module_name_type ref +); + +ruby_next_child( + unique int ruby_next: @ruby_next ref, + unique int child: @ruby_argument_list ref +); + +ruby_next_def( + unique int id: @ruby_next +); + +case @ruby_operator_assignment.operator of + 0 = @ruby_operator_assignment_percentequal +| 1 = @ruby_operator_assignment_ampersandampersandequal +| 2 = @ruby_operator_assignment_ampersandequal +| 3 = @ruby_operator_assignment_starstarequal +| 4 = @ruby_operator_assignment_starequal +| 5 = @ruby_operator_assignment_plusequal +| 6 = @ruby_operator_assignment_minusequal +| 7 = @ruby_operator_assignment_slashequal +| 8 = @ruby_operator_assignment_langlelangleequal +| 9 = @ruby_operator_assignment_ranglerangleequal +| 10 = @ruby_operator_assignment_caretequal +| 11 = @ruby_operator_assignment_pipeequal +| 12 = @ruby_operator_assignment_pipepipeequal +; + + +@ruby_operator_assignment_right_type = @ruby_rescue_modifier | @ruby_underscore_expression + +ruby_operator_assignment_def( + unique int id: @ruby_operator_assignment, + int left: @ruby_underscore_lhs ref, + int operator: int ref, + int right: @ruby_operator_assignment_right_type ref +); + +ruby_optional_parameter_def( + unique int id: @ruby_optional_parameter, + int name: @ruby_token_identifier ref, + int value: @ruby_underscore_arg ref +); + +@ruby_pair_key_type = @ruby_string__ | @ruby_token_hash_key_symbol | @ruby_underscore_arg + +ruby_pair_value( + unique int ruby_pair: @ruby_pair ref, + unique int value: @ruby_underscore_arg ref +); + +ruby_pair_def( + unique int id: @ruby_pair, + int key__: @ruby_pair_key_type ref +); + +ruby_parenthesized_pattern_def( + unique int id: @ruby_parenthesized_pattern, + int child: @ruby_underscore_pattern_expr ref +); + +@ruby_parenthesized_statements_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_parenthesized_statements, index] +ruby_parenthesized_statements_child( + int ruby_parenthesized_statements: @ruby_parenthesized_statements ref, + int index: int ref, + unique int child: @ruby_parenthesized_statements_child_type ref +); + +ruby_parenthesized_statements_def( + unique int id: @ruby_parenthesized_statements +); + +@ruby_pattern_child_type = @ruby_splat_argument | @ruby_underscore_arg + +ruby_pattern_def( + unique int id: @ruby_pattern, + int child: @ruby_pattern_child_type ref +); + +@ruby_program_child_type = @ruby_token_empty_statement | @ruby_token_uninterpreted | @ruby_underscore_statement + +#keyset[ruby_program, index] +ruby_program_child( + int ruby_program: @ruby_program ref, + int index: int ref, + unique int child: @ruby_program_child_type ref +); + +ruby_program_def( + unique int id: @ruby_program +); + +@ruby_range_begin_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_begin( + unique int ruby_range: @ruby_range ref, + unique int begin: @ruby_range_begin_type ref +); + +@ruby_range_end_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive + +ruby_range_end( + unique int ruby_range: @ruby_range ref, + unique int end: @ruby_range_end_type ref +); + +case @ruby_range.operator of + 0 = @ruby_range_dotdot +| 1 = @ruby_range_dotdotdot +; + + +ruby_range_def( + unique int id: @ruby_range, + int operator: int ref +); + +@ruby_rational_child_type = @ruby_token_float | @ruby_token_integer + +ruby_rational_def( + unique int id: @ruby_rational, + int child: @ruby_rational_child_type ref +); + +ruby_redo_child( + unique int ruby_redo: @ruby_redo ref, + unique int child: @ruby_argument_list ref +); + +ruby_redo_def( + unique int id: @ruby_redo +); + +@ruby_regex_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_regex, index] +ruby_regex_child( + int ruby_regex: @ruby_regex ref, + int index: int ref, + unique int child: @ruby_regex_child_type ref +); + +ruby_regex_def( + unique int id: @ruby_regex +); + +ruby_rescue_body( + unique int ruby_rescue: @ruby_rescue ref, + unique int body: @ruby_then ref +); + +ruby_rescue_exceptions( + unique int ruby_rescue: @ruby_rescue ref, + unique int exceptions: @ruby_exceptions ref +); + +ruby_rescue_variable( + unique int ruby_rescue: @ruby_rescue ref, + unique int variable: @ruby_exception_variable ref +); + +ruby_rescue_def( + unique int id: @ruby_rescue +); + +@ruby_rescue_modifier_body_type = @ruby_underscore_arg | @ruby_underscore_statement + +ruby_rescue_modifier_def( + unique int id: @ruby_rescue_modifier, + int body: @ruby_rescue_modifier_body_type ref, + int handler: @ruby_underscore_expression ref +); + +ruby_rest_assignment_child( + unique int ruby_rest_assignment: @ruby_rest_assignment ref, + unique int child: @ruby_underscore_lhs ref +); + +ruby_rest_assignment_def( + unique int id: @ruby_rest_assignment +); + +ruby_retry_child( + unique int ruby_retry: @ruby_retry ref, + unique int child: @ruby_argument_list ref +); + +ruby_retry_def( + unique int id: @ruby_retry +); + +ruby_return_child( + unique int ruby_return: @ruby_return ref, + unique int child: @ruby_argument_list ref +); + +ruby_return_def( + unique int id: @ruby_return +); + +@ruby_right_assignment_list_child_type = @ruby_splat_argument | @ruby_underscore_arg + +#keyset[ruby_right_assignment_list, index] +ruby_right_assignment_list_child( + int ruby_right_assignment_list: @ruby_right_assignment_list ref, + int index: int ref, + unique int child: @ruby_right_assignment_list_child_type ref +); + +ruby_right_assignment_list_def( + unique int id: @ruby_right_assignment_list +); + +@ruby_scope_resolution_scope_type = @ruby_underscore_pattern_constant | @ruby_underscore_primary + +ruby_scope_resolution_scope( + unique int ruby_scope_resolution: @ruby_scope_resolution ref, + unique int scope: @ruby_scope_resolution_scope_type ref +); + +ruby_scope_resolution_def( + unique int id: @ruby_scope_resolution, + int name: @ruby_token_constant ref +); + +ruby_setter_def( + unique int id: @ruby_setter, + int name: @ruby_token_identifier ref +); + +ruby_singleton_class_body( + unique int ruby_singleton_class: @ruby_singleton_class ref, + unique int body: @ruby_body_statement ref +); + +ruby_singleton_class_def( + unique int id: @ruby_singleton_class, + int value: @ruby_underscore_arg ref +); + +@ruby_singleton_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg + +ruby_singleton_method_body( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int body: @ruby_singleton_method_body_type ref +); + +@ruby_singleton_method_object_type = @ruby_underscore_arg | @ruby_underscore_variable + +ruby_singleton_method_parameters( + unique int ruby_singleton_method: @ruby_singleton_method ref, + unique int parameters: @ruby_method_parameters ref +); + +ruby_singleton_method_def( + unique int id: @ruby_singleton_method, + int name: @ruby_underscore_method_name ref, + int object: @ruby_singleton_method_object_type ref +); + +ruby_splat_argument_child( + unique int ruby_splat_argument: @ruby_splat_argument ref, + unique int child: @ruby_underscore_arg ref +); + +ruby_splat_argument_def( + unique int id: @ruby_splat_argument +); + +ruby_splat_parameter_name( + unique int ruby_splat_parameter: @ruby_splat_parameter ref, + unique int name: @ruby_token_identifier ref +); + +ruby_splat_parameter_def( + unique int id: @ruby_splat_parameter +); + +@ruby_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_string__, index] +ruby_string_child( + int ruby_string__: @ruby_string__ ref, + int index: int ref, + unique int child: @ruby_string_child_type ref +); + +ruby_string_def( + unique int id: @ruby_string__ +); + +#keyset[ruby_string_array, index] +ruby_string_array_child( + int ruby_string_array: @ruby_string_array ref, + int index: int ref, + unique int child: @ruby_bare_string ref +); + +ruby_string_array_def( + unique int id: @ruby_string_array +); + +@ruby_subshell_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content + +#keyset[ruby_subshell, index] +ruby_subshell_child( + int ruby_subshell: @ruby_subshell ref, + int index: int ref, + unique int child: @ruby_subshell_child_type ref +); + +ruby_subshell_def( + unique int id: @ruby_subshell +); + +ruby_superclass_def( + unique int id: @ruby_superclass, + int child: @ruby_underscore_expression ref +); + +#keyset[ruby_symbol_array, index] +ruby_symbol_array_child( + int ruby_symbol_array: @ruby_symbol_array ref, + int index: int ref, + unique int child: @ruby_bare_symbol ref +); + +ruby_symbol_array_def( + unique int id: @ruby_symbol_array +); + +ruby_test_pattern_def( + unique int id: @ruby_test_pattern, + int pattern: @ruby_underscore_pattern_top_expr_body ref, + int value: @ruby_underscore_arg ref +); + +@ruby_then_child_type = @ruby_token_empty_statement | @ruby_underscore_statement + +#keyset[ruby_then, index] +ruby_then_child( + int ruby_then: @ruby_then ref, + int index: int ref, + unique int child: @ruby_then_child_type ref +); + +ruby_then_def( + unique int id: @ruby_then +); + +@ruby_unary_operand_type = @ruby_parenthesized_statements | @ruby_underscore_expression | @ruby_underscore_simple_numeric + +case @ruby_unary.operator of + 0 = @ruby_unary_bang +| 1 = @ruby_unary_plus +| 2 = @ruby_unary_minus +| 3 = @ruby_unary_definedquestion +| 4 = @ruby_unary_not +| 5 = @ruby_unary_tilde +; + + +ruby_unary_def( + unique int id: @ruby_unary, + int operand: @ruby_unary_operand_type ref, + int operator: int ref +); + +#keyset[ruby_undef, index] +ruby_undef_child( + int ruby_undef: @ruby_undef ref, + int index: int ref, + unique int child: @ruby_underscore_method_name ref +); + +ruby_undef_def( + unique int id: @ruby_undef +); + +@ruby_unless_alternative_type = @ruby_else | @ruby_elsif + +ruby_unless_alternative( + unique int ruby_unless: @ruby_unless ref, + unique int alternative: @ruby_unless_alternative_type ref +); + +ruby_unless_consequence( + unique int ruby_unless: @ruby_unless ref, + unique int consequence: @ruby_then ref +); + +ruby_unless_def( + unique int id: @ruby_unless, + int condition: @ruby_underscore_statement ref +); + +ruby_unless_guard_def( + unique int id: @ruby_unless_guard, + int condition: @ruby_underscore_expression ref +); + +ruby_unless_modifier_def( + unique int id: @ruby_unless_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_until_def( + unique int id: @ruby_until, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_until_modifier_def( + unique int id: @ruby_until_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +@ruby_variable_reference_pattern_name_type = @ruby_token_identifier | @ruby_underscore_nonlocal_variable + +ruby_variable_reference_pattern_def( + unique int id: @ruby_variable_reference_pattern, + int name: @ruby_variable_reference_pattern_name_type ref +); + +ruby_when_body( + unique int ruby_when: @ruby_when ref, + unique int body: @ruby_then ref +); + +#keyset[ruby_when, index] +ruby_when_pattern( + int ruby_when: @ruby_when ref, + int index: int ref, + unique int pattern: @ruby_pattern ref +); + +ruby_when_def( + unique int id: @ruby_when +); + +ruby_while_def( + unique int id: @ruby_while, + int body: @ruby_do ref, + int condition: @ruby_underscore_statement ref +); + +ruby_while_modifier_def( + unique int id: @ruby_while_modifier, + int body: @ruby_underscore_statement ref, + int condition: @ruby_underscore_expression ref +); + +ruby_yield_child( + unique int ruby_yield: @ruby_yield ref, + unique int child: @ruby_argument_list ref +); + +ruby_yield_def( + unique int id: @ruby_yield +); + +ruby_tokeninfo( + unique int id: @ruby_token, + int kind: int ref, + string value: string ref +); + +case @ruby_token.kind of + 0 = @ruby_reserved_word +| 1 = @ruby_token_character +| 2 = @ruby_token_class_variable +| 3 = @ruby_token_comment +| 4 = @ruby_token_constant +| 5 = @ruby_token_empty_statement +| 6 = @ruby_token_encoding +| 7 = @ruby_token_escape_sequence +| 8 = @ruby_token_false +| 9 = @ruby_token_file +| 10 = @ruby_token_float +| 11 = @ruby_token_forward_argument +| 12 = @ruby_token_forward_parameter +| 13 = @ruby_token_global_variable +| 14 = @ruby_token_hash_key_symbol +| 15 = @ruby_token_hash_splat_nil +| 16 = @ruby_token_heredoc_beginning +| 17 = @ruby_token_heredoc_content +| 18 = @ruby_token_heredoc_end +| 19 = @ruby_token_identifier +| 20 = @ruby_token_instance_variable +| 21 = @ruby_token_integer +| 22 = @ruby_token_line +| 23 = @ruby_token_nil +| 24 = @ruby_token_operator +| 25 = @ruby_token_self +| 26 = @ruby_token_simple_symbol +| 27 = @ruby_token_string_content +| 28 = @ruby_token_super +| 29 = @ruby_token_true +| 30 = @ruby_token_uninterpreted +; + + +@ruby_ast_node = @ruby_alias | @ruby_alternative_pattern | @ruby_argument_list | @ruby_array | @ruby_array_pattern | @ruby_as_pattern | @ruby_assignment | @ruby_bare_string | @ruby_bare_symbol | @ruby_begin | @ruby_begin_block | @ruby_binary | @ruby_block | @ruby_block_argument | @ruby_block_body | @ruby_block_parameter | @ruby_block_parameters | @ruby_body_statement | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_complex | @ruby_conditional | @ruby_delimited_symbol | @ruby_destructured_left_assignment | @ruby_destructured_parameter | @ruby_do | @ruby_do_block | @ruby_element_reference | @ruby_else | @ruby_elsif | @ruby_end_block | @ruby_ensure | @ruby_exception_variable | @ruby_exceptions | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_for | @ruby_hash | @ruby_hash_pattern | @ruby_hash_splat_argument | @ruby_hash_splat_parameter | @ruby_heredoc_body | @ruby_if | @ruby_if_guard | @ruby_if_modifier | @ruby_in | @ruby_in_clause | @ruby_interpolation | @ruby_keyword_parameter | @ruby_keyword_pattern | @ruby_lambda | @ruby_lambda_parameters | @ruby_left_assignment_list | @ruby_match_pattern | @ruby_method | @ruby_method_parameters | @ruby_module | @ruby_next | @ruby_operator_assignment | @ruby_optional_parameter | @ruby_pair | @ruby_parenthesized_pattern | @ruby_parenthesized_statements | @ruby_pattern | @ruby_program | @ruby_range | @ruby_rational | @ruby_redo | @ruby_regex | @ruby_rescue | @ruby_rescue_modifier | @ruby_rest_assignment | @ruby_retry | @ruby_return | @ruby_right_assignment_list | @ruby_scope_resolution | @ruby_setter | @ruby_singleton_class | @ruby_singleton_method | @ruby_splat_argument | @ruby_splat_parameter | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_superclass | @ruby_symbol_array | @ruby_test_pattern | @ruby_then | @ruby_token | @ruby_unary | @ruby_undef | @ruby_unless | @ruby_unless_guard | @ruby_unless_modifier | @ruby_until | @ruby_until_modifier | @ruby_variable_reference_pattern | @ruby_when | @ruby_while | @ruby_while_modifier | @ruby_yield + +ruby_ast_node_location( + unique int node: @ruby_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +ruby_ast_node_parent( + unique int node: @ruby_ast_node ref, + int parent: @ruby_ast_node ref, + int parent_index: int ref +); + +/*- Erb dbscheme -*/ +erb_comment_directive_child( + unique int erb_comment_directive: @erb_comment_directive ref, + unique int child: @erb_token_comment ref +); + +erb_comment_directive_def( + unique int id: @erb_comment_directive +); + +erb_directive_child( + unique int erb_directive: @erb_directive ref, + unique int child: @erb_token_code ref +); + +erb_directive_def( + unique int id: @erb_directive +); + +erb_graphql_directive_child( + unique int erb_graphql_directive: @erb_graphql_directive ref, + unique int child: @erb_token_code ref +); + +erb_graphql_directive_def( + unique int id: @erb_graphql_directive +); + +erb_output_directive_child( + unique int erb_output_directive: @erb_output_directive ref, + unique int child: @erb_token_code ref +); + +erb_output_directive_def( + unique int id: @erb_output_directive +); + +@erb_template_child_type = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_token_content + +#keyset[erb_template, index] +erb_template_child( + int erb_template: @erb_template ref, + int index: int ref, + unique int child: @erb_template_child_type ref +); + +erb_template_def( + unique int id: @erb_template +); + +erb_tokeninfo( + unique int id: @erb_token, + int kind: int ref, + string value: string ref +); + +case @erb_token.kind of + 0 = @erb_reserved_word +| 1 = @erb_token_code +| 2 = @erb_token_comment +| 3 = @erb_token_content +; + + +@erb_ast_node = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_template | @erb_token + +erb_ast_node_location( + unique int node: @erb_ast_node ref, + int loc: @location_default ref +); + +#keyset[parent, parent_index] +erb_ast_node_parent( + unique int node: @erb_ast_node ref, + int parent: @erb_ast_node ref, + int parent_index: int ref +); + diff --git a/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/upgrade.properties b/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/upgrade.properties new file mode 100644 index 000000000000..9b83871fb9b6 --- /dev/null +++ b/ruby/ql/lib/upgrades/40a6b0a5e81115bd870b3a12a1fe954b06362bb7/upgrade.properties @@ -0,0 +1,2 @@ +description: Add databaseMetadata relation +compatibility: full diff --git a/rust/extractor/src/archive.rs b/rust/extractor/src/archive.rs index ad27c483942c..2cc3be227016 100644 --- a/rust/extractor/src/archive.rs +++ b/rust/extractor/src/archive.rs @@ -15,7 +15,7 @@ impl Archiver { } fn try_archive(&self, source: &Path) -> std::io::Result<()> { - let dest = file_paths::path_for(&self.root, source, ""); + let dest = file_paths::path_for(&self.root, source, "", None); if fs::metadata(&dest).is_ok() { return Ok(()); } diff --git a/rust/extractor/src/trap.rs b/rust/extractor/src/trap.rs index 2206c4c067b2..a7cb43a64327 100644 --- a/rust/extractor/src/trap.rs +++ b/rust/extractor/src/trap.rs @@ -212,7 +212,7 @@ impl TrapFile { ); } pub fn emit_file(&mut self, absolute_path: &Path) -> Label { - let untyped = extractor::populate_file(&mut self.writer, absolute_path); + let untyped = extractor::populate_file(&mut self.writer, absolute_path, None); // SAFETY: populate_file emits `@file` typed labels unsafe { Label::from_untyped(untyped) } } @@ -268,6 +268,7 @@ impl TrapFileProvider { &self.trap_dir.join(category), key.as_ref(), self.compression.extension(), + None, ); debug!("creating trap file {}", path.display()); let mut writer = trap::Writer::new(); diff --git a/shared/controlflow/codeql/controlflow/BasicBlock.qll b/shared/controlflow/codeql/controlflow/BasicBlock.qll index 9c26b18c0938..132920e329fb 100644 --- a/shared/controlflow/codeql/controlflow/BasicBlock.qll +++ b/shared/controlflow/codeql/controlflow/BasicBlock.qll @@ -5,6 +5,8 @@ * INTERNAL use only. This is an experimental API subject to change without * notice. */ +overlay[local?] +module; private import codeql.util.Location diff --git a/shared/controlflow/codeql/controlflow/Cfg.qll b/shared/controlflow/codeql/controlflow/Cfg.qll index bb49cc8d8aee..c9d7d4147347 100644 --- a/shared/controlflow/codeql/controlflow/Cfg.qll +++ b/shared/controlflow/codeql/controlflow/Cfg.qll @@ -2,6 +2,8 @@ * Provides a shared interface and implementation for constructing control-flow graphs * (CFGs) from abstract syntax trees (ASTs). */ +overlay[local?] +module; private import codeql.util.Location private import codeql.util.FileSystem diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 93327f5ad6a3..3483287e3b39 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -3,6 +3,8 @@ * adds a global analysis, mainly exposed through the `Global` and `GlobalWithState` * modules. */ +overlay[local?] +module; private import codeql.util.Location diff --git a/shared/dataflow/codeql/dataflow/TaintTracking.qll b/shared/dataflow/codeql/dataflow/TaintTracking.qll index 24aea44320e0..bd4b4ecd6ca5 100644 --- a/shared/dataflow/codeql/dataflow/TaintTracking.qll +++ b/shared/dataflow/codeql/dataflow/TaintTracking.qll @@ -2,6 +2,8 @@ * Provides modules for performing local (intra-procedural) and * global (inter-procedural) taint-tracking analyses. */ +overlay[local?] +module; private import DataFlow as DF private import internal.DataFlowImpl diff --git a/shared/dataflow/codeql/dataflow/VariableCapture.qll b/shared/dataflow/codeql/dataflow/VariableCapture.qll index c2c84b7f0f87..4df415f90ad9 100644 --- a/shared/dataflow/codeql/dataflow/VariableCapture.qll +++ b/shared/dataflow/codeql/dataflow/VariableCapture.qll @@ -2,6 +2,8 @@ * Provides a module for synthesizing data-flow nodes and related step relations * for supporting flow through captured variables. */ +overlay[local?] +module; private import codeql.util.Boolean private import codeql.util.Unit diff --git a/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll b/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll index 17b979e42a66..78b6db4090a5 100644 --- a/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll +++ b/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll @@ -5,6 +5,8 @@ * This file is used by the shared data flow library and by the JavaScript libraries * (which does not use the shared data flow libraries). */ +overlay[local?] +module; /** * Convenience-predicate for extracting two capture groups at once. diff --git a/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll index 1eaa84505419..baf473efff16 100644 --- a/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll @@ -22,6 +22,8 @@ * steps, followed by 0 or more stores, with value-preserving steps allowed in * between all other steps. */ +overlay[local?] +module; private import codeql.dataflow.DataFlow private import codeql.util.Boolean diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index a13c71f554cc..9b0e353dc095 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -3,6 +3,8 @@ * * Provides an implementation of global (interprocedural) data flow. */ +overlay[local?] +module; private import codeql.util.Unit private import codeql.util.Option @@ -792,6 +794,7 @@ module MakeImpl Lang> { innercc = getCallContextCall(call, inner) } + overlay[caller] pragma[inline] predicate fwdFlowIn( Call call, ArgNd arg, Callable inner, ParamNd p, Cc outercc, CcCall innercc, @@ -2321,6 +2324,7 @@ module MakeImpl Lang> { * For more information, see * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). */ + overlay[caller] pragma[inline] deprecated final predicate hasLocationInfo( string filepath, int startline, int startcolumn, int endline, int endcolumn @@ -2524,6 +2528,7 @@ module MakeImpl Lang> { class ApHeadContent = Unit; + overlay[caller] pragma[inline] ApHeadContent getHeadContent(Ap ap) { exists(result) and ap = true } diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll index 845da27aae7a..b2bdc0c12e67 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import codeql.dataflow.DataFlow private import codeql.typetracking.TypeTracking as Tt private import codeql.util.Location @@ -674,6 +677,7 @@ module MakeImplCommon Lang> { class CcCall = CallContextCall; + overlay[caller] pragma[inline] predicate matchesCall(CcCall cc, Call call) { cc = Input2::getSpecificCallContextCall(call, _) or @@ -885,6 +889,7 @@ module MakeImplCommon Lang> { pragma[nomagic] private Callable getEnclosingCallable0() { nodeEnclosingCallable(this.projectToNode(), result) } + overlay[caller] pragma[inline] Callable getEnclosingCallable() { pragma[only_bind_out](this).getEnclosingCallable0() = pragma[only_bind_into](result) @@ -899,6 +904,7 @@ module MakeImplCommon Lang> { isTopType(result) and this.isImplicitReadNode(_) } + overlay[caller] pragma[inline] Type getType() { pragma[only_bind_out](this).getType0() = pragma[only_bind_into](result) } @@ -2410,12 +2416,14 @@ module MakeImplCommon Lang> { * predicate ensures that joins go from `n` to the result instead of the other * way around. */ + overlay[caller] pragma[inline] Callable getNodeEnclosingCallable(Node n) { nodeEnclosingCallable(pragma[only_bind_out](n), pragma[only_bind_into](result)) } /** Gets the type of `n` used for type pruning. */ + overlay[caller] pragma[inline] Type getNodeDataFlowType(Node n) { nodeType(pragma[only_bind_out](n), pragma[only_bind_into](result)) diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll index 7721a5df0445..83abd41f5e6e 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll @@ -2,6 +2,8 @@ * Provides consistency queries for checking invariants in the language-specific * data-flow classes and predicates. */ +overlay[local?] +module; private import codeql.dataflow.DataFlow as DF private import codeql.dataflow.TaintTracking as TT diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll index f9eaea566cd8..07147fc56673 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll @@ -4,6 +4,8 @@ * Provides an implementation of a fast initial pruning of global * (interprocedural) data flow reachability (Stage 1). */ +overlay[local?] +module; private import codeql.util.Unit private import codeql.util.Location @@ -1784,6 +1786,7 @@ module MakeImplStage1 Lang> { * For more information, see * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). */ + overlay[caller] pragma[inline] deprecated predicate hasLocationInfo( string filepath, int startline, int startcolumn, int endline, int endcolumn diff --git a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll index e6da5d3a37f6..3eda6709517c 100644 --- a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for defining flow summaries. */ +overlay[local?] +module; private import codeql.dataflow.DataFlow as DF private import codeql.util.Location diff --git a/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll b/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll index 2171c9096434..4a5e92fd5897 100644 --- a/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll +++ b/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll @@ -5,6 +5,8 @@ * In addition to the `PathGraph`, a `query predicate models` is provided to * list the contents of the referenced MaD rows. */ +overlay[local?] +module; private import codeql.dataflow.DataFlow as DF diff --git a/shared/mad/codeql/mad/ModelValidation.qll b/shared/mad/codeql/mad/ModelValidation.qll index 4c1d6793d652..98b2a212c316 100644 --- a/shared/mad/codeql/mad/ModelValidation.qll +++ b/shared/mad/codeql/mad/ModelValidation.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates related to validating models-as-data rows. */ +overlay[local?] +module; /** Provides predicates for determining if a model exists for a given `kind`. */ signature module KindValidationConfigSig { diff --git a/shared/mad/codeql/mad/dynamic/GraphExport.qll b/shared/mad/codeql/mad/dynamic/GraphExport.qll index e28c82f47ab3..b666a96fb67a 100644 --- a/shared/mad/codeql/mad/dynamic/GraphExport.qll +++ b/shared/mad/codeql/mad/dynamic/GraphExport.qll @@ -1,6 +1,8 @@ /** * Contains predicates for converting an arbitrary graph to a set of `typeModel` rows. */ +overlay[local?] +module; private import codeql.util.Location diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index 829bf267c226..51dafc2cc96a 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -4,6 +4,8 @@ * Provides classes and predicates related to capturing summary, source, * and sink models of the Standard or a 3rd party library. */ +overlay[local?] +module; private import codeql.dataflow.DataFlow private import codeql.dataflow.TaintTracking as Tt diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll index d4fbd9062b63..a5f9145714bf 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + signature module ModelPrintingLangSig { /** * A class of callables. diff --git a/shared/quantum/codeql/quantum/experimental/Model.qll b/shared/quantum/codeql/quantum/experimental/Model.qll index d4a900f9bcac..e3ed4aea5d7a 100644 --- a/shared/quantum/codeql/quantum/experimental/Model.qll +++ b/shared/quantum/codeql/quantum/experimental/Model.qll @@ -1,6 +1,8 @@ /** * A language-independent library for reasoning about cryptography. */ +overlay[local?] +module; import codeql.util.Location diff --git a/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll b/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll index db3377ff3cc1..f7864a01f446 100644 --- a/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll +++ b/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll @@ -3,6 +3,8 @@ * an expression, `b` is a `Bound` (typically zero or the value of an SSA * variable), and `v` is an integer in the range `[0 .. m-1]`. */ +overlay[local?] +module; /* * The main recursion has base cases in both `ssaModulus` (for guarded reads) and `exprModulus` diff --git a/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll b/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll index 445ec9f0b8d3..1d17ad8346c4 100644 --- a/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll +++ b/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll @@ -8,6 +8,8 @@ * If an inferred bound relies directly on a condition, then this condition is * reported as the reason for the bound. */ +overlay[local?] +module; /* * This library tackles range analysis as a flow problem. Consider e.g.: diff --git a/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll b/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll index d6eeb781f391..1592102bc8e6 100644 --- a/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll +++ b/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import codeql.rangeanalysis.RangeAnalysis private import codeql.util.Location diff --git a/shared/regex/codeql/regex/HostnameRegexp.qll b/shared/regex/codeql/regex/HostnameRegexp.qll index fc77b9b56e2e..7d97d71ccef9 100644 --- a/shared/regex/codeql/regex/HostnameRegexp.qll +++ b/shared/regex/codeql/regex/HostnameRegexp.qll @@ -2,6 +2,8 @@ * Provides predicates for reasoning about regular expressions * that match URLs and hostname patterns. */ +overlay[local?] +module; private import RegexTreeView diff --git a/shared/regex/codeql/regex/MissingRegExpAnchor.qll b/shared/regex/codeql/regex/MissingRegExpAnchor.qll index c4fe642b790d..722d1baafd6c 100644 --- a/shared/regex/codeql/regex/MissingRegExpAnchor.qll +++ b/shared/regex/codeql/regex/MissingRegExpAnchor.qll @@ -2,6 +2,8 @@ * Provides predicates for reasoning about regular expressions * without anchors. */ +overlay[local?] +module; private import RegexTreeView import HostnameRegexp as HostnameShared diff --git a/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll b/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll index 57d7d365611b..88645a2abde1 100644 --- a/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll +++ b/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll @@ -1,6 +1,8 @@ /** * Classes and predicates for working with suspicious character ranges. */ +overlay[local?] +module; private import RegexTreeView diff --git a/shared/regex/codeql/regex/RegexTreeView.qll b/shared/regex/codeql/regex/RegexTreeView.qll index 03d8fcfcbcd6..7a37a2eaceb9 100644 --- a/shared/regex/codeql/regex/RegexTreeView.qll +++ b/shared/regex/codeql/regex/RegexTreeView.qll @@ -1,6 +1,8 @@ /** * This file contains a `RegexTreeViewSig` module describing the syntax tree of regular expressions. */ +overlay[local?] +module; /** * A signature describing the syntax tree of regular expressions. diff --git a/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll b/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll index 0d040bc6f64c..a38229da4971 100644 --- a/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll +++ b/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll @@ -1,6 +1,8 @@ /** * Provides predicates for reasoning about bad tag filter vulnerabilities. */ +overlay[local?] +module; private import NfaUtils as NfaUtils private import RegexpMatching as RM diff --git a/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll b/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll index 450ee807089d..23f764973715 100644 --- a/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll +++ b/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll @@ -61,6 +61,8 @@ * * Lastly we ensure that any state reached by repeating `n` copies of `w` has * a suffix `x` (possible empty) that is most likely __not__ accepted. */ +overlay[local?] +module; private import NfaUtils as NfaUtils private import codeql.regex.RegexTreeView diff --git a/shared/regex/codeql/regex/nfa/NfaUtils.qll b/shared/regex/codeql/regex/nfa/NfaUtils.qll index d074081b6ac2..e1be49796e00 100644 --- a/shared/regex/codeql/regex/nfa/NfaUtils.qll +++ b/shared/regex/codeql/regex/nfa/NfaUtils.qll @@ -1,6 +1,8 @@ /** * A shared library for creating and reasoning about NFA's. */ +overlay[local?] +module; private import codeql.regex.RegexTreeView private import codeql.util.Numbers diff --git a/shared/regex/codeql/regex/nfa/RegexpMatching.qll b/shared/regex/codeql/regex/nfa/RegexpMatching.qll index fae1cea5f8c1..85c21b355a4b 100644 --- a/shared/regex/codeql/regex/nfa/RegexpMatching.qll +++ b/shared/regex/codeql/regex/nfa/RegexpMatching.qll @@ -2,6 +2,8 @@ * Provides predicates for reasoning about which strings are matched by a regular expression, * and for testing which capture groups are filled when a particular regexp matches a string. */ +overlay[local?] +module; private import NfaUtils as NfaUtils private import codeql.regex.RegexTreeView diff --git a/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll b/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll index 6eb18aeeebc9..2faac9b02117 100644 --- a/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll +++ b/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll @@ -34,6 +34,8 @@ * It has the same suffix detection issue as the `js/redos` query, which can cause false positives. * It also doesn't find all transitions in the product automaton, which can cause false negatives. */ +overlay[local?] +module; private import NfaUtils as NfaUtils private import codeql.regex.RegexTreeView @@ -99,6 +101,7 @@ module Make { /** * Holds if the tuple `(r1, r2, r3)` might be on path from a start-state to an end-state in the product automaton. */ + overlay[caller] pragma[inline] predicate isFeasibleTuple(State r1, State r2, State r3) { // The first element is either inside a repetition (or the start state itself) diff --git a/shared/ssa/codeql/ssa/Ssa.qll b/shared/ssa/codeql/ssa/Ssa.qll index 4734cf7e414b..d9a017920171 100644 --- a/shared/ssa/codeql/ssa/Ssa.qll +++ b/shared/ssa/codeql/ssa/Ssa.qll @@ -2,6 +2,8 @@ * Provides a language-independent implementation of static single assignment * (SSA) form. */ +overlay[local?] +module; private import codeql.util.Location private import codeql.util.Unit diff --git a/shared/threat-models/codeql/threatmodels/ThreatModels.qll b/shared/threat-models/codeql/threatmodels/ThreatModels.qll index 19dfd0d1a656..dbb220c46e67 100644 --- a/shared/threat-models/codeql/threatmodels/ThreatModels.qll +++ b/shared/threat-models/codeql/threatmodels/ThreatModels.qll @@ -4,6 +4,8 @@ * This module provides extensible predicates for configuring which kinds of MaD models * are applicable to generic queries. */ +overlay[local?] +module; /** * Holds configuration entries to specify which threat models are enabled. diff --git a/shared/tree-sitter-extractor/src/extractor/mod.rs b/shared/tree-sitter-extractor/src/extractor/mod.rs index 18a0cfc94520..0bc489cd5591 100644 --- a/shared/tree-sitter-extractor/src/extractor/mod.rs +++ b/shared/tree-sitter-extractor/src/extractor/mod.rs @@ -67,19 +67,26 @@ pub fn default_subscriber_with_level( ), ) } -pub fn populate_file(writer: &mut trap::Writer, absolute_path: &Path) -> trap::Label { +pub fn populate_file( + writer: &mut trap::Writer, + absolute_path: &Path, + transformer: Option<&file_paths::PathTransformer>, +) -> trap::Label { let (file_label, fresh) = writer.global_id(&trap::full_id_for_file( - &file_paths::normalize_path(absolute_path), + &file_paths::normalize_and_transform_path(absolute_path, transformer), )); if fresh { writer.add_tuple( "files", vec![ trap::Arg::Label(file_label), - trap::Arg::String(file_paths::normalize_path(absolute_path)), + trap::Arg::String(file_paths::normalize_and_transform_path( + absolute_path, + transformer, + )), ], ); - populate_parent_folders(writer, file_label, absolute_path.parent()); + populate_parent_folders(writer, file_label, absolute_path.parent(), transformer); } file_label } @@ -117,6 +124,7 @@ pub fn populate_parent_folders( writer: &mut trap::Writer, child_label: trap::Label, path: Option<&Path>, + transformer: Option<&file_paths::PathTransformer>, ) { let mut path = path; let mut child_label = child_label; @@ -124,9 +132,9 @@ pub fn populate_parent_folders( match path { None => break, Some(folder) => { - let (folder_label, fresh) = writer.global_id(&trap::full_id_for_folder( - &file_paths::normalize_path(folder), - )); + let parent = folder.parent(); + let folder = file_paths::normalize_and_transform_path(folder, transformer); + let (folder_label, fresh) = writer.global_id(&trap::full_id_for_folder(&folder)); writer.add_tuple( "containerparent", vec![ @@ -137,12 +145,9 @@ pub fn populate_parent_folders( if fresh { writer.add_tuple( "folders", - vec![ - trap::Arg::Label(folder_label), - trap::Arg::String(file_paths::normalize_path(folder)), - ], + vec![trap::Arg::Label(folder_label), trap::Arg::String(folder)], ); - path = folder.parent(); + path = parent; child_label = folder_label; } else { break; @@ -205,11 +210,12 @@ pub fn extract( schema: &NodeTypeMap, diagnostics_writer: &mut diagnostics::LogWriter, trap_writer: &mut trap::Writer, + transformer: Option<&file_paths::PathTransformer>, path: &Path, source: &[u8], ranges: &[Range], ) { - let path_str = file_paths::normalize_path(path); + let path_str = file_paths::normalize_and_transform_path(path, transformer); let span = tracing::span!( tracing::Level::TRACE, "extract", @@ -225,7 +231,7 @@ pub fn extract( parser.set_included_ranges(ranges).unwrap(); let tree = parser.parse(source, None).expect("Failed to parse file"); trap_writer.comment(format!("Auto-generated TRAP file for {}", path_str)); - let file_label = populate_file(trap_writer, path); + let file_label = populate_file(trap_writer, path, transformer); let mut visitor = Visitor::new( source, diagnostics_writer, diff --git a/shared/tree-sitter-extractor/src/extractor/simple.rs b/shared/tree-sitter-extractor/src/extractor/simple.rs index eb1232a8ef2e..10414a7665bf 100644 --- a/shared/tree-sitter-extractor/src/extractor/simple.rs +++ b/shared/tree-sitter-extractor/src/extractor/simple.rs @@ -1,4 +1,4 @@ -use crate::trap; +use crate::{file_paths, trap}; use globset::{GlobBuilder, GlobSetBuilder}; use rayon::prelude::*; use std::fs::File; @@ -111,6 +111,8 @@ impl Extractor { ) }; + let path_transformer = file_paths::load_path_transformer()?; + let lines: std::io::Result> = file_lists .iter() .flat_map(|file_list| std::io::BufReader::new(file_list).lines()) @@ -122,8 +124,12 @@ impl Extractor { .try_for_each(|line| { let mut diagnostics_writer = diagnostics.logger(); let path = PathBuf::from(line).canonicalize()?; - let src_archive_file = - crate::file_paths::path_for(&self.source_archive_dir, &path, ""); + let src_archive_file = crate::file_paths::path_for( + &self.source_archive_dir, + &path, + "", + path_transformer.as_ref(), + ); let source = std::fs::read(&path)?; let mut trap_writer = trap::Writer::new(); @@ -152,6 +158,7 @@ impl Extractor { &schemas[i], &mut diagnostics_writer, &mut trap_writer, + None, &path, &source, &[], @@ -183,7 +190,7 @@ fn write_trap( trap_writer: &trap::Writer, trap_compression: trap::Compression, ) -> std::io::Result<()> { - let trap_file = crate::file_paths::path_for(trap_dir, path, trap_compression.extension()); + let trap_file = crate::file_paths::path_for(trap_dir, path, trap_compression.extension(), None); std::fs::create_dir_all(trap_file.parent().unwrap())?; trap_writer.write_to_file(&trap_file, trap_compression) } diff --git a/shared/tree-sitter-extractor/src/file_paths.rs b/shared/tree-sitter-extractor/src/file_paths.rs index 917a2fb63227..bdb9dd035f06 100644 --- a/shared/tree-sitter-extractor/src/file_paths.rs +++ b/shared/tree-sitter-extractor/src/file_paths.rs @@ -1,8 +1,81 @@ -use std::path::{Path, PathBuf}; +use std::{ + fs, + path::{Path, PathBuf}, +}; -/// Normalizes the path according the common CodeQL specification. Assumes that -/// `path` has already been canonicalized using `std::fs::canonicalize`. -pub fn normalize_path(path: &Path) -> String { +/// This represents the minimum supported path transformation that is needed to support extracting +/// overlay databases. Specifically, it represents a transformer where one path prefix is replaced +/// with a different prefix. +pub struct PathTransformer { + pub original: String, + pub replacement: String, +} + +/// Normalizes the path according to the common CodeQL specification, and, applies the given path +/// transformer, if any. Assumes that `path` has already been canonicalized using +/// `std::fs::canonicalize`. +pub fn normalize_and_transform_path(path: &Path, transformer: Option<&PathTransformer>) -> String { + let path = normalize_path(path); + match transformer { + Some(transformer) => match path.strip_prefix(&transformer.original) { + Some(suffix) => format!("{}{}", transformer.replacement, suffix), + None => path, + }, + None => path, + } +} + +/** + * Attempts to load a path transformer. + * + * If the `CODEQL_PATH_TRANSFORMER` environment variable is not set, no transformer has been + * specified and the function returns `Ok(None)`. + * + * If the environment variable is set, the function attempts to load the transformer from the file + * at the specified path. If this is successful, it returns `Ok(Some(PathTransformer))`. + * + * If the file cannot be read, or if it does not match the minimal subset of the path-transformer + * syntax supported by this extractor, the function returns an error. + */ +pub fn load_path_transformer() -> std::io::Result> { + let path = match std::env::var("CODEQL_PATH_TRANSFORMER") { + Ok(p) => p, + Err(_) => return Ok(None), + }; + let file_content = fs::read_to_string(path)?; + let lines = file_content + .lines() + .map(|line| line.trim().to_owned()) + .filter(|line| !line.is_empty()) + .collect::>(); + + if lines.len() != 2 { + return Err(unsupported_transformer_error()); + } + let replacement = lines[0] + .strip_prefix('#') + .ok_or(unsupported_transformer_error())?; + let original = lines[1] + .strip_suffix("//") + .ok_or(unsupported_transformer_error())?; + + Ok(Some(PathTransformer { + original: original.to_owned(), + replacement: replacement.to_owned(), + })) +} + +fn unsupported_transformer_error() -> std::io::Error { + std::io::Error::new( + std::io::ErrorKind::InvalidData, + "This extractor only supports path transformers specifying a single path-prefix rewrite, \ + with the first line starting with a # and the second line ending with //.", + ) +} + +/// Normalizes the path according to the common CodeQL specification. Assumes that `path` has +/// already been canonicalized using `std::fs::canonicalize`. +fn normalize_path(path: &Path) -> String { if cfg!(windows) { // The way Rust canonicalizes paths doesn't match the CodeQL spec, so we // have to do a bit of work removing certain prefixes and replacing @@ -93,7 +166,18 @@ pub fn path_from_string(path: &str) -> PathBuf { result } -pub fn path_for(dir: &Path, path: &Path, ext: &str) -> PathBuf { +pub fn path_for( + dir: &Path, + path: &Path, + ext: &str, + transformer: Option<&PathTransformer>, +) -> PathBuf { + let path = if transformer.is_some() { + let transformed = normalize_and_transform_path(path, transformer); + PathBuf::from(transformed) + } else { + path.to_path_buf() + }; let mut result = PathBuf::from(dir); for component in path.components() { match component { diff --git a/shared/tree-sitter-extractor/src/generator/mod.rs b/shared/tree-sitter-extractor/src/generator/mod.rs index d972e9fb128d..f4de09ed3756 100644 --- a/shared/tree-sitter-extractor/src/generator/mod.rs +++ b/shared/tree-sitter-extractor/src/generator/mod.rs @@ -17,6 +17,7 @@ pub fn generate( languages: Vec, dbscheme_path: PathBuf, ql_library_path: PathBuf, + overlay_support: bool, ) -> std::io::Result<()> { let dbscheme_file = File::create(dbscheme_path).map_err(|e| { tracing::error!("Failed to create dbscheme file: {}", e); @@ -32,6 +33,16 @@ pub fn generate( writeln!(dbscheme_writer, include_str!("prefix.dbscheme"))?; + // Eventually all languages will have the metadata relation (for overlay support), at which + // point this could be moved to prefix.dbscheme. + if overlay_support { + writeln!(dbscheme_writer, "/*- Database metadata -*/",)?; + dbscheme::write( + &mut dbscheme_writer, + &[dbscheme::Entry::Table(create_database_metadata())], + )?; + } + let mut ql_writer = LineWriter::new(File::create(ql_library_path)?); writeln!( ql_writer, @@ -49,6 +60,15 @@ pub fn generate( })], )?; + if overlay_support { + ql::write( + &mut ql_writer, + &[ql::TopLevel::Predicate( + ql_gen::create_is_overlay_predicate(), + )], + )?; + } + for language in languages { let prefix = node_types::to_snake_case(&language.name); let ast_node_name = format!("{}_ast_node", &prefix); @@ -92,6 +112,22 @@ pub fn generate( ql::TopLevel::Class(ql_gen::create_token_class(&token_name, &tokeninfo_name)), ql::TopLevel::Class(ql_gen::create_reserved_word_class(&reserved_word_name)), ]; + + if overlay_support { + body.push(ql::TopLevel::Predicate( + ql_gen::create_get_node_file_predicate(&ast_node_name, &node_location_table_name), + )); + body.push(ql::TopLevel::Predicate( + ql_gen::create_discard_file_predicate(), + )); + body.push(ql::TopLevel::Predicate( + ql_gen::create_discardable_ast_node_predicate(&ast_node_name), + )); + body.push(ql::TopLevel::Predicate( + ql_gen::create_discard_ast_node_predicate(&ast_node_name), + )); + } + body.append(&mut ql_gen::convert_nodes(&nodes)); ql::write( &mut ql_writer, @@ -99,6 +135,11 @@ pub fn generate( qldoc: None, name: &language.name, body, + overlay: if overlay_support { + Some(ql::OverlayAnnotation::Local) + } else { + None + }, })], )?; } @@ -442,3 +483,26 @@ fn create_token_case<'a>(name: &'a str, token_kinds: Map<&'a str, usize>) -> dbs branches, } } + +fn create_database_metadata() -> dbscheme::Table<'static> { + dbscheme::Table { + name: "databaseMetadata", + keysets: None, + columns: vec![ + dbscheme::Column { + db_type: dbscheme::DbColumnType::String, + name: "metadataKey", + unique: false, + ql_type: ql::Type::String, + ql_type_is_ref: true, + }, + dbscheme::Column { + db_type: dbscheme::DbColumnType::String, + name: "value", + unique: false, + ql_type: ql::Type::String, + ql_type_is_ref: true, + }, + ], + } +} diff --git a/shared/tree-sitter-extractor/src/generator/ql.rs b/shared/tree-sitter-extractor/src/generator/ql.rs index 8e899462ac39..b1e319afb1e8 100644 --- a/shared/tree-sitter-extractor/src/generator/ql.rs +++ b/shared/tree-sitter-extractor/src/generator/ql.rs @@ -6,6 +6,7 @@ pub enum TopLevel<'a> { Class(Class<'a>), Import(Import<'a>), Module(Module<'a>), + Predicate(Predicate<'a>), } impl fmt::Display for TopLevel<'_> { @@ -14,6 +15,7 @@ impl fmt::Display for TopLevel<'_> { TopLevel::Import(imp) => write!(f, "{}", imp), TopLevel::Class(cls) => write!(f, "{}", cls), TopLevel::Module(m) => write!(f, "{}", m), + TopLevel::Predicate(pred) => write!(f, "{}", pred), } } } @@ -68,10 +70,12 @@ impl fmt::Display for Class<'_> { qldoc: None, name: self.name, overridden: false, + is_private: false, is_final: false, return_type: None, formal_parameters: vec![], body: charpred.clone(), + overlay: None, } )?; } @@ -91,6 +95,7 @@ pub struct Module<'a> { pub qldoc: Option, pub name: &'a str, pub body: Vec>, + pub overlay: Option, } impl fmt::Display for Module<'_> { @@ -98,6 +103,14 @@ impl fmt::Display for Module<'_> { if let Some(qldoc) = &self.qldoc { write!(f, "/** {} */", qldoc)?; } + if let Some(overlay_annotation) = &self.overlay { + write!(f, "overlay[")?; + match overlay_annotation { + OverlayAnnotation::Local => write!(f, "local")?, + OverlayAnnotation::DiscardEntity => write!(f, "discard_entity")?, + } + write!(f, "] ")?; + } writeln!(f, "module {} {{ ", self.name)?; for decl in &self.body { writeln!(f, " {}", decl)?; @@ -150,6 +163,7 @@ pub enum Expression<'a> { expr: Box>, second_expr: Option>>, }, + Negation(Box>), } impl fmt::Display for Expression<'_> { @@ -231,19 +245,28 @@ impl fmt::Display for Expression<'_> { } write!(f, ")") } + Expression::Negation(e) => write!(f, "not ({})", e), } } } +#[derive(Clone, Eq, PartialEq, Hash)] +pub enum OverlayAnnotation { + Local, + DiscardEntity, +} + #[derive(Clone, Eq, PartialEq, Hash)] pub struct Predicate<'a> { pub qldoc: Option, pub name: &'a str, pub overridden: bool, + pub is_private: bool, pub is_final: bool, pub return_type: Option>, pub formal_parameters: Vec>, pub body: Expression<'a>, + pub overlay: Option, } impl fmt::Display for Predicate<'_> { @@ -251,6 +274,17 @@ impl fmt::Display for Predicate<'_> { if let Some(qldoc) = &self.qldoc { write!(f, "/** {} */", qldoc)?; } + if let Some(overlay_annotation) = &self.overlay { + write!(f, "overlay[")?; + match overlay_annotation { + OverlayAnnotation::Local => write!(f, "local")?, + OverlayAnnotation::DiscardEntity => write!(f, "discard_entity")?, + } + write!(f, "] ")?; + } + if self.is_private { + write!(f, "private ")?; + } if self.is_final { write!(f, "final ")?; } diff --git a/shared/tree-sitter-extractor/src/generator/ql_gen.rs b/shared/tree-sitter-extractor/src/generator/ql_gen.rs index 919ff43af428..f6f3c574bc39 100644 --- a/shared/tree-sitter-extractor/src/generator/ql_gen.rs +++ b/shared/tree-sitter-extractor/src/generator/ql_gen.rs @@ -16,6 +16,7 @@ pub fn create_ast_node_class<'a>( )), name: "toString", overridden: false, + is_private: false, is_final: false, return_type: Some(ql::Type::String), formal_parameters: vec![], @@ -27,11 +28,13 @@ pub fn create_ast_node_class<'a>( vec![], )), ), + overlay: None, }; let get_location = ql::Predicate { name: "getLocation", qldoc: Some(String::from("Gets the location of this element.")), overridden: false, + is_private: false, is_final: true, return_type: Some(ql::Type::Normal("L::Location")), formal_parameters: vec![], @@ -39,6 +42,7 @@ pub fn create_ast_node_class<'a>( node_location_table, vec![ql::Expression::Var("this"), ql::Expression::Var("result")], ), + overlay: None, }; let get_a_field_or_child = create_none_predicate( Some(String::from("Gets a field or child node of this node.")), @@ -50,6 +54,7 @@ pub fn create_ast_node_class<'a>( qldoc: Some(String::from("Gets the parent of this element.")), name: "getParent", overridden: false, + is_private: false, is_final: true, return_type: Some(ql::Type::Normal("AstNode")), formal_parameters: vec![], @@ -61,6 +66,7 @@ pub fn create_ast_node_class<'a>( ql::Expression::Var("_"), ], ), + overlay: None, }; let get_parent_index = ql::Predicate { qldoc: Some(String::from( @@ -68,6 +74,7 @@ pub fn create_ast_node_class<'a>( )), name: "getParentIndex", overridden: false, + is_private: false, is_final: true, return_type: Some(ql::Type::Int), formal_parameters: vec![], @@ -79,6 +86,7 @@ pub fn create_ast_node_class<'a>( ql::Expression::Var("result"), ], ), + overlay: None, }; let get_a_primary_ql_class = ql::Predicate { qldoc: Some(String::from( @@ -86,6 +94,7 @@ pub fn create_ast_node_class<'a>( )), name: "getAPrimaryQlClass", overridden: false, + is_private: false, is_final: false, return_type: Some(ql::Type::String), formal_parameters: vec![], @@ -93,6 +102,7 @@ pub fn create_ast_node_class<'a>( Box::new(ql::Expression::Var("result")), Box::new(ql::Expression::String("???")), ), + overlay: None, }; let get_primary_ql_classes = ql::Predicate { qldoc: Some( @@ -102,6 +112,7 @@ pub fn create_ast_node_class<'a>( ), name: "getPrimaryQlClasses", overridden: false, + is_private: false, is_final: false, return_type: Some(ql::Type::String), formal_parameters: vec![], @@ -119,6 +130,7 @@ pub fn create_ast_node_class<'a>( second_expr: Some(Box::new(ql::Expression::String(","))), }), ), + overlay: None, }; ql::Class { qldoc: Some(String::from("The base class for all AST nodes")), @@ -144,10 +156,12 @@ pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Cl qldoc: Some(String::from("Gets the value of this token.")), name: "getValue", overridden: false, + is_private: false, is_final: true, return_type: Some(ql::Type::String), formal_parameters: vec![], body: create_get_field_expr_for_column_storage("result", tokeninfo, 1, tokeninfo_arity), + overlay: None, }; let to_string = ql::Predicate { qldoc: Some(String::from( @@ -155,6 +169,7 @@ pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Cl )), name: "toString", overridden: true, + is_private: false, is_final: true, return_type: Some(ql::Type::String), formal_parameters: vec![], @@ -166,6 +181,7 @@ pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Cl vec![], )), ), + overlay: None, }; ql::Class { qldoc: Some(String::from("A token.")), @@ -210,10 +226,12 @@ fn create_none_predicate<'a>( qldoc, name, overridden, + is_private: false, is_final: false, return_type, formal_parameters: Vec::new(), body: ql::Expression::Pred("none", vec![]), + overlay: None, } } @@ -226,6 +244,7 @@ fn create_get_a_primary_ql_class(class_name: &str, is_final: bool) -> ql::Predic )), name: "getAPrimaryQlClass", overridden: true, + is_private: false, is_final, return_type: Some(ql::Type::String), formal_parameters: vec![], @@ -233,6 +252,166 @@ fn create_get_a_primary_ql_class(class_name: &str, is_final: bool) -> ql::Predic Box::new(ql::Expression::Var("result")), Box::new(ql::Expression::String(class_name)), ), + overlay: None, + } +} + +pub fn create_is_overlay_predicate() -> ql::Predicate<'static> { + ql::Predicate { + name: "isOverlay", + qldoc: Some(String::from("Holds if the database is an overlay.")), + overridden: false, + is_private: true, + is_final: false, + return_type: None, + overlay: Some(ql::OverlayAnnotation::Local), + formal_parameters: vec![], + body: ql::Expression::Pred( + "databaseMetadata", + vec![ + ql::Expression::String("isOverlay"), + ql::Expression::String("true"), + ], + ), + } +} + +pub fn create_get_node_file_predicate<'a>( + ast_node_name: &'a str, + node_location_table_name: &'a str, +) -> ql::Predicate<'a> { + ql::Predicate { + name: "getNodeFile", + qldoc: Some(String::from("Gets the file containing the given `node`.")), + overridden: false, + is_private: true, + is_final: false, + overlay: None, + return_type: Some(ql::Type::At("file")), + formal_parameters: vec![ql::FormalParameter { + name: "node", + param_type: ql::Type::At(ast_node_name), + }], + body: ql::Expression::Aggregate { + name: "exists", + vars: vec![ql::FormalParameter { + name: "loc", + param_type: ql::Type::At("location_default"), + }], + range: Some(Box::new(ql::Expression::Pred( + node_location_table_name, + vec![ql::Expression::Var("node"), ql::Expression::Var("loc")], + ))), + expr: Box::new(ql::Expression::Pred( + "locations_default", + vec![ + ql::Expression::Var("loc"), + ql::Expression::Var("result"), + ql::Expression::Var("_"), + ql::Expression::Var("_"), + ql::Expression::Var("_"), + ql::Expression::Var("_"), + ], + )), + second_expr: None, + }, + } +} + +pub fn create_discard_file_predicate<'a>() -> ql::Predicate<'a> { + ql::Predicate { + name: "discardFile", + qldoc: Some(String::from( + "Holds if `file` was extracted as part of the overlay database.", + )), + overridden: false, + is_private: true, + is_final: false, + overlay: None, + return_type: None, + formal_parameters: vec![ql::FormalParameter { + name: "file", + param_type: ql::Type::At("file"), + }], + body: ql::Expression::And(vec![ + ql::Expression::Pred("isOverlay", vec![]), + ql::Expression::Equals( + Box::new(ql::Expression::Var("file")), + Box::new(ql::Expression::Pred( + "getNodeFile", + vec![ql::Expression::Var("_")], + )), + ), + ]), + } +} + +pub fn create_discardable_ast_node_predicate<'a>(ast_node_name: &'a str) -> ql::Predicate<'a> { + ql::Predicate { + name: "discardableAstNode", + qldoc: Some(String::from( + "Holds if `node` is in the `file` and is part of the overlay base database.", + )), + overridden: false, + is_private: true, + is_final: false, + overlay: None, + return_type: None, + formal_parameters: vec![ + ql::FormalParameter { + name: "file", + param_type: ql::Type::At("file"), + }, + ql::FormalParameter { + name: "node", + param_type: ql::Type::At(ast_node_name), + }, + ], + body: ql::Expression::And(vec![ + ql::Expression::Negation(Box::new(ql::Expression::Pred("isOverlay", vec![]))), + ql::Expression::Equals( + Box::new(ql::Expression::Var("file")), + Box::new(ql::Expression::Pred( + "getNodeFile", + vec![ql::Expression::Var("node")], + )), + ), + ]), + } +} + +pub fn create_discard_ast_node_predicate<'a>(ast_node_name: &'a str) -> ql::Predicate<'a> { + ql::Predicate { + name: "discardAstNode", + qldoc: Some(String::from( + "Holds if `node` should be discarded, because it is part of the overlay base \ + and is in a file that was also extracted as part of the overlay database.", + )), + overridden: false, + is_private: true, + is_final: false, + overlay: Some(ql::OverlayAnnotation::DiscardEntity), + return_type: None, + formal_parameters: vec![ql::FormalParameter { + name: "node", + param_type: ql::Type::At(ast_node_name), + }], + body: ql::Expression::Aggregate { + name: "exists", + vars: vec![ql::FormalParameter { + name: "file", + param_type: ql::Type::At("file"), + }], + range: None, + expr: Box::new(ql::Expression::And(vec![ + ql::Expression::Pred( + "discardableAstNode", + vec![ql::Expression::Var("file"), ql::Expression::Var("node")], + ), + ql::Expression::Pred("discardFile", vec![ql::Expression::Var("file")]), + ])), + second_expr: None, + }, } } @@ -435,10 +614,12 @@ fn create_field_getters<'a>( qldoc: Some(qldoc), name: &field.getter_name, overridden: false, + is_private: false, is_final: true, return_type, formal_parameters, body, + overlay: None, }, optional_expr, ) @@ -548,10 +729,12 @@ pub fn convert_nodes(nodes: &node_types::NodeTypeMap) -> Vec { qldoc: Some(String::from("Gets a field or child node of this node.")), name: "getAFieldOrChild", overridden: true, + is_private: false, is_final: true, return_type: Some(ql::Type::Normal("AstNode")), formal_parameters: vec![], body: ql::Expression::Or(get_child_exprs), + overlay: None, }); classes.push(ql::TopLevel::Class(main_class)); diff --git a/shared/typeflow/codeql/typeflow/TypeFlow.qll b/shared/typeflow/codeql/typeflow/TypeFlow.qll index a2ae213ecb7f..52a911974091 100644 --- a/shared/typeflow/codeql/typeflow/TypeFlow.qll +++ b/shared/typeflow/codeql/typeflow/TypeFlow.qll @@ -7,6 +7,8 @@ * type has a subtype or if an inferred upper bound passed through at least one * explicit or implicit cast that lost type information. */ +overlay[local?] +module; private import codeql.util.Location diff --git a/shared/typeflow/codeql/typeflow/UniversalFlow.qll b/shared/typeflow/codeql/typeflow/UniversalFlow.qll index 75b210f8cebb..e5f07690a183 100644 --- a/shared/typeflow/codeql/typeflow/UniversalFlow.qll +++ b/shared/typeflow/codeql/typeflow/UniversalFlow.qll @@ -25,6 +25,8 @@ * that subsequently calculated properties hold under the assumption that the * value is not null. */ +overlay[local?] +module; private import codeql.util.Location private import codeql.util.Unit diff --git a/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll b/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll index f17b809ca32d..437e1ab31992 100644 --- a/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll +++ b/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import codeql.typeflow.TypeFlow private import codeql.typeflow.UniversalFlow as UniversalFlow private import codeql.util.Location diff --git a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll index f152d4a16422..8d84ffaf2b82 100644 --- a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll +++ b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll @@ -122,6 +122,8 @@ * } * ``` */ +overlay[local?] +module; private import codeql.util.Location @@ -849,6 +851,7 @@ module Make1 Input1> { ) } + overlay[caller] pragma[inline] predicate baseTypeMentionHasNonTypeParameterAt( Type sub, TypeMention baseMention, TypePath path, Type t @@ -856,6 +859,7 @@ module Make1 Input1> { not t = sub.getATypeParameter() and baseTypeMentionHasTypeAt(sub, baseMention, path, t) } + overlay[caller] pragma[inline] predicate baseTypeMentionHasTypeParameterAt( Type sub, TypeMention baseMention, TypePath path, TypeParameter tp diff --git a/shared/typetracking/codeql/typetracking/TypeTracking.qll b/shared/typetracking/codeql/typetracking/TypeTracking.qll index 7a411adb6333..da5b129241a7 100644 --- a/shared/typetracking/codeql/typetracking/TypeTracking.qll +++ b/shared/typetracking/codeql/typetracking/TypeTracking.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for simple data-flow reachability suitable * for tracking types. */ +overlay[local?] +module; private import codeql.util.Location diff --git a/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll b/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll index b942446d43ba..36dce0d081e4 100644 --- a/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll +++ b/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll @@ -3,6 +3,8 @@ * To use this, you must implement the `Input` signature. You can then use the predicates in the `Output` * signature to implement the predicates of the same names inside `TypeTrackerSpecific.qll`. */ +overlay[local?] +module; /** The classes and predicates needed to generate type-tracking steps from summaries. */ signature module Input { diff --git a/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll b/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll index b36edca04e7c..b74f803131fa 100644 --- a/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll +++ b/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for simple data-flow reachability suitable * for tracking types. */ +overlay[local?] +module; private import codeql.util.Boolean private import codeql.util.Option @@ -510,6 +512,7 @@ module TypeTracking I> { * } * ``` */ + overlay[caller] pragma[inline] TypeTracker smallstep(Node nodeFrom, Node nodeTo) { result = this.smallstepNoSimpleLocalFlowStep(nodeFrom, nodeTo) @@ -654,6 +657,7 @@ module TypeTracking I> { * } * ``` */ + overlay[caller] pragma[inline] TypeBackTracker smallstep(Node nodeFrom, Node nodeTo) { result = this.smallstepNoSimpleLocalFlowStep(nodeFrom, nodeTo) diff --git a/shared/typos/codeql/typos/TypoDatabase.qll b/shared/typos/codeql/typos/TypoDatabase.qll index a41f003a8c0c..7f1a8c2a3e73 100644 --- a/shared/typos/codeql/typos/TypoDatabase.qll +++ b/shared/typos/codeql/typos/TypoDatabase.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + /** * Holds if `wrong` is a common misspelling of `right`. * diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll index 97acd803f01e..1bc366c0416d 100644 --- a/shared/util/codeql/util/AlertFiltering.qll +++ b/shared/util/codeql/util/AlertFiltering.qll @@ -2,6 +2,8 @@ * Provides the `restrictAlertsTo` extensible predicate to restrict alerts to specific source * locations, and the `AlertFilteringImpl` parameterized module to apply the filtering. */ +overlay[local?] +module; private import codeql.util.Location diff --git a/shared/util/codeql/util/Boolean.qll b/shared/util/codeql/util/Boolean.qll index b58dc9a308f3..0f35421c408a 100644 --- a/shared/util/codeql/util/Boolean.qll +++ b/shared/util/codeql/util/Boolean.qll @@ -1,4 +1,6 @@ /** Provides the `Boolean` class. */ +overlay[local?] +module; /** * A utility class that is equivalent to `boolean`. diff --git a/shared/util/codeql/util/DenseRank.qll b/shared/util/codeql/util/DenseRank.qll index 0dccbbd48803..89ab865e9595 100644 --- a/shared/util/codeql/util/DenseRank.qll +++ b/shared/util/codeql/util/DenseRank.qll @@ -2,6 +2,8 @@ * Provides modules for computing dense `rank`s. See the `DenseRank` module * below for a more detailed explanation. */ +overlay[local?] +module; /** Provides the input to `DenseRank`. */ signature module DenseRankInputSig { diff --git a/shared/util/codeql/util/Either.qll b/shared/util/codeql/util/Either.qll index d514b9eaed58..a6796f99f38b 100644 --- a/shared/util/codeql/util/Either.qll +++ b/shared/util/codeql/util/Either.qll @@ -1,4 +1,6 @@ /** Provides a module for constructing a union `Either` type. */ +overlay[local?] +module; /** A type with `toString`. */ private signature class TypeWithToString { diff --git a/shared/util/codeql/util/FilePath.qll b/shared/util/codeql/util/FilePath.qll index 1b047f3c91ce..ff62ce6ee5e3 100644 --- a/shared/util/codeql/util/FilePath.qll +++ b/shared/util/codeql/util/FilePath.qll @@ -1,4 +1,6 @@ /** Provides a utility for normalizing filepaths. */ +overlay[local?] +module; /** * A filepath that should be normalized. diff --git a/shared/util/codeql/util/FileSystem.qll b/shared/util/codeql/util/FileSystem.qll index 2b120faaacea..fe724190f746 100644 --- a/shared/util/codeql/util/FileSystem.qll +++ b/shared/util/codeql/util/FileSystem.qll @@ -1,4 +1,6 @@ /** Provides classes for working with files and folders. */ +overlay[local?] +module; /** Provides the input specification of the files and folders implementation. */ signature module InputSig { diff --git a/shared/util/codeql/util/Location.qll b/shared/util/codeql/util/Location.qll index 8faa1ee4eeb9..c592f2c55564 100644 --- a/shared/util/codeql/util/Location.qll +++ b/shared/util/codeql/util/Location.qll @@ -1,4 +1,6 @@ /** Provides classes for working with locations. */ +overlay[local?] +module; /** * A location as given by a file, a start line, a start column, diff --git a/shared/util/codeql/util/Numbers.qll b/shared/util/codeql/util/Numbers.qll index 050f3c023f11..126307d41b4e 100644 --- a/shared/util/codeql/util/Numbers.qll +++ b/shared/util/codeql/util/Numbers.qll @@ -2,6 +2,8 @@ * Provides predicates for working with numeric values and their string * representations. */ +overlay[local?] +module; /** * Gets the integer value of `binary` when interpreted as binary. `binary` must diff --git a/shared/util/codeql/util/Option.qll b/shared/util/codeql/util/Option.qll index 8ba4d8e840bc..65a5e8724526 100644 --- a/shared/util/codeql/util/Option.qll +++ b/shared/util/codeql/util/Option.qll @@ -1,4 +1,6 @@ /** Provides a module for constructing optional versions of types. */ +overlay[local?] +module; /** A type with `toString`. */ private signature class TypeWithToString { diff --git a/shared/util/codeql/util/ReportStats.qll b/shared/util/codeql/util/ReportStats.qll index 03f381b5b9b3..947eff548e75 100644 --- a/shared/util/codeql/util/ReportStats.qll +++ b/shared/util/codeql/util/ReportStats.qll @@ -1,6 +1,7 @@ /** * Provides the `ReportStats` module for reporting database quality statistics. */ +overlay[local?] module; signature module StatsSig { diff --git a/shared/util/codeql/util/Strings.qll b/shared/util/codeql/util/Strings.qll index 6b8b6f2fb1d0..c82c23a9988b 100644 --- a/shared/util/codeql/util/Strings.qll +++ b/shared/util/codeql/util/Strings.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + private import Numbers /** diff --git a/shared/util/codeql/util/Unit.qll b/shared/util/codeql/util/Unit.qll index a0db9d7030f7..27e890788ff9 100644 --- a/shared/util/codeql/util/Unit.qll +++ b/shared/util/codeql/util/Unit.qll @@ -1,4 +1,6 @@ /** Provides the `Unit` class. */ +overlay[local?] +module; /** The unit type. */ private newtype TUnit = TMkUnit() diff --git a/shared/util/codeql/util/Void.qll b/shared/util/codeql/util/Void.qll index 886687b54602..28501cb9aca6 100644 --- a/shared/util/codeql/util/Void.qll +++ b/shared/util/codeql/util/Void.qll @@ -1,4 +1,6 @@ /** Provides the empty `Void` class. */ +overlay[local?] +module; /** The empty void type. */ private newtype TVoid = TMkVoid() { none() } diff --git a/shared/util/codeql/util/suppression/AlertSuppression.qll b/shared/util/codeql/util/suppression/AlertSuppression.qll index fad8d96566c0..722791148679 100644 --- a/shared/util/codeql/util/suppression/AlertSuppression.qll +++ b/shared/util/codeql/util/suppression/AlertSuppression.qll @@ -1,3 +1,6 @@ +overlay[local?] +module; + signature class AstNode { predicate hasLocationInfo( string filepath, int startline, int startcolumn, int endline, int endcolumn diff --git a/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll b/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll index 2ebd2b452828..4515bdabc79a 100644 --- a/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll +++ b/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll @@ -6,6 +6,7 @@ * VS Code, but prevents the "Location is outside of test directory" warning * when executed through `codeql test run`. */ +overlay[local?] module; external private predicate queryResults(string relation, int row, int column, string data); diff --git a/shared/xml/codeql/xml/Xml.qll b/shared/xml/codeql/xml/Xml.qll index 02d0ffc66fda..9620b156719e 100644 --- a/shared/xml/codeql/xml/Xml.qll +++ b/shared/xml/codeql/xml/Xml.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates for working with XML files and their content. */ +overlay[local?] +module; private import codeql.util.Location private import codeql.util.FileSystem diff --git a/shared/yaml/codeql/serverless/ServerLess.qll b/shared/yaml/codeql/serverless/ServerLess.qll index a0322ad47a12..009b50c7d1ca 100644 --- a/shared/yaml/codeql/serverless/ServerLess.qll +++ b/shared/yaml/codeql/serverless/ServerLess.qll @@ -2,6 +2,8 @@ * Provides classes and predicates for working with serverless handlers. * E.g. [AWS](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html) or [serverless](https://npmjs.com/package/serverless) */ +overlay[local?] +module; /** * Provides the input for the `ServerLess` module. diff --git a/shared/yaml/codeql/yaml/Yaml.qll b/shared/yaml/codeql/yaml/Yaml.qll index 1467fd09d137..153ff5979c8e 100644 --- a/shared/yaml/codeql/yaml/Yaml.qll +++ b/shared/yaml/codeql/yaml/Yaml.qll @@ -4,6 +4,8 @@ * YAML documents are represented as abstract syntax trees whose nodes * are either YAML values or alias nodes referring to another YAML value. */ +overlay[local?] +module; /** Provides the input specification of YAML implementation. */ signature module InputSig {