💾 Archived View for gemlog.blue › users › jiaming › 1635626680.gmi captured on 2024-07-09 at 04:36:14. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

-=-=-=-=-=-=-

30/10/2021 (things i learned)

- using https://code.golf to run list all cpython keywords and builtins `import keyword; print(keyword.kwlist)`

- rst reStructured Text, tables, headers etc cuz cpython uses it lol

- uuish python changed their keyword generators

python3 -m pegen -vq c ../../Grammar/python.gram ../../Grammar/Tokens -o ../../Parser/parser.new.c
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/__main__.py", line 188, in <module>
    main()
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/__main__.py", line 132, in main
    grammar, parser, tokenizer, gen = args.func(args)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/__main__.py", line 28, in generate_c_code
    grammar, parser, tokenizer, gen = build_c_parser_and_generator(
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/build.py", line 218, in build_c_parser_and_generator
    gen = build_c_generator(
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/build.py", line 163, in build_c_generator
    gen.generate(grammar_file)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/c_generator.py", line 418, in generate
    self.collect_rules()
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/parser_generator.py", line 165, in collect_rules
    rule_collector.visit(self.all_rules[rulename])
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 31, in visit
    return visitor(node, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/parser_generator.py", line 51, in visit_Rule
    self.visit(rule.flatten())
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 31, in visit
    return visitor(node, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 38, in generic_visit
    self.visit(item, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 31, in visit
    return visitor(node, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 38, in generic_visit
    self.visit(item, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 31, in visit
    return visitor(node, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/parser_generator.py", line 54, in visit_NamedItem
    self.callmaker.visit(item)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 31, in visit
    return visitor(node, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/c_generator.py", line 212, in visit_NamedItem
    call = self.generate_call(node.item)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/c_generator.py", line 343, in generate_call
    return super().visit(node)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/grammar.py", line 31, in visit
    return visitor(node, *args, **kwargs)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/c_generator.py", line 181, in visit_StringLeaf
    return self.keyword_helper(val)
  File "/home/jiaming/Desktop/Linguistika/Jawi/JawiPython/Tools/peg_generator/pegen/c_generator.py", line 127, in keyword_helper
    arguments=["p", self.gen.keywords[keyword]],
KeyError: 'كمبالي'

lol definitely not the first one with the idea

- hmm, so now u have to update two regular expressions to get it working. btw this is the solution to the error message above But what's up with this RAISE_INDENTATION_ERROR from the grammar file?

- i seee, with improved error messages come more work hehe, but all good, i know how to overcome, just dont replace the keywords like `a='for'`

- lol i wonder what's triggering the CD player reader in my laptop

- OK Jawi for python 3.11.0a1+ works, EXCEPT FOR 'untuk'|'ونتوق'? what's the problem omw

- oof IDLE doesn't support RTL properly :/ such a shame

- i am very offended at how low they gave me for the vacation web app. what do they expect us to work full time to meet arbitrary "user friendly" requirements just for the app to be never used ever again?

https://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system

- hehe lucky i had experience and noticed that the length of keywords are important which allowed me to debug cpython parser not accepting certain keywords (CUZ THEY WERE TOO LONG) and that they calculate length in more than one line of code now, but all still in c_generator.py

- OHHHH They froze/freezed site.py `<module 'site' (frozen)>`, so have to `make` again to update ahhh, took at least 30 mins to resolve this xD

- OH MY WOWWW~ shared it with others already :3

- i seee, now i need to figure out how to do jawi normalization too... haih why my keyboard doesn't follow wikipedia... i wonder what's the history behind these character differences ك ڬ ݢ ک

- hehehe found a cpython buggg, helpful error messages arrow doesn't point correctly for RTL text, but wow this would be extremely difficult to fix imo, maybe it's my terminal display's fault too

- omg jawi programs look beautiful...

فوڠسي اداله_ڤردان(ن):
    جك ن < 2:
        كمبالي ڤلسو
    ونتوق ي دالم جولت(2 ,اينتيڬر(ن ** 0.5)+1):
        جك ن % ي == 0:
            كمبالي ڤلسو
    كمبالي بنر

- with syntax highlighting, pheww wow... the isprime function in python