Giter VIP home page Giter VIP logo

pypascaltokenizer's People

Contributors

alexey-t avatar artem3213212 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

khongten001

pypascaltokenizer's Issues

repo descript.

Tokenizer for Pascal syntax (Delphi/FreePascal) written in Python 3

_pop_

не принято одно подчерчивание в нач и конце.
два- да, в стандарт либе.
одно- только в начале.

strange code

    s=(0,'//')
    while is_comment(s[1]):
        return self.main

???

return в цикле??
индекс 1 или 0?

not all symbols here

CHAPTER 1. PASCAL TOKENS
+ -
*
/ = < > [ ] . , ( ) : ^ @ { } $ # & %
and the following character pairs too:
<< >>
**
<> >< <= >= := += -=
*= /= (* *) (. .) //

Когда думал что все вспомнил

is_comment

def is_comment(s):
    return (s[0]=='{' and s[-1]=='}') or (s[:2]=='(*' and s[-2:]=='*)') or s[:2]=='//'

если токен точно валидный- мможно упростить-

return s.startswith('{') or s.startswith('(*') or s.startswith('//')

Strange names

I0 i1– я так понял это y x , тогда надо так и назвать...

setpos(i0, i1)

забыл переименовать.
Имхо- красивее set_pos, get_pos, в 1м стиле

Parse error on some text

  //parse <Address>
  {
  //  <expression>
  //  [Rn]
  //  [Rn, offset] {!}
  //  [Rn,{+/-}Rm{,<shift>}]{!}
  }

This block of comment breaks it.

yeah, this never ends.

Method name

не нашёл в стд Библ методов

__is_readable__ __doreadable__ 

так что не надо давать такие имена системные, можно с одним подчерком если ты скрыть хочешь

bug

    s = (0,'//')
    while is_comment(s[1]):
        s = self.main.get_next()

судя по ридми, текст лежит не в [1] а в [0].

Copyright

Нужно шапку в начале
И файл Licensе

Напиши рус ридми, а я переведу, со списком что парсится

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.