Skip to content

Commit bacf0d9

Browse files
committed
Fixup
1 parent 4f8ab6b commit bacf0d9

2 files changed

Lines changed: 39 additions & 36 deletions

File tree

src/TL_filerefs.tl

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
// Root
2-
fileReferenceOrigins#8260b721 db_schema:string ctxs:Vector<Origin> = FileReferenceOrigins;;
2+
fileReferenceOrigins#8260b721 db_schema:string ctxs:Vector<Origin> = FileReferenceOrigins;
33

4-
origin#72cc7c04 flags:# predicate:string is_constructor:flags.0?true action:ActionOp needs_parent:flags.3?string parent_is_constructor:flags.4?true = origin;;
4+
origin#72cc7c04 flags:# predicate:string is_constructor:flags.0?true action:ActionOp needs_parent:flags.3?string parent_is_constructor:flags.4?true = origin;
55

66
// For string => TypedOp dictionaries
7-
typedOpArg#3a2930c2 key:string value:TypedOp = TypedOpArg;;
7+
typedOpArg#3a2930c2 key:string value:TypedOp = TypedOpArg;
88

99
// Actions
10-
callOp#59aef5ce method:string args:Vector<TypedOpArg> stored_constructor:string = ActionOp;;
11-
getMessageOp#4f27329e flags:# peer:TypedOp id:TypedOp from_scheduled:flags.0?TypedOp stored_constructor:string = ActionOp;;
12-
noOp#c4d8df73 why:string = ActionOp;;
10+
callOp#59aef5ce method:string args:Vector<TypedOpArg> stored_constructor:string = ActionOp;
11+
getMessageOp#4f27329e flags:# peer:TypedOp id:TypedOp from_scheduled:flags.0?TypedOp stored_constructor:string = ActionOp;
12+
noOp#c4d8df73 why:string = ActionOp;
1313

1414
// Field extraction path
15-
paramNotFlag#acd9d5cf = ParamFlag;;
16-
paramIsFlagAbortIfEmpty#f8fe9fee = ParamFlag;;
17-
paramIsFlagFallback#202b77a1 fallback:TypedOp = ParamFlag;;
18-
paramIsFlagPassthrough#1dc6e17d = ParamFlag;;
15+
paramNotFlag#acd9d5cf = ParamFlag;
16+
paramIsFlagAbortIfEmpty#f8fe9fee = ParamFlag;
17+
paramIsFlagFallback#202b77a1 fallback:TypedOp = ParamFlag;
18+
paramIsFlagPassthrough#1dc6e17d = ParamFlag;
1919

20-
pathPart#7b8b07d4 flags:# constructor:string param:string flag:ParamFlag = PathPart;;
20+
pathPart#7b8b07d4 flags:# constructor:string param:string flag:ParamFlag = PathPart;
2121

22-
path#0c3586a2 parts:Vector<PathPart> = Path;;
23-
pathParent#58f13684 parts:Vector<PathPart> = Path;;
22+
path#0c3586a2 parts:Vector<PathPart> = Path;
23+
pathParent#58f13684 parts:Vector<PathPart> = Path;
2424

2525
// Extractor+storer
26-
extractAndStore#72069549 from:Path to:string = FieldExtractor;;
26+
extractAndStore#72069549 from:Path to:string = FieldExtractor;
2727

28-
extractInputStickerSetFromDocumentAttributesAndStore#369d8d14 from:Path to:string = FieldExtractor;;
29-
extractInputStickerSetFromStickerSetAndStore#c167d470 from:Path to:string = FieldExtractor;;
28+
extractInputStickerSetFromDocumentAttributesAndStore#369d8d14 from:Path to:string = FieldExtractor;
29+
extractInputStickerSetFromStickerSetAndStore#c167d470 from:Path to:string = FieldExtractor;
3030

31-
extractPeerIdFromPeerAndStore#7d33019c from:Path to:string = FieldExtractor;;
32-
extractPeerIdFromInputPeerAndStore#a51acfb4 from:Path to:string = FieldExtractor;;
31+
extractPeerIdFromPeerAndStore#7d33019c from:Path to:string = FieldExtractor;
32+
extractPeerIdFromInputPeerAndStore#a51acfb4 from:Path to:string = FieldExtractor;
3333

34-
extractChannelIdFromChannelAndStore#5675bc97 from:Path to:string = FieldExtractor;;
35-
extractChannelIdFromInputChannelAndStore#b662660e from:Path to:string = FieldExtractor;;
34+
extractChannelIdFromChannelAndStore#5675bc97 from:Path to:string = FieldExtractor;
35+
extractChannelIdFromInputChannelAndStore#b662660e from:Path to:string = FieldExtractor;
3636

37-
extractUserIdFromUserAndStore#4778ec63 from:Path to:string = FieldExtractor;;
38-
extractUserIdFromInputUserAndStore#7720aa2e from:Path to:string = FieldExtractor;;
37+
extractUserIdFromUserAndStore#4778ec63 from:Path to:string = FieldExtractor;
38+
extractUserIdFromInputUserAndStore#7720aa2e from:Path to:string = FieldExtractor;
3939

4040
// Typed constructors, the type is specified to simplify codegen,
4141
// but isn't strictly necessary as it can be inferred from the TypedOpOp.
4242
// It is fully pre-validated during the generation of the definition file.
43-
typedOp#705b10ec type:string op:TypedOpOp = TypedOp;;
43+
typedOp#705b10ec type:string op:TypedOpOp = TypedOp;
4444

4545
// The actual ops
46-
copyOp#1630c9f5 from:FieldExtractor = TypedOpOp;;
46+
copyOp#1630c9f5 from:FieldExtractor = TypedOpOp;
4747

48-
getInputChannelByIdOp#3eb8d855 from:FieldExtractor = TypedOpOp;;
49-
getInputUserByIdOp#a3a4e6c2 from:FieldExtractor = TypedOpOp;;
50-
getInputPeerByIdOp#acfb2a4a from:FieldExtractor = TypedOpOp;;
48+
getInputChannelByIdOp#3eb8d855 from:FieldExtractor = TypedOpOp;
49+
getInputUserByIdOp#a3a4e6c2 from:FieldExtractor = TypedOpOp;
50+
getInputPeerByIdOp#acfb2a4a from:FieldExtractor = TypedOpOp;
5151

5252
// Literals & constructors (methods not allowed or needed here)
53-
constructorOp#107f8d8a constructor:string args:Vector<TypedOpArg> = TypedOpOp;;
53+
constructorOp#107f8d8a constructor:string args:Vector<TypedOpArg> = TypedOpOp;
5454

55-
vectorOp#f8fb8f72 values:Vector<TypedOp> = TypedOpOp;;
55+
vectorOp#f8fb8f72 values:Vector<TypedOp> = TypedOpOp;
5656

57-
intLiteralOp#cbfabe7c value:int = TypedOpOp;;
58-
longLiteralOp#d08b8d3a value:long = TypedOpOp;;
59-
stringLiteralOp#2b56ea8e value:string = TypedOpOp;;
60-
boolLiteralOp#37e07911 value:Bool = TypedOpOp;;
61-
doubleLiteralOp#3651e3bf value:double = TypedOpOp;;
62-
themeFormatLiteralOp#8e4f9208 = TypedOpOp;;
57+
intLiteralOp#cbfabe7c value:int = TypedOpOp;
58+
longLiteralOp#d08b8d3a value:long = TypedOpOp;
59+
stringLiteralOp#2b56ea8e value:string = TypedOpOp;
60+
boolLiteralOp#37e07911 value:Bool = TypedOpOp;
61+
doubleLiteralOp#3651e3bf value:double = TypedOpOp;
62+
themeFormatLiteralOp#8e4f9208 = TypedOpOp;

tools/FileRefExtractor/BuildMode/Ast.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ public function finalize(string $schemaFile, string $refMapFile, string $dbSchem
5959
{
6060
$schema = explode("\n", file_get_contents($schemaFile));
6161
foreach ($schema as &$line) {
62-
$line = trim($line);
62+
$line = rtrim(trim($line), ';');
6363
if (str_starts_with($line, '//') || !$line) {
6464
continue;
6565
}
66+
$line = explode(" ", $line, 2);
67+
$line[0] = preg_replace('/#.*/', '', $line[0]);
68+
$line = implode(" ", $line);
6669
$id = self::crc($line);
6770

6871
$line = explode(" ", $line, 2);

0 commit comments

Comments
 (0)