diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-09-30 01:57:23 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-09-30 01:57:23 -0700 |
commit | 4e49b29e63b0d369b81318ac822dc06ce06786b5 (patch) | |
tree | d78b822660f33f40eea08c6747245fb729877073 /021check_type_by_instruction.cc | |
parent | a0d7a15594990974808cc613a4814d1f86471b5e (diff) | |
download | mu-4e49b29e63b0d369b81318ac822dc06ce06786b5.tar.gz |
2221
Diffstat (limited to '021check_type_by_instruction.cc')
-rw-r--r-- | 021check_type_by_instruction.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/021check_type_by_instruction.cc b/021check_type_by_instruction.cc index 0ac5a530..b5fb8197 100644 --- a/021check_type_by_instruction.cc +++ b/021check_type_by_instruction.cc @@ -104,5 +104,12 @@ bool is_mu_number(reagent r) { || r.properties.at(0).second.at(0) == "literal"; if (r.types.empty()) return false; if (r.types.at(0) == Type_ordinal["character"]) return true; // permit arithmetic on unicode code points - return !r.types.empty() && r.types.at(0) == Type_ordinal["number"]; + return r.types.at(0) == Type_ordinal["number"]; +} + +bool is_mu_scalar(reagent r) { + if (is_literal(r)) + return r.properties.at(0).second.at(0) != "literal-string"; + if (is_mu_array(r)) return false; + return size_of(r) == 1; } |