-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle characters in the parser. #45
base: master
Are you sure you want to change the base?
Conversation
This means I can do things like 'a', 'b', 'c' Also fix my misunderstanding of js regexs. This didn't cause a bug because we match the entire line anyway.
|
||
var char_match = token.match(/^'(.)'$/); | ||
if (char_match) { | ||
binary_data.push(char_match[1].charCodeAt()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be
binary_data.push(char_match[1].charCodeAt(0));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently 0 is the default.
I think I'm going to re-write the parser anyway.
LGTM, aside from a comment |
Cool, I hit this stumbling block too. |
@@ -340,20 +340,26 @@ angular.module('rdmApp', []) | |||
var token = tokens[j]; | |||
var hex_suffix_match = token.match(/^([\da-fA-F]{1,2})h$/); | |||
if (hex_suffix_match) { | |||
binary_data.push(parseInt(hex_suffix_match[0], 16)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a comment at the top of this block reminding people of the broken way capture groups work in JS (it gets even messier if it's a global match with groups!
Only one comment from me. |
application: "olp-rdm-staging" | ||
#application: "rdmprotocol-hrd" | ||
#application: "olp-rdm-staging" | ||
application: "rdmprotocol-hrd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this
This means I can do things like
'a', 'b', 'c'
Also fix my misunderstanding of js regexs. This didn't cause a bug because we
match the entire line anyway.