From 2eeb6682e3db5aaba550ebc58a6e1322430c5b17 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 25 Dec 2016 19:51:08 -0400 Subject: - Now, only using underscores (_) as number digit separators, without using commas (,). --- luxc/src/lux/compiler/host.clj | 2 +- luxc/src/lux/lexer.clj | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'luxc') 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 [ ] (def (|do [[meta _ token] (&reader/read-regex )] - (return (&/T [meta ( (string/replace token #",|_" ""))])))) + (return (&/T [meta ( (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 -- cgit v1.2.3