summaryrefslogtreecommitdiffstatshomepage
path: root/py/makeqstrdata.py
Commit message (Collapse)AuthorAge
* py/makeqstrdata.py: Compute the qstr hash from bytes, not characters.Damien George2016-09-02
|
* py/makeqstrdata.py: Allow to have double-quote characters in qstrs.Damien George2016-05-23
| | | | | When rendering the qstr for a C header file, the double-quate character must be escaped.
* py/makeqstrdata: Add special case to handle \n qstr.Damien George2016-04-14
|
* py/makeqstrdata: Reinstate Python2 compatibility.Damien George2016-04-14
|
* py/makeqstrdata: Fix rendering of qstrs that have non-printable ASCII.Damien George2016-04-14
| | | | | The qstr data needs to be turned into a proper C string so non-ASCII chars must be properly escaped according to C rules.
* py/makeqstrdata: Add more names for escaped chars and esc non-printable.Damien George2016-04-13
| | | | | Non-printable characters are escaped as 0xXX, where XX are the hex digits of the character value.
* py/makeqstrdata: Factor out some code to functions that can be reused.Damien George2016-04-13
|
* py/makeqstrdata.py: Catch and report case of empty input file.Paul Sokolovsky2015-10-11
| | | | The usual cause would be that a cross-compiler for a port is not in PATH.
* stmhal: add option to query for the current usb modeTony Abboud2015-09-03
| | | | | | Fetch the current usb mode and return a string representation when pyb.usb_mode() is called with no args. The possible string values are interned as qstr's. None will be returned if an incorrect mode is set.
* makeqstrdata.py: Typo fix in comment.Paul Sokolovsky2015-07-31
|
* py: Make qstr hash size configurable, defaults to 2 bytes.Damien George2015-07-20
| | | | | | | This patch makes configurable, via MICROPY_QSTR_BYTES_IN_HASH, the number of bytes used for a qstr hash. It was originally fixed at 2 bytes, and now defaults to 2 bytes. Setting it to 1 byte will save ROM and RAM at a small expense of hash collisions.
* py: Get makeqstrdata.py and makeversionhdr.py running under Python 2.6.Damien George2015-05-30
| | | | | These scripts should run under as wide a range of Python versions as possible.
* makeqstrdata.py: Add support for strings with backslash escapes.Paul Sokolovsky2015-04-02
|
* py/makeqstrdata.py: Make it work again with both Python2 and Python3.Damien George2015-01-11
|
* py: Add MICROPY_QSTR_BYTES_IN_LEN config option, defaulting to 1.Damien George2015-01-11
| | | | | | | | | | | | | | | | | | This new config option sets how many fixed-number-of-bytes to use to store the length of each qstr. Previously this was hard coded to 2, but, as per issue #1056, this is considered overkill since no-one needs identifiers longer than 255 bytes. With this patch the number of bytes for the length is configurable, and defaults to 1 byte. The configuration option filters through to the makeqstrdata.py script. Code size savings going from 2 to 1 byte: - unix x64 down by 592 bytes - stmhal down by 1148 bytes - bare-arm down by 284 bytes Also has RAM savings, and will be slightly more efficient in execution.
* py: Add qstr cfg capability; generate QSTR_NULL and QSTR_ from script.Damien George2015-01-11
|
* py/makeqstrdata.py: Add more allowed qstr characters; escape quot.Damien George2015-01-11
|
* py: Use % str formatting instead of {} in makeqstrdata.py.Damien George2014-09-05
| | | | | Script is equivalent, but now also runs under ancient Python 2.6. Goes part way to addressing issue #847.
* Bring the C and Python compute_hash functions into consistencyChris Angelico2014-06-07
|
* More relaxed parsing of preprocessed qstr headerstijn2014-05-03
| | | | | | | | | The original parsing would error out on any C declarations that are not typedefs or extern variables. This limits what can go in mpconfig.h and mpconfigport.h, as they are included in qstr.h. For instance even a function declaration would be rejected and including system headers is a complete no-go. That seems too limiting for a global config header, so makeqstrdata now ignores everything that does not match a qstr definition.
* py: Add '*' qstr for 'import *'; use blank qstr for comprehension arg.Damien George2014-04-27
|
* py: Add builtin functions bin and oct, and some tests for them.Damien George2014-04-15
|
* py: Fix builtin hex to print prefix.Damien George2014-04-15
| | | | I was too hasty. Still a one-liner though.
* py: Add hex builtin function.Damien George2014-04-15
| | | | A one-liner, added especially for @pfalcon :)
* py: Clean up and add comments to makeqstrdata.Damien George2014-04-14
|
* py: Modify makeqstrdata to recognise better the output of CPP.Damien George2014-04-13
|
* objstr: Add str.encode() and bytes.decode() methods.Paul Sokolovsky2014-04-13
| | | | | These largely duplicate str() & bytes() constructors' functionality, but can be used to achieve Python2 compatibility.
* py: Preprocess qstrdefs.h before feeding to makeqstrdata.py.Paul Sokolovsky2014-04-12
| | | | | This is alternative implementation of supporting conditionals in qstrdefs.h, hard to say if it's much cleaner than munging #ifdef's in Python code...
* Revert "makeqstrdata.py: Add support for conditionally defined qstrs."Paul Sokolovsky2014-04-12
| | | | | | This reverts commit acb133d1b1a68847bd85c545312c3e221a6f7c0b. Conditionals will be suported using C preprocessor.
* makeqstrdata.py: Add support for conditionally defined qstrs.Paul Sokolovsky2014-04-10
| | | | Syntax is usual C #if*/#endif, but each qstr must be wrapped individually.
* py: Replace naive and teribble hash function with djb2.Damien George2014-03-25
|
* Fix makeqstrdata.py to work in Python 2.7Dave Hylands2014-03-10
|
* makeqstrdata: print error to stderr.Damien George2014-03-08
|
* stm: Initialize sys.path with ["0:/", "0:/src", "0:/lib"].Paul Sokolovsky2014-02-18
| | | | | This is compatible with what search path was before sys.path refactor, with addition of module library path ("0:/lib").
* Change mp_obj_type_t.name from const char * to qstr.Damien George2014-02-15
| | | | | | Ultimately all static strings should be qstr. This entry in the type structure is only used for printing error messages (to tell the type of the bad argument), and printing objects that don't supply a .print method.
* Retain file order of qstr definitions.Damien George2014-01-24
| | | | | Want common qstrs to be first in the list so they have the lowest ids, so that in the byte code they take up the least room.
* Allow qstr's with non-ident chars, construct good identifier for them.Paul Sokolovsky2014-01-24
| | | | | Also, add qstr's for string appearing in unix REPL loop, gross effect being less allocations for each command run.
* Fix malformed generated file when using python 2.7Dave Hylands2014-01-21
|
* Revamp qstrs: they now include length and hash.Damien George2014-01-21
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h