diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-22 12:08:10 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-22 12:08:10 -0700 |
commit | ada5eb55cb185edf30dcac48b25cc485d44677ef (patch) | |
tree | e147838f053a582e33146ac4fc4ab30ac8434e0e /011load.cc | |
parent | a6deb48067f8049922f16ed3489896f7749fd39f (diff) | |
download | mu-ada5eb55cb185edf30dcac48b25cc485d44677ef.tar.gz |
3552
Stop requiring jump instructions to explicitly provide a ':label' type for jump targets. This has been a source of repeated confusion for my students: a) They'd add the ':label' to the label definition rather than the jump target (label use) b) They'd spend time thinking about whether the initial '+' prefix was part of the label name. In the process I cleaned up a couple of things: - the space of names is more cleanly partitioned into labels and non-labels (clarifying that '_' and '-' are non-label prefixes) - you can't use label names as regular variables anymore - you can infer the type of a label just from its name
Diffstat (limited to '011load.cc')
-rw-r--r-- | 011load.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/011load.cc b/011load.cc index c129ba4b..5dd64335 100644 --- a/011load.cc +++ b/011load.cc @@ -178,7 +178,7 @@ string next_word(istream& in) { bool is_label_word(const string& word) { assert(!word.empty()); - return !isalnum(word.at(0)) && word.at(0) != '$'; + return !isalnum(word.at(0)) && string("$_-").find(word.at(0)) == string::npos; } bool ends_with(const string& s, const char c) { |