Grammalecte  Check-in [ce93fb99b0]

Overview
Comment:[core] gc engine: small code cleaning
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: ce93fb99b0e9ea5d4683d0c49a97f4fe09120fba24530e4cda6e7d4d7c1f2215
User & Date: olr on 2018-08-21 08:33:32
Other Links: branch diff | manifest | tags
Context
2018-08-22
17:45
[fr] conversion: regex rules -> graph rules check-in: c4dba9031f user: olr tags: fr, rg
2018-08-21
08:33
[core] gc engine: small code cleaning check-in: ce93fb99b0 user: olr tags: core, rg
02:57
[fr] qq éléments à purger check-in: 5598aeb3a0 user: olr tags: fr, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [6ed05b1551] to [9ae6223ae7].

709
710
711
712
713
714
715
716

717
718
719

720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
709
710
711
712
713
714
715

716
717
718

719
720
721
722
723
724
725
726





727
728
729
730
731
732
733







-
+


-
+







-
-
-
-
-







                        print("  MATCH: /" + sTag)
                    yield { "iNode1": iNode1, "dNode": dGraph[dNode["<tags>"][sTag]] }
                    bTokenFound = True
        # meta arc (for token type)
        if "<meta>" in dNode:
            for sMeta in dNode["<meta>"]:
                # no regex here, we just search if <dNode["sType"]> exists within <sMeta>
                if sMeta == "*":
                if sMeta == "*" or dToken["sType"] == sMeta:
                    if bDebug:
                        print("  MATCH: *" + sMeta)
                    yield { "iNode1": iNode1, "dNode": dGraph[dNode["<meta>"]["*"]] }
                    yield { "iNode1": iNode1, "dNode": dGraph[dNode["<meta>"][sMeta]] }
                    bTokenFound = True
                elif "¬" in sMeta:
                    if dToken["sType"] not in sMeta:
                        if bDebug:
                            print("  MATCH: *" + sMeta)
                        yield { "iNode1": iNode1, "dNode": dGraph[dNode["<meta>"][sMeta]] }
                        bTokenFound = True
                elif dToken["sType"] == sMeta:
                    if bDebug:
                        print("  MATCH: *" + sMeta)
                    yield { "iNode1": iNode1, "dNode": dGraph[dNode["<meta>"][sMeta]] }
                    bTokenFound = True
        if "bKeep" in dPointer and not bTokenFound:
            yield dPointer
        # JUMP
        # Warning! Recurssion!
        if "<>" in dNode:
            dPointer2 = { "iNode1": iNode1, "dNode": dGraph[dNode["<>"]], "bKeep": True }
            yield from self._getNextPointers(dToken, dGraph, dPointer2, bDebug)