Skip to content

Commit

Permalink
add bool and match uniprop opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Mar 4, 2014
1 parent e79a521 commit f30b65f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 19 additions & 4 deletions docs/ops.markdown
Expand Up @@ -696,16 +696,31 @@ Looks up a property name in its property category, and returns which
table within that category to use.

## getuniprop_int
* `getuniprop_int(int $codepoint, int $propcode, int $pvalcode)`
* `getuniprop_int(int $codepoint, int $propcode)`

Uses the table found by the previous two opcodes to look up an integer property value
for a given codepoint.
Uses the table found by unipropcode to look up an integer property value
for a given codepoint. Note that many properties that are officially
numeric are really stored as strings, and if you try to use this op
on such a property, you'll get a meaningless position in an enum table
instead of the value you want.

## getuniprop_str
* `getuniprop_str(int $codepoint, int $propcode, int $pvalcode)`
* `getuniprop_str(int $codepoint, int $propcode)`

Same thing, but fetches a string property value.

## getuniprop_bool
* `getuniprop_bool(int $codepoint, int $propcode)`

Same thing, but fetches a boolean property value.

## matchuniprop
* `matchuniprop(int $codepoint, int $propcode, int $pvalcode)`

Looks up a codepoint property and return 1 if it matches the pval, 0 otherwise.
The propcode and pvalcode may be looked up with the opcodes above. (Note that
you can use the property value name (e.g. Nd) for both lookups.)

# Conditional Opcodes

## if
Expand Down
2 changes: 2 additions & 0 deletions src/vm/moar/QAST/QASTOperationsMAST.nqp
Expand Up @@ -1957,6 +1957,8 @@ QAST::MASTOperations.add_core_moarop_mapping('unipvalcode', 'unipvalcode');
QAST::MASTOperations.add_core_moarop_mapping('getuniname', 'getuniname');
QAST::MASTOperations.add_core_moarop_mapping('getuniprop_int', 'getuniprop_int');
QAST::MASTOperations.add_core_moarop_mapping('getuniprop_str', 'getuniprop_str');
QAST::MASTOperations.add_core_moarop_mapping('getuniprop_bool', 'getuniprop_bool');
QAST::MASTOperations.add_core_moarop_mapping('matchuniprop', 'matchuniprop');

# serialization context opcodes
QAST::MASTOperations.add_core_moarop_mapping('sha1', 'sha1');
Expand Down

0 comments on commit f30b65f

Please sign in to comment.