Skip to content

Added features #4

Merged
merged 2 commits into from Apr 6, 2012

2 participants

@hyqneuron
  1. The ?!: ternary conditional operator supported
  2. The ! logical not operator supported
  3. New preprocessor directive %definex. This allows convenient concatenation of pp variables to form new variable, eg:
    %define p1 aa
    %define p2 bb
    %define p3 cc
    %definex p1 %+ p2 %+ p3 value; defines aabbcc to value
    To achieve the above, the entire part after %definex is fully expanded using expand_smacro()

  4. preprocessor if directives can now be joined on the same line using {%if_dir} as an expression that evaluates to either one or zero:
    %if 1 && {%ifdef undefined_var} ; this will give 1 && 0 = 0
    %if {%ifstr abc} || {%if {%ifnstr abc} && 1}; {%if_dir} can be nested in a {%if }expression

noid and others added some commits Apr 3, 2012
noid Adding support for the {%if_dir } structure in preprocessor expression 842f269
@hyqneuron hyqneuron Adding support for ?!:, the ternary conditional operator. Works like ?:
but !? is chosen instead of ? so as not to confuse nasm(? is recognised
as a proper part of an nasm identifier). Also added the %definex
directive, the content following which is fully expanded using
expand_smacro, so that concatenation of PP variables to produce new
variable names will be easier.
E.g.
%define p1 aaa
%define p2 bbb
%define p3 ccc
%definex p1 %+ p2 %+ p3 value; defines aaabbbccc to value
143f9b9
@cbergstrom cbergstrom merged commit 6ba25af into path64:master Apr 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.