Skip to content

Commit 33cd8d2

Browse files
committed
unified: Add a basic facade AST
1 parent 0c196de commit 33cd8d2

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Provides facade AST classes, with additional hand-written members on top of the generated ones.
3+
*/
4+
overlay[local?]
5+
module;
6+
7+
module Unified {
8+
private import Ast::Unified as G
9+
import G
10+
11+
class AstNode extends G::AstNode {
12+
/** Holds if this AST node has a modifier with the given text. */
13+
predicate hasModifier(string text) {
14+
exists(Modifier mod |
15+
mod.getParent() = this and
16+
mod.getValue() = text
17+
)
18+
}
19+
}
20+
}

unified/ql/lib/unified.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
import codeql.Locations
66
import codeql.files.FileSystem
7-
import codeql.unified.Ast::Unified
7+
import codeql.unified.internal.FacadeAst::Unified
88
import codeql.unified.internal.AstExtra::Public
99
import codeql.unified.internal.Variables::Public

0 commit comments

Comments
 (0)