Changes between Version 5 and Version 6 of j2p


Ignore:
Timestamp:
06/07/23 14:15:49 (18 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • j2p

    v5 v6  
    2626
    2727The second is currently very partial. The reason is that there are a huge number of java classes, and every field and function in it will need a specialized translator. This will grow slowly over time as needed.
     28
     29
     30== Usage
     31Comments can contain python code if the block starts with {@link #CODE_IN_COMMENT_TXT}. This code replaces the entire object (if/case/while block; statement) that follows the comment.
     32
     33Python has strict requirements regarding indentation. To make this possible, we need to be strict about indentation as well. In a single line python comment, the code must look exactly like
     34
     35{{{
     36 //#PY single_python_line
     37}}}
     38
     39  Note the single whitespace after the #PY. Your code starts after this single whitespace.
     40
     41 In a multi line comment the code must look exactly like
     42{{{
     43/*#PY
     44 * codeline1
     45 * codeline2
     46 * ...
     47 */
     48}}}
     49
     50Your code lines each start with "* ", note the whitespace after the star. You are free to indent before the "*".
     51
     52Your code is automatically indented to the level needed at the insertion
     53 place in the coed.
     54
     55Code MUST be placed in either a standard block comment or a single line
     56comment. Starting a javadoc with the {@link #CODE_IN_COMMENT_TXT} is not
     57allowed. This is to encourage proper use of javadoc.
     58 
     59  A comment block overrides also annotations.
     60
     61 If the code block contains no code at all, it is translated as
     62 {{{pass}}}, to ensure that the code is a proper statement.
     63
     64
     65
     66
     67
     68
     69== Resulting file