diff options
author | Eduardo Julian | 2016-12-25 19:51:08 -0400 |
---|---|---|
committer | Eduardo Julian | 2016-12-25 19:51:08 -0400 |
commit | 2eeb6682e3db5aaba550ebc58a6e1322430c5b17 (patch) | |
tree | f68779e2450ef3451e7627a47a7c39a248e297c5 | |
parent | 364a08a67925c42e987ffaf6a3471680b7b82d10 (diff) |
- Now, only using underscores (_) as number digit separators, without using commas (,).
Diffstat (limited to '')
-rw-r--r-- | lux-mode/lux-mode.el | 6 | ||||
-rw-r--r-- | luxc/src/lux/compiler/host.clj | 2 | ||||
-rw-r--r-- | luxc/src/lux/lexer.clj | 10 | ||||
-rw-r--r-- | stdlib/source/lux/data/number.lux | 3 |
4 files changed, 10 insertions, 11 deletions
diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index 0dcb1247d..5713cfb5d 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -245,11 +245,11 @@ Called by `imenu--generic-function'." ; Char literals - #"1", #"a", #"\n", #"\u0000" ("#\".+\"" 0 font-lock-constant-face) ; Nat literals - ("\\<\\+\\(0\\|[1-9][0-9,_]*\\)\\>" 0 font-lock-constant-face) + ("\\<\\+\\(0\\|[1-9][0-9_]*\\)\\>" 0 font-lock-constant-face) ; Int|Real literals - ("\\<-?\\(0\\|[1-9][0-9,_]*\\)\\(\\.[0-9,_]+\\)?\\>" 0 font-lock-constant-face) + ("\\<-?\\(0\\|[1-9][0-9_]*\\)\\(\\.[0-9_]+\\)?\\>" 0 font-lock-constant-face) ; Frac literals - ("\\<\\(\\.[0-9,_]+\\)\\>" 0 font-lock-constant-face) + ("\\<\\(\\.[0-9_]+\\)\\>" 0 font-lock-constant-face) ; Tags ("#;[a-zA-Z0-9-\\+_=!@\\$%\\^&\\*<>\.,/\\\\\\|':~\\?]+" 0 font-lock-type-face) ("#;;[a-zA-Z0-9-\\+_=!@\\$%\\^&\\*<>\.,/\\\\\\|':~\\?]+" 0 font-lock-type-face) diff --git a/luxc/src/lux/compiler/host.clj b/luxc/src/lux/compiler/host.clj index ceaa35755..4c2ff9d24 100644 --- a/luxc/src/lux/compiler/host.clj +++ b/luxc/src/lux/compiler/host.clj @@ -1722,7 +1722,7 @@ _ (doto (.visitMethod =class (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STATIC) "clean_separators" "(Ljava/lang/String;)Ljava/lang/String;" nil nil) (.visitCode) (.visitVarInsn Opcodes/ALOAD 0) - (.visitLdcInsn ",|_") + (.visitLdcInsn "_") (.visitLdcInsn "") (.visitMethodInsn Opcodes/INVOKEVIRTUAL "java/lang/String" "replaceAll" "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;") (.visitInsn Opcodes/ARETURN) diff --git a/luxc/src/lux/lexer.clj b/luxc/src/lux/lexer.clj index f519aa563..819c130f0 100644 --- a/luxc/src/lux/lexer.clj +++ b/luxc/src/lux/lexer.clj @@ -164,12 +164,12 @@ (do-template [<name> <tag> <regex>] (def <name> (|do [[meta _ token] (&reader/read-regex <regex>)] - (return (&/T [meta (<tag> (string/replace token #",|_" ""))])))) + (return (&/T [meta (<tag> (string/replace token #"_" ""))])))) - lex-nat $Nat #"^\+(0|[1-9][0-9,_]*)" - lex-int $Int #"^-?(0|[1-9][0-9,_]*)" - lex-frac $Frac #"^(\.[0-9,_]+)" - lex-real $Real #"^-?(0\.[0-9,_]+|[1-9][0-9,_]*\.[0-9,_]+)(e-?[1-9][0-9,_]*)?" + lex-nat $Nat #"^\+(0|[1-9][0-9_]*)" + lex-int $Int #"^-?(0|[1-9][0-9_]*)" + lex-frac $Frac #"^(\.[0-9_]+)" + lex-real $Real #"^-?(0\.[0-9_]+|[1-9][0-9_]*\.[0-9_]+)(e-?[1-9][0-9_]*)?" ) (def lex-char diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux index 7d33da387..1a104071f 100644 --- a/stdlib/source/lux/data/number.lux +++ b/stdlib/source/lux/data/number.lux @@ -158,8 +158,7 @@ (def: clean-number (-> Text Text) - (|>. (text.replace "," "") - (text.replace "_" ""))) + (text.replace "_" "")) (do-template [<type> <encode> <decode> <error>] [(struct: #export _ (Codec Text <type>) |