kopia lustrzana https://github.com/micropython/micropython
all: Add *FORMAT-OFF* in various places.
This string is recognised by uncrustify, to disable formatting in the region marked by these comments. This is necessary in the qstrdef*.h files to prevent modification of the strings within the Q(...). In other places it is used to prevent excessive reformatting that would make the code less readable.pull/5700/head
rodzic
b86075ef1f
commit
3f39d18c2b
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
// for machine module
|
// for machine module
|
||||||
Q(/)
|
Q(/)
|
||||||
// entries for sys.path
|
// entries for sys.path
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// qstrs specific to this port, only needed if they aren't auto-generated
|
// qstrs specific to this port, only needed if they aren't auto-generated
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
// Entries for sys.path
|
// Entries for sys.path
|
||||||
Q(/lib)
|
Q(/lib)
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
* names of these defines are likely to change.
|
* names of these defines are likely to change.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
#ifndef SPI_REGISTER_H_INCLUDED
|
#ifndef SPI_REGISTER_H_INCLUDED
|
||||||
#define SPI_REGISTER_H_INCLUDED
|
#define SPI_REGISTER_H_INCLUDED
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// qstrs specific to this port, only needed if they aren't auto-generated
|
// qstrs specific to this port, only needed if they aren't auto-generated
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
// Entries for sys.path
|
// Entries for sys.path
|
||||||
Q(/)
|
Q(/)
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
Q(a)
|
Q(a)
|
||||||
Q(a#)
|
Q(a#)
|
||||||
Q(a#:1)
|
Q(a#:1)
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
// Entries for sys.path
|
// Entries for sys.path
|
||||||
Q(/flash)
|
Q(/flash)
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
// qstrs specific to this port
|
// qstrs specific to this port
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
|
@ -23,3 +23,5 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
2
py/gc.c
2
py/gc.c
|
@ -473,10 +473,12 @@ void *gc_alloc(size_t n_bytes, unsigned int alloc_flags) {
|
||||||
n_free = 0;
|
n_free = 0;
|
||||||
for (i = MP_STATE_MEM(gc_last_free_atb_index); i < MP_STATE_MEM(gc_alloc_table_byte_len); i++) {
|
for (i = MP_STATE_MEM(gc_last_free_atb_index); i < MP_STATE_MEM(gc_alloc_table_byte_len); i++) {
|
||||||
byte a = MP_STATE_MEM(gc_alloc_table_start)[i];
|
byte a = MP_STATE_MEM(gc_alloc_table_start)[i];
|
||||||
|
// *FORMAT-OFF*
|
||||||
if (ATB_0_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 0; goto found; } } else { n_free = 0; }
|
if (ATB_0_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 0; goto found; } } else { n_free = 0; }
|
||||||
if (ATB_1_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 1; goto found; } } else { n_free = 0; }
|
if (ATB_1_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 1; goto found; } } else { n_free = 0; }
|
||||||
if (ATB_2_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 2; goto found; } } else { n_free = 0; }
|
if (ATB_2_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 2; goto found; } } else { n_free = 0; }
|
||||||
if (ATB_3_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 3; goto found; } } else { n_free = 0; }
|
if (ATB_3_IS_FREE(a)) { if (++n_free >= n_blocks) { i = i * BLOCKS_PER_ATB + 3; goto found; } } else { n_free = 0; }
|
||||||
|
// *FORMAT-ON*
|
||||||
}
|
}
|
||||||
|
|
||||||
GC_EXIT();
|
GC_EXIT();
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
// rules for writing rules:
|
// rules for writing rules:
|
||||||
// - zero_or_more is implemented using opt_rule around a one_or_more rule
|
// - zero_or_more is implemented using opt_rule around a one_or_more rule
|
||||||
// - don't put opt_rule in arguments of or rule; instead, wrap the call to this or rule in opt_rule
|
// - don't put opt_rule in arguments of or rule; instead, wrap the call to this or rule in opt_rule
|
||||||
|
|
4
py/nlr.h
4
py/nlr.h
|
@ -42,6 +42,8 @@
|
||||||
#define MICROPY_NLR_NUM_REGS_XTENSA (10)
|
#define MICROPY_NLR_NUM_REGS_XTENSA (10)
|
||||||
#define MICROPY_NLR_NUM_REGS_XTENSAWIN (17)
|
#define MICROPY_NLR_NUM_REGS_XTENSAWIN (17)
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
// If MICROPY_NLR_SETJMP is not enabled then auto-detect the machine arch
|
// If MICROPY_NLR_SETJMP is not enabled then auto-detect the machine arch
|
||||||
#if !MICROPY_NLR_SETJMP
|
#if !MICROPY_NLR_SETJMP
|
||||||
// A lot of nlr-related things need different treatment on Windows
|
// A lot of nlr-related things need different treatment on Windows
|
||||||
|
@ -83,6 +85,8 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// *FORMAT-ON*
|
||||||
|
|
||||||
#if MICROPY_NLR_SETJMP
|
#if MICROPY_NLR_SETJMP
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -224,6 +224,8 @@ const mp_obj_type_t mp_type_BaseException = {
|
||||||
.attr = mp_obj_exception_attr,
|
.attr = mp_obj_exception_attr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
// List of all exceptions, arranged as in the table at:
|
// List of all exceptions, arranged as in the table at:
|
||||||
// http://docs.python.org/3/library/exceptions.html
|
// http://docs.python.org/3/library/exceptions.html
|
||||||
MP_DEFINE_EXCEPTION(SystemExit, BaseException)
|
MP_DEFINE_EXCEPTION(SystemExit, BaseException)
|
||||||
|
@ -303,6 +305,8 @@ MP_DEFINE_EXCEPTION(Exception, BaseException)
|
||||||
MP_DEFINE_EXCEPTION(ResourceWarning, Warning)
|
MP_DEFINE_EXCEPTION(ResourceWarning, Warning)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// *FORMAT-ON*
|
||||||
|
|
||||||
mp_obj_t mp_obj_new_exception(const mp_obj_type_t *exc_type) {
|
mp_obj_t mp_obj_new_exception(const mp_obj_type_t *exc_type) {
|
||||||
assert(exc_type->make_new == mp_obj_exception_make_new);
|
assert(exc_type->make_new == mp_obj_exception_make_new);
|
||||||
return mp_obj_exception_make_new(exc_type, 0, 0, NULL);
|
return mp_obj_exception_make_new(exc_type, 0, 0, NULL);
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
#if MICROPY_PY_SYS_MAXSIZE
|
#if MICROPY_PY_SYS_MAXSIZE
|
||||||
// Export value for sys.maxsize
|
// Export value for sys.maxsize
|
||||||
|
// *FORMAT-OFF*
|
||||||
#define DIG_MASK ((MPZ_LONG_1 << MPZ_DIG_SIZE) - 1)
|
#define DIG_MASK ((MPZ_LONG_1 << MPZ_DIG_SIZE) - 1)
|
||||||
STATIC const mpz_dig_t maxsize_dig[] = {
|
STATIC const mpz_dig_t maxsize_dig[] = {
|
||||||
#define NUM_DIG 1
|
#define NUM_DIG 1
|
||||||
|
@ -64,6 +65,7 @@ STATIC const mpz_dig_t maxsize_dig[] = {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
// *FORMAT-ON*
|
||||||
const mp_obj_int_t mp_maxsize_obj = {
|
const mp_obj_int_t mp_maxsize_obj = {
|
||||||
{&mp_type_int},
|
{&mp_type_int},
|
||||||
{.fixed_dig = 1, .len = NUM_DIG, .alloc = NUM_DIG, .dig = (mpz_dig_t*)maxsize_dig}
|
{.fixed_dig = 1, .len = NUM_DIG, .alloc = NUM_DIG, .dig = (mpz_dig_t*)maxsize_dig}
|
||||||
|
|
|
@ -58,6 +58,8 @@
|
||||||
// (un)comment to use rule names; for debugging
|
// (un)comment to use rule names; for debugging
|
||||||
//#define USE_RULE_NAME (1)
|
//#define USE_RULE_NAME (1)
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
// define rules with a compile function
|
// define rules with a compile function
|
||||||
#define DEF_RULE(rule, comp, kind, ...) RULE_##rule,
|
#define DEF_RULE(rule, comp, kind, ...) RULE_##rule,
|
||||||
|
@ -207,6 +209,8 @@ STATIC const char *const rule_name_table[] = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// *FORMAT-ON*
|
||||||
|
|
||||||
typedef struct _rule_stack_t {
|
typedef struct _rule_stack_t {
|
||||||
size_t src_line : (8 * sizeof(size_t) - 8); // maximum bits storing source line number
|
size_t src_line : (8 * sizeof(size_t) - 8); // maximum bits storing source line number
|
||||||
size_t rule_id : 8; // this must be large enough to fit largest rule number
|
size_t rule_id : 8; // this must be large enough to fit largest rule number
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
#include "py/mpconfig.h"
|
#include "py/mpconfig.h"
|
||||||
|
|
||||||
// All the qstr definitions in this file are available as constants.
|
// All the qstr definitions in this file are available as constants.
|
||||||
|
|
2
py/vm.c
2
py/vm.c
|
@ -36,6 +36,8 @@
|
||||||
#include "py/bc.h"
|
#include "py/bc.h"
|
||||||
#include "py/profile.h"
|
#include "py/profile.h"
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define TRACE(ip) printf("sp=%d ", (int)(sp - &code_state->state[0] + 1)); mp_bytecode_print2(ip, 1, code_state->fun_bc->const_table);
|
#define TRACE(ip) printf("sp=%d ", (int)(sp - &code_state->state[0] + 1)); mp_bytecode_print2(ip, 1, code_state->fun_bc->const_table);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// *FORMAT-OFF*
|
||||||
|
|
||||||
#if __clang__
|
#if __clang__
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Winitializer-overrides"
|
#pragma clang diagnostic ignored "-Winitializer-overrides"
|
||||||
|
|
Ładowanie…
Reference in New Issue