Skip to content
This repository has been archived by the owner on Jan 21, 2019. It is now read-only.

Commit

Permalink
Fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Xumeiquer committed Jul 16, 2017
1 parent d0b70a7 commit 32172b6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
test/
build/
dev/
build.sh
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM golang:latest

RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
&& rm -rf /var/lib/apt/lists/*


4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
appname := yago
BINARYNAME="YaGo"
VERSION=v0.1.2
VERSION=$(shell git describe)
TARGET=all
BUILD_TIME=$(shell date +%FT%T%z)
BUILD=$(shell git rev-parse HEAD)
Expand All @@ -23,7 +23,7 @@ zip = cd build && zip $(appname)_$(1)_$(2).zip $(appname)$(3) && rm $(appname)$(
all: windows darwin linux

clean:
rm -rf build/
rm -rf build/*

##### LINUX BUILDS #####
linux: build/linux_arm.tar.gz build/linux_arm64.tar.gz build/linux_386.tar.gz build/linux_amd64.tar.gz
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,3 @@ func main() {
# Contribute
If you would like to be part of the Yara comunity or Yara-Rules project you are free to contribute with us in any way. You can send issues or pull requests, by sharing Yara rules, etc.

# Changelog
Version: **0.1.3**
Initial release.

5 changes: 5 additions & 0 deletions godep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

go get
make clean
make
4 changes: 4 additions & 0 deletions lexic/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ func isSpace(r rune) bool {
return r == ' '
}

func isValidRegexpMod(r rune) bool {
return r == 'i' || r == 's'
}

// isEndOfLine reports whether r is an end-of-line character.
func isEndOfLine(r rune) bool {
return r == '\r' || r == '\n'
Expand Down
11 changes: 11 additions & 0 deletions lexic/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ func scanCommentOrRegex(l *Lexer) stateFn {
}
r = l.next()
}

mod := ""
r = l.next()
if !isValidRegexpMod(r) {
l.errorf("Line %d: illegal regex modifier", l.Line)
}
for isValidRegexpMod(r) {
mod += string(r)
r = l.next()
}
l.backup()
l.emit("ItemRegex")
return lexText
}
Expand Down

0 comments on commit 32172b6

Please sign in to comment.