Functions for querying properties of strings, such as whether they are valid local variable names, constant names, or method names.
More...
#include "prism/compiler/exported.h"
#include "prism/compiler/nonnull.h"
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Functions for querying properties of strings, such as whether they are valid local variable names, constant names, or method names.
◆ pm_string_query_t
Represents the results of a slice query.
| Enumerator |
|---|
| PM_STRING_QUERY_ERROR | Returned if the encoding given to a slice query was invalid.
|
| PM_STRING_QUERY_FALSE | Returned if the result of the slice query is false.
|
| PM_STRING_QUERY_TRUE | Returned if the result of the slice query is true.
|
◆ pm_string_query_local()
| PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_local |
( |
const uint8_t * |
source, |
|
|
size_t |
length, |
|
|
const char * |
encoding_name |
|
) |
| |
Check that the slice is a valid local variable name.
- Parameters
-
| source | The source to check. |
| length | The length of the source. |
| encoding_name | The name of the encoding of the source. |
- Returns
- PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
◆ pm_string_query_constant()
| PRISM_EXPORTED_FUNCTION pm_string_query_t PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_constant |
( |
const uint8_t * |
source, |
|
|
size_t |
length, |
|
|
const char * |
encoding_name |
|
) |
| |
Check that the slice is a valid constant name.
- Parameters
-
| source | The source to check. |
| length | The length of the source. |
| encoding_name | The name of the encoding of the source. |
- Returns
- PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
◆ pm_string_query_method_name()
Check that the slice is a valid method name.
- Parameters
-
| source | The source to check. |
| length | The length of the source. |
| encoding_name | The name of the encoding of the source. |
- Returns
- PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.