summaryrefslogtreecommitdiffstats
path: root/llparse/src/implementation/c/code/and.ts
diff options
context:
space:
mode:
Diffstat (limited to 'llparse/src/implementation/c/code/and.ts')
-rw-r--r--llparse/src/implementation/c/code/and.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/llparse/src/implementation/c/code/and.ts b/llparse/src/implementation/c/code/and.ts
new file mode 100644
index 0000000..fdd5434
--- /dev/null
+++ b/llparse/src/implementation/c/code/and.ts
@@ -0,0 +1,11 @@
+import * as frontend from 'llparse-frontend';
+
+import { Compilation } from '../compilation';
+import { Field } from './field';
+
+export class And extends Field<frontend.code.And> {
+ protected doBuild(ctx: Compilation, out: string[]): void {
+ out.push(`${this.field(ctx)} &= ${this.ref.value};`);
+ out.push('return 0;');
+ }
+}